Move Point, ColorMode, RGBA out

This commit is contained in:
Kirigaya Kazuto 2017-06-18 17:03:57 +08:00
parent 0629ceadba
commit 62b86cb072
7 changed files with 65 additions and 53 deletions

View File

@ -274,41 +274,7 @@ namespace MiniEngine
r = g = b = 0; 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() void ErrorViewer::fetch()
{ {

View File

@ -19,25 +19,6 @@ namespace MiniEngine
bool inRect(const Rect& rect) const; 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 class NonCopyable
{ {
protected: protected:

11
SDLWrapper/ColorMode.h Normal file
View File

@ -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"

0
SDLWrapper/Point.cpp Normal file
View File

0
SDLWrapper/Point.h Normal file
View File

38
SDLWrapper/RGBA.cpp Normal file
View File

@ -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"

16
SDLWrapper/RGBA.h Normal file
View File

@ -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"