MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / CheckToWriteCompressByte

Function CheckToWriteCompressByte

Descent3/LoadLevel.cpp:2345–2352  ·  view source on GitHub ↗

Given an array of values, checks to see if it would be better to write it out as a raw array or RLE array

Source from the content-addressed store, hash-verified

2343// Given an array of values, checks to see if it would be better to write it out
2344// as a raw array or RLE array
2345void CheckToWriteCompressByte(CFILE *fp, uint8_t *vals, int total) {
2346 int count = WriteCompressionByte(fp, vals, total, 1, COMPRESS);
2347
2348 if (count >= total)
2349 WriteCompressionByte(fp, vals, total, 0, NO_COMPRESS);
2350 else
2351 WriteCompressionByte(fp, vals, total, 0, COMPRESS);
2352}
2353
2354// Given an array of values, checks to see if it would be better to write it out
2355// as a raw array or RLE array

Callers 4

WriteRoomFunction · 0.85
WriteTerrainHeightChunkFunction · 0.85
WriteTerrainTmapChunkFunction · 0.85

Calls 1

WriteCompressionByteFunction · 0.85

Tested by

no test coverage detected