package me.hugmanrique.pokedata.tiles;

import lombok.Getter;
import me.hugmanrique.pokedata.Data;
import me.hugmanrique.pokedata.roms.ROM;

/**
 * http://datacrystal.romhacking.net/wiki/Pok%C3%A9mon_3rd_Generation#Maps
 * @author Hugmanrique
 * @since 02/07/2017
 */
@Getter
public class TilesetHeader extends Data {
    private boolean compressed;
    private boolean primary;
    private long tilesetImgPtr;
    private long palettesPtr;
    private long blocksPtr;
    private long animationPtr;
    private long behaviorPtr;

    public TilesetHeader(ROM rom) {
        compressed = rom.readByte() == 1;
        primary = rom.readByte() == 0;

        // Skip two unknown bytes
        rom.addInternalOffset(2);

        tilesetImgPtr = rom.getPointer();
        palettesPtr = rom.getPointer();
        blocksPtr = rom.getPointer();

        System.out.println("Read: Tileset imgs -> " + tilesetImgPtr + " Palettes -> " + palettesPtr + " Blocks -> " + blocksPtr);

        if (rom.getGame().isElements()) {
            animationPtr = rom.getPointer();
            behaviorPtr = rom.getPointer();
        } else {
            behaviorPtr = rom.getPointer();
            animationPtr = rom.getPointer();
        }
    }
}

@@ -836,139 +836,8 @@
 );%0A%0A
-        System.out.println(%22Read: Tileset imgs -%3E %22 + tilesetImgPtr + %22 Palettes -%3E %22 + palettesPtr + %22 Blocks -%3E %22 + blocksPtr);%0A%0A
     

Remove tileset load debug message