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

Comparing deliantra/maps/perl/map-prefetch.ext (file contents):
Revision 1.12 by root, Sun Aug 27 15:23:30 2006 UTC vs.
Revision 1.14 by root, Tue Nov 7 15:04:44 2006 UTC

6 6
7use Errno (); 7use Errno ();
8use Time::HiRes; 8use Time::HiRes;
9use Fcntl; 9use Fcntl;
10use IO::AIO; 10use IO::AIO;
11
12Event->io (fd => IO::AIO::poll_fileno,
13 poll => 'r',
14 cb => \&IO::AIO::poll_cb);
15 11
16# find all potential exit paths, this is slow, so this info is cached 12# find all potential exit paths, this is slow, so this info is cached
17sub find_exits { 13sub find_exits {
18 my ($map) = @_; 14 my ($map) = @_;
19 15
112 prefetch map => $_ for @$exit; 108 prefetch map => $_ for @$exit;
113} 109}
114 110
115cf::attach_to_players prio => -900, 111cf::attach_to_players prio => -900,
116 on_map_change => sub { 112 on_map_change => sub {
117 my ($pl, $old, $new) = @_; 113 my ($pl, $new, $x, $x) = @_;
118 114
119 prefetch_map $new; 115 prefetch_map $new;
120 }, 116 },
121; 117;
122 118

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines