TerrainMng.cpp在 CTerrainMng::CTerrainMng 替换代码:
[pre] ZeroMemory( m_aTerrain, sizeof( m_aTerrain ) );//* MAX_TERRAIN );[/pre]
通过代码:
[pre]#ifdef __TERRAIN_TEXFIX
1 m1 Y: I% H1 V" `1 |- L7 V2 p m_aTerrain.clear();#else // __TERRAIN_TEXFIX ZeroMemory( m_aTerrain, sizeof( m_aTerrain ) );//* MAX_TERRAIN );#endif // __TERRAIN_TEXFIX[/pre]
In CTerrainMng::DeleteDeviceObjects
取代代码::
[pre] for( int i = 0; i < MAX_TERRAIN; i++ )
4 x) Y6 i; W1 ^% X1 [ { if( m_aTerrain
.m_pTexture ) SAFE_RELEASE( m_aTerrain.m_pTexture ); }[/pre]
通过
代码:
[pre]#ifdef __TERRAIN_TEXFIX for( map<DWORD, TERRAIN>::iterator it = m_aTerrain.begin(); it != m_aTerrain.end(); ++it ) {: B# z5 f% ~7 j4 T% Y7 i4 B+ b& a if(it->second.m_pTexture) SAFE_RELEASE( it->second.m_pTexture );: f6 r# u! h6 d; E: d }1 E# t# r% ~7 o# Y; U. Z. R) O" q" ^#else // __TERRAIN_TEXFIX for( int i = 0; i < MAX_TERRAIN; i++ )4 Z# K' c- J0 } { if( m_aTerrain.m_pTexture )0 |1 N' |7 S. E3 i SAFE_RELEASE( m_aTerrain.m_pTexture ); }#endif // __TERRAIN_TEXFIX[/pre]TerrainMng.h:
替换
代码:
[pre] TERRAIN m_aTerrain[MAX_TERRAIN];[/pre]
通过
代码:
[pre]#ifdef __TERRAIN_TEXFIX map<DWORD, TERRAIN> m_aTerrain;#else // __TERRAIN_TEXFIX TERRAIN m_aTerrain[MAX_TERRAIN];1 g9 b5 B( S% x#endif // __TERRAIN_TEXFIX[/pre]
中华游戏网 cnyouw.cn
图片:logo_副本.png