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

Comparing deliantra/Deliantra-Client/bin/pclient (file contents):
Revision 1.195 by root, Sun Apr 30 11:17:09 2006 UTC vs.
Revision 1.205 by root, Tue May 9 16:22:44 2006 UTC

76our $MAPWIDGET; 76our $MAPWIDGET;
77our $BUTTONBAR; 77our $BUTTONBAR;
78our $LOGVIEW; 78our $LOGVIEW;
79our $CONSOLE; 79our $CONSOLE;
80our $METASERVER; 80our $METASERVER;
81our $LOGIN_BUTTON;
81 82
82our $FLOORBOX; 83our $FLOORBOX;
83our $GAUGES; 84our $GAUGES;
84our $STATWIDS; 85our $STATWIDS;
85 86
111 status "logging in..."; 112 status "logging in...";
112 113
113 my $mapsize = List::Util::min 32, List::Util::max 11, int $WIDTH * $CFG->{mapsize} * 0.01 / 32; 114 my $mapsize = List::Util::min 32, List::Util::max 11, int $WIDTH * $CFG->{mapsize} * 0.01 / 32;
114 115
115 $MAPCACHE = CFClient::db_table "mapcache_$CFG->{host}"; 116 $MAPCACHE = CFClient::db_table "mapcache_$CFG->{host}";
116
117 $MAP = new CFClient::Map $mapsize, $mapsize; 117 $MAP = new CFClient::Map $mapsize, $mapsize;
118 118
119 my ($host, $port) = split /:/, $CFG->{host}; 119 my ($host, $port) = split /:/, $CFG->{host};
120 120
121 $CONN = eval { 121 $CONN = eval {
128 maph => $mapsize, 128 maph => $mapsize,
129 ; 129 ;
130 }; 130 };
131 131
132 if ($CONN) { 132 if ($CONN) {
133 $LOGIN_BUTTON->set_text ("Logout");
134
133 status "login successful"; 135 status "login successful";
134 136
135 CFClient::lowdelay fileno $CONN->{fh}; 137 CFClient::lowdelay fileno $CONN->{fh};
136 } else { 138 } else {
137 status "unable to connect"; 139 status "unable to connect";
140 stop_game();
138 } 141 }
139} 142}
140 143
141sub stop_game { 144sub stop_game {
145 return unless $CONN;
146
147 status "connection closed";
148 $LOGIN_BUTTON->set_text ("Login");
149 $CONN->destroy;
150 $CONN = 0; # false, does not autovivify
151
152 undef $MAPCACHE;
142 undef $CONN; 153 undef $MAP;
143} 154}
144 155
145sub client_setup { 156sub client_setup {
146 my $dialog = new CFClient::UI::FancyFrame 157 my $dialog = new CFClient::UI::FancyFrame
147 title => "Client Setup", 158 title => "Client Setup",
571 582
572} 583}
573 584
574sub metaserver_dialog { 585sub metaserver_dialog {
575 my $dialog = new CFClient::UI::FancyFrame 586 my $dialog = new CFClient::UI::FancyFrame
576 title => "Metaserver", 587 title => "Server List",
577 child => (my $vbox = new CFClient::UI::VBox); 588 child => (my $vbox = new CFClient::UI::VBox);
578 589
579 $vbox->add ($dialog->{table} = new CFClient::UI::Table); 590 $vbox->add ($dialog->{table} = new CFClient::UI::Table);
580 591
581 $dialog 592 $dialog
683 694
684 $METASERVER = metaserver_dialog; 695 $METASERVER = metaserver_dialog;
685 696
686 $vbox->add (new CFClient::UI::Flopper 697 $vbox->add (new CFClient::UI::Flopper
687 expand => 1, 698 expand => 1,
688 text => "Metaserver", 699 text => "Server List",
689 other => $METASERVER, 700 other => $METASERVER,
690 tooltip => "Show a list of avaible crossfire servers", 701 tooltip => "Show a list of available crossfire servers",
691 connect_open => sub { 702 connect_open => sub {
692 update_metaserver $HOST; 703 update_metaserver $HOST;
693 } 704 }
694 ); 705 );
695 } 706 }
726 737
727 $CFG->{mapsize} = $self->{range}[0] = $value = int $value; 738 $CFG->{mapsize} = $self->{range}[0] = $value = int $value;
728 }, 739 },
729 ); 740 );
730 741
731 $table->add (1, 8, new CFClient::UI::Button expand => 1, align => 0, text => "Login", connect_activate => sub { 742 $table->add (1, 8, $LOGIN_BUTTON = new CFClient::UI::Button
743 expand => 1,
744 align => 0,
745 text => "Login",
746 connect_activate => sub {
747 $CONN ? stop_game
732 start_game; 748 : start_game;
749 },
733 }); 750 );
734 751
735 $dialog 752 $dialog
736} 753}
737 754
738sub message_window { 755sub message_window {
801} 818}
802 819
803sub video_init { 820sub video_init {
804 sdl_init; 821 sdl_init;
805 822
823 $CFG->{sdl_mode} = 0 if $CFG->{sdl_mode} >= @SDL_MODES;
824
806 ($WIDTH, $HEIGHT) = @{ $SDL_MODES[$CFG->{sdl_mode}] }; 825 ($WIDTH, $HEIGHT) = @{ $SDL_MODES[$CFG->{sdl_mode}] };
807 $FULLSCREEN = $CFG->{fullscreen}; 826 $FULLSCREEN = $CFG->{fullscreen};
808 $FAST = $CFG->{fast}; 827 $FAST = $CFG->{fast};
809 828
810 CFClient::SDL_SetVideoMode $WIDTH, $HEIGHT, $FULLSCREEN 829 CFClient::SDL_SetVideoMode $WIDTH, $HEIGHT, $FULLSCREEN
811 or die "SDL_SetVideoMode failed!\n"; 830 or die "SDL_SetVideoMode failed!\n";
812 831
813 $SDL_ACTIVE = 1; 832 $SDL_ACTIVE = 1;
814
815 $LAST_REFRESH = time - 0.01; 833 $LAST_REFRESH = time - 0.01;
816 834
817 CFClient::gl_init; 835 CFClient::gl_init;
818 836
819 $FONTSIZE = int $HEIGHT / 40 * $CFG->{gui_fontsize}; 837 $FONTSIZE = int $HEIGHT / 40 * $CFG->{gui_fontsize};
820 838
839 $CFClient::UI::ROOT->configure (0, 0, $WIDTH, $HEIGHT);#d#
840
821 ############################################################################# 841 #############################################################################
822 842
843 if ($DEBUG_STATUS) {
844 # reconfigure all widgets
845 $CFClient::UI::ROOT->reconfigure;
846
847 } else {
848 # create the widgets
849
823 $DEBUG_STATUS = new CFClient::UI::Label padding => 0, z => 100; 850 $DEBUG_STATUS = new CFClient::UI::Label padding => 0, z => 100;
824 $DEBUG_STATUS->show; 851 $DEBUG_STATUS->show;
825 852
826 $STATUS_LINE = new CFClient::UI::Label 853 $STATUS_LINE = new CFClient::UI::Label
827 padding => 0, 854 padding => 0,
828 y => $HEIGHT - $FONTSIZE * 1.8; 855 y => $HEIGHT - $FONTSIZE * 1.8;
829 $STATUS_LINE->show; 856 $STATUS_LINE->show;
830 857
831 $ALT_ENTER_MESSAGE = new CFClient::UI::Label 858 $ALT_ENTER_MESSAGE = new CFClient::UI::Label
832 padding => 0, 859 padding => 0,
833 fontsize => 0.8, 860 fontsize => 0.8,
834 markup => "Use <b>Alt-Enter</b> to toggle fullscreen mode"; 861 markup => "Use <b>Alt-Enter</b> to toggle fullscreen mode";
835 $ALT_ENTER_MESSAGE->show; 862 $ALT_ENTER_MESSAGE->show;
836 $ALT_ENTER_MESSAGE->move (0, $HEIGHT - $ALT_ENTER_MESSAGE->{h}); 863 $ALT_ENTER_MESSAGE->move (0, $HEIGHT - $ALT_ENTER_MESSAGE->{h});
837 864
838 CFClient::UI::FancyFrame->new ( 865 CFClient::UI::FancyFrame->new (
839 border_bg => [1, 1, 1, 192/255], 866 border_bg => [1, 1, 1, 192/255],
840 bg => [1, 1, 1, 0], 867 bg => [1, 1, 1, 0],
841 child => ($MAPMAP = new CFClient::MapWidget::MapMap), 868 child => ($MAPMAP = new CFClient::MapWidget::MapMap),
842 )->show; 869 )->show;
843 870
844 $MAPWIDGET = new CFClient::MapWidget; 871 $MAPWIDGET = new CFClient::MapWidget;
845 $MAPWIDGET->connect (activate_console => sub { 872 $MAPWIDGET->connect (activate_console => sub {
846 my ($mapwidget, $preset) = @_; 873 my ($mapwidget, $preset) = @_;
847 874
848 if ($CONSOLE) { 875 if ($CONSOLE) {
849 $CONSOLE->{input}->{auto_activated} = 1; 876 $CONSOLE->{input}->{auto_activated} = 1;
850 $CONSOLE->{input}->focus_in; 877 $CONSOLE->{input}->focus_in;
851 878
852 if ($preset && $CONSOLE->{input}->get_text eq '') { 879 if ($preset && $CONSOLE->{input}->get_text eq '') {
853 $CONSOLE->{input}->set_text ($preset); 880 $CONSOLE->{input}->set_text ($preset);
881 }
854 } 882 }
855 } 883 });
856 });
857 $MAPWIDGET->show; 884 $MAPWIDGET->show;
858 $MAPWIDGET->focus_in; 885 $MAPWIDGET->focus_in;
859 886
860 $BUTTONBAR = new CFClient::UI::HBox; 887 $BUTTONBAR = new CFClient::UI::HBox;
861 888
862 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Client Setup", other => client_setup); 889 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Client Setup", other => client_setup);
863 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Server Setup", other => server_setup); 890 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Server Setup", other => server_setup);
864 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Message Window", other => message_window); 891 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Message Window", other => message_window);
865 892
866 make_gauge_window->show; # XXX: this has to be set before make_stats_window as make_stats_window calls update_stats_window which updated the gauges also X-D 893 make_gauge_window->show; # XXX: this has to be set before make_stats_window as make_stats_window calls update_stats_window which updated the gauges also X-D
867 894
868 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Stats Window", other => make_stats_window); 895 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Stats Window", other => make_stats_window);
869 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Inventory", other => make_inventory_window); 896 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Inventory", other => make_inventory_window);
870 897
871 $BUTTONBAR->add (new CFClient::UI::Button text => "Save Config", connect_activate => sub { 898 $BUTTONBAR->add (new CFClient::UI::Button text => "Save Config", connect_activate => sub {
872 CFClient::write_cfg "$Crossfire::VARDIR/pclientrc"; 899 CFClient::write_cfg "$Crossfire::VARDIR/pclientrc";
873 status "Configuration Saved"; 900 status "Configuration Saved";
874 }); 901 });
875 902
876 $BUTTONBAR->show; 903 $BUTTONBAR->show;
877 904
878 $BUTTONBAR->{children}[1]->emit ("activate"); # pop up server setup 905 $BUTTONBAR->{children}[1]->emit ("activate"); # pop up server setup
906 }
879} 907}
880 908
881sub video_shutdown { 909sub video_shutdown {
882 $CFClient::UI::ROOT->{children} = [];
883 undef $CFClient::UI::GRAB;
884 undef $CFClient::UI::HOVER;
885 undef $SDL_ACTIVE; 910 undef $SDL_ACTIVE;
886} 911}
887 912
888my @bgmusic = qw(game1.ogg game2.ogg game3.ogg game5.ogg game6.ogg ross1.ogg ross2.ogg ross3.ogg ross4.ogg ross5.ogg); #d# 913my @bgmusic = qw(game1.ogg game2.ogg game3.ogg game5.ogg game6.ogg ross1.ogg ross2.ogg ross3.ogg ross4.ogg ross5.ogg); #d#
889my $bgmusic;#TODO#hack#d# 914my $bgmusic;#TODO#hack#d#
915
916sub audio_channel_finished {
917 my ($channel) = @_;
918
919 warn "channel $channel finished\n";#d#
920}
890 921
891sub audio_music_finished { 922sub audio_music_finished {
892 return unless $CFG->{bgm_enable}; 923 return unless $CFG->{bgm_enable};
893 924
894 # TODO: hack, do play loop and mood music 925 # TODO: hack, do play loop and mood music
1319 1350
1320 for my $skill (values %{$self->{skill_info}}) { 1351 for my $skill (values %{$self->{skill_info}}) {
1321 $MAPWIDGET->add_command ("ready_skill $skill", "Ready the skill '$skill'"); 1352 $MAPWIDGET->add_command ("ready_skill $skill", "Ready the skill '$skill'");
1322 $MAPWIDGET->add_command ("use_skill $skill", "Immediately use the skill '$skill'"); 1353 $MAPWIDGET->add_command ("use_skill $skill", "Immediately use the skill '$skill'");
1323 } 1354 }
1355
1356 $MAPWIDGET->add_command ("pet\\_mode defend", "Tell pets to stay close to you and defend you");
1357 $MAPWIDGET->add_command ("pet\\_mode arena", "Same as petmode attack, but also attack other players");
1358 $MAPWIDGET->add_command ("pet\\_mode sad", "Search &amp; Destroy - tell pets to roam about and attack enemies");
1359 $MAPWIDGET->add_command ("kill\\_pets", "kill your pets");
1360}
1361
1362sub conn::eof {
1363 stop_game;
1324} 1364}
1325 1365
1326sub update_floorbox { 1366sub update_floorbox {
1327 $CFClient::UI::ROOT->on_refresh ($FLOORBOX => sub { 1367 $CFClient::UI::ROOT->on_refresh ($FLOORBOX => sub {
1368 return unless $CONN;
1369
1328 $FLOORBOX->clear; 1370 $FLOORBOX->clear;
1329 $FLOORBOX->add (new CFClient::UI::Empty expand => 1); 1371 $FLOORBOX->add (new CFClient::UI::Empty expand => 1);
1330 1372
1331 # we basically have to use the same sorting as everybody else 1373 # we basically have to use the same sorting as everybody else
1332 for my $item (@{ $CONN->{container}{0} }) { 1374 $FLOORBOX->add (
1333 my $desc = $item->{nrof} < 2 1375 map +(new CFClient::UI::InventoryItem item => $_),
1334 ? $item->{name} 1376 @{ $CONN->{container}{0} }
1335 : "$item->{nrof} $item->{name_pl}";
1336 # todo: animation widget, face widget, weight(?) etc.
1337 $FLOORBOX->add (my $hbox = new CFClient::UI::HBox
1338 tooltip => (CFClient::UI::Label->escape ($desc)
1339 . "\n<small>leftclick - pick up\nmiddle click - apply\nrightclick - menu</small>"),
1340 can_hover => 1,
1341 can_events => 1,
1342 connect_button_down => sub {
1343 my ($self, $ev, $x, $y) = @_;
1344
1345 # todo: maybe put examine on 1? but should just be a tooltip :(
1346 if ($ev->{button} == 1) {
1347 $CONN->send ("move $CONN->{player}{tag} $item->{tag} 0");
1348 } elsif ($ev->{button} == 2) {
1349 $CONN->send ("apply $item->{tag}");
1350 } elsif ($ev->{button} == 3) {
1351 CFClient::UI::Menu->new (
1352 items => [
1353 ["examine", sub { $CONN->send ("examine $item->{tag}") }],
1354 [
1355 $item->{flags} & Crossfire::Protocol::F_LOCKED ? "lock" : "unlock",
1356 sub { $CONN->send ("lock $item->{tag}") },
1357 ],
1358 ["mark", sub { $CONN->send ("mark $item->{tag}") }],
1359 ["apply", sub { $CONN->send ("apply $item->{tag}") }],
1360 ],
1361 )->popup ($ev);
1362 }
1363
1364 1
1365 },
1366 ); 1377 );
1367
1368 $hbox->add (new CFClient::UI::Face
1369 can_events => 0,
1370 face => $item->{face},
1371 anim => $item->{anim},
1372 animspeed => $item->{animspeed},
1373 );
1374
1375 $hbox->add (new CFClient::UI::Label
1376 can_events => 0,
1377 text => $desc,
1378 );
1379 }
1380 }); 1378 });
1381 refresh; 1379 refresh;
1382} 1380}
1383 1381
1384sub conn::container_add { 1382sub conn::container_add {
1385 my ($self, $id, $items) = @_; 1383 my ($self, $tag, $items) = @_;
1386 1384
1387 update_floorbox if $id == 0; 1385 update_floorbox if $tag == 0;
1388 if ($self->{player}{tag} == $id) { 1386
1389 $INV->set_items ($self->{container}{$self->{player}{tag}}); 1387 $INV->set_items ($self->{container}{$self->{player}{tag}})
1390 } 1388 if $tag == $self->{player}{tag};
1389
1391 # $self-<{player}{tag} => player inv 1390 # $self-<{player}{tag} => player inv
1392 #use PApp::Util; warn PApp::Util::dumpval $self->{container}{$self->{player}{tag}}; 1391 #use PApp::Util; warn PApp::Util::dumpval $self->{container}{$self->{player}{tag}};
1393} 1392}
1394 1393
1395sub conn::container_clear { 1394sub conn::container_clear {
1396 my ($self, $id) = @_; 1395 my ($self, $tag) = @_;
1397 1396
1398 update_floorbox if $id == 0; 1397 update_floorbox if $tag == 0;
1399 if ($self->{player}{tag} == $id) { 1398
1400 $INV->set_items ($self->{container}{$id}); 1399 $INV->set_items ($self->{container}{$tag})
1401 } 1400 if $tag == $self->{player}{tag};
1402 1401
1403# use PApp::Util; warn PApp::Util::dumpval $self->{container}{0}; 1402# use PApp::Util; warn PApp::Util::dumpval $self->{container}{0};
1404} 1403}
1405 1404
1406sub conn::item_delete { 1405sub conn::item_delete {
1407 my ($self, @items) = @_; 1406 my ($self, @items) = @_;
1408 1407
1409 for (@items) { 1408 for (@items) {
1410 update_floorbox if $_->{container} == 0; 1409 update_floorbox if $_->{container} == 0;
1411 if ($self->{player}{tag} == $_->{container}) { 1410
1412 $INV->set_items ($self->{container}{$_->{container}}); 1411 $INV->set_items ($self->{container}{$_->{container}})
1413 } 1412 if $_->{container} == $self->{player}{tag};
1414 } 1413 }
1415} 1414}
1416 1415
1417sub conn::item_update { 1416sub conn::item_update {
1418 my ($self, $item) = @_; 1417 my ($self, $item) = @_;
1419 1418
1420 update_floorbox if $item->{container} == 0; 1419 update_floorbox if $item->{container} == 0;
1421 if ($self->{player}{tag} == $item->{container}) { 1420
1422 $INV->set_items ($self->{container}{$item->{container}}); 1421 $INV->set_items ($self->{container}{$item->{container}})
1423 } 1422 if $item->{container} == $self->{player}{tag};
1424} 1423}
1425 1424
1426%SDL_CB = ( 1425%SDL_CB = (
1427 CFClient::SDL_QUIT => sub { 1426 CFClient::SDL_QUIT => sub {
1428 Event::unloop -1; 1427 Event::unloop -1;
1441 video_init; 1440 video_init;
1442 } else { 1441 } else {
1443 CFClient::UI::feed_sdl_key_down_event ($_[0]); 1442 CFClient::UI::feed_sdl_key_down_event ($_[0]);
1444 } 1443 }
1445 }, 1444 },
1446 CFClient::SDL_KEYUP => \&CFClient::UI::feed_sdl_key_up_event, 1445 CFClient::SDL_KEYUP => \&CFClient::UI::feed_sdl_key_up_event,
1447 CFClient::SDL_MOUSEMOTION => \&CFClient::UI::feed_sdl_motion_event, 1446 CFClient::SDL_MOUSEMOTION => \&CFClient::UI::feed_sdl_motion_event,
1448 CFClient::SDL_MOUSEBUTTONDOWN => \&CFClient::UI::feed_sdl_button_down_event, 1447 CFClient::SDL_MOUSEBUTTONDOWN => \&CFClient::UI::feed_sdl_button_down_event,
1449 CFClient::SDL_MOUSEBUTTONUP => \&CFClient::UI::feed_sdl_button_up_event, 1448 CFClient::SDL_MOUSEBUTTONUP => \&CFClient::UI::feed_sdl_button_up_event,
1450 CFClient::SDL_USEREVENT => \&audio_music_finished, 1449 CFClient::SDL_USEREVENT => sub {
1450 if ($_[0]{code} == 1) {
1451 audio_channel_finished $_[0]{data1};
1452 } elsif ($_[0]{code} == 0) {
1453 audio_music_finished;
1454 }
1455 },
1451); 1456);
1452 1457
1453############################################################################# 1458#############################################################################
1454 1459
1455$SIG{INT} = $SIG{TERM} = sub { exit }; 1460$SIG{INT} = $SIG{TERM} = sub { exit };
1456 1461
1457CFClient::read_cfg "$Crossfire::VARDIR/pclientrc";
1458
1459$TILECACHE = CFClient::db_table "tilecache";
1460$FACEMAP = CFClient::db_table "facemap";
1461
1462my %DEF_CFG = (
1463 sdl_mode => 0,
1464 width => 640,
1465 height => 480,
1466 fullscreen => 0,
1467 fast => 0,
1468 map_scale => 0.5,
1469 fow_enable => 1,
1470 fow_intensity => 0.45,
1471 fow_smooth => 0,
1472 gui_fontsize => 1,
1473 log_fontsize => 1,
1474 gauge_fontsize => 1,
1475 gauge_size => 0.35,
1476 stat_fontsize => 1,
1477 mapsize => 100,
1478 host => "crossfire.schmorp.de",
1479 say_command => 'say',
1480 audio_enable => 1,
1481 bgm_enable => 1,
1482 bgm_volume => 0.25,
1483);
1484
1485while (my ($k, $v) = each %DEF_CFG) {
1486 $CFG->{$k} = $v unless exists $CFG->{$k};
1487}
1488
1489sdl_init;
1490
1491@SDL_MODES = reverse
1492 grep $_->[0] >= 640 && $_->[1] >= 480,
1493 CFClient::SDL_ListModes;
1494
1495@SDL_MODES or CFClient::fatal "Unable to find a usable video mode\n(hardware accelerated opengl fullscreen)";
1496
1497$CFG->{sdl_mode} = 0 if $CFG->{sdl_mode} > @SDL_MODES;
1498
1499{ 1462{
1463 local $SIG{__DIE__} = sub { CFClient::fatal $_[0] };
1464
1465 CFClient::read_cfg "$Crossfire::VARDIR/pclientrc";
1466
1467 $TILECACHE = CFClient::db_table "tilecache";
1468 $FACEMAP = CFClient::db_table "facemap";
1469
1470 my %DEF_CFG = (
1471 sdl_mode => 0,
1472 width => 640,
1473 height => 480,
1474 fullscreen => 0,
1475 fast => 0,
1476 map_scale => 0.5,
1477 fow_enable => 1,
1478 fow_intensity => 0.45,
1479 fow_smooth => 0,
1480 gui_fontsize => 1,
1481 log_fontsize => 1,
1482 gauge_fontsize => 1,
1483 gauge_size => 0.35,
1484 stat_fontsize => 1,
1485 mapsize => 100,
1486 host => "crossfire.schmorp.de",
1487 say_command => 'say',
1488 audio_enable => 1,
1489 bgm_enable => 1,
1490 bgm_volume => 0.25,
1491 );
1492
1493 while (my ($k, $v) = each %DEF_CFG) {
1494 $CFG->{$k} = $v unless exists $CFG->{$k};
1495 }
1496
1497 sdl_init;
1498
1499 @SDL_MODES = reverse
1500 grep $_->[0] >= 640 && $_->[1] >= 480,
1501 CFClient::SDL_ListModes;
1502
1503 @SDL_MODES or CFClient::fatal "Unable to find a usable video mode\n(hardware accelerated opengl fullscreen)";
1504
1505 $CFG->{sdl_mode} = 0 if $CFG->{sdl_mode} > @SDL_MODES;
1506
1507 {
1500 my @fonts = map CFClient::find_rcfile "fonts/$_", qw( 1508 my @fonts = map CFClient::find_rcfile "fonts/$_", qw(
1501 DejaVuSans.ttf 1509 DejaVuSans.ttf
1502 DejaVuSansMono.ttf 1510 DejaVuSansMono.ttf
1503 DejaVuSans-Bold.ttf 1511 DejaVuSans-Bold.ttf
1504 DejaVuSansMono-Bold.ttf 1512 DejaVuSansMono-Bold.ttf
1505 DejaVuSans-Oblique.ttf 1513 DejaVuSans-Oblique.ttf
1506 DejaVuSansMono-Oblique.ttf 1514 DejaVuSansMono-Oblique.ttf
1507 DejaVuSans-BoldOblique.ttf 1515 DejaVuSans-BoldOblique.ttf
1508 DejaVuSansMono-BoldOblique.ttf 1516 DejaVuSansMono-BoldOblique.ttf
1509 ); 1517 );
1510 1518
1511 CFClient::add_font $_ for @fonts; 1519 CFClient::add_font $_ for @fonts;
1512 1520
1513 $FONT_PROP = new_from_file CFClient::Font $fonts[0]; 1521 $FONT_PROP = new_from_file CFClient::Font $fonts[0];
1514 $FONT_FIXED = new_from_file CFClient::Font $fonts[1]; 1522 $FONT_FIXED = new_from_file CFClient::Font $fonts[1];
1515 1523
1516 $FONT_PROP->make_default; 1524 $FONT_PROP->make_default;
1517} 1525 }
1518 1526
1519video_init; 1527 video_init;
1520audio_init; 1528 audio_init;
1529}
1521 1530
1522Event::loop; 1531Event::loop;
1523 1532
1524END { CFClient::SDL_Quit } 1533END { CFClient::SDL_Quit }
1525 1534

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines