mirror of https://github.com/axmolengine/axmol.git
fix ci error.
This commit is contained in:
parent
c180c29d32
commit
b94d75e5d6
|
@ -335,6 +335,8 @@ bool Texture2D::updateWithImage(Image* image, backend::PixelFormat format, int i
|
||||||
}
|
}
|
||||||
|
|
||||||
_flagsAndFormatEXT |= formatEXT;
|
_flagsAndFormatEXT |= formatEXT;
|
||||||
|
|
||||||
|
// pitfall: because we do merge etc1 alpha at shader, so must mark as _hasPremultipliedAlpha = true to makesure alpha blend works well.
|
||||||
if (formatEXT == TextureFormatEXT::ETC1_ALPHA)
|
if (formatEXT == TextureFormatEXT::ETC1_ALPHA)
|
||||||
setPremultipliedAlpha(true);
|
setPremultipliedAlpha(true);
|
||||||
|
|
||||||
|
|
|
@ -419,8 +419,7 @@ Texture2D * TextureCache::addImage(const std::string &path)
|
||||||
{
|
{
|
||||||
Image imageAlpha;
|
Image imageAlpha;
|
||||||
if (imageAlpha.initWithImageFile(alphaFullPath))
|
if (imageAlpha.initWithImageFile(alphaFullPath))
|
||||||
{ // pitfall: because we do merge etc1 alpha at shader, so must mark as _hasPremultipliedAlpha=true to makesure alpha blend works well.
|
{
|
||||||
// the Premultiply operation can only do at shader.
|
|
||||||
texture->updateWithImage(&imageAlpha, Texture2D::getDefaultAlphaPixelFormat(), 1, TextureFormatEXT::ETC1_ALPHA);
|
texture->updateWithImage(&imageAlpha, Texture2D::getDefaultAlphaPixelFormat(), 1, TextureFormatEXT::ETC1_ALPHA);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -830,8 +829,11 @@ void VolatileTextureMgr::reloadAllTextures()
|
||||||
reloadTexture(vt->_texture, vt->_fileName, vt->_pixelFormat);
|
reloadTexture(vt->_texture, vt->_fileName, vt->_pixelFormat);
|
||||||
|
|
||||||
// etc1 support check whether alpha texture exists & load it
|
// etc1 support check whether alpha texture exists & load it
|
||||||
auto alphaFile = vt->_fileName + TextureCache::getETC1AlphaFileSuffix();
|
Image image;
|
||||||
reloadTexture(vt->_texture->getAlphaTexture(), alphaFile, vt->_pixelFormat);
|
if (image.initWithImageFile(vt->_fileName + TextureCache::getETC1AlphaFileSuffix()))
|
||||||
|
{
|
||||||
|
vt->_texture->updateWithImage(&image, vt->_pixelFormat, 1, TextureFormatEXT::ETC1_ALPHA);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VolatileTexture::kImageData:
|
case VolatileTexture::kImageData:
|
||||||
|
|
|
@ -226,7 +226,7 @@ public:
|
||||||
*/
|
*/
|
||||||
void apply(int index) const;
|
void apply(int index) const;
|
||||||
|
|
||||||
int getCount() const { return 1; }
|
int getCount() const override { return 1; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setTexParameters();
|
void setTexParameters();
|
||||||
|
|
Loading…
Reference in New Issue