annotate TaskManager/Test/test_render/viewer.cpp @ 269:abf96b4caee5 draft

merge
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 04 Jun 2009 00:01:11 +0900
parents e9735a64cd90 2b7d631695ca
children 237a75ab7a9b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
140
67a5469dfef2 add Controller
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 138
diff changeset
1 #include <SDL.h>
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #include "viewer.h"
120
13b43de5ef5d fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
3 #include "viewer_types.h"
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
4 #include "SceneGraph.h"
195
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 194
diff changeset
5 #include "SceneGraphRoot.h"
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
6 #include "scene_graph_pack.h"
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
7 #include "sys.h"
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8 #include "Func.h"
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9 #include "error.h"
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10 #include "TaskManager.h"
212
gongo@localhost.localdomain
parents: 210
diff changeset
11 #include <wchar.h>
221
0b0e0f323742 Cameraの設定、Makefile 修正
gongo@gendarme.local
parents: 219
diff changeset
12 #include "Pad.h"
212
gongo@localhost.localdomain
parents: 210
diff changeset
13
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15 extern void post2runLoop(void *);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
16 extern void post2runDraw(void *);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
18 /* measure for FPS (Frame Per Second) */
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
19 int start_time;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20 int this_time;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
21 int frames;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
22
198
b832e6cff83e rename snake_bg to panel
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 195
diff changeset
23 SceneGraphRootPtr sgroot;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
24
176
gongo@localhost.localdomain
parents: 170
diff changeset
25 /* Data Pack sent to Other CPUs (ex. SPE) */
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
26 SceneGraphPack *sgpack;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
27 PolygonPack *ppack;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
28 SpanPackPtr spackList;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
29 SpanPackPtr *spackList_ptr;
210
e75f9eb97180 fix DrawSpan
gongo@localhost.localdomain
parents: 205
diff changeset
30
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
31 int spackList_length;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
32 int spackList_length_align;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
33
140
67a5469dfef2 add Controller
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 138
diff changeset
34 /**
176
gongo@localhost.localdomain
parents: 170
diff changeset
35 *
gongo@localhost.localdomain
parents: 170
diff changeset
36 */
gongo@localhost.localdomain
parents: 170
diff changeset
37
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
38 Viewer::Viewer(int b, int w, int h, int _num)
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
39 {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
40 bpp = b;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
41 width = w;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
42 height = h;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
43 spe_num = _num;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
44 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
45
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
46 int
229
e6eb4f8d6b0e add Random class
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
47 Viewer::get_ticks(void)
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
48 {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
49 int time;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
50 time = SDL_GetTicks();
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
51 return time;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
52 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
53
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
54 bool
229
e6eb4f8d6b0e add Random class
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
55 Viewer::quit_check(void)
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
56 {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
57 SDL_Event event;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
58
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
59 while(SDL_PollEvent(&event)) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
60 if (event.type==SDL_QUIT) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
61 return true;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
62 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
63 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
64
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
65 Uint8 *keys=SDL_GetKeyState(NULL);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
66
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
67 if (keys[SDLK_q] == SDL_PRESSED) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
68 return true;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
69 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
70
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
71 return false;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
72 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
73
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
74 void
229
e6eb4f8d6b0e add Random class
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
75 Viewer::quit(void)
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
76 {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
77 SDL_Quit();
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
78 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
79
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
80 void
229
e6eb4f8d6b0e add Random class
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 222
diff changeset
81 Viewer::swap_buffers(void)
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
82 {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
83 SDL_GL_SwapBuffers();
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
84 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
85
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
86 extern void node_init(void);
144
gongo@localhost.localdomain
parents: 143
diff changeset
87 extern void create_cube_split(int);
198
b832e6cff83e rename snake_bg to panel
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 195
diff changeset
88 extern void panel_init(int);
158
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 157
diff changeset
89 extern void universe_init(void);
199
1fd0107ebb25 add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 198
diff changeset
90 extern void ieshoot_init(void);
210
e75f9eb97180 fix DrawSpan
gongo@localhost.localdomain
parents: 205
diff changeset
91 extern void ball_bound_init(int, int);
212
gongo@localhost.localdomain
parents: 210
diff changeset
92 extern void lcube_init(int, int);
gongo@localhost.localdomain
parents: 210
diff changeset
93 extern void direction_init(void);
213
8ac35507094d add SceneGraph "3D Super-Dandy"
gongo@localhost.localdomain
parents: 212
diff changeset
94 extern void init_position(int, int);
222
gongo@localhost.localdomain
parents: 221
diff changeset
95 extern void vacuum_init(int w, int h);
231
5ae15a5d3dc5 test program add (-sg 12)
tkaito@nw0534.st.ie.u-ryukyu.ac.jp
parents: 229
diff changeset
96 extern void untitled_init(void);
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
97 void
180
e3b7776b1420 いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents: 177
diff changeset
98 Viewer::run_init(const char *xml, int sg_number)
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
99 {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
100 HTaskPtr task_next;
167
508beb59e0eb DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents: 158
diff changeset
101 HTaskPtr task_tex;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
102
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
103 start_time = get_ticks();
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
104 this_time = 0;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
105 frames = 0;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
106
221
0b0e0f323742 Cameraの設定、Makefile 修正
gongo@gendarme.local
parents: 219
diff changeset
107 sgroot = new SceneGraphRoot(this->width, this->height);
195
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 194
diff changeset
108 //sgroot->createFromXMLFile(xml);
140
67a5469dfef2 add Controller
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 138
diff changeset
109
144
gongo@localhost.localdomain
parents: 143
diff changeset
110 switch (sg_number) {
gongo@localhost.localdomain
parents: 143
diff changeset
111 case 0:
gongo@localhost.localdomain
parents: 143
diff changeset
112 case 1:
gongo@localhost.localdomain
parents: 143
diff changeset
113 create_cube_split(sg_number);
gongo@localhost.localdomain
parents: 143
diff changeset
114 break;
gongo@localhost.localdomain
parents: 143
diff changeset
115 case 2:
153
70146cdec3d4 画像のサイズテストを加える -sg = [2,3,4]
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 150
diff changeset
116 case 3:
70146cdec3d4 画像のサイズテストを加える -sg = [2,3,4]
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 150
diff changeset
117 case 4:
198
b832e6cff83e rename snake_bg to panel
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 195
diff changeset
118 panel_init(sg_number);
144
gongo@localhost.localdomain
parents: 143
diff changeset
119 break;
153
70146cdec3d4 画像のサイズテストを加える -sg = [2,3,4]
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 150
diff changeset
120 case 5:
158
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 157
diff changeset
121 universe_init();
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 157
diff changeset
122 break;
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 157
diff changeset
123 case 6:
199
1fd0107ebb25 add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 198
diff changeset
124 ieshoot_init();
144
gongo@localhost.localdomain
parents: 143
diff changeset
125 break;
210
e75f9eb97180 fix DrawSpan
gongo@localhost.localdomain
parents: 205
diff changeset
126 case 7:
e75f9eb97180 fix DrawSpan
gongo@localhost.localdomain
parents: 205
diff changeset
127 ball_bound_init(this->width, this->height);
e75f9eb97180 fix DrawSpan
gongo@localhost.localdomain
parents: 205
diff changeset
128 break;
212
gongo@localhost.localdomain
parents: 210
diff changeset
129 case 8:
gongo@localhost.localdomain
parents: 210
diff changeset
130 lcube_init(this->width, this->height);
144
gongo@localhost.localdomain
parents: 143
diff changeset
131 break;
212
gongo@localhost.localdomain
parents: 210
diff changeset
132 case 9:
gongo@localhost.localdomain
parents: 210
diff changeset
133 direction_init();
gongo@localhost.localdomain
parents: 210
diff changeset
134 break;
213
8ac35507094d add SceneGraph "3D Super-Dandy"
gongo@localhost.localdomain
parents: 212
diff changeset
135 case 10:
8ac35507094d add SceneGraph "3D Super-Dandy"
gongo@localhost.localdomain
parents: 212
diff changeset
136 init_position(this->width, this->height);
8ac35507094d add SceneGraph "3D Super-Dandy"
gongo@localhost.localdomain
parents: 212
diff changeset
137 break;
222
gongo@localhost.localdomain
parents: 221
diff changeset
138 case 11:
gongo@localhost.localdomain
parents: 221
diff changeset
139 vacuum_init(this->width, this->height);
gongo@localhost.localdomain
parents: 221
diff changeset
140 break;
231
5ae15a5d3dc5 test program add (-sg 12)
tkaito@nw0534.st.ie.u-ryukyu.ac.jp
parents: 229
diff changeset
141 case 12:
5ae15a5d3dc5 test program add (-sg 12)
tkaito@nw0534.st.ie.u-ryukyu.ac.jp
parents: 229
diff changeset
142 untitled_init();
5ae15a5d3dc5 test program add (-sg 12)
tkaito@nw0534.st.ie.u-ryukyu.ac.jp
parents: 229
diff changeset
143 break;
144
gongo@localhost.localdomain
parents: 143
diff changeset
144 default:
gongo@localhost.localdomain
parents: 143
diff changeset
145 node_init();
gongo@localhost.localdomain
parents: 143
diff changeset
146 break;
gongo@localhost.localdomain
parents: 143
diff changeset
147 }
142
dc68420f705f add xml
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 140
diff changeset
148
217
gongo@localhost.localdomain
parents: 213
diff changeset
149 sgpack = (SceneGraphPack*)manager->allocate(sizeof(SceneGraphPack));
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
150 sgpack->init();
217
gongo@localhost.localdomain
parents: 213
diff changeset
151 ppack = (PolygonPack*)manager->allocate(sizeof(PolygonPack));
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
152
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
153 spackList_length = (this->height + split_screen_h - 1) / split_screen_h;
217
gongo@localhost.localdomain
parents: 213
diff changeset
154 spackList = (SpanPack*)manager->allocate(sizeof(SpanPack)*spackList_length);
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
155
176
gongo@localhost.localdomain
parents: 170
diff changeset
156 /**
gongo@localhost.localdomain
parents: 170
diff changeset
157 * SPU に送る address list は 16 バイト倍数でないといけない。
gongo@localhost.localdomain
parents: 170
diff changeset
158 * spackList_length*sizeof(SpanPack*) が 16 バイト倍数になるような
gongo@localhost.localdomain
parents: 170
diff changeset
159 * length_align を求めている。はみ出した部分は使われない
gongo@localhost.localdomain
parents: 170
diff changeset
160 * (ex) spackList_length が 13 の場合
gongo@localhost.localdomain
parents: 170
diff changeset
161 * spackList_length_align = 16;
gongo@localhost.localdomain
parents: 170
diff changeset
162 * 実際に送るデータは64バイトになるのでOK
gongo@localhost.localdomain
parents: 170
diff changeset
163 * 14,15,16 の部分は何も入らない。
gongo@localhost.localdomain
parents: 170
diff changeset
164 */
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
165 spackList_length_align = (spackList_length + 3)&(~3);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
166
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
167 /* 各 SPU が持つ、SpanPack の address list */
167
508beb59e0eb DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents: 158
diff changeset
168 spackList_ptr =
217
gongo@localhost.localdomain
parents: 213
diff changeset
169 (SpanPack**)manager->allocate(sizeof(SpanPack*)*spackList_length_align);
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
170
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
171 for (int i = 0; i < spackList_length; i++) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
172 spackList_ptr[i] = &spackList[i];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
173 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
174
126
74d0a70f60e9 fix RGBA mask (bgr -> rgba)
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
175 for (int i = 1; i <= spackList_length; i++) {
74d0a70f60e9 fix RGBA mask (bgr -> rgba)
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
176 spackList[i-1].init(i*split_screen_h);
74d0a70f60e9 fix RGBA mask (bgr -> rgba)
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
177 }
74d0a70f60e9 fix RGBA mask (bgr -> rgba)
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
178
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
179 task_next = manager->create_task(TASK_DUMMY);
244
e9735a64cd90 mail modify
e065746@localhost.localdomain
parents: 231
diff changeset
180
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
181
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
182 #if 0
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
183 // 諸事情で、今は SceneGraphPack を作らずに
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
184 // そのまま SceneGraph でやっています
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
185 HTaskPtr task_sgp;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
186 task_sgp = manager->create_task(TASK_CREATE_SGP);
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
187 task_sgp->add_param((uint32)scene_graph);
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
188 task_sgp->add_param((uint32)sgpack);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
189 task_next->wait_for(task_sgp);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
190 task_sgp->spawn();
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
191 #endif
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
192
167
508beb59e0eb DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents: 158
diff changeset
193 for (int i = 0; i < spe_num; i++) {
508beb59e0eb DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents: 158
diff changeset
194 task_tex = manager->create_task(TASK_INIT_TEXTURE);
244
e9735a64cd90 mail modify
e065746@localhost.localdomain
parents: 231
diff changeset
195 /*
e9735a64cd90 mail modify
e065746@localhost.localdomain
parents: 231
diff changeset
196 * ここはもう少しわかりやすい使い方がいいかもしれぬ。こんなもん?
e9735a64cd90 mail modify
e065746@localhost.localdomain
parents: 231
diff changeset
197 */
167
508beb59e0eb DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents: 158
diff changeset
198 task_tex->set_cpu((CPU_TYPE)((int)SPE_0 + i));
508beb59e0eb DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents: 158
diff changeset
199 task_next->wait_for(task_tex);
508beb59e0eb DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents: 158
diff changeset
200 task_tex->spawn();
120
13b43de5ef5d fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
201 }
13b43de5ef5d fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
202
244
e9735a64cd90 mail modify
e065746@localhost.localdomain
parents: 231
diff changeset
203 task_next->set_post(&post2runLoop, NULL); // set_post(function(this->run_loop()), NULL)
e9735a64cd90 mail modify
e065746@localhost.localdomain
parents: 231
diff changeset
204 task_next->spawn();
e9735a64cd90 mail modify
e065746@localhost.localdomain
parents: 231
diff changeset
205 // TASK_INIT_TEXTURE が全て終わったら DUMMY_TASK が Viewer::run_loop() を呼ぶ
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
206 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
207
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
208 void
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
209 Viewer::run_loop(void)
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
210 {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
211 HTaskPtr task_create_pp = NULL;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
212 HTaskPtr task_create_sp = NULL;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
213 HTaskPtr task_next;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
214 bool quit_flg;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
215
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
216 quit_flg = quit_check();
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
217
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
218 if (quit_flg == true) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
219 this_time = get_ticks();
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
220 run_finish();
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
221 return;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
222 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
223
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
224 clean_pixels();
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
225
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
226 for (int i = 1; i <= spackList_length; i++) {
126
74d0a70f60e9 fix RGBA mask (bgr -> rgba)
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
227 spackList[i-1].reinit(i*split_screen_h);
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
228 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
229
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
230 task_next = manager->create_task(TASK_DUMMY);
244
e9735a64cd90 mail modify
e065746@localhost.localdomain
parents: 231
diff changeset
231
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
232
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
233 #if 0
157
gongo@henri.cr.ie.u-ryukyu.ac.jp
parents: 155
diff changeset
234 // SceneGraphPack の update
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
235 HTaskPtr task_update_sgp = NULL;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
236 task_update_sgp = manager->create_task(TASK_UPDATE_SGP);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
237 task_update_sgp->add_inData(sgpack, sizeof(SceneGraphPack));
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
238 task_update_sgp->add_outData(sgpack, sizeof(SceneGraphPack));
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
239 task_update_sgp->add_param(width);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
240 task_update_sgp->add_param(height);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
241 task_next->wait_for(task_update_sgp);
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
242 task_update_sgp->spawn();
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
243 #else
195
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 194
diff changeset
244 sgroot->updateControllerState();
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 194
diff changeset
245 sgroot->allExecute(width, height);
219
335ea3665fcd allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 217
diff changeset
246 //sgroot->checkRemove();
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
247 #endif
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
248
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
249 #if 0
157
gongo@henri.cr.ie.u-ryukyu.ac.jp
parents: 155
diff changeset
250 // SceneGraphPack(配列) -> PolygonPack
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
251 task_create_pp = manager->create_task(TASK_CREATE_PP);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
252 task_create_pp->add_inData(sgpack, sizeof(SceneGraphPack));
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
253 task_create_pp->add_param((uint32)ppack);
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
254 #else
157
gongo@henri.cr.ie.u-ryukyu.ac.jp
parents: 155
diff changeset
255 // SceneGraph(木構造) -> PolygonPack
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
256 task_create_pp = manager->create_task(TASK_CREATE_PP2);
195
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 194
diff changeset
257 task_create_pp->add_param((uint32)sgroot->getDrawSceneGraph());
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
258 task_create_pp->add_param((uint32)ppack);
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 133
diff changeset
259 #endif
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
260 task_next->wait_for(task_create_pp);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
261
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
262 int range_base = spe_num;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
263 // 切り上げのつもり
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
264 int range = (spackList_length + range_base - 1) / range_base;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
265
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
266 for (int i = 0; i < range_base; i++) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
267 int index_start = range*i;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
268 int index_end = (index_start + range >= spackList_length)
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
269 ? spackList_length : index_start + range;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
270
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
271 task_create_sp = manager->create_task(TASK_CREATE_SPAN);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
272 task_create_sp->add_inData(ppack, sizeof(PolygonPack));
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
273 task_create_sp->add_inData(spackList_ptr,
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
274 sizeof(SpanPack*)*spackList_length_align);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
275 task_create_sp->add_inData(&spackList[index_start], sizeof(SpanPack));
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
276
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
277 task_create_sp->add_param(index_start);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
278
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
279 /**
133
8f1419174cdf DrawSpan のテクスチャ座標を求める部分で、width と height が逆に使われてた。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 130
diff changeset
280 * ex. screen_height が 480, spenum が 6 の場合、各SPEのy担当範囲
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
281 * [ 1.. 80] [ 81..160] [161..240]
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
282 * [241..320] [321..400] [401..480]
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
283 *
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
284 * ex. screen_height が 1080, spenum が 5 の場合、
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
285 * [ 1..216] [217..432] [433..648]
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
286 * [649..864] [865..1080]
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
287 */
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
288 task_create_sp->add_param(index_start*split_screen_h + 1);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
289 task_create_sp->add_param(index_end*split_screen_h);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
290
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
291 task_next->wait_for(task_create_sp);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
292 task_create_sp->wait_for(task_create_pp);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
293
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
294 task_create_sp->set_cpu(SPE_ANY);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
295 task_create_sp->spawn();
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
296 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
297
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
298 task_create_pp->spawn();
244
e9735a64cd90 mail modify
e065746@localhost.localdomain
parents: 231
diff changeset
299
e9735a64cd90 mail modify
e065746@localhost.localdomain
parents: 231
diff changeset
300 // Barrier 同期
e9735a64cd90 mail modify
e065746@localhost.localdomain
parents: 231
diff changeset
301 task_next->set_post(post2runDraw, NULL); // set_post(function(this->run_draw()), NULL)
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
302 task_next->spawn();
244
e9735a64cd90 mail modify
e065746@localhost.localdomain
parents: 231
diff changeset
303 // TASK_CREATE_SPAN が全て終わったら DUMMY_TASK が Viewer::run_draw() を呼ぶ
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
304 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
305
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
306 void
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
307 Viewer::run_draw(void)
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
308 {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
309 HTaskPtr task_next;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
310 HTaskPtr task_draw;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
311
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
312 task_next = manager->create_task(TASK_DUMMY);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
313
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
314 ppack->clear();
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
315 for (int i = 0; i < spackList_length; i++) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
316 SpanPack *spack = &spackList[i];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
317 int startx = 1;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
318 int endx = split_screen_w;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
319
180
e3b7776b1420 いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents: 177
diff changeset
320 int starty = spack->info.y_top - split_screen_h + 1;
e3b7776b1420 いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents: 177
diff changeset
321 //int endy = spack->info.y_top;
e3b7776b1420 いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents: 177
diff changeset
322 int rangey = (starty + split_screen_h - 1 > this->height)
e3b7776b1420 いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents: 177
diff changeset
323 ? this->height - starty + 1 : split_screen_h;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
324
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
325 while (startx < this->width) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
326 if (spack->info.size > 0) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
327 // Draw SpanPack
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
328 task_draw = manager->create_task(TASK_DRAW_SPAN);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
329 task_draw->add_inData(spack, sizeof(SpanPack));
193
gongo@localhost.localdomain
parents: 192
diff changeset
330
gongo@localhost.localdomain
parents: 192
diff changeset
331 task_draw->add_param(
gongo@localhost.localdomain
parents: 192
diff changeset
332 (uint32)&pixels[(startx-1) + this->width*(starty-1)]);
gongo@localhost.localdomain
parents: 192
diff changeset
333 task_draw->add_param(this->width);
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
334 } else {
200
efd7e4712342 fix run_draw
gongo@localhost.localdomain
parents: 199
diff changeset
335 #if 0
222
gongo@localhost.localdomain
parents: 221
diff changeset
336 //break;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
337 // Draw Background (現在は塗りつぶし)
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
338 task_draw = manager->create_task(TASK_DRAW_BACK);
266
8c9cae96404b merge 151 263
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150 122
diff changeset
339 <<<<<<< local
170
5a4f2497c22d fix ViewerSDL
gongo@localhost.localdomain
parents: 169
diff changeset
340 task_draw->add_param(0xffffffff);
269
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 244 268
diff changeset
341 <<<<<<< local
205
gongo@localhost.localdomain
parents: 204
diff changeset
342
193
gongo@localhost.localdomain
parents: 192
diff changeset
343 for (int k = 0; k < rangey; k++) {
gongo@localhost.localdomain
parents: 192
diff changeset
344 task_draw->add_outData(
gongo@localhost.localdomain
parents: 192
diff changeset
345 &pixels[(startx-1)+this->width*(k+starty-1)],
gongo@localhost.localdomain
parents: 192
diff changeset
346 (endx - startx + 1)*sizeof(int));
gongo@localhost.localdomain
parents: 192
diff changeset
347 }
200
efd7e4712342 fix run_draw
gongo@localhost.localdomain
parents: 199
diff changeset
348 #else
efd7e4712342 fix run_draw
gongo@localhost.localdomain
parents: 199
diff changeset
349 memset(&pixels[(startx-1)+this->width*(starty-1)],
213
8ac35507094d add SceneGraph "3D Super-Dandy"
gongo@localhost.localdomain
parents: 212
diff changeset
350 0, (this->width)*sizeof(int)*rangey);
212
gongo@localhost.localdomain
parents: 210
diff changeset
351 //wmemset((wchar_t*)&pixels[(startx-1)+this->width*(starty-1)],
gongo@localhost.localdomain
parents: 210
diff changeset
352 //0xFFFFFFFF, (this->width)*sizeof(int)*rangey/sizeof(wchar_t));
200
efd7e4712342 fix run_draw
gongo@localhost.localdomain
parents: 199
diff changeset
353 break;
efd7e4712342 fix run_draw
gongo@localhost.localdomain
parents: 199
diff changeset
354 #endif
269
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 244 268
diff changeset
355 =======
267
943c2ebe4483 merge 172 264
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 170 266
diff changeset
356 =======
943c2ebe4483 merge 172 264
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 170 266
diff changeset
357 <<<<<<< local
133
8f1419174cdf DrawSpan のテクスチャ座標を求める部分で、width と height が逆に使われてた。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 130
diff changeset
358 task_draw->add_param(0xffffff);
266
8c9cae96404b merge 151 263
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150 122
diff changeset
359 =======
122
08e47bbca4f5 add SceneGraph move
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 120
diff changeset
360 //task_draw->add_param(0x00ffcc55);
08e47bbca4f5 add SceneGraph move
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 120
diff changeset
361 task_draw->add_param(0);
08e47bbca4f5 add SceneGraph move
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 120
diff changeset
362 //task_draw->add_param(st_rgb);
266
8c9cae96404b merge 151 263
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150 122
diff changeset
363 >>>>>>> other
267
943c2ebe4483 merge 172 264
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 170 266
diff changeset
364 >>>>>>> other
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
365 }
176
gongo@localhost.localdomain
parents: 170
diff changeset
366
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
367 for (int k = 0; k < rangey; k++) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
368 task_draw->add_outData(
180
e3b7776b1420 いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents: 177
diff changeset
369 &pixels[(startx-1)+this->width*(k+starty-1)],
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
370 (endx - startx + 1)*sizeof(int));
269
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 244 268
diff changeset
371 >>>>>>> other
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
372 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
373
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
374 task_draw->add_param(startx);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
375 task_draw->add_param(endx);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
376 task_draw->add_param(rangey);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
377 task_draw->set_cpu(SPE_ANY);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
378 task_next->wait_for(task_draw);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
379 task_draw->spawn();
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
380
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
381 startx += split_screen_w;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
382 endx += split_screen_w;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
383
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
384 if (endx > this->width) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
385 endx = this->width;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
386 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
387 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
388 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
389
244
e9735a64cd90 mail modify
e065746@localhost.localdomain
parents: 231
diff changeset
390 task_next->set_post(post2runLoop, NULL); // set_post(function(this->run_loop()), NULL)
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
391 task_next->spawn();
244
e9735a64cd90 mail modify
e065746@localhost.localdomain
parents: 231
diff changeset
392 // TASK_DRAW_SPAN が全て終わったら DUMMY_TASK が Viewer::run_loop() を呼ぶ
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
393
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
394 frames++;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
395 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
396
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
397 void
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
398 Viewer::run_finish(void)
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
399 {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
400 if (this_time != start_time) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
401 printf("%f FPS\n", (((float)frames)/(this_time-start_time))*1000.0);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
402 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
403
219
335ea3665fcd allExecute する度に SceneGraph をコピーしていく様に変更
gongo@gendarme.local
parents: 217
diff changeset
404 delete sgroot;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
405
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
406 quit();
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
407 }