-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solve issue #1992: better messages in spatial assertions #1993
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -368,7 +368,7 @@ public boolean checkCulling(Camera cam) { | |
} | ||
|
||
CullHint cm = getCullHint(); | ||
assert cm != CullHint.Inherit; | ||
assert cm != CullHint.Inherit : "CullHint should never be inherit. Problem spatial name: " + getName(); | ||
if (cm == Spatial.CullHint.Always) { | ||
setLastFrustumIntersection(Camera.FrustumIntersect.Outside); | ||
return false; | ||
|
@@ -586,7 +586,7 @@ protected void updateWorldLightList() { | |
worldLights.update(localLights, null); | ||
refreshFlags &= ~RF_LIGHTLIST; | ||
} else { | ||
assert (parent.refreshFlags & RF_LIGHTLIST) == 0; | ||
assert (parent.refreshFlags & RF_LIGHTLIST) == 0 : "Illegal light list update. Problem spatial name: " + getName(); | ||
worldLights.update(localLights, parent.worldLights); | ||
refreshFlags &= ~RF_LIGHTLIST; | ||
} | ||
|
@@ -599,7 +599,7 @@ protected void updateMatParamOverrides() { | |
if (parent == null) { | ||
worldOverrides.addAll(localOverrides); | ||
} else { | ||
assert (parent.refreshFlags & RF_MATPARAM_OVERRIDE) == 0; | ||
assert (parent.refreshFlags & RF_MATPARAM_OVERRIDE) == 0 : "Illegal mat param update. Problem spatial name: " + getName(); | ||
worldOverrides.addAll(parent.worldOverrides); | ||
worldOverrides.addAll(localOverrides); | ||
} | ||
|
@@ -653,7 +653,7 @@ protected void updateWorldTransforms() { | |
refreshFlags &= ~RF_TRANSFORM; | ||
} else { | ||
// check if transform for parent is updated | ||
assert ((parent.refreshFlags & RF_TRANSFORM) == 0); | ||
assert ((parent.refreshFlags & RF_TRANSFORM) == 0) : "Illegal rf transform update. Problem spatial name: " + getName(); | ||
worldTransform.set(localTransform); | ||
worldTransform.combineWithParent(parent.worldTransform); | ||
refreshFlags &= ~RF_TRANSFORM; | ||
|
@@ -811,7 +811,7 @@ public void addControlAt(int index, Control control) { | |
|
||
if (index < numControls) { // re-arrange the list directly | ||
boolean success = controls.remove(control); | ||
assert success; | ||
assert success : "Surprising control remove failure. " + control.getClass().getSimpleName() + " from spatial " + getName(); | ||
stephengold marked this conversation as resolved.
Show resolved
Hide resolved
|
||
controls.add(index, control); | ||
} | ||
} | ||
|
@@ -952,7 +952,7 @@ public void updateGeometricState() { | |
if ((refreshFlags & RF_MATPARAM_OVERRIDE) != 0) { | ||
updateMatParamOverrides(); | ||
} | ||
assert refreshFlags == 0; | ||
assert refreshFlags == 0 : "Illegal refresh flags state: " + refreshFlags + " for spatial " + getName(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be desirable to apply a little bit of formatting? I'm thinking There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is fine as it stands. Double quotes don't add any clarity and might mislead the reader into thinking it's a String. |
||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And
never be \"inherit\".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine as it stands. Double quotes don't add any clarity and might mislead the reader into thinking it's a String.