[Scummvm-cvs-logs] SF.net SVN: scummvm: [29016] scummvm/trunk/engines/agi

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Sep 22 12:10:01 CEST 2007


Revision: 29016
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29016&view=rev
Author:   thebluegr
Date:     2007-09-22 03:10:01 -0700 (Sat, 22 Sep 2007)

Log Message:
-----------
Code simplification. Removed IDI_MSA_MAX_STR and fRmTxt - oRmTxt is used instead, as the two arrays contained non-null values for the same rooms. Also, room object indices are no longer read from the original executable

Modified Paths:
--------------
    scummvm/trunk/engines/agi/preagi_mickey.cpp
    scummvm/trunk/engines/agi/preagi_mickey.h

Modified: scummvm/trunk/engines/agi/preagi_mickey.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi_mickey.cpp	2007-09-22 09:53:13 UTC (rev 29015)
+++ scummvm/trunk/engines/agi/preagi_mickey.cpp	2007-09-22 10:10:01 UTC (rev 29016)
@@ -949,7 +949,7 @@
 	waitAnyKeyAnim();
 
 	// print extended room description
-	if (game.fRmTxt[game.iRoom]) {
+	if (game.oRmTxt[game.iRoom]) {
 		printExeMsg(game.oRmTxt[game.iRoom] + IDI_MSA_OFS_EXE);
 	}
 }
@@ -1340,13 +1340,13 @@
 void Mickey::getItem(ENUM_MSA_ITEM iItem) {
 	game.fItem[iItem] = true;
 	game.iItem[game.nItems++] = iItem;
-	game.fRmTxt[game.iRoom] = 0;
+	game.oRmTxt[game.iRoom] = 0;
 	playSound(IDI_MSA_SND_TAKE);
 	drawRoom();
 }
 
 void Mickey::getXtal(int iStr) {
-	game.fRmTxt[game.iRoom] = 0;
+	game.oRmTxt[game.iRoom] = 0;
 	game.fHasXtal = true;
 	game.nXtals++;
 	playSound(IDI_MSA_SND_CRYSTAL);
@@ -2149,8 +2149,8 @@
 	memset(&game, 0, sizeof(game));
 	memset(&game.iItem, IDI_MSA_OBJECT_NONE, sizeof(game.iItem));
 	// read room extended desc flags
-	readExe(IDO_MSA_ROOM_TEXT, buffer, sizeof(buffer));
-	memcpy(game.fRmTxt, buffer, sizeof(game.fRmTxt));
+	//readExe(IDO_MSA_ROOM_TEXT, buffer, sizeof(buffer));
+	//memcpy(game.fRmTxt, buffer, sizeof(game.fRmTxt));
 
 	// read room extended desc offsets
 	readExe(IDO_MSA_ROOM_TEXT_OFFSETS, buffer, sizeof(buffer));
@@ -2159,8 +2159,8 @@
 		game.oRmTxt[i] = buffer[i*2] + 256 * buffer[i*2+1];
 
 	// read room object indices
-	readExe(IDO_MSA_ROOM_OBJECT, buffer, sizeof(buffer));
-	memcpy(game.iRmObj, buffer, sizeof(game.iRmObj));
+	//readExe(IDO_MSA_ROOM_OBJECT, buffer, sizeof(buffer));
+	//memcpy(game.iRmObj, buffer, sizeof(game.iRmObj));
 
 	// read room picture indices
 	//readExe(IDO_MSA_ROOM_PICTURE, buffer, sizeof(buffer));
@@ -2170,11 +2170,17 @@
 	readExe(IDO_MSA_ROOM_MENU_FIX, buffer, sizeof(buffer));
 	memcpy(game.nRmMenu, buffer, sizeof(game.nRmMenu));
 
-	// set room picture indices
+	// set room picture and room object indices
 	for (int i = 0; i < IDI_MSA_MAX_ROOM; i++) {
 		game.iRmPic[i] = i;
+		game.iRmObj[i] = -1;
 	}
 	game.iRmPic[IDI_MSA_PIC_SHIP_AIRLOCK] = IDI_MSA_PIC_SHIP_AIRLOCK_0;
+	game.iRmObj[23] = 11;
+	game.iRmObj[110] = 21;
+	game.iRmObj[112] = 20;
+	game.iRmObj[119] = 19;
+	game.iRmObj[154] = 1;
 
 #if 0
 	// DEBUG

Modified: scummvm/trunk/engines/agi/preagi_mickey.h
===================================================================
--- scummvm/trunk/engines/agi/preagi_mickey.h	2007-09-22 09:53:13 UTC (rev 29015)
+++ scummvm/trunk/engines/agi/preagi_mickey.h	2007-09-22 10:10:01 UTC (rev 29016)
@@ -75,7 +75,6 @@
 #define IDI_MSA_MAX_PIC_ROOM			224
 #define IDI_MSA_MAX_SOUND				8
 #define IDI_MSA_MAX_ROOM				160
-#define IDI_MSA_MAX_STR					160
 
 #define IDI_MSA_MAX_BUTTON				6
 #define IDI_MSA_MAX_ITEM				11
@@ -466,7 +465,7 @@
 	uint16	filelen;
 	uint16	ofsRoom[IDI_MSA_MAX_ROOM];
 	uint16	ofsDesc[IDI_MSA_MAX_ROOM];
-	uint16	ofsStr[IDI_MSA_MAX_STR];
+	uint16	ofsStr[IDI_MSA_MAX_ROOM];
 };
 
 struct MSA_SND_NOTE {
@@ -716,7 +715,7 @@
 	int iItem[IDI_MSA_MAX_ITEM];
 	int nItems;
 
-	int8 fRmTxt[IDI_MSA_MAX_ROOM];
+	//int8 fRmTxt[IDI_MSA_MAX_ROOM];
 	int8 iRmObj[IDI_MSA_MAX_ROOM];
 	uint8 iRmPic[IDI_MSA_MAX_ROOM];
 	uint16 oRmTxt[IDI_MSA_MAX_ROOM];


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