示例#1
0
            public Record(BgActor actor, IFile file, RomVersion version)
            {
                Initialize();
                int ramStart = 0;

                if (file is RamObject)
                {
                    var obj = (RamObject)file;
                    ramStart = (int)obj.Ram.Start;
                    File     = new FileData(obj.Object, FileType.Object);
                }
                else if (file is OvlActor)
                {
                    var af = (OvlActor)file;
                    ramStart = (int)af.Ram.Start;
                    File     = new FileData(af.Actor, FileType.Actor);
                }
                else
                {
                    throw new NotImplementedException();
                }

                Offset = ((int)actor.MeshPtr & 0xFFFFFF) - (ramStart & 0xFFFFFF);
                Versions.Add(version);
                Actors.Add(actor.ActorId);
            }
示例#2
0
        public DynaCollisionContext(Ptr ctx, RomVersion version)
        {
            for (int i = 0; i < BG_ACTOR_MAX; i++)
            {
                bgActors[i] = new BgActor(ctx.RelOff(i * 0x64 + 0x54));
            }

            polyList = ctx.Deref(0x1440);
            vtxList  = ctx.Deref(0x1444);

            if (version.Game == Game.OcarinaOfTime)
            {
                polyNodes_tbl   = ctx.Deref(0x1448);
                polyNodes_count = ctx.ReadInt32(0x144C);
                polyNodes_max   = ctx.ReadInt32(0x1450);
                polyNodesMax    = ctx.ReadInt32(0x1454);
                polyListMax     = ctx.ReadInt32(0x1458);
                vtxListMax      = ctx.ReadInt32(0x145C);
            }
            else if (version.Game == Game.MajorasMask)
            {
                mm_0x1448       = ctx.ReadInt32(0x1448);
                waterBoxList    = ctx.Deref(0x144C);
                polyNodes_tbl   = ctx.Deref(0x1450);
                polyNodes_count = ctx.ReadInt32(0x1454);
                polyNodes_max   = ctx.ReadInt32(0x1458);
                polyNodesMax    = ctx.ReadInt32(0x145C);
                polyListMax     = ctx.ReadInt32(0x1460);
                vtxListMax      = ctx.ReadInt32(0x1464);
            }
            this.version = version;
        }
示例#3
0
        public static BgVertex GetVertex(DynaCollisionContext dyna, BgActor bgActor, short id)
        {
            var ptr = dyna.vtxList.RelOff(id * 6);

            return(new BgVertex(id,
                                ptr.ReadInt16(0),
                                ptr.ReadInt16(2),
                                ptr.ReadInt16(4)));
        }
示例#4
0
        public void AddNewRecord(BgActor actor, IFile obj, RomVersion version)
        {
            try
            {
                var record = new Record(actor, obj, version);

                if (Meshes.ContainsKey(record.GetHashCode()))
                {
                    Meshes[record.GetHashCode()].Merge(record);
                }
                else
                {
                    Meshes.Add(record.GetHashCode(), record);
                }
            }
            catch
            {
                Console.WriteLine("UNRECORDED");
            }
        }
            public Record(BgActor actor, IFile file, RomVersion version)
            {
                Initialize();
                int ramStart;

                if (file is RamObject obj)
                {
                    ramStart = obj.Ram.Start;
                    File     = new FileData(obj.Object, FileType.Object);
                }
                else if (file is OvlActor af)
                {
                    ramStart = af.Ram.Start;
                    File     = new FileData(af.Actor, FileType.Actor);
                }
                else
                {
                    throw new NotImplementedException();
                }

                Offset = ((N64Ptr)actor.MeshPtr).Offset - (ramStart & 0xFFFFFF);
                Versions.Add(version);
                Actors.Add(actor.ActorId);
            }