summaryrefslogtreecommitdiff
path: root/src/graphics
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-04 14:26:55 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-04 14:26:55 (GMT)
commit055832270979cdb027c0c30a74cf82c23df13689 (patch)
treeb2ee525f713764c020b8668fe5776f4aa3d60643 /src/graphics
parentf32cd872ca2214b670b1ed4efa0b5b12a9c1ed30 (diff)
downloadpowder-055832270979cdb027c0c30a74cf82c23df13689.zip
powder-055832270979cdb027c0c30a74cf82c23df13689.tar.gz
Add icons for erase, improve icons for certain walls, fix issue #45
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/Renderer.cpp56
1 files changed, 29 insertions, 27 deletions
diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp
index f18dbbb..9949926 100644
--- a/src/graphics/Renderer.cpp
+++ b/src/graphics/Renderer.cpp
@@ -441,17 +441,18 @@ VideoBuffer * Renderer::WallIcon(int wallID, int width, int height)
if (wt==WL_EWALL)
{
for (j=0; j<height; j++)
- for (i=0; i<width; i++)
- if(i > width/2)
- {
- if (i&j&1)
- newTexture->SetPixel(i, j, PIXR(pc), PIXG(pc), PIXB(pc), 255);
- }
- else
- {
- if (!(i&j&1))
- newTexture->SetPixel(i, j, PIXR(pc), PIXG(pc), PIXB(pc), 255);
- }
+ {
+ for (i=0; i<(width/4)+j; i++)
+ {
+ if (!(i&j&1))
+ newTexture->SetPixel(i, j, PIXR(pc), PIXG(pc), PIXB(pc), 255);
+ }
+ for (; i<width; i++)
+ {
+ if (i&j&1)
+ newTexture->SetPixel(i, j, PIXR(pc), PIXG(pc), PIXB(pc), 255);
+ }
+ }
}
else if (wt==WL_WALLELEC)
{
@@ -467,17 +468,18 @@ VideoBuffer * Renderer::WallIcon(int wallID, int width, int height)
else if (wt==WL_EHOLE)
{
for (j=0; j<height; j++)
- for (i=0; i<width; i++)
- if(i < width/2)
- {
- if (i&j&1)
- newTexture->SetPixel(i, j, PIXR(pc), PIXG(pc), PIXB(pc), 255);
- }
- else
- {
- if (!(i&j&1))
- newTexture->SetPixel(i, j, PIXR(pc), PIXG(pc), PIXB(pc), 255);
- }
+ {
+ for (i=0; i<(width/4)+j; i++)
+ {
+ if (i&j&1)
+ newTexture->SetPixel(i, j, PIXR(pc), PIXG(pc), PIXB(pc), 255);
+ }
+ for (; i<width; i++)
+ {
+ if (!(i&j&1))
+ newTexture->SetPixel(i, j, PIXR(pc), PIXG(pc), PIXB(pc), 255);
+ }
+ }
}
else if (wt == WL_ERASE)
{
@@ -495,12 +497,12 @@ VideoBuffer * Renderer::WallIcon(int wallID, int width, int height)
newTexture->SetPixel(i, j, PIXR(pc), PIXG(pc), PIXB(pc), 255);
}
}
- for (j=4; j<width/2; j++)
+ for (j=3; j<(width-4)/2; j++)
{
newTexture->SetPixel(j+6, j, 0xFF, 0, 0, 255);
newTexture->SetPixel(j+7, j, 0xFF, 0, 0, 255);
- newTexture->SetPixel(-j+21, j, 0xFF, 0, 0, 255);
- newTexture->SetPixel(-j+22, j, 0xFF, 0, 0, 255);
+ newTexture->SetPixel(-j+19, j, 0xFF, 0, 0, 255);
+ newTexture->SetPixel(-j+20, j, 0xFF, 0, 0, 255);
}
}
else if(wt == WL_STREAM)
@@ -513,10 +515,10 @@ VideoBuffer * Renderer::WallIcon(int wallID, int width, int height)
newTexture->SetPixel(i, j, PIXR(pc), PIXG(pc), PIXB(pc), 255);
}
}
- newTexture->SetCharacter(4, 3, 0x8D, 255, 255, 255, 255);
+ newTexture->SetCharacter(4, 2, 0x8D, 255, 255, 255, 255);
for (i=width/3; i<width; i++)
{
- newTexture->SetPixel(i, 8+(int)(3.9f*cos(i*0.3f)), 255, 255, 255, 255);
+ newTexture->SetPixel(i, 7+(int)(3.9f*cos(i*0.3f)), 255, 255, 255, 255);
}
}
return newTexture;