public void load(NSMBGraphics g, int TilesetNumber)
 {
     this.tnum = TilesetNumber;
     this.tls = g.Tilesets[tnum];
     tilePicker1.init(new Bitmap[] { tls.map16.buffer }, 16);
     previewObject = new NSMBObject(0, tnum, 0, 0, 6, 6, g);
 }
 public void load(NSMBGraphics g, int TilesetNumber)
 {
     this.tnum = TilesetNumber;
     this.tls  = g.Tilesets[tnum];
     tilePicker1.init(new Bitmap[] { tls.map16.buffer }, 16);
     previewObject = new NSMBObject(0, tnum, 0, 0, 6, 6, g);
 }
            public ObjectDefTile(ByteArrayInputStream inp, NSMBTileset t)
            {
                this.t = t;
                if (inp.available < 1)  //This should never happen. But sometimes, it does.
                {
                    controlByte = 0xFF; //Simulate object end.
                    return;
                }

                controlByte = inp.readByte();

                if (!controlTile)

                {
                    byte a, b;
                    a = inp.readByte();
                    b = inp.readByte();

                    tileID = a + ((b - t.ObjectDefTileOffset) << 8);

                    if ((controlByte & 64) != 0) //OVERRIDES
                    {
                        tileID += 768;
                    }
                    if (a == 0 && b == 0)
                    {
                        tileID = -1;
                    }
                }
            }
Beispiel #4
0
        public TilesetEditor(ushort TilesetID, string tilesetName)
        {
            InitializeComponent();
            if (Properties.Settings.Default.mdi)
                this.MdiParent = MdiParentForm.instance;
            LanguageManager.ApplyToContainer(this, "TilesetEditor");
            Text = string.Format(LanguageManager.Get("TilesetEditor", "_TITLE"), tilesetName);

            g = new NSMBGraphics();

            this.TilesetID = TilesetID;
            if (TilesetID == 65535)
            {
                // load Jyotyu
                g.LoadTilesets(0);
                TilesetNumber = 0;
            }
            else if (TilesetID == 65534)
            {
                // load Nohara_sub
                g.LoadTilesets(2);
                TilesetNumber = 2;
            }
            else
            {
                // load a normal tileset
                g.LoadTilesets(TilesetID);
                TilesetNumber = 1;
            }

            t = g.Tilesets[TilesetNumber];
            t.beginEdit();

            objectPickerControl1.Initialise(g);
            objectPickerControl1.CurrentTileset = TilesetNumber;

            tilesetObjectEditor1.load(g, TilesetNumber);
            tilemapEditor1.load(t.map16);

            imageManager1.addImage(t.graphics);

            for(int i = 0; i < t.palettes.Length; i++)
                imageManager1.addPalette(t.palettes[i]);

            tileBehaviorPicker.init(new Bitmap[] { t.Map16Buffer }, 16);

            //FIXME
            //            graphicsEditor1.SaveGraphics += new GraphicsEditor.SaveGraphicsHandler(graphicsEditor1_SaveGraphics);

            descExists = ROM.UserInfo.descriptions.ContainsKey(TilesetID); //Fild in there are descriptions for the tileset
            deleteDescriptions.Visible = descExists; //Make the appropriate button visible
            createDescriptions.Visible = !descExists;
            tilesetObjectEditor1.descBox.Visible = descExists; //Hide or show the description text box
            tilesetObjectEditor1.descLbl.Visible = descExists;
            if (descExists) {
                descriptions = ROM.UserInfo.descriptions[TilesetID]; //Get the descriptions
                tilesetObjectEditor1.descBox.Text = descriptions[0]; //Fill the description box with that of the first object
            }
            this.Icon = Properties.Resources.nsmbe;
        }
            public ObjectDef(NSMBTileset t)
            {
                this.t = t;
                tiles  = new List <List <ObjectDefTile> >();
                List <ObjectDefTile> row = new List <ObjectDefTile>();

                tiles.Add(row);
            }
Beispiel #6
0
 public void SetTileset(NSMBTileset t)
 {
     this.t           = t;
     tileCount        = t.Map16Buffer.Width / 16;
     map16Image       = Image2D.CutImage(t.Map16Buffer, 256, 1);
     pictureBox1.Size = map16Image.Size;
     pictureBox1.Invalidate(true);
 }
Beispiel #7
0
 public void SetTileset(NSMBTileset t)
 {
     this.t = t;
     tileCount = t.Map16Buffer.Width / 16;
     map16Image = Image2D.CutImage(t.Map16Buffer, 256, 1);
     pictureBox1.Size = map16Image.Size;
     pictureBox1.Invalidate(true);
 }
