Project

General

Profile

« Previous | Next » 

Revision c7da4e65

Added by Leszek Koltunski about 7 years ago

Fix OutputSurface.resize(): before it couldn't be called mid-render.

View differences:

src/main/java/org/distorted/library/DistortedSurface.java
31 31
*/
32 32
abstract class DistortedSurface
33 33
  {
34
  static final int FAILED_TO_CREATE = -1;
35
  static final int NOT_CREATED_YET  = -2;
36
  static final int DONT_CREATE      = -3;
34
  static final int FAILED_TO_CREATE = 1;
35
  static final int NOT_CREATED_YET  = 2;
36
  static final int DONT_CREATE      = 3;
37
  static final int CREATED          = 4;
37 38

  
38 39
  private static boolean mToDo = false;
39 40
  private static LinkedList<DistortedSurface> mDoneList = new LinkedList<>();
......
44 45
  private long mID;
45 46
  private boolean mMarked;
46 47
  private boolean mSystem;
48
  int mColorCreated;
47 49
  int[] mColorH = new int[1];
48 50
  int mSizeX, mSizeY;  // in screen space
49 51

  
......
169 171

  
170 172
///////////////////////////////////////////////////////////////////////////////////////////////////
171 173

  
172
  DistortedSurface(int width, int height, int color, boolean system)
174
  DistortedSurface(int width, int height, int create, boolean system)
173 175
    {
174
    mSizeX    = width ;
175
    mSizeY    = height;
176
    mColorH[0]= color;
177
    mMarked   = false;
178
    mID       = system ? --mNextSystemID : ++mNextClientID;
179
    mSystem   = system;
180

  
181
    if( color!=DONT_CREATE )
176
    mSizeX        = width ;
177
    mSizeY        = height;
178
    mColorCreated = create;
179
    mColorH[0]    = 0;
180
    mMarked       = false;
181
    mID           = system ? --mNextSystemID : ++mNextClientID;
182
    mSystem       = system;
183

  
184
    if( create!=DONT_CREATE )
182 185
      {
183 186
      mToDoList.add(this);
184 187
      mToDo = true;

Also available in: Unified diff