[Scummvm-cvs-logs] SF.net SVN: scummvm: [32583] scummvm/trunk/engines/drascula

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Jun 6 21:37:36 CEST 2008


Revision: 32583
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32583&view=rev
Author:   thebluegr
Date:     2008-06-06 12:37:36 -0700 (Fri, 06 Jun 2008)

Log Message:
-----------
- Cleanup
- Removed the unneeded AuxBuffLast buffer (this one is really not necessary :) )
- Simplified some more room actions

Modified Paths:
--------------
    scummvm/trunk/engines/drascula/drascula.cpp
    scummvm/trunk/engines/drascula/drascula.h
    scummvm/trunk/engines/drascula/rooms.cpp
    scummvm/trunk/engines/drascula/staticdata.h

Modified: scummvm/trunk/engines/drascula/drascula.cpp
===================================================================
--- scummvm/trunk/engines/drascula/drascula.cpp	2008-06-06 19:29:59 UTC (rev 32582)
+++ scummvm/trunk/engines/drascula/drascula.cpp	2008-06-06 19:37:36 UTC (rev 32583)
@@ -1420,13 +1420,12 @@
 
 void DrasculaEngine::print_abc(const char *said, int screenX, int screenY) {
 	int textPos[8];
-	int letterY = 0, letterX = 0, h, length;
-	length = strlen(said);
+	int letterY = 0, letterX = 0, c, i;
 
-	for (h = 0; h < length; h++) {
-		int c = toupper(said[h]);
+	for (uint h = 0; h < strlen(said); h++) {
+		c = toupper(said[h]);
 
-		for (int i = 0; i < CHARMAP_SIZE; i++) {
+		for (i = 0; i < CHARMAP_SIZE; i++) {
 			if (c == charMap[i].inChar) {
 				letterX = charMap[i].mappedChar;
 
@@ -1464,10 +1463,9 @@
 
 void DrasculaEngine::print_abc_opc(const char *said, int screenX, int screenY, int game) {
 	int textPos[6];
-	int signY, letterY, letterX = 0, h, length;
-	length = strlen(said);
+	int signY, letterY, letterX = 0;
 
-	for (h = 0; h < length; h++) {
+	for (uint h = 0; h < strlen(said); h++) {
 		if (game == 1) {
 			letterY = 6;
 			signY = 15;
@@ -1780,7 +1778,6 @@
 	int cnt = 2;
 	int dataSize = 0;
 
-	AuxBuffLast = (byte *)malloc(65000);
 	AuxBuffDes = (byte *)malloc(65000);
 
 	_arj.open(animationFile);
@@ -1800,7 +1797,6 @@
 	_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
 	_system->updateScreen();
 	setPalette(cPal);
-	memcpy(AuxBuffLast, AuxBuffDes, 64000);
 	WaitForNext(FPS);
 	while (cnt < NFrames) {
 		dataSize = _arj.readSint32LE();
@@ -1810,7 +1806,7 @@
 		loadPCX(AuxBuffOrg);
 		free(AuxBuffOrg);
 		for (j = 0;j < 64000; j++) {
-			VGA[j] = AuxBuffLast[j] = AuxBuffDes[j] ^ AuxBuffLast[j];
+			VGA[j] = AuxBuffDes[j] ^ VGA[j];
 		}
 		_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
 		_system->updateScreen();
@@ -1822,7 +1818,6 @@
 		if (key != 0)
 			break;
 	}
-	free(AuxBuffLast);
 	free(AuxBuffDes);
 	_arj.close();
 
@@ -2753,8 +2748,7 @@
 }
 
 void DrasculaEngine::MixVideo(byte *OldScreen, byte *NewScreen) {
-	int x;
-	for (x = 0; x < 64000; x++)
+	for (int x = 0; x < 64000; x++)
 		OldScreen[x] ^= NewScreen[x];
 }
 
@@ -2770,10 +2764,8 @@
 	unsigned int X = 0;
 	unsigned int fExit = 0;
 	char ch, rep;
-	byte *AuxPun;
+	byte *AuxPun = AuxBuffDes;
 
-	AuxPun = AuxBuffDes;
-
 	while (!fExit) {
 		ch = *NamePcc++;
 		rep = 1;
@@ -2825,10 +2817,10 @@
 
 			copyRectClip(pixelPos, dir_inicio, dir_fin);
 
-			pixelX = pixelX + totalX;
+			pixelX += totalX;
 		}
 		pixelX = xx1;
-		pixelY = pixelY + totalY;
+		pixelY += totalY;
 	}
 }
 
@@ -3008,7 +3000,7 @@
 void DrasculaEngine::converse(int index) {
 	char fileName[20];
 	sprintf(fileName, "op_%d.cal", index);
-	int h;
+	uint h;
 	int game1 = 1, game2 = 1, game3 = 1, game4 = 1;
 	char phrase1[78];
 	char phrase2[78];
@@ -3018,7 +3010,6 @@
 	char sound2[13];
 	char sound3[13];
 	char sound4[13];
-	int length;
 	int answer1;
 	int answer2;
 	int answer3;
@@ -3070,23 +3061,19 @@
 		answer3 = 15;
 	}
 
-	length = strlen(phrase1);
-	for (h = 0; h < length; h++)
+	for (h = 0; h < strlen(phrase1); h++)
 		if (phrase1[h] == (char)0xa7)
 			phrase1[h] = ' ';
 
-	length = strlen(phrase2);
-	for (h = 0; h < length; h++)
+	for (h = 0; h < strlen(phrase2); h++)
 		if (phrase2[h] == (char)0xa7)
 			phrase2[h] = ' ';
 
-	length = strlen(phrase3);
-	for (h = 0; h < length; h++)
+	for (h = 0; h < strlen(phrase3); h++)
 		if (phrase3[h] == (char)0xa7)
 			phrase3[h] = ' ';
 
-	length = strlen(phrase4);
-	for (h = 0; h < length; h++)
+	for (h = 0; h < strlen(phrase4); h++)
 		if (phrase4[h] == (char)0xa7)
 			phrase4[h] = ' ';
 

Modified: scummvm/trunk/engines/drascula/drascula.h
===================================================================
--- scummvm/trunk/engines/drascula/drascula.h	2008-06-06 19:29:59 UTC (rev 32582)
+++ scummvm/trunk/engines/drascula/drascula.h	2008-06-06 19:37:36 UTC (rev 32583)
@@ -464,7 +464,6 @@
 	int playFrameSSN();
 
 	byte *AuxBuffOrg;
-	byte *AuxBuffLast;
 	byte *AuxBuffDes;
 
 	byte *pointer;

Modified: scummvm/trunk/engines/drascula/rooms.cpp
===================================================================
--- scummvm/trunk/engines/drascula/rooms.cpp	2008-06-06 19:29:59 UTC (rev 32582)
+++ scummvm/trunk/engines/drascula/rooms.cpp	2008-06-06 19:37:36 UTC (rev 32583)
@@ -1494,9 +1494,7 @@
 				chooseObject(21);
 				removeObject(18);
 				removeObject(19);
-			} else if ((pickedObject == 14 && fl == 19) || (pickedObject == 19 && fl == 14))
-				talk(484);
-			else if (pickedObject == kVerbLook && fl == 9) {
+			} else if (pickedObject == kVerbLook && fl == 9) {
 				talk(482);
 				talk(483);
 			} else if (pickedObject == kVerbLook && fl == 19) {
@@ -1524,10 +1522,6 @@
 			// Note: the original check was strcmp(num_room, "18.alg")
 			if (pickedObject == 11 && fl == 50 && flags[22] == 0 && roomNumber != 18)
 				talk(315);
-			else if (pickedObject == 13 && fl == 50)
-				talk(156);
-			else if (pickedObject == 20 && fl == 50)
-				talk(163);
 			else
 				hasAnswer = 0;
 		} else if (currentChapter == 3) {
@@ -1541,21 +1535,15 @@
 				talk(178);
 			else if (pickedObject == 8 && fl == 50 && flags[18] == 0)
 				talk(481);
-			else if (pickedObject == 9 && fl == 50)
-				talk(484);
 			else if (pickedObject == 12 && fl == 50 && flags[18] == 0)
 				talk(487);
-			else if (pickedObject == 20 && fl == 50)
-				talk(487);
 			else if (roomNumber == 21) {
 				if (room(21, fl))
 					return true;
 			} else
 				hasAnswer = 0;
 		} else if (currentChapter == 5) {
-			if (pickedObject == 20 && fl == 50)
-				talk(487);
-			else if (roomNumber == 56) {
+			if (roomNumber == 56) {
 				if (room(56, fl))
 					return true;
 			} else

Modified: scummvm/trunk/engines/drascula/staticdata.h
===================================================================
--- scummvm/trunk/engines/drascula/staticdata.h	2008-06-06 19:29:59 UTC (rev 32582)
+++ scummvm/trunk/engines/drascula/staticdata.h	2008-06-06 19:37:36 UTC (rev 32583)
@@ -574,6 +574,8 @@
 	{ 200,	4,	kVerbLook,		28,		328 },
 	{ 200,	4,	kVerbTalk,		15,		118 },
 	{ 200,	4,	kVerbOpen,		15,		119 },
+	{ 200,	4,		   14,		19,		484 },
+	{ 200,	4,		   19,		14,		484 },
 	// ----------------------------------
 	{ 200,	5,	kVerbLook,		7,		478 },
 	{ 200,	5,	kVerbLook,		8,		120 },
@@ -605,6 +607,8 @@
 	{ 201,	2,	kVerbMove,		50,		312 },
 	{ 201,	2,	kVerbPick,		50,		313 },
 	{ 201,	2,	kVerbTalk,		50,		314 },
+	{ 201,	2,		   13,		50,		156 },
+	{ 201,	2,		   20,		50,		163 },
 	// ----------------------------------
 	{ 201,	3,	kVerbLook,		50,		309 },
 	{ 201,	3,	kVerbOpen,		50,		310 },
@@ -619,6 +623,8 @@
 	{ 201,	4,	kVerbMove,		50,		312 },
 	{ 201,	4,	kVerbPick,		50,		313 },
 	{ 201,	4,	kVerbTalk,		50,		314 },
+	{ 201,	4,		    9,		50,		484 },
+	{ 201,	4,		   20,		50,		487 },
 	// ----------------------------------
 	{ 201,	5,	kVerbLook,		50,		309 }, // Originally these are with
 	{ 201,	5,	kVerbOpen,		50,		310 }, // completely wrong voices
@@ -626,6 +632,7 @@
 	{ 201,	5,	kVerbMove,		50,		312 },
 	{ 201,	5,	kVerbPick,		50,		313 },
 	{ 201,	5,	kVerbTalk,		50,		314 },
+	{ 201,	5,		   20,		50,		487 },
 	// ----------------------------------
 	{ 201,	6,	kVerbOpen,		50,		310 },
 	{ 201,	6,	kVerbClose,		50,		311 },


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