Moved SDL_Rect ostream op to the correct file and improved output formatting
This commit is contained in:
parent
648ca5cd04
commit
1a2561721a
2 changed files with 6 additions and 7 deletions
|
@ -86,3 +86,9 @@ bool operator!=(const SDL_Rect& a, const SDL_Rect& b)
|
|||
{
|
||||
return !operator==(a,b);
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& s, const SDL_Rect& rect)
|
||||
{
|
||||
s << "x: " << rect.x << ", y: " << rect.y << ", w: " << rect.w << ", h: " << rect.h;
|
||||
return s;
|
||||
}
|
||||
|
|
|
@ -2213,17 +2213,10 @@ void draw_centered_on_background(surface surf, const SDL_Rect& rect, const color
|
|||
}
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& s, const SDL_Rect& rect)
|
||||
{
|
||||
s << rect.x << ',' << rect.y << " x " << rect.w << ',' << rect.h;
|
||||
return s;
|
||||
}
|
||||
|
||||
SDL_Color color_t::to_sdl() const {
|
||||
return {r, g, b, a};
|
||||
}
|
||||
|
||||
|
||||
color_t::color_t(const SDL_Color& c)
|
||||
: r(c.r)
|
||||
, g(c.g)
|
||||
|
|
Loading…
Add table
Reference in a new issue