annotate old/simple_pack/viewer.cpp @ 1616:05d449e7b9f8 draft

remove set_NDRange
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Tue, 14 May 2013 13:40:50 +0900
parents 3bc98f6d31ff
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
1 #include <iostream>
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
2 #include <SDL.h>
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
3 #include <SDL_opengl.h>
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
4 #include <math.h>
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
5 #include <unistd.h>
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
6 #include "polygon.h"
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
7 #include "viewer.h"
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
8 #include "sys.h"
75
db2b7c565b89 *** empty log message ***
chiaki
parents: 72
diff changeset
9 #include "spu_span.h"
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
10 using namespace std;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
11
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
12 #define redMask 0x00ff0000
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
13 #define greenMask 0x0000ff00
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
14 #define blueMask 0x000000ff
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
15 #define alphaMask 0
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
16
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
17 extern int create_sgp(Polygon *sg, SceneGraphPack *sgp);
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
18 //extern int update_sgp(SceneGraphPack *sgp, SceneGraphPack *_sgp);
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
19 //extern int create_pp(SceneGraphPack *sgp, PolygonPack *pp);
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
20
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
21 Viewer::Viewer(int b, int w, int h)
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
22 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
23 bpp = b;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
24 width = w;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
25 height = h;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
26 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
27
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
28
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
29 void Viewer::sdl_init()
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
30 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
31 if( SDL_Init( SDL_INIT_VIDEO ) < 0 )
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
32 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
33 fprintf(stderr,"Couldn't initialize SDL: %s\n",SDL_GetError());
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
34 exit( 1 );
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
35 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
36 screen = SDL_SetVideoMode( width, height, bpp, SDL_HWSURFACE );
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
37 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
38
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
39
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
40 int Viewer::get_ticks()
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
41 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
42 int time;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
43 time = SDL_GetTicks();
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
44 return time;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
45 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
46
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
47 bool Viewer::quit_check()
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
48 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
49 bool quit = false;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
50 SDL_Event event;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
51 while(SDL_PollEvent(&event))
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
52 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
53 if(event.type==SDL_QUIT)
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
54 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
55 quit = true;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
56 return quit;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
57 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
58 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
59 return quit;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
60 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
61
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
62 void Viewer::quit()
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
63 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
64 SDL_Quit();
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
65 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
66
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
67
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
68 void Viewer::swap_buffers()
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
69 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
70 SDL_GL_SwapBuffers();
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
71 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
72
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
73
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
74 void
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
75 Viewer::write_pixel(int x, int y,float z, Uint32 rgb)
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
76 {
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
77 SDL_PixelFormat *pf;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
78 pf = screen->format;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
79 x += width/2;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
80 y += height/2;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
81
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
82 static int diffz,diffz1;
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
83
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
84 diffz1 = diffz;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
85 diffz = (zRow[x][y]>z);
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
86 if (z < zRow[x][y]) {
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
87 if (x < width && x > 0 && y > 0 && y < height) {
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
88 zRow[x][y] = z;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
89 y = height - y;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
90 pixels[width*y + x] = rgb;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
91 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
92 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
93 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
94
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
95 void
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
96 Viewer::write_line(float x1, float y1, float x2, float y2, Uint32 rgb)
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
97 {
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
98 if (x1 > x2) {
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
99 float x=0;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
100 float y=0;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
101 x=x1;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
102 y=y1;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
103 x1 = x2;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
104 y1 = y2;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
105 x2 = x;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
106 y2 = y;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
107 }
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
108
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
109 float s = y1;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
110
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
111 if ((int)x1 == (int)x2) {
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
112 if (y1 > y2) {
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
113 float y=0;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
114 y = y1;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
115 y1 = y2;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
116 y2 = y;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
117 }
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
118
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
119 for (float i=y1; i<y2; i++) {
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
120 //write_pixel((int)x1,(int)i);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
121 write_pixel((int)x1,(int)i,0,rgb);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
122 }
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
123 } else {
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
124 float t = (y2 - y1)/(x2 - x1);
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
125 if (t < -1) {
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
126 float f = 0;
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
127 for (float i=x1; i<x2; i++) {
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
128 for (float a=(int)t; a<0; a++) {
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
129 write_pixel((int)i,(int)s,0,rgb);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
130 s--;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
131 }
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
132
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
133 f += t-(int)t;
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
134
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
135 if (f <= -1) {
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
136 write_pixel((int)i,(int)s,0,rgb);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
137 f = 0;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
138 s--;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
139 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
140 }
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
141 } else if (t <= 1) {
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
142 for(float i=x1; i<x2; i++) {
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
143 //write_pixel((int)i,(int)s);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
144 write_pixel((int)i,(int)s,0,rgb);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
145 s += t;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
146 }
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
147 } else {
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
148 float f = 0;
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
149 for (float i=x1; i<x2; i++) {
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
150 for (float a=0; a<(int)t; a++) {
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
151 write_pixel((int)i,(int)s,0,rgb);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
152 s++;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
153 }
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
154
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
155 f += t-(int)t;
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
156
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
157 if (f >= 1) {
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
158 write_pixel((int)i,(int)s,0,rgb);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
159 f = 0;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
160 s++;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
161 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
162 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
163 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
164 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
165 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
166
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
167 void Viewer::write_triangle(float x1, float y1, float x2, float y2, float x3, float y3, Uint32 rgb)
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
168 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
169 write_line(x1,y1,x2,y2,rgb);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
170 write_line(x2,y2,x3,y3,rgb);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
171 write_line(x3,y3,x1,y1,rgb);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
172 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
173
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
174 void Viewer::clean_pixels()
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
175 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
176 for(int i=0; i<width*height; i++)
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
177 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
178 pixels[i] = 0x00;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
179 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
180 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
181
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
182 void Viewer::graph_line()
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
183 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
184 int xl = width*height/2;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
185 int yl = width/2;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
186 for(int i=0; i<width; i++)
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
187 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
188 for(int t=0; t<height; t+=20)
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
189 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
190 pixels[width*t+i] = 0x5a;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
191 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
192 pixels[xl +i] = 0xff;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
193 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
194 for(int i=0; i<height; i++)
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
195 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
196 for(int t=0; t<width; t+=20)
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
197 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
198 pixels[i*width+t] = 0x5a;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
199 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
200 pixels[i*width+yl] = 0xff;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
201 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
202 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
203
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
204
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
205 struct run_arg_t {
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
206 int start_time;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
207 int this_time;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
208 int frames;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
209 SDL_Surface *bitmap;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
210 SDL_PixelFormat *pf;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
211 Uint32 background;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
212 Polygon *p;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
213 SceneGraphPack *sgp;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
214 PolygonPack *pp;
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
215 //SPANPACKLIST *spl;
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
216 //SPANPACK *sp;
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
217 //SPANPACK sps[135];
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
218 //SPAN s1[250];
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
219 //SPAN s2[250];
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
220 //SPAN s3[250];
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
221 //SPAN s4[250];
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
222 //SPAN s5[250];
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
223 //SPAN s6[250];
75
db2b7c565b89 *** empty log message ***
chiaki
parents: 72
diff changeset
224 SPUSPANLIST *ssl;
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
225 //SPLSSL *splssl;
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
226 };
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
227
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
228 struct run_arg_t *arg;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
229
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
230 void
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
231 Viewer::run_init()
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
232 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
233 arg = new run_arg_t;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
234 HTaskPtr task;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
235 int fd;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
236
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
237 arg->start_time = get_ticks();
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
238 arg->this_time = 0;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
239 arg->frames = 0;
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
240
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
241 arg->pf = screen->format;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
242 arg->background = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
243 arg->p = new Polygon;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
244 arg->p->set_data("cube.xml");
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
245 arg->p->viewer = this;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
246 arg->sgp = new SceneGraphPack;
72
cf36120bc158 *** empty log message ***
chiaki
parents: 69
diff changeset
247 //create_sgp(arg->p, arg->sgp);
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
248 arg->pp = new PolygonPack;
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
249 //arg->sp = new SPANPACK;
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
250 //arg->spl = new SPANPACKLIST;
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
251 //arg->spl->size = 60;
75
db2b7c565b89 *** empty log message ***
chiaki
parents: 72
diff changeset
252 //cout << sizeof(SPANPACKLIST) << endl;
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
253 //cout << "run_init :spl->size = " << arg->spl->size << endl;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
254 //arg->spl->dline = arg->sps;
69
c9b973f0673e *** empty log message ***
chiaki
parents: 68
diff changeset
255 /*
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
256 arg->spl->dline[0].span = arg->s1;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
257 arg->spl->dline[1].span = arg->s2;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
258 arg->spl->dline[2].span = arg->s3;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
259 arg->spl->dline[3].span = arg->s4;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
260 arg->spl->dline[4].span = arg->s5;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
261 arg->spl->dline[5].span = arg->s6;
69
c9b973f0673e *** empty log message ***
chiaki
parents: 68
diff changeset
262 cout << "run_init :spl->dline[0].span = " << arg->spl->dline[0].span << endl;
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
263 */
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
264 /*
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
265 for(int i=0; i<arg->spl->size; i++)
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
266 {
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
267 arg->spl->dline[i] = new SPANPACK;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
268 }
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
269 */
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
270
75
db2b7c565b89 *** empty log message ***
chiaki
parents: 72
diff changeset
271 arg->ssl = new SPUSPANLIST;
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
272 //arg->splssl = new SPLSSL;
75
db2b7c565b89 *** empty log message ***
chiaki
parents: 72
diff changeset
273
72
cf36120bc158 *** empty log message ***
chiaki
parents: 69
diff changeset
274 create_sgp(arg->p, arg->sgp);
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
275 arg->sgp->ssl = arg->ssl;
72
cf36120bc158 *** empty log message ***
chiaki
parents: 69
diff changeset
276
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
277 //arg->splssl->spl = arg->spl;
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
278 //arg->splssl->ssl = arg->ssl;
75
db2b7c565b89 *** empty log message ***
chiaki
parents: 72
diff changeset
279
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
280 pixels = new Uint32[width*height];
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
281
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
282 graph_line();
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
283
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
284 arg->bitmap = SDL_CreateRGBSurfaceFrom((void *)pixels, width, height, 32,
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
285 width*4, redMask, greenMask,
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
286 blueMask, alphaMask);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
287
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
288 fd = manager->open("ViewerRunLoop");
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
289 task = manager->create_task(fd, 0, 0, 0, NULL);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
290 manager->spawn_task(task);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
291 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
292
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
293 /*
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
294 void distribute_polygon_pack(int spu_num, PolygonPackList *ppl, PolygonPack *pp)
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
295 {
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
296 ppl->list[0].info.size = 0;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
297 ppl->list[1].info.size = 0;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
298 ppl->list[2].info.size = 0;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
299 ppl->list[3].info.size = 0;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
300 ppl->list[4].info.size = 0;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
301 ppl->list[5].info.size = 0;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
302
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
303 for(int i=0; i<pp->info.size; i++)
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
304 {
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
305 int num = i%spu_num;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
306 int mysize = ppl->list[num].info.size;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
307 ppl->list[num].tri[mysize] = pp->tri[i];
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
308 ppl->list[num].info.size++;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
309 }
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
310 }
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
311 */
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
312
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
313 void
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
314 Viewer::run_loop(void)
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
315 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
316 HTaskPtr task_update_sgp = NULL;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
317 HTaskPtr task_create_pp = NULL;
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
318 HTaskPtr task_create_sp = NULL;
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
319 //HTaskPtr task_spu_sp = NULL;
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
320 HTaskPtr task_finish = NULL;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
321 int fd_update_sgp;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
322 int fd_create_pp;
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
323 int fd_create_sp;
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
324 //int fd_spu_sp;
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
325 int fd_finish;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
326
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
327 HTaskPtr task;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
328 int fd;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
329
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
330 if (quit_check()) {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
331 arg->this_time = get_ticks();
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
332 fd_finish = manager->open("ViewerRunFinish");
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
333 task_finish = manager->create_task(fd_finish, 0, 0, 0, NULL);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
334 manager->spawn_task(task_finish);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
335 return;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
336 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
337
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
338 clean_pixels();
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
339
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
340 zRow_init();
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
341 graph_line();
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
342
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
343 fd_update_sgp = manager->open("UpdateSGP");
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
344 fd_create_pp = manager->open("CreatePP");
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
345 fd_create_sp = manager->open("CreateSP");
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
346 //fd_spu_sp = manager->open("SpuSP");
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
347 fd = manager->open("ViewerRunDraw");
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
348 task_update_sgp = manager->create_task(fd_update_sgp,
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
349 sizeof(SceneGraphPack),
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
350 (unsigned int)arg->sgp,
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
351 (unsigned int)arg->sgp,
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
352 NULL);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
353 task_create_pp = manager->create_task(fd_create_pp,
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
354 sizeof(SceneGraphPack),
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
355 (unsigned int)arg->sgp,
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
356 (unsigned int)arg->pp,
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
357 NULL);
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
358 //cout << "run_loop :spl->size = " << arg->spl->size << endl;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
359 //cout << "run_loop :spl->dline[0].span = " << arg->spl->dline[0].span << endl;
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
360 task_create_sp = manager->create_task(fd_create_sp,
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
361 sizeof(PolygonPack),
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
362 (unsigned int)arg->pp,
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
363 0,
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
364 NULL);
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
365 /*
75
db2b7c565b89 *** empty log message ***
chiaki
parents: 72
diff changeset
366 task_spu_sp = manager->create_task(fd_spu_sp,
db2b7c565b89 *** empty log message ***
chiaki
parents: 72
diff changeset
367 sizeof(SPLSSL),
db2b7c565b89 *** empty log message ***
chiaki
parents: 72
diff changeset
368 (unsigned int)arg->splssl,
db2b7c565b89 *** empty log message ***
chiaki
parents: 72
diff changeset
369 (unsigned int)arg->ssl,
db2b7c565b89 *** empty log message ***
chiaki
parents: 72
diff changeset
370 NULL);
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
371 */
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
372 task = manager->create_task(fd, 0, 0, 0, NULL);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
373
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
374 manager->set_task_depend(task_update_sgp, task);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
375 manager->set_task_depend(task_create_pp, task);
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
376 manager->set_task_depend(task_create_pp, task_create_sp);
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
377 //manager->set_task_depend(task_create_sp, task_spu_sp);
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
378 manager->set_task_depend(task_create_sp, task);
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
379 //manager->set_task_depend(task_spu_sp, task);
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
380
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
381 manager->spawn_task(task_update_sgp);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
382 manager->spawn_task(task_create_pp);
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
383 manager->spawn_task(task_create_sp);
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
384 //manager->spawn_task(task_spu_sp);
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
385 manager->spawn_task(task);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
386 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
387
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
388 void
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
389 Viewer::run_draw(void)
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
390 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
391 HTaskPtr task;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
392 int fd;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
393
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
394 //arg->p->draw(arg->pp); // test draw of PolygonPack
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
395 //arg->p->draw(arg->sp); // test draw of SpanPack
75
db2b7c565b89 *** empty log message ***
chiaki
parents: 72
diff changeset
396
db2b7c565b89 *** empty log message ***
chiaki
parents: 72
diff changeset
397 for(int i=0; i<10; i++)
db2b7c565b89 *** empty log message ***
chiaki
parents: 72
diff changeset
398 {
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
399 arg->p->draw(&arg->ssl->ss[0].spp[i]); // test draw of SpuSpanPackList
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
400 arg->p->draw(&arg->ssl->ss[1].spp[i]); // test draw of SpuSpanPackList
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
401 arg->p->draw(&arg->ssl->ss[2].spp[i]); // test draw of SpuSpanPackList
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
402 arg->p->draw(&arg->ssl->ss[3].spp[i]); // test draw of SpuSpanPackList
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
403 arg->p->draw(&arg->ssl->ss[4].spp[i]); // test draw of SpuSpanPackList
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
404 arg->p->draw(&arg->ssl->ss[5].spp[i]); // test draw of SpuSpanPackList
69
c9b973f0673e *** empty log message ***
chiaki
parents: 68
diff changeset
405 }
c9b973f0673e *** empty log message ***
chiaki
parents: 68
diff changeset
406
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
407 SDL_BlitSurface(arg->bitmap, NULL, screen, NULL);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
408 SDL_UpdateRect(screen, 0, 0, 0, 0);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
409
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
410 arg->frames++;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
411
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
412 fd = manager->open("ViewerRunLoop");
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
413 task = manager->create_task(fd, 0, 0, 0, NULL);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
414 manager->spawn_task(task);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
415 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
416
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
417 void
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
418 Viewer::run_finish(void)
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
419 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
420 if (arg->this_time != arg->start_time) {
68
35a6cf176c38 *** empty log message ***
chiaki
parents: 53
diff changeset
421 cout<< (((float)arg->frames)/(arg->this_time-arg->start_time))*1000.0 << " FPS\n";
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
422 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
423
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
424 SDL_FreeSurface(arg->bitmap);
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
425 delete [] pixels;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
426 arg->p->delete_data();
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
427 delete arg->p;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
428 delete arg->sgp;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
429 delete arg->pp;
84
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
430 //delete arg->spl;
c2e178b3415f create SPUSPANLIST no use task/spu_span.cpp
chiaki
parents: 75
diff changeset
431 //delete arg->sp;
53
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
432 quit();
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
433
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
434 delete arg;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
435 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
436
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
437 void
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
438 Viewer::zRow_init()
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
439 {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
440 for (int i = 0; i < width; i++) {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
441 for (int j = 0; j < height; j++) {
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
442 zRow[i][j] = 65535;
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
443 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
444 }
0c8ae614d421 Initial revision
chiaki
parents:
diff changeset
445 }