MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Fade

Function Fade

code/ui/ui_shared.cpp:8403–8432  ·  view source on GitHub ↗

================= Fade ================= */

Source from the content-addressed store, hash-verified

8401=================
8402*/
8403void Fade(int *flags, float *f, float clamp, int *nextTime, int offsetTime, qboolean bFlags, float fadeAmount)
8404{
8405 if (*flags & (WINDOW_FADINGOUT | WINDOW_FADINGIN))
8406 {
8407 if (DC->realTime > *nextTime)
8408 {
8409 *nextTime = DC->realTime + offsetTime;
8410 if (*flags & WINDOW_FADINGOUT)
8411 {
8412 *f -= fadeAmount;
8413 if (bFlags && *f <= 0.0)
8414 {
8415 *flags &= ~(WINDOW_FADINGOUT | WINDOW_VISIBLE);
8416 }
8417 }
8418 else
8419 {
8420 *f += fadeAmount;
8421 if (*f >= clamp)
8422 {
8423 *f = clamp;
8424 if (bFlags)
8425 {
8426 *flags &= ~WINDOW_FADINGIN;
8427 }
8428 }
8429 }
8430 }
8431 }
8432}
8433
8434/*
8435=================

Callers 3

Item_TextColorFunction · 0.70
Item_OwnerDraw_PaintFunction · 0.70
Window_PaintFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected