Skip to content

Commit 8004769

Browse files
committed
2 parents d40ea8b + cd491b5 commit 8004769

4 files changed

Lines changed: 22 additions & 7 deletions

File tree

GeneralsMD/Code/GameEngine/Include/Common/GameLOD.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ class GameLODManager
235235
bool m_userShadowDecalsEnabled;
236236
bool m_userHeatEffectsEnabled;
237237
bool m_isQualityReduced;
238-
int m_sustainedGoodFrames;
238+
int m_stableFPSDuration;
239239
DynamicGameLODLevel m_userDynamicLOD;
240240
#endif
241241
};

GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ GameLODManager::GameLODManager(void)
236236
m_userShadowDecalsEnabled = true;
237237
m_userHeatEffectsEnabled = true;
238238
m_isQualityReduced = false;
239-
m_sustainedGoodFrames = 0;
239+
m_stableFPSDuration = 0;
240240
m_userDynamicLOD = DYNAMIC_GAME_LOD_VERY_HIGH;
241241
#endif
242242

@@ -802,7 +802,7 @@ void GameLODManager::updateGraphicsQualityState(float averageFPS)
802802
if (TheGameClient)
803803
TheGameClient->allocateShadows();
804804
m_isQualityReduced = false;
805-
m_sustainedGoodFrames = 0;
805+
m_stableFPSDuration = 0;
806806
}
807807

808808
if (!m_isQualityReduced)
@@ -813,7 +813,7 @@ void GameLODManager::updateGraphicsQualityState(float averageFPS)
813813
m_userDynamicLOD = m_currentDynamicLOD;
814814
}
815815

816-
m_sustainedGoodFrames = (averageFPS >= 58.0f) ? (m_sustainedGoodFrames + 1) : 0; // Track a duration of sustained good performance
816+
m_stableFPSDuration = (averageFPS >= 58.0f) ? (m_stableFPSDuration + 1) : 0; // Track a duration of sustained good performance
817817

818818
bool shouldReduceQuality = (averageFPS < 56.0f && TheGameClient && TheGameClient->getFrame() > LOGICFRAMES_PER_SECOND * 10);
819819
if (shouldReduceQuality && !m_isQualityReduced)
@@ -829,7 +829,7 @@ void GameLODManager::updateGraphicsQualityState(float averageFPS)
829829
// Restore to user preferences after sustained good performance
830830
else if (!shouldReduceQuality && m_isQualityReduced)
831831
{
832-
if (m_sustainedGoodFrames > 300)
832+
if (m_stableFPSDuration > 20)
833833
{
834834
TheWritableGlobalData->m_useShadowVolumes = m_userShadowVolumesEnabled;
835835
TheWritableGlobalData->m_useShadowDecals = m_userShadowDecalsEnabled;
@@ -842,7 +842,7 @@ void GameLODManager::updateGraphicsQualityState(float averageFPS)
842842
TheGameLODManager->setDynamicLODLevel(lod);
843843

844844
m_isQualityReduced = false;
845-
m_sustainedGoodFrames = 0;
845+
m_stableFPSDuration = 0;
846846
}
847847
}
848848
}

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,20 @@ void WOLDisplaySlotList( void )
13371337
NGMPGameSlot *slot = game->getGameSpySlot(i);
13381338
if (slot && slot->isHuman())
13391339
{
1340+
// Determine friends and highlight in cyan
1341+
Color nameColor = GameSpyColor[GSCOLOR_PLAYER_NORMAL];
1342+
NGMP_OnlineServices_SocialInterface* pSocialInterface = NGMP_OnlineServicesManager::GetInterface<NGMP_OnlineServices_SocialInterface>();
1343+
1344+
if (pSocialInterface != nullptr && pSocialInterface->IsUserFriend(slot->m_userID))
1345+
{
1346+
nameColor = GameMakeColor(7, 183, 247, 255);
1347+
}
1348+
1349+
if (comboBoxPlayer[i])
1350+
{
1351+
GadgetTextEntrySetTextColor(GadgetComboBoxGetEditBox(comboBoxPlayer[i]), nameColor);
1352+
}
1353+
13401354
bool bIsConnected = false;
13411355
int latency = -1;
13421356
std::string strConnectionType = "";

GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,8 @@ void W3DDisplay::draw( void )
16871687

16881688
updateAverageFPS();
16891689
#if defined(GENERALS_ONLINE_HIGH_FPS_SERVER)
1690-
TheGameLODManager->updateGraphicsQualityState(m_averageFPS);
1690+
if (TheGameLogic && (TheGameLogic->getFrame() % LOGICFRAMES_PER_SECOND) == 0)
1691+
TheGameLODManager->updateGraphicsQualityState(m_averageFPS);
16911692
#else
16921693
if (TheGlobalData->m_enableDynamicLOD && TheGameLogic->getShowDynamicLOD())
16931694
{

0 commit comments

Comments
 (0)