comparison Renderer/Engine/task/Set_Texture.cc @ 539:3bc98f6d31ff draft

Reorganization..
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 12 Oct 2009 09:39:35 +0900
parents
children 92b0d490e839
comparison
equal deleted inserted replaced
538:5641d121818e 539:3bc98f6d31ff
1 #include <string.h>
2 #include "Set_Texture.h"
3 #include "texture.h"
4 #include "global_alloc.h"
5
6 SchedDefineTask(SetTexture);
7
8 //texture をglobal 領域にコピーするタスク
9 static int
10 run(SchedTask *s,void *rbuf, void *wbuf)
11 {
12 void *src[4];
13
14 src[0] = s->get_input(rbuf, 0);
15 src[1] = s->get_input(rbuf, 1);
16 src[2] = s->get_input(rbuf, 2);
17 src[3] = s->get_input(rbuf, 3);
18
19 if (s->global_get(TEXTURE_ID)) {
20 return 0;
21 } else {
22 //タスクが共有できる領域確保
23 void *data = s->global_alloc(TEXTURE_ID, MAX_LOAD_SIZE*4);
24
25 memcpy(data, src[0], MAX_LOAD_SIZE);
26 memcpy((void*)((int)data + MAX_LOAD_SIZE), src[1], MAX_LOAD_SIZE);
27 memcpy((void*)((int)data + MAX_LOAD_SIZE*2), src[2], MAX_LOAD_SIZE);
28 memcpy((void*)((int)data + MAX_LOAD_SIZE*3), src[3], MAX_LOAD_SIZE);
29 }
30
31 return 0;
32 }