ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/cfplus
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/cfplus (file contents):
Revision 1.202 by root, Sat Aug 4 03:29:03 2007 UTC vs.
Revision 1.203 by root, Mon Aug 6 02:11:45 2007 UTC

239 my $meta = $CONN->{sound_meta}{$face} 239 my $meta = $CONN->{sound_meta}{$face}
240 or return; 240 or return;
241 241
242 # if its a jingle, play it as ambient music 242 # if its a jingle, play it as ambient music
243 if ($meta->{meta}{jingle}) { 243 if ($meta->{meta}{jingle}) {
244 delete $AUDIO_PLAY{$face}; # take the jingle out of the sound queue 244 if (delete $AUDIO_PLAY{$face}) { # take the jingle out of the sound queue
245 push @MUSIC_JINGLE, $meta; # push it oto the music/jingle queue 245 push @MUSIC_JINGLE, $meta; # push it oto the music/jingle queue
246 &audio_music_push ($face); 246 &audio_music_push ($face);
247 }
247 } else { 248 } else {
248 # fetch from database 249 # fetch from database
249 CFPlus::DB::get res_data => $meta->{name}, sub { 250 CFPlus::DB::get res_data => $meta->{name}, sub {
250 my $rwops = new CFPlus::RW $_[0]; 251 my $rwops = new CFPlus::RW $_[0];
251 my $chunk = new CFPlus::MixChunk $rwops; 252 my $chunk = new CFPlus::MixChunk $rwops
253 or Carp::confess "sound face $meta->{face} unloadable: " . CFPlus::Mix_GetError;
252 $chunk->volume (($meta->{meta}{volume} || 1) * 128); 254 $chunk->volume (($meta->{meta}{volume} || 1) * 128);
253 $AUDIO_CHUNK{$face} = $chunk; 255 $AUDIO_CHUNK{$face} = $chunk;
254 256
255 audio_sound_push ($face); 257 audio_sound_push ($face);
256 }; 258 };
308 my $rwops = $meta->{path} 310 my $rwops = $meta->{path}
309 ? new_from_file CFPlus::RW $meta->{path} 311 ? new_from_file CFPlus::RW $meta->{path}
310 : new CFPlus::RW $$MUSIC_PLAYING_DATA; 312 : new CFPlus::RW $$MUSIC_PLAYING_DATA;
311 313
312 $MUSIC_PLAYER = new CFPlus::MixMusic $rwops 314 $MUSIC_PLAYER = new CFPlus::MixMusic $rwops
313 or ((warn CFPlus::Mix_GetError), return); # pretty fatal error 315 or Carp::confess "music face $meta->{face} unloadable: " . CFPlus::Mix_GetError;
314 316
315 my $NOW = time; 317 my $NOW = time;
316 318
317 if ($MUSIC_PLAYING_META->{stop_time} > $NOW - $MUSIC_RESUME) { 319 if ($MUSIC_PLAYING_META->{stop_time} > $NOW - $MUSIC_RESUME) {
318 my $pos = $MUSIC_PLAYING_META->{stop_pos}; 320 my $pos = $MUSIC_PLAYING_META->{stop_pos};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines