예제 #1
0
        public string FunctionParams;                   /* Function parameters that the error ocurred on */

        public ErrorCallbackInfo(ref ErrorCallbackInfoNative native)
        {
            Result = native.Result;

            InstanceType = native.InstanceType;

            Instance = native.Instance;

            FunctionName   = FmodHelpers.PtrToStringUnknownSize(native.FunctionName);
            FunctionParams = FmodHelpers.PtrToStringUnknownSize(native.FunctionParams);
        }
예제 #2
0
        private static Result DebugCallbackMarshaller(DebugFlags flags, byte *file, int line, byte *func, byte *message)
        {
            if (DebugCallbackReference is null)
            {
                return(Result.Ok);
            }

            try
            {
                var fileString    = FmodHelpers.PtrToStringUnknownSize(file);
                var funcString    = FmodHelpers.PtrToStringUnknownSize(func);
                var messageString = FmodHelpers.PtrToStringUnknownSize(message);

                return(DebugCallbackReference.Invoke(flags, fileString, line, funcString, messageString));
            }
            catch (FmodException fe)
            {
                return(fe.Result ?? Result.Err_Internal);
            }
            catch
            {
                return(Result.Err_Internal);
            }
        }