[Scummvm-git-logs] scummvm master -> 1999c827403a203e765abbac405af489eb8493b1

neuromancer noreply at scummvm.org
Mon Jul 8 08:36:00 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:
47f00487a6 FREESCAPE: implemented compass for eclipse
1999c82740 FREESCAPE: implemented compass for driller


Commit: 47f00487a6f045ce97dfecf97ccef8f470890c3d
    https://github.com/scummvm/scummvm/commit/47f00487a6f045ce97dfecf97ccef8f470890c3d
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-07-08T09:42:10+02:00

Commit Message:
FREESCAPE: implemented compass for eclipse

Changed paths:
    engines/freescape/games/eclipse/cpc.cpp
    engines/freescape/games/eclipse/dos.cpp


diff --git a/engines/freescape/games/eclipse/cpc.cpp b/engines/freescape/games/eclipse/cpc.cpp
index 0c14996f6ef..ea8798c0e78 100644
--- a/engines/freescape/games/eclipse/cpc.cpp
+++ b/engines/freescape/games/eclipse/cpc.cpp
@@ -195,6 +195,10 @@ void EclipseEngine::drawCPCUI(Graphics::Surface *surface) {
 	drawAnalogClock(surface, 90, 172, back, other, front);
 	drawIndicator(surface, 45, 4, 12);
 	drawEclipseIndicator(surface, 228, 0, front, other);
+
+	surface->fillRect(Common::Rect(225, 168, 235, 187), front);
+	drawCompass(surface, 229, 177, _yaw, 10, back);
+
 }
 
 } // End of namespace Freescape
diff --git a/engines/freescape/games/eclipse/dos.cpp b/engines/freescape/games/eclipse/dos.cpp
index 6d1b94a5178..186ebb377be 100644
--- a/engines/freescape/games/eclipse/dos.cpp
+++ b/engines/freescape/games/eclipse/dos.cpp
@@ -189,6 +189,8 @@ void EclipseEngine::drawDOSUI(Graphics::Surface *surface) {
 
 	drawIndicator(surface, 41, 4, 16);
 	drawEclipseIndicator(surface, 228, 0, yellow, green);
+	surface->fillRect(Common::Rect(225, 168, 235, 187), white);
+	drawCompass(surface, 229, 177, _yaw, 10, black);
 }
 
 soundFx *EclipseEngine::load1bPCM(Common::SeekableReadStream *file, int offset) {


Commit: 1999c827403a203e765abbac405af489eb8493b1
    https://github.com/scummvm/scummvm/commit/1999c827403a203e765abbac405af489eb8493b1
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-07-08T09:42:10+02:00

Commit Message:
FREESCAPE: implemented compass for driller

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


diff --git a/engines/freescape/games/driller/cpc.cpp b/engines/freescape/games/driller/cpc.cpp
index 48e9257d4ae..308f8053853 100644
--- a/engines/freescape/games/driller/cpc.cpp
+++ b/engines/freescape/games/driller/cpc.cpp
@@ -225,6 +225,9 @@ void DrillerEngine::drawCPCUI(Graphics::Surface *surface) {
 		Common::Rect shieldBar(88 - shield, 177, 88, 183);
 		surface->fillRect(shieldBar, front);
 	}
+
+	drawCompass(surface, 87, 156, _yaw, 10, front);
+	drawCompass(surface, 230, 156, _pitch - 30, 10, front);
 }
 
 } // End of namespace Freescape
\ No newline at end of file
diff --git a/engines/freescape/games/driller/dos.cpp b/engines/freescape/games/driller/dos.cpp
index 3b898af5c2d..2f05bd3452f 100644
--- a/engines/freescape/games/driller/dos.cpp
+++ b/engines/freescape/games/driller/dos.cpp
@@ -472,6 +472,13 @@ void DrillerEngine::drawDOSUI(Graphics::Surface *surface) {
 		surface->copyRectToSurface(*_indicators[0], 132, 128, Common::Rect(_indicators[0]->w, _indicators[0]->h));
 	else
 		surface->copyRectToSurface(*_indicators[1], 132, 128, Common::Rect(_indicators[1]->w, _indicators[1]->h));
+
+	color = 2;
+	_gfx->readFromPalette(color, r, g, b);
+	uint32 other = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
+
+	drawCompass(surface, 87, 156, _yaw, 10, other);
+	drawCompass(surface, 230, 156, _pitch - 30, 10, other);
 }
 
 } // End of namespace Freescape
diff --git a/engines/freescape/games/driller/driller.cpp b/engines/freescape/games/driller/driller.cpp
index bff6aa572ee..a38399f0d38 100644
--- a/engines/freescape/games/driller/driller.cpp
+++ b/engines/freescape/games/driller/driller.cpp
@@ -872,6 +872,31 @@ void DrillerEngine::updateTimeVariables() {
 	}
 }
 
+void DrillerEngine::drawCompass(Graphics::Surface *surface, int x, int y, double degrees, double magnitude, uint32 color) {
+	double fov = 60;
+	degrees = degrees + fov;
+	if (degrees >= 360)
+		degrees = degrees - 360;
+
+	const double degtorad = (M_PI * 2) / 360;
+	double w = magnitude * cos(-degrees * degtorad);
+	double h = magnitude * sin(-degrees * degtorad);
+
+	surface->drawLine(x, y, x+(int)w, y+(int)h, color);
+
+
+	degrees = degrees - fov;
+	if (degrees < 0)
+		degrees = degrees + 360;
+
+	w = magnitude * cos(-degrees * degtorad);
+	h = magnitude * sin(-degrees * degtorad);
+
+	surface->drawLine(x, y, x+(int)w, y+(int)h, color);
+	//surface->drawLine(x, y, x+(int)-w, y+(int)h, color);
+}
+
+
 Common::Error DrillerEngine::saveGameStreamExtended(Common::WriteStream *stream, bool isAutosave) {
 	for (auto &it : _areaMap) { // All but skip area 255
 		if (it._key == 255)
diff --git a/engines/freescape/games/driller/driller.h b/engines/freescape/games/driller/driller.h
index 0aca5f9f4b6..a3c22ce0ced 100644
--- a/engines/freescape/games/driller/driller.h
+++ b/engines/freescape/games/driller/driller.h
@@ -47,6 +47,7 @@ public:
 
 	void drawInfoMenu() override;
 	void drawSensorShoot(Sensor *sensor) override;
+	void drawCompass(Graphics::Surface *surface, int x, int y, double degrees, double magnitude, uint32 color);
 
 	void pressedKey(const int keycode) override;
 	Common::Error saveGameStreamExtended(Common::WriteStream *stream, bool isAutosave = false) override;
diff --git a/engines/freescape/games/driller/zx.cpp b/engines/freescape/games/driller/zx.cpp
index 3beca9441a8..95abcca07b8 100644
--- a/engines/freescape/games/driller/zx.cpp
+++ b/engines/freescape/games/driller/zx.cpp
@@ -151,6 +151,9 @@ void DrillerEngine::drawZXUI(Graphics::Surface *surface) {
 		Common::Rect shieldBar(106 - shield, 181, 106, 187);
 		surface->fillRect(shieldBar, front);
 	}
+
+	drawCompass(surface, 103, 160, _yaw, 10, front);
+	drawCompass(surface, 220 - 3, 160, _pitch - 30, 10, front);
 }
 
 } // End of namespace Freescape
\ No newline at end of file




More information about the Scummvm-git-logs mailing list