annotate TaskManager/Test/test_render/spe/Set_Texture.cpp @ 266:5c9dbd54cd51

merge
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 04 Jun 2009 00:00:09 +0900
parents a52e193f9a42
children 2ddf79a7c5fb 81b25e5d5379
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #include <string.h>
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #include "Set_Texture.h"
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3 #include "texture.h"
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
4
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
5 SchedDefineTask(SetTexture);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
6
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
7 //texture をglobal 領域にコピーするタスク
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8 int
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9 SetTexture::run(void *rbuf, void *wbuf)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10 {
120
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
11 void *src[4];
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13 src[0] = get_input(rbuf, 0);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14 src[1] = get_input(rbuf, 1);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15 src[2] = get_input(rbuf, 2);
120
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
16 src[3] = get_input(rbuf, 3);
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17
120
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
18 if (global_get(TEXTURE_ID)) {
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
19 return 0;
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
20 } else {
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
21 //タスクが共有できる領域確保
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
22 void *data = global_alloc(TEXTURE_ID, MAX_LOAD_SIZE*4);
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
23
120
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
24 memcpy(data, src[0], MAX_LOAD_SIZE);
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
25 memcpy((void*)((int)data + MAX_LOAD_SIZE), src[1], MAX_LOAD_SIZE);
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
26 memcpy((void*)((int)data + MAX_LOAD_SIZE*2), src[2], MAX_LOAD_SIZE);
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
27 memcpy((void*)((int)data + MAX_LOAD_SIZE*3), src[3], MAX_LOAD_SIZE);
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
28 }
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
29
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
30 return 0;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
31 }