From: Ingo Ruhnke Date: Sun, 17 Aug 2014 01:09:35 +0000 (+0200) Subject: Render SDL lightmaps at lower resolutions, as specified by LIGHTMAP_DIV X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=3bb33b044dbaf27fc91a9dca1810445a3fc6f4cc;p=supertux.git Render SDL lightmaps at lower resolutions, as specified by LIGHTMAP_DIV --- 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); }