TerrainMng.cpp
In CTerrainMng::CTerrainMng replace
byCode:ZeroMemory( m_aTerrain, sizeof( m_aTerrain ) );//* MAX_TERRAIN );
In CTerrainMng::DeleteDeviceObjects replaceCode:#ifdef __TERRAIN_TEXFIX m_aTerrain.clear(); #else // __TERRAIN_TEXFIX ZeroMemory( m_aTerrain, sizeof( m_aTerrain ) );//* MAX_TERRAIN ); #endif // __TERRAIN_TEXFIX
byCode:for( int i = 0; i < MAX_TERRAIN; i++ ) { if( m_aTerrain[i].m_pTexture ) SAFE_RELEASE( m_aTerrain[i].m_pTexture ); }
TerrainMng.h:Code:#ifdef __TERRAIN_TEXFIX for( map<DWORD, TERRAIN>::iterator it = m_aTerrain.begin(); it != m_aTerrain.end(); ++it ) { if(it->second.m_pTexture) SAFE_RELEASE( it->second.m_pTexture ); } #else // __TERRAIN_TEXFIX for( int i = 0; i < MAX_TERRAIN; i++ ) { if( m_aTerrain[i].m_pTexture ) SAFE_RELEASE( m_aTerrain[i].m_pTexture ); } #endif // __TERRAIN_TEXFIX
Replace
byCode:TERRAIN m_aTerrain[MAX_TERRAIN];
Code:#ifdef __TERRAIN_TEXFIX map<DWORD, TERRAIN> m_aTerrain; #else // __TERRAIN_TEXFIX TERRAIN m_aTerrain[MAX_TERRAIN]; #endif // __TERRAIN_TEXFIX
~ Enjoy.



Reply With Quote

