You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
Physics interpolation - Move out of Scenario
Move VisualServer interpolation data out of Scenario and into VisualServerScene, so the interpolation data and enabled status is now common to all Scenarios. Fix physics interpolation in multithreaded mode by ensuring tick and pre-draw are called.
This commit is contained in:
@@ -36,18 +36,6 @@ void VisualServerWrapMT::thread_exit() {
|
||||
exit.set();
|
||||
}
|
||||
|
||||
void VisualServerWrapMT::thread_scenario_tick(RID p_scenario) {
|
||||
if (!draw_pending.decrement()) {
|
||||
visual_server->scenario_tick(p_scenario);
|
||||
}
|
||||
}
|
||||
|
||||
void VisualServerWrapMT::thread_scenario_pre_draw(RID p_scenario, bool p_will_draw) {
|
||||
if (!draw_pending.decrement()) {
|
||||
visual_server->scenario_pre_draw(p_scenario, p_will_draw);
|
||||
}
|
||||
}
|
||||
|
||||
void VisualServerWrapMT::thread_draw(bool p_swap_buffers, double frame_step) {
|
||||
if (!draw_pending.decrement()) {
|
||||
visual_server->draw(p_swap_buffers, frame_step);
|
||||
@@ -94,24 +82,6 @@ void VisualServerWrapMT::sync() {
|
||||
}
|
||||
}
|
||||
|
||||
void VisualServerWrapMT::scenario_tick(RID p_scenario) {
|
||||
if (create_thread) {
|
||||
draw_pending.increment();
|
||||
command_queue.push(this, &VisualServerWrapMT::thread_scenario_tick, p_scenario);
|
||||
} else {
|
||||
visual_server->scenario_tick(p_scenario);
|
||||
}
|
||||
}
|
||||
|
||||
void VisualServerWrapMT::scenario_pre_draw(RID p_scenario, bool p_will_draw) {
|
||||
if (create_thread) {
|
||||
draw_pending.increment();
|
||||
command_queue.push(this, &VisualServerWrapMT::thread_scenario_pre_draw, p_scenario, p_will_draw);
|
||||
} else {
|
||||
visual_server->scenario_pre_draw(p_scenario, p_will_draw);
|
||||
}
|
||||
}
|
||||
|
||||
void VisualServerWrapMT::draw(bool p_swap_buffers, double frame_step) {
|
||||
if (create_thread) {
|
||||
draw_pending.increment();
|
||||
|
||||
Reference in New Issue
Block a user