00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _TIMER_H
00026
00027 #include <stdio.h>
00028 #include <GL/gl.h>
00029 #include <GL/glu.h>
00030 #include <SDL/SDL.h>
00031 #ifdef __APPLE__
00032 #include <SDL_image/SDL_image.h>
00033 #else
00034 #include <SDL/SDL_image.h>
00035 #endif
00036 #include <string>
00037 #include <iostream>
00038 #include <fstream>
00039 #include <cmath>
00040 #include <cassert>
00041
00042 using namespace std;
00043
00044 #include "font.h"
00045 #include "utility.h"
00046 #include "gamestate.h"
00047 #include "settings.h"
00048 #include "globals.h"
00049
00050 #define STAGING_TIME 4.0
00051
00052 class TIMER
00053 {
00054 private:
00055 double time;
00056 double pretime;
00057 double lastlap;
00058 double bestlap;
00059 void SecsToSecsMin(double t, float &secs, int &min);
00060 TEXTURE_HANDLE timerbox;
00061
00062 bool loaded;
00063
00064 public:
00065 TIMER();
00066 ~TIMER();
00067 void Load();
00068 void Reset();
00069 void Lap(bool storelastlap);
00070 float GetTimer();
00071 void TickTimer(float timefactor, float fps);
00072 void ResetBest();
00073 void ResetLast();
00074
00075 void Draw();
00076 };
00077
00078 #define _TIMER_H
00079 #endif