Java Code Examples for org.andengine.util.debug.Debug#d()

The following examples show how to use org.andengine.util.debug.Debug#d() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseGameActivity.java    From tilt-game-android with MIT License 6 votes vote down vote up
@Override
protected void onDestroy() {
	if (BuildConfig.DEBUG) {
		Debug.d(this.getClass().getSimpleName() + ".onDestroy" + " @(Thread: '" + Thread.currentThread().getName() + "')");
	}

	super.onDestroy();

	this.mEngine.onDestroy();

	try {
		this.onDestroyResources();
	} catch (final Throwable pThrowable) {
		Debug.e(this.getClass().getSimpleName() + ".onDestroyResources failed." + " @(Thread: '" + Thread.currentThread().getName() + "')", pThrowable);
	}

	this.onGameDestroyed();

	this.mEngine = null;
}
 
Example 2
Source File: BaseGameActivity.java    From 30-android-libraries-in-30-days with Apache License 2.0 6 votes vote down vote up
@Override
public synchronized void onSurfaceCreated(final GLState pGLState) {
	if(BuildConfig.DEBUG) {
		Debug.d(this.getClass().getSimpleName() + ".onSurfaceCreated" + " @(Thread: '" + Thread.currentThread().getName() + "')");
	}

	if(this.mGameCreated) {
		this.onReloadResources();

		if(this.mGamePaused && this.mGameCreated) {
			this.onResumeGame();
		}
	} else {
		if(this.mCreateGameCalled) {
			this.mOnReloadResourcesScheduled = true;
		} else {
			this.mCreateGameCalled = true;
			this.onCreateGame();
		}
	}
}
 
Example 3
Source File: FrameCountCrasher.java    From 30-android-libraries-in-30-days with Apache License 2.0 6 votes vote down vote up
@Override
public void onUpdate(final float pSecondsElapsed) {
	this.mFramesLeft--;

	final float[] frameLengths = this.mFrameLengths;
	if(this.mFramesLeft >= 0) {
		frameLengths[this.mFramesLeft] = pSecondsElapsed;
	} else {
		if(BuildConfig.DEBUG) {
			for(int i = frameLengths.length - 1; i >= 0; i--) {
				Debug.d("Elapsed: " + frameLengths[i]);
			}
		}

		throw new RuntimeException();
	}
}
 
Example 4
Source File: FrameCountCrasher.java    From tilt-game-android with MIT License 6 votes vote down vote up
@Override
public void onUpdate(final float pSecondsElapsed) {
	this.mFramesLeft--;

	final float[] frameLengths = this.mFrameLengths;
	if (this.mFramesLeft >= 0) {
		frameLengths[this.mFramesLeft] = pSecondsElapsed;
	} else {
		if (BuildConfig.DEBUG) {
			for (int i = frameLengths.length - 1; i >= 0; i--) {
				Debug.d("Elapsed: " + frameLengths[i]);
			}
		}

		throw new RuntimeException();
	}
}
 
Example 5
Source File: BaseGameActivity.java    From tilt-game-android with MIT License 6 votes vote down vote up
@Override
public synchronized void onSurfaceCreated(final GLState pGLState) {
	if (BuildConfig.DEBUG) {
		Debug.d(this.getClass().getSimpleName() + ".onSurfaceCreated" + " @(Thread: '" + Thread.currentThread().getName() + "')");
	}

	if (this.mGameCreated) {
		this.onReloadResources();

		if (this.mGamePaused && this.mGameCreated && !this.isFinishing()) {
			this.onResumeGame();
		}
	} else {
		if (this.mCreateGameCalled) {
			this.mOnReloadResourcesScheduled = true;
		} else {
			this.mCreateGameCalled = true;
			this.onCreateGame();
		}
	}
}
 
Example 6
Source File: BaseGameActivity.java    From tilt-game-android with MIT License 5 votes vote down vote up
@Override
protected synchronized void onResume() {
	if (BuildConfig.DEBUG) {
		Debug.d(this.getClass().getSimpleName() + ".onResume" + " @(Thread: '" + Thread.currentThread().getName() + "')");
	}

	super.onResume();

	this.acquireWakeLock();
	this.mRenderSurfaceView.onResume();
}
 
Example 7
Source File: BaseGameActivity.java    From tilt-game-android with MIT License 5 votes vote down vote up
@Override
public synchronized void onResumeGame() {
	if (BuildConfig.DEBUG) {
		Debug.d(this.getClass().getSimpleName() + ".onResumeGame" + " @(Thread: '" + Thread.currentThread().getName() + "')");
	}

	this.mEngine.start();

	this.mGamePaused = false;
}
 
Example 8
Source File: BaseGameActivity.java    From tilt-game-android with MIT License 5 votes vote down vote up
@Override
public void onReloadResources() {
	if (BuildConfig.DEBUG) {
		Debug.d(this.getClass().getSimpleName() + ".onReloadResources" + " @(Thread: '" + Thread.currentThread().getName() + "')");
	}

	this.mEngine.onReloadResources();
}
 
Example 9
Source File: BaseGameActivity.java    From 30-android-libraries-in-30-days with Apache License 2.0 5 votes vote down vote up
@Override
protected synchronized void onResume() {
	if(BuildConfig.DEBUG) {
		Debug.d(this.getClass().getSimpleName() + ".onResume" + " @(Thread: '" + Thread.currentThread().getName() + "')");
	}

	super.onResume();

	this.acquireWakeLock();
	this.mRenderSurfaceView.onResume();
}
 
Example 10
Source File: BaseGameActivity.java    From tilt-game-android with MIT License 5 votes vote down vote up
@Override
public synchronized void onPauseGame() {
	if (BuildConfig.DEBUG) {
		Debug.d(this.getClass().getSimpleName() + ".onPauseGame" + " @(Thread: '" + Thread.currentThread().getName() + "')");
	}

	this.mGamePaused = true;

	this.mEngine.stop();
}
 
Example 11
Source File: BaseGameActivity.java    From tilt-game-android with MIT License 5 votes vote down vote up
@Override
public void onDestroyResources() throws IOException {
	if (BuildConfig.DEBUG) {
		Debug.d(this.getClass().getSimpleName() + ".onDestroyResources" + " @(Thread: '" + Thread.currentThread().getName() + "')");
	}

	if (this.mEngine.getEngineOptions().getAudioOptions().needsMusic()) {
		this.getMusicManager().releaseAll();
	}

	if (this.mEngine.getEngineOptions().getAudioOptions().needsSound()) {
		this.getSoundManager().releaseAll();
	}
}
 
Example 12
Source File: BaseGameActivity.java    From 30-android-libraries-in-30-days with Apache License 2.0 5 votes vote down vote up
@Override
public void onDestroyResources() throws Exception {
	if(BuildConfig.DEBUG) {
		Debug.d(this.getClass().getSimpleName() + ".onDestroyResources" + " @(Thread: '" + Thread.currentThread().getName() + "')");
	}

	if(this.mEngine.getEngineOptions().getAudioOptions().needsMusic()) {
		this.getMusicManager().releaseAll();
	}

	if(this.mEngine.getEngineOptions().getAudioOptions().needsSound()) {
		this.getSoundManager().releaseAll();
	}
}
 
Example 13
Source File: BaseGameActivity.java    From 30-android-libraries-in-30-days with Apache License 2.0 5 votes vote down vote up
@Override
public void onReloadResources() {
	if(BuildConfig.DEBUG) {
		Debug.d(this.getClass().getSimpleName() + ".onReloadResources" + " @(Thread: '" + Thread.currentThread().getName() + "')");
	}

	this.mEngine.onReloadResources();
}
 
Example 14
Source File: BaseGameActivity.java    From 30-android-libraries-in-30-days with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized void onResumeGame() {
	if(BuildConfig.DEBUG) {
		Debug.d(this.getClass().getSimpleName() + ".onResumeGame" + " @(Thread: '" + Thread.currentThread().getName() + "')");
	}

	this.mEngine.start();

	this.mGamePaused = false;
}
 
Example 15
Source File: BaseGameActivity.java    From 30-android-libraries-in-30-days with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized void onGameDestroyed() {
	if(BuildConfig.DEBUG) {
		Debug.d(this.getClass().getSimpleName() + ".onGameDestroyed" + " @(Thread: '" + Thread.currentThread().getName() + "')");
	}

	this.mGameCreated = false;
}
 
Example 16
Source File: Engine.java    From tilt-game-android with MIT License 5 votes vote down vote up
@Override
public void run() {
	android.os.Process.setThreadPriority(this.mEngine.getEngineOptions().getUpdateThreadPriority());
	try {
		while (true) {
			this.mRunnableHandler.onUpdate(0);
			this.mEngine.onTickUpdate();
		}
	} catch (final InterruptedException e) {
		if (BuildConfig.DEBUG) {
			Debug.d(this.getClass().getSimpleName() + " interrupted. Don't worry - this " + e.getClass().getSimpleName() + " is most likely expected!", e);
		}
		this.interrupt();
	}
}
 
Example 17
Source File: BaseGameActivity.java    From tilt-game-android with MIT License 4 votes vote down vote up
@Override
public synchronized void onSurfaceChanged(final GLState pGLState, final int pWidth, final int pHeight) {
	if (BuildConfig.DEBUG) {
		Debug.d(this.getClass().getSimpleName() + ".onSurfaceChanged(Width=" + pWidth + ", Height=" + pHeight + ")" + " @(Thread: '" + Thread.currentThread().getName() + "')");
	}
}
 
Example 18
Source File: ITextureAtlas.java    From tilt-game-android with MIT License 4 votes vote down vote up
@Override
public void onUnloadedFromHardware(final ITexture pTexture) {
	if (BuildConfig.DEBUG) {
		Debug.d("Texture unloaded: " + pTexture.toString());
	}
}
 
Example 19
Source File: DebugTextureStateListener.java    From tilt-game-android with MIT License 4 votes vote down vote up
@Override
public void onUnloadedFromHardware(final ITexture pTexture) {
	if (BuildConfig.DEBUG) {
		Debug.d("Texture unloaded: " + pTexture.toString());
	}
}
 
Example 20
Source File: ITextureAtlas.java    From 30-android-libraries-in-30-days with Apache License 2.0 4 votes vote down vote up
@Override
public void onUnloadedFromHardware(final ITexture pTexture) {
	if(BuildConfig.DEBUG) {
		Debug.d("Texture unloaded: " + pTexture.toString());
	}
}