MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / loadResource

Method loadResource

OgreMain/src/OgreMeshManager2.cpp:154–179  ·  view source on GitHub ↗

-------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

152 }
153 //-------------------------------------------------------------------------
154 void MeshManager::loadResource( Resource *res )
155 {
156 Mesh *mesh = static_cast<Mesh *>( res );
157
158 // Find build parameters
159 V1MeshImportParamsMap::iterator it = mV1MeshImportParams.find( res );
160 if( it == mV1MeshImportParams.end() )
161 {
162 OGRE_EXCEPT( Exception::ERR_ITEM_NOT_FOUND,
163 "Cannot find build parameters for " + res->getName(),
164 "MeshManager::loadResource" );
165 }
166 V1MeshImportParams &params = it->second;
167
168 Ogre::v1::MeshPtr meshV1 =
169 Ogre::v1::MeshManager::getSingleton().getByName( params.name, params.groupName );
170
171 bool unloadV1 =
172 ( meshV1->isReloadable() && meshV1->getLoadingState() == Resource::LOADSTATE_UNLOADED );
173
174 mesh->importV1( meshV1.get(), params.halfPos, params.halfTexCoords, params.qTangents,
175 params.halfPose );
176
177 if( unloadV1 )
178 meshV1->unload();
179 }
180 //-----------------------------------------------------------------------
181 Real MeshManager::getBoundsPaddingFactor() { return mBoundsPaddingFactor; }
182 //-----------------------------------------------------------------------

Callers

nothing calls this directly

Calls 9

isReloadableMethod · 0.80
getLoadingStateMethod · 0.80
importV1Method · 0.80
findMethod · 0.45
endMethod · 0.45
getNameMethod · 0.45
getByNameMethod · 0.45
getMethod · 0.45
unloadMethod · 0.45

Tested by

no test coverage detected