Mercurial > hg > forks > gldragon
diff gldragon.cpp @ 69:267b3fd2c98c
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 16 Dec 2019 06:51:40 +0200 |
parents | 1327ef5dc9fb |
children | 03aa729a9e90 |
line wrap: on
line diff
--- a/gldragon.cpp Mon Dec 16 06:46:46 2019 +0200 +++ b/gldragon.cpp Mon Dec 16 06:51:40 2019 +0200 @@ -322,11 +322,9 @@ // Return true if a full rotation was done totalFrames++; - if (cycleFrames++ == SET_FRAMES) + cycleFrames++; + if (cycleFrames >= SET_FRAMES) { - // Reset cycleFrames - cycleFrames = 0; - // Get the time it took to render a full turn int cycleEnd = SDL_GetTicks(); double cycleTime = cycleEnd - cycleStart; @@ -336,7 +334,10 @@ // Print the current frames per second printf("%.1lf ms for %d frames = %.1lf FPS\n", - cycleTime, SET_FRAMES, (SET_FRAMES * 1000.0f) / cycleTime); + cycleTime, cycleFrames, (cycleFrames * 1000.0f) / cycleTime); + + // Reset cycleFrames + cycleFrames = 0; } }