1 | #!/opt/bin/perl |
1 | #!/opt/bin/perl |
2 | |
2 | |
3 | use strict; |
3 | use strict; |
4 | use utf8; |
4 | use utf8; |
|
|
5 | |
|
|
6 | BEGIN { |
|
|
7 | if (%PAR::LibCache) { |
|
|
8 | @INC = grep ref, @INC; # weed out all paths except pars loader refs |
|
|
9 | |
|
|
10 | while (my ($filename, $zip) = each %PAR::LibCache) { |
|
|
11 | for ($zip->memberNames) { |
|
|
12 | next unless /^\/root\/(.*)/; |
|
|
13 | $zip->extractMember ($_, "$ENV{PAR_TEMP}/$1") |
|
|
14 | unless -e "$ENV{PAR_TEMP}/$1"; |
|
|
15 | } |
|
|
16 | } |
|
|
17 | |
|
|
18 | unshift @INC, $ENV{PAR_TEMP}; |
|
|
19 | |
|
|
20 | if ($^O eq "MSWin32") { |
|
|
21 | $ENV{GTK_RC_FILES} = "$ENV{PAR_TEMP}/share/themes/MS-Windows/gtk-2.0/gtkrc"; |
|
|
22 | } |
|
|
23 | } |
|
|
24 | } |
|
|
25 | |
|
|
26 | # need to do it again because that pile of garbage called PAR nukes it before main |
|
|
27 | unshift @INC, $ENV{PAR_TEMP}; |
5 | |
28 | |
6 | use Time::HiRes 'time'; |
29 | use Time::HiRes 'time'; |
7 | use Event; |
30 | use Event; |
8 | |
31 | |
9 | use Crossfire; |
32 | use Crossfire; |
… | |
… | |
12 | use Compress::LZF; |
35 | use Compress::LZF; |
13 | |
36 | |
14 | use CFClient; |
37 | use CFClient; |
15 | use CFClient::UI; |
38 | use CFClient::UI; |
16 | use CFClient::MapWidget; |
39 | use CFClient::MapWidget; |
|
|
40 | |
|
|
41 | $Event::DIED = sub { |
|
|
42 | CFClient::error $_[1]; |
|
|
43 | }; |
17 | |
44 | |
18 | our $VERSION = '0.1'; |
45 | our $VERSION = '0.1'; |
19 | |
46 | |
20 | my $MAX_FPS = 60; |
47 | my $MAX_FPS = 60; |
21 | my $MIN_FPS = 5; # unused as of yet |
48 | my $MIN_FPS = 5; # unused as of yet |
… | |
… | |
812 | $BUTTONBAR->{children}[1]->emit ("activate"); # pop up server setup |
839 | $BUTTONBAR->{children}[1]->emit ("activate"); # pop up server setup |
813 | } |
840 | } |
814 | |
841 | |
815 | sub video_shutdown { |
842 | sub video_shutdown { |
816 | $CFClient::UI::ROOT->{children} = []; |
843 | $CFClient::UI::ROOT->{children} = []; |
|
|
844 | undef $CFClient::UI::GRAB; |
|
|
845 | undef $CFClient::UI::HOVER; |
817 | undef $SDL_ACTIVE; |
846 | undef $SDL_ACTIVE; |
818 | } |
847 | } |
819 | |
848 | |
820 | my @bgmusic = qw(game1.ogg game2.ogg game3.ogg game5.ogg game6.ogg ross1.ogg ross2.ogg ross3.ogg ross4.ogg ross5.ogg); #d# |
849 | my @bgmusic = qw(game1.ogg game2.ogg game3.ogg game5.ogg game6.ogg ross1.ogg ross2.ogg ross3.ogg ross4.ogg ross5.ogg); #d# |
821 | my $bgmusic;#TODO#hack#d# |
850 | my $bgmusic;#TODO#hack#d# |