// Path: core/src/main/java/net/panuska/tlappy/Constants.java
// public class Constants {
// 
//     static final int SCREEN_WIDTH = 320;
//     static final int SCREEN_HEIGHT = 200;
//     static final int NUM_SCENES = 200;
//     static final int LIVES = 5;
//     public static final int SPRITE_SIZE = 16;
//     public static final int SPRITE_HALF = 8;
//     public static final int FONT_WIDTH = SPRITE_HALF;
// 
//     static final int UP = 1;
//     static final int DOWN = 2;
//     static final int LEFT = 3;
//     static final int RIGHT = 4;
//     static final int FIRE = 5;
//     static final int ESC = 255;
//     
//     static final int INTRO = -1;
//     static final int GAME = -2;
//     static final int SETUP = -3;
// 
//     static final byte SPACE = 0;
//     static final byte MUSHROOM = 0x10;
//     static final byte CHICKEN = 0x20;
//     static final byte BLUE_ENEMY = 0x30;
//     static final byte RED_ENEMY = 0x40;
//     static final byte RED_BALL = 0x50;
//     static final byte BLUE_BALL = 0x60;
//     static final byte WALL = 0x70;
//     static final byte BLUE_WALL = 0x71; // ORIGINAL: (byte) 0x80;
//     
// }
// 
// Path: core/src/main/java/net/panuska/tlappy/ImageUtils.java
// public class ImageUtils {
// 
//     private static final int ZOOM = 1;
// 
//     private ImageUtils() {
//     }
//     static BufferedImage loadDrawable(Resources r, int drawableId) {
//         BitmapDrawable d = (BitmapDrawable)r.getDrawable(drawableId);
//         return new BufferedImage(d);
//     }
// 
//     public static final int FONT_SIZE = 8;
//     public static BufferedImage createLetterImage(int z, Color color, Color background) {
//         BufferedImage img = new BufferedImage(FONT_SIZE * ZOOM, FONT_SIZE * ZOOM, BufferedImage.TYPE_INT_RGB);
//         Graphics g = img.getGraphics();
//         for (int i = 0; i < FONT_SIZE; i++) {
//             int b = Fonts.bitmap[z][i];
//             for (int j = 0; j < FONT_SIZE; j++) {
//                 boolean px = (b & 0x80) == 0x80;
//                 b = b << 1;
//                 g.setColor(px ? color : background);
//                 g.fillRect(j * ZOOM, i * ZOOM, ZOOM, ZOOM);
//             }
//         }
//         return img;
//     }
// }


import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Typeface;
import net.panuska.tlappy.Constants;
import net.panuska.tlappy.ImageUtils;
    }

    public boolean drawImage(BufferedImage img, int x, int y, Paint paint) {
        c.drawBitmap(img.getBitmap(), x, y, paint);
        return true;
    }

    public void drawString(String str, int x, int y, Color color) {
        Paint p = new Paint();
        p.setTypeface(Typeface.DEFAULT_BOLD);
        p.setTextSize(Constants.SPRITE_SIZE);
        p.setColor(color.getValue());
        c.drawText(str, x, y + Constants.SPRITE_SIZE, p);
    }

    /**
     * Draws string using monospaced (Flappy built-in) font.
     * @param text
     * @param x
     * @param y
     * @param color
     */
    public void drawText(String text, int x, int y, Color color) {
        //todo copied from VRAM.printText()
        for (int i = 0, maxi = text.length(); i < maxi; i++) {
            int z = text.charAt(i);
            if (z < 0x20 || z > 0x7a) {
                z = '!';
            }
            z -= 0x20;
// Path: core/src/main/java/net/panuska/tlappy/Constants.java
// public class Constants {
// 
//     static final int SCREEN_WIDTH = 320;
//     static final int SCREEN_HEIGHT = 200;
//     static final int NUM_SCENES = 200;
//     static final int LIVES = 5;
//     public static final int SPRITE_SIZE = 16;
//     public static final int SPRITE_HALF = 8;
//     public static final int FONT_WIDTH = SPRITE_HALF;
// 
//     static final int UP = 1;
//     static final int DOWN = 2;
//     static final int LEFT = 3;
//     static final int RIGHT = 4;
//     static final int FIRE = 5;
//     static final int ESC = 255;
//     
//     static final int INTRO = -1;
//     static final int GAME = -2;
//     static final int SETUP = -3;
// 
//     static final byte SPACE = 0;
//     static final byte MUSHROOM = 0x10;
//     static final byte CHICKEN = 0x20;
//     static final byte BLUE_ENEMY = 0x30;
//     static final byte RED_ENEMY = 0x40;
//     static final byte RED_BALL = 0x50;
//     static final byte BLUE_BALL = 0x60;
//     static final byte WALL = 0x70;
//     static final byte BLUE_WALL = 0x71; // ORIGINAL: (byte) 0x80;
//     
// }
// 
// Path: core/src/main/java/net/panuska/tlappy/ImageUtils.java
// public class ImageUtils {
// 
//     private static final int ZOOM = 1;
// 
//     private ImageUtils() {
//     }
//     static BufferedImage loadDrawable(Resources r, int drawableId) {
//         BitmapDrawable d = (BitmapDrawable)r.getDrawable(drawableId);
//         return new BufferedImage(d);
//     }
// 
//     public static final int FONT_SIZE = 8;
//     public static BufferedImage createLetterImage(int z, Color color, Color background) {
//         BufferedImage img = new BufferedImage(FONT_SIZE * ZOOM, FONT_SIZE * ZOOM, BufferedImage.TYPE_INT_RGB);
//         Graphics g = img.getGraphics();
//         for (int i = 0; i < FONT_SIZE; i++) {
//             int b = Fonts.bitmap[z][i];
//             for (int j = 0; j < FONT_SIZE; j++) {
//                 boolean px = (b & 0x80) == 0x80;
//                 b = b << 1;
//                 g.setColor(px ? color : background);
//                 g.fillRect(j * ZOOM, i * ZOOM, ZOOM, ZOOM);
//             }
//         }
//         return img;
//     }
// }


// Path: core/src/main/java/net/panuska/tlappy/awt/Graphics.java
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Typeface;
import net.panuska.tlappy.Constants;
import net.panuska.tlappy.ImageUtils;

    }

    public boolean drawImage(BufferedImage img, int x, int y, Paint paint) {
        c.drawBitmap(img.getBitmap(), x, y, paint);
        return true;
    }

    public void drawString(String str, int x, int y, Color color) {
        Paint p = new Paint();
        p.setTypeface(Typeface.DEFAULT_BOLD);
        p.setTextSize(Constants.SPRITE_SIZE);
        p.setColor(color.getValue());
        c.drawText(str, x, y + Constants.SPRITE_SIZE, p);
    }

    /**
     * Draws string using monospaced (Flappy built-in) font.
     * @param text
     * @param x
     * @param y
     * @param color
     */
    public void drawText(String text, int x, int y, Color color) {
        //todo copied from VRAM.printText()
        for (int i = 0, maxi = text.length(); i < maxi; i++) {
            int z = text.charAt(i);
            if (z < 0x20 || z > 0x7a) {
                z = '!';
            }
            z -= 0x20;
            BufferedImage imgChar = ImageUtils.createLetterImage(z, color, Color.BLACK);