[Scummvm-git-logs] scummvm master -> 4de3a93ed09417d5b56c13211bd6b93b43b849bf
neuromancer
noreply at scummvm.org
Sun Sep 8 10:39:12 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:
f8c9e65d8f FREESCAPE: fix incorrect deallocation
4de3a93ed0 FREESCAPE: loaded more images from castle ega dos
Commit: f8c9e65d8f30caf5ad7e11276ec2053f16d953aa
https://github.com/scummvm/scummvm/commit/f8c9e65d8f30caf5ad7e11276ec2053f16d953aa
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-09-08T12:36:43+02:00
Commit Message:
FREESCAPE: fix incorrect deallocation
Changed paths:
engines/freescape/games/castle/amiga.cpp
diff --git a/engines/freescape/games/castle/amiga.cpp b/engines/freescape/games/castle/amiga.cpp
index 01042a6f8b3..3754cc034d9 100644
--- a/engines/freescape/games/castle/amiga.cpp
+++ b/engines/freescape/games/castle/amiga.cpp
@@ -81,7 +81,7 @@ void CastleEngine::loadAssetsAmigaDemo() {
file.seek(0x2cf28 + 0x28 - 0x2 + 0x28);
_border = loadFrameFromPlanesVertical(&file, 160, 200);
_border->convertToInPlace(_gfx->_texturePixelFormat, borderPalete, 16);
- free(borderPalete);
+ delete[] borderPalete;
file.close();
_areaMap[2]->_groundColor = 1;
Commit: 4de3a93ed09417d5b56c13211bd6b93b43b849bf
https://github.com/scummvm/scummvm/commit/4de3a93ed09417d5b56c13211bd6b93b43b849bf
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-09-08T12:36:43+02:00
Commit Message:
FREESCAPE: loaded more images from castle ega dos
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 c4fe1ae1e05..3cc50acb21d 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -61,7 +61,6 @@ CastleEngine::CastleEngine(OSystem *syst, const ADGameDescription *gd) : Freesca
_option = nullptr;
_optionTexture = nullptr;
- _keysFrame = nullptr;
_spiritsMeterIndicatorFrame = nullptr;
_strenghtBackgroundFrame = nullptr;
_strenghtBarFrame = nullptr;
@@ -674,14 +673,15 @@ void CastleEngine::drawEnergyMeter(Graphics::Surface *surface) {
Common::Point origin;
if (isDOS())
- origin = Common::Point(43, 157);
+ origin = Common::Point(40, 160);
if (isSpectrum())
origin = Common::Point(63, 154);
- if (!_strenghtBackgroundFrame)
- return;
surface->copyRectToSurface((const Graphics::Surface)*_strenghtBackgroundFrame, origin.x, origin.y, Common::Rect(0, 0, _strenghtBackgroundFrame->w, _strenghtBackgroundFrame->h));
+ if (!_strenghtBarFrame)
+ return;
+
surface->copyRectToSurface((const Graphics::Surface)*_strenghtBarFrame, origin.x, origin.y + 8, Common::Rect(0, 0, _strenghtBarFrame->w, _strenghtBarFrame->h));
Common::Point weightPoint;
diff --git a/engines/freescape/games/castle/castle.h b/engines/freescape/games/castle/castle.h
index 263d4e6207d..a36843346a5 100644
--- a/engines/freescape/games/castle/castle.h
+++ b/engines/freescape/games/castle/castle.h
@@ -86,7 +86,8 @@ public:
Graphics::ManagedSurface *loadFrameFromPlanesVertical(Common::SeekableReadStream *file, int widthInBytes, int height);
Graphics::ManagedSurface *loadFrameFromPlanesInternalVertical(Common::SeekableReadStream *file, Graphics::ManagedSurface *surface, int width, int height, int plane);
- Graphics::ManagedSurface *_keysFrame;
+ Common::Array<Graphics::ManagedSurface *>_keysBorderFrames;
+ Common::Array<Graphics::ManagedSurface *>_keysMenuFrames;
Graphics::ManagedSurface *_spiritsMeterIndicatorFrame;
Graphics::ManagedSurface *_strenghtBackgroundFrame;
Graphics::ManagedSurface *_strenghtBarFrame;
diff --git a/engines/freescape/games/castle/dos.cpp b/engines/freescape/games/castle/dos.cpp
index 7f381287120..7672fb727d0 100644
--- a/engines/freescape/games/castle/dos.cpp
+++ b/engines/freescape/games/castle/dos.cpp
@@ -135,6 +135,24 @@ void CastleEngine::loadAssetsDOSFullGame() {
stream->seek(0x1c700);
_background = loadFrameFromPlanes(stream, 252, 42);
_background->convertToInPlace(_gfx->_texturePixelFormat, (byte *)&kEGADefaultPalette, 16);
+ // Eye widget is next to 0x1f058
+
+ stream->seek(0x1f4ea);
+ for (int i = 0; i < 9; i++) {
+ Graphics::ManagedSurface *frame = loadFrameFromPlanes(stream, 8, 14);
+ frame->convertToInPlace(_gfx->_texturePixelFormat, (byte *)&kEGADefaultPalette, 16);
+ _keysBorderFrames.push_back(frame);
+ }
+
+ for (int i = 0; i < 11; i++) {
+ Graphics::ManagedSurface *frame = loadFrameFromPlanes(stream, 8, 14);
+ frame->convertToInPlace(_gfx->_texturePixelFormat, (byte *)&kEGADefaultPalette, 16);
+ _keysMenuFrames.push_back(frame);
+ }
+
+ stream->seek(0x202b8);
+ _strenghtBackgroundFrame = loadFrameFromPlanes(stream, 40, 14);
+ _strenghtBackgroundFrame->convertToInPlace(_gfx->_texturePixelFormat, (byte *)&kEGADefaultPalette, 16);
stream->seek(0x221ae);
_menu = loadFrameFromPlanes(stream, 112, 114);
@@ -350,6 +368,10 @@ void CastleEngine::drawDOSUI(Graphics::Surface *surface) {
} else
drawStringInSurface(_currentArea->_name, 97, 182, front, back, surface);
+ for (int k = 0; k < _numberKeys; k++) {
+ 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);
int flagFrameIndex = (_ticks / 10) % 4;
surface->copyRectToSurface(*_flagFrames[flagFrameIndex], 282, 5, Common::Rect(10, 0, _flagFrames[flagFrameIndex]->w, _flagFrames[flagFrameIndex]->h));
diff --git a/engines/freescape/games/castle/zx.cpp b/engines/freescape/games/castle/zx.cpp
index 7d42c37bc75..3ebf3fc9831 100644
--- a/engines/freescape/games/castle/zx.cpp
+++ b/engines/freescape/games/castle/zx.cpp
@@ -137,7 +137,7 @@ void CastleEngine::loadAssetsZXFullGame() {
_gfx->readFromPalette(7, r, g, b);
uint32 white = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
- _keysFrame = loadFrameWithHeader(&file, 0xdf7, white, red);
+ _keysBorderFrames.push_back(loadFrameWithHeader(&file, 0xdf7, white, red));
uint32 green = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0, 0xff, 0);
_spiritsMeterIndicatorFrame = loadFrameWithHeader(&file, _language == Common::ES_ESP ? 0xe5e : 0xe4f, green, white);
@@ -223,7 +223,7 @@ void CastleEngine::drawZXUI(Graphics::Surface *surface) {
drawStringInSurface(_currentArea->_name, 120, 179, front, black, surface);
for (int k = 0; k < _numberKeys; k++) {
- surface->copyRectToSurface((const Graphics::Surface)*_keysFrame, 99 - k * 4, 177, Common::Rect(0, 0, 6, 11));
+ surface->copyRectToSurface((const Graphics::Surface)*_keysBorderFrames[0], 99 - k * 4, 177, Common::Rect(0, 0, 6, 11));
}
uint32 green = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0, 0xff, 0);
More information about the Scummvm-git-logs
mailing list