本文整理汇总了C++中MEngine::getImageSaver方法的典型用法代码示例。如果您正苦于以下问题:C++ MEngine::getImageSaver方法的具体用法?C++ MEngine::getImageSaver怎么用?C++ MEngine::getImageSaver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MEngine
的用法示例。
在下文中一共展示了MEngine::getImageSaver方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Save
void Atlas::Save()
{
MEngine* engine = MEngine::getInstance();
std::string imgName = (std::string("atlases/") + m_Name + ".png");
engine->getImageSaver()->loadData(imgName.c_str(), &m_Atlas);
if(m_ConfigFile)
{
m_ConfigFile->Write("atlas.filename", imgName);
m_ConfigFile->Write("atlas.images", m_Images.size());
int i = 0;
for(imageMapIter iImage = m_Images.begin(); iImage != m_Images.end(); iImage++)
{
std::string root = "atlas.image";
char num[32];
snprintf(num, 32, "%d.", i);
root += num;
++i;
m_ConfigFile->Write((root + "name").c_str(), iImage->first);
m_ConfigFile->Write((root + "pos").c_str(), iImage->second.uv);
m_ConfigFile->Write((root + "w").c_str(), iImage->second.width);
m_ConfigFile->Write((root + "h").c_str(), iImage->second.height);
}
m_ConfigFile->Save();
}
}
示例2: ScriptAtlasImageWrite
int ScriptAtlasImageWrite()
{
MEngine* engine = MEngine::getInstance();
MScriptContext* script = engine->getScriptContext();
MImage* image = (MImage*)script->getPointer(0);
const char* file = script->getString(1);
engine->getImageSaver()->loadData(file, image);
return 0;
}