home *** CD-ROM | disk | FTP | other *** search
/ Crazy Collection 12 / CC-12_1.iso / update / doompack / data.a00 / LMPC280.ZIP / LMPC-2.8 / SRC / ULMP.H < prev   
Encoding:
C/C++ Source or Header  |  1995-08-23  |  4.5 KB  |  148 lines

  1. /****************************************************************************\
  2. ;                                                                            ;
  3. ;  ulmp.h - project LMP control center                                       ;
  4. ;  header file of ulmp.c                                                     ;
  5. ;                                                                            ;
  6. ;  general LMP routines                                                      ;
  7. ;                                                                            ;
  8. ;  Uwe Girlich                                                               ;
  9. ;  Erika-von-Brockdorff-Strasse 2                                            ;
  10. ;  04159 Leipzig                                                             ;
  11. ;  Deutschland/Germany                                                       ;
  12. ;  E-mail: girlich@aix520.informatik.uni-leipzig.de                          ;
  13. ;                                                                            ;
  14. \****************************************************************************/
  15.  
  16.  
  17. #ifndef __ULMP_H
  18. #define __ULMP_H
  19.  
  20.  
  21. #include <stdio.h>
  22.  
  23. #define C_MOUSE         1
  24. #define C_KEY_OLD       2
  25. #define C_KEY_NEW       4
  26. #define C_KEY           (C_KEY_OLD | C_KEY_NEW)
  27. #define ruleCOOP  0
  28. #define ruleDEATH 1
  29. #define ruleALT   2
  30. #define MAXPLAYER   4
  31. #define SHORT_SIZE  7
  32. #define LONG_SIZE  13
  33. #define SHORT_TIC   4
  34. #define LONG_TIC    6
  35.  
  36. #define UNKNOWN   0
  37. #define WRONG     1
  38. #define DOOM_old  2
  39. #define DOOM_new  4
  40. #define DOOM2     8
  41. #define HERETIC  16
  42. #define TICTIME  1.0/35.0
  43.  
  44.  
  45. extern char *PlayerColor[];
  46. extern char *WeaponName[];
  47. extern char *ArtifactName[];
  48.  
  49. typedef struct {
  50.                  unsigned char go;
  51.                  unsigned char strafe;
  52.                  unsigned char turn;
  53.                  unsigned char use;
  54.                  unsigned char fl;
  55.                  unsigned char art;
  56.                } TIC_t;
  57.  
  58.  
  59. typedef struct {
  60.                  unsigned char header[13];
  61.                  int           headersize;
  62.                  int           game;
  63.                  unsigned char versionbyte;
  64.                  unsigned char skill;
  65.                  unsigned char episode;
  66.                  unsigned char map;
  67.                  unsigned char multirule;
  68.                  unsigned char respawn;
  69.                  unsigned char fast;
  70.                  unsigned char nomonsters;
  71.                  unsigned char mainplayer;
  72.                  int           playernum;
  73.                  int           num[MAXPLAYER];
  74.                  char          *filename;
  75.                  FILE          *file;
  76.                  long          filesize;
  77.                  long          datasize;
  78.                  long          tics;
  79.                  int           ticsize;
  80.                  double        time;
  81.          char          *gs;
  82.          char          *ns;
  83.                } LMP_t;
  84.  
  85.  
  86. typedef struct {
  87.                  char          *filename;
  88.                  FILE          *file;
  89.                  long          filesize;
  90.                } LS_t;
  91.  
  92.  
  93. typedef struct {
  94.                  unsigned long hist[128];
  95.                  unsigned long sum;
  96.                  char *command;
  97.                  int maxm;
  98.                  unsigned char m[3];
  99.                  unsigned char control;
  100.                  unsigned char last;
  101.                } STAT_t; 
  102.  
  103.  
  104. typedef struct {
  105.                  char*         versionstring;
  106.          int           game;
  107.                  unsigned char versionbyte;
  108.          unsigned int  string_no;
  109.                } VK;
  110. extern VK VersionKey[];
  111. #define VersionKeys 16
  112.  
  113. /* LMP */
  114. void LMP_init(LMP_t *l, char *filename, char *mode);
  115. int LMP_checkgametype(LMP_t *l);
  116. void LMP_readheader(LMP_t *l);
  117. void LMP_writeheader(LMP_t *l);
  118. void LMP_init(LMP_t *l, char *filename, char *mode);
  119. int LMP_checkgametype(LMP_t *l);
  120. void LMP_readheader(LMP_t *l);
  121. void LMP_writeheader(LMP_t *l);
  122. void LMP_writequitbyte(LMP_t *l);
  123. void LMP_putgametic(LMP_t *l, TIC_t *t);
  124. void LMP_getgametic(LMP_t *l, TIC_t *t);
  125. void LMP_done(LMP_t *l);
  126.  
  127. /* LS */
  128. void LS_init(LS_t *l, char *filename, char *mode);
  129. void LS_done(LS_t *l);
  130.  
  131. /* STAT */
  132. void STAT_init(STAT_t *s, char *command, int maxm);
  133. void STAT_calc(STAT_t *s);
  134. int STAT_turncheck(STAT_t *s, unsigned char t1, unsigned char t2, unsigned char t3);
  135. char *STAT_writehist(STAT_t *s, char *buf);
  136. void STAT_done(STAT_t *s);
  137.  
  138. void getversion(unsigned char versionbyte, int *game, char *filename,
  139.                 char **gs, char **ns);
  140. unsigned char strtoversionbyte(char *s);
  141.  
  142.  
  143. #endif /* __ULMP_H */
  144.  
  145.  
  146. /*-- file end ulmp.h ---------------------------------------------------------*/
  147.  
  148.