Beispiel #8
0
        public override void save()
        {
            ByteArrayOutputStream oo = new ByteArrayOutputStream();

            for (int i = 0; i < pal.Length; i++)
            {
                oo.writeUShort(NSMBTileset.toRGB15(pal[i]));
            }

            f.replace(oo.getArray(), this);
        }
Beispiel #9
0
        public static Color[] arrayToPalette(byte[] data)
        {
            ByteArrayInputStream ii = new ByteArrayInputStream(data);

            Color[] pal = new Color[data.Length / 2];
            for (int i = 0; i < pal.Length; i++)
            {
                pal[i] = NSMBTileset.fromRGB15(ii.readUShort());
            }
            return(pal);
        }
Beispiel #10
0
        public void LoadTileset1(ushort TilesetID)
        {
            File GFXFile          = ROM.FS.getFileById(ROM.GetFileIDFromTable(TilesetID, ROM.Data.Table_TS_NCG));
            File PalFile          = ROM.FS.getFileById(ROM.GetFileIDFromTable(TilesetID, ROM.Data.Table_TS_NCL));
            File Map16File        = ROM.FS.getFileById(ROM.GetFileIDFromTable(TilesetID, ROM.Data.Table_TS_PNL));
            File ObjFile          = ROM.FS.getFileById(ROM.GetFileIDFromTable(TilesetID, ROM.Data.Table_TS_UNT));
            File ObjIndexFile     = ROM.FS.getFileById(ROM.GetFileIDFromTable(TilesetID, ROM.Data.Table_TS_UNT_HD));
            File TileBehaviorFile = ROM.FS.getFileById(ROM.GetFileIDFromTable(TilesetID, ROM.Data.Table_TS_CHK));

            Tilesets[1] = new NSMBTileset(GFXFile, PalFile, Map16File, ObjFile, ObjIndexFile, TileBehaviorFile, false, 1);
        }
        public override byte[] getRawData()
        {
            ByteArrayOutputStream oo = new ByteArrayOutputStream();

            for (int i = 0; i < pal.Length; i++)
            {
                oo.writeUShort(NSMBTileset.toRGB15(pal[i]));
            }

            return(oo.getArray());
        }
Beispiel #12
0
        public void LoadTileset1(ushort TilesetID)
        {
            File GFXFile =          ROM.FS.getFileById(ROM.GetFileIDFromTable(TilesetID, ROM.Data.Table_TS_NCG   ));
            File PalFile =          ROM.FS.getFileById(ROM.GetFileIDFromTable(TilesetID, ROM.Data.Table_TS_NCL   ));
            File Map16File =        ROM.FS.getFileById(ROM.GetFileIDFromTable(TilesetID, ROM.Data.Table_TS_PNL   ));
            File ObjFile =          ROM.FS.getFileById(ROM.GetFileIDFromTable(TilesetID, ROM.Data.Table_TS_UNT   ));
            File ObjIndexFile =     ROM.FS.getFileById(ROM.GetFileIDFromTable(TilesetID, ROM.Data.Table_TS_UNT_HD));
            File TileBehaviorFile = ROM.FS.getFileById(ROM.GetFileIDFromTable(TilesetID, ROM.Data.Table_TS_CHK   ));

            Tilesets[1] = new NSMBTileset(GFXFile, PalFile, Map16File, ObjFile, ObjIndexFile, TileBehaviorFile, false, 1);
        }
Beispiel #13
0
        private void exportTilesetBtn_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.Filter = "NMT Files|*.nmt";
            if (sfd.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            NSMBTileset t = loadTileset(getSelectedID());

            t.exportTileset(sfd.FileName);
        }
        private void exportTilesetBtn_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.Filter = LanguageManager.Get("Filters", "tileset");
            if (sfd.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            NSMBTileset t = loadTileset(getSelectedID());

            t.exportTileset(sfd.FileName);
        }
        private void importTilesetBtn_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter          = LanguageManager.Get("Filters", "tileset");
            ofd.CheckFileExists = true;

            if (ofd.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            NSMBTileset t = loadTileset(getSelectedID());

            t.importTileset(ofd.FileName);
        }
Beispiel #16
0
 public void load(NSMBTileset t)
 {
     this.t = t;
     map16Picker1.SetTileset(t);
     tilePicker1.SetTileset(t);
 }
        private void selectTile(NSMBTileset.ObjectDefTile tile)
        {
            selTile = tile;
            DataUpdateFlag = true;
            map16Tile.Value = selTile.tileID;
            controlByte.Value = selTile.controlByte;
            //            map16Picker1.selectTile(selTile.tileID);
            groupBox1.Visible = selTile != null;

            DataUpdateFlag = false;
        }
        private void insertTile(NSMBTileset.ObjectDefTile tile)
        {
            if (selRow == null)
                return;
            if (selTile == null)
                selRow.Insert(0, tile);
            else
                selRow.Insert(selRow.IndexOf(selTile) + 1, tile);

            selectTile(tile);
            repaint();
        }
Beispiel #19
0
        public void LoadTilesets(ushort TilesetID, int JyotyuPalOverride)
        {
            Tilesets = new NSMBTileset[3];

            Console.WriteLine("JyotyuPalOverride = {0}, JyotyuPal offset = {1}...", JyotyuPalOverride, ROM.Overlay0[ROM.GetOffset(ROM.Data.Table_Jyotyu_NCL) + JyotyuPalOverride]);

            byte JyotyuPalID   = ROM.Overlay0[ROM.GetOffset(ROM.Data.Table_Jyotyu_NCL) + JyotyuPalOverride];
            File JyotyuPalFile = null;

            if (JyotyuPalID == 1)
            {
                JyotyuPalFile = ROM.FS.getFileByName("d_2d_A_J_jyotyu_B_ncl.bin");
            }
            else if (JyotyuPalID == 2)
            {
                JyotyuPalFile = ROM.FS.getFileByName("d_2d_A_J_jyotyu_R_ncl.bin");
            }
            else if (JyotyuPalID == 3)
            {
                JyotyuPalFile = ROM.FS.getFileByName("d_2d_A_J_jyotyu_W_ncl.bin");
            }
            else
            {
                JyotyuPalFile = ROM.FS.getFileByName("d_2d_A_J_jyotyu_ncl.bin");
            }

            Tilesets[0] = new NSMBTileset(
                ROM.FS.getFileByName("d_2d_A_J_jyotyu_ncg.bin"),
                JyotyuPalFile,
                ROM.FS.getFileByName("d_2d_PA_A_J_jyotyu.bin"),
                ROM.FS.getFileByName("A_J_jyotyu.bin"),
                ROM.FS.getFileByName("A_J_jyotyu_hd.bin"),
                null, true, 0);

            LoadTileset1(TilesetID);

            Tilesets[2] = new NSMBTileset(
                ROM.FS.getFileByName("d_2d_I_S_tikei_nohara_ncg.bin"),
                ROM.FS.getFileByName("d_2d_I_S_tikei_nohara_ncl.bin"),
                ROM.FS.getFileByName("d_2d_PA_I_S_nohara.bin"),
                ROM.FS.getFileByName("I_S_nohara.bin"),
                ROM.FS.getFileByName("I_S_nohara_hd.bin"),
                ROM.FS.getFileByName("NoHaRaSubUnitChangeData.bin"), false, 2);

            // Patch in a bunch of overrides to the normal tileset
            // Now works directly on the map16 data
            Tilesets[0].UseOverrides   = true;
            Tilesets[0].Overrides[36]  = 135;
            Tilesets[0].Overrides[112] = 26;
            Tilesets[0].Overrides[113] = 27;
            Tilesets[0].Overrides[114] = 53;
            Tilesets[0].Overrides[115] = 55;
            Tilesets[0].Overrides[116] = 28;
            Tilesets[0].Overrides[117] = 57;
            Tilesets[0].Overrides[118] = 0;
            Tilesets[0].Overrides[119] = 1;
            Tilesets[0].Overrides[120] = 4;
            Tilesets[0].Overrides[121] = 5;
            Tilesets[0].Overrides[122] = 30;
            Tilesets[0].Overrides[123] = 31;
            Tilesets[0].Overrides[124] = 8;
            Tilesets[0].Overrides[125] = 9;
            Tilesets[0].Overrides[126] = 20;
            Tilesets[0].Overrides[127] = 21;
            Tilesets[0].Overrides[128] = 24;
            Tilesets[0].Overrides[129] = 25;
            Tilesets[0].Overrides[132] = 29;
            Tilesets[0].Overrides[130] = 54;
            Tilesets[0].Overrides[131] = 56;
            Tilesets[0].Overrides[133] = 58;
            Tilesets[0].Overrides[134] = 2;
            Tilesets[0].Overrides[135] = 3;
            Tilesets[0].Overrides[136] = 6;
            Tilesets[0].Overrides[137] = 7;
            Tilesets[0].Overrides[138] = 12;
            Tilesets[0].Overrides[139] = 13;
            Tilesets[0].Overrides[140] = 10;
            Tilesets[0].Overrides[141] = 11;
            Tilesets[0].Overrides[142] = 22;
            Tilesets[0].Overrides[143] = 23;
            Tilesets[0].Overrides[145] = 32;
            Tilesets[0].Overrides[146] = 19;
            Tilesets[0].Overrides[147] = 17;
            Tilesets[0].Overrides[148] = 18;
            Tilesets[0].Overrides[149] = 14;
            Tilesets[0].Overrides[150] = 22;
            Tilesets[0].Overrides[151] = 23;
            Tilesets[0].Overrides[152] = 71;
            Tilesets[0].Overrides[153] = 72;
            Tilesets[0].Overrides[154] = 15;
            Tilesets[0].Overrides[155] = 16;
            Tilesets[0].Overrides[156] = 20;
            Tilesets[0].Overrides[157] = 21;
            Tilesets[0].Overrides[158] = 28;
            Tilesets[0].Overrides[159] = 29;
            Tilesets[0].Overrides[160] = 71;
            Tilesets[0].Overrides[161] = 72;
            Tilesets[0].Overrides[171] = 53;
            Tilesets[0].Overrides[172] = 57;
            Tilesets[0].Overrides[173] = 55;
            Tilesets[0].Overrides[174] = 26;
            Tilesets[0].Overrides[175] = 27;
            Tilesets[0].Overrides[187] = 54;
            Tilesets[0].Overrides[188] = 58;
            Tilesets[0].Overrides[189] = 56;
            Tilesets[0].Overrides[190] = 24;
            Tilesets[0].Overrides[191] = 25;
            Tilesets[0].Overrides[192] = 59;
            Tilesets[0].Overrides[193] = 63;
            Tilesets[0].Overrides[194] = 61;
            Tilesets[0].Overrides[195] = 65;
            Tilesets[0].Overrides[196] = 69;
            Tilesets[0].Overrides[197] = 67;
            Tilesets[0].Overrides[198] = 33;
            Tilesets[0].Overrides[199] = 34;
            Tilesets[0].Overrides[200] = 41;
            Tilesets[0].Overrides[201] = 42;
            Tilesets[0].Overrides[202] = 37;
            Tilesets[0].Overrides[203] = 38;
            Tilesets[0].Overrides[204] = 47;
            Tilesets[0].Overrides[205] = 48;
            Tilesets[0].Overrides[206] = 51;
            Tilesets[0].Overrides[207] = 52;
            Tilesets[0].Overrides[208] = 60;
            Tilesets[0].Overrides[209] = 64;
            Tilesets[0].Overrides[210] = 62;
            Tilesets[0].Overrides[211] = 66;
            Tilesets[0].Overrides[212] = 70;
            Tilesets[0].Overrides[213] = 68;
            Tilesets[0].Overrides[214] = 35;
            Tilesets[0].Overrides[215] = 36;
            Tilesets[0].Overrides[216] = 43;
            Tilesets[0].Overrides[217] = 44;
            Tilesets[0].Overrides[218] = 39;
            Tilesets[0].Overrides[219] = 40;
            Tilesets[0].Overrides[220] = 49;
            Tilesets[0].Overrides[221] = 50;
            Tilesets[0].Overrides[222] = 45;
            Tilesets[0].Overrides[223] = 46;
            Tilesets[0].Overrides[228] = 41;
            Tilesets[0].Overrides[229] = 42;
            Tilesets[0].Overrides[230] = 45;
            Tilesets[0].Overrides[231] = 65;
            Tilesets[0].Overrides[232] = 69;
            Tilesets[0].Overrides[233] = 67;
            Tilesets[0].Overrides[234] = 47;
            Tilesets[0].Overrides[235] = 48;
            Tilesets[0].Overrides[236] = 52;
            Tilesets[0].Overrides[237] = 59;
            Tilesets[0].Overrides[238] = 63;
            Tilesets[0].Overrides[239] = 61;
            Tilesets[0].Overrides[244] = 43;
            Tilesets[0].Overrides[245] = 44;
            Tilesets[0].Overrides[246] = 46;
            Tilesets[0].Overrides[247] = 66;
            Tilesets[0].Overrides[248] = 70;
            Tilesets[0].Overrides[249] = 68;
            Tilesets[0].Overrides[250] = 49;
            Tilesets[0].Overrides[251] = 50;
            Tilesets[0].Overrides[252] = 51;
            Tilesets[0].Overrides[253] = 60;
            Tilesets[0].Overrides[254] = 64;
            Tilesets[0].Overrides[255] = 62;
//            Tilesets[0].repaintAllMap16();

            RepatchBlocks(Properties.Settings.Default.SmallBlockOverlays);

            // Enable notes for the normal tileset
            Tilesets[0].UseNotes = true;
            if (ROM.UserInfo.descriptions.ContainsKey(65535))
            {
                Tilesets[0].ObjNotes = ROM.UserInfo.descriptions[65535].ToArray();
            }
            else
            {
                Tilesets[0].ObjNotes = GetDescriptions(LanguageManager.GetList("ObjNotes"));
            }
            if (ROM.UserInfo.descriptions.ContainsKey(TilesetID))
            {
                Tilesets[1].ObjNotes = ROM.UserInfo.descriptions[TilesetID].ToArray();;
                Tilesets[1].UseNotes = true;
            }
            if (ROM.UserInfo.descriptions.ContainsKey(65534))
            {
                Tilesets[2].ObjNotes = ROM.UserInfo.descriptions[65534].ToArray();
                Tilesets[2].UseNotes = true;
            }
        }
