Project

General

Profile

« Previous | Next » 

Revision b0f04e72

Added by Leszek Koltunski over 6 years ago

Simplify postprocessing buffers.

View differences:

src/main/java/org/distorted/library/main/DistortedOutputSurface.java
80 80
  private ArrayList<Job> mJobs = new ArrayList<>();
81 81

  
82 82
  // Global buffers used for postprocessing.
83
  private static DistortedOutputSurface[] mBuffer = new DistortedOutputSurface[1+EffectQuality.LENGTH];
83
  private static DistortedOutputSurface[] mBuffer = new DistortedOutputSurface[EffectQuality.LENGTH];
84 84

  
85 85
  private long mTime;
86 86
  private float mFOV;
......
324 324

  
325 325
  static synchronized void onDestroy()
326 326
    {
327
    for(int j=0; j<=EffectQuality.LENGTH; j++)
327
    for(int j=0; j<EffectQuality.LENGTH; j++)
328 328
      {
329 329
      mBuffer[j] = null;
330 330
      }
......
334 334

  
335 335
  private static void cloneViewport(DistortedOutputSurface from)
336 336
    {
337
    if( mBuffer[EffectQuality.LENGTH] != from )
337
    if( mBuffer[0].mWidth != from.mWidth )
338 338
      {
339
      mBuffer[EffectQuality.LENGTH]=from;
340 339
      DistortedOutputSurface surface;
341 340

  
342 341
      for(int i=0; i<EffectQuality.LENGTH; i++)
......
348 347

  
349 348
        surface.mNear   = from.mNear;  // Near plane is independent of the mipmap level
350 349

  
350
        android.util.Log.e("surface", "viewport "+i+" to ("+from.mWidth+"x"+from.mHeight+")");
351

  
351 352
        surface.createProjection();
352 353

  
353 354
        int maxw = surface.mWidth  > surface.mRealWidth  ? surface.mWidth  : surface.mRealWidth;

Also available in: Unified diff