Skip to content
Permalink
Browse files

Fix PackedCol to work on big endian. We must not forget our PowerPC b…

…rethren.
  • Loading branch information...
UnknownShadow200 committed Oct 4, 2019
1 parent 1de1f2a commit aa05582f7e611c61640734602895bd48b12d7d67
Showing with 11 additions and 1 deletion.
  1. +5 −0 src/Core.h
  2. +6 −1 src/PackedCol.h
@@ -66,8 +66,13 @@ typedef unsigned __INTPTR_TYPE__ cc_uintptr;
#endif
#endif
#define CC_HAS_VARS

#ifdef __BIG_ENDIAN__
#define CC_BIG_ENDIAN
#endif
#elif __MWERKS__
/* TODO: Is there actual attribute support for CC_API etc somewhere? */
#define CC_BIG_ENDIAN
#endif

/* Unrecognised compiler, so just go with sensisble defaults */
@@ -6,11 +6,16 @@
*/

typedef cc_uint32 PackedCol;
#ifdef CC_BUILD_D3D9
#if defined CC_BUILD_D3D9
#define PACKEDCOL_B_SHIFT 0
#define PACKEDCOL_G_SHIFT 8
#define PACKEDCOL_R_SHIFT 16
#define PACKEDCOL_A_SHIFT 24
#elif defined CC_BIG_ENDIAN
#define PACKEDCOL_R_SHIFT 24
#define PACKEDCOL_G_SHIFT 16
#define PACKEDCOL_B_SHIFT 8
#define PACKEDCOL_A_SHIFT 0
#else
#define PACKEDCOL_R_SHIFT 0
#define PACKEDCOL_G_SHIFT 8

0 comments on commit aa05582

Please sign in to comment.
You can’t perform that action at this time.