annotate TaskManager/Test/test_render/task/Load_Texture.cpp @ 130:40978d4b608a draft

テクスチャの大きさを128x128以外にも使えるように。(若干バグ有り)
author gongo@gendarme.cr.ie.u-ryukyu.ac.jp
date Tue, 25 Nov 2008 17:19:43 +0900
parents 13b43de5ef5d
children 7bc603ec6111
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #include <stdlib.h>
120
13b43de5ef5d fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
2 #include <string.h>
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3 #include "Load_Texture.h"
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
4 #include "texture.h"
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
5 #include "Func.h"
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
6
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
7 /**
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8 * 決めうちじゃなくて、
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9 * create_task の時に param で渡せばおk
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10 */
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
11 #define height 128
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12 #define width 128
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14 // byteperpixel = 3 width = 128 dma_height= 32
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15 #define LOAD_SIZE 3*128*32
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
16 #define MAX_LOAD_SIZE 16384
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17 #define USE_ARRAY 3
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
18
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
19 SchedDefineTask(LoadTexture);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
21 int
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
22 LoadTexture::run(void *rbuf , void *wbuf)
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
23 {
130
40978d4b608a テクスチャの大きさを128x128以外にも使えるように。(若干バグ有り)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 120
diff changeset
24 int addrNum = smanager->get_param(0);
40978d4b608a テクスチャの大きさを128x128以外にも使えるように。(若干バグ有り)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 120
diff changeset
25 int addrSize = addrNum*sizeof(void*);
40978d4b608a テクスチャの大きさを128x128以外にも使えるように。(若干バグ有り)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 120
diff changeset
26 void **list = (void**)global_alloc(TEXTURE2_ID, addrSize);
120
13b43de5ef5d fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
27
13b43de5ef5d fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
28 void **addrList = (void**)smanager->get_input(0);
130
40978d4b608a テクスチャの大きさを128x128以外にも使えるように。(若干バグ有り)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 120
diff changeset
29 memcpy(list, addrList, addrSize);
120
13b43de5ef5d fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
30
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
31 return 0;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
32 }