[Scummvm-git-logs] scummvm master -> 3a570f2795b4ff0fcbce44bc6457d92ef7587b4e
neuromancer
noreply at scummvm.org
Sat Jun 21 14:32:27 UTC 2025
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
8d66f251a3 FREESCAPE: small fixes for the driller amiga UI
3a570f2795 FREESCAPE: added missing indicators for driller amiga/atari
Commit: 8d66f251a352821356ef9f48b65f1489af06510d
https://github.com/scummvm/scummvm/commit/8d66f251a352821356ef9f48b65f1489af06510d
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2025-06-21T16:32:46+02:00
Commit Message:
FREESCAPE: small fixes for the driller amiga UI
Changed paths:
engines/freescape/font.cpp
engines/freescape/freescape.h
engines/freescape/games/dark/amiga.cpp
engines/freescape/games/dark/atari.cpp
engines/freescape/games/driller/amiga.cpp
engines/freescape/games/driller/driller.h
engines/freescape/ui.cpp
diff --git a/engines/freescape/font.cpp b/engines/freescape/font.cpp
index 73969bab488..dbb9b3dc0fd 100644
--- a/engines/freescape/font.cpp
+++ b/engines/freescape/font.cpp
@@ -34,6 +34,28 @@ Common::String shiftStr(const Common::String &str, int shift) {
return result;
}
+Common::String centerAndPadString(const Common::String &str, int size) {
+ Common::String result;
+
+ if (int(str.size()) >= size)
+ return str;
+
+ int padding = (size - str.size()) / 2;
+ for (int i = 0; i < padding; i++)
+ result += " ";
+
+ result += str;
+
+ if (int(result.size()) >= size)
+ return result;
+
+ padding = size - result.size();
+
+ for (int i = 0; i < padding; i++)
+ result += " ";
+ return result;
+}
+
Font::Font() {
_backgroundColor = 0;
_secondaryColor = 0;
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index b8fd12a8ddf..228ce703780 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -137,6 +137,7 @@ struct CGAPaletteEntry {
};
extern Common::String shiftStr(const Common::String &str, int shift);
+extern Common::String centerAndPadString(const Common::String &str, int size);
class EventManagerWrapper {
public:
diff --git a/engines/freescape/games/dark/amiga.cpp b/engines/freescape/games/dark/amiga.cpp
index 31e337664cb..53468acdd33 100644
--- a/engines/freescape/games/dark/amiga.cpp
+++ b/engines/freescape/games/dark/amiga.cpp
@@ -26,8 +26,6 @@
namespace Freescape {
-extern Common::String centerAndPadString(const Common::String &str, int size);
-
void DarkEngine::loadAssetsAmigaFullGame() {
Common::File file;
file.open("0.drk");
diff --git a/engines/freescape/games/dark/atari.cpp b/engines/freescape/games/dark/atari.cpp
index e461e1f7ccf..f7f52cb525d 100644
--- a/engines/freescape/games/dark/atari.cpp
+++ b/engines/freescape/games/dark/atari.cpp
@@ -26,28 +26,6 @@
namespace Freescape {
-Common::String centerAndPadString(const Common::String &str, int size) {
- Common::String result;
-
- if (int(str.size()) >= size)
- return str;
-
- int padding = (size - str.size()) / 2;
- for (int i = 0; i < padding; i++)
- result += " ";
-
- result += str;
-
- if (int(result.size()) >= size)
- return result;
-
- padding = size - result.size();
-
- for (int i = 0; i < padding; i++)
- result += " ";
- return result;
-}
-
void DarkEngine::loadAssetsAtariFullGame() {
Common::File file;
file.open("0.drk");
diff --git a/engines/freescape/games/driller/amiga.cpp b/engines/freescape/games/driller/amiga.cpp
index ad371ae79b8..17812565f6f 100644
--- a/engines/freescape/games/driller/amiga.cpp
+++ b/engines/freescape/games/driller/amiga.cpp
@@ -38,6 +38,12 @@ void DrillerEngine::loadAssetsAmigaFullGame() {
_title = loadAndConvertNeoImage(&file, 0xce);
loadFonts(&file, 0x8940);
+
+ Common::Array<Graphics::ManagedSurface *> chars;
+ chars = getCharsAmigaAtariInternal(8, 8, -3, 33, 32, &file, 0x8940 + 112 * 33 + 1, 100);
+ _fontSmall = Font(chars);
+ _fontSmall.setCharWidth(5);
+
loadMessagesFixedSize(&file, 0xc66e, 14, 20);
loadGlobalObjects(&file, 0xbd62, 8);
load8bitBinary(&file, 0x29c16, 16);
@@ -76,6 +82,12 @@ void DrillerEngine::loadAssetsAmigaFullGame() {
loadSoundsFx(&file, 0, 25);
} else
error("Invalid or unknown Amiga release");
+
+
+ for (auto &area : _areaMap) {
+ // Center and pad each area name so we do not have to do it at each frame
+ area._value->_name = centerAndPadString(area._value->_name, 14);
+ }
}
void DrillerEngine::loadAssetsAmigaDemo() {
@@ -141,6 +153,8 @@ void DrillerEngine::drawAmigaAtariSTUI(Graphics::Surface *surface) {
uint32 yellow = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0x55);
uint32 brownish = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x9E, 0x80, 0x20);
uint32 brown = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x7E, 0x60, 0x19);
+ uint32 red = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xE0, 0x00, 0x00);
+ uint32 redish = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xE0, 0x60, 0x20);
uint32 primaryFontColor = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xA0, 0x80, 0x00);
uint32 secondaryFontColor = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x60, 0x40, 0x00);
uint32 black = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x00, 0x00, 0x00);
@@ -151,23 +165,21 @@ void DrillerEngine::drawAmigaAtariSTUI(Graphics::Surface *surface) {
// It seems that some demos will not include the complete font
if (!isDemo() || (_variant & GF_AMIGA_MAGAZINE_DEMO) || (_variant & GF_ATARI_MAGAZINE_DEMO)) {
- drawStringInSurface("x", 37, 18, white, transparent, transparent, surface, 82);
+
+ drawString(kDrillerFontSmall, ":", 38, 18, white, white, transparent, surface); // ":" is the next character to "9" representing "x"
coords = Common::String::format("%04d", 2 * int(_position.x()));
- for (int i = 0; i < 4; i++)
- drawStringInSurface(Common::String(coords[i]), 47 + 6*i, 18, white, transparent, transparent, surface, 112);
+ drawString(kDrillerFontSmall, coords, 47, 18, white, transparent, transparent, surface);
- drawStringInSurface("y", 37, 26, white, transparent, transparent, surface, 82);
+ drawString(kDrillerFontSmall, ";", 37, 26, white, white, transparent, surface); // ";" is the next character to ":" representing "y"
coords = Common::String::format("%04d", 2 * int(_position.z())); // Coords y and z are swapped!
- for (int i = 0; i < 4; i++)
- drawStringInSurface(Common::String(coords[i]), 47 + 6*i, 26, white, transparent, transparent, surface, 112);
+ drawString(kDrillerFontSmall, coords, 47, 26, white, transparent, transparent, surface);
- drawStringInSurface("z", 37, 34, white, transparent, transparent, surface, 82);
+ drawString(kDrillerFontSmall, "<", 37, 34, white, white, transparent, surface); // "<" is the next character to ";" representing "z"
coords = Common::String::format("%04d", 2 * int(_position.y())); // Coords y and z are swapped!
- for (int i = 0; i < 4; i++)
- drawStringInSurface(Common::String(coords[i]), 47 + 6*i, 34, white, transparent, transparent, surface, 112);
+ drawString(kDrillerFontSmall, coords, 47, 34, white, transparent, transparent, surface);
}
- drawStringInSurface(_currentArea->_name, 188, 185, primaryFontColor, secondaryFontColor, black, surface);
+ drawStringInSurface(_currentArea->_name, 189, 185, primaryFontColor, secondaryFontColor, black, surface);
drawStringInSurface(Common::String::format("%07d", score), 241, 129, primaryFontColor, secondaryFontColor, black, surface);
int seconds, minutes, hours;
@@ -199,29 +211,75 @@ void DrillerEngine::drawAmigaAtariSTUI(Graphics::Surface *surface) {
if (shield >= 0) {
Common::Rect shieldBar;
- shieldBar = Common::Rect(11, 178, 76 - (_maxShield - shield), 184);
+ shieldBar = Common::Rect(11, 178, 74 - (_maxShield - shield), 184);
surface->fillRect(shieldBar, brown);
- shieldBar = Common::Rect(11, 179, 76 - (_maxShield - shield), 183);
+ if (shield > 11)
+ shieldBar = Common::Rect(11, 178, 25, 184);
+ else
+ shieldBar = Common::Rect(11, 178, 74 - (_maxShield - shield), 184);
+ surface->fillRect(shieldBar, red);
+
+ shieldBar = Common::Rect(11, 179, 74 - (_maxShield - shield), 183);
surface->fillRect(shieldBar, brownish);
- shieldBar = Common::Rect(11, 180, 76 - (_maxShield - shield), 182);
+ if (shield > 11)
+ shieldBar = Common::Rect(11, 179, 25, 183);
+ else
+ shieldBar = Common::Rect(11, 179, 74 - (_maxShield - shield), 183);
+ surface->fillRect(shieldBar, redish);
+
+ shieldBar = Common::Rect(11, 180, 74 - (_maxShield - shield), 182);
surface->fillRect(shieldBar, yellow);
}
if (energy >= 0) {
Common::Rect energyBar;
- energyBar = Common::Rect(11, 186, 75 - (_maxEnergy - energy), 192);
+ energyBar = Common::Rect(11, 186, 74 - (_maxEnergy - energy), 192);
surface->fillRect(energyBar, brown);
- energyBar = Common::Rect(11, 187, 75 - (_maxEnergy - energy), 191);
+ if (energy > 11)
+ energyBar = Common::Rect(11, 186, 24, 192);
+ else
+ energyBar = Common::Rect(11, 186, 74 - (_maxEnergy - energy), 192);
+ surface->fillRect(energyBar, red);
+
+ energyBar = Common::Rect(11, 187, 74 - (_maxEnergy - energy), 191);
surface->fillRect(energyBar, brownish);
- energyBar = Common::Rect(11, 188, 75 - (_maxEnergy - energy), 190);
+ if (energy > 11)
+ energyBar = Common::Rect(11, 187, 24, 191);
+ else
+ energyBar = Common::Rect(11, 187, 74 - (_maxEnergy - energy), 191);
+ surface->fillRect(energyBar, redish);
+
+ energyBar = Common::Rect(11, 188, 74 - (_maxEnergy - energy), 190);
surface->fillRect(energyBar, yellow);
}
}
+void DrillerEngine::drawString(const DrillerFontSize size, const Common::String &str, int x, int y, uint32 primaryColor, uint32 secondaryColor, uint32 backColor, Graphics::Surface *surface) {
+ if (!_fontLoaded)
+ return;
+
+ Font *font = nullptr;
+
+ if (size == kDrillerFontNormal) {
+ font = &_font;
+ } else if (size == kDrillerFontSmall) {
+ font = &_fontSmall;
+ } else {
+ error("Invalid font size %d", size);
+ return;
+ }
+
+ Common::String ustr = str;
+ ustr.toUppercase();
+ font->setBackground(backColor);
+ font->setSecondaryColor(secondaryColor);
+ font->drawString(surface, ustr, x, y, _screenW, primaryColor);
+}
+
void DrillerEngine::initAmigaAtari() {
_viewArea = Common::Rect(36, 16, 284, 118);
diff --git a/engines/freescape/games/driller/driller.h b/engines/freescape/games/driller/driller.h
index 107f345a5fa..e39c7b53492 100644
--- a/engines/freescape/games/driller/driller.h
+++ b/engines/freescape/games/driller/driller.h
@@ -27,6 +27,11 @@
namespace Freescape {
+enum DrillerFontSize {
+ kDrillerFontSmall,
+ kDrillerFontNormal,
+};
+
class DrillerEngine : public FreescapeEngine {
public:
DrillerEngine(OSystem *syst, const ADGameDescription *gd);
@@ -42,6 +47,10 @@ public:
DrillerSIDPlayer *_playerSid;
+ // Only used for Amiga and Atari ST
+ Font _fontSmall;
+ void drawString(const DrillerFontSize size, const Common::String &str, int x, int y, uint32 primaryColor, uint32 secondaryColor, uint32 backColor, Graphics::Surface *surface);
+
Common::HashMap<uint16, uint32> _drillStatusByArea;
Common::HashMap<uint16, uint32> _drillMaxScoreByArea;
Common::HashMap<uint16, uint32> _drillSuccessByArea;
diff --git a/engines/freescape/ui.cpp b/engines/freescape/ui.cpp
index b02defe0843..88acfc41e5c 100644
--- a/engines/freescape/ui.cpp
+++ b/engines/freescape/ui.cpp
@@ -182,8 +182,6 @@ Graphics::Surface *FreescapeEngine::drawStringsInSurface(const Common::Array<Com
return surface;
}
-extern Common::String centerAndPadString(const Common::String &x, int y);
-
void FreescapeEngine::borderScreen() {
if (!_border)
return;
Commit: 3a570f2795b4ff0fcbce44bc6457d92ef7587b4e
https://github.com/scummvm/scummvm/commit/3a570f2795b4ff0fcbce44bc6457d92ef7587b4e
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2025-06-21T16:32:46+02:00
Commit Message:
FREESCAPE: added missing indicators for driller amiga/atari
Changed paths:
A devtools/create_freescape/driller_ship_indicator_Amiga.bmp
A devtools/create_freescape/driller_tank_indicator_0_Amiga.bmp
A devtools/create_freescape/driller_tank_indicator_1_Amiga.bmp
A devtools/create_freescape/driller_tank_indicator_2_Amiga.bmp
A devtools/create_freescape/driller_tank_indicator_3_Amiga.bmp
dists/engine-data/freescape.dat
engines/freescape/games/driller/amiga.cpp
engines/freescape/games/driller/atari.cpp
diff --git a/devtools/create_freescape/driller_ship_indicator_Amiga.bmp b/devtools/create_freescape/driller_ship_indicator_Amiga.bmp
new file mode 100644
index 00000000000..88d02c283aa
Binary files /dev/null and b/devtools/create_freescape/driller_ship_indicator_Amiga.bmp differ
diff --git a/devtools/create_freescape/driller_tank_indicator_0_Amiga.bmp b/devtools/create_freescape/driller_tank_indicator_0_Amiga.bmp
new file mode 100644
index 00000000000..042ba169bb5
Binary files /dev/null and b/devtools/create_freescape/driller_tank_indicator_0_Amiga.bmp differ
diff --git a/devtools/create_freescape/driller_tank_indicator_1_Amiga.bmp b/devtools/create_freescape/driller_tank_indicator_1_Amiga.bmp
new file mode 100644
index 00000000000..2151d1110dc
Binary files /dev/null and b/devtools/create_freescape/driller_tank_indicator_1_Amiga.bmp differ
diff --git a/devtools/create_freescape/driller_tank_indicator_2_Amiga.bmp b/devtools/create_freescape/driller_tank_indicator_2_Amiga.bmp
new file mode 100644
index 00000000000..5a6ab96f050
Binary files /dev/null and b/devtools/create_freescape/driller_tank_indicator_2_Amiga.bmp differ
diff --git a/devtools/create_freescape/driller_tank_indicator_3_Amiga.bmp b/devtools/create_freescape/driller_tank_indicator_3_Amiga.bmp
new file mode 100644
index 00000000000..834fedbd98d
Binary files /dev/null and b/devtools/create_freescape/driller_tank_indicator_3_Amiga.bmp differ
diff --git a/dists/engine-data/freescape.dat b/dists/engine-data/freescape.dat
index 0ddaddc32a8..4bbe3ca3a88 100644
Binary files a/dists/engine-data/freescape.dat and b/dists/engine-data/freescape.dat differ
diff --git a/engines/freescape/games/driller/amiga.cpp b/engines/freescape/games/driller/amiga.cpp
index 17812565f6f..e3407445b38 100644
--- a/engines/freescape/games/driller/amiga.cpp
+++ b/engines/freescape/games/driller/amiga.cpp
@@ -88,6 +88,15 @@ void DrillerEngine::loadAssetsAmigaFullGame() {
// Center and pad each area name so we do not have to do it at each frame
area._value->_name = centerAndPadString(area._value->_name, 14);
}
+
+ _indicators.push_back(loadBundledImage("driller_tank_indicator_0"));
+ _indicators.push_back(loadBundledImage("driller_tank_indicator_1"));
+ _indicators.push_back(loadBundledImage("driller_tank_indicator_2"));
+ _indicators.push_back(loadBundledImage("driller_tank_indicator_3"));
+ _indicators.push_back(loadBundledImage("driller_ship_indicator"));
+
+ for (auto &it : _indicators)
+ it->convertToInPlace(_gfx->_texturePixelFormat);
}
void DrillerEngine::loadAssetsAmigaDemo() {
@@ -142,6 +151,15 @@ void DrillerEngine::loadAssetsAmigaDemo() {
error("Failed to open 'soundfx' executable for Amiga");
loadSoundsFx(&file, 0, 25);
+
+ _indicators.push_back(loadBundledImage("driller_tank_indicator_0"));
+ _indicators.push_back(loadBundledImage("driller_tank_indicator_1"));
+ _indicators.push_back(loadBundledImage("driller_tank_indicator_2"));
+ _indicators.push_back(loadBundledImage("driller_tank_indicator_3"));
+ _indicators.push_back(loadBundledImage("driller_ship_indicator"));
+
+ for (auto &it : _indicators)
+ it->convertToInPlace(_gfx->_texturePixelFormat);
}
/*
@@ -256,6 +274,13 @@ void DrillerEngine::drawAmigaAtariSTUI(Graphics::Surface *surface) {
energyBar = Common::Rect(11, 188, 74 - (_maxEnergy - energy), 190);
surface->fillRect(energyBar, yellow);
}
+
+ if (_indicators.size() > 0) {
+ if (_flyMode)
+ surface->copyRectToSurface(*_indicators[4], 106, 128, Common::Rect(_indicators[1]->w, _indicators[1]->h));
+ else
+ surface->copyRectToSurface(*_indicators[_playerHeightNumber], 106, 128, Common::Rect(_indicators[1]->w, _indicators[1]->h));
+ }
}
void DrillerEngine::drawString(const DrillerFontSize size, const Common::String &str, int x, int y, uint32 primaryColor, uint32 secondaryColor, uint32 backColor, Graphics::Surface *surface) {
diff --git a/engines/freescape/games/driller/atari.cpp b/engines/freescape/games/driller/atari.cpp
index d4e49ccc99a..188898b9c0d 100644
--- a/engines/freescape/games/driller/atari.cpp
+++ b/engines/freescape/games/driller/atari.cpp
@@ -70,11 +70,16 @@ void DrillerEngine::loadAssetsAtariFullGame() {
_title = loadAndConvertNeoImage(stream, 0x3f6);
loadFonts(stream, 0x8a92);
+ Common::Array<Graphics::ManagedSurface *> chars;
+ chars = getCharsAmigaAtariInternal(8, 8, -3, 33, 32, stream, 0x8a92 + 112 * 33 + 1, 100);
+ _fontSmall = Font(chars);
+ _fontSmall.setCharWidth(5);
+
loadMessagesFixedSize(stream, 0xda22, 14, 20);
loadGlobalObjects(stream, 0xd116, 8);
load8bitBinary(stream, 0x2afb8, 16);
loadPalettes(stream, 0x2ab76);
- //loadSoundsFx(&file, 0x30da6, 25);
+ loadSoundsFx(stream, 0x30da6 + 0x147c, 25);
} else if (_variant & GF_ATARI_BUDGET) {
Common::File file;
file.open("x.prg");
@@ -103,6 +108,12 @@ void DrillerEngine::loadAssetsAtariFullGame() {
_title = loadAndConvertNeoImage(&file, 0x396);
loadFonts(&file, 0x8a32);
+
+ Common::Array<Graphics::ManagedSurface *> chars;
+ chars = getCharsAmigaAtariInternal(8, 8, -3, 33, 32, &file, 0x8a32 + 112 * 33 + 1, 100);
+ _fontSmall = Font(chars);
+ _fontSmall.setCharWidth(5);
+
loadMessagesFixedSize(&file, 0xc5d8, 14, 20);
loadGlobalObjects(&file, 0xbccc, 8);
load8bitBinary(&file, 0x29b3c, 16);
@@ -110,6 +121,20 @@ void DrillerEngine::loadAssetsAtariFullGame() {
loadSoundsFx(&file, 0x30da6, 25);
}
}
+
+ for (auto &area : _areaMap) {
+ // Center and pad each area name so we do not have to do it at each frame
+ area._value->_name = centerAndPadString(area._value->_name, 14);
+ }
+
+ _indicators.push_back(loadBundledImage("driller_tank_indicator_0_Amiga", false));
+ _indicators.push_back(loadBundledImage("driller_tank_indicator_1_Amiga", false));
+ _indicators.push_back(loadBundledImage("driller_tank_indicator_2_Amiga", false));
+ _indicators.push_back(loadBundledImage("driller_tank_indicator_3_Amiga", false));
+ _indicators.push_back(loadBundledImage("driller_ship_indicator_Amiga", false));
+
+ for (auto &it : _indicators)
+ it->convertToInPlace(_gfx->_texturePixelFormat);
}
void DrillerEngine::loadAssetsAtariDemo() {
@@ -147,9 +172,14 @@ void DrillerEngine::loadAssetsAtariDemo() {
}
if (_variant & GF_ATARI_MAGAZINE_DEMO) {
- loadFonts(&file, 0x7ee);
loadMessagesFixedSize(&file, 0x40d2, 14, 20);
loadGlobalObjects(&file, 0x3e88, 8);
+
+ loadFonts(&file, 0x7ee);
+ Common::Array<Graphics::ManagedSurface *> chars;
+ chars = getCharsAmigaAtariInternal(8, 8, -3, 33, 32, &file, 0x7ee + 112 * 33 + 1, 100);
+ _fontSmall = Font(chars);
+ _fontSmall.setCharWidth(5);
} else {
loadFonts(&file, 0x7bc);
loadMessagesFixedSize(&file, 0x3b90, 14, 20);
@@ -171,6 +201,20 @@ void DrillerEngine::loadAssetsAtariDemo() {
error("Failed to open 'soundfx' executable for AtariST demo");
loadSoundsFx(&file, 0, 25);
+
+ for (auto &area : _areaMap) {
+ // Center and pad each area name so we do not have to do it at each frame
+ area._value->_name = centerAndPadString(area._value->_name, 14);
+ }
+
+ _indicators.push_back(loadBundledImage("driller_tank_indicator_0_Amiga", false));
+ _indicators.push_back(loadBundledImage("driller_tank_indicator_1_Amiga", false));
+ _indicators.push_back(loadBundledImage("driller_tank_indicator_2_Amiga", false));
+ _indicators.push_back(loadBundledImage("driller_tank_indicator_3_Amiga", false));
+ _indicators.push_back(loadBundledImage("driller_ship_indicator_Amiga", false));
+
+ for (auto &it : _indicators)
+ it->convertToInPlace(_gfx->_texturePixelFormat);
}
} // End of namespace Freescape
More information about the Scummvm-git-logs
mailing list