b->x |
= x; |
b->y |
= y; |
b->oldval |
= 0; |
b->val |
= val; |
b->on |
= on; |
b->p |
= i; |
} |
|
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 - SHORT(bi->p->leftoffset); y = bi->y - SHORT(bi->p->topoffset); w = SHORT(bi->p->width);
h = SHORT(bi->p->height);
if (y - ST_Y < 0)
I_Error("updateBinIcon: y - ST_Y < 0");
if (*bi->val)
V_DrawPatch(bi->x, bi->y, FG, bi->p);
else
V_CopyRect(x, y-ST_Y, BG, w, h, x, y, FG);
bi->oldval = *bi->val;
}
}
12.2st lib.h
// Emacs style mode select -*- C++ -*- //-----------------------------------------------------------------------------
//
//$Id:$
//Copyright (C) 1993-1996 by id Software, Inc.
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either version 2
//of the License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//DESCRIPTION:
//The status bar widget code.
//-----------------------------------------------------------------------------