[Scummvm-git-logs] scummvm master -> 34b266b51d69617d852d0118b9992f0013f3c1e4

sev- sev at scummvm.org
Sat Sep 17 20:44:09 CEST 2016


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

Summary:
210a57c4c0 FULLPIPE: Implement inventory saving
80419708d0 FULLPIPE: Turned MfcArchive into read/write stream like in original
ec378ac3b7 FULLPIPE: Fix teleportation when turning mid-walk
34b266b51d FULLPIPE: Mass fix incorrect inhibitor flag


Commit: 210a57c4c07733edb31733a1c81a53b01fb6eb7a
    https://github.com/scummvm/scummvm/commit/210a57c4c07733edb31733a1c81a53b01fb6eb7a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-09-17T20:43:57+02:00

Commit Message:
FULLPIPE: Implement inventory saving

Changed paths:
    engines/fullpipe/gameloader.cpp
    engines/fullpipe/inventory.cpp
    engines/fullpipe/inventory.h



diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp
index 7a862ee..83da25d 100644
--- a/engines/fullpipe/gameloader.cpp
+++ b/engines/fullpipe/gameloader.cpp
@@ -659,7 +659,7 @@ void GameLoader::writeSavegame(Scene *sc, const char *fname) {
 		v->_prevVarObj = prv;
 	}
 
-	getGameLoaderInventory()->writePartial(saveFile);
+	getGameLoaderInventory()->savePartial(saveFile);
 
 	saveFile->writeUint32LE(_sc2array.size());
 
diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp
index 10a5847..335635c 100644
--- a/engines/fullpipe/inventory.cpp
+++ b/engines/fullpipe/inventory.cpp
@@ -106,8 +106,14 @@ bool Inventory2::loadPartial(MfcArchive &file) { // Inventory2_SerializePartiall
 	return true;
 }
 
