diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/inventory.cpp | 9 | ||||
-rw-r--r-- | src/ui.cpp | 6 |
2 files changed, 9 insertions, 6 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){ @@ -354,15 +354,15 @@ namespace ui { * Create a wimpy buffer. */ - buf = new char[128]; //(char *)calloc(128,sizeof(char)); - memset(buf,0,128*sizeof(char)); + buf = new char[512]; //(char *)calloc(128,sizeof(char)); + memset(buf,0,512*sizeof(char)); /* * Handle the formatted string, printing it to the buffer. */ va_start(args,str); - vsnprintf(buf,128,str,args); + vsnprintf(buf,512,str,args); va_end(args); /* |