Added Color support for Surface

This commit is contained in:
Vraiment 2017-07-03 21:50:49 -07:00
parent f9fa7a9d03
commit ae24c0dd76
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 color;
GetColorMod(color.r, color.g, color.b);
color.a = GetAlphaMod();
GetColorMod(color.r, color.g, color.b);
color.SetAlpha(GetAlphaMod());
return color;
}
@ -187,7 +187,7 @@ Surface& Surface::SetColorMod(Uint8 r, Uint8 g, Uint8 b) {
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);
}

View File

@ -398,7 +398,6 @@ public:
///
/// \throws SDL2pp::Exception
///
/// \see http://wiki.libsdl.org/SDL_GetSurfaceAlphaMod
/// \see http://wiki.libsdl.org/SDL_GetSurfaceColorMod
///
////////////////////////////////////////////////////////////
@ -500,11 +499,10 @@ public:
///
/// \throws SDL2pp::Exception
///
/// \see http://wiki.libsdl.org/SDL_SetSurfaceAlphaMod
/// \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