109
|
1 #include <string.h>
|
|
2 #include "Set_Texture.h"
|
|
3 #include "texture.h"
|
|
4
|
|
5 SchedDefineTask(SetTexture);
|
|
6
|
|
7 //texture をglobal 領域にコピーするタスク
|
|
8 int
|
|
9 SetTexture::run(void *rbuf, void *wbuf)
|
|
10 {
|
120
|
11 void *src[4];
|
109
|
12
|
|
13 src[0] = get_input(rbuf, 0);
|
|
14 src[1] = get_input(rbuf, 1);
|
|
15 src[2] = get_input(rbuf, 2);
|
120
|
16 src[3] = get_input(rbuf, 3);
|
109
|
17
|
120
|
18 if (global_get(TEXTURE_ID)) {
|
|
19 return 0;
|
|
20 } else {
|
|
21 //タスクが共有できる領域確保
|
|
22 void *data = global_alloc(TEXTURE_ID, MAX_LOAD_SIZE*4);
|
109
|
23
|
120
|
24 memcpy(data, src[0], MAX_LOAD_SIZE);
|
|
25 memcpy((void*)((int)data + MAX_LOAD_SIZE), src[1], MAX_LOAD_SIZE);
|
|
26 memcpy((void*)((int)data + MAX_LOAD_SIZE*2), src[2], MAX_LOAD_SIZE);
|
|
27 memcpy((void*)((int)data + MAX_LOAD_SIZE*3), src[3], MAX_LOAD_SIZE);
|
|
28 }
|
109
|
29
|
|
30 return 0;
|
|
31 }
|