doom

a minimalistic implementation of doom
git clone git://ssnf.xyz/doom
Log | Files | Refs

st_lib.h (1642B)


      1 
      2 
      3 
      4 
      5 
      6 
      7 
      8 
      9 
     10 
     11 
     12 
     13 
     14 
     15 
     16 
     17 
     18 
     19 
     20 
     21 
     22 #ifndef __STLIB__
     23 #define __STLIB__
     24 
     25 
     26 
     27 #include "r_defs.h"
     28 
     29 
     30 
     31 
     32 
     33 #define BG 4
     34 #define FG 0
     35 
     36 
     37 
     38 
     39 
     40 
     41 
     42 
     43 
     44 typedef struct
     45 {
     46     
     47     
     48     int		x;
     49     int		y;
     50 
     51     
     52     int width;    
     53 
     54     
     55     int		oldnum;
     56     
     57     
     58     int*	num;
     59 
     60     
     61     
     62     boolean*	on;
     63 
     64     
     65     patch_t**	p;
     66 
     67     
     68     int data;
     69     
     70 } st_number_t;
     71 
     72 
     73 
     74 
     75 
     76 typedef struct
     77 {
     78     
     79     st_number_t		n;
     80 
     81     
     82     patch_t*		p;
     83     
     84 } st_percent_t;
     85 
     86 
     87 
     88 
     89 typedef struct
     90 {
     91      
     92     int			x;
     93     int			y;
     94 
     95     
     96     int			oldinum;
     97 
     98     
     99     int*		inum;
    100 
    101     
    102     
    103     boolean*		on;
    104 
    105     
    106     patch_t**		p;
    107     
    108     
    109     int			data;
    110     
    111 } st_multicon_t;
    112 
    113 
    114 
    115 
    116 
    117 
    118 typedef struct
    119 {
    120     
    121     int			x;
    122     int			y;
    123 
    124     
    125     int			oldval;
    126 
    127     
    128     boolean*		val;
    129 
    130     
    131     
    132     boolean*		on;  
    133 
    134 
    135     patch_t*		p;	
    136     int			data;   
    137     
    138 } st_binicon_t;
    139 
    140 
    141 
    142 
    143 
    144 
    145 
    146 
    147 
    148 
    149 
    150 void STlib_init(void);
    151 
    152 
    153 
    154 
    155 void
    156 STlib_initNum
    157 ( st_number_t*		n,
    158   int			x,
    159   int			y,
    160   patch_t**		pl,
    161   int*			num,
    162   boolean*		on,
    163   int			width );
    164 
    165 void
    166 STlib_updateNum
    167 ( st_number_t*		n,
    168   boolean		refresh );
    169 
    170 
    171 
    172 void
    173 STlib_initPercent
    174 ( st_percent_t*		p,
    175   int			x,
    176   int			y,
    177   patch_t**		pl,
    178   int*			num,
    179   boolean*		on,
    180   patch_t*		percent );
    181 
    182 
    183 void
    184 STlib_updatePercent
    185 ( st_percent_t*		per,
    186   int			refresh );
    187 
    188 
    189 
    190 void
    191 STlib_initMultIcon
    192 ( st_multicon_t*	mi,
    193   int			x,
    194   int			y,
    195   patch_t**		il,
    196   int*			inum,
    197   boolean*		on );
    198 
    199 
    200 void
    201 STlib_updateMultIcon
    202 ( st_multicon_t*	mi,
    203   boolean		refresh );
    204 
    205 
    206 
    207 void
    208 STlib_initBinIcon
    209 ( st_binicon_t*		b,
    210   int			x,
    211   int			y,
    212   patch_t*		i,
    213   boolean*		val,
    214   boolean*		on );
    215 
    216 void
    217 STlib_updateBinIcon
    218 ( st_binicon_t*		bi,
    219   boolean		refresh );
    220 
    221 #endif
    222 
    223 
    224 
    225 
    226