2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 22:27:41 +00:00

General: Make use of emplace_back where applicable

Allows for in-place construction. Also results in less code to read in
certain usages.
This commit is contained in:
Lioncash
2020-03-21 00:12:13 -04:00
parent 36ac0a8d78
commit fc4df76afc
13 changed files with 38 additions and 33 deletions

View File

@@ -174,7 +174,7 @@ void CTextRenderBuffer::AddImage(const zeus::CVector2i& offset, const CFontImage
if (x0_mode == EMode::AllocTally)
m_primitiveMarks.push_back({Command::ImageRender, m_imagesCount++, 0});
else
m_images.push_back({image, offset});
m_images.emplace_back(image, offset);
}
void CTextRenderBuffer::AddCharacter(const zeus::CVector2i& offset, char16_t ch, const zeus::CColor& color) {
@@ -209,7 +209,7 @@ void CTextRenderBuffer::AddFontChange(const TToken<CRasterFont>& font) {
}
m_activeFontCh = m_fontCharacters.size();
m_fontCharacters.push_back({font});
m_fontCharacters.emplace_back(font);
}
bool CTextRenderBuffer::HasSpaceAvailable(const zeus::CVector2i& origin, const zeus::CVector2i& extent) const {