[Scummvm-git-logs] scummvm master -> 300e34d53520f56d9bc35595b46fcd613d2ec851

yinsimei roseline.yin at gmail.com
Thu Jul 20 08:02:49 CEST 2017


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:
aded7ce9e9 SLUDGE: Add game Out Of Order
7e95f7dc63 SLUDGE: Fix backdrop loading for images not of the window size
300e34d535 SLUDGE: Correct snapshot


Commit: aded7ce9e9cdfd8f6c2a24f712d860f3ac712f75
    https://github.com/scummvm/scummvm/commit/aded7ce9e9cdfd8f6c2a24f712d860f3ac712f75
Author: Simei Yin (roseline.yin at gmail.com)
Date: 2017-07-20T02:00:18+02:00

Commit Message:
SLUDGE: Add game Out Of Order

Changed paths:
    engines/sludge/detection.cpp
    engines/sludge/detection_tables.h


diff --git a/engines/sludge/detection.cpp b/engines/sludge/detection.cpp
index d6da811..0ab7814 100644
--- a/engines/sludge/detection.cpp
+++ b/engines/sludge/detection.cpp
@@ -48,6 +48,7 @@ static const PlainGameDescriptor sludgeGames[] = {
 	{ "welcome", "Welcome Example" },
 	{ "verbcoin", "Verb Coin" },
 	{ "robinsrescue", "Robin's Rescue" },
+	{ "outoforder", "Out Of Order" },
 	{ 0, 0 }
 };
 
diff --git a/engines/sludge/detection_tables.h b/engines/sludge/detection_tables.h
index b162533..7b422cb 100644
--- a/engines/sludge/detection_tables.h
+++ b/engines/sludge/detection_tables.h
@@ -75,6 +75,19 @@ static const SludgeGameDescription gameDescriptions[] = {
 		0
 	},
 
+	{
+		{
+			"outoforder",
+			"",
+			AD_ENTRY1s("gamedata", "4d72dbad0ff170169cd7e4e7e389a90d", 21122647),
+			Common::EN_ANY,
+			Common::kPlatformUnknown,
+			ADGF_NO_FLAGS,
+			GUIO0()
+		},
+		0
+	},
+
 	{ AD_TABLE_END_MARKER, 0 }
 };
 


Commit: 7e95f7dc635409152a86e2209e308f69a83c1889
    https://github.com/scummvm/scummvm/commit/7e95f7dc635409152a86e2209e308f69a83c1889
Author: Simei Yin (roseline.yin at gmail.com)
Date: 2017-07-20T02:00:18+02:00

Commit Message:
SLUDGE: Fix backdrop loading for images not of the window size

Changed paths:
    engines/sludge/backdrop.cpp
    engines/sludge/builtin.cpp
    engines/sludge/graphics.cpp
    engines/sludge/graphics.h
    engines/sludge/people.cpp
    engines/sludge/zbuffer.cpp


diff --git a/engines/sludge/backdrop.cpp b/engines/sludge/backdrop.cpp
index 5236ab3..8ef14b2 100644
--- a/engines/sludge/backdrop.cpp
+++ b/engines/sludge/backdrop.cpp
@@ -236,6 +236,7 @@ void GraphicsManager::killAllBackDrop() {
 }
 
 bool GraphicsManager::resizeBackdrop(int x, int y) {
+	debug(kSludgeDebugGraphics, "Load HSI");
 	_sceneWidth = x;
 	_sceneHeight = y;
 	return reserveBackdrop();
@@ -247,7 +248,7 @@ bool GraphicsManager::killResizeBackdrop(int x, int y) {
 }
 
 void GraphicsManager::loadBackDrop(int fileNum, int x, int y) {
-	debug(kSludgeDebugGraphics, "Load back drop");
+	debug(kSludgeDebugGraphics, "Load back drop of num %i at position %i, %i", fileNum, x, y);
 	setResourceForFatal(fileNum);
 	if (!g_sludge->_resMan->openFileFromNum(fileNum)) {
 		fatal("Can't load overlay image");
@@ -262,14 +263,14 @@ void GraphicsManager::loadBackDrop(int fileNum, int x, int y) {
 	g_sludge->_resMan->finishAccess();
 	setResourceForFatal(-1);
 
-	// set zBuffer if it's not set
-	if (_zBufferToSet >= 0) {
-		setZBuffer(_zBufferToSet);
-		_zBufferToSet = -1;
+	// reset zBuffer
+	if (_zBuffer->originalNum >= 0) {
+		setZBuffer(_zBuffer->originalNum);
 	}
 }
 
 void GraphicsManager::mixBackDrop(int fileNum, int x, int y) {
+	debug(kSludgeDebugGraphics, "Mix back drop of num %i at position %i, %i", fileNum, x, y);
 	setResourceForFatal(fileNum);
 	if (!g_sludge->_resMan->openFileFromNum(fileNum)) {
 		fatal("Can't load overlay image");
@@ -285,9 +286,9 @@ void GraphicsManager::mixBackDrop(int fileNum, int x, int y) {
 }
 
 void GraphicsManager::blankScreen(int x1, int y1, int x2, int y2) {
-	// in case of no backdrop added at all
+	// in case of no backdrop added at all, create it
 	if (!_backdropSurface.getPixels()) {
-		return;
+		_backdropSurface.create(_winWidth, _winHeight, _renderSurface.format);
 	}
 
 	if (y1 < 0)
@@ -410,11 +411,13 @@ bool GraphicsManager::loadHSI(Common::SeekableReadStream *stream, int x, int y,
 		killAllBackDrop(); // kill all
 	}
 
-	if (!ImgLoader::loadImage(stream, &_backdropSurface, (int)reserve))
+	Graphics::Surface tmp;
+
+	if (!ImgLoader::loadImage(stream, &tmp, (int)reserve))
 		return false;
 
-	uint realPicWidth = _backdropSurface.w;
-	uint realPicHeight = _backdropSurface.h;
+	uint realPicWidth = tmp.w;
+	uint realPicHeight = tmp.h;
 
 	// resize backdrop
 	if (reserve) {
@@ -431,6 +434,10 @@ bool GraphicsManager::loadHSI(Common::SeekableReadStream *stream, int x, int y,
 		return false;
 	}
 
+	// copy surface loaded to backdrop
+	_backdropSurface.copyRectToSurface(tmp.getPixels(), tmp.pitch, x, y, tmp.w, tmp.h);
+	tmp.free();
+
 	_origBackdropSurface.copyFrom(_backdropSurface);
 	_backdropExists = true;
 
diff --git a/engines/sludge/builtin.cpp b/engines/sludge/builtin.cpp
index 61ee353..63568d0 100644
--- a/engines/sludge/builtin.cpp
+++ b/engines/sludge/builtin.cpp
@@ -77,7 +77,6 @@ extern float speechSpeed;
 extern byte brightnessLevel;
 extern byte fadeMode;
 extern uint16 saveEncoding;
-extern byte currentBurnR, currentBurnG, currentBurnB;
 
 int paramNum[] = { -1, 0, 1, 1, -1, -1, 1, 3, 4, 1, 0, 0, 8, -1,    // SAY->MOVEMOUSE
                    -1, 0, 0, -1, -1, 1, 1, 1, 1, 4, 1, 1, 2, 1,// FOCUS->REMOVEREGION
diff --git a/engines/sludge/graphics.cpp b/engines/sludge/graphics.cpp
index 81e8ed2..e139e52 100644
--- a/engines/sludge/graphics.cpp
+++ b/engines/sludge/graphics.cpp
@@ -64,8 +64,8 @@ GraphicsManager::GraphicsManager(SludgeEngine *vm) {
 	_spriteLayers->numLayers = 0;
 
 	// ZBuffer
-	_zBufferToSet = -1;
 	_zBuffer = new ZBufferData;
+	_zBuffer->originalNum = -1;
 	_zBuffer->sprites = nullptr;
 
 	// Colors
diff --git a/engines/sludge/graphics.h b/engines/sludge/graphics.h
index 024c8ca..df8fa69 100644
--- a/engines/sludge/graphics.h
+++ b/engines/sludge/graphics.h
@@ -110,7 +110,7 @@ public:
 
 	// Screen
 	int getCenterX(int width) { return (_winWidth - width) >> 1; }
-	int checkSizeValide(int width, int height) { return ((width >= 0) && (height >= 0) && (width < (int)_winWidth) && (height > (int)_winHeight)); }
+	int checkSizeValide(int width, int height) { return ((width >= 0) && (height >= 0) && (width < (int)_winWidth) && (height < (int)_winHeight)); }
 
 	// Freeze
 	bool freeze();
@@ -194,7 +194,6 @@ private:
 	uint32 getDrawColor(onScreenPerson *thisPerson);
 
 	// ZBuffer
-	int _zBufferToSet;
 	ZBufferData *_zBuffer;
 	void sortZPal(int *oldpal, int *newpal, int size);
 
diff --git a/engines/sludge/people.cpp b/engines/sludge/people.cpp
index 6469681..e0941a0 100644
--- a/engines/sludge/people.cpp
+++ b/engines/sludge/people.cpp
@@ -838,6 +838,7 @@ bool addPerson(int x, int y, int objNum, persona *p) {
 	newPerson->colourmix = 0;
 	newPerson->transparency = 0;
 	newPerson->myPersona = p;
+	newPerson->lastUsedAnim = 0;
 
 	setFrames(*newPerson, ANI_STAND);
 
diff --git a/engines/sludge/zbuffer.cpp b/engines/sludge/zbuffer.cpp
index 5b6235a..a62c5ef 100644
--- a/engines/sludge/zbuffer.cpp
+++ b/engines/sludge/zbuffer.cpp
@@ -44,7 +44,7 @@ void GraphicsManager::killZBuffer() {
 		_zBuffer->sprites = nullptr;
 	}
 	_zBuffer->numPanels = 0;
-	_zBuffer->originalNum = 0;
+	_zBuffer->originalNum = -1;
 }
 
 void GraphicsManager::sortZPal(int *oldpal, int *newpal, int size) {
@@ -71,7 +71,7 @@ bool GraphicsManager::setZBuffer(int num) {
 	// if the backdrop has not been set yet
 	// set zbuffer later
 	if (!_backdropSurface.getPixels()) {
-		_zBufferToSet = num;
+		_zBuffer->originalNum = num;
 		return true;
 	}
 


Commit: 300e34d53520f56d9bc35595b46fcd613d2ec851
    https://github.com/scummvm/scummvm/commit/300e34d53520f56d9bc35595b46fcd613d2ec851
Author: Simei Yin (roseline.yin at gmail.com)
Date: 2017-07-20T02:48:21+02:00

Commit Message:
SLUDGE: Correct snapshot

Changed paths:
    engines/sludge/backdrop.cpp


diff --git a/engines/sludge/backdrop.cpp b/engines/sludge/backdrop.cpp
index 8ef14b2..b1c9e5f 100644
--- a/engines/sludge/backdrop.cpp
+++ b/engines/sludge/backdrop.cpp
@@ -184,13 +184,13 @@ bool GraphicsManager::snapshot() {
 	if (!freeze())
 		return false;
 
-	// draw snapshot to backdrop
+	// draw snapshot to rendersurface
 	displayBase();
 	viewSpeech(); // ...and anything being said
 	drawStatusBar();
 
 	// copy backdrop to snapshot
-	_snapshotSurface.copyFrom(_backdropSurface);
+	_snapshotSurface.copyFrom(_renderSurface);
 
 	unfreeze(false);
 	return true;





More information about the Scummvm-git-logs mailing list