doom

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

hu_lib.h (1758B)


      1 #ifndef __HULIB__
      2 #define __HULIB__
      3 
      4 #include "r_defs.h"
      5 
      6 #define BG			1
      7 #define FG			0
      8 #define HU_CHARERASE	KEY_BACKSPACE
      9 #define HU_MAXLINES		4
     10 #define HU_MAXLINELENGTH	80
     11 
     12 typedef struct {
     13     int       x;
     14     int       y;
     15     patch_t** f;			
     16     int       sc;			
     17     char      l[HU_MAXLINELENGTH+1];	
     18     int       len;		      	
     19     int		needsupdate;	      
     20 } hu_textline_t;
     21 
     22 typedef struct {
     23     hu_textline_t l[HU_MAXLINES];	
     24     int           h;		
     25     int           cl;		
     26     boolean*      on;
     27     boolean       laston;		
     28 } hu_stext_t;
     29 
     30 typedef struct {
     31     hu_textline_t l;		
     32     int           lm;
     33     boolean*      on; 
     34     boolean       laston; 
     35 } hu_itext_t;
     36 
     37 void HUlib_init(void);
     38 void HUlib_clearTextLine(hu_textline_t *t);
     39 void HUlib_initTextLine(hu_textline_t *t, int x, int y, patch_t **f, int sc);
     40 boolean HUlib_addCharToTextLine(hu_textline_t *t, char ch);
     41 boolean HUlib_delCharFromTextLine(hu_textline_t *t);
     42 void HUlib_drawTextLine(hu_textline_t *l, boolean drawcursor);
     43 void HUlib_eraseTextLine(hu_textline_t *l); 
     44 void HUlib_initSText(hu_stext_t* s, int x, int y, int h, patch_t** font, int startchar, boolean* on);
     45 void HUlib_addLineToSText(hu_stext_t* s);  
     46 void HUlib_addMessageToSText(hu_stext_t* s, char* prefix, char* msg);
     47 void HUlib_drawSText(hu_stext_t* s);
     48 void HUlib_eraseSText(hu_stext_t* s); 
     49 void HUlib_initIText(hu_itext_t* it, int x, int y, patch_t** font, int startchar, boolean* on);
     50 void HUlib_delCharFromIText(hu_itext_t* it);
     51 void HUlib_eraseLineFromIText(hu_itext_t* it);
     52 void HUlib_resetIText(hu_itext_t* it);
     53 void HUlib_addPrefixToIText(hu_itext_t* it, char* str);
     54 boolean HUlib_keyInIText(hu_itext_t* it, unsigned char ch);
     55 void HUlib_drawIText(hu_itext_t* it);
     56 void HUlib_eraseIText(hu_itext_t* it); 
     57 
     58 #endif