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.58 by root, Thu Mar 23 20:15:08 2006 UTC vs.
Revision 1.60 by root, Mon Mar 27 17:23:35 2006 UTC

59 59
60 name name_pl custom_name title race 60 name name_pl custom_name title race
61 slaying skill msg lore other_arch face 61 slaying skill msg lore other_arch face
62 #todo-events 62 #todo-events
63 animation is_animated 63 animation is_animated
64 Str Dex Con Wis Pow Cha Int 64 str dex con wis pow cha int
65 hp maxhp sp maxsp grace maxgrace 65 hp maxhp sp maxsp grace maxgrace
66 exp perm_exp expmul 66 exp perm_exp expmul
67 food dam luck wc ac x y speed speed_left move_state attack_movement 67 food dam luck wc ac x y speed speed_left move_state attack_movement
68 nrof level direction type subtype 68 nrof level direction type subtype attacktype
69 69
70 resist_physical resist_magic resist_fire resist_electricity 70 resist_physical resist_magic resist_fire resist_electricity
71 resist_cold resist_confusion resist_acid resist_drain 71 resist_cold resist_confusion resist_acid resist_drain
72 resist_weaponmagic resist_ghosthit resist_poison resist_slow 72 resist_weaponmagic resist_ghosthit resist_poison resist_slow
73 resist_paralyze resist_turn_undead resist_fear resist_cancellation 73 resist_paralyze resist_turn_undead resist_fear resist_cancellation
628 cache_file "$LIB/crossfire.0", "$VARDIR/tilecache.pst", sub { 628 cache_file "$LIB/crossfire.0", "$VARDIR/tilecache.pst", sub {
629 $TILE = new_from_file Gtk2::Gdk::Pixbuf "$VARDIR/tilecache.png" 629 $TILE = new_from_file Gtk2::Gdk::Pixbuf "$VARDIR/tilecache.png"
630 or die "$VARDIR/tilecache.png: $!"; 630 or die "$VARDIR/tilecache.png: $!";
631 *FACE = $_[0]; 631 *FACE = $_[0];
632 }, sub { 632 }, sub {
633 require File::Temp;
634
635 my $tile = read_pak "$LIB/crossfire.0"; 633 my $tile = read_pak "$LIB/crossfire.0";
636 634
637 my %cache; 635 my %cache;
638 636
639 my $idx = 0; 637 my $idx = 0;
640 638
641 for my $name (sort keys %$tile) { 639 for my $name (sort keys %$tile) {
642 my ($fh, $filename) = File::Temp::tempfile (); 640 my $pb = new Gtk2::Gdk::PixbufLoader;
643 print $fh $tile->{$name}; 641 $pb->write ($tile->{$name});
644 close $fh; 642 $pb->close;
645 my $pb = new_from_file Gtk2::Gdk::Pixbuf $filename; 643 my $pb = $pb->get_pixbuf;
646 unlink $filename;
647 644
648 my $tile = $cache{$name} = { 645 my $tile = $cache{$name} = {
649 pb => $pb, 646 pb => $pb,
650 idx => $idx, 647 idx => $idx,
651 w => int $pb->get_width / TILESIZE, 648 w => int $pb->get_width / TILESIZE,
669 $pb, ($idx % 64) * TILESIZE, TILESIZE * int $idx / 64); 666 $pb, ($idx % 64) * TILESIZE, TILESIZE * int $idx / 64);
670 } 667 }
671 } 668 }
672 } 669 }
673 670
674 $pb->save ("$VARDIR/tilecache.png", "png"); 671 $pb->save ("$VARDIR/tilecache.png", "png", compression => 1);
675 672
676 \%cache 673 \%cache
677 }; 674 };
678} 675}
679 676

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines