Fix #10490: Allow ships to exit depots if another is not moving at the exit point...
[openttd-github.git] / src / video / null_v.cpp
blobf0551e8898faf9475f8a63f1ddfcbeeaf45fc87d
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
8 /** @file null_v.cpp The video driver that doesn't blit. */
10 #include "../stdafx.h"
11 #include "../gfx_func.h"
12 #include "../blitter/factory.hpp"
13 #include "../saveload/saveload.h"
14 #include "../window_func.h"
15 #include "null_v.h"
17 #include "../safeguards.h"
19 /** Factory for the null video driver. */
20 static FVideoDriver_Null iFVideoDriver_Null;
22 const char *VideoDriver_Null::Start(const StringList &parm)
24 #ifdef _MSC_VER
25 /* Disable the MSVC assertion message box. */
26 _set_error_mode(_OUT_TO_STDERR);
27 #endif
29 this->UpdateAutoResolution();
31 this->ticks = GetDriverParamInt(parm, "ticks", 1000);
32 _screen.width = _screen.pitch = _cur_resolution.width;
33 _screen.height = _cur_resolution.height;
34 _screen.dst_ptr = nullptr;
35 ScreenSizeChanged();
37 /* Do not render, nor blit */
38 Debug(misc, 1, "Forcing blitter 'null'...");
39 BlitterFactory::SelectBlitter("null");
40 return nullptr;
43 void VideoDriver_Null::Stop() { }
45 void VideoDriver_Null::MakeDirty(int, int, int, int) {}
47 void VideoDriver_Null::MainLoop()
49 uint i;
51 for (i = 0; i < this->ticks; i++) {
52 ::GameLoop();
53 ::InputLoop();
54 ::UpdateWindows();
57 /* If requested, make a save just before exit. The normal exit-flow is
58 * not triggered from this driver, so we have to do this manually. */
59 if (_settings_client.gui.autosave_on_exit) {
60 DoExitSave();
64 bool VideoDriver_Null::ChangeResolution(int, int) { return false; }
66 bool VideoDriver_Null::ToggleFullscreen(bool) { return false; }