diff options
Diffstat (limited to 'src/PowderToySDL.cpp')
| -rw-r--r-- | src/PowderToySDL.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/PowderToySDL.cpp b/src/PowderToySDL.cpp index 0229103..d268f57 100644 --- a/src/PowderToySDL.cpp +++ b/src/PowderToySDL.cpp @@ -129,6 +129,7 @@ return surface; int main(int argc, char * argv[]) { int elapsedTime = 0, currentTime = 0, lastTime = 0, currentFrame = 0; + unsigned int lastTick = 0; float fps = 0, delta = 1.0f; sdl_scrn = SDLOpen(); @@ -192,6 +193,13 @@ int main(int argc, char * argv[]) engine->Tick(); engine->Draw(); + if(SDL_GetTicks()-lastTick>1000) + { + //Run client tick every second + lastTick = SDL_GetTicks(); + Client::Ref().Tick(); + } + #ifdef OGLR blit(); #else |
