INNER CODE UNIT · C++
dst
TheAssemblyArmada/Vanilla-Conquer · common/auduncmp.cpp:24
unsigned char* dst = (unsigned char*)(dest);
unsigned short remaining = size;
while (remaining > 0) { // expecting more output
shifted = *src++;
shifted <<= 2;
code = (shifted & 0xFF00) >> 8;
count = (shifted & 0x00FF) >> 2;
switch (code) {
case 2: // no compression...
if (count & 0x20) {
count <<= 3; // here it's significant that (count) is signed:
sample += count >> 3; // the sign bit will be copied by these shifts!
*dst++ = clamp(sample, 0, 255);
remaining--; // one byte added to output
} else {
for (++count; count > 0; --count) {