From abb147d9742f349513d076a76b2957eb573d78e7 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Mon, 4 Jan 2010 02:32:36 +0000 Subject: (svn r18709) -Fix (r10227,FS#3464): Animation buffer for 32bpp-anim blitter was only validated during sprite blitting, other drawing operations didn't check it. Initial startup and window resize could therefore lead to crash. --- src/blitter/32bpp_anim.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/blitter/32bpp_anim.cpp') diff --git a/src/blitter/32bpp_anim.cpp b/src/blitter/32bpp_anim.cpp index ef42ee0a3..42fbe3fe9 100644 --- a/src/blitter/32bpp_anim.cpp +++ b/src/blitter/32bpp_anim.cpp @@ -202,14 +202,6 @@ void Blitter_32bppAnim::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomL return; } - if (_screen.width != this->anim_buf_width || _screen.height != this->anim_buf_height) { - /* The size of the screen changed; we can assume we can wipe all data from our buffer */ - free(this->anim_buf); - this->anim_buf = CallocT(_screen.width * _screen.height); - this->anim_buf_width = _screen.width; - this->anim_buf_height = _screen.height; - } - switch (mode) { default: NOT_REACHED(); case BM_NORMAL: Draw (bp, zoom); return; @@ -448,3 +440,14 @@ Blitter::PaletteAnimation Blitter_32bppAnim::UsePaletteAnimation() { return Blitter::PALETTE_ANIMATION_BLITTER; } + +void Blitter_32bppAnim::PostResize() +{ + if (_screen.width != this->anim_buf_width || _screen.height != this->anim_buf_height) { + /* The size of the screen changed; we can assume we can wipe all data from our buffer */ + free(this->anim_buf); + this->anim_buf = CallocT(_screen.width * _screen.height); + this->anim_buf_width = _screen.width; + this->anim_buf_height = _screen.height; + } +} -- cgit v1.2.3-54-g00ecf