[Scummvm-git-logs] scummvm master -> c4c40d8a8b80c176905f38b0d2407ab5e0bbf8f3

neuromancer noreply at scummvm.org
Mon Jul 14 18:18:51 UTC 2025


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

Summary:
e4847b5d82 FREESCAPE: implement vertical compass for some dark releases
6d39382397 FREESCAPE: fixed extra color handling in castle for dos
c4c40d8a8b FREESCAPE: implemented horizontal compass for some releases of dark


Commit: e4847b5d8241e22c8f22496360167bffd011d26f
    https://github.com/scummvm/scummvm/commit/e4847b5d8241e22c8f22496360167bffd011d26f
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2025-07-14T17:42:58+02:00

Commit Message:
FREESCAPE: implement vertical compass for some dark releases

Changed paths:
    engines/freescape/freescape.cpp
    engines/freescape/games/dark/c64.cpp
    engines/freescape/games/dark/cpc.cpp
    engines/freescape/games/dark/dark.cpp
    engines/freescape/games/dark/dark.h
    engines/freescape/games/dark/dos.cpp
    engines/freescape/games/dark/zx.cpp


diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index b64a8a6e435..c81f9d677d5 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -995,10 +995,18 @@ void FreescapeEngine::rotate(float xoffset, float yoffset, float zoffset) {
 	_roll += zoffset;
 
 	// Make sure that when pitch is out of bounds, screen doesn't get flipped
-	if (_pitch > 360.0f)
-		_pitch -= 360.0f;
-	if (_pitch < 0.0f)
-		_pitch += 360.0f;
+	if (!isDriller()) {
+		if (_pitch > 90.0f)
+			_pitch = 90.0f;
+		else if (_pitch < -89.9f)
+			_pitch = -89.9f;
+	} else {
+		// Driller allowed to rotate pitch up to 360 degrees
+		if (_pitch > 360.0f)
+			_pitch -= 360.0f;
+		if (_pitch < 0.0f)
+			_pitch += 360.0f;
+	}
 
 	if (_yaw > 360.0f)
 		_yaw -= 360.0f;
diff --git a/engines/freescape/games/dark/c64.cpp b/engines/freescape/games/dark/c64.cpp
index ad8e3c64d59..729f8294cd4 100644
--- a/engines/freescape/games/dark/c64.cpp
+++ b/engines/freescape/games/dark/c64.cpp
@@ -243,6 +243,7 @@ void DarkEngine::drawC64UI(Graphics::Surface *surface) {
 			surface->drawLine(64, 147 + 8, 127 - (_maxEnergy - energy) - 1, 155, lineColor);
 	}
 	drawBinaryClock(surface, 304, 124, front, back);
+	drawVerticalCompass(surface, 17, 77, _pitch, front);
 }
 
 } // End of namespace Freescape
\ No newline at end of file
diff --git a/engines/freescape/games/dark/cpc.cpp b/engines/freescape/games/dark/cpc.cpp
index 8126abbfb7b..7f2c85c57e5 100644
--- a/engines/freescape/games/dark/cpc.cpp
+++ b/engines/freescape/games/dark/cpc.cpp
@@ -162,6 +162,7 @@ void DarkEngine::drawCPCUI(Graphics::Surface *surface) {
 	}
 	drawBinaryClock(surface, 300, 124, front, back);
 	drawIndicator(surface, 160, 136);
+	drawVerticalCompass(surface, 24, 76, _pitch, front);
 }
 
 } // End of namespace Freescape
diff --git a/engines/freescape/games/dark/dark.cpp b/engines/freescape/games/dark/dark.cpp
index 3fa8e20b428..934e895a975 100644
--- a/engines/freescape/games/dark/dark.cpp
+++ b/engines/freescape/games/dark/dark.cpp
@@ -818,6 +818,24 @@ void DarkEngine::drawBinaryClock(Graphics::Surface *surface, int xPosition, int
 	}
 }
 
+void DarkEngine::drawVerticalCompass(Graphics::Surface *surface, int x, int y, float angle, uint32 color) {
+	int pitch = int(angle / 1.65);
+	Common::Array<int> xpoints;
+	Common::Array<int> ypoints;
+
+	xpoints.push_back(x);
+	xpoints.push_back(x + 3);
+	xpoints.push_back(x + 3);
+	xpoints.push_back(x);
+
+	ypoints.push_back(y - pitch);
+	ypoints.push_back(y + 3 - pitch);
+	ypoints.push_back(y - 4 - pitch);
+	ypoints.push_back(y - pitch);
+
+	surface->drawPolygonScan(xpoints.data(), ypoints.data(), 4, Common::Rect(0, 0, surface->w, surface->h), color);
+}
+
 void DarkEngine::drawIndicator(Graphics::Surface *surface, int xPosition, int yPosition) {
 	if (_indicators.size() == 0)
 		return;
diff --git a/engines/freescape/games/dark/dark.h b/engines/freescape/games/dark/dark.h
index 27b5788d896..cb0a9f948d8 100644
--- a/engines/freescape/games/dark/dark.h
+++ b/engines/freescape/games/dark/dark.h
@@ -118,6 +118,7 @@ private:
 	bool tryDestroyECD(int index);
 	bool tryDestroyECDFullGame(int index);
 	void addWalls(Area *area);
+	void drawVerticalCompass(Graphics::Surface *surface, int x, int y, float angle, uint32 color);
 };
 
 }
