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 {
|
|
11 void *src[3];
|
|
12
|
|
13 src[0] = get_input(rbuf, 0);
|
|
14 src[1] = get_input(rbuf, 1);
|
|
15 src[2] = get_input(rbuf, 2);
|
|
16
|
|
17 if (global_get(TEXTURE_ID)) {
|
|
18 return 0;
|
|
19 } else {
|
|
20 //タスクが共有できる領域確保
|
|
21 void *data = global_alloc(TEXTURE_ID, MAX_LOAD_SIZE*3);
|
|
22
|
|
23 memcpy(data, src[0], MAX_LOAD_SIZE);
|
|
24 memcpy((void*)((int)data + MAX_LOAD_SIZE), src[1], MAX_LOAD_SIZE);
|
|
25 memcpy((void*)((int)data + MAX_LOAD_SIZE*2), src[2], MAX_LOAD_SIZE);
|
|
26 }
|
|
27
|
|
28 return 0;
|
|
29 }
|