| 242 | bool motions_container::has(shared_str key) { return (container.find(key) != container.end()); } |
| 243 | |
| 244 | motions_value* motions_container::dock(shared_str key, IReader* data, vecBones* bones) |
| 245 | { |
| 246 | motions_value* result = nullptr; |
| 247 | auto I = container.find(key); |
| 248 | if (I != container.end()) |
| 249 | result = I->second; |
| 250 | if (nullptr == result) |
| 251 | { |
| 252 | // loading motions |
| 253 | VERIFY(data); |
| 254 | result = xr_new<motions_value>(); |
| 255 | result->m_dwReference = 0; |
| 256 | BOOL bres = result->load(key.c_str(), data, bones); |
| 257 | if (bres) |
| 258 | container.emplace(key, result); |
| 259 | else |
| 260 | xr_delete(result); |
| 261 | } |
| 262 | return result; |
| 263 | } |
| 264 | void motions_container::clean(bool force_destroy) |
| 265 | { |
| 266 | auto it = container.begin(); |