aboutsummaryrefslogtreecommitdiff
path: root/engines/supernova/supernova.cpp
diff options
context:
space:
mode:
authorThierry Crozat2017-11-16 02:49:03 +0000
committerThierry Crozat2018-01-23 02:15:40 +0000
commit624425077b0353303a72192906c495f619099b7d (patch)
tree45bbf646f438ad0cc907eae6192bfe22187242a4 /engines/supernova/supernova.cpp
parentb11772d9044196666117cb0e8141664e7385b746 (diff)
downloadscummvm-rg350-624425077b0353303a72192906c495f619099b7d.tar.gz
scummvm-rg350-624425077b0353303a72192906c495f619099b7d.tar.bz2
scummvm-rg350-624425077b0353303a72192906c495f619099b7d.zip
SUPERNOVA: Add warning when trying to use out of bound file number
This is likely happening, and a comment has also been added to indicate this. The warning was added to help detect those issue and so that we don't forgert about it.
Diffstat (limited to 'engines/supernova/supernova.cpp')
-rw-r--r--engines/supernova/supernova.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp
index f56db88bb7..0e7631becb 100644
--- a/engines/supernova/supernova.cpp
+++ b/engines/supernova/supernova.cpp
@@ -482,8 +482,10 @@ void SupernovaEngine::renderImage(int section) {
}
bool SupernovaEngine::setCurrentImage(int filenumber) {
- if (filenumber == -1 || filenumber > ARRAYSIZE(_images) - 1)
+ if (filenumber == -1 || filenumber > ARRAYSIZE(_images) - 1) {
+ warning("Trying to display image from out of bound file number %d", filenumber);
return false;
+ }
_currentImage = &(_images[filenumber]);
_system->getPaletteManager()->setPalette(_currentImage->getPalette(), 16, 239);