* When drawing the FPS "timer/display" (or whatever you wish to call it) don't make assumptions about the text's size

* Instead use iV_GetTextWidth & iV_GetTextHeight to find out...


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3084 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2007-12-16 21:09:34 +00:00
parent 77644a9dbd
commit fa329f1b21
1 changed files with 8 additions and 1 deletions

View File

@ -358,7 +358,14 @@ void draw3DScene( void )
}
if (showFPS)
{
iV_DrawTextF(pie_GetVideoBufferWidth() - 114, 472 + E_H, "FPS: %u", frameGetAverageRate());
unsigned int width, height;
const char* fps;
sasprintf((char**)&fps, "FPS: %02u", frameGetAverageRate());
width = iV_GetTextWidth(fps) + 10;
height = iV_GetTextHeight(fps);
iV_DrawText(fps, pie_GetVideoBufferWidth() - width, pie_GetVideoBufferHeight() - height);
}
if(getDebugMappingStatus() && !demoGetStatus() && !gamePaused())
{