components/prboom/st_lib.c
//
// STlib_updateBinIcon()
//
// DInitialize a st_binicon_t widget, used for a multinumber display
// like the status bar's weapons, that are present or not.
//
// Draw a st_binicon_t widget, used for a multinumber display
// like the status bar's weapons that are present or not. Displays each
// when the control flag changes or refresh is true
//
// Passed a st_binicon_t widget, and a refresh flag
// Returns nothing.
//
STlib_updateBinIcon()
DInitialize a st_binicon_t widget, used for a multinumber display
like the status bar's weapons, that are present or not.

Draw a st_binicon_t widget, used for a multinumber display
like the status bar's weapons that are present or not. Displays each
when the control flag changes or refresh is true

Passed a st_binicon_t widget, and a refresh flag
Returns nothing.
STlib_updateBinIcon () DInitialize a st_binicon_t widget used for a multinumber display like the status bar ' s weapons that are present or not . Draw a st_binicon_t widget used for a multinumber display like the status bar ' s weapons that are present or not . Displays each when the control flag changes or refresh is true Passed a st_binicon_t widget and a refresh flag Returns nothing .
void STlib_updateBinIcon
( st_binicon_t*   bi,
  boolean   refresh )
{
  int     x;
  int     y;
  int     w;
  int     h;
  if (*bi->on && (bi->oldval != *bi->val || refresh))
  {
    x = bi->x - bi->p->leftoffset;
    y = bi->y - bi->p->topoffset;
    w = bi->p->width;
    h = bi->p->height;
#ifdef RANGECHECK
    if (y - ST_Y < 0)
      I_Error("STlib_updateBinIcon: y - ST_Y < 0");
#endif
    if (*bi->val)
      V_DrawNumPatch(bi->x, bi->y, FG, bi->p->lumpnum, CR_DEFAULT, VPT_STRETCH);
    else
      V_CopyRect(x, y-ST_Y, BG, w, h, x, y, FG, VPT_STRETCH);
    bi->oldval = *bi->val;
  }
}
void STlib_updateBinIcon ( st_binicon_t * bi , boolean refresh ) { int x ; int y ; int w ; int h ; if ( * bi -> on && ( bi -> oldval != * bi -> val || refresh ) ) { x = bi -> x - bi -> p -> leftoffset ; y = bi -> y - bi -> p -> topoffset ; w = bi -> p -> width ; h = bi -> p -> height ; #ifdef RANGECHECK if ( y - ST_Y < 0 ) I_Error ( " " ) ; #endif if ( * bi -> val ) V_DrawNumPatch ( bi -> x , bi -> y , FG , bi -> p -> lumpnum , CR_DEFAULT , VPT_STRETCH ) ; else V_CopyRect ( x , y - ST_Y , BG , w , h , x , y , FG , VPT_STRETCH ) ; bi -> oldval = * bi -> val ; } }
STlib_updateBinIcon()
DInitialize a st_binicon_t widget, used for a multinumber display
like the status bar's weapons, that are present or not.
STlib_updateBinIcon () DInitialize a st_binicon_t widget used for a multinumber display like the status bar ' s weapons that are present or not .