mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-09-02 04:22:34 +02:00
fix PIXR() macro: if MSB of the color is nonzero, it used to return a >255 value, which, say, in Renderer.cpp would get clamped to 255, no matter what the actual red byte is
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
#define PIXRGB(r,g,b) (((b)<<24)|((g)<<16)|((r)<<8))
|
#define PIXRGB(r,g,b) (((b)<<24)|((g)<<16)|((r)<<8))
|
||||||
#define PIXR(x) (((x)>>8)&0xFF)
|
#define PIXR(x) (((x)>>8)&0xFF)
|
||||||
#define PIXG(x) (((x)>>16)&0xFF)
|
#define PIXG(x) (((x)>>16)&0xFF)
|
||||||
#define PIXB(x) (((x)>>24))
|
#define PIXB(x) (((x)>>24)&0xFF)
|
||||||
#elif defined(PIX32OGL)
|
#elif defined(PIX32OGL)
|
||||||
#define PIXELCHANNELS 4
|
#define PIXELCHANNELS 4
|
||||||
#define PIXPACK(x) (0xFF000000|((x)&0xFFFFFF)) //32bit ARGB in 32bit int: AARRGGBB
|
#define PIXPACK(x) (0xFF000000|((x)&0xFFFFFF)) //32bit ARGB in 32bit int: AARRGGBB
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
#else
|
#else
|
||||||
#define PIXPACK(x) (x) //24bit RGB in 32bit int: 00RRGGBB.
|
#define PIXPACK(x) (x) //24bit RGB in 32bit int: 00RRGGBB.
|
||||||
#define PIXRGB(r,g,b) (((r)<<16)|((g)<<8)|(b))
|
#define PIXRGB(r,g,b) (((r)<<16)|((g)<<8)|(b))
|
||||||
#define PIXR(x) ((x)>>16)
|
#define PIXR(x) (((x)>>16)&0xFF)
|
||||||
#define PIXG(x) (((x)>>8)&0xFF)
|
#define PIXG(x) (((x)>>8)&0xFF)
|
||||||
#define PIXB(x) ((x)&0xFF)
|
#define PIXB(x) ((x)&0xFF)
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user