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

Comparing deliantra/gde/GCE/StackView.pm (file contents):
Revision 1.9 by elmex, Thu Mar 16 01:13:57 2006 UTC vs.
Revision 1.10 by elmex, Thu Mar 16 14:00:24 2006 UTC

12 12
13use Crossfire; 13use Crossfire;
14use Crossfire::MapWidget; 14use Crossfire::MapWidget;
15 15
16use GCE::AttrEdit; 16use GCE::AttrEdit;
17use GCE::Util;
17 18
18use Glib::Object::Subclass Gtk2::VBox; 19use Glib::Object::Subclass Gtk2::VBox;
19 20
20use strict; 21use strict;
21 22
34 35
35 $self->{stackbox}->remove ($_); 36 $self->{stackbox}->remove ($_);
36 } 37 }
37 38
38 my $stack = $mapedit->get ($x, $y); 39 my $stack = $mapedit->get ($x, $y);
39 my $idx = (@$stack - 1); 40 my $idx = $stack ? (@$stack - 1) : 0;
40 41
41 for (reverse @$stack) { 42 for (reverse @$stack) {
42 # FIXME: How to change a stack with a virtual arch???? 43 # FIXME: How to change a stack with a virtual arch????
43 next if $_->{_virtual}; 44 next if $_->{_virtual};
44 45
45 #my $a = $_->{_virtual} || $_; 46 #my $a = $_->{_virtual} || $_;
46 my $a = $_; 47 my $a = $_;
47 48
48 # this is awful, is this really the best way? 49 # this is awful, is this really the best way?
49 my $pb = new Gtk2::Gdk::Pixbuf 'rgb', 1, 8, TILESIZE, TILESIZE; 50 my $pb = new Gtk2::Gdk::Pixbuf 'rgb', 1, 8, TILESIZE, TILESIZE;
50 $pb->fill (0x00000000);
51 51
52 $TILE->composite ($pb, 52 fill_pb_from_arch ($pb, $a);
53 0, 0,
54 TILESIZE, TILESIZE,
55 - ($a->{_face} % 64) * TILESIZE, - TILESIZE * int $a->{_face} / 64,
56 1, 1, 'nearest', 255
57 );
58 53
59 $self->{stackbox}->pack_start (my $hb = Gtk2::HBox->new, 0, 0, 0); 54 $self->{stackbox}->pack_start (my $hb = Gtk2::HBox->new, 0, 0, 0);
60 $hb->pack_start (my $delbtn = Gtk2::Button->new_with_label ('del'), 0, 0, 0); 55 $hb->pack_start (my $delbtn = Gtk2::Button->new_with_label ('del'), 0, 0, 0);
61 do { 56 do {
62 my $ownidx = $idx; 57 my $ownidx = $idx;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines