diff options
author | truelight <truelight@openttd.org> | 2007-06-12 20:24:12 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2007-06-12 20:24:12 +0000 |
commit | f3f744d36a60431a6845d2b7e3ce17e64ee2e4f5 (patch) | |
tree | bed173ca279e1556489d31b0b8aa873a6d1cf110 /src/video/null_v.cpp | |
parent | 381b11c9796d6b40653f8b4c319c33f9920f047a (diff) | |
download | openttd-f3f744d36a60431a6845d2b7e3ce17e64ee2e4f5.tar.xz |
(svn r10121) -Codechange: split renderer from rest of code; no longer any code directly accesses the video-buffer
-Add: added NULL blitter and renderer, which are always used for -vnull
-Add: dedicated driver doesn't blit nor render by default. Can be overruled by user. (-D -b 8bpp-optimized)
-Remove: removed CTRL+D from win32, which is incompatible with above
-Add: extended screenshot support for PNG and BMP
-Codechange: remove all hardcoded 8bpp references and replace them with more dynamic ones
-Codechange: minor stuff in blitters
Diffstat (limited to 'src/video/null_v.cpp')
-rw-r--r-- | src/video/null_v.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/video/null_v.cpp b/src/video/null_v.cpp index fd15954d9..0c1f4715e 100644 --- a/src/video/null_v.cpp +++ b/src/video/null_v.cpp @@ -5,19 +5,23 @@ #include "../gfx.h" #include "../variables.h" #include "../window.h" +#include "../debug.h" +#include "../blitter/blitter.hpp" #include "null_v.h" -static Pixel *_null_video_mem = NULL; - static const char* NullVideoStart(const char* const* parm) { _screen.width = _screen.pitch = _cur_resolution[0]; _screen.height = _cur_resolution[1]; - _null_video_mem = (Pixel *)malloc(_cur_resolution[0] * _cur_resolution[1] * sizeof(Pixel)); + /* Do not render, nor blit */ + DEBUG(misc, 1, "Forcing blitter 'null'..."); + BlitterFactoryBase::SelectBlitter("null"); + _screen.renderer = RendererFactoryBase::SelectRenderer(BlitterFactoryBase::GetCurrentBlitter()->GetRenderer()); + if (_screen.renderer == NULL) error("Couldn't load the renderer '%s' the selected blitter depends on", BlitterFactoryBase::GetCurrentBlitter()->GetRenderer()); return NULL; } -static void NullVideoStop() { free(_null_video_mem); } +static void NullVideoStop() { } static void NullVideoMakeDirty(int left, int top, int width, int height) {} @@ -27,7 +31,7 @@ static void NullVideoMainLoop() for (i = 0; i < 1000; i++) { GameLoop(); - _screen.dst_ptr = _null_video_mem; + _screen.dst_ptr = NULL; UpdateWindows(); } } |