Ejemplo n.º 1
0
        protected StupidTM2Image Get8BitPalettedBitmap()
        {
            PatcherLib.Iso.KnownPosition newPalettePosition = PalettePosition.AddOffset(CurrentPalette * PalettePosition.Length, PalettePosition.Length * 15);
            StupidTM2Image image = new StupidTM2Image(Name, Width, Height, newPalettePosition, PixelPositions.ToArray());

            image.ImportFilename = ImportFilename;
            return(image);
        }
Ejemplo n.º 2
0
        protected void SaveImage8bpp(System.IO.Stream iso, System.IO.Stream output, StupidTM2Image image8bpp = null)
        {
            if (image8bpp == null)
            {
                image8bpp = Get8BitPalettedBitmap();
            }

            image8bpp.SaveImageSpecific(iso, output, true);
        }
Ejemplo n.º 3
0
        public static StupidTM2Image ConstructFromXml(System.Xml.XmlNode node)
        {
            ImageInfo info   = GetImageInfo(node);
            var       palPos = GetPalettePositionFromImageNode(info.Sector, node);

            var posNodes = node.SelectNodes("Position");

            PatcherLib.Iso.KnownPosition   firstPosition = ParsePositionNode(info.Sector, posNodes[0]);
            PatcherLib.Iso.KnownPosition[] positions     = new PatcherLib.Iso.KnownPosition[posNodes.Count - 1];
            for (int i = 1; i < posNodes.Count; i++)
            {
                positions[i - 1] = ParsePositionNode(info.Sector, posNodes[i]);
            }

            StupidTM2Image image = new StupidTM2Image(info.Name, info.Width, info.Height, palPos, firstPosition, positions);

            image.OriginalFilename = info.OriginalFilename;
            image.Filesize         = info.Filesize;
            image.Sector           = info.Sector;

            return(image);
        }
Ejemplo n.º 4
0
        protected void WriteImageToIsoInner8bpp(System.IO.Stream iso, System.Drawing.Image image, StupidTM2Image image8bpp = null)
        {
            if (image8bpp == null)
            {
                image8bpp = Get8BitPalettedBitmap();
            }

            image8bpp.WriteImageToIsoInnerSpecific(iso, image, true);
        }
Ejemplo n.º 5
0
        protected void WriteImageToIsoInner8bpp(System.IO.Stream iso, System.Drawing.Image image, StupidTM2Image image8bpp = null)
        {
            if (image8bpp == null)
                image8bpp = Get8BitPalettedBitmap();

            image8bpp.WriteImageToIsoInnerSpecific(iso, image, true);
        }
Ejemplo n.º 6
0
        protected void SaveImage8bpp(System.IO.Stream iso, System.IO.Stream output, StupidTM2Image image8bpp = null)
        {
            if (image8bpp == null)
                image8bpp = Get8BitPalettedBitmap();

            image8bpp.SaveImageSpecific(iso, output, true);
        }
Ejemplo n.º 7
0
 protected StupidTM2Image Get8BitPalettedBitmap()
 {
     PatcherLib.Iso.KnownPosition newPalettePosition = PalettePosition.AddOffset(CurrentPalette * PalettePosition.Length, PalettePosition.Length * 15);
     StupidTM2Image image = new StupidTM2Image(Name, Width, Height, newPalettePosition, PixelPositions.ToArray());
     image.ImportFilename = ImportFilename;
     return image;
 }
Ejemplo n.º 8
0
        public static StupidTM2Image ConstructFromXml( System.Xml.XmlNode node )
        {
            ImageInfo info = GetImageInfo( node );
            var palPos = GetPalettePositionFromImageNode( info.Sector, node );

            var posNodes = node.SelectNodes( "Position" );
            PatcherLib.Iso.KnownPosition firstPosition = ParsePositionNode(info.Sector, posNodes[0]);
            PatcherLib.Iso.KnownPosition[] positions = new PatcherLib.Iso.KnownPosition[posNodes.Count-1];
            for ( int i = 1; i < posNodes.Count; i++ )
            {
                positions[i-1] = ParsePositionNode(info.Sector, posNodes[i]);
            }

            StupidTM2Image image = new StupidTM2Image( info.Name, info.Width, info.Height, palPos, firstPosition, positions );
            image.OriginalFilename = info.OriginalFilename;
            image.Filesize = info.Filesize;
            image.Sector = info.Sector;

            return image;
        }