Added Color support for Surface

This commit is contained in:
Vraiment 2017-07-03 21:50:49 -07:00
parent b0f09dac4e
commit c9684f03d3
2 changed files with 4 additions and 6 deletions

View File

@ -147,8 +147,8 @@ SDL_BlendMode Surface::GetBlendMode() const {
Color Surface::GetColorAndAlphaMod() const { Color Surface::GetColorAndAlphaMod() const {
Color color; Color color;
GetColorMod(color.r, color.g, color.b); GetColorMod(color.r, color.g, color.b);
color.a = GetAlphaMod(); color.SetAlpha(GetAlphaMod());
return color; return color;
} }
@ -187,7 +187,7 @@ Surface& Surface::SetColorMod(Uint8 r, Uint8 g, Uint8 b) {
return *this; return *this;
} }
Surface& Surface::SetColorAndAlphaMod(const Color& color) { Surface& Surface::SetColorAndAlphaMod(const Color color) {
return SetColorMod(color.r, color.g, color.b).SetAlphaMod(color.a); return SetColorMod(color.r, color.g, color.b).SetAlphaMod(color.a);
} }

View File

@ -398,7 +398,6 @@ public:
/// ///
/// \throws SDL2pp::Exception /// \throws SDL2pp::Exception
/// ///
/// \see http://wiki.libsdl.org/SDL_GetSurfaceAlphaMod
/// \see http://wiki.libsdl.org/SDL_GetSurfaceColorMod /// \see http://wiki.libsdl.org/SDL_GetSurfaceColorMod
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -500,11 +499,10 @@ public:
/// ///
/// \throws SDL2pp::Exception /// \throws SDL2pp::Exception
/// ///
/// \see http://wiki.libsdl.org/SDL_SetSurfaceAlphaMod
/// \see http://wiki.libsdl.org/SDL_SetSurfaceColorMod /// \see http://wiki.libsdl.org/SDL_SetSurfaceColorMod
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Surface& SetColorAndAlphaMod(const Color& color); Surface& SetColorAndAlphaMod(const Color color);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Set the RLE acceleration hint for a surface /// \brief Set the RLE acceleration hint for a surface