MCPcopy Create free account
hub / github.com/OGRECave/ogre / writeLayerDeclaration

Method writeLayerDeclaration

Components/Terrain/src/OgreTerrain.cpp:462–481  ·  view source on GitHub ↗

---------------------------------------------------------------------

Source from the content-addressed store, hash-verified

460 }
461 //---------------------------------------------------------------------
462 void Terrain::writeLayerDeclaration(const TerrainLayerDeclaration& decl, StreamSerialiser& stream)
463 {
464 // Layer declaration
465 stream.writeChunkBegin(TERRAINLAYERDECLARATION_CHUNK_ID, TERRAINLAYERDECLARATION_CHUNK_VERSION);
466 // samplers
467 uint8 numSamplers = (uint8)decl.size();
468 stream.write(&numSamplers);
469 for (const auto & sampler : decl)
470 {
471 stream.writeChunkBegin(TERRAINLAYERSAMPLER_CHUNK_ID, TERRAINLAYERSAMPLER_CHUNK_VERSION);
472 stream.write(&sampler.alias);
473 uint8 pixFmt = (uint8)sampler.format;
474 stream.write(&pixFmt);
475 stream.writeChunkEnd(TERRAINLAYERSAMPLER_CHUNK_ID);
476 }
477 // elements
478 uint8 numElems = 0;
479 stream.write(&numElems);
480 stream.writeChunkEnd(TERRAINLAYERDECLARATION_CHUNK_ID);
481 }
482 //---------------------------------------------------------------------
483 bool Terrain::readLayerDeclaration(StreamSerialiser& stream, TerrainLayerDeclaration& targetdecl)
484 {

Callers

nothing calls this directly

Calls 4

writeChunkBeginMethod · 0.80
writeChunkEndMethod · 0.80
sizeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected