/// <summary> /// Set up this function by copying over an array of Sonic Adventure physics. /// </summary> public FixedArrayPtr() { // Read in the Sonic Adventure physics array from file, then copy over to self-allocated memory. byte[] bytes = File.ReadAllBytes("phys.bin"); _currentProcess = new Reloaded.Memory.Sources.Memory(); _adventurePhysicsArray = _currentProcess.Allocate(bytes.Length); _currentProcess.WriteRaw(_adventurePhysicsArray, bytes); _fixedArrayPtr = new FixedArrayPtr <AdventurePhysics>((ulong)_adventurePhysicsArray, PhysicsArrayLength); }
/// <summary> /// Set up this function by copying over an array of Sonic Adventure physics. /// </summary> public IArrayPtrGenerator() { // Read in the Sonic Adventure physics array from file, then copy over to self-allocated memory. byte[] bytes = File.ReadAllBytes("phys.bin"); AdventurePhysicsArray = CurrentProcess.Allocate(bytes.Length); CurrentProcess.WriteRaw(AdventurePhysicsArray, bytes); _data = new List <object[]> { new object[] { new Reloaded.Memory.Pointers.ArrayPtr <AdventurePhysics>((ulong)AdventurePhysicsArray, false, CurrentProcess) }, new object[] { new Reloaded.Memory.Pointers.FixedArrayPtr <AdventurePhysics>((ulong)AdventurePhysicsArray, 10, false, CurrentProcess) } }; }