From f3f744d36a60431a6845d2b7e3ce17e64ee2e4f5 Mon Sep 17 00:00:00 2001 From: truelight Date: Tue, 12 Jun 2007 20:24:12 +0000 Subject: (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 --- src/video/null_v.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/video/null_v.cpp') 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(); } } -- cgit v1.2.3-54-g00ecf