… | |
… | |
8 | |
8 | |
9 | our $VERSION = '0.1'; |
9 | our $VERSION = '0.1'; |
10 | |
10 | |
11 | use strict; |
11 | use strict; |
12 | |
12 | |
|
|
13 | use base 'Exporter'; |
|
|
14 | |
13 | use Storable; |
15 | use Storable; |
14 | use List::Util qw(max); |
16 | |
|
|
17 | our @EXPORT = qw(read_pak read_arch arch2map $ARCH TILESIZE); |
15 | |
18 | |
16 | our $LIB = $ENV{CROSSFIRE_LIBDIR} |
19 | our $LIB = $ENV{CROSSFIRE_LIBDIR} |
17 | or die "\$CROSSFIRE_LIBDIR must be set\n"; |
20 | or die "\$CROSSFIRE_LIBDIR must be set\n"; |
18 | |
21 | |
19 | sub T (){ 32 } |
22 | sub TILESIZE (){ 32 } |
20 | |
23 | |
21 | our $ARCH; |
24 | our $ARCH; |
22 | our $TILE; |
|
|
23 | |
25 | |
24 | sub read_pak($;$) { |
26 | sub read_pak($;$) { |
25 | my ($path, $cache) = @_; |
27 | my ($path, $cache) = @_; |
26 | |
28 | |
27 | eval { |
29 | eval { |
… | |
… | |
160 | |
162 | |
161 | sub init($) { |
163 | sub init($) { |
162 | my ($cachedir) = @_; |
164 | my ($cachedir) = @_; |
163 | |
165 | |
164 | $ARCH = read_arch "$LIB/archetypes", "$cachedir/archetypes.pst"; |
166 | $ARCH = read_arch "$LIB/archetypes", "$cachedir/archetypes.pst"; |
165 | $TILE = read_pak "$LIB/crossfire.0", "$cachedir/crossfire.0.pst"; |
|
|
166 | } |
167 | } |
167 | |
168 | |
168 | =head1 AUTHOR |
169 | =head1 AUTHOR |
169 | |
170 | |
170 | Marc Lehmann <schmorp@schmorp.de> |
171 | Marc Lehmann <schmorp@schmorp.de> |