本文整理汇总了C++中CTexture::getType方法的典型用法代码示例。如果您正苦于以下问题:C++ CTexture::getType方法的具体用法?C++ CTexture::getType怎么用?C++ CTexture::getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTexture
的用法示例。
在下文中一共展示了CTexture::getType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getItemText
/* TextureXListView::getItemText
* Returns the string for [item] at [column]
*******************************************************************/
string TextureXListView::getItemText(long item, long column, long index) const
{
// Check texture list exists
if (!texturex)
return "INVALID INDEX";
// Check index is ok
if (index < 0 || (unsigned)index > texturex->nTextures())
return "INVALID INDEX";
// Get associated texture
CTexture* tex = texturex->getTexture(index);
if (column == 0) // Name column
return tex->getName();
else if (column == 1) // Size column
return S_FMT("%dx%d", tex->getWidth(), tex->getHeight());
else if (column == 2) // Type column
return tex->getType();
else
return "INVALID COLUMN";
}
示例2: buildTexInfoList
/* MapTextureManager::buildTexInfoList
* (Re)builds lists with information about all currently available
* resource textures and flats
*******************************************************************/
void MapTextureManager::buildTexInfoList()
{
// Clear
tex_info.clear();
flat_info.clear();
// --- Textures ---
// Composite textures
vector<TextureResource::tex_res_t> textures;
theResourceManager->getAllTextures(textures, NULL);
for (unsigned a = 0; a < textures.size(); a++)
{
CTexture * tex = textures[a].tex;
Archive* parent = textures[a].parent;
if (tex->isExtended())
{
if (S_CMPNOCASE(tex->getType(), "texture") || S_CMPNOCASE(tex->getType(), "walltexture"))
tex_info.push_back(map_texinfo_t(tex->getName(), TC_TEXTURES, parent));
else if (S_CMPNOCASE(tex->getType(), "define"))
tex_info.push_back(map_texinfo_t(tex->getName(), TC_HIRES, parent));
else if (S_CMPNOCASE(tex->getType(), "flat"))
flat_info.push_back(map_texinfo_t(tex->getName(), TC_TEXTURES, parent));
// Ignore graphics, patches and sprites
}
else
tex_info.push_back(map_texinfo_t(tex->getName(), TC_TEXTUREX, parent, "", tex->getIndex() + 1));
}
// Texture namespace patches (TX_)
if (theGameConfiguration->txTextures())
{
vector<ArchiveEntry*> patches;
theResourceManager->getAllPatchEntries(patches, NULL);
for (unsigned a = 0; a < patches.size(); a++)
{
if (patches[a]->isInNamespace("textures") || patches[a]->isInNamespace("hires"))
{
// Determine texture path if it's in a pk3
string path = patches[a]->getPath();
if (path.StartsWith("/textures/"))
path.Remove(0, 9);
else if (path.StartsWith("/hires/"))
path.Remove(0, 6);
else
path = "";
tex_info.push_back(map_texinfo_t(patches[a]->getName(true), TC_TX, patches[a]->getParent(), path));
}
}
}
// Flats
vector<ArchiveEntry*> flats;
theResourceManager->getAllFlatEntries(flats, NULL);
for (unsigned a = 0; a < flats.size(); a++)
{
ArchiveEntry* entry = flats[a];
// Determine flat path if it's in a pk3
string path = entry->getPath();
if (path.StartsWith("/flats/") || path.StartsWith("/hires/"))
path.Remove(0, 6);
else
path = "";
flat_info.push_back(map_texinfo_t(entry->getName(true), TC_NONE, flats[a]->getParent(), path));
}
}