Project

General

Profile

« Previous | Next » 

Revision c90aca24

Added by Leszek Koltunski about 4 years ago

Move the 'pre-multiply mesh before applying any effects' thing from [(Xsize of texture, Ysize of texture) x Mesh's zFactor] to Effects.setStretch(sx,sy,sz)

View differences:

src/main/java/org/distorted/library/main/DistortedTexture.java
113 113
// inside a Tree of DistortedNodes (TREE)
114 114
// SYSTEM surfaces do not get removed in onDestroy().
115 115

  
116
  public DistortedTexture(int width, int height, int type)
116
  public DistortedTexture(int type)
117 117
    {
118
    super(width,height,NOT_CREATED_YET,1,1,type);
118
    super(0,0,NOT_CREATED_YET,1,1,type);
119 119
    mBmp= null;
120 120
    }
121 121

  
......
123 123
// PUBLIC API
124 124
///////////////////////////////////////////////////////////////////////////////////////////////////
125 125
/**
126
 * Create empty texture of given dimensions.
126
 * Create an empty texture.
127 127
 */
128
  public DistortedTexture(int width, int height)
128
  public DistortedTexture()
129 129
    {
130
    this(width,height,TYPE_USER);
130
    this(TYPE_USER);
131 131
    }
132 132

  
133 133
///////////////////////////////////////////////////////////////////////////////////////////////////
......
157 157
 */
158 158
  public void setTexture(Bitmap bmp)
159 159
    {
160
    mBmp= bmp;
160
    mBmp   = bmp;
161
    mWidth = bmp.getWidth();
162
    mHeight= bmp.getHeight();
163

  
161 164
    markForCreation();
162 165
    }
163 166

  
......
173 176
    paint.setColor(argb);
174 177
    paint.setStyle(Paint.Style.FILL);
175 178

  
176
    mBmp = Bitmap.createBitmap(1,1, Bitmap.Config.ARGB_8888);
179
    mWidth = 1;
180
    mHeight= 1;
181

  
182
    mBmp = Bitmap.createBitmap(mWidth,mHeight, Bitmap.Config.ARGB_8888);
177 183
    Canvas canvas = new Canvas(mBmp);
178
    canvas.drawRect(0,0,1,1,paint);
184
    canvas.drawRect(0,0,mWidth,mHeight,paint);
179 185

  
180 186
    markForCreation();
181 187
    }

Also available in: Unified diff