[Scummvm-cvs-logs] SF.net SVN: scummvm:[33860] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Thu Aug 14 12:04:44 CEST 2008


Revision: 33860
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33860&view=rev
Author:   peres001
Date:     2008-08-14 10:04:43 +0000 (Thu, 14 Aug 2008)

Log Message:
-----------
Cleanup.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/exec.h
    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.h
===================================================================
--- scummvm/trunk/engines/parallaction/exec.h	2008-08-14 07:14:34 UTC (rev 33859)
+++ scummvm/trunk/engines/parallaction/exec.h	2008-08-14 10:04:43 UTC (rev 33860)
@@ -84,8 +84,6 @@
 	Parallaction_ns	*_vm;
 
 protected:
-	void updateGetZone(ZonePtr z, bool visible);
-
 	DECLARE_UNQUALIFIED_COMMAND_OPCODE(invalid);
 	DECLARE_UNQUALIFIED_COMMAND_OPCODE(set);
 	DECLARE_UNQUALIFIED_COMMAND_OPCODE(clear);

Modified: scummvm/trunk/engines/parallaction/exec_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_br.cpp	2008-08-14 07:14:34 UTC (rev 33859)
+++ scummvm/trunk/engines/parallaction/exec_br.cpp	2008-08-14 10:04:43 UTC (rev 33860)
@@ -139,31 +139,12 @@
 
 
 DECLARE_COMMAND_OPCODE(on) {
-	CommandData *data = &_ctxt.cmd->u;
-	ZonePtr z = data->_zone;
-
-	if (z) {
-		z->_flags |= kFlagsActive;
-		z->_flags &= ~kFlagsRemove;
-
-		if ((z->_type & 0xFFFF) & kZoneGet) {
-			_vm->_gfx->showGfxObj(z->u.get->gfxobj, true);
-		}
-	}
+	_vm->showZone(_ctxt.cmd->u._zone, true);
 }
 
 
 DECLARE_COMMAND_OPCODE(off) {
-	CommandData *data = &_ctxt.cmd->u;
-	ZonePtr z = data->_zone;
-
-	if (z) {
-		z->_flags |= kFlagsRemove;
-
-		if ((z->_type & 0xFFFF) & kZoneGet) {
-			_vm->_gfx->showGfxObj(z->u.get->gfxobj, false);
-		}
-	}
+	_vm->showZone(_ctxt.cmd->u._zone, false);
 }
 
 
@@ -335,31 +316,12 @@
 
 
 DECLARE_INSTRUCTION_OPCODE(on) {
-	InstructionPtr inst = *_ctxt.inst;
-	ZonePtr z = inst->_z;
-
-	if (z) {
-		z->_flags |= kFlagsActive;
-		z->_flags &= ~kFlagsRemove;
-
-		if ((z->_type & 0xFFFF) & kZoneGet) {
-			_vm->_gfx->showGfxObj(z->u.get->gfxobj, true);
-		}
-	}
+	_vm->showZone((*_ctxt.inst)->_z, true);
 }
 
 
 DECLARE_INSTRUCTION_OPCODE(off) {
-	InstructionPtr inst = *_ctxt.inst;
-	ZonePtr z = inst->_z;
-
-	if (z) {
-		z->_flags |= kFlagsRemove;
-
-		if ((z->_type & 0xFFFF) & kZoneGet) {
-			_vm->_gfx->showGfxObj(z->u.get->gfxobj, false);
-		}
-	}
+	_vm->showZone((*_ctxt.inst)->_z, false);
 }
 
 

Modified: scummvm/trunk/engines/parallaction/exec_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_ns.cpp	2008-08-14 07:14:34 UTC (rev 33859)
+++ scummvm/trunk/engines/parallaction/exec_ns.cpp	2008-08-14 10:04:43 UTC (rev 33860)
@@ -260,34 +260,31 @@
 	}
 }
 
-void CommandExec_ns::updateGetZone(ZonePtr z, bool visible) {
+void Parallaction::showZone(ZonePtr z, bool visible) {
 	if (!z) {
 		return;
 	}
 
+	if (visible) {
+		z->_flags &= ~kFlagsRemove;
+		z->_flags |= kFlagsActive;
+	} else {
+		z->_flags |= kFlagsRemove;
+	}
+
 	if ((z->_type & 0xFFFF) == kZoneGet) {
-		_vm->_gfx->showGfxObj(z->u.get->gfxobj, visible);
+		_gfx->showGfxObj(z->u.get->gfxobj, visible);
 	}
+
 }
 
 DECLARE_COMMAND_OPCODE(on) {
-	ZonePtr z = _ctxt.cmd->u._zone;
-
-	if (z) {
-		z->_flags &= ~kFlagsRemove;
-		z->_flags |= kFlagsActive;
-		updateGetZone(z, true);
-	}
+	_vm->showZone(_ctxt.cmd->u._zone, true);
 }
 
 
 DECLARE_COMMAND_OPCODE(off) {
-	ZonePtr z = _ctxt.cmd->u._zone;
-
-	if (z) {
-		_ctxt.cmd->u._zone->_flags |= kFlagsRemove;
-		updateGetZone(z, false);
-	}
+	_vm->showZone(_ctxt.cmd->u._zone, false);
 }
 
 
@@ -618,7 +615,6 @@
 		if (pickupItem(z) != 0) {
 			return 1;
 		}
-		z->_flags |= kFlagsRemove;
 		break;
 
 	case kZoneDoor:
@@ -666,7 +662,7 @@
 int16 Parallaction::pickupItem(ZonePtr z) {
 	int r = addInventoryItem(z->u.get->_icon);
 	if (r != -1) {
-		_gfx->showGfxObj(z->u.get->gfxobj, false);
+		showZone(z, false);
 	}
 
 	return (r == -1);

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2008-08-14 07:14:34 UTC (rev 33859)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2008-08-14 10:04:43 UTC (rev 33860)
@@ -424,6 +424,8 @@
 
 	void setInternLanguage(uint id);
 	uint getInternLanguage();
+
+	void showZone(ZonePtr z, bool visible);
 };
 
 


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