- Timestamp:
- Apr 15, 2004, 8:38:20 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/bensch/orxonox_gui_file.c
r1829 r1831 36 36 37 37 IOFILE = fopen( local_config_file, "w"); 38 if (verbose >= 1) 39 printf ("Saving settings to %s\n", local_config_file); 40 41 fprintf (IOFILE, "%s\n", "Configuration file of orxonox (do not edit if ou do not know what you are doing)"); 42 fprintf (IOFILE, "orxonox_settings->video_fullscreen = %i\n", orxonox_settings->video_fullscreen); 43 fprintf (IOFILE, "orxonox_settings->video_wireframe = %i\n", orxonox_settings->video_wireframe); 44 45 fprintf (IOFILE, "orxonox_settings->audio_enable_sound = %i\n", orxonox_settings->audio_enable_sound); 46 fprintf (IOFILE, "orxonox_settings->audio_music_volume = %i\n", orxonox_settings->audio_music_volume); 47 fprintf (IOFILE, "orxonox_settings->audio_effects_volume = %i\n", orxonox_settings->audio_effects_volume); 48 49 fprintf (IOFILE, "orxonox_settings->exec_save_settings = %i\n", orxonox_settings->exec_save_settings); 50 fprintf (IOFILE, "orxonox_settings->exec_show_menu = %i\n", orxonox_settings->exec_show_menu); 51 52 fprintf (IOFILE, "orxonox_settings->verbose = %i\n", verbose); 53 54 fclose( IOFILE ); 55 return; 38 if (IOFILE) 39 { 40 if (verbose >= 1) 41 printf ("Saving settings to '%s'\n", local_config_file); 42 43 fprintf (IOFILE, "%s\n", "Configuration file of orxonox (do not edit if ou do not know what you are doing)"); 44 fprintf (IOFILE, "orxonox_settings->video_fullscreen = %i\n", orxonox_settings->video_fullscreen); 45 fprintf (IOFILE, "orxonox_settings->video_wireframe = %i\n", orxonox_settings->video_wireframe); 46 47 fprintf (IOFILE, "orxonox_settings->audio_enable_sound = %i\n", orxonox_settings->audio_enable_sound); 48 fprintf (IOFILE, "orxonox_settings->audio_music_volume = %i\n", orxonox_settings->audio_music_volume); 49 fprintf (IOFILE, "orxonox_settings->audio_effects_volume = %i\n", orxonox_settings->audio_effects_volume); 50 51 fprintf (IOFILE, "orxonox_settings->exec_save_settings = %i\n", orxonox_settings->exec_save_settings); 52 fprintf (IOFILE, "orxonox_settings->exec_show_menu = %i\n", orxonox_settings->exec_show_menu); 53 54 fprintf (IOFILE, "orxonox_settings->verbose = %i\n", verbose); 55 56 fclose( IOFILE ); 57 return; 58 } 59 else 60 { 61 if (verbose >= 1) 62 printf ("Settingsfile '%s' does not exist.\n", local_config_file); 63 } 56 64 } 57 65 … … 75 83 76 84 IOFILE = fopen(local_config_file, "r"); 77 if (verbose >= 1) 78 printf ("Loading settings from '%s'\n", local_config_file); 79 80 fscanf (IOFILE, "Configuration file of orxonox (do not edit if ou do not know what you are doing)"); 81 while (fscanf (IOFILE,"%s %s %s", variable, equals, value) != EOF) 85 if (IOFILE) 82 86 { 83 if ( !strcmp (variable, "orxonox_settings->video_fullscreen")) 87 if (verbose >= 1) 88 printf ("Loading settings from '%s'\n", local_config_file); 89 90 fscanf (IOFILE, "Configuration file of orxonox (do not edit if ou do not know what you are doing)"); 91 while (fscanf (IOFILE,"%s %s %s", variable, equals, value) != EOF) 84 92 { 85 orxonox_settings->video_fullscreen = atoi (value); 93 if ( !strcmp (variable, "orxonox_settings->video_fullscreen")) 94 { 95 orxonox_settings->video_fullscreen = atoi (value); 96 } 97 else if ( !strcmp (variable, "orxonox_settings->video_wireframe")) 98 { 99 orxonox_settings->video_wireframe = atoi (value); 100 } 101 102 else if ( !strcmp (variable, "orxonox_settings->audio_enable_sound")) 103 { 104 orxonox_settings->audio_enable_sound = atoi (value); 105 } 106 else if ( !strcmp (variable, "orxonox_settings->audio_music_volume")) 107 { 108 orxonox_settings->audio_music_volume = atoi (value); 109 } 110 else if ( !strcmp (variable, "orxonox_settings->audio_effects_volume")) 111 { 112 orxonox_settings->audio_effects_volume = atoi (value); 113 } 114 115 else if ( !strcmp (variable, "orxonox_settings->exec_save_settings")) 116 { 117 orxonox_settings->exec_save_settings = atoi (value); 118 } 119 else if ( !strcmp (variable, "orxonox_settings->exec_show_menu")) 120 { 121 orxonox_settings->exec_show_menu = atoi (value); 122 } 123 124 else if ( !strcmp (variable, "orxonox_settings->verbose")) 125 { 126 verbose = atoi (value); 127 } 128 86 129 } 87 else if ( !strcmp (variable, "orxonox_settings->video_wireframe")) 88 { 89 orxonox_settings->video_wireframe = atoi (value); 90 } 130 fclose( IOFILE ); 131 return; 132 } 91 133 92 else if ( !strcmp (variable, "orxonox_settings->audio_enable_sound")) 93 { 94 orxonox_settings->audio_enable_sound = atoi (value); 95 } 96 else if ( !strcmp (variable, "orxonox_settings->audio_music_volume")) 97 { 98 orxonox_settings->audio_music_volume = atoi (value); 99 } 100 else if ( !strcmp (variable, "orxonox_settings->audio_effects_volume")) 101 { 102 orxonox_settings->audio_effects_volume = atoi (value); 103 } 104 105 else if ( !strcmp (variable, "orxonox_settings->exec_save_settings")) 106 { 107 orxonox_settings->exec_save_settings = atoi (value); 108 } 109 else if ( !strcmp (variable, "orxonox_settings->exec_show_menu")) 110 { 111 orxonox_settings->exec_show_menu = atoi (value); 112 } 113 114 else if ( !strcmp (variable, "orxonox_settings->verbose")) 115 { 116 verbose = atoi (value); 117 } 118 134 else 135 { 136 if (verbose >= 1) 137 printf ("File '%s' does not exist. Can not load orxonox-states.\n", local_config_file); 119 138 } 120 fclose( IOFILE );121 return;122 139 } 123
Note: See TracChangeset
for help on using the changeset viewer.