[Scummvm-git-logs] scummvm master -> 5c201b470b701d5d6920a248539961f8d6f038ba
neuromancer
noreply at scummvm.org
Sun Oct 6 20:15:28 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:
1a681566b1 FREESCAPE: improved energy metter in castle
5c201b470b FREESCAPE: small ui fixes for castle zx
Commit: 1a681566b1648295717306552ca8381cf894d326
https://github.com/scummvm/scummvm/commit/1a681566b1648295717306552ca8381cf894d326
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-10-06T22:17:02+02:00
Commit Message:
FREESCAPE: improved energy metter in castle
Changed paths:
engines/freescape/games/castle/castle.cpp
diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index b1c00d63db5..49fd7e423d1 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -349,7 +349,7 @@ void CastleEngine::initGameState() {
FreescapeEngine::initGameState();
_playerHeightNumber = 1;
- _gameStateVars[k8bitVariableShield] = 16;
+ _gameStateVars[k8bitVariableShield] = 20;
_gameStateVars[k8bitVariableEnergy] = 1;
_countdown = INT_MAX;
_keysCollected.clear();
@@ -854,31 +854,31 @@ void CastleEngine::drawEnergyMeter(Graphics::Surface *surface, Common::Point ori
int frameIdx = -1;
weightPoint = Common::Point(origin.x + 10, origin.y);
- frameIdx = 3 - _gameStateVars[k8bitVariableShield] % 4;
- frameIdx++;
- frameIdx = frameIdx % 4;
+ frameIdx = 4 - _gameStateVars[k8bitVariableShield] % 5;
if (_strenghtWeightsFrames.empty())
return;
- surface->copyRectToSurface((const Graphics::Surface)*_strenghtWeightsFrames[frameIdx], weightPoint.x, weightPoint.y, Common::Rect(0, 0, 3, _strenghtWeightsFrames[frameIdx]->h));
- weightPoint += Common::Point(3, 0);
+ if (frameIdx != 4) {
+ surface->copyRectToSurfaceWithKey((const Graphics::Surface)*_strenghtWeightsFrames[frameIdx], weightPoint.x, weightPoint.y, Common::Rect(0, 0, 3, _strenghtWeightsFrames[frameIdx]->h), black);
+ weightPoint += Common::Point(3, 0);
+ }
- for (int i = 0; i < _gameStateVars[k8bitVariableShield] / 4 - 1; i++) {
- surface->copyRectToSurface((const Graphics::Surface)*_strenghtWeightsFrames[0], weightPoint.x, weightPoint.y, Common::Rect(0, 0, 3, _strenghtWeightsFrames[0]->h));
+ for (int i = 0; i < _gameStateVars[k8bitVariableShield] / 5; i++) {
+ surface->copyRectToSurfaceWithKey((const Graphics::Surface)*_strenghtWeightsFrames[0], weightPoint.x, weightPoint.y, Common::Rect(0, 0, 3, _strenghtWeightsFrames[0]->h), black);
weightPoint += Common::Point(3, 0);
}
weightPoint = Common::Point(origin.x + 62, origin.y);
- frameIdx = 3 - _gameStateVars[k8bitVariableShield] % 4;
- frameIdx++;
- frameIdx = frameIdx % 4;
+ frameIdx = 4 - _gameStateVars[k8bitVariableShield] % 5;
- surface->copyRectToSurface((const Graphics::Surface)*_strenghtWeightsFrames[frameIdx], weightPoint.x, weightPoint.y, Common::Rect(0, 0, 3, _strenghtWeightsFrames[frameIdx]->h));
- weightPoint += Common::Point(-3, 0);
+ if (frameIdx != 4) {
+ surface->copyRectToSurfaceWithKey((const Graphics::Surface)*_strenghtWeightsFrames[frameIdx], weightPoint.x, weightPoint.y, Common::Rect(0, 0, 3, _strenghtWeightsFrames[frameIdx]->h), black);
+ weightPoint += Common::Point(-3, 0);
+ }
- for (int i = 0; i < _gameStateVars[k8bitVariableShield] / 4 - 1; i++) {
- surface->copyRectToSurface((const Graphics::Surface)*_strenghtWeightsFrames[0], weightPoint.x, weightPoint.y, Common::Rect(0, 0, 3, _strenghtWeightsFrames[0]->h));
+ for (int i = 0; i < _gameStateVars[k8bitVariableShield] / 5; i++) {
+ surface->copyRectToSurfaceWithKey((const Graphics::Surface)*_strenghtWeightsFrames[0], weightPoint.x, weightPoint.y, Common::Rect(0, 0, 3, _strenghtWeightsFrames[0]->h), black);
weightPoint += Common::Point(-3, 0);
}
}
Commit: 5c201b470b701d5d6920a248539961f8d6f038ba
https://github.com/scummvm/scummvm/commit/5c201b470b701d5d6920a248539961f8d6f038ba
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-10-06T22:17:02+02:00
Commit Message:
FREESCAPE: small ui fixes for castle zx
Changed paths:
engines/freescape/games/castle/castle.cpp
engines/freescape/games/castle/zx.cpp
diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index 49fd7e423d1..0aaa2554ba2 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -842,12 +842,15 @@ void CastleEngine::drawEnergyMeter(Graphics::Surface *surface, Common::Point ori
if (!_strenghtBackgroundFrame)
return;
-
surface->copyRectToSurface((const Graphics::Surface)*_strenghtBackgroundFrame, origin.x, origin.y, Common::Rect(0, 0, _strenghtBackgroundFrame->w, _strenghtBackgroundFrame->h));
if (!_strenghtBarFrame)
return;
uint32 black = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x00, 0x00, 0x00);
+ uint32 back = 0;
+
+ if (isDOS())
+ back = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x00, 0x00, 0x00);
surface->copyRectToSurfaceWithKey((const Graphics::Surface)*_strenghtBarFrame, origin.x + 5, origin.y + 8, Common::Rect(0, 0, _strenghtBarFrame->w, _strenghtBarFrame->h), black);
Common::Point weightPoint;
@@ -860,12 +863,12 @@ void CastleEngine::drawEnergyMeter(Graphics::Surface *surface, Common::Point ori
return;
if (frameIdx != 4) {
- surface->copyRectToSurfaceWithKey((const Graphics::Surface)*_strenghtWeightsFrames[frameIdx], weightPoint.x, weightPoint.y, Common::Rect(0, 0, 3, _strenghtWeightsFrames[frameIdx]->h), black);
+ surface->copyRectToSurfaceWithKey((const Graphics::Surface)*_strenghtWeightsFrames[frameIdx], weightPoint.x, weightPoint.y, Common::Rect(0, 0, 3, _strenghtWeightsFrames[frameIdx]->h), back);
weightPoint += Common::Point(3, 0);
}
for (int i = 0; i < _gameStateVars[k8bitVariableShield] / 5; i++) {
- surface->copyRectToSurfaceWithKey((const Graphics::Surface)*_strenghtWeightsFrames[0], weightPoint.x, weightPoint.y, Common::Rect(0, 0, 3, _strenghtWeightsFrames[0]->h), black);
+ surface->copyRectToSurfaceWithKey((const Graphics::Surface)*_strenghtWeightsFrames[0], weightPoint.x, weightPoint.y, Common::Rect(0, 0, 3, _strenghtWeightsFrames[0]->h), back);
weightPoint += Common::Point(3, 0);
}
@@ -873,12 +876,12 @@ void CastleEngine::drawEnergyMeter(Graphics::Surface *surface, Common::Point ori
frameIdx = 4 - _gameStateVars[k8bitVariableShield] % 5;
if (frameIdx != 4) {
- surface->copyRectToSurfaceWithKey((const Graphics::Surface)*_strenghtWeightsFrames[frameIdx], weightPoint.x, weightPoint.y, Common::Rect(0, 0, 3, _strenghtWeightsFrames[frameIdx]->h), black);
+ surface->copyRectToSurfaceWithKey((const Graphics::Surface)*_strenghtWeightsFrames[frameIdx], weightPoint.x, weightPoint.y, Common::Rect(0, 0, 3, _strenghtWeightsFrames[frameIdx]->h), back);
weightPoint += Common::Point(-3, 0);
}
for (int i = 0; i < _gameStateVars[k8bitVariableShield] / 5; i++) {
- surface->copyRectToSurfaceWithKey((const Graphics::Surface)*_strenghtWeightsFrames[0], weightPoint.x, weightPoint.y, Common::Rect(0, 0, 3, _strenghtWeightsFrames[0]->h), black);
+ surface->copyRectToSurfaceWithKey((const Graphics::Surface)*_strenghtWeightsFrames[0], weightPoint.x, weightPoint.y, Common::Rect(0, 0, 3, _strenghtWeightsFrames[0]->h), back);
weightPoint += Common::Point(-3, 0);
}
}
diff --git a/engines/freescape/games/castle/zx.cpp b/engines/freescape/games/castle/zx.cpp
index f4079e25c96..89f55c26ed0 100644
--- a/engines/freescape/games/castle/zx.cpp
+++ b/engines/freescape/games/castle/zx.cpp
@@ -158,7 +158,7 @@ void CastleEngine::loadAssetsZXFullGame() {
_gfx->readFromPalette(7, r, g, b);
uint32 white = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
- _keysBorderFrames.push_back(loadFrameWithHeader(&file, 0xdf7, white, red));
+ _keysBorderFrames.push_back(loadFrameWithHeader(&file, 0xdf7, red, white));
uint32 green = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0, 0xff, 0);
_spiritsMeterIndicatorFrame = loadFrameWithHeader(&file, _language == Common::ES_ESP ? 0xe5e : 0xe4f, green, white);
@@ -279,7 +279,8 @@ void CastleEngine::drawZXUI(Graphics::Surface *surface) {
surface->copyRectToSurface((const Graphics::Surface)*_spiritsMeterIndicatorFrame, 140 + _spiritsMeterPosition, 156, Common::Rect(0, 0, 15, 8));
drawEnergyMeter(surface, Common::Point(63, 154));
- int flagFrameIndex = (_ticks / 10) % 4;
+ int ticks = g_system->getMillis() / 20;
+ int flagFrameIndex = (ticks / 10) % 4;
surface->copyRectToSurface(*_flagFrames[flagFrameIndex], 264, 9, Common::Rect(0, 0, _flagFrames[flagFrameIndex]->w, _flagFrames[flagFrameIndex]->h));
}
More information about the Scummvm-git-logs
mailing list