// Path: src/com/painless/glclock/Debug.java
// public class Debug {
// 
// 	private static final String TAG = "ClockGL";
// 
// 	public static void log(Object msg) {
// 		Log.e(getTag(), msg + "");
// 	}
// 
// 	public static void log(Throwable err) {
// 		Log.e(getTag(), err.getMessage() + " ");
// 		err.printStackTrace();
// 	}
// 
// 	private static String getTag() {
// 		boolean startFound = false;
// 		String className = Debug.class.getName();
// 
// 		StackTraceElement[] trace = Thread.currentThread().getStackTrace();
// 		for(StackTraceElement item : trace){
// 			if (item.getClassName().equals(className)) {
// 				startFound = true;
// 			} else if (startFound) {
// 				return String.format(
// 						"[%s/%s/%s]", item.getFileName(), item.getMethodName(), item.getLineNumber());
// 			}
// 		}
// 
// 		return TAG;
// 	}
// }


import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Random;
import javax.microedition.khronos.opengles.GL10;
import javax.microedition.khronos.opengles.GL11;
import javax.microedition.khronos.opengles.GL11Ext;
import android.content.Context;
import com.painless.glclock.Debug;
			trails.remove(0).clear();
		}
		while(count > trails.size()) {
			final Trail t = new Trail();
			if ((trailLimitX > 0) && (trailLimitY > 0)) {
				t.init();
			}
			trails.add(t);
		}
	}

	@Override
	public void loadTextures(GL10 gl) {
		super.loadTextures(gl);

		if (textureW == 0 || textureH == 0) {
			return;
		}

		gl.glBindTexture(GL10.GL_TEXTURE_2D, textureNames[0]);

		gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);
		gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_NEAREST);

		// and init the GL texture with the pixels
		gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_ALPHA, textureW, textureH,
				0, GL10.GL_ALPHA, GL10.GL_UNSIGNED_BYTE, pixelBuffer);

		final int error = gl.glGetError();
		if (error != GL10.GL_NO_ERROR) {
// Path: src/com/painless/glclock/Debug.java
// public class Debug {
// 
// 	private static final String TAG = "ClockGL";
// 
// 	public static void log(Object msg) {
// 		Log.e(getTag(), msg + "");
// 	}
// 
// 	public static void log(Throwable err) {
// 		Log.e(getTag(), err.getMessage() + " ");
// 		err.printStackTrace();
// 	}
// 
// 	private static String getTag() {
// 		boolean startFound = false;
// 		String className = Debug.class.getName();
// 
// 		StackTraceElement[] trace = Thread.currentThread().getStackTrace();
// 		for(StackTraceElement item : trace){
// 			if (item.getClassName().equals(className)) {
// 				startFound = true;
// 			} else if (startFound) {
// 				return String.format(
// 						"[%s/%s/%s]", item.getFileName(), item.getMethodName(), item.getLineNumber());
// 			}
// 		}
// 
// 		return TAG;
// 	}
// }


// Path: src/com/painless/glclock/spirit/TrailSpirit.java
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Random;
import javax.microedition.khronos.opengles.GL10;
import javax.microedition.khronos.opengles.GL11;
import javax.microedition.khronos.opengles.GL11Ext;
import android.content.Context;
import com.painless.glclock.Debug;

			trails.remove(0).clear();
		}
		while(count > trails.size()) {
			final Trail t = new Trail();
			if ((trailLimitX > 0) && (trailLimitY > 0)) {
				t.init();
			}
			trails.add(t);
		}
	}

	@Override
	public void loadTextures(GL10 gl) {
		super.loadTextures(gl);

		if (textureW == 0 || textureH == 0) {
			return;
		}

		gl.glBindTexture(GL10.GL_TEXTURE_2D, textureNames[0]);

		gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);
		gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_NEAREST);

		// and init the GL texture with the pixels
		gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_ALPHA, textureW, textureH,
				0, GL10.GL_ALPHA, GL10.GL_UNSIGNED_BYTE, pixelBuffer);

		final int error = gl.glGetError();
		if (error != GL10.GL_NO_ERROR) {
			Debug.log("Trails Texture Load GLError: " + error);