--- deliantra/Deliantra-Client/DC/UI.pm 2006/06/04 23:05:06 1.278 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/06/05 00:17:47 1.279 @@ -857,13 +857,10 @@ glEnable GL_TEXTURE_2D; glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; - glEnable GL_BLEND; - glBlendFunc GL_ONE, GL_ONE_MINUS_SRC_ALPHA; glColor 0, 0, 0, 1; - $tex->draw_quad (0, 0, $w, $h); + $tex->draw_quad_alpha_premultiplied (0, 0, $w, $h); - glDisable GL_BLEND; glDisable GL_TEXTURE_2D; } @@ -1640,12 +1637,10 @@ glEnable GL_TEXTURE_2D; glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; - if ($tex->{format} == GL_ALPHA) { - glColor @{$self->{fg}}; - $tex->draw_quad_alpha ($self->{ox}, $self->{oy}); - } else { - $tex->draw_quad_alpha_premultiplied ($self->{ox}, $self->{oy}); - } + glColor_premultiply @{$self->{fg}} + if $tex->{format} == GL_ALPHA; + + $tex->draw_quad_alpha_premultiplied ($self->{ox}, $self->{oy}); glDisable GL_TEXTURE_2D; } @@ -1915,11 +1910,7 @@ sub _draw { my ($self) = @_; - local $self->{fg} = $self->{fg}; - - if ($GRAB == $self) { - $self->{fg} = $self->{active_fg}; - } + local $self->{fg} = $GRAB == $self ? $self->{active_fg} : $self->{fg}; glEnable GL_TEXTURE_2D; glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; @@ -2577,7 +2568,7 @@ } $self->{texture} ||= new_from_opengl CFClient::Texture $W, $H, sub { - glClearColor 0.5, 0.5, 0.5, 0; + glClearColor 0, 0, 0, 0; glClear GL_COLOR_BUFFER_BIT; my $top = int $self->{children}[1]{range}[0]; @@ -2622,8 +2613,8 @@ glEnable GL_TEXTURE_2D; glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; - glColor 1, 1, 1, 1; - $self->{texture}->draw_quad_alpha (0, 0, $self->{children}[0]{w}, $self->{children}[0]{h}); + glColor 0, 0, 0, 1; + $self->{texture}->draw_quad_alpha_premultiplied (0, 0, $self->{children}[0]{w}, $self->{children}[0]{h}); glDisable GL_TEXTURE_2D; $self->{children}[1]->draw; @@ -2860,7 +2851,7 @@ if ($tex) { glEnable GL_TEXTURE_2D; glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; - glColor 1, 1, 1, 1; + glColor 0, 0, 0, 1; $tex->draw_quad_alpha (0, 0, $self->{w}, $self->{h}); glDisable GL_TEXTURE_2D; }