aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/inventory.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2013-06-20 14:44:59 -0400
committerEugene Sandulenko2013-09-06 14:48:13 +0300
commit8de8a901cb7946f5506e990224b78bdfb4ca737e (patch)
tree1a1f0f15a2531329871087f7475dd5ce6f1dc961 /engines/fullpipe/inventory.cpp
parent3e948052f7a0775d3b4d04e1eaef533951f1a719 (diff)
downloadscummvm-rg350-8de8a901cb7946f5506e990224b78bdfb4ca737e.tar.gz
scummvm-rg350-8de8a901cb7946f5506e990224b78bdfb4ca737e.tar.bz2
scummvm-rg350-8de8a901cb7946f5506e990224b78bdfb4ca737e.zip
FULLPIPE: Put all inventory-related classes into separate file
Diffstat (limited to 'engines/fullpipe/inventory.cpp')
-rw-r--r--engines/fullpipe/inventory.cpp72
1 files changed, 72 insertions, 0 deletions
diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp
new file mode 100644
index 0000000000..03b7cbf8b7
--- /dev/null
+++ b/engines/fullpipe/inventory.cpp
@@ -0,0 +1,72 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "fullpipe/fullpipe.h"
+
+#include "fullpipe/objects.h"
+
+namespace Fullpipe {
+
+bool CInventory::load(MfcArchive &file) {
+ _sceneId = file.readUint16LE();
+ int numInvs = file.readUint32LE();
+
+ for (int i = 0; i < numInvs; i++) {
+ InventoryPoolItem *t = new InventoryPoolItem();
+ t->_id = file.readUint16LE();
+ t->_pictureObjectNormalId = file.readUint16LE();
+ t->_pictureObjectId1 = file.readUint16LE();
+ t->_pictureObjectMouseInsideId = file.readUint16LE();
+ t->_pictureObjectId3 = file.readUint16LE();
+ t->_flags = file.readUint32LE();
+ t->_field_C = 0;
+ t->_field_A = -536;
+ _itemsPool.push_back(*t);
+ }
+
+ return true;
+}
+
+CInventory2::CInventory2() {
+ _selectedId = -1;
+ _field_48 = -1;
+ _sceneObj = 0;
+ _picture = 0;
+ _isInventoryOut = 0;
+ _isLocked = 0;
+ _topOffset = -65;
+}
+
+bool CInventory2::loadPartial(MfcArchive &file) { // CInventory2_SerializePartially
+ int numInvs = file.readUint32LE();
+
+ for (int i = 0; i < numInvs; i++) {
+ InventoryItem *t = new InventoryItem();
+ t->itemId = file.readUint16LE();
+ t->count = file.readUint16LE();
+ _inventoryItems.push_back(*t);
+ }
+
+ return true;
+}
+
+} // End of namespace Fullpipe