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 +++++++++++++++++- src/world.cpp | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'src') 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); diff --git a/src/world.cpp b/src/world.cpp index 72287be..1498016 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -163,7 +163,7 @@ void World::singleDetect(Entity *e){ e->ground=true; e->loc.y=line[i].y-.001*deltaTime; if(e->type==STRUCTURET){ - std::cout<loc.x<<" "<loc.y<loc.x<<" "<loc.y<loc.y>line[i].y-.002*deltaTime){ // Snap the player to the top of that line if the player is inside it -- cgit v1.2.3