summaryrefslogtreecommitdiff
path: root/src/gfx_type.h
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-06-18 21:19:04 +0000
committersmatz <smatz@openttd.org>2008-06-18 21:19:04 +0000
commit7a7ff65ac53cab72eddf2838000fbf95f5de9f42 (patch)
tree4997235d0f8568325d0c8f7c1412cca55e69496d /src/gfx_type.h
parentbc12e5453cca334705fe9d280a015e6c58a83dd6 (diff)
downloadopenttd-7a7ff65ac53cab72eddf2838000fbf95f5de9f42.tar.xz
(svn r13571) -Codechange: define channels in struct Colour in different order on LE and BE machines
Diffstat (limited to 'src/gfx_type.h')
-rw-r--r--src/gfx_type.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gfx_type.h b/src/gfx_type.h
index c65e69fad..f5ed4a328 100644
--- a/src/gfx_type.h
+++ b/src/gfx_type.h
@@ -5,6 +5,7 @@
#ifndef GFX_TYPE_H
#define GFX_TYPE_H
+#include "core/endian_type.hpp"
#include "core/enum_type.hpp"
#include "core/geometry_type.hpp"
#include "zoom_type.h"
@@ -142,9 +143,13 @@ struct DrawPixelInfo {
};
struct Colour {
- byte r;
- byte g;
- byte b;
+#if TTD_ENDIAN == TTD_BIG_ENDIAN
+ uint8 a, r, g, b; ///< colour channels in BE order
+#else
+ uint8 b, g, r, a; ///< colour channels in LE order
+#endif /* TTD_ENDIAN == TTD_BIG_ENDIAN */
+
+ operator uint32 () { return *(uint32 *)this; }
};
enum FontSize {