summaryrefslogtreecommitdiff
path: root/src/texteff.cpp
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-06-21 12:36:46 +0000
committertruelight <truelight@openttd.org>2007-06-21 12:36:46 +0000
commit3fa3d2e3653f351ba071152a4fa8ff19e31aa14f (patch)
tree32794e63c78972c1d43b56d335b38c6f56fad413 /src/texteff.cpp
parent3b12e7b6b0a6b71a7b085c60c3b4ac4ffbe1dc44 (diff)
downloadopenttd-3fa3d2e3653f351ba071152a4fa8ff19e31aa14f.tar.xz
(svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
-Codechange: added CopyImageToBuffer, which produces a readable buffer for screenshots -Fix: 32bpp-anim now holds animation on transparent objects to avoid strange graphical effects -Fix: 32bpp-anim now works correct on mouse-movement (it holds the palette animation correctly)
Diffstat (limited to 'src/texteff.cpp')
-rw-r--r--src/texteff.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/texteff.cpp b/src/texteff.cpp
index 30f94884b..af89f30b3 100644
--- a/src/texteff.cpp
+++ b/src/texteff.cpp
@@ -55,7 +55,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 uint8 _textmessage_backup[150 * 500 * 4]; // (height * width)
+static uint8 _textmessage_backup[150 * 500 * 5]; // (height * width)
static inline uint GetTextMessageCount()
{
@@ -163,7 +163,7 @@ void UndrawTextMessage()
_textmessage_visible = false;
/* Put our 'shot' back to the screen */
- blitter->CopyFromBuffer(blitter->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);
/* And make sure it is updated next time */
_video_driver->make_dirty(x, y, width, height);
@@ -223,8 +223,10 @@ void DrawTextMessage()
}
if (width <= 0 || height <= 0) return;
+ assert(blitter->BufferSize(width, height) < (int)sizeof(_textmessage_backup));
+
/* Make a copy of the screen as it is before painting (for undraw) */
- blitter->CopyToBuffer(blitter->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);
_cur_dpi = &_screen; // switch to _screen painting