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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Jul 29 21:17:53 CEST 2007


Revision: 28315
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28315&view=rev
Author:   peres001
Date:     2007-07-29 12:17:53 -0700 (Sun, 29 Jul 2007)

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

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/commands.cpp
    scummvm/trunk/engines/parallaction/dialogue.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction_ns.cpp
    scummvm/trunk/engines/parallaction/walk.cpp
    scummvm/trunk/engines/parallaction/zone.cpp

Modified: scummvm/trunk/engines/parallaction/commands.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/commands.cpp	2007-07-29 19:14:50 UTC (rev 28314)
+++ scummvm/trunk/engines/parallaction/commands.cpp	2007-07-29 19:17:53 UTC (rev 28315)
@@ -314,7 +314,7 @@
 				continue;
 			}
 
-			WalkNodeList *vC = _vm->_char._builder.buildPath(u->_move._x, u->_move._y);
+			WalkNodeList *vC = _char._builder.buildPath(u->_move._x, u->_move._y);
 
 			addJob(&jobWalk, vC, kPriority19 );
 			_engineFlags |= kEngineWalking;

Modified: scummvm/trunk/engines/parallaction/dialogue.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/dialogue.cpp	2007-07-29 19:14:50 UTC (rev 28314)
+++ scummvm/trunk/engines/parallaction/dialogue.cpp	2007-07-29 19:17:53 UTC (rev 28315)
@@ -491,7 +491,7 @@
 
 	_gfx->setFont(kFontDialogue);
 
-	if (_vm->getPlatform() == Common::kPlatformPC)
+	if (getPlatform() == Common::kPlatformPC)
 		showCursor(false);
 
 	DialogueManager man(this, data);

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2007-07-29 19:14:50 UTC (rev 28314)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2007-07-29 19:17:53 UTC (rev 28315)
@@ -102,7 +102,7 @@
 	Engine(syst) {
 
 	// FIXME
-	_vm = this;
+//	_vm = this;
 
 	_mouseHidden = false;
 
@@ -178,7 +178,7 @@
 	initWalk();			// needs to be pushed into subclass
 	initInventory();	// needs to be pushed into subclass
 
-	_animations.push_front(&_vm->_char._ani);
+	_animations.push_front(&_char._ani);
 	_gfx = new Gfx(this);
 
 	_debugger = new Debugger(this);
@@ -219,9 +219,9 @@
 	parseLocation(_location._name);
 
 	if (_location._startPosition.x != -1000) {
-		_vm->_char._ani._left = _location._startPosition.x;
-		_vm->_char._ani._top = _location._startPosition.y;
-		_vm->_char._ani._frame = _location._startFrame;
+		_char._ani._left = _location._startPosition.x;
+		_char._ani._top = _location._startPosition.y;
+		_char._ani._frame = _location._startFrame;
 		_location._startPosition.y = -1000;
 		_location._startPosition.x = -1000;
 	}
@@ -466,9 +466,9 @@
 		debugC(2, kDebugInput, "processInput: kEvWalk");
 		_hoverZone = NULL;
 		changeCursor(kCursorArrow);
-		if (_vm->_char._ani._flags & kFlagsRemove) break;
-		if ((_vm->_char._ani._flags & kFlagsActive) == 0) break;
-		WalkNodeList *v4 = _vm->_char._builder.buildPath(data->_mousePos.x, data->_mousePos.y);
+		if (_char._ani._flags & kFlagsRemove) break;
+		if ((_char._ani._flags & kFlagsActive) == 0) break;
+		WalkNodeList *v4 = _char._builder.buildPath(data->_mousePos.x, data->_mousePos.y);
 		addJob(&jobWalk, v4, kPriority19);
 		_engineFlags |= kEngineWalking; 								   // inhibits processing of input until walking is over
 		}
