… | |
… | |
161 | |
161 | |
162 | $self->{minified} ||= [CFPlus::average $dw, $dh, $data] |
162 | $self->{minified} ||= [CFPlus::average $dw, $dh, $data] |
163 | if $self->{minify}; |
163 | if $self->{minify}; |
164 | |
164 | |
165 | # against rather broken cards we enforce a maximum texture size |
165 | # against rather broken cards we enforce a maximum texture size |
166 | $tw = min $MAX_W, minpot $tw; |
166 | $tw = min $MAX_W, $tw; |
167 | $th = min $MAX_H, minpot $th; |
167 | $th = min $MAX_H, $th; |
168 | |
168 | |
169 | # if only pot-textures are allowed, pot'ify tw/th |
169 | # if only pot-textures are allowed, pot'ify tw/th |
170 | unless ($GL_NPOT && 0) {#d# |
170 | unless ($GL_NPOT) { |
171 | $tw = minpot $tw; |
171 | $tw = CFPlus::minpot $tw; |
172 | $th = minpot $th; |
172 | $th = CFPlus::minpot $th; |
173 | } |
173 | } |
174 | |
174 | |
175 | # now further decrease texture size until the |
175 | # now further decrease texture size until the |
176 | # card does accept it |
176 | # card does accept it |
177 | while (!texture_valid_2d $self->{internalformat}, $tw, $th, $self->{format}, $self->{type}) { |
177 | while (!texture_valid_2d $self->{internalformat}, $tw, $th, $self->{format}, $self->{type}) { |