CLODSkinnedMesh::CLODSkinnedMesh(const std::string &filename, Resource::Mapping &materials, Resource::Mapping &textures, Resource::Mapping &skeletons, Resource::Mapping &joints, Resource::Mapping &animations) : filename(filename), materials(materials), textures(textures), skeletons(skeletons) { setLoadState(Discovered); }
void LLAudioData::updateLoadState() { if(mLoadState == STATE_LOAD_REQ_DECODE && gAudioDecodeMgrp) { if( gAudioDecodeMgrp->addDecodeRequest(getID()) ) { setLoadState(STATE_LOAD_DECODING); LL_DEBUGS("AudioEngine") << "Decoding asset data for: " << getID() << LL_ENDL; } else { setLoadState(STATE_LOAD_ERROR); } } else if(mLoadState == STATE_LOAD_REQ_FETCH && gAssetStorage && gAssetStorage->isUpstreamOK()) { LL_DEBUGS("AudioEngine") << "Fetching asset data for: " << getID() << LL_ENDL; setLoadState(STATE_LOAD_FETCHING); gAssetStorage->getAssetData(getID(), LLAssetType::AT_SOUND, LLAudioEngine::assetCallback, NULL); } }
bool CLODSkinnedMesh::unload() { if(getLoadState() == Discovered) return false; delete geometry; delete tmpGeometry; uninitializedDelete(vertexSplits, numVertexSplits); delete boundingVolume; setLoadState(Discovered); return true; }
bool CLODSkinnedMesh::load() { if(getLoadState() != Discovered) return false; InitInfo initInfo = CLODSMF::loadFromFile(filename.c_str(), materials, textures, skeletons); skeleton = initInfo.skeleton; boundingVolume = initInfo.boundingVolume; geometry = new GenericGeometry<SkinVertex>(initInfo.geometry, true); tmpGeometry = new GenericGeometry<SkinVertex>(initInfo.geometry); isCached = false; lastVertexSplits = 0; numVertexSplits = initInfo.vertexSplits.size(); vertexSplits = uninitializedAlloc<VSplit>(initInfo.vertexSplits.size()); for(int i = 0; i < initInfo.vertexSplits.size(); i++) new(&vertexSplits[i]) VSplit(initInfo.vertexSplits[i]); setLoadState(Loaded); return true; }