mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
Add a few more actor debugger subcommands, and correct V2 coordinate translation for
o2_(get/set)ActorElevation svn-id: r8683
This commit is contained in:
parent
2c9a784be8
commit
00d5c5af89
@ -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 {
|
||||
|
@ -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();
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user