-bool Inventory2::writePartial(Common::WriteStream *file) {
-	warning("STUB: nventory2::writePartial()");
+bool Inventory2::savePartial(Common::WriteStream *saveFile) {
+	saveFile->writeUint32LE(_inventoryItems.size());
+
+	for (uint i = 0; i < _inventoryItems.size(); i++) {
+		saveFile->writeUint16LE(_inventoryItems[i]->itemId);
+		saveFile->writeUint16LE(_inventoryItems[i]->count);
+	}
+
 	return true;
 }
 
diff --git a/engines/fullpipe/inventory.h b/engines/fullpipe/inventory.h
index 6f6e349..e619f7d 100644
--- a/engines/fullpipe/inventory.h
+++ b/engines/fullpipe/inventory.h
@@ -101,7 +101,7 @@ class Inventory2 : public Inventory {
 	virtual ~Inventory2();
 
 	bool loadPartial(MfcArchive &file);
-	bool writePartial(Common::WriteStream *file);
+	bool savePartial(Common::WriteStream *file);
 	void addItem(int itemId, int count);
 	void addItem2(StaticANIObject *obj);
 	void removeItem(int itemId, int count);


Commit: 80419708d03811ac1605ccf1cafa34e64f389646
    https://github.com/scummvm/scummvm/commit/80419708d03811ac1605ccf1cafa34e64f389646
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-09-17T20:43:57+02:00

Commit Message:
FULLPIPE: Turned MfcArchive into read/write stream like in original

Changed paths:
    engines/fullpipe/utils.cpp
    engines/fullpipe/utils.h



diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp
index de7cbbb..3250376 100644
--- a/engines/fullpipe/utils.cpp
+++ b/engines/fullpipe/utils.cpp
@@ -347,6 +347,20 @@ static CObject *createObject(int objectId) {
 }
 
 MfcArchive::MfcArchive(Common::SeekableReadStream *stream) {
+	_stream = stream;
+	_wstream = 0;
+
+	init();
+}
+
+MfcArchive::MfcArchive(Common::WriteStream *stream) {
+	_wstream = stream;
+	_stream = 0;
+
+	init();
+}
+
+void MfcArchive::init() {
 	for (int i = 0; classMap[i].name; i++) {
 		_classMap[classMap[i].name] = classMap[i].id;
 	}
@@ -354,8 +368,6 @@ MfcArchive::MfcArchive(Common::SeekableReadStream *stream) {
 	_lastIndex = 1;
 	_level = 0;
 
-	_stream = stream;
-
 	_objectMap.push_back(0);
 	_objectIdMap.push_back(kNullObject);
 }
diff --git a/engines/fullpipe/utils.h b/engines/fullpipe/utils.h
index da3ab7e..3741b4a 100644
--- a/engines/fullpipe/utils.h
+++ b/engines/fullpipe/utils.h
@@ -34,7 +34,7 @@ class NGIArchive;
 
 typedef Common::HashMap<Common::String, int, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> ClassMap;
 
-class MfcArchive : public Common::SeekableReadStream {
+class MfcArchive : public Common::SeekableReadStream, Common::WriteStream {
 	ClassMap _classMap;
 	Common::Array<CObject *> _objectMap;
 	Common::Array<int> _objectIdMap;
@@ -43,9 +43,11 @@ class MfcArchive : public Common::SeekableReadStream {
 	int _level;
 
 	Common::SeekableReadStream *_stream;
+	Common::WriteStream *_wstream;
 
- public:
+public:
 	MfcArchive(Common::SeekableReadStream *file);
+	MfcArchive(Common::WriteStream *file);
 
 	char *readPascalString(bool twoByte = false);
 	int readCount();
@@ -59,9 +61,14 @@ class MfcArchive : public Common::SeekableReadStream {
 
 	virtual bool eos() const { return _stream->eos(); }
 	virtual uint32 read(void *dataPtr, uint32 dataSize) { return _stream->read(dataPtr, dataSize); }
-	virtual int32 pos() const { return _stream->pos(); }
+	virtual int32 pos() const { return _stream ? _stream->pos() : _wstream->pos(); }
 	virtual int32 size() const { return _stream->size(); }
 	virtual bool seek(int32 offset, int whence = SEEK_SET) { return _stream->seek(offset, whence); }
+
+	virtual uint32 write(const void *dataPtr, uint32 dataSize) { return _wstream->write(dataPtr, dataSize); }
+
+private:
+	void init();
 };
 
 enum ObjType {


Commit: ec378ac3b74c001cb0972ca1949b8716d6eb6af5
    https://github.com/scummvm/scummvm/commit/ec378ac3b74c001cb0972ca1949b8716d6eb6af5
Author: Retro-Junk (bambarbee at yandex.ru)
Date: 2016-09-17T20:43:57+02:00

Commit Message:
FULLPIPE: Fix teleportation when turning mid-walk

Changed paths:
    engines/fullpipe/motion.cpp



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index b910c81..ba627a9 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -1675,8 +1675,9 @@ int MctlGraph::getDirByStatics(int idx, int staticsId) {
 
 int MctlGraph::getDirByMovement(int idx, int movId) {
 	for (int i = 0; i < 4; i++)
-		if (_items2[idx]->_subItems[i]._walk[0]._movementId == movId || _items2[idx]->_subItems[i]._turn[0]._movementId == movId ||
-			_items2[idx]->_subItems[i]._turnS[0]._movementId == movId)
+		if (_items2[idx]->_subItems[i]._walk[0]._movementId == movId
+		 || _items2[idx]->_subItems[i]._walk[1]._movementId == movId
+		 || _items2[idx]->_subItems[i]._walk[2]._movementId == movId)
 			return i;
 
 	return -1;


Commit: 34b266b51d69617d852d0118b9992f0013f3c1e4
    https://github.com/scummvm/scummvm/commit/34b266b51d69617d852d0118b9992f0013f3c1e4
Author: Retro-Junk (bambarbee at yandex.ru)
Date: 2016-09-17T20:43:57+02:00

Commit Message:
FULLPIPE: Mass fix incorrect inhibitor flag

Changed paths:
    engines/fullpipe/interaction.cpp
    engines/fullpipe/lift.cpp
    engines/fullpipe/scenes/scene04.cpp
    engines/fullpipe/scenes/scene16.cpp
    engines/fullpipe/scenes/scene18and19.cpp
    engines/fullpipe/scenes/scene25.cpp
    engines/fullpipe/scenes/scene28.cpp
    engines/fullpipe/scenes/scene34.cpp
    engines/fullpipe/scenes/scene35.cpp



diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp
index 6bbf98e..accba78 100644
--- a/engines/fullpipe/interaction.cpp
+++ b/engines/fullpipe/interaction.cpp
@@ -290,8 +290,8 @@ LABEL_38:
 			return false;
 		}
 
-		subj->_flags |= 1;
-		obj->_flags |= 1;
+		subj->_flags |= 0x100;
+		obj->_flags |= 0x100;
 	} else {
 		bool someFlag = false;
 		PicAniInfo aniInfo;
@@ -389,7 +389,7 @@ LABEL_38:
 				ani->queueMessageQueue(mq);
 			}
 		} else {
-			obj->_flags |= 1;
+			obj->_flags |= 0x100;
 
 			if (inter->_flags & 0x10000)
 				return true;
diff --git a/engines/fullpipe/lift.cpp b/engines/fullpipe/lift.cpp
index 10b4154..113ddf7 100644
--- a/engines/fullpipe/lift.cpp
+++ b/engines/fullpipe/lift.cpp
@@ -358,7 +358,7 @@ void FullpipeEngine::lift_walkAndGo() {
 
 		mq->chain(0);
 
-		_aniMan->_flags |= 1;
+		_aniMan->_flags |= 0x100;
 	}
 }
 
@@ -423,12 +423,12 @@ void FullpipeEngine::lift_goAnimation() {
 
 				mq->addExCommandToEnd(ex);
 
-				_aniMan->_flags &= 0xFEFF;
+				_aniMan->_flags &= ~0x100;
 
 				if (!mq->chain(_aniMan))
 					delete mq;
 
-				_aniMan->_flags |= 1;
+				_aniMan->_flags |= 0x100;
 
 				return;
 			}
diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp
index 6810744..3bdc338 100644
--- a/engines/fullpipe/scenes/scene04.cpp
+++ b/engines/fullpipe/scenes/scene04.cpp
@@ -413,7 +413,7 @@ void sceneHandler04_jumpOnLadder() {
 
 	g_fp->_aniMan->changeStatics2(ST_MAN_LADDERDOWN);
 
-	g_fp->_aniMan->_flags |= 1;
+	g_fp->_aniMan->_flags |= 0x100;
 
 	AniHandler aniHandler;
 	MakeQueueStruct mkQueue;
@@ -527,7 +527,7 @@ void sceneHandler04_gotoLadder(ExCommand *ex) {
 
 		if (mq->chain(g_fp->_aniMan)) {
 			g_fp->_aniMan->_priority = 12;
-			g_fp->_aniMan->_flags |= 1;
+			g_fp->_aniMan->_flags |= 0x100;
 		} else {
 			delete mq;
 		}
diff --git a/engines/fullpipe/scenes/scene16.cpp b/engines/fullpipe/scenes/scene16.cpp
index 89b7977..52daef3 100644
--- a/engines/fullpipe/scenes/scene16.cpp
+++ b/engines/fullpipe/scenes/scene16.cpp
@@ -269,7 +269,7 @@ void sceneHandler16_drink() {
 							mq->setFlags(mq->getFlags() | 1);
 							mq->chain(0);
 						} else {
-							g_fp->_aniMan->_flags |= 1;
+							g_fp->_aniMan->_flags |= 0x100;
 
 							mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC16_MANDRINK), 0, 1);
 
diff --git a/engines/fullpipe/scenes/scene18and19.cpp b/engines/fullpipe/scenes/scene18and19.cpp
index e6754e4..a6f77a3 100644
--- a/engines/fullpipe/scenes/scene18and19.cpp
+++ b/engines/fullpipe/scenes/scene18and19.cpp
@@ -538,7 +538,7 @@ void sceneHandler18and19_girlJumpTo() {
 
 void sceneHandler18and19_manStandArmchair() {
 	g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT);
-	g_fp->_aniMan->_flags |= 1;
+	g_fp->_aniMan->_flags |= 0x100;
 	g_fp->_aniMan->_priority = 35;
 	g_fp->_aniMan->startAnim(MV_MAN18_STANDKRESLO, 0, -1);
 }
diff --git a/engines/fullpipe/scenes/scene25.cpp b/engines/fullpipe/scenes/scene25.cpp
index dfb767e..9bc8f41 100644
--- a/engines/fullpipe/scenes/scene25.cpp
+++ b/engines/fullpipe/scenes/scene25.cpp
@@ -516,7 +516,7 @@ void sceneHandler25_walkOnLadder(StaticANIObject *ani, Common::Point *pnt, Messa
 		ani->restartMessageQueue(mq);
 	}
 
-	ani->_flags |= 1;
+	ani->_flags |= 0x100;
 }
 
 bool sceneHandler25_isOnLadder(ExCommand *cmd) {
diff --git a/engines/fullpipe/scenes/scene28.cpp b/engines/fullpipe/scenes/scene28.cpp
index 503facf..b9cdf7a 100644
--- a/engines/fullpipe/scenes/scene28.cpp
+++ b/engines/fullpipe/scenes/scene28.cpp
@@ -204,7 +204,7 @@ void sceneHandler28_lift0Start() {
 }
 
 void sceneHandler28_lift1Start() {
-	g_fp->_aniMan->_flags |= 1;
+	g_fp->_aniMan->_flags |= 0x100;
 
 	g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0);
 
@@ -220,7 +220,7 @@ void sceneHandler28_lift3Start() {
 }
 
 void sceneHandler28_lift4Start() {
-	g_fp->_aniMan->_flags |= 1;
+	g_fp->_aniMan->_flags |= 0x100;
 
 	g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0);
 
@@ -232,7 +232,7 @@ void sceneHandler28_lift5Start() {
 }
 
 void sceneHandler28_lift6Start() {
-	g_fp->_aniMan->_flags |= 1;
+	g_fp->_aniMan->_flags |= 0x100;
 
 	g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0);
 
diff --git a/engines/fullpipe/scenes/scene34.cpp b/engines/fullpipe/scenes/scene34.cpp
index 6b74551..bc4ff18 100644
--- a/engines/fullpipe/scenes/scene34.cpp
+++ b/engines/fullpipe/scenes/scene34.cpp
@@ -189,7 +189,7 @@ void sceneHandler34_fromCactus(ExCommand *cmd) {
 	mq->setFlags(mq->getFlags() | 1);
 	mq->chain(0);
 
-	g_fp->_aniMan->_flags |= 1;
+	g_fp->_aniMan->_flags |= 0x100;
 }
 
 void sceneHandler34_animateLeaveBoard(ExCommand *cmd) {
diff --git a/engines/fullpipe/scenes/scene35.cpp b/engines/fullpipe/scenes/scene35.cpp
index 7a290ad..3cdbb42 100644
--- a/engines/fullpipe/scenes/scene35.cpp
+++ b/engines/fullpipe/scenes/scene35.cpp
@@ -88,7 +88,7 @@ void sceneHandler35_startFlow() {
 			g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene35_bellyInflater, ST_PDV_SMALL, QU_PDV_SML_TRY, 0);
 
 			g_vars->scene35_bellyInflater->changeStatics2(ST_PDV_SMALL);
-			g_vars->scene35_bellyInflater->_flags &= 0xFEFF;
+			g_vars->scene35_bellyInflater->_flags &= ~0x100;
 
 			MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC35_EATHOZE), 0, 0);
 
@@ -105,7 +105,7 @@ void sceneHandler35_startFlow() {
 			if (!mq->chain(g_vars->scene35_bellyInflater))
 				delete mq;
 
-			g_vars->scene35_bellyInflater->_flags |= 1;
+			g_vars->scene35_bellyInflater->_flags |= 0x100;
 
 			getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing, 1);
 





More information about the Scummvm-git-logs mailing list