draw health bars but still incorrect

This commit is contained in:
Eduardo Bart
2011-08-19 10:23:35 -03:00
parent 817234a660
commit 7b13161036
3 changed files with 176 additions and 148 deletions

View File

@@ -21,10 +21,16 @@ public:
RGBA rgba() const { return color; }
const uint8* rgbaPtr() const { return (const uint8*)&color; }
void setAlpha(uint8 a) { color = ((a & 0xff)<<24) | (color & 0x00ffffff); }
void setBlue(uint8 b) { color = ((b & 0xff)<<16) | (color & 0xff00ffff); }
void setGreen(uint8 g) { color = ((g & 0xff)<<8) | (color & 0xffff00ff); }
void setRed(uint8 r) { color = (r & 0xff) | (color & 0xffffff00); }
void setRed(int r) { color = (r & 0xff) | (color & 0xffffff00); }
void setGreen(int g) { color = ((g & 0xff)<<8) | (color & 0xffff00ff); }
void setBlue(int b) { color = ((b & 0xff)<<16) | (color & 0xff00ffff); }
void setAlpha(int a) { color = ((a & 0xff)<<24) | (color & 0x00ffffff); }
void setRed(float r) { setRed(int(r*255.0f)); }
void setGreen(float g) { setGreen(int(g*255.0f)); }
void setBlue(float b) { setBlue(int(b*255.0f)); }
void setAlpha(float a) { setAlpha(int(a*255.0f)); }
void setRGBA(uint8 r, uint8 g, uint8 b, uint8 a = 0xFF) { color = ((a & 0xff)<<24) | ((b & 0xff)<<16) | ((g & 0xff)<<8) | (r & 0xff); }
void setABGR(uint32 abgr) { color = ((abgr>>24) & 0xff) | ((abgr>>16) & 0xff) << 8 | ((abgr>>8) & 0xff) << 16 | (abgr & 0xff) << 24; }
void setRGBA(uint32 rgba) { color = rgba; }