diff --git a/EgtGraphics.rc b/EgtGraphics.rc index 5669e16..5d77cca 100644 Binary files a/EgtGraphics.rc and b/EgtGraphics.rc differ diff --git a/SceneGeom.cpp b/SceneGeom.cpp index ae2d0d8..0a42307 100644 --- a/SceneGeom.cpp +++ b/SceneGeom.cpp @@ -449,9 +449,13 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, const MdStMkCol& siObj) if ( (( nGeoType & GEO_CURVE) != 0 || pUserObj != nullptr) && m_bShowCurveDirection) bShowAux = true ; - // recupero il valore di opacità (solo per le superfici può esserci trasparenza) + // recupero il valore di opacità (solo per le superfici e i solidi può esserci trasparenza) int nAlpha = siObj.colObj.GetIntAlpha() ; + // salto in ogni caso le superfici e i solidi completamente trasparenti + if ( nAlpha == 0 && ( nGeoType & ( GEO_SURF | GEO_VOLUME)) != 0) + return true ; + // se hiddenline e non selezione if ( m_nShowMode == SM_HIDDENLINE && ! m_bSelect) { // in prima passata disegno solo le superfici opache diff --git a/TextureMgr.cpp b/TextureMgr.cpp index cdb1e5e..e86f7e6 100644 --- a/TextureMgr.cpp +++ b/TextureMgr.cpp @@ -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