diff --git a/source/glest_game/graphics/renderer.cpp b/source/glest_game/graphics/renderer.cpp index 2f4ddfe6..89f666eb 100644 --- a/source/glest_game/graphics/renderer.cpp +++ b/source/glest_game/graphics/renderer.cpp @@ -4457,6 +4457,7 @@ void Renderer::renderMapPreview( const MapPreview *map, bool renderAll, float playerCrossSize = 2; float clientW = renderMapWidth * cellSize; float clientH = renderMapHeight * cellSize;; + float minDimension = std::min(metrics.getVirtualW(), metrics.getVirtualH()); // stretch small maps to 128x128 if(map->getW() < map->getH()) { @@ -4477,7 +4478,7 @@ void Renderer::renderMapPreview( const MapPreview *map, bool renderAll, Texture2DGl *texture = static_cast(*renderToTexture); texture->setMipmap(false); Pixmap2D *pixmapScreenShot = texture->getPixmap(); - pixmapScreenShot->init(metrics.getVirtualW(), metrics.getVirtualH(), 4); + pixmapScreenShot->init(minDimension, minDimension, 4); texture->setForceCompressionDisabled(true); texture->init(textureFilter,maxAnisotropy); texture->setup_FBO_RBO(); @@ -4492,8 +4493,8 @@ void Renderer::renderMapPreview( const MapPreview *map, bool renderAll, if(supportFBOs == true && renderToTexture != NULL) { cellSize =1; - clientW = metrics.getVirtualW(); - clientH = metrics.getVirtualH(); + clientW = minDimension; + clientH = minDimension; int mapMaxDimensionSize = std::max(map->getW(),map->getH()); switch(mapMaxDimensionSize) { case 8: diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index 5181d634..78cc2709 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -1214,7 +1214,7 @@ void MenuStateCustomGame::render() { renderer.renderTextureQuad(800,600,200,150,factionTexture,0.7f); } if(mapPreviewTexture != NULL) { - renderer.renderTextureQuad(5,165,180,180,mapPreviewTexture,1.0f); + renderer.renderTextureQuad(5,185,150,150,mapPreviewTexture,1.0f); //printf("=================> Rendering map preview texture\n"); }