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.30 by root, Fri May 19 18:39:08 2006 UTC vs.
Revision 1.31 by root, Fri May 19 23:18:42 2006 UTC

115 0.05, 0.13, 0.05, 115 0.05, 0.13, 0.05,
116 ); 116 );
117 glEnable GL_CONVOLUTION_2D; 117 glEnable GL_CONVOLUTION_2D;
118 } 118 }
119 119
120 undef $self->{fow_texture};#d# remove 120 # try to re-use the texture name: TODO improve texture class instead
121 my $prev_name = ((delete $self->{fow_texture}) || {})->{name};
122
121 $self->{fow_texture} = new CFClient::Texture 123 $self->{fow_texture} = new CFClient::Texture
122 w => $w, 124 w => $w,
123 h => $h, 125 h => $h,
124 data => $data, 126 data => $data,
127 name => $prev_name, # a bit hackish
125 internalformat => GL_ALPHA, 128 internalformat => GL_ALPHA,
126 format => GL_ALPHA; 129 format => GL_ALPHA;
127 130
128 glDisable GL_CONVOLUTION_2D if $::CFG->{fow_smooth}; 131 glDisable GL_CONVOLUTION_2D if $::CFG->{fow_smooth};
129 132
130 glEnable GL_BLEND;
131 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA;
132 glEnable GL_TEXTURE_2D; 133 glEnable GL_TEXTURE_2D;
133 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; 134 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE;
134 135
135 glColor +($::CFG->{fow_intensity}) x 3, 0.8; 136 glColor +($::CFG->{fow_intensity}) x 3, 0.8;
136 $self->{fow_texture}->draw_quad (0, 0, $w * 32, $h * 32); 137 $self->{fow_texture}->draw_quad_alpha (0, 0, $w * 32, $h * 32);
137 138
138 glDisable GL_TEXTURE_2D; 139 glDisable GL_TEXTURE_2D;
139 glDisable GL_BLEND;
140 } 140 }
141 141
142 glPopMatrix; 142 glPopMatrix;
143 } 143 }
144 144

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines