3 Copyright (C) 2001-2003 Paolo Martella
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
29 static Texture
* j_Text
;
30 static GLuint numtexs
=19;
31 static GLuint width
=800;
32 static GLuint height
=600;
33 static bool init
=true;
34 static GLfloat j_time
=0;
36 static GLfloat j_FogColor
[]={1.0f
,1.0f
,1.0f
,1.0f
};
37 //static int j_x, j_y;
38 static GLfloat j_max
=0.0f
;
40 static GLfloat j_zeta
=-6.7f
;
41 static GLfloat j_radius
=0.0f
;
44 static const int j_num
=150;
57 static j_part parts
[j_num
];
61 j_Text
=new Texture
[numtexs
];
63 j_Text
[1].Load("data/provaz.raw");
64 j_Text
[2].Load("data/skygs.raw");
65 j_Text
[3].Load("data/white.raw");
66 j_Text
[4].Load("data/moon.raw");
67 j_Text
[5].Load("data/stars1.raw");
68 j_Text
[6].Load("data/moonmask.raw");
69 j_Text
[7].Load("data/spread.raw");
70 j_Text
[8].Load("data/circle.raw");
71 j_Text
[9].Load("data/circleempty.raw");
72 j_Text
[10].Load("data/circlefill.raw");
73 j_Text
[11].Load("data/noise.raw");
74 j_Text
[12].Load("data/tail.raw");
75 glTexParameteri(GL_TEXTURE_2D
,GL_TEXTURE_MAG_FILTER
, GL_LINEAR
);
76 glTexParameteri(GL_TEXTURE_2D
,GL_TEXTURE_MIN_FILTER
, GL_LINEAR
);
77 j_Text
[13].Load("data/profile.raw");
78 j_Text
[14].Load("data/star.raw");
79 j_Text
[15].Load("data/land.raw");
80 glTexParameteri(GL_TEXTURE_2D
,GL_TEXTURE_WRAP_S
, GL_CLAMP
);
81 glTexParameteri(GL_TEXTURE_2D
,GL_TEXTURE_WRAP_T
, GL_CLAMP
);
82 j_Text
[16].Load("data/esaflr.raw");
83 j_Text
[17].Load("data/credits.raw");
84 j_Text
[18].Load("data/creditsneg.raw");
86 glMatrixMode(GL_PROJECTION
); // Select The Projection Matrix
88 gluPerspective(45.0f
,(GLfloat
)width
/(GLfloat
)height
,0.1f
,150.0f
);
89 glMatrixMode(GL_MODELVIEW
); // Select The Modelview Matrix
91 glShadeModel(GL_SMOOTH
);
92 glClearColor(0,0,0,0);//.07f, 0.1f, 0.25f, 0.0f);
94 glDepthFunc(GL_LEQUAL
);
95 glHint(GL_PERSPECTIVE_CORRECTION_HINT
, GL_NICEST
);
96 glPolygonMode(GL_FRONT_AND_BACK
, GL_FILL
);
97 glEnable(GL_TEXTURE_2D
);
103 glDisable (GL_CULL_FACE
);
104 glDisable(GL_DEPTH_TEST
);
105 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
108 for (int i
=0; i
<j_num
; i
++)
110 parts
[i
].j_x
=.001*((GLfloat
)(rand()%12000));
111 if (parts
[i
].j_x
>6.0f
) parts
[i
].j_x
-=12.0f
;
112 parts
[i
].j_y
=.001*((GLfloat
)(rand()%5000));
113 parts
[i
].rad
=.5+.005*((GLfloat
)(rand()%1000));//parts[i].j_y*.001*((GLfloat)(rand()%1000));
114 parts
[i
].phase
=.002*((GLfloat
)(rand()%1000))*3.1415;
115 parts
[i
].spd
=.25+.0025*((GLfloat
)(rand()%1000));
117 parts
[i
].xp
=.00044*((GLfloat
)(rand()%1000));
118 if (parts
[i
].xp
>0.22f
) parts
[i
].xp
-=.44f
;
119 parts
[i
].r
=128+rand()%128;
120 parts
[i
].b
=parts
[i
].r
;
121 parts
[i
].g
=parts
[i
].r
;
122 parts
[i
].a
=(int)(parts
[i
].j_y
*51.0f
);
124 glEnable(GL_POINT_SMOOTH
);
153 void j_drawquad(GLfloat size
)
156 glTexCoord2f(0.0f
, 0.0f
);
157 glVertex3f(-.5*size
,-.5*size
,0);
158 glTexCoord2f(1.0f
, 0.0f
);
159 glVertex3f(-.5*size
,.5*size
,0);
160 glTexCoord2f(1.0f
, 1.0f
);
161 glVertex3f(.5*size
,.5*size
,0);
162 glTexCoord2f(0.0f
, 1.0f
);
163 glVertex3f(.5*size
,-.5*size
,0);
167 void j_drawcred(GLfloat sizew
, GLfloat sizeh
, GLfloat pos
, GLfloat facts
)
169 // if (benchmode) return;
170 glTexParameterf(GL_TEXTURE_2D
,GL_TEXTURE_WRAP_S
, GL_CLAMP
);
171 glTexParameterf(GL_TEXTURE_2D
,GL_TEXTURE_WRAP_T
, GL_CLAMP
);
172 glBegin(GL_QUAD_STRIP
);
175 glTexCoord2f(0.0f
, 0.0f
+pos
);
176 glVertex3f(-1*sizew
,-1*sizeh
,0);
177 glTexCoord2f(1.0f
, 0.0f
+pos
);
178 glVertex3f(1*sizew
,-1*sizeh
,0);
181 glTexCoord2f(0.0f
, facts
*.025f
+pos
);
182 glVertex3f(-1*sizew
,-.9*sizeh
,0);
183 glTexCoord2f(1.0f
, facts
*.025f
+pos
);
184 glVertex3f(1*sizew
,-.9*sizeh
,0);
186 glTexCoord2f(0.0f
, facts
*.475f
+pos
);
187 glVertex3f(-1*sizew
,.9*sizeh
,0);
188 glTexCoord2f(1.0f
, facts
*.475f
+pos
);
189 glVertex3f(1*sizew
,.9*sizeh
,0);
192 glTexCoord2f(0.0f
, facts
*.5f
+pos
);
193 glVertex3f(-1*sizew
,1*sizeh
,0);
194 glTexCoord2f(1.0f
, facts
*.5f
+pos
);
195 glVertex3f(1*sizew
,1*sizeh
,0);
198 glTexParameterf(GL_TEXTURE_2D
,GL_TEXTURE_WRAP_S
, GL_REPEAT
);
199 glTexParameterf(GL_TEXTURE_2D
,GL_TEXTURE_WRAP_T
, GL_REPEAT
);
202 void j_drawquad1(int col
,GLfloat sizex
,GLfloat sizey
)
205 if (col
>32) glColor4ub(255,255,255,col
); else glColor4ub(255,255,255,32);
206 glTexCoord2f(0.0f
+j_radius
/3, 0.0f
+j_radius
);
207 glVertex3f(-.5*sizex
,-.5*sizey
,0);
208 glTexCoord2f(1.0f
*2+j_radius
/3, 0.0f
+j_radius
);
209 glVertex3f(-.5*sizex
,.5*sizey
,0);
210 glColor4ub(255,255,255,col
/2);
211 glTexCoord2f(1.0f
*2+j_radius
/3, 1.0f
*2+j_radius
);
212 glVertex3f(.5*sizex
,.5*sizey
,0);
213 glTexCoord2f(0.0f
+j_radius
/3, 1.0f
*2+j_radius
);
214 glVertex3f(.5*sizex
,-.5*sizey
,0);
218 void j_drawquad10(int col
,GLfloat sizex
,GLfloat sizey
)
221 if (col
>32) glColor4ub(255,255,255,col
); else glColor4ub(255,255,255,32);
223 glVertex3f(-.5*sizex
,-.5*sizey
,0);
224 glVertex3f(-.5*sizex
,.5*sizey
,0);
226 glColor4f(j_FogColor
[0],j_FogColor
[1],j_FogColor
[2],1.75*(GLfloat
)col
/255.0f
);
227 glVertex3f(.5*sizex
,.5*sizey
,0);
228 glVertex3f(.5*sizex
,-.5*sizey
,0);
233 void j_drawquad2(int col
,int shd
,GLfloat sizex
,GLfloat sizey
)
236 glColor4ub(col
,col
,col
,shd
);
237 glTexCoord2f(1+0.0f
+j_radius
/2, 0.0f
+j_radius
/2);
238 glVertex3f(-.5*sizex
,-.5*sizey
,0);
239 glTexCoord2f(1+1.0f
*2+j_radius
/2, 0.0f
+j_radius
/2);
240 glVertex3f(-.5*sizex
,.5*sizey
,0);
241 glColor4ub(col
,col
,col
,shd
/2);
242 glTexCoord2f(1+1.0f
*2+j_radius
/2, 1.0f
*2+j_radius
/2);
243 glVertex3f(.5*sizex
,.5*sizey
,0);
244 glTexCoord2f(1+0.0f
+j_radius
/2, 1.0f
*2+j_radius
/2);
245 glVertex3f(.5*sizex
,-.5*sizey
,0);
249 void j_drawquad3(int col
,GLfloat sizex
,GLfloat sizey
)
252 glColor4ub(0,0,0,col
);
253 glTexCoord2f(0.0f
-j_radius
/10.0f
, 0.0f
);
254 glVertex3f(-.5*sizex
,-.5*sizey
,0);
255 glTexCoord2f(1.0f
-j_radius
/10.0f
, 0.0f
);
256 glColor4ub(255,255,255,col
);
257 glVertex3f(-.5*sizex
,.5*sizey
,0);
258 glTexCoord2f(1.0f
-j_radius
/10.0f
, 2.0f
);
259 glVertex3f(.5*sizex
,.5*sizey
,0);
260 glTexCoord2f(0.0f
-j_radius
/10.0f
, 2.0f
);
261 glColor4ub(0,0,0,col
);
262 glVertex3f(.5*sizex
,-.5*sizey
,0);
266 void j_drawquad6(int col
,GLfloat sizex
,GLfloat sizey
)
269 glColor4ub(0,0,0,col
);
270 glTexCoord2f(0.0f
-j_radius
*2.0f
, 0.0f
+j_radius
/2.0f
);
271 glVertex3f(-.5*sizex
,-.5*sizey
,0);
272 glTexCoord2f(1.0f
-j_radius
*2.0f
, 0.0f
+j_radius
/2.0f
);
273 glColor4ub(col
,col
,col
,255);
274 glVertex3f(-.5*sizex
,.5*sizey
,0);
275 glTexCoord2f(1.0f
-j_radius
*2.0f
, 2.0f
+j_radius
/2.0f
);
276 glVertex3f(.5*sizex
,.5*sizey
,0);
277 glTexCoord2f(0.0f
-j_radius
*2.0f
, 2.0f
+j_radius
/2.0f
);
278 glColor4ub(0,0,0,col
);
279 glVertex3f(.5*sizex
,-.5*sizey
,0);
283 void j_drawtrail(GLuint thickness
, GLint alpha
, GLfloat length
, GLuint r
,GLuint g
,GLuint b
,GLuint a
)
286 for (unsigned int p
=0; p
<thickness
; p
++)
288 glTranslatef(0,-1/length
,0);
290 glRotatef(-alpha
,1,0,0);
291 glRotatef(p
*j_radius
*10,0,0,1);
293 j_drawquad(j_max
*(p
*.2*j_radius
/2)+.00002*((GLfloat
)(rand()%1000)));
299 bool j_DrawGLScene(GLfloat globtime
)
301 if (init
) {j_InitGL();init
=false;}
304 j_radius
=-.075f
+(j_time
)/45000.0f
;
306 glClear(GL_COLOR_BUFFER_BIT
| GL_DEPTH_BUFFER_BIT
);
312 glTranslatef(0.0f
,0.75f
,j_zeta
-2.0f
);
313 glRotatef(80,1.0f
,0.0f
,0.0f
);
314 glRotatef(0,0.0f
,1.0f
,0.0f
);
315 glRotatef(-90,0.0f
,0.0f
,1.0f
);
316 glBlendFunc(GL_SRC_ALPHA
, GL_ONE
);
317 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[4]);
321 glTranslatef(0,1.25,-5);
322 j_drawquad3((int)(32*j_radius
),6.0,2.5); // STELLE
325 glLoadIdentity(); // LUNA
326 glTranslatef(.55f
+3.0f
*cos(.35+j_radius
/2),.4f
+1.25*sin(.35+j_radius
/2),-5);
327 glRotatef(-45,0,0,1);
328 glColor4ub(255,255,255,255);
329 glBlendFunc(GL_DST_COLOR
,GL_ZERO
);
330 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[5]);
332 glColor4ub(255,255,255,(unsigned char)(148*(j_radius
-.35)));
333 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
334 //glBindTexture(GL_TEXTURE_2D,j_Text[ure[3]);
338 if ((j_radius
-.5f
<.053)&&(j_radius
-.5f
>-.007f
))
341 glTranslatef(-2.5+(j_radius
-.5f
)*25,1.2f
+(j_radius
-.5f
)*4.7,-5);
344 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
345 glRotatef(100,0,0,1); // SCIA
346 glScalef(.1,sin(55*(j_radius
-.5f
))*sin(55*(j_radius
-.5f
)),1);
347 glColor4ub(255,255,255,(unsigned char)(64*sin(55*(j_radius
-.5f
))*sin(55*(j_radius
-.5f
))));
351 if ((j_radius
<.08)&&(j_radius
>.05))
354 glTranslatef(-1.0+(-.05+j_radius
)*50,1.5f
-(-.05+j_radius
)*9,-5);
356 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
357 glRotatef(80,0,0,1); // SCIA
358 glScalef(.07,.5*sin(100*(-.05+j_radius
))*sin(100*(-.05+j_radius
)),1);
359 glColor4ub(255,255,255,(unsigned char)(255*sin(100*(-.05+j_radius
))*sin(100*(-.05+j_radius
))));
364 glTranslatef(0.0f
,0.75f
,j_zeta
-2.0f
);
365 glRotatef(80,1.0f
,0.0f
,0.0f
);
366 glRotatef(0,0.0f
,1.0f
,0.0f
);
367 glRotatef(-90,0.0f
,0.0f
,1.0f
);
368 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
369 ///////////////////////////////////////////////////////
370 ///////////////////////////////////////////////////////
371 ///////////////////////////////////////////////////////
372 ///////////////////////////////////////////////////////
373 ///////////////////////////////////////////////////////
374 glDisable(GL_TEXTURE_2D
);
377 glTranslatef(0,1.4,j_zeta
-2.0f
);
378 //glRotatef(-90+j_zrot,0.0f,0.0f,1.0f);
379 glRotatef(-90,0,0,1);
380 j_drawquad10(100,3,10);
382 glEnable(GL_TEXTURE_2D
);
386 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[0]);
388 j_drawquad1(100,10,15); // NUVOLE
389 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[1]);
392 if (((j_radius
>1.482)&&(j_radius
<1.484))||
394 ((j_radius
>1.305)&&(j_radius
<1.306))||
395 ((j_radius
>1.3)&&(j_radius
<1.3025)))
396 j_drawquad2(128+rand()%128,128+rand()%128,10,15);
398 else if (j_radius
>1.2) j_drawquad2(190,(int)(128-128*(j_radius
-1.2)/.3),10,15);
399 else j_drawquad2(190,128,10,15);
401 glTranslatef(1.5f
*cos(2.2+j_radius
),sin(2.2+j_radius
),-3);
402 //glBindTexture(GL_TEXTURE_2D,j_Text[ure[2]);
405 glRotatef(j_radius
*300,0,0,1);
406 glColor4ub(255,255,255,(unsigned char)(255-50*j_radius
));
407 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
408 if (j_radius
<1.1) j_drawquad(1.0-j_radius
/1.75f
);
411 if (j_radius
*3.0f
<3.1415)
413 glRotatef(j_radius
*90,0,0,1);
416 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[8]);
418 glColor4ub(128,160,255,(unsigned char)(32*sin(j_radius
*3.0f
)));
419 glTranslatef(j_radius
/1.75,0,0);
424 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[8]);
426 glColor4ub(192,48,16,(unsigned char)(80*sin(j_radius
*3.0f
)));
427 glTranslatef(j_radius
*1.5f
,0,0);
432 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[9]);
434 glColor4ub(64,192,96,(unsigned char)(100*sin(j_radius
*3.0f
)));
435 glTranslatef(j_radius
*1.81f
,0,0);
437 glColor4ub(255,255,255,(unsigned char)(100*sin(j_radius
*3.0f
)));
442 //BindTexture(GL_TEXTURE_2D, j_Text[ure[7]);
444 glColor4ub(96,128,192,(unsigned char)(64*sin(j_radius
*3.0f
)));
445 glTranslatef(j_radius
*2.5f
,0,0);
450 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[7]);
452 glColor4ub(192,192,160,(unsigned char)(64*sin(j_radius
*3.0f
)));
453 glTranslatef(j_radius
*2.1f
,0,0);
458 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[8]);
460 glColor4ub(132,160,148,(unsigned char)(32*sin(j_radius
*3.0f
)));
461 glTranslatef(j_radius
*1.25f
,0,0);
465 glLoadIdentity(); // LUNA
466 glTranslatef(.55f
+3.0f
*cos(.35+j_radius
/2),.4f
+1.25*sin(.35+j_radius
/2),-5);
467 glRotatef(-45,0,0,1);
468 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
469 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[6]);
471 glColor4ub(255,255,255,(unsigned char)(53.3*j_radius
));
474 } //*************************************************************************************************
475 else //*************************************************************************************************
478 glTranslatef(0.0f
,0.75f
,j_zeta
-2.0f
);
479 glRotatef(80,1.0f
,0.0f
,0.0f
);
480 glRotatef(0,0.0f
,1.0f
,0.0f
);
481 glRotatef(-90,0.0f
,0.0f
,1.0f
);
482 glBlendFunc(GL_SRC_ALPHA
, GL_ONE
);
483 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[4]);
486 glTranslatef(0,1.25,-5);
489 j_drawquad3(255,6.0,2.5); // STELLE
490 j_drawquad3(255,6.0,2.5); // STELLE
491 glBlendFunc(GL_ZERO
,GL_ONE_MINUS_SRC_COLOR
);
492 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[10]);
494 j_drawquad6(192,6.0,2.5);
498 j_drawquad3((int)(50+205*(2*(j_radius
-1.5))),6.0,2.5);
499 j_drawquad3((int)(50+205*(2*(j_radius
-1.5))),6.0,2.5);
500 glBlendFunc(GL_ZERO
,GL_ONE_MINUS_SRC_COLOR
);
501 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[10]);
503 j_drawquad6((int)(192*(2*(j_radius
-1.5))),6.0,2.5);
505 glLoadIdentity(); // LUNA
506 glTranslatef(.55f
+3.0f
*cos(.35+j_radius
/2),.4f
+1.25*sin(.35+j_radius
/2),-5);
507 glRotatef(-45,0,0,1);
508 glColor4ub(255,255,255,255);
509 glBlendFunc(GL_DST_COLOR
,GL_ZERO
);
510 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[5]);
513 glColor4ub(255,255,255,255);
514 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
515 //glBindTexture(GL_TEXTURE_2D,j_Text[ure[3]);
520 glTranslatef(0.0f
,0.75f
,j_zeta
-2.0f
);
521 glRotatef(80,1.0f
,0.0f
,0.0f
);
522 glRotatef(0,0.0f
,1.0f
,0.0f
);
523 glRotatef(-90,0.0f
,0.0f
,1.0f
);
525 glDisable(GL_TEXTURE_2D
);
528 glTranslatef(0,1.4,j_zeta
-2.0f
);
529 //glRotatef(-90+j_zrot,0.0f,0.0f,1.0f);
530 glRotatef(-90,0,0,1);
531 j_drawquad10(100,3,10);
533 glEnable(GL_TEXTURE_2D
);
535 glBlendFunc(GL_SRC_ALPHA
, GL_ONE_MINUS_SRC_COLOR
);
536 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[0]);
538 j_drawquad1(100,10,15); // NUVOLE
539 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[1]);
541 j_drawquad2(255,64,10,15); // NUVOLE
543 glLoadIdentity(); // LUNA
544 glTranslatef(.55f
+3.0f
*cos(.35+j_radius
/2),.4f
+1.25*sin(.35+j_radius
/2),-5);
545 glRotatef(-45,0,0,1);
546 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
547 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[6]);
549 glColor4ub(255,255,255,80);
554 glTranslatef(0,.05,-8);
555 glBlendFunc(GL_ZERO
,GL_ONE_MINUS_SRC_COLOR
);
556 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[12]);
559 glScalef (.51,-10,1);
560 glColor4ub(255,255,255,255);
564 glTranslatef(-.035,-.645,-3);
566 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[14]);
569 glScalef(1.2,-3.4,1);
570 if (j_radius
<3.9f
) glColor4ub((unsigned char)(192-192*j_radius
/4),(unsigned char)(192-192*j_radius
/4),(unsigned char)(192-192*j_radius
/4),255);
571 else glColor4ub((unsigned char)(192-192*3.9f
/4),(unsigned char)(192-192*3.9f
/4),(unsigned char)(192-192*3.9f
/4),255);
575 if ((j_radius
>.8f
)&&(j_radius
<1.115))
578 glTranslatef(-2.5,.05,-5);
579 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
580 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[9]);
582 glColor4ub(255,255,255,(unsigned char)(160*sin((j_radius
-.8f
)*10)*sin((j_radius
-.8f
)*10)));
588 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[15]);
590 glTranslatef(0,.5,-10);
591 glRotatef(1.5,1,0,0);
593 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
594 for (int i
=0; i
<j_num
; i
++)
597 glTranslatef(-1+parts
[i
].j_x
/2.3,-.6-parts
[i
].j_y
/10,0);
598 glColor4ub(parts
[i
].r
,parts
[i
].g
,parts
[i
].b
,(unsigned char)(j_max
*j_max
*parts
[i
].a
*(.75+.25*sin(parts
[i
].phase
+j_radius
*(i
)))));
599 glRotatef(j_radius
*200,0,0,1);
600 j_drawquad(parts
[i
].rad
/8);
604 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[13]);
606 glTranslatef(-5,-1.2,-10);
608 for (int i
=0; i
<10; i
++)
611 glTranslatef(i
*.75,0,0);
612 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
613 glRotatef(-90,1,0,0);
614 j_drawtrail(5,-90,.9f
,255,128,96,255);
618 glTranslatef(6,.2,6);
620 for (int i
=0; i
<5; i
++)
623 glTranslatef(i
*.25,.1,0);
624 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
625 glRotatef(-88,1,0,0);
626 j_drawtrail(3,-88,1.5f
,255,192,128,255);
630 glTranslatef(-2.5,.2,0);
631 glRotatef(-55,0,1,0);
632 for (int i
=0; i
<10; i
++)
635 glTranslatef(i
*.35,0,0);
636 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
637 glRotatef(-84,1,0,0);
638 j_drawtrail(2,-84,1.5f
,192,212,255,255);
642 glTranslatef(-1,-.27,0);
644 for (int i
=0; i
<8; i
++)
647 glTranslatef(i
*.2,0,0);
648 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
649 glRotatef(-85,1,0,0);
650 j_drawtrail(3,-85,2.5f
,192,212,255,255);
655 glTranslatef(-1.77,-.24,-5);
658 glRotatef(30*sin(j_radius
*10),0,0,1);
660 glTranslatef(0,.5,0);
661 glColor4ub(128,128,128,(unsigned char)(128*j_max
));
666 glRotatef(20*sin(1+j_radius
*15),0,0,1);
668 glTranslatef(0,.5,0);
669 glColor4ub(128,128,128,(unsigned char)(128*j_max
*j_max
));
674 glRotatef(20*sin(2+j_radius
*25),0,0,1);
676 glTranslatef(0,.5,0);
677 glColor4ub(128,128,128,(unsigned char)(128*j_max
*j_max
*j_max
));
682 glTranslatef(-.1,-.075,-1);
683 //glDisable(GL_TEXTURE_2D);
686 //glBegin(GL_POINTS);
687 for (int i
=0; i
<j_num
/5; i
++)
690 time
=(j_time
-parts
[i
].init
)/250000.0f
;
692 GLfloat alpha
=parts
[i
].a
;
693 if (parts
[i
].xp
>.2f
) alpha
=parts
[i
].a
*(1.0f
-(parts
[i
].xp
-.2f
)*50.0f
);
694 if (parts
[i
].xp
<-.23f
) alpha
=parts
[i
].a
*(1.0f
-(-parts
[i
].xp
-.23f
)*50.0f
);
696 if (alpha
<0) alpha
=0;
699 if (parts
[i
].xp
>0.0f
) glColor4ub((unsigned char)(128+127*parts
[i
].xp
*4), (unsigned char)(128-128*parts
[i
].xp
*4), (unsigned char)(128-128*parts
[i
].xp
*4),(unsigned char)(alpha
));
700 else glColor4ub(128,128,128,(unsigned char)(alpha
));
701 //if (parts[i].xp>0.0f) glColor4ub(255*parts[i].xp*4,255-255*parts[i].xp*4,255-255*parts[i].xp*4,alpha);
702 //else glColor4ub(255,255,255,alpha);
703 //glVertex3f(parts[i].xp,.3*parts[i].xp*parts[i].xp,0);
704 if (parts
[i
].xp
>.22f
)
706 parts
[i
].spd
=.25+.0025*((GLfloat
)(rand()%1000));
708 parts
[i
].init
=(long int)j_time
;
711 parts
[i
].xp
=-.25f
+parts
[i
].spd
*time
;
715 if (parts
[i
].xp
<0.0f
) glColor4ub((unsigned char)(128-127*parts
[i
].xp
*4), (unsigned char)(128+128*parts
[i
].xp
*4), (unsigned char)(128+128*parts
[i
].xp
*4), (unsigned char)(alpha
));
716 else glColor4ub(128,128,128,(unsigned char)(alpha
));
717 //if (parts[i].xp<0.0f) glColor4ub(255-255*parts[i].xp*4,255*parts[i].xp*4,255*parts[i].xp*4,alpha);
718 //else glColor4ub(255,255,255,alpha);
719 //glVertex3f(parts[i].xp,.3*parts[i].xp*parts[i].xp,0);
721 if (parts
[i
].xp
<-.25f
)
723 parts
[i
].spd
=.25+.0025*((GLfloat
)(rand()%1000));
725 parts
[i
].init
=(long int)j_time
;
729 parts
[i
].xp
=.22f
-parts
[i
].spd
*time
;
732 glTranslatef(parts
[i
].xp
,.3*parts
[i
].xp
*parts
[i
].xp
,0);
740 GLfloat credinit
=-.6f
;
741 glEnable(GL_TEXTURE_2D
);
742 glBlendFunc(GL_ZERO
,GL_ONE_MINUS_SRC_COLOR
);
743 glColor4f(.75,.75,.75,1);
747 glTranslatef(1.1,0,-3.0f
);
748 j_drawcred(.45,1.25,credinit
+j_radius
/3.1f
,.9f
);
750 glTexParameterf(GL_TEXTURE_2D
,GL_TEXTURE_MIN_FILTER
, GL_LINEAR
);
751 //glBindTexture(GL_TEXTURE_2D, j_Text[ure[1]);
752 glBlendFunc(GL_SRC_ALPHA
,GL_ONE
);
754 j_drawcred(.45,1.25,credinit
+j_radius
/3.1f
,.9f
);
755 glTexParameterf(GL_TEXTURE_2D
,GL_TEXTURE_MIN_FILTER
, GL_LINEAR_MIPMAP_NEAREST
);
756 glEnable(GL_TEXTURE_2D
);
763 if (j_FogColor
[0]>0.2f
) j_FogColor
[0]=1.0f
-(j_radius
-lime
);
764 if (j_FogColor
[1]>0.2f
) j_FogColor
[1]= .8f
-(j_radius
-lime
)*.9f
;
765 if (j_FogColor
[2]>0.2f
) j_FogColor
[2]= .5f
-(j_radius
-lime
)*.5f
;
767 glClearColor(.07f
-j_radius
/5.0f
, 0.1f
-j_radius
/5.0f
, 0.25f
-j_radius
/5.0f
, 0.0f
);
768 if ((j_radius
>.5f
)&&(j_radius
<1.5f
)) j_max
=j_radius
-.5f
;
772 GLfloat j_fader
=.5f
*(1.0f
+cos(j_radius
*3.1415f
/.075f
));
773 glDisable(GL_TEXTURE_2D
);
775 glTranslatef(0,0,-1.0f
);
776 glColor4f(1,1,1,j_fader
);
778 glEnable(GL_TEXTURE_2D
);
782 GLfloat j_fader
=.5f
*(1.0f
-cos((j_radius
-4.25f
)*3.1415f
/.5f
));
783 glDisable(GL_TEXTURE_2D
);
784 glBlendFunc(GL_ZERO
,GL_ONE_MINUS_SRC_ALPHA
);
786 glTranslatef(0,0,-1.0f
);
787 glColor4f(1,1,1,j_fader
);
789 glEnable(GL_TEXTURE_2D
);
793 //******************** FINISH
797 /* if ((j_radius>1.32)&&(th[0]))
800 FSOUND_PlaySound(FSOUND_FREE, th1);
801 FSOUND_PlaySound(FSOUND_FREE, th1);
802 FSOUND_PlaySound(FSOUND_FREE, th1);
804 if ((j_radius>1.48)&&(th[1]))
807 FSOUND_PlaySound(FSOUND_FREE, th2);
808 FSOUND_PlaySound(FSOUND_FREE, th2);
809 FSOUND_PlaySound(FSOUND_FREE, th2);