From 01a31f374b953b9d40548f8369289a8c6dc48b77 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Thu, 8 Oct 2015 09:29:22 -0400 Subject: fixed mouse --- src/inventory.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/inventory.cpp') diff --git a/src/inventory.cpp b/src/inventory.cpp index 3882fb0..83c40f6 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -30,6 +30,7 @@ unsigned int initInventorySprites(void){ } Inventory::Inventory(unsigned int s){ + sel=0; size=s; item=(struct item_t *)calloc(size,sizeof(struct item_t)); } @@ -37,19 +38,32 @@ Inventory::Inventory(unsigned int s){ Inventory::~Inventory(void){ free(item); } - + +void Inventory::setSelection(unsigned int s){ + sel=s; +} + int Inventory::addItem(ITEM_ID id,unsigned char count){ unsigned int i; for(i=0;iloc.x-SCREEN_WIDTH/2,y,"%d x ",item[i].count); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D,ITEM_TEX[item[i].id-1]); + if(sel==i)glColor3ub(255,0,255); + else glColor3ub(255,255,255); glBegin(GL_QUADS); glTexCoord2i(0,1);glVertex2i(xoff ,y); glTexCoord2i(1,1);glVertex2i(xoff+HLINE*10,y); -- cgit v1.2.3