… | |
… | |
4 | use strict; |
4 | use strict; |
5 | |
5 | |
6 | use Symbol; |
6 | use Symbol; |
7 | use List::Util; |
7 | use List::Util; |
8 | use Storable; |
8 | use Storable; |
|
|
9 | use Event; |
9 | use Opcode; |
10 | use Opcode; |
10 | use Safe; |
11 | use Safe; |
11 | use Safe::Hole; |
12 | use Safe::Hole; |
12 | |
13 | |
13 | use Coro 3.5 (); |
14 | use Coro 3.52 (); |
|
|
15 | use Coro::State; |
14 | use Coro::Event; |
16 | use Coro::Event; |
15 | use Coro::Timer; |
17 | use Coro::Timer; |
16 | use Coro::Signal; |
18 | use Coro::Signal; |
17 | use Coro::Semaphore; |
19 | use Coro::Semaphore; |
18 | use Coro::AIO; |
20 | use Coro::AIO; |
… | |
… | |
24 | use IO::AIO 2.32 (); |
26 | use IO::AIO 2.32 (); |
25 | use YAML::Syck (); |
27 | use YAML::Syck (); |
26 | use Time::HiRes; |
28 | use Time::HiRes; |
27 | use Compress::LZF; |
29 | use Compress::LZF; |
28 | |
30 | |
|
|
31 | Coro::State::cctx_stacksize 256000; # 1-2MB stack, for deep recursions in maze generator |
29 | Compress::LZF::sfreeze_cr { }; # prime Compress::LZF so it does not use require later |
32 | Compress::LZF::sfreeze_cr { }; # prime Compress::LZF so it does not use require later |
30 | |
|
|
31 | use Event; $Event::Eval = 1; # no idea why this is required, but it is |
33 | $Event::Eval = 1; # no idea why this is required, but it is |
32 | |
34 | |
33 | sub WF_AUTOCANCEL () { 1 } # automatically cancel this watcher on reload |
35 | sub WF_AUTOCANCEL () { 1 } # automatically cancel this watcher on reload |
34 | |
36 | |
35 | # work around bug in YAML::Syck - bad news for perl6, will it be as broken wrt. unicode? |
37 | # work around bug in YAML::Syck - bad news for perl6, will it be as broken wrt. unicode? |
36 | $YAML::Syck::ImplicitUnicode = 1; |
38 | $YAML::Syck::ImplicitUnicode = 1; |
… | |
… | |
1993 | |
1995 | |
1994 | sub cf::client::send_drawinfo { |
1996 | sub cf::client::send_drawinfo { |
1995 | my ($self, $text, $flags) = @_; |
1997 | my ($self, $text, $flags) = @_; |
1996 | |
1998 | |
1997 | utf8::encode $text; |
1999 | utf8::encode $text; |
1998 | $self->send_packet (sprintf "drawinfo %d %s", $flags, $text); |
2000 | $self->send_packet (sprintf "drawinfo %d %s", $flags || cf::NDI_BLACK, $text); |
1999 | } |
2001 | } |
2000 | |
2002 | |
2001 | |
2003 | |
2002 | =item $success = $client->query ($flags, "text", \&cb) |
2004 | =item $success = $client->query ($flags, "text", \&cb) |
2003 | |
2005 | |
… | |
… | |
2284 | |
2286 | |
2285 | while (my ($face, $info) = each %$faces) { |
2287 | while (my ($face, $info) = each %$faces) { |
2286 | my $idx = (cf::face::find $face) || cf::face::alloc $face; |
2288 | my $idx = (cf::face::find $face) || cf::face::alloc $face; |
2287 | cf::face::set $idx, $info->{visibility}, $info->{magicmap}; |
2289 | cf::face::set $idx, $info->{visibility}, $info->{magicmap}; |
2288 | cf::face::set_data $idx, 0, $info->{data32}, $info->{chksum32}; |
2290 | cf::face::set_data $idx, 0, $info->{data32}, $info->{chksum32}; |
|
|
2291 | Coro::cede; |
|
|
2292 | } |
|
|
2293 | |
|
|
2294 | while (my ($face, $info) = each %$faces) { |
|
|
2295 | next unless $info->{smooth}; |
|
|
2296 | my $idx = cf::face::find $face |
|
|
2297 | or next; |
|
|
2298 | if (my $smooth = cf::face::find $info->{smooth}) { |
|
|
2299 | cf::face::set_smooth $idx, $smooth; |
|
|
2300 | warn "smooth $idx,$smooth ($face,$info->{smooth})\n";#d# |
|
|
2301 | } else { |
|
|
2302 | warn "smooth face '$info->{smooth}' not found for face '$face'"; |
|
|
2303 | } |
2289 | Coro::cede; |
2304 | Coro::cede; |
2290 | } |
2305 | } |
2291 | |
2306 | |
2292 | 1 |
2307 | 1 |
2293 | } |
2308 | } |