| 408 | } |
| 409 | |
| 410 | bool ParticleSystem::initWithFile(std::string_view plistFile) |
| 411 | { |
| 412 | bool ret = false; |
| 413 | _plistFile = FileUtils::getInstance()->fullPathForFilename(plistFile); |
| 414 | ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(_plistFile); |
| 415 | |
| 416 | AXASSERT(!dict.empty(), "Particles: file not found"); |
| 417 | |
| 418 | // FIXME: compute path from a path, should define a function somewhere to do it |
| 419 | auto listFilePath = plistFile; |
| 420 | if (listFilePath.find('/') != string::npos) |
| 421 | { |
| 422 | listFilePath = listFilePath.substr(0, listFilePath.rfind('/') + 1); |
| 423 | ret = this->initWithDictionary(dict, listFilePath); |
| 424 | } |
| 425 | else |
| 426 | { |
| 427 | ret = this->initWithDictionary(dict, ""); |
| 428 | } |
| 429 | |
| 430 | return ret; |
| 431 | } |
| 432 | |
| 433 | bool ParticleSystem::initWithDictionary(const ValueMap& dictionary) |
| 434 | { |
no test coverage detected