示例#1
0
文件: LVD.cs 项目: struz/Smash-Forge
 public override void save(FileOutput f)
 {
     f.writeHex("010401017735BB750000000201");
     f.writeChars(name.PadRight(0x38).ToCharArray());
     f.writeByte(1);
     f.writeChars(subname.PadRight(0x40).ToCharArray());
     f.writeHex("0100000000000000000000000000010000000001000000000000000000000000FFFFFFFF010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001014C800203");
     f.writeInt(type);
     f.writeFloat(x);
     f.writeFloat(y);
     f.writeHex("0000000000000000010100000000");
 }
示例#2
0
        public void save(FileOutput f)
        {
            f.writeHex("0103");

            f.writeInt(type);
            f.writeFloat(x);
            f.writeFloat(y);
            f.writeFloat(z);
            f.writeFloat(unk);

            f.writeHex("0101");
            f.writeInt(0);
        }
示例#3
0
文件: LVD.cs 项目: struz/Smash-Forge
 public void save(FileOutput f)
 {
     f.writeHex("030401017735BB750000000201");
     f.writeString(name.PadRight(0x38, (char)0));
     f.writeByte(1);
     f.writeString(subname.PadRight(0x40, (char)0));
     f.writeByte(1);
     foreach (float i in startPos)
     {
         f.writeFloat(i);
     }
     f.writeFlag(useStartPos);
     f.writeByte(1);
     f.writeInt(unk2);
     f.writeByte(1);
     f.writeBytes(unk3);
     f.writeHex("FFFFFFFF01");
     f.writeChars(unk4);
     f.writeFlag(flag1);
     f.writeFlag(flag2);
     f.writeFlag(flag3);
     f.writeFlag(flag4);
     f.writeByte(1);
     f.writeInt(verts.Count);
     foreach (Vector2D v in verts)
     {
         f.writeByte(1);
         f.writeFloat(v.x);
         f.writeFloat(v.y);
     }
     f.writeByte(1);
     f.writeInt(normals.Count);
     foreach (Vector2D n in normals)
     {
         f.writeByte(1);
         f.writeFloat(n.x);
         f.writeFloat(n.y);
     }
     f.writeByte(1);
     f.writeInt(0);
     f.writeByte(1);
     f.writeInt(materials.Count);
     foreach (CollisionMat m in materials)
     {
         f.writeByte(1);
         f.writeBytes(m.material);
     }
 }
示例#4
0
        public void save(FileOutput f)
        {
            f.writeHex(magic);

            f.writeByte(1);
            f.writeString(name.PadRight(0x38, (char)0));

            f.writeByte(1);
            f.writeString(subname.PadRight(0x40, (char)0));

            f.writeByte(1);
            for (int i = 0; i < 3; i++)
            {
                f.writeFloat(startPos[i]);
            }
            f.writeFlag(useStartPos);

            f.writeByte(1);
            f.writeInt(unk1);

            f.writeByte(1);
            foreach (float i in unk2)
            {
                f.writeFloat(i);
            }
            f.writeInt(unk3);

            f.writeByte(1);
            f.writeChars(boneName);
        }
示例#5
0
        public void save(FileOutput f)
        {
            base.save(f);

            f.writeByte(1);
            f.writeInt(type);

            f.writeFloat(x);
            f.writeFloat(y);
            f.writeFloat(z);
            if (type == 2)
            {
                f.writeFloat(radius);
                f.writeFloat(dx);
                f.writeFloat(dy);
                f.writeFloat(dz);
            }
            else if (type == 3)
            {
                f.writeFloat(dx);
                f.writeFloat(dy);
                f.writeFloat(dz);
                f.writeFloat(radius);
            }
            f.writeFloat(unk);
            f.writeHex("00");
        }
示例#6
0
 private void injectRom(object sender, EventArgs e)
 {
     using (OpenFileDialog ofd = new OpenFileDialog())
     {
         ofd.Title = "Select NES ROM";
         if (ofd.ShowDialog() == DialogResult.OK)
         {
             using (SaveFileDialog sfd = new SaveFileDialog())
             {
                 sfd.Title = "Select Save Location";
                 if (sfd.ShowDialog() == DialogResult.OK)
                 {
                     byte[]     rom = File.ReadAllBytes(ofd.FileName);
                     FileOutput f   = new FileOutput();
                     f.Endian = Endianness.Little;
                     f.writeInt(0);
                     f.writeInt(0x30 + rom.Length);
                     f.writeInt(0x30);
                     f.writeInt(0x10 + rom.Length);
                     f.writeInt(0x30 + rom.Length);
                     f.writeInt(0);
                     f.writeInt(0x1B + rom.Length);
                     f.writeInt(0x1B + rom.Length);
                     f.writeString("JAM WAS HERE");
                     f.writeInt(0);
                     f.writeBytes(rom);
                     f.writeHex("3C00000000001000090002080000000100000000000000000000000000000000");
                     f.save(sfd.FileName);
                 }
             }
         }
     }
 }
示例#7
0
文件: LVD.cs 项目: struz/Smash-Forge
 public override void save(FileOutput f)
 {
     f.writeHex("010401017735BB750000000201");
     f.writeChars(name.PadRight(0x38).ToCharArray());
     f.writeByte(1);
     f.writeChars(subname.PadRight(0x40).ToCharArray());
     f.writeHex("0100000000000000000000000000010000000001000000000000000000000000FFFFFFFF010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001014C800203");
     f.writeInt(type);
     f.writeHex("000000000000000000000000000000000101");
     f.writeInt(points.Count);
     foreach (Vector2D point in points)
     {
         f.writeByte(1);
         f.writeFloat(point.x);
         f.writeFloat(point.y);
     }
 }
示例#8
0
文件: LVD.cs 项目: struz/Smash-Forge
 public void save(FileOutput f)
 {
     f.writeHex("010401017735BB750000000201");
     f.writeChars(name.PadRight(0x38, (char)0).ToCharArray());
     f.writeByte(1);
     f.writeChars(subname.PadRight(0x40, (char)0).ToCharArray());
     f.writeHex("0100000000000000000000000000010000000001000000000000000000000000FFFFFFFF010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001098400010101");
     f.writeInt(sections.Count);
     foreach (Section s in sections)
     {
         f.writeHex("010300000004000000000000000000000000000000000101");
         f.writeInt(s.points.Count);
         foreach (Vector2D p in s.points)
         {
             f.writeByte(1);
             f.writeFloat(p.x);
             f.writeFloat(p.y);
         }
     }
 }
示例#9
0
        public void save(FileOutput f)
        {
            base.save(f);

            f.writeHex("0101");
            f.writeInt(sections.Count);
            foreach (EnmSection temp in sections)
            {
                temp.save(f);
            }

            f.writeHex("0101");
            f.writeInt(sections2.Count);
            foreach (EnmSection temp in sections2)
            {
                temp.save(f);
            }

            f.writeHex("0101");
            f.writeInt(0);

            f.writeByte(1);
            f.writeInt(id);

            f.writeByte(1);
            f.writeInt(ids.Count);
            foreach (int temp in ids)
            {
                f.writeByte(1);
                f.writeInt(temp);
            }

            f.writeByte(1);
            f.writeInt(0);
            f.writeByte(1);
            f.writeInt(padCount);
            for (int i = 0; i < padCount; i++)
            {
                f.writeHex("0100000000");
            }
        }
示例#10
0
        public void save(FileOutput f)
        {
            base.save(f);

            f.writeByte(1);
            f.writeInt(type);

            f.writeFloat(x);
            f.writeFloat(y);
            f.writeFloat(z);
            f.writeHex("00000000000000000000000000000000");
        }
示例#11
0
        public void save(FileOutput f)
        {
            base.save(f);

            f.writeByte(1);
            f.writeHex("0984000101");

            f.writeByte(1);
            f.writeInt(sections.Count);
            foreach (Section s in sections)
            {
                s.save(f);
            }
        }
示例#12
0
        public void save(FileOutput f)
        {
            f.writeByte(1);
            f.writeHex("03000000040000000000000000000000000000000001");

            f.writeByte(1);
            f.writeInt(points.Count);
            foreach (Vector2D v in points)
            {
                f.writeByte(1);
                f.writeFloat(v.x);
                f.writeFloat(v.y);
            }
        }
示例#13
0
        public override byte[] Rebuild()
        {
            FileOutput file = new FileOutput();

            file.Endian = Endianness.Little;

            file.writeHex("53514200"); //SQB

            file.writeShort(unk1);
            file.writeShort(unk2);

            file.writeInt(sequences.Count);
            file.writeInt(sequences.Count * 0x4);

            int currentOffset = 0;

            for (int i = 0; i < sequences.Count; ++i)
            {
                if (sequences[i].empty)
                {
                    file.writeInt(-1);
                    continue;
                }
                file.writeInt(currentOffset);
                currentOffset += 0x8 + (0x10 * sequences[i].events.Count);
            }

            for (int i = 0; i < sequences.Count; ++i)
            {
                if (sequences[i].empty)
                {
                    continue;
                }
                sequences[i].Write(file);
            }

            return(file.getBytes());
        }
