Пример #1
0
 internal CharacterSprite(PatcherLib.Datatypes.Context context, string name, SpriteAttributes attributes, SpriteLocation location) :
     base(context, name,
          context == PatcherLib.Datatypes.Context.US_PSP ? (PatcherLib.Iso.KnownPosition) new PatcherLib.Iso.PspIso.KnownPosition((PatcherLib.Iso.FFTPack.Files)location.Sector, 0, (int)location.Size) :
          (PatcherLib.Iso.KnownPosition) new PatcherLib.Iso.PsxIso.KnownPosition((PatcherLib.Iso.PsxIso.Sectors)location.Sector, 0, (int)location.Size))
 {
     this.location   = location;
     this.attributes = attributes;
 }
Пример #2
0
 internal CharacterSprite(PatcherLib.Datatypes.Context context, string name, SpriteAttributes attributes, SpriteLocation location)
     : base(context, name,
         context == PatcherLib.Datatypes.Context.US_PSP ? (PatcherLib.Iso.KnownPosition)new PatcherLib.Iso.PspIso.KnownPosition((PatcherLib.Iso.FFTPack.Files)location.Sector, 0, (int)location.Size) :
                                                          (PatcherLib.Iso.KnownPosition)new PatcherLib.Iso.PsxIso.KnownPosition((PatcherLib.Iso.PsxIso.Sectors)location.Sector, 0, (int)location.Size))
 {
     this.location = location;
     this.attributes = attributes;
 }
Пример #3
0
 public static AllSpriteAttributes FromPsxIso(Stream iso)
 {
     byte[] bytes = PatcherLib.Iso.PsxIso.ReadFile(iso, psxPos);
     AllSpriteAttributes result = new AllSpriteAttributes();
     IList<SpriteAttributes> sprites = new SpriteAttributes[numPsxSprites];
     for (int i = 0; i < numPsxSprites; i++)
     {
         sprites[i] = SpriteAttributes.BuildPsx(
             new PatcherLib.Iso.PsxIso.KnownPosition(psxPos.Sector, psxPos.StartLocation + i * 4, 4),
             bytes.Sub(i * 4, (i + 1) * 4 - 1));
     }
     result.sprites = sprites;
     result.Count = numPsxSprites;
     return result;
 }
Пример #4
0
        public static AllSpriteAttributes FromPsxIso(Stream iso)
        {
            byte[] bytes = PatcherLib.Iso.PsxIso.ReadFile(iso, psxPos);
            AllSpriteAttributes      result  = new AllSpriteAttributes();
            IList <SpriteAttributes> sprites = new SpriteAttributes[numPsxSprites];

            for (int i = 0; i < numPsxSprites; i++)
            {
                sprites[i] = SpriteAttributes.BuildPsx(
                    new PatcherLib.Iso.PsxIso.KnownPosition(psxPos.Sector, psxPos.StartLocation + i * 4, 4),
                    bytes.Sub(i * 4, (i + 1) * 4 - 1));
            }
            result.sprites = sprites;
            result.Count   = numPsxSprites;
            return(result);
        }
        public static AllSpriteAttributes FromPspIso(Stream iso, PatcherLib.Iso.PspIso.PspIsoInfo info)
        {
            IList <byte> bytes = PatcherLib.Iso.PspIso.GetBlock(iso, info, pspPos);
            //List<byte> realBytes = new List<byte>(bytes.Sub(0, numPsxSprites * 4 - 1));
            //realBytes.AddRange(bytes.Sub(numPsxSprites * 4 + (4 * 4)));
            //bytes = realBytes.AsReadOnly();
            AllSpriteAttributes      result  = new AllSpriteAttributes();
            IList <SpriteAttributes> sprites = new SpriteAttributes[numPspSprites];

            for (int i = 0; i < numPspSprites; i++)
            {
                sprites[i] = SpriteAttributes.BuildPsp(
                    new PatcherLib.Iso.PspIso.KnownPosition(pspPos.Sector.Value, pspPos.StartLocation + i * 4, 4),
                    info,
                    bytes.Sub(i * 4, (i + 1) * 4 - 1));
            }
            result.sprites = sprites;
            result.Count   = numPspSprites;
            return(result);
        }
Пример #6
0
        public static AllSpriteAttributes FromPspIso(Stream iso, PatcherLib.Iso.PspIso.PspIsoInfo info)
        {
            IList<byte> bytes = PatcherLib.Iso.PspIso.GetBlock(iso, info, pspPos);
            List<byte> realBytes = new List<byte>(bytes.Sub(0, numPsxSprites * 4 - 1));
            realBytes.AddRange(bytes.Sub(numPsxSprites * 4 + (4 * 4)));
            bytes = realBytes.AsReadOnly();
            AllSpriteAttributes result = new AllSpriteAttributes();
            IList<SpriteAttributes> sprites = new SpriteAttributes[numPspSprites];
            for (int i = 0; i < numPspSprites; i++)
            {
                sprites[i] = SpriteAttributes.BuildPsp(
                    new PatcherLib.Iso.PspIso.KnownPosition(pspPos.Sector.Value, pspPos.StartLocation + i * 4, 4),
                    info,
                    bytes.Sub(i * 4, (i + 1) * 4 - 1));

            }
            result.sprites = sprites;
            result.Count = numPspSprites;
            return result;
        }