mirror of https://github.com/OpenTTD/OpenTTD
Fix 91b8ce07: dedicated servers could no longer create screenshots (#9232)
Although most commands are not useful on a dedicated server, screenshot commands should be dequeued.pull/9254/head
parent
3d9436bd75
commit
56050fc96f
|
@ -270,6 +270,7 @@ void VideoDriver_Dedicated::MainLoop()
|
||||||
|
|
||||||
while (!_exit_game) {
|
while (!_exit_game) {
|
||||||
if (!_dedicated_forks) DedicatedHandleKeyInput();
|
if (!_dedicated_forks) DedicatedHandleKeyInput();
|
||||||
|
this->DrainCommandQueue();
|
||||||
|
|
||||||
ChangeGameSpeed(_ddc_fastforward);
|
ChangeGameSpeed(_ddc_fastforward);
|
||||||
this->Tick();
|
this->Tick();
|
||||||
|
|
|
@ -319,23 +319,6 @@ protected:
|
||||||
return std::chrono::microseconds(1000000 / _settings_client.gui.refresh_rate);
|
return std::chrono::microseconds(1000000 / _settings_client.gui.refresh_rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::chrono::steady_clock::time_point next_game_tick;
|
|
||||||
std::chrono::steady_clock::time_point next_draw_tick;
|
|
||||||
|
|
||||||
bool fast_forward_key_pressed; ///< The fast-forward key is being pressed.
|
|
||||||
bool fast_forward_via_key; ///< The fast-forward was enabled by key press.
|
|
||||||
|
|
||||||
bool is_game_threaded;
|
|
||||||
std::thread game_thread;
|
|
||||||
std::mutex game_state_mutex;
|
|
||||||
std::mutex game_thread_wait_mutex;
|
|
||||||
|
|
||||||
static void GameThreadThunk(VideoDriver *drv);
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::mutex cmd_queue_mutex;
|
|
||||||
std::vector<std::function<void()>> cmd_queue;
|
|
||||||
|
|
||||||
/** Execute all queued commands. */
|
/** Execute all queued commands. */
|
||||||
void DrainCommandQueue()
|
void DrainCommandQueue()
|
||||||
{
|
{
|
||||||
|
@ -354,6 +337,23 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::chrono::steady_clock::time_point next_game_tick;
|
||||||
|
std::chrono::steady_clock::time_point next_draw_tick;
|
||||||
|
|
||||||
|
bool fast_forward_key_pressed; ///< The fast-forward key is being pressed.
|
||||||
|
bool fast_forward_via_key; ///< The fast-forward was enabled by key press.
|
||||||
|
|
||||||
|
bool is_game_threaded;
|
||||||
|
std::thread game_thread;
|
||||||
|
std::mutex game_state_mutex;
|
||||||
|
std::mutex game_thread_wait_mutex;
|
||||||
|
|
||||||
|
static void GameThreadThunk(VideoDriver *drv);
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::mutex cmd_queue_mutex;
|
||||||
|
std::vector<std::function<void()>> cmd_queue;
|
||||||
|
|
||||||
void GameLoop();
|
void GameLoop();
|
||||||
void GameThread();
|
void GameThread();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue