Back out the minimap aspect ratio preservation hack,

describing why it's probably not a good idea before the next point
release.
This commit is contained in:
Eric S. Raymond 2007-09-16 10:27:55 +00:00
parent f97d1cfc94
commit 087c81c18d

View file

@ -95,14 +95,25 @@ surface getMinimap(int w, int h, const gamemap& map, const viewpoint* vw)
if((minimap->w != w || minimap->h != h) && w != 0 && h != 0) {
const surface surf(minimap);
float sw = 1.0, sh = 1.0;
#if 0
// preserve the aspect ratio of the original map rather than
// distorting it to fit the minimap window.
//
// This needs more work. There are at least two issues:
// (1) the part of the minimap window outside the scaled map
// needs to be blacked out/invalidated.
// (2) the rather nasty code in draw_minimap_units needs to
// change.
float sw = 1.0, sh = 1.0;
if (minimap->h < minimap->w) sh = (minimap->h*1.0)/minimap->w;
if (minimap->w < minimap->h) sw = (minimap->w*1.0)/minimap->h;
w = int(w * sw);
h = int(h * sh);
#endif
minimap = surface(scale_surface(surf,int(w * sw),int(h * sh)));
minimap = surface(scale_surface(surf,w,h));
}
LOG_DP << "done generating minimap\n";