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

Comparing deliantra/Deliantra-Client/DC/MapWidget.pm (file contents):
Revision 1.142 by root, Sat Aug 30 08:04:01 2008 UTC vs.
Revision 1.144 by root, Wed Sep 3 10:08:18 2008 UTC

11use DC::Macro; 11use DC::Macro;
12 12
13our @ISA = DC::UI::Base::; 13our @ISA = DC::UI::Base::;
14 14
15my $magicmap_tex = 15my $magicmap_tex =
16 new_from_file DC::Texture DC::find_rcfile "magicmap.png", 16 new_from_resource DC::Texture "magicmap.png",
17 mipmap => 1, wrap => 0, internalformat => GL_ALPHA; 17 mipmap => 1, wrap => 0, internalformat => GL_ALPHA;
18 18
19sub new { 19sub new {
20 my $class = shift; 20 my $class = shift;
21 21
610sub refresh_hook { 610sub refresh_hook {
611 my ($self) = @_; 611 my ($self) = @_;
612 612
613 if ($::MAP && $self->{texture_atime} < time) { 613 if ($::MAP && $self->{texture_atime} < time) {
614 my ($w, $h) = @$self{qw(w h)}; 614 my ($w, $h) = @$self{qw(w h)};
615
616 return unless $w && $h;
615 617
616 my $sw = int $::WIDTH / ($::MAPWIDGET->{tilesize} * $::CFG->{map_scale}) + 0.99; 618 my $sw = int $::WIDTH / ($::MAPWIDGET->{tilesize} * $::CFG->{map_scale}) + 0.99;
617 my $sh = int $::HEIGHT / ($::MAPWIDGET->{tilesize} * $::CFG->{map_scale}) + 0.99; 619 my $sh = int $::HEIGHT / ($::MAPWIDGET->{tilesize} * $::CFG->{map_scale}) + 0.99;
618 620
619 my $ox = 0.5 * ($w - $sw); 621 my $ox = 0.5 * ($w - $sw);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines