]> 4ch.mooo.com Git - 16.git/blob - 16/cawat/ID_US.H
wwww
[16.git] / 16 / cawat / ID_US.H
1 /* Catacomb Armageddon Source Code\r
2  * Copyright (C) 1993-2014 Flat Rock Software\r
3  *\r
4  * This program is free software; you can redistribute it and/or modify\r
5  * it under the terms of the GNU General Public License as published by\r
6  * the Free Software Foundation; either version 2 of the License, or\r
7  * (at your option) any later version.\r
8  *\r
9  * This program is distributed in the hope that it will be useful,\r
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
12  * GNU General Public License for more details.\r
13  *\r
14  * You should have received a copy of the GNU General Public License along\r
15  * with this program; if not, write to the Free Software Foundation, Inc.,\r
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
17  */\r
18 \r
19 //\r
20 //      ID Engine\r
21 //      ID_US.h - Header file for the User Manager\r
22 //      v1.0d1\r
23 //      By Jason Blochowiak\r
24 //\r
25 \r
26 #ifndef __TYPES__\r
27 #include "ID_Types.h"\r
28 #endif\r
29 \r
30 #ifndef __ID_US__\r
31 #define __ID_US__\r
32 \r
33 #ifdef  __DEBUG__\r
34 #define __DEBUG_UserMgr__\r
35 #endif\r
36 \r
37 //#define       HELPTEXTLINKED\r
38 \r
39 #define MaxHelpLines    500\r
40 \r
41 #define MaxHighName     57\r
42 #define MaxScores       7\r
43 typedef struct\r
44                 {\r
45                         char    name[MaxHighName + 1];\r
46                         long    score;\r
47                         word    completed;\r
48                 } HighScore;\r
49 \r
50 #define MaxGameName             32\r
51 #define MaxSaveGames    6\r
52 typedef struct\r
53                 {\r
54                         char    signature[4];\r
55                         word    *oldtest;\r
56                         boolean present;\r
57                         char    name[MaxGameName + 1];\r
58                 } SaveGame;\r
59 \r
60 #define MaxString       128     // Maximum input string size\r
61 \r
62 typedef struct\r
63                 {\r
64                         int     x,y,\r
65                                 w,h,\r
66                                 px,py;\r
67                 } WindowRec;    // Record used to save & restore screen windows\r
68 \r
69 typedef enum\r
70                 {\r
71                         gd_Continue,\r
72                         gd_Easy,\r
73                         gd_Normal,\r
74                         gd_Hard\r
75                 } GameDiff;\r
76 \r
77 //      Hack import for TED launch support\r
78 extern  boolean         tedlevel;\r
79 extern  word            tedlevelnum;\r
80 extern  void            TEDDeath(void);\r
81 \r
82 extern word MaxX,MaxY;          // MDM (GAMERS EDGE)\r
83 \r
84 extern  boolean         ingame,         // Set by game code if a game is in progress\r
85                                         abortgame,      // Set if a game load failed\r
86                                         loadedgame,     // Set if the current game was loaded\r
87                                         NoWait,\r
88                                         HighScoresDirty;\r
89 extern  char            *abortprogram;  // Set to error msg if program is dying\r
90 extern  GameDiff        restartgame;    // Normally gd_Continue, else starts game\r
91 extern  word            PrintX,PrintY;  // Current printing location in the window\r
92 extern  word            WindowX,WindowY,// Current location of window\r
93                                         WindowW,WindowH;// Current size of window\r
94 \r
95 extern  boolean         Button0,Button1,\r
96                                         CursorBad;\r
97 extern  int                     CursorX,CursorY;\r
98 \r
99 extern  void            (*USL_MeasureString)(char far *,word *,word *),\r
100                                         (*USL_DrawString)(char far *);\r
101 \r
102 extern  boolean         (*USL_SaveGame)(int),(*USL_LoadGame)(int);\r
103 extern  void            (*USL_ResetGame)(void);\r
104 extern  SaveGame        Games[MaxSaveGames];\r
105 extern  HighScore       Scores[];\r
106 \r
107 #define US_HomeWindow() {PrintX = WindowX; PrintY = WindowY;}\r
108 \r
109 extern  void    US_Startup(void),\r
110                                 US_Setup(void),\r
111                                 US_Shutdown(void),\r
112                                 US_InitRndT(boolean randomize),\r
113                                 US_SetLoadSaveHooks(boolean (*load)(int),\r
114                                                                         boolean (*save)(int),\r
115                                                                         void (*reset)(void)),\r
116                                 US_TextScreen(void),\r
117                                 US_UpdateTextScreen(void),\r
118                                 US_FinishTextScreen(void),\r
119                                 US_ControlPanel(void),\r
120                                 US_DrawWindow(word x,word y,word w,word h),\r
121                                 US_CenterWindow(word,word),\r
122                                 US_SaveWindow(WindowRec *win),\r
123                                 US_RestoreWindow(WindowRec *win),\r
124                                 US_ClearWindow(void),\r
125                                 US_SetPrintRoutines(void (*measure)(char far *,word *,word *),\r
126                                                                         void (*print)(char far *)),\r
127                                 US_PrintCentered(char *s),\r
128                                 US_CPrint(char *s),\r
129                                 US_CPrintLine(char *s),\r
130                                 US_Print(char *s),\r
131                                 US_PrintUnsigned(longword n),\r
132                                 US_PrintSigned(long n),\r
133                                 US_StartCursor(void),\r
134                                 US_ShutCursor(void),\r
135                                 US_ControlPanel(void),\r
136                                 US_CheckHighScore(long score,word other),\r
137                                 US_DisplayHighScores(int which);\r
138 extern  boolean US_UpdateCursor(void),\r
139                                 US_LineInput(int x,int y,char *buf,char *def,boolean escok,\r
140                                                                 int maxchars,int maxwidth);\r
141 extern  int             US_CheckParm(char *parm,char **strings),\r
142                                 US_RndT(void);\r
143 \r
144                 void    USL_PrintInCenter(char *s,Rect r);\r
145                 char    *USL_GiveSaveName(word game);\r
146 #endif\r