Mercurial > hg > Game > Cerium
annotate Renderer/Engine/spe/DataAllocate.cc @ 986:b3a8545eb2fa draft akira
double buffering of spanpack/polgonpack
not yet worked.
author | root@henri.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Fri, 01 Oct 2010 03:42:25 +0900 |
parents | aa9728394194 |
children | da1cec21f0c9 |
rev | line source |
---|---|
749 | 1 #include <stdio.h> |
2 #include <string.h> | |
915
aa9728394194
create_polygon_task ..not worked yet.
yutaka@localhost.localdomain
parents:
823
diff
changeset
|
3 #include "DataAllocate.h" |
749 | 4 #include "Func.h" |
5 | |
6 /* これは必須 */ | |
915
aa9728394194
create_polygon_task ..not worked yet.
yutaka@localhost.localdomain
parents:
823
diff
changeset
|
7 SchedDefineTask(DataAllocate); |
749 | 8 |
9 static int | |
10 run(SchedTask *s, void *rbuf, void *wbuf) | |
11 { | |
12 | |
986
b3a8545eb2fa
double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents:
915
diff
changeset
|
13 int count = (int)s->get_input(rbuf, 0); |
b3a8545eb2fa
double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents:
915
diff
changeset
|
14 for(int i=0;i<count;i++) { |
b3a8545eb2fa
double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents:
915
diff
changeset
|
15 void *idata = s->get_input(rbuf, i); |
b3a8545eb2fa
double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents:
915
diff
changeset
|
16 long size = (long)s->get_param(i*2+1); |
b3a8545eb2fa
double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents:
915
diff
changeset
|
17 long load_id = (long)s->get_param(i*2+2); |
749 | 18 |
986
b3a8545eb2fa
double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents:
915
diff
changeset
|
19 void *buff = s->global_alloc(load_id, size); |
b3a8545eb2fa
double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents:
915
diff
changeset
|
20 if (idata != NULL) { |
b3a8545eb2fa
double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents:
915
diff
changeset
|
21 memcpy(buff,idata,size); |
b3a8545eb2fa
double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents:
915
diff
changeset
|
22 } |
915
aa9728394194
create_polygon_task ..not worked yet.
yutaka@localhost.localdomain
parents:
823
diff
changeset
|
23 } |
749 | 24 |
25 return 0; | |
26 } | |
27 |