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