mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
[Fix] Revive FPS drawing overlay
To enable built-in FPS, change gbFPSDisplay to SHOW_FULL_FPS (1) in debugger (or change it in src code and rebuild).
This commit is contained in:
@@ -1009,6 +1009,12 @@ BOOLEAN UpdateVideoOverlay( VIDEO_OVERLAY_DESC *pTopmostDesc, UINT32 iBlitterInd
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( uiFlags & VOVERLAY_DESC_FONT )
|
||||||
|
{
|
||||||
|
gVideoOverlays[iBlitterIndex].uiFontID = pTopmostDesc->uiFontID;
|
||||||
|
gVideoOverlays[iBlitterIndex].ubFontBack = pTopmostDesc->ubFontBack;
|
||||||
|
gVideoOverlays[iBlitterIndex].ubFontFore = pTopmostDesc->ubFontFore;
|
||||||
|
}
|
||||||
|
|
||||||
if ( uiFlags & VOVERLAY_DESC_DISABLED )
|
if ( uiFlags & VOVERLAY_DESC_DISABLED )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,9 +15,10 @@
|
|||||||
#define VOVERLAY_STARTDISABLED 0x00000002
|
#define VOVERLAY_STARTDISABLED 0x00000002
|
||||||
|
|
||||||
|
|
||||||
#define VOVERLAY_DESC_TEXT 0x00001000
|
#define VOVERLAY_DESC_TEXT 0x00001000
|
||||||
#define VOVERLAY_DESC_DISABLED 0x00002000
|
#define VOVERLAY_DESC_DISABLED 0x00002000
|
||||||
#define VOVERLAY_DESC_POSITION 0x00004000
|
#define VOVERLAY_DESC_POSITION 0x00004000
|
||||||
|
#define VOVERLAY_DESC_FONT 0x00008000
|
||||||
|
|
||||||
// STRUCTURES
|
// STRUCTURES
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -166,6 +166,7 @@ UINT32 MainGameScreenInit(void)
|
|||||||
UnLockVideoSurface( FRAME_BUFFER);
|
UnLockVideoSurface( FRAME_BUFFER);
|
||||||
|
|
||||||
InitializeBackgroundRects();
|
InitializeBackgroundRects();
|
||||||
|
InitializeBaseDirtyRectQueue();
|
||||||
|
|
||||||
//EnvSetTimeInHours(ENV_TIME_12);
|
//EnvSetTimeInHours(ENV_TIME_12);
|
||||||
|
|
||||||
@@ -188,8 +189,8 @@ UINT32 MainGameScreenInit(void)
|
|||||||
giFPSOverlay = RegisterVideoOverlay( ( VOVERLAY_STARTDISABLED | VOVERLAY_DIRTYBYTEXT ), &VideoOverlayDesc );
|
giFPSOverlay = RegisterVideoOverlay( ( VOVERLAY_STARTDISABLED | VOVERLAY_DIRTYBYTEXT ), &VideoOverlayDesc );
|
||||||
|
|
||||||
// SECOND, PERIOD COUNTER
|
// SECOND, PERIOD COUNTER
|
||||||
VideoOverlayDesc.sLeft = 30;
|
VideoOverlayDesc.sLeft = 0;
|
||||||
VideoOverlayDesc.sTop = 0;
|
VideoOverlayDesc.sTop = 12;
|
||||||
VideoOverlayDesc.sX = VideoOverlayDesc.sLeft;
|
VideoOverlayDesc.sX = VideoOverlayDesc.sLeft;
|
||||||
VideoOverlayDesc.sY = VideoOverlayDesc.sTop;
|
VideoOverlayDesc.sY = VideoOverlayDesc.sTop;
|
||||||
swprintf( VideoOverlayDesc.pzText, L"Levelnodes: 100000" );
|
swprintf( VideoOverlayDesc.pzText, L"Levelnodes: 100000" );
|
||||||
|
|||||||
+15
-28
@@ -122,46 +122,33 @@ void DisplayFrameRate( )
|
|||||||
uiFrameCount = 0;
|
uiFrameCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create string
|
|
||||||
SetFont( SMALLFONT1 );
|
|
||||||
|
|
||||||
//DebugMsg(TOPIC_JA2, DBG_LEVEL_0, String( "FPS: %d ", __min( uiFPS, 1000 ) ) );
|
|
||||||
|
|
||||||
if ( uiFPS < 20 )
|
|
||||||
{
|
|
||||||
SetFontBackground( FONT_MCOLOR_BLACK );
|
|
||||||
SetFontForeground( FONT_MCOLOR_LTRED );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SetFontBackground( FONT_MCOLOR_BLACK );
|
|
||||||
SetFontForeground( FONT_MCOLOR_DKGRAY );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( gbFPSDisplay == SHOW_FULL_FPS )
|
if ( gbFPSDisplay == SHOW_FULL_FPS )
|
||||||
{
|
{
|
||||||
|
memset(&VideoOverlayDesc, 0, sizeof(VideoOverlayDesc));
|
||||||
|
|
||||||
// FRAME RATE
|
// FRAME RATE
|
||||||
memset( &VideoOverlayDesc, 0, sizeof( VideoOverlayDesc ) );
|
VideoOverlayDesc.uiFontID = SMALLFONT1;
|
||||||
swprintf( VideoOverlayDesc.pzText, L"%ld", __min( uiFPS, 1000 ) );
|
VideoOverlayDesc.ubFontBack = FONT_MCOLOR_BLACK;
|
||||||
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_TEXT;
|
VideoOverlayDesc.ubFontFore = uiFPS < 20 ? FONT_MCOLOR_LTRED : FONT_MCOLOR_DKGRAY;
|
||||||
|
swprintf( VideoOverlayDesc.pzText, L"FPS: %ld", __min( uiFPS, 1000 ) );
|
||||||
|
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_TEXT | VOVERLAY_DESC_FONT | VOVERLAY_DESC_DISABLED;
|
||||||
UpdateVideoOverlay( &VideoOverlayDesc, giFPSOverlay, FALSE );
|
UpdateVideoOverlay( &VideoOverlayDesc, giFPSOverlay, FALSE );
|
||||||
|
|
||||||
// TIMER COUNTER
|
// TIMER COUNTER
|
||||||
swprintf( VideoOverlayDesc.pzText, L"%ld", __min( giTimerDiag, 1000 ) );
|
swprintf( VideoOverlayDesc.pzText, L"Frame: %04ld ms", __min( giTimerDiag, 10000 ) );
|
||||||
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_TEXT;
|
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_TEXT | VOVERLAY_DESC_DISABLED;
|
||||||
UpdateVideoOverlay( &VideoOverlayDesc, giCounterPeriodOverlay, FALSE );
|
UpdateVideoOverlay( &VideoOverlayDesc, giCounterPeriodOverlay, FALSE );
|
||||||
|
|
||||||
|
//if( GetMouseMapPos( &usMapPos) )
|
||||||
if( GetMouseMapPos( &usMapPos) )
|
//{
|
||||||
{
|
|
||||||
//gprintfdirty( 0, 315, L"(%d)",sMapPos);
|
//gprintfdirty( 0, 315, L"(%d)",sMapPos);
|
||||||
//mprintf( 0,315,L"(%d)",sMapPos);
|
//mprintf( 0,315,L"(%d)",sMapPos);
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
//gprintfdirty( 0, 315, L"(%d %d)",gusMouseXPos, gusMouseYPos - INTERFACE_START_Y );
|
//gprintfdirty( 0, 315, L"(%d %d)",gusMouseXPos, gusMouseYPos - INTERFACE_START_Y );
|
||||||
//mprintf( 0,315,L"(%d %d)",gusMouseXPos, gusMouseYPos - INTERFACE_START_Y );
|
//mprintf( 0,315,L"(%d %d)",gusMouseXPos, gusMouseYPos - INTERFACE_START_Y );
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ( gTacticalStatus.uiFlags & GODMODE ) )
|
if ( ( gTacticalStatus.uiFlags & GODMODE ) )
|
||||||
|
|||||||
Reference in New Issue
Block a user