mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-16 08:57:03 +00:00
CAuiEnergyBarT01: Make use of std::array where applicable
Same behavior, but allows dehardcoding array sizes.
This commit is contained in:
@@ -54,15 +54,16 @@ void CAuiEnergyBarT01::Update(float dt) {
|
||||
}
|
||||
|
||||
void CAuiEnergyBarT01::Draw(const CGuiWidgetDrawParms& drawParms) const {
|
||||
if (!xbc_tex || !xbc_tex.IsLoaded() || !xd8_coordFunc)
|
||||
if (!xbc_tex || !xbc_tex.IsLoaded() || !xd8_coordFunc) {
|
||||
return;
|
||||
}
|
||||
SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(fmt("CAuiEnergyBarT01::Draw {}"), m_name).c_str(), zeus::skCyan);
|
||||
|
||||
CGraphics::SetModelMatrix(x34_worldXF);
|
||||
const_cast<CEnergyBarShader&>(m_energyBarShader).updateModelMatrix();
|
||||
|
||||
float filledT = xe0_maxEnergy > 0.f ? xf8_filledEnergy / xe0_maxEnergy : 0.f;
|
||||
float shadowT = xe0_maxEnergy > 0.f ? xfc_shadowEnergy / xe0_maxEnergy : 0.f;
|
||||
const float filledT = xe0_maxEnergy > 0.f ? xf8_filledEnergy / xe0_maxEnergy : 0.f;
|
||||
const float shadowT = xe0_maxEnergy > 0.f ? xfc_shadowEnergy / xe0_maxEnergy : 0.f;
|
||||
|
||||
zeus::CColor filledColor = xd0_filledColor;
|
||||
filledColor.a() *= drawParms.x0_alphaMod;
|
||||
@@ -76,7 +77,7 @@ void CAuiEnergyBarT01::Draw(const CGuiWidgetDrawParms& drawParms) const {
|
||||
emptyColor.a() *= drawParms.x0_alphaMod;
|
||||
emptyColor *= xa8_color2;
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (size_t i = 0; i < m_verts.size(); ++i) {
|
||||
std::vector<CEnergyBarShader::Vertex>& verts = const_cast<CAuiEnergyBarT01&>(*this).m_verts[i];
|
||||
verts.clear();
|
||||
|
||||
@@ -98,8 +99,9 @@ void CAuiEnergyBarT01::Draw(const CGuiWidgetDrawParms& drawParms) const {
|
||||
break;
|
||||
}
|
||||
|
||||
if (start == end)
|
||||
if (start == end) {
|
||||
continue;
|
||||
}
|
||||
|
||||
std::pair<zeus::CVector3f, zeus::CVector3f> coords = xd8_coordFunc(start);
|
||||
while (start < end) {
|
||||
|
||||
Reference in New Issue
Block a user