00001 /* $Id: null_v.cpp 26209 2014-01-02 22:41:58Z rubidium $ */ 00002 00003 /* 00004 * This file is part of OpenTTD. 00005 * 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. 00006 * 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. 00007 * 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/>. 00008 */ 00009 00012 #include "../stdafx.h" 00013 #include "../gfx_func.h" 00014 #include "../blitter/factory.hpp" 00015 #include "null_v.h" 00016 00018 static FVideoDriver_Null iFVideoDriver_Null; 00019 00020 const char *VideoDriver_Null::Start(const char * const *parm) 00021 { 00022 #ifdef _MSC_VER 00023 /* Disable the MSVC assertion message box. */ 00024 _set_error_mode(_OUT_TO_STDERR); 00025 #endif 00026 00027 this->ticks = GetDriverParamInt(parm, "ticks", 1000); 00028 _screen.width = _screen.pitch = _cur_resolution.width; 00029 _screen.height = _cur_resolution.height; 00030 _screen.dst_ptr = NULL; 00031 ScreenSizeChanged(); 00032 00033 /* Do not render, nor blit */ 00034 DEBUG(misc, 1, "Forcing blitter 'null'..."); 00035 BlitterFactory::SelectBlitter("null"); 00036 return NULL; 00037 } 00038 00039 void VideoDriver_Null::Stop() { } 00040 00041 void VideoDriver_Null::MakeDirty(int left, int top, int width, int height) {} 00042 00043 void VideoDriver_Null::MainLoop() 00044 { 00045 uint i; 00046 00047 for (i = 0; i < this->ticks; i++) { 00048 GameLoop(); 00049 UpdateWindows(); 00050 } 00051 } 00052 00053 bool VideoDriver_Null::ChangeResolution(int w, int h) { return false; } 00054 00055 bool VideoDriver_Null::ToggleFullscreen(bool fs) { return false; }