diff options
author | Vladimir Menshakov | 2009-10-18 10:46:42 +0000 |
---|---|---|
committer | Vladimir Menshakov | 2009-10-18 10:46:42 +0000 |
commit | 3a8a872a8f96232fd8cb23e6e7801ebe540fa02d (patch) | |
tree | 5e681996ca9584301aeccfa0a8ccd969121f7d84 /engines/teenagent | |
parent | a10929594d951ec31d8f4e4ec0e17178ca0d8a58 (diff) | |
download | scummvm-rg350-3a8a872a8f96232fd8cb23e6e7801ebe540fa02d.tar.gz scummvm-rg350-3a8a872a8f96232fd8cb23e6e7801ebe540fa02d.tar.bz2 scummvm-rg350-3a8a872a8f96232fd8cb23e6e7801ebe540fa02d.zip |
fixed long standing bug with empty messages being processed
svn-id: r45216
Diffstat (limited to 'engines/teenagent')
-rw-r--r-- | engines/teenagent/callbacks.cpp | 5 | ||||
-rw-r--r-- | engines/teenagent/dialog.cpp | 10 | ||||
-rw-r--r-- | engines/teenagent/scene.cpp | 3 |
3 files changed, 10 insertions, 8 deletions
diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp index d21e5b4eee..87d75da3cc 100644 --- a/engines/teenagent/callbacks.cpp +++ b/engines/teenagent/callbacks.cpp @@ -618,10 +618,9 @@ bool TeenAgentEngine::processCallback(uint16 addr) { if (CHECK_FLAG(0xdbda, 1)) { //papers are shown loadScene(5, 124, 199); } else { - playAnimation(809, 1, true); - Dialog::show(scene, 0x5FE9); + Dialog::show(scene, 0x5FE9, 0, 809, 0xd1, 0xd0, 0, 1); moveTo(269, 175, 4); - Dialog::pop(scene, 0xDB56); + Dialog::pop(scene, 0xDB56, 0, 809, 0xd1, 0xd0, 0, 1); } return true; diff --git a/engines/teenagent/dialog.cpp b/engines/teenagent/dialog.cpp index a968d0e298..8adbde4ba9 100644 --- a/engines/teenagent/dialog.cpp +++ b/engines/teenagent/dialog.cpp @@ -61,13 +61,12 @@ void Dialog::show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation switch (n) { case 1: //debug(0, "new line\n"); - message += '\n'; + if (!message.empty()) + message += '\n'; break; case 2: - //debug(0, "displaymessage\n"); - + //debug(0, "displaymessage %s", message.c_str()); if (color == color2) { - //pause animation in other slot if (animation1 != 0) { SceneEvent e(SceneEvent::kPauseAnimation); @@ -96,6 +95,9 @@ void Dialog::show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation } { + message.trim(); + if (message.empty()) + break; SceneEvent e(SceneEvent::kMessage); e.message = message; e.color = color; diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index d5ba251f47..1b92176929 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -655,7 +655,8 @@ Common::Point Scene::messagePosition(const Common::String &str, Common::Point po } void Scene::displayMessage(const Common::String &str, byte color) { - debug(0, "displayMessage: %s", str.c_str()); + //assert(!str.empty()); + //debug(0, "displayMessage: %s", str.c_str()); message = str; message_pos = messagePosition(str, position); message_color = color; |