Don't assert since we remove deprecated pixel formats

This commit is contained in:
halx99 2024-04-22 23:07:09 +08:00
parent 6f8e07167b
commit f159250c4e
1 changed files with 1 additions and 7 deletions

View File

@ -84,9 +84,7 @@ void SpriteFrameCachePixelFormatTest::loadSpriteFrames(std::string_view file,
const ssize_t bitsPerKB = 8 * 1024;
const double memorySize = 1.0 * texture->getBitsPerPixelForFormat() * texture->getContentSizeInPixels().width *
texture->getContentSizeInPixels().height / bitsPerKB;
#ifndef AX_USE_METAL
AX_ASSERT(texture->getPixelFormat() == expectedFormat);
#endif
const std::string textureInfo = StringUtils::format("%s%s: %.2f KB\r\n", infoLabel->getString().data(),
texture->getStringForFormat(), memorySize);
infoLabel->setString(textureInfo);
@ -112,7 +110,6 @@ void SpriteFrameCacheLoadMultipleTimes::loadSpriteFrames(std::string_view file,
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(file);
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName("sprite_frames_test/grossini.png");
Texture2D* texture = spriteFrame->getTexture();
AX_ASSERT(texture->getPixelFormat() == expectedFormat);
SpriteFrameCache::getInstance()->removeSpriteFrameByName("sprite_frames_test/grossini.png");
Director::getInstance()->getTextureCache()->removeTexture(texture);
@ -496,9 +493,6 @@ void SpriteFrameCacheJsonAtlasTest::loadSpriteFrames(std::string_view file,
const ssize_t bitsPerKB = 8 * 1024;
const double memorySize = 1.0 * texture->getBitsPerPixelForFormat() * texture->getContentSizeInPixels().width *
texture->getContentSizeInPixels().height / bitsPerKB;
#ifndef AX_USE_METAL
AX_ASSERT(texture->getPixelFormat() == expectedFormat);
#endif
const std::string textureInfo = StringUtils::format("%s%s: %.2f KB\r\n", infoLabel->getString().data(),
texture->getStringForFormat(), memorySize);
infoLabel->setString(textureInfo);