diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/common.h | 2 | ||||
-rw-r--r-- | include/inventory.h | 11 |
2 files changed, 11 insertions, 2 deletions
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 <common.h> #include <string.h> +#include <boost/range/adaptor/reversed.hpp> #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; |