aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.cpp
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2015-10-28 11:55:21 -0400
committerdrumsetmonkey <abelleisle@roadrunner.com>2015-10-28 11:55:21 -0400
commit193af27884fc910b4ffa7212ec772894c03e36ee (patch)
treece3a10772b3af81815261a11959da6e715eaa96f /src/ui.cpp
parenta3e3f43a51e4a8137dff779f38b358b5b8608e4e (diff)
Locked camera to world bounds and added basic mountain backdrop
Diffstat (limited to 'src/ui.cpp')
-rw-r--r--src/ui.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ui.cpp b/src/ui.cpp
index 9d7de8a..8f19e34 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -174,13 +174,13 @@ namespace ui {
putString(x+HLINE,y-fontSize-HLINE,dialogBoxText);
}
setFontSize(16);
- putText(((SCREEN_WIDTH/2)+player->loc.x)-125,SCREEN_HEIGHT-fontSize,"Health: %u/%u",player->health>0?(unsigned)player->health:0,
+ putText(((SCREEN_WIDTH/2)+offset.x)-125,SCREEN_HEIGHT-fontSize,"Health: %u/%u",player->health>0?(unsigned)player->health:0,
(unsigned)player->maxHealth);
if(player->alive){
glColor3ub(255,0,0);
- glRectf((SCREEN_WIDTH/2+player->loc.x)-125,
+ glRectf((SCREEN_WIDTH/2+offset.x)-125,
SCREEN_HEIGHT-32,
- ((SCREEN_WIDTH/2+player->loc.x)-125)+((player->health/player->maxHealth)*100),
+ ((SCREEN_WIDTH/2+offset.x)-125)+((player->health/player->maxHealth)*100),
SCREEN_HEIGHT-32+12);
}
}
@@ -188,7 +188,7 @@ namespace ui {
static bool left=false,right=false;
static vec2 premouse={0,0};
SDL_Event e;
- mouse.x=premouse.x+player->loc.x-(SCREEN_WIDTH/2);
+ mouse.x=premouse.x+offset.x-(SCREEN_WIDTH/2);
mouse.y=SCREEN_HEIGHT-premouse.y;
while(SDL_PollEvent(&e)){
switch(e.type){