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

Function CheckToWriteCompressShort

Descent3/LoadLevel.cpp:2356–2363  ·  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

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
2356void CheckToWriteCompressShort(CFILE *fp, uint16_t *vals, int total) {
2357 int count = WriteCompressionShort(fp, vals, total, 1, COMPRESS);
2358
2359 if (count >= total)
2360 WriteCompressionShort(fp, vals, total, 0, NO_COMPRESS);
2361 else
2362 WriteCompressionShort(fp, vals, total, 0, COMPRESS);
2363}
2364
2365void ReadCompressionByte(CFILE *fp, uint8_t *vals, int total) {
2366 int count = 0;

Callers 2

WriteTerrainTmapChunkFunction · 0.85
WriteLightmapChunkFunction · 0.85

Calls 1

WriteCompressionShortFunction · 0.85

Tested by

no test coverage detected