---------------------------------------------------------------------
| 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 | { |
nothing calls this directly
no test coverage detected