ID_US.H 4.0 KB

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