From 6f8c6b28ba3b56b0bd3761741f3a8bd04312f8f7 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 11 Aug 2022 11:35:12 -0700 Subject: [PATCH] Add unused statics, fix CColor constructor Former-commit-id: e7117197dae1d32ae1264cca528cc714ed71bb18 --- include/Kyoto/Graphics/CColor.hpp | 28 ++++++++++++++++------------ src/Kyoto/Graphics/CColor.cpp | 2 ++ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/include/Kyoto/Graphics/CColor.hpp b/include/Kyoto/Graphics/CColor.hpp index 66b0ae0c..0c86ba76 100644 --- a/include/Kyoto/Graphics/CColor.hpp +++ b/include/Kyoto/Graphics/CColor.hpp @@ -3,19 +3,23 @@ #include "types.h" +#pragma cpp_extensions on + class CColor { public: CColor(u32 col) : mRgba(col) {} - //CColor(float r, float g, float b, float a = 1.f) : mR(r * 255.f), mG(g * 255.f), mB(b * 255.f), mA(a * 255.f) {} + CColor(f32 r, f32 g, f32 b, f32 a = 1.f) : mR(r * 255.f), mG(g * 255.f), mB(b * 255.f), mA(a * 255.f) {} - static const CColor& Black(); static const CColor& White(); static const CColor& Grey(); static const CColor& Red(); + static const CColor& Green(); static const CColor& Blue(); static const CColor& Yellow(); + static const CColor& Purple(); static const CColor& Orange(); + private: union { struct { @@ -26,16 +30,16 @@ private: }; u32 mRgba; }; - - static const CColor sBlackColor; - static const CColor sWhiteColor; - static const CColor sGreyColor; - static const CColor sRedColor; - static const CColor sGreenColor; - static const CColor sBlueColor; - static const CColor sYellowColor; - static const CColor sPurpleColor; - static const CColor sOrangeColor; + + static const CColor sBlackColor; + static const CColor sWhiteColor; + static const CColor sGreyColor; + static const CColor sRedColor; + static const CColor sGreenColor; + static const CColor sBlueColor; + static const CColor sYellowColor; + static const CColor sPurpleColor; + static const CColor sOrangeColor; }; #endif // __CCOLOR_HPP__ diff --git a/src/Kyoto/Graphics/CColor.cpp b/src/Kyoto/Graphics/CColor.cpp index 286e26aa..0bad089e 100644 --- a/src/Kyoto/Graphics/CColor.cpp +++ b/src/Kyoto/Graphics/CColor.cpp @@ -14,6 +14,8 @@ const CColor& CColor::Black() { return sBlackColor; } const CColor& CColor::White() { return sWhiteColor; } const CColor& CColor::Grey() { return sGreyColor; } const CColor& CColor::Red() { return sRedColor; } +const CColor& CColor::Green() { return sGreenColor; } const CColor& CColor::Blue() { return sBlueColor; } const CColor& CColor::Yellow() { return sYellowColor; } +const CColor& CColor::Purple() { return sPurpleColor; } const CColor& CColor::Orange() { return sOrangeColor; }