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

Method _setBaseTexFormat

Engine/source/terrain/terrData.cpp:278–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278bool TerrainBlock::_setBaseTexFormat(void *obj, const char *index, const char *data)
279{
280 TerrainBlock *terrain = static_cast<TerrainBlock*>(obj);
281
282 EngineEnumTable eTable = _baseTexFormat::_sEnumTable;
283
284 for (U8 i = 0; i < eTable.getNumValues(); i++)
285 {
286 if (strcasecmp(eTable[i].mName, data) == 0)
287 {
288 terrain->mBaseTexFormat = (BaseTexFormat)eTable[i].mInt;
289 terrain->_updateMaterials();
290
291 if (terrain->isServerObject()) return false;
292 terrain->_updateLayerTexture();
293 // If the cached base texture is older that the terrain file or
294 // it doesn't exist then generate and cache it.
295 String baseCachePath = terrain->_getBaseTexCacheFileName();
296 if (Platform::compareModifiedTimes(baseCachePath, terrain->mTerrFileName) < 0)
297 terrain->_updateBaseTexture(true);
298 break;
299 }
300 }
301
302 return false;
303}
304
305bool TerrainBlock::_setLightMapSize( void *obj, const char *index, const char *data )
306{

Callers

nothing calls this directly

Calls 6

getNumValuesMethod · 0.80
isServerObjectMethod · 0.80
_updateLayerTextureMethod · 0.80
_updateBaseTextureMethod · 0.80
_updateMaterialsMethod · 0.45

Tested by

no test coverage detected