… | |
… | |
9 | use SDL; |
9 | use SDL; |
10 | use SDL::App; |
10 | use SDL::App; |
11 | use SDL::Event; |
11 | use SDL::Event; |
12 | use SDL::Surface; |
12 | use SDL::Surface; |
13 | |
13 | |
|
|
14 | use SDL::Mixer; |
14 | use SDL::Sound; |
15 | use SDL::Sound; |
15 | use SDL::Mixer; |
16 | use SDL::Music; |
16 | |
17 | |
17 | use SDL::OpenGL; |
18 | use SDL::OpenGL; |
18 | |
19 | |
19 | use Crossfire; |
20 | use Crossfire; |
20 | use Crossfire::Protocol; |
21 | use Crossfire::Protocol; |
… | |
… | |
465 | $CFClient::UI::ROOT->{children} = []; |
466 | $CFClient::UI::ROOT->{children} = []; |
466 | undef $SDL_ACTIVE; |
467 | undef $SDL_ACTIVE; |
467 | undef $SDL_EV; |
468 | undef $SDL_EV; |
468 | } |
469 | } |
469 | |
470 | |
|
|
471 | my $bgmusic;#TODO#hack#d# |
|
|
472 | |
470 | sub audio_init { |
473 | sub audio_init { |
471 | if ($CFG->{sound} || 1) { |
474 | if ($CFG->{sound} || 1) { |
472 | if (open my $fh, "<:utf8", CFClient::find_rcfile "sounds/config") { |
475 | if (open my $fh, "<:utf8", CFClient::find_rcfile "sounds/config") { |
473 | $SDL_MIXER = new SDL::Mixer; |
476 | $SDL_MIXER = new SDL::Mixer; |
474 | $SDL_MIXER->allocate_channels (8); |
477 | $SDL_MIXER->allocate_channels (8); |
|
|
478 | |
|
|
479 | $bgmusic = new SDL::Music CFClient::find_rcfile "music/game3.ogg"; |
|
|
480 | $SDL_MIXER->play_music ($bgmusic, 0); |
475 | |
481 | |
476 | while (<$fh>) { |
482 | while (<$fh>) { |
477 | next if /^\s*#/; |
483 | next if /^\s*#/; |
478 | next if /^\s*$/; |
484 | next if /^\s*$/; |
479 | |
485 | |