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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Mar 11 01:04:52 CET 2007


Revision: 26076
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26076&view=rev
Author:   peres001
Date:     2007-03-10 16:04:50 -0800 (Sat, 10 Mar 2007)

Log Message:
-----------
more refactoring

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/dialogue.cpp
    scummvm/trunk/engines/parallaction/inventory.cpp
    scummvm/trunk/engines/parallaction/menu.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction.h

Modified: scummvm/trunk/engines/parallaction/dialogue.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/dialogue.cpp	2007-03-10 22:56:32 UTC (rev 26075)
+++ scummvm/trunk/engines/parallaction/dialogue.cpp	2007-03-11 00:04:50 UTC (rev 26076)
@@ -226,7 +226,7 @@
 /*
 	// the only character which can have a dialogue inside the museum location is Dino
 	if (!scumm_stricmp(_location, "museum")) {
-		_vm->_graphics->freeCnv( &_tempFrames );
+		_vm->_graphics->freeCnv( &_characterFrames );
 		debugC(1, kDebugDialogue, "runDialogue: special trick for 'museum' location");
 	}
 */
@@ -509,9 +509,9 @@
 	// that's why this hack (with hardcoded Dino) works
 	if (!scumm_stricmp(_location, "museum")) {
 		_vm->_disk->selectArchive("disk1");
-		_vm->_disk->loadFrames(_dinoName, &_tempFrames);
+		_vm->_disk->loadFrames(_dinoName, &_characterFrames);
 
-		memcpy(&_yourself._cnv, &_tempFrames, sizeof(Cnv));
+		memcpy(&_yourself._cnv, &_characterFrames, sizeof(Cnv));
 
 		debugC(1, kDebugDialogue, "runDialogue: special trick for 'museum' location ok");
 	}

Modified: scummvm/trunk/engines/parallaction/inventory.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/inventory.cpp	2007-03-10 22:56:32 UTC (rev 26075)
+++ scummvm/trunk/engines/parallaction/inventory.cpp	2007-03-11 00:04:50 UTC (rev 26076)
@@ -51,7 +51,7 @@
 #define INVENTORY_WIDTH 			(INVENTORY_ITEMS_PER_LINE*INVENTORYITEM_WIDTH)
 #define INVENTORY_HEIGHT			(INVENTORY_LINES*INVENTORYITEM_HEIGHT)
 
-Cnv 			_characterInventory;
+extern Cnv 		_yourObjects;
 uint16			_numInvLines = 0;
 static Point	_invPosition = { 0, 0 };
 
@@ -190,10 +190,10 @@
 	_vm->_graphics->copyRect(
 		Graphics::kBit3,
 		col * INVENTORYITEM_WIDTH,
-		line * _characterInventory._height,
+		line * _yourObjects._height,
 		INVENTORYITEM_WIDTH,
-		_characterInventory._height,
-		_characterInventory._array[item->_index],
+		_yourObjects._height,
+		_yourObjects._array[item->_index],
 		INVENTORYITEM_PITCH
 	);
 
@@ -216,9 +216,9 @@
 	_vm->_graphics->drawBorder(
 		Graphics::kBit3,
 		col * INVENTORYITEM_WIDTH,
-		line * _characterInventory._height,
+		line * _yourObjects._height,
 		INVENTORYITEM_WIDTH,
-		_characterInventory._height,
+		_yourObjects._height,
 		color
 	);
 
@@ -238,9 +238,9 @@
 		Graphics::kBit3,
 		dst,
 		col * INVENTORYITEM_WIDTH,
-		line * _characterInventory._height,
+		line * _yourObjects._height,
 		INVENTORYITEM_WIDTH,
-		_characterInventory._height,
+		_yourObjects._height,
 		INVENTORYITEM_PITCH
 	);
 
@@ -355,7 +355,7 @@
 }
 
 void initInventory() {
-	_characterInventory._count = 0;
+	_yourObjects._count = 0;
 }
 
 void cleanInventory() {
@@ -372,18 +372,18 @@
 
 
 void refreshInventory(const char *character) {
-	_vm->_disk->loadObjects(character, &_characterInventory);
+//	_vm->_disk->loadObjects(character, &_characterInventory);
 	redrawInventory();
-	_vm->_graphics->freeCnv(&_characterInventory);
+//	_vm->_graphics->freeCnv(&_yourObjects);
 
 	return;
 }
 
 
 void refreshInventoryItem(const char *character, uint16 index) {
-	_vm->_disk->loadObjects(character, &_characterInventory);
+//	_vm->_disk->loadObjects(character, &_yourObjects);
 	drawInventoryItem(index, &_inventory[index]);
-	_vm->_graphics->freeCnv(&_characterInventory);
+//	_vm->_graphics->freeCnv(&_characterInventory);
 
 	return;
 }

Modified: scummvm/trunk/engines/parallaction/menu.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/menu.cpp	2007-03-10 22:56:32 UTC (rev 26075)
+++ scummvm/trunk/engines/parallaction/menu.cpp	2007-03-11 00:04:50 UTC (rev 26076)
@@ -408,7 +408,7 @@
 
 	free(v14._data0);
 
-	refreshInventory(_vm->_characterName);
+//	refreshInventory(_vm->_characterName);
 
 	return;
 

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2007-03-10 22:56:32 UTC (rev 26075)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2007-03-11 00:04:50 UTC (rev 26076)
@@ -55,9 +55,14 @@
 uint32		_engineFlags = 0;
 char	   *_objectsNames[100];
 Zone	   *_activeZone = NULL;
-Animation	_yourself;
-StaticCnv	_yourHead;
-Cnv		    _yourTalk;
+
+Animation		_yourself;
+StaticCnv		_yourHead;
+Cnv		    	_yourTalk;
+Cnv 			_characterFrames;
+static Cnv		_miniCharacterFrames;
+Cnv 			_yourObjects;
+
 uint16		_score = 1;
 Command    *_locationACommands = NULL;
 Command    *_locationCommands = NULL;
@@ -136,7 +141,6 @@
 byte		_mouseHidden = 0;
 Node		_locationWalkNodes = { 0, 0 };
 uint32		_commandFlags = 0;
-Cnv 		_tempFrames;
 uint16		_introSarcData3 = 200;
 uint16		_introSarcData2 = 1;
 
@@ -151,8 +155,8 @@
 Zone    *_hoverZone = NULL;
 static Job	   *_jRunScripts = NULL;
 
-static Cnv		_miniCharacterFrames;
 
+
 static Job		_jobs = { { NULL, NULL }, 0, 0, 0, NULL, 0 };
 
 
@@ -827,13 +831,14 @@
 
 void freeCharacterFrames() {
 
-	_vm->_graphics->freeCnv(&_tempFrames);
+	_vm->_graphics->freeCnv(&_characterFrames);
 
 	if (!IS_DUMMY_CHARACTER(_vm->_characterName)) {
 		_vm->_graphics->freeCnv(&_miniCharacterFrames);
 		_vm->freeTable(_objectsNames);
 		_vm->_graphics->freeCnv(&_yourTalk);
 		_vm->_graphics->freeStaticCnv(&_yourHead);
+		_vm->_graphics->freeCnv(&_yourObjects);
 	}
 
 	return;
@@ -867,27 +872,24 @@
 	char v32[20];
 	strcpy(v32, name);
 
-
-
-	if (_engineFlags & kEngineTransformedDonna) {
+	if (_engineFlags & kEngineTransformedDonna)
 		strcat(v32, "tras");
-	}
 
 	if (scumm_stricmp(v32, _characterName1)) {
 
-		if (scumm_stricmp(_characterName1, "null")) {
+		if (scumm_stricmp(_characterName1, "null"))
 			freeCharacterFrames();
-		}
 
 		_disk->selectArchive("disk1");
 
 		char path[PATH_LEN];
 		strcpy(path, v32);
-		_disk->loadFrames(path, &_tempFrames);
+		_disk->loadFrames(path, &_characterFrames);
 
 		if (!IS_DUMMY_CHARACTER(name)) {
 			_disk->loadHead(path, &_yourHead);
 			_disk->loadTalk(path, &_yourTalk);
+			_disk->loadObjects(name, &_yourObjects);
 
 			sprintf(path, "mini%s", v32);
 			_disk->loadFrames(path, &_miniCharacterFrames);
@@ -899,16 +901,13 @@
 
 			if (scumm_stricmp(name, "night") && scumm_stricmp(name, "intsushi"))
 				selectCharacterMusic(name);
-
 		}
-
 	}
 
-	if (miniCharacter) {
+	if (miniCharacter)
 		memcpy(&_yourself._cnv, &_miniCharacterFrames, sizeof(Cnv));
-	} else {
-		memcpy(&_yourself._cnv, &_tempFrames, sizeof(Cnv));
-	}
+	else
+		memcpy(&_yourself._cnv, &_characterFrames, sizeof(Cnv));
 
 	strcpy(_characterName1, v32);
 

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2007-03-10 22:56:32 UTC (rev 26075)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2007-03-11 00:04:50 UTC (rev 26076)
@@ -119,11 +119,13 @@
 extern char _saveData1[];
 extern Point _firstPosition;		 // starting position after load game??
 extern uint16 _firstFrame;	 // starting frame after load game??
-extern Cnv _yourTalk;
 extern byte _mouseHidden;
 extern uint32 _commandFlags;
-extern Cnv _tempFrames;
 
+extern Cnv _yourTalk;
+
+extern Cnv _characterFrames;
+
 extern char _location[];
 extern Node _locationWalkNodes;
 extern Command *_locationACommands;


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