private static String calcMeshMaterial(final Mesh mesh) { final StringBuilder material = new StringBuilder(); // First, check if we are lit or not final LightState ls = mesh.getWorldRenderState(StateType.Light); final boolean lit = (ls != null && ls.isEnabled() && ls.count() > 0); material.append(lit ? "lit/" : "unlit/"); // Now check if we are textured final TextureState ts = mesh.getWorldRenderState(StateType.Texture); final boolean textured = (ts != null && ts.isEnabled() && ts.getNumberOfSetTextures() > 0); material.append(textured ? "textured/" : "untextured/"); // Check if we are using vertex colors final boolean vertColor = mesh.getMeshData().containsKey(MeshData.KEY_ColorCoords); material.append(vertColor ? "vertex_color" : "basic"); material.append(lit ? "_phong" : ""); // Finally, check if we are using fog final boolean foggy = mesh.hasProperty(FogParams.DefaultPropertyKey); material.append(foggy ? "_fog" : ""); material.append(".yaml"); System.out.println(material + " - " + mesh.getName()); return material.toString(); } }
tState.setTexture(texture, tState.getNumberOfSetTextures()); loadedTextures.put(textureReference, texture); if (info != null) {
@Override public void draw(final Renderer renderer, final UIComponent comp) { if (_texState.getNumberOfSetTextures() == 0 || _texState.getTexture().getTextureKey() == null || !_texState.getTexture().getTextureKey().equals(_image.getTexture().getTextureKey())) { _texState.setTexture(_image.getTexture()); ImageArcBackdrop._standin.setRenderState(_texState); ImageArcBackdrop._standin.updateWorldRenderStates(false); } drawBackdrop(ImageArcBackdrop._standin, renderer, comp, _image); }
if (_texState.getNumberOfSetTextures() == 0 || _texState.getTexture().getTextureKey() == null || !_texState.getTexture().getTextureKey().equals(_image.getTexture().getTextureKey())) { _texState.setTexture(_image.getTexture());
if (SubTexUtil._tstate.getNumberOfSetTextures() == 0 || SubTexUtil._tstate.getTexture().getTextureKey() == null || !SubTexUtil._tstate.getTexture().getTextureKey().equals(subTex.getTexture().getTextureKey())) { SubTexUtil._tstate.setTexture(subTex.getTexture());
if (SubTexUtil._tstate.getNumberOfSetTextures() == 0 || SubTexUtil._tstate.getTexture().getTextureKey() == null || !SubTexUtil._tstate.getTexture().getTextureKey().equals(subTex.getTexture().getTextureKey())) { SubTexUtil._tstate.setTexture(subTex.getTexture());
if (SubTexUtil._tstate.getNumberOfSetTextures() == 0 || SubTexUtil._tstate.getTexture().getTextureKey() == null || !SubTexUtil._tstate.getTexture().getTextureKey().equals(subTex.getTexture().getTextureKey())) { SubTexUtil._tstate.setTexture(subTex.getTexture());
if (SubTexUtil._tstate.getNumberOfSetTextures() == 0 || SubTexUtil._tstate.getTexture().getTextureKey() == null || !SubTexUtil._tstate.getTexture().getTextureKey().equals(subTex.getTexture().getTextureKey())) { SubTexUtil._tstate.setTexture(subTex.getTexture());