wip: wait until data is ready and has been consumed (couples physics and rendering thread again)

This commit is contained in:
2026-02-24 13:16:00 +01:00
parent 74065b7ea2
commit e7d4170b77
6 changed files with 37 additions and 22 deletions

View File

@ -43,7 +43,7 @@ auto StateManager::FillGraph() -> void {
// TODO: We have only dispatched the commands, the states won't be downloaded
// when calling this... Make FindWinningStates() another command?
// Or recalculate whenever masses.size() changes?
FindWinningStates();
// FindWinningStates();
}
auto StateManager::UpdateGraph() -> void {
@ -74,7 +74,7 @@ auto StateManager::FindWinningStates() -> void {
winning_states.clear();
std::unordered_map<State, int> state_masses;
{
std::lock_guard<LockableBase(std::mutex)> lock(physics.state.pos_mtx);
std::lock_guard<LockableBase(std::mutex)> lock(physics.state.data_mtx);
state_masses = physics.state.state_masses;
}
for (const auto &[state, mass] : state_masses) {