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

Comparing deliantra/Deliantra-Client/bin/deliantra (file contents):
Revision 1.105 by root, Sat Apr 3 02:58:25 2010 UTC vs.
Revision 1.118 by root, Mon Dec 26 03:58:12 2011 UTC

5 use Coro; 5 use Coro;
6 use Coro::EV; 6 use Coro::EV;
7 use Coro::Debug; 7 use Coro::Debug;
8 our $debug = new_unix_server Coro::Debug "/tmp/dc"; 8 our $debug = new_unix_server Coro::Debug "/tmp/dc";
9 '; 9 ';
10 die if $@;
10} 11}
11 12
12# do splash-screen thingy on win32 13# do splash-screen thingy on win32
13my $startup_done = sub { }; 14my $startup_done = sub { };
14BEGIN { 15BEGIN {
17 $zip->extractMember ("SPLASH.bmp", "$ENV{PAR_TEMP}/SPLASH.bmp"); 18 $zip->extractMember ("SPLASH.bmp", "$ENV{PAR_TEMP}/SPLASH.bmp");
18 } 19 }
19 20
20 require Win32::GUI::SplashScreen; 21 require Win32::GUI::SplashScreen;
21 22
22 # initialise the resolver now, as vista forces us back to the desktop
23 # when doing this.
24 use AnyEvent::DNS ();
25 AnyEvent::DNS::resolver;
26
27 Win32::GUI::SplashScreen::Show ( 23 Win32::GUI::SplashScreen::Show (
28 -file => "$ENV{PAR_TEMP}/SPLASH.bmp", 24 -file => "$ENV{PAR_TEMP}/SPLASH.bmp",
29 ); 25 );
26
27 # initialise the resolver now, as vista forces us back to the desktop
28 # when doing this later.
29 require AnyEvent::DNS;
30 AnyEvent::DNS::resolver ();
30 31
31 $startup_done = sub { 32 $startup_done = sub {
32 Win32::GUI::SplashScreen::Done (1); 33 Win32::GUI::SplashScreen::Done (1);
33 }; 34 };
34 } 35 }
143our $NOW; 144our $NOW;
144 145
145our $CFG; 146our $CFG;
146our $PROFILE; # current profile 147our $PROFILE; # current profile
147our $FAST; # fast, low-quality mode, possibly useful for software-rendering 148our $FAST; # fast, low-quality mode, possibly useful for software-rendering
149our $DELIANTRA_DEBUG = $ENV{DELIANTRA_DEBUG} * 1;
148 150
149our $WANT_REFRESH; 151our $WANT_REFRESH;
150 152
151our $MODE_SLIDER; 153our $MODE_SLIDER;
152our $CAVEAT_LABEL; 154our $CAVEAT_LABEL;
517 audio_music_push; 519 audio_music_push;
518} 520}
519 521
520sub audio_init { 522sub audio_init {
521 if ($CFG->{audio_enable}) { 523 if ($CFG->{audio_enable}) {
524 if (length $CFG->{audio_driver}) {
525 local $ENV{SDL_AUDIODRIVER} = $CFG->{audio_driver};
526 DC::SDL_Init DC::SDL_INIT_AUDIO
527 and die "SDL::Init failed!\n";
528 } else {
529 DC::SDL_Init DC::SDL_INIT_AUDIO
530 and die "SDL::Init failed!\n";
531 }
532
522 $ENV{MIX_EFFECTSMAXSPEED} = 1; 533 $ENV{MIX_EFFECTSMAXSPEED} = 1;
523 $SDL_MIXER = !DC::Mix_OpenAudio 534 $SDL_MIXER = !DC::Mix_OpenAudio
524 $CFG->{audio_hw_frequency}, 535 $CFG->{audio_hw_frequency},
525 DC::MIX_DEFAULT_FORMAT, 536 DC::MIX_DEFAULT_FORMAT,
526 $CFG->{audio_hw_channels}, 537 $CFG->{audio_hw_channels},
556 %AUDIO_PLAY = (); 567 %AUDIO_PLAY = ();
557 %AUDIO_CHUNK = (); 568 %AUDIO_CHUNK = ();
558 569
559 DC::Mix_CloseAudio if $SDL_MIXER; 570 DC::Mix_CloseAudio if $SDL_MIXER;
560 undef $SDL_MIXER; 571 undef $SDL_MIXER;
572
573 DC::SDL_QuitSubSystem DC::SDL_INIT_AUDIO;
561} 574}
562 575
563############################################################################# 576#############################################################################
564 577
565sub destroy_query_dialog { 578sub destroy_query_dialog {
806 user => $PROFILE->{user}, 819 user => $PROFILE->{user},
807 pass => $PROFILE->{password}, 820 pass => $PROFILE->{password},
808 mapw => $mapw, 821 mapw => $mapw,
809 maph => $maph, 822 maph => $maph,
810 823
824 c_version => {
825 client => "deliantra",
811 client => "$DC::VERSION $] $^O", 826 clientver => $DC::VERSION,
827 gl_vendor => DC::OpenGL::gl_vendor,
828 gl_version => DC::OpenGL::gl_version,
829 },
812 830
813 map_widget => $MAPWIDGET, 831 map_widget => $MAPWIDGET,
814 statusbox => $STATUSBOX, 832 statusbox => $STATUSBOX,
815 map => $MAP, 833 map => $MAP,
816 mapmap => $MAPMAP, 834 mapmap => $MAPMAP,
848 866
849 # hack to make SURE we find the IP address all right 867 # hack to make SURE we find the IP address all right
850 # can be removed once AnyEvent::DNS is proven stable. 868 # can be removed once AnyEvent::DNS is proven stable.
851 if ($host eq "gameserver.deliantra.net") { 869 if ($host eq "gameserver.deliantra.net") {
852 AnyEvent::DNS::a "dnstest.deliantra.net", sub { 870 AnyEvent::DNS::a "dnstest.deliantra.net", sub {
853 if ($_[0] ne "80.101.114.108") { # Perl 871 if ($_[0] ne "80.101.114.108") { # P-e-r-l
854 status "dns failure, trying differently"; 872 status "dns failure, trying differently";
855 $host = eval { Socket::inet_ntoa Socket::inet_aton "gameserver.deliantra.net" }; 873 $host = eval { Socket::inet_ntoa Socket::inet_aton "gameserver.deliantra.net" };
856 unless (defined $host) { 874 unless (defined $host) {
857 status "dns failure, using hardcoded address"; 875 status "dns failure, using hardcoded address";
858 $host = "129.13.162.95"; 876 $host = "194.126.175.154";
859 } 877 }
860 } 878 }
861 879
862 dc_connect $host, $port; 880 dc_connect $host, $port;
863 }; 881 };
1139 ]); 1157 ]);
1140 1158
1141 my $text = !$freq 1159 my $text = !$freq
1142 ? "audio is off" 1160 ? "audio is off"
1143 : "audio is enabled\n" 1161 : "audio is enabled\n"
1162 . "driver: " . DC::SDL_AudioDriverName . "\n"
1144 . "frequency (Hz): $freq\n" 1163 . "frequency (Hz): $freq\n"
1145 . "channels: $chans\n" 1164 . "channels: $chans\n"
1146 . "chunk decoders available: " . (join ", ", DC::MixChunk::decoders) . "\n" 1165 . "chunk decoders available: " . (join ", ", DC::MixChunk::decoders) . "\n"
1147 . "music decoders available: " . (join ", ", DC::MixMusic::decoders); 1166 . "music decoders available: " . (join ", ", DC::MixMusic::decoders);
1148 1167
1149 $AUDIO_INFO->set_text ($text); 1168 $AUDIO_INFO->set_text ($text);
1150} 1169}
1151 1170
1152sub audio_setup { 1171sub audio_setup {
1155 $vbox->add (my $table = new DC::UI::Table expand => 1, col_expand => [0, 0, 1]); 1174 $vbox->add (my $table = new DC::UI::Table expand => 1, col_expand => [0, 0, 1]);
1156 1175
1157 my $row = 0; 1176 my $row = 0;
1158 1177
1159 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Audio Enable"); 1178 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Audio Enable");
1160 $table->add_at (1, $row++, new DC::UI::CheckBox 1179 $table->add_at (1, $row, new DC::UI::CheckBox
1161 state => $CFG->{audio_enable}, 1180 state => $CFG->{audio_enable},
1162 tooltip => "<b>Master Audio Enable.</b> If enabled, sound effects and music will be played. If disabled, no audio will be used and the soundcard will not be opened.", 1181 tooltip => "<b>Master Audio Enable.</b> If enabled, sound effects and music will be played. If disabled, no audio will be used and the soundcard will not be opened.",
1163 on_changed => sub { $CFG->{audio_enable} = $_[1]; 1 } 1182 on_changed => sub { $CFG->{audio_enable} = $_[1]; 1 }
1183 );
1184 $table->add_at (2, $row++, my $driver = new DC::UI::HBox expand => 1);
1185
1186 $driver->add (new DC::UI::Label align => 1, text => " Audio driver override");
1187 $driver->add (new DC::UI::Entry
1188 text => $CFG->{audio_driver},
1189 template => "dsound1234",
1190 tooltip => "You can override the audio driver to use here. Leaving it empty will result "
1191 . "in Deliantra picking one automatically. GNU/Linux users often prefer specific "
1192 . "drivers though, and can experiment with <b>alsa</b>, <b>dsp</b>, <b>esd</b>, <b>pulse</b>, <b>arts</b>, <b>nas</b> "
1193 . "or other system-specific drivers. Selecting the wrong driver here will simply result"
1194 . "in no sound.",
1195 on_changed => sub { my ($self, $value) = @_; $CFG->{audio_driver} = $value; 1 }
1164 ); 1196 );
1165 1197
1166 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Sound Effects"); 1198 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Sound Effects");
1167 $table->add_at (1, $row, new DC::UI::CheckBox 1199 $table->add_at (1, $row, new DC::UI::CheckBox
1168 expand => 1, state => $CFG->{effects_enable}, 1200 expand => 1, state => $CFG->{effects_enable},
1181 ); 1213 );
1182 1214
1183 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Background Music"); 1215 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Background Music");
1184 $table->add_at (1, $row, new DC::UI::CheckBox 1216 $table->add_at (1, $row, new DC::UI::CheckBox
1185 expand => 1, state => $CFG->{bgm_enable}, 1217 expand => 1, state => $CFG->{bgm_enable},
1186 tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.", 1218 tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played. Needs server reconnect to take effect.",
1187 on_changed => sub { 1219 on_changed => sub {
1188 $CFG->{bgm_enable} = $_[1]; 1220 $CFG->{bgm_enable} = $_[1];
1189 $CONN->update_fx_want if $CONN; 1221 $CONN->update_fx_want if $CONN;
1190 audio_music_push; 1222 audio_music_push;
1191 1 1223 1
1202 c_colspan => 2, expand => 1, 1234 c_colspan => 2, expand => 1,
1203 value => $CFG->{audio_hw_frequency}, 1235 value => $CFG->{audio_hw_frequency},
1204 options => [ 1236 options => [
1205 [ 0, "default" , "Use System Default"], 1237 [ 0, "default" , "Use System Default"],
1206 [11025, "11 kHz" , "11kHz (low quality)"], 1238 [11025, "11 kHz" , "11kHz (low quality)"],
1207 [22050, "22 kHz" , "22kHz (reduced quality)"], 1239 [22050, "22 kHz" , "22kHz (reduced quality, recommended)"],
1208 [44100, "44.1 kHz", "44.1kHz (cd quality)"], 1240 [44100, "44.1 kHz", "44.1kHz (cd quality)"],
1209 [48000, "48 kHz" , "48kHz (studio quality)"], 1241 [48000, "48 kHz" , "48kHz (studio quality, not recommended)"],
1210 ], 1242 ],
1211 tooltip => "The sampling frequency to use. Higher sounds better, but also more cpu-intensive and might cause stuttering.", 1243 tooltip => "The sampling frequency to use. Higher sounds better, but also more cpu-intensive and might cause stuttering.",
1212 on_changed => sub { 1244 on_changed => sub {
1213 $CFG->{audio_hw_frequency} = $_[1]; 1245 $CFG->{audio_hw_frequency} = $_[1];
1214 audio_tab_update; 1246 audio_tab_update;
1238 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Latency"); 1270 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Latency");
1239 $table->add_at (1, $row++, $AUDIO_HW_CHUNKSIZE = new DC::UI::Selector 1271 $table->add_at (1, $row++, $AUDIO_HW_CHUNKSIZE = new DC::UI::Selector
1240 c_colspan => 2, expand => 1, 1272 c_colspan => 2, expand => 1,
1241 value => $CFG->{audio_hw_chunksize}, 1273 value => $CFG->{audio_hw_chunksize},
1242 tooltip => "The guarenteed latency. Lower is better, but also more cpu-intensive and might cause stuttering. If music playback " 1274 tooltip => "The guarenteed latency. Lower is better, but also more cpu-intensive and might cause stuttering. If music playback "
1243 . "is stuttering, increase this value. Values of 50-100ms are optimal.", 1275 . "is stuttering, increase this value. Values of 50-150ms are optimal.",
1244 on_changed => sub { 1276 on_changed => sub {
1245 $CFG->{audio_hw_chunksize} = $_[1]; 1277 $CFG->{audio_hw_chunksize} = $_[1];
1246 audio_tab_update; 1278 audio_tab_update;
1247 1 1279 1
1248 } 1280 }
1328 &set_gauge_window_fontsize; 1360 &set_gauge_window_fontsize;
1329 1361
1330 $win 1362 $win
1331} 1363}
1332 1364
1365our $BW_WATCHER;
1366
1367sub debug_toggle($) {
1368 $DELIANTRA_DEBUG ^= $_[0];
1369
1370 if ($DELIANTRA_DEBUG & 16) {
1371 $BW_WATCHER = EV::periodic 0, 1, 0, sub {
1372 return unless $CONN;
1373 debug sprintf "%8.2gKB/s", $CONN->{octets_in} / 1e3;
1374 $CONN->{octets_in} = 0;
1375 };
1376 } else {
1377 undef $BW_WATCHER;
1378 }
1379
1380}
1381
1333sub debug_setup { 1382sub debug_setup {
1334 my $table = new DC::UI::Table; 1383 my $table = new DC::UI::Table;
1335 1384
1336 $table->add_at (0, 0, new DC::UI::Label text => "Widget Borders"); 1385 $table->add_at (0, 0, new DC::UI::Label text => "Widget Borders");
1337 $table->add_at (1, 0, new DC::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 1; 0 }); 1386 $table->add_at (1, 0, new DC::UI::CheckBox on_changed => sub { debug_toggle 1; 0 });
1338 $table->add_at (0, 1, new DC::UI::Label text => "Tooltip Widget Info"); 1387 $table->add_at (0, 1, new DC::UI::Label text => "Tooltip Widget Info");
1339 $table->add_at (1, 1, new DC::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 2; 0 }); 1388 $table->add_at (1, 1, new DC::UI::CheckBox on_changed => sub { debug_toggle 2; 0 });
1340 $table->add_at (0, 2, new DC::UI::Label text => "Show FPS"); 1389 $table->add_at (0, 2, new DC::UI::Label text => "Show FPS");
1341 $table->add_at (1, 2, new DC::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 4; 0 }); 1390 $table->add_at (1, 2, new DC::UI::CheckBox on_changed => sub { debug_toggle 4; 0 });
1342 $table->add_at (0, 3, new DC::UI::Label text => "Suppress Tooltips"); 1391 $table->add_at (0, 3, new DC::UI::Label text => "Suppress Tooltips");
1343 $table->add_at (1, 3, new DC::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 8; 0 }); 1392 $table->add_at (1, 3, new DC::UI::CheckBox on_changed => sub { debug_toggle 8; 0 });
1393 $table->add_at (0, 4, new DC::UI::Label text => "Show Bandwidth");
1394 $table->add_at (1, 4, new DC::UI::CheckBox on_changed => sub { debug_toggle 16; 0 });
1395
1344 $table->add_at (0, 4, new DC::UI::Button text => "die on click(tm)", on_activate => sub { &DC::debug() } ); 1396 $table->add_at (0, 6, new DC::UI::Button text => "die on click(tm)", on_activate => sub { &DC::debug() } );
1345
1346 $table->add_at (0, 5, new DC::UI::TextEdit text => "line1\0152\0153\nµikachu\nづx゙つ゛");#d# 1397 $table->add_at (0, 7, new DC::UI::TextEdit text => "line1\0152\0153\nµikachu\nづx゙つ゛");#d#
1347 1398
1348 $table->add_at (7,7, my $t = new DC::UI::Table expand => 0); 1399 $table->add_at (7,7, my $t = new DC::UI::Table expand => 0);
1349 $t->add_at (0,0, new DC::UI::Label text => "a a", c_rowspan => 1, c_colspan => 2); 1400 $t->add_at (0,0, new DC::UI::Label text => "a a", c_rowspan => 1, c_colspan => 2);
1350 $t->add_at (2,0, new DC::UI::Label text => "b\nb", c_rowspan => 2, c_colspan => 1, ellipsise => 0 ); 1401 $t->add_at (2,0, new DC::UI::Label text => "b\nb", c_rowspan => 2, c_colspan => 1, ellipsise => 0 );
1351 $t->add_at (1,2, new DC::UI::Label text => "c c", c_rowspan => 1, c_colspan => 2); 1402 $t->add_at (1,2, new DC::UI::Label text => "c c", c_rowspan => 1, c_colspan => 2);
1472 para => ["Paralysation", 1523 para => ["Paralysation",
1473 "<b>Paralysation</b> (this resistance affects the chance you get paralysed)"], 1524 "<b>Paralysation</b> (this resistance affects the chance you get paralysed)"],
1474 deat => ["Death", 1525 deat => ["Death",
1475 "<b>Death</b> (resistance against death spells)"], 1526 "<b>Death</b> (resistance against death spells)"],
1476 phys => ["Physical", 1527 phys => ["Physical",
1477 "<b>Physical</b> (this is the resistance against physical attacks, like when a monster hit you in melee combat. The value displayed here is also displayed in the 'Arm' field on the left.)"], 1528 "<b>Physical</b> (this is the resistance against physical attacks, like when a monster hit you in melee combat. The value displayed here is also displayed as the 'Arm' secondary stat.)"],
1478 blind => ["Blind", 1529 blind => ["Blind",
1479 "<b>Blind</b> (blind resistance affects the chance of a successful blinding attack)"], 1530 "<b>Blind</b> (blind resistance affects the chance of a successful blinding attack)"],
1480 fear => ["Fear", 1531 fear => ["Fear",
1481 "<b>Fear</b> (this attack will drive you away from monsters who cast this and hit you successfully, being resistant to this helps a lot when fighting those monsters)"], 1532 "<b>Fear</b> (this attack will drive you away from monsters who cast this and hit you successfully, being resistant to this helps a lot when fighting those monsters)"],
1482 tund => ["Turn undead", 1533 tund => ["Turn undead",
1941 $r 1992 $r
1942} 1993}
1943 1994
1944my %SORT_ORDER = ( 1995my %SORT_ORDER = (
1945 type => sub { 1996 type => sub {
1997 use sort 'stable';
1946 sort { $a->{type} <=> $b->{type} or $a->{name} cmp $b->{name} } @_ 1998 sort { $a->{type} <=> $b->{type} or $a->{name} cmp $b->{name} } @_
1947 }, 1999 },
1948 mtime => sub { 2000 mtime => sub {
2001 use sort 'stable';
1949 my $NOW = time; 2002 my $NOW = time;
1950 sort { 2003 sort {
1951 my $atime = $a->{mtime} - $NOW; $atime = $atime < 5 * 60 ? int $atime / 60 : 6; 2004 my $atime = $a->{mtime} - $NOW; $atime = $atime < 5 * 60 ? int $atime / 60 : 6;
1952 my $btime = $b->{mtime} - $NOW; $btime = $btime < 5 * 60 ? int $btime / 60 : 6; 2005 my $btime = $b->{mtime} - $NOW; $btime = $btime < 5 * 60 ? int $btime / 60 : 6;
1953 2006
1954 ($a->{flags} & F_LOCKED) <=> ($b->{flags} & F_LOCKED) 2007 ($a->{flags} & F_LOCKED) <=> ($b->{flags} & F_LOCKED)
1955 or $btime <=> $atime 2008 or $btime <=> $atime
1956 or $a->{type} <=> $b->{type} 2009 or $a->{type} <=> $b->{type}
1957 } @_ 2010 } @_
1958 }, 2011 },
1959 weight => sub { sort { 2012 weight => sub {
2013 use sort 'stable';
2014 sort {
1960 $a->{weight} * ($a->{nrof} || 1) <=> $b->{weight} * ($b->{nrof} || 1) 2015 $a->{weight} * ($a->{nrof} || 1) <=> $b->{weight} * ($b->{nrof} || 1)
1961 or $a->{type} <=> $b->{type} 2016 or $a->{type} <=> $b->{type}
1962 } @_ }, 2017 } @_
2018 },
1963); 2019);
1964 2020
1965sub inventory_widget { 2021sub inventory_widget {
1966 my $hb = new DC::UI::HBox homogeneous => 1; 2022 my $hb = new DC::UI::HBox homogeneous => 1;
1967 2023
2408 2464
2409 $dialog->show; 2465 $dialog->show;
2410 }; 2466 };
2411} 2467}
2412 2468
2413sub sdl_init {
2414 DC::SDL_Init DC::SDL_INIT_AUDIO #| DC::SDL_NOPARACHUTE
2415 and die "SDL::Init failed!\n";
2416}
2417
2418sub video_init { 2469sub video_init {
2419 DC::set_theme $CFG->{uitheme}; 2470 DC::set_theme $CFG->{uitheme};
2420 2471
2421 DC::SDL_InitSubSystem DC::SDL_INIT_VIDEO if $SDL_REINIT; 2472 DC::SDL_InitSubSystem DC::SDL_INIT_VIDEO if $SDL_REINIT;
2422 $SDL_REINIT = 0; 2473 $SDL_REINIT = 0;
2481 2532
2482 $DEBUG_STATUS = new DC::UI::Label 2533 $DEBUG_STATUS = new DC::UI::Label
2483 padding => 0, 2534 padding => 0,
2484 z => 100, 2535 z => 100,
2485 force_x => "max", 2536 force_x => "max",
2486 force_y => 0; 2537 force_y => 20;
2487 $DEBUG_STATUS->show; 2538 $DEBUG_STATUS->show;
2488 2539
2489 $STATUSBOX = new DC::UI::Statusbox; 2540 $STATUSBOX = new DC::UI::Statusbox;
2490 2541
2491 $MODBOX = new DC::UI::Label 2542 $MODBOX = new DC::UI::Label
2619my $animate_timer; 2670my $animate_timer;
2620 2671
2621my $fps = 9; 2672my $fps = 9;
2622 2673
2623sub force_refresh { 2674sub force_refresh {
2624 if ($ENV{CFPLUS_DEBUG} & 4) { 2675 if ($DELIANTRA_DEBUG & 4) {
2625 $fps = $fps * 0.98 + 1 / (($NOW - $LAST_REFRESH) || 0.1) * 0.02; 2676 $fps = $fps * 0.98 + 1 / (($NOW - $LAST_REFRESH) || 0.1) * 0.02;
2626 debug sprintf "%3.2f", $fps; 2677 debug sprintf "%3.2f", $fps;
2627 } 2678 }
2628 2679
2629 undef $WANT_REFRESH; 2680 undef $WANT_REFRESH;
2782 $CFG->{$k} = $v unless exists $CFG->{$k}; 2833 $CFG->{$k} = $v unless exists $CFG->{$k};
2783 } 2834 }
2784 2835
2785 my @args = @ARGV; 2836 my @args = @ARGV;
2786 2837
2838 # OS X passes some process serial number of other shit. they
2839 # could have used an env var or any other sane mechanism. but
2840 # would it be os x then? no...
2841 shift @args if $args[0] =~ /^-psn_/;
2842
2787 my $profile = 'default'; 2843 my $profile = 'default';
2788 2844
2789 for (my $i = 0; $i < @args; $i++) { 2845 for (my $i = 0; $i < @args; $i++) {
2790 if ($args[$i] =~ /^--?profile$/) { 2846 if ($args[$i] =~ /^--?profile$/) {
2791 $profile = $args[$i + 1]; 2847 $profile = $args[$i + 1];
2814 action => $cmds, 2870 action => $cmds,
2815 }; 2871 };
2816 } 2872 }
2817 } 2873 }
2818 } 2874 }
2819
2820 sdl_init;
2821 2875
2822 $ENV{FONTCONFIG_FILE} = DC::find_rcfile "fonts/fonts.conf"; 2876 $ENV{FONTCONFIG_FILE} = DC::find_rcfile "fonts/fonts.conf";
2823 $ENV{FONTCONFIG_DIR} = DC::find_rcfile "fonts"; 2877 $ENV{FONTCONFIG_DIR} = DC::find_rcfile "fonts";
2824 2878
2825 { 2879 {
2856# } 2910# }
2857# my $t2 = Time::HiRes::time; 2911# my $t2 = Time::HiRes::time;
2858# warn $t2-$t1; 2912# warn $t2-$t1;
2859# } 2913# }
2860 2914
2915 DC::IMG_Init;
2861 video_init; 2916 video_init;
2862 audio_init; 2917 audio_init;
2863 } 2918 }
2864 2919
2865 show_tip_of_the_day if $CFG->{show_tips}; 2920 show_tip_of_the_day if $CFG->{show_tips};
2867 our $STARTUP_CANCEL = EV::idle sub { 2922 our $STARTUP_CANCEL = EV::idle sub {
2868 undef $::STARTUP_CANCEL; 2923 undef $::STARTUP_CANCEL;
2869 $startup_done->(); 2924 $startup_done->();
2870 }; 2925 };
2871 2926
2927 debug_toggle 0;
2928
2872 delete $SIG{__DIE__}; 2929 delete $SIG{__DIE__};
2873 EV::loop; 2930 EV::loop;
2874 2931
2875 DC::write_cfg if $CFG->{config_autosave}; 2932 DC::write_cfg if $CFG->{config_autosave};
2876 2933
2898The deliantra client utilises OpenGL for all UI elements and the game. It 2955The deliantra client utilises OpenGL for all UI elements and the game. It
2899is supposed to be used in fullscreen mode and interactively. 2956is supposed to be used in fullscreen mode and interactively.
2900 2957
2901=head1 DEBUGGING 2958=head1 DEBUGGING
2902 2959
2903CFPLUS_DEBUG - environment variable 2960DELIANTRA_DEBUG - environment variable
2904 2961
2905 1 draw borders around widgets 2962 1 draw borders around widgets
2906 2 add low-level widget info to tooltips 2963 2 add low-level widget info to tooltips
2907 4 show fps 2964 4 show fps
2908 8 suppress tooltips 2965 8 suppress tooltips
2966 16 show bandwidth downstream
2909 2967
2910=head1 AUTHOR 2968=head1 AUTHOR
2911 2969
2912Marc Lehmann <deliantra@schmorp.de>, Robin Redeker <elmex@ta-sa.org> 2970Marc Lehmann <deliantra@schmorp.de>, Robin Redeker <elmex@ta-sa.org>
2913 2971

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines