ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/map-world.ext
(Generate patch)

Comparing deliantra/server/ext/map-world.ext (file contents):
Revision 1.29 by root, Mon Sep 10 17:24:36 2007 UTC vs.
Revision 1.31 by root, Wed Sep 19 21:56:30 2007 UTC

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
9cf::map->register (qr{^/world/world_(\d\d\d)_(\d\d\d)$}, 100);
8 10
9use Coro::Handle; 11use Coro::Handle;
10use Coro::AIO; 12use Coro::AIO;
11 13
12our $WORLD; 14our $WORLD;
86 88
87# this is contorted, but likely the correct way to acquire the lock :) 89# this is contorted, but likely the correct way to acquire the lock :)
88cf::sync_job { 90cf::sync_job {
89 my $guard = cf::lock_acquire "ext::world_gridmap"; 91 my $guard = cf::lock_acquire "ext::world_gridmap";
90 cf::async_ext { 92 cf::async_ext {
93 $Coro::current->{desc} = "worldmap loader";
91 reload; 94 reload;
92 undef $guard; 95 undef $guard;
93 }; 96 };
94}; 97};
95
96cf::map->register (qr{^/world/world_(\d\d\d)_(\d\d\d)$}, 100);
97 98
98sub wxwy { 99sub wxwy {
99 $_[0]->path =~ m{/world/world_(\d\d\d)_(\d\d\d)$} 100 $_[0]->path =~ m{/world/world_(\d\d\d)_(\d\d\d)$}
100 ? ($1, $2) 101 ? ($1, $2)
101 : (0, 0) 102 : (0, 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines