[Tuxracer-checkins] CVS: tuxracer/src game_config.c,1.31,1.32
Status: Beta
Brought to you by:
jfpatry
From: Jasmin P. <jf...@us...> - 2000-09-30 16:59:04
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv31243 Modified Files: game_config.c Log Message: - Added comments to config parameters; comments are printed in options file. - Cleaned up some parameters: removed a few obsolete ones and added capture_mouse for Voodoo1/2 owners. Index: game_config.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/game_config.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -r1.31 -r1.32 *** game_config.c 2000/09/29 14:52:05 1.31 --- game_config.c 2000/09/30 16:59:01 1.32 *************** *** 114,117 **** --- 114,118 ---- param_val val; param_val deflt; + char *comment; }; *************** *** 120,142 **** */ ! #define INIT_PARAM( nam, val, typename ) \ Params. ## nam ## .loaded = False; \ Params. ## nam ## .name = #nam; \ ! Params. ## nam ## .deflt. ## typename ## _val = val; ! #define INIT_PARAM_STRING( nam, val ) \ ! INIT_PARAM( nam, val, string ); \ Params. ## nam ## .type = PARAM_STRING; ! #define INIT_PARAM_CHAR( nam, val ) \ ! INIT_PARAM( nam, val, char ); \ Params. ## nam ## .type = PARAM_CHAR; ! #define INIT_PARAM_INT( nam, val ) \ ! INIT_PARAM( nam, val, int ); \ Params. ## nam ## .type = PARAM_INT; ! #define INIT_PARAM_BOOL( nam, val ) \ ! INIT_PARAM( nam, val, bool ); \ Params. ## nam ## .type = PARAM_BOOL; --- 121,144 ---- */ ! #define INIT_PARAM( nam, val, typename, commnt ) \ Params. ## nam ## .loaded = False; \ Params. ## nam ## .name = #nam; \ ! Params. ## nam ## .deflt. ## typename ## _val = val; \ ! Params. ## nam ## .comment = commnt; ! #define INIT_PARAM_STRING( nam, val, commnt ) \ ! INIT_PARAM( nam, val, string, commnt ); \ Params. ## nam ## .type = PARAM_STRING; ! #define INIT_PARAM_CHAR( nam, val, commnt ) \ ! INIT_PARAM( nam, val, char, commnt ); \ Params. ## nam ## .type = PARAM_CHAR; ! #define INIT_PARAM_INT( nam, val, commnt ) \ ! INIT_PARAM( nam, val, int, commnt ); \ Params. ## nam ## .type = PARAM_INT; ! #define INIT_PARAM_BOOL( nam, val, commnt ) \ ! INIT_PARAM( nam, val, bool, commnt ); \ Params. ## nam ## .type = PARAM_BOOL; *************** *** 345,354 **** struct param x_resolution; struct param y_resolution; struct param force_window_position; - struct param warp_pointer; - struct param control_mode; /* 0 = keyboard, - 1 = mouse, - 2 = joystick - */ struct param quit_key; struct param turn_left_key; --- 347,352 ---- struct param x_resolution; struct param y_resolution; + struct param capture_mouse; struct param force_window_position; struct param quit_key; struct param turn_left_key; *************** *** 422,479 **** void init_game_configuration() { ! INIT_PARAM_STRING( data_dir, DATA_DIR ); ! INIT_PARAM_BOOL( draw_tux_shadow, False ); ! INIT_PARAM_BOOL( draw_particles, True ); ! INIT_PARAM_INT( tux_sphere_divisions, 6 ); ! INIT_PARAM_INT( tux_shadow_sphere_divisions, 3 ); ! INIT_PARAM_BOOL( nice_fog, True ); ! INIT_PARAM_BOOL( use_sphere_display_list, True ); ! INIT_PARAM_BOOL( display_fps, False ); ! INIT_PARAM_INT( x_resolution, 640 ); ! INIT_PARAM_INT( y_resolution, 480 ); ! INIT_PARAM_BOOL( do_intro_animation, True ); ! INIT_PARAM_INT( mipmap_type, 3 ); ! INIT_PARAM_BOOL( fullscreen, False ); ! INIT_PARAM_BOOL( force_window_position, False ); ! INIT_PARAM_BOOL( warp_pointer, False ); ! INIT_PARAM_INT( ode_solver, 1 ); ! INIT_PARAM_INT( control_mode, 0 ); ! INIT_PARAM_STRING( quit_key, "q escape" ); ! INIT_PARAM_STRING( turn_left_key, "j left" ); ! INIT_PARAM_STRING( turn_right_key, "l right" ); ! INIT_PARAM_STRING( trick_modifier_key, "d" ); ! INIT_PARAM_STRING( brake_key, "k space down" ); ! INIT_PARAM_STRING( paddle_key, "i up" ); ! INIT_PARAM_STRING( follow_view_key, "1" ); ! INIT_PARAM_STRING( behind_view_key, "2" ); ! INIT_PARAM_STRING( above_view_key, "3" ); ! INIT_PARAM_INT( view_mode, 1 ); ! INIT_PARAM_STRING( screenshot_key, "=" ); ! INIT_PARAM_STRING( pause_key, "p" ); ! INIT_PARAM_STRING( reset_key, "backspace" ); ! INIT_PARAM_STRING( jump_key, "e" ); ! INIT_PARAM_INT( fov, 60 ); ! INIT_PARAM_STRING( debug, "" ); ! INIT_PARAM_INT( warning_level, 100 ); ! INIT_PARAM_INT( forward_clip_distance, 75 ); ! INIT_PARAM_INT( backward_clip_distance, 10 ); ! INIT_PARAM_INT( tree_detail_distance, 20 ); ! INIT_PARAM_BOOL( terrain_blending, True ); ! INIT_PARAM_BOOL( perfect_terrain_blending, False ); ! INIT_PARAM_BOOL( terrain_envmap, True ); ! INIT_PARAM_BOOL( use_cva, True ); ! INIT_PARAM_BOOL( cva_hack, True ); ! INIT_PARAM_INT( course_detail_level, 75 ); ! ! INIT_PARAM_BOOL( no_audio, False ); ! INIT_PARAM_BOOL( sound_enabled, True ); ! INIT_PARAM_BOOL( music_enabled, True ); ! INIT_PARAM_INT( sound_volume, 127 ); ! INIT_PARAM_INT( music_volume, 64 ); ! INIT_PARAM_INT( audio_freq_mode, 1 ); ! INIT_PARAM_INT( audio_format_mode, 1 ); ! INIT_PARAM_BOOL( audio_stereo, True ); ! INIT_PARAM_INT( audio_buffer_size, 2048 ); ! INIT_PARAM_BOOL( track_marks, True ); } --- 420,666 ---- void init_game_configuration() { ! INIT_PARAM_STRING( ! data_dir, DATA_DIR, ! "# The location of the Tux Racer data files" ); ! ! INIT_PARAM_BOOL( ! draw_tux_shadow, False, ! "# Set this to true to display Tux's shadow. Note that this is a \n" ! "# hack and is quite expensive in terms of framerate.\n" ! "# [EXPERT] This looks better if your card has a stencil buffer; \n" ! "# if compiling use the --enable-stencil-buffer configure option \n" ! "# to enable the use of the stencil buffer" ); ! ! INIT_PARAM_BOOL( ! draw_particles, True, ! "# Controls the drawing of snow particles that are kicked up as Tux\n" ! "# turns and brakes. Setting this to false should help improve \n" ! "# performance." ); ! ! INIT_PARAM_INT( ! tux_sphere_divisions, 6, ! "# [EXPERT] Higher values result in a more finely subdivided mesh \n" ! "# for Tux, and vice versa. If you're experiencing low framerates,\n" ! "# try lowering this value." ); ! ! INIT_PARAM_INT( ! tux_shadow_sphere_divisions, 3, ! "# [EXPERT] The level of subdivision of Tux's shadow." ); ! ! INIT_PARAM_BOOL( ! nice_fog, True, ! "# [EXPERT] If true, then the GL_NICEST hint will be used when\n" ! "# rendering fog. On some cards, setting this to false may improve\n" ! "# performance."); ! ! INIT_PARAM_BOOL( ! use_sphere_display_list, True, ! "# [EXPERT] Mesa 3.1 sometimes renders Tux strangely when display \n" ! "# lists are used. Setting this to false should solve the problem \n" ! "# at the cost of a few Hz." ); ! ! INIT_PARAM_BOOL( ! display_fps, False, ! "# Set this to true to display the current framerate in Hz." ); ! ! INIT_PARAM_INT( ! x_resolution, 640, ! "# The horizontal size of the Tux Racer window" ); ! ! INIT_PARAM_INT( ! y_resolution, 480, ! "# The vertical size of the Tux Racer window" ); ! ! INIT_PARAM_BOOL( ! capture_mouse, False, ! "# If true, then the mouse will not be able to leave the \n" ! "# Tux Racer window.\n" ! "# Set this to true if you are rendering in fullscreen mode." ); ! ! INIT_PARAM_BOOL( ! do_intro_animation, True, ! "# If false, then the introductory animation sequence will be skipped" ! ); ! ! INIT_PARAM_INT( ! mipmap_type, 3, ! "# [EXPERT] Allows you to control which type of texture\n" ! "# interpolation/mipmapping is used when rendering textures. The\n" ! "# values correspond to the following OpenGL settings:\n" ! "#\n" ! "# 0: GL_NEAREST\n" ! "# 1: GL_LINEAR\n" ! "# 2: GL_NEAREST_MIPMAP_NEAREST\n" ! "# 3: GL_LINEAR_MIPMAP_NEAREST\n" ! "# 4: GL_NEAREST_MIPMAP_LINEAR\n" ! "# 5: GL_LINEAR_MIPMAP_LINEAR\n" ! "#\n" ! "# On some cards, you may be able to improve performance by\n" ! "# decreasing this number, at the cost of lower image quality." ); ! ! INIT_PARAM_BOOL( ! fullscreen, False, ! "# Set this to true to force the window to be the same \n" ! "# size as your screen.\n" ! "# Linux Voodoo1/Voodoo2 users: This is NOT what you want to use to\n" ! "# activate fullscreen rendering on your card." ); ! ! INIT_PARAM_BOOL( ! force_window_position, False , ! "# If true, then the Tux Racer window will automatically be\n" ! "# placed at (0,0)" ); ! ! INIT_PARAM_INT( ! ode_solver, 1 , ! "# Selects the ODE (ordinary differential equation) solver. \n" ! "# Possible values are:\n" ! "#\n" ! "# 0: Modified Euler (fastest but least accurate)\n" ! "# 1: Runge-Kutta (2,3)\n" ! "# 2: Runge-Kutta (4,5) (slowest but most accurate)\n" ); ! ! INIT_PARAM_STRING( ! quit_key, "q escape" , ! "# Key binding for quitting a race" ); ! INIT_PARAM_STRING( ! turn_left_key, "j left" , ! "# Key binding for turning left" ); ! INIT_PARAM_STRING( ! turn_right_key, "l right" , ! "# Key binding for turning right" ); ! INIT_PARAM_STRING( ! trick_modifier_key, "d" , ! "# Key binding for doing tricks" ); ! INIT_PARAM_STRING( ! brake_key, "k space down" , ! "# Key binding for braking" ); ! INIT_PARAM_STRING( ! paddle_key, "i up" , ! "# Key binding for paddling (on the ground) and flapping (in the air)" ! ); ! INIT_PARAM_STRING( ! follow_view_key, "1" , ! "# Key binding for the \"Follow\" camera mode" ); ! INIT_PARAM_STRING( ! behind_view_key, "2" , ! "# Key binding for the \"Behind\" camera mode" ); ! INIT_PARAM_STRING( ! above_view_key, "3" , ! "# Key binding for the \"Above\" camera mode" ); ! INIT_PARAM_INT( ! view_mode, 1 , ! "# Default view mode. Possible values are\n" ! "#\n" ! "# 0: Behind\n" ! "# 1: Follow\n" ! "# 2: Above" ); ! INIT_PARAM_STRING( ! screenshot_key, "=" , ! "# Key binding for taking a screenshot" ); ! INIT_PARAM_STRING( ! pause_key, "p" , ! "# Key binding for pausing the game" ); ! INIT_PARAM_STRING( ! reset_key, "backspace" , ! "# Key binding for resetting the player position" ); ! INIT_PARAM_STRING( ! jump_key, "e" , ! "# Key binding for jumping" ); ! INIT_PARAM_INT( ! fov, 60 , ! "# [EXPERT] Sets the camera field-of-view" ); ! INIT_PARAM_STRING( ! debug, "" , ! "# [EXPERT] Controls the Tux Racer debugging modes" ); ! INIT_PARAM_INT( ! warning_level, 100 , ! "# [EXPERT] Controls the Tux Racer warning messages" ); ! INIT_PARAM_INT( ! forward_clip_distance, 75 , ! "# Controls how far ahead the course of the camera the course\n" ! "# is rendered. Larger values mean that more of the course is\n" ! "# rendered, resulting in slower performance. Decreasing this \n" ! "# value is an effective way to improve framerates." ); ! INIT_PARAM_INT( ! backward_clip_distance, 10 , ! "# [EXPERT] Some objects aren't yet clipped to the view frustum, \n" ! "# so this value is used to control how far up the course these \n" ! "# objects are drawn." ); ! INIT_PARAM_INT( ! tree_detail_distance, 20 , ! "# [EXPERT] Controls the distance at which trees are drawn with \n" ! "# two rectangles instead of one." ); ! INIT_PARAM_BOOL( ! terrain_blending, True , ! "# Controls the blending of the terrain textures. Setting this\n" ! "# to false will help improve performance." ); ! INIT_PARAM_BOOL( ! perfect_terrain_blending, False , ! "# [EXPERT] If true, then terrain triangles with three different\n" ! "# terrain types at the vertices will be blended correctly\n" ! "# (instead of using a faster but imperfect approximation)" ); ! INIT_PARAM_BOOL( ! terrain_envmap, True , ! "# If true, then the ice will be drawn with an \"environment map\",\n" ! "# which gives the ice a shiny appearance. Setting this to false\n" ! "# will help improve performance" ); ! INIT_PARAM_BOOL( ! use_cva, True , ! "# [EXPERT] If true, then compiled vertex arrays will be used when\n" ! "# drawing the terrain. Whether or not this helps performance\n" ! "# is driver- and card-dependent" ); ! INIT_PARAM_BOOL( ! cva_hack, True , ! "# Some card/driver combinations render the terrrain incorrectly\n" ! "# when using compiled vertex arrays. This activates a hack \n" ! "# to work around that problem." ); ! INIT_PARAM_INT( ! course_detail_level, 75 , ! "# [EXPERT] This controls how accurately the course terrain is \n" ! "# rendered. A high value results in greater accuracy at the cost of \n" ! "# performance, and vice versa. This value can be decreased and \n" ! "# increased in 10% increments at runtime using the F9 and F10 keys.\n" ! "# To better see the effect, activate wireframe mode using the F11 \n" ! "# key (this is a toggle)." ); ! INIT_PARAM_BOOL( ! no_audio, False , ! "# If True, then audio in the game is completely disabled." ); ! INIT_PARAM_BOOL( ! sound_enabled, True , ! "# Use this to turn sound effects on and off" ); ! INIT_PARAM_BOOL( ! music_enabled, True , ! "# Use this to turn music on and off" ); ! INIT_PARAM_INT( ! sound_volume, 127 , ! "# This controls the sound volume (valid range is 0-127)" ); ! INIT_PARAM_INT( ! music_volume, 64 , ! "# This controls the music volume (valid range is 0-127)" ); ! INIT_PARAM_INT( ! audio_freq_mode, 1 , ! "# The controls the frequency of the audio. Valid values are:\n" ! "# \n" ! "# 0: 11025 Hz\n" ! "# 1: 22050 Hz\n" ! "# 2: 44100 Hz" ); ! INIT_PARAM_INT( ! audio_format_mode, 1 , ! "# This controls the number of bits per sample for the audio.\n" ! "# Valid values are:\n" ! "#\n" ! "# 0: 8 bits\n" ! "# 1: 16 bits\n" ); ! INIT_PARAM_BOOL( ! audio_stereo, True , ! "# Audio will be played in stereo of true, and mono if false" ); ! INIT_PARAM_INT( ! audio_buffer_size, 2048 , ! "# [EXPERT] Controls the size of the audio buffer. \n" ! "# Increase the buffer size if you experience choppy audio\n" ! "# (at the cost of greater audio latency" ); ! INIT_PARAM_BOOL( ! track_marks, True , ! "# If true, then the players will leave track marks in the snow" ); } *************** *** 493,501 **** FN_PARAM_INT( x_resolution ) FN_PARAM_INT( y_resolution ) FN_PARAM_BOOL( do_intro_animation ) FN_PARAM_INT( mipmap_type ) FN_PARAM_BOOL( fullscreen ) FN_PARAM_BOOL( force_window_position ) - FN_PARAM_BOOL( warp_pointer ) FN_PARAM_INT( ode_solver ) FN_PARAM_STRING( quit_key ) --- 680,688 ---- FN_PARAM_INT( x_resolution ) FN_PARAM_INT( y_resolution ) + FN_PARAM_BOOL( capture_mouse ) FN_PARAM_BOOL( do_intro_animation ) FN_PARAM_INT( mipmap_type ) FN_PARAM_BOOL( fullscreen ) FN_PARAM_BOOL( force_window_position ) FN_PARAM_INT( ode_solver ) FN_PARAM_STRING( quit_key ) *************** *** 710,716 **** "# Tux Racer " VERSION " configuration file\n" "#\n" ! "# See the README file distributed with the program for\n" ! "# descriptions of these parameters.\n" ! "# Note: this file is parsed using Tcl, so Tcl syntax applies.\n" "#\n" ); --- 897,901 ---- "# Tux Racer " VERSION " configuration file\n" "#\n" ! "# Note: This file is overwritten each time Tux Racer is run.\n" "#\n" ); *************** *** 718,721 **** --- 903,910 ---- for (i=0; i<sizeof(Params)/sizeof(struct param); i++) { parm = (struct param*)&Params + i; + if ( parm->comment != NULL ) { + fprintf( config_stream, "\n# %s\n#\n%s\n#\n", + parm->name, parm->comment ); + } switch ( parm->type ) { case PARAM_STRING: |