aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2013-07-28 10:35:56 -0400
committerPaul Gilbert2013-07-28 10:35:56 -0400
commit8320a556d4f2d90aede5a8a8a4ae13bd213927dd (patch)
tree4375046b958c8c2d14dbc4870f3c7290fac75778 /engines
parent28b85375306e08a04360dacf070c496dc5d1dbd2 (diff)
downloadscummvm-rg350-8320a556d4f2d90aede5a8a8a4ae13bd213927dd.tar.gz
scummvm-rg350-8320a556d4f2d90aede5a8a8a4ae13bd213927dd.tar.bz2
scummvm-rg350-8320a556d4f2d90aede5a8a8a4ae13bd213927dd.zip
TSAGE: Added R2R conversation dialog text and removal code
Diffstat (limited to 'engines')
-rw-r--r--engines/tsage/converse.cpp41
-rw-r--r--engines/tsage/converse.h1
2 files changed, 36 insertions, 6 deletions
diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp
index 8fc25f9a6d..76ccb70441 100644
--- a/engines/tsage/converse.cpp
+++ b/engines/tsage/converse.cpp
@@ -429,10 +429,12 @@ int ConversationChoiceDialog::execute(const Common::StringArray &choiceList) {
// Set up the list of choices
int yp = 0;
+ int xp = (g_vm->getGameID() == GType_Ringworld2) ? 40 : 25;
+
for (uint idx = 0; idx < choiceList.size(); ++idx) {
Rect tempRect;
_gfxManager._font.getStringBounds(choiceList[idx].c_str(), tempRect, 265);
- tempRect.moveTo(25, yp + 10);
+ tempRect.moveTo(xp, yp + 10);
_choiceList.push_back(ChoiceEntry(choiceList[idx], tempRect));
yp += tempRect.height() + 5;
@@ -537,6 +539,18 @@ void ConversationChoiceDialog::draw() {
_gfxManager.deactivate();
}
+void ConversationChoiceDialog::remove() {
+ if (_savedArea) {
+ // Restore the area the dialog covered
+ Rect tempRect = _bounds;
+ tempRect.collapse(-10, -10);
+ g_globals->_gfxManagerInstance.copyFrom(*_savedArea, tempRect.left, tempRect.top);
+
+ delete _savedArea;
+ _savedArea = NULL;
+ }
+}
+
/*--------------------------------------------------------------------------*/
void Obj44::load(const byte *dataP) {
@@ -891,13 +905,26 @@ void StripManager::signal() {
if (g_vm->getGameID() == GType_Ringworld2) {
Ringworld2::VisualSpeaker *speaker = static_cast<Ringworld2::VisualSpeaker *>(_activeSpeaker);
- speaker->_speakerMode = obj44._speakerMode;
- if (_obj44List.size() > 0)
+
+ if (speaker) {
+ speaker->_speakerMode = obj44._speakerMode;
+ if (choiceList[strIndex].empty())
+ speaker->proc15();
+ }
+
+ if (!choiceList[strIndex].empty()) {
+ _textShown = true;
+ _activeSpeaker->setText(choiceList[strIndex]);
+ } else if (!obj44._speakerMode) {
+ _delayFrames = 1;
+ } else {
+ _delayFrames = 0;
speaker->proc15();
+ }
+ } else {
+ _textShown = true;
+ _activeSpeaker->setText(choiceList[strIndex]);
}
-
- _textShown = true;
- _activeSpeaker->setText(choiceList[strIndex]);
}
_obj44Index = getNewIndex(obj44._list[strIndex]._id);
@@ -965,6 +992,8 @@ Speaker *StripManager::getSpeaker(const char *speakerName) {
int StripManager::getNewIndex(int id) {
if (id == 10000)
return id;
+ if ((g_vm->getGameID() == GType_Ringworld2) && (id < 0))
+ return id;
for (uint idx = 0; idx < _obj44List.size(); ++idx) {
if (_obj44List[idx]._id == id) {
diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h
index 66e9982762..7f30e963ec 100644
--- a/engines/tsage/converse.h
+++ b/engines/tsage/converse.h
@@ -164,6 +164,7 @@ public:
int execute(const Common::StringArray &choiceList);
virtual void draw();
+ virtual void remove();
};
class Obj0A : public Serialisable {