[Scummvm-git-logs] scummvm master -> 910fbbcdaff35ae0a4eea841ed7a7a7fc8c258a1
neuromancer
noreply at scummvm.org
Wed Mar 27 11:32:31 UTC 2024
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3c1064433c FREESCAPE: added ankh indicator for zx release of eclipse
3b38124e96 FREESCAPE: Tweaked frutum parameters to match original implementation
c87651637e FREESCAPE: fix shoot sound for Driller
910fbbcdaf FREESCAPE: fix background color rendering when using color remaps
Commit: 3c1064433ca793382949370015fc44feea2f25a8
https://github.com/scummvm/scummvm/commit/3c1064433ca793382949370015fc44feea2f25a8
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-03-27T11:29:01+01:00
Commit Message:
FREESCAPE: added ankh indicator for zx release of eclipse
Changed paths:
A devtools/create_freescape/eclipse_ankh_indicator_ZX Spectrum.bmp
dists/engine-data/freescape.dat
engines/freescape/games/eclipse/eclipse.cpp
engines/freescape/games/eclipse/zx.cpp
diff --git a/devtools/create_freescape/eclipse_ankh_indicator_ZX Spectrum.bmp b/devtools/create_freescape/eclipse_ankh_indicator_ZX Spectrum.bmp
new file mode 100644
index 00000000000..ddfa307d670
Binary files /dev/null and b/devtools/create_freescape/eclipse_ankh_indicator_ZX Spectrum.bmp differ
diff --git a/dists/engine-data/freescape.dat b/dists/engine-data/freescape.dat
index 0b6ce0aae5e..98340536ccd 100644
Binary files a/dists/engine-data/freescape.dat and b/dists/engine-data/freescape.dat differ
diff --git a/engines/freescape/games/eclipse/eclipse.cpp b/engines/freescape/games/eclipse/eclipse.cpp
index 1cc3e1434dc..adae25e662e 100644
--- a/engines/freescape/games/eclipse/eclipse.cpp
+++ b/engines/freescape/games/eclipse/eclipse.cpp
@@ -445,7 +445,10 @@ void EclipseEngine::drawIndicator(Graphics::Surface *surface, int xPosition, int
return;
for (int i = 0; i < 5; i++) {
- if (_gameStateVars[kVariableEclipseAnkhs] > i)
+ if (isSpectrum()) {
+ if (_gameStateVars[kVariableEclipseAnkhs] <= i)
+ continue;
+ } else if (_gameStateVars[kVariableEclipseAnkhs] > i)
continue;
surface->copyRectToSurface(*_indicators[0], xPosition + separation * i, yPosition, Common::Rect(_indicators[0]->w, _indicators[0]->h));
}
diff --git a/engines/freescape/games/eclipse/zx.cpp b/engines/freescape/games/eclipse/zx.cpp
index eb78ba941a4..4dfae7aff62 100644
--- a/engines/freescape/games/eclipse/zx.cpp
+++ b/engines/freescape/games/eclipse/zx.cpp
@@ -76,6 +76,11 @@ void EclipseEngine::loadAssetsZXFullGame() {
for (int16 id = 183; id < 207; id++)
it._value->addObjectFromArea(id, _areaMap[255]);
}
+
+ _indicators.push_back(loadBundledImage("eclipse_ankh_indicator"));
+
+ for (auto &it : _indicators)
+ it->convertToInPlace(_gfx->_texturePixelFormat);
}
void EclipseEngine::loadAssetsZXDemo() {
@@ -120,13 +125,10 @@ void EclipseEngine::loadAssetsZXDemo() {
it._value->addObjectFromArea(id, _areaMap[255]);
}
- /*_indicators.push_back(loadBundledImage("dark_fallen_indicator"));
- _indicators.push_back(loadBundledImage("dark_crouch_indicator"));
- _indicators.push_back(loadBundledImage("dark_walk_indicator"));
- _indicators.push_back(loadBundledImage("dark_jet_indicator"));
+ _indicators.push_back(loadBundledImage("eclipse_ankh_indicator"));
for (auto &it : _indicators)
- it->convertToInPlace(_gfx->_texturePixelFormat);*/
+ it->convertToInPlace(_gfx->_texturePixelFormat);
}
void EclipseEngine::drawZXUI(Graphics::Surface *surface) {
@@ -188,8 +190,8 @@ void EclipseEngine::drawZXUI(Graphics::Surface *surface) {
drawStringInSurface("<", 240, 141, back, yellow, surface, 'Z' - '$' + 1);
}
drawAnalogClock(surface, 89, 172, back, back, gray);
+ drawIndicator(surface, 65, 7, 8);
drawEclipseIndicator(surface, 215, 3, front, gray);
-
}
} // End of namespace Freescape
Commit: 3b38124e962695c7341f3297d34c5aa5a6539212
https://github.com/scummvm/scummvm/commit/3b38124e962695c7341f3297d34c5aa5a6539212
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-03-27T11:29:01+01:00
Commit Message:
FREESCAPE: Tweaked frutum parameters to match original implementation
Changed paths:
engines/freescape/freescape.cpp
engines/freescape/gfx_opengl.cpp
engines/freescape/gfx_opengl_shaders.cpp
engines/freescape/gfx_tinygl.cpp
diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index 8a2c711441b..813b2c7edb4 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -322,7 +322,7 @@ void FreescapeEngine::drawBackground() {
}
void FreescapeEngine::drawFrame() {
- _gfx->updateProjectionMatrix(70.0, _nearClipPlane, _farClipPlane);
+ _gfx->updateProjectionMatrix(90.0, _nearClipPlane, _farClipPlane);
_gfx->positionCamera(_position, _position + _cameraFront);
if (_underFireFrames > 0) {
diff --git a/engines/freescape/gfx_opengl.cpp b/engines/freescape/gfx_opengl.cpp
index c6f5f57f69a..6fbce92c63d 100644
--- a/engines/freescape/gfx_opengl.cpp
+++ b/engines/freescape/gfx_opengl.cpp
@@ -159,14 +159,15 @@ void OpenGLRenderer::drawTexturedRect2D(const Common::Rect &screenRect, const Co
void OpenGLRenderer::updateProjectionMatrix(float fov, float nearClipPlane, float farClipPlane) {
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
-
- float aspectRatio = _screenW / (float)_screenH;
+ // Determining xmaxValue and ymaxValue still needs some work for matching the 3D view in freescape games
+ /*float aspectRatio = _screenW / (float)_screenH;
float xmaxValue = nearClipPlane * tan(Common::deg2rad(fov) / 2);
float ymaxValue = xmaxValue / aspectRatio;
// debug("max values: %f %f", xmaxValue, ymaxValue);
- glFrustum(xmaxValue, -xmaxValue, -ymaxValue, ymaxValue, nearClipPlane, farClipPlane);
+ glFrustum(xmaxValue, -xmaxValue, -ymaxValue, ymaxValue, nearClipPlane, farClipPlane);*/
+ glFrustum(1.5, -1.5, -0.625, 0.625, nearClipPlane, farClipPlane);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
diff --git a/engines/freescape/gfx_opengl_shaders.cpp b/engines/freescape/gfx_opengl_shaders.cpp
index 0d7deaa4ce2..b4341b08a84 100644
--- a/engines/freescape/gfx_opengl_shaders.cpp
+++ b/engines/freescape/gfx_opengl_shaders.cpp
@@ -138,10 +138,12 @@ void OpenGLShaderRenderer::drawTexturedRect2D(const Common::Rect &screenRect, co
}
void OpenGLShaderRenderer::updateProjectionMatrix(float fov, float nearClipPlane, float farClipPlane) {
- float aspectRatio = _screenW / (float)_screenH;
+ // Determining xmaxValue and ymaxValue still needs some work for matching the 3D view in freescape games
+ /*float aspectRatio = _screenW / (float)_screenH;
float xmaxValue = nearClipPlane * tan(Common::deg2rad(fov) / 2);
float ymaxValue = xmaxValue / aspectRatio;
- _projectionMatrix = Math::makeFrustumMatrix(xmaxValue, -xmaxValue, -ymaxValue, ymaxValue, nearClipPlane, farClipPlane);
+ _projectionMatrix = Math::makeFrustumMatrix(xmaxValue, -xmaxValue, -ymaxValue, ymaxValue, nearClipPlane, farClipPlane);*/
+ _projectionMatrix = Math::makeFrustumMatrix(1.5, -1.5, -0.625, 0.625, nearClipPlane, farClipPlane);
}
void OpenGLShaderRenderer::positionCamera(const Math::Vector3d &pos, const Math::Vector3d &interest) {
@@ -217,7 +219,7 @@ void OpenGLShaderRenderer::renderPlayerShootBall(byte color, const Common::Point
float coef = (9 - frame) / 9.0;
float radius = (1 - coef) * 4.0;
- Common::Point position(_position.x, _screenH - _position.y);
+ Common::Point position(_position.x, _screenH - _position.y);
Common::Point initial_position(viewArea.left + viewArea.width() / 2 + 2, _screenH - (viewArea.height() + viewArea.top));
Common::Point ball_position = coef * position + (1 - coef) * initial_position;
diff --git a/engines/freescape/gfx_tinygl.cpp b/engines/freescape/gfx_tinygl.cpp
index 5f7c3545fc7..4edb35abec3 100644
--- a/engines/freescape/gfx_tinygl.cpp
+++ b/engines/freescape/gfx_tinygl.cpp
@@ -98,13 +98,15 @@ void TinyGLRenderer::updateProjectionMatrix(float fov, float nearClipPlane, floa
tglMatrixMode(TGL_PROJECTION);
tglLoadIdentity();
- float aspectRatio = _screenW / (float)_screenH;
+ // Determining xmaxValue and ymaxValue still needs some work for matching the 3D view in freescape games
+ /*float aspectRatio = _screenW / (float)_screenH;
float xmaxValue = nearClipPlane * tan(Common::deg2rad(fov) / 2);
float ymaxValue = xmaxValue / aspectRatio;
// debug("max values: %f %f", xmaxValue, ymaxValue);
- tglFrustumf(xmaxValue, -xmaxValue, -ymaxValue, ymaxValue, nearClipPlane, farClipPlane);
+ tglFrustumf(xmaxValue, -xmaxValue, -ymaxValue, ymaxValue, nearClipPlane, farClipPlane);*/
+ tglFrustumf(1.5, -1.5, -0.625, 0.625, nearClipPlane, farClipPlane);
tglMatrixMode(TGL_MODELVIEW);
tglLoadIdentity();
}
Commit: c87651637edfaca2f8749fe95a34e56e90433079
https://github.com/scummvm/scummvm/commit/c87651637edfaca2f8749fe95a34e56e90433079
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-03-27T11:29:01+01:00
Commit Message:
FREESCAPE: fix shoot sound for Driller
Changed paths:
engines/freescape/movement.cpp
diff --git a/engines/freescape/movement.cpp b/engines/freescape/movement.cpp
index f771a49cc61..cc0e6a00b50 100644
--- a/engines/freescape/movement.cpp
+++ b/engines/freescape/movement.cpp
@@ -184,7 +184,9 @@ void FreescapeEngine::activate() {
void FreescapeEngine::shoot() {
- if (isSpectrum()) {
+ if (isDriller())
+ playSound(1, false);
+ else if (isSpectrum()) {
if (isDark())
playSound(15, false);
else if (isEclipse())
Commit: 910fbbcdaff35ae0a4eea841ed7a7a7fc8c258a1
https://github.com/scummvm/scummvm/commit/910fbbcdaff35ae0a4eea841ed7a7a7fc8c258a1
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-03-27T11:29:02+01:00
Commit Message:
FREESCAPE: fix background color rendering when using color remaps
Changed paths:
engines/freescape/gfx.cpp
diff --git a/engines/freescape/gfx.cpp b/engines/freescape/gfx.cpp
index 4b9491206a8..379ce4eecfa 100644
--- a/engines/freescape/gfx.cpp
+++ b/engines/freescape/gfx.cpp
@@ -979,8 +979,14 @@ void Renderer::renderPolygon(const Math::Vector3d &origin, const Math::Vector3d
}
void Renderer::drawBackground(uint8 color) {
+ uint8 r1, g1, b1;
+ uint8 r2, g2, b2;
+
if (_colorRemaps && _colorRemaps->contains(color)) {
color = (*_colorRemaps)[color];
+ readFromPalette(color, r1, g1, b1);
+ clear(r1, g1, b1);
+ return;
}
if (color == 0) {
@@ -988,8 +994,6 @@ void Renderer::drawBackground(uint8 color) {
return;
}
- uint8 r1, g1, b1;
- uint8 r2, g2, b2;
byte *stipple = nullptr;
getRGBAt(color, r1, g1, b1, r2, g2, b2, stipple);
More information about the Scummvm-git-logs
mailing list