aboutsummaryrefslogtreecommitdiff
path: root/src/irrlicht_changes/CGUITTFont.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/irrlicht_changes/CGUITTFont.h')
-rw-r--r--src/irrlicht_changes/CGUITTFont.h43
1 files changed, 28 insertions, 15 deletions
diff --git a/src/irrlicht_changes/CGUITTFont.h b/src/irrlicht_changes/CGUITTFont.h
index 7b04ae828..2721364f5 100644
--- a/src/irrlicht_changes/CGUITTFont.h
+++ b/src/irrlicht_changes/CGUITTFont.h
@@ -1,7 +1,7 @@
/*
CGUITTFont FreeType class for Irrlicht
Copyright (c) 2009-2010 John Norman
- Copyright (c) 2016 Nathanaƫl Courant
+ Copyright (c) 2016 Nathanaƫlle Courant
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
@@ -34,8 +34,10 @@
#include <irrlicht.h>
#include <ft2build.h>
#include <vector>
+#include <map>
#include <irrUString.h>
#include "util/enriched_string.h"
+#include "util/basic_macros.h"
#include FT_FREETYPE_H
namespace irr
@@ -45,23 +47,34 @@ namespace gui
struct SGUITTFace;
class CGUITTFont;
- //! Class to assist in deleting glyphs.
- class CGUITTAssistDelete
- {
- public:
- template <class T, typename TAlloc>
- static void Delete(core::array<T, TAlloc>& a)
- {
- TAlloc allocator;
- allocator.deallocate(a.pointer());
- }
- };
-
//! Structure representing a single TrueType glyph.
struct SGUITTGlyph
{
//! Constructor.
- SGUITTGlyph() : isLoaded(false), glyph_page(0), surface(0), parent(0) {}
+ SGUITTGlyph() :
+ isLoaded(false),
+ glyph_page(0),
+ source_rect(),
+ offset(),
+ advance(),
+ surface(0),
+ parent(0)
+ {}
+
+ DISABLE_CLASS_COPY(SGUITTGlyph);
+
+ //! This class would be trivially copyable except for the reference count on `surface`.
+ SGUITTGlyph(SGUITTGlyph &&other) :
+ isLoaded(other.isLoaded),
+ glyph_page(other.glyph_page),
+ source_rect(other.source_rect),
+ offset(other.offset),
+ advance(other.advance),
+ surface(other.surface),
+ parent(other.parent)
+ {
+ other.surface = 0;
+ }
//! Destructor.
~SGUITTGlyph() { unload(); }
@@ -345,7 +358,7 @@ namespace gui
private:
// Manages the FreeType library.
static FT_Library c_library;
- static core::map<io::path, SGUITTFace*> c_faces;
+ static std::map<io::path, SGUITTFace*> c_faces;
static bool c_libraryLoaded;
static scene::IMesh* shared_plane_ptr_;
static scene::SMesh shared_plane_;