Remove redundant _getPOIList methods

This commit is contained in:
Jack Andersen 2016-08-27 11:19:55 -10:00
parent b25e5ad014
commit 8dacdd18b8
9 changed files with 8 additions and 160 deletions

View File

@ -167,8 +167,8 @@ u32 CAnimSourceReaderBase::VGetBoolPOIList(const CCharAnimTime& time,
if (x4_sourceInfo->HasPOIData()) if (x4_sourceInfo->HasPOIData())
{ {
const std::vector<CBoolPOINode>& boolNodes = x4_sourceInfo->GetBoolPOIStream(); const std::vector<CBoolPOINode>& boolNodes = x4_sourceInfo->GetBoolPOIStream();
return CBoolPOINode::_getPOIList(time, listOut, capacity, iterator, unk, boolNodes, return _getPOIList(time, listOut, capacity, iterator, unk, boolNodes,
xc_curTime, *x4_sourceInfo, x14_passedBoolCount); xc_curTime, *x4_sourceInfo, x14_passedBoolCount);
} }
return 0; return 0;
} }
@ -180,8 +180,8 @@ u32 CAnimSourceReaderBase::VGetInt32POIList(const CCharAnimTime& time,
if (x4_sourceInfo->HasPOIData()) if (x4_sourceInfo->HasPOIData())
{ {
const std::vector<CInt32POINode>& int32Nodes = x4_sourceInfo->GetInt32POIStream(); const std::vector<CInt32POINode>& int32Nodes = x4_sourceInfo->GetInt32POIStream();
return CInt32POINode::_getPOIList(time, listOut, capacity, iterator, unk, int32Nodes, return _getPOIList(time, listOut, capacity, iterator, unk, int32Nodes,
xc_curTime, *x4_sourceInfo, x18_passedIntCount); xc_curTime, *x4_sourceInfo, x18_passedIntCount);
} }
return 0; return 0;
} }
@ -193,8 +193,8 @@ u32 CAnimSourceReaderBase::VGetParticlePOIList(const CCharAnimTime& time,
if (x4_sourceInfo->HasPOIData()) if (x4_sourceInfo->HasPOIData())
{ {
const std::vector<CParticlePOINode>& particleNodes = x4_sourceInfo->GetParticlePOIStream(); const std::vector<CParticlePOINode>& particleNodes = x4_sourceInfo->GetParticlePOIStream();
return CParticlePOINode::_getPOIList(time, listOut, capacity, iterator, unk, particleNodes, return _getPOIList(time, listOut, capacity, iterator, unk, particleNodes,
xc_curTime, *x4_sourceInfo, x1c_passedParticleCount); xc_curTime, *x4_sourceInfo, x1c_passedParticleCount);
} }
return 0; return 0;
} }
@ -206,8 +206,8 @@ u32 CAnimSourceReaderBase::VGetSoundPOIList(const CCharAnimTime& time,
if (x4_sourceInfo->HasPOIData()) if (x4_sourceInfo->HasPOIData())
{ {
const std::vector<CSoundPOINode>& soundNodes = x4_sourceInfo->GetSoundPOIStream(); const std::vector<CSoundPOINode>& soundNodes = x4_sourceInfo->GetSoundPOIStream();
return CSoundPOINode::_getPOIList(time, listOut, capacity, iterator, unk, soundNodes, return _getPOIList(time, listOut, capacity, iterator, unk, soundNodes,
xc_curTime, *x4_sourceInfo, x20_passedSoundCount); xc_curTime, *x4_sourceInfo, x20_passedSoundCount);
} }
return 0; return 0;
} }

View File

