Revision c3a033e9
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objectlib/main/ObjectPreRender.java | ||
---|---|---|
64 | 64 |
private int mCubit, mFace, mNewColor; |
65 | 65 |
private int mNearestAngle; |
66 | 66 |
private long mDebugStartTime; |
67 |
private int mMeshState; |
|
67 | 68 |
|
68 | 69 |
// debugging only |
69 | 70 |
private long mAddRotationTime; |
... | ... | |
100 | 101 |
|
101 | 102 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
102 | 103 |
|
103 |
private void createObjectNow(int ordinal, InputStream jsonStream, InputStream meshStream) |
|
104 |
private void createObjectNow(int ordinal, int meshState, InputStream jsonStream, InputStream meshStream)
|
|
104 | 105 |
{ |
105 | 106 |
boolean firstTime = (mNewObject==null); |
106 | 107 |
|
... | ... | |
111 | 112 |
|
112 | 113 |
long time1 = System.currentTimeMillis(); |
113 | 114 |
|
114 |
if( jsonStream==null ) mNewObject = ObjectType.create( ordinal, quat, move, mScale, meshStream); |
|
115 |
else mNewObject = new TwistyJson( jsonStream, quat, move, mScale, meshStream); |
|
115 |
if( jsonStream==null ) mNewObject = ObjectType.create( ordinal, meshState, quat, move, mScale, meshStream);
|
|
116 |
else mNewObject = new TwistyJson( jsonStream, meshState, quat, move, mScale, meshStream);
|
|
116 | 117 |
|
117 | 118 |
long time2 = System.currentTimeMillis(); |
118 | 119 |
mInterface.onObjectCreated(time2-time1); |
... | ... | |
241 | 242 |
{ |
242 | 243 |
mChangeObject = false; |
243 | 244 |
blockEverything(BlockController.PLACE_1); |
244 |
createObjectNow(mOrdinal,mJsonStream,mMeshStream); |
|
245 |
createObjectNow(mOrdinal,mMeshState,mJsonStream,mMeshStream);
|
|
245 | 246 |
doEffectNow( BaseEffect.Type.SIZECHANGE ); |
246 | 247 |
} |
247 | 248 |
|
... | ... | |
411 | 412 |
|
412 | 413 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
413 | 414 |
|
414 |
public void changeObject(int ordinal, InputStream jsonStream, InputStream meshStream) |
|
415 |
public void changeObject(int ordinal, int meshState, InputStream jsonStream, InputStream meshStream)
|
|
415 | 416 |
{ |
416 | 417 |
mChangeObject = true; |
417 | 418 |
mOrdinal = ordinal; |
419 |
mMeshState = meshState; |
|
418 | 420 |
mJsonStream = jsonStream; |
419 | 421 |
mMeshStream = meshStream; |
420 | 422 |
} |
Also available in: Unified diff
Introduce 'Simple' and 'Nice' meshes.