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*/ = default;
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 // NOLINTEND
100
101public:
102 // constructor thunks
103 // NOLINTBEGIN
104 MCAPI void* $ctor(::BitmapFont const& rhs);
105
106 MCAPI void* $ctor(
107 ::Core::Path const& asciiName,
108 ::Core::Path const& unicodeName,
109 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
110 bool uploadOnConstruction
111 );
112 // NOLINTEND
113
114public:
115 // virtual function thunks
116 // NOLINTBEGIN
117 MCAPI float $_getCharWidth(int uniChar, bool forceUnicode);
118
119 MCAPI bool $supportsChar(int const& character);
120
121 MCAPI float $getWrapHeight() const;
122
123 MCAPI float $getScaleFactor(int c) const;
124
125 MCAPI float $getScaleFactor() const;
126
127 MCFOLD bool $isScreenPixelAligned() const;
128
129 MCFOLD bool $materialCanBeOverridden() const;
130
131 MCAPI void $uploadTextureToGPU();
132
133 MCAPI void $_scanUnicodeCharacterSize(int character, int sheet, bool forceUnicode);
134
135 MCFOLD bool $_supportsShadowInSingleDraw();
136
137 MCAPI ::ResourceLocation $_getFontSheetLocation(int sheet, bool forceUnicode) const;
138
139 MCAPI ::mce::MaterialPtr const& $getMaterial(int sheet, bool isOddGuiScale) const;
140
141 MCAPI void $loadFontData(bool uploadTextureImmediately);
142
143 MCAPI float $buildChar(
144 ::std::vector<::Font::GlyphQuad>& quads,
145 int i,
146 ::mce::Color const& color,
147 bool italic,
148 float x,
149 float y,
150 bool unicode
151 );
152
153 MCAPI ::Core::PathBuffer<::std::string>
154 $getUnicodeFontNameWithPage(::Core::Path const& fontName, uchar const page) const;
155
156 MCAPI void $switchFontsource(::Core::Path const& asciiName, ::Core::Path const& unicodeName);
157
158 MCAPI ::std::pair<::Core::PathBuffer<::std::string> const&, ::Core::PathBuffer<::std::string> const&>
159 $getFontSources() const;
160 // NOLINTEND
161};
Definition BitmapFont.h:5
Definition Path.h:11
Definition Font.h:5
Definition ResourceLocation.h:15
Definition Color.h:13
Definition MaterialPtr.h:14
Definition TextureGroup.h:7
Definition Font.h:15
Definition Image.h:13