本文整理汇总了C++中Archive::addEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ Archive::addEntry方法的具体用法?C++ Archive::addEntry怎么用?C++ Archive::addEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Archive
的用法示例。
在下文中一共展示了Archive::addEntry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exportTexture
/* TextureXPanel::exportTexture
* Create standalone image entries of any selected textures
*******************************************************************/
void TextureXPanel::exportTexture()
{
// Get selected textures
vector<long> selec_num = list_textures->getSelection();
vector<CTexture*> selection;
if (!tx_entry) return;
//saveTEXTUREX();
Archive* archive = tx_entry->getParent();
bool force_rgba = texture_editor->getBlendRGBA();
// Go through selection
for (unsigned a = 0; a < selec_num.size(); ++a)
{
selection.push_back(texturex.getTexture(selec_num[a]));
}
// Create gfx conversion dialog
GfxConvDialog gcd(this);
// Send selection to the gcd
gcd.openTextures(selection, texture_editor->getPalette(), archive, force_rgba);
// Run the gcd
gcd.ShowModal();
// Show splash window
theSplashWindow->show("Writing converted image data...", true);
// Write any changes
for (unsigned a = 0; a < selection.size(); a++)
{
// Update splash window
theSplashWindow->setProgressMessage(selection[a]->getName());
theSplashWindow->setProgress((float)a / (float)selection.size());
// Skip if the image wasn't converted
if (!gcd.itemModified(a))
continue;
// Get image and conversion info
SImage* image = gcd.getItemImage(a);
SIFormat* format = gcd.getItemFormat(a);
// Write converted image back to entry
MemChunk mc;
format->saveImage(*image, mc, force_rgba ? NULL : gcd.getItemPalette(a));
ArchiveEntry* lump = new ArchiveEntry;
lump->importMemChunk(mc);
lump->rename(selection[a]->getName());
archive->addEntry(lump, "textures");
EntryType::detectEntryType(lump);
lump->setExtensionByType();
}
// Hide splash window
theSplashWindow->hide();
}
示例2: createEntry
bool createEntry()
{
// Get parent dir
ArchiveTreeNode* dir = archive->getDir(path);
if (dir)
{
archive->addEntry(entry_copy, index, dir, true);
return true;
}
else
return false;
}