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

Function CompressTelComOnImage

Descent3/TelCom.cpp:909–927  ·  view source on GitHub ↗

This function 'compresses' the on-state background, to save space

Source from the content-addressed store, hash-verified

907
908// This function 'compresses' the on-state background, to save space
909void CompressTelComOnImage(int bitmap, chunked_bitmap *array) {
910 if (!array)
911 return;
912 int count;
913 int width, height;
914 int handle;
915
916 // the first hotspot bitmap doesn't exist so we can skip it
917 for (count = 1; count < hotspotmap.num_of_hotspots; count++) {
918 width = HotSpotW(count);
919 ASSERT(width != -1); // DAJ -1FIX
920 height = HotSpotH(count);
921 ASSERT(height != -1); // DAJ -1FIX
922 handle = bm_AllocBitmap(width, height, 0);
923 TelCom_BltToMem(handle, 0, 0, bitmap, HotSpotL(count), HotSpotT(count), width, height);
924 bm_CreateChunkedBitmap(handle, &array[count]);
925 bm_FreeBitmap(handle);
926 }
927}
928
929// frees up on-state bitmaps
930void FreeTelComOnBitmaps(chunked_bitmap *array) {

Callers 1

TelComShowFunction · 0.85

Calls 8

HotSpotWFunction · 0.85
HotSpotHFunction · 0.85
bm_AllocBitmapFunction · 0.85
TelCom_BltToMemFunction · 0.85
HotSpotLFunction · 0.85
HotSpotTFunction · 0.85
bm_CreateChunkedBitmapFunction · 0.85
bm_FreeBitmapFunction · 0.85

Tested by

no test coverage detected