diff --git a/engines/freescape/games/dark/dos.cpp b/engines/freescape/games/dark/dos.cpp
index 425e8fed152..f2a71652ebe 100644
--- a/engines/freescape/games/dark/dos.cpp
+++ b/engines/freescape/games/dark/dos.cpp
@@ -242,6 +242,7 @@ void DarkEngine::drawDOSUI(Graphics::Surface *surface) {
 	uint32 clockColor = _renderMode == Common::kRenderCGA ? front : _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0xFF);
 	drawBinaryClock(surface, 300, 124, clockColor, back);
 	drawIndicator(surface, 160, 136);
+	drawVerticalCompass(surface, 24, 76, _pitch, blue);
 }
 
 } // End of namespace Freescape
diff --git a/engines/freescape/games/dark/zx.cpp b/engines/freescape/games/dark/zx.cpp
index d526b2a606a..ce10504bf78 100644
--- a/engines/freescape/games/dark/zx.cpp
+++ b/engines/freescape/games/dark/zx.cpp
@@ -191,6 +191,7 @@ void DarkEngine::drawZXUI(Graphics::Surface *surface) {
 	uint32 clockColor = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0x00, 0x00);
 	drawBinaryClock(surface, 273, 128, clockColor, back);
 	drawIndicator(surface, 152, 140);
+	drawVerticalCompass(surface, 47, 79, _pitch, front);
 }
 
 } // End of namespace Freescape


Commit: 6d393823973df806c0180e4156e1645f64c9bb29
    https://github.com/scummvm/scummvm/commit/6d393823973df806c0180e4156e1645f64c9bb29
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2025-07-14T17:42:58+02:00

Commit Message:
FREESCAPE: fixed extra color handling in castle for dos

Changed paths:
    engines/freescape/games/castle/castle.cpp


diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index bb461be5a60..64f077e926c 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -351,8 +351,8 @@ void CastleEngine::gotoArea(uint16 areaID, int entranceID) {
 
 	swapPalette(areaID);
 	if (isDOS()) {
-		_gfx->_colorPair[_currentArea->_underFireBackgroundColor] = _currentArea->_extraColor[0];
-		_gfx->_colorPair[_currentArea->_usualBackgroundColor] = _currentArea->_extraColor[1];
+		_gfx->_colorPair[_currentArea->_underFireBackgroundColor] = _currentArea->_extraColor[1];
+		_gfx->_colorPair[_currentArea->_usualBackgroundColor] = _currentArea->_extraColor[0];
 		_gfx->_colorPair[_currentArea->_paperColor] = _currentArea->_extraColor[2];
 		_gfx->_colorPair[_currentArea->_inkColor] = _currentArea->_extraColor[3];
 	} else if (isAmiga()) {


Commit: c4c40d8a8b80c176905f38b0d2407ab5e0bbf8f3
    https://github.com/scummvm/scummvm/commit/c4c40d8a8b80c176905f38b0d2407ab5e0bbf8f3
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2025-07-14T17:42:59+02:00

Commit Message:
FREESCAPE: implemented horizontal compass for some releases of dark

Changed paths:
    engines/freescape/font.cpp
    engines/freescape/games/dark/cpc.cpp
    engines/freescape/games/dark/dark.cpp
    engines/freescape/games/dark/dark.h
    engines/freescape/games/dark/dos.cpp
    engines/freescape/games/dark/zx.cpp


diff --git a/engines/freescape/font.cpp b/engines/freescape/font.cpp
index dbb9b3dc0fd..d83ac3b5980 100644
--- a/engines/freescape/font.cpp
+++ b/engines/freescape/font.cpp
@@ -103,6 +103,15 @@ void Font::drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 col
 	assert(chr >= 32);
 	chr -= 32;
 
+	// Check if the character drawing is completely contained in the surface
+	// Make sure you use the correct width for the character
+	int height = getCharWidth(chr);
+	int width = getCharWidth(chr);
+	if (x < 0 || y < 0 || x + width > dst->w || y + height > dst->h) {
+		//warning("drawChar: Character %d (%c) is out of bounds at (%d, %d)", chr + 32, char(chr + 32), x, y);
+		return;
+	}
+
 	Graphics::ManagedSurface surface = Graphics::ManagedSurface();
 	surface.copyFrom(*_chars[chr]);
 
diff --git a/engines/freescape/games/dark/cpc.cpp b/engines/freescape/games/dark/cpc.cpp
index 7f2c85c57e5..8cae0c940c0 100644
--- a/engines/freescape/games/dark/cpc.cpp
+++ b/engines/freescape/games/dark/cpc.cpp
@@ -113,6 +113,9 @@ void DarkEngine::drawCPCUI(Graphics::Surface *surface) {
 	_gfx->readFromPalette(color, r, g, b);
 	uint32 back = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
 
+	// Drawing the horizontal compass should be done first, so that the background is properly filled
+	drawHorizontalCompass(200, 143, _yaw, front, back, surface);
+
 	int score = _gameStateVars[k8bitVariableScore];
 	int ecds = _gameStateVars[kVariableActiveECDs];
 	drawStringInSurface(Common::String::format("%04d", int(2 * _position.x())), 200, 137, front, back, surface);
diff --git a/engines/freescape/games/dark/dark.cpp b/engines/freescape/games/dark/dark.cpp
index 934e895a975..020906d7d69 100644
--- a/engines/freescape/games/dark/dark.cpp
+++ b/engines/freescape/games/dark/dark.cpp
@@ -836,6 +836,15 @@ void DarkEngine::drawVerticalCompass(Graphics::Surface *surface, int x, int y, f
 	surface->drawPolygonScan(xpoints.data(), ypoints.data(), 4, Common::Rect(0, 0, surface->w, surface->h), color);
 }
 
+void DarkEngine::drawHorizontalCompass(int x, int y, float angle, uint32 front, uint32 back, Graphics::Surface *surface) {
+	// TODO implement different compass styles for C64, Amiga and Atari ST
+	uint32 transparent = _gfx->_texturePixelFormat.ARGBToColor(0x00, 0x00, 0x00, 0x00);
+	int delta = (angle - 180) / 5.5;
+	drawStringInSurface("-N-E-S-W-N-E-S", delta + x, y, front, back, surface);
+	surface->fillRect(Common::Rect(x - 20, y - 5, x + 40, y + 10), transparent);
+	surface->fillRect(Common::Rect(x + 80, y - 5, 320, y + 10), transparent);
+}
+
 void DarkEngine::drawIndicator(Graphics::Surface *surface, int xPosition, int yPosition) {
 	if (_indicators.size() == 0)
 		return;
diff --git a/engines/freescape/games/dark/dark.h b/engines/freescape/games/dark/dark.h
index cb0a9f948d8..c813fab4aa6 100644
--- a/engines/freescape/games/dark/dark.h
+++ b/engines/freescape/games/dark/dark.h
@@ -119,6 +119,7 @@ private:
 	bool tryDestroyECDFullGame(int index);
 	void addWalls(Area *area);
 	void drawVerticalCompass(Graphics::Surface *surface, int x, int y, float angle, uint32 color);
+	void drawHorizontalCompass(int x, int y, float angle, uint32 front, uint32 back, Graphics::Surface *surface);
 };
 
 }
diff --git a/engines/freescape/games/dark/dos.cpp b/engines/freescape/games/dark/dos.cpp
index f2a71652ebe..064dbdd04c8 100644
--- a/engines/freescape/games/dark/dos.cpp
+++ b/engines/freescape/games/dark/dos.cpp
@@ -182,6 +182,8 @@ void DarkEngine::drawDOSUI(Graphics::Surface *surface) {
 	_gfx->readFromPalette(color, r, g, b);
 	uint32 back = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
 
+	// Drawing the horizontal compass should be done first, so that the background is properly filled
+	drawHorizontalCompass(200, 143, _yaw, front, back, surface);
 	Common::Rect stepBackgroundRect = Common::Rect(69, 177, 98, 185);
 	surface->fillRect(stepBackgroundRect, back);
 
diff --git a/engines/freescape/games/dark/zx.cpp b/engines/freescape/games/dark/zx.cpp
index ce10504bf78..598d610d8d7 100644
--- a/engines/freescape/games/dark/zx.cpp
+++ b/engines/freescape/games/dark/zx.cpp
@@ -140,6 +140,9 @@ void DarkEngine::drawZXUI(Graphics::Surface *surface) {
 	uint32 back = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
 	uint32 transparent = _gfx->_texturePixelFormat.ARGBToColor(0x00, 0x00, 0x00, 0x00);
 
+	// Drawing the horizontal compass should be done first, so that the background is properly filled
+	drawHorizontalCompass(192, 141, _yaw, front, back, surface);
+
 	int score = _gameStateVars[k8bitVariableScore];
 	int ecds = _gameStateVars[kVariableActiveECDs];
 	surface->fillRect(Common::Rect(193, 140, 223, 163), back);




More information about the Scummvm-git-logs mailing list