[Scummvm-cvs-logs] SF.net SVN: scummvm:[33861] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Thu Aug 14 12:24:39 CEST 2008
Revision: 33861
http://scummvm.svn.sourceforge.net/scummvm/?rev=33861&view=rev
Author: peres001
Date: 2008-08-14 10:24:39 +0000 (Thu, 14 Aug 2008)
Log Message:
-----------
More cleanup.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/exec_br.cpp
scummvm/trunk/engines/parallaction/exec_ns.cpp
scummvm/trunk/engines/parallaction/parallaction.h
Modified: scummvm/trunk/engines/parallaction/exec_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_br.cpp 2008-08-14 10:04:43 UTC (rev 33860)
+++ scummvm/trunk/engines/parallaction/exec_br.cpp 2008-08-14 10:24:39 UTC (rev 33861)
@@ -122,19 +122,13 @@
DECLARE_COMMAND_OPCODE(open) {
warning("Parallaction_br::cmdOp_open command not yet implemented");
- _ctxt.cmd->u._zone->_flags &= ~kFlagsClosed;
- if (_ctxt.cmd->u._zone->u.door->gfxobj) {
- _vm->updateDoor(_ctxt.cmd->u._zone);
- }
+ _vm->updateDoor(_ctxt.cmd->u._zone, false);
}
DECLARE_COMMAND_OPCODE(close) {
warning("Parallaction_br::cmdOp_close not yet implemented");
- _ctxt.cmd->u._zone->_flags |= kFlagsClosed;
- if (_ctxt.cmd->u._zone->u.door->gfxobj) {
- _vm->updateDoor(_ctxt.cmd->u._zone);
- }
+ _vm->updateDoor(_ctxt.cmd->u._zone, true);
}
Modified: scummvm/trunk/engines/parallaction/exec_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_ns.cpp 2008-08-14 10:04:43 UTC (rev 33860)
+++ scummvm/trunk/engines/parallaction/exec_ns.cpp 2008-08-14 10:24:39 UTC (rev 33861)
@@ -246,18 +246,12 @@
DECLARE_COMMAND_OPCODE(open) {
- _ctxt.cmd->u._zone->_flags &= ~kFlagsClosed;
- if (_ctxt.cmd->u._zone->u.door->gfxobj) {
- _vm->updateDoor(_ctxt.cmd->u._zone);
- }
+ _vm->updateDoor(_ctxt.cmd->u._zone, false);
}
DECLARE_COMMAND_OPCODE(close) {
- _ctxt.cmd->u._zone->_flags |= kFlagsClosed;
- if (_ctxt.cmd->u._zone->u.door->gfxobj) {
- _vm->updateDoor(_ctxt.cmd->u._zone);
- }
+ _vm->updateDoor(_ctxt.cmd->u._zone, true);
}
void Parallaction::showZone(ZonePtr z, bool visible) {
@@ -598,7 +592,7 @@
}
-uint16 Parallaction::runZone(ZonePtr z) {
+void Parallaction::runZone(ZonePtr z) {
debugC(3, kDebugExec, "runZone (%s)", z->_name);
uint16 subtype = z->_type & 0xFFFF;
@@ -608,19 +602,15 @@
case kZoneExamine:
enterCommentMode(z);
- return 0;
+ return;
case kZoneGet:
- if (z->_flags & kFlagsFixed) break;
- if (pickupItem(z) != 0) {
- return 1;
- }
+ pickupItem(z);
break;
case kZoneDoor:
if (z->_flags & kFlagsLocked) break;
- z->_flags ^= kFlagsClosed;
- updateDoor(z);
+ updateDoor(z, !(z->_flags & kFlagsClosed));
break;
case kZoneHear:
@@ -629,23 +619,24 @@
case kZoneSpeak:
enterDialogueMode(z);
- return 0;
+ return;
}
debugC(3, kDebugExec, "runZone completed");
_cmdExec->run(z->_commands, z);
- return 0;
+ return;
}
//
// ZONE TYPE: DOOR
//
-void Parallaction::updateDoor(ZonePtr z) {
+void Parallaction::updateDoor(ZonePtr z, bool close) {
+ z->_flags = close ? (z->_flags |= kFlagsClosed) : (z->_flags &= ~kFlagsClosed);
if (z->u.door->gfxobj) {
- uint frame = (z->_flags & kFlagsClosed ? 0 : 1);
+ uint frame = (close ? 0 : 1);
// z->u.door->gfxobj->setFrame(frame);
z->u.door->gfxobj->frame = frame;
}
@@ -659,13 +650,17 @@
// ZONE TYPE: GET
//
-int16 Parallaction::pickupItem(ZonePtr z) {
- int r = addInventoryItem(z->u.get->_icon);
- if (r != -1) {
+bool Parallaction::pickupItem(ZonePtr z) {
+ if (z->_flags & kFlagsFixed) {
+ return false;
+ }
+
+ int slot = addInventoryItem(z->u.get->_icon);
+ if (slot != -1) {
showZone(z, false);
}
- return (r == -1);
+ return (slot != -1);
}
Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h 2008-08-14 10:04:43 UTC (rev 33860)
+++ scummvm/trunk/engines/parallaction/parallaction.h 2008-08-14 10:24:39 UTC (rev 33861)
@@ -263,7 +263,7 @@
ZonePtr findZone(const char *name);
ZonePtr hitZone(uint32 type, uint16 x, uint16 y);
- uint16 runZone(ZonePtr z);
+ void runZone(ZonePtr z);
void freeZones();
AnimationPtr findAnimation(const char *name);
@@ -354,7 +354,7 @@
void freeCharacter();
- int16 pickupItem(ZonePtr z);
+ bool pickupItem(ZonePtr z);
void clearSet(OpcodeSet &opcodes);
@@ -370,7 +370,7 @@
virtual void parseLocation(const char* name) = 0;
- void updateDoor(ZonePtr z);
+ void updateDoor(ZonePtr z, bool close);
virtual void drawAnimations() = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list