Moved SDL_Rect ostream op to the correct file and improved output formatting

This commit is contained in:
Charles Dang 2017-06-02 13:53:45 +11:00
parent 648ca5cd04
commit 1a2561721a
2 changed files with 6 additions and 7 deletions

View file

@ -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;
}

View file

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