Changeset 25394
- Timestamp:
- May 6, 2021, 6:49:34 PM (3 years ago)
- Location:
- ps/trunk/source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/source/ps/Game.cpp
r25376 r25394 394 394 if (deltaSimTime) 395 395 { 396 // To avoid confusing the profiler, we need to trigger the new turn397 // while we're not nested inside any PROFILE blocks398 if (m_TurnManager->WillUpdate(deltaSimTime))399 g_Profiler.Turn();400 401 396 // At the normal sim rate, we currently want to render at least one 402 397 // frame per simulation turn, so let maxTurns be 1. But for fast-forward -
ps/trunk/source/ps/Profile.h
r24352 r25394 1 /* Copyright (C) 202 0Wildfire Games.1 /* Copyright (C) 202 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * … … 32 32 33 33 #define PROFILE_AMORTIZE_FRAMES 30 34 #define PROFILE_AMORTIZE_TURNS 134 #define PROFILE_AMORTIZE_TURNS 35 35 36 36 class CProfileManager; -
ps/trunk/source/simulation2/system/TurnManager.cpp
r25170 r25394 63 63 } 64 64 65 bool CTurnManager::WillUpdate(float simFrameLength) const66 {67 // Keep this in sync with the return value of Update()68 69 if (m_CurrentTurn > m_FinalTurn)70 return false;71 72 if (m_DeltaSimTime + simFrameLength < 0)73 return false;74 75 if (m_ReadyTurn <= m_CurrentTurn)76 return false;77 78 return true;79 }80 81 65 bool CTurnManager::Update(float simFrameLength, size_t maxTurns) 82 66 { … … 124 108 if (m_ReadyTurn <= m_CurrentTurn && m_CommandDelay > 1) 125 109 break; 110 111 112 113 126 114 127 115 NotifyFinishedOwnCommands(m_CurrentTurn + m_CommandDelay); -
ps/trunk/source/simulation2/system/TurnManager.h
r25170 r25394 113 113 114 114 /** 115 * Returns whether Update(simFrameLength, ...) will process at least one new turn.116 * @param simFrameLength Length of the previous frame, in simulation seconds117 */118 bool WillUpdate(float simFrameLength) const;119 120 /**121 115 * Advance the graphics by a certain time. 122 116 * @param simFrameLength Length of the previous frame, in simulation seconds
Note:
See TracChangeset
for help on using the changeset viewer.