aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJoseph-Eugene Winzer2017-07-17 16:28:06 +0200
committerThierry Crozat2018-01-22 23:54:41 +0000
commitdc12a0fd2392c09c7c5c75bd851da834c48ab4fa (patch)
tree47f16f43adf6c5433fc90e846c5825599c9261dd /engines
parenta54c9084c1b4e9a18556066e255bb71e33793547 (diff)
downloadscummvm-rg350-dc12a0fd2392c09c7c5c75bd851da834c48ab4fa.tar.gz
scummvm-rg350-dc12a0fd2392c09c7c5c75bd851da834c48ab4fa.tar.bz2
scummvm-rg350-dc12a0fd2392c09c7c5c75bd851da834c48ab4fa.zip
SUPERNOVA: Enables renderImage() to render inverse sections
Besides the addition of inverse sections, the 'fullscreen' parameter was removed as it was used only for testing purposes in the beginning.
Diffstat (limited to 'engines')
-rw-r--r--engines/supernova/graphics.cpp1
-rw-r--r--engines/supernova/supernova.cpp31
-rw-r--r--engines/supernova/supernova.h4
3 files changed, 18 insertions, 18 deletions
diff --git a/engines/supernova/graphics.cpp b/engines/supernova/graphics.cpp
index 1940dd7ef6..d28c60118c 100644
--- a/engines/supernova/graphics.cpp
+++ b/engines/supernova/graphics.cpp
@@ -85,6 +85,7 @@ bool MSNImageDecoder::loadStream(Common::SeekableReadStream &stream) {
_section[i].addressHigh = 0xff;
_section[i].addressLow = 0xffff;
_section[i].x2 = 0;
+ _section[i].next = 0;
}
for (int i = 0; i < _numSections; ++i) {
_section[i].x1 = stream.readUint16LE();
diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp
index 26a6aa5ed8..e8e425336c 100644
--- a/engines/supernova/supernova.cpp
+++ b/engines/supernova/supernova.cpp
@@ -273,14 +273,16 @@ void SupernovaEngine::playSoundMod(int filenumber)
-1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO);
}
-void SupernovaEngine::renderImage(MSNImageDecoder &image, int section, bool fullscreen) {
+void SupernovaEngine::renderImage(MSNImageDecoder &image, int section) {
+ _sectionIndex = section;
+
+ if (section > 128)
+ section -= 128;
if (section > image._numSections - 1)
return;
_currentImage = &image;
_imageIndex = image._filenumber;
- _sectionIndex = section;
-
_system->getPaletteManager()->setPalette(image.getPalette(), 16, 239);
paletteBrightness();
@@ -291,7 +293,6 @@ void SupernovaEngine::renderImage(MSNImageDecoder &image, int section, bool full
if (image._filenumber == 1 || image._filenumber == 2) {
sectionRect.setWidth(640);
sectionRect.setHeight(480);
-
if (_screenWidth != 640) {
_screenWidth = 640;
_screenHeight = 480;
@@ -305,23 +306,21 @@ void SupernovaEngine::renderImage(MSNImageDecoder &image, int section, bool full
}
}
- if (fullscreen) {
- _system->copyRectToScreen(image._sectionSurfaces[section]->getPixels(),
- image._pitch, 0, 0, _screenWidth, _screenHeight);
- } else {
- uint offset = image._section[section].y1 * image._pitch + image._section[section].x1;
- _system->copyRectToScreen(static_cast<const byte *>(image._sectionSurfaces[section]->getPixels()) + offset,
- image._pitch,
- sectionRect.left, sectionRect.top,
- sectionRect.width(), sectionRect.height());
- }
+ uint offset = image._section[section].y1 * image._pitch + image._section[section].x1;
+ if (_sectionIndex > 128)
+ section = 0;
+
+ _system->copyRectToScreen(static_cast<const byte *>(image._sectionSurfaces[section]->getPixels()) + offset,
+ image._pitch,
+ sectionRect.left, sectionRect.top,
+ sectionRect.width(), sectionRect.height());
}
-void SupernovaEngine::renderImage(int filenumber, int section, bool fullscreen) {
+void SupernovaEngine::renderImage(int filenumber, int section) {
if (filenumber > ARRAYSIZE(_images) - 1)
return;
- renderImage(_images[filenumber], section, fullscreen);
+ renderImage(_images[filenumber], section);
}
void SupernovaEngine::saveScreen(int x, int y, int width, int height) {
diff --git a/engines/supernova/supernova.h b/engines/supernova/supernova.h
index 1d3b17cd36..67c7067f4e 100644
--- a/engines/supernova/supernova.h
+++ b/engines/supernova/supernova.h
@@ -117,8 +117,8 @@ public:
void playSound(AudioIndex sample);
void playSoundMod(int filenumber);
void stopSound();
- void renderImage(MSNImageDecoder &image, int section, bool fullscreen = false);
- void renderImage(int filenumber, int section, bool fullscreen = false);
+ void renderImage(MSNImageDecoder &image, int section);
+ void renderImage(int filenumber, int section);
void saveScreen(int x, int y, int width, int height);
void restoreScreen();
void renderRoom(Room &room);