[Scummvm-cvs-logs] scummvm master -> 0e00c2b41c9862c0ec9eb4e211b693e67acf449d

criezy criezy at scummvm.org
Sat Apr 16 20:05:25 CEST 2016


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
eef8371432 DRASCULA: Swap extraSurface and tableSurface use in chapter 6 for Spanish version
6dcaef191c DRASCULA: Fix animations speed
0e00c2b41c NEWS: Add fix for Drascula animations speed


Commit: eef83714322b98fbe02249478ad66b88fd4c1fe2
    https://github.com/scummvm/scummvm/commit/eef83714322b98fbe02249478ad66b88fd4c1fe2
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2016-04-16T18:59:27+01:00

Commit Message:
DRASCULA: Swap extraSurface and tableSurface use in chapter 6 for Spanish version

This simplifies the code and bring it closer to the original source code.
This should help if we need to debug issues in the future.

Changed paths:
    engines/drascula/actors.cpp
    engines/drascula/animation.cpp
    engines/drascula/drascula.cpp
    engines/drascula/graphics.cpp
    engines/drascula/interface.cpp
    engines/drascula/rooms.cpp
    engines/drascula/sound.cpp
    engines/drascula/talk.cpp



diff --git a/engines/drascula/actors.cpp b/engines/drascula/actors.cpp
index a1f2c53..b459c45 100644
--- a/engines/drascula/actors.cpp
+++ b/engines/drascula/actors.cpp
@@ -196,10 +196,6 @@ void DrasculaEngine::moveCharacters() {
 			return;
 		}
 	}
-	
-	byte *srcSurface = extraSurface;
-	if (currentChapter == 6 && _lang == kSpanish)
-		srcSurface = tableSurface;
 
 	if (characterMoved == 0) {
 		curPos[0] = 0;
@@ -218,17 +214,17 @@ void DrasculaEngine::moveCharacters() {
 			curPos[1] = 0;
 			if (currentChapter == 2)
 				copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
-						 srcSurface, screenSurface);
+						 extraSurface, screenSurface);
 			else
 				reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
-									factor_red[curY + curHeight], srcSurface, screenSurface);
+									factor_red[curY + curHeight], extraSurface, screenSurface);
 		} else if (trackProtagonist == 1) {
 			if (currentChapter == 2)
 				copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
-						 srcSurface, screenSurface);
+						 extraSurface, screenSurface);
 			else
 				reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
-									factor_red[curY + curHeight], srcSurface, screenSurface);
+									factor_red[curY + curHeight], extraSurface, screenSurface);
 		} else if (trackProtagonist == 2) {
 			if (currentChapter == 2)
 				copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
@@ -260,17 +256,17 @@ void DrasculaEngine::moveCharacters() {
 			curPos[1] = 0;
 			if (currentChapter == 2)
 				copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
-						 srcSurface, screenSurface);
+						 extraSurface, screenSurface);
 			else
 				reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
-									factor_red[curY + curHeight], srcSurface, screenSurface);
+									factor_red[curY + curHeight], extraSurface, screenSurface);
 		} else if (trackProtagonist == 1) {
 			if (currentChapter == 2)
 				copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
-						 srcSurface, screenSurface);
+						 extraSurface, screenSurface);
 			else
 				reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
-									factor_red[curY + curHeight], srcSurface, screenSurface);
+									factor_red[curY + curHeight], extraSurface, screenSurface);
 		} else if (trackProtagonist == 2) {
 			if (currentChapter == 2)
 				copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp
index 0ed2c61..f672ad3 100644
--- a/engines/drascula/animation.cpp
+++ b/engines/drascula/animation.cpp
@@ -1612,7 +1612,7 @@ void DrasculaEngine::animation_6_6() {
 	removeObject(20);
 	loadPic(96, frontSurface);
 	loadPic(97, frontSurface);
-	loadPic(97, _lang == kSpanish ? tableSurface : extraSurface);
+	loadPic(97, extraSurface);
 	loadPic(99, backSurface);
 	doBreak = 1;
 	objExit = 104;
@@ -2216,7 +2216,7 @@ void DrasculaEngine::activatePendulum() {
 	_roomNumber = 102;
 	loadPic(102, bgSurface, HALF_PAL);
 	loadPic("an_p1.alg", drawSurface3);
-	loadPic("an_p2.alg", _lang == kSpanish ? tableSurface : extraSurface);
+	loadPic("an_p2.alg", extraSurface);
 	loadPic("an_p3.alg", frontSurface);
 
 	copyBackground(0, 171, 0, 0, OBJWIDTH, OBJHEIGHT, backSurface, drawSurface3);
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 75a81c2..f20f020 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -359,16 +359,13 @@ Common::Error DrasculaEngine::run() {
 		for (i = 0; i < 25; i++)
 			memcpy(crosshairCursor + i * 40, tableSurface + 225 + (56 + i) * 320, 40);
 
-		if (_lang == kSpanish)
-			loadPic(currentChapter == 6 ? 97 : 974, tableSurface);
+		if (_lang == kSpanish && currentChapter != 6)
+			loadPic(974, tableSurface);
 
 		if (currentChapter != 2) {
 			loadPic(99, cursorSurface);
 			loadPic(99, backSurface);
-			if (currentChapter == 6 && _lang == kSpanish)
-				loadPic(95, extraSurface);
-			else
-				loadPic(97, extraSurface);
+			loadPic(97, extraSurface);
 		}
 
 		memset(iconName, 0, sizeof(iconName));
diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp
index 01bd267..6bfb2e1 100644
--- a/engines/drascula/graphics.cpp
+++ b/engines/drascula/graphics.cpp
@@ -217,6 +217,10 @@ void DrasculaEngine::print_abc(const char *said, int screenX, int screenY) {
 	int letterY = 0, letterX = 0, i;
 	uint len = strlen(said);
 	byte c;
+	
+	byte *srcSurface = tableSurface;
+	if (_lang == kSpanish && currentChapter == 6)
+		srcSurface = extraSurface;
 
 	for (uint h = 0; h < len; h++) {
 		c = toupper(said[h]);
@@ -241,7 +245,7 @@ void DrasculaEngine::print_abc(const char *said, int screenX, int screenY) {
 		}	// for
 
 		copyRect(letterX, letterY, screenX, screenY,
-				 CHAR_WIDTH, CHAR_HEIGHT, tableSurface, screenSurface);
+				 CHAR_WIDTH, CHAR_HEIGHT, srcSurface, screenSurface);
 
 		screenX = screenX + CHAR_WIDTH;
 		if (screenX > 317) {
diff --git a/engines/drascula/interface.cpp b/engines/drascula/interface.cpp
index a09b9da..07f192c 100644
--- a/engines/drascula/interface.cpp
+++ b/engines/drascula/interface.cpp
@@ -123,15 +123,6 @@ void DrasculaEngine::showMenu() {
 	int h, n, x;
 	byte *srcSurface = (currentChapter == 6) ? tableSurface : frontSurface;
 	x = whichObject();
-	
-	// The original uses extraSurface to draw text in draw_abc() in the Spanish version
-	// while other languages use tableSurface. Here all language use tableSurface for
-	// chapter 6. However the code in ScummVM was changed to use tableSurface for all
-	// labguage in draw_abc(). So instead here for the Spanish version we use extraSurface.
-	// Compared to the original the use of the tableSurface and extraSurface has been swapped
-	// for the Spanish language all through chapter 6.
-	if (currentChapter == 6 && _lang == kSpanish)
-		srcSurface = extraSurface;
 
 	for (n = 1; n < ARRAYSIZE(inventoryObjects); n++) {
 		h = inventoryObjects[n];
diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp
index acfc528..57d4517 100644
--- a/engines/drascula/rooms.cpp
+++ b/engines/drascula/rooms.cpp
@@ -1501,7 +1501,7 @@ void DrasculaEngine::update_102() {
 	if (actorFrames[kFramePendulum] <= 4)
 		pendulumSurface = drawSurface3;
 	else if (actorFrames[kFramePendulum] <= 11)
-		pendulumSurface = _lang == kSpanish ? tableSurface : extraSurface;
+		pendulumSurface = extraSurface;
 	else
 		pendulumSurface = frontSurface;
 
diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp
index 6c0c171..204a6f2 100644
--- a/engines/drascula/sound.cpp
+++ b/engines/drascula/sound.cpp
@@ -44,13 +44,10 @@ void DrasculaEngine::updateVolume(Audio::Mixer::SoundType soundType, int prevVol
 }
 
 void DrasculaEngine::volumeControls() {
-	byte* srcSurface = tableSurface;
-	if (currentChapter == 6 && _lang == kSpanish)
-		srcSurface = extraSurface;
-	if (_lang == kSpanish)
-		loadPic(95, srcSurface);
+	if (_lang == kSpanish && currentChapter != 6)
+		loadPic(95, tableSurface);
 
-	copyRect(1, 56, 73, 63, 177, 97, srcSurface, screenSurface);
+	copyRect(1, 56, 73, 63, 177, 97, tableSurface, screenSurface);
 	updateScreen(73, 63, 73, 63, 177, 97, screenSurface);
 
 	setCursor(kCursorCrosshair);
@@ -67,11 +64,11 @@ void DrasculaEngine::volumeControls() {
 
 		updateRoom();
 
-		copyRect(1, 56, 73, 63, 177, 97, srcSurface, screenSurface);
+		copyRect(1, 56, 73, 63, 177, 97, tableSurface, screenSurface);
 
-		copyBackground(183, 56, 82, masterVolumeY, 39, 2 + masterVolume * 4, srcSurface, screenSurface);
-		copyBackground(183, 56, 138, voiceVolumeY, 39, 2 + voiceVolume * 4, srcSurface, screenSurface);
-		copyBackground(183, 56, 194, musicVolumeY, 39, 2 + musicVolume * 4, srcSurface, screenSurface);
+		copyBackground(183, 56, 82, masterVolumeY, 39, 2 + masterVolume * 4, tableSurface, screenSurface);
+		copyBackground(183, 56, 138, voiceVolumeY, 39, 2 + voiceVolume * 4, tableSurface, screenSurface);
+		copyBackground(183, 56, 194, musicVolumeY, 39, 2 + musicVolume * 4, tableSurface, screenSurface);
 
 		updateScreen();
 
@@ -104,8 +101,8 @@ void DrasculaEngine::volumeControls() {
 
 	}
 
-	if (_lang == kSpanish)
-		loadPic(currentChapter == 6 ? 95 : 974, srcSurface);
+	if (_lang == kSpanish && currentChapter != 6)
+		loadPic(974, tableSurface);
 
 	selectVerb(kVerbNone);
 
diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp
index 3176c5e..cc329b2 100644
--- a/engines/drascula/talk.cpp
+++ b/engines/drascula/talk.cpp
@@ -440,12 +440,9 @@ void DrasculaEngine::talk(const char *said, const char *filename) {
 				copyRect(x_talk_izq[face], y_mask_talk, curX + 8, curY - 1, TALK_WIDTH, TALK_HEIGHT,
 						extraSurface, screenSurface);
 			else if (notTowers) {
-				byte *srcSurface = extraSurface;
-				if (currentChapter == 6 && _lang == kSpanish)
-					srcSurface = tableSurface;
 				reduce_hare_chico(x_talk_izq[face], y_mask_talk, curX + (int)((8.0f / 100) * factor_red[MIN(201, curY + curHeight)]),
 					curY, TALK_WIDTH, TALK_HEIGHT, factor_red[MIN(201, curY + curHeight)],
-					srcSurface, screenSurface);
+					extraSurface, screenSurface);
 			}
 			updateRefresh();
 		} else if (trackProtagonist == 1) {
@@ -453,11 +450,8 @@ void DrasculaEngine::talk(const char *said, const char *filename) {
 				copyRect(x_talk_dch[face], y_mask_talk, curX + 12, curY, TALK_WIDTH, TALK_HEIGHT,
 					extraSurface, screenSurface);
 			else if (notTowers) {
-				byte *srcSurface = extraSurface;
-				if (currentChapter == 6 && _lang == kSpanish)
-					srcSurface = tableSurface;
 				reduce_hare_chico(x_talk_dch[face], y_mask_talk, curX + (int)((12.0f / 100) * factor_red[MIN(201, curY + curHeight)]),
-					curY, TALK_WIDTH, TALK_HEIGHT, factor_red[MIN(201, curY + curHeight)], srcSurface, screenSurface);
+					curY, TALK_WIDTH, TALK_HEIGHT, factor_red[MIN(201, curY + curHeight)], extraSurface, screenSurface);
 			}
 			updateRefresh();
 		} else if (trackProtagonist == 2) {


Commit: 6dcaef191cfd421f7909da0b2432b64f7d4a6440
    https://github.com/scummvm/scummvm/commit/6dcaef191cfd421f7909da0b2432b64f7d4a6440
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2016-04-16T18:59:27+01:00

Commit Message:
DRASCULA: Fix animations speed

To time animations the original engine uses interrupt to get the
Real Time Clock and divides the number of clock ticks by 0.182.
Since there is approximately 18.2 ticks per second, this means
it uses values in 1/100th of a second. In ScummVM we were using
getMillis() / 20, so the animations was two times slower than in
the original.

This might fix bug #7115 Drascula: FPS are incorrect or some
frames are dropped.

Note that for the walk animation we are still not exactly using the
timing of the original. The original engines keeps each walk frames
for 5.7 times 1/100th of a second (i.e. 17.54 FPS). In ScummVM
getTime returns an integer value and as a result each walk frame is
now kept for 6 times 1/100th of a second (i.e. 16.67 FPS, which i
 better than the 8.33 FPS we were getting before this commit).

 as our getTime returns integer values and thus we use
frames for 6 of 1/100th of a second while the original is slightly
faster as it kept frames for 5.7 times 1/100th of a second.

Changed paths:
    engines/drascula/drascula.cpp



diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index f20f020..d7b1fd6 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -891,7 +891,7 @@ void DrasculaEngine::pause(int duration) {
 }
 
 int DrasculaEngine::getTime() {
-	return _system->getMillis() / 20; // originally was 1
+	return _system->getMillis() / 10;
 }
 
 void DrasculaEngine::reduce_hare_chico(int xx1, int yy1, int xx2, int yy2, int width, int height, int factor, byte *dir_inicio, byte *dir_fin) {


Commit: 0e00c2b41c9862c0ec9eb4e211b693e67acf449d
    https://github.com/scummvm/scummvm/commit/0e00c2b41c9862c0ec9eb4e211b693e67acf449d
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2016-04-16T19:04:43+01:00

Commit Message:
NEWS: Add fix for Drascula animations speed

Changed paths:
    NEWS



diff --git a/NEWS b/NEWS
index 3bbea89..e6afb1c 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,8 @@ For a more comprehensive changelog of the latest experimental code, see:
    - Fixed loading savegames in the Pendulum scene.
    - Fixed wrong background for inventory items during chapter 6 in the
      Spanish version.
+   - Fixed animations speed (they were running two times slower than in the
+     original engine).
 
  Gob:
    - Fixed lock up for some games during sound initialization.






More information about the Scummvm-git-logs mailing list