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

Comparing deliantra/Deliantra/Deliantra/Tilecache.pm (file contents):
Revision 1.2 by root, Sun Feb 5 21:19:26 2006 UTC vs.
Revision 1.3 by root, Sun Feb 12 04:50:24 2006 UTC

12 12
13use Gtk2; 13use Gtk2;
14 14
15use Crossfire; 15use Crossfire;
16 16
17our $TILECACHE;
18our %TILECACHE;
19
20sub init_tilecache($) { 17sub init_tilecache($) {
21 my ($cacheprefix) = @_; 18 my ($cacheprefix) = @_;
22 19
23 eval { 20 eval {
24 -M "$cacheprefix.pst" < -M "$Crossfire::LIB/crossfire.0" 21 -M "$cacheprefix.pst" < -M "$Crossfire::LIB/crossfire.0"
25 && ($TILECACHE = new_from_file Gtk2::Gdk::Pixbuf "$cacheprefix.png") 22 && ($Crossfire::TILE = new_from_file Gtk2::Gdk::Pixbuf "$cacheprefix.png")
26 && (*TILECACHE = Storable::retrieve "$cacheprefix.pst") 23 && (*Crossfire::FACE = Storable::retrieve "$cacheprefix.pst")
27 } or do { 24 } or do {
28 my $tile = read_pak "$Crossfire::LIB/crossfire.0"; 25 my $tile = read_pak "$Crossfire::LIB/crossfire.0";
29 26
30 my %cache; 27 my %cache;
31 28
69 } 66 }
70 67
71 $pb->save ("$cacheprefix.png", "png"); 68 $pb->save ("$cacheprefix.png", "png");
72 Storable::nstore \%cache, "$cacheprefix.pst"; 69 Storable::nstore \%cache, "$cacheprefix.pst";
73 70
74 $TILECACHE = $pb; 71 $Crossfire::TILE = $pb;
75 *TILECACHE = \%cache; 72 *Crossfire::FACE = \%cache;
76 } 73 }
77} 74}
75
76init_tilecache "$Crossfire::CACHEDIR/tilecache";
78 77
79=head1 AUTHOR 78=head1 AUTHOR
80 79
81 Marc Lehmann <schmorp@schmorp.de> 80 Marc Lehmann <schmorp@schmorp.de>
82 http://home.schmorp.de/ 81 http://home.schmorp.de/

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines