File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 4242
4343#include < cstdlib>
4444#include < iostream>
45- #include < optional>
4645
4746namespace irr
4847{
4948namespace gui
5049{
5150
5251std::map<io::path, SGUITTFace*> SGUITTFace::faces;
53- std::optional< FT_Library> SGUITTFace::freetype_library;
54- std::size_t SGUITTFace::n_faces;
52+ FT_Library SGUITTFace::freetype_library = nullptr ;
53+ std::size_t SGUITTFace::n_faces = 0 ;
5554
5655FT_Library SGUITTFace::getFreeTypeLibrary ()
5756{
5857 if (freetype_library)
59- return * freetype_library;
58+ return freetype_library;
6059 FT_Library ft;
6160 if (FT_Init_FreeType (&ft))
6261 FATAL_ERROR (" initializing freetype failed" );
6362 freetype_library = ft;
64- return * freetype_library;
63+ return freetype_library;
6564}
6665
6766SGUITTFace::SGUITTFace (std::string &&buffer) : face_buffer(std::move(buffer))
@@ -77,8 +76,8 @@ SGUITTFace::~SGUITTFace()
7776 // If there are no more faces referenced by FreeType, clean up.
7877 if (n_faces == 0 ) {
7978 assert (freetype_library);
80- FT_Done_FreeType (* freetype_library);
81- freetype_library = std:: nullopt ;
79+ FT_Done_FreeType (freetype_library);
80+ freetype_library = nullptr ;
8281 }
8382}
8483
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ namespace gui
5656 private:
5757
5858 static std::map<io::path, SGUITTFace*> faces;
59- static std::optional< FT_Library> freetype_library;
59+ static FT_Library freetype_library;
6060 static std::size_t n_faces;
6161
6262 static FT_Library getFreeTypeLibrary ();
You can’t perform that action at this time.
0 commit comments