| 1233 | } |
| 1234 | } |
| 1235 | |
| 1236 | void 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 | |
| 1246 | void 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]; |
no test coverage detected