Noticed, there were methods to remove main/post viewport with the name as an argument in RenderManager.java, but not one for a pre viewport. Sorry no diff, and its not been tested
[java]/**
* Removes the pre ViewPort with the specified name.
*
* @param viewName The preViewPort name to remove
* @return True if the ViewPort was removed successfully.
*
* @see#createPreView(java.lang.String, com.jme3.renderer.Camera)
*/
public boolean removePreView(String viewName) {
for (int i = 0; i < preViewPorts.size(); i++) {
if (preViewPorts.get(i).getName().equals(viewName)) {
preViewPorts.remove(i);
return true;
}
}
return false;
}[/java]
This completes the pattern of removeMainView(), removePostView(), … but it doesn’t add much functionality to the class since there’s a trivial workaround using getPreView(String) and removePreView(ViewPort).
Is there a second for this proposal? If so, I’m prepared to test and commit.
I tested it on the JME trunk, and (not surprisingly) it works. The affected files are:
/trunk/engine/src/core/com/jme3/renderer/RenderManager.java
and
/branches/gradle-restructure/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java
Here is the final diff:
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -107,6 +107,24 @@
}
/**
+ * Removes the pre ViewPort with the specified name.
+ *
+ * @param viewName The name of the pre ViewPort to remove
+ * @return True if the ViewPort was removed successfully.
+ *
+ * @see #createPreView(java.lang.String, com.jme3.renderer.Camera)
+ */
+ public boolean removePreView(String viewName) {
+ for (int i = 0; i < preViewPorts.size(); i++) {
+ if (preViewPorts.get(i).getName().equals(viewName)) {
+ preViewPorts.remove(i);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
* Removes the specified pre ViewPort.
*
* @param view The pre ViewPort to remove
@zarch said:
Seems reasonable to complete the API :)
Really @wezrule should be testing it before posting it as a patch tho
I think my build was screwed at the time, and I noticed it was missing by accident (I didn’t even need the method). So it was just a quick “heads” up, this is missing, before I forget about it