Project

General

Profile

« Previous | Next » 

Revision 630703d1

Added by Leszek Koltunski about 7 years ago

Revert "Major refactoring: convert the Matrix Effects to be independent of the resolution of the surface we render to."

This reverts commit d79a56d3bc6cc7a22b21abeb180353a1818bd6ad.

View differences:

src/main/java/org/distorted/examples/check/CheckRenderer.java
88 88
    
89 89
    public void onSurfaceChanged(GL10 glUnused, int width, int height) 
90 90
      { 
91
      float qx = (float)width /bmpWidth;
92
      float qy = (float)height/bmpHeight;
93

  
94 91
      mEffects.abortEffects(EffectTypes.MATRIX);
95
      mEffects.scale(  qx<qy ? (new Static3D(1,qx/qy,1)) : (new Static3D(qy/qx,1,1)) );
92
      
93
      if( (float)bmpHeight/bmpWidth > (float)height/width )
94
        {
95
        int w = (height*bmpWidth)/bmpHeight;
96
        float factor = (float)height/bmpHeight;
97

  
98
        mEffects.move( new Static3D((width-w)/2,0,0) );
99
        mEffects.scale(factor);
100
        }
101
      else
102
        {
103
        int h = (width*bmpHeight)/bmpWidth;
104
        float factor = (float)width/bmpWidth;
105

  
106
        mEffects.move( new Static3D(0,(height-h)/2,0) );
107
        mEffects.scale(factor);
108
        }
96 109
      
97 110
      mScreen.resize(width, height);
98 111
      }

Also available in: Unified diff