EgtGraphics 1.8i2 :

- corretta gestione trasparenza 0 (superfici e solidi completamente trasparenti).
This commit is contained in:
Dario Sassi
2017-09-25 07:07:38 +00:00
parent ed80637dad
commit 4515deb8f9
3 changed files with 15 additions and 2 deletions
+10 -1
View File
@@ -83,7 +83,7 @@ TextureMgr::LoadTexture( const string& sName, const string& sFile,
return false ;
// se necessario, converto l'immagine a 32 bit per pixel (BGRA)
int bitsPerPixel = FreeImage_GetBPP( pDib) ;
int bitsPerPixel = FreeImage_GetBPP( pDib) ;
if ( bitsPerPixel != 32) {
FIBITMAP* pTmpDib = pDib ;
pDib = FreeImage_ConvertTo32Bits( pTmpDib) ;
@@ -384,6 +384,15 @@ TextureMgr::TestImageWithOpenGL( FIBITMAP*& pDib)
FreeImage_Unload( pTmpDib) ;
nWidth = nNewW ;
nHeight = nNewH ;
// verifico che la nuova immagine sia valida
if ( pDib == nullptr)
return false ;
if ( FreeImage_GetBits( pDib) == nullptr ||
FreeImage_GetWidth( pDib) != nWidth || FreeImage_GetHeight( pDib) != nHeight) {
FreeImage_Unload( pDib) ;
pDib = nullptr ;
return false ;
}
}
// verifico sia caricabile da OpenGL corrente