Revision 51554e47
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/examples/save/SaveRenderer.java | ||
---|---|---|
187 | 187 |
|
188 | 188 |
private void applyMatrixEffects(int width, int height) |
189 | 189 |
{ |
190 |
mEffects.abortEffects(EffectTypes.MATRIX); |
|
191 |
|
|
192 |
if( (float)bmpHeight/bmpWidth > (float)height/width ) |
|
193 |
{ |
|
194 |
int w = (height*bmpWidth)/bmpHeight; |
|
195 |
float factor = (float)height/bmpHeight; |
|
196 |
|
|
197 |
mEffects.move( new Static3D((width-w)/2,0,0) ); |
|
198 |
mEffects.scale(factor); |
|
199 |
} |
|
200 |
else |
|
201 |
{ |
|
202 |
int h = (width*bmpHeight)/bmpWidth; |
|
203 |
float factor = (float)width/bmpWidth; |
|
190 |
float qx = (float)width /bmpWidth; |
|
191 |
float qy = (float)height/bmpHeight; |
|
204 | 192 |
|
205 |
mEffects.move( new Static3D(0,(height-h)/2,0) ); |
|
206 |
mEffects.scale(factor); |
|
207 |
} |
|
193 |
mEffects.abortEffects(EffectTypes.MATRIX); |
|
194 |
mEffects.scale( qx<qy ? (new Static3D(1,qx/qy,1)) : (new Static3D(qy/qx,1,1)) ); |
|
208 | 195 |
|
209 | 196 |
mEffects.scale(mScaleDyn); |
210 | 197 |
} |
Also available in: Unified diff
Convert a few more APPs to the new resolution-independent Matrix Effects.