| 228 | } |
| 229 | |
| 230 | void EntityType::InitShape() |
| 231 | { |
| 232 | if (!_shape) |
| 233 | return; |
| 234 | |
| 235 | const ParamEntry* array = _par->FindEntry("animateTextures"); |
| 236 | if (array) |
| 237 | { |
| 238 | int n = array->GetSize() / 2, index = 0; |
| 239 | _animateTextures.Realloc(n); |
| 240 | _animateTextures.Resize(n); |
| 241 | for (int i = 0; i < n; i++) |
| 242 | { |
| 243 | RString name = (*array)[index++]; |
| 244 | _animateTextures[i].animation.Init(_shape, name, nullptr); |
| 245 | float animTime = (*array)[index++]; |
| 246 | _animateTextures[i].animSpeed = animTime > 0 ? 1.0f / animTime : 0; |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | array = _par->FindEntry("Animations"); |
| 251 | if (array) |
| 252 | { |
| 253 | int n = array->GetEntryCount(); |
| 254 | _animations.Realloc(n); |
| 255 | _animations.Resize(n); |
| 256 | for (int i = 0; i < n; i++) |
| 257 | { |
| 258 | _animations[i] = AnimationType::CreateObject(array->GetEntry(i), _shape); |
| 259 | } |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | void EntityType::DeinitShape() {} |
| 264 |
no test coverage detected