本文整理汇总了C++中ToonzScene::loadLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ ToonzScene::loadLevel方法的具体用法?C++ ToonzScene::loadLevel怎么用?C++ ToonzScene::loadLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToonzScene
的用法示例。
在下文中一共展示了ToonzScene::loadLevel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setLevel
void Vectorizer::setLevel(const TXshSimpleLevelP &level)
{
m_level = level;
//Creo il livello pli
TXshSimpleLevel *sl = m_level.getPointer();
if (!sl)
return;
int rowCount = sl->getFrameCount();
if (rowCount <= 0 || sl->isEmpty())
return;
TXshLevel *xl;
ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene();
// Build the new level name
wstring levelName = sl->getName() + L"v";
{
std::auto_ptr<NameBuilder> nameBuilder(NameBuilder::getBuilder(levelName));
for (;;) {
levelName = nameBuilder->getNext();
if (scene->getLevelSet()->getLevel(levelName) == 0)
break;
}
}
TFilePath dstPath = sl->getPath().withName(levelName).withType("pli");
dstPath = scene->decodeFilePath(dstPath);
bool overWrite = false;
if (TSystem::doesExistFileOrLevel(dstPath)) {
m_dialogShown = true;
std::wstring name = m_dialog->execute(scene, dstPath, true);
if (m_dialog->cancelPressed())
return;
switch (m_dialog->getChoice()) {
case OverwriteDialog::KEEP_OLD: {
xl = scene->getLevelSet()->getLevel(levelName);
if (!xl)
xl = scene->loadLevel(dstPath);
m_vLevel = xl->getSimpleLevel();
return;
}
CASE OverwriteDialog::OVERWRITE : overWrite = true;
DEFAULT:
levelName = name;
}
}
xl = scene->createNewLevel(PLI_XSHLEVEL, levelName);
TXshSimpleLevel *vl = xl->getSimpleLevel();
assert(vl);
if (overWrite) {
vl->setPath(scene->codeFilePath(dstPath));
vl->setName(levelName);
}
TPalette *palette = 0;
if (sl->getType() == TZP_XSHLEVEL)
palette = sl->getPalette();
palette = palette ? palette->clone() : new TPalette;
palette->setPaletteName(vl->getName());
vl->setPalette(palette);
m_vLevel = vl;
}