Revision 7ba38dd4
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objectlib/effects/scramble/ScrambleEffect.java | ||
---|---|---|
32 | 32 |
import org.distorted.objectlib.main.TwistyObject; |
33 | 33 |
import org.distorted.objectlib.effects.BaseEffect; |
34 | 34 |
import org.distorted.objectlib.helpers.MovesFinished; |
35 |
import org.distorted.objectlib.main.TwistyObjectNode; |
|
35 | 36 |
|
36 | 37 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
37 | 38 |
|
... | ... | |
76 | 77 |
|
77 | 78 |
ObjectPreRender mPre; |
78 | 79 |
TwistyObject mObject; |
80 |
TwistyObjectNode mObjectNode; |
|
79 | 81 |
Effect[] mNodeEffects; |
80 | 82 |
int[] mNodeEffectPosition; |
81 | 83 |
Effect[] mCubeEffects; |
... | ... | |
154 | 156 |
mCubeEffects[i].notifyWhenFinished(this); |
155 | 157 |
} |
156 | 158 |
|
157 |
DistortedEffects nodeEffects = mObject.getEffects(); |
|
159 |
DistortedEffects nodeEffects = mObjectNode.getEffects();
|
|
158 | 160 |
|
159 | 161 |
for(int i=0; i<mNodeEffectNumber; i++) |
160 | 162 |
{ |
... | ... | |
172 | 174 |
mObject.remove(mCubeEffects[i].getID()); |
173 | 175 |
} |
174 | 176 |
|
175 |
DistortedEffects nodeEffects = mObject.getEffects(); |
|
177 |
DistortedEffects nodeEffects = mObjectNode.getEffects();
|
|
176 | 178 |
|
177 | 179 |
for(int i=0; i<mNodeEffectNumber; i++) |
178 | 180 |
{ |
... | ... | |
258 | 260 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
259 | 261 |
|
260 | 262 |
@SuppressWarnings("unused") |
261 |
public long start(int duration, DistortedFramebuffer frame, ObjectPreRender pre)
|
|
263 |
public long start(int duration, ObjectPreRender pre) |
|
262 | 264 |
{ |
263 |
mObject= pre.getObject(); |
|
264 |
mPre = pre; |
|
265 |
mObject = pre.getObject(); |
|
266 |
mObjectNode = pre.getObjectNode(); |
|
267 |
mPre = pre; |
|
265 | 268 |
|
266 | 269 |
// NOT mController.solve() !! This would be a very subtle bug. We need to do this immediately, |
267 | 270 |
// because here we are already inside the mController.preRender() function (doing 'scrambleObjectNow') |
Also available in: Unified diff
Major change: separate the notion of a TwistyObject and its Node. Now,
1) the Node stays when we change objects (this makes transitions faster)
2) it's possible to just create an Object without adding it to the Screen (now app needs to explicitly create the Node and add it to its Screen itself)