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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Thu Feb 26 11:44:01 CET 2009


Revision: 38897
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38897&view=rev
Author:   peres001
Date:     2009-02-26 10:44:01 +0000 (Thu, 26 Feb 2009)

Log Message:
-----------
Removed null*Ptr dummy objects, using SharedPtr's reset method to null pointers instead.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/dialogue.cpp
    scummvm/trunk/engines/parallaction/exec.cpp
    scummvm/trunk/engines/parallaction/exec.h
    scummvm/trunk/engines/parallaction/input.cpp
    scummvm/trunk/engines/parallaction/objects.cpp
    scummvm/trunk/engines/parallaction/objects.h
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction_br.cpp
    scummvm/trunk/engines/parallaction/parallaction_ns.cpp
    scummvm/trunk/engines/parallaction/parser_br.cpp
    scummvm/trunk/engines/parallaction/parser_ns.cpp
    scummvm/trunk/engines/parallaction/walk.cpp

Modified: scummvm/trunk/engines/parallaction/dialogue.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/dialogue.cpp	2009-02-26 10:31:48 UTC (rev 38896)
+++ scummvm/trunk/engines/parallaction/dialogue.cpp	2009-02-26 10:44:01 UTC (rev 38897)
@@ -194,7 +194,7 @@
 	if (isNpc) {
 		delete _questioner;
 	}
-	_z = nullZonePtr;
+	_z.reset();
 }
 
 

Modified: scummvm/trunk/engines/parallaction/exec.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec.cpp	2009-02-26 10:31:48 UTC (rev 38896)
+++ scummvm/trunk/engines/parallaction/exec.cpp	2009-02-26 10:44:01 UTC (rev 38897)
@@ -164,7 +164,7 @@
 
 	_suspendedCtxt._valid = false;
 	_suspendedCtxt._first = _suspendedCtxt._last;
-	_suspendedCtxt._zone = nullZonePtr;
+	_suspendedCtxt._zone.reset();
 }
 
 void CommandExec::suspend() {

Modified: scummvm/trunk/engines/parallaction/exec.h
===================================================================
--- scummvm/trunk/engines/parallaction/exec.h	2009-02-26 10:31:48 UTC (rev 38896)
+++ scummvm/trunk/engines/parallaction/exec.h	2009-02-26 10:44:01 UTC (rev 38897)
@@ -109,7 +109,7 @@
 public:
 	CommandExec(Parallaction *vm);
 
-	void run(CommandList &list, ZonePtr z = nullZonePtr);
+	void run(CommandList &list, ZonePtr z = ZonePtr());
 	void runSuspended();
 	void suspend();
 };

Modified: scummvm/trunk/engines/parallaction/input.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/input.cpp	2009-02-26 10:31:48 UTC (rev 38896)
+++ scummvm/trunk/engines/parallaction/input.cpp	2009-02-26 10:44:01 UTC (rev 38897)
@@ -69,7 +69,7 @@
 	_activeItem._index = 0;
 	_activeItem._id = 0;
 	_mouseButtons = 0;
-	_delayedActionZone = nullZonePtr;
+	_delayedActionZone.reset();
 
 	initCursors();
 }
@@ -256,7 +256,7 @@
 }
 
 void Input::stopHovering() {
-	_hoverZone = nullZonePtr;
+	_hoverZone.reset();
 	_vm->_gfx->hideFloatingLabel();
 }
 
@@ -283,7 +283,7 @@
 		// if walking is over, then take programmed action
 		takeAction(_delayedActionZone);
 		_hasDelayedAction = false;
-		_delayedActionZone = nullZonePtr;
+		_delayedActionZone.reset();
 		return true;
 	}
 

Modified: scummvm/trunk/engines/parallaction/objects.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/objects.cpp	2009-02-26 10:31:48 UTC (rev 38896)
+++ scummvm/trunk/engines/parallaction/objects.cpp	2009-02-26 10:44:01 UTC (rev 38897)
@@ -30,10 +30,6 @@
 namespace Parallaction {
 
 
-ZonePtr nullZonePtr;
-AnimationPtr nullAnimationPtr;
-InstructionPtr nullInstructionPtr;
-
 Command::Command() {
 	_id = 0;
 	_flagsOn = 0;

Modified: scummvm/trunk/engines/parallaction/objects.h
===================================================================
--- scummvm/trunk/engines/parallaction/objects.h	2009-02-26 10:31:48 UTC (rev 38896)
+++ scummvm/trunk/engines/parallaction/objects.h	2009-02-26 10:44:01 UTC (rev 38897)
@@ -44,15 +44,12 @@
 
 typedef Common::SharedPtr<Zone> ZonePtr;
 typedef Common::List<ZonePtr> ZoneList;
-extern ZonePtr nullZonePtr;
 
 typedef Common::SharedPtr<Animation> AnimationPtr;
 typedef Common::List<AnimationPtr> AnimationList;
-extern AnimationPtr nullAnimationPtr;
 
 typedef Common::SharedPtr<Instruction> InstructionPtr;
 typedef Common::List<InstructionPtr> InstructionList;
-extern InstructionPtr nullInstructionPtr;
 
 typedef Common::List<Common::Point> PointList;
 

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2009-02-26 10:31:48 UTC (rev 38896)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2009-02-26 10:44:01 UTC (rev 38897)
@@ -210,7 +210,7 @@
 	for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); ++it)
 		if (!scumm_stricmp((*it)->_name, name)) return *it;
 
