--- deliantra/Deliantra-Client/bin/cfplus 2007/08/03 02:20:32 1.201 +++ deliantra/Deliantra-Client/bin/cfplus 2007/08/06 05:06:33 1.204 @@ -241,14 +241,16 @@ # if its a jingle, play it as ambient music if ($meta->{meta}{jingle}) { - delete $AUDIO_PLAY{$face}; # take the jingle out of the sound queue - push @MUSIC_JINGLE, $meta; # push it oto the music/jingle queue - &audio_music_push ($face); + if (delete $AUDIO_PLAY{$face}) { # take the jingle out of the sound queue + push @MUSIC_JINGLE, $meta; # push it oto the music/jingle queue + &audio_music_push ($face); + } } else { # fetch from database CFPlus::DB::get res_data => $meta->{name}, sub { my $rwops = new CFPlus::RW $_[0]; - my $chunk = new CFPlus::MixChunk $rwops; + my $chunk = new CFPlus::MixChunk $rwops + or Carp::confess "sound face $meta->{face} unloadable: " . CFPlus::Mix_GetError; $chunk->volume (($meta->{meta}{volume} || 1) * 128); $AUDIO_CHUNK{$face} = $chunk; @@ -310,7 +312,7 @@ : new CFPlus::RW $$MUSIC_PLAYING_DATA; $MUSIC_PLAYER = new CFPlus::MixMusic $rwops - or ((warn CFPlus::Mix_GetError), return); # pretty fatal error + or Carp::confess "music face $meta->{face} unloadable: " . CFPlus::Mix_GetError; my $NOW = time; @@ -353,8 +355,7 @@ } # if the currently playing song is acceptable, let it continue - return if $MUSIC_PLAYING_META - && grep $MUSIC_PLAYING_META == $_, @MUSIC_HAVE; + return if grep $MUSIC_PLAYING_META == $_, @MUSIC_HAVE; my $NOW = time; @@ -421,8 +422,6 @@ undef $MUSIC_PLAYING_META; undef $MUSIC_PLAYING_DATA; - audio_music_set_meta { }; - $MUSIC_WANT = []; @MUSIC_JINGLE = (); %AUDIO_PLAY = (); @@ -2286,13 +2285,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 @@ -2300,8 +2301,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