summaryrefslogtreecommitdiff
path: root/src/texteff.cpp
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-06-12 20:24:12 +0000
committertruelight <truelight@openttd.org>2007-06-12 20:24:12 +0000
commitf3f744d36a60431a6845d2b7e3ce17e64ee2e4f5 (patch)
treebed173ca279e1556489d31b0b8aa873a6d1cf110 /src/texteff.cpp
parent381b11c9796d6b40653f8b4c319c33f9920f047a (diff)
downloadopenttd-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/texteff.cpp')
-rw-r--r--src/texteff.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/texteff.cpp b/src/texteff.cpp
index ad94b1d6f..dd73f509d 100644
--- a/src/texteff.cpp
+++ b/src/texteff.cpp
@@ -54,9 +54,7 @@ static bool _textmessage_visible = false;
/* The chatbox grows from the bottom so the coordinates are pixels from
* the left and pixels from the bottom. The height is the maximum height */
static const Oblong _textmsg_box = {10, 30, 500, 150};
-static Pixel _textmessage_backup[150 * 500]; // (height * width)
-
-extern void memcpy_pitch(void *dst, void *src, int w, int h, int srcpitch, int dstpitch);
+static uint8 _textmessage_backup[150 * 500 * 4]; // (height * width)
static inline uint GetTextMessageCount()
{
@@ -163,11 +161,7 @@ void UndrawTextMessage()
_textmessage_visible = false;
/* Put our 'shot' back to the screen */
- memcpy_pitch(
- _screen.dst_ptr + x + y * _screen.pitch,
- _textmessage_backup,
- width, height, _textmsg_box.width, _screen.pitch);
-
+ _screen.renderer->CopyFromBuffer(_screen.renderer->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);
@@ -227,10 +221,7 @@ void DrawTextMessage()
if (width <= 0 || height <= 0) return;
/* Make a copy of the screen as it is before painting (for undraw) */
- memcpy_pitch(
- _textmessage_backup,
- _screen.dst_ptr + x + y * _screen.pitch,
- width, height, _screen.pitch, _textmsg_box.width);
+ _screen.renderer->CopyToBuffer(_screen.renderer->MoveTo(_screen.dst_ptr, x, y), _textmessage_backup, width, height, _textmsg_box.width);
_cur_dpi = &_screen; // switch to _screen painting