示例#1
0
        public Rectangle GetMapRect(int areaIndex)
        {
            if (metadata == null)
            {
                metadata = new RoomMetaData(areaIndex, this.Index);
            }

            return(new Rectangle(new Point(metadata.mapPosX, metadata.mapPosY), new Size(metadata.TileWidth, metadata.TileHeight)));
        }
示例#2
0
        private void LoadRoom(int areaIndex)
        {
            metadata = new RoomMetaData(areaIndex, this.Index);

            //build tileset using tile addrs from room metadata
            tset = metadata.GetTileSet();

            //palettes
            pset = metadata.GetPaletteSet();

            //room data
            bg2RoomData = new byte[0x2000];                                     //this seems to be the maximum size
            bg1RoomData = new byte[0x2000];                                     //2000 isnt too much memory, so this is just easier

            bg2Exists = metadata.GetBG2Data(ref bg2RoomData, ref bg2MetaTiles); //loads in the data and tiles
            bg1Exists = metadata.GetBG1Data(ref bg1RoomData, ref bg1MetaTiles); //loads in the data, tiles and sets bg1Use20344B0

            Loaded = true;                                                      //do not load data a 2nd time for this room
        }
示例#3
0
        public void LoadRoom(int areaIndex)
        {
            metadata = new RoomMetaData(areaIndex, this.Index);

            //build tileset using tile addrs from room metadata
            tset = metadata.GetTileSet();

            //palettes
            pset = metadata.GetPaletteSet();

            //room data
            bg2RoomData = new byte[0x2000];                                     //this seems to be the maximum size
            bg1RoomData = new byte[0x2000];                                     //2000 isnt too much memory, so this is just easier

            bg2Exists = metadata.GetBG2Data(ref bg2RoomData, ref bg2MetaTiles); //loads in the data and tiles
            bg1Exists = metadata.GetBG1Data(ref bg1RoomData, ref bg1MetaTiles); //loads in the data, tiles and sets bg1Use20344B0

            if (!bg1Exists && !bg2Exists)
            {
                throw new RoomException("No layers exist for this room, the room is highly likely invalid.");
            }

            Loaded = true; //do not load data a 2nd time for this room
        }