diff options
Diffstat (limited to 'engines/teenagent')
-rw-r--r-- | engines/teenagent/callbacks.cpp | 24 | ||||
-rw-r--r-- | engines/teenagent/console.cpp | 64 | ||||
-rw-r--r-- | engines/teenagent/console.h | 3 | ||||
-rw-r--r-- | engines/teenagent/detection.cpp | 2 | ||||
-rw-r--r-- | engines/teenagent/music.cpp | 1 | ||||
-rw-r--r-- | engines/teenagent/music.h | 2 | ||||
-rw-r--r-- | engines/teenagent/surface.h | 1 |
7 files changed, 80 insertions, 17 deletions
diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp index f8bb142bd8..8882531d27 100644 --- a/engines/teenagent/callbacks.cpp +++ b/engines/teenagent/callbacks.cpp @@ -3110,7 +3110,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) { playSound(67, 4); playActorAnimation(680); SET_FLAG(0xDBB8, 0); - } else if (CHECK_FLAG(0xDBB8, 1)) { + } else if (CHECK_FLAG(0xDBB7, 1)) { processCallback(0x6b86); } else if (CHECK_FLAG(0xDBB9, 1)) { processCallback(0x6b86); @@ -3177,7 +3177,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) { playSound(67, 5); playActorAnimation(688); SET_FLAG(0xdbbc, 0); - } else if (CHECK_FLAG(0xdbbc, 1)) { + } else if (CHECK_FLAG(0xdbbb, 1)) { processCallback(0x6b86); } else { playSound(66, 6); @@ -3221,7 +3221,8 @@ bool TeenAgentEngine::processCallback(uint16 addr) { return true; case 0x6c83: - Dialog::pop(scene, 0xdb2e, 0, 0, 0xd1, 0xef, 0, 1); + waitLanAnimationFrame(1, 1); + Dialog::pop(scene, 0xdb2e, 0, 727, 0xd1, 0xef, 0, 1); scene->getObject(1)->setName((const char *)res->dseg.ptr(0xaa94)); SET_FLAG(0xDBD1, 1); return true; @@ -3557,8 +3558,9 @@ bool TeenAgentEngine::processCallback(uint16 addr) { playSound(5, 39); displayAsyncMessage(0x5124, 40388, 9, 35, 0xd0); playActorAnimation(728); - //fixme: add 727 animation - Dialog::show(scene, 0x3d17, 0, 0, 0xd1, 0xef, 0, 1); + + waitLanAnimationFrame(1, 1); + Dialog::show(scene, 0x3d17, 0, 727, 0xd1, 0xef, 0, 1); SET_FLAG(0xDBD2, 1); processCallback(0x9175); return true; @@ -3572,13 +3574,14 @@ bool TeenAgentEngine::processCallback(uint16 addr) { return true; } displayMessage(0x5138); - waitLanAnimationFrame(1, 1); + waitLanAnimationFrame(1, 1); playSound(5, 3); playSound(5, 23); playActorAnimation(729); - //fixme: add 727 animation - Dialog::show(scene, 0x3d70, 0, 0, 0xd1, 0xef, 0, 1); + + waitLanAnimationFrame(1, 1); + Dialog::show(scene, 0x3d70, 0, 727, 0xd1, 0xef, 0, 1); SET_FLAG(0xDBD3, 1); processCallback(0x9175); return true; @@ -3597,8 +3600,9 @@ bool TeenAgentEngine::processCallback(uint16 addr) { playSound(5, 3); playSound(5, 25); playActorAnimation(730); - //fixme: add 727 animation - Dialog::show(scene, 0x3dd6, 0, 0, 0xd1, 0xef, 0, 1); + + waitLanAnimationFrame(1, 1); + Dialog::show(scene, 0x3dd6, 0, 727, 0xd1, 0xef, 0, 1); SET_FLAG(0xDBD4, 1); processCallback(0x9175); return true; diff --git a/engines/teenagent/console.cpp b/engines/teenagent/console.cpp index 5164b44729..9ab6001d54 100644 --- a/engines/teenagent/console.cpp +++ b/engines/teenagent/console.cpp @@ -25,10 +25,13 @@ namespace TeenAgent { Console::Console(TeenAgentEngine *engine) : _engine(engine) { - DCmd_Register("enable_object", WRAP_METHOD(Console, enableObject)); - DCmd_Register("disable_object", WRAP_METHOD(Console, enableObject)); - DCmd_Register("set_ons", WRAP_METHOD(Console, setOns)); - DCmd_Register("set_music", WRAP_METHOD(Console, setMusic)); + DCmd_Register("enable_object", WRAP_METHOD(Console, enableObject)); + DCmd_Register("disable_object", WRAP_METHOD(Console, enableObject)); + DCmd_Register("set_ons", WRAP_METHOD(Console, setOns)); + DCmd_Register("set_music", WRAP_METHOD(Console, setMusic)); + DCmd_Register("animation", WRAP_METHOD(Console, playAnimation)); + DCmd_Register("actor_animation", WRAP_METHOD(Console, playActorAnimation)); + DCmd_Register("call", WRAP_METHOD(Console, call)); } bool Console::enableObject(int argc, const char **argv) { @@ -97,13 +100,66 @@ bool Console::setMusic(int argc, const char **argv) { DebugPrintf("usage: %s index(1-11)\n", argv[0]); return true; } + int index = atoi(argv[1]); if (index <= 0 || index > 11) { DebugPrintf("invalid value\n"); return true; } + _engine->setMusic(index); return true; } +bool Console::playAnimation(int argc, const char **argv) { + if (argc < 3) { + DebugPrintf("usage: %s id slot(0-3)\n", argv[0]); + return true; + } + + int id = atoi(argv[1]); + int slot = atoi(argv[2]); + if (id < 0 || slot < 0 || slot > 3) { + DebugPrintf("invalid slot or animation id\n"); + return true; + } + + _engine->playAnimation(id, slot); + return true; +} + +bool Console::playActorAnimation(int argc, const char **argv) { + if (argc < 2) { + DebugPrintf("usage: %s id\n", argv[0]); + return true; + } + + int id = atoi(argv[1]); + if (id < 0) { + DebugPrintf("invalid animation id\n"); + return true; + } + + _engine->playActorAnimation(id); + return true; +} + +bool Console::call(int argc, const char **argv) { + if (argc < 2) { + DebugPrintf("usage: %s 0xHEXADDR\n", argv[0]); + return true; + } + + uint addr; + if (sscanf(argv[1], "0x%x", &addr) != 1) { + DebugPrintf("invalid address\n"); + return true; + } + + if (!_engine->processCallback(addr)) + DebugPrintf("calling callback %04x failed\n", addr); + + return true; +} + } diff --git a/engines/teenagent/console.h b/engines/teenagent/console.h index ab2f068520..4dbdd3fc07 100644 --- a/engines/teenagent/console.h +++ b/engines/teenagent/console.h @@ -36,6 +36,9 @@ private: bool enableObject(int argc, const char **argv); bool setOns(int argc, const char **argv); bool setMusic(int argc, const char **argv); + bool playAnimation(int argc, const char **argv); + bool playActorAnimation(int argc, const char **argv); + bool call(int argc, const char **argv); TeenAgentEngine *_engine; }; diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp index cf58df1344..dad876dd97 100644 --- a/engines/teenagent/detection.cpp +++ b/engines/teenagent/detection.cpp @@ -74,7 +74,7 @@ static const ADGameDescription teenAgentGameDescriptions[] = { Common::CZ_CZE, Common::kPlatformPC, ADGF_CD, - GUIO1(GUIO_NONE) + GUIO0() }, AD_TABLE_END_MARKER, }; diff --git a/engines/teenagent/music.cpp b/engines/teenagent/music.cpp index 6cc2fd8d6b..1f44e9cfcb 100644 --- a/engines/teenagent/music.cpp +++ b/engines/teenagent/music.cpp @@ -51,6 +51,7 @@ bool MusicPlayer::load(int id) { stream->read(header, 4); //check header? + Common::StackLock lock(_mutex); // Load the samples sampleCount = stream->readByte(); diff --git a/engines/teenagent/music.h b/engines/teenagent/music.h index bf36ac7057..22b4fa5e8e 100644 --- a/engines/teenagent/music.h +++ b/engines/teenagent/music.h @@ -40,7 +40,7 @@ public: void start(); void stop(); -protected: +private: int _id; struct Row { diff --git a/engines/teenagent/surface.h b/engines/teenagent/surface.h index 1771b2d683..51368c6bee 100644 --- a/engines/teenagent/surface.h +++ b/engines/teenagent/surface.h @@ -31,7 +31,6 @@ class SeekableReadStream; namespace TeenAgent { -class Pack; class Surface : public Graphics::Surface { public: enum Type {kTypeOns, kTypeLan}; |