[Scummvm-git-logs] scummvm master -> f4a9cc125e1f84703acc0d582722e744cac14568

neuromancer noreply at scummvm.org
Fri Apr 26 06:44:33 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
f4a9cc125e FREESCAPE: initial implementation for font parsing in dark releases for amiga/atari


Commit: f4a9cc125e1f84703acc0d582722e744cac14568
    https://github.com/scummvm/scummvm/commit/f4a9cc125e1f84703acc0d582722e744cac14568
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-04-26T08:37:52+02:00

Commit Message:
FREESCAPE: initial implementation for font parsing in dark releases for amiga/atari

Changed paths:
    engines/freescape/freescape.cpp
    engines/freescape/games/dark/amiga.cpp
    engines/freescape/games/dark/atari.cpp


diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index b58f3d3f25f..7143c7cf716 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -902,9 +902,10 @@ void FreescapeEngine::drawStringInSurface(const Common::String &str, int x, int
 	if (isDOS() || isSpectrum() || isCPC() || isC64()) {
 		for (uint32 c = 0; c < ustr.size(); c++) {
 			assert(ustr[c] >= 32);
+			int position = sizeX * sizeY * (offset + ustr[c] - 32);
 			for (int j = 0; j < sizeY; j++) {
 				for (int i = 0; i < sizeX; i++) {
-					if (_font.get(sizeX * sizeY * (offset + ustr[c] - 32) + additional + j * 8 + i))
+					if (_font.get(position + additional + j * 8 + i))
 						surface->setPixel(x + 8 - i + sep * c, y + j, fontColor);
 					else
 						surface->setPixel(x + 8 - i + sep * c, y + j, backColor);
@@ -912,12 +913,15 @@ void FreescapeEngine::drawStringInSurface(const Common::String &str, int x, int
 			}
 		}
 	} else if (isAmiga() || isAtariST()) {
+		int multiplier1 = isDriller() ? 33 : 16;
+		int multiplier2 = isDriller() ? 32 : 16;
+
 		for (uint32 c = 0; c < ustr.size(); c++) {
 			assert(ustr[c] >= 32);
-			int position = 8 * (33*(offset + ustr[c] - 32) + 1);
+			int position = 8 * (multiplier1*(offset + ustr[c] - 32) + 1);
 			for (int j = 0; j < 8; j++) {
 				for (int i = 0; i < 8; i++) {
-					if (_font.get(position + j * 32 + i))
+					if (_font.get(position + j * multiplier2 + i))
 						surface->setPixel(x + 8 - i + 8 * c, y + j, fontColor);
 					else
 						surface->setPixel(x + 8 - i + 8 * c, y + j, backColor);
diff --git a/engines/freescape/games/dark/amiga.cpp b/engines/freescape/games/dark/amiga.cpp
index 12c6decbde6..ef85835080e 100644
--- a/engines/freescape/games/dark/amiga.cpp
+++ b/engines/freescape/games/dark/amiga.cpp
@@ -130,6 +130,31 @@ void DarkEngine::loadAssetsAmigaFullGame() {
 }
 
 void DarkEngine::drawAmigaAtariSTUI(Graphics::Surface *surface) {
+	uint32 white = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0xFF);
+	uint32 yellow = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xEE, 0xCC, 0x00);
+	uint32 red = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xEE, 0x00, 0x00);
+	uint32 black = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x00, 0x00, 0x00);
+
+	int score = _gameStateVars[k8bitVariableScore];
+	int ecds = _gameStateVars[kVariableActiveECDs];
+	//drawStringInSurface(Common::String::format("%04d", int(2 * _position.x())), 199, 137, front, back, surface);
+	//drawStringInSurface(Common::String::format("%04d", int(2 * _position.z())), 199, 145, front, back, surface);
+	//drawStringInSurface(Common::String::format("%04d", int(2 * _position.y())), 199, 153, front, back, surface);
+
+	drawStringInSurface(Common::String::format("%02d", int(_angleRotations[_angleRotationIndex])), 73, 178, red, black, surface);
+	drawStringInSurface(Common::String::format("%3d", _playerSteps[_playerStepIndex]), 73, 186, red, black, surface);
+	drawStringInSurface(Common::String::format("%07d", score), 93, 16, yellow, black, surface);
+	drawStringInSurface(Common::String::format("%3d%%", ecds), 181, 16, yellow, black, surface);
+
+	Common::String message;
+	int deadline;
+	getLatestMessages(message, deadline);
+	if (deadline <= _countdown) {
+		drawStringInSurface(message, 32, 150, white, black, surface);
+		_temporaryMessages.push_back(message);
+		_temporaryMessageDeadlines.push_back(deadline);
+	} else
+		drawStringInSurface(_currentArea->_name, 32, 150, white, black, surface);
 }
 
 void DarkEngine::initAmigaAtari() {
diff --git a/engines/freescape/games/dark/atari.cpp b/engines/freescape/games/dark/atari.cpp
index 00d5d2dde66..693910232cf 100644
--- a/engines/freescape/games/dark/atari.cpp
+++ b/engines/freescape/games/dark/atari.cpp
@@ -32,6 +32,7 @@ void DarkEngine::loadAssetsAtariFullGame() {
 	parseAmigaAtariHeader(stream);
 
 	_border = loadAndConvertNeoImage(stream, 0xd710);
+	loadFonts(stream, 0xd06a); //0x7f0);
 	load8bitBinary(stream, 0x20918, 16);
 	loadMessagesVariableSize(stream, 0x3f6f, 66);
 	loadPalettes(stream, 0x205e6);




More information about the Scummvm-git-logs mailing list