Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@ class GlobalData : public SubsystemInterface
Bool m_saveCameraInReplay;
Bool m_useCameraInReplay;

// TheSuperHackers @feature L3-M 05/09/2025 allow the network latency counter and render fps counter font size to be set, a size of zero disables them
Int m_networkLatencyFontSize;
Int m_renderFpsFontSize;
// TheSuperHackers @feature Mauller 21/06/2025 allow the system time and game time font size to be set, a size of zero disables them
Int m_systemTimeFontSize;
Int m_gameTimeFontSize;
Expand Down
2 changes: 2 additions & 0 deletions GeneralsMD/Code/GameEngine/Include/Common/UserPreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ class OptionPreferences : public UserPreferences
Int getCampaignDifficulty(void);
void setCampaignDifficulty( Int diff );

Int getNetworkLatencyFontSize(void);
Int getRenderFpsFontSize(void);
Int getSystemTimeFontSize(void);
Int getGameTimeFontSize(void);

Expand Down
32 changes: 31 additions & 1 deletion GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,8 @@ friend class Drawable; // for selection/deselection transactions

virtual void recreateControlBar( void );
virtual void refreshCustomUiResources( void );
virtual void refreshNetworkLatencyResources(void);
virtual void refreshRenderFpsResources(void);
virtual void refreshSystemTimeResources( void );
virtual void refreshGameTimeResources( void );

Expand All @@ -592,7 +594,10 @@ friend class Drawable; // for selection/deselection transactions
virtual void updateIdleWorker( void );
virtual void resetIdleWorker( void );

void drawSystemTime();
void updateRenderFpsString();
void drawNetworkLatency(Int &x, Int &y);
void drawRenderFps(Int &x, Int &y);
void drawSystemTime(Int &x, Int &y);
void drawGameTime();

public:
Expand Down Expand Up @@ -753,6 +758,31 @@ friend class Drawable; // for selection/deselection transactions
VideoBuffer* m_cameoVideoBuffer;///< video playback buffer
VideoStreamInterface* m_cameoVideoStream;///< Video stream;

// Network Latency Counter
DisplayString * m_networkLatencyString;
AsciiString m_networkLatencyFont;
Int m_networkLatencyPointSize;
Bool m_networkLatencyBold;
Coord2D m_networkLatencyPosition;
Color m_networkLatencyColor;
Color m_networkLatencyDropColor;
UnsignedInt m_lastNetworkLatencyFrames;

// Render FPS Counter
DisplayString * m_renderFpsString;
DisplayString * m_renderFpsLimitString;
AsciiString m_renderFpsFont;
Int m_renderFpsPointSize;
Bool m_renderFpsBold;
Coord2D m_renderFpsPosition;
Color m_renderFpsColor;
Color m_renderFpsLimitColor;
Color m_renderFpsDropColor;
UnsignedInt m_renderFpsRefreshMs;
UnsignedInt m_lastRenderFps;
UnsignedInt m_lastRenderFpsLimit;
UnsignedInt m_lastRenderFpsUpdateMs;

// System Time
DisplayString * m_systemTimeString;
AsciiString m_systemTimeFont;
Expand Down
4 changes: 4 additions & 0 deletions GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,8 @@ GlobalData::GlobalData()
m_saveCameraInReplay = FALSE;
m_useCameraInReplay = FALSE;

m_networkLatencyFontSize = 8;
m_renderFpsFontSize = 8;
m_systemTimeFontSize = 8;
m_gameTimeFontSize = 8;

Expand Down Expand Up @@ -1212,6 +1214,8 @@ void GlobalData::parseGameDataDefinition( INI* ini )
TheWritableGlobalData->m_saveCameraInReplay = optionPref.saveCameraInReplays();
TheWritableGlobalData->m_useCameraInReplay = optionPref.useCameraInReplays();

TheWritableGlobalData->m_networkLatencyFontSize = optionPref.getNetworkLatencyFontSize();
TheWritableGlobalData->m_renderFpsFontSize = optionPref.getRenderFpsFontSize();
TheWritableGlobalData->m_systemTimeFontSize = optionPref.getSystemTimeFontSize();
TheWritableGlobalData->m_gameTimeFontSize = optionPref.getGameTimeFontSize();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,34 @@ Real OptionPreferences::getMoneyTransactionVolume(void) const
return volume;
}

Int OptionPreferences::getNetworkLatencyFontSize(void)
{
OptionPreferences::const_iterator it = find("NetworkLatencyFontSize");
if (it == end())
return 8;

Int fontSize = atoi(it->second.str());
if (fontSize < 0)
{
fontSize = 0;
}
return fontSize;
}

Int OptionPreferences::getRenderFpsFontSize(void)
{
OptionPreferences::const_iterator it = find("RenderFpsFontSize");
if (it == end())
return 8;

Int fontSize = atoi(it->second.str());
if (fontSize < 0)
{
fontSize = 0;
}
return fontSize;
}

Int OptionPreferences::getSystemTimeFontSize(void)
{
OptionPreferences::const_iterator it = find("SystemTimeFontSize");
Expand Down Expand Up @@ -1430,6 +1458,28 @@ static void saveOptions( void )
}
}

//-------------------------------------------------------------------------------------------------
// Set Network Latency Font Size
val = pref->getNetworkLatencyFontSize();
if (val >= 0)
{
AsciiString prefString;
prefString.format("%d", val);
(*pref)["NetworkLatencyFontSize"] = prefString;
TheInGameUI->refreshNetworkLatencyResources();
}

//-------------------------------------------------------------------------------------------------
// Set Render FPS Font Size
val = pref->getRenderFpsFontSize();
if (val >= 0)
{
AsciiString prefString;
prefString.format("%d", val);
(*pref)["RenderFpsFontSize"] = prefString;
TheInGameUI->refreshRenderFpsResources();
}

//-------------------------------------------------------------------------------------------------
// Set System Time Font Size
val = pref->getSystemTimeFontSize(); // TheSuperHackers @todo replace with options input when applicable
Expand Down
Loading
Loading