aboutsummaryrefslogtreecommitdiffstats
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-12-03 08:26:09 -0500
committerClyne Sullivan <tullivan99@gmail.com>2015-12-03 08:26:09 -0500
commit3c8140152bcf72eb1d64b580bb9c1e139bcbe191 (patch)
treed01fef6465eca39950c40dcf77cc9678f2a9457a /src/inventory.cpp
parentbf91141782766f3648b62c6d96528fddb9ae7447 (diff)
inv. fixes
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 73e5e32..0eac3b2 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -15,6 +15,12 @@ static GLuint itemtex[ITEM_COUNT];
void itemDraw(Player *p,ITEM_ID id);
+void initInventorySprites(void){
+ for(int i = 0;i<ITEM_COUNT;i++){
+ itemtex[i]=Texture::loadTexture(getItemTexturePath((ITEM_ID)i));
+ }
+}
+
char *getItemTexturePath(ITEM_ID id){
return item[id].textureLoc;
}
@@ -41,9 +47,6 @@ Inventory::Inventory(unsigned int s){
size=s;
inv = new struct item_t[size];
memset(inv,0,size*sizeof(struct item_t));
- for(int i = 0;i<ITEM_COUNT;i++){
- itemtex[i]=Texture::loadTexture(getItemTexturePath((ITEM_ID)i));
- }
}
Inventory::~Inventory(void){
@@ -90,7 +93,6 @@ int Inventory::takeItem(ITEM_ID id,unsigned char count){
}
void Inventory::draw(void){
- std::cout << invHover << std::endl;
unsigned int i=0;
static unsigned int lop = 0;
float y,xoff;