Beispiel #20
0
 public void SetTileset(NSMBTileset t)
 {
 }
 public ObjectDefTile(NSMBTileset t)
 {
     this.t = t;
 }
 public ObjectDef(byte[] data, NSMBTileset t)
 {
     this.t = t;
     load(new ByteArrayInputStream(data));
 }
Beispiel #23
0
        private void importPNGButton_Click(object sender, EventArgs e)
        {
            getFiles();

            if (GFXFile == null)
            {
                return;
            }
            if (PalFile == null)
            {
                return;
            }
            if (LayoutFile == null)
            {
                return;
            }

            int offs    = bg.topLayer ? 256 : 576;
            int palOffs = bg.topLayer ? 8 : 10;

            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter          = LanguageManager.Get("Filters", "png");
            ofd.CheckFileExists = true;

            if (ofd.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            string filename = ofd.FileName;

            Bitmap b = new Bitmap(filename);

            ImageTiler ti = new ImageTiler(b);

            Color[] palette = ImageIndexer.createPaletteForImage(b);

            ByteArrayOutputStream oo = new ByteArrayOutputStream();

            for (int i = 0; i < palette.Length; i++)
            {
                oo.writeUShort(NSMBTileset.toRGB15(palette[i]));
            }
            for (int i = 0; i < 256; i++)
            {
                oo.writeUShort(0);
            }

            PalFile.beginEdit(this);
            PalFile.replace(ROM.LZ77_Compress(oo.getArray()), this);
            PalFile.endEdit(this);
            GFXFile.beginEdit(this);
            GFXFile.replace(ROM.LZ77_Compress(ImageIndexer.indexImageWithPalette(ti.tileBuffer, palette)), this);
            GFXFile.endEdit(this);
            b.Dispose();

            ByteArrayOutputStream layout = new ByteArrayOutputStream();

            for (int y = 0; y < 64; y++)
            {
                for (int x = 0; x < 64; x++)
                {
                    layout.writeUShort((ushort)((ti.tileMap[x, y] + offs) | (palOffs << 12)));
                }
            }

            LayoutFile.beginEdit(this);
            LayoutFile.replace(ROM.LZ77_Compress(layout.getArray()), this);
            LayoutFile.endEdit(this);
        }
Beispiel #24
0
        public TilesetEditor(ushort TilesetID, string tilesetName)
        {
            InitializeComponent();
            if (Properties.Settings.Default.mdi)
            {
                this.MdiParent = MdiParentForm.instance;
            }
            LanguageManager.ApplyToContainer(this, "TilesetEditor");
            savePNG.Filter     = LanguageManager.Get("Filters", "png");
            openPNG.Filter     = LanguageManager.Get("Filters", "png");
            saveTileset.Filter = LanguageManager.Get("Filters", "tileset");
            openTileset.Filter = LanguageManager.Get("Filters", "tileset");

            Text = string.Format(LanguageManager.Get("TilesetEditor", "_TITLE"), tilesetName);

            g = new NSMBGraphics();

            this.TilesetID = TilesetID;
            if (TilesetID == 65535)
            {
                // load Jyotyu
                g.LoadTilesets(0);
                TilesetNumber = 0;
            }
            else if (TilesetID == 65534)
            {
                // load Nohara_sub
                g.LoadTilesets(2);
                TilesetNumber = 2;
            }
            else
            {
                // load a normal tileset
                g.LoadTilesets(TilesetID);
                TilesetNumber = 1;
            }

            t = g.Tilesets[TilesetNumber];
            t.beginEdit();

            objectPickerControl1.Initialise(g);
            objectPickerControl1.CurrentTileset = TilesetNumber;

            tilesetObjectEditor1.load(g, TilesetNumber);
            tilemapEditor1.load(t.map16);

            imageManager1.addImage(t.graphics);

            for (int i = 0; i < t.palettes.Length; i++)
            {
                imageManager1.addPalette(t.palettes[i]);
            }

            tileBehaviorPicker.init(new Bitmap[] { t.Map16Buffer }, 16);

            //FIXME
//            graphicsEditor1.SaveGraphics += new GraphicsEditor.SaveGraphicsHandler(graphicsEditor1_SaveGraphics);

            descExists = ROM.UserInfo.descriptions.ContainsKey(TilesetID); //Fild in there are descriptions for the tileset
            deleteDescriptions.Visible           = descExists;             //Make the appropriate button visible
            createDescriptions.Visible           = !descExists;
            tilesetObjectEditor1.descBox.Visible = descExists;             //Hide or show the description text box
            tilesetObjectEditor1.descLbl.Visible = descExists;
            if (descExists)
            {
                descriptions = ROM.UserInfo.descriptions[TilesetID]; //Get the descriptions
                tilesetObjectEditor1.descBox.Text = descriptions[0]; //Fill the description box with that of the first object
            }
            this.Icon = Properties.Resources.nsmbe;
        }
Beispiel #25
0
            public ObjectDefTile(ByteArrayInputStream inp, NSMBTileset t)
            {
                this.t = t;
                if (inp.available < 1) //This should never happen. But sometimes, it does.
                {
                    controlByte = 0xFF; //Simulate object end.
                    return;
                }

                controlByte = inp.readByte();

                if (!controlTile)

                {
                    byte a, b;
                    a = inp.readByte();
                    b = inp.readByte();

                    tileID = a + ((b - t.ObjectDefTileOffset) << 8);

                    if ((controlByte & 64) != 0) //OVERRIDES
                        tileID += 768;
                    if (a == 0 && b == 0)
                        tileID = -1;
                }
            }
Beispiel #26
0
 public ObjectDefTile(NSMBTileset t)
 {
     this.t = t;
 }
Beispiel #27
0
        private void YFlipTile(NSMBTileset.Map16Tile t)
        {
            NSMBTileset.Map16Quarter aux = t.topLeft;
            t.topLeft = t.bottomLeft;
            t.bottomLeft = aux;

            aux = t.topRight;
            t.topRight = t.bottomRight;
            t.bottomRight = aux;

            t.bottomRight.yFlip = !t.bottomRight.yFlip;
            t.bottomLeft.yFlip = !t.topLeft.yFlip;
            t.topRight.yFlip = !t.topRight.yFlip;
            t.topLeft.yFlip = !t.topLeft.yFlip;
        }
Beispiel #28
0
 public void SetTileset(NSMBTileset t)
 {
 }
Beispiel #29
0
 public ObjectDef(NSMBTileset t)
 {
     this.t = t;
     tiles = new List<List<ObjectDefTile>>();
     List<ObjectDefTile> row = new List<ObjectDefTile>();
     tiles.Add(row);
 }
Beispiel #30
0
 public ObjectDef(byte[] data, NSMBTileset t)
 {
     this.t = t;
     load(new ByteArrayInputStream(data));
 }
Beispiel #31
0
        public void LoadTilesets(ushort TilesetID, int JyotyuPalOverride)
        {
            Tilesets = new NSMBTileset[3];

            Console.WriteLine("JyotyuPalOverride = {0}, JyotyuPal offset = {1}...", JyotyuPalOverride, ROM.Overlay0[ROM.GetOffset(ROM.Data.Table_Jyotyu_NCL) + JyotyuPalOverride]);

            byte JyotyuPalID = ROM.Overlay0[ROM.GetOffset(ROM.Data.Table_Jyotyu_NCL) + JyotyuPalOverride];
            File JyotyuPalFile = null;
            if (JyotyuPalID == 1)
                JyotyuPalFile = ROM.FS.getFileByName("d_2d_A_J_jyotyu_B_ncl.bin");
            else if (JyotyuPalID == 2)
                JyotyuPalFile = ROM.FS.getFileByName("d_2d_A_J_jyotyu_R_ncl.bin");
            else if (JyotyuPalID == 3)
                JyotyuPalFile = ROM.FS.getFileByName("d_2d_A_J_jyotyu_W_ncl.bin");
            else
                JyotyuPalFile = ROM.FS.getFileByName("d_2d_A_J_jyotyu_ncl.bin");

            Tilesets[0] = new NSMBTileset(
                ROM.FS.getFileByName("d_2d_A_J_jyotyu_ncg.bin"),
                JyotyuPalFile,
                ROM.FS.getFileByName("d_2d_PA_A_J_jyotyu.bin"),
                ROM.FS.getFileByName("A_J_jyotyu.bin"),
                ROM.FS.getFileByName("A_J_jyotyu_hd.bin"),
                null, true, 0);

            LoadTileset1(TilesetID);

            Tilesets[2] = new NSMBTileset(
                ROM.FS.getFileByName("d_2d_I_S_tikei_nohara_ncg.bin"),
                ROM.FS.getFileByName("d_2d_I_S_tikei_nohara_ncl.bin"),
                ROM.FS.getFileByName("d_2d_PA_I_S_nohara.bin"),
                ROM.FS.getFileByName("I_S_nohara.bin"),
                ROM.FS.getFileByName("I_S_nohara_hd.bin"),
                ROM.FS.getFileByName("NoHaRaSubUnitChangeData.bin"), false, 2);

            // Patch in a bunch of overrides to the normal tileset
            // Now works directly on the map16 data
            Tilesets[0].UseOverrides = true;
            Tilesets[0].Overrides[36] = 135;
            Tilesets[0].Overrides[112] = 26;
            Tilesets[0].Overrides[113] = 27;
            Tilesets[0].Overrides[114] = 53;
            Tilesets[0].Overrides[115] = 55;
            Tilesets[0].Overrides[116] = 28;
            Tilesets[0].Overrides[117] = 57;
            Tilesets[0].Overrides[118] = 0;
            Tilesets[0].Overrides[119] = 1;
            Tilesets[0].Overrides[120] = 4;
            Tilesets[0].Overrides[121] = 5;
            Tilesets[0].Overrides[122] = 30;
            Tilesets[0].Overrides[123] = 31;
            Tilesets[0].Overrides[124] = 8;
            Tilesets[0].Overrides[125] = 9;
            Tilesets[0].Overrides[126] = 20;
            Tilesets[0].Overrides[127] = 21;
            Tilesets[0].Overrides[128] = 24;
            Tilesets[0].Overrides[129] = 25;
            Tilesets[0].Overrides[132] = 29;
            Tilesets[0].Overrides[130] = 54;
            Tilesets[0].Overrides[131] = 56;
            Tilesets[0].Overrides[133] = 58;
            Tilesets[0].Overrides[134] = 2;
            Tilesets[0].Overrides[135] = 3;
            Tilesets[0].Overrides[136] = 6;
            Tilesets[0].Overrides[137] = 7;
            Tilesets[0].Overrides[138] = 12;
            Tilesets[0].Overrides[139] = 13;
            Tilesets[0].Overrides[140] = 10;
            Tilesets[0].Overrides[141] = 11;
            Tilesets[0].Overrides[142] = 22;
            Tilesets[0].Overrides[143] = 23;
            Tilesets[0].Overrides[145] = 32;
            Tilesets[0].Overrides[146] = 19;
            Tilesets[0].Overrides[147] = 17;
            Tilesets[0].Overrides[148] = 18;
            Tilesets[0].Overrides[149] = 14;
            Tilesets[0].Overrides[150] = 22;
            Tilesets[0].Overrides[151] = 23;
            Tilesets[0].Overrides[152] = 71;
            Tilesets[0].Overrides[153] = 72;
            Tilesets[0].Overrides[154] = 15;
            Tilesets[0].Overrides[155] = 16;
            Tilesets[0].Overrides[156] = 20;
            Tilesets[0].Overrides[157] = 21;
            Tilesets[0].Overrides[158] = 28;
            Tilesets[0].Overrides[159] = 29;
            Tilesets[0].Overrides[160] = 71;
            Tilesets[0].Overrides[161] = 72;
            Tilesets[0].Overrides[171] = 53;
            Tilesets[0].Overrides[172] = 57;
            Tilesets[0].Overrides[173] = 55;
            Tilesets[0].Overrides[174] = 26;
            Tilesets[0].Overrides[175] = 27;
            Tilesets[0].Overrides[187] = 54;
            Tilesets[0].Overrides[188] = 58;
            Tilesets[0].Overrides[189] = 56;
            Tilesets[0].Overrides[190] = 24;
            Tilesets[0].Overrides[191] = 25;
            Tilesets[0].Overrides[192] = 59;
            Tilesets[0].Overrides[193] = 63;
            Tilesets[0].Overrides[194] = 61;
            Tilesets[0].Overrides[195] = 65;
            Tilesets[0].Overrides[196] = 69;
            Tilesets[0].Overrides[197] = 67;
            Tilesets[0].Overrides[198] = 33;
            Tilesets[0].Overrides[199] = 34;
            Tilesets[0].Overrides[200] = 41;
            Tilesets[0].Overrides[201] = 42;
            Tilesets[0].Overrides[202] = 37;
            Tilesets[0].Overrides[203] = 38;
            Tilesets[0].Overrides[204] = 47;
            Tilesets[0].Overrides[205] = 48;
            Tilesets[0].Overrides[206] = 51;
            Tilesets[0].Overrides[207] = 52;
            Tilesets[0].Overrides[208] = 60;
            Tilesets[0].Overrides[209] = 64;
            Tilesets[0].Overrides[210] = 62;
            Tilesets[0].Overrides[211] = 66;
            Tilesets[0].Overrides[212] = 70;
            Tilesets[0].Overrides[213] = 68;
            Tilesets[0].Overrides[214] = 35;
            Tilesets[0].Overrides[215] = 36;
            Tilesets[0].Overrides[216] = 43;
            Tilesets[0].Overrides[217] = 44;
            Tilesets[0].Overrides[218] = 39;
            Tilesets[0].Overrides[219] = 40;
            Tilesets[0].Overrides[220] = 49;
            Tilesets[0].Overrides[221] = 50;
            Tilesets[0].Overrides[222] = 45;
            Tilesets[0].Overrides[223] = 46;
            Tilesets[0].Overrides[228] = 41;
            Tilesets[0].Overrides[229] = 42;
            Tilesets[0].Overrides[230] = 45;
            Tilesets[0].Overrides[231] = 65;
            Tilesets[0].Overrides[232] = 69;
            Tilesets[0].Overrides[233] = 67;
            Tilesets[0].Overrides[234] = 47;
            Tilesets[0].Overrides[235] = 48;
            Tilesets[0].Overrides[236] = 52;
            Tilesets[0].Overrides[237] = 59;
            Tilesets[0].Overrides[238] = 63;
            Tilesets[0].Overrides[239] = 61;
            Tilesets[0].Overrides[244] = 43;
            Tilesets[0].Overrides[245] = 44;
            Tilesets[0].Overrides[246] = 46;
            Tilesets[0].Overrides[247] = 66;
            Tilesets[0].Overrides[248] = 70;
            Tilesets[0].Overrides[249] = 68;
            Tilesets[0].Overrides[250] = 49;
            Tilesets[0].Overrides[251] = 50;
            Tilesets[0].Overrides[252] = 51;
            Tilesets[0].Overrides[253] = 60;
            Tilesets[0].Overrides[254] = 64;
            Tilesets[0].Overrides[255] = 62;
            //            Tilesets[0].repaintAllMap16();

            RepatchBlocks(Properties.Settings.Default.SmallBlockOverlays);

            // Enable notes for the normal tileset
            Tilesets[0].UseNotes = true;
            if (ROM.UserInfo.descriptions.ContainsKey(65535))
                Tilesets[0].ObjNotes = ROM.UserInfo.descriptions[65535].ToArray();
            else
                Tilesets[0].ObjNotes = GetDescriptions(LanguageManager.GetList("ObjNotes"));
            if (ROM.UserInfo.descriptions.ContainsKey(TilesetID)) {
                Tilesets[1].ObjNotes = ROM.UserInfo.descriptions[TilesetID].ToArray(); ;
                Tilesets[1].UseNotes = true;
            }
            if (ROM.UserInfo.descriptions.ContainsKey(65534)) {
                Tilesets[2].ObjNotes = ROM.UserInfo.descriptions[65534].ToArray();
                Tilesets[2].UseNotes = true;
            }
        }
Beispiel #32
0
 public void load(NSMBTileset t)
 {
     this.t = t;
     map16Picker1.SetTileset(t);
     tilePicker1.SetTileset(t);
 }