summaryrefslogtreecommitdiff
path: root/src/interface.c
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2012-06-21 10:06:27 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2012-06-21 10:06:27 (GMT)
commitded23cfa948ef224075e59340a4ab70f3b1b9f28 (patch)
treec2fa3b6a30833885ec44ccf02d1e649719849c35 /src/interface.c
parent79614a97197803c0b8bf9cc9cb5b92047c142f6c (diff)
downloadpowder-ded23cfa948ef224075e59340a4ab70f3b1b9f28.zip
powder-ded23cfa948ef224075e59340a4ab70f3b1b9f28.tar.gz
Fix minor bug with deco sample tool
If particles are not being drawn with blendpixel, then it is possible for the R/G/B component of a pixel to be 255. Adding 1 gives 256, which does not produce the right colour when combined into a RRGGBB value
Diffstat (limited to 'src/interface.c')
-rw-r--r--src/interface.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/interface.c b/src/interface.c
index 689ef13..8c494b7 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -5949,9 +5949,9 @@ unsigned int decorations_ui(pixel *vid_buf,int *bsx,int *bsy, unsigned int saved
cb = PIXB(tempcolor);
if (cr || cg || cb)
{
- if (cr) cr++;
- if (cg) cg++;
- if (cb) cb++;
+ if (cr && cr<255) cr++;
+ if (cg && cg<255) cg++;
+ if (cb && cb<255) cb++;
currR = cr;
currG = cg;
currB = cb;