From 0415b7f0a9305cd43e8fd8c77a8bafd3b8016dd0 Mon Sep 17 00:00:00 2001 From: drumsetmonkey Date: Mon, 30 Nov 2015 08:47:24 -0500 Subject: Working on animations --- include/common.h | 2 ++ include/inventory.h | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/common.h b/include/common.h index 525a4cd..869c811 100644 --- a/include/common.h +++ b/include/common.h @@ -123,6 +123,8 @@ extern float handAngle; * */ + extern unsigned int loops; + //GLuint loadTexture(const char *fileName); /* diff --git a/include/inventory.h b/include/inventory.h index 2793ad7..3b4c260 100644 --- a/include/inventory.h +++ b/include/inventory.h @@ -3,6 +3,7 @@ #include #include +#include #define DEBUG @@ -49,24 +50,30 @@ public: int maxStackSize; char* textureLoc; Texturec *tex; + GLuint text; int count; Item(ITEM_ID i, char* n, ITEM_TYPE t, float w, float h, int m, char* tl): id(i), type(t), width(w), height(h), maxStackSize(m){ count = 0; - name = (char*)calloc(strlen(n ),sizeof(char)); - textureLoc = (char*)calloc(strlen(tl),sizeof(char)); + name = (char*)calloc(strlen(n )+1,sizeof(char)); + textureLoc = (char*)calloc(strlen(tl)+1,sizeof(char)); strcpy(name,n); strcpy(textureLoc,tl); tex= new Texturec(1,textureLoc); + text = Texture::loadTexture(textureLoc); } GLuint rtex(){ return tex->image[0]; } }; +static Item item[5]= { + #include "../config/items.h" +}; + struct item_t{ int count; ITEM_ID id; -- cgit v1.2.3