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.195 by root, Tue Jul 31 01:03:52 2007 UTC vs.
Revision 1.201 by root, Fri Aug 3 02:20:32 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; 198our $MUSIC_WANT; # arryref of ambient music we want to play
199our @MUSIC_HAVE; # ambient music we have on disk
167our $MUSIC_START; 200our $MUSIC_START;
201our @MUSIC_JINGLE; # which jingles to play next
168our $MUSIC_PLAYING_DATA; 202our $MUSIC_PLAYING_DATA;
169our $MUSIC_PLAYING_META; 203our $MUSIC_PLAYING_META;
170our $MUSIC_PLAYER; 204our $MUSIC_PLAYER;
171our $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
172our @SOUNDS; # event => file mapping 206
173our %AUDIO_CHUNK; # audio files 207our %AUDIO_CHUNK; # audio "files"
174 208our %AUDIO_PLAY; # which audio faces should be played
175our $ALT_ENTER_MESSAGE;
176our $STATUSBOX;
177our $DEBUG_STATUS;
178
179our $INV;
180our $INVR;
181our $INV_RIGHT_HB;
182
183our $PICKUP_CFG;
184
185#############################################################################
186#TODO: maybe move into own audio module...
187 209
188sub audio_channel_finished { 210sub audio_channel_finished {
189 my ($channel) = @_; 211 my ($channel) = @_;
190 212
191# warn "channel $channel finished\n";#d# 213# warn "channel $channel finished\n";#d#
192} 214}
193 215
194our %AUDIO_PLAY;
195our %AUDIO_CHUNK;
196
197sub audio_sound_push($) { 216sub audio_sound_push($) {
198 my ($face) = @_; 217 my ($face) = @_;
218
219 $CFG->{effects_enable}
220 or return;
199 221
200 if (my $chunk = $AUDIO_CHUNK{$face}) { 222 if (my $chunk = $AUDIO_CHUNK{$face}) {
201 for (grep $_->[0] >= Event::time, @{(delete $AUDIO_PLAY{$face}) || []}) { 223 for (grep $_->[0] >= Event::time, @{(delete $AUDIO_PLAY{$face}) || []}) {
202 my (undef, $dx, $dy, $vol) = @$_; 224 my (undef, $dx, $dy, $vol) = @$_;
203 225
204 my $channel = CFPlus::Channel::find; 226 my $channel = CFPlus::Channel::find;
205 $channel->volume (128 + $vol); 227 $channel->volume ($vol * $CFG->{effects_volume} * 128 / 255);
206 $dx = $dx / 10 * 255; 228 $dx = $dx / 10 * 255;
207 $channel->set_panning ((min 255, 255 - $dx), (min 255, 255 + $dx)); 229 $channel->set_panning (255 - $dx, 255 + $dx);
208 230
209# my $angle = $dx ? : $dx < 0 ? 231# my $angle = $dx ? : $dx < 0 ?
210# my $distance = -$vol; 232# my $distance = -$vol;
211# $channel->set_position ($angle, $distance); 233# $channel->set_position ($angle, $distance);
212 234
215 } else { 237 } else {
216 # sound_meta not set means data is in flight either way 238 # sound_meta not set means data is in flight either way
217 my $meta = $CONN->{sound_meta}{$face} 239 my $meta = $CONN->{sound_meta}{$face}
218 or return; 240 or return;
219 241
242 # if its a jingle, play it as ambient music
243 if ($meta->{meta}{jingle}) {
244 delete $AUDIO_PLAY{$face}; # take the jingle out of the sound queue
245 push @MUSIC_JINGLE, $meta; # push it oto the music/jingle queue
246 &audio_music_push ($face);
247 } else {
220 # fetch from database 248 # fetch from database
221 CFPlus::DB::get res_data => $meta->{name}, sub { 249 CFPlus::DB::get res_data => $meta->{name}, sub {
222 my $vol = $meta->{meta}{volume} || 1;
223 my $rwops = new CFPlus::RW $_[0]; 250 my $rwops = new CFPlus::RW $_[0];
224 my $chunk = new CFPlus::MixChunk $rwops; 251 my $chunk = new CFPlus::MixChunk $rwops;
225 $chunk->volume ($vol * 128); 252 $chunk->volume (($meta->{meta}{volume} || 1) * 128);
226 $AUDIO_CHUNK{$face} = $chunk; 253 $AUDIO_CHUNK{$face} = $chunk;
227 254
228 audio_sound_push ($face); 255 audio_sound_push ($face);
256 };
229 }; 257 }
230 } 258 }
231} 259}
232 260
233sub audio_sound_play { 261sub audio_sound_play {
234 my ($face, $dx, $dy, $vol) = @_; 262 my ($face, $dx, $dy, $vol) = @_;
235 263
236 $SDL_MIXER 264 $SDL_MIXER
265 or return;
266 $CFG->{effects_enable}
237 or return; 267 or return;
238 268
239 my $queue = $AUDIO_PLAY{$face} ||= []; 269 my $queue = $AUDIO_PLAY{$face} ||= [];
240 push @$queue, [Event::time + 0.2, $dx, $dy, $vol]; # delay sound by max. 0.2s 270 push @$queue, [Event::time + 0.2, $dx, $dy, $vol]; # delay sound by max. 0.2s
241 audio_sound_push $face 271 audio_sound_push $face
242 unless @$queue > 1; 272 unless @$queue > 1;
243} 273}
244 274
275sub audio_music_set_meta {
276 my ($meta) = @_;
277
278 $MUSIC_PLAYING_META = $meta;
279 $MUSIC_PLAYING_WIDGET->set_markup (
280 "<b>Name</b>: " . (CFPlus::asxml $meta->{meta}{name}) . "\n"
281 . "<b>Author</b>: " . (CFPlus::asxml $meta->{meta}{author}) . "\n"
282 . "<b>Source</b>: " . (CFPlus::asxml $meta->{meta}{source}) . "\n"
283 . "<b>License</b>: " . (CFPlus::asxml $meta->{meta}{license})
284 );
285}
286
245sub audio_music_update_volume { 287sub audio_music_update_volume {
246 return unless $MUSIC_PLAYING_META; 288 return unless $MUSIC_PLAYING_META;
247 my $volume = $MUSIC_PLAYING_META->{meta}{volume} || 1; 289 my $volume = $MUSIC_PLAYING_META->{meta}{volume} || 1;
248 my $base = $CFG->{bgm_volume}; 290 my $base = $MUSIC_PLAYING_META->{meta}{jingle} ? 1 : $CFG->{bgm_volume};
249 CFPlus::MixMusic::volume $base * $volume * 128; 291 CFPlus::MixMusic::volume $base * $volume * 128;
250}
251
252sub audio_music_set_ambient {
253 my ($songs) = @_;
254
255 my @want =
256 grep $_,
257 map $CONN->{music_meta}{$_},
258 @$songs;
259
260 if (@want) {
261 @MUSIC_WANT = @want;
262 &audio_music_changed ();
263 }
264} 292}
265 293
266sub audio_music_start { 294sub audio_music_start {
267 my $meta = $MUSIC_PLAYING_META; 295 my $meta = $MUSIC_PLAYING_META;
268 296
293 } else { 321 } else {
294 $MUSIC_PLAYER->play (0); 322 $MUSIC_PLAYER->play (0);
295 $MUSIC_START = time; 323 $MUSIC_START = time;
296 } 324 }
297 325
298 delete $MUSIC_PLAYING_META->{stop_time}; 326 delete $meta->{stop_time};
299 delete $MUSIC_PLAYING_META->{stop_pos}; 327 delete $meta->{stop_pos};
300 } 328 }
301} 329}
302 330
303sub audio_music_changed { 331sub audio_music_push {
304 return unless $CFG->{bgm_enable};
305 return unless $SDL_MIXER; 332 return unless $SDL_MIXER;
306 333
334 my $fade_out;
335
336 if (@MUSIC_JINGLE) {
337 @MUSIC_HAVE = $MUSIC_JINGLE[0];
338 $fade_out = 333;
339 } else {
340 return unless $CFG->{bgm_enable};
341
342 my @have =
343 grep $_,
344 map $CONN->{music_meta}{$_},
345 @$MUSIC_WANT;
346
347 @MUSIC_HAVE = @have
348 if @have;
349
307 # default MUSIC_WANT == MUSIC_DEFAULT 350 # default MUSIC_HAVE == MUSIC_DEFAULT
308 @MUSIC_WANT = { path => CFPlus::find_rcfile "music/$MUSIC_DEFAULT" } unless @MUSIC_WANT; 351 @MUSIC_HAVE = { path => CFPlus::find_rcfile "music/$MUSIC_DEFAULT" } unless @MUSIC_HAVE;
352 $fade_out = 1000;
353 }
309 354
310 # if the currently playing song is acceptable, let it continue 355 # if the currently playing song is acceptable, let it continue
311 return if $MUSIC_PLAYING_META 356 return if $MUSIC_PLAYING_META
312 && grep $MUSIC_PLAYING_META == $_, @MUSIC_WANT; 357 && grep $MUSIC_PLAYING_META == $_, @MUSIC_HAVE;
313 358
314 my $NOW = time; 359 my $NOW = time;
315 360
316 if ($MUSIC_PLAYING_META) { 361 if ($MUSIC_PLAYING_META) {
317 $MUSIC_PLAYING_META->{stop_time} = $NOW; 362 $MUSIC_PLAYING_META->{stop_time} = $NOW;
318 $MUSIC_PLAYING_META->{stop_pos} = $NOW - $MUSIC_START; 363 $MUSIC_PLAYING_META->{stop_pos} = $NOW - $MUSIC_START;
319 CFPlus::MixMusic::fade_out 1000; 364 CFPlus::MixMusic::fade_out $fade_out;
320 } else { 365 } else {
321 # sort by stop time, oldest first 366 # sort by stop time, oldest first
322 @MUSIC_WANT = sort { $a->{stop_time} <=> $b->{stop_time} } @MUSIC_WANT; 367 @MUSIC_HAVE = sort { $a->{stop_time} <=> $b->{stop_time} } @MUSIC_HAVE;
323 368
324 # if the most recently-played piece played very recently, 369 # if the most recently-played piece played very recently,
325 # resume it, else choose the oldest piece for rotation. 370 # resume it, else choose the oldest piece for rotation.
326 $MUSIC_PLAYING_META = 371 audio_music_set_meta
327 $MUSIC_WANT[-1]{stop_time} > $NOW - $MUSIC_RESUME 372 $MUSIC_HAVE[-1]{stop_time} > $NOW - $MUSIC_RESUME
328 ? $MUSIC_WANT[-1] 373 ? $MUSIC_HAVE[-1]
329 : $MUSIC_WANT[0]; 374 : $MUSIC_HAVE[0];
330 375
331 audio_music_start; 376 audio_music_start;
332 } 377 }
333} 378}
334 379
380sub audio_music_set_ambient {
381 my ($songs) = @_;
382
383 $MUSIC_WANT = $songs;
384 audio_music_push;
385}
386
335sub audio_music_finished { 387sub audio_music_finished {
388 # we compress multiple jingles of the same type
389 shift @MUSIC_JINGLE
390 while @MUSIC_JINGLE && $MUSIC_PLAYING_META == $MUSIC_JINGLE[0];
391
392 $MUSIC_PLAYING_WIDGET->clear;
393
336 undef $MUSIC_PLAYER; 394 undef $MUSIC_PLAYER;
337 undef $MUSIC_PLAYING_META; 395 undef $MUSIC_PLAYING_META;
338 undef $MUSIC_PLAYING_DATA; 396 undef $MUSIC_PLAYING_DATA;
339 397
340 audio_music_changed; 398 audio_music_push;
399}
400
401sub audio_init {
402 if ($CFG->{audio_enable}) {
403 $ENV{MIX_EFFECTSMAXSPEED} = 1;
404 $SDL_MIXER = !CFPlus::Mix_OpenAudio;
405
406 unless ($SDL_MIXER) {
407 status "Unable to open sound device: there will be no sound";
408 return;
409 }
410
411 CFPlus::Mix_AllocateChannels 16;
412
413 audio_music_finished;
414 } else {
415 undef $SDL_MIXER;
416 }
417}
418
419sub audio_shutdown {
420 undef $MUSIC_PLAYER;
421 undef $MUSIC_PLAYING_META;
422 undef $MUSIC_PLAYING_DATA;
423
424 audio_music_set_meta { };
425
426 $MUSIC_WANT = [];
427 @MUSIC_JINGLE = ();
428 %AUDIO_PLAY = ();
429 %AUDIO_CHUNK = ();
430
431 CFPlus::Mix_CloseAudio if $SDL_MIXER;
432 undef $SDL_MIXER;
341} 433}
342 434
343############################################################################# 435#############################################################################
344
345sub status {
346 $STATUSBOX->add (CFPlus::asxml $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]);
347}
348
349sub debug {
350 $DEBUG_STATUS->set_text ($_[0]);
351}
352
353sub message {
354 my ($para) = @_;
355 $MESSAGE_WINDOW->message ($para);
356}
357 436
358sub destroy_query_dialog { 437sub destroy_query_dialog {
359 (delete $_[0]{query_dialog})->destroy 438 (delete $_[0]{query_dialog})->destroy
360 if $_[0]{query_dialog}; 439 if $_[0]{query_dialog};
361} 440}
784} 863}
785 864
786sub audio_setup { 865sub audio_setup {
787 my $vbox = new CFPlus::UI::VBox; 866 my $vbox = new CFPlus::UI::VBox;
788 867
789 $vbox->add (my $table = new CFPlus::UI::Table expand => 1, col_expand => [0, 1]); 868 $vbox->add (my $table = new CFPlus::UI::Table expand => 1, col_expand => [0, 0, 1]);
790 869
791 my $row = 0; 870 my $row = 0;
792 871
793 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Audio Enable"); 872 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Audio Enable");
794 $table->add_at (1, $row++, new CFPlus::UI::CheckBox 873 $table->add_at (1, $row++, new CFPlus::UI::CheckBox
798 ); 877 );
799# $table->add_at (0, 9, new CFPlus::UI::Label valign => 0, align => 1, text => "Effects Volume"); 878# $table->add_at (0, 9, new CFPlus::UI::Label valign => 0, align => 1, text => "Effects Volume");
800# $table->add_at (1, 8, new CFPlus::UI::Slider range => [$CFG->{effects_volume}, 0, 128, 1], on_changed => sub { 879# $table->add_at (1, 8, new CFPlus::UI::Slider range => [$CFG->{effects_volume}, 0, 128, 1], on_changed => sub {
801# $CFG->{effects_volume} = $_[1]; 880# $CFG->{effects_volume} = $_[1];
802# }); 881# });
882
883 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Effects Volume");
884 $table->add_at (1, $row, new CFPlus::UI::CheckBox
885 expand => 1, state => $CFG->{effects_enable},
886 tooltip => "If enabled, sound effects are enabled. If disabled, no sound effects will be played.",
887 on_changed => sub { $CFG->{effects_enable} = $_[1]; 0 }
888 );
889 $table->add_at (2, $row++, new CFPlus::UI::Slider
890 expand => 1, range => [$CFG->{effects_volume}, 0, 1, 0, 1/128],
891 tooltip => "The relative volume of sound effects. Best audio quality is achieved if this "
892 . "is set highest and you use your operating system volume setting. Changes are instant.",
893 on_changed => sub { $CFG->{effects_volume} = $_[1]; 0 }
894 );
895
803 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Background Music"); 896 $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Background Music");
804 $table->add_at (1, $row++, my $hbox = new CFPlus::UI::HBox); 897 $table->add_at (1, $row, new CFPlus::UI::CheckBox
805 $hbox->add (new CFPlus::UI::CheckBox
806 expand => 1, state => $CFG->{bgm_enable}, 898 expand => 1, state => $CFG->{bgm_enable},
807 tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.", 899 tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.",
808 on_changed => sub { $CFG->{bgm_enable} = $_[1]; 0 } 900 on_changed => sub { $CFG->{bgm_enable} = $_[1]; 0 }
809 ); 901 );
810 $hbox->add (new CFPlus::UI::Slider 902 $table->add_at (2, $row++, new CFPlus::UI::Slider
811 expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128], 903 expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128],
812 tooltip => "The volume of the background music. Changes are instant.", 904 tooltip => "The volume of the background music. Changes are instant.",
813 on_changed => sub { $CFG->{bgm_volume} = $_[1]; audio_music_update_volume; 0 } 905 on_changed => sub { $CFG->{bgm_volume} = $_[1]; audio_music_update_volume; 0 }
814 ); 906 );
815 907
816 $table->add_at (1, $row++, new CFPlus::UI::Button 908 $table->add_at (1, $row++, new CFPlus::UI::Button
817 expand => 1, align => 0, text => "Apply", 909 c_colspan => 2, expand => 1, align => 0, text => "Apply",
818 tooltip => "Apply the audio settings", 910 tooltip => "Apply the audio settings",
819 on_activate => sub { 911 on_activate => sub {
820 audio_shutdown (); 912 audio_shutdown ();
821 audio_init (); 913 audio_init ();
822 0 914 0
893 $table->add_at (0, 4, new CFPlus::UI::Button text => "die on click(tm)", on_activate => sub { &CFPlus::debug() } ); 985 $table->add_at (0, 4, new CFPlus::UI::Button text => "die on click(tm)", on_activate => sub { &CFPlus::debug() } );
894 986
895 $table->add_at (0, 5, new CFPlus::UI::TextEdit text => "line1\0152\0153");#d# 987 $table->add_at (0, 5, new CFPlus::UI::TextEdit text => "line1\0152\0153");#d#
896 988
897 $table->add_at (7,7, my $t = new CFPlus::UI::Table expand => 0); 989 $table->add_at (7,7, my $t = new CFPlus::UI::Table expand => 0);
898 $t->add_at (0,0, new CFPlus::UI::Label text => "a a a a", rowspan => 1, colspan => 2); 990 $t->add_at (0,0, new CFPlus::UI::Label text => "a a a a", c_rowspan => 1, c_colspan => 2);
899 $t->add_at (2,0, new CFPlus::UI::Label text => "b\nb", rowspan => 2, colspan => 1); 991 $t->add_at (2,0, new CFPlus::UI::Label text => "b\nb", c_rowspan => 2, c_colspan => 1);
900 $t->add_at (1,2, new CFPlus::UI::Label text => "c c c c", rowspan => 1, colspan => 2); 992 $t->add_at (1,2, new CFPlus::UI::Label text => "c c c c", c_rowspan => 1, c_colspan => 2);
901 $t->add_at (0,1, new CFPlus::UI::Label text => "d\nd", rowspan => 2, colspan => 1); 993 $t->add_at (0,1, new CFPlus::UI::Label text => "d\nd", c_rowspan => 2, c_colspan => 1);
902 $t->add_at (1,1, new CFPlus::UI::Label text => "e"); 994 $t->add_at (1,1, new CFPlus::UI::Label text => "e");
903 995
904 $table->add_at (7, 6, my $c = new CFPlus::UI::Canvas); 996 $table->add_at (7, 6, my $c = new CFPlus::UI::Canvas);
905 997
906 $c->add_items ({ 998 $c->add_items ({
1513 CFPlus::Protocol::set_opencont ($::CONN, 0, "Floor"); 1605 CFPlus::Protocol::set_opencont ($::CONN, 0, "Floor");
1514 1606
1515 $hb 1607 $hb
1516} 1608}
1517 1609
1610sub media_window {
1611 my $vb = new CFPlus::UI::VBox;
1612
1613 $vb->add (new CFPlus::UI::FancyFrame
1614 label => "Currently playing music",
1615 child => new CFPlus::UI::ScrolledWindow scroll_x => 1, scroll_y => 0,
1616 child => ($MUSIC_PLAYING_WIDGET = new CFPlus::UI::Label ellipsise => 0, fontsize => 0.8),
1617 );
1618
1619 $vb->add (new CFPlus::UI::FancyFrame
1620 label => "Other media used in this session",
1621 expand => 1,
1622 child => ($LICENSE_WIDGET = new CFPlus::UI::TextScroller
1623 expand => 1, fontsize => 0.8, padding_x => 4, padding_y => 4),
1624 );
1625
1626 $vb
1627}
1628
1629sub add_license {
1630 my ($meta) = @_;
1631
1632 $meta = $meta->{meta}
1633 or return;
1634
1635 $meta->{license} || $meta->{author} || $meta->{source}
1636 or return;
1637
1638 $LICENSE_WIDGET->add_paragraph ({
1639 fg => [1, 1, 1, 1],
1640 markup => "<small>"
1641 . "<b>Name:</b> " . (CFPlus::asxml $meta->{name}) . "\n"
1642 . "<b>Author:</b> " . (CFPlus::asxml $meta->{author}) . "\n"
1643 . "<b>Source:</b> " . (CFPlus::asxml $meta->{source}) . "\n"
1644 . "<b>License:</b> " . (CFPlus::asxml $meta->{license}) . "\n"
1645 . "</small>",
1646 });
1647 $LICENSE_WIDGET->scroll_to_bottom;
1648}
1649
1518sub toggle_player_page { 1650sub toggle_player_page {
1519 my ($widget) = @_; 1651 my ($widget) = @_;
1520 1652
1521 if ($PL_WINDOW->{visible} && $PL_NOTEBOOK->get_current_page == $widget) { 1653 if ($PL_WINDOW->{visible} && $PL_NOTEBOOK->get_current_page == $widget) {
1522 $PL_WINDOW->hide; 1654 $PL_WINDOW->hide;
1559 $ntb->add_tab ( 1691 $ntb->add_tab (
1560 "Inventory (F5)" => $INVENTORY_PAGE = inventory_widget, 1692 "Inventory (F5)" => $INVENTORY_PAGE = inventory_widget,
1561 "Toggles the inventory window, where you can manage your loot (or treasures :). " 1693 "Toggles the inventory window, where you can manage your loot (or treasures :). "
1562 . "You can also hit the <b>Tab</b>-key to show/hide the Inventory." 1694 . "You can also hit the <b>Tab</b>-key to show/hide the Inventory."
1563 ); 1695 );
1564 $ntb->add_tab (Pickup => autopickup_setup, 1696 $ntb->add_tab (Pickup => autopickup_setup,
1565 "Configure autopickup settings, i.e. which items you will pick up automatically when walking (or running) over them."); 1697 "Configure autopickup settings, i.e. which items you will pick up automatically when walking (or running) over them.");
1698
1699 $ntb->add_tab (Media => media_window,
1700 "License, Author and Source info for media sent by the server.");
1566 1701
1567 $ntb->set_current_page ($INVENTORY_PAGE); 1702 $ntb->set_current_page ($INVENTORY_PAGE);
1568 1703
1569 $plwin->add ($ntb); 1704 $plwin->add ($ntb);
1570 $plwin 1705 $plwin
1945 2080
1946sub video_shutdown { 2081sub video_shutdown {
1947 CFPlus::OpenGL::shutdown; 2082 CFPlus::OpenGL::shutdown;
1948 2083
1949 undef $SDL_ACTIVE; 2084 undef $SDL_ACTIVE;
1950}
1951
1952sub audio_init {
1953 if ($CFG->{audio_enable}) {
1954 $ENV{MIX_EFFECTSMAXSPEED} = 1;
1955 $SDL_MIXER = !CFPlus::Mix_OpenAudio;
1956
1957 unless ($SDL_MIXER) {
1958 status "Unable to open sound device: there will be no sound";
1959 return;
1960 }
1961
1962 CFPlus::Mix_AllocateChannels 16;
1963
1964 audio_music_finished;
1965 } else {
1966 undef $SDL_MIXER;
1967 }
1968}
1969
1970sub audio_shutdown {
1971 CFPlus::Mix_CloseAudio if $SDL_MIXER;
1972 undef $SDL_MIXER;
1973 @SOUNDS = ();
1974 %AUDIO_CHUNK = ();
1975} 2085}
1976 2086
1977my %animate_object; 2087my %animate_object;
1978my $animate_timer; 2088my $animate_timer;
1979 2089
2083 gauge_fontsize => 1, 2193 gauge_fontsize => 1,
2084 gauge_size => 0.35, 2194 gauge_size => 0.35,
2085 stat_fontsize => 0.7, 2195 stat_fontsize => 0.7,
2086 mapsize => 100, 2196 mapsize => 100,
2087 audio_enable => 1, 2197 audio_enable => 1,
2198 effects_enable => 1,
2199 effects_volume => 1,
2088 bgm_enable => 1, 2200 bgm_enable => 1,
2089 bgm_volume => 0.25, 2201 bgm_volume => 0.5,
2090 output_sync => 1, 2202 output_sync => 1,
2091 output_count => 1, 2203 output_count => 1,
2092 output_rate => "", 2204 output_rate => "",
2093 pickup => 0, 2205 pickup => 0,
2094 inv_sort => "mtime", 2206 inv_sort => "mtime",

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines