GameSettings.h 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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. // GameSettings.h
  19. // Project: Nostril (aka Postal)
  20. //
  21. // History:
  22. // 12/02/96 MJR Started.
  23. //
  24. // 03/31/97 JMI Moved CGameSettings definition from game.h to this file.
  25. //
  26. // 03/31/97 JMI Now loads game play keys from prefs file.
  27. //
  28. // 04/07/97 JMI Added m_szServerName and m_usServerPort.
  29. //
  30. // 04/08/97 JMI Added m_szPlayerName and m_sPlayerColorIndex.
  31. //
  32. // 04/14/97 JMI Added TEMP flag m_bDontBlit to allow us to speed up the
  33. // Snap() call by not blitting.
  34. //
  35. // 04/21/97 MJR Added m_pszRealm for the name of the world .ini file.
  36. //
  37. // 04/22/97 JMI Added m_sCanRecordDemos indicating something obscure.
  38. //
  39. // 05/15/97 JMI Added m_sAlphaBlend and m_sXRayEffect.
  40. //
  41. // 05/19/97 JMI Added m_sDisplayInfo.
  42. //
  43. // 05/22/97 JMI Added m_s3dFog.
  44. //
  45. // 05/22/97 JMI Added m_sParticleEffects.
  46. //
  47. // 06/03/97 JMI Added m_lInitialDemoTimeOut and m_lPersistentDemoTimeOut.
  48. //
  49. // 06/09/97 JMI Added m_sCanTakeSnapShots.
  50. //
  51. // 06/09/97 JMI Added m_sCrossHair.
  52. //
  53. // 06/11/97 JMI Added m_szDontShowTitles.
  54. //
  55. // 06/12/97 MJR Renamed m_pszRealm to m_pszRealmPrefsFile.
  56. // Removed m_sServer and m_sClient and m_sDemo.
  57. //
  58. // 06/13/97 MJR Removed m_bDontBlit and cleaned up the loads and saves
  59. // and made sure everything defaulted properly.
  60. //
  61. // 06/16/97 MJR Added m_pszDemoMovie.
  62. // Added m_sNetGetInputInterval
  63. // Added m_sNetSendInputInterval.
  64. // Added m_sNetMaxFrameLag.
  65. // Added m_sNetTimePerFrame.
  66. //
  67. // MJR Added m_lNetMaxBlockingTime.
  68. // Added m_sNetUsersMaxPlayers;
  69. //
  70. // JMI Added m_sTrickySystemQuit.
  71. //
  72. // 06/17/97 MJR Added m_lNetForceAbortTime.
  73. //
  74. // 06/19/97 JMI Added m_sResetMPScoresEachLevel.
  75. //
  76. // 06/23/97 JMI Added m_szSynchLogFile.
  77. //
  78. // 07/07/97 JMI Added m_dGameFilmScale and m_dEditorFilmScale.
  79. //
  80. // 07/07/97 JMI Removed m_dEditorFilmScale and added m_sEditorViewWidth
  81. // and m_sEditorViewHeight.
  82. //
  83. // 07/16/97 JMI Changed m_lTitleLoadLoops to m_lTitleDuration.
  84. //
  85. // 07/20/97 JMI Added m_sVolumeDistance and m_sGripZoneRadius.
  86. //
  87. // 07/23/97 BRH Added several different values for m_lTitleDuration so
  88. // that each title screen can have its own setting in
  89. // the postal.ini file.
  90. //
  91. // 08/03/97 BRH Added m_usProtocol to be loaded and saved into the ini
  92. // file.
  93. //
  94. // 08/04/97 JMI Added m_sPlayAmbientSounds.
  95. //
  96. // 08/05/97 JMI Added m_eNetConnectionType and
  97. // ms_apszNetConnectionTypeNames[].
  98. //
  99. // 08/11/97 MJR Added m_szHostName and modified connection types and text.
  100. //
  101. // 08/18/97 MJR Lots of changes to network-related stuff.
  102. //
  103. // 08/20/97 BRH Added paths for the sound, hoods, and game saks to give
  104. // more install options.
  105. //
  106. // 08/23/97 JMI Added ms_apszPlayerColorDescriptions[] to provide color
  107. // descriptions and ms_sNumPlayerColorDescriptions.
  108. //
  109. // 08/25/97 JMI Now includes the m_eCurSoundQuality enum representing the
  110. // game's current sound quality.
  111. // Also, now sets all the default volumes to one value and
  112. // stores all values from 0 to the UserMaxVolume instead of
  113. // in the 0..MaxVolume scale samplemaster uses.
  114. //
  115. ////////////////////////////////////////////////////////////////////////////////
  116. #ifndef GAMESETTINGS_H
  117. #define GAMESETTINGS_H
  118. #include "RSPiX.h"
  119. #ifdef PATHS_IN_INCLUDES
  120. #include "WishPiX/Prefs/prefs.h"
  121. #else
  122. #include "prefs.h"
  123. #endif
  124. #include "settings.h"
  125. #include "localize.h"
  126. #include "SampleMaster.h"
  127. #define MAX_TITLE_SCREENS 10
  128. // Game settings
  129. class CGameSettings : CSettings
  130. {
  131. public:
  132. char m_pszCDPath[RSP_MAX_PATH+1]; // CD (Compact Disc) Path. Where product was installed from.
  133. char m_pszHDPath[RSP_MAX_PATH+1]; // HD (Hard Drive) Path. Where product was installed to.
  134. char m_pszVDPath[RSP_MAX_PATH+1]; // VD (Variable Drive) Path. Either HD or CD path, depending on optional install.
  135. char m_pszSoundPath[RSP_MAX_PATH+1]; // Path for sound files
  136. char m_pszGamePath[RSP_MAX_PATH+1]; // Path for game sak and other game files
  137. char m_pszHoodsPath[RSP_MAX_PATH+1]; // Path for level hoods
  138. char m_szNoSakDir[RSP_MAX_PATH]; // NoSakDir path. The root path to files in the absence of their SAK.
  139. char m_pszRealmPrefsFile[RSP_MAX_PATH+1];// Name of realm prefs file
  140. short m_sDifficulty; // Difficulty level (0 to 11)
  141. short m_sViolence; // Violence level (0 to 11)
  142. short m_sCrossHair; // TRUE, to use crosshair.
  143. char m_szServerName[RSP_MAX_PATH]; // Name of server for network game.
  144. USHORT m_usServerPort; // Port on server for network game.
  145. USHORT m_usProtocol; // Network protocol enum
  146. char m_szPlayerName[256]; // Player's name for multiplayer mode.
  147. short m_sPlayerColorIndex; // Player's color index for multiplayer mode.
  148. short m_sNetBandwidth; // Network bandwidth
  149. short m_sHostMinBandwidth; // Host's minimum network bandwidth
  150. short m_sHostMaxPlayers; // Host's max players
  151. char m_szHostName[RSP_MAX_PATH]; // Host name
  152. short m_sHostResetScoresEachLevel; // Host's reset-scores-each-level flag
  153. short m_sHostRejuvenate; // Host's rejuvenation flag
  154. short m_sHostTimeLimit; // Host's time limit
  155. short m_sHostKillLimit; // Host's kill limit
  156. short m_sNetGetInputInterval; // Interval between getting input
  157. short m_sNetSendInputInterval; // Interval between sending input
  158. short m_sNetMaxFrameLag; // Maximum lag between output frame and input seq
  159. short m_sNetTimePerFrame; // Time per frame
  160. long m_lNetMaxBlockingTime; // Maximum network blocking time
  161. long m_lNetForceAbortTime; // Maximum time after which to force abort
  162. /*** 12/5/97 AJC ***/
  163. char m_szNetSyncLogFile[RSP_MAX_PATH+1]; // Log file name for recording network syn time
  164. RFile m_rfNetSyncLog; // Log file for network syn time
  165. long m_lStartRealmTime; // Time when a client receives START_REALM from server
  166. char m_bLogNetTime; // True, if user wants to log net time
  167. /*** 12/5/97 AJC ***/
  168. /*** 01/14/98 SPA ***/
  169. long m_lPeerDropMaxWaitTime; // Maximum time to wait for peer data before
  170. // dropping peer (in seconds!!)
  171. /*** 01/14/98 SPA ***/
  172. long m_lInitialDemoTimeOut; // Initial demo timeout.
  173. long m_lPersistentDemoTimeOut; // Persistent demo timeout.
  174. short m_sCanRecordDemos; // TRUE, if the user can record demos.
  175. char m_szDemoDebugMovie[RSP_MAX_PATH]; // If supplied, turns on recording of demo movie to this file name
  176. short m_sNumAvailableDemos; // Number of available demos
  177. long m_alTitleDurations[MAX_TITLE_SCREENS];// Time spent on title screen while "loading".
  178. short m_sGammaVal; // Gamma brighten value for palette.
  179. short m_sUseCurrentDeviceDimensions; // If TRUE, the current display device dimensions are not changed.
  180. short m_sAlphaBlend; // TRUE, if alpha blending is on.
  181. short m_sXRayEffect; // TRUE, if x-ray effect is on.
  182. short m_s3dFog; // TRUE, if 3D objects are rendered with fog (lighting).
  183. short m_sParticleEffects; // TRUE, if particle effects are to be used.
  184. short m_sVolumeDistance; // TRUE, if volume varied by distance is on.
  185. short m_sPlayAmbientSounds; // TRUE, if we should play ambient sounds.
  186. short m_sDisplayInfo; // TRUE, to show display info.
  187. short m_sCanTakeSnapShots; // TRUE, to be able to take snap shots.
  188. char m_szDontShowTitles[512]; // Comma delimited list of title filenames that won't be shown
  189. short m_sTrickySystemQuit; // TRUE, to use 'trickier' system quit.
  190. char m_szSynchLogFile[RSP_MAX_PATH]; // If not "", logs if's to specified file.
  191. double m_dGameFilmScale; // Percentage of default film size for Play mode.
  192. // For example, if 50, what was normally displayed on 640x480
  193. // would be 320x240.
  194. short m_sEditorViewWidth; // Initial display size for editor.
  195. short m_sEditorViewHeight; // Initial display size for editor.
  196. short m_sGripZoneRadius; // Radius of non scroll area to be specified to grip.
  197. SampleMaster::SoundQuality m_eCurSoundQuality; // Current sound quality.
  198. short m_asCategoryVolumes[SampleMaster::MAX_NUM_SOUND_CATEGORIES]; // Volumes for each category.
  199. public: // Statics.
  200. // Player color descriptions.
  201. static char* ms_apszPlayerColorDescriptions[];
  202. // Number of color descriptions.
  203. static const short ms_sNumPlayerColorDescriptions;
  204. public:
  205. // Set settings to default values
  206. CGameSettings(void);
  207. // Destructor
  208. ~CGameSettings();
  209. // Read settings that are stored in preference file
  210. short LoadPrefs(
  211. RPrefs* pPrefs);
  212. // Write settings that are stored in preference file
  213. short SavePrefs(
  214. RPrefs* pPrefs);
  215. // Load settings that are stored in game file
  216. short LoadGame(
  217. RFile* pFile);
  218. // Save settings that are stored in game file
  219. short SaveGame(
  220. RFile* pFile);
  221. // Temporarily set settings for demo mode (file is for saving current settings)
  222. short PreDemo(
  223. RFile* pFile);
  224. // Restore settings to what they were prior to demo mode
  225. short PostDemo(
  226. RFile* pFile);
  227. };
  228. #endif // GAMESETTINGS_H
  229. ////////////////////////////////////////////////////////////////////////////////
  230. // EOF
  231. ////////////////////////////////////////////////////////////////////////////////