예제 #1
0
        internal static IntPtr ReadToPointer(string name, out IntPtr size)
        {
            string safeName = MonoGame.Utilities.FileHelpers.NormalizeFilePathSeparators(name);

#if CASE_SENSITIVITY_HACK
            if (Path.IsPathRooted(safeName))
            {
                safeName = GetCaseName(safeName);
            }
            safeName = GetCaseName(Path.Combine(TitleLocation.Path, safeName));
#endif
            string realName;
            if (Path.IsPathRooted(safeName))
            {
                realName = safeName;
            }
            else
            {
                realName = Path.Combine(TitleLocation.Path, safeName);
            }
            if (!File.Exists(realName))
            {
                throw new FileNotFoundException(realName);
            }
            return(FNAPlatform.ReadFileToPointer(realName, out size));
        }
예제 #2
0
        internal static IntPtr ReadToPointer(string name, out IntPtr size)
        {
            string safeName = MonoGame.Utilities.FileHelpers.NormalizeFilePathSeparators(name);

#if CASE_SENSITIVITY_HACK
            if (Path.IsPathRooted(safeName))
            {
                safeName = GetCaseName(safeName);
            }
            safeName = GetCaseName(Path.Combine(TitleLocation.Path, safeName));
#endif
            if (Path.IsPathRooted(safeName))
            {
                return(FNAPlatform.ReadFileToPointer(safeName, out size));
            }
            return(FNAPlatform.ReadFileToPointer(Path.Combine(TitleLocation.Path, safeName), out size));
        }