Merge pull request #1283 from Gymnasiast/sound-settings-remnants

Force best sound quality and software buffering
This commit is contained in:
Ted John 2015-06-09 23:06:44 +01:00
commit 92daca54b8
4 changed files with 10 additions and 23 deletions

View File

@ -1764,10 +1764,10 @@ void audio_init2(int device)
ride_music->rideid = -1;
}
}
// Used by original code for directsound
if (!(RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & 1 << 4)) {
gConfigSound.forced_software_buffering = RCT2_GLOBAL(0x001425B74, uint32) != RCT2_GLOBAL(0x001425B78, uint32) || RCT2_GLOBAL(0x001425B74, uint32) != RCT2_GLOBAL(0x001425B7C, uint32);
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) |= 1 << 4;
config_save_default();
}
// When all sound code is reversed this can be removed.
@ -1881,4 +1881,4 @@ void stop_vehicle_sounds()
vehicle_sound->id = 0xFFFF;
}
}
}
}

View File

@ -186,8 +186,6 @@ config_property_definition _interfaceDefinitions[] = {
};
config_property_definition _soundDefinitions[] = {
{ offsetof(sound_configuration, forced_software_buffering), "forced_software_buffering", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL },
{ offsetof(sound_configuration, sound_quality), "sound_quality", CONFIG_VALUE_TYPE_UINT8, 2, NULL },
{ offsetof(sound_configuration, title_music), "title_music", CONFIG_VALUE_TYPE_UINT8, 2, NULL },
{ offsetof(sound_configuration, sound), "sound", CONFIG_VALUE_TYPE_BOOLEAN, true, NULL },
{ offsetof(sound_configuration, ride_music), "ride_music", CONFIG_VALUE_TYPE_BOOLEAN, true, NULL },
@ -749,8 +747,9 @@ void config_apply_to_old_addresses()
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, sint8) = gConfigGeneral.measurement_format;
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_TEMPERATURE, sint8) = gConfigGeneral.temperature_format;
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER, uint8) = gConfigGeneral.construction_marker_colour;
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, sint8) = gConfigSound.sound_quality;
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_SW_BUFFER, sint8) = gConfigSound.forced_software_buffering;
// Force best sound quality and software buffering, for original code.
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, sint8) = 2;
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_SW_BUFFER, sint8) = 1;
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, sint16) = (gConfigGeneral.measurement_format + 1) * 256;
if (gConfigGeneral.show_height_as_units)
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, sint16) = 0;
@ -830,9 +829,9 @@ void config_dat_load()
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) &= !CONFIG_FLAG_SAVE_PLUGIN_DATA;
}
//sound configuration
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, sint8) = gConfigSound.sound_quality;
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_SW_BUFFER, sint8) = gConfigSound.forced_software_buffering;
//sound configuration: force software buffering and best quality
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, sint8) = 2;
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_SW_BUFFER, sint8) = 1;
// Line below is temporaraly disabled until all config is in the new format.
//if (RCT2_GLOBAL(0x009AB4C6, sint8) == 1)
@ -1389,4 +1388,4 @@ static theme_property_definition *themes_get_property_def(theme_section_definiti
return NULL;
}
#pragma endregion
#pragma endregion

View File

@ -89,13 +89,6 @@ enum {
MEASUREMENT_FORMAT_METRIC
};
enum{
SOUND_QUALITY_LOW,
SOUND_QUALITY_MEDIUM,
SOUND_QUALITY_HIGH
};
enum {
AUTOSAVE_EVERY_WEEK,
AUTOSAVE_EVERY_2_WEEKS,
@ -151,8 +144,6 @@ typedef struct {
} interface_configuration;
typedef struct {
sint8 forced_software_buffering;
sint8 sound_quality;
uint8 title_music;
uint8 sound;
uint8 ride_music;

View File

@ -1047,9 +1047,6 @@ static void window_options_invalidate()
// music: on/off
RCT2_GLOBAL(0x013CE952 + 8, uint16) = STR_OFF + RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_MUSIC, uint8);
// sound quality: low/medium/high
RCT2_GLOBAL(0x013CE952 + 10, uint16) = STR_SOUND_LOW + gConfigSound.sound_quality;
widget_set_checkbox_value(w, WIDX_SOUND_CHECKBOX, gConfigSound.sound);
widget_set_checkbox_value(w, WIDX_MUSIC_CHECKBOX, RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_MUSIC, uint8));