aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Crozat2017-11-16 02:49:03 +0000
committerThierry Crozat2018-01-23 02:15:40 +0000
commit624425077b0353303a72192906c495f619099b7d (patch)
tree45bbf646f438ad0cc907eae6192bfe22187242a4
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.
-rw-r--r--engines/supernova/supernova.cpp4
-rw-r--r--engines/supernova/supernova.h2
2 files changed, 5 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);
diff --git a/engines/supernova/supernova.h b/engines/supernova/supernova.h
index fe171084b8..882f6a9feb 100644
--- a/engines/supernova/supernova.h
+++ b/engines/supernova/supernova.h
@@ -90,6 +90,8 @@ public:
ScreenBufferStack _screenBuffer;
byte _mouseNormal[256];
byte _mouseWait[256];
+ // TODO check this! There are 56 data files (0 to 55) and at least the outro
+ // tries to displayimage from file 55 (and fails!).
MSNImageDecoder _images[44];
MSNImageDecoder *_currentImage;
struct SoundSample {