Fixed build

This commit is contained in:
Sam Lantinga
2022-12-02 13:11:04 -08:00
parent 1878674477
commit 1a890808a4

View File

@@ -142,7 +142,8 @@ SDL_Color MooseColors[84] = {
/* *INDENT-ON* */ /* clang-format on */ /* *INDENT-ON* */ /* clang-format on */
static SDLTest_CommonState *state; static SDLTest_CommonState *state;
static Uint32 next_fps_check, frames; static Uint64 next_fps_check;
static Uint32 frames;
static const Uint32 fps_check_delay = 5000; static const Uint32 fps_check_delay = 5000;
SDL_Surface *MooseYUVSurfaces[MOOSEFRAMES_COUNT]; SDL_Surface *MooseYUVSurfaces[MOOSEFRAMES_COUNT];
@@ -216,7 +217,7 @@ void MoveSprites(SDL_Renderer *renderer)
void loop() void loop()
{ {
Uint32 now; Uint64 now;
int i; int i;
SDL_Event event; SDL_Event event;
@@ -273,9 +274,9 @@ void loop()
frames++; frames++;
now = SDL_GetTicks(); now = SDL_GetTicks();
if (SDL_TICKS_PASSED(now, next_fps_check)) { if (now >= next_fps_check) {
/* Print out some timing information */ /* Print out some timing information */
const Uint32 then = next_fps_check - fps_check_delay; const Uint64 then = next_fps_check - fps_check_delay;
const double fps = ((double)frames * 1000) / (now - then); const double fps = ((double)frames * 1000) / (now - then);
SDL_Log("%2.2f frames per second\n", fps); SDL_Log("%2.2f frames per second\n", fps);
next_fps_check = now + fps_check_delay; next_fps_check = now + fps_check_delay;