From 3680049510ab7380220571c3e568171505665330 Mon Sep 17 00:00:00 2001 From: Patryk Obara Date: Tue, 14 Apr 2020 01:01:46 +0200 Subject: [PATCH] Replace Bitu with size_t when drawing surface --- src/gui/sdlmain.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 212aa673..2bef34b8 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -1613,12 +1613,13 @@ void GFX_EndUpdate( const Bit16u *changedLines ) { case SCREEN_SURFACE: if (changedLines) { int y = 0; - Bitu index = 0, rectCount = 0; + size_t index = 0; + size_t rect_count = 0; while (y < sdl.draw.height) { if (!(index & 1)) { y += changedLines[index]; } else { - SDL_Rect *rect = &sdl.updateRects[rectCount++]; + SDL_Rect *rect = &sdl.updateRects[rect_count++]; rect->x = sdl.clip.x; rect->y = sdl.clip.y + y; rect->w = sdl.draw.width; @@ -1627,8 +1628,10 @@ void GFX_EndUpdate( const Bit16u *changedLines ) { } index++; } - if (rectCount) - SDL_UpdateWindowSurfaceRects(sdl.window, sdl.updateRects, rectCount); + if (rect_count) + SDL_UpdateWindowSurfaceRects(sdl.window, + sdl.updateRects, + rect_count); } break; }