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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sun Jun 8 05:09:21 CEST 2008


Revision: 32609
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32609&view=rev
Author:   thebluegr
Date:     2008-06-07 20:09:21 -0700 (Sat, 07 Jun 2008)

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

Modified Paths:
--------------
    scummvm/trunk/engines/drascula/actors.cpp
    scummvm/trunk/engines/drascula/animation.cpp
    scummvm/trunk/engines/drascula/graphics.cpp
    scummvm/trunk/engines/drascula/talk.cpp

Modified: scummvm/trunk/engines/drascula/actors.cpp
===================================================================
--- scummvm/trunk/engines/drascula/actors.cpp	2008-06-08 02:02:06 UTC (rev 32608)
+++ scummvm/trunk/engines/drascula/actors.cpp	2008-06-08 03:09:21 UTC (rev 32609)
@@ -28,9 +28,8 @@
 namespace Drascula {
 
 void DrasculaEngine::placeIgor() {
-	int pos_igor[6];
+	int pos_igor[6] = { 1, 0, igorX, igorY, 54, 61 };
 
-	pos_igor[0] = 1;
 	if (currentChapter == 4) {
 		pos_igor[1] = 138;
 	} else {
@@ -39,16 +38,12 @@
 		else if (trackIgor == 1)
 			pos_igor[1] = 76;
 	}
-	pos_igor[2] = igorX;
-	pos_igor[3] = igorY;
-	pos_igor[4] = 54;
-	pos_igor[5] = 61;
 
 	copyRectClip(pos_igor, frontSurface, screenSurface);
 }
 
 void DrasculaEngine::placeDrascula() {
-	int pos_dr[6];
+	int pos_dr[6] = { 0, 122, drasculaX, drasculaY, 45, 77 };
 
 	if (trackDrascula == 1)
 		pos_dr[0] = 47;
@@ -56,11 +51,6 @@
 		pos_dr[0] = 1;
 	else if (trackDrascula == 3 && currentChapter == 1)
 		pos_dr[0] = 93;
-	pos_dr[1] = 122;
-	pos_dr[2] = drasculaX;
-	pos_dr[3] = drasculaY;
-	pos_dr[4] = 45;
-	pos_dr[5] = 77;
 
 	if (currentChapter == 6)
 		copyRectClip(pos_dr, drawSurface2, screenSurface);
@@ -69,17 +59,12 @@
 }
 
 void DrasculaEngine::placeBJ() {
-	int pos_bj[6];
+	int pos_bj[6] = { 0, 99, bjX, bjY, 26, 76 };
 
 	if (trackBJ == 3)
 		pos_bj[0] = 10;
 	else if (trackBJ == 0)
 		pos_bj[0] = 37;
-	pos_bj[1] = 99;
-	pos_bj[2] = bjX;
-	pos_bj[3] = bjY;
-	pos_bj[4] = 26;
-	pos_bj[5] = 76;
 
 	copyRectClip(pos_bj, drawSurface3, screenSurface);
 }

Modified: scummvm/trunk/engines/drascula/animation.cpp
===================================================================
--- scummvm/trunk/engines/drascula/animation.cpp	2008-06-08 02:02:06 UTC (rev 32608)
+++ scummvm/trunk/engines/drascula/animation.cpp	2008-06-08 03:09:21 UTC (rev 32609)
@@ -812,18 +812,11 @@
 }
 
 void DrasculaEngine::animation_14_2() {
-	int cabinPos[6];
+	int cabinPos[6] = { 150, 6, 69, -160, 158, 161 };
 	int l = 0;
 
 	loadPic("an14_2.alg", backSurface);
 
-	cabinPos[0] = 150;
-	cabinPos[1] = 6;
-	cabinPos[2] = 69;
-	cabinPos[3] = -160;
-	cabinPos[4] = 158;
-	cabinPos[5] = 161;
-
 	for (int n = -160; n <= 0; n = n + 5 + l) {
 		copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
 		updateRefresh_pre();

Modified: scummvm/trunk/engines/drascula/graphics.cpp
===================================================================
--- scummvm/trunk/engines/drascula/graphics.cpp	2008-06-08 02:02:06 UTC (rev 32608)
+++ scummvm/trunk/engines/drascula/graphics.cpp	2008-06-08 03:09:21 UTC (rev 32609)
@@ -58,8 +58,6 @@
 }
 
 void DrasculaEngine::moveCursor() {
-	int cursorPos[8];
-
 	copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
 
 	updateRefresh_pre();
@@ -78,25 +76,12 @@
 	else if (menuBar == 1)
 		clearMenu();
 
-	cursorPos[0] = 0;
-	cursorPos[1] = 0;
-	cursorPos[2] = mouseX - 20;
-	cursorPos[3] = mouseY - 17;
-	cursorPos[4] = OBJWIDTH;
-	cursorPos[5] = OBJHEIGHT;
+	int cursorPos[6] = { 0, 0, mouseX - 20, mouseY - 17, OBJWIDTH, OBJHEIGHT };
 	copyRectClip(cursorPos, drawSurface3, screenSurface);
 }
 
 void DrasculaEngine::setCursorTable() {
-	int cursorPos[8];
-
-	cursorPos[0] = 225;
-	cursorPos[1] = 56;
-	cursorPos[2] = mouseX - 20;
-	cursorPos[3] = mouseY - 12;
-	cursorPos[4] = 40;
-	cursorPos[5] = 25;
-
+	int cursorPos[6] = { 225, 56, mouseX - 20, mouseY - 12, 40, 25 };
 	copyRectClip(cursorPos, tableSurface, screenSurface);
 }
 
@@ -233,7 +218,6 @@
 }
 
 void DrasculaEngine::print_abc(const char *said, int screenX, int screenY) {
-	int textPos[8];
 	int letterY = 0, letterX = 0, i;
 	uint len = strlen(said);
 	byte c;
@@ -260,13 +244,7 @@
 			}	// if
 		}	// for
 
