[Scummvm-git-logs] scummvm master -> 9e437d46a8b95589263aa1185983d9c20d2f2879

dreammaster dreammaster at scummvm.org
Sat Sep 3 04:44:42 CEST 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:
e2c68e0a7d TITANIC: Cleanup of CPlugIn
9e437d46a8 TITANIC: Cleanup of CPetInventory, removal of unused fields


Commit: e2c68e0a7dcb2eeb10072df84f1ac6dfefa8d1f1
    https://github.com/scummvm/scummvm/commit/e2c68e0a7dcb2eeb10072df84f1ac6dfefa8d1f1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-09-02T22:34:10-04:00

Commit Message:
TITANIC: Cleanup of CPlugIn

Changed paths:
    engines/titanic/carry/plug_in.cpp
    engines/titanic/carry/plug_in.h



diff --git a/engines/titanic/carry/plug_in.cpp b/engines/titanic/carry/plug_in.cpp
index 883458c..438b9a5 100644
--- a/engines/titanic/carry/plug_in.cpp
+++ b/engines/titanic/carry/plug_in.cpp
@@ -28,16 +28,18 @@ BEGIN_MESSAGE_MAP(CPlugIn, CCarry)
 	ON_MESSAGE(UseWithOtherMsg)
 END_MESSAGE_MAP()
 
-CPlugIn::CPlugIn() : CCarry(), _field12C(0) {
+CPlugIn::CPlugIn() : CCarry(), _unused(0) {
 }
 
 void CPlugIn::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_unused, indent);
 	CCarry::save(file, indent);
 }
 
 void CPlugIn::load(SimpleFile *file) {
 	file->readNumber();
+	_unused = file->readNumber();
 	CCarry::load(file);
 }
 
diff --git a/engines/titanic/carry/plug_in.h b/engines/titanic/carry/plug_in.h
index 1358a99..5f7d5dd 100644
--- a/engines/titanic/carry/plug_in.h
+++ b/engines/titanic/carry/plug_in.h
@@ -31,7 +31,7 @@ class CPlugIn : public CCarry {
 	DECLARE_MESSAGE_MAP;
 	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
 private:
-	int _field12C;
+	int _unused;
 public:
 	CLASSDEF;
 	CPlugIn();


Commit: 9e437d46a8b95589263aa1185983d9c20d2f2879
    https://github.com/scummvm/scummvm/commit/9e437d46a8b95589263aa1185983d9c20d2f2879
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-09-02T22:44:34-04:00

Commit Message:
TITANIC: Cleanup of CPetInventory, removal of unused fields

Changed paths:
    engines/titanic/main_game_window.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/pet_control/pet_inventory_glyphs.cpp
    engines/titanic/pet_control/pet_inventory_glyphs.h
    engines/titanic/support/files_manager.cpp
    engines/titanic/support/files_manager.h



diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index 530d579..7bd918d 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -40,7 +40,6 @@ private:
 	TitanicEngine *_vm;
 	int _pendingLoadSlot;
 	uint _specialButtons;
-	uint32 _priorFrameTime;
 	uint32 _priorLeftDownTime;
 	uint32 _priorMiddleDownTime;
 	uint32 _priorRightDownTime;
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 55176d8..8831045 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 CPetInventory::CPetInventory() : CPetSection(),
-		_movie(nullptr), _field290(false), _field294(0), _field298(0) {
+		_movie(nullptr), _isLoading(false), _field298(0) {
 	for (int idx = 0; idx < TOTAL_ITEMS; ++idx) {
 		_itemBackgrounds[idx] = _itemGlyphs[idx] = nullptr;
 	}
@@ -109,9 +109,9 @@ void CPetInventory::load(SimpleFile *file, int param) {
 
 void CPetInventory::postLoad() {
 	reset();
-	_field290 = 1;
+	_isLoading = true;
 	itemsChanged();
-	_field290 = 0;
+	_isLoading = false;
 }
 
 void CPetInventory::save(SimpleFile *file, int indent) {
@@ -179,7 +179,7 @@ void CPetInventory::itemsChanged() {
 	while (item) {
 		CPetInventoryGlyph *glyph = new CPetInventoryGlyph();
 		glyph->setup(_petControl, &_items);
-		glyph->setItem(item, _field290);
+		glyph->setItem(item, _isLoading);
 
 		_items.push_back(glyph);
 		item = _petControl->getNextObject(item);
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 1764954..184bb20 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -40,8 +40,7 @@ private:
 	CGameObject *_itemBackgrounds[46];
 	CGameObject *_itemGlyphs[46];
 	CGameObject *_movie;
-	bool _field290;
-	int _field294;
+	bool _isLoading;
 	int _field298;
 private:
 	/**
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
index 783a8a9..3897454 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
@@ -198,17 +198,17 @@ bool CPetInventoryGlyph::doAction(CGlyphAction *action) {
 	return true;
 }
 
-void CPetInventoryGlyph::setItem(CGameObject *item, int val) {
+void CPetInventoryGlyph::setItem(CGameObject *item, bool isLoading) {
 	_item = item;
 
 	if (_owner && item) {
-		int v1 = populateItem(item, val);
+		int v1 = populateItem(item, isLoading);
 		_background = dynamic_cast<CPetInventoryGlyphs *>(_owner)->getBackground(v1);
 		_image = dynamic_cast<CPetInventory *>(getPetSection())->getImage(v1);
 	}
 }
 
-int CPetInventoryGlyph::populateItem(CGameObject *item, int val) {
+int CPetInventoryGlyph::populateItem(CGameObject *item, bool isLoading) {
 	// Scan the master item names list
 	CString itemName = item->getName();
 	int itemIndex = -1;
@@ -221,7 +221,7 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, int val) {
 
 	switch (ITEM_MODES[itemIndex]) {
 	case 0:
-		switch (subMode(item, val)) {
+		switch (subMode(item, isLoading)) {
 		case 0:
 		case 1:
 			return 0;
@@ -233,7 +233,7 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, int val) {
 		}
 
 	case 2:
-		switch (subMode(item, val)) {
+		switch (subMode(item, isLoading)) {
 		case 0:
 			return 2;
 		default:
@@ -242,7 +242,7 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, int val) {
 		break;
 
 	case 15:
-		switch (subMode(item, val)) {
+		switch (subMode(item, isLoading)) {
 		case 0:
 		case 1:
 			return 14;
@@ -260,7 +260,7 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, int val) {
 		break;
 
 	case 26:
-		switch (subMode(item, val)) {
+		switch (subMode(item, isLoading)) {
 		case 0:
 			return 26;
 		case 1:
@@ -281,11 +281,11 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, int val) {
 	return ITEM_MODES[itemIndex];
 }
 
-int CPetInventoryGlyph::subMode(CGameObject *item, int val) {
+int CPetInventoryGlyph::subMode(CGameObject *item, bool isLoading) {
 	int frameNum = item->getFrameNumber();
 	int movieFrame = item->getMovieFrame();
 
-	if (val && frameNum != -1 && frameNum != movieFrame)
+	if (isLoading && frameNum != -1 && frameNum != movieFrame)
 		item->loadFrame(frameNum);
 
 	return frameNum;
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.h b/engines/titanic/pet_control/pet_inventory_glyphs.h
index 716c9d1..0d167c4 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.h
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.h
@@ -34,9 +34,9 @@ private:
 	/**
 	 * Populate the details for an item
 	 */
-	int populateItem(CGameObject *item, int val);
+	int populateItem(CGameObject *item, bool isLoading);
 
-	int subMode(CGameObject *item, int val);
+	int subMode(CGameObject *item, bool isLoading);
 
 	/**
 	 * Start any movie for the background
@@ -126,7 +126,7 @@ public:
 	/**
 	 * Set the inventory item
 	 */
-	void setItem(CGameObject *item, int val);
+	void setItem(CGameObject *item, bool isLoading);
 };
 
 class CInventoryGlyphAction : public CGlyphAction {
diff --git a/engines/titanic/support/files_manager.cpp b/engines/titanic/support/files_manager.cpp
index 3ee17e9..ee3a3e1 100644
--- a/engines/titanic/support/files_manager.cpp
+++ b/engines/titanic/support/files_manager.cpp
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 CFilesManager::CFilesManager() : _gameManager(nullptr), _assetsPath("Assets"),
-		_field0(0), _drive(-1), _field18(0), _field1C(0), _field3C(0) {
+		_drive(-1) {
 	loadResourceIndex();
 }
 
diff --git a/engines/titanic/support/files_manager.h b/engines/titanic/support/files_manager.h
index c530b05..6f56327 100644
--- a/engines/titanic/support/files_manager.h
+++ b/engines/titanic/support/files_manager.h
@@ -48,13 +48,7 @@ private:
 	Common::File _datFile;
 	ResourceHash _resources;
 	CFilesManagerList _list;
-	CString _string1;
-	CString _string2;
-	int _field0;
 	int _drive;
-	int _field18;
-	int _field1C;
-	int _field3C;
 	const CString _assetsPath;
 private:
 	void loadResourceIndex();





More information about the Scummvm-git-logs mailing list