diff options
author | truelight <truelight@openttd.org> | 2007-06-17 20:30:28 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2007-06-17 20:30:28 +0000 |
commit | 79cd3f5db0deeb4017c75198f3b530c3a2bf0ee3 (patch) | |
tree | e0105857aa1562ca3ca15a5e7df7e49bfc939456 /src/texteff.cpp | |
parent | 8c3e9d111f55531f67e8dc132c678d70632f56d9 (diff) | |
download | openttd-79cd3f5db0deeb4017c75198f3b530c3a2bf0ee3.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/texteff.cpp')
-rw-r--r-- | src/texteff.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/texteff.cpp b/src/texteff.cpp index dd73f509d..30f94884b 100644 --- a/src/texteff.cpp +++ b/src/texteff.cpp @@ -16,6 +16,7 @@ #include "string.h" #include "variables.h" #include "table/sprites.h" +#include "blitter/factory.hpp" #include <stdarg.h> /* va_list */ #include "date.h" @@ -126,6 +127,7 @@ void InitTextMessage() void UndrawTextMessage() { if (_textmessage_visible) { + Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter(); /* Sometimes we also need to hide the cursor * This is because both textmessage and the cursor take a shot of the * screen before drawing. @@ -161,7 +163,7 @@ void UndrawTextMessage() _textmessage_visible = false; /* Put our 'shot' back to the screen */ - _screen.renderer->CopyFromBuffer(_screen.renderer->MoveTo(_screen.dst_ptr, x, y), _textmessage_backup, width, height, _textmsg_box.width); + blitter->CopyFromBuffer(blitter->MoveTo(_screen.dst_ptr, x, y), _textmessage_backup, width, height, _textmsg_box.width); /* And make sure it is updated next time */ _video_driver->make_dirty(x, y, width, height); @@ -196,6 +198,7 @@ void TextMessageDailyLoop() /** Draw the textmessage-box */ void DrawTextMessage() { + Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter(); if (!_textmessage_dirty) return; /* First undraw if needed */ @@ -221,7 +224,7 @@ void DrawTextMessage() if (width <= 0 || height <= 0) return; /* Make a copy of the screen as it is before painting (for undraw) */ - _screen.renderer->CopyToBuffer(_screen.renderer->MoveTo(_screen.dst_ptr, x, y), _textmessage_backup, width, height, _textmsg_box.width); + blitter->CopyToBuffer(blitter->MoveTo(_screen.dst_ptr, x, y), _textmessage_backup, width, height, _textmsg_box.width); _cur_dpi = &_screen; // switch to _screen painting |