本文整理汇总了C++中MEngine::getLevelLoader方法的典型用法代码示例。如果您正苦于以下问题:C++ MEngine::getLevelLoader方法的具体用法?C++ MEngine::getLevelLoader怎么用?C++ MEngine::getLevelLoader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MEngine
的用法示例。
在下文中一共展示了MEngine::getLevelLoader方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: start
void MaratisPlayer::start(void)
{
// MEngine
{
MEngine * engine = MEngine::getInstance();
// package manager
engine->setPackageManager(m_packageManager);
m_packageManager->init();
// contexts
engine->setSoundContext(m_soundContext); // sound context
engine->setRenderingContext(m_render); // rendering context
engine->setPhysicsContext(m_physics); // physics context
engine->setScriptContext(m_script); // script context
engine->setInputContext(m_input); // input context
engine->setSystemContext(m_system); // system context
// loaders
engine->getImageLoader()->addLoader(M_loadImage); // image loader
engine->getSoundLoader()->addLoader(M_loadSound); // sound loader
engine->getLevelLoader()->addLoader(xmlLevelLoad); // level loader
engine->getFontLoader()->addLoader(M_loadFont); // font loader
engine->getFontLoader()->addLoader(M_loadBinFont); // bin font loader
// add behaviors
engine->getBehaviorManager()->addBehavior(MBLookAt::getStaticName(), M_OBJECT3D_CAMERA, MBLookAt::getNew);
engine->getBehaviorManager()->addBehavior(MBFollow::getStaticName(), M_OBJECT3D, MBFollow::getNew);
// add renderers
engine->getRendererManager()->addRenderer(MStandardRenderer::getStaticName(), MStandardRenderer::getNew);
engine->getRendererManager()->addRenderer(MFixedRenderer::getStaticName(), MFixedRenderer::getNew);
// mesh loader
engine->getMeshLoader()->addLoader(xmlMeshLoad);
engine->getMeshLoader()->addLoader(M_loadBinMesh);
engine->getArmatureAnimLoader()->addLoader(xmlArmatureAnimLoad);
engine->getArmatureAnimLoader()->addLoader(M_loadBinArmatureAnim);
engine->getTexturesAnimLoader()->addLoader(xmlTextureAnimLoad);
engine->getTexturesAnimLoader()->addLoader(M_loadBinTexturesAnim);
engine->getMaterialsAnimLoader()->addLoader(xmlMaterialAnimLoad);
engine->getMaterialsAnimLoader()->addLoader(M_loadBinMaterialsAnim);
// level
engine->setLevel(m_level);
// game
engine->setGame(m_game);
// set default renderer (standard)
if(m_renderer == NULL)
m_renderer = new MStandardRenderer();
engine->setRenderer(m_renderer);
engine->setSaveFileFactory(MSaveFileImpl::getNew);
}
}
示例2: clear
void MaratisPlayer::clear(void)
{
MEngine * engine = MEngine::getInstance();
// level
m_level->clear();
if(m_renderer){
m_renderer->destroy();
m_renderer = NULL;
}
// plugins
SAFE_DELETE(m_gamePlugin);
unsigned int i;
unsigned int pSize = m_plugins.size();
for(i=0; i<pSize; i++)
SAFE_DELETE(m_plugins[i]);
m_plugins.clear();
// MEngine
{
// loaders
engine->getImageLoader()->clear();
engine->getSoundLoader()->clear();
engine->getLevelLoader()->clear();
engine->getFontLoader()->clear();
engine->getFontLoader()->clear();
// behaviors
engine->getBehaviorManager()->clear();
// renderer
engine->getRendererManager()->clear();
// mesh loader
engine->getMeshLoader()->clear();
engine->getArmatureAnimLoader()->clear();
engine->getTexturesAnimLoader()->clear();
engine->getMaterialsAnimLoader()->clear();
}
}