diff --git a/SDLWrapper/Font.cpp b/SDLWrapper/Font.cpp index 2d94533..5a729c9 100644 --- a/SDLWrapper/Font.cpp +++ b/SDLWrapper/Font.cpp @@ -10,12 +10,12 @@ void Font::_set(TTF_Font* p) // private void Font::_clear() { - _font.reset(); + _font.release(); } // private TTF_Font* Font::_get() const { - return _font.get(); + return const_cast(_font.get()); } Font::Font(const std::string& FontFileName, size_t size) @@ -400,5 +400,5 @@ void Font::release() { _clear(); } -} /// End of namespace MiniEngine +} /// End of namespace MiniEngine diff --git a/SDLWrapper/Font.h b/SDLWrapper/Font.h index 19c9fe9..cd9d753 100644 --- a/SDLWrapper/Font.h +++ b/SDLWrapper/Font.h @@ -8,9 +8,11 @@ #include "Renderer.h" #include #include "__Plugin.h" +#include "__Noncopyable.h" +#include "_handler.h" namespace MiniEngine { -class Font +class Font : public NonCopyable { public: Font() = default; @@ -116,12 +118,13 @@ private: void _real_setFontStyle(int); int _style_caster(FontStyle); - std::shared_ptr _font; + res_ptr _font; + void _set(TTF_Font*); void _clear(); TTF_Font* _get() const; friend class _internal::Plugin; }; -} /// End of namespace MiniEngine +} /// End of namespace MiniEngine