aboutsummaryrefslogtreecommitdiffstats
path: root/include/inventory.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/inventory.h')
-rw-r--r--include/inventory.h11
1 files changed, 9 insertions, 2 deletions
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;