2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 01:07:43 +00:00

Runtime: Make use of std::make_unique where applicable

Makes use of the C++14 make_unique allocation function to allocate class
instances where applicable instead of a reset with a new operator within
it.

This doesn't touch cases where buffers are allocated, given make_unique
would zero-initialize them.
This commit is contained in:
Lioncash
2019-09-11 23:50:38 -04:00
parent d6166ad666
commit f9079f0215
42 changed files with 227 additions and 205 deletions

View File

@@ -18,9 +18,9 @@ CGuiFrame::CGuiFrame(CAssetId id, CGuiSys& sys, int a, int b, int c, CSimplePool
: x0_id(id), x8_guiSys(sys), x4c_a(a), x50_b(b), x54_c(c), x58_24_loaded(false) {
x3c_lights.reserve(8);
m_indexedLights.reserve(8);
x10_rootWidget.reset(new CGuiWidget(CGuiWidget::CGuiWidgetParms(
x10_rootWidget = std::make_unique<CGuiWidget>(CGuiWidget::CGuiWidgetParms(
this, false, 0, 0, false, false, false, zeus::skWhite, CGuiWidget::EGuiModelDrawFlags::Alpha, false,
x8_guiSys.x8_mode != CGuiSys::EUsageMode::Zero, "<root>"s)));
x8_guiSys.x8_mode != CGuiSys::EUsageMode::Zero, "<root>"s));
x8_guiSys.m_registeredFrames.insert(this);
}