From 6c4e379723b878e3cec5f9d1da269554f5815015 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sun, 27 Jan 2013 10:10:30 -0800 Subject: j3dcore: use correct types in the TextureBin render method to avoid instanceof Signed-off-by: Harvey Harrison --- src/classes/share/javax/media/j3d/TextureBin.java | 44 ++++++++--------------- 1 file changed, 14 insertions(+), 30 deletions(-) (limited to 'src/classes/share') diff --git a/src/classes/share/javax/media/j3d/TextureBin.java b/src/classes/share/javax/media/j3d/TextureBin.java index 2cc8592..ef1ff25 100644 --- a/src/classes/share/javax/media/j3d/TextureBin.java +++ b/src/classes/share/javax/media/j3d/TextureBin.java @@ -1219,40 +1219,24 @@ RenderMolecule addAll(HashMap renderMoleculeMap, } - /** - * Renders this TextureBin - */ - void render(Canvas3D cv) { - render(cv, (Object) opaqueRMList); - } - - void render(Canvas3D cv, Object rlist) { - /* - System.err.println("TextureBin/render " + this + - " numActiveTexUnit= " + numActiveTexUnit + - " maxTextureUnits= " + cv.maxTextureUnits); - */ +/** + * Renders this TextureBin + */ +void render(Canvas3D cv) { + render(cv, opaqueRMList); +} +void render(Canvas3D cv, RenderMolecule rlist) { // include this TextureBin to the to-be-updated state set in canvas cv.setStateToUpdate(Canvas3D.TEXTUREBIN_BIT, this); + renderList(cv, USE_DISPLAYLIST, rlist); +} - renderList(cv, USE_DISPLAYLIST, rlist); - } - - - /** - * render a render list - */ - void renderList(Canvas3D cv, int pass, Object rlist) { - assert pass < 0; - - if (rlist instanceof RenderMolecule) { - renderList(cv, pass, (RenderMolecule) rlist); - } else if (rlist instanceof TransparentRenderingInfo) { - renderList(cv, pass, (TransparentRenderingInfo) rlist); - } - } - +void render(Canvas3D cv, TransparentRenderingInfo rlist) { + // include this TextureBin to the to-be-updated state set in canvas + cv.setStateToUpdate(Canvas3D.TEXTUREBIN_BIT, this); + renderList(cv, USE_DISPLAYLIST, rlist); +} /** * render list of RenderMolecule -- cgit v1.2.3