Project

General

Profile

« Previous | Next » 

Revision 126393c8

Added by Leszek Koltunski almost 5 years ago

Remove width & height from InternalSurface and move it to InternalOutputSurface.

View differences:

src/main/java/org/distorted/examples/aroundtheworld/AroundTheWorldRenderer.java
91 91
    
92 92
   public void onSurfaceChanged(GL10 glUnused, int width, int height) 
93 93
      {
94
      float horiRatio = (float)width / mTexture.getWidth();
95
      float vertRatio = (float)height/ mTexture.getHeight();
94
      float horiRatio = (float)width / mMesh.getStretchX();
95
      float vertRatio = (float)height/ mMesh.getStretchY();
96 96
      float factor    = horiRatio > vertRatio ? vertRatio : horiRatio;
97 97

  
98 98
      mScale.set( factor,factor,factor );
src/main/java/org/distorted/examples/bean/BeanRenderer.java
104 104
    
105 105
   public void onSurfaceChanged(GL10 glUnused, int width, int height)
106 106
     {
107
     float horiRatio = (float)width / mTexture.getWidth();
108
     float vertRatio = (float)height/ mTexture.getHeight();
107
     float horiRatio = (float)width / mMesh.getStretchX();
108
     float vertRatio = (float)height/ mMesh.getStretchY();
109 109
     float factor    = horiRatio > vertRatio ? vertRatio : horiRatio;
110 110

  
111 111
     mScale.set( factor,factor,factor );
src/main/java/org/distorted/examples/differentbitmaps/DifferentBitmapsRenderer.java
112 112
    
113 113
   public void onSurfaceChanged(GL10 glUnused, int width, int height)
114 114
     {
115
     float horiRatio = (float)width / (NUM*mTexture[0].getWidth());
116
     float vertRatio = (float)height/ (    mTexture[0].getHeight());
115
     float horiRatio = (float)width / (NUM*mMesh.getStretchX());
116
     float vertRatio = (float)height/ (    mMesh.getStretchY());
117 117
     float factor    = horiRatio > vertRatio ? vertRatio : horiRatio;
118 118

  
119 119
     mScale.set( factor,factor,factor );
src/main/java/org/distorted/examples/differenteffects/DifferentEffectsRenderer.java
130 130
    
131 131
   public void onSurfaceChanged(GL10 glUnused, int width, int height)
132 132
     {
133
     float horiRatio = (float)width / (NUM*mTexture.getWidth());
134
     float vertRatio = (float)height/ (    mTexture.getHeight());
133
     float horiRatio = (float)width / (NUM*mMesh.getStretchX());
134
     float vertRatio = (float)height/ (    mMesh.getStretchY());
135 135
     float factor    = horiRatio > vertRatio ? vertRatio : horiRatio;
136 136

  
137 137
     mScale.set( factor,factor,factor );
src/main/java/org/distorted/examples/girl/GirlRenderer.java
163 163
    
164 164
   public void onSurfaceChanged(GL10 glUnused, int width, int height)
165 165
     {
166
     float horiRatio = (float)width / mTexture.getWidth();
167
     float vertRatio = (float)height/ mTexture.getHeight();
166
     float horiRatio = (float)width / mMesh.getStretchX();
167
     float vertRatio = (float)height/ mMesh.getStretchY();
168 168
     float factor    = horiRatio > vertRatio ? vertRatio : horiRatio;
169 169

  
170 170
     mScale.set( factor,factor,factor );
src/main/java/org/distorted/examples/listener/ListenerRenderer.java
114 114
    
115 115
   public void onSurfaceChanged(GL10 glUnused, int width, int height)
116 116
     {
117
     float horiRatio = (float)width / mTexture.getWidth();
118
     float vertRatio = (float)height/ mTexture.getHeight();
117
     float horiRatio = (float)width / mMesh.getStretchX();
118
     float vertRatio = (float)height/ mMesh.getStretchY();
119 119
     float factor    = horiRatio > vertRatio ? vertRatio : horiRatio;
120 120

  
121 121
     mScale.set( factor,factor,factor );
src/main/java/org/distorted/examples/objecttree/ObjectTreeRenderer.java
116 116
    
117 117
   public void onSurfaceChanged(GL10 glUnused, int width, int height)
118 118
      {
119
      float horiRatio = (float)width / mLisaTexture.getWidth();
120
      float vertRatio = (float)height/ mLisaTexture.getHeight();
119
      float horiRatio = (float)width / mMeshRectangles.getStretchX();
120
      float vertRatio = (float)height/ mMeshRectangles.getStretchY();
121 121
      float factor    = horiRatio > vertRatio ? vertRatio : horiRatio;
122 122

  
123 123
      mScale.set( factor,factor,factor );
src/main/java/org/distorted/examples/save/SaveRenderer.java
190 190

  
191 191
  private void applyMatrixEffects(int width, int height)
192 192
    {
193
    float horiRatio = (float)width / mTexture.getWidth();
194
    float vertRatio = (float)height/ mTexture.getHeight();
193
    float horiRatio = (float)width / mMesh.getStretchX();
194
    float vertRatio = (float)height/ mMesh.getStretchY();
195 195
    float factor    = horiRatio > vertRatio ? vertRatio : horiRatio;
196 196
    mScaleMain.set(factor,factor,factor);
197 197
    }
src/main/java/org/distorted/examples/sink/SinkRenderer.java
84 84
    
85 85
  public void onSurfaceChanged(GL10 glUnused, int width, int height) 
86 86
    {
87
    float horiRatio = (float)width / mTexture.getWidth();
88
    float vertRatio = (float)height/ mTexture.getHeight();
87
    float horiRatio = (float)width / mMesh.getStretchX();
88
    float vertRatio = (float)height/ mMesh.getStretchY();
89 89
    float factor    = horiRatio > vertRatio ? vertRatio : horiRatio;
90 90

  
91 91
    mScale.set( factor,factor,factor );
src/main/java/org/distorted/examples/surfaceview/RenderThread.java
213 213
    {
214 214
    Log.d(TAG, "surfaceChanged " + width + "x" + height);
215 215

  
216
    float horiRatio = (float)width / mTexture.getWidth();
217
    float vertRatio = (float)height/ mTexture.getHeight();
216
    float horiRatio = (float)width / mMesh.getStretchX();
217
    float vertRatio = (float)height/ mMesh.getStretchY();
218 218
    float factor    = horiRatio > vertRatio ? vertRatio : horiRatio;
219 219

  
220 220
    mScale.set( factor,factor,factor );

Also available in: Unified diff