[Scummvm-git-logs] scummvm master -> 374d46e0a8ef276f66951bfa891ade5ab4ec360e

yuv422 noreply at scummvm.org
Thu Nov 21 21:44:51 UTC 2024


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

Summary:
a76f5ccdbf DARKSEED: Clip sprites to game window.
374d46e0a8 DARKSEED: Flush config to disk when toggling mute from in-game menu.


Commit: a76f5ccdbfc89488e7a94b6765fbe1e3a70e0870
    https://github.com/scummvm/scummvm/commit/a76f5ccdbfc89488e7a94b6765fbe1e3a70e0870
Author: Eric Fry (yuv422 at reversedgames.com)
Date: 2024-11-22T08:43:19+11:00

Commit Message:
DARKSEED: Clip sprites to game window.

Changed paths:
    engines/darkseed/nsp.cpp


diff --git a/engines/darkseed/nsp.cpp b/engines/darkseed/nsp.cpp
index 8fea18b1a0b..f7dc5b59252 100644
--- a/engines/darkseed/nsp.cpp
+++ b/engines/darkseed/nsp.cpp
@@ -61,6 +61,9 @@ void Sprite::clipToScreen(int x, int y, uint16 frameBottom, uint16 *clippedWidth
 	if (x + _width > g_engine->_screen->w) {
 		*clippedWidth = g_engine->_screen->w - x;
 	}
+	if (x + _width > 569) {
+		*clippedWidth = 569 - x;
+	}
 	if (frameBottom != 0 && y + _height > g_engine->_frameBottom) {
 		if (y >= frameBottom) {
 			return;
@@ -73,7 +76,19 @@ void Sprite::draw(int x, int y, uint16 frameBottom) const {
 	uint16 clippedWidth = _width;
 	uint16 clippedHeight = _height;
 	clipToScreen(x, y, frameBottom, &clippedWidth, &clippedHeight);
-	g_engine->_screen->copyRectToSurfaceWithKey(_pixels.data(), _pitch, x, y, clippedWidth, clippedHeight, 0xf);
+
+	// clip to left side of frame.
+	if (x + _width <= 70) {
+		return;
+	}
+	int dX = 0;
+	if (x < 70) {
+		dX = 70 - x;
+		x = 70;
+		clippedWidth -= dX;
+	}
+	const uint8  *pixels = _pixels.data() + dX;
+	g_engine->_screen->copyRectToSurfaceWithKey(pixels, _pitch, x, y, clippedWidth, clippedHeight, 0xf);
 }
 
 void Sprite::draw(Graphics::Surface *dst, int x, int y, uint16 frameBottom) const {
@@ -122,7 +137,7 @@ void Sprite::drawScaled(int destX, int destY, int destWidth, int destHeight, boo
 		int xi = flipX ? xs : xs * clipX;
 		const byte *wsrc = hsrc + ((xi + 0x8000) >> 16);
 		for (int xc = 0; xc < destWidth; ++xc) {
-			if (currX >= 69 && currX < destSurface->w) { // clip to game window. TODO pass clip rect into method.
+			if (currX > 69 && currX < destSurface->w) { // clip to game window. TODO pass clip rect into method.
 				byte colorIndex = *wsrc;
 				//				uint16 c = READ_LE_UINT16(&palette[colorIndex * 2]);
 				if (colorIndex != 0xf) {


Commit: 374d46e0a8ef276f66951bfa891ade5ab4ec360e
    https://github.com/scummvm/scummvm/commit/374d46e0a8ef276f66951bfa891ade5ab4ec360e
Author: Eric Fry (yuv422 at reversedgames.com)
Date: 2024-11-22T08:43:19+11:00

Commit Message:
DARKSEED: Flush config to disk when toggling mute from in-game menu.

Changed paths:
    engines/darkseed/menu.cpp


diff --git a/engines/darkseed/menu.cpp b/engines/darkseed/menu.cpp
index 475b155ee61..a67db4af150 100644
--- a/engines/darkseed/menu.cpp
+++ b/engines/darkseed/menu.cpp
@@ -20,6 +20,7 @@
 */
 
 #include "common/keyboard.h"
+#include "common/config-manager.h"
 #include "darkseed/menu.h"
 #include "darkseed/darkseed.h"
 
@@ -99,6 +100,7 @@ void loadMenu() {
 		}
 		if (menuItemIdx == 2) { // sound settings
 			g_engine->flipMute();
+			ConfMan.flushToDisk();
 			drawSoundMenuItem();
 		}
 		if (menuItemIdx == 3) { // Resume




More information about the Scummvm-git-logs mailing list