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

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.81 by root, Wed Apr 12 00:40:45 2006 UTC vs.
Revision 1.82 by root, Wed Apr 12 02:00:06 2006 UTC

133 my ($self, $x, $y, $w, $h) = @_; 133 my ($self, $x, $y, $w, $h) = @_;
134 134
135 $self->_size_allocate ($x, $y, $w, $h); 135 $self->_size_allocate ($x, $y, $w, $h);
136} 136}
137 137
138# translate global koordinates to local coordinate system 138# translate global coordinates to local coordinate system
139sub translate { 139sub translate {
140 my ($self, $x, $y) = @_; 140 my ($self, $x, $y) = @_;
141 141
142 $self->{parent}->translate ($x - $self->{x}, $y - $self->{y}); 142 $self->{parent}->translate ($x - $self->{x}, $y - $self->{y});
143} 143}
637 637
638 my $bg = $tex[0]; 638 my $bg = $tex[0];
639 639
640 glBindTexture GL_TEXTURE_2D, $bg->{name}; 640 glBindTexture GL_TEXTURE_2D, $bg->{name};
641 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; 641 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE;
642 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT;
643 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT;
644 642
645 my $rep_x = $cw / $bg->{w}; 643 my $rep_x = $cw / $bg->{w};
646 my $rep_y = $ch / $bg->{h}; 644 my $rep_y = $ch / $bg->{h};
647 645
648 $bg->draw_quad ($left->{w}, $top->{h}, $cw, $ch); 646 $bg->draw_quad ($left->{w}, $top->{h}, $cw, $ch);
1000 my $x = 998 my $x =
1001 $self->{align} < 0 ? $self->{padding} 999 $self->{align} < 0 ? $self->{padding}
1002 : $self->{align} > 0 ? $self->{w} - $tex->{w} - $self->{padding} 1000 : $self->{align} > 0 ? $self->{w} - $tex->{w} - $self->{padding}
1003 : ($self->{w} - $tex->{w}) * 0.5; 1001 : ($self->{w} - $tex->{w}) * 0.5;
1004 1002
1005 $tex->draw_quad ($x, $self->{padding}); 1003 glTranslate $x, $self->{padding}, 0;
1004 $tex->draw_quad (0, 0);
1006 1005
1007 glDisable GL_TEXTURE_2D; 1006 glDisable GL_TEXTURE_2D;
1008 glDisable GL_BLEND; 1007 glDisable GL_BLEND;
1009} 1008}
1010 1009
1034 1033
1035 $self->{last_activity} = $::NOW; 1034 $self->{last_activity} = $::NOW;
1036 1035
1037 $self->{text} = $text; 1036 $self->{text} = $text;
1038 $self->{layout}->set_width ($self->{w}); 1037 $self->{layout}->set_width ($self->{w});
1038 $self->{layout}->set_height (List::Util::min $self->{h} - $self->{padding} * 2, $self->{height});
1039 1039
1040 $text =~ s/./*/g if $self->{hidden}; 1040 $text =~ s/./*/g if $self->{hidden};
1041 1041
1042 $self->{layout}->set_markup ($self->escape_text ($text) . " "); 1042 $self->{layout}->set_markup ($self->escape_text ($text) . " ");
1043 1043

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines