Changeset 617
- Timestamp:
- Feb 9, 2011, 12:23:54 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/deushax/deushax.cpp
r616 r617 50 50 //SDL_WM_GrabInput(SDL_GRAB_ON); 51 51 52 Ticker::Setup(FPS); 53 52 54 /* Initialise OpenGL */ 53 55 Video::Setup(video->w, video->h); … … 76 78 Ticker::TickDraw(); 77 79 SDL_GL_SwapBuffers(); 78 Ticker::ClampFps( 1000.0f / FPS);80 Ticker::ClampFps(); 79 81 } 80 82 -
trunk/deushax/gtk/glmapview.cpp
r616 r617 122 122 gtk_widget_grab_focus(glarea); 123 123 if (gtk_gl_area_make_current(GTK_GL_AREA(glarea))) 124 { 125 Ticker::Setup(FPS); 124 126 Video::Setup(glarea->allocation.width, glarea->allocation.height); 127 } 125 128 126 129 UpdateAdjustments(); … … 156 159 157 160 // FIXME: do some GTK stuff in here 158 Ticker::ClampFps( 1000.0f / FPS);161 Ticker::ClampFps(); 159 162 } 160 163 -
trunk/monsterz/monsterz.cpp
r616 r617 52 52 SDL_ShowCursor(0); 53 53 54 /* Initialise OpenGL */ 54 /* Initialise everything */ 55 Ticker::Setup(FPS); 55 56 Video::Setup(video->w, video->h); 56 57 Audio::Setup(2); … … 75 76 Ticker::TickDraw(); 76 77 SDL_GL_SwapBuffers(); 77 Ticker::ClampFps( 1000.0f / FPS);78 Ticker::ClampFps(); 78 79 } 79 80 -
trunk/src/ticker.cpp
r616 r617 140 140 } 141 141 142 void Ticker::Setup(float fps) 143 { 144 data->fps = fps; 145 } 146 142 147 void Ticker::TickGame() 143 148 { … … 309 314 } 310 315 311 void Ticker::ClampFps( float deltams)316 void Ticker::ClampFps() 312 317 { 313 318 Profiler::Stop(Profiler::STAT_TICK_BLIT); 319 320 float deltams = data->fps ? 1000.0f / data->fps : 0.0f; 314 321 315 322 if (deltams > data->bias + 200.0f) -
trunk/src/ticker.h
r221 r617 29 29 static int Unref(Entity *entity); 30 30 31 static void Setup(float fps); 31 32 static void TickGame(); 32 33 static void TickDraw(); 33 static void ClampFps( float deltams);34 static void ClampFps(); 34 35 static int GetFrameNum(); 35 36
Note: See TracChangeset
for help on using the changeset viewer.