Fix right mouse scrolling in the win32 video driver
[openttd/fttd.git] / src / video / null_v.cpp
blob99e78c91f928c4623013d5846a03aeb4295ecff1
1 /* $Id$ */
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
10 /** @file null_v.cpp The videio driver that doesn't blit. */
12 #include "../stdafx.h"
13 #include "../debug.h"
14 #include "../gfx_func.h"
15 #include "../blitter/blitter.h"
16 #include "null_v.h"
18 /** Factory for the null video driver. */
19 static VideoDriverFactory <VideoDriver_Null>
20 iFVideoDriver_Null (0, "null", "Null Video Driver");
22 const char *VideoDriver_Null::Start(const char * const *parm)
24 #ifdef _MSC_VER
25 /* Disable the MSVC assertion message box. */
26 _set_error_mode(_OUT_TO_STDERR);
27 #endif
29 this->ticks = GetDriverParamInt(parm, "ticks", 1000);
31 /* Do not render, nor blit */
32 DEBUG(misc, 1, "Forcing blitter 'null'...");
33 const Blitter::Info *blitter = Blitter::find ("null");
34 /* The null blitter should always be available. */
35 assert (blitter != NULL);
36 Blitter::select (blitter);
37 _screen_surface.reset (blitter->create (NULL, _cur_resolution.width,
38 _cur_resolution.height, _cur_resolution.width,
39 true));
40 _screen_width = _cur_resolution.width;
41 _screen_height = _cur_resolution.height;
42 ScreenSizeChanged();
44 return NULL;
47 void VideoDriver_Null::Stop() { }
49 void VideoDriver_Null::MainLoop()
51 uint i;
53 for (i = 0; i < this->ticks; i++) {
54 GameLoop();
55 UpdateWindows();