From f8670f22ed21c1806422e73822a16dc3d204e3fc Mon Sep 17 00:00:00 2001 From: avolkov Date: Tue, 9 Jan 2007 07:58:22 +0000 Subject: [PATCH] VC6 does not allow ptr arithmetic on void*; casting pixels to Uint32* for cleaner ptr arith git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2651 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/graphics/sdl/opengl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sc2/src/sc2code/libs/graphics/sdl/opengl.c b/sc2/src/sc2code/libs/graphics/sdl/opengl.c index 7f893b828..1bdf5316e 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/opengl.c +++ b/sc2/src/sc2code/libs/graphics/sdl/opengl.c @@ -348,8 +348,8 @@ TFB_GL_SwapBuffers (int force_full_redraw) SDL_LockSurface (scaled_display); glTexSubImage2D (GL_TEXTURE_2D, 0, updated.x * 2, updated.y * 2, updated.w * 2, updated.h * 2, GL_RGBA, GL_UNSIGNED_BYTE, - scaled_display->pixels + - (updated.y * 16 * ScreenWidth + updated.x * 8)); + (Uint32*)scaled_display->pixels + + (updated.y * 4 * ScreenWidth + updated.x * 2)); SDL_UnlockSurface (scaled_display); } else @@ -362,8 +362,8 @@ TFB_GL_SwapBuffers (int force_full_redraw) SDL_LockSurface (SDL_Screen); glTexSubImage2D (GL_TEXTURE_2D, 0, updated.x, updated.y, updated.w, updated.h, GL_RGBA, GL_UNSIGNED_BYTE, - SDL_Screen->pixels + - (updated.y * 4 * ScreenWidth + updated.x * 4)); + (Uint32*)SDL_Screen->pixels + + (updated.y * ScreenWidth + updated.x)); SDL_UnlockSurface (SDL_Screen); } }