MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _setLightMapSize

Method _setLightMapSize

Engine/source/terrain/terrData.cpp:325–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323}
324
325bool 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
347bool TerrainBlock::setFile( const FileName &terrFileName )
348{

Callers

nothing calls this directly

Calls 6

dAtoiFunction · 0.85
mClampFunction · 0.85
getNextPow2Function · 0.85
queryProfileMethod · 0.80
getCardProfilerMethod · 0.80
setMaskBitsMethod · 0.45

Tested by

no test coverage detected