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

Function makecorner

Descent3/hotspotmap.cpp:803–827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

801}
802
803void makecorner(int corner_bmp, int back_bmp, const char *tmap, int l, int t, int r, int b) {
804 int real_x, real_y, awidth, ax, ay;
805 int16_t *backdata, *cornerdata;
806 int back_rowsize, corner_rowsize;
807
808 awidth = r - l;
809 bm_ClearBitmap(corner_bmp);
810 backdata = (int16_t *)bm_data(back_bmp, 0);
811 back_rowsize = bm_rowsize(back_bmp, 0);
812 cornerdata = (int16_t *)bm_data(corner_bmp, 0);
813 corner_rowsize = bm_rowsize(corner_bmp, 0);
814
815 backdata += (t * (back_rowsize / 2));
816
817 for (real_y = t, ay = 0; real_y < b; real_y++, ay++) {
818 for (real_x = l, ax = 0; real_x < r; real_x++, ax++) {
819 if (!tmap[ay * awidth + ax]) {
820 // not transparent
821 cornerdata[ax] = backdata[real_x];
822 }
823 }
824 cornerdata += (corner_rowsize / 2);
825 backdata += (back_rowsize / 2);
826 }
827}
828
829// This function frees up the allocated memory within a hotspotmap struct. It does not free up the struct though.
830void FreeHotSpotMapInternals(hotspotmap_t *hsmap) {

Callers 1

menutga_LoadHotSpotMapFunction · 0.85

Calls 3

bm_ClearBitmapFunction · 0.85
bm_dataFunction · 0.85
bm_rowsizeFunction · 0.85

Tested by

no test coverage detected