From b6663bb942780ed9786992ca1fd757fc96f1412d Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 5 Sep 2010 22:56:03 +0000 Subject: KYRA: Constify some tables. svn-id: r52578 --- engines/kyra/text_lol.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/text_lol.cpp b/engines/kyra/text_lol.cpp index d5264be483..7f9531507c 100644 --- a/engines/kyra/text_lol.cpp +++ b/engines/kyra/text_lol.cpp @@ -204,10 +204,12 @@ void TextDisplayer_LoL::printDialogueText(int dim, char *str, EMCState *script, } void TextDisplayer_LoL::printMessage(uint16 type, const char *str, ...) { - static uint8 textColors256[] = { 0xfe, 0xa2, 0x84, 0x97, 0x9F }; - static uint8 textColors16[] = { 0x33, 0xaa, 0x88, 0x55, 0x99 }; - static uint8 soundEffect[] = { 0x0B, 0x00, 0x2B, 0x1B, 0x00 }; + static const uint8 textColors256[] = { 0xfe, 0xa2, 0x84, 0x97, 0x9F }; + static const uint8 textColors16[] = { 0x33, 0xaa, 0x88, 0x55, 0x99 }; + static const uint8 soundEffect[] = { 0x0B, 0x00, 0x2B, 0x1B, 0x00 }; + const uint8 *textColors = _vm->gameFlags().use16ColorMode ? textColors16 : textColors256; + if (type & 4) type ^= 4; else -- cgit v1.2.3 From f69bfaf355b2544bf8ca8cc6cf3209773b8ad005 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 5 Sep 2010 22:56:25 +0000 Subject: KYRA: Get rid of local static non-POD object. This fixes crashes with the plugins branch for dhewg. svn-id: r52579 --- engines/kyra/kyra_v1.h | 1 + engines/kyra/saveload.cpp | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h index f05e113456..d077d3a3b0 100644 --- a/engines/kyra/kyra_v1.h +++ b/engines/kyra/kyra_v1.h @@ -387,6 +387,7 @@ protected: bool canSaveGameStateCurrently() { return _isSaveAllowed; } const char *getSavegameFilename(int num); + Common::String _savegameFilename; static Common::String getSavegameFilename(const Common::String &target, int num); bool saveFileLoadable(int slot); diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp index 56e1c73d0a..b1cc954137 100644 --- a/engines/kyra/saveload.cpp +++ b/engines/kyra/saveload.cpp @@ -224,9 +224,8 @@ Common::WriteStream *KyraEngine_v1::openSaveForWriting(const char *filename, con } const char *KyraEngine_v1::getSavegameFilename(int num) { - static Common::String filename; - filename = getSavegameFilename(_targetName, num); - return filename.c_str(); + _savegameFilename = getSavegameFilename(_targetName, num); + return _savegameFilename.c_str(); } Common::String KyraEngine_v1::getSavegameFilename(const Common::String &target, int num) { -- cgit v1.2.3