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

Strangerke arnaud.boutonne at gmail.com
Thu Feb 24 19:59:52 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:
fbf41fc66a HUGO:


Commit: fbf41fc66a5e6c24903e4fbe51b28c9f03ed1628
    https://github.com/scummvm/scummvm/commit/fbf41fc66a5e6c24903e4fbe51b28c9f03ed1628
Author: strangerke (arnaud.boutonne at gmail.com)
Date: 2011-02-24T10:59:36-08:00

Commit Message:
HUGO:

- Increase savegame version, as it has changed due to RGBa->RGB modification
- Fix regression in restorePal()
- Implement load from GMM

Changed paths:
    engines/hugo/display.cpp
    engines/hugo/hugo.cpp
    engines/hugo/hugo.h



diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp
index 0210eb8..6c36318 100644
--- a/engines/hugo/display.cpp
+++ b/engines/hugo/display.cpp
@@ -214,10 +214,10 @@ void Screen::savePal(Common::WriteStream *f) const {
 void Screen::restorePal(Common::ReadStream *f) {
 	debugC(1, kDebugDisplay, "restorePal()");
 
-	for (int i = 0; i < _paletteSize; i++) {
+	for (int i = 0; i < _paletteSize; i++)
 		_curPalette[i] = f->readByte();
-		g_system->getPaletteManager()->setPalette(_curPalette, i, 1);
-	}
+
+	g_system->getPaletteManager()->setPalette(_curPalette, 0, _paletteSize / 3);
 }
 
 
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index 2143b8c..8d5fa87 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -28,6 +28,7 @@
 #include "common/events.h"
 #include "common/EventRecorder.h"
 #include "common/debug-channels.h"
+#include "common/config-manager.h"
 
 #include "hugo/hugo.h"
 #include "hugo/game.h"
@@ -253,14 +254,20 @@ Common::Error HugoEngine::run() {
 
 	// Start the state machine
 	_status.viewState = kViewIntroInit;
-
 	_status.doQuitFl = false;
+	int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot");
+	if (loadSlot >= 0) {
+		_status.skipIntroFl = true;
+		_file->restoreGame(loadSlot);
+		_scheduler->restoreScreen(*_screen_p);
+		_status.viewState = kViewPlay;
+	}
 
 	while (!_status.doQuitFl) {
 		_screen->drawBoundaries();
-
 		g_system->updateScreen();
 		runMachine();
+
 		// Handle input
 		Common::Event event;
 		while (_eventMan->pollEvent(event)) {
@@ -285,6 +292,7 @@ Common::Error HugoEngine::run() {
 				break;
 			}
 		}
+	
 		_mouse->mouseHandler();                     // Mouse activity - adds to display list
 		_screen->displayList(kDisplayDisplay);      // Blit the display list to screen
 		_status.doQuitFl |= shouldQuit();           // update game quit flag
diff --git a/engines/hugo/hugo.h b/engines/hugo/hugo.h
index b2739c8..ca069ca 100644
--- a/engines/hugo/hugo.h
+++ b/engines/hugo/hugo.h
@@ -58,7 +58,7 @@ class RandomSource;
  */
 namespace Hugo {
 
-static const int kSavegameVersion = 3;
+static const int kSavegameVersion = 4;
 static const int kInvDx = 32;                       // Width of an inventory icon
 static const int kInvDy = 32;                       // Height of inventory icon
 static const int kMaxTunes = 16;                    // Max number of tunes
@@ -242,7 +242,6 @@ public:
 	object_t *_hero;
 	byte  *_screen_p;
 	byte  _heroImage;
-
 	byte  *_screenStates;
 	command_t _line;                                // Line of user text input
 	config_t  _config;                              // User's config






More information about the Scummvm-git-logs mailing list