diff --git a/src/include/color.h b/src/include/color.h index 6feeed9ccd..3ceaf65812 100644 --- a/src/include/color.h +++ b/src/include/color.h @@ -44,9 +44,9 @@ struct lua_State; class CColor { public: - CColor() : R(0), G(0), B(0), A(0) {} + CColor() : R(0), G(0), B(0), A(255) {} CColor(unsigned char r, unsigned char g, unsigned char b, - unsigned char a = 0) : R(r), G(g), B(b), A(a) {} + unsigned char a = 255) : R(r), G(g), B(b), A(a) {} CColor(const CColor &color) = default; void Parse(lua_State *l, int index = -1); diff --git a/src/include/font.h b/src/include/font.h index 7df9db22cc..c13550b73e 100644 --- a/src/include/font.h +++ b/src/include/font.h @@ -123,7 +123,7 @@ class CFont : public gcn::Font class CFontColor { public: - explicit CFontColor(std::string ident) : Ident(std::move(ident)) {} + explicit CFontColor(std::string ident); static CFontColor *New(const std::string &ident); static CFontColor *Get(std::string_view ident); diff --git a/src/tolua/video.pkg b/src/tolua/video.pkg index c821637669..684fa59a1f 100644 --- a/src/tolua/video.pkg +++ b/src/tolua/video.pkg @@ -42,7 +42,7 @@ public: class CColor { CColor(unsigned char r = 0, unsigned char g = 0, unsigned char b = 0, - unsigned char a = 0); + unsigned char a = 255); unsigned char R; unsigned char G; diff --git a/src/video/font.cpp b/src/video/font.cpp index ecc431a4dc..24ed54d2ad 100644 --- a/src/video/font.cpp +++ b/src/video/font.cpp @@ -981,6 +981,16 @@ void ReloadFonts() return font.get(); } +/** +* Constructor +*/ +/* explicit */ CFontColor::CFontColor(std::string ident) : Ident(std::move(ident)) +{ + for (auto& color : Colors) { + color.a = SDL_ALPHA_OPAQUE; + } +} + /** ** Get a font **