aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/dialogs.cpp15
-rw-r--r--engines/scumm/dialogs.h1
-rw-r--r--engines/scumm/he/script_v60he.cpp5
-rw-r--r--engines/scumm/imuse/imuse.cpp8
4 files changed, 17 insertions, 12 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 42e49afcc1..63ac952265 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -471,10 +471,13 @@ ScummMenuDialog::~ScummMenuDialog() {
delete _loadDialog;
}
-void ScummMenuDialog::reflowLayout() {
- if (!_vm->canSaveGameStateCurrently())
- _saveButton->setEnabled(false);
+int ScummMenuDialog::runModal() {
+ _saveButton->setEnabled(_vm->canSaveGameStateCurrently());
+ return ScummDialog::runModal();
+}
+void ScummMenuDialog::reflowLayout() {
+ _saveButton->setEnabled(_vm->canSaveGameStateCurrently());
Dialog::reflowLayout();
}
@@ -745,7 +748,7 @@ InfoDialog::InfoDialog(ScummEngine *scumm, int res)
_message = queryResString(res);
// Width and height are dummy
- _text = new StaticTextWidget(this, 4, 4, 10, 10, _message, kTextAlignCenter);
+ _text = new StaticTextWidget(this, 0, 0, 10, 10, _message, kTextAlignCenter);
}
InfoDialog::InfoDialog(ScummEngine *scumm, const String& message)
@@ -754,7 +757,7 @@ InfoDialog::InfoDialog(ScummEngine *scumm, const String& message)
_message = message;
// Width and height are dummy
- _text = new StaticTextWidget(this, 4, 4, 10, 10, _message, kTextAlignCenter);
+ _text = new StaticTextWidget(this, 0, 0, 10, 10, _message, kTextAlignCenter);
}
void InfoDialog::setInfoText(const String& message) {
@@ -775,7 +778,7 @@ void InfoDialog::reflowLayout() {
_x = (screenW - width) / 2;
_y = (screenH - height) / 2;
- _text->setSize(_w - 8, _h);
+ _text->setSize(_w, _h);
}
const Common::String InfoDialog::queryResString(int stringno) {
diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h
index d4ecbde534..85b562ed67 100644
--- a/engines/scumm/dialogs.h
+++ b/engines/scumm/dialogs.h
@@ -90,6 +90,7 @@ public:
virtual void reflowLayout();
+ int runModal();
protected:
ScummEngine *_vm;
diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp
index 79b589df00..92848ce981 100644
--- a/engines/scumm/he/script_v60he.cpp
+++ b/engines/scumm/he/script_v60he.cpp
@@ -115,9 +115,10 @@ int ScummEngine_v60he::convertFilePath(byte *dst, int dstSize) {
int r = 0;
if (dst[len - 3] == 's' && dst[len - 2] == 'g') { // Save Game File
// Change filename prefix to target name, for save game files.
- char saveName[20];
+ char saveName[40];
+ memset(saveName, 0, sizeof(saveName));
sprintf(saveName, "%s.sg%c", _targetName.c_str(), dst[len - 1]);
- memcpy(dst, saveName, 20);
+ memcpy(dst, saveName, 40);
} else if (dst[0] == '.' && dst[1] == '/') { // Game Data Path
// The default game data path is set to './' by ScummVM
r = 2;
diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp
index 2d20b72db6..455eaac984 100644
--- a/engines/scumm/imuse/imuse.cpp
+++ b/engines/scumm/imuse/imuse.cpp
@@ -695,11 +695,11 @@ int32 IMuseInternal::doCommand_internal(int numargs, int a[]) {
return -1;
{
- char string[128];
- sprintf(string, "doCommand - %d (%d/%d)", a[0], (int)param, (int)cmd);
+ Common::String string = "doCommand - ";
+ string += Common::String::printf("%d (%d/%d)", a[0], (int)param, (int)cmd);
for (i = 1; i < numargs; ++i)
- sprintf(string + strlen(string), ", %d", a[i]);
- debugC(DEBUG_IMUSE, string);
+ string += Common::String::printf(", %d", a[i]);
+ debugC(DEBUG_IMUSE, "%s", string.c_str());
}
if (param == 0) {