diff options
Diffstat (limited to 'sky')
-rw-r--r-- | sky/gmmusic.cpp | 3 | ||||
-rw-r--r-- | sky/musicbase.cpp | 1 | ||||
-rw-r--r-- | sky/text.cpp | 14 | ||||
-rw-r--r-- | sky/text.h | 1 |
4 files changed, 15 insertions, 4 deletions
diff --git a/sky/gmmusic.cpp b/sky/gmmusic.cpp index 784e4f846a..98e79ca88d 100644 --- a/sky/gmmusic.cpp +++ b/sky/gmmusic.cpp @@ -41,8 +41,9 @@ SkyGmMusic::SkyGmMusic(MidiDriver *pMidiDrv, SkyDisk *pSkyDisk) SkyGmMusic::~SkyGmMusic(void) { - _midiDrv->close(); _midiDrv->setTimerCallback(NULL, NULL); + if (_currentMusic) stopMusic(); + _midiDrv->close(); delete _midiDrv; } diff --git a/sky/musicbase.cpp b/sky/musicbase.cpp index 48957f0407..254cbfb153 100644 --- a/sky/musicbase.cpp +++ b/sky/musicbase.cpp @@ -30,7 +30,6 @@ SkyMusicBase::SkyMusicBase(SkyDisk *pSkyDisk) { SkyMusicBase::~SkyMusicBase(void) { - if (_currentMusic) stopMusic(); if (_musicData) free(_musicData); } diff --git a/sky/text.cpp b/sky/text.cpp index 6e5b147dd4..f2e65c9719 100644 --- a/sky/text.cpp +++ b/sky/text.cpp @@ -46,7 +46,7 @@ SkyText::SkyText(SkyDisk *skyDisk, uint32 gameVersion, uint16 language) { _mainCharacterSet.charSpacing = 0; fnSetFont(0); - + if (!SkyState::isDemo(_gameVersion)) { _controlCharacterSet.addr = _skyDisk->loadFile(60520, NULL); _controlCharacterSet.charHeight = 12; @@ -55,11 +55,21 @@ SkyText::SkyText(SkyDisk *skyDisk, uint32 gameVersion, uint16 language) { _linkCharacterSet.addr = _skyDisk->loadFile(60521, NULL); _linkCharacterSet.charHeight = 12; _linkCharacterSet.charSpacing = 0; + } else { + _controlCharacterSet.addr = NULL; + _linkCharacterSet.addr = NULL; } if (SkyState::isCDVersion(_gameVersion)) { _preAfterTableArea = _skyDisk->loadFile(60522, NULL); - } + } else _preAfterTableArea = NULL; +} + +SkyText::~SkyText(void) { + + if (_controlCharacterSet.addr) free(_controlCharacterSet.addr); + if (_linkCharacterSet.addr) free(_linkCharacterSet.addr); + if (_preAfterTableArea) free(_preAfterTableArea); } void SkyText::fnSetFont(uint32 fontNr) { diff --git a/sky/text.h b/sky/text.h index 6f58667e33..672bfeb331 100644 --- a/sky/text.h +++ b/sky/text.h @@ -33,6 +33,7 @@ struct HuffTree { class SkyText { public: SkyText(SkyDisk *skyDisk, uint32 gameVersion, uint16 _language); + ~SkyText(void); void getText(uint32 textNr); struct displayText_t displayText(uint8 *dest, bool centre, uint16 pixelWidth, uint8 color); struct displayText_t displayText(char *textPtr, uint8 *dest, bool centre, uint16 pixelWidth, uint8 color); |