# null_v.cpp

Go to the documentation of this file.

    00001 /* $Id: null_v.cpp 18545 2009-12-19 18:46:40Z frosch $ */
    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
    00017 static FVideoDriver_Null iFVideoDriver_Null;
    00018
    00019 const char *VideoDriver_Null::Start(const char * const *parm)
    00020 {
    00021   this->ticks = GetDriverParamInt(parm, "ticks", 1000);
    00022   _screen.width  = _screen.pitch = _cur_resolution.width;
    00023   _screen.height = _cur_resolution.height;
    00024   _screen.dst_ptr = NULL;
    00025   ScreenSizeChanged();
    00026
    00027   /* Do not render, nor blit */
    00028   DEBUG(misc, 1, "Forcing blitter 'null'...");
    00029   BlitterFactoryBase::SelectBlitter("null");
    00030   return NULL;
    00031 }
    00032
    00033 void VideoDriver_Null::Stop() { }
    00034
    00035 void VideoDriver_Null::MakeDirty(int left, int top, int width, int height) {}
    00036
    00037 void VideoDriver_Null::MainLoop()
    00038 {
    00039   uint i;
    00040
    00041   for (i = 0; i < this->ticks; i++) {
    00042     GameLoop();
    00043     UpdateWindows();
    00044   }
    00045 }
    00046
    00047 bool VideoDriver_Null::ChangeResolution(int w, int h) { return false; }
    00048
    00049 bool VideoDriver_Null::ToggleFullscreen(bool fs) { return false; }