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