From 14b03594c9d4022c2dc621adb9f0a9dad3d630dd Mon Sep 17 00:00:00 2001 From: Thanasis Antoniou Date: Fri, 22 Mar 2019 01:28:41 +0200 Subject: BLADERUNNER: Rephrasing of if clause sequence in getFramePtr() --- engines/bladerunner/slice_animations.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/engines/bladerunner/slice_animations.cpp b/engines/bladerunner/slice_animations.cpp index 11ec717b3e..1b2c2e209b 100644 --- a/engines/bladerunner/slice_animations.cpp +++ b/engines/bladerunner/slice_animations.cpp @@ -204,14 +204,17 @@ void *SliceAnimations::getFramePtr(uint32 animation, uint32 frame) { uint32 page = frameOffset / _pageSize; uint32 pageOffset = frameOffset % _pageSize; - if (!_pages[page]._data) - _pages[page]._data = _coreAnimPageFile.loadPage(page); + if (_pages[page]._data == nullptr) { // if not cached already + _pages[page]._data = _coreAnimPageFile.loadPage(page); // look in COREANIM first - if (!_pages[page]._data) - _pages[page]._data = _framesPageFile.loadPage(page); + if (_pages[page]._data == nullptr) { // if not in COREAMIM + _pages[page]._data = _framesPageFile.loadPage(page); // Look in CDFRAMES or HDFRAMES loaded data - if (!_pages[page]._data) - error("Unable to locate page %d for animation %d frame %d", page, animation, frame); + if (_pages[page]._data == nullptr) { + error("Unable to locate page %d for animation %d frame %d", page, animation, frame); + } + } + } _pages[page]._lastAccess = _vm->_time->currentSystem(); -- cgit v1.2.3