| 323 | } |
| 324 | |
| 325 | bool TerrainBlock::_setLightMapSize( void *obj, const char *index, const char *data ) |
| 326 | { |
| 327 | TerrainBlock *terrain = static_cast<TerrainBlock*>(obj); |
| 328 | |
| 329 | // Handle inspector value decrements correctly |
| 330 | U32 mapSize = dAtoi( data ); |
| 331 | if ( mapSize == terrain->mLightMapSize-1 ) |
| 332 | mapSize = terrain->mLightMapSize/2; |
| 333 | |
| 334 | // Limit the lightmap size, and ensure it is a power of 2 |
| 335 | const U32 maxTextureSize = GFX->getCardProfiler()->queryProfile( "maxTextureSize", 1024 ); |
| 336 | mapSize = mClamp( getNextPow2( mapSize ), 0, maxTextureSize ); |
| 337 | |
| 338 | if ( terrain->mLightMapSize != mapSize ) |
| 339 | { |
| 340 | terrain->mLightMapSize = mapSize; |
| 341 | terrain->setMaskBits( MaterialMask ); |
| 342 | } |
| 343 | |
| 344 | return false; |
| 345 | } |
| 346 | |
| 347 | bool TerrainBlock::setFile( const FileName &terrFileName ) |
| 348 | { |
nothing calls this directly
no test coverage detected