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

Comparing deliantra/Deliantra-Client/DC/Texture.pm (file contents):
Revision 1.2 by root, Mon May 29 02:01:56 2006 UTC vs.
Revision 1.4 by root, Tue Jun 6 02:55:50 2006 UTC

122 unless ($tw > 0 && $th > 0) { 122 unless ($tw > 0 && $th > 0) {
123 $tw = $th = 1; 123 $tw = $th = 1;
124 $data = "\x00" x 64; 124 $data = "\x00" x 64;
125 } 125 }
126 126
127 $self->{minified} = [CFClient::average $tw, $th, $data] 127 $self->{minified} ||= [CFClient::average $tw, $th, $data]
128 if $self->{minify}; 128 if $self->{minify};
129 129
130 unless ($GL_NPOT) { 130 unless ($GL_NPOT) {
131 # TODO: does not work for zero-sized textures 131 # TODO: does not work for zero-sized textures
132 $tw = topot $tw; 132 $tw = topot $tw;
157 157
158 if ($::FAST) { 158 if ($::FAST) {
159 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST; 159 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST;
160 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST; 160 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST;
161 } elsif ($self->{mipmap} && $GL_VERSION >= 1.4) { 161 } elsif ($self->{mipmap} && $GL_VERSION >= 1.4) {
162 # alternatively check for 0x8191
163 glTexParameter GL_TEXTURE_2D, GL_GENERATE_MIPMAP, 1; 162 glTexParameter GL_TEXTURE_2D, GL_GENERATE_MIPMAP, 1;
164 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR; 163 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR;
165 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR; 164 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR;
166 } else { 165 } else {
167 glTexParameter GL_TEXTURE_2D, GL_GENERATE_MIPMAP, $self->{mipmap}; 166 glTexParameter GL_TEXTURE_2D, GL_GENERATE_MIPMAP, $self->{mipmap};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines