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

« back to all changes in this revision

Viewing changes to oglc_src/hufo_smoke.cpp

  • 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:
20
20
 
21
21
#include <math.h>
22
22
#include <stdio.h>
23
 
#include <time.h>
24
23
#include <GL/gl.h>
25
24
#include <GL/glu.h>
26
 
#include <sys/time.h>
27
25
 
28
26
#include "driver.h"
29
27
#include "rsRand.h"
113
111
}
114
112
 
115
113
// Draw all the scene related stuff.
116
 
void hack_draw (xstuff_t * XStuff)
 
114
void hack_draw (xstuff_t * XStuff, double currentTime, float frameTime)
117
115
{
118
 
        struct timeval now;
119
 
        static int lastTime = -1;
120
 
        float fDeltaTime;
121
 
 
122
 
        gettimeofday (&now, NULL);
123
 
 
124
 
        if (lastTime == -1) {
125
 
                fDeltaTime = 0;
126
 
        } else {
127
 
                fDeltaTime = (((now.tv_usec < lastTime) ? 1000000 : 0) + now.tv_usec - lastTime) * 0.000001f * TVit;
128
 
        }
129
 
        lastTime = now.tv_usec;
130
 
 
131
 
        TFire += fDeltaTime;
132
 
        CalcFire (TFire, fDeltaTime);   // animate the fire
 
116
        TFire += frameTime;
 
117
        CalcFire (TFire, frameTime);    // animate the fire
133
118
 
134
119
        glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
135
120
 
211
196
 
212
197
        if (!change_flag) {
213
198
                do {
214
 
                        fr = myRandf (256) / 256;
215
 
                        fg = myRandf (256) / 256;
216
 
                        fb = myRandf (256) / 256;
 
199
                        fr = rsRandf (256) / 256;
 
200
                        fg = rsRandf (256) / 256;
 
201
                        fb = rsRandf (256) / 256;
217
202
 
218
 
                        br = myRandi (256) / 256;
219
 
                        bg = myRandi (256) / 256;
220
 
                        bb = myRandi (256) / 256;
 
203
                        br = rsRandi (256) / 256;
 
204
                        bg = rsRandi (256) / 256;
 
205
                        bb = rsRandi (256) / 256;
221
206
                } while ((fr + fg + fb < 1) && (br + bg + bb < 1));
222
207
        }
223
208
}