71 static void SetSDLColor(SDL_Color & set,
const u32 from) ;
72 static void GetSDLColor(
const SDL_Color & from, u32 & to) ;
76 static const int WHITE = 0xffffffff;
77 static const int BLACK = 0xff000000;
78 static const int RED = 0xffff0000;
79 static const int GREEN = 0xff00ff00;
80 static const int BLUE = 0xff0000ff;
81 static const int CYAN = 0xff00ffff;
82 static const int MAGENTA = 0xffff00ff;
83 static const int YELLOW = 0xffffff00;
85 static const int GREY05 = 0xff0c0c0c;
86 static const int GREY10 = 0xff191919;
87 static const int GREY20 = 0xff333333;
88 static const int GREY30 = 0xff4c4c4c;
89 static const int GREY40 = 0xff666666;
90 static const int GREY50 = 0xff7f7f7f;
91 static const int GREY60 = 0xff999999;
92 static const int GREY70 = 0xffb2b2b2;
93 static const int GREY80 = 0xffcccccc;
94 static const int GREY90 = 0xffe5e5e5;
95 static const int GREY95 = 0xfff2f2f2;
97 static const int GREY = GREY50;
98 static const int DARK_PURPLE = 0xff200020;
99 static const int ORANGE = 0xffff6600;
101 static u32 HalfColor(u32 input)
104 r = (input & 0xff0000) >> 17;
105 g = (input & 0x00ff00) >> 9;
106 b = (input & 0xff) >> 1;
108 return 0xff000000 | (r << 16) | (g << 8) | b;
111 Drawing(SDL_Surface * dest = 0, TTF_Font * font = 0) ;
122 static u32
InterpolateColors(
const u32 color1,
const u32 color2, u32 percentOfColor1);
152 void Reset(SDL_Surface * dest, TTF_Font * font);
211 TTF_Font* old = m_font;
227 return SetFont(AssetManager::Get(asset));
233 void DrawHLine(
int y,
int startX,
int endX)
const;
238 void DrawVLine(
int x,
int startY,
int endY)
const;
249 void FillRect(
int x,
int y,
int w,
int h)
const;
255 void FillRect(
int x,
int y,
int w,
int h, u32 color)
const;
269 void FillCircle(
int x,
int y,
int w,
int h,
int radius)
const;
313 static void Convert(
const Rect & rect, SDL_Rect & toFill) ;
319 static inline void SetPixel(SDL_Surface* dest,
323 if(x >= 0 && y >= 0 && x < (u32)dest->w && y < (u32)dest->h)
325 ((u32*)dest->pixels)[x + y * dest->w] = color;
s32 GetX() const
Definition: Rect.h:147
static u32 InterpolateColors(const u32 color1, const u32 color2, u32 percentOfColor1)
Definition: Drawing.cpp:41
void FillCircle(int x, int y, int w, int h, int radius) const
Definition: Drawing.cpp:135
void BlitBackedTextCentered(const char *message, UPoint loc, UPoint size)
Definition: Drawing.cpp:220
TTF_Font * GetFont() const
Definition: Drawing.h:199
void GetWindow(Rect &rect) const
Definition: Drawing.cpp:36
void SetWindow(const Rect &rect)
Definition: Drawing.cpp:31
void BlitAsset(Asset asset, UPoint loc, UPoint maxSize) const
Definition: Drawing.cpp:167
u32 GetWidth() const
Definition: Rect.h:209
u32 SetForeground(const u32 color)
Definition: Drawing.h:188
void FillRect(const Rect &rect) const
Definition: Drawing.h:260
void Clear()
Definition: Drawing.cpp:91
void BlitImage(SDL_Surface *image, UPoint loc, UPoint maxSize) const
Definition: Drawing.cpp:147
SPoint GetTextSizeInFont(const char *message, TTF_Font *thisFont)
Definition: Drawing.cpp:206
void BlitBackedText(const char *message, UPoint loc, UPoint size)
Definition: Drawing.cpp:233
SPoint GetTextSize(const char *message)
Definition: Drawing.cpp:201
u32 SetBackground(const u32 color)
Definition: Drawing.h:170
void DrawRectangle(const Rect &rect) const
Definition: Drawing.cpp:106
void DrawHLine(int y, int startX, int endX) const
Definition: Drawing.cpp:96
u32 GetForeground() const
Definition: Drawing.h:180
void TransformWindow(const Rect &rect)
Definition: Drawing.cpp:16
void FillRect(int x, int y, int w, int h) const
Definition: Drawing.cpp:115
void DrawVLine(int x, int startY, int endY) const
Definition: Drawing.cpp:101
TTF_Font * SetFont(FontAsset asset)
Definition: Drawing.h:225
void Reset(SDL_Surface *dest, TTF_Font *font)
Definition: Drawing.cpp:75
u32 GetBackground() const
Definition: Drawing.h:162
TTF_Font * SetFont(TTF_Font *newFont)
Definition: Drawing.h:209
void BlitText(const char *message, UPoint loc, UPoint size) const
Definition: Drawing.cpp:172
u32 GetHeight() const
Definition: Rect.h:219
s32 GetY() const
Definition: Rect.h:157