MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / readVariableLength

Function readVariableLength

TheForceEngine/TFE_Asset/gmidAsset.cpp:119–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117 }
118
119 u32 readVariableLength(const u8*& buffer)
120 {
121 u32 value = 0u;
122 for (u32 i = 0; i < 4; i++)
123 {
124 const u8 partial = *buffer;
125 buffer++;
126
127 value = (value << 7u) | (partial & 0x7f);
128 if (!(partial & 0x80)) { break; }
129 }
130 return value;
131 }
132
133 #define CHUNK_ID(c0, c1, c2, c3) ((u32)c0 | ((u32)c1 << 8u) | ((u32)c2 << 16u) | ((u32)c3 << 24u))
134 static const u32 c_MIDI = CHUNK_ID('M', 'I', 'D', 'I');

Callers 1

parseGMidiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected