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

Method _setBaseTexFormat

Engine/source/terrain/terrData.cpp:298–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298bool TerrainBlock::_setBaseTexFormat(void *obj, const char *index, const char *data)
299{
300 TerrainBlock *terrain = static_cast<TerrainBlock*>(obj);
301
302 EngineEnumTable eTable = _baseTexFormat::_sEnumTable;
303
304 for (U8 i = 0; i < eTable.getNumValues(); i++)
305 {
306 if (strcasecmp(eTable[i].mName, data) == 0)
307 {
308 terrain->mBaseTexFormat = (BaseTexFormat)eTable[i].mInt;
309 terrain->_updateMaterials();
310
311 if (terrain->isServerObject()) return false;
312 terrain->_updateLayerTexture();
313 // If the cached base texture is older that the terrain file or
314 // it doesn't exist then generate and cache it.
315 String baseCachePath = terrain->_getBaseTexCacheFileName();
316 if (Platform::compareModifiedTimes(baseCachePath, terrain->mTerrainAsset->getTerrainFilePath()) < 0 && terrain->mUpdateBasetex)
317 terrain->_updateBaseTexture(true);
318 break;
319 }
320 }
321
322 return false;
323}
324
325bool TerrainBlock::_setLightMapSize( void *obj, const char *index, const char *data )
326{

Callers

nothing calls this directly

Calls 8

strcasecmpFunction · 0.85
getNumValuesMethod · 0.80
isServerObjectMethod · 0.80
_updateLayerTextureMethod · 0.80
getTerrainFilePathMethod · 0.80
_updateBaseTextureMethod · 0.80
_updateMaterialsMethod · 0.45

Tested by

no test coverage detected