summaryrefslogtreecommitdiff
path: root/src/graphics
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-06-21 00:29:20 (GMT)
committer jacob1 <jfu614@gmail.com>2013-06-21 00:29:20 (GMT)
commit3aac957e501a2fc5fde868f1fe973c523968357e (patch)
tree08653e5d4338f8b1b444eaa6081bcc2ed45f9427 /src/graphics
parentfcff2ecc7fdaf93c39086fa52ae6608982fd509c (diff)
downloadpowder-3aac957e501a2fc5fde868f1fe973c523968357e.zip
powder-3aac957e501a2fc5fde868f1fe973c523968357e.tar.gz
HUD displays the correct name of LIFE particles in the HUD, show mouse position in HUD on the edges of the screen
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/Renderer.cpp9
-rw-r--r--src/graphics/Renderer.h2
2 files changed, 5 insertions, 6 deletions
diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp
index dfdd307..d732d18 100644
--- a/src/graphics/Renderer.cpp
+++ b/src/graphics/Renderer.cpp
@@ -1381,10 +1381,10 @@ void Renderer::render_parts()
else
continue;
- if (mousePosX>(nx-3) && mousePosX<(nx+3) && mousePosY<(ny+3) && mousePosY>(ny-3)) //If mouse is in the head
+ if (mousePos.X>(nx-3) && mousePos.X<(nx+3) && mousePos.Y<(ny+3) && mousePos.Y>(ny-3)) //If mouse is in the head
{
sprintf(buff, "%3d", sim->parts[i].life); //Show HP
- drawtext(mousePosX-8-2*(sim->parts[i].life<100)-2*(sim->parts[i].life<10), mousePosY-12, buff, 255, 255, 255, 255);
+ drawtext(mousePos.X-8-2*(sim->parts[i].life<100)-2*(sim->parts[i].life<10), mousePos.Y-12, buff, 255, 255, 255, 255);
}
if (colour_mode!=COLOUR_HEAT)
@@ -1890,7 +1890,7 @@ void Renderer::render_parts()
}
if (pixel_mode & EFFECT_DBGLINES)
{
- if (mousePosX == nx && mousePosY == ny && debugLines)//draw lines connecting wifi/portal channels
+ if (mousePos.X == nx && mousePos.Y == ny && debugLines)//draw lines connecting wifi/portal channels
{
int z;
int type = parts[i].type;
@@ -2407,8 +2407,7 @@ Renderer::Renderer(Graphics * g, Simulation * sim):
decorations_enable(1),
gravityFieldEnabled(false),
gravityZonesEnabled(false),
- mousePosX(-1),
- mousePosY(-1),
+ mousePos(0, 0),
display_mode(0),
render_mode(0),
colour_mode(0),
diff --git a/src/graphics/Renderer.h b/src/graphics/Renderer.h
index 8a7120f..9978de0 100644
--- a/src/graphics/Renderer.h
+++ b/src/graphics/Renderer.h
@@ -66,7 +66,7 @@ public:
pixel sampleColor;
//Mouse position for debug information
- int mousePosX, mousePosY;
+ ui::Point mousePos;
//Zoom window
ui::Point zoomWindowPosition;