[Scummvm-git-logs] scummvm master -> 68ad7b064d7fc9b2f0052b3ced3d9e2982b747db
neuromancer
noreply at scummvm.org
Wed Oct 2 11:19:26 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:
30a27c1521 FREESCAPE: corrected Driller DOS UI text positions
34fbfbe28a FREESCAPE: corrected Driller ZX UI text positions
68ad7b064d FREESCAPE: corrected dark ZX UI text positions
Commit: 30a27c15218a693520ea5685c239c7f439ef97e4
https://github.com/scummvm/scummvm/commit/30a27c15218a693520ea5685c239c7f439ef97e4
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-10-02T13:20:55+02:00
Commit Message:
FREESCAPE: corrected Driller DOS UI text positions
Changed paths:
engines/freescape/games/driller/dos.cpp
diff --git a/engines/freescape/games/driller/dos.cpp b/engines/freescape/games/driller/dos.cpp
index a50802daccf..ebb4411fc28 100644
--- a/engines/freescape/games/driller/dos.cpp
+++ b/engines/freescape/games/driller/dos.cpp
@@ -438,30 +438,30 @@ void DrillerEngine::drawDOSUI(Graphics::Surface *surface) {
uint32 back = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
int score = _gameStateVars[k8bitVariableScore];
- drawStringInSurface(_currentArea->_name, 196, 185, front, back, surface);
- drawStringInSurface(Common::String::format("%04d", int(2 * _position.x())), 150, 145, front, back, surface);
- drawStringInSurface(Common::String::format("%04d", int(2 * _position.z())), 150, 153, front, back, surface);
- drawStringInSurface(Common::String::format("%04d", int(2 * _position.y())), 150, 161, front, back, surface);
+ drawStringInSurface(_currentArea->_name, 197, 185, front, back, surface);
+ drawStringInSurface(Common::String::format("%04d", int(2 * _position.x())), 151, 145, front, back, surface);
+ drawStringInSurface(Common::String::format("%04d", int(2 * _position.z())), 151, 153, front, back, surface);
+ drawStringInSurface(Common::String::format("%04d", int(2 * _position.y())), 151, 161, front, back, surface);
if (_playerHeightNumber >= 0)
drawStringInSurface(Common::String::format("%d", _playerHeightNumber), 57, 161, front, back, surface);
else
drawStringInSurface(Common::String::format("%s", "J"), 57, 161, front, back, surface);
- drawStringInSurface(Common::String::format("%02d", int(_angleRotations[_angleRotationIndex])), 46, 145, front, back, surface);
- drawStringInSurface(Common::String::format("%3d", _playerSteps[_playerStepIndex]), _renderMode == Common::kRenderCGA ? 44 : 46, 153, front, back, surface);
- drawStringInSurface(Common::String::format("%07d", score), 238, 129, front, back, surface);
+ drawStringInSurface(Common::String::format("%02d", int(_angleRotations[_angleRotationIndex])), 47, 145, front, back, surface);
+ drawStringInSurface(Common::String::format("%3d", _playerSteps[_playerStepIndex]), _renderMode == Common::kRenderCGA ? 44 : 47, 153, front, back, surface);
+ drawStringInSurface(Common::String::format("%07d", score), 239, 129, front, back, surface);
int seconds, minutes, hours;
getTimeFromCountdown(seconds, minutes, hours);
drawStringInSurface(Common::String::format("%02d", hours), 208, 8, front, back, surface);
- drawStringInSurface(Common::String::format("%02d", minutes), 230, 8, front, back, surface);
- drawStringInSurface(Common::String::format("%02d", seconds), 254, 8, front, back, surface);
+ drawStringInSurface(Common::String::format("%02d", minutes), 231, 8, front, back, surface);
+ drawStringInSurface(Common::String::format("%02d", seconds), 255, 8, front, back, surface);
Common::String message;
int deadline;
getLatestMessages(message, deadline);
if (deadline <= _countdown) {
- drawStringInSurface(message, 190, 177, back, front, surface);
+ drawStringInSurface(message, 191, 177, back, front, surface);
_temporaryMessages.push_back(message);
_temporaryMessageDeadlines.push_back(deadline);
} else {
Commit: 34fbfbe28a216f3ffec80ab00fbf3ae0dc71a83e
https://github.com/scummvm/scummvm/commit/34fbfbe28a216f3ffec80ab00fbf3ae0dc71a83e
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-10-02T13:20:55+02:00
Commit Message:
FREESCAPE: corrected Driller ZX UI text positions
Changed paths:
engines/freescape/games/driller/zx.cpp
diff --git a/engines/freescape/games/driller/zx.cpp b/engines/freescape/games/driller/zx.cpp
index 636343fdd47..7faf72addbc 100644
--- a/engines/freescape/games/driller/zx.cpp
+++ b/engines/freescape/games/driller/zx.cpp
@@ -99,15 +99,15 @@ void DrillerEngine::drawZXUI(Graphics::Surface *surface) {
int score = _gameStateVars[k8bitVariableScore];
drawStringInSurface(_currentArea->_name, 174, 188, front, back, surface);
- drawStringInSurface(Common::String::format("%04d", int(2 * _position.x())), 150, 149, front, back, surface);
- drawStringInSurface(Common::String::format("%04d", int(2 * _position.z())), 150, 157, front, back, surface);
- drawStringInSurface(Common::String::format("%04d", int(2 * _position.y())), 150, 165, front, back, surface);
+ drawStringInSurface(Common::String::format("%04d", int(2 * _position.x())), 151, 149, front, back, surface);
+ drawStringInSurface(Common::String::format("%04d", int(2 * _position.z())), 151, 157, front, back, surface);
+ drawStringInSurface(Common::String::format("%04d", int(2 * _position.y())), 151, 165, front, back, surface);
if (_playerHeightNumber >= 0)
drawStringInSurface(Common::String::format("%d", _playerHeightNumber), 72, 165, front, back, surface);
else
drawStringInSurface(Common::String::format("%s", "J"), 72, 165, front, back, surface);
- drawStringInSurface(Common::String::format("%02d", int(_angleRotations[_angleRotationIndex])), 62, 149, front, back, surface);
+ drawStringInSurface(Common::String::format("%02d", int(_angleRotations[_angleRotationIndex])), 63, 149, front, back, surface);
drawStringInSurface(Common::String::format("%3d", _playerSteps[_playerStepIndex]), 63, 157, front, back, surface);
drawStringInSurface(Common::String::format("%07d", score), 215, 133, white, back, surface);
@@ -115,13 +115,13 @@ void DrillerEngine::drawZXUI(Graphics::Surface *surface) {
getTimeFromCountdown(seconds, minutes, hours);
drawStringInSurface(Common::String::format("%02d", hours), 185, 12, front, back, surface);
drawStringInSurface(Common::String::format("%02d", minutes), 207, 12, front, back, surface);
- drawStringInSurface(Common::String::format("%02d", seconds), 230, 12, front, back, surface);
+ drawStringInSurface(Common::String::format("%02d", seconds), 231, 12, front, back, surface);
Common::String message;
int deadline;
getLatestMessages(message, deadline);
if (deadline <= _countdown) {
- drawStringInSurface(message, 167, 181, back, front, surface);
+ drawStringInSurface(message, 168, 181, back, front, surface);
_temporaryMessages.push_back(message);
_temporaryMessageDeadlines.push_back(deadline);
} else {
@@ -132,7 +132,7 @@ void DrillerEngine::drawZXUI(Graphics::Surface *surface) {
else
message = _messagesList[1];
- drawStringInSurface(message, 167, 181, front, back, surface);
+ drawStringInSurface(message, 168, 181, front, back, surface);
}
int energy = _gameStateVars[k8bitVariableEnergy];
Commit: 68ad7b064d7fc9b2f0052b3ced3d9e2982b747db
https://github.com/scummvm/scummvm/commit/68ad7b064d7fc9b2f0052b3ced3d9e2982b747db
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-10-02T13:20:55+02:00
Commit Message:
FREESCAPE: corrected dark ZX UI text positions
Changed paths:
engines/freescape/font.cpp
engines/freescape/games/dark/zx.cpp
diff --git a/engines/freescape/font.cpp b/engines/freescape/font.cpp
index 8db79102e51..c4dd5b03169 100644
--- a/engines/freescape/font.cpp
+++ b/engines/freescape/font.cpp
@@ -25,70 +25,75 @@
namespace Freescape {
Font::Font() {
- _backgroundColor = 0;
- _secondaryColor = 0;
- _kerningOffset = 0;
- _chars.clear();
+ _backgroundColor = 0;
+ _secondaryColor = 0;
+ _kerningOffset = 0;
+ _chars.clear();
}
Font::Font(Common::Array<Graphics::ManagedSurface *> &chars) {
- _chars = chars;
- _backgroundColor = 0;
- _secondaryColor = 0;
- _kerningOffset = 0;
+ _chars = chars;
+ _backgroundColor = 0;
+ _secondaryColor = 0;
+ _kerningOffset = 0;
}
Font::~Font() {
- /*for (Graphics::ManagedSurface *surface : _chars) {
- surface->free();
- delete surface;
- }*/
+ /*for (Graphics::ManagedSurface *surface : _chars) {
+ surface->free();
+ delete surface;
+ }*/
}
int Font::getCharWidth(uint32 chr) const {
- return 8;
+ return 8;
}
int Font::getMaxCharWidth() const {
- return getCharWidth(0);
+ return getCharWidth(0);
}
int Font::getFontHeight() const {
- return _chars[0]->h + 1;
+ return _chars[0]->h + 1;
}
void Font::setSecondaryColor(uint32 color) {
- _secondaryColor = color;
+ _secondaryColor = color;
}
void Font::setBackground(uint32 color) {
- _backgroundColor = color;
+ _backgroundColor = color;
}
void Font::drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const {
- assert(chr >= 32);
- chr -= 32;
+ assert(chr >= 32);
+ chr -= 32;
- Graphics::ManagedSurface surface = Graphics::ManagedSurface();
- surface.copyFrom(*_chars[chr]);
+ Graphics::ManagedSurface surface = Graphics::ManagedSurface();
+ surface.copyFrom(*_chars[chr]);
- uint8 rb, gb, bb;
- uint8 rp, gp, bp;
- uint8 rs, gs, bs;
+ uint8 rb, gb, bb;
+ uint8 rp, gp, bp;
+ uint8 rs, gs, bs;
- dst->format.colorToRGB(color, rp, gp, bp);
- dst->format.colorToRGB(_secondaryColor, rs, gs, bs);
- dst->format.colorToRGB(_backgroundColor, rb, gb, bb);
+ dst->format.colorToRGB(color, rp, gp, bp);
+ dst->format.colorToRGB(_secondaryColor, rs, gs, bs);
+ dst->format.colorToRGB(_backgroundColor, rb, gb, bb);
- byte palette[3][3] = {
- { rb, gb, bb },
- { rp, gp, bp },
- { rs, gs, bs },
- };
+ byte palette[3][3] = {
+ { rb, gb, bb },
+ { rp, gp, bp },
+ { rs, gs, bs },
+ };
- surface.convertToInPlace(dst->format, (byte *)palette, 3);
- dst->copyRectToSurfaceWithKey(surface, x, y, Common::Rect(0, 0, 8, surface.h), surface.getTransparentColor());
- surface.free();
+ surface.convertToInPlace(dst->format, (byte *)palette, 3);
+
+ if (_backgroundColor == 0 )
+ dst->copyRectToSurfaceWithKey(surface, x, y, Common::Rect(0, 0, 8, surface.h), dst->format.ARGBToColor(0xFF, 0x00, 0x00, 0x00));
+ else
+ dst->copyRectToSurface(surface, x, y, Common::Rect(0, 0, 8, surface.h));
+
+ surface.free();
}
Common::Array<Graphics::ManagedSurface *> FreescapeEngine::getChars(Common::SeekableReadStream *file, int offset, int charsNumber) {
@@ -172,6 +177,7 @@ void FreescapeEngine::drawStringInSurface(const Common::String &str, int x, int
void FreescapeEngine::drawStringInSurface(const Common::String &str, int x, int y, uint32 primaryColor, uint32 secondaryColor, uint32 backColor, Graphics::Surface *surface, int offset) {
Common::String ustr = str;
ustr.toUppercase();
+ _font.setBackground(backColor);
_font.setSecondaryColor(secondaryColor);
_font.drawString(surface, ustr, x, y, _screenW, primaryColor);
}
diff --git a/engines/freescape/games/dark/zx.cpp b/engines/freescape/games/dark/zx.cpp
index ec2b0bbc0b2..b3c64a56eb6 100644
--- a/engines/freescape/games/dark/zx.cpp
+++ b/engines/freescape/games/dark/zx.cpp
@@ -138,17 +138,22 @@ void DarkEngine::drawZXUI(Graphics::Surface *surface) {
_gfx->readFromPalette(color, r, g, b);
uint32 back = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
+ uint32 transparent = _gfx->_texturePixelFormat.ARGBToColor(0x00, 0x00, 0x00, 0x00);
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("%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);
+ surface->fillRect(Common::Rect(193, 140, 223, 163), back);
+ drawStringInSurface(Common::String::format("%04d", int(2 * _position.x())), 191, 141, front, transparent, surface);
+ drawStringInSurface(Common::String::format("%04d", int(2 * _position.z())), 191, 149, front, transparent, surface);
+ drawStringInSurface(Common::String::format("%04d", int(2 * _position.y())), 191, 157, front, transparent, surface);
+
+ surface->fillRect(Common::Rect(80, 165, 95, 171), back);
+ surface->fillRect(Common::Rect(80, 172, 102, 178), back);
+ drawStringInSurface(Common::String::format("%02d", int(_angleRotations[_angleRotationIndex])), 79, 165, front, transparent, surface);
+ drawStringInSurface(Common::String::format("%3d", _playerSteps[_playerStepIndex]), 79, 173, front, transparent, surface);
+ surface->fillRect(Common::Rect(96, 12, 151, 18), back);
+ drawStringInSurface(Common::String::format("%07d", score), 95, 13, front, transparent, surface);
+ drawStringInSurface(Common::String::format("%3d%%", ecds), 191, 13, front, back, surface);
int seconds, minutes, hours;
getTimeFromCountdown(seconds, minutes, hours);
More information about the Scummvm-git-logs
mailing list