From 45edad31559852d306d59b50f380cb79c9f27dcc Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Tue, 5 Jan 2016 08:48:29 -0500 Subject: save/load stuffs --- include/inventory.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/inventory.h') diff --git a/include/inventory.h b/include/inventory.h index 31b7d88..b035f91 100644 --- a/include/inventory.h +++ b/include/inventory.h @@ -60,6 +60,11 @@ struct item_t{ ITEM_ID id; } __attribute__((packed)); +typedef struct { + unsigned int size; + int os; + unsigned int sel; +} __attribute__ ((packed)) InventorySavePacket; class Inventory { private: @@ -87,6 +92,18 @@ public: void draw(void); // Draws a text list of items in this inventory (should only be called for the player for now) + char *save(void){ + static InventorySavePacket *isp = new InventorySavePacket(); + isp->size = size; + isp->os = os; + isp->sel = sel; + return (char *)isp; + } + void load(InventorySavePacket *isp){ + size = isp->size; + os = isp->os; + sel = isp->sel; + } }; void itemUse(void *p); -- cgit v1.2.3