--- deliantra/Deliantra-Client/DC/MapWidget.pm 2006/05/19 18:39:08 1.30 +++ deliantra/Deliantra-Client/DC/MapWidget.pm 2006/05/19 23:18:42 1.31 @@ -117,26 +117,26 @@ glEnable GL_CONVOLUTION_2D; } - undef $self->{fow_texture};#d# remove + # try to re-use the texture name: TODO improve texture class instead + my $prev_name = ((delete $self->{fow_texture}) || {})->{name}; + $self->{fow_texture} = new CFClient::Texture w => $w, h => $h, data => $data, + name => $prev_name, # a bit hackish internalformat => GL_ALPHA, format => GL_ALPHA; glDisable GL_CONVOLUTION_2D if $::CFG->{fow_smooth}; - glEnable GL_BLEND; - glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; glEnable GL_TEXTURE_2D; glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; glColor +($::CFG->{fow_intensity}) x 3, 0.8; - $self->{fow_texture}->draw_quad (0, 0, $w * 32, $h * 32); + $self->{fow_texture}->draw_quad_alpha (0, 0, $w * 32, $h * 32); glDisable GL_TEXTURE_2D; - glDisable GL_BLEND; } glPopMatrix;