From 1e6676c35ce4990981e8cda389ba39108437d66d Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Wed, 20 Jan 2016 08:42:46 -0500 Subject: WIP save/load --- include/Texture.h | 2 ++ include/common.h | 2 ++ include/entities.h | 15 ++++++--------- include/inventory.h | 3 ++- include/ui.h | 2 ++ include/world.h | 3 +++ 6 files changed, 17 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/Texture.h b/include/Texture.h index 85225d8..03593bf 100644 --- a/include/Texture.h +++ b/include/Texture.h @@ -28,6 +28,8 @@ namespace Texture{ */ GLuint loadTexture(const char *fileName); + + void freeTextures(void); } /** diff --git a/include/common.h b/include/common.h index ae832f1..fa7356a 100644 --- a/include/common.h +++ b/include/common.h @@ -205,6 +205,8 @@ unsigned int millis(void); int getdir(const char *dir, std::vector &files); void strVectorSortAlpha(std::vector *v); +const char *readFile(const char *path); + int strCreateFunc(const char *equ); extern void *NULLPTR; diff --git a/include/entities.h b/include/entities.h index d434546..6328770 100644 --- a/include/entities.h +++ b/include/entities.h @@ -63,15 +63,13 @@ public: bool gravity; bool behind; Particles(float x, float y, float w, float h, float vx, float vy, Color c, float d){ - loc.x = (x); - loc.y = (y); - width = (w); - height = (h); + loc.x = x; + loc.y = y; + width = w; + height = h; velx = vx; vely = vy; - color.red = (c.red); - color.green = (c.green); - color.blue = (c.blue); + color = c; duration = d; fountain = false; gravity = true; @@ -166,7 +164,7 @@ public: class NPC : public Entity{ public: std::vectoraiFunc; - unsigned int dialogIndex; + int dialogIndex; NPC(); ~NPC(); @@ -180,7 +178,6 @@ class Structures : public Entity{ public: BUILD_SUB bsubtype; char *inside; - //char *outside; Structures(); ~Structures(); diff --git a/include/inventory.h b/include/inventory.h index b035f91..a08954a 100644 --- a/include/inventory.h +++ b/include/inventory.h @@ -106,8 +106,9 @@ public: } }; -void itemUse(void *p); void initInventorySprites(void); +void destroyInventory(void); + char *getItemTexturePath(ITEM_ID id); int getItemWidth(ITEM_ID); int getItemHeight(ITEM_ID); diff --git a/include/ui.h b/include/ui.h index b769bbf..c018008 100644 --- a/include/ui.h +++ b/include/ui.h @@ -41,6 +41,8 @@ namespace ui { void initFonts(void); + void destroyFonts(void); + /* * Sets the current font/font size. */ diff --git a/include/world.h b/include/world.h index a1cc870..3209284 100644 --- a/include/world.h +++ b/include/world.h @@ -272,6 +272,9 @@ public: */ int getTheWidth(void); + + void save(void); + void load(void); }; /* -- cgit v1.2.3