Revision 3bf19410
Added by Leszek Koltunski about 2 years ago
src/main/java/org/distorted/objectlib/main/ObjectControl.java | ||
---|---|---|
81 | 81 |
private boolean mIsLocked, mRemLocked; |
82 | 82 |
private final int[] mBuffer; |
83 | 83 |
private final float[] mAxis; |
84 |
private int mMeshState; |
|
84 |
private int mMeshState, mIconMode;
|
|
85 | 85 |
private boolean mRotateOnCreation; |
86 | 86 |
|
87 | 87 |
private static final Static4D mQuat= new Static4D(-0.25189602f,0.3546389f,0.009657208f,0.90038127f); |
88 | 88 |
private static final Static4D mTemp= new Static4D(0,0,0,1); |
89 | 89 |
|
90 |
private static boolean mForcedIconMode = false; |
|
91 |
|
|
92 | 90 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
93 | 91 |
|
94 | 92 |
private void addSpeedProbe(float x, float y) |
... | ... | |
543 | 541 |
return mInterface; |
544 | 542 |
} |
545 | 543 |
|
546 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
547 |
|
|
548 |
public static void setIconMode(boolean mode) |
|
549 |
{ |
|
550 |
mForcedIconMode = mode; |
|
551 |
} |
|
552 |
|
|
553 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
554 |
|
|
555 |
public static boolean isInIconMode() |
|
556 |
{ |
|
557 |
return mForcedIconMode; |
|
558 |
} |
|
559 |
|
|
560 | 544 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
561 | 545 |
// PUBLIC API |
562 | 546 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
578 | 562 |
mFirstIndex= 0; |
579 | 563 |
mLastIndex = 0; |
580 | 564 |
mMeshState =-1; |
565 |
mIconMode =-1; |
|
581 | 566 |
|
582 | 567 |
DisplayMetrics dm = new DisplayMetrics(); |
583 | 568 |
act.getWindowManager().getDefaultDisplay().getMetrics(dm); |
... | ... | |
769 | 754 |
|
770 | 755 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
771 | 756 |
|
772 |
public void changeObject(int ordinal, int meshState, InputStream jsonStream, InputStream meshStream) |
|
757 |
public void changeObject(int ordinal, int meshState, int iconMode, InputStream jsonStream, InputStream meshStream)
|
|
773 | 758 |
{ |
774 |
mPreRender.changeObject(ordinal, meshState, jsonStream, meshStream); |
|
759 |
mPreRender.changeObject(ordinal, meshState, iconMode, jsonStream, meshStream);
|
|
775 | 760 |
} |
776 | 761 |
|
777 | 762 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
778 | 763 |
|
779 |
public void changeIfDifferent(int ordinal, String oldName, int meshState, InputStream jsonStream, InputStream meshStream) |
|
764 |
public void changeIfDifferent(int ordinal, String oldName, int meshState, int iconMode, InputStream jsonStream, InputStream meshStream)
|
|
780 | 765 |
{ |
781 | 766 |
TwistyObject object = mPreRender.getObject(); |
782 | 767 |
String newName = object==null ? "" : object.getShortName(); |
783 | 768 |
|
784 |
if( !oldName.equals(newName) || mMeshState!=meshState ) |
|
769 |
if( !oldName.equals(newName) || mMeshState!=meshState || mIconMode!=iconMode )
|
|
785 | 770 |
{ |
786 | 771 |
mMeshState = meshState; |
787 |
mPreRender.changeObject(ordinal, meshState, jsonStream, meshStream); |
|
772 |
mIconMode = iconMode; |
|
773 |
mPreRender.changeObject(ordinal, meshState, iconMode, jsonStream, meshStream); |
|
788 | 774 |
} |
789 | 775 |
} |
790 | 776 |
|
Also available in: Unified diff
Mode the 'iconMode' from static variable in ObjectControl to member varaible in TwistyObject (safer)