~ubuntu-branches/ubuntu/gutsy/rss-glx/gutsy

« back to all changes in this revision

Viewing changes to other_src/biof.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2005-11-30 18:21:27 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20051130182127-5iww7elbiyzej1lk
Tags: upstream-0.8.0
ImportĀ upstreamĀ versionĀ 0.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include <math.h>
22
22
#include <stdio.h>
23
23
#include <stdlib.h>
24
 
#include <time.h>
25
24
#include <GL/gl.h>
26
25
#include <GL/glu.h>
27
 
#include <sys/time.h>
28
26
 
29
27
#include "driver.h"
30
28
#include "rsRand.h"
172
170
                gluDeleteQuadric(shapes);
173
171
}
174
172
 
175
 
void hack_draw (xstuff_t * XStuff)
 
173
void hack_draw (xstuff_t * XStuff, double currentTime, float lastFrameDuration)
176
174
{
177
 
        struct timeval now;
178
 
        double dt;
179
 
 
180
 
        gettimeofday (&now, NULL);
181
 
 
182
 
        dt = (now.tv_sec * 1000000 + now.tv_usec) * 0.000001;
183
 
 
184
175
        if (dGeometry == LIGHTMAP) {
185
176
                int i, j, offset;
186
177
                float fb_buffer[NRPOINTS * NRLINES * 3];
197
188
                gluLookAt (200, 0, 0, 0, 0, 0, 0, 0, 1);
198
189
 
199
190
                glRotated (90, 0, 1, 0);
200
 
                glRotated (10 * dt, 0, 0, 1);
 
191
                glRotated (10 * currentTime, 0, 0, 1);
201
192
 
202
193
                glNewList (1, GL_COMPILE);
203
 
                Horn (NRPOINTS, 315 * sin (dt * 0.237), 45 /* + 20 * sin(dt * 0.133) */ , 1500 * sin (dt * 0.213), 7.5 + 2.5 * sin (dt * 0.173), 1);
 
194
                Horn (NRPOINTS, 315 * sin (currentTime * 0.237), 45 /* + 20 * sin(currentTime * 0.133) */ , 1500 * sin (currentTime * 0.213), 7.5 + 2.5 * sin (currentTime * 0.173), 1);
204
195
                glEndList ();
205
196
 
206
197
                if (dOffAngle)
283
274
 
284
275
                glPushMatrix ();
285
276
                glRotated (90, 0, 1, 0);
286
 
                glRotated (10 * dt, 0, 0, 1);
 
277
                glRotated (10 * currentTime, 0, 0, 1);
287
278
 
288
279
                glColor3d (0.9, 0.7, 0.5);
289
280
 
290
281
                glNewList (1, GL_COMPILE);
291
 
                Horn (NRPOINTS, 315 * sin (dt * 0.237), 50 + 20 * sin (dt * 0.133), 1500 * sin (dt * 0.213), 7.5 + 2.5 * sin (dt * 0.173), 0.6 + 0.1 * sin (dt * 0.317));
 
282
                Horn (NRPOINTS, 315 * sin (currentTime * 0.237), 50 + 20 * sin (currentTime * 0.133), 1500 * sin (currentTime * 0.213), 7.5 + 2.5 * sin (currentTime * 0.173), 0.6 + 0.1 * sin (currentTime * 0.317));
292
283
                glEndList ();
293
284
 
294
285
                if (dOffAngle)
408
399
        }
409
400
 
410
401
        if (!change_flag) {
411
 
                dGeometry = myRandi (5) + 1;
412
 
                dOffAngle = myRandi (2);
 
402
                dGeometry = rsRandi (5) + 1;
 
403
                dOffAngle = rsRandi (2);
413
404
 
414
405
                switch (dGeometry) {
415
406
                case TRIANGLES:
416
407
                case SPHERES:
417
 
                        NRLINES = myRandi (7) + 2;
418
 
                        NRPOINTS = myRandi (96) + 32;
 
408
                        NRLINES = rsRandi (7) + 2;
 
409
                        NRPOINTS = rsRandi (96) + 32;
419
410
                        break;
420
411
 
421
412
                case BIGSPHERES:
422
 
                        NRLINES = myRandi (7) + 4;
423
 
                        NRPOINTS = myRandi (32) + 4;
 
413
                        NRLINES = rsRandi (7) + 4;
 
414
                        NRPOINTS = rsRandi (32) + 4;
424
415
                        break;
425
416
 
426
417
                case POINTS:
427
418
                case LIGHTMAP:
428
 
                        NRLINES = myRandi (32) + 4;
429
 
                        NRPOINTS = myRandi (64) + 64;
 
419
                        NRLINES = rsRandi (32) + 4;
 
420
                        NRPOINTS = rsRandi (64) + 64;
430
421
                }
431
422
        }
432
423
}