home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 February / maximum-cd-2009-02.iso / DiscContents / SMC_1.6_win32.exe / src / user / preferences.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-07-01  |  3.4 KB  |  118 lines

  1. /***************************************************************************
  2.  * preferences.h  -  header for the corresponding cpp file
  3.  *
  4.  * Copyright (C) 2003 - 2008 Florian Richter
  5.  ***************************************************************************/
  6. /*
  7.    This program is free software; you can redistribute it and/or modify
  8.    it under the terms of the GNU General Public License as published by
  9.    the Free Software Foundation; either version 3 of the License, or
  10.    (at your option) any later version.
  11.    
  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  14. */
  15.  
  16. #ifndef SMC_PREFERENCES_H
  17. #define SMC_PREFERENCES_H
  18.  
  19. #include "../core/globals.h"
  20.  
  21. /* *** *** *** *** *** cPreferences *** *** *** *** *** *** *** *** *** *** *** *** */
  22.  
  23. class cPreferences : public CEGUI::XMLHandler
  24. {
  25. public:
  26.     cPreferences( void );
  27.     virtual ~cPreferences( void );
  28.     
  29.     // Load the preferences from a file
  30.     bool Load( string filename = "" );
  31.     // Save the preferences to a file
  32.     void Save( void );
  33.  
  34.     // Reset the settings
  35.     void Default( void );
  36.      // Get settings from current game settings
  37.     void Update( void );
  38.     // Set settings to current game settings
  39.     void Apply( void );
  40.     // Set new video settings
  41.     void Apply_Video( Uint16 screen_w, Uint16 screen_h, Uint8 screen_bpp, bool fullscreen, bool vsync, float geometry_detail, float texture_detail );
  42.     // Set new audio settings
  43.     void Apply_Audio( bool sound, bool music );
  44.  
  45.     /* *** *** *** Game Settings *** *** *** *** */
  46.  
  47.     // Game
  48.     // default language
  49.     string language;
  50.     // last version of smc which saved the preferences file
  51.     float game_version;
  52.     // force the given user data directory
  53.     string force_user_data_dir;
  54.     // smart camera speed
  55.     float camera_hor_speed, camera_ver_speed;
  56.  
  57.     // Audio
  58.     bool audio_music, audio_sound;
  59.     unsigned int audio_hz;
  60.  
  61.     // Video
  62.     bool video_fullscreen;
  63.     Uint16 video_screen_w, video_screen_h;
  64.     Uint8 video_screen_bpp;
  65.     bool video_vsync;
  66.  
  67.     // Keyboard
  68.     // key definitions
  69.     SDLKey key_up, key_down, key_left, key_right, key_jump, key_shoot, key_action;
  70.     // scroll speed
  71.     float scroll_speed;
  72.     // Joystick
  73.     bool joy_enabled;
  74.     // active joy name
  75.     string joy_name;
  76.     // jump with upwards
  77.     bool joy_analog_jump;
  78.     // hor/ver axis used
  79.     int joy_axis_hor, joy_axis_ver;
  80.     // axis threshold
  81.     Sint16 joy_axis_threshold;
  82.     // button definitions
  83.     Uint8 joy_button_jump, joy_button_shoot, joy_button_item, joy_button_action, joy_button_exit;
  84.  
  85.  
  86.     // Special
  87.     // player always runs
  88.     bool always_run;
  89.     // hide mouse if clicked on an object
  90.     bool editor_mouse_auto_hide;
  91.     // level background images enabled
  92.     bool level_background_images;
  93.     // image cache enabled
  94.     bool image_cache_enabled;
  95.  
  96.     /* *** *** *** *** *** *** *** */
  97.  
  98.     // configuration filename
  99.     string config_filename;
  100.  
  101. private:
  102.     // XML element start
  103.     virtual void elementStart( const CEGUI::String &element, const CEGUI::XMLAttributes &attributes );
  104.     // XML element end
  105.     virtual void elementEnd( const CEGUI::String &element );
  106.     // handles an item
  107.     void handle_item( const CEGUI::XMLAttributes& attributes );
  108. };
  109.  
  110. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  111.  
  112. // The Preferences
  113. extern cPreferences *pPreferences;
  114.  
  115. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  116.  
  117. #endif
  118.