void CRole::setSet(const unsigned char* charSet) { setClass(charSet[CS_CLASS]); // ---- setSkeleton(); // ---- setEquip(ET_HELM, GET_CHAR_H(charSet[3])); setEquip(ET_ARMOR, GET_CHAR_L(charSet[3])); setEquip(ET_GLOVE, GET_CHAR_H(charSet[4])); setEquip(ET_PANT, GET_CHAR_L(charSet[4])); setEquip(ET_BOOT, GET_CHAR_H(charSet[5])); setEquip(ET_BACK, GET_CHAR_L(charSet[5])); setEquip(ET_RIGHT, charSet[1]); setEquip(ET_LEFT, charSet[2]); }
void CSkelModel::load(const std::string &n, CVirtualFS *vfs){ setName(n); CFileText f(n); vfs->readFile(f); string buffer = (char*)f.getData(); CTokenizerNoComments tokenizer(buffer); string path; bool skeletonLoaded = false; while(tokenizer.nextToken()){ const string key = tokenizer.lowerCase(tokenizer.getToken()); tokenizer.nextToken(); const string value = tokenizer.getToken(); if(key == "path"){ path = value; if(path[path.size()-1] != '/') path += '/'; } else if(key == "skeleton"){ setSkeleton(mManager->registerSkeleton(path + value)); skeletonLoaded = true; } else if(key == "mesh"){ if(!skeletonLoaded) throw CException("Failed because no skeleton active"); addMesh(mManager->registerMesh(path + value)); } else if(key == "animation"){ if(!skeletonLoaded) throw CException("Failed because no skeleton active"); tokenizer.nextToken(); string alias = tokenizer.getToken(); if (alias == "-"){ alias = value; } addSkelAnimation(mManager->registerSkelAnimation(path + value), alias); } else if(key == "material"){ mMeshes.back()->addShader(CEngine::getSingleton()->mMaterials.registerMaterial(path + value)); //addShader(mManager->registerShader(path + value)); } } CResource::load(); // Mark us loaded }
MotionFilterNone::MotionFilterNone(Skeleton* skeleton) : MotionFilterBase() { setSkeleton(skeleton); }