[Scummvm-git-logs] scummvm master -> 0eee24e2e6c0f02b98de5c1372171ad39dbf40a8
neuromancer
noreply at scummvm.org
Sun May 26 11:42:00 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:
3337e14f30 FREESCAPE: tweaks for tinygl rendering
02a32906c3 FREESCAPE: better rendering of riddles
0eee24e2e6 FREESCAPE: initial implementation of shield metter for castle (dos, ega)
Commit: 3337e14f30b9e6967b251e98b690d6a62e466a6a
https://github.com/scummvm/scummvm/commit/3337e14f30b9e6967b251e98b690d6a62e466a6a
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-05-26T13:34:23+02:00
Commit Message:
FREESCAPE: tweaks for tinygl rendering
Changed paths:
engines/freescape/area.cpp
engines/freescape/gfx_tinygl.cpp
diff --git a/engines/freescape/area.cpp b/engines/freescape/area.cpp
index ff3d584bb5b..76ffb7513db 100644
--- a/engines/freescape/area.cpp
+++ b/engines/freescape/area.cpp
@@ -228,7 +228,7 @@ void Area::draw(Freescape::Renderer *gfx, uint32 animationTicks, Math::Vector3d
ObjectArray planarObjects;
ObjectArray nonPlanarObjects;
Object *floor = nullptr;
- float offset = !gfx->_isAccelerated ? 1.0 : 0.5;
+ float offset = !gfx->_isAccelerated ? 2.0 : 0.5;
for (auto &obj : _drawableObjects) {
if (!obj->isDestroyed() && !obj->isInvisible()) {
diff --git a/engines/freescape/gfx_tinygl.cpp b/engines/freescape/gfx_tinygl.cpp
index 2ba7455d5bc..372ecd17b62 100644
--- a/engines/freescape/gfx_tinygl.cpp
+++ b/engines/freescape/gfx_tinygl.cpp
@@ -282,7 +282,7 @@ void TinyGLRenderer::depthTesting(bool enabled) {
void TinyGLRenderer::polygonOffset(bool enabled) {
if (enabled) {
tglEnable(TGL_POLYGON_OFFSET_FILL);
- tglPolygonOffset(-2.0f, 1.0f);
+ tglPolygonOffset(-10.0f, 1.0f);
} else {
tglPolygonOffset(0, 0);
tglDisable(TGL_POLYGON_OFFSET_FILL);
Commit: 02a32906c3e06df9cc3cb3960ee737e59009aa1c
https://github.com/scummvm/scummvm/commit/02a32906c3e06df9cc3cb3960ee737e59009aa1c
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-05-26T13:34:23+02:00
Commit Message:
FREESCAPE: better rendering of riddles
Changed paths:
engines/freescape/games/castle/castle.cpp
engines/freescape/games/castle/dos.cpp
diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index fd3b9a33d1a..d5dae35978d 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -216,7 +216,7 @@ void CastleEngine::executePrint(FCLInstruction &instruction) {
_currentAreaMessages.clear();
if (index > 129) {
index = index - 129;
- if (index < _riddleList.size())
+ if (index < _riddleList.size() / 6)
drawFullscreenRiddleAndWait(index);
else
debugC(1, kFreescapeDebugCode, "Riddle index %d out of bounds", index);
@@ -359,21 +359,23 @@ void CastleEngine::drawRiddle(uint16 riddle, uint32 front, uint32 back, Graphics
uint32 noColor = _gfx->_texturePixelFormat.ARGBToColor(0x00, 0x00, 0x00, 0x00);
uint32 black = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x00, 0x00, 0x00);
+ uint32 grey = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x60, 0x60, 0x60);
uint32 frame = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xA7, 0xA7, 0xA7);
surface->fillRect(_fullscreenViewArea, noColor);
surface->fillRect(_viewArea, black);
+ surface->fillRect(Common::Rect(47, 47, 271, 147), grey);
surface->frameRect(Common::Rect(47, 47, 271, 147), frame);
surface->frameRect(Common::Rect(53, 53, 266, 141), frame);
- surface->fillRect(Common::Rect(54, 54, 266, 139), back);
+ surface->fillRect(Common::Rect(54, 54, 265, 140), back);
int x = 0;
int y = 0;
int numberOfLines = 6;
if (isDOS()) {
- x = 58;
+ x = 60;
y = 66;
} else if (isSpectrum() || isCPC()) {
x = 60;
diff --git a/engines/freescape/games/castle/dos.cpp b/engines/freescape/games/castle/dos.cpp
index b3fa4e3e065..dd400bafef3 100644
--- a/engines/freescape/games/castle/dos.cpp
+++ b/engines/freescape/games/castle/dos.cpp
@@ -101,6 +101,7 @@ void CastleEngine::loadAssetsDOSFullGame() {
loadFonts(kFreescapeCastleFont, 59);
loadMessagesVariableSize(stream, 0x11, 164);
+ loadRiddles(stream, 0xaae, 11);
delete stream;
stream = decryptFile("CMEDF");
Commit: 0eee24e2e6c0f02b98de5c1372171ad39dbf40a8
https://github.com/scummvm/scummvm/commit/0eee24e2e6c0f02b98de5c1372171ad39dbf40a8
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-05-26T13:34:23+02:00
Commit Message:
FREESCAPE: initial implementation of shield metter for castle (dos, ega)
Changed paths:
engines/freescape/games/castle/castle.cpp
engines/freescape/games/castle/castle.h
engines/freescape/games/castle/dos.cpp
diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index d5dae35978d..6c87881fc09 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -44,6 +44,7 @@ CastleEngine::CastleEngine(OSystem *syst, const ADGameDescription *gd) : Freesca
_playerDepth = 8;
_stepUpDistance = 32;
_maxFallingDistance = 8192;
+ _maxShield = 24;
_option = nullptr;
}
@@ -164,7 +165,7 @@ void CastleEngine::initGameState() {
_playerHeightNumber = 1;
_playerHeight = _playerHeights[_playerHeightNumber];
- _gameStateVars[k8bitVariableShield] = 1;
+ _gameStateVars[k8bitVariableShield] = 16;
_gameStateVars[k8bitVariableEnergy] = 1;
_countdown = INT_MAX;
}
@@ -389,6 +390,37 @@ void CastleEngine::drawRiddle(uint16 riddle, uint32 front, uint32 back, Graphics
drawFullscreenSurface(surface);
}
+void CastleEngine::drawEnergyMeter(Graphics::Surface *surface) {
+ uint32 back = 0;
+ uint32 black = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x00, 0x00, 0x00);
+ Common::Rect weightRect;
+ Common::Rect barRect;
+ Common::Rect backRect;
+
+ if (isDOS()) {
+ back = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xA7, 0x00, 0x00);
+ barRect = Common::Rect(45, 164, 110, 166);
+ weightRect = Common::Rect(57, 158, 59, 172);
+ backRect = Common::Rect(45, 157, 112, 173);
+ if (_gameStateVars[k8bitVariableShield] > 16)
+ weightRect.translate(3, 0);
+ }
+ surface->fillRect(backRect, black);
+ surface->fillRect(barRect, back);
+
+ for (int i = 0; i < _gameStateVars[k8bitVariableShield] / 4; i++) {
+ surface->fillRect(weightRect, back);
+ weightRect.translate(-3, 0);
+ }
+
+ uint8 remainder = 3 - _gameStateVars[k8bitVariableShield] % 4;
+ if (remainder < 3) {
+ weightRect.translate(0, remainder / 2);
+ weightRect.setHeight(weightRect.height() - remainder);
+ surface->fillRect(weightRect, back);
+ }
+}
+
void CastleEngine::addGhosts() {
for (auto &it : _areaMap) {
for (auto &sensor : it._value->getSensors()) {
diff --git a/engines/freescape/games/castle/castle.h b/engines/freescape/games/castle/castle.h
index c796c79e7dc..b354594c070 100644
--- a/engines/freescape/games/castle/castle.h
+++ b/engines/freescape/games/castle/castle.h
@@ -34,6 +34,7 @@ public:
void loadAssetsAmigaDemo() override;
void drawDOSUI(Graphics::Surface *surface) override;
+ void drawEnergyMeter(Graphics::Surface *surface);
void pressedKey(const int keycode) override;
void checkSensors() override;
diff --git a/engines/freescape/games/castle/dos.cpp b/engines/freescape/games/castle/dos.cpp
index dd400bafef3..fc4e7a3f207 100644
--- a/engines/freescape/games/castle/dos.cpp
+++ b/engines/freescape/games/castle/dos.cpp
@@ -212,6 +212,8 @@ void CastleEngine::drawDOSUI(Graphics::Surface *surface) {
_temporaryMessageDeadlines.push_back(deadline);
} else
drawStringInSurface(_currentArea->_name, 97, 182, front, back, surface);
+
+ drawEnergyMeter(surface);
}
} // End of namespace Freescape
More information about the Scummvm-git-logs
mailing list