[Scummvm-git-logs] scummvm master -> 4e2c2094a0aa287f747e0759cd63229480128d66
neuromancer
noreply at scummvm.org
Wed Aug 30 19:16:23 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:
b522838aa4 FREESCAPE: ui fixes for dark for cpc
4e2c2094a0 FREESCAPE: more ui fixes for dark for cpc
Commit: b522838aa47c2bfd7cdca643c7622e68f6b07f10
https://github.com/scummvm/scummvm/commit/b522838aa47c2bfd7cdca643c7622e68f6b07f10
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-08-30T20:50:15+02:00
Commit Message:
FREESCAPE: ui fixes for dark for cpc
Changed paths:
engines/freescape/games/dark/cpc.cpp
engines/freescape/games/palettes.cpp
diff --git a/engines/freescape/games/dark/cpc.cpp b/engines/freescape/games/dark/cpc.cpp
index be1f25c1df5..8d0d3a89989 100644
--- a/engines/freescape/games/dark/cpc.cpp
+++ b/engines/freescape/games/dark/cpc.cpp
@@ -29,7 +29,7 @@
namespace Freescape {
void DarkEngine::initCPC() {
- _viewArea = Common::Rect(40, 24, 279, 124);
+ _viewArea = Common::Rect(36, 24, 284, 124);
}
@@ -69,7 +69,7 @@ void DarkEngine::loadAssetsCPCFullGame() {
}
void DarkEngine::drawCPCUI(Graphics::Surface *surface) {
- uint32 color = 7;
+ uint32 color = _currentArea->_underFireBackgroundColor;
uint8 r, g, b;
_gfx->readFromPalette(color, r, g, b);
@@ -85,14 +85,14 @@ void DarkEngine::drawCPCUI(Graphics::Surface *surface) {
int score = _gameStateVars[k8bitVariableScore];
int ecds = _gameStateVars[kVariableActiveECDs];
- drawStringInSurface(Common::String::format("%04d", int(2 * _position.x())), 191, 141, front, back, surface);
- drawStringInSurface(Common::String::format("%04d", int(2 * _position.z())), 191, 149, front, back, surface);
- drawStringInSurface(Common::String::format("%04d", int(2 * _position.y())), 191, 157, front, back, surface);
+ drawStringInSurface(Common::String::format("%04d", int(2 * _position.x())), 200, 137, front, back, surface);
+ drawStringInSurface(Common::String::format("%04d", int(2 * _position.z())), 200, 137 + 9, front, back, surface);
+ drawStringInSurface(Common::String::format("%04d", int(2 * _position.y())), 200, 137 + 9, front, back, surface);
- drawStringInSurface(Common::String::format("%02d", int(_angleRotations[_angleRotationIndex])), 78, 165, front, back, surface);
- drawStringInSurface(Common::String::format("%3d", _playerSteps[_playerStepIndex]), 78, 173, front, back, surface);
- drawStringInSurface(Common::String::format("%07d", score), 94, 13, front, back, surface);
- drawStringInSurface(Common::String::format("%3d%%", ecds), 190, 13, front, back, surface);
+ drawStringInSurface(Common::String::format("%02d", int(_angleRotations[_angleRotationIndex])), 72, 168, front, back, surface);
+ drawStringInSurface(Common::String::format("%3d", _playerSteps[_playerStepIndex]), 72, 177, front, back, surface);
+ drawStringInSurface(Common::String::format("%07d", score), 94, 8, front, back, surface);
+ drawStringInSurface(Common::String::format("%3d%%", ecds), 191, 8, front, back, surface);
int seconds, minutes, hours;
getTimeFromCountdown(seconds, minutes, hours);
@@ -101,34 +101,33 @@ void DarkEngine::drawCPCUI(Graphics::Surface *surface) {
int deadline;
getLatestMessages(message, deadline);
if (deadline <= _countdown) {
- drawStringInSurface(message, 112, 173, back, front, surface);
+ drawStringInSurface(message, 112 + 5, 173 + 4, back, front, surface);
_temporaryMessages.push_back(message);
_temporaryMessageDeadlines.push_back(deadline);
} else
- drawStringInSurface(_currentArea->_name, 112, 173, front, back, surface);
+ drawStringInSurface(_currentArea->_name, 112, 173 + 4, front, back, surface);
int energy = _gameStateVars[k8bitVariableEnergy]; // called fuel in this game
int shield = _gameStateVars[k8bitVariableShield];
if (shield >= 0) {
Common::Rect shieldBar;
- shieldBar = Common::Rect(80, 140, 143 - (_maxShield - shield), 148);
+ shieldBar = Common::Rect(72, 140, 143 - (_maxShield - shield), 148);
surface->fillRect(shieldBar, back);
- shieldBar = Common::Rect(80, 141, 143 - (_maxShield - shield), 147);
+ shieldBar = Common::Rect(72, 141, 143 - (_maxShield - shield), 147);
surface->fillRect(shieldBar, front);
}
if (energy >= 0) {
Common::Rect energyBar;
- energyBar = Common::Rect(80, 147, 143 - (_maxEnergy - energy), 155);
+ energyBar = Common::Rect(72, 147, 143 - (_maxEnergy - energy), 155);
surface->fillRect(energyBar, back);
- energyBar = Common::Rect(80, 148, 143 - (_maxEnergy - energy), 154);
+ energyBar = Common::Rect(72, 148, 143 - (_maxEnergy - energy), 154);
surface->fillRect(energyBar, front);
}
- uint32 clockColor = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0x00, 0x00);
- drawBinaryClock(surface, 273, 128, clockColor, back);
+ drawBinaryClock(surface, 300, 124, front, back);
//drawIndicator(surface, 152, 140);
}
diff --git a/engines/freescape/games/palettes.cpp b/engines/freescape/games/palettes.cpp
index 9498b48b758..18f20b84097 100644
--- a/engines/freescape/games/palettes.cpp
+++ b/engines/freescape/games/palettes.cpp
@@ -74,7 +74,7 @@ byte kDrillerZXPalette[9][3] = {
};
byte kDrillerCPCPalette[32][3] = {
- {0x80, 0x80, 0x80}, // 0: special case?
+ {0x00, 0x00, 0x00}, // 0: special case?
{0x11, 0x22, 0x33},
{0x80, 0xff, 0x80}, // 2
{0xff, 0xff, 0x80}, // 3
@@ -99,7 +99,7 @@ byte kDrillerCPCPalette[32][3] = {
{0x00, 0x80, 0x00}, // 22
{0x00, 0x80, 0xff}, // 23
{0x80, 0x00, 0x80}, // 24
- {0x11, 0x22, 0x33},
+ {0x80, 0xff, 0x80}, // 25
{0x11, 0x22, 0x33},
{0x00, 0xff, 0xff}, // 27
{0x80, 0x00, 0x00}, // 28
Commit: 4e2c2094a0aa287f747e0759cd63229480128d66
https://github.com/scummvm/scummvm/commit/4e2c2094a0aa287f747e0759cd63229480128d66
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-08-30T20:50:15+02:00
Commit Message:
FREESCAPE: more ui fixes for dark for cpc
Changed paths:
engines/freescape/games/dark/cpc.cpp
engines/freescape/games/palettes.cpp
engines/freescape/gfx.cpp
diff --git a/engines/freescape/games/dark/cpc.cpp b/engines/freescape/games/dark/cpc.cpp
index 8d0d3a89989..d5a282bfc57 100644
--- a/engines/freescape/games/dark/cpc.cpp
+++ b/engines/freescape/games/dark/cpc.cpp
@@ -62,10 +62,15 @@ void DarkEngine::loadAssetsCPCFullGame() {
if (!file.isOpen())
error("Failed to open DARKCODE.BIN");
- loadMessagesFixedSize(&file, 0x5d9, 14, 20);
+ loadMessagesFixedSize(&file, 0x5d9, 16, 27);
loadFonts(&file, 0x60f3);
- loadGlobalObjects(&file, 0x9a, 8);
+ loadGlobalObjects(&file, 0x9a, 23);
load8bitBinary(&file, 0x6255, 16);
+ for (auto &it : _areaMap) {
+ addWalls(it._value);
+ addECDs(it._value);
+ addSkanner(it._value);
+ }
}
void DarkEngine::drawCPCUI(Graphics::Surface *surface) {
@@ -101,11 +106,11 @@ void DarkEngine::drawCPCUI(Graphics::Surface *surface) {
int deadline;
getLatestMessages(message, deadline);
if (deadline <= _countdown) {
- drawStringInSurface(message, 112 + 5, 173 + 4, back, front, surface);
+ drawStringInSurface(message, 111, 173 + 4, back, front, surface);
_temporaryMessages.push_back(message);
_temporaryMessageDeadlines.push_back(deadline);
} else
- drawStringInSurface(_currentArea->_name, 112, 173 + 4, front, back, surface);
+ drawStringInSurface(_currentArea->_name, 111, 173 + 4, front, back, surface);
int energy = _gameStateVars[k8bitVariableEnergy]; // called fuel in this game
int shield = _gameStateVars[k8bitVariableShield];
diff --git a/engines/freescape/games/palettes.cpp b/engines/freescape/games/palettes.cpp
index 18f20b84097..4e39c9f89b9 100644
--- a/engines/freescape/games/palettes.cpp
+++ b/engines/freescape/games/palettes.cpp
@@ -80,7 +80,7 @@ byte kDrillerCPCPalette[32][3] = {
{0xff, 0xff, 0x80}, // 3
{0x11, 0x22, 0x33},
{0xff, 0x00, 0x80}, // 5
- {0x00, 0x80, 0x00}, // 6
+ {0x00, 0x80, 0x80}, // 6
{0xff, 0x80, 0x80}, // 7
{0x11, 0x22, 0x33},
{0x11, 0x22, 0x33},
@@ -94,13 +94,13 @@ byte kDrillerCPCPalette[32][3] = {
{0x00, 0xff, 0x80}, // 17
{0x00, 0xff, 0x00}, // 18
{0x80, 0xff, 0xff}, // 19
- {0x00, 0x00, 0x00}, // 20
+ {0x80, 0x80, 0x80}, // 20
{0x00, 0x00, 0xff}, // 21
{0x00, 0x80, 0x00}, // 22
{0x00, 0x80, 0xff}, // 23
{0x80, 0x00, 0x80}, // 24
{0x80, 0xff, 0x80}, // 25
- {0x11, 0x22, 0x33},
+ {0x80, 0xff, 0x00}, // 26
{0x00, 0xff, 0xff}, // 27
{0x80, 0x00, 0x00}, // 28
{0x11, 0x22, 0x33},
diff --git a/engines/freescape/gfx.cpp b/engines/freescape/gfx.cpp
index f589958e477..db0dc6dda5c 100644
--- a/engines/freescape/gfx.cpp
+++ b/engines/freescape/gfx.cpp
@@ -339,10 +339,6 @@ bool Renderer::getRGBAtZX(uint8 index, uint8 &r1, uint8 &g1, uint8 &b1, uint8 &r
}
void Renderer::selectColorFromFourColorPalette(uint8 index, uint8 &r1, uint8 &g1, uint8 &b1) {
- if (_colorRemaps && _colorRemaps->contains(index)) {
- index = (*_colorRemaps)[index];
- }
-
if (index == 0) {
r1 = 0;
g1 = 0;
@@ -361,6 +357,10 @@ bool Renderer::getRGBAtCPC(uint8 index, uint8 &r1, uint8 &g1, uint8 &b1, uint8 &
if (index == _keyColor)
return false;
+ if (_colorRemaps && _colorRemaps->contains(index)) {
+ index = (*_colorRemaps)[index];
+ }
+
assert (_renderMode == Common::kRenderCPC);
if (index <= 4) { // Solid colors
selectColorFromFourColorPalette(index - 1, r1, g1, b1);
More information about the Scummvm-git-logs
mailing list