diff options
author | Walter van Niftrik | 2016-03-18 00:50:30 +0100 |
---|---|---|
committer | Walter van Niftrik | 2016-06-06 20:35:49 +0200 |
commit | eaacfe1eede00d6370d1abb0afe2f0e6cf622b16 (patch) | |
tree | e9dbfa9b4f5f543c126b31dc2aca362a1f16bd94 /engines/adl/adl.cpp | |
parent | 64cf93198fc560d31cc24003d164f656751d2e76 (diff) | |
download | scummvm-rg350-eaacfe1eede00d6370d1abb0afe2f0e6cf622b16.tar.gz scummvm-rg350-eaacfe1eede00d6370d1abb0afe2f0e6cf622b16.tar.bz2 scummvm-rg350-eaacfe1eede00d6370d1abb0afe2f0e6cf622b16.zip |
ADL: Use template for direction opcode
Diffstat (limited to 'engines/adl/adl.cpp')
-rw-r--r-- | engines/adl/adl.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp index ad5f559fe0..8d501d8980 100644 --- a/engines/adl/adl.cpp +++ b/engines/adl/adl.cpp @@ -330,13 +330,13 @@ void AdlEngine::setupOpcodeTables() { Opcode(o1_setItemPic); // 0x14 Opcode(o1_resetPic); - Opcode(o1_goDirection); - Opcode(o1_goDirection); - Opcode(o1_goDirection); + Opcode(o1_goDirection<IDI_DIR_NORTH>); + Opcode(o1_goDirection<IDI_DIR_SOUTH>); + Opcode(o1_goDirection<IDI_DIR_EAST>); // 0x18 - Opcode(o1_goDirection); - Opcode(o1_goDirection); - Opcode(o1_goDirection); + Opcode(o1_goDirection<IDI_DIR_WEST>); + Opcode(o1_goDirection<IDI_DIR_UP>); + Opcode(o1_goDirection<IDI_DIR_DOWN>); Opcode(o1_takeItem); // 0x1c Opcode(o1_dropItem); @@ -1017,8 +1017,9 @@ bool AdlEngine::o1_resetPic(ScriptEnv &env) { return true; } +template <Direction D> bool AdlEngine::o1_goDirection(ScriptEnv &env) { - byte room = getCurRoom().connections[ARG(0) - IDO_ACT_GO_NORTH]; + byte room = getCurRoom().connections[D]; if (room == 0) { printMessage(_messageIds.cantGoThere); |