1 #pragma once 2 3 //******************************************************************************************** 4 //* 5 //* This file is part of Egoboo. 6 //* 7 //* Egoboo is free software: you can redistribute it and/or modify it 8 //* 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 //* Egoboo is distributed in the hope that it will be useful, but 13 //* WITHOUT ANY WARRANTY; without even the implied warranty of 14 //* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 //* General Public License for more details. 16 //* 17 //* You should have received a copy of the GNU General Public License 18 //* along with Egoboo. If not, see <http://www.gnu.org/licenses/>. 19 //* 20 //******************************************************************************************** 21 22 #include "egoboo_typedef.h" 23 24 #if defined(__cplusplus) 25 extern "C" 26 { 27 #endif 28 29 //-------------------------------------------------------------------------------------------- 30 // CONSTANTS 31 //-------------------------------------------------------------------------------------------- 32 33 // The possible levels of game difficulty 34 enum e_game_difficulty 35 { 36 GAME_EASY = 0, 37 GAME_NORMAL, 38 GAME_HARD 39 }; 40 41 //-------------------------------------------------------------------------------------------- 42 // What feedback does the user want 43 typedef enum e_feedback 44 { 45 FEEDBACK_OFF = 0, //None 46 FEEDBACK_TEXT, //Descriptive text 47 FEEDBACK_NUMBER //Show the damage as a number 48 } FEEDBACK_TYPE; 49 50 //-------------------------------------------------------------------------------------------- 51 // struct s_egoboo_config 52 //-------------------------------------------------------------------------------------------- 53 54 /// The internal representation of the data in "settings.txt" 55 struct s_egoboo_config 56 { 57 // {GRAPHIC} 58 bool_t fullscreen_req; ///< Start in fullscreen? 59 int scrd_req; ///< Screen bit depth 60 int scrz_req; ///< Screen z-buffer depth ( 8 unsupported ) 61 int scrx_req; ///< Screen X size 62 int scry_req; ///< Screen Y size 63 bool_t use_perspective; ///< Perspective correct textures? 64 bool_t use_dither; ///< Dithering? 65 bool_t reflect_allowed; ///< Reflections? 66 Uint8 reflect_fade; ///< 255 = Don't fade reflections 67 bool_t reflect_prt; ///< Reflect particles? 68 bool_t shadow_allowed; ///< Shadows? 69 bool_t shadow_sprite; ///< Shadow sprites? 70 bool_t use_phong; ///< Do phong overlay? 71 bool_t twolayerwater_allowed; ///< Two layer water? 72 bool_t overlay_allowed; ///< Allow large overlay? 73 bool_t background_allowed; ///< Allow large background? 74 bool_t fog_allowed; 75 bool_t gouraud_req; ///< Gouraud shading? 76 Uint8 multisamples; ///< Antialiasing? 77 Uint8 texturefilter_req; ///< Texture filtering? 78 int dyna_count_req; ///< Max number of lights to draw 79 Sint32 framelimit; 80 Uint16 particle_count_req; ///< max number of particles 81 82 // {SOUND} 83 bool_t sound_allowed; 84 bool_t music_allowed; 85 Uint8 music_volume; ///< The sound volume of music 86 Uint8 sound_volume; ///< Volume of sounds played 87 Uint16 sound_channel_count; ///< Max number of sounds playing at the same time 88 Uint16 sound_buffer_size; 89 bool_t sound_highquality; 90 bool_t sound_highquality_base; 91 bool_t sound_footfall; 92 93 // {NETWORK} 94 bool_t network_allowed; ///< Try to connect? 95 int network_lag; ///< Lag tolerance 96 char network_hostname[64]; ///< Name for hosting session 97 char network_messagename[64]; ///< Name for messages 98 99 // {GAME} 100 int message_count_req; 101 Uint16 message_duration; ///< Time to keep the message alive 102 bool_t StatusList_on; ///< Draw the status bars? 103 Uint8 autoturncamera; ///< Type of camera control... 104 bool_t fps_allowed; ///< FPS displayed? 105 FEEDBACK_TYPE feedback; ///< Feedback type 106 Uint8 difficulty; ///< What is the current game difficulty 107 108 // {DEBUG} 109 bool_t hide_mouse; 110 bool_t grab_mouse; 111 bool_t dev_mode; 112 bool_t sdl_image_allowed; ///< Allow advanced SDL_Image functions? 113 114 }; 115 typedef struct s_egoboo_config egoboo_config_t; 116 117 extern egoboo_config_t cfg; 118 119 //-------------------------------------------------------------------------------------------- 120 // EXTERNAL FUNCTION PROTOTYPES 121 //-------------------------------------------------------------------------------------------- 122 123 bool_t setup_read_vfs(); 124 bool_t setup_write(); 125 bool_t setup_quit(); 126 127 bool_t setup_download( egoboo_config_t * pcfg ); 128 bool_t setup_upload( egoboo_config_t * pcfg ); 129 bool_t setup_synch( egoboo_config_t * pcfg ); 130 131 bool_t input_settings_save_vfs( const char* whichfile ); 132 bool_t input_settings_load_vfs( const char *szFilename ); 133 134 //-------------------------------------------------------------------------------------------- 135 //-------------------------------------------------------------------------------------------- 136 137 #if defined(__cplusplus) 138 } 139 #endif 140 141 //-------------------------------------------------------------------------------------------- 142 //-------------------------------------------------------------------------------------------- 143 144 #define _egoboo_setup_h 145