Exemplo n.º 1
0
        public static SM64MarioState MarioTick(uint marioId, SM64MarioInputs inputs, Vector3[] positionBuffer, Vector3[] normalBuffer, Vector3[] colorBuffer, Vector2[] uvBuffer)
        {
            SM64MarioState outState = new SM64MarioState();

            var posHandle   = GCHandle.Alloc(positionBuffer, GCHandleType.Pinned);
            var normHandle  = GCHandle.Alloc(normalBuffer, GCHandleType.Pinned);
            var colorHandle = GCHandle.Alloc(colorBuffer, GCHandleType.Pinned);
            var uvHandle    = GCHandle.Alloc(uvBuffer, GCHandleType.Pinned);

            SM64MarioGeometryBuffers buff = new SM64MarioGeometryBuffers
            {
                position = posHandle.AddrOfPinnedObject(),
                normal   = normHandle.AddrOfPinnedObject(),
                color    = colorHandle.AddrOfPinnedObject(),
                uv       = uvHandle.AddrOfPinnedObject()
            };

            sm64_mario_tick(marioId, ref inputs, ref outState, ref buff);

            posHandle.Free();
            normHandle.Free();
            colorHandle.Free();
            uvHandle.Free();

            return(outState);
        }
Exemplo n.º 2
0
 static extern void sm64_mario_tick(uint marioId, ref SM64MarioInputs inputs, ref SM64MarioState outState, ref SM64MarioGeometryBuffers outBuffers);