diff --git a/MiniEngine.cpp b/MiniEngine.cpp index 0514212..e08c480 100644 --- a/MiniEngine.cpp +++ b/MiniEngine.cpp @@ -274,41 +274,7 @@ namespace MiniEngine r = g = b = 0; } - RGBA::RGBA(int R, int G, int B, int A) - { - r = R; - g = G; - b = B; - a = A; - } - RGBA::RGBA(ColorMode mode, int A) - { - r = mode.r; - g = mode.g; - b = mode.b; - a = A; - } - - RGBA::RGBA() - { - r = g = b = a = 0; - } - - SDL_Color RGBA::toSDLColor() const - { - SDL_Color c; - c.r = r; - c.g = g; - c.b = b; - c.a = a; - return c; - } - - ColorMode RGBA::toColorMode() const - { - return ColorMode(r, g, b); - } void ErrorViewer::fetch() { diff --git a/MiniEngine.h b/MiniEngine.h index c8fa871..e1ea1b9 100644 --- a/MiniEngine.h +++ b/MiniEngine.h @@ -19,25 +19,6 @@ namespace MiniEngine bool inRect(const Rect& rect) const; }; - class ColorMode - { - public: - int r, g, b; - ColorMode(int R, int G, int B); - ColorMode(); - }; - - class RGBA - { - public: - int r, g, b, a; - RGBA(int R, int G, int B, int A); - RGBA(ColorMode mode, int A); - RGBA(); - SDL_Color toSDLColor() const; - ColorMode toColorMode() const; - }; - class NonCopyable { protected: diff --git a/SDLWrapper/ColorMode.h b/SDLWrapper/ColorMode.h new file mode 100644 index 0000000..cf37d3c --- /dev/null +++ b/SDLWrapper/ColorMode.h @@ -0,0 +1,11 @@ +#pragma once +#include "include.h" +#include "begin_code.h" +class ColorMode +{ +public: + int r, g, b; + ColorMode(int R, int G, int B); + ColorMode(); +}; +#include "end_code.h" diff --git a/SDLWrapper/Point.cpp b/SDLWrapper/Point.cpp new file mode 100644 index 0000000..e69de29 diff --git a/SDLWrapper/Point.h b/SDLWrapper/Point.h new file mode 100644 index 0000000..e69de29 diff --git a/SDLWrapper/RGBA.cpp b/SDLWrapper/RGBA.cpp new file mode 100644 index 0000000..c01b83e --- /dev/null +++ b/SDLWrapper/RGBA.cpp @@ -0,0 +1,38 @@ +#include "RGBA.h" +#include "begin_code.h" +RGBA::RGBA(int R, int G, int B, int A) +{ + r = R; + g = G; + b = B; + a = A; +} + +RGBA::RGBA(ColorMode mode, int A) +{ + r = mode.r; + g = mode.g; + b = mode.b; + a = A; +} + +RGBA::RGBA() +{ + r = g = b = a = 0; +} + +SDL_Color RGBA::toSDLColor() const +{ + SDL_Color c; + c.r = r; + c.g = g; + c.b = b; + c.a = a; + return c; +} + +ColorMode RGBA::toColorMode() const +{ + return ColorMode(r, g, b); +} +#include "end_code.h" diff --git a/SDLWrapper/RGBA.h b/SDLWrapper/RGBA.h new file mode 100644 index 0000000..ff83c7e --- /dev/null +++ b/SDLWrapper/RGBA.h @@ -0,0 +1,16 @@ +#pragma once +#include "include.h" +#include "begin_code.h" + +class RGBA +{ +public: + int r, g, b, a; + RGBA(int R, int G, int B, int A); + RGBA(ColorMode mode, int A); + RGBA(); + SDL_Color toSDLColor() const; + ColorMode toColorMode() const; +}; + +#include "end_code.h"