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.3 by root, Wed Apr 19 20:46:44 2006 UTC vs.
Revision 1.4 by root, Wed Apr 19 23:37:49 2006 UTC

2 2
3use strict; 3use strict;
4 4
5use List::Util qw(min max); 5use List::Util qw(min max);
6 6
7use SDL::OpenGL; 7use CFClient::OpenGL;
8 8
9our @ISA = CFClient::UI::Base::; 9our @ISA = CFClient::UI::Base::;
10 10
11sub new { 11sub new {
12 my $class = shift; 12 my $class = shift;
13 13
14 $class->SUPER::new ( 14 $class->SUPER::new (
15 z => -1, 15 z => -1,
16 can_focus => 1, 16 can_focus => 1,
17 list => (glGenLists 1), 17 list => glGenList,
18 @_ 18 @_
19 ) 19 )
20}
21
22sub DESTROY {
23 my $self = shift;
24
25 glDeleteList $self->{list};
26
27 $self->SUPER::DESTROY;
20} 28}
21 29
22sub key_down { 30sub key_down {
23 print "MAPKEYDOWN\n"; 31 print "MAPKEYDOWN\n";
24} 32}
76 84
77sub draw { 85sub draw {
78 my ($self) = @_; 86 my ($self) = @_;
79 87
80 if (delete $self->{need_update}) { 88 if (delete $self->{need_update}) {
81 glNewList $self->{list}, GL_COMPILE; 89 glNewList $self->{list};
82 90
83 if ($::MAP) { 91 if ($::MAP) {
84 my $sw = int $::WIDTH / 32; 92 my $sw = int $::WIDTH / 32;
85 my $sh = int $::HEIGHT / 32; 93 my $sh = int $::HEIGHT / 32;
86 94

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines