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/>.
10 /** @file null_v.cpp The videio driver that doesn't blit. */
12 #include "../stdafx.h"
14 #include "../gfx_func.h"
15 #include "../blitter/blitter.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
)
25 /* Disable the MSVC assertion message box. */
26 _set_error_mode(_OUT_TO_STDERR
);
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
,
40 _screen_width
= _cur_resolution
.width
;
41 _screen_height
= _cur_resolution
.height
;
47 void VideoDriver_Null::Stop() { }
49 void VideoDriver_Null::MainLoop()
53 for (i
= 0; i
< this->ticks
; i
++) {