本文整理汇总了C++中CAImage::retainCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CAImage::retainCount方法的具体用法?C++ CAImage::retainCount怎么用?C++ CAImage::retainCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAImage
的用法示例。
在下文中一共展示了CAImage::retainCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dumpCachedImageInfo
void CAImageCache::dumpCachedImageInfo()
{
unsigned int count = 0;
unsigned int totalBytes = 0;
CAMap<std::string, CAImage*>::iterator itr;
for (itr=m_mImages.begin(); itr!=m_mImages.end(); itr++)
{
CAImage* image = itr->second;
unsigned int bpp = image->bitsPerPixelForFormat();
// Each texture takes up width * height * bytesPerPixel bytes.
unsigned int bytes = image->getPixelsWide() * image->getPixelsHigh() * bpp / 8;
totalBytes += bytes;
count++;
CCLog("CrossApp: \"%s\" rc=%lu id=%lu %lu x %lu @ %ld bpp => %lu KB",
itr->first.c_str(),
(long)image->retainCount(),
(long)image->getName(),
(long)image->getPixelsWide(),
(long)image->getPixelsHigh(),
(long)bpp,
(long)bytes / 1024);
}
CCLog("CrossApp: CAImageCache dumpDebugInfo: %ld images, for %lu KB (%.2f MB)", (long)count, (long)totalBytes / 1024, totalBytes / (1024.0f*1024.0f));
}