MCPcopy Create free account
hub / github.com/JRickey/BattleShip / parse_bitmap

Function parse_bitmap

port/android_torch_bridge.cpp:218–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218static bool parse_bitmap(const std::vector<uint8_t> &file_data, uint32_t bm_off,
219 ParsedBitmap &bm) {
220 if (bm_off + kBitmapSize > file_data.size()) {
221 return false;
222 }
223 const uint8_t *d = file_data.data() + bm_off;
224 bm.width = read_be_s16(d + 0x00);
225 bm.actual_height = read_be_s16(d + 0x0C);
226 bm.buf_off = resolve_reloc_ptr(file_data, bm_off + 0x08);
227 return bm.buf_off != UINT32_MAX;
228}
229
230static void unswizzle_rgba16_strip(std::vector<uint8_t> &strip, int width, int height) {
231 const int row_bytes = width * 2;

Callers 1

derive_stage_assetFunction · 0.70

Calls 2

read_be_s16Function · 0.70
resolve_reloc_ptrFunction · 0.70

Tested by

no test coverage detected