CAudioMacro: Make use of size_t where applicable
This commit is contained in:
parent
5d0a08b207
commit
e2dedf1b31
|
@ -466,23 +466,23 @@ void GenerateAssetNames(CGameProject *pProj)
|
||||||
|
|
||||||
for (TResourceIterator<EResourceType::AudioMacro> It(pStore); It; ++It)
|
for (TResourceIterator<EResourceType::AudioMacro> It(pStore); It; ++It)
|
||||||
{
|
{
|
||||||
CAudioMacro *pMacro = (CAudioMacro*) It->Load();
|
const auto* pMacro = static_cast<CAudioMacro*>(It->Load());
|
||||||
TString MacroName = pMacro->MacroName();
|
TString MacroName = pMacro->MacroName();
|
||||||
ApplyGeneratedName(*It, kSfxDir, MacroName);
|
ApplyGeneratedName(*It, kSfxDir, MacroName);
|
||||||
|
|
||||||
for (uint32 iSamp = 0; iSamp < pMacro->NumSamples(); iSamp++)
|
for (size_t iSamp = 0; iSamp < pMacro->NumSamples(); iSamp++)
|
||||||
{
|
{
|
||||||
CAssetID SampleID = pMacro->SampleByIndex(iSamp);
|
const CAssetID SampleID = pMacro->SampleByIndex(iSamp);
|
||||||
CResourceEntry *pSample = pStore->FindEntry(SampleID);
|
CResourceEntry* pSample = pStore->FindEntry(SampleID);
|
||||||
|
|
||||||
if (pSample && !pSample->IsNamed())
|
if (pSample != nullptr && !pSample->IsNamed())
|
||||||
{
|
{
|
||||||
TString SampleName;
|
TString SampleName;
|
||||||
|
|
||||||
if (pMacro->NumSamples() == 1)
|
if (pMacro->NumSamples() == 1)
|
||||||
SampleName = MacroName;
|
SampleName = MacroName;
|
||||||
else
|
else
|
||||||
SampleName = TString::Format("%s_%d", *MacroName, iSamp);
|
SampleName = TString::Format("%s_%zu", *MacroName, iSamp);
|
||||||
|
|
||||||
ApplyGeneratedName(pSample, kSfxDir, SampleName);
|
ApplyGeneratedName(pSample, kSfxDir, SampleName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,8 +28,8 @@ public:
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
TString MacroName() const { return mMacroName; }
|
TString MacroName() const { return mMacroName; }
|
||||||
uint32 NumSamples() const { return mSamples.size(); }
|
size_t NumSamples() const { return mSamples.size(); }
|
||||||
CAssetID SampleByIndex(uint32 Index) const { return mSamples[Index]; }
|
CAssetID SampleByIndex(size_t Index) const { return mSamples[Index]; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CAUDIOMACRO_H
|
#endif // CAUDIOMACRO_H
|
||||||
|
|
Loading…
Reference in New Issue