[Scummvm-git-logs] scummvm master -> 61566edb86534d7a1bcaff39e8fa7d88737e21e3
neuromancer
noreply at scummvm.org
Sun Apr 2 16:32:58 UTC 2023
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:
4997478581 FREESCAPE: loading of title and border images in castle for dos
61566edb86 FREESCAPE: show basic UI in castle for dos
Commit: 4997478581d99179d70ffab28f283e496b7c46ed
https://github.com/scummvm/scummvm/commit/4997478581d99179d70ffab28f283e496b7c46ed
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-04-02T18:34:35+02:00
Commit Message:
FREESCAPE: loading of title and border images in castle for dos
Changed paths:
engines/freescape/freescape.h
engines/freescape/games/castle.cpp
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index ccb3af3942a..25a0c6ff0d1 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -464,20 +464,14 @@ private:
void addSkanner(Area *area);
void loadAssetsFullGame() override;
-
void loadAssetsAtariFullGame() override;
void loadAssetsAtariDemo() override;
-
void loadAssetsAmigaFullGame() override;
void loadAssetsAmigaDemo() override;
-
void loadAssetsDOSFullGame() override;
void loadAssetsDOSDemo() override;
-
void loadAssetsZXFullGame() override;
-
void loadAssetsCPCFullGame() override;
-
void loadAssetsC64FullGame() override;
void drawDOSUI(Graphics::Surface *surface) override;
@@ -560,6 +554,7 @@ class CastleEngine : public FreescapeEngine {
public:
CastleEngine(OSystem *syst, const ADGameDescription *gd);
+ void titleScreen() override;
void loadAssetsDOSFullGame() override;
void gotoArea(uint16 areaID, int entranceID) override;
diff --git a/engines/freescape/games/castle.cpp b/engines/freescape/games/castle.cpp
index e81afcff921..04c95a7b2cc 100644
--- a/engines/freescape/games/castle.cpp
+++ b/engines/freescape/games/castle.cpp
@@ -56,19 +56,36 @@ Common::SeekableReadStream *CastleEngine::decryptFile(const Common::String filen
return (new Common::MemoryReadStream(encryptedBuffer, size));
}
+extern byte kEGADefaultPaletteData[16][3];
+
void CastleEngine::loadAssetsDOSFullGame() {
+ Common::File file;
Common::SeekableReadStream *stream = nullptr;
- stream = decryptFile("CMLE");
- loadMessagesVariableSize(stream, 0x11, 164);
- delete stream;
+ if (_renderMode == Common::kRenderEGA) {
+ file.open("CMOE.DAT");
+ _title = load8bitBinImage(&file, 0x0);
+ _title->setPalette((byte *)&kEGADefaultPaletteData, 0, 16);
+
+ file.close();
+
+ file.open("CME.DAT");
+ _border = load8bitBinImage(&file, 0x0);
+ _border->setPalette((byte *)&kEGADefaultPaletteData, 0, 16);
+
+ file.close();
- stream = decryptFile("CMEDF");
- load8bitBinary(stream, 0, 16);
- for (auto &it : _areaMap)
- it._value->addStructure(_areaMap[255]);
- delete stream;
+ stream = decryptFile("CMLE");
+ loadMessagesVariableSize(stream, 0x11, 164);
+ delete stream;
+ stream = decryptFile("CMEDF");
+ load8bitBinary(stream, 0, 16);
+ for (auto &it : _areaMap)
+ it._value->addStructure(_areaMap[255]);
+ delete stream;
+ } else
+ error("Not implemented yet");
// CPC
// file = gameDir.createReadStreamForMember("cm.bin");
// if (file == nullptr)
@@ -76,6 +93,18 @@ void CastleEngine::loadAssetsDOSFullGame() {
// load8bitBinary(file, 0x791a, 16);
}
+void CastleEngine::titleScreen() {
+ if (isAmiga() || isAtariST()) // These releases has their own screens
+ return;
+
+ if (_title) {
+ drawTitle();
+ _gfx->flipBuffer();
+ g_system->updateScreen();
+ g_system->delayMillis(3000);
+ }
+}
+
void CastleEngine::gotoArea(uint16 areaID, int entranceID) {
debugC(1, kFreescapeDebugMove, "Jumping to area: %d, entrance: %d", areaID, entranceID);
if (!_gameStateBits.contains(areaID))
Commit: 61566edb86534d7a1bcaff39e8fa7d88737e21e3
https://github.com/scummvm/scummvm/commit/61566edb86534d7a1bcaff39e8fa7d88737e21e3
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-04-02T18:34:35+02:00
Commit Message:
FREESCAPE: show basic UI in castle for dos
Changed paths:
engines/freescape/freescape.h
engines/freescape/games/castle.cpp
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index 25a0c6ff0d1..ca41cd9b7c9 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -556,6 +556,7 @@ public:
void titleScreen() override;
void loadAssetsDOSFullGame() override;
+ void drawUI() override;
void gotoArea(uint16 areaID, int entranceID) override;
Common::Error saveGameStreamExtended(Common::WriteStream *stream, bool isAutosave = false) override;
diff --git a/engines/freescape/games/castle.cpp b/engines/freescape/games/castle.cpp
index 04c95a7b2cc..a1e6f6555ff 100644
--- a/engines/freescape/games/castle.cpp
+++ b/engines/freescape/games/castle.cpp
@@ -63,6 +63,8 @@ void CastleEngine::loadAssetsDOSFullGame() {
Common::SeekableReadStream *stream = nullptr;
if (_renderMode == Common::kRenderEGA) {
+ _viewArea = Common::Rect(39, 31, 278, 150);
+
file.open("CMOE.DAT");
_title = load8bitBinImage(&file, 0x0);
_title->setPalette((byte *)&kEGADefaultPaletteData, 0, 16);
@@ -127,6 +129,28 @@ void CastleEngine::gotoArea(uint16 areaID, int entranceID) {
_gfx->_keyColor = 255;
}
+void CastleEngine::drawUI() {
+ _gfx->setViewport(_fullscreenViewArea);
+
+ Graphics::Surface *surface = new Graphics::Surface();
+ surface->create(_screenW, _screenH, _gfx->_texturePixelFormat);
+ uint32 gray = _gfx->_texturePixelFormat.ARGBToColor(0x00, 0xA0, 0xA0, 0xA0);
+ surface->fillRect(_fullscreenViewArea, gray);
+ drawCrossair(surface);
+
+ if (!_uiTexture)
+ _uiTexture = _gfx->createTexture(surface);
+ else
+ _uiTexture->update(surface);
+
+ _gfx->drawTexturedRect2D(_fullscreenViewArea, _fullscreenViewArea, _uiTexture);
+
+ surface->free();
+ delete surface;
+
+ _gfx->setViewport(_viewArea);
+}
+
Common::Error CastleEngine::saveGameStreamExtended(Common::WriteStream *stream, bool isAutosave) {
return Common::kNoError;
}
More information about the Scummvm-git-logs
mailing list