Ejemplo n.º 1
0
        private Tilemap getTilemap()
        {
            getFiles();
            if (GFXFile == null)
            {
                return(null);
            }
            if (PalFile == null)
            {
                return(null);
            }
            if (LayoutFile == null)
            {
                return(null);
            }

            LayoutFile = new LZFile(LayoutFile, LZFile.CompressionType.LZ);

            Image2D i         = new Image2D(GFXFile, 256, false);
            LZFile  PalFileLz = new LZFile(PalFile, LZFile.CompressionType.LZ);
            Palette pal1      = new FilePalette(new InlineFile(PalFileLz, 0, 512, PalFile.name));
            Palette pal2      = new FilePalette(new InlineFile(PalFileLz, 512, 512, PalFile.name));

            Tilemap t = new Tilemap(LayoutFile, 64, i, new Palette[] { pal1, pal2 }, bg.topLayer ? 256 : 576, bg.topLayer ? 8 : 10);

            return(t);
        }
Ejemplo n.º 2
0
        private Bitmap RenderBackground(File GFXFile, File PalFile, File LayoutFile, int offs, int palOffs)
        {
            LayoutFile = new LZFile(LayoutFile, LZFile.CompressionType.LZ);

            Image2D i    = new Image2D(GFXFile, 256, false);
            Palette pal1 = new FilePalette(new InlineFile(PalFile, 0, 512, PalFile.name));
            Palette pal2 = new FilePalette(new InlineFile(PalFile, 512, 512, PalFile.name));

            Tilemap t = new Tilemap(LayoutFile, 64, i, new Palette[] { pal1, pal2 }, offs, palOffs);

            t.render();
            return(t.buffer);
        }
Ejemplo n.º 3
0
        public void load()
        {
            //Palettes
            int palCount = ROM.LZ77_GetDecompressedSize(PalFile.getContents()) / 512;

            palettes = new Palette[palCount];

            LZFile PalFileLz = new LZFile(PalFile, LZFile.CompressionType.LZ);

            for (int i = 0; i < palCount; i++)
            {
                palettes[i] = new FilePalette(new InlineFile(PalFileLz, i * 512, 512, "Palette " + i));
            }

            //Graphics
            graphics = new Image2D(GFXFile, 256, false);

            //Map16
            map16       = new Map16Tilemap(Map16File, 32, graphics, palettes, Map16TileOffset, Map16PaletteOffset);
            Overrides   = new short[map16.getMap16TileCount()];
            Map16Buffer = map16.render();

            /*
             * TilemapEditorTest t = new TilemapEditorTest();
             * t.load(map16);
             * t.Show();
             */
            //Tile Behaviors
            loadTileBehaviors();

            //Objects
            loadObjects();

/*            // Finally, load overrides
 *          if (overrideFlag)
 *          {
 *              UseOverrides = true;
 *              OverrideBitmap = Properties.Resources.tileoverrides;
 *
 *              Overrides = new short[Map16.Length];
 *              EditorOverrides = new short[Map16.Length];
 *
 *              for (int idx = 0; idx < Map16.Length; idx++)
 *              {
 *                  Overrides[idx] = -1;
 *                  EditorOverrides[idx] = -1;
 *              }
 *          }*/
        }