diff options
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp index e364ce0..40f2153 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){ |