wip: wait until data is ready and has been consumed (couples physics and rendering thread again)
This commit is contained in:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user