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

Function bm_MakeBad

bitmap/bitmain.cpp:978–995  ·  view source on GitHub ↗

Given a handle, makes a big random shape to let you know you are screwed.

Source from the content-addressed store, hash-verified

976}
977// Given a handle, makes a big random shape to let you know you are screwed.
978void bm_MakeBad(int handle) {
979 int i, t, limit;
980 uint16_t *dest;
981 ASSERT(GameBitmaps[handle].used);
982 if (handle != BAD_BITMAP_HANDLE)
983 Int3(); // hmm, you're assigning a random bitmap to something other than
984 // the default.
985 if (bm_mipped(handle))
986 limit = bm_miplevels(handle);
987 else
988 limit = 1;
989 for (i = 0; i < limit; i++) {
990 dest = bm_data(handle, i);
991
992 for (t = 0; t < bm_h(handle, i) * bm_w(handle, i); t++)
993 *dest++ = (OPAQUE_FLAG | ps_rand());
994 }
995}
996
997// Saves a bitmap to an open file. Saves the bitmap as an OUTRAGE_COMPRESSED_OGF.
998// Returns -1 if something is wrong.

Callers 1

bm_InitBitmapsFunction · 0.85

Calls 6

bm_mippedFunction · 0.85
bm_miplevelsFunction · 0.85
bm_dataFunction · 0.85
bm_hFunction · 0.85
bm_wFunction · 0.85
ps_randFunction · 0.85

Tested by

no test coverage detected