[Scummvm-git-logs] scummvm master -> 713d13e7ad182b308f6e15ad34c666563d39e607

criezy criezy at scummvm.org
Wed Jan 31 22:17:33 CET 2018


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:
bab0bf2b1e SUPERNOVA: Improve command button size for translations
4c857e1706 SUPERNOVA: Fix incorrect sanity check for debug command
713d13e7ad SUPERNOVA: Mark intentional fallthrough in switch


Commit: bab0bf2b1eab75e8575bb87bdecadf52fbe05ec9
    https://github.com/scummvm/scummvm/commit/bab0bf2b1eab75e8575bb87bdecadf52fbe05ec9
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2018-01-31T20:45:31Z

Commit Message:
SUPERNOVA: Improve command button size for translations

Changed paths:
    engines/supernova/state.cpp


diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp
index 9103a0b..b8e28c3 100644
--- a/engines/supernova/state.cpp
+++ b/engines/supernova/state.cpp
@@ -462,13 +462,22 @@ void GameManager::initRooms() {
 }
 
 void GameManager::initGui() {
+	int cmdCount = ARRAYSIZE(_guiCommandButton);
+	int cmdAvailableSpace = 320 - (cmdCount - 1) * 2;
+	for (int i = 0; i < cmdCount; ++i) {
+		const Common::String &text = _vm->getGameString(guiCommands[i]);
+		cmdAvailableSpace -= _vm->textWidth(text);
+	}
+
 	int commandButtonX = 0;
 	for (int i = 0; i < ARRAYSIZE(_guiCommandButton); ++i) {
 		const Common::String &text = _vm->getGameString(guiCommands[i]);
 		int width;
-		if (i < 9)
-			width = _vm->textWidth(text) + 2;
-		else
+		if (i < cmdCount - 1) {
+			int space = cmdAvailableSpace / (cmdCount - i);
+			cmdAvailableSpace -= space;
+			width = _vm->textWidth(text) + space;
+		} else
 			width = 320 - commandButtonX;
 
 		_guiCommandButton[i].setSize(commandButtonX, 150, commandButtonX + width, 159);
@@ -1476,8 +1485,9 @@ void GameManager::drawCommandBox() {
 		               _guiCommandButton[i].width(),
 		               _guiCommandButton[i].height(),
 		               _guiCommandButton[i]._bgColor);
+		int space = (_guiCommandButton[i].width() - _vm->textWidth(_guiCommandButton[i]._text)) / 2;
 		_vm->renderText(_guiCommandButton[i]._text,
-		                _guiCommandButton[i]._textPosition.x,
+		                _guiCommandButton[i]._textPosition.x + space,
 		                _guiCommandButton[i]._textPosition.y,
 		                _guiCommandButton[i]._textColor);
 	}


Commit: 4c857e1706a28a4374344c87162b6de54a36489f
    https://github.com/scummvm/scummvm/commit/4c857e1706a28a4374344c87162b6de54a36489f
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2018-01-31T20:58:02Z

Commit Message:
SUPERNOVA: Fix incorrect sanity check for debug command

This was reported by coverity (CID 1385537).

Changed paths:
    engines/supernova/console.cpp


diff --git a/engines/supernova/console.cpp b/engines/supernova/console.cpp
index ee1905a..4dc7f04 100644
--- a/engines/supernova/console.cpp
+++ b/engines/supernova/console.cpp
@@ -86,7 +86,7 @@ bool Console::cmdList(int argc, const char **argv) {
 }
 
 bool Console::cmdInventory(int argc, const char **argv) {
-	if (argc != 2 || argc != 3) {
+	if (argc != 2 && argc != 3) {
 		debugPrintf("Usage: inventory [list][add/remove [object]]");
 		return true;
 	}


Commit: 713d13e7ad182b308f6e15ad34c666563d39e607
    https://github.com/scummvm/scummvm/commit/713d13e7ad182b308f6e15ad34c666563d39e607
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2018-01-31T21:09:10Z

Commit Message:
SUPERNOVA: Mark intentional fallthrough in switch

Changed paths:
    engines/supernova/state.cpp


diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp
index b8e28c3..e843738 100644
--- a/engines/supernova/state.cpp
+++ b/engines/supernova/state.cpp
@@ -895,6 +895,7 @@ void GameManager::telomat(int nr) {
 				_vm->renderText(kStringShipSleepCabin9, 100, 120, kColorGreen);
 				wait2(10);
 			}
+			// fallthrough
 		case Common::KEYCODE_ESCAPE:
 			_vm->renderBox(0, 0, 320, 200, kColorBlack);
 			_vm->renderRoom(*_currentRoom);





More information about the Scummvm-git-logs mailing list