Internals: Added IM_NEW, IM_DELETE helper macros (#1517, #484, #504)

This commit is contained in:
omar
2017-12-23 16:24:33 +01:00
parent a5739a0aa3
commit 9cda86d55a
3 changed files with 17 additions and 31 deletions

View File

@ -1461,15 +1461,9 @@ ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg)
// Create new font
if (!font_cfg->MergeMode)
{
ImFont* font = (ImFont*)ImGui::MemAlloc(sizeof(ImFont));
IM_PLACEMENT_NEW(font) ImFont();
Fonts.push_back(font);
}
Fonts.push_back(IM_NEW(ImFont));
else
{
IM_ASSERT(!Fonts.empty()); // When using MergeMode make sure that a font has already been added before. You can use ImGui::GetIO().Fonts->AddFontDefault() to add the default imgui font.
}
ConfigData.push_back(*font_cfg);
ImFontConfig& new_font_cfg = ConfigData.back();