[Scummvm-cvs-logs] scummvm master -> 29b5b4afa66287dc382adbd2bfcb8add620d2a0d

Strangerke arnaud.boutonne at gmail.com
Mon Mar 7 19:40:47 CET 2011


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:
29b5b4afa6 HUGO: Fix registration messages for H1 Dos Freeware version (in intro)


Commit: 29b5b4afa66287dc382adbd2bfcb8add620d2a0d
    https://github.com/scummvm/scummvm/commit/29b5b4afa66287dc382adbd2bfcb8add620d2a0d
Author: strangerke (arnaud.boutonne at gmail.com)
Date: 2011-03-07T10:40:20-08:00

Commit Message:
HUGO: Fix registration messages for H1 Dos Freeware version (in intro)

Changed paths:
    engines/hugo/file.cpp
    engines/hugo/hugo.cpp
    engines/hugo/hugo.h
    engines/hugo/intro.cpp



diff --git a/engines/hugo/file.cpp b/engines/hugo/file.cpp
index 740513d..c287ebf 100644
--- a/engines/hugo/file.cpp
+++ b/engines/hugo/file.cpp
@@ -563,6 +563,8 @@ void FileManager::readBootFile() {
 		if (_vm->_gameVariant == kGameVariantH1Dos) {
 			//TODO initialize properly _boot structure
 			warning("readBootFile - Skipping as H1 Dos may be a freeware");
+			memset(_vm->_boot.distrib, '\0', sizeof(_vm->_boot.distrib));
+			_vm->_boot.registered = kRegFreeware;
 			return;
 		} else {
 			error("Missing startup file");
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index 226009e..9a62229 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -673,7 +673,7 @@ void HugoEngine::calcMaxScore() {
 void HugoEngine::endGame() {
 	debugC(1, kDebugEngine, "endGame");
 
-	if (!_boot.registered)
+	if (_boot.registered != kRegRegistered)
 		Utils::Box(kBoxAny, "%s", _text->getTextEngine(kEsAdvertise));
 	Utils::Box(kBoxAny, "%s\n%s", _episode, getCopyrightString());
 	_status.viewState = kViewExit;
diff --git a/engines/hugo/hugo.h b/engines/hugo/hugo.h
index 44ec001..2de442e 100644
--- a/engines/hugo/hugo.h
+++ b/engines/hugo/hugo.h
@@ -125,6 +125,12 @@ enum HugoDebugChannels {
 	kDebugMusic     = 1 <<  9
 };
 
+enum HugoRegistered {
+	kRegShareware = 0,
+	kRegRegistered,
+	kRegFreeware
+};
+
 /**
  * Ways to dismiss a text/prompt box
  */
diff --git a/engines/hugo/intro.cpp b/engines/hugo/intro.cpp
index 689dfbf..7551476 100644
--- a/engines/hugo/intro.cpp
+++ b/engines/hugo/intro.cpp
@@ -119,15 +119,19 @@ bool intro_v1d::introPlay() {
 				error("Unable to load font TMSRB.FON, face 'Tms Rmn', size 8");
 
 			char buffer[80];
-			if (_vm->_boot.registered)
+			if (_vm->_boot.registered == kRegRegistered)
 				strcpy(buffer, "Registered Version");
-			else
+			else if (_vm->_boot.registered == kRegShareware)
 				strcpy(buffer, "Shareware Version");
+			else if (_vm->_boot.registered == kRegFreeware)
+				strcpy(buffer, "Freeware Version");
+			else
+				error("Unknown registration flag in hugo.bsf: %d", _vm->_boot.registered);
 
 			font.drawString(&surf, buffer, 0, 163, 320, _TLIGHTMAGENTA, Graphics::kTextAlignCenter);
 			font.drawString(&surf, _vm->getCopyrightString(), 0, 176, 320, _TLIGHTMAGENTA, Graphics::kTextAlignCenter);
 
-			if (scumm_stricmp(_vm->_boot.distrib, "David P. Gray")) {
+			if ((*_vm->_boot.distrib != '\0') && (scumm_stricmp(_vm->_boot.distrib, "David P. Gray"))) {
 				sprintf(buffer, "Distributed by %s.", _vm->_boot.distrib);
 				font.drawString(&surf, buffer, 0, 75, 320, _TMAGENTA, Graphics::kTextAlignCenter);
 			}






More information about the Scummvm-git-logs mailing list