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-861f7616d084master
parent
be7e5ce951
commit
f9e5517b67
12
src/radar.c
12
src/radar.c
|
@ -97,8 +97,16 @@ static void radarSize(int ZoomLevel)
|
||||||
float zoom = (float)ZoomLevel * RadarZoomMultiplier / 16.0;
|
float zoom = (float)ZoomLevel * RadarZoomMultiplier / 16.0;
|
||||||
radarWidth = radarTexWidth * zoom;
|
radarWidth = radarTexWidth * zoom;
|
||||||
radarHeight = radarTexHeight * zoom;
|
radarHeight = radarTexHeight * zoom;
|
||||||
radarCenterX = pie_GetVideoBufferWidth() - BASE_GAP * 4 - MAX(radarHeight, radarWidth)/2;
|
if (rotateRadar)
|
||||||
radarCenterY = pie_GetVideoBufferHeight() - BASE_GAP * 4 - MAX(radarWidth, radarHeight)/2;
|
{
|
||||||
|
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);
|
debug(LOG_WZ, "radar=(%u,%u) tex=(%u,%u) size=(%u,%u)", radarCenterX, radarCenterY, radarTexWidth, radarTexHeight, radarWidth, radarHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue