Skip to content

Commit 813cf47

Browse files
committed
Fix sleep chunk, better debug view, minor optimizations
1 parent 7f2096b commit 813cf47

23 files changed

+136
-123
lines changed

org.sheepy.vsand.model.edit/plugin.properties

+1
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,4 @@ _UI_PrimaryColorPropertyCategory = Primary Color
226226
_UI_SecondaryColorPropertyCategory = Secondary Color
227227
_UI_VSandApplication_nextMode_feature = Next Mode
228228
_UI_VSandConstants_showSleepZones_feature = Show Sleep Zones
229+
_UI_VSandConstants_forceClear_feature = Force Clear

org.sheepy.vsand.model.edit/src/generated/java/org/sheepy/vsand/model/provider/VSandConstantsItemProvider.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,27 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object)
4949
{
5050
super.getPropertyDescriptors(object);
5151

52-
addFirstPassPropertyDescriptor(object);
52+
addForceClearPropertyDescriptor(object);
5353
addShowSleepZonesPropertyDescriptor(object);
5454
}
5555
return itemPropertyDescriptors;
5656
}
5757

5858
/**
59-
* This adds a property descriptor for the First Pass feature.
59+
* This adds a property descriptor for the Force Clear feature.
6060
* <!-- begin-user-doc -->
6161
* <!-- end-user-doc -->
6262
* @generated
6363
*/
64-
protected void addFirstPassPropertyDescriptor(Object object)
64+
protected void addForceClearPropertyDescriptor(Object object)
6565
{
6666
itemPropertyDescriptors.add
6767
(createItemPropertyDescriptor
6868
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
6969
getResourceLocator(),
70-
getString("_UI_VSandConstants_firstPass_feature"),
71-
getString("_UI_PropertyDescriptor_description", "_UI_VSandConstants_firstPass_feature", "_UI_VSandConstants_type"),
72-
VSandPackage.Literals.VSAND_CONSTANTS__FIRST_PASS,
70+
getString("_UI_VSandConstants_forceClear_feature"),
71+
getString("_UI_PropertyDescriptor_description", "_UI_VSandConstants_forceClear_feature", "_UI_VSandConstants_type"),
72+
VSandPackage.Literals.VSAND_CONSTANTS__FORCE_CLEAR,
7373
true,
7474
false,
7575
false,
@@ -143,7 +143,7 @@ public void notifyChanged(Notification notification)
143143

144144
switch (notification.getFeatureID(VSandConstants.class))
145145
{
146-
case VSandPackage.VSAND_CONSTANTS__FIRST_PASS:
146+
case VSandPackage.VSAND_CONSTANTS__FORCE_CLEAR:
147147
case VSandPackage.VSAND_CONSTANTS__SHOW_SLEEP_ZONES:
148148
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
149149
return;

org.sheepy.vsand.model/model/VSand.xcore

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class RepeatComputePipeline extends ComputePipeline
7676

7777
class VSandConstants extends AbstractConstants
7878
{
79-
boolean firstPass = "true"
79+
boolean forceClear = "false"
8080
boolean showSleepZones = "false"
8181
}
8282

org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/VSandConstants.java

+12-16
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* The following features are supported:
1414
* </p>
1515
* <ul>
16-
* <li>{@link org.sheepy.vsand.model.VSandConstants#isFirstPass <em>First Pass</em>}</li>
16+
* <li>{@link org.sheepy.vsand.model.VSandConstants#isForceClear <em>Force Clear</em>}</li>
1717
* <li>{@link org.sheepy.vsand.model.VSandConstants#isShowSleepZones <em>Show Sleep Zones</em>}</li>
1818
* </ul>
1919
*
@@ -24,31 +24,27 @@
2424
public interface VSandConstants extends AbstractConstants
2525
{
2626
/**
27-
* Returns the value of the '<em><b>First Pass</b></em>' attribute.
28-
* The default value is <code>"true"</code>.
27+
* Returns the value of the '<em><b>Force Clear</b></em>' attribute.
28+
* The default value is <code>"false"</code>.
2929
* <!-- begin-user-doc -->
30-
* <p>
31-
* If the meaning of the '<em>First Pass</em>' attribute isn't clear,
32-
* there really should be more of a description here...
33-
* </p>
3430
* <!-- end-user-doc -->
35-
* @return the value of the '<em>First Pass</em>' attribute.
36-
* @see #setFirstPass(boolean)
37-
* @see org.sheepy.vsand.model.VSandPackage#getVSandConstants_FirstPass()
38-
* @model default="true" unique="false"
31+
* @return the value of the '<em>Force Clear</em>' attribute.
32+
* @see #setForceClear(boolean)
33+
* @see org.sheepy.vsand.model.VSandPackage#getVSandConstants_ForceClear()
34+
* @model default="false" unique="false"
3935
* @generated
4036
*/
41-
boolean isFirstPass();
37+
boolean isForceClear();
4238

4339
/**
44-
* Sets the value of the '{@link org.sheepy.vsand.model.VSandConstants#isFirstPass <em>First Pass</em>}' attribute.
40+
* Sets the value of the '{@link org.sheepy.vsand.model.VSandConstants#isForceClear <em>Force Clear</em>}' attribute.
4541
* <!-- begin-user-doc -->
4642
* <!-- end-user-doc -->
47-
* @param value the new value of the '<em>First Pass</em>' attribute.
48-
* @see #isFirstPass()
43+
* @param value the new value of the '<em>Force Clear</em>' attribute.
44+
* @see #isForceClear()
4945
* @generated
5046
*/
51-
void setFirstPass(boolean value);
47+
void setForceClear(boolean value);
5248

5349
/**
5450
* Returns the value of the '<em><b>Show Sleep Zones</b></em>' attribute.

org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/VSandPackage.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -790,13 +790,13 @@ public interface VSandPackage extends EPackage
790790
int VSAND_CONSTANTS__STAGES = ResourcePackage.ABSTRACT_CONSTANTS__STAGES;
791791

792792
/**
793-
* The feature id for the '<em><b>First Pass</b></em>' attribute.
793+
* The feature id for the '<em><b>Force Clear</b></em>' attribute.
794794
* <!-- begin-user-doc -->
795795
* <!-- end-user-doc -->
796796
* @generated
797797
* @ordered
798798
*/
799-
int VSAND_CONSTANTS__FIRST_PASS = ResourcePackage.ABSTRACT_CONSTANTS_FEATURE_COUNT + 0;
799+
int VSAND_CONSTANTS__FORCE_CLEAR = ResourcePackage.ABSTRACT_CONSTANTS_FEATURE_COUNT + 0;
800800

801801
/**
802802
* The feature id for the '<em><b>Show Sleep Zones</b></em>' attribute.
@@ -1330,15 +1330,15 @@ public interface VSandPackage extends EPackage
13301330
EClass getVSandConstants();
13311331

13321332
/**
1333-
* Returns the meta object for the attribute '{@link org.sheepy.vsand.model.VSandConstants#isFirstPass <em>First Pass</em>}'.
1333+
* Returns the meta object for the attribute '{@link org.sheepy.vsand.model.VSandConstants#isForceClear <em>Force Clear</em>}'.
13341334
* <!-- begin-user-doc -->
13351335
* <!-- end-user-doc -->
1336-
* @return the meta object for the attribute '<em>First Pass</em>'.
1337-
* @see org.sheepy.vsand.model.VSandConstants#isFirstPass()
1336+
* @return the meta object for the attribute '<em>Force Clear</em>'.
1337+
* @see org.sheepy.vsand.model.VSandConstants#isForceClear()
13381338
* @see #getVSandConstants()
13391339
* @generated
13401340
*/
1341-
EAttribute getVSandConstants_FirstPass();
1341+
EAttribute getVSandConstants_ForceClear();
13421342

13431343
/**
13441344
* Returns the meta object for the attribute '{@link org.sheepy.vsand.model.VSandConstants#isShowSleepZones <em>Show Sleep Zones</em>}'.
@@ -1717,12 +1717,12 @@ interface Literals
17171717
EClass VSAND_CONSTANTS = eINSTANCE.getVSandConstants();
17181718

17191719
/**
1720-
* The meta object literal for the '<em><b>First Pass</b></em>' attribute feature.
1720+
* The meta object literal for the '<em><b>Force Clear</b></em>' attribute feature.
17211721
* <!-- begin-user-doc -->
17221722
* <!-- end-user-doc -->
17231723
* @generated
17241724
*/
1725-
EAttribute VSAND_CONSTANTS__FIRST_PASS = eINSTANCE.getVSandConstants_FirstPass();
1725+
EAttribute VSAND_CONSTANTS__FORCE_CLEAR = eINSTANCE.getVSandConstants_ForceClear();
17261726

17271727
/**
17281728
* The meta object literal for the '<em><b>Show Sleep Zones</b></em>' attribute feature.

org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/VSandConstantsImpl.java

+23-23
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* The following features are implemented:
2020
* </p>
2121
* <ul>
22-
* <li>{@link org.sheepy.vsand.model.impl.VSandConstantsImpl#isFirstPass <em>First Pass</em>}</li>
22+
* <li>{@link org.sheepy.vsand.model.impl.VSandConstantsImpl#isForceClear <em>Force Clear</em>}</li>
2323
* <li>{@link org.sheepy.vsand.model.impl.VSandConstantsImpl#isShowSleepZones <em>Show Sleep Zones</em>}</li>
2424
* </ul>
2525
*
@@ -28,24 +28,24 @@
2828
public class VSandConstantsImpl extends AbstractConstantsImpl implements VSandConstants
2929
{
3030
/**
31-
* The default value of the '{@link #isFirstPass() <em>First Pass</em>}' attribute.
31+
* The default value of the '{@link #isForceClear() <em>Force Clear</em>}' attribute.
3232
* <!-- begin-user-doc -->
3333
* <!-- end-user-doc -->
34-
* @see #isFirstPass()
34+
* @see #isForceClear()
3535
* @generated
3636
* @ordered
3737
*/
38-
protected static final boolean FIRST_PASS_EDEFAULT = true;
38+
protected static final boolean FORCE_CLEAR_EDEFAULT = false;
3939

4040
/**
41-
* The cached value of the '{@link #isFirstPass() <em>First Pass</em>}' attribute.
41+
* The cached value of the '{@link #isForceClear() <em>Force Clear</em>}' attribute.
4242
* <!-- begin-user-doc -->
4343
* <!-- end-user-doc -->
44-
* @see #isFirstPass()
44+
* @see #isForceClear()
4545
* @generated
4646
* @ordered
4747
*/
48-
protected boolean firstPass = FIRST_PASS_EDEFAULT;
48+
protected boolean forceClear = FORCE_CLEAR_EDEFAULT;
4949

5050
/**
5151
* The default value of the '{@link #isShowSleepZones() <em>Show Sleep Zones</em>}' attribute.
@@ -94,9 +94,9 @@ protected EClass eStaticClass()
9494
* @generated
9595
*/
9696
@Override
97-
public boolean isFirstPass()
97+
public boolean isForceClear()
9898
{
99-
return firstPass;
99+
return forceClear;
100100
}
101101

102102
/**
@@ -105,12 +105,12 @@ public boolean isFirstPass()
105105
* @generated
106106
*/
107107
@Override
108-
public void setFirstPass(boolean newFirstPass)
108+
public void setForceClear(boolean newForceClear)
109109
{
110-
boolean oldFirstPass = firstPass;
111-
firstPass = newFirstPass;
110+
boolean oldForceClear = forceClear;
111+
forceClear = newForceClear;
112112
if (eNotificationRequired())
113-
eNotify(new ENotificationImpl(this, Notification.SET, VSandPackage.VSAND_CONSTANTS__FIRST_PASS, oldFirstPass, firstPass));
113+
eNotify(new ENotificationImpl(this, Notification.SET, VSandPackage.VSAND_CONSTANTS__FORCE_CLEAR, oldForceClear, forceClear));
114114
}
115115

116116
/**
@@ -148,8 +148,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType)
148148
{
149149
switch (featureID)
150150
{
151-
case VSandPackage.VSAND_CONSTANTS__FIRST_PASS:
152-
return isFirstPass();
151+
case VSandPackage.VSAND_CONSTANTS__FORCE_CLEAR:
152+
return isForceClear();
153153
case VSandPackage.VSAND_CONSTANTS__SHOW_SLEEP_ZONES:
154154
return isShowSleepZones();
155155
}
@@ -166,8 +166,8 @@ public void eSet(int featureID, Object newValue)
166166
{
167167
switch (featureID)
168168
{
169-
case VSandPackage.VSAND_CONSTANTS__FIRST_PASS:
170-
setFirstPass((Boolean)newValue);
169+
case VSandPackage.VSAND_CONSTANTS__FORCE_CLEAR:
170+
setForceClear((Boolean)newValue);
171171
return;
172172
case VSandPackage.VSAND_CONSTANTS__SHOW_SLEEP_ZONES:
173173
setShowSleepZones((Boolean)newValue);
@@ -186,8 +186,8 @@ public void eUnset(int featureID)
186186
{
187187
switch (featureID)
188188
{
189-
case VSandPackage.VSAND_CONSTANTS__FIRST_PASS:
190-
setFirstPass(FIRST_PASS_EDEFAULT);
189+
case VSandPackage.VSAND_CONSTANTS__FORCE_CLEAR:
190+
setForceClear(FORCE_CLEAR_EDEFAULT);
191191
return;
192192
case VSandPackage.VSAND_CONSTANTS__SHOW_SLEEP_ZONES:
193193
setShowSleepZones(SHOW_SLEEP_ZONES_EDEFAULT);
@@ -206,8 +206,8 @@ public boolean eIsSet(int featureID)
206206
{
207207
switch (featureID)
208208
{
209-
case VSandPackage.VSAND_CONSTANTS__FIRST_PASS:
210-
return firstPass != FIRST_PASS_EDEFAULT;
209+
case VSandPackage.VSAND_CONSTANTS__FORCE_CLEAR:
210+
return forceClear != FORCE_CLEAR_EDEFAULT;
211211
case VSandPackage.VSAND_CONSTANTS__SHOW_SLEEP_ZONES:
212212
return showSleepZones != SHOW_SLEEP_ZONES_EDEFAULT;
213213
}
@@ -225,8 +225,8 @@ public String toString()
225225
if (eIsProxy()) return super.toString();
226226

227227
StringBuilder result = new StringBuilder(super.toString());
228-
result.append(" (firstPass: ");
229-
result.append(firstPass);
228+
result.append(" (forceClear: ");
229+
result.append(forceClear);
230230
result.append(", showSleepZones: ");
231231
result.append(showSleepZones);
232232
result.append(')');

org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/VSandPackageImpl.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ public EClass getVSandConstants()
510510
* @generated
511511
*/
512512
@Override
513-
public EAttribute getVSandConstants_FirstPass()
513+
public EAttribute getVSandConstants_ForceClear()
514514
{
515515
return (EAttribute)vSandConstantsEClass.getEStructuralFeatures().get(0);
516516
}
@@ -681,7 +681,7 @@ public void createPackageContents()
681681
createEAttribute(repeatComputePipelineEClass, REPEAT_COMPUTE_PIPELINE__REPEAT_COUNT);
682682

683683
vSandConstantsEClass = createEClass(VSAND_CONSTANTS);
684-
createEAttribute(vSandConstantsEClass, VSAND_CONSTANTS__FIRST_PASS);
684+
createEAttribute(vSandConstantsEClass, VSAND_CONSTANTS__FORCE_CLEAR);
685685
createEAttribute(vSandConstantsEClass, VSAND_CONSTANTS__SHOW_SLEEP_ZONES);
686686

687687
materialSelectorPanelEClass = createEClass(MATERIAL_SELECTOR_PANEL);
@@ -772,7 +772,7 @@ public void initializePackageContents()
772772
initEAttribute(getRepeatComputePipeline_RepeatCount(), theEcorePackage.getEInt(), "repeatCount", "1", 0, 1, RepeatComputePipeline.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
773773

774774
initEClass(vSandConstantsEClass, VSandConstants.class, "VSandConstants", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
775-
initEAttribute(getVSandConstants_FirstPass(), theEcorePackage.getEBoolean(), "firstPass", "true", 0, 1, VSandConstants.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
775+
initEAttribute(getVSandConstants_ForceClear(), theEcorePackage.getEBoolean(), "forceClear", "false", 0, 1, VSandConstants.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
776776
initEAttribute(getVSandConstants_ShowSleepZones(), theEcorePackage.getEBoolean(), "showSleepZones", "false", 0, 1, VSandConstants.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
777777

778778
initEClass(materialSelectorPanelEClass, MaterialSelectorPanel.class, "MaterialSelectorPanel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

org.sheepy.vsand/src/main/java/org/sheepy/vsand/adapter/ConfigurationBufferLoader.java

+8-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@Adapter(scope = Buffer.class, name = "Configuration")
1818
public class ConfigurationBufferLoader extends BufferAdapter
1919
{
20-
private static final int BYTE_SIZE = MaterialUtil.MAX_MATERIAL_NUMBER * 4 * Integer.BYTES;
20+
private static final int BYTE_SIZE = MaterialUtil.MAX_MATERIAL_NUMBER * 8 * Integer.BYTES;
2121

2222
public ConfigurationBufferLoader(Buffer buffer)
2323
{
@@ -33,9 +33,14 @@ public ConfigurationBufferLoader(Buffer buffer)
3333
bBuffer.putInt(material.getDensity());
3434
bBuffer.putInt(material.getRunoff());
3535

36-
final int rgb = material.getR() | material.getG() << 8 | material.getB() << 16;
36+
// Alignment
37+
bBuffer.putInt(0);
3738

38-
bBuffer.putInt(rgb);
39+
// Color
40+
bBuffer.putFloat(material.getR() / 255f);
41+
bBuffer.putFloat(material.getG() / 255f);
42+
bBuffer.putFloat(material.getB() / 255f);
43+
bBuffer.putFloat(0f);
3944
}
4045
bBuffer.flip();
4146

org.sheepy.vsand/src/main/java/org/sheepy/vsand/adapter/VSandConstantAdapter.java

+4-10
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ public VSandConstantAdapter(VSandConstants constants)
2929
this.constants = constants;
3030
}
3131

32-
public void tick()
33-
{
34-
constants.setFirstPass(true);
35-
}
36-
3732
@Override
3833
public void allocate(MemoryStack stack, IAllocationContext context)
3934
{
@@ -55,17 +50,16 @@ protected int getSize()
5550
@Override
5651
public ByteBuffer getData()
5752
{
58-
int firstPass = 0;
59-
if (constants.isFirstPass())
53+
int forceClear = 0;
54+
if (constants.isForceClear())
6055
{
61-
firstPass = 1;
62-
constants.setFirstPass(false);
56+
forceClear = 1;
6357
}
6458

6559
final float rNumber = random.nextFloat();
6660

6761
buffer.putFloat(rNumber);
68-
buffer.putInt(firstPass);
62+
buffer.putInt(forceClear);
6963
buffer.putInt(constants.isShowSleepZones() ? 1 : 0);
7064
buffer.flip();
7165

0 commit comments

Comments
 (0)