aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2013-07-28 16:50:33 -0400
committerPaul Gilbert2013-07-28 16:50:33 -0400
commit2fefa91d952d775158c1b9bae2d6c5821b62d385 (patch)
tree63ea8f15cb6c54e4a0292e2d2eb805baaf2b4265 /engines
parentd969b1b11b7c5d95d933b34f99f14b59f7de4bbb (diff)
downloadscummvm-rg350-2fefa91d952d775158c1b9bae2d6c5821b62d385.tar.gz
scummvm-rg350-2fefa91d952d775158c1b9bae2d6c5821b62d385.tar.bz2
scummvm-rg350-2fefa91d952d775158c1b9bae2d6c5821b62d385.zip
TSAGE: Fixes for R2R text positioning in conversation dialogs
Diffstat (limited to 'engines')
-rw-r--r--engines/tsage/converse.cpp29
-rw-r--r--engines/tsage/converse.h4
-rw-r--r--engines/tsage/dialogs.cpp78
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes0.cpp7
4 files changed, 68 insertions, 50 deletions
diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp
index 76ccb70441..d1cc7fbf71 100644
--- a/engines/tsage/converse.cpp
+++ b/engines/tsage/converse.cpp
@@ -424,17 +424,15 @@ ConversationChoiceDialog::ConversationChoiceDialog() {
int ConversationChoiceDialog::execute(const Common::StringArray &choiceList) {
_gfxManager._font.setFontNumber(_fontNumber);
- _bounds = Rect(20, 0, 20, 0);
+ _bounds = Rect(40, 0, 40, 0);
_choiceList.clear();
// 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(xp, yp + 10);
+ _gfxManager._font.getStringBounds(choiceList[idx].c_str(), tempRect, textMaxWidth());
+ tempRect.moveTo(textLeft(), yp + 10);
_choiceList.push_back(ChoiceEntry(choiceList[idx], tempRect));
yp += tempRect.height() + 5;
@@ -515,11 +513,8 @@ void ConversationChoiceDialog::draw() {
// Fill in the contents of the entire dialog
_gfxManager._bounds = Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
-
- if (g_vm->getGameID() == GType_Ringworld2)
- GfxElement::drawFrame();
- else
- drawFrame();
+
+ drawFrame();
_gfxManager._bounds = tempRect;
_gfxManager._font._colors.foreground = _stdColor;
@@ -530,7 +525,7 @@ void ConversationChoiceDialog::draw() {
Common::String strNum = Common::String::format("%d", idx + 1);
// Write the choice number
- _gfxManager._font.setPosition(13, _choiceList[idx]._bounds.top);
+ _gfxManager._font.setPosition(numberLeft(), _choiceList[idx]._bounds.top);
_gfxManager._font.writeString(strNum.c_str());
_gfxManager._font.writeLines(_choiceList[idx]._msg.c_str(), _choiceList[idx]._bounds, ALIGN_LEFT);
@@ -551,6 +546,18 @@ void ConversationChoiceDialog::remove() {
}
}
+int ConversationChoiceDialog::textLeft() const {
+ return (g_vm->getGameID() == GType_Ringworld2) ? 20 : 25;
+}
+
+int ConversationChoiceDialog::textMaxWidth() const {
+ return (g_vm->getGameID() == GType_Ringworld2) ? 250 : 265;
+}
+
+int ConversationChoiceDialog::numberLeft() const {
+ return (g_vm->getGameID() == GType_Ringworld2) ? 6 : 13;
+}
+
/*--------------------------------------------------------------------------*/
void Obj44::load(const byte *dataP) {
diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h
index 7f30e963ec..aedd7b7659 100644
--- a/engines/tsage/converse.h
+++ b/engines/tsage/converse.h
@@ -145,6 +145,10 @@ public:
};
class ConversationChoiceDialog : public ModalDialog {
+private:
+ int textLeft() const;
+ int textMaxWidth() const;
+ int numberLeft() const;
public:
int _stdColor;
int _highlightColor;
diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp
index 77ac0a25d7..43833f53b9 100644
--- a/engines/tsage/dialogs.cpp
+++ b/engines/tsage/dialogs.cpp
@@ -137,43 +137,47 @@ void ModalDialog::drawFrame() {
Rect origRect = _bounds;
_bounds.collapse(-10, -10);
- // Fill the dialog area
- g_globals->gfxManager().fillRect(origRect, 54);
-
- // Draw top line
- GfxSurface surface = surfaceFromRes(8, 1, 7);
- for (int xp = _bounds.left + 10; xp < (_bounds.right - 20); xp += 10)
- surface.draw(Common::Point(xp, _bounds.top));
- surface.draw(Common::Point(_bounds.right - 20, _bounds.top));
-
- surface = surfaceFromRes(8, 1, 1);
- surface.draw(Common::Point(_bounds.left, _bounds.top));
-
- surface = surfaceFromRes(8, 1, 4);
- surface.draw(Common::Point(_bounds.right - 10, _bounds.top));
-
- // Draw vertical edges
- surface = surfaceFromRes(8, 1, 2);
- for (int yp = _bounds.top + 10; yp < (_bounds.bottom - 20); yp += 10)
- surface.draw(Common::Point(_bounds.left, yp));
- surface.draw(Common::Point(_bounds.left, _bounds.bottom - 20));
-
- surface = surfaceFromRes(8, 1, 5);
- for (int yp = _bounds.top + 10; yp < (_bounds.bottom - 20); yp += 10)
- surface.draw(Common::Point(_bounds.right - 10, yp));
- surface.draw(Common::Point(_bounds.right - 10, _bounds.bottom - 20));
-
- // Draw bottom line
- surface = surfaceFromRes(8, 1, 8);
- for (int xp = _bounds.left + 10; xp < (_bounds.right - 20); xp += 10)
- surface.draw(Common::Point(xp, _bounds.bottom - 10));
- surface.draw(Common::Point(_bounds.right - 20, _bounds.bottom - 10));
-
- surface = surfaceFromRes(8, 1, 3);
- surface.draw(Common::Point(_bounds.left, _bounds.bottom - 10));
-
- surface = surfaceFromRes(8, 1, 6);
- surface.draw(Common::Point(_bounds.right - 10, _bounds.bottom - 10));
+ if (g_vm->getGameID() == GType_Ringworld2) {
+ GfxElement::drawFrame();
+ } else {
+ // Fill the dialog area
+ g_globals->gfxManager().fillRect(origRect, 54);
+
+ // Draw top line
+ GfxSurface surface = surfaceFromRes(8, 1, 7);
+ for (int xp = _bounds.left + 10; xp < (_bounds.right - 20); xp += 10)
+ surface.draw(Common::Point(xp, _bounds.top));
+ surface.draw(Common::Point(_bounds.right - 20, _bounds.top));
+
+ surface = surfaceFromRes(8, 1, 1);
+ surface.draw(Common::Point(_bounds.left, _bounds.top));
+
+ surface = surfaceFromRes(8, 1, 4);
+ surface.draw(Common::Point(_bounds.right - 10, _bounds.top));
+
+ // Draw vertical edges
+ surface = surfaceFromRes(8, 1, 2);
+ for (int yp = _bounds.top + 10; yp < (_bounds.bottom - 20); yp += 10)
+ surface.draw(Common::Point(_bounds.left, yp));
+ surface.draw(Common::Point(_bounds.left, _bounds.bottom - 20));
+
+ surface = surfaceFromRes(8, 1, 5);
+ for (int yp = _bounds.top + 10; yp < (_bounds.bottom - 20); yp += 10)
+ surface.draw(Common::Point(_bounds.right - 10, yp));
+ surface.draw(Common::Point(_bounds.right - 10, _bounds.bottom - 20));
+
+ // Draw bottom line
+ surface = surfaceFromRes(8, 1, 8);
+ for (int xp = _bounds.left + 10; xp < (_bounds.right - 20); xp += 10)
+ surface.draw(Common::Point(xp, _bounds.bottom - 10));
+ surface.draw(Common::Point(_bounds.right - 20, _bounds.bottom - 10));
+
+ surface = surfaceFromRes(8, 1, 3);
+ surface.draw(Common::Point(_bounds.left, _bounds.bottom - 10));
+
+ surface = surfaceFromRes(8, 1, 6);
+ surface.draw(Common::Point(_bounds.right - 10, _bounds.bottom - 10));
+ }
// Set the dialog's manager bounds
_gfxManager._bounds = origRect;
diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
index 840172335f..fd3b01c13a 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
@@ -3173,6 +3173,9 @@ bool Scene300::Doorway::startAction(CursorType action, Event &event) {
Scene300::Scene300(): SceneExt() {
_stripId = 0;
_rotation = NULL;
+
+ _stripManager.setColors(60, 255);
+ _stripManager.setFontNumber(3);
}
void Scene300::synchronize(Serializer &s) {
@@ -3194,8 +3197,6 @@ void Scene300::postInit(SceneObjectList *OwnerList) {
R2_GLOBALS._player._characterIndex = R2_QUINN;
}
- _stripManager.setColors(60, 255);
- _stripManager.setFontNumber(3);
_stripManager.addSpeaker(&_mirandaSpeaker);
_stripManager.addSpeaker(&_seekerSpeaker);
_stripManager.addSpeaker(&_quinnSpeaker);
@@ -3627,6 +3628,8 @@ void Scene300::signal() {
case 309:
signal309();
R2_GLOBALS._events.setCursor(CURSOR_ARROW);
+ R2_GLOBALS._events._currentCursor = CURSOR_ARROW;
+
_sceneMode = 10;
_stripManager.start3(_stripId, this, R2_GLOBALS._stripManager_lookupList);
break;