[Scummvm-git-logs] scummvm master -> 9c963f2249cc2a8413ebbb1342c83c61f442fd2b

neuromancer noreply at scummvm.org
Wed Jan 10 12:55:46 UTC 2024


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

Summary:
9c963f2249 FREESCAPE: use double instead of float to avoid casting issues


Commit: 9c963f2249cc2a8413ebbb1342c83c61f442fd2b
    https://github.com/scummvm/scummvm/commit/9c963f2249cc2a8413ebbb1342c83c61f442fd2b
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-01-10T13:56:01+01:00

Commit Message:
FREESCAPE: use double instead of float to avoid casting issues

Changed paths:
    engines/freescape/games/eclipse/eclipse.cpp
    engines/freescape/games/eclipse/eclipse.h


diff --git a/engines/freescape/games/eclipse/eclipse.cpp b/engines/freescape/games/eclipse/eclipse.cpp
index fbbbf5a5cf1..af02e8070f5 100644
--- a/engines/freescape/games/eclipse/eclipse.cpp
+++ b/engines/freescape/games/eclipse/eclipse.cpp
@@ -185,10 +185,10 @@ void EclipseEngine::drawAnalogClock(Graphics::Surface *surface, int x, int y, ui
 	drawAnalogClockHand(surface, x, y, seconds * 6 - 90, 11, colorHand2);
 }
 
-void EclipseEngine::drawAnalogClockHand(Graphics::Surface *surface, int x, int y, float degrees, float magnitude, uint32 color) {
-	const float degtorad = (M_PI * 2) / 360;
-	float w = magnitude * cos(degrees * degtorad);
-	float h = magnitude * sin(degrees * degtorad);
+void EclipseEngine::drawAnalogClockHand(Graphics::Surface *surface, int x, int y, double degrees, double magnitude, uint32 color) {
+	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);
 }
 
diff --git a/engines/freescape/games/eclipse/eclipse.h b/engines/freescape/games/eclipse/eclipse.h
index 2105274140f..47c479564bf 100644
--- a/engines/freescape/games/eclipse/eclipse.h
+++ b/engines/freescape/games/eclipse/eclipse.h
@@ -49,7 +49,7 @@ public:
 	void drawCPCUI(Graphics::Surface *surface) override;
 	void drawZXUI(Graphics::Surface *surface) override;
 	void drawAnalogClock(Graphics::Surface *surface, int x, int y, uint32 colorHand1, uint32 colorHand2, uint32 colorBack);
-	void drawAnalogClockHand(Graphics::Surface *surface, int x, int y, float degrees, float magnitude, uint32 color);
+	void drawAnalogClockHand(Graphics::Surface *surface, int x, int y, double degrees, double magnitude, uint32 color);
 
 
 	Common::Error saveGameStreamExtended(Common::WriteStream *stream, bool isAutosave = false) override;




More information about the Scummvm-git-logs mailing list