summaryrefslogtreecommitdiff
path: root/src/video
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-06-17 20:30:28 +0000
committertruelight <truelight@openttd.org>2007-06-17 20:30:28 +0000
commit003375d3755fe06227894e941b177491770c17fe (patch)
treee0105857aa1562ca3ca15a5e7df7e49bfc939456 /src/video
parentb0b4820387ec6f0214b43dc61b452fa73ca8a09a (diff)
downloadopenttd-003375d3755fe06227894e941b177491770c17fe.tar.xz
(svn r10190) -Codechange: merged renderer and blitter to one single class API: blitter
-Codechange: introduced a hierachy of blitters to avoid a lot of code duplication Note: this allows much easier adding other types of video-drivers, like OpenGL
Diffstat (limited to 'src/video')
-rw-r--r--src/video/cocoa_v.mm3
-rw-r--r--src/video/dedicated_v.cpp4
-rw-r--r--src/video/null_v.cpp4
-rw-r--r--src/video/sdl_v.cpp5
-rw-r--r--src/video/win32_v.cpp2
5 files changed, 3 insertions, 15 deletions
diff --git a/src/video/cocoa_v.mm b/src/video/cocoa_v.mm
index 950aa2b28..5317ecfa2 100644
--- a/src/video/cocoa_v.mm
+++ b/src/video/cocoa_v.mm
@@ -1763,9 +1763,6 @@ static void QZ_VideoInit()
_cocoa_video_data.cursor_visible = true;
- _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());
-
/* register for sleep notifications so wake from sleep generates SDL_VIDEOEXPOSE */
// QZ_RegisterForSleepNotifications();
}
diff --git a/src/video/dedicated_v.cpp b/src/video/dedicated_v.cpp
index 596e55497..cbcbaef3b 100644
--- a/src/video/dedicated_v.cpp
+++ b/src/video/dedicated_v.cpp
@@ -14,7 +14,7 @@
#include "../variables.h"
#include "../genworld.h"
#include "../fileio.h"
-#include "../blitter/blitter.hpp"
+#include "../blitter/factory.hpp"
#include "dedicated_v.h"
#ifdef BEOS_NET_SERVER
@@ -128,8 +128,6 @@ static const char *DedicatedVideoStart(const char * const *parm)
_screen.width = _screen.pitch = _cur_resolution[0];
_screen.height = _cur_resolution[1];
- _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());
SetDebugString("net=6");
diff --git a/src/video/null_v.cpp b/src/video/null_v.cpp
index 0c1f4715e..d6afc7af4 100644
--- a/src/video/null_v.cpp
+++ b/src/video/null_v.cpp
@@ -6,7 +6,7 @@
#include "../variables.h"
#include "../window.h"
#include "../debug.h"
-#include "../blitter/blitter.hpp"
+#include "../blitter/factory.hpp"
#include "null_v.h"
static const char* NullVideoStart(const char* const* parm)
@@ -16,8 +16,6 @@ static const char* NullVideoStart(const char* const* parm)
/* 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;
}
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp
index 8b851e2d6..3a1f2229e 100644
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -13,8 +13,7 @@
#include "../window.h"
#include "../network/network.h"
#include "../variables.h"
-#include "../blitter/blitter.hpp"
-#include "../renderer/renderer.hpp"
+#include "../blitter/factory.hpp"
#include "sdl_v.h"
#include <SDL.h>
@@ -205,8 +204,6 @@ static bool CreateMainSurface(int w, int h)
_screen.width = newscreen->w;
_screen.height = newscreen->h;
_screen.pitch = newscreen->pitch / (bpp / 8);
- _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());
_sdl_screen = newscreen;
InitPalette();
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index 53d02c69f..8d32daab1 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -653,8 +653,6 @@ static bool AllocateDibSection(int w, int h)
_screen.width = w;
_screen.pitch = ALIGN(w, 4);
_screen.height = h;
- _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());
bi = (BITMAPINFO*)alloca(sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256);
memset(bi, 0, sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256);
bi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);