ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra/Deliantra.pm
(Generate patch)

Comparing deliantra/Deliantra/Deliantra.pm (file contents):
Revision 1.6 by elmex, Sun Feb 5 00:28:09 2006 UTC vs.
Revision 1.8 by root, Sun Feb 5 02:29:13 2006 UTC

5=cut 5=cut
6 6
7package Crossfire; 7package Crossfire;
8 8
9our $VERSION = '0.1'; 9our $VERSION = '0.1';
10use base 'Exporter';
11our @EXPORT = qw(read_pak read_arch arch2map);
12 10
13use strict; 11use strict;
14 12
13use base 'Exporter';
14
15use Storable; 15use Storable;
16
17our @EXPORT = qw(read_pak read_arch arch2map $ARCH TILESIZE);
16 18
17our $LIB = $ENV{CROSSFIRE_LIBDIR} 19our $LIB = $ENV{CROSSFIRE_LIBDIR}
18 or die "\$CROSSFIRE_LIBDIR must be set\n"; 20 or die "\$CROSSFIRE_LIBDIR must be set\n";
19 21
20sub T (){ 32 } 22sub TILESIZE (){ 32 }
21 23
22our $ARCH; 24our $ARCH;
23our $TILE;
24 25
25sub read_pak($;$) { 26sub read_pak($;$) {
26 my ($path, $cache) = @_; 27 my ($path, $cache) = @_;
27 28
28 eval { 29 eval {
153 } 154 }
154 } 155 }
155 156
156 $meta{width} = $mapx; 157 $meta{width} = $mapx;
157 $meta{height} = $mapy; 158 $meta{height} = $mapy;
159 $meta{map} = $map;
158 160
159 \%meta 161 \%meta
160} 162}
161 163
162sub init($) { 164sub init($) {
163 my ($cachedir) = @_; 165 my ($cachedir) = @_;
164 166
165 $ARCH = read_arch "$LIB/archetypes", "$cachedir/archetypes.pst"; 167 $ARCH = read_arch "$LIB/archetypes", "$cachedir/archetypes.pst";
166 $TILE = read_pak "$LIB/crossfire.0", "$cachedir/crossfire.0.pst";
167} 168}
168 169
169=head1 AUTHOR 170=head1 AUTHOR
170 171
171 Marc Lehmann <schmorp@schmorp.de> 172 Marc Lehmann <schmorp@schmorp.de>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines