[Scummvm-git-logs] scummvm master -> 026fcfe9c335f58a0f8a9360339a4a77e2f97f62

neuromancer noreply at scummvm.org
Mon Jun 10 20:51:32 UTC 2024


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:
9c42fbd230 FREESCAPE: added authentic graphics option to simulate original size of stipple patterns
4d06981e28 FREESCAPE: improved movement using original (co)sine table for demo mode
026fcfe9c3 AGS: added latest crimson diamond demo to detection entries


Commit: 9c42fbd230597164d466f1790e65baf2d3c2ee6c
    https://github.com/scummvm/scummvm/commit/9c42fbd230597164d466f1790e65baf2d3c2ee6c
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-06-10T22:52:39+02:00

Commit Message:
FREESCAPE: added authentic graphics option to simulate original size of stipple patterns

Changed paths:
    engines/freescape/detection.cpp
    engines/freescape/detection.h
    engines/freescape/freescape.cpp
    engines/freescape/gfx.cpp
    engines/freescape/gfx.h
    engines/freescape/gfx_opengl.cpp
    engines/freescape/gfx_opengl.h
    engines/freescape/gfx_opengl_shaders.cpp
    engines/freescape/gfx_opengl_shaders.h
    engines/freescape/gfx_tinygl.cpp
    engines/freescape/metaengine.cpp


