aboutsummaryrefslogtreecommitdiff
path: root/src/irrlicht_changes/CGUITTFont.h
diff options
context:
space:
mode:
authorparadust7 <102263465+paradust7@users.noreply.github.com>2022-05-21 15:11:49 -0700
committerGitHub <noreply@github.com>2022-05-22 00:11:49 +0200
commit2742fef458c3626476193c9e2d1b9231e042e420 (patch)
treef7682c0a9e2a97578bc44fe344f29fe86bcf233c /src/irrlicht_changes/CGUITTFont.h
parentbc59fcf5c5cc44ea18e93f64aca9c20be71c1b07 (diff)
downloadminetest-2742fef458c3626476193c9e2d1b9231e042e420.tar.gz
minetest-2742fef458c3626476193c9e2d1b9231e042e420.tar.bz2
minetest-2742fef458c3626476193c9e2d1b9231e042e420.zip
Fixes needed to use irrArray backed by std::vector (#12263)
Diffstat (limited to 'src/irrlicht_changes/CGUITTFont.h')
-rw-r--r--src/irrlicht_changes/CGUITTFont.h38
1 files changed, 25 insertions, 13 deletions
diff --git a/src/irrlicht_changes/CGUITTFont.h b/src/irrlicht_changes/CGUITTFont.h
index 9457e5b18..210222ed4 100644
--- a/src/irrlicht_changes/CGUITTFont.h
+++ b/src/irrlicht_changes/CGUITTFont.h
@@ -37,6 +37,7 @@
#include <map>
#include <irrUString.h>
#include "util/enriched_string.h"
+#include "util/basic_macros.h"
#include FT_FREETYPE_H
namespace irr
@@ -46,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(); }