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

Method writeChunkEnd

OgreMain/src/OgreStreamSerialiser.cpp:374–397  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

372 }
373 //---------------------------------------------------------------------
374 void StreamSerialiser::writeChunkEnd(uint32 id)
375 {
376 checkStream(false, false, true);
377
378 Chunk* c = popChunk(id);
379
380 // update the sizes
381 size_t currPos = mStream->tell();
382 c->length = static_cast<uint32>(currPos - c->offset - CHUNK_HEADER_SIZE);
383
384 // seek to 'length' position in stream for this chunk
385 // skip id (32) and version (16)
386 mStream->seek(c->offset + sizeof(uint32) + sizeof(uint16));
387 write(&c->length);
388 // write updated checksum
389 uint32 checksum = calculateChecksum(c);
390 write(&checksum);
391
392 // seek back to previous position
393 mStream->seek(currPos);
394
395 OGRE_DELETE c;
396
397 }
398 //---------------------------------------------------------------------
399 size_t StreamSerialiser::getOffsetFromChunkStart() const
400 {

Callers 14

serializeMethod · 0.80
saveMethod · 0.80
saveMethod · 0.80
saveMethod · 0.80
saveMethod · 0.80
saveMethod · 0.80
saveMethod · 0.80
saveLodDataMethod · 0.80
saveMethod · 0.80
writeLayerDeclarationMethod · 0.80
saveGroupDefinitionMethod · 0.80

Calls 3

writeFunction · 0.50
tellMethod · 0.45
seekMethod · 0.45

Tested by 1

TESTFunction · 0.64