(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)
This commit is contained in:
truelight
2007-06-21 12:36:46 +00:00
parent 3b12e7b6b0
commit 3fa3d2e365
11 changed files with 156 additions and 63 deletions

View File

@@ -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