示例#14
0
        public override byte[] Rebuild()
        {
            FileOutput f = new FileOutput();

            f.Endian = Endianness.Big;

            f.writeHex("4C494748"); //LIGH
            f.writeInt(version);
            f.writeInt(frameCount);
            if (version == 5)
            {
                f.writeInt(frameDuration);
            }

            //Offsets
            int padding = 0;

            while ((((frameCount * 3) + padding) % 4) != 0) //All offsets must be multiples of 4 or the game won't use the file properly
            {
                padding++;
            }

            int[] offsets = new int[6];
            int   currOff = 0x24;

            if (version == 4)
            {
                currOff = 0x24;
            }
            else if (version == 5)
            {
                currOff = 0x28;
            }

            for (int i = 0; i < 5; i++)
            {
                offsets[i + 1] = (rgbProperties[i].enabled) ? currOff : 0x0;
                if (rgbProperties[i].enabled)
                {
                    currOff += (frameCount * 3) + padding;
                }
            }
            offsets[0] = currOff;

            for (int i = 0; i < 6; i++)
            {
                f.writeInt(offsets[i]);
            }

            //RGB properties
            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < frameCount; j++)
                {
                    for (int k = 0; k < 3; k++)
                    {
                        f.writeByte(rgbProperties[i].frames[j][k]);
                    }
                }

                for (int j = 0; j < padding; j++)
                {
                    f.writeByte(0);
                }
            }

            //Light data
            for (int i = 0; i < frameCount; i++)
            {
                for (int j = 0; j < 17; j++)
                {
                    for (int k = 0; k < 4; k++)
                    {
                        f.writeInt(lightFrames[i].lightSets[j].lights[k].enabled);
                        for (int l = 0; l < 3; l++)
                        {
                            f.writeFloat(lightFrames[i].lightSets[j].lights[k].angle[l]);
                        }
                        f.writeFloat(lightFrames[i].lightSets[j].lights[k].colorHue);
                        f.writeFloat(lightFrames[i].lightSets[j].lights[k].colorSat);
                        f.writeFloat(lightFrames[i].lightSets[j].lights[k].colorVal);
                    }
                    f.writeByte(lightFrames[i].lightSets[j].fog.unknown);
                    for (int k = 0; k < 3; k++)
                    {
                        f.writeByte(lightFrames[i].lightSets[j].fog.color[k]);
                    }
                }
                f.writeByte(lightFrames[i].effect.unknown);
                for (int j = 0; j < 3; j++)
                {
                    f.writeByte(lightFrames[i].effect.color[j]);
                }
                for (int j = 0; j < 3; j++)
                {
                    f.writeFloat(lightFrames[i].effect.position[j]);
                }
            }

            return(f.getBytes());
        }
示例#15
0
        public override byte[] Rebuild()
        {
            FileOutput f = new FileOutput();

            f.Endian = Endianness.Big;

            f.writeHex("000000010A014C564431");

            f.writeByte(1);
            f.writeInt(collisions.Count);
            foreach (Collision c in collisions)
            {
                c.save(f);
            }

            f.writeByte(1);
            f.writeInt(spawns.Count);
            foreach (Spawn s in spawns)
            {
                s.save(f);
            }

            f.writeByte(1);
            f.writeInt(respawns.Count);
            foreach (Spawn s in respawns)
            {
                s.save(f);
            }

            f.writeByte(1);
            f.writeInt(cameraBounds.Count);
            foreach (Bounds b in cameraBounds)
            {
                b.save(f);
            }

            f.writeByte(1);
            f.writeInt(blastzones.Count);
            foreach (Bounds b in blastzones)
            {
                b.save(f);
            }

            for (int i = 0; i < 6; i++)
            {
                f.writeByte(1);
                f.writeInt(0);
            }

            f.writeByte(1);
            f.writeInt(damageShapes.Count);
            foreach (DamageShape shape in damageShapes)
            {
                shape.save(f);
            }

            f.writeByte(1);
            f.writeInt(items.Count);
            foreach (ItemSpawner item in items)
            {
                item.save(f);
            }

            f.writeByte(1);
            f.writeInt(generalShapes.Count);
            foreach (GeneralShape shape in generalShapes)
            {
                shape.save(f);
            }

            f.writeByte(1);
            f.writeInt(generalPoints.Count);
            foreach (GeneralPoint p in generalPoints)
            {
                p.save(f);
            }

            for (int i = 0; i < 4; i++)
            {
                f.writeByte(1);
                f.writeInt(0);
            }

            return(f.getBytes());
        }
