LeviLamina
Loading...
Searching...
No Matches
BitmapFont.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/Font.h"
7#include "mc/deps/core/file/PathBuffer.h"
8
9// auto generated forward declare list
10// clang-format off
12namespace Core { class Path; }
13namespace mce { class Color; }
14namespace mce { class MaterialPtr; }
15namespace mce { class TextureGroup; }
16namespace mce { struct Image; }
17// clang-format on
18
19class BitmapFont : public ::Font {
20public:
21 // member variables
22 // NOLINTBEGIN
23 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mAsciiFontName;
24 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mUnicodeFontName;
25 ::ll::TypedStorage<4, 1024, float[256]> mCharWidths;
26 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::Image>> mBitmapFontImage;
27 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, float>> mUnicodeWidths;
28 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, float>> mUnicodeOffsets;
29 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, float>> mUnicodePageGlyphWidths;
30 ::ll::TypedStorage<8, 64, ::std::unordered_set<int>> mSheetScannedForWidthsAndOffsets;
31 // NOLINTEND
32
33public:
34 // prevent constructor by default
35 BitmapFont& operator=(BitmapFont const&);
36 BitmapFont();
37
38public:
39 // virtual functions
40 // NOLINTBEGIN
41 virtual ~BitmapFont() /*override*/;
42
43 virtual float _getCharWidth(int uniChar, bool forceUnicode) /*override*/;
44
45 virtual bool supportsChar(int const& character) /*override*/;
46
47 virtual float getWrapHeight() const /*override*/;
48
49 virtual float getScaleFactor(int c) const /*override*/;
50
51 virtual float getScaleFactor() const /*override*/;
52
53 virtual bool isScreenPixelAligned() const /*override*/;
54
55 virtual bool materialCanBeOverridden() const /*override*/;
56
57 virtual void uploadTextureToGPU() /*override*/;
58
59 virtual void _scanUnicodeCharacterSize(int character, int sheet, bool forceUnicode) /*override*/;
60
61 virtual bool _supportsShadowInSingleDraw() /*override*/;
62
63 virtual ::ResourceLocation _getFontSheetLocation(int sheet, bool forceUnicode) const /*override*/;
64
65 virtual ::mce::MaterialPtr const& getMaterial(int sheet, bool isOddGuiScale) const /*override*/;
66
67 virtual void loadFontData(bool uploadTextureImmediately) /*override*/;
68
69 virtual float buildChar(
70 ::std::vector<::Font::GlyphQuad>& quads,
71 int i,
72 ::mce::Color const& color,
73 bool italic,
74 float x,
75 float y,
76 bool unicode
77 ) /*override*/;
78
79 virtual ::Core::PathBuffer<::std::string>
80 getUnicodeFontNameWithPage(::Core::Path const& fontName, uchar const page) const;
81
82 virtual void switchFontsource(::Core::Path const& asciiName, ::Core::Path const& unicodeName) /*override*/;
83
84 virtual ::std::pair<::Core::PathBuffer<::std::string> const&, ::Core::PathBuffer<::std::string> const&>
85 getFontSources() const /*override*/;
86 // NOLINTEND
87
88public:
89 // member functions
90 // NOLINTBEGIN
91 MCAPI BitmapFont(::BitmapFont const& rhs);
92
93 MCAPI BitmapFont(
94 ::Core::Path const& asciiName,
95 ::Core::Path const& unicodeName,
96 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
97 bool uploadOnConstruction
98 );
99
100 MCAPI void _loadAsciiFontInformation(::Core::Path const& fontName, bool uploadTextureImmediately);
101 // NOLINTEND
102
103public:
104 // constructor thunks
105 // NOLINTBEGIN
106 MCAPI void* $ctor(::BitmapFont const& rhs);
107
108 MCAPI void* $ctor(
109 ::Core::Path const& asciiName,
110 ::Core::Path const& unicodeName,
111 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
112 bool uploadOnConstruction
113 );
114 // NOLINTEND
115
116public:
117 // destructor thunk
118 // NOLINTBEGIN
119 MCAPI void $dtor();
120 // NOLINTEND
121
122public:
123 // virtual function thunks
124 // NOLINTBEGIN
125 MCAPI float $_getCharWidth(int uniChar, bool forceUnicode);
126
127 MCAPI bool $supportsChar(int const& character);
128
129 MCAPI float $getWrapHeight() const;
130
131 MCAPI float $getScaleFactor(int c) const;
132
133 MCAPI float $getScaleFactor() const;
134
135 MCFOLD bool $isScreenPixelAligned() const;
136
137 MCFOLD bool $materialCanBeOverridden() const;
138
139 MCAPI void $uploadTextureToGPU();
140
141 MCAPI void $_scanUnicodeCharacterSize(int character, int sheet, bool forceUnicode);
142
143 MCFOLD bool $_supportsShadowInSingleDraw();
144
145 MCAPI ::ResourceLocation $_getFontSheetLocation(int sheet, bool forceUnicode) const;
146
147 MCAPI ::mce::MaterialPtr const& $getMaterial(int sheet, bool isOddGuiScale) const;
148
149 MCAPI void $loadFontData(bool uploadTextureImmediately);
150
151 MCAPI float $buildChar(
152 ::std::vector<::Font::GlyphQuad>& quads,
153 int i,
154 ::mce::Color const& color,
155 bool italic,
156 float x,
157 float y,
158 bool unicode
159 );
160
161 MCAPI ::Core::PathBuffer<::std::string>
162 $getUnicodeFontNameWithPage(::Core::Path const& fontName, uchar const page) const;
163
164 MCAPI void $switchFontsource(::Core::Path const& asciiName, ::Core::Path const& unicodeName);
165
166 MCAPI ::std::pair<::Core::PathBuffer<::std::string> const&, ::Core::PathBuffer<::std::string> const&>
167 $getFontSources() const;
168 // NOLINTEND
169
170public:
171 // vftables
172 // NOLINTBEGIN
173 MCNAPI static void** $vftable();
174 // NOLINTEND
175};
Definition BitmapFont.h:5
static MCAPI void ** $vftable()
Definition Path.h:17
Definition Font.h:5
Definition ResourceLocation.h:15
Definition Color.h:13
Definition MaterialPtr.h:15
Definition TextureGroup.h:7
Definition Font.h:14
Definition Image.h:12