aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS10
-rw-r--r--NEWS6
-rw-r--r--backends/platform/sdl/sdl.cpp14
-rw-r--r--common/macresman.cpp5
-rwxr-xr-xconfigure2
-rwxr-xr-xdevtools/credits.pl4
-rw-r--r--devtools/scumm-md5.txt1
-rw-r--r--engines/hugo/dialogs.cpp57
-rw-r--r--engines/hugo/dialogs.h6
-rw-r--r--engines/hugo/schedule.cpp53
-rw-r--r--engines/hugo/util.cpp3
-rw-r--r--engines/saga/interface.cpp10
-rw-r--r--engines/saga/interface.h2
-rw-r--r--engines/saga/saveload.cpp2
-rw-r--r--engines/scumm/scumm-md5.h3
-rw-r--r--engines/toon/character.cpp5
-rw-r--r--engines/toon/font.cpp8
-rw-r--r--engines/toon/toon.cpp6
-rw-r--r--engines/toon/toon.h1
-rw-r--r--engines/tsage/core.cpp1
-rw-r--r--engines/tsage/debugger.cpp221
-rw-r--r--engines/tsage/debugger.h6
-rw-r--r--engines/tsage/graphics.cpp31
-rw-r--r--engines/tsage/ringworld_scenes1.cpp98
-rw-r--r--engines/tsage/ringworld_scenes1.h8
-rw-r--r--engines/tsage/ringworld_scenes10.cpp40
-rw-r--r--engines/tsage/ringworld_scenes3.cpp16
-rw-r--r--engines/tsage/ringworld_scenes3.h17
-rw-r--r--engines/tsage/ringworld_scenes8.cpp36
-rw-r--r--engines/tsage/saveload.h8
-rw-r--r--engines/tsage/tsage.cpp4
-rw-r--r--gui/credits.h4
-rw-r--r--gui/widgets/edittext.cpp8
-rw-r--r--gui/widgets/edittext.h6
34 files changed, 507 insertions, 195 deletions
diff --git a/AUTHORS b/AUTHORS
index 57bf0086be..ca6342d836 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -183,9 +183,9 @@ ScummVM Team
Touche:
Gregory Montoir
- TsAGE:
- Paul Gilbert
- Arnaud Boutonne
+ TsAGE:
+ Paul Gilbert
+ Arnaud Boutonne
Tucker:
Gregory Montoir
@@ -421,7 +421,7 @@ Other contributions
David Jensen - SVG logo conversion
Jean Marc Gimenez - ScummVM logo
Raina - ScummVM forum buttons
- William Claydon - Skins for doxygen and wiki
+ William Claydon - Skins for doxygen, buildbot and wiki
Code contributions
------------------
@@ -559,7 +559,7 @@ Special thanks to
Drascula: The Vampire Strikes Back with us and his generosity with
freewaring the game.
- David P. Gray from Gray Design Associate for sharing the source code of
+ David P. Gray from Gray Design Associates for sharing the source code of
the Hugo trilogy.
Broken Sword 2.5 team for providing sources of their engine and their
diff --git a/NEWS b/NEWS
index d2ab41c29d..3d2fa44eb2 100644
--- a/NEWS
+++ b/NEWS
@@ -9,10 +9,12 @@ For a more comprehensive changelog of the latest experimental code, see:
- Added support for Playtoons: Bambou le Sauveur de la Jungle.
- Added support for Toonstruck.
- Added support for Living Books v1 and v2 games.
+ - Added support for Hugo's House of Horrors, Hugo 2: Whodunit?
+ and Hugo 3: Jungle of Doom
General
- - Added support for loadable modules on platforms without a dynamic loader.
- (GSoC Task)
+ - Added support for loadable modules on platforms without a dynamic
+ loader. (GSoC Task)
- Added Danish translation.
- Added Norwegian Bokmaal translation.
- Added Norwegian Nynorsk translation.
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index d6e79248f9..2c0c45907f 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -378,7 +378,11 @@ void OSystem_SDL::setupIcon() {
unsigned int rgba[256];
unsigned int *icon;
- sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes);
+ if (sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes) != 4) {
+ warning("Wrong format of scummvm_icon[0] (%s)", scummvm_icon[0]);
+
+ return;
+ }
if ((w > 512) || (h > 512) || (ncols > 255) || (nbytes > 1)) {
warning("Could not load the built-in icon (%d %d %d %d)", w, h, ncols, nbytes);
return;
@@ -393,13 +397,17 @@ void OSystem_SDL::setupIcon() {
unsigned char code;
char color[32];
unsigned int col;
- sscanf(scummvm_icon[1 + i], "%c c %s", &code, color);
+ if (sscanf(scummvm_icon[1 + i], "%c c %s", &code, color) != 2) {
+ warning("Wrong format of scummvm_icon[%d] (%s)", 1 + i, scummvm_icon[1 + i]);
+ }
if (!strcmp(color, "None"))
col = 0x00000000;
else if (!strcmp(color, "black"))
col = 0xFF000000;
else if (color[0] == '#') {
- sscanf(color + 1, "%06x", &col);
+ if (sscanf(color + 1, "%06x", &col) != 1) {
+ warning("Wrong format of color (%s)", color + 1);
+ }
col |= 0xFF000000;
} else {
warning("Could not load the built-in icon (%d %s - %s) ", code, color, scummvm_icon[1 + i]);
diff --git a/common/macresman.cpp b/common/macresman.cpp
index e7d4a30789..b06d986ca2 100644
--- a/common/macresman.cpp
+++ b/common/macresman.cpp
@@ -623,6 +623,11 @@ void MacResManager::convertCrsrCursor(SeekableReadStream *data, byte **cursor, i
// Pixel data for cursor
int iconDataSize = iconRowBytes * (iconBounds[3] - iconBounds[1]);
byte *iconData = new byte[iconDataSize];
+
+ if (!iconData) {
+ error("Cannot allocate iconData in macresman.cpp");
+ }
+
data->read(iconData, iconDataSize);
// Color table
diff --git a/configure b/configure
index a70b89e975..d673f2d612 100755
--- a/configure
+++ b/configure
@@ -88,7 +88,7 @@ add_engine drascula "Drascula: The Vampire Strikes Back" yes
add_engine gob "Gobli*ns" yes
add_engine groovie "Groovie" yes "groovie2"
add_engine groovie2 "Groovie 2 games" no
-add_engine hugo "Hugo Trilogy" no
+add_engine hugo "Hugo Trilogy" yes
add_engine kyra "Legend of Kyrandia" yes "lol"
add_engine lol "Lands of Lore" no
add_engine lastexpress "The Last Express" no
diff --git a/devtools/credits.pl b/devtools/credits.pl
index 648b0c0a5b..94f72617af 100755
--- a/devtools/credits.pl
+++ b/devtools/credits.pl
@@ -977,7 +977,7 @@ begin_credits("Credits");
add_person("David Jensen", "Tyst", "SVG logo conversion");
add_person("Jean Marc Gimenez", "", "ScummVM logo");
add_person("", "Raina", "ScummVM forum buttons");
- add_person("William Claydon", "billwashere", "Skins for doxygen and wiki");
+ add_person("William Claydon", "billwashere", "Skins for doxygen, buildbot and wiki");
end_persons();
end_section();
@@ -1118,7 +1118,7 @@ begin_credits("Credits");
"freewaring the game.");
add_paragraph(
- "David P. Gray from Gray Design Associate for sharing the source code ".
+ "David P. Gray from Gray Design Associates for sharing the source code ".
"of the Hugo trilogy.");
add_paragraph(
diff --git a/devtools/scumm-md5.txt b/devtools/scumm-md5.txt
index 60fc615057..e9e155925e 100644
--- a/devtools/scumm-md5.txt
+++ b/devtools/scumm-md5.txt
@@ -466,6 +466,7 @@ fbear Fatty Bear's Birthday Surprise
fbpack Fatty Bear's Fun Pack
e01acc8c12ef44e8f778fe87e5f90f4e -1 en 3DO - - - sev
c9717ee6059f1e43b768b464493d2fba -1 jp 3DO - - - clone2727
+ 4cfd3fda4a4e6e64a1fc488eba973b7a -1 en DOS - - - velocity37
f06e66fd45b2f8b0f4a2833ff4476050 -1 he DOS - - - sev
freddi Freddi Fish 1: The Case of the Missing Kelp Seeds
diff --git a/engines/hugo/dialogs.cpp b/engines/hugo/dialogs.cpp
index ead432c5df..096cea8a72 100644
--- a/engines/hugo/dialogs.cpp
+++ b/engines/hugo/dialogs.cpp
@@ -26,6 +26,7 @@
#include "common/substream.h"
#include "graphics/imagedec.h"
#include "gui/gui-manager.h"
+#include "gui/ThemeEval.h"
#include "hugo/hugo.h"
#include "hugo/display.h"
@@ -231,12 +232,52 @@ void TopMenu::handleMouseUp(int x, int y, int button, int clickCount) {
}
EntryDialog::EntryDialog(const Common::String &title, const Common::String &buttonLabel, const Common::String &defaultValue) : GUI::Dialog(20, 20, 100, 50) {
- new GUI::StaticTextWidget(this, 0, 0, 10, 10, title, Graphics::kTextAlignCenter);
-
- _text = new GUI::EditTextWidget(this, 0, 0, 50, 10, "");
+ const int screenW = g_system->getOverlayWidth();
+ const int screenH = g_system->getOverlayHeight();
+
+ int buttonWidth = g_gui.xmlEval()->getVar("Globals.Button.Width", 0);
+ int buttonHeight = g_gui.xmlEval()->getVar("Globals.Button.Height", 0);
+
+ // First, determine the size the dialog needs. For this we have to break
+ // down the string into lines, and taking the maximum of their widths.
+ // Using this, and accounting for the space the button(s) need, we can set
+ // the real size of the dialog
+ Common::Array<Common::String> lines;
+ int lineCount, buttonPos;
+ int maxlineWidth = g_gui.getFont().wordWrapText(title, screenW - 2 * 30, lines);
+
+ // Calculate the desired dialog size (maxing out at 300*180 for now)
+ _w = MAX(maxlineWidth, buttonWidth) + 20;
+
+ lineCount = lines.size();
+
+ _h = 16 + buttonHeight + 8;
+
+ // Limit the number of lines so that the dialog still fits on the screen.
+ if (lineCount > (screenH - 20 - _h) / kLineHeight) {
+ lineCount = (screenH - 20 - _h) / kLineHeight;
+ }
+ _h += lineCount * kLineHeight;
+
+ // Center the dialog
+ _x = (screenW - _w) / 2;
+ _y = (screenH - _h) / 2;
+
+ // Each line is represented by one static text item.
+ for (int i = 0; i < lineCount; i++) {
+ new GUI::StaticTextWidget(this, 10, 10 + i * kLineHeight, maxlineWidth, kLineHeight,
+ lines[i], Graphics::kTextAlignCenter);
+ }
+
+ _text = new GUI::EditTextWidget(this, 10, 10 + lineCount * (kLineHeight + 1), _w - 20, kLineHeight, "", "", 0, kCmdFinishEdit);
_text->setEditString(defaultValue);
- new GUI::ButtonWidget(this, 20, 20, 30, 10, buttonLabel, 0, kCmdButton);
+ _h += kLineHeight + 5;
+
+ buttonPos = (_w - buttonWidth) / 2;
+
+ new GUI::ButtonWidget(this, buttonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, buttonLabel, 0, kCmdButton, Common::ASCII_RETURN); // Confirm dialog
+
}
EntryDialog::~EntryDialog() {
@@ -245,6 +286,7 @@ EntryDialog::~EntryDialog() {
void EntryDialog::handleCommand(GUI::CommandSender *sender, uint32 command, uint32 data) {
switch (command) {
case kCmdButton:
+ case kCmdFinishEdit:
close();
break;
default:
@@ -252,11 +294,4 @@ void EntryDialog::handleCommand(GUI::CommandSender *sender, uint32 command, uint
}
}
-void EntryDialog::reflowLayout() {
-}
-
-void EntryDialog::init() {
-}
-
-
} // End of namespace Hugo
diff --git a/engines/hugo/dialogs.h b/engines/hugo/dialogs.h
index f870414a93..56dbd41f81 100644
--- a/engines/hugo/dialogs.h
+++ b/engines/hugo/dialogs.h
@@ -67,7 +67,8 @@ enum {
kCmdInvent = 'INVT',
// EntryDialog commands
- kCmdButton = 'BTNP'
+ kCmdButton = 'BTNP',
+ kCmdFinishEdit = 'FNSH'
};
class TopMenu : public GUI::Dialog {
@@ -105,14 +106,11 @@ public:
EntryDialog(const Common::String &title, const Common::String &buttonLabel, const Common::String &defaultValue);
virtual ~EntryDialog();
- void reflowLayout();
void handleCommand(GUI::CommandSender *sender, uint32 command, uint32 data);
const Common::String &getEditString() const { return _text->getEditString(); }
protected:
- void init();
-
GUI::EditTextWidget *_text;
};
diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp
index 45a2b77826..ca1583921e 100644
--- a/engines/hugo/schedule.cpp
+++ b/engines/hugo/schedule.cpp
@@ -1529,28 +1529,22 @@ void Scheduler_v1d::runScheduler() {
}
void Scheduler_v1d::promptAction(act *action) {
- Utils::promptBox(_vm->_file->fetchString(action->a3.promptIndex));
-
- warning("STUB: doAction(act3)");
- // TODO: The answer of the player is not handled currently! Once it'll be read in the messageBox, uncomment this block
-#if 0
- char response[256];
- // TODO: Put user input in response
-
- Utils::strlwr(response);
- if (action->a3.encodedFl) {
- warning("Encrypted flag set");
- decodeString(response);
- }
+ Common::String response;
+
+ response = Utils::promptBox(_vm->_file->fetchString(action->a3.promptIndex));
+
+ response.toLowercase();
+
+ char resp[256];
+ strncpy(resp, response.c_str(), 256);
+
+ if (action->a3.encodedFl)
+ decodeString(resp);
- if (strstr(response, _vm->_file->fetchString(action->a3.responsePtr[0]))
+ if (strstr(resp, _vm->_file->fetchString(action->a3.responsePtr[0])))
insertActionList(action->a3.actPassIndex);
else
insertActionList(action->a3.actFailIndex);
-#endif
-
- // HACK: As the answer is not read, currently it's always considered correct
- insertActionList(action->a3.actPassIndex);
}
/**
@@ -1578,19 +1572,22 @@ const char *Scheduler_v2d::getCypher() const {
}
void Scheduler_v2d::promptAction(act *action) {
- Utils::promptBox(_vm->_file->fetchString(action->a3.promptIndex));
- warning("STUB: doAction(act3), expecting answer %s", _vm->_file->fetchString(action->a3.responsePtr[0]));
+ Common::String response;
+
+ response = Utils::promptBox(_vm->_file->fetchString(action->a3.promptIndex));
+ response.toLowercase();
- // TODO: The answer of the player is not handled currently! Once it'll be read in the messageBox, uncomment this block
-#if 0
- char *response = Utils::Box(BOX_PROMPT, "%s", _vm->_file->fetchString(action->a3.promptIndex));
+ debug(1, "doAction(act3), expecting answer %s", _vm->_file->fetchString(action->a3.responsePtr[0]));
bool found = false;
- char *tmpStr; // General purpose string ptr
+ const char *tmpStr; // General purpose string ptr
- for (dx = 0; !found && (action->a3.responsePtr[dx] != -1); dx++) {
+ char resp[256];
+ strncpy(resp, response.c_str(), 256);
+
+ for (int dx = 0; !found && (action->a3.responsePtr[dx] != -1); dx++) {
tmpStr = _vm->_file->fetchString(action->a3.responsePtr[dx]);
- if (strstr(Utils::strlwr(response) , tmpStr))
+ if (strstr(Utils::strlwr(resp), tmpStr))
found = true;
}
@@ -1598,10 +1595,6 @@ void Scheduler_v2d::promptAction(act *action) {
insertActionList(action->a3.actPassIndex);
else
insertActionList(action->a3.actFailIndex);
-#endif
-
- // HACK: As the answer is not read, currently it's always considered correct
- insertActionList(action->a3.actPassIndex);
}
/**
diff --git a/engines/hugo/util.cpp b/engines/hugo/util.cpp
index 044b58e986..6846bc98af 100644
--- a/engines/hugo/util.cpp
+++ b/engines/hugo/util.cpp
@@ -104,6 +104,9 @@ Common::String promptBox(const Common::String &msg) {
return Common::String();
EntryDialog dialog(msg, "OK", "");
+
+ dialog.runModal();
+
return dialog.getEditString();
}
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index 5a3b229c9d..0f84b09547 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -1379,9 +1379,7 @@ void Interface::setSave(PanelButton *panelButton) {
fileName = _vm->calcSaveFileName(_vm->getSaveFile(_optionSaveFileTitleNumber)->slotNumber);
_vm->save(fileName, _textInputString);
}
- _vm->getTimerManager()->removeTimerProc(&saveReminderCallback);
- _vm->getTimerManager()->installTimerProc(&saveReminderCallback, TIMETOSAVE, this);
- setSaveReminderState(1);
+ resetSaveReminder();
_textInput = false;
setMode(kPanelOption);
@@ -1393,6 +1391,12 @@ void Interface::setSave(PanelButton *panelButton) {
}
}
+void Interface::resetSaveReminder() {
+ _vm->getTimerManager()->removeTimerProc(&saveReminderCallback);
+ _vm->getTimerManager()->installTimerProc(&saveReminderCallback, TIMETOSAVE, this);
+ setSaveReminderState(1);
+}
+
void Interface::handleOptionUpdate(const Point& mousePoint) {
int16 mouseY;
Rect rect;
diff --git a/engines/saga/interface.h b/engines/saga/interface.h
index b9a96653a7..09631bf0e8 100644
--- a/engines/saga/interface.h
+++ b/engines/saga/interface.h
@@ -288,6 +288,8 @@ public:
int32 getProtectHash() { return _protectHash; }
+ void resetSaveReminder();
+
private:
void handleMainUpdate(const Point& mousePoint); // main panel update
void handleMainClick(const Point& mousePoint); // main panel click
diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp
index 9edb79fa7c..6a6992fb5f 100644
--- a/engines/saga/saveload.cpp
+++ b/engines/saga/saveload.cpp
@@ -256,6 +256,8 @@ void SagaEngine::save(const char *fileName, const char *saveName) {
warning("Can't write file '%s'. (Disk full?)", fileName);
delete out;
+
+ _interface->resetSaveReminder();
}
void SagaEngine::load(const char *fileName) {
diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h
index 40eeba3663..8f555818f4 100644
--- a/engines/scumm/scumm-md5.h
+++ b/engines/scumm/scumm-md5.h
@@ -1,5 +1,5 @@
/*
- This file was generated by the md5table tool on Mon Oct 18 00:42:16 2010
+ This file was generated by the md5table tool on Sun Apr 17 10:46:26 2011
DO NOT EDIT MANUALLY!
*/
@@ -206,6 +206,7 @@ static const MD5Table md5table[] = {
{ "4c4820518e16e1a0e3616a3b021a04f3", "catalog", "HE CUP", "Preview", 10927456, Common::DE_DEU, Common::kPlatformUnknown },
{ "4cb9c3618f71668f8e4346c8f323fa82", "monkey2", "", "", 10700, Common::EN_ANY, Common::kPlatformMacintosh },
{ "4ce2d5b355964bbcb5e5ce73236ef868", "freddicove", "HE 100", "", -1, Common::RU_RUS, Common::kPlatformWindows },
+ { "4cfd3fda4a4e6e64a1fc488eba973b7a", "fbpack", "", "", -1, Common::EN_ANY, Common::kPlatformPC },
{ "4d34042713958b971cb139fba4658586", "atlantis", "FM-TOWNS", "", -1, Common::JA_JPN, Common::kPlatformFMTowns },
{ "4dbff3787aedcd96b0b325f2d92d7ad9", "maze", "HE 100", "Updated", -1, Common::EN_USA, Common::kPlatformUnknown },
{ "4dc780f1bc587a193ce8a97652791438", "loom", "EGA", "EGA", -1, Common::EN_ANY, Common::kPlatformAmiga },
diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp
index 69051d45fd..e63bc912c4 100644
--- a/engines/toon/character.cpp
+++ b/engines/toon/character.cpp
@@ -166,8 +166,9 @@ bool Character::walkTo(int32 newPosX, int32 newPosY) {
_vm->getPathFinding()->resetBlockingRects();
- if (_id == 1) {
- int32 sizeX = MAX<int32>(5, 40 * _vm->getDrew()->getScale() / 1024);
+ // don't allow flux to go at the same position as drew
+ if (_id == 1 ) {
+ int32 sizeX = MAX<int32>(5, 30 * _vm->getDrew()->getScale() / 1024);
int32 sizeY = MAX<int32>(2, 20 * _vm->getDrew()->getScale() / 1024);
_vm->getPathFinding()->addBlockingEllipse(_vm->getDrew()->getFinalX(), _vm->getDrew()->getFinalY(), sizeX, sizeY);
}
diff --git a/engines/toon/font.cpp b/engines/toon/font.cpp
index 8192a6f6f1..0e2d58ca83 100644
--- a/engines/toon/font.cpp
+++ b/engines/toon/font.cpp
@@ -81,7 +81,7 @@ void FontRenderer::renderText(int32 x, int32 y, Common::String origText, int32 m
x -= xx / 2;
}
- _vm->addDirtyRect(x, y, x + xx, y + yy);
+ _vm->addDirtyRect(x, y, x + xx + 2, y + yy);
int32 curX = x;
int32 curY = y;
@@ -214,7 +214,7 @@ void FontRenderer::renderMultiLineText(int32 x, int32 y, Common::String origText
curChar = textToFont(curChar);
int width = _currentFont->getFrameWidth(curChar);
- curWidth += width - 2;
+ curWidth += MAX<int32>(width - 2, 0);
it++;
curLetterNr++;
}
@@ -275,12 +275,12 @@ void FontRenderer::renderMultiLineText(int32 x, int32 y, Common::String origText
for (int32 i = 0; i < numLines; i++) {
const byte *line = lines[i];
curX = x - lineSize[i] / 2;
- _vm->addDirtyRect(curX + _vm->state()->_currentScrollValue, y, curX + lineSize[i] + _vm->state()->_currentScrollValue, curY + height);
+ _vm->addDirtyRect(curX + _vm->state()->_currentScrollValue, curY, curX + lineSize[i] + _vm->state()->_currentScrollValue + 2, curY + height);
while (*line) {
byte curChar = textToFont(*line);
if (curChar != 32) _currentFont->drawFontFrame(_vm->getMainSurface(), curChar, curX + _vm->state()->_currentScrollValue, curY, _currentFontColor);
- curX = curX + _currentFont->getFrameWidth(curChar) - 2;
+ curX = curX + MAX<int32>(_currentFont->getFrameWidth(curChar) - 2, 0);
//height = MAX(height, _currentFont->getFrameHeight(curChar));
line++;
}
diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp
index 2040668245..1bc53e0e20 100644
--- a/engines/toon/toon.cpp
+++ b/engines/toon/toon.cpp
@@ -843,6 +843,7 @@ ToonEngine::ToonEngine(OSystem *syst, const ADGameDescription *gameDescription)
_backupPalette = NULL;
_additionalPalette1 = NULL;
_additionalPalette2 = NULL;
+ _additionalPalette2Present = false;
_cutawayPalette = NULL;
_universalPalette = NULL;
_fluxPalette = NULL;
@@ -1148,6 +1149,7 @@ void ToonEngine::loadScene(int32 SceneId, bool forGameLoad) {
strcat(temp, ".NPP");
loadAdditionalPalette(temp, 0);
+ _additionalPalette2Present = false;
strcpy(temp, state()->_locations[SceneId]._name);
strcat(temp, ".NP2");
loadAdditionalPalette(temp, 1);
@@ -1318,6 +1320,7 @@ void ToonEngine::loadAdditionalPalette(Common::String fileName, int32 mode) {
case 1:
memcpy(_additionalPalette2, palette, 69);
fixPaletteEntries(_additionalPalette2, 23);
+ _additionalPalette2Present = true;
break;
case 2:
memcpy(_cutawayPalette, palette, size);
@@ -1786,7 +1789,8 @@ void ToonEngine::flipScreens() {
if (_gameState->_inCloseUp) {
_gameState->_currentScrollValue = TOON_SCREEN_WIDTH;
setPaletteEntries(_cutawayPalette, 1, 128);
- setPaletteEntries(_additionalPalette2, 232, 23);
+ if (_additionalPalette2Present)
+ setPaletteEntries(_additionalPalette2, 232, 23);
} else {
_gameState->_currentScrollValue = 0;
_currentPicture->setupPalette();
diff --git a/engines/toon/toon.h b/engines/toon/toon.h
index 3554900684..373437d658 100644
--- a/engines/toon/toon.h
+++ b/engines/toon/toon.h
@@ -352,6 +352,7 @@ protected:
uint8 *_backupPalette;
uint8 *_additionalPalette1;
uint8 *_additionalPalette2;
+ bool _additionalPalette2Present;
uint8 *_cutawayPalette;
uint8 *_universalPalette;
uint8 *_fluxPalette;
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index 9e3b3fcc0e..e9f0079236 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -2243,7 +2243,6 @@ void SceneObject::removeObject() {
_globals->_sceneObjects->remove(this);
if (_visage) {
- _vm->_memoryManager.deallocate(_visage);
_visage = 0;
}
diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp
index 9f4d197377..ad4e76f61c 100644
--- a/engines/tsage/debugger.cpp
+++ b/engines/tsage/debugger.cpp
@@ -37,6 +37,12 @@ Debugger::Debugger() : GUI::Debugger() {
DCmd_Register("scene", WRAP_METHOD(Debugger, Cmd_Scene));
DCmd_Register("walk_regions", WRAP_METHOD(Debugger, Cmd_WalkRegions));
DCmd_Register("priority_regions", WRAP_METHOD(Debugger, Cmd_PriorityRegions));
+ DCmd_Register("setflag", WRAP_METHOD(Debugger, Cmd_SetFlag));
+ DCmd_Register("getflag", WRAP_METHOD(Debugger, Cmd_GetFlag));
+ DCmd_Register("clearflag", WRAP_METHOD(Debugger, Cmd_ClearFlag));
+ DCmd_Register("listobjects", WRAP_METHOD(Debugger, Cmd_ListObjects));
+ DCmd_Register("moveobject", WRAP_METHOD(Debugger, Cmd_MoveObject));
+
DCmd_Register("item", WRAP_METHOD(Debugger, Cmd_Item));
}
@@ -161,6 +167,220 @@ bool Debugger::Cmd_PriorityRegions(int argc, const char **argv) {
return true;
}
+/*
+ * This command sets a flag
+ */
+bool Debugger::Cmd_SetFlag(int argc, const char **argv) {
+ // Check for a flag to set
+ if (argc != 2) {
+ DebugPrintf("Usage: %s <flag number>\n", argv[0]);
+ return true;
+ }
+
+ int flagNum = strToInt(argv[1]);
+ _globals->setFlag(flagNum);
+ return true;
+}
+
+/*
+ * This command gets the value of a flag
+ */
+bool Debugger::Cmd_GetFlag(int argc, const char **argv) {
+ // Check for an flag to display
+ if (argc != 2) {
+ DebugPrintf("Usage: %s <flag number>\n", argv[0]);
+ return true;
+ }
+
+ int flagNum = strToInt(argv[1]);
+ DebugPrintf("Value: %d\n", _globals->getFlag(flagNum));
+ return true;
+}
+
+/*
+ * This command clears a flag
+ */
+bool Debugger::Cmd_ClearFlag(int argc, const char **argv) {
+ // Check for a flag to clear
+ if (argc != 2) {
+ DebugPrintf("Usage: %s <flag number>\n", argv[0]);
+ return true;
+ }
+
+ int flagNum = strToInt(argv[1]);
+ _globals->clearFlag(flagNum);
+ return true;
+}
+
+/*
+ * This command lists the objects available, and their ID
+ */
+bool Debugger::Cmd_ListObjects(int argc, const char **argv) {
+ if (argc != 1) {
+ DebugPrintf("Usage: %s\n", argv[0]);
+ return true;
+ }
+
+ DebugPrintf("Available objects for this game are:\n");
+ DebugPrintf("0 - Stunner\n");
+ DebugPrintf("1 - Scanner\n");
+ DebugPrintf("2 - Stasis Box\n");
+ DebugPrintf("3 - Info Disk\n");
+ DebugPrintf("4 - Stasis Negator\n");
+ DebugPrintf("5 - Key Device\n");
+ DebugPrintf("6 - Medkit\n");
+ DebugPrintf("7 - Ladder\n");
+ DebugPrintf("8 - Rope\n");
+ DebugPrintf("9 - Key\n");
+ DebugPrintf("10 - Translator\n");
+ DebugPrintf("11 - Ale\n");
+ DebugPrintf("12 - Paper\n");
+ DebugPrintf("13 - Waldos\n");
+ DebugPrintf("14 - Stasis Box 2\n");
+ DebugPrintf("15 - Ring\n");
+ DebugPrintf("16 - Cloak\n");
+ DebugPrintf("17 - Tunic\n");
+ DebugPrintf("18 - Candle\n");
+ DebugPrintf("19 - Straw\n");
+ DebugPrintf("20 - Scimitar\n");
+ DebugPrintf("21 - Sword\n");
+ DebugPrintf("22 - Helmet\n");
+ DebugPrintf("23 - Items\n");
+ DebugPrintf("24 - Concentrator\n");
+ DebugPrintf("25 - Nullifier\n");
+ DebugPrintf("26 - Peg\n");
+ DebugPrintf("27 - Vial\n");
+ DebugPrintf("28 - Jacket\n");
+ DebugPrintf("29 - Tunic 2\n");
+ DebugPrintf("30 - Bone\n");
+ DebugPrintf("31 - Empty Jar\n");
+ DebugPrintf("32 - Jar\n");
+ return true;
+}
+
+/*
+ * This command gets an item, or move it to a room
+ */
+bool Debugger::Cmd_MoveObject(int argc, const char **argv) {
+ // Check for a flag to clear
+ if ((argc < 2) || (argc > 3)){
+ DebugPrintf("Usage: %s <object number> [<scene number>]\n", argv[0]);
+ DebugPrintf("If no scene is specified, the object will be added to inventory\n");
+ return true;
+ }
+
+ int objNum = strToInt(argv[1]);
+ int sceneNum = 1;
+ if (argc == 3)
+ sceneNum = strToInt(argv[2]);
+
+ switch (objNum) {
+ case OBJECT_STUNNER:
+ _globals->_inventory._stunner._sceneNumber = sceneNum;
+ break;
+ case OBJECT_SCANNER:
+ _globals->_inventory._scanner._sceneNumber = sceneNum;
+ break;
+ case OBJECT_STASIS_BOX:
+ _globals->_inventory._stasisBox._sceneNumber = sceneNum;
+ break;
+ case OBJECT_INFODISK:
+ _globals->_inventory._infoDisk._sceneNumber = sceneNum;
+ break;
+ case OBJECT_STASIS_NEGATOR:
+ _globals->_inventory._stasisNegator._sceneNumber = sceneNum;
+ break;
+ case OBJECT_KEY_DEVICE:
+ _globals->_inventory._keyDevice._sceneNumber = sceneNum;
+ break;
+ case OBJECT_MEDKIT:
+ _globals->_inventory._medkit._sceneNumber = sceneNum;
+ break;
+ case OBJECT_LADDER:
+ _globals->_inventory._ladder._sceneNumber = sceneNum;
+ break;
+ case OBJECT_ROPE:
+ _globals->_inventory._rope._sceneNumber = sceneNum;
+ break;
+ case OBJECT_KEY:
+ _globals->_inventory._key._sceneNumber = sceneNum;
+ break;
+ case OBJECT_TRANSLATOR:
+ _globals->_inventory._translator._sceneNumber = sceneNum;
+ break;
+ case OBJECT_ALE:
+ _globals->_inventory._ale._sceneNumber = sceneNum;
+ break;
+ case OBJECT_PAPER:
+ _globals->_inventory._paper._sceneNumber = sceneNum;
+ break;
+ case OBJECT_WALDOS:
+ _globals->_inventory._waldos._sceneNumber = sceneNum;
+ break;
+ case OBJECT_STASIS_BOX2:
+ _globals->_inventory._stasisBox2._sceneNumber = sceneNum;
+ break;
+ case OBJECT_RING:
+ _globals->_inventory._ring._sceneNumber = sceneNum;
+ break;
+ case OBJECT_CLOAK:
+ _globals->_inventory._cloak._sceneNumber = sceneNum;
+ break;
+ case OBJECT_TUNIC:
+ _globals->_inventory._tunic._sceneNumber = sceneNum;
+ break;
+ case OBJECT_CANDLE:
+ _globals->_inventory._candle._sceneNumber = sceneNum;
+ break;
+ case OBJECT_STRAW:
+ _globals->_inventory._straw._sceneNumber = sceneNum;
+ break;
+ case OBJECT_SCIMITAR:
+ _globals->_inventory._scimitar._sceneNumber = sceneNum;
+ break;
+ case OBJECT_SWORD:
+ _globals->_inventory._sword._sceneNumber = sceneNum;
+ break;
+ case OBJECT_HELMET:
+ _globals->_inventory._helmet._sceneNumber = sceneNum;
+ break;
+ case OBJECT_ITEMS:
+ _globals->_inventory._items._sceneNumber = sceneNum;
+ break;
+ case OBJECT_CONCENTRATOR:
+ _globals->_inventory._concentrator._sceneNumber = sceneNum;
+ break;
+ case OBJECT_NULLIFIER:
+ _globals->_inventory._nullifier._sceneNumber = sceneNum;
+ break;
+ case OBJECT_PEG:
+ _globals->_inventory._peg._sceneNumber = sceneNum;
+ break;
+ case OBJECT_VIAL:
+ _globals->_inventory._vial._sceneNumber = sceneNum;
+ break;
+ case OBJECT_JACKET:
+ _globals->_inventory._jacket._sceneNumber = sceneNum;
+ break;
+ case OBJECT_TUNIC2:
+ _globals->_inventory._tunic2._sceneNumber = sceneNum;
+ break;
+ case OBJECT_BONE:
+ _globals->_inventory._bone._sceneNumber = sceneNum;
+ break;
+ case OBJECT_EMPTY_JAR:
+ _globals->_inventory._emptyJar._sceneNumber = sceneNum;
+ break;
+ case OBJECT_JAR:
+ _globals->_inventory._jar._sceneNumber = sceneNum;
+ break;
+ default:
+ DebugPrintf("Invlid object Id %s\n", argv[1]);
+ }
+
+ return true;
+}
+
/**
* Give a specified item to the player
*/
@@ -169,4 +389,5 @@ bool Debugger::Cmd_Item(int argc, const char **argv) {
return true;
}
+
} // End of namespace tSage
diff --git a/engines/tsage/debugger.h b/engines/tsage/debugger.h
index c94d77b2ab..a34bb1ef0a 100644
--- a/engines/tsage/debugger.h
+++ b/engines/tsage/debugger.h
@@ -40,6 +40,12 @@ protected:
bool Cmd_Scene(int argc, const char **argv);
bool Cmd_WalkRegions(int argc, const char **argv);
bool Cmd_PriorityRegions(int argc, const char **argv);
+ bool Cmd_SetFlag(int argc, const char **argv);
+ bool Cmd_GetFlag(int argc, const char **argv);
+ bool Cmd_ClearFlag(int argc, const char **argv);
+ bool Cmd_ListObjects(int argc, const char **argv);
+ bool Cmd_MoveObject(int argc, const char **argv);
+
bool Cmd_Item(int argc, const char **argv);
};
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index d67810cac2..77316d2d7d 100644
--- a/engines/tsage/graphics.cpp
+++ b/engines/tsage/graphics.cpp
@@ -410,19 +410,20 @@ void GfxSurface::loadScreenSection(Graphics::Surface &dest, int xHalf, int yHalf
* included in a scaled image
*/
static int *scaleLine(int size, int srcSize) {
- int scale = 100 * size / srcSize;
+ const int PRECISION_FACTOR = 1000;
+ int scale = PRECISION_FACTOR * size / srcSize;
assert(scale >= 0);
int *v = new int[size];
- Common::set_to(v, &v[size], 0);
+ Common::set_to(v, &v[size], -1);
int distCtr = 0;
int *destP = v;
for (int distIndex = 0; distIndex < srcSize; ++distIndex) {
distCtr += scale;
- while (distCtr >= 100) {
+ while (distCtr >= PRECISION_FACTOR) {
assert(destP < &v[size]);
*destP++ = distIndex;
- distCtr -= 100;
+ distCtr -= PRECISION_FACTOR;
}
}
@@ -436,7 +437,7 @@ static int *scaleLine(int size, int srcSize) {
* @param NewHeight New height for scaled image
* @remarks Caller is responsible for freeing the returned surface
*/
-static GfxSurface ResizeSurface(GfxSurface &src, int xSize, int ySize) {
+static GfxSurface ResizeSurface(GfxSurface &src, int xSize, int ySize, int transIndex) {
GfxSurface s;
s.create(xSize, ySize);
@@ -448,12 +449,22 @@ static GfxSurface ResizeSurface(GfxSurface &src, int xSize, int ySize) {
// Loop to create scaled version
for (int yp = 0; yp < ySize; ++yp) {
- const byte *srcP = (const byte *)srcImage.getBasePtr(0, vertUsage[yp]);
byte *destP = (byte *)destImage.getBasePtr(0, yp);
- for (int xp = 0; xp < xSize; ++xp) {
- const byte *tempSrcP = srcP + horizUsage[xp];
- *destP++ = *tempSrcP++;
+ if (vertUsage[yp] == -1) {
+ Common::set_to(destP, destP + xSize, transIndex);
+ } else {
+ const byte *srcP = (const byte *)srcImage.getBasePtr(0, vertUsage[yp]);
+
+ for (int xp = 0; xp < xSize; ++xp) {
+ if (horizUsage[xp] != -1) {
+ const byte *tempSrcP = srcP + horizUsage[xp];
+ *destP++ = *tempSrcP++;
+ } else {
+ // Pixel overrun at the end of the line
+ *destP++ = transIndex;
+ }
+ }
}
}
@@ -493,7 +504,7 @@ void GfxSurface::copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Regi
}
if ((destBounds.width() != srcBounds.width()) || (destBounds.height() != srcBounds.height()))
- srcImage = ResizeSurface(srcImage, destBounds.width(), destBounds.height());
+ srcImage = ResizeSurface(srcImage, destBounds.width(), destBounds.height(), src._transColor);
Graphics::Surface srcSurface = srcImage.lockSurface();
Graphics::Surface destSurface = lockSurface();
diff --git a/engines/tsage/ringworld_scenes1.cpp b/engines/tsage/ringworld_scenes1.cpp
index aad415b1d7..c8d10e1708 100644
--- a/engines/tsage/ringworld_scenes1.cpp
+++ b/engines/tsage/ringworld_scenes1.cpp
@@ -1004,7 +1004,8 @@ void Scene40::Action1::signal() {
break;
case 9: {
scene->_dyingKzin.setStrip(1);
- scene->_dyingKzin.setFrame(1);
+ //Workaround: The original uses setFrame(1) but it's completely wrong.
+ scene->_dyingKzin.setFrame(2);
scene->_dyingKzin._moveDiff.y = 15;
scene->_dyingKzin.animate(ANIM_MODE_5, NULL);
Common::Point pt(223, 186);
@@ -1207,7 +1208,7 @@ void Scene40::Action5::signal() {
switch (_actionIndex++) {
case 0:
- setDelay(_globals->_randomSource.getRandomNumber(120));
+ setDelay(_globals->_randomSource.getRandomNumber(119) + 120);
break;
case 1:
scene->_object2.animate(ANIM_MODE_8, 1, this);
@@ -1223,12 +1224,13 @@ void Scene40::Action6::signal() {
scene->_object1.postInit();
scene->_object1.setVisage(16);
scene->_object1.setStrip2(6);
+ scene->_object1._moveDiff = Common::Point(40, 40);
scene->_object1.setPosition(Common::Point(313, 53));
scene->_object1._field7A = 60;
Common::Point pt(141, 194);
NpcMover *mover = new NpcMover();
- scene->_object1.addMover(mover, &pt, this);
+ scene->_object1.addMover(mover, &pt, NULL);
scene->_object1.animate(ANIM_MODE_5, NULL);
scene->_doorway.postInit();
@@ -1256,6 +1258,7 @@ void Scene40::Action7::signal() {
switch (_actionIndex++) {
case 0:
+ // TODO: check if it's rand(500) or rand(499)+500
setDelay(_globals->_randomSource.getRandomNumber(500));
break;
case 1:
@@ -1269,6 +1272,8 @@ void Scene40::Action7::signal() {
scene->_object7.setPosition(Common::Point(305, 61));
scene->_object7.setFrame(15);
}
+ scene->_object7.animate(ANIM_MODE_5, this);
+ scene->_soundHandler.startSound(25);
break;
case 2:
scene->_object7.remove();
@@ -1363,6 +1368,7 @@ void Scene40::Assassin::doAction(int action) {
Common::Point pt(230, 187);
NpcMover *mover = new NpcMover();
addMover(mover, &pt, NULL);
+ scene->setAction(&scene->_action2);
}
break;
case OBJECT_SCANNER:
@@ -1875,7 +1881,7 @@ void Scene60::Action1::signal() {
scene->_object10.animate(ANIM_MODE_8, 0, NULL);
scene->_object10._numFrames = 5;
- scene->_object6.animate(ANIM_MODE_2, NULL);
+ scene->_controlButton.animate(ANIM_MODE_2, NULL);
if (!_globals->getFlag(83)) {
scene->_object5.postInit();
@@ -1900,9 +1906,9 @@ void Scene60::Action1::signal() {
if (_globals->_sceneObjects->contains(&scene->_object10))
scene->_object10.remove();
- scene->_object6.remove();
+ scene->_controlButton.remove();
scene->_slaveButton.remove();
- scene->_object8.remove();
+ scene->_masterButton.remove();
scene->_item1.remove();
scene->_item2.remove();
@@ -1951,8 +1957,8 @@ void Scene60::Action1::signal() {
if (_globals->_sceneObjects->contains(&scene->_object5))
scene->_object5.remove();
- scene->_object6.animate(ANIM_MODE_NONE);
- scene->_object6.setFrame(1);
+ scene->_controlButton.animate(ANIM_MODE_NONE);
+ scene->_controlButton.setFrame(1);
scene->_object10.remove();
scene->_object9.postInit();
@@ -1965,8 +1971,8 @@ void Scene60::Action1::signal() {
scene->_soundHandler1.startSound(35);
scene->_soundHandler3.proc3();
- scene->_object8.setFrame(1);
- scene->_object8._state = 0;
+ scene->_masterButton.setFrame(1);
+ scene->_masterButton._state = 0;
_globals->clearFlag(103);
_globals->clearFlag(!_globals->_stripNum ? 116 : 119);
@@ -1979,6 +1985,7 @@ void Scene60::Action1::signal() {
scene->_object9.remove();
remove();
break;
+ case 8:
default:
break;
}
@@ -2054,21 +2061,22 @@ void Scene60::Object4::doAction(int action) {
SceneItem::display(0, 0);
scene->loadScene(60);
- scene->_object6.setVisage(60);
- scene->_object6.setPosition(Common::Point(233, 143));
- scene->_object6.animate(ANIM_MODE_2, NULL);
+ scene->_controlButton.postInit();
+ scene->_controlButton.setVisage(60);
+ scene->_controlButton.setPosition(Common::Point(233, 143));
+ scene->_controlButton.animate(ANIM_MODE_2, NULL);
scene->_slaveButton.postInit();
scene->_slaveButton.setVisage(60);
scene->_slaveButton.setStrip(8);
scene->_slaveButton.setPosition(Common::Point(143, 125));
- scene->_object8.postInit();
- scene->_object8.setVisage(60);
- scene->_object8.setStrip(8);
- scene->_object8.setPosition(Common::Point(143, 105));
+ scene->_masterButton.postInit();
+ scene->_masterButton.setVisage(60);
+ scene->_masterButton.setStrip(8);
+ scene->_masterButton.setPosition(Common::Point(143, 105));
- _globals->_sceneItems.push_front(&scene->_object8);
+ _globals->_sceneItems.push_front(&scene->_masterButton);
_globals->_sceneItems.push_front(&scene->_slaveButton);
scene->_object10.postInit();
@@ -2080,13 +2088,13 @@ void Scene60::Object4::doAction(int action) {
if (scene->_slaveButton._state)
scene->_slaveButton.setFrame(2);
- if (scene->_object8._state)
- scene->_object8.setFrame(2);
+ if (scene->_masterButton._state)
+ scene->_masterButton.setFrame(2);
_globals->_sceneItems.push_front(&scene->_item1);
- _globals->_sceneItems.push_front(&scene->_object6);
+ _globals->_sceneItems.push_front(&scene->_controlButton);
_globals->_sceneItems.push_front(&scene->_slaveButton);
- _globals->_sceneItems.push_front(&scene->_object8);
+ _globals->_sceneItems.push_front(&scene->_masterButton);
_globals->_sceneItems.push_back(&scene->_item2);
_globals->gfxManager()._font.setFontNumber(2);
@@ -2114,7 +2122,7 @@ void Scene60::Object5::doAction(int action) {
}
}
-void Scene60::Object6::doAction(int action) {
+void Scene60::ControlObject::doAction(int action) {
Scene60 *scene = (Scene60 *)_globals->_sceneManager._scene;
if (action == CURSOR_LOOK) {
@@ -2141,7 +2149,7 @@ void Scene60::SlaveObject::doAction(int action) {
if (action == CURSOR_LOOK) {
SceneItem::display2(60, 8);
} else if (action == CURSOR_USE) {
- if (scene->_object8._state)
+ if (scene->_masterButton._state)
scene->_sceneMode = 19;
else if (_state) {
scene->_soundHandler3.proc3();
@@ -2165,20 +2173,22 @@ void Scene60::SlaveObject::doAction(int action) {
}
}
-void Scene60::Object8::doAction(int action) {
+void Scene60::MasterObject::doAction(int action) {
Scene60 *scene = (Scene60 *)_globals->_sceneManager._scene;
if (action == CURSOR_LOOK) {
SceneItem::display2(60, 7);
} else if (action == CURSOR_USE) {
- if (!scene->_object8._state)
+ if (!scene->_controlButton._animateMode)
scene->_sceneMode = 14;
+ else if (scene->_slaveButton._state)
+ scene->_sceneMode = 20;
else if (_state) {
scene->_soundHandler3.proc3();
animate(ANIM_MODE_6, NULL);
+ _state = 0;
_globals->clearFlag(103);
_globals->clearFlag(!_globals->_stripNum ? 116 : 119);
- _state = 0;
scene->_sceneMode = 9998;
} else {
scene->_soundHandler3.startSound(39);
@@ -2291,20 +2301,20 @@ void Scene60::postInit(SceneObjectList *OwnerList) {
_slaveButton.setPosition(Common::Point(143, 125));
_slaveButton._state = 0;
- _object8.postInit();
- _object8.setVisage(60);
- _object8.setStrip(8);
- _object8.setPosition(Common::Point(143, 105));
- _object8._state = 0;
+ _masterButton.postInit();
+ _masterButton.setVisage(60);
+ _masterButton.setStrip(8);
+ _masterButton.setPosition(Common::Point(143, 105));
+ _masterButton._state = 0;
- _globals->_sceneItems.push_back(&_object8);
+ _globals->_sceneItems.push_back(&_masterButton);
_globals->_sceneItems.push_back(&_slaveButton);
- _object6.postInit();
- _object6.setVisage(60);
- _object6.setStrip(5);
- _object6.setPosition(Common::Point(233, 143));
- _globals->_sceneItems.push_back(&_object6);
+ _controlButton.postInit();
+ _controlButton.setVisage(60);
+ _controlButton.setStrip(5);
+ _controlButton.setPosition(Common::Point(233, 143));
+ _globals->_sceneItems.push_back(&_controlButton);
if (_globals->_stripNum == -1) {
_globals->_stripNum = 0;
@@ -2324,12 +2334,12 @@ void Scene60::postInit(SceneObjectList *OwnerList) {
}
if (_globals->getFlag(116)) {
- _object8._state = 1;
- _object8.setFrame(2);
+ _masterButton._state = 1;
+ _masterButton.setFrame(2);
}
if (_globals->getFlag(118)) {
- _object6.animate(ANIM_MODE_2, NULL);
+ _controlButton.animate(ANIM_MODE_2, NULL);
_object10.postInit();
_object10.setVisage(60);
@@ -2358,12 +2368,12 @@ void Scene60::postInit(SceneObjectList *OwnerList) {
}
if (_globals->getFlag(119)) {
- _object8._state = 1;
- _object8.setFrame(2);
+ _masterButton._state = 1;
+ _masterButton.setFrame(2);
}
if (_globals->getFlag(121)) {
- _object6.animate(ANIM_MODE_2, NULL);
+ _controlButton.animate(ANIM_MODE_2, NULL);
_object10.postInit();
_object10.setVisage(60);
diff --git a/engines/tsage/ringworld_scenes1.h b/engines/tsage/ringworld_scenes1.h
index 4e95edcbbb..4862bedfe0 100644
--- a/engines/tsage/ringworld_scenes1.h
+++ b/engines/tsage/ringworld_scenes1.h
@@ -339,7 +339,7 @@ class Scene60 : public Scene {
public:
virtual void doAction(int action);
};
- class Object6 : public SceneObject {
+ class ControlObject : public SceneObject {
public:
virtual void doAction(int action);
};
@@ -347,7 +347,7 @@ class Scene60 : public Scene {
public:
virtual void doAction(int action);
};
- class Object8 : public SceneObjectExt {
+ class MasterObject : public SceneObjectExt {
public:
virtual void doAction(int action);
};
@@ -383,9 +383,9 @@ public:
Object3 _object3;
Object4 _object4;
Object5 _object5;
- Object6 _object6;
+ ControlObject _controlButton;
SlaveObject _slaveButton;
- Object8 _object8;
+ MasterObject _masterButton;
Object9 _object9;
SceneObject _object10;
Item1 _item1;
diff --git a/engines/tsage/ringworld_scenes10.cpp b/engines/tsage/ringworld_scenes10.cpp
index 3aba65026e..4d413a09fb 100644
--- a/engines/tsage/ringworld_scenes10.cpp
+++ b/engines/tsage/ringworld_scenes10.cpp
@@ -155,7 +155,7 @@ void Scene9100::postInit(SceneObjectList *OwnerList) {
_sceneHotspot5.setup(69, 36, 121, 272, 9100, 45, 46);
_sceneHotspot6.setup(127, 0, 200, 52, 9100, 47, 48);
- _globals->_soundHandler.startSound(251, 0, 127);
+ _globals->_soundHandler.startSound(251);
if (_globals->_sceneManager._previousScene == 9150) {
if (_globals->getFlag(20)) {
_globals->_player.disableControl();
@@ -240,7 +240,7 @@ void Scene9150::dispatch() {
} else {
_globals->_player.disableControl();
if (_globals->getFlag(11)) {
- _globals->_soundHandler.startSound(286, 0, 127);
+ _globals->_soundHandler.startSound(286);
_sceneMode = 9153;
} else {
_sceneMode = 9156;
@@ -274,7 +274,7 @@ void Scene9150::postInit(SceneObjectList *OwnerList) {
_sceneHotspot8.setup(133, 584, 142, 640, 9150, 57, -1);
_sceneHotspot10.setup(83, 304, 103, 323, 9150, 58, 59);
- _globals->_soundHandler.startSound(285, 0, 127);
+ _globals->_soundHandler.startSound(285);
_globals->_player.disableControl();
if (_globals->getFlag(20)) {
@@ -406,7 +406,7 @@ void Scene9200::postInit(SceneObjectList *OwnerList) {
_object1.animate(ANIM_MODE_2, 0);
_object1.setPosition(Common::Point(132, 114), 0);
_object1.setPriority2(140);
- _soundHandler.startSound(297, 0, 127);
+ _soundHandler.startSound(297);
_stripManager.addSpeaker(&_speakerQText);
_stripManager.addSpeaker(&_speakerGR);
_stripManager.addSpeaker(&_speakerGText);
@@ -479,7 +479,7 @@ void Scene9300::signal() {
_globals->setFlag(84);
// No break on purpose
case 9303:
- _globals->_soundHandler.startSound(295, 0, 127);
+ _globals->_soundHandler.startSound(295);
_globals->_sceneManager.changeScene(9350);
break;
case 9302:
@@ -509,7 +509,7 @@ void Scene9300::postInit(SceneObjectList *OwnerList) {
_globals->_player.changeZoom(-1);
_object1.postInit();
_object2.postInit();
- _globals->_soundHandler.startSound(289, 0, 127);
+ _globals->_soundHandler.startSound(289);
_hotspot1.setup(35, 142, 76, 212, 9300, 0, 1);
_hotspot2.setup(28, 90, 81, 143, 9300, 2, 3);
@@ -763,7 +763,7 @@ void Scene9400::signal() {
void Scene9400::dispatch() {
if ((_object1._animateMode == 2) && (_object1._strip == 1) && (_object1._frame == 4)){
if (_field1032 == 0) {
- _soundHandler.startSound(296, 0, 127);
+ _soundHandler.startSound(296);
_field1032 = 1;
}
} else {
@@ -1072,7 +1072,7 @@ void Scene9500::signal() {
switch (_sceneMode) {
case 9503:
_globals->_sceneManager.changeScene(9200);
- _globals->_soundHandler.startSound(295, 0, 127);
+ _globals->_soundHandler.startSound(295);
break;
case 9504:
_globals->_sceneManager.changeScene(9850);
@@ -1128,7 +1128,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) {
setZoomPercents(110, 75, 200, 150);
_globals->_player.postInit();
- _globals->_soundHandler.startSound(305, 0, 127);
+ _globals->_soundHandler.startSound(305);
_candle.postInit(0);
_candle.setVisage(9500);
@@ -1236,7 +1236,7 @@ void Scene9700::signal() {
_globals->_events.setCursor(CURSOR_USE);
break;
case 9704:
- _globals->_soundHandler.startSound(323, 0, 127);
+ _globals->_soundHandler.startSound(323);
_globals->_sceneManager.changeScene(9750);
break;
}
@@ -1426,7 +1426,7 @@ void Scene9850::Hotspot17::doAction(int action) {
SceneItem::display(9850, 32, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else {
if (action == CURSOR_USE)
- scene->_soundHandler.startSound(306, 0, 127);
+ scene->_soundHandler.startSound(306);
NamedHotspot::doAction(action);
}
}
@@ -1438,7 +1438,7 @@ void Scene9850::Hotspot18::doAction(int action) {
SceneItem::display(9850, 32, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else {
if (action == CURSOR_USE)
- scene->_soundHandler.startSound(306, 0, 127);
+ scene->_soundHandler.startSound(306);
NamedHotspot::doAction(action);
}
}
@@ -1450,7 +1450,7 @@ void Scene9850::Hotspot19::doAction(int action) {
SceneItem::display(9850, 31, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else {
if (action == CURSOR_USE)
- scene->_soundHandler.startSound(313, 0, 127);
+ scene->_soundHandler.startSound(313);
NamedHotspot::doAction(action);
}
}
@@ -1639,7 +1639,7 @@ void Scene9900::strAction1::signal() {
switch (_actionIndex++) {
case 0:
- scene->_soundHandler.startSound(351, 0, 127);
+ scene->_soundHandler.startSound(351);
_object9.postInit();
_object9.setVisage(18);
_object9._frame = 1;
@@ -1658,7 +1658,7 @@ void Scene9900::strAction1::signal() {
_globals->_scenePalette.addFader(&mask2[0], 1, 5, this);
break;
case 3:
- _globals->_soundHandler.startSound(377, 0, 127);
+ _globals->_soundHandler.startSound(377);
setDelay(120);
break;
case 4:
@@ -1829,7 +1829,7 @@ void Scene9900::signal() {
switch (_sceneMode){
case 150:
- _globals->_soundHandler.startSound(380, 0, 127);
+ _globals->_soundHandler.startSound(380);
_object8.postInit(0);
_object8.setVisage(2002);
_object8.setStrip(1);
@@ -1862,7 +1862,7 @@ void Scene9900::signal() {
setAction(&_sequenceManager, this, 9902, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6);
break;
case 9904:
- _globals->_soundHandler.startSound(390, 0, 127);
+ _globals->_soundHandler.startSound(390);
_sceneMode = 9912;
setAction(&_strAction2, this);
break;
@@ -1893,7 +1893,7 @@ void Scene9900::signal() {
setAction(&_sequenceManager, this, 9904, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6);
break;
case 9909:
- _globals->_soundHandler.startSound(375, 0, 127);
+ _globals->_soundHandler.startSound(375);
_globals->_player.disableControl();
_sceneMode = 9907;
setAction(&_sequenceManager, this, 9907, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6);
@@ -1904,7 +1904,7 @@ void Scene9900::signal() {
setAction(&_sequenceManager, this, 9911, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6);
break;
case 9911:
- _globals->_soundHandler.startSound(367, 0, 127);
+ _globals->_soundHandler.startSound(367);
_globals->_player.disableControl();
_sceneMode = 9909;
setAction(&_sequenceManager, this, 9909, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6);
@@ -2055,7 +2055,7 @@ void Scene9999::postInit(SceneObjectList *OwnerList) {
else
_globals->_stripNum = 2121;
- _globals->_soundHandler.startSound(118, 0, 127);
+ _globals->_soundHandler.startSound(118);
}
diff --git a/engines/tsage/ringworld_scenes3.cpp b/engines/tsage/ringworld_scenes3.cpp
index 0cf299c2de..c0afe48708 100644
--- a/engines/tsage/ringworld_scenes3.cpp
+++ b/engines/tsage/ringworld_scenes3.cpp
@@ -4546,7 +4546,7 @@ void Scene2300::Action2::signal() {
case 7:
scene->_hotspot7._strip = 2;
scene->_hotspot7._frame = 1;
- scene->_hotspot7.animate(ANIM_MODE_7, this);
+ scene->_hotspot7.animate(ANIM_MODE_5, this);
break;
case 8:
scene->_hotspot2.animate(ANIM_MODE_6, this);
@@ -4672,7 +4672,7 @@ void Scene2300::Hotspot5::doAction(int action) {
}
}
-void Scene2300::Hotspot6::doAction(int action) {
+void Scene2300::Hotspot7::doAction(int action) {
Scene2300 *scene = (Scene2300 *)_globals->_sceneManager._scene;
switch (action) {
@@ -4707,7 +4707,7 @@ void Scene2300::postInit(SceneObjectList *OwnerList) {
setZoomPercents(0, 100, 200, 100);
_stripManager.addSpeaker(&_speakerSL);
- _stripManager.addSpeaker(&_speakerML);
+ _stripManager.addSpeaker(&_speakerMText);
_stripManager.addSpeaker(&_speakerQText);
_stripManager.addSpeaker(&_speakerSText);
@@ -4864,7 +4864,10 @@ void Scene2310::postInit(SceneObjectList *OwnerList) {
_globals->_events.setCursor(CURSOR_WALK);
_wireIndex = 5;
- _pageIndex = _globals->_randomSource.getRandomNumber(19) + 1;
+ if (_vm->getFeatures() & GF_CD)
+ _pageIndex = _globals->_randomSource.getRandomNumber(14) + 2;
+ else
+ _pageIndex = _globals->_randomSource.getRandomNumber(19) + 1;
signal();
}
@@ -4966,10 +4969,7 @@ void Scene2310::process(Event &event) {
}
void Scene2310::dispatch() {
- if ((_vm->getFeatures() & GF_CD) && !ConfMan.getBool("copy_protection")) {
- // CD version of Ringworld has the copy protection disabled
- signal();
- } else if (_wireIndex != 5) {
+ if (_wireIndex != 5) {
for (int idx = 0; idx < 5; ++idx) {
if (_rectList[idx].contains(_globals->_events._mousePos)) {
_wireList[_wireIndex].setFrame(idx + 2);
diff --git a/engines/tsage/ringworld_scenes3.h b/engines/tsage/ringworld_scenes3.h
index 61aac522f2..85f454a61e 100644
--- a/engines/tsage/ringworld_scenes3.h
+++ b/engines/tsage/ringworld_scenes3.h
@@ -710,22 +710,14 @@ class Scene2300 : public Scene {
public:
virtual void doAction(int action);
};
- class Hotspot6 : public SceneObject {
- public:
- virtual void doAction(int action);
- };
- class Hotspot12 : public SceneObject {
- public:
- virtual void doAction(int action);
- };
- class Hotspot13 : public SceneObject {
+ class Hotspot7 : public SceneObject {
public:
virtual void doAction(int action);
};
public:
SoundHandler _soundHandler1, _soundHandler2;
SpeakerSL _speakerSL;
- SpeakerML _speakerML;
+ SpeakerMText _speakerMText;
SpeakerQText _speakerQText;
SpeakerSText _speakerSText;
Action1 _action1;
@@ -734,8 +726,9 @@ public:
Action4 _action4;
SceneObject _hotspot1, _hotspot2, _hotspot3, _hotspot4;
Hotspot5 _hotspot5;
- Hotspot6 _hotspot6;
- SceneObject _hotspot7, _hotspot8, _hotspot9, _hotspot10;
+ SceneObject _hotspot6;
+ Hotspot7 _hotspot7;
+ SceneObject _hotspot8, _hotspot9, _hotspot10;
DisplayHotspot _hotspot11, _hotspot12, _hotspot13, _hotspot14, _hotspot15;
Scene2300();
diff --git a/engines/tsage/ringworld_scenes8.cpp b/engines/tsage/ringworld_scenes8.cpp
index a2742bea25..35db3cd387 100644
--- a/engines/tsage/ringworld_scenes8.cpp
+++ b/engines/tsage/ringworld_scenes8.cpp
@@ -48,7 +48,7 @@ void Scene7000::Action1::signal() {
setAction(&scene->_action6, this);
break;
case 2:
- scene->_soundHandler.startSound(252, 0, 127);
+ scene->_soundHandler.startSound(252);
scene->_object8.remove();
scene->_object1.postInit();
scene->_object1.setVisage(7003);
@@ -169,7 +169,7 @@ void Scene7000::Action4::signal() {
setDelay(300);
break;
case 2:
- _globals->_soundHandler.startSound(252, 0, 127);
+ _globals->_soundHandler.startSound(252);
scene->_object1.show();
scene->_object1.setStrip(3);
scene->_object1.setFrame(1);
@@ -199,7 +199,7 @@ void Scene7000::Action5::signal() {
}
case 1:
_globals->_player.checkAngle(&scene->_object1);
- _globals->_soundHandler.startSound(252, 0, 127);
+ _globals->_soundHandler.startSound(252);
scene->_object1.setStrip(2);
scene->_stripManager.start(7015, this);
break;
@@ -532,7 +532,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) {
_object1.animate(ANIM_MODE_8, 0, 0);
_globals->_sceneItems.addItems(&_object1, 0);
}
- _soundHandler.startSound(251, 0, 127);
+ _soundHandler.startSound(251);
if (_globals->_sceneManager._previousScene == 2100) {
if (_globals->getFlag(72)) {
_globals->_player.postInit();
@@ -550,7 +550,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) {
setAction(&_action1);
}
} else {
- _globals->_soundHandler.startSound(250, 0, 127);
+ _globals->_soundHandler.startSound(250);
_globals->setFlag(72);
_object3.postInit();
@@ -597,9 +597,9 @@ void Scene7000::postInit(SceneObjectList *OwnerList) {
_object3.setVisage(5001);
_object3.setStrip2(1);
_object3.setPosition(Common::Point(307, 0), 0);
- _soundHandler.startSound(151, 0, 127);
+ _soundHandler.startSound(151);
_soundHandler.proc5(1);
- _globals->_soundHandler.startSound(250, 0, 127);
+ _globals->_soundHandler.startSound(250);
setAction(&_action3);
}
}
@@ -1114,9 +1114,9 @@ void Scene7100::postInit(SceneObjectList *OwnerList) {
_object1.setPosition(Common::Point(100, 100), 0);
setAction(&_action11);
- _soundHandler1.startSound(270, 0, 127);
- _soundHandler2.startSound(275, 0, 127);
- _globals->_soundHandler.startSound(270, 0, 127);
+ _soundHandler1.startSound(270);
+ _soundHandler2.startSound(275);
+ _globals->_soundHandler.startSound(270);
}
/*--------------------------------------------------------------------------
* Scene 7200
@@ -1281,7 +1281,7 @@ void Scene7200::postInit(SceneObjectList *OwnerList) {
_swimmer.setPosition(Common::Point(-8, 16), 0);
setAction(&_action1);
- _soundHandler.startSound(271, 0, 127);
+ _soundHandler.startSound(271);
}
/*--------------------------------------------------------------------------
@@ -1476,7 +1476,7 @@ void Scene7300::postInit(SceneObjectList *OwnerList) {
_object8._numFrames = 2;
setAction(&_action1);
- _globals->_soundHandler.startSound(272, 0, 127);
+ _globals->_soundHandler.startSound(272);
}
/*--------------------------------------------------------------------------
@@ -1644,7 +1644,7 @@ void Scene7700::Action3::signal() {
setDelay(60);
// No break on purpose!
case 2:
- scene->_soundHandler.startSound(260, 0, 127);
+ scene->_soundHandler.startSound(260);
scene->_object8.setVisage(7703);
scene->_object8.setPosition(Common::Point(177, 97), 0);
scene->_object8.setStrip2(3);
@@ -1853,7 +1853,7 @@ void Scene7700::SceneHotspot8::doAction(int action) {
break;
case CURSOR_USE:
scene->_sceneMode = 7709;
- scene->_soundHandler.startSound(259, 0, 127);
+ scene->_soundHandler.startSound(259);
scene->_object15.setFrame(scene->_object15.getFrameCount());
scene->_object15.animate(ANIM_MODE_6, scene);
if ((scene->_field977 == 2) && (scene->_field97B == 0)) {
@@ -1879,7 +1879,7 @@ void Scene7700::SceneHotspot9::doAction(int action) {
break;
case CURSOR_USE:
scene->_sceneMode = 7709;
- scene->_soundHandler.startSound(259, 0, 127);
+ scene->_soundHandler.startSound(259);
scene->_object15.setFrame(1);
scene->_object15.animate(ANIM_MODE_5, scene);
if (scene->_field977 > 2) {
@@ -2102,7 +2102,7 @@ void Scene7700::Object9::doAction(int action) {
_globals->_sceneItems.push_front(&scene->_object10);
scene->_object10.setPriority2(240);
}
- scene->_soundHandler.startSound(262, 0, 127);
+ scene->_soundHandler.startSound(262);
scene->_object14.animate(ANIM_MODE_5, 0);
}
_globals->_events.setCursor(CURSOR_WALK);
@@ -2209,7 +2209,7 @@ void Scene7700::signal() {
_globals->_player.enableControl();
break;
case 7704:
- _globals->_soundHandler.startSound(256, 0, 127);
+ _globals->_soundHandler.startSound(256);
_prof.setStrip2(4);
_prof.setFrame2(1);
_prof.setPosition(Common::Point(159, 87), 0);
@@ -2493,7 +2493,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) {
_sceneMode = 7701;
setAction(&_sequenceManager, this, 7701, &_globals->_player, 0);
- _soundHandler.startSound(256, 0, 127);
+ _soundHandler.startSound(256);
}
Scene7700::Scene7700() {
diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h
index 83661b8f15..945d144ae5 100644
--- a/engines/tsage/saveload.h
+++ b/engines/tsage/saveload.h
@@ -51,7 +51,13 @@ struct tSageSavegameHeader {
/*--------------------------------------------------------------------------*/
-#define SYNC_POINTER(x) s.syncPointer((SavedObject **)&x)
+// FIXME: workaround to supress spurious strict-alias warnings on older GCC
+// versions. this should be resolved with the savegame rewrite
+#define SYNC_POINTER(x) do { \
+ SavedObject *y = (SavedObject *)x; \
+ s.syncPointer(&y); \
+} while (false)
+
#define SYNC_ENUM(FIELD, TYPE) int v_##FIELD = (int)FIELD; s.syncAsUint16LE(v_##FIELD); \
if (s.isLoading()) FIELD = (TYPE)v_##FIELD;
diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp
index 1f6442f2ff..9d5d7223cb 100644
--- a/engines/tsage/tsage.cpp
+++ b/engines/tsage/tsage.cpp
@@ -101,14 +101,14 @@ Common::Error TSageEngine::run() {
* Returns true if it is currently okay to restore a game
*/
bool TSageEngine::canLoadGameStateCurrently() {
- return _globals->getFlag(50) == 0;
+ return (_globals->getFlag(50) == 0) && _globals->_player._uiEnabled;
}
/**
* Returns true if it is currently okay to save the game
*/
bool TSageEngine::canSaveGameStateCurrently() {
- return _globals->getFlag(50) == 0;
+ return (_globals->getFlag(50) == 0) && _globals->_player._uiEnabled;
}
/**
diff --git a/gui/credits.h b/gui/credits.h
index 14a26d9557..7ad480032e 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -476,7 +476,7 @@ static const char *credits[] = {
"C0""Raina",
"C2""ScummVM forum buttons",
"C0""William Claydon",
-"C2""Skins for doxygen and wiki",
+"C2""Skins for doxygen, buildbot and wiki",
"",
"C1""Code contributions",
"C0""Ori Avtalion",
@@ -653,7 +653,7 @@ static const char *credits[] = {
"C0""",
"C0""Emilio de Paz Aragon from Alcachofa Soft for sharing the source code of Drascula: The Vampire Strikes Back with us and his generosity with freewaring the game.",
"C0""",
-"C0""David P. Gray from Gray Design Associate for sharing the source code of the Hugo trilogy.",
+"C0""David P. Gray from Gray Design Associates for sharing the source code of the Hugo trilogy.",
"C0""",
"C0""Broken Sword 2.5 team for providing sources of their engine and their great support.",
"C0""",
diff --git a/gui/widgets/edittext.cpp b/gui/widgets/edittext.cpp
index 3ef813283e..159943fcdd 100644
--- a/gui/widgets/edittext.cpp
+++ b/gui/widgets/edittext.cpp
@@ -30,18 +30,20 @@
namespace GUI {
-EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip, uint32 cmd)
+ EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip, uint32 cmd, uint32 finishCmd)
: EditableWidget(boss, x, y - 1, w, h + 2, tooltip, cmd) {
setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE);
_type = kEditTextWidget;
+ _finishCmd = finishCmd;
setEditString(text);
}
-EditTextWidget::EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltip, uint32 cmd)
+EditTextWidget::EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltip, uint32 cmd, uint32 finishCmd)
: EditableWidget(boss, name, tooltip, cmd) {
setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE);
_type = kEditTextWidget;
+ _finishCmd = finishCmd;
setEditString(text);
}
@@ -107,6 +109,8 @@ void EditTextWidget::startEditMode() {
void EditTextWidget::endEditMode() {
releaseFocus();
+
+ sendCommand(_finishCmd, 0);
}
void EditTextWidget::abortEditMode() {
diff --git a/gui/widgets/edittext.h b/gui/widgets/edittext.h
index a2549882ca..b94e58780c 100644
--- a/gui/widgets/edittext.h
+++ b/gui/widgets/edittext.h
@@ -41,8 +41,8 @@ protected:
int _rightPadding;
public:
- EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip = 0, uint32 cmd = 0);
- EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltp = 0, uint32 cmd = 0);
+ EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip = 0, uint32 cmd = 0, uint32 finishCmd = 0);
+ EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltp = 0, uint32 cmd = 0, uint32 finishCmd = 0);
void setEditString(const String &str);
@@ -62,6 +62,8 @@ protected:
void abortEditMode();
Common::Rect getEditRect() const;
+
+ uint32 _finishCmd;
};
} // End of namespace GUI