diff options
Diffstat (limited to 'engines/cruise')
-rw-r--r-- | engines/cruise/background.cpp | 3 | ||||
-rw-r--r-- | engines/cruise/cruise.h | 2 | ||||
-rw-r--r-- | engines/cruise/dataLoader.cpp | 2 | ||||
-rw-r--r-- | engines/cruise/function.cpp | 4 | ||||
-rw-r--r-- | engines/cruise/menu.cpp | 5 | ||||
-rw-r--r-- | engines/cruise/script.cpp | 3 | ||||
-rw-r--r-- | engines/cruise/vars.cpp | 4 | ||||
-rw-r--r-- | engines/cruise/vars.h | 4 |
8 files changed, 14 insertions, 13 deletions
diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp index 3ac57cc376..edd52d3b4a 100644 --- a/engines/cruise/background.cpp +++ b/engines/cruise/background.cpp @@ -216,8 +216,7 @@ int loadBackground(const char *name, int idx) { if (strlen(name) >= sizeof(backgroundTable[idx].name)) warning("background name length exceeded allowable maximum"); - strncpy(backgroundTable[idx].name, name, sizeof(backgroundTable[idx].name)); - backgroundTable[idx].name[sizeof(backgroundTable[idx].name) - 1] = 0; + Common::strlcpy(backgroundTable[idx].name, name, sizeof(backgroundTable[idx].name)); } return (0); diff --git a/engines/cruise/cruise.h b/engines/cruise/cruise.h index 94f5c68ca0..ad3bb20ca1 100644 --- a/engines/cruise/cruise.h +++ b/engines/cruise/cruise.h @@ -42,7 +42,7 @@ * * Status of this engine: Game is completable, engine needs objectifying * - * Supported games: + * Games using this engine: * - Cruise for a Corpse */ namespace Cruise { diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp index b2ac7a2fd6..b48240b30e 100644 --- a/engines/cruise/dataLoader.cpp +++ b/engines/cruise/dataLoader.cpp @@ -55,7 +55,7 @@ void decodeGfxUnified(dataFileEntry *pCurrentFileEntry, int16 format) { break; default: - error("Unkown gfx format %d", format); + error("Unknown gfx format %d", format); } uint8 *buffer = (uint8 *)MemAlloc(spriteSize); diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp index 3d07abf441..c3d435bde6 100644 --- a/engines/cruise/function.cpp +++ b/engines/cruise/function.cpp @@ -58,9 +58,9 @@ int16 Op_LoadOverlay() { updateAllScriptsImports(); - strcpy(nextOverlay, overlayName); + Common::strlcpy(nextOverlay, overlayName, sizeof(nextOverlay)); - return(overlayLoadResult); + return overlayLoadResult; } int16 Op_Strcpy() { diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp index 2ffaa29e4a..e5a1136c23 100644 --- a/engines/cruise/menu.cpp +++ b/engines/cruise/menu.cpp @@ -29,6 +29,7 @@ #include "engines/metaengine.h" #include "gui/saveload.h" +#include "common/translation.h" namespace Cruise { @@ -212,9 +213,9 @@ static void handleSaveLoad(bool saveFlag) { EngineMan.findGame(_vm->getGameId(), &plugin); GUI::SaveLoadChooser *dialog; if (saveFlag) - dialog = new GUI::SaveLoadChooser("Save game:", "Save"); + dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save")); else - dialog = new GUI::SaveLoadChooser("Load game:", "Load"); + dialog = new GUI::SaveLoadChooser(_("Load game:"), _("Load")); dialog->setSaveMode(saveFlag); int slot = dialog->runModal(plugin, ConfMan.getActiveDomainName()); diff --git a/engines/cruise/script.cpp b/engines/cruise/script.cpp index d6c1aa47f3..3d07575c16 100644 --- a/engines/cruise/script.cpp +++ b/engines/cruise/script.cpp @@ -185,8 +185,9 @@ int32 opcodeType1() { return 0; } case 2: { + assert (ptr); *(ptr + var_A + offset) = var; - return (0); + return 0; } default: error("Unsupported code in opcodeType1 case 1"); diff --git a/engines/cruise/vars.cpp b/engines/cruise/vars.cpp index c61cedc503..07bd646cae 100644 --- a/engines/cruise/vars.cpp +++ b/engines/cruise/vars.cpp @@ -51,8 +51,8 @@ int32 volumeDataLoaded = 0; int16 numOfDisks; -char lastOverlay[15]; -char nextOverlay[15]; +char lastOverlay[38]; +char nextOverlay[38]; int16 currentActiveMenu; int16 autoMsg; diff --git a/engines/cruise/vars.h b/engines/cruise/vars.h index af39993f2f..54920a1436 100644 --- a/engines/cruise/vars.h +++ b/engines/cruise/vars.h @@ -154,8 +154,8 @@ extern int32 volumeDataLoaded; extern int16 numOfDisks; -extern char lastOverlay[15]; -extern char nextOverlay[15]; +extern char lastOverlay[38]; +extern char nextOverlay[38]; extern int16 currentActiveMenu; extern int16 autoMsg; |