… | |
… | |
33 | use AnyEvent::Socket (); |
33 | use AnyEvent::Socket (); |
34 | use AnyEvent::DNS (); |
34 | use AnyEvent::DNS (); |
35 | |
35 | |
36 | use Compress::LZF; |
36 | use Compress::LZF; |
37 | use JSON::XS; |
37 | use JSON::XS; |
|
|
38 | use Urlader; |
38 | |
39 | |
39 | use DC; |
40 | use DC; |
40 | |
41 | |
41 | sub crash($;$) { |
42 | sub crash($;$) { |
42 | # nop at compiletime |
43 | # nop at compiletime |
… | |
… | |
44 | |
45 | |
45 | BEGIN { |
46 | BEGIN { |
46 | $SIG{__DIE__} = sub { |
47 | $SIG{__DIE__} = sub { |
47 | return if $^S; # quick reject |
48 | return if $^S; # quick reject |
48 | |
49 | |
49 | # return if there are any eval contexts in the csall stack |
50 | # return if there are any eval contexts in the call stack |
50 | for my $i (0..999) { |
51 | for my $i (0..999) { |
51 | my ($sub, $is_require) = (caller $i)[3, 7] |
52 | my ($sub, $is_require) = (caller $i)[3, 7] |
52 | or last; |
53 | or last; |
53 | return if $sub eq "(eval)" && !$is_require; |
54 | return if $sub eq "(eval)" && !$is_require; |
54 | } |
55 | } |
… | |
… | |
2660 | DC::set_theme $CFG->{uitheme}; |
2661 | DC::set_theme $CFG->{uitheme}; |
2661 | |
2662 | |
2662 | DC::SDL_InitSubSystem DC::SDL_INIT_VIDEO if $SDL_REINIT; |
2663 | DC::SDL_InitSubSystem DC::SDL_INIT_VIDEO if $SDL_REINIT; |
2663 | $SDL_REINIT = 0; |
2664 | $SDL_REINIT = 0; |
2664 | |
2665 | |
2665 | @SDL_MODES = DC::SDL_ListModes 8, $CFG->{disable_alpha} ? 0 : 8; |
2666 | @SDL_MODES = DC::SDL_ListModes 8, $CFG->{disable_alpha} ? 0 : 2; |
2666 | @SDL_MODES = DC::SDL_ListModes 8, 8 unless @SDL_MODES; |
2667 | @SDL_MODES = DC::SDL_ListModes 8, 8 unless @SDL_MODES; |
2667 | @SDL_MODES = DC::SDL_ListModes 5, 0 unless @SDL_MODES; |
2668 | @SDL_MODES = DC::SDL_ListModes 5, 0 unless @SDL_MODES; |
2668 | @SDL_MODES or DC::fatal "Unable to find a usable video mode\n(hardware accelerated opengl fullscreen)"; |
2669 | @SDL_MODES or DC::fatal "Unable to find a usable video mode\n(hardware accelerated opengl fullscreen)"; |
2669 | |
2670 | |
2670 | @SDL_MODES = sort { $a->[0] * $a->[1] <=> $b->[0] * $b->[1] } @SDL_MODES; |
2671 | @SDL_MODES = sort { $a->[0] * $a->[1] <=> $b->[0] * $b->[1] } @SDL_MODES; |