xb_settings.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef __XB_SETTINGS_H
  2. #define __XB_SETTINGS_H
  3. #include <xtl.h>
  4. enum XBStartupState
  5. {
  6. STARTUP_LOAD_SETTINGS,
  7. STARTUP_COMBINED_SPACE_CHECK,
  8. STARTUP_GAME_SPACE_CHECK,
  9. STARTUP_INVITE_CHECK,
  10. STARTUP_FINISH,
  11. };
  12. // Minimum save size on Xbox. Bleh:
  13. #define SETTINGS_NUM_BLOCKS 4
  14. struct XBSettings
  15. {
  16. // Magic number/revision stamp:
  17. unsigned long version;
  18. // Controls, etc... One for SP/P1 in MP, other for P2 in MP:
  19. bool invertAim[2];
  20. int thumbstickMode[2];
  21. int buttonMode[2];
  22. int triggerMode[2];
  23. int rumble[2];
  24. int autolevel[2];
  25. int autoswitch[2];
  26. float sensitivityX[2];
  27. float sensitivityY[2];
  28. // Black/White/X assignments, SP:
  29. int hotswapSP[3];
  30. // Black/White for players one & two, MP:
  31. int hotswapMP[4];
  32. // A/V settings, Global:
  33. float effectsVolume;
  34. float musicVolume;
  35. float voiceVolume;
  36. float brightness;
  37. // Subtitles, only used in SP:
  38. int subtitles;
  39. // Voice/Live options, only used in MP:
  40. int voiceMode;
  41. int voiceMask;
  42. int appearOffline;
  43. // INTERFACE:
  44. XBSettings( void );
  45. bool Save( void );
  46. bool Load( void );
  47. void Delete( void );
  48. // For determining why a Save/Load failed:
  49. bool Missing( void );
  50. bool Corrupt( void );
  51. // This copies all settings from the Settings struct to their various cvars
  52. void SetAll( void );
  53. // Turn off the settings file completely:
  54. void Disable( void );
  55. // Has the user turned off saving (by choosing "Continue Without Saving")?
  56. bool IsDisabled( void );
  57. #ifdef XBOX_DEMO
  58. void RestoreDefaults( void );
  59. #endif
  60. private:
  61. bool Sign( XCALCSIG_SIGNATURE *pSig );
  62. };
  63. // One global copy (declared in xb_settings.cpp)
  64. extern XBSettings Settings;
  65. #endif