mirror of
https://github.com/GabsPuNs/Project-Zenith-Main.git
synced 2026-07-09 17:48:11 +00:00
Update RmlManager.cpp
This commit is contained in:
@@ -37,12 +37,7 @@ bool RmlManager::Init(int viewport_width, int viewport_height)
|
||||
}
|
||||
|
||||
// Set asset path for RmlUi files (relative to exe directory)
|
||||
char exePath[MAX_PATH];
|
||||
GetModuleFileNameA(nullptr, exePath, MAX_PATH);
|
||||
char* lastSlash = strrchr(exePath, '\\');
|
||||
if (lastSlash)
|
||||
*(lastSlash + 1) = '\0';
|
||||
Rml::String assetPath = Rml::String(exePath) + "Assets/UI";
|
||||
Rml::String assetPath = utils.GetExeDir().string() + "/Assets/UI";
|
||||
m_file_interface->SetAssetPath(assetPath);
|
||||
|
||||
Rml::SetRenderInterface(m_renderer.get());
|
||||
@@ -55,11 +50,14 @@ bool RmlManager::Init(int viewport_width, int viewport_height)
|
||||
return false;
|
||||
}
|
||||
|
||||
// GabsPuN: Hardcoded. Is this really needed?
|
||||
/*
|
||||
// Load default fonts
|
||||
Rml::LoadFontFace("C:/Windows/Fonts/segoeui.ttf", false);
|
||||
Rml::LoadFontFace("C:/Windows/Fonts/segoeuib.ttf", false);
|
||||
Rml::LoadFontFace("C:/Windows/Fonts/segoeuii.ttf", false);
|
||||
Rml::LoadFontFace("C:/Windows/Fonts/segoeuiz.ttf", false);
|
||||
*/
|
||||
|
||||
// Minecraft's UI fonts (from tryashtar/minecraft-ttf)
|
||||
if (!Rml::LoadFontFace(assetPath + "/fonts/Mojangles.ttf", "Minecraft Default", Rml::Style::FontStyle::Normal, Rml::Style::FontWeight::Normal, false))
|
||||
@@ -132,6 +130,8 @@ void RmlManager::Render()
|
||||
|
||||
m_renderer->BeginFrame();
|
||||
|
||||
//GabsPuN: This DebugPrintf is called each frame when RMLUI is not used.
|
||||
/*
|
||||
int docCount = 0;
|
||||
for (int i = 0; i < m_context->GetNumDocuments(); i++)
|
||||
{
|
||||
@@ -141,6 +141,7 @@ void RmlManager::Render()
|
||||
}
|
||||
if (docCount == 0)
|
||||
app.DebugPrintf("[RmlManager] WARNING: No visible documents in context\n");
|
||||
*/
|
||||
|
||||
m_context->Render();
|
||||
m_renderer->EndFrame();
|
||||
|
||||
Reference in New Issue
Block a user