diff --git a/engines/freescape/detection.cpp b/engines/freescape/detection.cpp
index c824cb6bbc6..af8508ec20f 100644
--- a/engines/freescape/detection.cpp
+++ b/engines/freescape/detection.cpp
@@ -967,7 +967,7 @@ static const DebugChannelDef debugFlagList[] = {
 class FreescapeMetaEngineDetection : public AdvancedMetaEngineDetection {
 public:
 	FreescapeMetaEngineDetection() : AdvancedMetaEngineDetection(Freescape::gameDescriptions, sizeof(ADGameDescription), Freescape::freescapeGames) {
-		_guiOptions = GUIO7(GUIO_NOMIDI, GAMEOPTION_PRERECORDED_SOUNDS, GAMEOPTION_EXTENDED_TIMER, GAMEOPTION_DISABLE_DEMO_MODE, GAMEOPTION_DISABLE_SENSORS, GAMEOPTION_DISABLE_FALLING, GAMEOPTION_INVERT_Y);
+		_guiOptions = GUIO8(GUIO_NOMIDI, GAMEOPTION_PRERECORDED_SOUNDS, GAMEOPTION_EXTENDED_TIMER, GAMEOPTION_DISABLE_DEMO_MODE, GAMEOPTION_DISABLE_SENSORS, GAMEOPTION_DISABLE_FALLING, GAMEOPTION_INVERT_Y, GAMEOPTION_AUTHENTIC_GRAPHICS);
 	}
 
 	const char *getName() const override {
diff --git a/engines/freescape/detection.h b/engines/freescape/detection.h
index 31c8ebf6117..5262bcd7a50 100644
--- a/engines/freescape/detection.h
+++ b/engines/freescape/detection.h
@@ -29,8 +29,9 @@
 #define GAMEOPTION_DISABLE_SENSORS      GUIO_GAMEOPTIONS4
 #define GAMEOPTION_DISABLE_FALLING      GUIO_GAMEOPTIONS5
 #define GAMEOPTION_INVERT_Y             GUIO_GAMEOPTIONS6
+#define GAMEOPTION_AUTHENTIC_GRAPHICS   GUIO_GAMEOPTIONS7
 
 // Driller options
-#define GAMEOPTION_AUTOMATIC_DRILLING   GUIO_GAMEOPTIONS7
+#define GAMEOPTION_AUTOMATIC_DRILLING   GUIO_GAMEOPTIONS8
 
 #endif
diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index b12ea583e4a..c02c173c6c3 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -619,7 +619,7 @@ Common::Error FreescapeEngine::run() {
 	// Initialize graphics
 	_screenW = g_system->getWidth();
 	_screenH = g_system->getHeight();
-	_gfx = createRenderer(_screenW, _screenH, _renderMode);
+	_gfx = createRenderer(_screenW, _screenH, _renderMode, ConfMan.getBool("authentic_graphics"));
 	_speaker = new SizedPCSpeaker();
 	_speaker->setVolume(50);
 	_crossairPosition.x = _screenW / 2;
diff --git a/engines/freescape/gfx.cpp b/engines/freescape/gfx.cpp
index c50873ab09f..df95cc4c165 100644
--- a/engines/freescape/gfx.cpp
+++ b/engines/freescape/gfx.cpp
@@ -34,7 +34,7 @@
 
 namespace Freescape {
 
-Renderer::Renderer(int screenW, int screenH, Common::RenderMode renderMode) {
+Renderer::Renderer(int screenW, int screenH, Common::RenderMode renderMode, bool authenticGraphics) {
 	_screenW = screenW;
 	_screenH = screenH;
 	_currentPixelFormat = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
@@ -48,6 +48,7 @@ Renderer::Renderer(int screenW, int screenH, Common::RenderMode renderMode) {
 	_colorRemaps = nullptr;
 	_renderMode = renderMode;
 	_isAccelerated = false;
+	_authenticGraphics = authenticGraphics;
 
 	for (int i = 0; i < 16; i++) {
 		for (int j = 0; j < 128; j++) {
@@ -169,6 +170,36 @@ void Renderer::fillColorPairArray() {
 	}
 }
 
+
+uint16 duplicate_bits(uint8 byte) {
+    uint16 result = 0;
+
+    for (int i = 0; i < 8; i++) {
+        // Extract the bit at position i
+        uint8 bit = (byte >> i) & 1;
+        // Duplicate the bit
+        uint16 duplicated_bits = (bit << 1) | bit;
+        // Position the duplicated bits in the appropriate place in the result
+        result |= (duplicated_bits << (2 * i));
+    }
+
+    return result;
+}
+
+
+void scaleStipplePattern(byte originalPattern[128], byte newPattern[128]) {
+    // Initialize the new pattern to all 0
+    memset(newPattern, 0, 128);
+
+    for (int i = 0; i < 64; i++) {
+		// Duplicate the bits of the original pattern
+		uint16 duplicated_bits = duplicate_bits(originalPattern[i]);
+		// Position the duplicated bits in the appropriate place in the new pattern
+		newPattern[2 * i] = (duplicated_bits >> 8) & 0xff;
+		newPattern[2 * i + 1] = duplicated_bits & 0xff;
+	}
+}
+
 void Renderer::setColorMap(ColorMap *colorMap_) {
 	_colorMap = colorMap_;
 	if (_renderMode == Common::kRenderZX) {
@@ -198,6 +229,15 @@ void Renderer::setColorMap(ColorMap *colorMap_) {
 				_stipples[i][j] = getCGAStipple(entry[(j / 8) % 4], c1, c2) ;
 		}
 	}
+
+	if (_isAccelerated && _authenticGraphics) {
+		for (int i = 1; i < 14; i++) {
+			scaleStipplePattern(_stipples[i], _stipples[15]);
+			memcpy(_stipples[i], _stipples[15], 128);
+			scaleStipplePattern(_stipples[i], _stipples[15]);
+			memcpy(_stipples[i], _stipples[15], 128);
+		}
+	}
 }
 
 void Renderer::readFromPalette(uint8 index, uint8 &r, uint8 &g, uint8 &b) {
@@ -1143,7 +1183,7 @@ Graphics::RendererType determinateRenderType() {
 	return Graphics::kRendererTypeDefault;
 }
 
-Renderer *createRenderer(int screenW, int screenH, Common::RenderMode renderMode) {
+Renderer *createRenderer(int screenW, int screenH, Common::RenderMode renderMode, bool authenticGraphics) {
 	Graphics::PixelFormat pixelFormat = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
 	Graphics::RendererType rendererType = determinateRenderType();
 
@@ -1157,18 +1197,19 @@ Renderer *createRenderer(int screenW, int screenH, Common::RenderMode renderMode
 
 	#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 		if (rendererType == Graphics::kRendererTypeOpenGL) {
-			return CreateGfxOpenGL(screenW, screenH, renderMode);
+			return CreateGfxOpenGL(screenW, screenH, renderMode, authenticGraphics);
 		}
 	#endif
 
 	#if defined(USE_OPENGL_SHADERS)
 		if (rendererType == Graphics::kRendererTypeOpenGLShaders) {
-			return CreateGfxOpenGLShader(screenW, screenH, renderMode);
+			return CreateGfxOpenGLShader(screenW, screenH, renderMode, authenticGraphics);
 		}
 	#endif
 
 	#if defined(USE_TINYGL)
 	if (rendererType == Graphics::kRendererTypeTinyGL) {
+		// TinyGL graphics are always authentic
 		return CreateGfxTinyGL(screenW, screenH, renderMode);
 	}
 	#endif
diff --git a/engines/freescape/gfx.h b/engines/freescape/gfx.h
index 1cc6db9cda0..772b1bf3176 100644
--- a/engines/freescape/gfx.h
+++ b/engines/freescape/gfx.h
@@ -58,13 +58,14 @@ public:
 
 class Renderer {
 public:
-	Renderer(int screenW, int screenH, Common::RenderMode renderMode);
+	Renderer(int screenW, int screenH, Common::RenderMode renderMode, bool authenticGraphics);
 	virtual ~Renderer();
 
 	Graphics::PixelFormat _currentPixelFormat;
 	Graphics::PixelFormat _palettePixelFormat;
 	Graphics::PixelFormat _texturePixelFormat;
 	bool _isAccelerated;
+	bool _authenticGraphics;
 
 	virtual void init() = 0;
 	virtual void setViewport(const Common::Rect &rect) = 0;
@@ -175,10 +176,10 @@ protected:
 };
 
 Graphics::RendererType determinateRenderType();
-Renderer *CreateGfxOpenGL(int screenW, int screenH, Common::RenderMode renderMode);
-Renderer *CreateGfxOpenGLShader(int screenW, int screenH, Common::RenderMode renderMode);
+Renderer *CreateGfxOpenGL(int screenW, int screenH, Common::RenderMode renderMode, bool authenticGraphics);
+Renderer *CreateGfxOpenGLShader(int screenW, int screenH, Common::RenderMode renderMode, bool authenticGraphics);
 Renderer *CreateGfxTinyGL(int screenW, int screenH, Common::RenderMode renderMode);
-Renderer *createRenderer(int screenW, int screenH, Common::RenderMode renderMode);
+Renderer *createRenderer(int screenW, int screenH, Common::RenderMode renderMode, bool authenticGraphics);
 
 } // End of namespace Freescape
 
diff --git a/engines/freescape/gfx_opengl.cpp b/engines/freescape/gfx_opengl.cpp
index 1ed503926cf..058ba9384c0 100644
--- a/engines/freescape/gfx_opengl.cpp
+++ b/engines/freescape/gfx_opengl.cpp
@@ -35,11 +35,11 @@
 
 namespace Freescape {
 
-Renderer *CreateGfxOpenGL(int screenW, int screenH, Common::RenderMode renderMode) {
-	return new OpenGLRenderer(screenW, screenH, renderMode);
+Renderer *CreateGfxOpenGL(int screenW, int screenH, Common::RenderMode renderMode, bool authenticGraphics) {
+	return new OpenGLRenderer(screenW, screenH, renderMode, authenticGraphics);
 }
 
-OpenGLRenderer::OpenGLRenderer(int screenW, int screenH, Common::RenderMode renderMode) : Renderer(screenW, screenH, renderMode) {
+OpenGLRenderer::OpenGLRenderer(int screenW, int screenH, Common::RenderMode renderMode, bool authenticGraphics) : Renderer(screenW, screenH, renderMode, authenticGraphics) {
 	_verts = (Vertex *)malloc(sizeof(Vertex) * kVertexArraySize);
 	_coords = (Coord *)malloc(sizeof(Coord) * kCoordsArraySize);
 	_texturePixelFormat = OpenGLTexture::getRGBAPixelFormat();
diff --git a/engines/freescape/gfx_opengl.h b/engines/freescape/gfx_opengl.h
index 50a8de02bf7..731d8742a55 100644
--- a/engines/freescape/gfx_opengl.h
+++ b/engines/freescape/gfx_opengl.h
@@ -34,7 +34,7 @@ namespace Freescape {
 
 class OpenGLRenderer : public Renderer {
 public:
-	OpenGLRenderer(int screenW, int screenH, Common::RenderMode renderMode);
+	OpenGLRenderer(int screenW, int screenH, Common::RenderMode renderMode, bool authenticGraphics);
 	virtual ~OpenGLRenderer();
 
 	struct Vertex {
diff --git a/engines/freescape/gfx_opengl_shaders.cpp b/engines/freescape/gfx_opengl_shaders.cpp
index a76af77454c..e5d40824a02 100644
--- a/engines/freescape/gfx_opengl_shaders.cpp
+++ b/engines/freescape/gfx_opengl_shaders.cpp
@@ -41,11 +41,11 @@ static const GLfloat bitmapVertices[] = {
 	1.0, 1.0,
 };
 
-Renderer *CreateGfxOpenGLShader(int screenW, int screenH, Common::RenderMode renderMode) {
-	return new OpenGLShaderRenderer(screenW, screenH, renderMode);
+Renderer *CreateGfxOpenGLShader(int screenW, int screenH, Common::RenderMode renderMode, bool authenticGraphics) {
+	return new OpenGLShaderRenderer(screenW, screenH, renderMode, authenticGraphics);
 }
 
-OpenGLShaderRenderer::OpenGLShaderRenderer(int screenW, int screenH, Common::RenderMode renderMode) : Renderer(screenW, screenH, renderMode) {
+OpenGLShaderRenderer::OpenGLShaderRenderer(int screenW, int screenH, Common::RenderMode renderMode, bool authenticGraphics) : Renderer(screenW, screenH, renderMode, authenticGraphics) {
 	_verts = nullptr;
 	_triangleShader = nullptr;
 	_triangleVBO = 0;
diff --git a/engines/freescape/gfx_opengl_shaders.h b/engines/freescape/gfx_opengl_shaders.h
index 030ac6aa6fa..abd0b2b0218 100644
--- a/engines/freescape/gfx_opengl_shaders.h
+++ b/engines/freescape/gfx_opengl_shaders.h
@@ -33,7 +33,7 @@ namespace Freescape {
 
 class OpenGLShaderRenderer : public Renderer {
 public:
-	OpenGLShaderRenderer(int screenW, int screenH, Common::RenderMode renderMode);
+	OpenGLShaderRenderer(int screenW, int screenH, Common::RenderMode renderMode, bool authenticGraphics);
 	virtual ~OpenGLShaderRenderer();
 
 	Math::Matrix4 _projectionMatrix;
diff --git a/engines/freescape/gfx_tinygl.cpp b/engines/freescape/gfx_tinygl.cpp
index 3ad1a6b44c3..87d5e658947 100644
--- a/engines/freescape/gfx_tinygl.cpp
+++ b/engines/freescape/gfx_tinygl.cpp
@@ -38,7 +38,7 @@ Renderer *CreateGfxTinyGL(int screenW, int screenH, Common::RenderMode renderMod
 	return new TinyGLRenderer(screenW, screenH, renderMode);
 }
 
-TinyGLRenderer::TinyGLRenderer(int screenW, int screenH, Common::RenderMode renderMode) : Renderer(screenW, screenH, renderMode) {
+TinyGLRenderer::TinyGLRenderer(int screenW, int screenH, Common::RenderMode renderMode) : Renderer(screenW, screenH, renderMode, true) {
 	_verts = (Vertex *)malloc(sizeof(Vertex) * kVertexArraySize);
 	_texturePixelFormat = TinyGLTexture::getRGBAPixelFormat();
 	_variableStippleArray = nullptr;
diff --git a/engines/freescape/metaengine.cpp b/engines/freescape/metaengine.cpp
index 87ecfc1b177..4ae108f70be 100644
--- a/engines/freescape/metaengine.cpp
+++ b/engines/freescape/metaengine.cpp
@@ -111,6 +111,17 @@ static const ADExtraGuiOptionsMap optionsList[] = {
 			0
 		}
 	},
+	{
+		GAMEOPTION_AUTHENTIC_GRAPHICS,
+		{
+			_s("Authentic graphics"),
+			_s("Keep graphics as close as possible to the original"),
+			"authentic_graphics",
+			false,
+			0,
+			0
+		}
+	},
 	AD_EXTRA_GUI_OPTIONS_TERMINATOR
 };
 


Commit: 4d06981e28b8060d3bd200434b86bb65d47c2b59
    https://github.com/scummvm/scummvm/commit/4d06981e28b8060d3bd200434b86bb65d47c2b59
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-06-10T22:52:39+02:00

Commit Message:
FREESCAPE: improved movement using original (co)sine table for demo mode

Changed paths:
    engines/freescape/demo.cpp
    engines/freescape/freescape.cpp
    engines/freescape/freescape.h
    engines/freescape/movement.cpp
    engines/freescape/ui.cpp


diff --git a/engines/freescape/demo.cpp b/engines/freescape/demo.cpp
index aa4227b1c59..9cbfbc1ed17 100644
--- a/engines/freescape/demo.cpp
+++ b/engines/freescape/demo.cpp
@@ -24,6 +24,9 @@
 namespace Freescape {
 
 void FreescapeEngine::generateDemoInput() {
+	if (_shootingFrames > 0)
+		return;
+
 	Common::Event event;
 	if (isDOS()) {
 
diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index c02c173c6c3..2091b657e5b 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -259,18 +259,63 @@ void FreescapeEngine::drawTitle() {
 	_gfx->setViewport(_viewArea);
 }
 
+static uint8 kCosineSineTable [72][2] {
+    // Each "dw" contains (cos, sin) (one byte each):
+    // [-64, 64]
+    // 72 steps is a whole turn.
+      0x40, 0x00, 0x40, 0x06, 0x3f, 0x0b, 0x3e, 0x11
+    , 0x3c, 0x16, 0x3a, 0x1b, 0x37, 0x20, 0x34, 0x25
+    , 0x31, 0x29, 0x2d, 0x2d, 0x29, 0x31, 0x25, 0x34
+    , 0x20, 0x37, 0x1b, 0x3a, 0x16, 0x3c, 0x11, 0x3e
+    , 0x0b, 0x3f, 0x06, 0x40, 0x00, 0x40, 0xfa, 0x40
+    , 0xf5, 0x3f, 0xef, 0x3e, 0xea, 0x3c, 0xe5, 0x3a
+    , 0xe0, 0x37, 0xdb, 0x34, 0xd7, 0x31, 0xd3, 0x2d
+    , 0xcf, 0x29, 0xcc, 0x25, 0xc9, 0x20, 0xc6, 0x1b
+    , 0xc4, 0x16, 0xc2, 0x11, 0xc1, 0x0b, 0xc0, 0x06
+    , 0xc0, 0x00, 0xc0, 0xfa, 0xc1, 0xf5, 0xc2, 0xef
+    , 0xc4, 0xea, 0xc6, 0xe5, 0xc9, 0xe0, 0xcc, 0xdb
+    , 0xcf, 0xd7, 0xd3, 0xd3, 0xd7, 0xcf, 0xdb, 0xcc
+    , 0xe0, 0xc9, 0xe5, 0xc6, 0xea, 0xc4, 0xef, 0xc2
+    , 0xf5, 0xc1, 0xfa, 0xc0, 0x00, 0xc0, 0x06, 0xc0
+    , 0x0b, 0xc1, 0x11, 0xc2, 0x16, 0xc4, 0x1b, 0xc6
+    , 0x20, 0xc9, 0x25, 0xcc, 0x29, 0xcf, 0x2d, 0xd3
+    , 0x31, 0xd7, 0x34, 0xdb, 0x37, 0xe0, 0x3a, 0xe5
+    , 0x3c, 0xea, 0x3e, 0xef, 0x3f, 0xf5, 0x40, 0xfa
+};
+
 // Taken from the Myst 3 codebase, it should be abstracted
-Math::Vector3d FreescapeEngine::directionToVector(float pitch, float heading) {
+Math::Vector3d FreescapeEngine::directionToVector(float pitch, float heading, bool useTable) {
 	Math::Vector3d v;
 
-	float radHeading = Common::deg2rad(heading);
-	float radPitch = Common::deg2rad(pitch);
-
-	v.setValue(0, cos(radPitch) * cos(radHeading));
-	v.setValue(1, sin(radPitch));
-	v.setValue(2, cos(radPitch) * sin(radHeading));
+	if (useTable) {
+		int pitchInt = (int)pitch;
+		int headingInt = (int)heading;
+
+		if (pitchInt < 0)
+			pitchInt = 360 + pitchInt;
+		if (pitchInt == 360)
+			pitchInt = 0;
+
+		if (headingInt < 0)
+			headingInt = 360 + headingInt;
+		if (headingInt == 360)
+			headingInt = 0;
+
+		int headingIndex = headingInt / 5;
+		int pitchIndex = pitchInt / 5;
+
+		v.setValue(0, ((int8)kCosineSineTable[pitchIndex][0] / 64.0) * ((int8)kCosineSineTable[headingIndex][0] / 64.0));
+		v.setValue(1, (int8)kCosineSineTable[pitchIndex][1] / 64.0);
+		v.setValue(2, ((int8)kCosineSineTable[pitchIndex][0] / 64.0) * (int8)kCosineSineTable[headingIndex][1] / 64.0);
+	} else {
+		float radHeading = Common::deg2rad(heading);
+		float radPitch = Common::deg2rad(pitch);
+
+		v.setValue(0, cos(radPitch) * cos(radHeading));
+		v.setValue(1, sin(radPitch));
+		v.setValue(2, cos(radPitch) * sin(radHeading));
+	}
 	v.normalize();
-
 	return v;
 }
 
@@ -870,7 +915,8 @@ void FreescapeEngine::rotate(float xoffset, float yoffset) {
 }
 
 void FreescapeEngine::updateCamera() {
-	_cameraFront = directionToVector(_pitch, _yaw);
+	bool useTable = _demoMode;
+	_cameraFront = directionToVector(_pitch, _yaw, useTable);
 	// _right = _front x _up;
 	Math::Vector3d v = Math::Vector3d::crossProduct(_cameraFront, _upVector);
 	v.normalize();
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index 85e096235c7..6149c215464 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -308,7 +308,7 @@ public:
 	int _angleRotationIndex;
 	Common::Array<float> _angleRotations;
 
-	Math::Vector3d directionToVector(float pitch, float heading);
+	Math::Vector3d directionToVector(float pitch, float heading, bool useTable);
 	void updateCamera();
 
 	// Camera options
diff --git a/engines/freescape/movement.cpp b/engines/freescape/movement.cpp
index aeb6334c4af..ddba96598ed 100644
--- a/engines/freescape/movement.cpp
+++ b/engines/freescape/movement.cpp
@@ -47,13 +47,13 @@ void FreescapeEngine::initKeymaps(Common::Keymap *engineKeyMap, const char *targ
 	act = new Common::Action(Common::kStandardActionMoveLeft, _("Strafe Left"));
 	act->setKeyEvent(Common::KEYCODE_LEFT);
 	act->addDefaultInputMapping("JOY_LEFT");
-	act->addDefaultInputMapping("q");
+	//act->addDefaultInputMapping("q");
 	engineKeyMap->addAction(act);
 
 	act = new Common::Action(Common::kStandardActionMoveRight, _("Strafe Right"));
 	act->setKeyEvent(Common::KEYCODE_RIGHT);
 	act->addDefaultInputMapping("JOY_RIGHT");
-	act->addDefaultInputMapping("w");
+	//act->addDefaultInputMapping("w");
 	engineKeyMap->addAction(act);
 
 	act = new Common::Action("SHOOT", _("Shoot"));
@@ -164,7 +164,7 @@ void FreescapeEngine::activate() {
 	xoffset = xoffset * 0.33;
 	yoffset = yoffset * 0.50;
 
-	Math::Vector3d direction = directionToVector(_pitch - yoffset, _yaw - xoffset);
+	Math::Vector3d direction = directionToVector(_pitch - yoffset, _yaw - xoffset, false);
 	Math::Ray ray(_position, direction);
 	Object *interacted = _currentArea->checkCollisionRay(ray, 8192);
 	if (interacted) {
@@ -205,7 +205,7 @@ void FreescapeEngine::shoot() {
 	xoffset = xoffset * 0.33;
 	yoffset = yoffset * 0.50;
 
-	Math::Vector3d direction = directionToVector(_pitch - yoffset, _yaw - xoffset);
+	Math::Vector3d direction = directionToVector(_pitch - yoffset, _yaw - xoffset, false);
 	Math::Ray ray(_position, direction);
 	Object *shot = _currentArea->checkCollisionRay(ray, 8192);
 	if (shot) {
diff --git a/engines/freescape/ui.cpp b/engines/freescape/ui.cpp
index 0c5690b5a2a..f8a34dacea6 100644
--- a/engines/freescape/ui.cpp
+++ b/engines/freescape/ui.cpp
@@ -272,6 +272,10 @@ void FreescapeEngine::drawBorderScreenAndWait(Graphics::Surface *surface) {
 				case Common::KEYCODE_SPACE:
 					i = maxWait;
 					break;
+				case Common::KEYCODE_d:
+					_demoMode = true;
+					i = maxWait;
+					break;
 				default:
 					break;
 				}


Commit: 026fcfe9c335f58a0f8a9360339a4a77e2f97f62
    https://github.com/scummvm/scummvm/commit/026fcfe9c335f58a0f8a9360339a4a77e2f97f62
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-06-10T22:52:39+02:00

Commit Message:
AGS: added latest crimson diamond demo to detection entries

Changed paths:
    engines/ags/detection_tables.h


diff --git a/engines/ags/detection_tables.h b/engines/ags/detection_tables.h
index 0d6a4089402..9ed4705ddf8 100644
--- a/engines/ags/detection_tables.h
+++ b/engines/ags/detection_tables.h
@@ -4932,6 +4932,7 @@ const AGSGameDescription GAME_DESCRIPTIONS[] = {
 	DEMO_ENTRY_EN("cosmosquest1", "tfas1.exe", "0710e2ec71042617f565c01824f0cf3c", 4571793),
 	DEMO_ENTRY_EN("cougarisland", "LV69.exe", "63f8a60cc094996bd070e68cb3c4722c", 17187670),
 	DEMO_ENTRY_EN("crimmsson", "Crimm's Son.exe", "618d7dce9631229b4579340b964c6810", 9039508),
+	DEMO_ENTRY_EN("crimsondiamond", "The Crimson Diamond Demo.exe", "38a49a28c0af599633006c09fe6c2f72", 147061686),
 	DEMO_ENTRY_EN("crimsondiamond", "The Crimson Diamond Demo.exe", "69414fa4aa2cc5414a38cc166d44338b", 51640494),
 	DEMO_ENTRY_EN("crimsondiamond", "The Crimson Diamond Demo.exe", "69414fa4aa2cc5414a38cc166d44338b", 53471704),  // v10
 	DEMO_ENTRY_EN("crimsondiamond", "The Crimson Diamond Demo.exe", "69414fa4aa2cc5414a38cc166d44338b", 53472267),




More information about the Scummvm-git-logs mailing list