[Scummvm-git-logs] scummvm master -> dff24e60806d01daffcee0b745be2c78e63d6af6
neuromancer
noreply at scummvm.org
Thu Sep 12 07:19:54 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:
5840db6142 FREESCAPE: refactored drawEnergyMeter
254dc6ee30 FREESCAPE: removed unused images from freescape.dat
dff24e6080 FREESCAPE: fixed background image rendering in castle dos ega
Commit: 5840db614204e4baa4da06f14bb2a7d3625b80f4
https://github.com/scummvm/scummvm/commit/5840db614204e4baa4da06f14bb2a7d3625b80f4
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-09-12T09:21:05+02:00
Commit Message:
FREESCAPE: refactored drawEnergyMeter
Changed paths:
engines/freescape/games/castle/castle.cpp
engines/freescape/games/castle/castle.h
engines/freescape/games/castle/dos.cpp
engines/freescape/games/castle/zx.cpp
diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index f52a67649af..ae755a0114e 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -441,12 +441,6 @@ void CastleEngine::executeRedraw(FCLInstruction &instruction) {
void CastleEngine::loadAssets() {
FreescapeEngine::loadAssets();
if (isDOS()) {
-
- /*Graphics::Surface *surface = loadBundledImage("castle_riddle_background");
- surface->convertToInPlace(_gfx->_texturePixelFormat);
- _riddleBackgroundFrame = new Graphics::ManagedSurface();
- _riddleBackgroundFrame->copyFrom(surface);*/
-
for (auto &it : _areaMap) {
it._value->addStructure(_areaMap[255]);
it._value->addObjectFromArea(229, _areaMap[255]);
@@ -656,14 +650,7 @@ void CastleEngine::drawStringInSurface(const Common::String &str, int x, int y,
//FreescapeEngine::drawStringInSurface(str, x, y, transparent, green, surface, offset);
}
-void CastleEngine::drawEnergyMeter(Graphics::Surface *surface) {
- Common::Point origin;
-
- if (isDOS())
- origin = Common::Point(39, 157);
- if (isSpectrum())
- origin = Common::Point(63, 154);
-
+void CastleEngine::drawEnergyMeter(Graphics::Surface *surface, Common::Point origin) {
if (!_strenghtBackgroundFrame)
return;
diff --git a/engines/freescape/games/castle/castle.h b/engines/freescape/games/castle/castle.h
index d0c9cfa977f..3caf67aa330 100644
--- a/engines/freescape/games/castle/castle.h
+++ b/engines/freescape/games/castle/castle.h
@@ -55,7 +55,7 @@ public:
void drawDOSUI(Graphics::Surface *surface) override;
void drawZXUI(Graphics::Surface *surface) override;
void drawAmigaAtariSTUI(Graphics::Surface *surface) override;
- void drawEnergyMeter(Graphics::Surface *surface);
+ void drawEnergyMeter(Graphics::Surface *surface, Common::Point origin);
void pressedKey(const int keycode) override;
void checkSensors() override;
void updateTimeVariables() override;
diff --git a/engines/freescape/games/castle/dos.cpp b/engines/freescape/games/castle/dos.cpp
index 12c6c16c747..c383730b938 100644
--- a/engines/freescape/games/castle/dos.cpp
+++ b/engines/freescape/games/castle/dos.cpp
@@ -413,10 +413,10 @@ void CastleEngine::drawDOSUI(Graphics::Surface *surface) {
surface->copyRectToSurfaceWithKey((const Graphics::Surface)*_keysBorderFrames[k], 76 - k * 4, 179, Common::Rect(0, 0, 6, 14), _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x00, 0x00, 0x00));
}
- drawEnergyMeter(surface);
+ drawEnergyMeter(surface, Common::Point(39, 157));
int flagFrameIndex = (_ticks / 10) % 4;
surface->copyRectToSurface(*_flagFrames[flagFrameIndex], 285, 5, Common::Rect(0, 0, _flagFrames[flagFrameIndex]->w, _flagFrames[flagFrameIndex]->h));
- surface->copyRectToSurface((const Graphics::Surface)*_spiritsMeterIndicatorFrame, 140 + _spiritsMeterPosition, 156, Common::Rect(0, 0, 15, 8));
+ surface->copyRectToSurface((const Graphics::Surface)*_spiritsMeterIndicatorFrame, 140 + _spiritsMeterPosition, 156, Common::Rect(0, 0, _spiritsMeterIndicatorFrame->w, _spiritsMeterIndicatorFrame->h));
//surface->copyRectToSurface(*_spiritsMeterIndicatorFrame, 100, 50, Common::Rect(0, 0, _spiritsMeterIndicatorFrame->w, _spiritsMeterIndicatorFrame->h));
}
diff --git a/engines/freescape/games/castle/zx.cpp b/engines/freescape/games/castle/zx.cpp
index 3ebf3fc9831..e0f70b0ccb4 100644
--- a/engines/freescape/games/castle/zx.cpp
+++ b/engines/freescape/games/castle/zx.cpp
@@ -230,7 +230,7 @@ void CastleEngine::drawZXUI(Graphics::Surface *surface) {
surface->fillRect(Common::Rect(152, 156, 216, 164), green);
surface->copyRectToSurface((const Graphics::Surface)*_spiritsMeterIndicatorFrame, 140 + _spiritsMeterPosition, 156, Common::Rect(0, 0, 15, 8));
- drawEnergyMeter(surface);
+ drawEnergyMeter(surface, Common::Point(63, 154));
}
} // End of namespace Freescape
Commit: 254dc6ee3019ace37b56bfb8e848dda66bae2b88
https://github.com/scummvm/scummvm/commit/254dc6ee3019ace37b56bfb8e848dda66bae2b88
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-09-12T09:21:06+02:00
Commit Message:
FREESCAPE: removed unused images from freescape.dat
Changed paths:
R devtools/create_freescape/castle_strength_bar_ega.bmp
R devtools/create_freescape/castle_strength_weight_0_ega.bmp
R devtools/create_freescape/castle_strength_weight_1_ega.bmp
R devtools/create_freescape/castle_strength_weight_2_ega.bmp
R devtools/create_freescape/castle_strength_weight_3_ega.bmp
dists/engine-data/freescape.dat
diff --git a/devtools/create_freescape/castle_strength_bar_ega.bmp b/devtools/create_freescape/castle_strength_bar_ega.bmp
deleted file mode 100644
index 96162e7d920..00000000000
Binary files a/devtools/create_freescape/castle_strength_bar_ega.bmp and /dev/null differ
diff --git a/devtools/create_freescape/castle_strength_weight_0_ega.bmp b/devtools/create_freescape/castle_strength_weight_0_ega.bmp
deleted file mode 100644
index a81a9833eaa..00000000000
Binary files a/devtools/create_freescape/castle_strength_weight_0_ega.bmp and /dev/null differ
diff --git a/devtools/create_freescape/castle_strength_weight_1_ega.bmp b/devtools/create_freescape/castle_strength_weight_1_ega.bmp
deleted file mode 100644
index 1502311bf68..00000000000
Binary files a/devtools/create_freescape/castle_strength_weight_1_ega.bmp and /dev/null differ
diff --git a/devtools/create_freescape/castle_strength_weight_2_ega.bmp b/devtools/create_freescape/castle_strength_weight_2_ega.bmp
deleted file mode 100644
index 527a235c125..00000000000
Binary files a/devtools/create_freescape/castle_strength_weight_2_ega.bmp and /dev/null differ
diff --git a/devtools/create_freescape/castle_strength_weight_3_ega.bmp b/devtools/create_freescape/castle_strength_weight_3_ega.bmp
deleted file mode 100644
index 527a235c125..00000000000
Binary files a/devtools/create_freescape/castle_strength_weight_3_ega.bmp and /dev/null differ
diff --git a/dists/engine-data/freescape.dat b/dists/engine-data/freescape.dat
index 4eceb1f18cc..8ab5cb22c1f 100644
Binary files a/dists/engine-data/freescape.dat and b/dists/engine-data/freescape.dat differ
Commit: dff24e60806d01daffcee0b745be2c78e63d6af6
https://github.com/scummvm/scummvm/commit/dff24e60806d01daffcee0b745be2c78e63d6af6
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-09-12T09:21:06+02:00
Commit Message:
FREESCAPE: fixed background image rendering in castle dos ega
Changed paths:
engines/freescape/games/castle/dos.cpp
engines/freescape/gfx_opengl.cpp
engines/freescape/gfx_opengl.h
diff --git a/engines/freescape/games/castle/dos.cpp b/engines/freescape/games/castle/dos.cpp
index c383730b938..1c15d213b07 100644
--- a/engines/freescape/games/castle/dos.cpp
+++ b/engines/freescape/games/castle/dos.cpp
@@ -175,7 +175,7 @@ void CastleEngine::loadAssetsDOSFullGame() {
_endGameBackgroundFrame = loadFrameFromPlanes(stream, 112, 108);
_endGameBackgroundFrame->convertToInPlace(_gfx->_texturePixelFormat, (byte *)&kEGADefaultPalette, 16);
- _background = loadFrameFromPlanes(stream, 252, 42);
+ _background = loadFrameFromPlanes(stream, 504, 42);
_background->convertToInPlace(_gfx->_texturePixelFormat, (byte *)&kEGADefaultPalette, 16);
debug("%lx", stream->pos());
// Eye widget is next to 0x1f058
diff --git a/engines/freescape/gfx_opengl.cpp b/engines/freescape/gfx_opengl.cpp
index 1e81b0b8c3d..f426d1ebb91 100644
--- a/engines/freescape/gfx_opengl.cpp
+++ b/engines/freescape/gfx_opengl.cpp
@@ -169,7 +169,12 @@ void OpenGLRenderer::drawSkybox(Texture *texture, Math::Vector3d camera) {
glBindTexture(GL_TEXTURE_2D, glTexture->_id);
glVertexPointer(3, GL_FLOAT, 0, _skyVertices);
glNormalPointer(GL_FLOAT, 0, _skyNormals);
- glTexCoordPointer(2, GL_FLOAT, 0, _skyUvs);
+ if (texture->_height == 18) {
+ glTexCoordPointer(2, GL_FLOAT, 0, _skyUvs18);
+ } else if (texture->_height == 42) {
+ glTexCoordPointer(2, GL_FLOAT, 0, _skyUvs42);
+ } else
+ error("Unsupported skybox texture width %d", texture->_width);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
diff --git a/engines/freescape/gfx_opengl.h b/engines/freescape/gfx_opengl.h
index 1f71f3e4bfe..28770efe0bb 100644
--- a/engines/freescape/gfx_opengl.h
+++ b/engines/freescape/gfx_opengl.h
@@ -133,7 +133,7 @@ public:
{ 1.0, 0.0, 0.0 }
};
- GLfloat _skyUvs[16][2] = {
+ GLfloat _skyUvs18[16][2] = {
{ 0.0f, 0.0f }, //1
{ 0.0f, 2.0f }, //2
{ 2.5f, 2.0f }, //3
@@ -155,6 +155,28 @@ public:
{ 2.5f, 2.0f }, //4
};
+ GLfloat _skyUvs42[16][2] = {
+ { 0.0f, 0.0f }, //1
+ { 0.0f, 0.95f }, //2
+ { 0.4f, 0.95f }, //3
+ { 0.4f, 0.0f }, //front //4
+
+ { 0.0f, 0.95f }, //back //1
+ { 0.4f, 0.95f }, //2
+ { 0.4f, 0.0f }, //3
+ { 0.0f, 0.0f }, //4
+
+ { 0.0f, 0.0f }, //left //1
+ { 0.4f, 0.0f }, //2
+ { 0.4f, 0.95f }, //3
+ { 0.0f, 0.95f }, //4
+
+ { 0.4f, 0.0f }, //right //1
+ { 0.0f, 0.0f }, //2
+ { 0.0f, 0.95f }, //3
+ { 0.4f, 0.95f }, //4
+ };
+
GLfloat _skyVertices[16][3] = {
{ -81280.0, 8128.0, 81280.0 }, //1 // Vertex #0 front
{ -81280.0, -8128.0, 81280.0 }, //2 // Vertex #1
More information about the Scummvm-git-logs
mailing list