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

Method _load

Engine/source/terrain/terrFile.cpp:332–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332void TerrainFile::_load( FileStream &stream )
333{
334 // NOTE: We read using a loop instad of in one large chunk
335 // because the stream will do endian conversions for us when
336 // reading one type at a time.
337
338 stream.read( &mSize );
339
340 // Load the heightmap.
341 mHeightMap.setSize( mSize * mSize );
342 for ( U32 i=0; i < mHeightMap.size(); i++ )
343 stream.read( &mHeightMap[i] );
344
345 // Load the layer index map.
346 mLayerMap.setSize( mSize * mSize );
347 for ( U32 i=0; i < mLayerMap.size(); i++ )
348 stream.read( &mLayerMap[i] );
349
350 // Get the material name count.
351 U32 materialCount;
352 stream.read( &materialCount );
353 Vector<String> materials;
354 materials.setSize( materialCount );
355
356 // Load the material names.
357 for ( U32 i=0; i < materialCount; i++ )
358 stream.read( &materials[i] );
359
360 // Resolve the TerrainMaterial objects from the names.
361 _resolveMaterials( materials );
362}
363
364void TerrainFile::_loadLegacy( FileStream &stream )
365{

Callers 1

loadMethod · 0.45

Calls 3

readMethod · 0.45
setSizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected