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

neuromancer noreply at scummvm.org
Sat Sep 14 07:18:26 UTC 2024


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

Summary:
07d47d5d31 FREESCAPE: improved border screen text padding
1085fcb33f FREESCAPE: initialize all the pointers from castle
3f90fa93b8 FREESCAPE: improved info menu in castle for dos
a8a7ce664e FREESCAPE: implemented info menu in castle for zx (eng) and refacted drawStringsInSurface


Commit: 07d47d5d312ff8707c0181c64ac5b12f2bd9d546
    https://github.com/scummvm/scummvm/commit/07d47d5d312ff8707c0181c64ac5b12f2bd9d546
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-09-14T09:19:45+02:00

Commit Message:
FREESCAPE: improved border screen text padding

Changed paths:
    engines/freescape/ui.cpp


diff --git a/engines/freescape/ui.cpp b/engines/freescape/ui.cpp
index 4c4a2a7854f..27640b24df4 100644
--- a/engines/freescape/ui.cpp
+++ b/engines/freescape/ui.cpp
@@ -136,25 +136,31 @@ void FreescapeEngine::borderScreen() {
 
 	if (isDOS() || isSpectrum()) {
 		Common::Array<Common::String> lines;
+		int pad = 25;
+		if (isSpectrum() && isCastle())
+			pad = 22;
+		else if (isDOS() && !isCastle())
+			pad = 30;
+
 		if (isDOS())
-			lines.push_back(centerAndPadString("Configuration Menu", 30));
+			lines.push_back(centerAndPadString("Configuration Menu", pad));
 		else
-			lines.push_back(centerAndPadString("Control Options", 25));
+			lines.push_back(centerAndPadString("Control Options", pad));
 		lines.push_back("");
-		lines.push_back(centerAndPadString("1: KEYBOARD ONLY   ", isDOS() ? 30 : 25));
-		lines.push_back(centerAndPadString("2: IBM JOYSTICK    ", isDOS() ? 30 : 25));
-		lines.push_back(centerAndPadString("3: AMSTRAD JOYSTICK", isDOS() ? 30 : 25));
+		lines.push_back(centerAndPadString("1: KEYBOARD ONLY   ", pad));
+		lines.push_back(centerAndPadString("2: IBM JOYSTICK    ", pad));
+		lines.push_back(centerAndPadString("3: AMSTRAD JOYSTICK", pad));
 		lines.push_back("");
 		lines.push_back("");
 		if (isDOS())
-			lines.push_back(centerAndPadString("SPACEBAR:  BEGIN MISSION", 30));
+			lines.push_back(centerAndPadString("SPACEBAR:  BEGIN MISSION", pad));
 		else
-			lines.push_back(centerAndPadString("Enter: Begin Mission", 25));
+			lines.push_back(centerAndPadString("Enter: Begin Mission", pad));
 		lines.push_back("");
 		if (isDOS())
-			lines.push_back(centerAndPadString("COPYRIGHT 1988 INCENTIVE", 30));
+			lines.push_back(centerAndPadString("COPYRIGHT 1988 INCENTIVE", pad));
 		else
-			lines.push_back(centerAndPadString("(c) 1988 Incentive", 25));
+			lines.push_back(centerAndPadString("(c) 1988 Incentive", pad));
 
 		lines.push_back("");
 		Graphics::Surface *surface = drawStringsInSurface(lines);


Commit: 1085fcb33f0a9800b4c6ef4fbb555efbb2d652d4
    https://github.com/scummvm/scummvm/commit/1085fcb33f0a9800b4c6ef4fbb555efbb2d652d4
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-09-14T09:19:45+02:00

Commit Message:
FREESCAPE: initialize all the pointers from castle

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


diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index 2502399f306..9dc738a181d 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -62,12 +62,20 @@ CastleEngine::CastleEngine(OSystem *syst, const ADGameDescription *gd) : Freesca
 	_option = nullptr;
 	_optionTexture = nullptr;
 	_spiritsMeterIndicatorFrame = nullptr;
+	_spiritsMeterIndicatorBackgroundFrame = nullptr;
 	_strenghtBackgroundFrame = nullptr;
 	_strenghtBarFrame = nullptr;
 	_thunderFrame = nullptr;
 	_menu = nullptr;
 	_menuButtons = nullptr;
 
+	_riddleTopFrame = nullptr;
+	_riddleBottomFrame = nullptr;
+	_riddleBackgroundFrame = nullptr;
+
+	_endGameThroneFrame = nullptr;
+	_endGameBackgroundFrame = nullptr;
+
 	_menuCrawlIndicator = nullptr;
 	_menuWalkIndicator = nullptr;
 	_menuRunIndicator = nullptr;


Commit: 3f90fa93b8dc5502ea04892d38d0dcba3e1f763a
    https://github.com/scummvm/scummvm/commit/3f90fa93b8dc5502ea04892d38d0dcba3e1f763a
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-09-14T09:19:45+02:00

Commit Message:
FREESCAPE: improved info menu in castle for dos

Changed paths:
    engines/freescape/freescape.cpp
    engines/freescape/freescape.h
    engines/freescape/games/castle/castle.cpp


diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index bd263c9f51b..2c56b894579 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -632,10 +632,7 @@ void FreescapeEngine::processInput() {
 			mousePos = event.mouse;
 			{
 				bool touchedScreenControls = false;
-
-				Common::Point resolution(g_system->getWidth(), g_system->getHeight());
-				mousePos.x = _screenW * mousePos.x / resolution.x;
-				mousePos.y = _screenH * mousePos.y / resolution.y;
+				mousePos = getNormalizedPosition(mousePos);
 				touchedScreenControls = onScreenControls(mousePos);
 
 				if (!touchedScreenControls) {
@@ -658,6 +655,13 @@ void FreescapeEngine::processInput() {
 	}
 }
 
+Common::Point FreescapeEngine::getNormalizedPosition(Common::Point position) {
+	Common::Point resolution(g_system->getWidth(), g_system->getHeight());
+	position.x = _screenW * position.x / resolution.x;
+	position.y = _screenH * position.y / resolution.y;
+	return position;
+}
+
 bool FreescapeEngine::onScreenControls(Common::Point mouse) {
 	return false;
 }
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index 4bfbe90f586..5000e245b81 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -318,6 +318,7 @@ public:
 	void generateDemoInput();
 	virtual void pressedKey(const int keycode);
 	virtual void releasedKey(const int keycode);
+	Common::Point getNormalizedPosition(Common::Point position);
 	virtual bool onScreenControls(Common::Point mouse);
 	void move(CameraMovement direction, uint8 scale, float deltaTime);
 	void resolveCollisions(Math::Vector3d newPosition);
diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index 9dc738a181d..68ab5d24250 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -430,6 +430,7 @@ void CastleEngine::drawInfoMenu() {
 
 	Texture *menuTexture = _gfx->createTexture(surface);
 	Common::Event event;
+	Common::Point mousePos;
 	bool cont = true;
 	while (!shouldQuit() && cont) {
 		while (_eventManager->pollEvent(event)) {
@@ -440,21 +441,19 @@ void CastleEngine::drawInfoMenu() {
 				if (event.customType == kActionLoad) {
 					_gfx->setViewport(_fullscreenViewArea);
 					_eventManager->purgeKeyboardEvents();
+
+					g_system->lockMouse(false);
+					g_system->showMouse(true);
 					loadGameDialog();
-					if (isDOS()) {
-						g_system->lockMouse(false);
-						g_system->showMouse(true);
-					}
 
 					_gfx->setViewport(_viewArea);
 				} else if (event.customType == kActionSave) {
 					_gfx->setViewport(_fullscreenViewArea);
 					_eventManager->purgeKeyboardEvents();
+
+					g_system->lockMouse(false);
+					g_system->showMouse(true);
 					saveGameDialog();
-					if (isDOS()) {
-						g_system->lockMouse(false);
-						g_system->showMouse(true);
-					}
 
 					_gfx->setViewport(_viewArea);
 				} else if (isDOS() && event.customType == kActionToggleSound) {
@@ -475,8 +474,33 @@ void CastleEngine::drawInfoMenu() {
 			case Common::EVENT_RBUTTONDOWN:
 			// fallthrough
 			case Common::EVENT_LBUTTONDOWN:
-				if (g_system->hasFeature(OSystem::kFeatureTouchscreen))
-					cont = false;
+				if (isSpectrum() || isCPC())
+					break;
+
+				mousePos = getNormalizedPosition(event.mouse);
+				if (Common::Rect(101, 67, 133, 79).contains(mousePos)) {
+					_gfx->setViewport(_fullscreenViewArea);
+					_eventManager->purgeKeyboardEvents();
+					loadGameDialog();
+					g_system->lockMouse(false);
+					g_system->showMouse(true);
+
+					_gfx->setViewport(_viewArea);
+				} else if (Common::Rect(101, 82, 133, 95).contains(mousePos)) {
+					_gfx->setViewport(_fullscreenViewArea);
+					_eventManager->purgeKeyboardEvents();
+					saveGameDialog();
+					g_system->lockMouse(false);
+					g_system->showMouse(true);
+
+					_gfx->setViewport(_viewArea);
+				} else if (Common::Rect(101, 101, 133, 114).contains(mousePos)) {
+					// Toggle sounds
+				} else if (Common::Rect(101, 116, 133, 129).contains(mousePos)) {
+					// Cycle between crawl, walk or run
+					// It can fail if there is no room
+				} else if (Common::Rect(101, 131, 133, 144).contains(mousePos))
+					cont = false; // Back to game
 				break;
 			default:
 				break;


Commit: a8a7ce664e5a216d34999f4087b2745b0a1fbc0b
    https://github.com/scummvm/scummvm/commit/a8a7ce664e5a216d34999f4087b2745b0a1fbc0b
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-09-14T09:19:45+02:00

Commit Message:
FREESCAPE: implemented info menu in castle for zx (eng) and refacted drawStringsInSurface

Changed paths:
    engines/freescape/freescape.h
    engines/freescape/games/castle/castle.cpp
    engines/freescape/ui.cpp


diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index 5000e245b81..6ed0ab2133a 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -512,7 +512,7 @@ public:
 	bool _fontLoaded;
 	virtual void drawStringInSurface(const Common::String &str, int x, int y, uint32 fontColor, uint32 backColor, Graphics::Surface *surface, int offset = 0);
 	virtual void drawStringInSurface(const Common::String &str, int x, int y, uint32 primaryFontColor, uint32 secondaryFontColor, uint32 backColor, Graphics::Surface *surface, int offset = 0);
-	Graphics::Surface *drawStringsInSurface(const Common::Array<Common::String> &lines);
+	Graphics::Surface *drawStringsInSurface(const Common::Array<Common::String> &lines, Graphics::Surface *surface);
 
 	// Game state
 	virtual void initGameState();
diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index 68ab5d24250..9b17db8982a 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -399,6 +399,8 @@ void CastleEngine::pressedKey(const int keycode) {
 	}
 }
 
+extern Common::String centerAndPadString(const Common::String &x, int y);
+
 void CastleEngine::drawInfoMenu() {
 	PauseToken pauseToken = pauseEngine();
 	if (_savedScreen) {
@@ -426,6 +428,18 @@ void CastleEngine::drawInfoMenu() {
 		_gfx->readFromPalette(10, r, g, b);
 		front = _gfx->_texturePixelFormat.ARGBToColor(0xFF, r, g, b);
 		drawStringInSurface(Common::String::format("%07d", score), 166, 71, front, black, surface);
+	} else if (isSpectrum()) {
+		Common::Array<Common::String> lines;
+		lines.push_back(centerAndPadString("********************", 21));
+		lines.push_back(centerAndPadString("s-save l-load q-quit", 21));
+		lines.push_back("");
+		lines.push_back(centerAndPadString(Common::String::format("keys   %d collected", _numberKeys), 21));
+		lines.push_back(centerAndPadString(Common::String::format("spirits  %d destroyed", _spiritsDestroyed), 21));
+		lines.push_back(centerAndPadString("strength  strong", 21));
+		lines.push_back(centerAndPadString(Common::String::format("score   %07d", score), 21));
+		lines.push_back("");
+		lines.push_back(centerAndPadString("********************", 21));
+		surface = drawStringsInSurface(lines, surface);
 	}
 
 	Texture *menuTexture = _gfx->createTexture(surface);
@@ -442,18 +456,22 @@ void CastleEngine::drawInfoMenu() {
 					_gfx->setViewport(_fullscreenViewArea);
 					_eventManager->purgeKeyboardEvents();
 
-					g_system->lockMouse(false);
-					g_system->showMouse(true);
 					loadGameDialog();
+					if (isDOS() || isAmiga() || isAtariST()) {
+						g_system->lockMouse(false);
+						g_system->showMouse(true);
+					}
 
 					_gfx->setViewport(_viewArea);
 				} else if (event.customType == kActionSave) {
 					_gfx->setViewport(_fullscreenViewArea);
 					_eventManager->purgeKeyboardEvents();
 
-					g_system->lockMouse(false);
-					g_system->showMouse(true);
 					saveGameDialog();
+					if (isDOS() || isAmiga() || isAtariST()) {
+						g_system->lockMouse(false);
+						g_system->showMouse(true);
+					}
 
 					_gfx->setViewport(_viewArea);
 				} else if (isDOS() && event.customType == kActionToggleSound) {
@@ -968,6 +986,11 @@ extern Common::String centerAndPadString(const Common::String &x, int y);
 
 void CastleEngine::selectCharacterScreen() {
 	Common::Array<Common::String> lines;
+	uint32 color = _gfx->_texturePixelFormat.ARGBToColor(0x00, 0x00, 0x00, 0x00);
+	Graphics::Surface *surface = new Graphics::Surface();
+	surface->create(_screenW, _screenH, _gfx->_texturePixelFormat);
+	surface->fillRect(_fullscreenViewArea, color);
+
 	switch (_language) {
 		case Common::ES_ESP:
 			// No accent in "príncipe" since it is not supported by the font
@@ -1010,7 +1033,7 @@ void CastleEngine::selectCharacterScreen() {
 			break;
 	}
 
-	Graphics::Surface *surface = drawStringsInSurface(lines);
+	drawStringsInSurface(lines, surface);
 	_system->lockMouse(false);
 	_system->showMouse(true);
 	Common::Rect princeSelector(82, 100, 163, 109);
diff --git a/engines/freescape/ui.cpp b/engines/freescape/ui.cpp
index 27640b24df4..84a6cfaa010 100644
--- a/engines/freescape/ui.cpp
+++ b/engines/freescape/ui.cpp
@@ -69,12 +69,8 @@ void FreescapeEngine::titleScreen() {
 	_gfx->clear(0, 0, 0, true);
 }
 
-Graphics::Surface *FreescapeEngine::drawStringsInSurface(const Common::Array<Common::String> &lines) {
-	uint32 color = _gfx->_texturePixelFormat.ARGBToColor(0x00, 0x00, 0x00, 0x00);
-	Graphics::Surface *surface = new Graphics::Surface();
-	surface->create(_screenW, _screenH, _gfx->_texturePixelFormat);
-	surface->fillRect(_fullscreenViewArea, color);
-
+Graphics::Surface *FreescapeEngine::drawStringsInSurface(const Common::Array<Common::String> &lines, Graphics::Surface *surface) {
+	uint32 color = 0;
 	uint32 back = _gfx->_texturePixelFormat.ARGBToColor(0x00, 0x00, 0x00, 0x00);
 
 	switch (_renderMode) {
@@ -163,7 +159,13 @@ void FreescapeEngine::borderScreen() {
 			lines.push_back(centerAndPadString("(c) 1988 Incentive", pad));
 
 		lines.push_back("");
-		Graphics::Surface *surface = drawStringsInSurface(lines);
+
+		uint32 color = _gfx->_texturePixelFormat.ARGBToColor(0x00, 0x00, 0x00, 0x00);
+		Graphics::Surface *surface = new Graphics::Surface();
+		surface->create(_screenW, _screenH, _gfx->_texturePixelFormat);
+		surface->fillRect(_fullscreenViewArea, color);
+
+		surface = drawStringsInSurface(lines, surface);
 		drawBorderScreenAndWait(surface, 6 * 60);
 		surface->free();
 		delete surface;
@@ -189,7 +191,13 @@ void FreescapeEngine::drawFullscreenMessageAndWait(Common::String message) {
 	for (int i = 0; i < numberOfLines; i++) {
 		lines.push_back(message.substr(letterPerLine * i, letterPerLine));
 	}
-	Graphics::Surface *surface = drawStringsInSurface(lines);
+
+	uint32 color = _gfx->_texturePixelFormat.ARGBToColor(0x00, 0x00, 0x00, 0x00);
+	Graphics::Surface *surface = new Graphics::Surface();
+	surface->create(_screenW, _screenH, _gfx->_texturePixelFormat);
+	surface->fillRect(_fullscreenViewArea, color);
+
+	surface = drawStringsInSurface(lines, surface);
 	drawBorderScreenAndWait(surface);
 	surface->free();
 	delete surface;




More information about the Scummvm-git-logs mailing list