[Scummvm-git-logs] scummvm master -> ba0db4171b1bb8c52f790d2230cf35fe984f3a2d
neuromancer
noreply at scummvm.org
Wed Oct 4 10:49:52 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:
6bb49f021d FREESCAPE: refactored headers for dark and eclipse to move them into their specific folders
ba0db4171b FREESCAPE: some fixes for the rendering of the CPC demo of eclipse
Commit: 6bb49f021df2fa0222df977ad6aed2fe0775f14a
https://github.com/scummvm/scummvm/commit/6bb49f021df2fa0222df977ad6aed2fe0775f14a
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-10-04T12:46:47+02:00
Commit Message:
FREESCAPE: refactored headers for dark and eclipse to move them into their specific folders
Changed paths:
A engines/freescape/games/eclipse/eclipse.h
engines/freescape/freescape.h
engines/freescape/games/dark/amiga.cpp
engines/freescape/games/dark/dark.h
engines/freescape/games/eclipse/cpc.cpp
engines/freescape/games/eclipse/dos.cpp
engines/freescape/games/eclipse/eclipse.cpp
engines/freescape/metaengine.cpp
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index 0799710f1bb..7ca0575d34e 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -546,90 +546,6 @@ struct ECD {
int _id;
};
-class DarkEngine : public FreescapeEngine {
-public:
- DarkEngine(OSystem *syst, const ADGameDescription *gd);
-
- uint32 _initialEnergy;
- uint32 _initialShield;
- uint32 _jetFuelSeconds;
- void addSkanner(Area *area);
-
- void initGameState() override;
- void borderScreen() override;
- bool checkIfGameEnded() override;
-
- void gotoArea(uint16 areaID, int entranceID) override;
- void pressedKey(const int keycode) override;
- void executePrint(FCLInstruction &instruction) override;
-
- void initDOS();
- void initAmigaAtari();
- void initZX();
- void initCPC();
-
- void loadAssetsDOSFullGame() override;
- void loadAssetsDOSDemo() override;
- void loadAssetsAmigaFullGame() override;
-
- void loadAssetsCPCFullGame() override;
-
- void loadAssetsZXDemo() override;
- void loadAssetsZXFullGame() override;
- void loadMessagesVariableSize(Common::SeekableReadStream *file, int offset, int number) override;
-
- int _lastTenSeconds;
- int _lastSecond;
- void updateTimeVariables() override;
-
- void drawBinaryClock(Graphics::Surface *surface, int xPosition, int yPosition, uint32 front, uint32 back);
- void drawIndicator(Graphics::Surface *surface, int xPosition, int yPosition);
-
- void drawSensorShoot(Sensor *sensor) override;
- void drawDOSUI(Graphics::Surface *surface) override;
- void drawZXUI(Graphics::Surface *surface) override;
- void drawCPCUI(Graphics::Surface *surface) override;
- void drawAmigaAtariSTUI(Graphics::Surface *surface) override;
-
-
- void drawInfoMenu() override;
- void drawFullscreenMessageAndWait(Common::String message);
- void drawFullscreenMessage(Common::String message, uint32 front, Graphics::Surface *surface);
-
- Common::Error saveGameStreamExtended(Common::WriteStream *stream, bool isAutosave = false) override;
- Common::Error loadGameStreamExtended(Common::SeekableReadStream *stream) override;
-
-private:
- void addECDs(Area *area);
- void addECD(Area *area, const Math::Vector3d position, int index);
- void restoreECD(Area &area, int index);
- bool checkECD(uint16 areaID, int index);
- bool tryDestroyECD(int index);
- bool tryDestroyECDFullGame(int index);
- void addWalls(Area *area);
- Common::SeekableReadStream *decryptFile(const Common::String filename);
- Common::HashMap<uint16, bool> _exploredAreas;
-};
-
-class EclipseEngine : public FreescapeEngine {
-public:
- EclipseEngine(OSystem *syst, const ADGameDescription *gd);
-
- void gotoArea(uint16 areaID, int entranceID) override;
-
- void loadAssetsDOSFullGame() override;
-
- void initDOS();
- void initCPC();
- void loadAssetsCPCDemo() override;
-
- void drawDOSUI(Graphics::Surface *surface) override;
- void drawCPCUI(Graphics::Surface *surface) override;
-
- Common::Error saveGameStreamExtended(Common::WriteStream *stream, bool isAutosave = false) override;
- Common::Error loadGameStreamExtended(Common::SeekableReadStream *stream) override;
-};
-
class CastleEngine : public FreescapeEngine {
public:
CastleEngine(OSystem *syst, const ADGameDescription *gd);
diff --git a/engines/freescape/games/dark/amiga.cpp b/engines/freescape/games/dark/amiga.cpp
index 0bbb89cc561..ee233b02144 100644
--- a/engines/freescape/games/dark/amiga.cpp
+++ b/engines/freescape/games/dark/amiga.cpp
@@ -22,6 +22,7 @@
#include "common/memstream.h"
#include "freescape/freescape.h"
+#include "freescape/games/dark/dark.h"
#include "freescape/language/8bitDetokeniser.h"
namespace Freescape {
diff --git a/engines/freescape/games/dark/dark.h b/engines/freescape/games/dark/dark.h
index f8a1b9bfcf4..a3e556e8ce5 100644
--- a/engines/freescape/games/dark/dark.h
+++ b/engines/freescape/games/dark/dark.h
@@ -32,4 +32,69 @@ enum {
kDarkEndingECDsDestroyed = 2,
};
+class DarkEngine : public FreescapeEngine {
+public:
+ DarkEngine(OSystem *syst, const ADGameDescription *gd);
+
+ uint32 _initialEnergy;
+ uint32 _initialShield;
+ uint32 _jetFuelSeconds;
+ void addSkanner(Area *area);
+
+ void initGameState() override;
+ void borderScreen() override;
+ bool checkIfGameEnded() override;
+
+ void gotoArea(uint16 areaID, int entranceID) override;
+ void pressedKey(const int keycode) override;
+ void executePrint(FCLInstruction &instruction) override;
+
+ void initDOS();
+ void initAmigaAtari();
+ void initZX();
+ void initCPC();
+
+ void loadAssetsDOSFullGame() override;
+ void loadAssetsDOSDemo() override;
+ void loadAssetsAmigaFullGame() override;
+
+ void loadAssetsCPCFullGame() override;
+
+ void loadAssetsZXDemo() override;
+ void loadAssetsZXFullGame() override;
+ void loadMessagesVariableSize(Common::SeekableReadStream *file, int offset, int number) override;
+
+ int _lastTenSeconds;
+ int _lastSecond;
+ void updateTimeVariables() override;
+
+ void drawBinaryClock(Graphics::Surface *surface, int xPosition, int yPosition, uint32 front, uint32 back);
+ void drawIndicator(Graphics::Surface *surface, int xPosition, int yPosition);
+
+ void drawSensorShoot(Sensor *sensor) override;
+ void drawDOSUI(Graphics::Surface *surface) override;
+ void drawZXUI(Graphics::Surface *surface) override;
+ void drawCPCUI(Graphics::Surface *surface) override;
+ void drawAmigaAtariSTUI(Graphics::Surface *surface) override;
+
+
+ void drawInfoMenu() override;
+ void drawFullscreenMessageAndWait(Common::String message);
+ void drawFullscreenMessage(Common::String message, uint32 front, Graphics::Surface *surface);
+
+ Common::Error saveGameStreamExtended(Common::WriteStream *stream, bool isAutosave = false) override;
+ Common::Error loadGameStreamExtended(Common::SeekableReadStream *stream) override;
+
+private:
+ void addECDs(Area *area);
+ void addECD(Area *area, const Math::Vector3d position, int index);
+ void restoreECD(Area &area, int index);
+ bool checkECD(uint16 areaID, int index);
+ bool tryDestroyECD(int index);
+ bool tryDestroyECDFullGame(int index);
+ void addWalls(Area *area);
+ Common::SeekableReadStream *decryptFile(const Common::String filename);
+ Common::HashMap<uint16, bool> _exploredAreas;
+};
+
}
\ No newline at end of file
diff --git a/engines/freescape/games/eclipse/cpc.cpp b/engines/freescape/games/eclipse/cpc.cpp
index 35d6cbcfeed..af4b79bc4ed 100644
--- a/engines/freescape/games/eclipse/cpc.cpp
+++ b/engines/freescape/games/eclipse/cpc.cpp
@@ -23,7 +23,7 @@
#include "common/memstream.h"
#include "freescape/freescape.h"
-#include "freescape/games/dark/dark.h"
+#include "freescape/games/eclipse/eclipse.h"
#include "freescape/language/8bitDetokeniser.h"
namespace Freescape {
diff --git a/engines/freescape/games/eclipse/dos.cpp b/engines/freescape/games/eclipse/dos.cpp
index 5b9b28f751e..cab51c53335 100644
--- a/engines/freescape/games/eclipse/dos.cpp
+++ b/engines/freescape/games/eclipse/dos.cpp
@@ -22,6 +22,7 @@
#include "common/file.h"
#include "freescape/freescape.h"
+#include "freescape/games/eclipse/eclipse.h"
#include "freescape/language/8bitDetokeniser.h"
namespace Freescape {
diff --git a/engines/freescape/games/eclipse/eclipse.cpp b/engines/freescape/games/eclipse/eclipse.cpp
index 106d94aa515..cb653368cd6 100644
--- a/engines/freescape/games/eclipse/eclipse.cpp
+++ b/engines/freescape/games/eclipse/eclipse.cpp
@@ -22,6 +22,7 @@
#include "common/file.h"
#include "freescape/freescape.h"
+#include "freescape/games/eclipse/eclipse.h"
#include "freescape/language/8bitDetokeniser.h"
namespace Freescape {
diff --git a/engines/freescape/games/eclipse/eclipse.h b/engines/freescape/games/eclipse/eclipse.h
new file mode 100644
index 00000000000..498ec3ceec0
--- /dev/null
+++ b/engines/freescape/games/eclipse/eclipse.h
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Freescape {
+
+class EclipseEngine : public FreescapeEngine {
+public:
+ EclipseEngine(OSystem *syst, const ADGameDescription *gd);
+
+ void gotoArea(uint16 areaID, int entranceID) override;
+
+ void loadAssetsDOSFullGame() override;
+
+ void initDOS();
+ void initCPC();
+ void loadAssetsCPCDemo() override;
+
+ void drawDOSUI(Graphics::Surface *surface) override;
+ void drawCPCUI(Graphics::Surface *surface) override;
+
+ Common::Error saveGameStreamExtended(Common::WriteStream *stream, bool isAutosave = false) override;
+ Common::Error loadGameStreamExtended(Common::SeekableReadStream *stream) override;
+};
+
+}
\ No newline at end of file
diff --git a/engines/freescape/metaengine.cpp b/engines/freescape/metaengine.cpp
index efd7c4e74ef..1258233690f 100644
--- a/engines/freescape/metaengine.cpp
+++ b/engines/freescape/metaengine.cpp
@@ -25,6 +25,8 @@
#include "freescape/freescape.h"
+#include "freescape/games/dark/dark.h"
+#include "freescape/games/eclipse/eclipse.h"
#include "freescape/detection.h"
Commit: ba0db4171b1bb8c52f790d2230cf35fe984f3a2d
https://github.com/scummvm/scummvm/commit/ba0db4171b1bb8c52f790d2230cf35fe984f3a2d
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-10-04T12:46:47+02:00
Commit Message:
FREESCAPE: some fixes for the rendering of the CPC demo of eclipse
Changed paths:
engines/freescape/games/eclipse/cpc.cpp
engines/freescape/games/eclipse/eclipse.cpp
engines/freescape/gfx_opengl.cpp
diff --git a/engines/freescape/games/eclipse/cpc.cpp b/engines/freescape/games/eclipse/cpc.cpp
index af4b79bc4ed..053bb2250c4 100644
--- a/engines/freescape/games/eclipse/cpc.cpp
+++ b/engines/freescape/games/eclipse/cpc.cpp
@@ -56,7 +56,7 @@ void EclipseEngine::loadAssetsCPCDemo() {
loadFonts(&file, 0x63ce);
load8bitBinary(&file, 0x65c6, 16);
for (auto &it : _areaMap) {
- it._value->_name = "Now training";
+ it._value->_name = " NOW TRAINING ";
it._value->addStructure(_areaMap[255]);
for (int16 id = 183; id < 207; id++)
it._value->addObjectFromArea(id, _areaMap[255]);
@@ -85,11 +85,16 @@ void EclipseEngine::drawCPCUI(Graphics::Surface *surface) {
_gfx->readFromPalette(color, r, g, b);
uint32 back = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
+ color = _currentArea->_inkColor;
+
+ _gfx->readFromPalette(color, r, g, b);
+ uint32 other = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
+
int score = _gameStateVars[k8bitVariableScore];
if (!_currentAreaMessages.empty())
- drawStringInSurface(_currentAreaMessages[0], 102, 135, front, back, surface);
- drawStringInSurface(Common::String::format("%07d", score), 136, 6, front, back, surface);
+ drawStringInSurface(_currentAreaMessages[0], 102, 135, back, front, surface);
+ drawStringInSurface(Common::String::format("%08d", score), 136, 6, back, other, surface);
}
} // End of namespace Freescape
\ No newline at end of file
diff --git a/engines/freescape/games/eclipse/eclipse.cpp b/engines/freescape/games/eclipse/eclipse.cpp
index cb653368cd6..88e8b410961 100644
--- a/engines/freescape/games/eclipse/eclipse.cpp
+++ b/engines/freescape/games/eclipse/eclipse.cpp
@@ -103,7 +103,8 @@ void EclipseEngine::gotoArea(uint16 areaID, int entranceID) {
_gfx->_keyColor = 255;
swapPalette(areaID);
- //_currentArea->_skyColor = isCPC() ? 1 : 0;
+ if (isDemo())
+ _currentArea->_skyColor = 27;
_currentArea->_usualBackgroundColor = isCPC() ? 1 : 0;
resetInput();
diff --git a/engines/freescape/gfx_opengl.cpp b/engines/freescape/gfx_opengl.cpp
index f6eafa711bc..06f1ec70274 100644
--- a/engines/freescape/gfx_opengl.cpp
+++ b/engines/freescape/gfx_opengl.cpp
@@ -334,8 +334,10 @@ void OpenGLRenderer::setStippleData(byte *data) {
void OpenGLRenderer::useStipple(bool enabled) {
if (enabled) {
+ GLfloat factor = 0;
+ glGetFloatv(GL_POLYGON_OFFSET_FACTOR, &factor);
glEnable(GL_POLYGON_OFFSET_FILL);
- glPolygonOffset(0.0f, -1.0f);
+ glPolygonOffset(factor - 1.0f, -1.0f);
glEnable(GL_POLYGON_STIPPLE);
if (_renderMode == Common::kRenderZX ||
_renderMode == Common::kRenderCPC ||
More information about the Scummvm-git-logs
mailing list