play.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2016 RWS Inc, All Rights Reserved
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of version 2 of the GNU General Public License as published by
  7. // the Free Software Foundation
  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. // play.h
  19. // Project: Postal
  20. //
  21. // History:
  22. // 12/04/96 MJR Started.
  23. //
  24. // 03/07/97 JMI Added Play_SetRealmName() so an outside force can choose
  25. // the realm to load.
  26. //
  27. // 05/27/97 JMI Added #include of "Menus.h".
  28. //
  29. // 06/11/97 JMI Added protos for Play_GetRealmName() and Play_SetRealmNum().
  30. //
  31. // 06/12/97 MJR Reworked the entire interface to this module.
  32. //
  33. // 07/14/97 BRH Added additional challenge mode parameter to Play()
  34. // and Play_GetRealmInfo() to indicate if a challenge
  35. // cycle is being played.
  36. //
  37. // 07/16/97 JMI Made SnapPicture() extern.
  38. //
  39. // 07/23/97 JMI Made UpdateDisplays() and GetAppDescriptor() extern.
  40. // Also, renamed these two and SnapPicture() to be preceded
  41. // by Play_.
  42. //
  43. // 08/13/97 MJR Added difficulty as parameter to Play().
  44. //
  45. // 08/14/97 JMI Added difficulty paramter to Play_GetRealmSectionAndEntry()
  46. // and Play_GetRealmInfo().
  47. //
  48. // 08/14/97 JMI Converted Play_VerifyQuitMenuChoice() to returning true to
  49. // accept or false to deny.
  50. //
  51. // 08/18/97 JMI Now defines a variable that allows you to go to the next
  52. // level if SALES_DEMO is defined.
  53. //
  54. // 08/27/97 MJR Added frames-per-sec to Play().
  55. //
  56. // 11/20/97 JMI Added bCoopLevels & bCoopMode parameters to
  57. // Play_GetRealmInfo() and Play_GetRealmSectionAndEntry()
  58. // calls.
  59. // Also, added sCoopLevels & sCoopMode to Play() call.
  60. //
  61. // 12/01/97 BRH Added bAddOn parameters to Play_GetRealmInfo() and
  62. // Play_GetRealmSectionAndEntry() calls. Added bAddOn
  63. // flag to Play() call.
  64. //
  65. ////////////////////////////////////////////////////////////////////////////////
  66. #ifndef PLAY_H
  67. #define PLAY_H
  68. #include "RSPiX.h"
  69. #include "menus.h"
  70. #include "netclient.h"
  71. #include "netserver.h"
  72. #include "input.h"
  73. #include "camera.h"
  74. #include "dude.h"
  75. #ifdef MOBILE
  76. #include "android/android.h"
  77. #endif
  78. ////////////////////////////////////////////////////////////////////////////////
  79. //
  80. // Play game using specified settings.
  81. //
  82. ////////////////////////////////////////////////////////////////////////////////
  83. extern short Play( // Returns 0 if successfull, non-zero otherwise
  84. CNetClient* pclient, // In: Client object or NULL if not network game
  85. CNetServer* pserver, // In: Server object or NULL if not server or not network game
  86. INPUT_MODE inputMode, // In: Input mode
  87. const short sRealmNum, // In: Realm number to start on or -1 to use specified realm file
  88. const char* pszRealmFile, // In: Realm file to play (ignored if sRealmNum >= 0)
  89. const bool bJustOneRealm, // In: Play just this one realm (ignored if sRealmNum < 0)
  90. const bool bGauntlet, // In: Play challenge levels gauntlet - as selected on menu
  91. const bool bAddOn, // In: Play Add On levels
  92. const short sDifficulty, // In: Difficulty level
  93. const bool bRejuvenate, // In: Whether to allow players to rejuvenate (MP only)
  94. const short sTimeLimit, // In: Time limit for MP games (0 or negative if none)
  95. const short sKillLimit, // In: Kill limit for MP games (0 or negative if none)
  96. const short sCoopLevels, // In: Zero for deathmatch levels, non-zero for cooperative levels.
  97. const short sCoopMode, // In: Zero for deathmatch mode, non-zero for cooperative mode.
  98. const short sFrameTime, // In: Milliseconds per frame (MP only)
  99. RFile* pfileDemoModeDebugMovie); // In: File for loading/saving demo mode debug movie
  100. ////////////////////////////////////////////////////////////////////////////////
  101. //
  102. // Get info about specified realm
  103. //
  104. ////////////////////////////////////////////////////////////////////////////////
  105. extern short Play_GetRealmInfo( // Returns 0 if successfull, 1 if no such realm, negative on error
  106. bool bNetwork, // In: true if network game, false otherwise
  107. bool bCoop, // In: true if coop net game, false otherwise -- no effect if bNetwork is false.
  108. bool bGauntlet, // In: true if playing multiple challenge levels.
  109. bool bAddOn, // In: true if playing new Add on levels
  110. short sRealmNum, // In: Realm number
  111. short sDifficulty, // In: Realm difficulty.
  112. char* pszFile, // Out: Realm's file name
  113. short sMaxFileLen, // In: Max length of returned file name, including terminating null
  114. char* pszTitle = 0, // Out: Realm's title
  115. short sMaxTitleLen = NULL); // In: Max length of returned title, including terminating null
  116. ////////////////////////////////////////////////////////////////////////////////
  117. //
  118. // Get the section and entry that should be used when querying the realms prefs
  119. // file for the described realm.
  120. //
  121. ////////////////////////////////////////////////////////////////////////////////
  122. extern void Play_GetRealmSectionAndEntry(
  123. bool bNetwork, // In: true if network game, false otherwise
  124. bool bCoop, // In: true if coop net game, false otherwise -- no effect if bNetwork is false.
  125. bool bGauntlet, // In: true if playing challenge mode
  126. bool bAddOn, // In: true if playing new add on levels
  127. short sRealmNum, // In: Realm number
  128. short sDifficulty, // In: Realm difficulty.
  129. RString* pstrSection, // Out: Section is returned here
  130. RString* pstrEntry); // Out: Entry is returned here
  131. ////////////////////////////////////////////////////////////////////////////////
  132. //
  133. // Callback from g_menuVerifyQuitGame with choice.
  134. //
  135. ////////////////////////////////////////////////////////////////////////////////
  136. extern bool Play_VerifyQuitMenuChoice( // Returns true to accept, false to deny choice.
  137. Menu* pmenuCurrent, // In: Current menu.
  138. short sMenuItem); // In: Item chosen or -1 for change of focus.
  139. ////////////////////////////////////////////////////////////////////////////////
  140. //
  141. // Snap picture to disk.
  142. //
  143. ////////////////////////////////////////////////////////////////////////////////
  144. extern void Play_SnapPicture(void);
  145. ////////////////////////////////////////////////////////////////////////////////
  146. //
  147. // Creates descriptor including app's time stamp, debug status (debug or release)
  148. // and, if defined, TRACENASSERT flag.
  149. //
  150. ////////////////////////////////////////////////////////////////////////////////
  151. extern void Play_GetApplicationDescriptor( // Returns nothing.
  152. char* pszText, // Out: Text descriptor.
  153. short sMaxBytes); // In: Amount of writable
  154. // memory pointed to by pszText.
  155. #ifdef SALES_DEMO
  156. // When true, one can advance to the next level without meeting the goal.
  157. extern bool g_bEnableLevelAdvanceWithoutGoal;
  158. #endif
  159. #endif //PLAY_H
  160. ////////////////////////////////////////////////////////////////////////////////
  161. // EOF
  162. ////////////////////////////////////////////////////////////////////////////////