diff options
| author | MegaMech <7255464+MegaMech@users.noreply.github.com> | 2025-05-23 16:50:26 -0600 |
|---|---|---|
| committer | MegaMech <7255464+MegaMech@users.noreply.github.com> | 2025-05-23 16:50:26 -0600 |
| commit | 25b68921ad4cece662b2d20885103d8cc998dac5 (patch) | |
| tree | bff02190a71052cfc9897444b3e3e0fc19e20718 /src/port/Engine.cpp | |
| parent | c4721b2df546b77773e184c8c2ce3b3d83b17542 (diff) | |
| parent | c2ddd2c25626b2797b9f730d77118f0e96131108 (diff) | |
Merge branch 'transformsharedfromptr' of https://github.com/HarbourMasters/SpaghettiKart into transformsharedfromptr
Diffstat (limited to 'src/port/Engine.cpp')
| -rw-r--r-- | src/port/Engine.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index 15acab0ac..70ea4054c 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -298,6 +298,9 @@ void GameEngine::Destroy() { #ifdef __SWITCH__ Ship::Switch::Exit(); #endif + GameUI::Destroy(); + delete GameEngine::Instance; + GameEngine::Instance = nullptr; } bool ShouldClearTextureCacheAtEndOfFrame = false; @@ -509,7 +512,9 @@ ImFont* GameEngine::CreateFontWithSize(float size, std::string fontPath) { initData->Path = fontPath; std::shared_ptr<Ship::Font> fontData = std::static_pointer_cast<Ship::Font>( Ship::Context::GetInstance()->GetResourceManager()->LoadResource(fontPath, false, initData)); - font = mImGuiIo->Fonts->AddFontFromMemoryTTF(fontData->Data, fontData->DataSize, size); + char* fontDataPtr = (char*)malloc(fontData->DataSize); + memcpy(fontDataPtr, fontData->Data, fontData->DataSize); + font = mImGuiIo->Fonts->AddFontFromMemoryTTF(fontDataPtr, fontData->DataSize, size); } // FontAwesome fonts need to have their sizes reduced by 2.0f/3.0f in order to align correctly float iconFontSize = size * 2.0f / 3.0f; |
