Fit the fixed radar into the corner.

The rotating radar needs space for rotation, and so position is calculated
using the longer side for non-square maps. The fixed radar doesn't need that
space, and so can be put snugly in the corner.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/branches/qt-trunk@10982 4a71c877-e1ca-e34f-864e-861f7616d084
master
Christian Ohm 2010-06-15 21:11:27 +00:00 committed by Git SVN Gateway
parent be7e5ce951
commit f9e5517b67
1 changed files with 10 additions and 2 deletions

View File

@ -97,8 +97,16 @@ static void radarSize(int ZoomLevel)
float zoom = (float)ZoomLevel * RadarZoomMultiplier / 16.0;
radarWidth = radarTexWidth * zoom;
radarHeight = radarTexHeight * zoom;
radarCenterX = pie_GetVideoBufferWidth() - BASE_GAP * 4 - MAX(radarHeight, radarWidth)/2;
radarCenterY = pie_GetVideoBufferHeight() - BASE_GAP * 4 - MAX(radarWidth, radarHeight)/2;
if (rotateRadar)
{
radarCenterX = pie_GetVideoBufferWidth() - BASE_GAP * 4 - MAX(radarHeight, radarWidth) / 2;
radarCenterY = pie_GetVideoBufferHeight() - BASE_GAP * 4 - MAX(radarWidth, radarHeight) / 2;
}
else
{
radarCenterX = pie_GetVideoBufferWidth() - BASE_GAP * 4 - radarWidth / 2;
radarCenterY = pie_GetVideoBufferHeight() - BASE_GAP * 4 - radarHeight / 2;
}
debug(LOG_WZ, "radar=(%u,%u) tex=(%u,%u) size=(%u,%u)", radarCenterX, radarCenterY, radarTexWidth, radarTexHeight, radarWidth, radarHeight);
}