-		textPos[0] = letterX;
-		textPos[1] = letterY;
-		textPos[2] = screenX;
-		textPos[3] = screenY;
-		textPos[4] = CHAR_WIDTH;
-		textPos[5] = CHAR_HEIGHT;
-
+		int textPos[6] = { letterX, letterY, screenX, screenY, CHAR_WIDTH, CHAR_HEIGHT };
 		copyRectClip(textPos, textSurface, screenSurface);
 
 		screenX = screenX + CHAR_WIDTH;
@@ -278,7 +256,6 @@
 }
 
 void DrasculaEngine::print_abc_opc(const char *said, int screenX, int screenY, int game) {
-	int textPos[6];
 	int signY, letterY, letterX = 0;
 	uint len = strlen(said);
 
@@ -317,13 +294,7 @@
 			}	// if
 		}	// for
 
-		textPos[0] = letterX;
-		textPos[1] = letterY;
-		textPos[2] = screenX;
-		textPos[3] = screenY;
-		textPos[4] = CHAR_WIDTH_OPC;
-		textPos[5] = CHAR_HEIGHT_OPC;
-
+		int textPos[6] = { letterX, letterY, screenX, screenY, CHAR_WIDTH_OPC, CHAR_HEIGHT_OPC };
 		copyRectClip(textPos, backSurface, screenSurface);
 
 		screenX = screenX + CHAR_WIDTH_OPC;
@@ -555,48 +526,40 @@
 			mSession += 4;
 		}
 		if (CMP == kFrameCmpRle) {
+			BufferSSN = (byte *)malloc(Lengt);
 			if (!UsingMem) {
-				BufferSSN = (byte *)malloc(Lengt);
 				_arj.read(BufferSSN, Lengt);
 			} else {
-				BufferSSN = (byte *)malloc(Lengt);
 				memcpy(BufferSSN, mSession, Lengt);
 				mSession += Lengt;
 			}
 			Des_RLE(BufferSSN, MiVideoSSN);
 			free(BufferSSN);
-			if (FrameSSN) {
-				WaitFrameSSN();
-				MixVideo(VGA, MiVideoSSN);
-				_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
-			} else {
-				WaitFrameSSN();
+			WaitFrameSSN();
+			if (FrameSSN)
+				MixVideo(VGA, MiVideoSSN);			
+			else
 				memcpy(VGA, MiVideoSSN, 64000);
-				_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
-			}
+			_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
 			_system->updateScreen();
 			FrameSSN++;
 		} else {
 			if (CMP == kFrameCmpOff) {
+				BufferSSN = (byte *)malloc(Lengt);
 				if (!UsingMem) {
-					BufferSSN = (byte *)malloc(Lengt);
 					_arj.read(BufferSSN, Lengt);
 				} else {
-					BufferSSN = (byte *)malloc(Lengt);
 					memcpy(BufferSSN, mSession, Lengt);
 					mSession += Lengt;
 				}
 				Des_OFF(BufferSSN, MiVideoSSN, Lengt);
 				free(BufferSSN);
-				if (FrameSSN) {
-					WaitFrameSSN();
+				WaitFrameSSN();
+				if (FrameSSN)
 					MixVideo(VGA, MiVideoSSN);
-					_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
-				} else {
-					WaitFrameSSN();
+				else
 					memcpy(VGA, MiVideoSSN, 64000);
-					_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
-				}
+				_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
 				_system->updateScreen();
 				FrameSSN++;
 			}

Modified: scummvm/trunk/engines/drascula/talk.cpp
===================================================================
--- scummvm/trunk/engines/drascula/talk.cpp	2008-06-08 02:02:06 UTC (rev 32608)
+++ scummvm/trunk/engines/drascula/talk.cpp	2008-06-08 03:09:21 UTC (rev 32609)
@@ -575,7 +575,7 @@
 
 	byte *faceBuffer;
 	int p = 0;
-	int pos_blind[6];
+	int pos_blind[6] = { 0, 2, 73, 1, 126, 149 };
 	int length = strlen(said);
 
 	color_abc(kColorBrown);
@@ -585,12 +585,6 @@
 
 	talkInit(filename);
 
-	pos_blind[1] = 2;
-	pos_blind[2] = 73;
-	pos_blind[3] = 1;
-	pos_blind[4] = 126;
-	pos_blind[5] = 149;
-
 	do {
 		copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
 		pos_blind[5] = 149;


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