Project

General

Profile

« Previous | Next » 

Revision 9361b337

Added by Leszek Koltunski almost 8 years ago

Provide support to add any class derived from DistortedObject to DistortedNode.

View differences:

src/main/java/org/distorted/library/DistortedBitmap.java
78 78
     this(bmp.getWidth(), bmp.getHeight(), gridSize); 
79 79
     setBitmap(bmp);
80 80
     }
81
   
81

  
82 82
///////////////////////////////////////////////////////////////////////////////////////////////////
83 83
/**
84
 * Copy constructor used to create a DistortedBitmap based on various parts of another Bitmap.
84
 * Copy constructor used to create a DistortedBitmap based on various parts of another object.
85 85
 * <p>
86 86
 * Whatever we do not clone gets created just like in the default constructor.
87
 *    
88
 * @param db    Source DistortedBitmap to create our object from
87
 *
88
 * @param db    Source object to create our object from
89 89
 * @param flags A bitmask of values specifying what to copy.
90 90
 *              For example, CLONE_BITMAP | CLONE_MATRIX.
91 91
 */
92 92
   public DistortedBitmap(DistortedBitmap db, int flags)
93 93
     {
94
     initializeEffectLists(db,flags);  
95
      
96
     mID = DistortedObjectList.add(this);
97
        
98
     mSizeX = db.mSizeX;
99
     mSizeY = db.mSizeY;
100
     mSizeZ = db.mSizeZ;
101
     mSize  = db.mSize;
102
     mGrid  = db.mGrid;
103
       
104
     if( (flags & Distorted.CLONE_BITMAP) != 0 ) 
105
       {
106
       mTextureDataH = db.mTextureDataH;
107
 	    mBmp          = db.mBmp;
108
 	    mBitmapSet    = db.mBitmapSet;
109
 	    }
110
     else
111
       {
112
       mTextureDataH   = new int[1];
113
       mTextureDataH[0]= 0;
114
       mBitmapSet      = new boolean[1];
115
       mBitmapSet[0]   = false;
116
       mBmp            = new Bitmap[1];
117
       mBmp[0]         = null;
118
       
119
       if( Distorted.isInitialized() ) resetTexture();
120
       }
94
     super(db,flags);
121 95
     }
122 96

  
123 97
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff