aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanasis Antoniou2019-03-22 01:28:41 +0200
committerThanasis Antoniou2019-03-22 01:29:44 +0200
commit14b03594c9d4022c2dc621adb9f0a9dad3d630dd (patch)
tree6c69a26c14d237808b9d653b5632d16d6170724d
parent2afb6e185dec0d9f1f71cf5078c740ed531251e6 (diff)
downloadscummvm-rg350-14b03594c9d4022c2dc621adb9f0a9dad3d630dd.tar.gz
scummvm-rg350-14b03594c9d4022c2dc621adb9f0a9dad3d630dd.tar.bz2
scummvm-rg350-14b03594c9d4022c2dc621adb9f0a9dad3d630dd.zip
BLADERUNNER: Rephrasing of if clause sequence in getFramePtr()
-rw-r--r--engines/bladerunner/slice_animations.cpp15
1 files 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();