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

Function bm_pixel_transparent

bitmap/bitmain.cpp:1355–1369  ·  view source on GitHub ↗

a function to determine if a pixel in a bitmap is transparent

Source from the content-addressed store, hash-verified

1353}
1354// a function to determine if a pixel in a bitmap is transparent
1355bool bm_pixel_transparent(int bm_handle, int x, int y) {
1356 if ((bm_data(bm_handle, 0)) == NULL)
1357 return 0; // only check 16bit stuff
1358 uint16_t *data = bm_data(bm_handle, 0);
1359 data = data + (bm_w(bm_handle, 0) * y) + x;
1360 if (GameBitmaps[bm_handle].format == BITMAP_FORMAT_4444) {
1361 int pix = *data;
1362 if (!(pix >> 12))
1363 return true;
1364 } else {
1365 if (!(*data & OPAQUE_FLAG))
1366 return true;
1367 }
1368 return false;
1369}
1370// a function to determine if a pixel in a bitmap is transparent
1371uint16_t bm_pixel(int bm_handle, int x, int y) {
1372 if ((bm_data(bm_handle, 0)) == NULL)

Callers 1

CheckTransparentPointFunction · 0.85

Calls 2

bm_dataFunction · 0.85
bm_wFunction · 0.85

Tested by

no test coverage detected