mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
impr: Drastically reduce font-related memory usage
This commit is contained in:
@@ -16,7 +16,7 @@ namespace hex::fonts {
|
||||
|
||||
bool buildFontAtlas(FontAtlas *fontAtlas, std::fs::path fontPath, bool pixelPerfectFont, float fontSize, bool loadUnicodeCharacters, bool bold, bool italic, bool antialias);
|
||||
|
||||
static AutoReset<std::map<ImFont*, std::unique_ptr<FontAtlas>>> s_fontAtlases;
|
||||
static AutoReset<std::map<UnlocalizedString, std::unique_ptr<FontAtlas>>> s_fontAtlases;
|
||||
|
||||
void loadFont(const ContentRegistry::Settings::Widgets::Widget &widget, const UnlocalizedString &name, ImFont **font, float scale) {
|
||||
const auto &settings = static_cast<const FontSelector&>(widget);
|
||||
@@ -51,7 +51,7 @@ namespace hex::fonts {
|
||||
|
||||
*font = atlas->getAtlas()->Fonts[0];
|
||||
|
||||
(*s_fontAtlases)[*font] = std::move(atlas);
|
||||
(*s_fontAtlases)[name] = std::move(atlas);
|
||||
}
|
||||
|
||||
bool setupFonts() {
|
||||
|
||||
Reference in New Issue
Block a user