示例#1
0
        public void RegisterScroll(EditorScroll scr)
        {
            if (scr == null)
            {
                return;
            }

            scrollRegions.AddRegion(scr.segmentedAddress, scr.vertexCount * 0x10);
        }
示例#2
0
        static RegionParseState PerformRegionParseInternal(ROM rom, List <Region> regions, int offset, int layer)
        {
            RegionParseState state = new RegionParseState();

            rom.PushOffset(offset);
            try
            {
                int cmd = 0;
                do
                {
                    cmd = rom.Read8();
                    parser[cmd](rom, regions, state);
                    rom.AddOffset(8);
                }while (cmd != 0xB8);

                Region           region;
                SortedRegionList graphicsData = new SortedRegionList();

                foreach (KeyValuePair <int, int> lightRegion in state.lightData.RegionList)
                {
                    //region = new Region(lightRegion.Key, lightRegion.Value, RegionState.LightData);
                    graphicsData.AddRegion(lightRegion.Key, lightRegion.Value);
                    //regions.Add(region);
                }

                // kostul
                if (state.lightData.RegionList.Count == 0)
                {
                    graphicsData.AddRegion(rom.GetROMAddress(0x0E000000), 0x10);
                }

                foreach (KeyValuePair <int, int> textureRegion in state.textureData.RegionList)
                {
                    //region = new Region(textureRegion.Key, textureRegion.Value, RegionState.TextureInfo);
                    graphicsData.AddRegion(textureRegion.Key, textureRegion.Value);
                    //regions.Add(region);
                }

                foreach (KeyValuePair <int, int> vertexRegion in state.vertexData.RegionList)
                {
                    //region = new Region(vertexRegion.Key, vertexRegion.Value, RegionState.VertexInfo);
                    graphicsData.AddRegion(vertexRegion.Key, vertexRegion.Value);
                    //regions.Add(region);
                }

                int count = 0;
                foreach (KeyValuePair <int, int> notFixedRegion in graphicsData.RegionList)
                {
                    region        = new DynamicRegion(notFixedRegion.Key, notFixedRegion.Value, RegionState.GraphicsData);
                    region.number = count++;
                    regions.Add(region);
                }


                region = new DisplayListRegion(offset, rom.offset - offset, state.isFogEnabled, state.isEnvColorEnabled, state.FCCount, state.B9cmdfirst, layer);
                regions.Add(region);
            }
            finally
            {
                rom.PopOffset();
            }
            return(state);
        }
示例#3
0
 public void RegisterVertex(int segAddr)
 {
     vertexRegions.AddRegion(segAddr, 0x10);
 }