internal Effect(AssetLoader loader)
: base(loader)
{
var reader = loader.Reader;
loader.ExpectMagic(Magic);
loader.Expect(0x10000);
loader.Expect(ContentStart);
int offsetOffset = reader.ReadInt32();
int pointerCount = reader.ReadInt32();
HashSet<int> pointers = new HashSet<int>();
int functionCount = reader.ReadInt32();
HashSet<int> functions = new HashSet<int>();
loader.Position = offsetOffset;
for (int index = 0; index < pointerCount; index++)
pointers.Add(reader.ReadInt32());
for (int index = 0; index < functionCount; index++)
functions.Add(reader.ReadInt32());
loader.Position = ContentStart;
int tokenCount = (offsetOffset - ContentStart) / 4;
Tokens = new Codex<EffectToken>(tokenCount);
for (int index = 0; index < tokenCount; index++)
Tokens.Add(new EffectToken(reader, pointers, functions));
for (int index = 0; index < tokenCount; index++)
Tokens[index].Link(Tokens);
Instructions = new Codex<EffectInstruction>();
for (int index = 0; index < tokenCount; )
Instructions.Add(new EffectInstruction(Tokens, ref index));
}