Ejemplo n.º 1
0
        public static void ReadRom(BackgroundWorker worker, byte[] rawData, MarioKart64ReaderResults finalResults)
        {
            TextureReaderResults results = new TextureReaderResults();

            //Here, load in the texture stuff

            ProgressService.SetMessage("Loading Textures and Palettes");
            foreach (MarioKartRomInfo.MK64ImageInfo imageInfo in MarioKartRomInfo.ImageLocations)
            {
                MK64Image image = new MK64Image(imageInfo, rawData);
                if (image.IsValidImage)
                {
                    results.AddImage(image);
                }
                else
                {
                    throw new Exception();
                }
            }

            ProgressService.SetMessage("Loading Kart Images");
            foreach (MarioKartRomInfo.MK64ImageInfo imageInfo in KartImageInfo.ImageLocations)
            {
                MK64Image image = new MK64Image(imageInfo, rawData);
                if (image.IsValidImage)
                {
                    results.AddKartImage(image);
                }
                else
                {
                    throw new Exception();
                }
            }

            finalResults.TextureResults = results;
        }