… | |
… | |
3 | # optional plug-in to speed up worldmap rendering by dynamically |
3 | # optional plug-in to speed up worldmap rendering by dynamically |
4 | # generating it out of an image |
4 | # generating it out of an image |
5 | # - saves loading time (less data to read) |
5 | # - saves loading time (less data to read) |
6 | # - saves temporary space (only overlay stuff needs to be saved) |
6 | # - saves temporary space (only overlay stuff needs to be saved) |
7 | # - might get reused as a generic tiled map |
7 | # - might get reused as a generic tiled map |
|
|
8 | |
|
|
9 | cf::map->register (qr{^/world/world_(\d\d\d)_(\d\d\d)$}, 100); |
8 | |
10 | |
9 | use Coro::Handle; |
11 | use Coro::Handle; |
10 | use Coro::AIO; |
12 | use Coro::AIO; |
11 | |
13 | |
12 | our $WORLD; |
14 | our $WORLD; |
… | |
… | |
91 | reload; |
93 | reload; |
92 | undef $guard; |
94 | undef $guard; |
93 | }; |
95 | }; |
94 | }; |
96 | }; |
95 | |
97 | |
96 | cf::map->register (qr{^/world/world_(\d\d\d)_(\d\d\d)$}, 100); |
|
|
97 | |
|
|
98 | sub wxwy { |
98 | sub wxwy { |
99 | $_[0]->path =~ m{/world/world_(\d\d\d)_(\d\d\d)$} |
99 | $_[0]->path =~ m{/world/world_(\d\d\d)_(\d\d\d)$} |
100 | ? ($1, $2) |
100 | ? ($1, $2) |
101 | : (0, 0) |
101 | : (0, 0) |
102 | } |
102 | } |