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

Function FadeProcTexture

Descent3/procedurals.cpp:339–356  ·  view source on GitHub ↗

Fades an entire bitmap one step closer to black

Source from the content-addressed store, hash-verified

337}
338// Fades an entire bitmap one step closer to black
339void FadeProcTexture(int tex_handle) {
340 int total = PROC_SIZE * PROC_SIZE;
341 uint8_t *src_data = ProcDestData;
342 int fadeval;
343 fadeval = 255 - GameTextures[tex_handle].procedural->heat;
344 fadeval >>= 3;
345 fadeval++;
346
347 for (int i = 0; i < total; i++, src_data++) {
348 int pix = *src_data;
349 if (pix) {
350 if (pix - fadeval <= 0)
351 *src_data = 0;
352 else
353 *src_data = pix - fadeval;
354 }
355 }
356}
357// Heats an entire bitmap
358void HeatProcTexture(int tex_handle) {
359 int total = PROC_SIZE * PROC_SIZE;

Callers 1

EvaluateFireProceduralFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected