--- deliantra/Deliantra-Client/bin/cfplus 2007/08/06 02:11:45 1.203 +++ deliantra/Deliantra-Client/bin/cfplus 2007/08/09 03:40:44 1.206 @@ -219,6 +219,9 @@ $CFG->{effects_enable} or return; + $AUDIO_PLAY{$face} + or return; + if (my $chunk = $AUDIO_CHUNK{$face}) { for (grep $_->[0] >= Event::time, @{(delete $AUDIO_PLAY{$face}) || []}) { my (undef, $dx, $dy, $vol) = @$_; @@ -250,7 +253,7 @@ CFPlus::DB::get res_data => $meta->{name}, sub { my $rwops = new CFPlus::RW $_[0]; my $chunk = new CFPlus::MixChunk $rwops - or Carp::confess "sound face $meta->{face} unloadable: " . CFPlus::Mix_GetError; + or Carp::confess "sound face " . (JSON::XS::to_json $meta) . " unloadable: " . CFPlus::Mix_GetError; $chunk->volume (($meta->{meta}{volume} || 1) * 128); $AUDIO_CHUNK{$face} = $chunk; @@ -422,8 +425,6 @@ undef $MUSIC_PLAYING_META; undef $MUSIC_PLAYING_DATA; - audio_music_set_meta { }; - $MUSIC_WANT = []; @MUSIC_JINGLE = (); %AUDIO_PLAY = (); @@ -881,16 +882,20 @@ # $CFG->{effects_volume} = $_[1]; # }); - $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Effects Volume"); + $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Sound Effects"); $table->add_at (1, $row, new CFPlus::UI::CheckBox expand => 1, state => $CFG->{effects_enable}, tooltip => "If enabled, sound effects are enabled. If disabled, no sound effects will be played.", - on_changed => sub { $CFG->{effects_enable} = $_[1]; 0 } + on_changed => sub { + $CFG->{effects_enable} = $_[1]; + $CONN->update_fx_want if $CONN; + 0 + } ); $table->add_at (2, $row++, new CFPlus::UI::Slider expand => 1, range => [$CFG->{effects_volume}, 0, 1, 0, 1/128], tooltip => "The relative volume of sound effects. Best audio quality is achieved if this " - . "is set highest and you use your operating system volume setting. Changes are instant.", + . "is set highest (rightmost) and you use your operating system volume setting. Changes are instant.", on_changed => sub { $CFG->{effects_volume} = $_[1]; 0 } ); @@ -898,7 +903,11 @@ $table->add_at (1, $row, new CFPlus::UI::CheckBox expand => 1, state => $CFG->{bgm_enable}, tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.", - on_changed => sub { $CFG->{bgm_enable} = $_[1]; 0 } + on_changed => sub { + $CFG->{bgm_enable} = $_[1]; + $CONN->update_fx_want if $CONN; + 0 + } ); $table->add_at (2, $row++, new CFPlus::UI::Slider expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128], @@ -2287,13 +2296,15 @@ #CFPlus::_exit 0; END { + video_shutdown; + audio_shutdown; CFPlus::SDL_Quit; CFPlus::DB::Server::stop; } =head1 NAME -cfplus - A Crossfire+ and Crossfire game client +cfplus - A Crossfire TRT and Crossfire game client =head1 SYNOPSIS @@ -2301,8 +2312,8 @@ =head1 USAGE -cfplus utilises OpenGL for all UI elements and the game. It is supposed to be used -fullscreen and interactively. +cfplus utilises OpenGL for all UI elements and the game. It is supposed to +be used in fullscreen mode and interactively. =head1 DEBUGGING