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.34 by root, Tue Sep 23 04:29:11 2008 UTC vs.
Revision 1.39 by root, Tue May 4 21:45:42 2010 UTC

81 Coro::Storable::thaw $map 81 Coro::Storable::thaw $map
82} 82}
83 83
84sub reload() { 84sub reload() {
85 $WORLD = load_gridmap "$MAPDIR/world"; 85 $WORLD = load_gridmap "$MAPDIR/world";
86 warn "worldmap gridmap loaded."; 86 cf::trace "worldmap gridmap loaded.\n";
87} 87}
88 88
89# this is contorted, but likely the correct way to acquire the lock :) 89{
90cf::post_init {
91 my $guard = cf::lock_acquire "ext::world_gridmap"; 90 my $guard = cf::lock_acquire "ext::world_gridmap";
91
92 cf::post_init {
92 cf::async_ext { 93 cf::async_ext {
93 $Coro::current->{desc} = "worldmap loader"; 94 $Coro::current->{desc} = "worldmap loader";
94 reload; 95 reload;
95 undef $guard; 96 undef $guard;
97 };
96 }; 98 };
97}; 99}
98 100
99sub wxwy { 101sub wxwy {
100 $_[0]->path =~ m{/world/world_(\d\d\d)_(\d\d\d)$} 102 $_[0]->path =~ m{/world/world_(\d\d\d)_(\d\d\d)$}
101 ? ($1, $2) 103 ? ($1, $2)
102 : (0, 0) 104 : (0, 0)
133} 135}
134 136
135sub fill { 137sub fill {
136 my ($self) = @_; 138 my ($self) = @_;
137 139
138 $self->add_underlay ("\x00" x ($WORLD->{tile_w} * $WORLD->{tile_h}), 0, $WORLD->{tile_w}, $WORLD->{arc_plt}); 140 $self->add_underlay ("\x00" x ($WORLD->{tile_w} * $WORLD->{tile_h}), 0, $WORLD->{tile_w}, $WORLD->{arc_plt});#d#
139 $self->default_region (cf::region::find $WORLD->{reg_plt}[0]); 141 $self->default_region (cf::region::find $WORLD->{reg_plt}[0]);
140} 142}
141 143
142sub load { 144sub load {
143 my ($self) = @_; 145 my ($self) = @_;
175 177
176 $self->create_region_treasure 178 $self->create_region_treasure
177 if delete $self->{need_create_treasure}; 179 if delete $self->{need_create_treasure};
178} 180}
179 181
1801
181

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines