CGrappleArm: Resolve sign mismatch warnings in loops

This commit is contained in:
Lioncash 2020-03-16 19:07:41 -04:00
parent 7039232a95
commit d0d6210ccd
1 changed files with 10 additions and 8 deletions

View File

@ -1,5 +1,7 @@
#include "Runtime/Weapon/CGrappleArm.hpp" #include "Runtime/Weapon/CGrappleArm.hpp"
#include <array>
#include "Runtime/CDependencyGroup.hpp" #include "Runtime/CDependencyGroup.hpp"
#include "Runtime/CSimplePool.hpp" #include "Runtime/CSimplePool.hpp"
#include "Runtime/GameGlobalObjects.hpp" #include "Runtime/GameGlobalObjects.hpp"
@ -54,11 +56,6 @@ CGrappleArm::CGrappleArm(const zeus::CVector3f& scale)
LoadAnimations(); LoadAnimations();
} }
static const char* skDependencyNames[] = {
"PowerSuit_DGRP", "GravitySuit_DGRP", "VariaSuit_DGRP", "PhazonSuit_DGRP",
"FusionSuit_DGRP", "FusionSuitG_DGRP", "FusionSuitV_DGRP", "FusionSuitP_DGRP",
};
void CGrappleArm::FillTokenVector(const std::vector<SObjectTag>& tags, std::vector<CToken>& objects) { void CGrappleArm::FillTokenVector(const std::vector<SObjectTag>& tags, std::vector<CToken>& objects) {
objects.reserve(tags.size()); objects.reserve(tags.size());
for (const SObjectTag& tag : tags) for (const SObjectTag& tag : tags)
@ -66,8 +63,13 @@ void CGrappleArm::FillTokenVector(const std::vector<SObjectTag>& tags, std::vect
} }
void CGrappleArm::BuildSuitDependencyList() { void CGrappleArm::BuildSuitDependencyList() {
static constexpr std::array skDependencyNames{
"PowerSuit_DGRP"sv, "GravitySuit_DGRP"sv, "VariaSuit_DGRP"sv, "PhazonSuit_DGRP"sv,
"FusionSuit_DGRP"sv, "FusionSuitG_DGRP"sv, "FusionSuitV_DGRP"sv, "FusionSuitP_DGRP"sv,
};
x184_grappleArm.Lock(); x184_grappleArm.Lock();
for (const char* name : skDependencyNames) { for (const auto& name : skDependencyNames) {
TLockedToken<CDependencyGroup> dgrp = g_SimplePool->GetObj(name); TLockedToken<CDependencyGroup> dgrp = g_SimplePool->GetObj(name);
std::vector<CToken>& depsOut = x19c_suitDeps.emplace_back(); std::vector<CToken>& depsOut = x19c_suitDeps.emplace_back();
FillTokenVector(dgrp->GetObjectTagVector(), depsOut); FillTokenVector(dgrp->GetObjectTagVector(), depsOut);
@ -254,7 +256,7 @@ void CGrappleArm::DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node,
void CGrappleArm::DoUserAnimEvents(CStateManager& mgr) { void CGrappleArm::DoUserAnimEvents(CStateManager& mgr) {
zeus::CVector3f armToCam = mgr.GetCameraManager()->GetCurrentCamera(mgr)->GetTranslation() - x220_xf.origin; zeus::CVector3f armToCam = mgr.GetCameraManager()->GetCurrentCamera(mgr)->GetTranslation() - x220_xf.origin;
const CAnimData& animData = *x0_grappleArmModel->GetAnimationData(); const CAnimData& animData = *x0_grappleArmModel->GetAnimationData();
for (int i = 0; i < animData.GetPassedSoundPOICount(); ++i) { for (size_t i = 0; i < animData.GetPassedSoundPOICount(); ++i) {
const CSoundPOINode& node = CAnimData::g_SoundPOINodes[i]; const CSoundPOINode& node = CAnimData::g_SoundPOINodes[i];
if (node.GetPoiType() != EPOIType::Sound || if (node.GetPoiType() != EPOIType::Sound ||
(node.GetCharacterIndex() != -1 && animData.x204_charIdx != node.GetCharacterIndex())) (node.GetCharacterIndex() != -1 && animData.x204_charIdx != node.GetCharacterIndex()))
@ -263,7 +265,7 @@ void CGrappleArm::DoUserAnimEvents(CStateManager& mgr) {
node.GetFlags(), node.GetFalloff(), node.GetMaxDist(), 0.16f, 1.f, armToCam, node.GetFlags(), node.GetFalloff(), node.GetMaxDist(), 0.16f, 1.f, armToCam,
x220_xf.origin, mgr.GetPlayer().GetAreaIdAlways(), mgr); x220_xf.origin, mgr.GetPlayer().GetAreaIdAlways(), mgr);
} }
for (int i = 0; i < animData.GetPassedIntPOICount(); ++i) { for (size_t i = 0; i < animData.GetPassedIntPOICount(); ++i) {
const CInt32POINode& node = CAnimData::g_Int32POINodes[i]; const CInt32POINode& node = CAnimData::g_Int32POINodes[i];
switch (node.GetPoiType()) { switch (node.GetPoiType()) {
case EPOIType::UserEvent: case EPOIType::UserEvent: