From 3fa3d2e3653f351ba071152a4fa8ff19e31aa14f Mon Sep 17 00:00:00 2001 From: truelight Date: Thu, 21 Jun 2007 12:36:46 +0000 Subject: (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) --- src/texteff.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/texteff.cpp') 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 -- cgit v1.2.3-54-g00ecf