[Scummvm-cvs-logs] scummvm master -> eaad4208c73a80dd30bce19306f3f1420abbcaa7

sev- sev at scummvm.org
Sun Feb 14 12:52:28 CET 2016


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

Summary:
fde06e342d SHERLOCK: Safer print()
eaad4208c7 SCI: Proper initialization.


Commit: fde06e342db4931c229cb493f43738a8a7c67e69
    https://github.com/scummvm/scummvm/commit/fde06e342db4931c229cb493f43738a8a7c67e69
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-02-14T12:46:48+01:00

Commit Message:
SHERLOCK: Safer print()

Changed paths:
    engines/sherlock/scalpel/scalpel_user_interface.cpp



diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp
index 13c4f68..7ac8d0d 100644
--- a/engines/sherlock/scalpel/scalpel_user_interface.cpp
+++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp
@@ -501,7 +501,7 @@ void ScalpelUserInterface::toggleButton(uint16 num) {
 
 void ScalpelUserInterface::clearInfo() {
 	if (_infoFlag) {
-		_vm->_screen->vgaBar(Common::Rect(IS_3DO ? 33 : 16, INFO_LINE, 
+		_vm->_screen->vgaBar(Common::Rect(IS_3DO ? 33 : 16, INFO_LINE,
 			SHERLOCK_SCREEN_WIDTH - (IS_3DO ? 33 : 19), INFO_LINE + 10), INFO_BLACK);
 		_infoFlag = false;
 		_oldLook = -1;
@@ -654,16 +654,16 @@ void ScalpelUserInterface::lookScreen(const Common::Point &pt) {
 
 						int xStart = (SHERLOCK_SCREEN_WIDTH - x) / 2;
 						screen.print(Common::Point(xStart, INFO_LINE + 1),
-							INFO_FOREGROUND, useText1.c_str());
+							INFO_FOREGROUND, "%s", useText1.c_str());
 
 						if (_selector != -1) {
 							screen.print(Common::Point(xStart + width1, INFO_LINE + 1),
-								TALK_FOREGROUND, useText2.c_str());
+								TALK_FOREGROUND, "%s", useText2.c_str());
 							screen.print(Common::Point(xStart + width1 + width2, INFO_LINE + 1),
-								INFO_FOREGROUND, useText3.c_str());
+								INFO_FOREGROUND, "%s", useText3.c_str());
 						} else {
 							screen.print(Common::Point(xStart + width1, INFO_LINE + 1),
-								INFO_FOREGROUND, useText3.c_str());
+								INFO_FOREGROUND, "%s", useText3.c_str());
 						}
 					} else if (temp >= 0 && temp < 1000 && _selector != -1 &&
 							scene._bgShapes[temp]._aType == PERSON) {
@@ -686,11 +686,11 @@ void ScalpelUserInterface::lookScreen(const Common::Point &pt) {
 
 						int xStart = (SHERLOCK_SCREEN_WIDTH - x) / 2;
 						screen.print(Common::Point(xStart, INFO_LINE + 1),
-							INFO_FOREGROUND, giveText1.c_str());
+							INFO_FOREGROUND, "%s", giveText1.c_str());
 						screen.print(Common::Point(xStart + width1, INFO_LINE + 1),
-							TALK_FOREGROUND, giveText2.c_str());
+							TALK_FOREGROUND, "%s", giveText2.c_str());
 						screen.print(Common::Point(xStart + width1 + width2, INFO_LINE + 1),
-							INFO_FOREGROUND, giveText3.c_str());
+							INFO_FOREGROUND, "%s", giveText3.c_str());
 					}
 				} else {
 					screen.print(Common::Point(0, INFO_LINE + 1), INFO_FOREGROUND, "%s", tempStr.c_str());
@@ -927,7 +927,7 @@ void ScalpelUserInterface::doEnvControl() {
 			} while (saves._savegameIndex < (MAX_SAVEGAME_SLOTS - ONSCREEN_FILES_COUNT) && moreKeys);
 		} else if ((found == 5 && events._released) || _key == saves._hotkeyQuit) {
 			clearWindow();
-			screen.print(Common::Point(0, CONTROLS_Y + 20), INV_FOREGROUND, saves._fixedTextQuitGameQuestion.c_str());
+			screen.print(Common::Point(0, CONTROLS_Y + 20), INV_FOREGROUND, "%s", saves._fixedTextQuitGameQuestion.c_str());
 			screen.vgaBar(Common::Rect(0, CONTROLS_Y, SHERLOCK_SCREEN_WIDTH, CONTROLS_Y + 10), BORDER_COLOR);
 
 			screen.makeButton(Common::Rect(112, CONTROLS_Y, 160, CONTROLS_Y + 10), 136, saves._fixedTextQuitGameYes);
@@ -2252,7 +2252,7 @@ void ScalpelUserInterface::checkUseAction(const UseType *use, const Common::Stri
 			if (scene._goToScene != 1 && !printed && !talk._talkToAbort) {
 				_infoFlag = true;
 				clearInfo();
-				screen.print(Common::Point(0, INFO_LINE + 1), INFO_FOREGROUND, FIXED(UserInterface_Done));
+				screen.print(Common::Point(0, INFO_LINE + 1), INFO_FOREGROUND, "%s", FIXED(UserInterface_Done));
 				_menuCounter = 25;
 			}
 		}
@@ -2262,9 +2262,9 @@ void ScalpelUserInterface::checkUseAction(const UseType *use, const Common::Stri
 		clearInfo();
 
 		if (giveMode) {
-			screen.print(Common::Point(0, INFO_LINE + 1), INFO_FOREGROUND, FIXED(UserInterface_NoThankYou));
+			screen.print(Common::Point(0, INFO_LINE + 1), INFO_FOREGROUND, "%s", FIXED(UserInterface_NoThankYou));
 		} else if (fixedTextActionId == kFixedTextAction_Invalid) {
-			screen.print(Common::Point(0, INFO_LINE + 1), INFO_FOREGROUND, FIXED(UserInterface_YouCantDoThat));
+			screen.print(Common::Point(0, INFO_LINE + 1), INFO_FOREGROUND, "%s", FIXED(UserInterface_YouCantDoThat));
 		} else {
 			Common::String errorMessage = fixedText.getActionMessage(fixedTextActionId, 0);
 			screen.print(Common::Point(0, INFO_LINE + 1), INFO_FOREGROUND, "%s", errorMessage.c_str());


Commit: eaad4208c73a80dd30bce19306f3f1420abbcaa7
    https://github.com/scummvm/scummvm/commit/eaad4208c73a80dd30bce19306f3f1420abbcaa7
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-02-14T12:50:04+01:00

Commit Message:
SCI: Proper initialization.

There is no guarantee of initialization order in the constructor
declaration, thus corss references are not a good idea.

Changed paths:
    engines/sci/graphics/palette32.cpp



diff --git a/engines/sci/graphics/palette32.cpp b/engines/sci/graphics/palette32.cpp
index e330b56..e61ac5d 100644
--- a/engines/sci/graphics/palette32.cpp
+++ b/engines/sci/graphics/palette32.cpp
@@ -31,7 +31,7 @@
 #include "sci/graphics/screen.h"
 
 namespace Sci {
-	
+
 GfxPalette32::GfxPalette32(ResourceManager *resMan, GfxScreen *screen)
 	: GfxPalette(resMan, screen),
 	_clutTable(nullptr),
@@ -42,9 +42,10 @@ GfxPalette32::GfxPalette32(ResourceManager *resMan, GfxScreen *screen)
 	_varyTime(0), _varyDirection(0), _varyTargetPercent(0),
 	_varyTargetPalette(nullptr), _varyStartPalette(nullptr),
 	_varyFromColor(0), _varyToColor(255), _varyNumTimesPaused(0),
-	_varyPercent(_varyTargetPercent), _varyLastTick(0),
+	_varyLastTick(0),
 	// Palette versioning
 	_version(1), _versionUpdated(false) {
+		_varyPercent = _varyTargetPercent;
 		memset(_fadeTable, 100, sizeof(_fadeTable));
 
 		// NOTE: In SCI engine, the palette manager constructor loads






More information about the Scummvm-git-logs mailing list