diff options
author | Thierry Crozat | 2017-11-16 02:34:51 +0000 |
---|---|---|
committer | Thierry Crozat | 2018-01-23 02:15:40 +0000 |
commit | b11772d9044196666117cb0e8141664e7385b746 (patch) | |
tree | 05b61c67d3920e47bee4388404aacc5ad56858c3 /engines/supernova/supernova.h | |
parent | ee905b762a6356a6313aa9c150338991fc0dc6ed (diff) | |
download | scummvm-rg350-b11772d9044196666117cb0e8141664e7385b746.tar.gz scummvm-rg350-b11772d9044196666117cb0e8141664e7385b746.tar.bz2 scummvm-rg350-b11772d9044196666117cb0e8141664e7385b746.zip |
SUPERNOVA: Fix logic in rendering code
There were several issues fixed by this commit. The main ones are:
- It was in many places only drawing the first section even for
images that have multiple sections.
- It was in some places using the wrong image.
The first issue has been fixed by removing the GameManager::drawImage
function, and moving its logic to SupernovaEngine::renderImage which
was initially only drawing one section, but was nevertheless called
directly from many place.
The second image required more changes to the rendering code to allow
setting the current image file when it is different from the room file.
This fixes some memory issues and random crashes in places where it was
for example trying to use the image -1. This also fixes the rendering
of the flying cutscene.
Diffstat (limited to 'engines/supernova/supernova.h')
-rw-r--r-- | engines/supernova/supernova.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/supernova/supernova.h b/engines/supernova/supernova.h index 8606600019..fe171084b8 100644 --- a/engines/supernova/supernova.h +++ b/engines/supernova/supernova.h @@ -105,7 +105,6 @@ public: Common::StringArray _gameStrings; Common::String _nullString; - byte _imageIndex; byte _menuBrightness; byte _brightness; uint _delay; @@ -127,8 +126,10 @@ public: void playSound(AudioIndex sample); void playSoundMod(int filenumber); void stopSound(); - void renderImage(MSNImageDecoder &image, int section); + void renderImageSection(int section); void renderImage(int filenumber, int section); + void renderImage(int section); + bool setCurrentImage(int filenumber); void saveScreen(int x, int y, int width, int height); void restoreScreen(); void renderRoom(Room &room); |