| 282 | } |
| 283 | |
| 284 | u32 CParticleManager::LoadActions(int alist_id, IReader& R, bool copFormat) |
| 285 | { |
| 286 | // Execute the specified action list. |
| 287 | ParticleActions* pa = GetActionListPtr(alist_id); |
| 288 | VERIFY(pa); |
| 289 | |
| 290 | std::scoped_lock m{pa->m_bLocked}; |
| 291 | |
| 292 | pa->clear(); |
| 293 | if (R.length()) |
| 294 | { |
| 295 | u32 cnt = R.r_u32(); |
| 296 | for (u32 k = 0; k < cnt; k++) |
| 297 | { |
| 298 | u32 type = R.r_u32(); |
| 299 | if (type == (u32)-1) |
| 300 | continue; |
| 301 | |
| 302 | ParticleAction* act = CreateAction((PActionEnum)type); |
| 303 | act->m_copFormat = copFormat; |
| 304 | act->Load(R); |
| 305 | pa->append(act); |
| 306 | } |
| 307 | } |
| 308 | return pa->size(); |
| 309 | } |