From 24886ff8c7b406481b36d04ec52df9ff5ae3742c Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Wed, 25 Nov 2015 18:38:43 -0800 Subject: [PATCH] Build Fixes --- include/CColor.hpp | 11 +++++++---- src/CColor.cpp | 18 +++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/include/CColor.hpp b/include/CColor.hpp index 4892afb..e1f530d 100644 --- a/include/CColor.hpp +++ b/include/CColor.hpp @@ -1,12 +1,16 @@ #ifndef CCOLOR_HPP #define CCOLOR_HPP +#include "Global.hpp" #include "Math.hpp" #include "TVectorUnion.hpp" +#if ZE_ATHENA_TYPES +#include +#endif #include #if BYTE_ORDER == __ORDER_LITTLE_ENDIAN__ -#define COLOR(rgba) ( ( (rgba) & 0x000000FF ) << 24 | ( (rgba) & 0x0000FF00 ) << 8 \ +#define COLOR(rgba) (unsigned)( ( (rgba) & 0x000000FF ) << 24 | ( (rgba) & 0x0000FF00 ) << 8 \ | ( (rgba) & 0x00FF0000 ) >> 8 | ( (rgba) & 0xFF000000 ) >> 24 ) #else #define COLOR(rgba) rgba @@ -188,17 +192,16 @@ public: inline void normalize() { float mag = magnitude(); - assert(mag != 0.0); mag = 1.0 / mag; *this *= mag; } - inline CColor normalized() + inline CColor normalized() const { float mag = magnitude(); - assert(mag != 0.0); mag = 1.0 / mag; return *this * mag; } + inline float magSquared() const { #if __SSE__ diff --git a/src/CColor.cpp b/src/CColor.cpp index 0d3d3b7..725ad9e 100644 --- a/src/CColor.cpp +++ b/src/CColor.cpp @@ -3,15 +3,15 @@ namespace Zeus { -const CColor CColor::skRed (0xFF0000FFul); -const CColor CColor::skBlack (0x000000FFul); -const CColor CColor::skBlue (0x0000FFFFul); -const CColor CColor::skGreen (0x00FF00FFul); -const CColor CColor::skGrey (0x808080FFul); -const CColor CColor::skOrange(0xFF7000FFul); -const CColor CColor::skPurple(0xA000FFFFul); -const CColor CColor::skYellow(0xFFFF00FFul); -const CColor CColor::skWhite (0xFFFFFFFFul); +const CColor CColor::skRed (Comp32(0xFF0000FFul)); +const CColor CColor::skBlack (Comp32(0x000000FFul)); +const CColor CColor::skBlue (Comp32(0x0000FFFFul)); +const CColor CColor::skGreen (Comp32(0x00FF00FFul)); +const CColor CColor::skGrey (Comp32(0x808080FFul)); +const CColor CColor::skOrange(Comp32(0xFF7000FFul)); +const CColor CColor::skPurple(Comp32(0xA000FFFFul)); +const CColor CColor::skYellow(Comp32(0xFFFF00FFul)); +const CColor CColor::skWhite (Comp32(0xFFFFFFFFul)); float hueToRgb(float p, float q, float t) {