@@ -684,27 +684,27 @@
 void Parallaction::freeCharacter() {
 	debugC(3, kDebugLocation, "freeCharacter()");
 
-	if (!IS_DUMMY_CHARACTER(_vm->_characterName)) {
+	if (!IS_DUMMY_CHARACTER(_characterName)) {
 		if (_objectsNames)
 			delete _objectsNames;
 		_objectsNames = NULL;
 
-		if (_vm->_char._ani._cnv)
-			delete _vm->_char._ani._cnv;
-		_vm->_char._ani._cnv = NULL;
+		if (_char._ani._cnv)
+			delete _char._ani._cnv;
+		_char._ani._cnv = NULL;
 
-		if (_vm->_char._talk)
-			delete _vm->_char._talk;
-		_vm->_char._talk = NULL;
+		if (_char._talk)
+			delete _char._talk;
+		_char._talk = NULL;
 
-		_vm->_gfx->freeStaticCnv(_vm->_char._head);
-		if (_vm->_char._head)
-			delete _vm->_char._head;
-		_vm->_char._head = NULL;
+		_gfx->freeStaticCnv(_char._head);
+		if (_char._head)
+			delete _char._head;
+		_char._head = NULL;
 
-		if (_vm->_char._objs)
-			delete _vm->_char._objs;
-		_vm->_char._objs = NULL;
+		if (_char._objs)
+			delete _char._objs;
+		_char._objs = NULL;
 	}
 
 	return;
@@ -731,16 +731,16 @@
 		// character for sanity before memory is freed
 		freeCharacter();
 
-		Common::String oldArchive = _disk->selectArchive((_vm->getFeatures() & GF_LANG_MULT) ? "disk1" : "disk0");
-		_vm->_char._ani._cnv = _disk->loadFrames(fullName);
+		Common::String oldArchive = _disk->selectArchive((getFeatures() & GF_LANG_MULT) ? "disk1" : "disk0");
+		_char._ani._cnv = _disk->loadFrames(fullName);
 
 		if (!IS_DUMMY_CHARACTER(name)) {
-			if (_vm->getPlatform() == Common::kPlatformAmiga && (_vm->getFeatures() & GF_LANG_MULT))
+			if (getPlatform() == Common::kPlatformAmiga && (getFeatures() & GF_LANG_MULT))
 				_disk->selectArchive("disk0");
 
-			_vm->_char._head = _disk->loadHead(baseName);
-			_vm->_char._talk = _disk->loadTalk(baseName);
-			_vm->_char._objs = _disk->loadObjects(baseName);
+			_char._head = _disk->loadHead(baseName);
+			_char._talk = _disk->loadTalk(baseName);
+			_char._objs = _disk->loadObjects(baseName);
 			_objectsNames = _disk->loadTable(baseName);
 
 			_soundMan->playCharacterMusic(name);

Modified: scummvm/trunk/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2007-07-29 19:14:50 UTC (rev 28314)
+++ scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2007-07-29 19:17:53 UTC (rev 28315)
@@ -49,7 +49,7 @@
 			strcpy(_location._name, "fognedemo");
 		}
 		_disk = new AmigaDisk_ns(this);
-		_disk->selectArchive((_vm->getFeatures() & GF_DEMO) ? "disk0" : "disk1");
+		_disk->selectArchive((getFeatures() & GF_DEMO) ? "disk0" : "disk1");
 	}
 
 	if (getPlatform() == Common::kPlatformPC) {

Modified: scummvm/trunk/engines/parallaction/walk.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/walk.cpp	2007-07-29 19:14:50 UTC (rev 28314)
+++ scummvm/trunk/engines/parallaction/walk.cpp	2007-07-29 19:17:53 UTC (rev 28315)
@@ -272,19 +272,19 @@
 
 void Parallaction::clipMove(Common::Point& pos, const WalkNode* from) {
 
-	if ((pos.x < from->_x) && (pos.x < _screenWidth) && (queryPath(_vm->_char._ani.width()/2 + pos.x + 2, _vm->_char._ani.height() + pos.y) != 0)) {
+	if ((pos.x < from->_x) && (pos.x < _screenWidth) && (queryPath(_char._ani.width()/2 + pos.x + 2, _char._ani.height() + pos.y) != 0)) {
 		pos.x = (pos.x + 2 < from->_x) ? pos.x + 2 : from->_x;
 	}
 
-	if ((pos.x > from->_x) && (pos.x > -20) && (queryPath(_vm->_char._ani.width()/2 + pos.x - 2, _vm->_char._ani.height() + pos.y) != 0)) {
+	if ((pos.x > from->_x) && (pos.x > -20) && (queryPath(_char._ani.width()/2 + pos.x - 2, _char._ani.height() + pos.y) != 0)) {
 		pos.x = (pos.x - 2 > from->_x) ? pos.x - 2 : from->_x;
 	}
 
-	if ((pos.y < from->_y) && (pos.y < (_screenHeight - _vm->_char._ani.height())) && (queryPath(_vm->_char._ani.width()/2 + pos.x, _vm->_char._ani.height() + pos.y + 2) != 0)) {
+	if ((pos.y < from->_y) && (pos.y < (_screenHeight - _char._ani.height())) && (queryPath(_char._ani.width()/2 + pos.x, _char._ani.height() + pos.y + 2) != 0)) {
 		pos.y = (pos.y + 2 <= from->_y) ? pos.y + 2 : from->_y;
 	}
 
-	if ((pos.y > from->_y) && (pos.y > -20) && (queryPath(_vm->_char._ani.width()/2 + pos.x, _vm->_char._ani.height() + pos.y- 2) != 0)) {
+	if ((pos.y > from->_y) && (pos.y > -20) && (queryPath(_char._ani.width()/2 + pos.x, _char._ani.height() + pos.y- 2) != 0)) {
 		pos.y = (pos.y - 2 >= from->_y) ? pos.y - 2 :from->_y;
 	}
 
@@ -304,7 +304,7 @@
 
 	// walk frame selection
 	int16 v16;
-	if (_vm->_char._ani.getFrameNum() == 20) {
+	if (_char._ani.getFrameNum() == 20) {
 
 		if (dist.x > dist.y) {
 			walkData2 = (from->_x > pos.x) ? 0 : 7;
@@ -336,49 +336,49 @@
 uint16 Parallaction::checkDoor() {
 //	printf("checkDoor()...");
 
-	if (_vm->_currentLocationIndex != _doorData1) {
-		_doorData1 = _vm->_currentLocationIndex;
+	if (_currentLocationIndex != _doorData1) {
+		_doorData1 = _currentLocationIndex;
 		_zoneTrap = NULL;
 	}
 
 	_engineFlags &= ~kEngineWalking;
-	Zone *z = _vm->hitZone(kZoneDoor, _vm->_char._ani._left + _vm->_char._ani.width() / 2,	_vm->_char._ani._top + _vm->_char._ani.height());
+	Zone *z = hitZone(kZoneDoor, _char._ani._left + _char._ani.width() / 2,	_char._ani._top + _char._ani.height());
 
 	if (z != NULL) {
 
 		if ((z->_flags & kFlagsClosed) == 0) {
-			_vm->_location._startPosition.x = z->u.door->_startPos.x;
-			_vm->_location._startPosition.y = z->u.door->_startPos.y;
-			_vm->_location._startFrame = z->u.door->_startFrame;
-			strcpy( _vm->_location._name, z->u.door->_location );
+			_location._startPosition.x = z->u.door->_startPos.x;
+			_location._startPosition.y = z->u.door->_startPos.y;
+			_location._startFrame = z->u.door->_startFrame;
+			strcpy(_location._name, z->u.door->_location);
 
 			_engineFlags |= kEngineChangeLocation;
 			_zoneTrap = NULL;
 
 		} else {
-			_vm->runCommands(z->_commands, z);
+			runCommands(z->_commands, z);
 		}
 	}
 
-	z = _vm->hitZone(kZoneTrap, _vm->_char._ani._left + _vm->_char._ani.width() / 2, _vm->_char._ani._top + _vm->_char._ani.height());
+	z = hitZone(kZoneTrap, _char._ani._left + _char._ani.width() / 2, _char._ani._top + _char._ani.height());
 
 	if (z != NULL) {
-		_localFlags[_vm->_currentLocationIndex] |= kFlagsEnter;
-		_vm->runCommands(z->_commands, z);
-		_localFlags[_vm->_currentLocationIndex] &= ~kFlagsEnter;
+		_localFlags[_currentLocationIndex] |= kFlagsEnter;
+		runCommands(z->_commands, z);
+		_localFlags[_currentLocationIndex] &= ~kFlagsEnter;
 		_zoneTrap = z;
 	} else
 	if (_zoneTrap != NULL) {
-		_localFlags[_vm->_currentLocationIndex] |= kFlagsExit;
-		_vm->runCommands(_zoneTrap->_commands, _zoneTrap);
-		_localFlags[_vm->_currentLocationIndex] &= ~kFlagsExit;
+		_localFlags[_currentLocationIndex] |= kFlagsExit;
+		runCommands(_zoneTrap->_commands, _zoneTrap);
+		_localFlags[_currentLocationIndex] &= ~kFlagsExit;
 		_zoneTrap = NULL;
 	}
 
 //	printf("done\n");
 
-	_vm->_char._ani._frame = walkData2;
-	return _vm->_char._ani._frame;
+	_char._ani._frame = walkData2;
+	return _char._ani._frame;
 }
 
 

Modified: scummvm/trunk/engines/parallaction/zone.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/zone.cpp	2007-07-29 19:14:50 UTC (rev 28314)
+++ scummvm/trunk/engines/parallaction/zone.cpp	2007-07-29 19:17:53 UTC (rev 28315)
@@ -349,7 +349,7 @@
 	Common::Rect r(v6C, v6A);
 	r.moveTo(0, 90);
 	_gfx->drawBalloon(r, 0);
-	_gfx->flatBlitCnv(_vm->_char._head, 100, 152, Gfx::kBitFront);
+	_gfx->flatBlitCnv(_char._head, 100, 152, Gfx::kBitFront);
 	_gfx->displayWrappedString(data->_description, 0, 90, 0, 130);
 
 	jobEraseAnimations((void*)1, NULL);


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