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.197 by root, Tue Jul 31 02:25:52 2007 UTC vs.
Revision 1.203 by root, Mon Aug 6 02:11:45 2007 UTC

144our $SETUP_KEYBOARD; 144our $SETUP_KEYBOARD;
145 145
146our $PL_NOTEBOOK; 146our $PL_NOTEBOOK;
147our $PL_WINDOW; 147our $PL_WINDOW;
148 148
149our $MUSIC_PLAYING_WIDGET;
150our $LICENSE_WIDGET;
151
149our $INVENTORY_PAGE; 152our $INVENTORY_PAGE;
150our $STATS_PAGE; 153our $STATS_PAGE;
151our $SKILL_PAGE; 154our $SKILL_PAGE;
152our $SPELL_PAGE; 155our $SPELL_PAGE;
153our $SPELL_LIST; 156our $SPELL_LIST;
159our $STATWIDS; 162our $STATWIDS;
160 163
161our $SDL_ACTIVE; 164our $SDL_ACTIVE;
162our %SDL_CB; 165our %SDL_CB;
163 166
167our $ALT_ENTER_MESSAGE;
168our $STATUSBOX;
169our $DEBUG_STATUS;
170
171our $INV;
172our $INVR;
173our $INV_RIGHT_HB;
174
175our $PICKUP_CFG;
176
177#############################################################################
178
179sub status {
180 $STATUSBOX->add (CFPlus::asxml $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]);
181}
182
183sub debug {
184 $DEBUG_STATUS->set_text ($_[0]);
185}
186
187sub message {
188 my ($para) = @_;
189 $MESSAGE_WINDOW->message ($para);
190}
191
192#############################################################################
193#TODO: maybe move into own audio module...
194
164our $SDL_MIXER; 195our $SDL_MIXER;
196
165our $MUSIC_DEFAULT = "in_a_heartbeat.ogg"; 197our $MUSIC_DEFAULT = "in_a_heartbeat.ogg";
166our $MUSIC_WANT; # arryref of ambient music 198our $MUSIC_WANT; # arryref of ambient music we want to play
167our @MUSIC_HAVE; # ambient music we want now 199our @MUSIC_HAVE; # ambient music we have on disk
168our $MUSIC_START; 200our $MUSIC_START;
169our @MUSIC_JINGLE; # which jingles to play 201our @MUSIC_JINGLE; # which jingles to play next
170our $MUSIC_PLAYING_DATA; 202our $MUSIC_PLAYING_DATA;
171our $MUSIC_PLAYING_META; 203our $MUSIC_PLAYING_META;
172our $MUSIC_PLAYER; 204our $MUSIC_PLAYER;
173our $MUSIC_RESUME = 30; # resume music when players less than these many seconds before 205our $MUSIC_RESUME = 30; # resume music when played less than these many seconds before
174our @SOUNDS; # event => file mapping 206
175our %AUDIO_CHUNK; # audio files 207our %AUDIO_CHUNK; # audio "files"
176 208our %AUDIO_PLAY; # which audio faces should be played
177our $ALT_ENTER_MESSAGE;
178our $STATUSBOX;
179our $DEBUG_STATUS;
180
181our $INV;
182our $INVR;
183our $INV_RIGHT_HB;
184
185our $PICKUP_CFG;
186
187#############################################################################
188#TODO: maybe move into own audio module...
189 209
190sub audio_channel_finished { 210sub audio_channel_finished {
191 my ($channel) = @_; 211 my ($channel) = @_;
192 212
193# warn "channel $channel finished\n";#d# 213# warn "channel $channel finished\n";#d#
194} 214}
195 215
196our %AUDIO_PLAY;
197our %AUDIO_CHUNK;
198
199sub audio_sound_push($) { 216sub audio_sound_push($) {
200 my ($face) = @_; 217 my ($face) = @_;
218
219 $CFG->{effects_enable}
220 or return;
201 221
202 if (my $chunk = $AUDIO_CHUNK{$face}) { 222 if (my $chunk = $AUDIO_CHUNK{$face}) {
203 for (grep $_->[0] >= Event::time, @{(delete $AUDIO_PLAY{$face}) || []}) { 223 for (grep $_->[0] >= Event::time, @{(delete $AUDIO_PLAY{$face}) || []}) {
204 my (undef, $dx, $dy, $vol) = @$_; 224 my (undef, $dx, $dy, $vol) = @$_;
205 225
206 my $channel = CFPlus::Channel::find; 226 my $channel = CFPlus::Channel::find;
207 $channel->volume ($vol * 128 / 255); 227 $channel->volume ($vol * $CFG->{effects_volume} * 128 / 255);
208 $dx = $dx / 10 * 255; 228 $dx = $dx / 10 * 255;
209 $channel->set_panning (255 - $dx, 255 + $dx); 229 $channel->set_panning (255 - $dx, 255 + $dx);
210 230
211# my $angle = $dx ? : $dx < 0 ? 231# my $angle = $dx ? : $dx < 0 ?
212# my $distance = -$vol; 232# my $distance = -$vol;
219 my $meta = $CONN->{sound_meta}{$face} 239 my $meta = $CONN->{sound_meta}{$face}
220 or return; 240 or return;
221 241
222 # if its a jingle, play it as ambient music 242 # if its a jingle, play it as ambient music
223 if ($meta->{meta}{jingle}) { 243 if ($meta->{meta}{jingle}) {
224 push @MUSIC_JINGLE, $meta; 244 if (delete $AUDIO_PLAY{$face}) { # take the jingle out of the sound queue
225 delete $AUDIO_PLAY{$face}; 245 push @MUSIC_JINGLE, $meta; # push it oto the music/jingle queue
226 &audio_music_push ($face); 246 &audio_music_push ($face);
247 }
227 } else { 248 } else {
228 # fetch from database 249 # fetch from database
229 CFPlus::DB::get res_data => $meta->{name}, sub { 250 CFPlus::DB::get res_data => $meta->{name}, sub {
230 my $rwops = new CFPlus::RW $_[0]; 251 my $rwops = new CFPlus::RW $_[0];
231 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;
232 $chunk->volume (($meta->{meta}{volume} || 1) * 128); 254 $chunk->volume (($meta->{meta}{volume} || 1) * 128);
233 $AUDIO_CHUNK{$face} = $chunk; 255 $AUDIO_CHUNK{$face} = $chunk;
234 256
235 audio_sound_push ($face); 257 audio_sound_push ($face);
236 }; 258 };
241sub audio_sound_play { 263sub audio_sound_play {
242 my ($face, $dx, $dy, $vol) = @_; 264 my ($face, $dx, $dy, $vol) = @_;
243 265
244 $SDL_MIXER 266 $SDL_MIXER
245 or return; 267 or return;
268 $CFG->{effects_enable}
269 or return;
246 270
247 my $queue = $AUDIO_PLAY{$face} ||= []; 271 my $queue = $AUDIO_PLAY{$face} ||= [];
248 push @$queue, [Event::time + 0.2, $dx, $dy, $vol]; # delay sound by max. 0.2s 272 push @$queue, [Event::time + 0.2, $dx, $dy, $vol]; # delay sound by max. 0.2s
249 audio_sound_push $face 273 audio_sound_push $face
250 unless @$queue > 1; 274 unless @$queue > 1;
275}
276
277sub audio_music_set_meta {
278 my ($meta) = @_;
279
280 $MUSIC_PLAYING_META = $meta;
281 $MUSIC_PLAYING_WIDGET->set_markup (
282 "<b>Name</b>: " . (CFPlus::asxml $meta->{meta}{name}) . "\n"
283 . "<b>Author</b>: " . (CFPlus::asxml $meta->{meta}{author}) . "\n"
284 . "<b>Source</b>: " . (CFPlus::asxml $meta->{meta}{source}) . "\n"
285 . "<b>License</b>: " . (CFPlus::asxml $meta->{meta}{license})
286 );
251} 287}
252 288
253sub audio_music_update_volume { 289sub audio_music_update_volume {
254 return unless $MUSIC_PLAYING_META; 290 return unless $MUSIC_PLAYING_META;
255 my $volume = $MUSIC_PLAYING_META->{meta}{volume} || 1; 291 my $volume = $MUSIC_PLAYING_META->{meta}{volume} || 1;
274 my $rwops = $meta->{path} 310 my $rwops = $meta->{path}
275 ? new_from_file CFPlus::RW $meta->{path} 311 ? new_from_file CFPlus::RW $meta->{path}
276 : new CFPlus::RW $$MUSIC_PLAYING_DATA; 312 : new CFPlus::RW $$MUSIC_PLAYING_DATA;
277 313
278 $MUSIC_PLAYER = new CFPlus::MixMusic $rwops 314 $MUSIC_PLAYER = new CFPlus::MixMusic $rwops
279 or ((warn CFPlus::Mix_GetError), return); # pretty fatal error 315 or Carp::confess "music face $meta->{face} unloadable: " . CFPlus::Mix_GetError;
280 316
281 my $NOW = time; 317 my $NOW = time;
282 318
283 if ($MUSIC_PLAYING_META->{stop_time} > $NOW - $MUSIC_RESUME) { 319 if ($MUSIC_PLAYING_META->{stop_time} > $NOW - $MUSIC_RESUME) {
284 my $pos = $MUSIC_PLAYING_META->{stop_pos}; 320 my $pos = $MUSIC_PLAYING_META->{stop_pos};
287 } else { 323 } else {
288 $MUSIC_PLAYER->play (0); 324 $MUSIC_PLAYER->play (0);
289 $MUSIC_START = time; 325 $MUSIC_START = time;
290 } 326 }
291 327
292 delete $MUSIC_PLAYING_META->{stop_time}; 328 delete $meta->{stop_time};
293 delete $MUSIC_PLAYING_META->{stop_pos}; 329 delete $meta->{stop_pos};
294 } 330 }
295} 331}
296 332
297sub audio_music_push { 333sub audio_music_push {
298 return unless $SDL_MIXER; 334 return unless $SDL_MIXER;
317 @MUSIC_HAVE = { path => CFPlus::find_rcfile "music/$MUSIC_DEFAULT" } unless @MUSIC_HAVE; 353 @MUSIC_HAVE = { path => CFPlus::find_rcfile "music/$MUSIC_DEFAULT" } unless @MUSIC_HAVE;
318 $fade_out = 1000; 354 $fade_out = 1000;
319 } 355 }
320 356
321 # if the currently playing song is acceptable, let it continue 357 # if the currently playing song is acceptable, let it continue
322 return if $MUSIC_PLAYING_META
323 && grep $MUSIC_PLAYING_META == $_, @MUSIC_HAVE; 358 return if grep $MUSIC_PLAYING_META == $_, @MUSIC_HAVE;
324 359
325 my $NOW = time; 360 my $NOW = time;
326 361
327 if ($MUSIC_PLAYING_META) { 362 if ($MUSIC_PLAYING_META) {
328 $MUSIC_PLAYING_META->{stop_time} = $NOW; 363 $MUSIC_PLAYING_META->{stop_time} = $NOW;
332 # sort by stop time, oldest first 367 # sort by stop time, oldest first
333 @MUSIC_HAVE = sort { $a->{stop_time} <=> $b->{stop_time} } @MUSIC_HAVE; 368 @MUSIC_HAVE = sort { $a->{stop_time} <=> $b->{stop_time} } @MUSIC_HAVE;
334 369
335 # if the most recently-played piece played very recently, 370 # if the most recently-played piece played very recently,
336 # resume it, else choose the oldest piece for rotation. 371 # resume it, else choose the oldest piece for rotation.
337 $MUSIC_PLAYING_META = 372 audio_music_set_meta
338 $MUSIC_HAVE[-1]{stop_time} > $NOW - $MUSIC_RESUME 373 $MUSIC_HAVE[-1]{stop_time} > $NOW - $MUSIC_RESUME
339 ? $MUSIC_HAVE[-1] 374 ? $MUSIC_HAVE[-1]
340 : $MUSIC_HAVE[0]; 375 : $MUSIC_HAVE[0];
341 376
342 audio_music_start; 377 audio_music_start;
349 $MUSIC_WANT = $songs; 384 $MUSIC_WANT = $songs;
350 audio_music_push; 385 audio_music_push;
351} 386}
352 387
353sub audio_music_finished { 388sub audio_music_finished {
389 # we compress multiple jingles of the same type
354 shift @MUSIC_JINGLE 390 shift @MUSIC_JINGLE
355 if $MUSIC_PLAYING_META == $MUSIC_JINGLE[0]; 391 while @MUSIC_JINGLE && $MUSIC_PLAYING_META == $MUSIC_JINGLE[0];
392
393 $MUSIC_PLAYING_WIDGET->clear;
356 394
357 undef $MUSIC_PLAYER; 395 undef $MUSIC_PLAYER;
358 undef $MUSIC_PLAYING_META; 396 undef $MUSIC_PLAYING_META;
359 undef $MUSIC_PLAYING_DATA; 397 undef $MUSIC_PLAYING_DATA;
360 398
361 audio_music_push; 399 audio_music_push;
362} 400}
363 401
402sub audio_init {
403 if ($CFG->{audio_enable}) {
404 $ENV{MIX_EFFECTSMAXSPEED} = 1;
405 $SDL_MIXER = !CFPlus::Mix_OpenAudio;
406
407 unless ($SDL_MIXER) {
408 status "Unable to open sound device: there will be no sound";
409 return;
410 }
411
412 CFPlus::Mix_AllocateChannels 16;
413
414 audio_music_finished;
415 } else {
416 undef $SDL_MIXER;
417 }
418}
419
420sub audio_shutdown {
421 undef $MUSIC_PLAYER;
422 undef $MUSIC_PLAYING_META;
423 undef $MUSIC_PLAYING_DATA;
424
425 audio_music_set_meta { };
426
427 $MUSIC_WANT = [];
428 @MUSIC_JINGLE = ();
429 %AUDIO_PLAY = ();
430 %AUDIO_CHUNK = ();
431
432 CFPlus::Mix_CloseAudio if $SDL_MIXER;
433 undef $SDL_MIXER;
434}
435
364############################################################################# 436#############################################################################
365
366sub status {
367 $STATUSBOX->add (CFPlus::asxml $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]);
368}
369
370sub debug {
371 $DEBUG_STATUS->set_text ($_[0]);
372}
373
374sub message {
375 my ($para) = @_;
376 $MESSAGE_WINDOW->message ($para);
377}
378 437
379sub destroy_query_dialog { 438sub destroy_query_dialog {
380 (delete $_[0]{query_dialog})->destroy 439 (delete $_[0]{query_dialog})->destroy
381 if $_[0]{query_dialog}; 440 if $_[0]{query_dialog};
382} 441}
805} 864}
806 865
807sub audio_setup { 866sub audio_setup {
808 my $vbox = new CFPlus::UI::VBox; 867 my $vbox = new CFPlus::UI::VBox;
809 868
810 $vbox->add (my $table = new CFPlus::UI::Table expand => 1, col_expand => [0, 1]); 869 $vbox->add (my $table = new CFPlus::UI::Table expand => 1, col_expand => [0, 0, 1]);
811 870
812 my $row = 0; 871 my $row = 0;
813 872
814 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Audio Enable"); 873 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Audio Enable");
815 $table->add_at (1, $row++, new CFPlus::UI::CheckBox 874 $table->add_at (1, $row++, new CFPlus::UI::CheckBox
819 ); 878 );
820# $table->add_at (0, 9, new CFPlus::UI::Label valign => 0, align => 1, text => "Effects Volume"); 879# $table->add_at (0, 9, new CFPlus::UI::Label valign => 0, align => 1, text => "Effects Volume");
821# $table->add_at (1, 8, new CFPlus::UI::Slider range => [$CFG->{effects_volume}, 0, 128, 1], on_changed => sub { 880# $table->add_at (1, 8, new CFPlus::UI::Slider range => [$CFG->{effects_volume}, 0, 128, 1], on_changed => sub {
822# $CFG->{effects_volume} = $_[1]; 881# $CFG->{effects_volume} = $_[1];
823# }); 882# });
883
884 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Effects Volume");
885 $table->add_at (1, $row, new CFPlus::UI::CheckBox
886 expand => 1, state => $CFG->{effects_enable},
887 tooltip => "If enabled, sound effects are enabled. If disabled, no sound effects will be played.",
888 on_changed => sub { $CFG->{effects_enable} = $_[1]; 0 }
889 );
890 $table->add_at (2, $row++, new CFPlus::UI::Slider
891 expand => 1, range => [$CFG->{effects_volume}, 0, 1, 0, 1/128],
892 tooltip => "The relative volume of sound effects. Best audio quality is achieved if this "
893 . "is set highest and you use your operating system volume setting. Changes are instant.",
894 on_changed => sub { $CFG->{effects_volume} = $_[1]; 0 }
895 );
896
824 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Background Music"); 897 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Background Music");
825 $table->add_at (1, $row++, my $hbox = new CFPlus::UI::HBox); 898 $table->add_at (1, $row, new CFPlus::UI::CheckBox
826 $hbox->add (new CFPlus::UI::CheckBox
827 expand => 1, state => $CFG->{bgm_enable}, 899 expand => 1, state => $CFG->{bgm_enable},
828 tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.", 900 tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.",
829 on_changed => sub { $CFG->{bgm_enable} = $_[1]; 0 } 901 on_changed => sub { $CFG->{bgm_enable} = $_[1]; 0 }
830 ); 902 );
831 $hbox->add (new CFPlus::UI::Slider 903 $table->add_at (2, $row++, new CFPlus::UI::Slider
832 expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128], 904 expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128],
833 tooltip => "The volume of the background music. Changes are instant.", 905 tooltip => "The volume of the background music. Changes are instant.",
834 on_changed => sub { $CFG->{bgm_volume} = $_[1]; audio_music_update_volume; 0 } 906 on_changed => sub { $CFG->{bgm_volume} = $_[1]; audio_music_update_volume; 0 }
835 ); 907 );
836 908
837 $table->add_at (1, $row++, new CFPlus::UI::Button 909 $table->add_at (1, $row++, new CFPlus::UI::Button
838 expand => 1, align => 0, text => "Apply", 910 c_colspan => 2, expand => 1, align => 0, text => "Apply",
839 tooltip => "Apply the audio settings", 911 tooltip => "Apply the audio settings",
840 on_activate => sub { 912 on_activate => sub {
841 audio_shutdown (); 913 audio_shutdown ();
842 audio_init (); 914 audio_init ();
843 0 915 0
914 $table->add_at (0, 4, new CFPlus::UI::Button text => "die on click(tm)", on_activate => sub { &CFPlus::debug() } ); 986 $table->add_at (0, 4, new CFPlus::UI::Button text => "die on click(tm)", on_activate => sub { &CFPlus::debug() } );
915 987
916 $table->add_at (0, 5, new CFPlus::UI::TextEdit text => "line1\0152\0153");#d# 988 $table->add_at (0, 5, new CFPlus::UI::TextEdit text => "line1\0152\0153");#d#
917 989
918 $table->add_at (7,7, my $t = new CFPlus::UI::Table expand => 0); 990 $table->add_at (7,7, my $t = new CFPlus::UI::Table expand => 0);
919 $t->add_at (0,0, new CFPlus::UI::Label text => "a a a a", rowspan => 1, colspan => 2); 991 $t->add_at (0,0, new CFPlus::UI::Label text => "a a a a", c_rowspan => 1, c_colspan => 2);
920 $t->add_at (2,0, new CFPlus::UI::Label text => "b\nb", rowspan => 2, colspan => 1); 992 $t->add_at (2,0, new CFPlus::UI::Label text => "b\nb", c_rowspan => 2, c_colspan => 1);
921 $t->add_at (1,2, new CFPlus::UI::Label text => "c c c c", rowspan => 1, colspan => 2); 993 $t->add_at (1,2, new CFPlus::UI::Label text => "c c c c", c_rowspan => 1, c_colspan => 2);
922 $t->add_at (0,1, new CFPlus::UI::Label text => "d\nd", rowspan => 2, colspan => 1); 994 $t->add_at (0,1, new CFPlus::UI::Label text => "d\nd", c_rowspan => 2, c_colspan => 1);
923 $t->add_at (1,1, new CFPlus::UI::Label text => "e"); 995 $t->add_at (1,1, new CFPlus::UI::Label text => "e");
924 996
925 $table->add_at (7, 6, my $c = new CFPlus::UI::Canvas); 997 $table->add_at (7, 6, my $c = new CFPlus::UI::Canvas);
926 998
927 $c->add_items ({ 999 $c->add_items ({
1534 CFPlus::Protocol::set_opencont ($::CONN, 0, "Floor"); 1606 CFPlus::Protocol::set_opencont ($::CONN, 0, "Floor");
1535 1607
1536 $hb 1608 $hb
1537} 1609}
1538 1610
1611sub media_window {
1612 my $vb = new CFPlus::UI::VBox;
1613
1614 $vb->add (new CFPlus::UI::FancyFrame
1615 label => "Currently playing music",
1616 child => new CFPlus::UI::ScrolledWindow scroll_x => 1, scroll_y => 0,
1617 child => ($MUSIC_PLAYING_WIDGET = new CFPlus::UI::Label ellipsise => 0, fontsize => 0.8),
1618 );
1619
1620 $vb->add (new CFPlus::UI::FancyFrame
1621 label => "Other media used in this session",
1622 expand => 1,
1623 child => ($LICENSE_WIDGET = new CFPlus::UI::TextScroller
1624 expand => 1, fontsize => 0.8, padding_x => 4, padding_y => 4),
1625 );
1626
1627 $vb
1628}
1629
1630sub add_license {
1631 my ($meta) = @_;
1632
1633 $meta = $meta->{meta}
1634 or return;
1635
1636 $meta->{license} || $meta->{author} || $meta->{source}
1637 or return;
1638
1639 $LICENSE_WIDGET->add_paragraph ({
1640 fg => [1, 1, 1, 1],
1641 markup => "<small>"
1642 . "<b>Name:</b> " . (CFPlus::asxml $meta->{name}) . "\n"
1643 . "<b>Author:</b> " . (CFPlus::asxml $meta->{author}) . "\n"
1644 . "<b>Source:</b> " . (CFPlus::asxml $meta->{source}) . "\n"
1645 . "<b>License:</b> " . (CFPlus::asxml $meta->{license}) . "\n"
1646 . "</small>",
1647 });
1648 $LICENSE_WIDGET->scroll_to_bottom;
1649}
1650
1539sub toggle_player_page { 1651sub toggle_player_page {
1540 my ($widget) = @_; 1652 my ($widget) = @_;
1541 1653
1542 if ($PL_WINDOW->{visible} && $PL_NOTEBOOK->get_current_page == $widget) { 1654 if ($PL_WINDOW->{visible} && $PL_NOTEBOOK->get_current_page == $widget) {
1543 $PL_WINDOW->hide; 1655 $PL_WINDOW->hide;
1580 $ntb->add_tab ( 1692 $ntb->add_tab (
1581 "Inventory (F5)" => $INVENTORY_PAGE = inventory_widget, 1693 "Inventory (F5)" => $INVENTORY_PAGE = inventory_widget,
1582 "Toggles the inventory window, where you can manage your loot (or treasures :). " 1694 "Toggles the inventory window, where you can manage your loot (or treasures :). "
1583 . "You can also hit the <b>Tab</b>-key to show/hide the Inventory." 1695 . "You can also hit the <b>Tab</b>-key to show/hide the Inventory."
1584 ); 1696 );
1585 $ntb->add_tab (Pickup => autopickup_setup, 1697 $ntb->add_tab (Pickup => autopickup_setup,
1586 "Configure autopickup settings, i.e. which items you will pick up automatically when walking (or running) over them."); 1698 "Configure autopickup settings, i.e. which items you will pick up automatically when walking (or running) over them.");
1699
1700 $ntb->add_tab (Media => media_window,
1701 "License, Author and Source info for media sent by the server.");
1587 1702
1588 $ntb->set_current_page ($INVENTORY_PAGE); 1703 $ntb->set_current_page ($INVENTORY_PAGE);
1589 1704
1590 $plwin->add ($ntb); 1705 $plwin->add ($ntb);
1591 $plwin 1706 $plwin
1966 2081
1967sub video_shutdown { 2082sub video_shutdown {
1968 CFPlus::OpenGL::shutdown; 2083 CFPlus::OpenGL::shutdown;
1969 2084
1970 undef $SDL_ACTIVE; 2085 undef $SDL_ACTIVE;
1971}
1972
1973sub audio_init {
1974 if ($CFG->{audio_enable}) {
1975 $ENV{MIX_EFFECTSMAXSPEED} = 1;
1976 $SDL_MIXER = !CFPlus::Mix_OpenAudio;
1977
1978 unless ($SDL_MIXER) {
1979 status "Unable to open sound device: there will be no sound";
1980 return;
1981 }
1982
1983 CFPlus::Mix_AllocateChannels 16;
1984
1985 audio_music_finished;
1986 } else {
1987 undef $SDL_MIXER;
1988 }
1989}
1990
1991sub audio_shutdown {
1992 CFPlus::Mix_CloseAudio if $SDL_MIXER;
1993 undef $SDL_MIXER;
1994 @SOUNDS = ();
1995 %AUDIO_CHUNK = ();
1996} 2086}
1997 2087
1998my %animate_object; 2088my %animate_object;
1999my $animate_timer; 2089my $animate_timer;
2000 2090
2104 gauge_fontsize => 1, 2194 gauge_fontsize => 1,
2105 gauge_size => 0.35, 2195 gauge_size => 0.35,
2106 stat_fontsize => 0.7, 2196 stat_fontsize => 0.7,
2107 mapsize => 100, 2197 mapsize => 100,
2108 audio_enable => 1, 2198 audio_enable => 1,
2199 effects_enable => 1,
2200 effects_volume => 1,
2109 bgm_enable => 1, 2201 bgm_enable => 1,
2110 bgm_volume => 0.25, 2202 bgm_volume => 0.5,
2111 output_sync => 1, 2203 output_sync => 1,
2112 output_count => 1, 2204 output_count => 1,
2113 output_rate => "", 2205 output_rate => "",
2114 pickup => 0, 2206 pickup => 0,
2115 inv_sort => "mtime", 2207 inv_sort => "mtime",

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines