示例#1
0
        /// <summary>
        /// Loads an IMG file.
        /// </summary>
        /// <param name="filePath">Absolute path to *.IMG file</param>
        /// <param name="usage">Specify if file will be accessed from disk, or loaded into RAM.</param>
        /// <param name="readOnly">File will be read-only if true, read-write if false.</param>
        /// <returns>True if successful, otherwise false.</returns>
        public bool Load(byte[] data, FileUsage usage, bool readOnly)
        {
            elvPakFile = new PakFile(data);

            //// Load file
            //if (!managedFile.Load(data, ""))
            //    return false;

            // Read file
            if (!Read())
            {
                return(false);
            }

            return(true);
        }
示例#2
0
        /// <summary>
        /// Loads an IMG file.
        /// </summary>
        /// <param name="filePath">Absolute path to *.IMG file</param>
        /// <param name="usage">Specify if file will be accessed from disk, or loaded into RAM.</param>
        /// <param name="readOnly">File will be read-only if true, read-write if false.</param>
        /// <returns>True if successful, otherwise false.</returns>
        public bool Load(string filePath, FileUsage usage, bool readOnly)
        {
            elvPakFile = new PakFile(filePath);

            // Exit if this file already loaded
            //if (managedFile.FilePath == filePath)
            //    return true;

            //// Load file
            //if (!managedFile.Load(filePath, usage, readOnly))
            //    return false;

            // Read file
            if (!Read())
            {
                return(false);
            }

            return(true);
        }