Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Ray2Mod.Components.Types;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Runtime.InteropServices;
- using System.Text;
- using System.Threading.Tasks;
- namespace Ray2Mod.Game.Structs.LinkedLists {
- // All LinkedLists in Rayman 2 are double
- [StructLayout(LayoutKind.Sequential)]
- public unsafe struct LinkedList_NoPreviousPointersForDouble_ElementPointerFirst_ReadAtPointer<T> where T : unmanaged {
- public int * Head;
- public int * Tail;
- public int Count;
- public unsafe Pointer<T>[] Read()
- {
- Pointer<T>[] results = new Pointer<T>[Count];
- int* Next = Head;
- for(int i=0;i<Count;i++) {
- int* Element = Next;
- Next = (int*)(*Next);
- // No Previous Pointer
- results[i] = new Pointer<T>((int)(*Element));
- Next += 4;
- }
- return results;
- }
- }
- }
Add Comment
Please, Sign In to add comment