예제 #1
0
        public Bitmap GetImage(GPTrack track)
        {
            Tile[]  tiles   = this.GetTiles(track.Objects.Tileset);
            Palette palette = track.Objects.Palette;

            return(TrackObjectGraphics.GetImage(tiles, palette));
        }
예제 #2
0
        /// <summary>
        /// Gets the Match Race object image.
        /// </summary>
        /// <param name="theme">The track theme.</param>
        /// <param name="moving">True for moving Match Race object, false for still Match Race object.</param>
        /// <returns></returns>
        public Bitmap GetMatchRaceObjectImage(Theme theme, bool moving)
        {
            Tile[]  tiles   = this.tiles[this.GetMatchRaceTileIndex(moving)];
            Palette palette = moving ? theme.Palettes[12] : theme.Palettes[14];

            return(TrackObjectGraphics.GetImage(tiles, palette));
        }
예제 #3
0
        public TrackObjectGraphics(byte[] romBuffer, Offsets offsets)
        {
            int typeCount = Enum.GetValues(typeof(TrackObjectType)).Length;
            int count     = typeCount + 2; // + 2 to account for moving Match Race object and items

            this.tiles = new TrackObjectTile[count][];
            int offsetLocation = offsets[Offset.TrackObjectGraphics];

            byte[] tilesetGfx;
            int[]  tileIndexes;

            for (int i = 0; i < typeCount; i++)
            {
                TrackObjectType type   = (TrackObjectType)i;
                int             offset = TrackObjectGraphics.GetGraphicsOffset(type, romBuffer, offsetLocation);
                tilesetGfx    = Codec.Decompress(romBuffer, offset);
                tileIndexes   = TrackObjectGraphics.GetTileIndexes(type);
                this.tiles[i] = TrackObjectGraphics.GetTiles(tilesetGfx, tileIndexes);
            }

            tileIndexes = TrackObjectGraphics.GetMatchRaceTileIndexes();

            tilesetGfx = Codec.Decompress(romBuffer, offsets[Offset.MatchRaceObjectGraphics]);
            this.tiles[this.tiles.Length - 2] = TrackObjectGraphics.GetTiles(tilesetGfx, tileIndexes);

            tilesetGfx = Codec.Decompress(romBuffer, offsets[Offset.ItemGraphics]);
            this.tiles[this.tiles.Length - 1] = TrackObjectGraphics.GetTiles(tilesetGfx, tileIndexes);
        }