diff options
author | James Brown | 2003-07-01 04:20:41 +0000 |
---|---|---|
committer | James Brown | 2003-07-01 04:20:41 +0000 |
commit | 00d5c5af89da9f1aa7fcec723756dc95ecbec63a (patch) | |
tree | 2bb557bb1bbad9c628398f1fa23bc7823e1b3edc /scumm | |
parent | 2c9a784be8fa44fdf250cf2abb541ea54436e91f (diff) | |
download | scummvm-rg350-00d5c5af89da9f1aa7fcec723756dc95ecbec63a.tar.gz scummvm-rg350-00d5c5af89da9f1aa7fcec723756dc95ecbec63a.tar.bz2 scummvm-rg350-00d5c5af89da9f1aa7fcec723756dc95ecbec63a.zip |
Add a few more actor debugger subcommands, and correct V2 coordinate translation for
o2_(get/set)ActorElevation
svn-id: r8683
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/debugger.cpp | 17 | ||||
-rw-r--r-- | scumm/intern.h | 1 | ||||
-rw-r--r-- | scumm/script_v2.cpp | 13 |
3 files changed, 26 insertions, 5 deletions
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp index 3d4b4da8d2..dd8415d866 100644 --- a/scumm/debugger.cpp +++ b/scumm/debugger.cpp @@ -546,16 +546,29 @@ bool ScummDebugger::Cmd_Actor(int argc, const char **argv) { } a = &_s->_actors[actnum]; + value = atoi(argv[3]); if (!strcmp(argv[2], "ignoreboxes")) { - a->ignoreBoxes = (atoi(argv[3]) > 0); + a->ignoreBoxes = (value > 0); Debug_Printf("Actor[%d].ignoreBoxes = %d\n", actnum, a->ignoreBoxes); + } else if (!strcmp(argv[2], "x")) { + a->putActor(value, a->y, a->room); + Debug_Printf("Actor[%d].x = %d\n", actnum, a->x); + _s->_fullRedraw = 1; + } else if (!strcmp(argv[2], "y")) { + a->putActor(a->x, value, a->room); + Debug_Printf("Actor[%d].y = %d\n", actnum, a->y); + _s->_fullRedraw = 1; + } else if (!strcmp(argv[2], "elevation")) { + a->elevation = value; + Debug_Printf("Actor[%d].elevation = %d\n", actnum, a->elevation); + _s->_fullRedraw = 1; } else if (!strcmp(argv[2], "costume")) { - value = atoi(argv[3]); if (value >= _s->res.num[rtCostume]) Debug_Printf("Costume not changed as %d exceeds max of %d\n", value, _s->res.num[rtCostume]); else { a->setActorCostume( value ); + _s->_fullRedraw = 1; Debug_Printf("Actor[%d].costume = %d\n", actnum, a->costume); } } else { diff --git a/scumm/intern.h b/scumm/intern.h index 55216fb80b..cc0a830ea4 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -263,6 +263,7 @@ protected: void o2_restart(); void o2_roomOps(); void o2_saveLoadGame(); + void o2_getActorElevation(); void o2_setActorElevation(); void o2_setBitVar(); void o2_setCameraAt(); diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index ca3fd53e9a..956c1687c3 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -40,7 +40,7 @@ void Scumm_v2::setupOpcodes() { /* 04 */ OPCODE(o5_isGreaterEqual), OPCODE(o2_drawObject), - OPCODE(o5_getActorElevation), + OPCODE(o2_getActorElevation), OPCODE(o2_setState08), /* 08 */ OPCODE(o5_isNotEqual), @@ -200,7 +200,7 @@ void Scumm_v2::setupOpcodes() { /* 84 */ OPCODE(o5_isGreaterEqual), OPCODE(o2_drawObject), - OPCODE(o5_getActorElevation), + OPCODE(o2_getActorElevation), OPCODE(o2_setState08), /* 88 */ OPCODE(o5_isNotEqual), @@ -1060,12 +1060,19 @@ void Scumm_v2::o2_putActorAtObject() { a->putActor(x, y, a->room); } +void Scumm_v2::o2_getActorElevation() { + getResultPos(); + int act = getVarOrDirectByte(0x80); + Actor *a = derefActor(act, "o2_getActorElevation"); + setResult(a->elevation / 2); +} + void Scumm_v2::o2_setActorElevation() { int act = getVarOrDirectByte(0x80); int elevation = getVarOrDirectByte(0x40); Actor *a = derefActor(act, "o2_setActorElevation"); - a->elevation = elevation; + a->elevation = elevation * 2; } void Scumm_v2::o2_animateActor() { |