From d703f0c3b527f1c1f324875762293929c6fbb932 Mon Sep 17 00:00:00 2001 From: smatz Date: Mon, 22 Jun 2009 23:15:27 +0000 Subject: (svn r16628) -Codechange: remove one gcc2 hack --- src/gfx_type.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/gfx_type.h') diff --git a/src/gfx_type.h b/src/gfx_type.h index 7796d19e0..57f1b3d42 100644 --- a/src/gfx_type.h +++ b/src/gfx_type.h @@ -138,14 +138,15 @@ struct DrawPixelInfo { }; /** Structure to access the alpha, red, green, and blue channels from a 32 bit number. */ -struct Colour { +union Colour { + uint32 data; ///< Conversion of the channel information to a 32 bit number. + struct { #if TTD_ENDIAN == TTD_BIG_ENDIAN - uint8 a, r, g, b; ///< colour channels in BE order + uint8 a, r, g, b; ///< colour channels in BE order #else - uint8 b, g, r, a; ///< colour channels in LE order + uint8 b, g, r, a; ///< colour channels in LE order #endif /* TTD_ENDIAN == TTD_BIG_ENDIAN */ - - operator uint32 () const { return *(uint32 *)this; } ///< Conversion of the channel information to a 32 bit number. + }; }; /** Available font sizes */ -- cgit v1.2.3-54-g00ecf