-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathAGAfiles.cs
More file actions
33 lines (32 loc) · 1.1 KB
/
Copy pathAGAfiles.cs
File metadata and controls
33 lines (32 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using Ionic.Zlib;
public class VOres
{
#region variables
internal string Filename;
public string[] SFXnames;
#endregion variables
public VOres(string filename)
{
Filename = filename;
using (BinaryReader binreader = new BinaryReader(File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.Read), J2File.FileEncoding))
{
binreader.ReadBytes(20);
int numberOfSounds = binreader.ReadInt32();
SFXnames = new string[numberOfSounds];
binreader.ReadBytes(5);
int cLength = binreader.ReadInt32();
int uLength = binreader.ReadInt32();
binreader.ReadBytes(32);
BinaryReader data1reader = new BinaryReader(new MemoryStream(ZlibStream.UncompressBuffer(binreader.ReadBytes(cLength))), J2File.FileEncoding);
for (int i = 0; i < numberOfSounds; i++)
{
SFXnames[i] = new string(data1reader.ReadChars(64)).TrimEnd();
}
}
}
}