From 3bb33b044dbaf27fc91a9dca1810445a3fc6f4cc Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Sun, 17 Aug 2014 03:09:35 +0200 Subject: [PATCH] Render SDL lightmaps at lower resolutions, as specified by LIGHTMAP_DIV --- src/video/sdl/sdl_lightmap.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/video/sdl/sdl_lightmap.cpp b/src/video/sdl/sdl_lightmap.cpp index 641e8ad89..e27e18634 100644 --- a/src/video/sdl/sdl_lightmap.cpp +++ b/src/video/sdl/sdl_lightmap.cpp @@ -38,7 +38,8 @@ SDLLightmap::SDLLightmap() : texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGB888, SDL_TEXTUREACCESS_TARGET, - width, height); + width / LIGHTMAP_DIV, + height / LIGHTMAP_DIV); if (!texture) { std::stringstream msg; @@ -63,11 +64,13 @@ SDLLightmap::start_draw(const Color &ambient_color) SDL_SetRenderDrawColor(renderer, r, g, b, 255); SDL_RenderClear(renderer); + SDL_RenderSetScale(renderer, 1.0f / LIGHTMAP_DIV, 1.0f / LIGHTMAP_DIV); } void SDLLightmap::end_draw() { + SDL_RenderSetScale(renderer, 1.0f, 1.0f); SDL_SetRenderTarget(renderer, NULL); } -- 2.11.0