2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 02:27:42 +00:00

CAutoMapper: Eliminate usages of const_cast

Same behavior, but makes it explicit from the interface that
modifications are clearly going on from within the class.
This commit is contained in:
Lioncash
2020-03-31 06:24:54 -04:00
parent 12e42ba58a
commit 47555c725b
14 changed files with 65 additions and 54 deletions

View File

@@ -257,15 +257,16 @@ void CMapArea::CMapAreaSurface::PostConstruct(const u8* buf, std::vector<u32>& i
}
void CMapArea::CMapAreaSurface::Draw(const zeus::CVector3f* verts, const zeus::CColor& surfColor,
const zeus::CColor& lineColor, float lineWidth, size_t instIdx) const {
const zeus::CColor& lineColor, float lineWidth, size_t instIdx) {
if (instIdx >= m_instances.size()) {
return;
}
Instance& instance = const_cast<Instance&>(m_instances[instIdx]);
Instance& instance = m_instances[instIdx];
if (surfColor.a())
if (surfColor.a()) {
instance.m_surfacePrims.draw(surfColor, m_primStart, m_primCount);
}
if (lineColor.a()) {
bool draw2 = lineWidth > 1.f;