标签:des style blog io ar color sp for on
1 //-------------------------------------------------------------- 2 // Name: CIMAGE::LoadUncompressedTGA - private 3 // Description: Load an uncompressed targa (TGA) 4 // Arguments: None 5 // Return Value: A boolean variable: -true: TGA was loaded 6 // -false: TGA was not loaded 7 //-------------------------------------------------------------- 8 bool CIMAGE::LoadUncompressedTGA( void ) 9 { 10 ........ 11 .... 12 pTGAinfo.m_uiBytesPerPixel= m_uiBPP/8; 13 pTGAinfo.m_uiImageSize = ( pTGAinfo.m_uiBytesPerPixel*m_uiWidth*m_uiHeight ); 14 15 //copy the image data 16 memcpy( m_ucpData, ucpFile, pTGAinfo.m_uiImageSize ); 17 18 //byte swapping ( optimized by Steve Thomas ) 19 for( uiCSwap=0; uiCSwap<( int )pTGAinfo.m_uiImageSize; uiCSwap+=pTGAinfo.m_uiBytesPerPixel ) 20 { 21 m_ucpData[uiCSwap]^= m_ucpData[uiCSwap+2]^=m_ucpData[uiCSwap]^= m_ucpData[uiCSwap+2]; 22 } 23 24 //the uncompressed TGA has been successfully loaded 25 return true; 26 }
《Focus On 3D Terrain Programming》中一段代码的注释三
标签:des style blog io ar color sp for on
原文地址:http://www.cnblogs.com/QQ122252656/p/4161897.html