Skip to content

Commit

Permalink
Fixed SDLLightmap::get_light()
Browse files Browse the repository at this point in the history
Coordinates were upside down and brought the resolution in line with
OpenGL.
  • Loading branch information
Grumbel committed Aug 29, 2014
1 parent 8e4911b commit 98eb08a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/video/sdl/sdl_lightmap.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -118,8 +118,8 @@ SDLLightmap::get_light(const DrawingRequest& request) const
= static_cast<GetLightRequest*>(request.request_data);

SDL_Rect rect;
rect.x = static_cast<int>(request.pos.x * m_width / SCREEN_WIDTH);
rect.y = static_cast<int>(request.pos.y * m_height / SCREEN_HEIGHT);
rect.x = static_cast<int>(request.pos.x / m_LIGHTMAP_DIV);
rect.y = static_cast<int>((m_height - request.pos.y) / m_LIGHTMAP_DIV);
rect.w = 1;
rect.h = 1;

Expand Down

0 comments on commit 98eb08a

Please sign in to comment.