null_v.cpp
00001
00002
00003 #include "../stdafx.h"
00004 #include "../openttd.h"
00005 #include "../gfx_func.h"
00006 #include "../variables.h"
00007 #include "../debug.h"
00008 #include "../blitter/factory.hpp"
00009 #include "null_v.h"
00010
00011 static FVideoDriver_Null iFVideoDriver_Null;
00012
00013 const char *VideoDriver_Null::Start(const char* const *parm)
00014 {
00015 this->ticks = GetDriverParamInt(parm, "ticks", 1000);
00016 _screen.width = _screen.pitch = _cur_resolution[0];
00017 _screen.height = _cur_resolution[1];
00018
00019 DEBUG(misc, 1, "Forcing blitter 'null'...");
00020 BlitterFactoryBase::SelectBlitter("null");
00021 return NULL;
00022 }
00023
00024 void VideoDriver_Null::Stop() { }
00025
00026 void VideoDriver_Null::MakeDirty(int left, int top, int width, int height) {}
00027
00028 void VideoDriver_Null::MainLoop()
00029 {
00030 uint i;
00031
00032 for (i = 0; i < this->ticks; i++) {
00033 GameLoop();
00034 _screen.dst_ptr = NULL;
00035 UpdateWindows();
00036 }
00037 }
00038
00039 bool VideoDriver_Null::ChangeResolution(int w, int h) { return false; }
00040
00041 bool VideoDriver_Null::ToggleFullscreen(bool fs) { return false; }