MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / SetPhase

Method SetPhase

engine/Poseidon/World/Simulation/Animation/Animation.cpp:1235–1269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1233 }
1234}
1235
1236void AnimationAnimatedTexture::Deinit()
1237{
1238 for (int level = 0; level < MAX_LOD_LEVELS; level++)
1239 {
1240 _animTexF[level].Free();
1241 _animTexS[level].Free();
1242 }
1243 AnimationSection::Deinit();
1244}
1245
1246void AnimationAnimatedTexture::SetPhase(LODShape* shape, int level, int phase) const
1247{
1248 PoseidonAssert(phase >= 0);
1249 if (_selection[level] < 0)
1250 {
1251 return;
1252 }
1253 Shape* lShape = shape->Level(level);
1254 PoseidonAssert(lShape);
1255 const NamedSelection& sel = lShape->NamedSel(_selection[level]);
1256 const FaceSelection& faces = sel.FaceOffsets(lShape);
1257 for (int i = 0; i < faces.Size(); i++)
1258 {
1259 Texture* texture = _animTexF[level][i];
1260 if (!texture || phase >= texture->AnimationLength())
1261 {
1262 continue;
1263 }
1264 Poly& face = lShape->Face(faces[i]);
1265 face.SetTexture(texture->GetAnimation(phase));
1266 }
1267 for (int i = 0; i < sel.NSections(); i++)
1268 {
1269 int si = sel.GetSection(i);
1270 ShapeSection& ss = lShape->GetSection(si);
1271
1272 Texture* texture = _animTexS[level][i];

Callers 11

DrawProxiesMethod · 0.45
DrawNVOpticsMethod · 0.45
DrawMethod · 0.45
AnimateMethod · 0.45
DeanimateMethod · 0.45
AnimateMethod · 0.45
AnimateMethod · 0.45
AnimateMethod · 0.45
AnimateMethod · 0.45
AnimateMethod · 0.45
AnimateMethod · 0.45

Calls 7

LevelMethod · 0.80
AnimationLengthMethod · 0.80
SizeMethod · 0.45
SetTextureMethod · 0.45
GetAnimationMethod · 0.45
NSectionsMethod · 0.45
GetSectionMethod · 0.45

Tested by

no test coverage detected