Inheritance: NSMBe4.Palette
示例#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);
        }
示例#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);
        }
示例#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;
 *              }
 *          }*/
        }
 public PaletteViewer(File f)
 {
     InitializeComponent();
     LanguageManager.ApplyToContainer(this, "PaletteViewer");
     this.MdiParent = MdiParentForm.instance;
     this.f         = f;
     this.pal       = FilePalette.arrayToPalette(f.getContents());
     if (pal.Length < 256)
     {
         is4bpp.Checked = true;
     }
     updatePalettes();
     pictureBox1.Invalidate();
     this.Icon = Properties.Resources.nsmbe;
 }
示例#5
0
 public PaletteViewer(File f)
 {
     InitializeComponent();
     this.MdiParent = MdiParentForm.instance;
     this.f         = f;
     fileLz         = new LZFile(f, LZFile.CompressionType.LZ);
     this.pal       = FilePalette.arrayToPalette(ROM.LZ77_Decompress(f.getContents()));
     if (pal.Length < 256)
     {
         is4bpp.Checked = true;
     }
     updatePalettes();
     pictureBox1.Invalidate();
     this.Icon = Properties.Resources.nsmbe;
 }
示例#6
0
        private Bitmap RenderBackground(File GFXFile, File PalFile, File LayoutFile, int offs, int palOffs)
        {
            LayoutFile = new LZFile(LayoutFile, LZFile.CompressionType.LZ);
            PalFile = new LZFile(PalFile, 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;
        }
示例#7
0
        public void load()
        {
            //Palettes
            int palCount = ROM.LZ77_GetDecompressedSize(PalFile.getContents()) / 512;

            palettes = new Palette[palCount];

            for(int i = 0; i < palCount; i++)
                palettes[i] = new FilePalette(new InlineFile(PalFile, i*512, 512, "Palette "+i, null, InlineFile.CompressionType.LZComp));

            //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;
                }
            }*/
        }
示例#8
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;
        }