Beispiel #1
0
        /// <summary>
        /// Reads memory of size into buffer.
        /// </summary>
        /// <param name="file">The file to read from.</param>
        /// <param name="buffer">The buffer to write to.</param>
        /// <param name="size">Size in bytes.</param>
        /// <param name="count">The number to be read.</param>
        public static void Read(File file, FallenGE.Utility.Buffer buffer, uint size, uint count)
        {
            IntPtr data;

            Fs.PHYSFS_read(file.Handle, out data, size, count);
            buffer.Data = data;
        }
Beispiel #2
0
        /// <summary>
        /// Create a new sound.
        /// </summary>
        /// <param name="file">The file that contains sound data.</param>
        public Sound(File file)
        {
            FallenGE.Utility.Buffer buffer = new FallenGE.Utility.Buffer();

            uint size = Convert.ToUInt32(FallenGE.File_System.FileManager.FileSize(file));

            FallenGE.File_System.FileManager.Read(file, buffer, size, 1);

            chunk = SdlMixer.Mix_LoadWAV_RW(Sdl.SDL_RWFromMem(buffer.Data, (int)size), 1);

            buffer.Destroy();
        }