@Override public void error (AssetDescriptor asset, Throwable throwable) { Gdx.app.error("AssetManagerTest", "Couldn't load asset: " + asset, (Exception)throwable); }
@Override public void reportErrorWarning (String warningString) { Gdx.app.error("Bullet", warningString); }
@Override protected void finalize() throws Throwable { if (!destroyed && Bullet.enableLogging) Gdx.app.error("Bullet", "The "+className+" class does not override the finalize method."); super.finalize(); } }
/** Forgiving parsing of gl major, minor and release versions as some manufacturers don't adhere to spec **/ private int parseInt (String v, int defaultValue) { try { return Integer.parseInt(v); } catch (NumberFormatException nfe) { Gdx.app.error("LibGDX GL", "Error parsing number: " + v +", assuming: " + defaultValue); return defaultValue; } }
@Override protected void finalize() throws Throwable { if (!destroyed && Bullet.enableLogging) Gdx.app.error("Bullet", "The "+className+" class does not override the finalize method."); super.finalize(); } }
/** Forgiving parsing of gl major, minor and release versions as some manufacturers don't adhere to spec **/ private int parseInt (String v, int defaultValue) { try { return Integer.parseInt(v); } catch (NumberFormatException nfe) { Gdx.app.error("LibGDX GL", "Error parsing number: " + v +", assuming: " + defaultValue); return defaultValue; } }
@Override protected void onModelClicked (final String name) { if (name == null) return; if (currentlyLoading != null) { Gdx.app.error("ModelTest", "Wait for the current model/material to be loaded."); return; } currentlyLoading = "data/" + name; loadingMaterial = false; if (!name.equals(currentModel)) assets.load(currentlyLoading, Model.class); loading = true; }
private void checkFloat (double val1, double val2) { if (val1 != val2) { Gdx.app.error("BufferUtilsTest", "checkFloat failed: "+val1+" != "+val2); throw new GdxRuntimeException("Error, val1 != val2"); } } }
public void setMaterial (String name) { if (name == null) return; if (currentlyLoading != null) { Gdx.app.error("ModelTest", "Wait for the current model/material to be loaded."); return; } currentlyLoading = "data/g3d/materials/" + name + ".g3dj"; loadingMaterial = true; if (!name.equals(currentMaterial)) assets.load(currentlyLoading, Model.class); loading = true; }
private void checkInt (long val1, long val2) { if (val1 != val2) { Gdx.app.error("BufferUtilsTest", "checkInt failed: "+val1+" != "+val2); throw new GdxRuntimeException("Error, val1 != val2"); } }
private int findPointer (UITouch touch) { long ptr = touch.getHandle(); for (int i = 0; i < touchDown.length; i++) { if (touchDown[i] == ptr) return i; } // If pointer is not found StringBuilder sb = new StringBuilder(); for (int i = 0; i < touchDown.length; i++) { sb.append(i + ":" + touchDown[i] + " "); } Gdx.app.error("IOSInput", "Pointer ID lookup failed: " + ptr + ", " + sb.toString()); return POINTER_NOT_FOUND; }
@Override public void dispose () { if (refCount > 0 && Bullet.useRefCounting && Bullet.enableLogging) Gdx.app.error("Bullet", "Disposing "+toString()+" while it still has "+refCount+" references."); disposed = true; delete(); }
@Override public void dispose () { if (refCount > 0 && Bullet.useRefCounting && Bullet.enableLogging) Gdx.app.error("Bullet", "Disposing "+toString()+" while it still has "+refCount+" references."); disposed = true; delete(); }
/** Updates the time and load counters and resets the time. Call {@link #start()} to begin a new count. * @param delta The time since the last call to this method */ public void tick (final float delta) { if (!valid) { Gdx.app.error("PerformanceCounter", "Invalid data, check if you called PerformanceCounter#stop()"); return; } time.put(current); final float currentLoad = delta == 0f ? 0f : current / delta; load.put((delta > 1f) ? currentLoad : delta * currentLoad + (1f - delta) * load.latest); current = 0f; valid = false; }
/** Updates the time and load counters and resets the time. Call {@link #start()} to begin a new count. * @param delta The time since the last call to this method */ public void tick (final float delta) { if (!valid) { Gdx.app.error("PerformanceCounter", "Invalid data, check if you called PerformanceCounter#stop()"); return; } time.put(current); final float currentLoad = delta == 0f ? 0f : current / delta; load.put((delta > 1f) ? currentLoad : delta * currentLoad + (1f - delta) * load.latest); current = 0f; valid = false; }
public IOSAudio (IOSApplicationConfiguration config) { OALSimpleAudio audio = OALSimpleAudio.sharedInstance(); if (audio != null) { audio.setAllowIpod(config.allowIpod); audio.setHonorSilentSwitch(!config.overrideRingerSwitch); } else Gdx.app.error("IOSAudio", "No OALSimpleAudio instance available, audio will not be availabe"); }
public IOSAudio (IOSApplicationConfiguration config) { OALSimpleAudio audio = OALSimpleAudio.sharedInstance(); if (audio != null) { audio.setAllowIpod(config.allowIpod); audio.setHonorSilentSwitch(!config.overrideRingerSwitch); } else Gdx.app.error("IOSAudio", "No OALSimpleAudio instance available, audio will not be availabe"); }
public IOSAudio (IOSApplicationConfiguration config) { OALSimpleAudio audio = OALSimpleAudio.sharedInstance(); if (audio != null) { audio.setAllowIpod(config.allowIpod); audio.setHonorSilentSwitch(!config.overrideRingerSwitch); } else Gdx.app.error("IOSAudio", "No OALSimpleAudio instance available, audio will not be availabe"); }
public IOSAudio (IOSApplicationConfiguration config) { OALSimpleAudio audio = OALSimpleAudio.sharedInstance(); if (audio != null) { audio.setAllowIpod(config.allowIpod); audio.setHonorSilentSwitch(!config.overrideRingerSwitch); } else Gdx.app.error("IOSAudio", "No OALSimpleAudio instance available, audio will not be availabe"); }
public TestShader (Renderable renderable) { super(); withColor = renderable.material.has(ColorAttribute.Diffuse); if (withColor) Gdx.app.log("ShaderTest", "Compiling test shader with u_color uniform"); else Gdx.app.log("ShaderTest", "Compiling test shader without u_color uniform"); String prefix = withColor ? "#define HasDiffuseColor\n" : ""; program = new ShaderProgram(vertexShader, prefix + fragmentShader); if (!program.isCompiled()) throw new GdxRuntimeException("Couldn't compile shader " + program.getLog()); String log = program.getLog(); if (log.length() > 0) Gdx.app.error("ShaderTest", "Shader compilation log: " + log); }