@ -18,36 +18,4 @@ CBoolPOINode CBoolPOINode::CopyNodeMinusStartTime(const CBoolPOINode& node,
return ret; return ret;
} }
u32 CBoolPOINode::_getPOIList(const CCharAnimTime& time,
CBoolPOINode* listOut,
u32 capacity, u32 iterator, u32 unk1,
const std::vector<CBoolPOINode>& stream,
const CCharAnimTime& curTime,
const IAnimSourceInfo& animInfo, u32 passedCount)
{
u32 ret = 0;
if (animInfo.HasPOIData() && stream.size())
{
CCharAnimTime dur = animInfo.GetAnimationDuration();
CCharAnimTime targetTime = curTime + time;
if (targetTime >= dur)
targetTime = dur;
if (passedCount >= stream.size())
return ret;
CCharAnimTime nodeTime = stream[passedCount].GetTime();
while (nodeTime <= targetTime)
{
u32 idx = iterator + ret;
if (idx < capacity)
listOut[idx] = CopyNodeMinusStartTime(stream[passedCount], curTime);
++passedCount;
++ret;
nodeTime = stream[passedCount].GetTime();
}
}
return ret;
}
} }

View File

@ -14,12 +14,6 @@ public:
CBoolPOINode(); CBoolPOINode();
CBoolPOINode(CInputStream& in); CBoolPOINode(CInputStream& in);
bool GetValue() const {return x38_val;} bool GetValue() const {return x38_val;}
static u32 _getPOIList(const CCharAnimTime& time,
CBoolPOINode* listOut,
u32 capacity, u32 iterator, u32 unk1,
const std::vector<CBoolPOINode>& stream,
const CCharAnimTime& curTime,
const IAnimSourceInfo& animInfo, u32 passedCount);
static CBoolPOINode CopyNodeMinusStartTime(const CBoolPOINode& node, static CBoolPOINode CopyNodeMinusStartTime(const CBoolPOINode& node,
const CCharAnimTime& startTime); const CCharAnimTime& startTime);
}; };

View File

@ -18,36 +18,4 @@ CInt32POINode CInt32POINode::CopyNodeMinusStartTime(const CInt32POINode& node,
return ret; return ret;
} }
u32 CInt32POINode::_getPOIList(const CCharAnimTime& time,
CInt32POINode* listOut,
u32 capacity, u32 iterator, u32 unk1,
const std::vector<CInt32POINode>& stream,
const CCharAnimTime& curTime,
const IAnimSourceInfo& animInfo, u32 passedCount)
{
u32 ret = 0;
if (animInfo.HasPOIData() && stream.size())
{
CCharAnimTime dur = animInfo.GetAnimationDuration();
CCharAnimTime targetTime = curTime + time;
if (targetTime >= dur)
targetTime = dur;
if (passedCount >= stream.size())
return ret;
CCharAnimTime nodeTime = stream[passedCount].GetTime();
while (nodeTime <= targetTime)
{
u32 idx = iterator + ret;
if (idx < capacity)
listOut[idx] = CopyNodeMinusStartTime(stream[passedCount], curTime);
++passedCount;
++ret;
nodeTime = stream[passedCount].GetTime();
}
}
return ret;
}
} }

View File

@ -17,12 +17,6 @@ public:
s32 GetValue() const {return x38_val;} s32 GetValue() const {return x38_val;}
const std::string& GetLocatorName() const {return x3c_locatorName;} const std::string& GetLocatorName() const {return x3c_locatorName;}
static u32 _getPOIList(const CCharAnimTime& time,
CInt32POINode* listOut,
u32 capacity, u32 iterator, u32 unk1,
const std::vector<CInt32POINode>& stream,
const CCharAnimTime& curTime,
const IAnimSourceInfo& animInfo, u32 passedCount);
static CInt32POINode CopyNodeMinusStartTime(const CInt32POINode& node, static CInt32POINode CopyNodeMinusStartTime(const CInt32POINode& node,
const CCharAnimTime& startTime); const CCharAnimTime& startTime);
}; };

View File

