Skip to content
Snippets Groups Projects
Commit b5bdefbd authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

msc is busted

parent 676a4194
Branches
Tags
No related merge requests found
...@@ -220,15 +220,18 @@ class Context_T { ...@@ -220,15 +220,18 @@ class Context_T {
// how RGBA values are packed and unpacked into/from an unsigned // how RGBA values are packed and unpacked into/from an unsigned
// integer to be fed to glColor4ubv (depends on machine byte // integer to be fed to glColor4ubv (depends on machine byte
// ordering!): // ordering!):
inline unsigned int PACK_COLOR(int R, int G, int B, int A){ inline unsigned int PACK_COLOR(int R, int G, int B, int A)
{
if(big_endian) return ( (unsigned int)((R)<<24 | (G)<<16 | (B)<<8 | (A)) ); if(big_endian) return ( (unsigned int)((R)<<24 | (G)<<16 | (B)<<8 | (A)) );
else return ( (unsigned int)((A)<<24 | (B)<<16 | (G)<<8 | (R)) ); else return ( (unsigned int)((A)<<24 | (B)<<16 | (G)<<8 | (R)) );
} }
inline int UNPACK_RED(unsigned int X){ inline int UNPACK_RED(unsigned int X)
{
if(big_endian) return ( ( (X) >> 24 ) & 0xff ); if(big_endian) return ( ( (X) >> 24 ) & 0xff );
else return ( (X) & 0xff ); else return ( (X) & 0xff );
} }
inline int UNPACK_GREEN(unsigned int X){ inline int UNPACK_GREEN(unsigned int X)
{
if(big_endian) return ( ( (X) >> 16 ) & 0xff ); if(big_endian) return ( ( (X) >> 16 ) & 0xff );
else return ( ( (X) >> 8 ) & 0xff ); else return ( ( (X) >> 8 ) & 0xff );
} }
...@@ -236,7 +239,8 @@ class Context_T { ...@@ -236,7 +239,8 @@ class Context_T {
if(big_endian) return ( ( (X) >> 8 ) & 0xff ); if(big_endian) return ( ( (X) >> 8 ) & 0xff );
else return ( ( (X) >> 16 ) & 0xff ); else return ( ( (X) >> 16 ) & 0xff );
} }
inline int UNPACK_ALPHA(unsigned int X){ inline int UNPACK_ALPHA(unsigned int X)
{
if(big_endian) return ( (X) & 0xff ); if(big_endian) return ( (X) & 0xff );
else return ( ( (X) >> 24 ) & 0xff ); else return ( ( (X) >> 24 ) & 0xff );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment