home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / mt / screenf.h < prev    next >
C/C++ Source or Header  |  1989-02-11  |  3KB  |  112 lines

  1. /* screenf.h  header file for screenf.lib */
  2. /* for writscrn.c, linedraw.c, chain.c  */
  3.  
  4.  
  5. #define WHITE       1
  6. #define BLACK       0
  7.                                 /* starting memory for video page */
  8. #define CVIDMEM     0xB8000000L /* CGA text/graphics */
  9. #define HVIDMEM     0xB0000000L /* monochrome/hercules text */
  10. #define EVIDMEM     0xA8000000L /* ega/vga */
  11.  
  12.  
  13. #define SCRNWIDE 80         /* usual width and hight of screen in chars */
  14. #define SCRNTALL 25
  15.                             /* codes for screen char attributes */
  16.  
  17. #define BWC   0x07  /* black and white */
  18. #define ULC   0x01  /* underlined */
  19. #define RVC   0x70  /* reverse video */
  20. #define BRVC  0xF0  /* blinking reverse video */
  21. #define BRBWC 0x0F  /* bright, black and white */
  22.  
  23. /* structures used in modules */
  24. /* writscrn.c */
  25.  
  26. struct selement {   /* used by movescrn() for cursor element definition */
  27.     int xpos;
  28.     int ypos;
  29.     char content[15];
  30.     int nup;
  31.     int ndown;
  32.     int nleft;
  33.     int nright;
  34.     int key;
  35. };
  36.  
  37. /* videofnc.c */
  38.  
  39. struct sprite{      /* sprite structure; sdata is bit map */
  40.     int swide;
  41.     int stall;
  42.     unsigned char *sdata;
  43.    };
  44.  
  45.  
  46. /* chain.c   */
  47.     
  48. struct strchain {   /* used for linked list storage of screen displays */
  49.     char *line;
  50.     struct strchain *next;
  51. };
  52.  
  53. /* old style func declarations
  54.  
  55. struct strchain *inpchain(), 
  56.                 *chain(), 
  57.                 *chainalloc();
  58. char *strsave();             */
  59.  
  60.  
  61.             /* function prototypes */
  62.  
  63. /* videofnc.c */
  64.  
  65. void writeword(char *string, int x, int y, int attrib);
  66. void clearscreen(int attrib);
  67. void clearline(int lineno, int attrib);
  68. void csrplot(int x, int y);
  69. void setvideomode(int mode);
  70. void dotplot(int x, int y, int color);
  71. void draw_rectangle(int fill, int x1, int y1, int x2, int y2, int color);
  72. void drawline(int x1, int y1, int x2, int y2, int color);
  73. void wordul(int mode, char *string, int x, int y, int color);
  74. void draw_sprite(struct sprite spr, int xpos, int ypos, int line_color, 
  75.     int back_color);
  76. void xsprite(struct sprite spr, int xpos, int ypos, int color);
  77.  
  78.  
  79. /* writscrn.c */
  80.  
  81. int movescrn(int vidmode, struct selement scrnarray[], int first, int last, 
  82.      int normal, int hilit);
  83. void to_new_csr(int vidmode, struct selement scrnarray[], int k, int oldk, 
  84.      int normal, int hilit);
  85. void writerr(char *s, int lineno,  int normal, int hilit);
  86. void clearwind(int tx, int ty, int bx, int by, int attrib);
  87. void initscrn(struct selement scrnarray[], int first, int last, int attrib);
  88. void finitscrn(struct selement scrnarray[], int first, int last, int attrib, 
  89.     int mode);
  90. void fwriteword(char *string, int x, int y, int attrib, int mode);
  91. void write_int(int value, int x, int y, int attrib);
  92.  
  93. /* chain.c */
  94.  
  95. struct strchain *inpchain(char *file, int maxlen);
  96. struct strchain *chain(struct strchain *p, char *w);
  97. void dechain(struct strchain *p);
  98. void dispchain(struct strchain *p, int y, int attrib);
  99. struct strchain *chainalloc(void);
  100. char *strsave(char *s);
  101. void fdispchain(struct strchain *p, int y,  int attrib, int mode);
  102.  
  103. /* inputf.c */
  104.  
  105. int getfloat(int lineno, char *prompt, float *value, float min, float max,
  106.     int normal, int hilit);
  107. int getint(int lineno, char *prompt, int *value, int min, int max,
  108.     int normal, int hilit);
  109. int getstr(int lineno, char *prompt, char *string, int max,
  110.     int attrib);
  111. int get_string(char *str, int max); 
  112.