aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Crozat2017-11-05 02:36:45 +0000
committerThierry Crozat2018-01-23 02:15:37 +0000
commit73278c3f9f0157e1adf19134eceeb65eec3e37eb (patch)
tree1652ecdb90258b2fb7d1f1fc31869d05659df220
parent5b76bbb016a4e24f72e895b96c3c6ce2c4615b1f (diff)
downloadscummvm-rg350-73278c3f9f0157e1adf19134eceeb65eec3e37eb.tar.gz
scummvm-rg350-73278c3f9f0157e1adf19134eceeb65eec3e37eb.tar.bz2
scummvm-rg350-73278c3f9f0157e1adf19134eceeb65eec3e37eb.zip
SUPERNOVA: Replace a class variable used in a single function by a local variable
-rw-r--r--engines/supernova/supernova.cpp12
-rw-r--r--engines/supernova/supernova.h1
2 files changed, 7 insertions, 6 deletions
diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp
index c693f9e34b..6dda5657ff 100644
--- a/engines/supernova/supernova.cpp
+++ b/engines/supernova/supernova.cpp
@@ -104,7 +104,6 @@ SupernovaEngine::SupernovaEngine(OSystem *syst)
, _brightness(255)
, _menuBrightness(255)
, _imageIndex(0)
- , _sectionIndex(0)
, _delay(33)
, _textSpeed(kTextSpeed[2])
, _screenWidth(320)
@@ -391,10 +390,13 @@ void SupernovaEngine::playSoundMod(int filenumber)
}
void SupernovaEngine::renderImage(MSNImageDecoder &image, int section) {
- _sectionIndex = section;
-
- if (section > 128)
+ // Note: inverting means we are removing the section. So we should get the rect for that
+ // section but draw the background (section 0) instead.
+ bool invert = false;
+ if (section > 128) {
section -= 128;
+ invert = true;
+ }
if (section > image._numSections - 1)
return;
@@ -424,7 +426,7 @@ void SupernovaEngine::renderImage(MSNImageDecoder &image, int section) {
}
uint offset = image._section[section].y1 * image._pitch + image._section[section].x1;
- if (_sectionIndex > 128)
+ if (invert)
section = 0;
_system->copyRectToScreen(static_cast<const byte *>(image._sectionSurfaces[section]->getPixels()) + offset,
diff --git a/engines/supernova/supernova.h b/engines/supernova/supernova.h
index 8ba298c751..16c98887b0 100644
--- a/engines/supernova/supernova.h
+++ b/engines/supernova/supernova.h
@@ -108,7 +108,6 @@ public:
Common::String _nullString;
byte _imageIndex;
- byte _sectionIndex;
byte _menuBrightness;
byte _brightness;
uint _timePaused;