-	return nullAnimationPtr;
+	return AnimationPtr();
 }
 
 void Location::freeAnimations() {
@@ -589,7 +589,7 @@
 	_gfx->setHalfbriteMode(false);
 
 	_cmdExec->run(_commentZone->_commands, _commentZone);
-	_commentZone = nullZonePtr;
+	_commentZone.reset();
 }
 
 void Parallaction::runCommentFrame() {
@@ -792,7 +792,7 @@
 		}
 	}
 
-	return nullZonePtr;
+	return ZonePtr();
 }
 
 

Modified: scummvm/trunk/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_br.cpp	2009-02-26 10:31:48 UTC (rev 38896)
+++ scummvm/trunk/engines/parallaction/parallaction_br.cpp	2009-02-26 10:44:01 UTC (rev 38897)
@@ -164,7 +164,7 @@
 
 	if (_activeZone) {
 		z = _activeZone;	// speak Zone or sound
-		_activeZone = nullZonePtr;
+		_activeZone.reset();
 		if (ACTIONTYPE(z) == kZoneSpeak) {
 			enterDialogueMode(z);
 		} else {
@@ -174,7 +174,7 @@
 
 	if (_activeZone2) {
 		z = _activeZone2;	// speak Zone or sound
-		_activeZone2 = nullZonePtr;
+		_activeZone2.reset();
 		if (ACTIONTYPE(z) == kZoneSpeak) {
 			enterDialogueMode(z);
 		} else {

Modified: scummvm/trunk/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2009-02-26 10:31:48 UTC (rev 38896)
+++ scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2009-02-26 10:44:01 UTC (rev 38897)
@@ -280,7 +280,7 @@
 void Parallaction_ns::runPendingZones() {
 	if (_activeZone) {
 		ZonePtr z = _activeZone;	// speak Zone or sound
-		_activeZone = nullZonePtr;
+		_activeZone.reset();
 		runZone(z);
 	}
 }
@@ -299,7 +299,7 @@
 	_input->stopHovering();
 	_gfx->freeLabels();
 
-	_zoneTrap = nullZonePtr;
+	_zoneTrap.reset();
 
 	_input->setArrowCursor();
 

Modified: scummvm/trunk/engines/parallaction/parser_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parser_br.cpp	2009-02-26 10:31:48 UTC (rev 38896)
+++ scummvm/trunk/engines/parallaction/parser_br.cpp	2009-02-26 10:44:01 UTC (rev 38897)
@@ -1041,7 +1041,7 @@
 		error("unexpected 'endif'");
 
 //	ctxt.openIf->_endif = ctxt.inst;
-	ctxt.openIf = nullInstructionPtr;
+	ctxt.openIf = InstructionPtr();
 	ctxt.inst->_index = _parser->_lookup;
 }
 

Modified: scummvm/trunk/engines/parallaction/parser_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parser_ns.cpp	2009-02-26 10:31:48 UTC (rev 38896)
+++ scummvm/trunk/engines/parallaction/parser_ns.cpp	2009-02-26 10:44:01 UTC (rev 38897)
@@ -332,7 +332,7 @@
 	_script = script;
 	_program = program;
 
-	ctxt.openIf = nullInstructionPtr;
+	ctxt.openIf = InstructionPtr();
 	ctxt.end = false;
 	ctxt.locals = program->_locals;
 

Modified: scummvm/trunk/engines/parallaction/walk.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/walk.cpp	2009-02-26 10:31:48 UTC (rev 38896)
+++ scummvm/trunk/engines/parallaction/walk.cpp	2009-02-26 10:44:01 UTC (rev 38897)
@@ -290,7 +290,7 @@
 			_vm->_location._startPosition = z->u.door->_startPos;
 			_vm->_location._startFrame = z->u.door->_startFrame;
 			_vm->scheduleLocationSwitch(z->u.door->_location);
-			_vm->_zoneTrap = nullZonePtr;
+			_vm->_zoneTrap.reset();
 		} else {
 			_vm->_cmdExec->run(z->_commands, z);
 		}
@@ -307,7 +307,7 @@
 		_vm->setLocationFlags(kFlagsExit);
 		_vm->_cmdExec->run(_vm->_zoneTrap->_commands, _vm->_zoneTrap);
 		_vm->clearLocationFlags(kFlagsExit);
-		_vm->_zoneTrap = nullZonePtr;
+		_vm->_zoneTrap.reset();
 	}
 
 }


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