From 3c9b4e0f073ad5c2c583123fad158cf244ab4286 Mon Sep 17 00:00:00 2001 From: Fabio Battaglia Date: Tue, 17 Mar 2009 07:46:04 +0000 Subject: sword1: enable psx background caching for screen 54 (bull's head) too svn-id: r39475 --- engines/sword1/screen.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/sword1/screen.cpp b/engines/sword1/screen.cpp index 985c62b52d..15df92b021 100644 --- a/engines/sword1/screen.cpp +++ b/engines/sword1/screen.cpp @@ -372,11 +372,11 @@ void Screen::draw(void) { renderParallax(_parallax[0]); uint8 *src = _layerBlocks[0]; uint8 *dest = _screenBuf; - uint8 *indxScreen = NULL; if(SwordEngine::isPsx()) { - indxScreen = psxShrinkedBackgroundToIndexed(_layerBlocks[0], _scrnSizeX, _scrnSizeY); - src = indxScreen; + if (!_psxCache.decodedBackground) + _psxCache.decodedBackground = psxShrinkedBackgroundToIndexed(_layerBlocks[0], _scrnSizeX, _scrnSizeY); + src = _psxCache.decodedBackground; } for (uint16 cnty = 0; cnty < _scrnSizeY; cnty++) @@ -388,8 +388,6 @@ void Screen::draw(void) { src++; } - free(indxScreen); - } else if (!(SwordEngine::isPsx())) { memcpy(_screenBuf, _layerBlocks[0], _scrnSizeX * _scrnSizeY); } else { //We are using PSX version -- cgit v1.2.3