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.187 by elmex, Fri Jul 27 18:04:43 2007 UTC vs.
Revision 1.188 by root, Sun Jul 29 03:58:26 2007 UTC

1840 1840
1841 # music might have changed... 1841 # music might have changed...
1842 $path eq $MUSIC_PLAYING->{path} 1842 $path eq $MUSIC_PLAYING->{path}
1843 or return &audio_music_start (); 1843 or return &audio_music_start ();
1844 1844
1845 my $rwops = new_from_file CFPlus::RW $path;
1845 $MUSIC_PLAYER = new_from_file CFPlus::MixMusic $path; 1846 $MUSIC_PLAYER = new CFPlus::MixMusic $rwops;
1846 1847
1847 my $NOW = time; 1848 my $NOW = time;
1848 1849
1849 if ($MUSIC_PLAYING->{stop_time} > $NOW - $MUSIC_RESUME) { 1850 if ($MUSIC_PLAYING->{stop_time} > $NOW - $MUSIC_RESUME) {
1850 my $pos = $MUSIC_PLAYING->{stop_pos}; 1851 my $pos = $MUSIC_PLAYING->{stop_pos};
1900} 1901}
1901 1902
1902sub audio_init { 1903sub audio_init {
1903 if ($CFG->{audio_enable}) { 1904 if ($CFG->{audio_enable}) {
1904 if (open my $fh, "<", CFPlus::find_rcfile "sounds/config") { 1905 if (open my $fh, "<", CFPlus::find_rcfile "sounds/config") {
1906 $ENV{MIX_EFFECTSMAXSPEED} = 1;
1905 $SDL_MIXER = !CFPlus::Mix_OpenAudio; 1907 $SDL_MIXER = !CFPlus::Mix_OpenAudio;
1906 1908
1907 unless ($SDL_MIXER) { 1909 unless ($SDL_MIXER) {
1908 status "Unable to open sound device: there will be no sound"; 1910 status "Unable to open sound device: there will be no sound";
1909 return; 1911 return;
1922 my ($file, $volume, $event) = split /\s+/, $_, 3; 1924 my ($file, $volume, $event) = split /\s+/, $_, 3;
1923 1925
1924 push @SOUNDS, "$volume,$file"; 1926 push @SOUNDS, "$volume,$file";
1925 1927
1926 $AUDIO_CHUNKS{"$volume,$file"} ||= do { 1928 $AUDIO_CHUNKS{"$volume,$file"} ||= do {
1927 my $chunk = new_from_file CFPlus::MixChunk CFPlus::find_rcfile "sounds/$file"; 1929 my $rwops = new_from_file CFPlus::RW CFPlus::find_rcfile "sounds/$file";
1930 my $chunk = new CFPlus::MixChunk $rwops;
1928 $chunk->volume ($volume * 128 / 100); 1931 $chunk->volume ($volume * 128 / 100);
1929 $chunk 1932 $chunk
1930 }; 1933 };
1931 } 1934 }
1932 } else { 1935 } else {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines