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

dreammaster dreammaster at scummvm.org
Tue Sep 13 11:53:52 CEST 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:
e20647eae3 TSAGE: Synchronise UI fields in savegames so it is correctly shown when restoring


Commit: e20647eae3e4e139c30c058e238848d2b3728631
    https://github.com/scummvm/scummvm/commit/e20647eae3e4e139c30c058e238848d2b3728631
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2011-09-13T02:47:31-07:00

Commit Message:
TSAGE: Synchronise UI fields in savegames so it is correctly shown when restoring

Changed paths:
    engines/tsage/blue_force/blueforce_ui.cpp
    engines/tsage/blue_force/blueforce_ui.h
    engines/tsage/core.cpp
    engines/tsage/globals.cpp



diff --git a/engines/tsage/blue_force/blueforce_ui.cpp b/engines/tsage/blue_force/blueforce_ui.cpp
index 8f40d2b..75ab9a6 100644
--- a/engines/tsage/blue_force/blueforce_ui.cpp
+++ b/engines/tsage/blue_force/blueforce_ui.cpp
@@ -264,6 +264,34 @@ void UICollection::draw() {
 
 UIElements::UIElements(): UICollection() {
 	_cursorVisage.setVisage(1, 5);
+	_saver->addLoadNotifier(&UIElements::loadNotifierProc);
+}
+
+void UIElements::synchronize(Serializer &s) {
+	UICollection::synchronize(s);
+
+	s.syncAsSint16LE(_slotStart);
+	s.syncAsSint16LE(_scoreValue);
+	s.syncAsByte(_active);
+
+	int count = _itemList.size();
+	s.syncAsSint16LE(count);
+	if (s.isLoading()) {
+		// Load in item list
+		_itemList.clear();
+
+		for (int idx = 0; idx < count; ++idx) {
+			int itemId;
+			s.syncAsSint16LE(itemId);
+			_itemList.push_back(itemId);
+		}
+	} else {
+		// Save item list
+		for (int idx = 0; idx < count; ++idx) {
+			int itemId = _itemList[idx];
+			s.syncAsSint16LE(itemId);
+		}
+	}
 }
 
 void UIElements::process(Event &event) {
@@ -471,6 +499,11 @@ void UIElements::scrollInventory(bool isLeft) {
 	updateInventory();
 }
 
+void UIElements::loadNotifierProc(bool postFlag) {
+	if (postFlag && BF_GLOBALS._uiElements._active)
+		BF_GLOBALS._uiElements.show();
+}
+
 } // End of namespace BlueForce
 
 } // End of namespace TsAGE
diff --git a/engines/tsage/blue_force/blueforce_ui.h b/engines/tsage/blue_force/blueforce_ui.h
index 927e667..d9c593b 100644
--- a/engines/tsage/blue_force/blueforce_ui.h
+++ b/engines/tsage/blue_force/blueforce_ui.h
@@ -136,6 +136,8 @@ public:
 	Visage _cursorVisage;
 
 	UIElements();
+	virtual Common::String getClassName() { return "UIElements"; }
+	virtual void synchronize(Serializer &s);
 	virtual void postInit(SceneObjectList *OwnerList = NULL) { error("Wrong init() called"); }
 	virtual void process(Event &event);
 
@@ -143,6 +145,8 @@ public:
 	void updateInventory();
 	void addScore(int amount);
 	void scrollInventory(bool isLeft);
+
+	static void loadNotifierProc(bool postFlag);
 };
 
 } // End of namespace BlueForce
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index 7656a6c..252a7b2 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -1423,8 +1423,12 @@ void ScenePalette::changeBackground(const Rect &bounds, FadeMode fadeMode) {
 		}
 	}
 
+	Rect tempRect = bounds;
+	if (_vm->getGameID() == GType_BlueForce)
+		tempRect.setHeight(BF_GLOBALS._interfaceY);
+	
 	_globals->_screenSurface.copyFrom(_globals->_sceneManager._scene->_backSurface,
-		bounds, Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), NULL);
+		tempRect, Rect(0, 0, tempRect.width(), tempRect.height()), NULL);
 
 	for (SynchronizedList<PaletteModifier *>::iterator i = tempPalette._listeners.begin(); i != tempPalette._listeners.end(); ++i)
 		delete *i;
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index 1895fbc..75af19d 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -224,7 +224,7 @@ void BlueForceGlobals::reset() {
 	_driveFromScene = 300;
 	_driveToScene = 0;
 
-	_interfaceY = 0;
+	_interfaceY = BF_INTERFACE_Y;
 	_v51C44 = 1;
 	_dayNumber = 0;
 	_v4CEA4 = 0;






More information about the Scummvm-git-logs mailing list