--- deliantra/Deliantra-Client/DC/UI.pm 2006/04/12 21:01:46 1.88 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/04/12 23:32:27 1.92 @@ -1526,6 +1526,19 @@ glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; + if ($::CFG->{fow_smooth}) { # smooth fog of war + my @conv = ( + 0.1, 0.1, 0.1, + 0.1, 0.2, 0.1, + 0.1, 0.1, 0.1, + ); + glConvolutionParameter GL_CONVOLUTION_2D, GL_CONVOLUTION_BORDER_MODE, GL_CONSTANT_BORDER; + glConvolutionFilter2D GL_CONVOLUTION_2D, + GL_ALPHA, 3, 3, GL_ALPHA, GL_FLOAT, + pack "f*", @conv; + glEnable GL_CONVOLUTION_2D; + } + $darkness = new CFClient::Texture w => $sw4, h => $sh, @@ -1533,9 +1546,11 @@ internalformat => GL_ALPHA, format => GL_ALPHA; - glColor 0.45, 0.45, 0.45, 1; + glColor +($::CFG->{fow_intensity}) x 3, 1; $darkness->draw_quad (0, 0, $sw4 * 32, $sh * 32); + glDisable GL_CONVOLUTION_2D if $::CFG->{fow_smooth}; + glDisable GL_TEXTURE_2D; glDisable GL_BLEND; @@ -1580,18 +1595,18 @@ my $sym = $ev->key_sym; if ($sym == SDLK_KP5) { - $::CONN->send ("command stay fire"); + $::CONN->user_send ("command stay fire"); } elsif ($sym == SDLK_a) { - $::CONN->send ("command apply"); + $::CONN->user_send ("command apply"); } elsif (exists $DIR{$sym}) { if ($mod & KMOD_SHIFT) { $self->{shft}++; - $::CONN->send ("command fire $DIR{$sym}[0]"); + $::CONN->user_send ("command fire $DIR{$sym}[0]"); } elsif ($mod & KMOD_CTRL) { $self->{ctrl}++; - $::CONN->send ("command run $DIR{$sym}[0]"); + $::CONN->user_send ("command run $DIR{$sym}[0]"); } else { - $::CONN->send ("command $DIR{$sym}[1]"); + $::CONN->user_send ("command $DIR{$sym}[1]"); } } } @@ -1603,10 +1618,10 @@ my $sym = $ev->key_sym; if (!($mod & KMOD_SHIFT) && delete $self->{shft}) { - $::CONN->send ("command fire_stop"); + $::CONN->user_send ("command fire_stop"); } if (!($mod & KMOD_CTRL ) && delete $self->{ctrl}) { - $::CONN->send ("command run_stop"); + $::CONN->user_send ("command run_stop"); } }