85
84
for (i = 0; i < dEmitters; i++) {
86
85
emitters[i] = new float[3];
88
emitters[i][0] = myRandf (60.0f) - 30.0f;
89
emitters[i][1] = myRandf (60.0f) - 30.0f;
90
emitters[i][2] = myRandf (30.0f) - 15.0f;
87
emitters[i][0] = rsRandf (60.0f) - 30.0f;
88
emitters[i][1] = rsRandf (60.0f) - 30.0f;
89
emitters[i][2] = rsRandf (30.0f) - 15.0f;
93
92
particles = new float *[dParticles];
165
164
for (i = 0; i < dEmitters; i++) {
166
165
emitters[i][2] += evel; // emitter moves toward viewer
167
166
if (emitters[i][2] > 15.0f) { // reset emitter
168
emitters[i][0] = myRandf (60.0f) - 30.0f;
169
emitters[i][1] = myRandf (60.0f) - 30.0f;
167
emitters[i][0] = rsRandf (60.0f) - 30.0f;
168
emitters[i][1] = rsRandf (60.0f) - 30.0f;
170
169
emitters[i][2] = -15.0f;
172
171
particles[whichparticle][0] = emitters[i][0];
266
void hack_draw (xstuff_t * XStuff)
265
void hack_draw (xstuff_t * XStuff, double currentTime, float frameTime)
273
270
glClear (GL_COLOR_BUFFER_BIT);
275
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
276
glColor4f (0.0f, 0.0f, 0.0f, 0.5f - (float (dBlur) * 0.0049f));
278
glVertex3f (-40.0f, -17.0f, 0.0f);
279
glVertex3f (40.0f, -17.0f, 0.0f);
280
glVertex3f (40.0f, 17.0f, 0.0f);
281
glVertex3f (-40.0f, 17.0f, 0.0f);
284
glBlendFunc (GL_ONE, GL_ONE);
286
glBlendFunc (GL_SRC_ALPHA, GL_ONE); // Necessary for point and
288
// line smoothing (I don't
290
// Maybe it's just my video card...
272
glMatrixMode(GL_PROJECTION);
275
glOrtho(0.0, 1.0, 0.0, 1.0, 1.0, -1.0);
276
glMatrixMode(GL_MODELVIEW);
278
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
279
glColor4f(0.0f, 0.0f, 0.0f, 0.5f - (float(dBlur) * 0.0049f));
280
glBegin(GL_TRIANGLE_STRIP);
281
glVertex3f(0.0f, 0.0f, 0.0f);
282
glVertex3f(1.0f, 0.0f, 0.0f);
283
glVertex3f(0.0f, 1.0f, 0.0f);
284
glVertex3f(1.0f, 1.0f, 0.0f);
287
glBlendFunc(GL_ONE, GL_ONE);
289
glBlendFunc(GL_SRC_ALPHA, GL_ONE); // Necessary for point and line smoothing (I don't know why)
290
// Maybe it's just my video card...
291
glMatrixMode(GL_PROJECTION);
295
glMatrixMode(GL_MODELVIEW);
297
glTranslatef(0.0, 0.0, -15.0);
293
299
// You should need to draw twice if using blur, once to each buffer.
294
300
// But wglSwapLayerBuffers appears to copy the back to the
295
301
// front instead of just switching the pointers to them. It turns