@ -18,36 +18,4 @@ CParticlePOINode CParticlePOINode::CopyNodeMinusStartTime(const CParticlePOINode
return ret; return ret;
} }
u32 CParticlePOINode::_getPOIList(const CCharAnimTime& time,
CParticlePOINode* listOut,
u32 capacity, u32 iterator, u32 unk1,
const std::vector<CParticlePOINode>& stream,
const CCharAnimTime& curTime,
const IAnimSourceInfo& animInfo, u32 passedCount)
{
u32 ret = 0;
if (animInfo.HasPOIData() && stream.size())
{
CCharAnimTime dur = animInfo.GetAnimationDuration();
CCharAnimTime targetTime = curTime + time;
if (targetTime >= dur)
targetTime = dur;
if (passedCount >= stream.size())
return ret;
CCharAnimTime nodeTime = stream[passedCount].GetTime();
while (nodeTime <= targetTime)
{
u32 idx = iterator + ret;
if (idx < capacity)
listOut[idx] = CopyNodeMinusStartTime(stream[passedCount], curTime);
++passedCount;
++ret;
nodeTime = stream[passedCount].GetTime();
}
}
return ret;
}
} }

View File

@ -16,12 +16,6 @@ public:
CParticlePOINode(CInputStream& in); CParticlePOINode(CInputStream& in);
const CParticleData& GetParticleData() const {return x38_data;} const CParticleData& GetParticleData() const {return x38_data;}
static u32 _getPOIList(const CCharAnimTime& time,
CParticlePOINode* listOut,
u32 capacity, u32 iterator, u32 unk1,
const std::vector<CParticlePOINode>& stream,
const CCharAnimTime& curTime,
const IAnimSourceInfo& animInfo, u32 passedCount);
static CParticlePOINode CopyNodeMinusStartTime(const CParticlePOINode& node, static CParticlePOINode CopyNodeMinusStartTime(const CParticlePOINode& node,
const CCharAnimTime& startTime); const CCharAnimTime& startTime);
}; };

View File

@ -32,36 +32,4 @@ CSoundPOINode CSoundPOINode::CopyNodeMinusStartTime(const CSoundPOINode& node,
return ret; return ret;
} }
u32 CSoundPOINode::_getPOIList(const CCharAnimTime& time,
CSoundPOINode* listOut,
u32 capacity, u32 iterator, u32 unk1,
const std::vector<CSoundPOINode>& stream,
const CCharAnimTime& curTime,
const IAnimSourceInfo& animInfo, u32 passedCount)
{
u32 ret = 0;
if (animInfo.HasPOIData() && stream.size())
{
CCharAnimTime dur = animInfo.GetAnimationDuration();
CCharAnimTime targetTime = curTime + time;
if (targetTime >= dur)
targetTime = dur;
if (passedCount >= stream.size())
return ret;
CCharAnimTime nodeTime = stream[passedCount].GetTime();
while (nodeTime <= targetTime)
{
u32 idx = iterator + ret;
if (idx < capacity)
listOut[idx] = CopyNodeMinusStartTime(stream[passedCount], curTime);
++passedCount;
++ret;
nodeTime = stream[passedCount].GetTime();
}
}
return ret;
}
} }

View File

@ -20,12 +20,6 @@ public:
const CCharAnimTime& time, u32 b, bool c, const CCharAnimTime& time, u32 b, bool c,
float d, u32 e, u32 f, u32 sfxId, float falloff, float maxDist); float d, u32 e, u32 f, u32 sfxId, float falloff, float maxDist);
static u32 _getPOIList(const CCharAnimTime& time,
CSoundPOINode* listOut,
u32 capacity, u32 iterator, u32 unk1,
const std::vector<CSoundPOINode>& stream,
const CCharAnimTime& curTime,
const IAnimSourceInfo& animInfo, u32 passedCount);
static CSoundPOINode CopyNodeMinusStartTime(const CSoundPOINode& node, static CSoundPOINode CopyNodeMinusStartTime(const CSoundPOINode& node,
const CCharAnimTime& startTime); const CCharAnimTime& startTime);
}; };