by Anthony Rosenbaum · in Torque Game Engine · 01/03/2005 (12:55 pm) · 1 replies
void EditInteriorResource::dumpLightmaps( const char* OutPath ) { if ( mDetailLevels.size() < 1 || !mDetailLevels[0] ) { return; } Interior* Detail = mDetailLevels[0]; U32 minCnt = 0; for(U32 j = 0; j < Detail->mLightmaps.size(); j++) { if( Detail->mLightmaps[j] ) { FileStream output; output.open( avar("%s\lightmap_%d.png", OutPath, minCnt++), FileStream::Write ); Detail->mLightmaps[j]->writePNG( output ); } } }
Associate Tom Spilman
Sickhead Games
void EditInteriorResource::dumpLightmaps( const char* OutPath ) { if ( mDetailLevels.size() < 1 || !mDetailLevels[0] ) { return; } Interior* Detail = mDetailLevels[0]; U32 minCnt = 0; for(U32 j = 0; j < Detail->mLightmaps.size(); j++) { if( Detail->mLightmaps[j] ) { FileStream output; output.open( avar("%s\lightmap_%d.png", OutPath, minCnt++), FileStream::Write ); Detail->mLightmaps[j]->writePNG( output ); } } }You just need to call this code somewhere near the end of main before gWorkingResource gets deleted.
I did this in the TSE version of map2dif, but i think it should work for TGE too.