mirror of https://github.com/axmolengine/axmol.git
Update deps to v29
This commit is contained in:
parent
72eaf595b5
commit
55f96054b7
|
@ -297,8 +297,7 @@ void UserDefault::setStringForKey(const char* pKey, const std::string & value)
|
|||
if ((_realSize + obs.length() + sizeof(udflen_t)) < _curMapSize)
|
||||
{
|
||||
// increase entities count
|
||||
auto count = yasio::endian::ntohv(*(udflen_t*)_rwmmap->data());
|
||||
*(udflen_t*)_rwmmap->data() = yasio::endian::htonv(count + 1);
|
||||
yasio::obstream::swrite_i(_rwmmap->data(), 1 + yasio::ibstream::sread_i<udflen_t>(_rwmmap->data()));
|
||||
|
||||
// append entity
|
||||
::memcpy(_rwmmap->data() + sizeof(udflen_t) + _realSize, obs.data(), obs.length());
|
||||
|
|
|
@ -281,8 +281,8 @@ bool Texture2D::updateWithImage(Image* image, backend::PixelFormat format, int i
|
|||
case PixelFormat::ASTC4:
|
||||
case PixelFormat::ASTC8:
|
||||
renderFormat = imagePixelFormat;
|
||||
default:
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
//override renderFormat, since some render format is not supported by metal
|
||||
switch (renderFormat)
|
||||
|
@ -326,16 +326,14 @@ bool Texture2D::updateWithImage(Image* image, backend::PixelFormat format, int i
|
|||
}
|
||||
else if (image->isCompressed())
|
||||
{
|
||||
#ifndef CC_USE_METAL
|
||||
switch (imagePixelFormat) {
|
||||
case PixelFormat::ETC:
|
||||
case PixelFormat::ASTC4:
|
||||
case PixelFormat::ASTC8:
|
||||
case PixelFormat::ETC:
|
||||
renderFormat = imagePixelFormat;
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (renderFormat != image->getPixelFormat())
|
||||
{
|
||||
CCLOG("cocos2d: WARNING: This image is compressed and we can't convert it for now");
|
||||
|
|
|
@ -140,30 +140,6 @@ namespace
|
|||
return bytesPerRow;
|
||||
}
|
||||
|
||||
std::size_t getBytesPerRowASTC(MTLPixelFormat pixleFormat, std::size_t width)
|
||||
{
|
||||
std::size_t bytesPerRow = 0;
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
|
||||
uint32_t bytesPerBlock = 0;
|
||||
switch (pixleFormat) {
|
||||
case MTLPixelFormatASTC_4x4_sRGB:
|
||||
case MTLPixelFormatASTC_4x4_LDR:
|
||||
case MTLPixelFormatASTC_4x4_HDR:
|
||||
bytesPerBlock = 4;
|
||||
break;
|
||||
case MTLPixelFormatASTC_8x8_sRGB:
|
||||
case MTLPixelFormatASTC_8x8_LDR:
|
||||
case MTLPixelFormatASTC_8x8_HDR:
|
||||
bytesPerBlock = 8;
|
||||
break;
|
||||
default:
|
||||
CCASSERT(false, "Not supported ASTC format!");
|
||||
}
|
||||
bytesPerRow = width * bytesPerBlock;
|
||||
#endif
|
||||
return bytesPerRow;
|
||||
}
|
||||
|
||||
std::size_t getBytesPerRowS3TC(MTLPixelFormat pixleFormat, std::size_t width)
|
||||
{
|
||||
std::size_t bytesPerRow = 0;
|
||||
|
@ -200,10 +176,6 @@ namespace
|
|||
{
|
||||
bytesPerRow = getBytesPerRowETC(pixelFormat, width);
|
||||
}
|
||||
else if (textureFormat == PixelFormat::ASTC4 || textureFormat == PixelFormat::ASTC8)
|
||||
{
|
||||
bytesPerRow = getBytesPerRowASTC(pixelFormat, width);
|
||||
}
|
||||
else if(textureFormat >= PixelFormat::S3TC_DXT1 &&
|
||||
textureFormat <= PixelFormat::S3TC_DXT5)
|
||||
{
|
||||
|
|
|
@ -123,10 +123,6 @@ MTLPixelFormat Utils::toMTLPixelFormat(PixelFormat textureFormat)
|
|||
return MTLPixelFormatPVRTC_RGB_2BPP;
|
||||
case PixelFormat::ETC:
|
||||
return MTLPixelFormatETC2_RGB8;
|
||||
case PixelFormat::ASTC4:
|
||||
return MTLPixelFormatASTC_4x4_LDR;
|
||||
case PixelFormat::ASTC8:
|
||||
return MTLPixelFormatASTC_8x8_LDR;
|
||||
#else
|
||||
case PixelFormat::S3TC_DXT1:
|
||||
return MTLPixelFormatBC1_RGBA;
|
||||
|
|
Loading…
Reference in New Issue