void plLeafController::IPrcParse(const pfPrcTag* tag, plResManager* mgr) { if (tag->getName() == "Parameters") { plString typeStr = tag->getParam("Type", ""); fType = hsKeyFrame::kUnknownKeyFrame; for (size_t i=0; i<=hsKeyFrame::kMatrix44KeyFrame; i++) { if (typeStr == hsKeyFrame::TypeNames[i]) fType = i; } fUruUnknown = tag->getParam("UruUnknown", "0").toUint(); } else if (tag->getName() == "Keys") { AllocKeys(tag->countChildren(), fType); const pfPrcTag* child = tag->getFirstChild(); for (size_t i=0; i<fKeys.getSize(); i++) { fKeys[i]->prcParse(child); child = child->getNextSibling(); } } else if (tag->getName() == "EaseControllers") { AllocControllers(tag->countChildren()); const pfPrcTag* child = tag->getFirstChild(); for (size_t i=0; i<fEaseControllers.getSize(); i++) { fEaseControllers[i]->prcParse(child, mgr); child = child->getNextSibling(); } } else { plCreatable::IPrcParse(tag, mgr); } }
void plLeafController::read(hsStream* S, plResManager* mgr) { if (S->getVer().isUniversal()) { if (ClassIndex() == kLeafController) { fType = S->readByte(); unsigned int numKeys = S->readInt(); AllocKeys(numKeys, fType); for (size_t i=0; i<fKeys.getSize(); i++) fKeys[i]->read(S, fType); } else { unsigned int numControllers = S->readInt(); AllocControllers(numControllers); for (size_t i=0; i<fEaseControllers.getSize(); i++) fEaseControllers[i]->read(S, mgr); IReadUruController(S); } } else if (S->getVer().isUruSP()) { fUruUnknown = S->readInt(); if (fUruUnknown != 0) plDebug::Debug("Found an UruUnknown of %d", fUruUnknown); unsigned int numControllers = S->readInt(); AllocControllers(numControllers); for (size_t i=0; i<fEaseControllers.getSize(); i++) fEaseControllers[i]->read(S, mgr); S->readInt(); IReadUruController(S); } else { fType = S->readByte(); if ((S->getVer().isNewPlasma()) && fType >= hsKeyFrame::kCompressedQuatKeyFrame64) fType++; // Myst V doesn't have hsCompressedQuatKeyFrame64 unsigned int numKeys = S->readInt(); AllocKeys(numKeys, fType); for (size_t i=0; i<fKeys.getSize(); i++) fKeys[i]->read(S, fType); } }
void plLeafController::setEaseControllers(const hsTArray<class plEaseController*>& controllers) { DeallocControllers(); AllocControllers(controllers.getSize()); for (size_t i=0; i<controllers.getSize(); i++) fEaseControllers[i] = controllers[i]; }
void plLeafController::setEaseControllers(const std::vector<class plEaseController*>& controllers) { DeallocControllers(); AllocControllers(controllers.size()); for (size_t i=0; i<controllers.size(); i++) *fEaseControllers[i] = *controllers[i]; }