示例#16
0
文件: LVD.cs 项目: struz/Smash-Forge
        public override byte[] Rebuild()
        {
            FileOutput f = new FileOutput();

            f.Endian = Endianness.Big;

            f.writeHex("000000010A014C56443101");
            f.writeInt(collisions.Count);
            foreach (Collision c in collisions)
            {
                c.save(f);
            }
            f.writeByte(1);
            f.writeInt(spawns.Count);
            foreach (Point p in spawns)
            {
                f.writeHex("020401017735BB750000000201");
                f.writeString(p.name.PadRight(0x38, (char)0));
                f.writeByte(1);
                f.writeString(p.subname.PadRight(0x40, (char)0));
                f.writeByte(1);
                f.writeHex("00000000000000000000000000010000000001000000000000000000000000FFFFFFFF010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001");
                f.writeFloat(p.x);
                f.writeFloat(p.y);
            }
            f.writeByte(1);
            f.writeInt(respawns.Count);
            foreach (Point p in respawns)
            {
                f.writeHex("020401017735BB750000000201");
                f.writeString(p.name.PadRight(0x38, (char)0));
                f.writeByte(1);
                f.writeString(p.subname.PadRight(0x40, (char)0));
                f.writeByte(1);
                f.writeHex("00000000000000000000000000010000000001000000000000000000000000FFFFFFFF010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001");
                f.writeFloat(p.x);
                f.writeFloat(p.y);
            }
            f.writeByte(1);
            f.writeInt(cameraBounds.Count);
            foreach (Bounds b in cameraBounds)
            {
                f.writeHex("020401017735BB750000000201");
                f.writeString(b.name.PadRight(0x38, (char)0));
                f.writeByte(1);
                f.writeString(b.subname.PadRight(0x40, (char)0));
                f.writeByte(1);
                f.writeHex("00000000000000000000000000010000000001000000000000000000000000FFFFFFFF010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001");
                f.writeFloat(b.left);
                f.writeFloat(b.right);
                f.writeFloat(b.top);
                f.writeFloat(b.bottom);
            }
            f.writeByte(1);
            f.writeInt(blastzones.Count);
            foreach (Bounds b in blastzones)
            {
                f.writeHex("020401017735BB750000000201");
                f.writeString(b.name.PadRight(0x38, (char)0));
                f.writeByte(1);
                f.writeString(b.subname.PadRight(0x40, (char)0));
                f.writeByte(1);
                f.writeHex("00000000000000000000000000010000000001000000000000000000000000FFFFFFFF010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001");
                f.writeFloat(b.left);
                f.writeFloat(b.right);
                f.writeFloat(b.top);
                f.writeFloat(b.bottom);
            }

            for (int i = 0; i < 7; i++)
            {
                f.writeByte(1);
                f.writeInt(0);
            }

            f.writeByte(1);
            f.writeInt(items.Count);
            foreach (ItemSpawner item in items)
            {
                item.save(f);
            }

            f.writeByte(1);
            f.writeInt(generalShapes.Count);
            foreach (LVDGeneralShape shape in generalShapes)
            {
                shape.save(f);
            }


            f.writeByte(1);
            f.writeInt(generalPoints.Count);
            foreach (Point p in generalPoints)
            {
                f.writeHex("010401017735BB750000000201");
                f.writeChars(p.name.PadRight(0x38, (char)0).ToCharArray());
                f.writeByte(1);
                f.writeChars(p.subname.PadRight(0x40, (char)0).ToCharArray());
                f.writeByte(1);
                f.writeHex("00000000432100000000000000010000000001000000000000000000000000FFFFFFFF010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000100000004");
                f.writeFloat(p.x);
                f.writeFloat(p.y);
                f.writeBytes(new byte[0x14]);
            }

            for (int i = 0; i < 4; i++)
            {
                f.writeByte(1);
                f.writeInt(0);
            }

            return(f.getBytes());
        }