From: Ingo Ruhnke Date: Fri, 29 Aug 2014 05:57:07 +0000 (+0200) Subject: Fixed SDLLightmap::get_light() X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=98eb08a125491e17546d98843c9bdb8db88adc6f;p=supertux.git Fixed SDLLightmap::get_light() Coordinates were upside down and brought the resolution in line with OpenGL. --- diff --git a/src/video/sdl/sdl_lightmap.cpp b/src/video/sdl/sdl_lightmap.cpp index 68dc08529..1d7f6c43e 100644 --- a/src/video/sdl/sdl_lightmap.cpp +++ b/src/video/sdl/sdl_lightmap.cpp @@ -29,7 +29,7 @@ SDLLightmap::SDLLightmap() : m_height(), m_LIGHTMAP_DIV() { - m_LIGHTMAP_DIV = 8; + m_LIGHTMAP_DIV = 5; m_width = SCREEN_WIDTH; m_height = SCREEN_HEIGHT; @@ -118,8 +118,8 @@ SDLLightmap::get_light(const DrawingRequest& request) const = static_cast(request.request_data); SDL_Rect rect; - rect.x = static_cast(request.pos.x * m_width / SCREEN_WIDTH); - rect.y = static_cast(request.pos.y * m_height / SCREEN_HEIGHT); + rect.x = static_cast(request.pos.x / m_LIGHTMAP_DIV); + rect.y = static_cast((m_height - request.pos.y) / m_LIGHTMAP_DIV); rect.w = 1; rect.h = 1;