[Scummvm-git-logs] scummvm master -> 582af0e00a4e36d3b0460b921a794b75fd23a9b0

neuromancer noreply at scummvm.org
Tue Jun 4 06:44:39 UTC 2024


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

Summary:
b809f5b2cf FREESCAPE: fix fullscreen messages in dark for amiga/atari
0eb052f33a FREESCAPE: avoid crashing when executing SETFLAGS
a5d6634905 FREESCAPE: show fuel/energy in dark for amiga/atari
9899669214 FREESCAPE: added more color cycle elements in dark for atari
8c8fac918d FREESCAPE: fixes in dark parsing and end game
582af0e00a FREESCAPE: initial implementation of info menu in dark for amiga/atari


Commit: b809f5b2cf312aca9ac58cd82c87c591ac0f2412
    https://github.com/scummvm/scummvm/commit/b809f5b2cf312aca9ac58cd82c87c591ac0f2412
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-06-04T08:45:42+02:00

Commit Message:
FREESCAPE: fix fullscreen messages in dark for amiga/atari

Changed paths:
    engines/freescape/games/dark/dark.cpp
    engines/freescape/ui.cpp


diff --git a/engines/freescape/games/dark/dark.cpp b/engines/freescape/games/dark/dark.cpp
index 626e02d11d0..7acfead4339 100644
--- a/engines/freescape/games/dark/dark.cpp
+++ b/engines/freescape/games/dark/dark.cpp
@@ -623,6 +623,17 @@ void DarkEngine::borderScreen() {
 void DarkEngine::executePrint(FCLInstruction &instruction) {
 	uint16 index = instruction._source - 1;
 	debugC(1, kFreescapeDebugCode, "Printing message %d", index);
+
+	if (index == 239 && (isAmiga() || isAtariST())) {
+		// Total Eclipse easter egg in Dark Side (Amiga/Atari)
+		Common::String message;
+		for (int i = 60; i < 66; i++)
+			message += _messagesList[i];
+
+		drawFullscreenMessageAndWait(message);
+		return;
+	}
+
 	if (index > 127) {
 		index = _messagesList.size() - (index - 254) - 2;
 		drawFullscreenMessageAndWait(_messagesList[index]);
diff --git a/engines/freescape/ui.cpp b/engines/freescape/ui.cpp
index 150a8db7d73..0c5690b5a2a 100644
--- a/engines/freescape/ui.cpp
+++ b/engines/freescape/ui.cpp
@@ -171,6 +171,11 @@ void FreescapeEngine::drawFullscreenMessage(Common::String message, uint32 front
 		y = 40;
 		letterPerLine = 24;
 		numberOfLines = 12;
+	} else if (isAtariST()) {
+		x = 33;
+		y = 40;
+		letterPerLine = 32;
+		numberOfLines = 10;
 	}
 
 	for (int i = 0; i < numberOfLines; i++) {


Commit: 0eb052f33a0b73a2e922c3688207f7db9948b7d2
    https://github.com/scummvm/scummvm/commit/0eb052f33a0b73a2e922c3688207f7db9948b7d2
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-06-04T08:45:42+02:00

Commit Message:
FREESCAPE: avoid crashing when executing SETFLAGS

Changed paths:
    engines/freescape/language/instruction.cpp


diff --git a/engines/freescape/language/instruction.cpp b/engines/freescape/language/instruction.cpp
index 8be4ebf2610..e70d0d69f16 100644
--- a/engines/freescape/language/instruction.cpp
+++ b/engines/freescape/language/instruction.cpp
@@ -233,6 +233,9 @@ void FreescapeEngine::executeCode(FCLInstructionVector &code, bool shot, bool co
 		case Token::SCREEN:
 			// TODO
 			break;
+		case Token::SETFLAGS:
+			// TODO
+			break;
 		case Token::STARTANIM:
 			executeStartAnim(instruction);
 			break;


Commit: a5d6634905d593c6a8a094bf728e4317b9a4e45a
    https://github.com/scummvm/scummvm/commit/a5d6634905d593c6a8a094bf728e4317b9a4e45a
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-06-04T08:45:42+02:00

Commit Message:
FREESCAPE: show fuel/energy in dark for amiga/atari

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


diff --git a/engines/freescape/games/dark/amiga.cpp b/engines/freescape/games/dark/amiga.cpp
index 672d3f46307..102e7668268 100644
--- a/engines/freescape/games/dark/amiga.cpp
+++ b/engines/freescape/games/dark/amiga.cpp
@@ -123,28 +123,6 @@ void DarkEngine::loadAssetsAmigaFullGame() {
 	loadMessagesVariableSize(stream, 0x3d37, 66);
 }
 
-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::drawAmigaAtariSTUI(Graphics::Surface *surface) {
 	uint32 white = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0xFF);
 	uint32 yellow = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xEE, 0xCC, 0x00);
@@ -174,8 +152,30 @@ void DarkEngine::drawAmigaAtariSTUI(Graphics::Surface *surface) {
 		_temporaryMessageDeadlines.push_back(deadline);
 	}
 
-	drawString(kDarkFontSmall, centerAndPadString(_currentArea->_name, 26), 32, 150, white, white, transparent, surface);
+	drawString(kDarkFontSmall, _currentArea->_name, 32, 150, white, white, transparent, surface);
 	drawBinaryClock(surface, 6, 110, white, grey);
+
+	int x = 229;
+	int y = 180;
+	for (int i = 0; i < _maxShield / 2; i++) {
+		if (i < _gameStateVars[k8bitVariableShield] / 2) {
+			surface->drawLine(x, y, x, y + 3, orange);
+			surface->drawLine(x, y + 1, x, y + 2, yellow);
+		} else
+			surface->drawLine(x, y, x, y + 3, red);
+		x += 2;
+	}
+
+	x = 229;
+	y = 188;
+	for (int i = 0; i < _maxEnergy / 2; i++) {
+		if (i < _gameStateVars[k8bitVariableEnergy] / 2) {
+			surface->drawLine(x, y, x, y + 3, orange);
+			surface->drawLine(x, y + 1, x, y + 2, yellow);
+		} else
+			surface->drawLine(x, y, x, y + 3, red);
+		x += 2;
+	}
 }
 
 void DarkEngine::initAmigaAtari() {
diff --git a/engines/freescape/games/dark/atari.cpp b/engines/freescape/games/dark/atari.cpp
index 8c5d0492b3e..359261b5e3e 100644
--- a/engines/freescape/games/dark/atari.cpp
+++ b/engines/freescape/games/dark/atari.cpp
@@ -27,6 +27,28 @@
 
 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::SeekableReadStream *stream = decryptFile("1.drk", "0.drk", 840);
 	parseAmigaAtariHeader(stream);
@@ -51,6 +73,10 @@ void DarkEngine::loadAssetsAtariFullGame() {
 	assert(obj);
 	obj->_cyclingColors = true;
 
+	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, 26);
+	}
 }
 
 } // End of namespace Freescape


Commit: 989966921499a043ba76087bd212e9df841d476f
    https://github.com/scummvm/scummvm/commit/989966921499a043ba76087bd212e9df841d476f
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-06-04T08:45:42+02:00

Commit Message:
FREESCAPE: added more color cycle elements in dark for atari

Changed paths:
    engines/freescape/games/dark/atari.cpp
    engines/freescape/objects/geometricobject.cpp


diff --git a/engines/freescape/games/dark/atari.cpp b/engines/freescape/games/dark/atari.cpp
index 359261b5e3e..3ddf57e9a97 100644
--- a/engines/freescape/games/dark/atari.cpp
+++ b/engines/freescape/games/dark/atari.cpp
@@ -73,6 +73,17 @@ void DarkEngine::loadAssetsAtariFullGame() {
 	assert(obj);
 	obj->_cyclingColors = true;
 
+	for (int i = 0; i < 3; i++) {
+		int16 id = 227 + i * 6 - 2;
+		for (int j = 0; j < 2; j++) {
+			//debugC(1, kFreescapeDebugParser, "Restoring object %d to from ECD %d", id, index);
+			obj = (GeometricObject *)_areaMap[255]->objectWithID(id);
+			assert(obj);
+			obj->_cyclingColors = true;
+			id--;
+		}
+	}
+
 	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, 26);
diff --git a/engines/freescape/objects/geometricobject.cpp b/engines/freescape/objects/geometricobject.cpp
index 46d175998ad..25aabeb22e0 100644
--- a/engines/freescape/objects/geometricobject.cpp
+++ b/engines/freescape/objects/geometricobject.cpp
@@ -254,7 +254,7 @@ Object *GeometricObject::duplicate() {
 	conditionCopy = duplicateCondition(&_condition);
 	assert(conditionCopy);
 
-	return new GeometricObject(
+	GeometricObject *copy = new GeometricObject(
 		_type,
 		_objectID,
 		_flags,
@@ -264,7 +264,11 @@ Object *GeometricObject::duplicate() {
 		ecoloursCopy,
 		ordinatesCopy,
 		*conditionCopy,
-		_conditionSource);
+		_conditionSource
+	);
+
+	copy->_cyclingColors = _cyclingColors;
+	return copy;
 }
 
 void GeometricObject::computeBoundingBox() {


Commit: 8c8fac918d780e4775db54b37b13b916814a53f8
    https://github.com/scummvm/scummvm/commit/8c8fac918d780e4775db54b37b13b916814a53f8
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-06-04T08:45:42+02:00

Commit Message:
FREESCAPE: fixes in dark parsing and end game

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


diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index 96dd5cbbc53..b12ea583e4a 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -364,7 +364,8 @@ void FreescapeEngine::drawFrame() {
 	drawBackground();
 	if (_avoidRenderingFrames == 0) { // Avoid rendering inside objects
 		_currentArea->draw(_gfx, _ticks / 10, _position, _cameraFront);
-		if (_currentArea->hasActiveGroups() && _ticks % 50 == 0) {
+		if (_gameStateControl == kFreescapeGameStatePlaying &&
+		    _currentArea->hasActiveGroups() && _ticks % 50 == 0) {
 			executeMovementConditions();
 		}
 	} else
diff --git a/engines/freescape/games/dark/dark.cpp b/engines/freescape/games/dark/dark.cpp
index 7acfead4339..534791732a1 100644
--- a/engines/freescape/games/dark/dark.cpp
+++ b/engines/freescape/games/dark/dark.cpp
@@ -345,9 +345,42 @@ bool DarkEngine::tryDestroyECD(int index) {
 }
 
 void DarkEngine::addSkanner(Area *area) {
-	int id = 251;
-	debugC(1, kFreescapeDebugParser, "Adding skanner (group %d) to room structure %d", id, area->getAreaID());
-	area->addGroupFromArea(id, _areaMap[255]);
+	debugC(1, kFreescapeDebugParser, "Adding skanner to room %d", area->getAreaID());
+	int16 id = 0;
+	if (isAmiga() || isAtariST()) {
+		id = 251;
+		debugC(1, kFreescapeDebugParser, "Adding group %d", id);
+		area->addGroupFromArea(id, _areaMap[255]);
+	} else {
+		GeometricObject *obj = nullptr;
+		id = 248;
+		// If first object is already added, do not re-add any
+		if (area->objectWithID(id) != nullptr)
+			return;
+
+		debugC(1, kFreescapeDebugParser, "Adding object %d to room structure", id);
+		obj = (GeometricObject *)_areaMap[255]->objectWithID(id);
+		assert(obj);
+		obj = (GeometricObject *)obj->duplicate();
+		obj->makeInvisible();
+		area->addObject(obj);
+
+		id = 249;
+		debugC(1, kFreescapeDebugParser, "Adding object %d to room structure", id);
+		obj = (GeometricObject *)_areaMap[255]->objectWithID(id);
+		assert(obj);
+		obj = (GeometricObject *)obj->duplicate();
+		obj->makeInvisible();
+		area->addObject(obj);
+
+		id = 250;
+		debugC(1, kFreescapeDebugParser, "Adding object %d to room structure", id);
+		obj = (GeometricObject *)_areaMap[255]->objectWithID(id);
+		assert(obj);
+		obj = (GeometricObject *)obj->duplicate();
+		obj->makeInvisible();
+		area->addObject(obj);
+	}
 }
 
 bool DarkEngine::checkIfGameEnded() {
@@ -647,16 +680,19 @@ void DarkEngine::drawBinaryClock(Graphics::Surface *surface, int xPosition, int
 
 	if (_gameStateControl == kFreescapeGameStatePlaying)
 		number = _ticks / 2;
-	else if (_gameStateControl == kFreescapeGameStateEnd)
-		number = 1 << (_ticks - _ticksFromEnd) / 15;
-	else
+	else if (_gameStateControl == kFreescapeGameStateEnd) {
+		if (_gameStateVars[kVariableDarkEnding] == 0)
+			number = (1 << 15) - 1;
+		else
+			number = 1 << (_ticks - _ticksFromEnd) / 15;
+	} else
 		return;
 
-	if (number >= 1 << 15)
-		number = (1 << 15) - 1;
+	int maxBits = isAtariST() || isAmiga() ? 14 : 15;
+	/*if (number >= 1 << maxBits)
+		number = (1 << maxBits) - 1;*/
 
 	int bits = 0;
-	int maxBits = isAtariST() || isAmiga() ? 14 : 15;
 	while (bits <= maxBits) {
 		int y = 0;
 		if (isAmiga() || isAtariST()) {


Commit: 582af0e00a4e36d3b0460b921a794b75fd23a9b0
    https://github.com/scummvm/scummvm/commit/582af0e00a4e36d3b0460b921a794b75fd23a9b0
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-06-04T08:45:42+02:00

Commit Message:
FREESCAPE: initial implementation of info menu in dark for amiga/atari

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


diff --git a/engines/freescape/games/dark/amiga.cpp b/engines/freescape/games/dark/amiga.cpp
index 102e7668268..e2efd817210 100644
--- a/engines/freescape/games/dark/amiga.cpp
+++ b/engines/freescape/games/dark/amiga.cpp
@@ -147,12 +147,12 @@ void DarkEngine::drawAmigaAtariSTUI(Graphics::Surface *surface) {
 	int deadline;
 	getLatestMessages(message, deadline);
 	if (deadline <= _countdown) {
-		drawString(kDarkFontSmall, message, 32, 156, white, white, transparent, surface);
+		drawString(kDarkFontSmall, message, 32, 157, white, white, transparent, surface);
 		_temporaryMessages.push_back(message);
 		_temporaryMessageDeadlines.push_back(deadline);
 	}
 
-	drawString(kDarkFontSmall, _currentArea->_name, 32, 150, white, white, transparent, surface);
+	drawString(kDarkFontSmall, _currentArea->_name, 32, 151, white, white, transparent, surface);
 	drawBinaryClock(surface, 6, 110, white, grey);
 
 	int x = 229;
diff --git a/engines/freescape/games/dark/dark.cpp b/engines/freescape/games/dark/dark.cpp
index 534791732a1..3a943748082 100644
--- a/engines/freescape/games/dark/dark.cpp
+++ b/engines/freescape/games/dark/dark.cpp
@@ -757,29 +757,39 @@ void DarkEngine::drawInfoMenu() {
 		default:
 			color = 14;
 	}
-	uint8 r, g, b;
-	_gfx->readFromPalette(color, r, g, b);
-	uint32 front = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
-	uint32 black = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x00, 0x00, 0x00);
 
+	Texture *menuTexture = nullptr;
 	Graphics::Surface *surface = new Graphics::Surface();
 	surface->create(_screenW, _screenH, _gfx->_texturePixelFormat);
 
-	surface->fillRect(Common::Rect(88, 48, 231, 103), black);
-	surface->frameRect(Common::Rect(88, 48, 231, 103), front);
+	if (isAmiga() || isAtariST()) {
+		uint32 white = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0xFF);
+		uint32 black = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x00, 0x00, 0x00);
 
-	surface->frameRect(Common::Rect(90, 50, 229, 101), front);
+		drawString(kDarkFontSmall, "L-LOAD  S-SAVE ESC-ABORT", 32, 145, white, white, black, surface);
+		drawString(kDarkFontSmall, "OR USE THE ICONS.  OTHER", 32, 151, white, white, black, surface);
+		drawString(kDarkFontSmall, "KEYS WILL CONTINUE  GAME", 32, 157, white, white, black, surface);
+	} else {
+		uint8 r, g, b;
+		_gfx->readFromPalette(color, r, g, b);
+		uint32 front = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
+		uint32 black = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x00, 0x00, 0x00);
 
-	drawStringInSurface("L-LOAD S-SAVE", 105, 56, front, black, surface);
-	if (isSpectrum())
-		drawStringInSurface("1-TERMINATE", 105, 64, front, black, surface);
-	else
-		drawStringInSurface("ESC-TERMINATE", 105, 64, front, black, surface);
+		surface->fillRect(Common::Rect(88, 48, 231, 103), black);
+		surface->frameRect(Common::Rect(88, 48, 231, 103), front);
 
-	drawStringInSurface("T-TOGGLE", 128, 81, front, black, surface);
-	drawStringInSurface("SOUND ON/OFF", 113, 88, front, black, surface);
+		surface->frameRect(Common::Rect(90, 50, 229, 101), front);
 
-	Texture *menuTexture = _gfx->createTexture(surface);
+		drawStringInSurface("L-LOAD S-SAVE", 105, 56, front, black, surface);
+		if (isSpectrum())
+			drawStringInSurface("1-TERMINATE", 105, 64, front, black, surface);
+		else
+			drawStringInSurface("ESC-TERMINATE", 105, 64, front, black, surface);
+
+		drawStringInSurface("T-TOGGLE", 128, 81, front, black, surface);
+		drawStringInSurface("SOUND ON/OFF", 113, 88, front, black, surface);
+	}
+	menuTexture = _gfx->createTexture(surface);
 
 	Common::Event event;
 	bool cont = true;




More information about the Scummvm-git-logs mailing list