1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 |
|
---|
4 | namespace Oni.Metadata
|
---|
5 | {
|
---|
6 | internal class OniMacMetadata : InstanceMetadata
|
---|
7 | {
|
---|
8 | //
|
---|
9 | // Binary Data template
|
---|
10 | //
|
---|
11 |
|
---|
12 | private static MetaStruct bina = new MetaStruct("BINAInstance",
|
---|
13 | new Field(MetaType.Int32, "DataSize"),
|
---|
14 | new BinaryPartField(MetaType.SepOffset, "DataOffset", "DataSize")
|
---|
15 | );
|
---|
16 |
|
---|
17 | //
|
---|
18 | // Texture Map template
|
---|
19 | //
|
---|
20 |
|
---|
21 | private static MetaStruct txmp = new MetaStruct("TXMPInstance",
|
---|
22 | new Field(MetaType.Padding(128)),
|
---|
23 | new Field(MetaType.Enum<TXMPFlags>(), "Flags"),
|
---|
24 | new Field(MetaType.Int16, "Width"),
|
---|
25 | new Field(MetaType.Int16, "Height"),
|
---|
26 | new Field(MetaType.Enum<TXMPFormat>(), "Format"),
|
---|
27 | new Field(MetaType.Pointer(TemplateTag.TXAN), "Animation"),
|
---|
28 | new Field(MetaType.Pointer(TemplateTag.TXMP), "EnvMap"),
|
---|
29 | new Field(MetaType.Padding(4)),
|
---|
30 | new BinaryPartField(MetaType.SepOffset, "DataOffset"),
|
---|
31 | new Field(MetaType.Padding(8))
|
---|
32 | );
|
---|
33 |
|
---|
34 | //
|
---|
35 | // Oni Sound Binary Data template
|
---|
36 | //
|
---|
37 |
|
---|
38 | private static MetaStruct osbd = new MetaStruct("OSBDInstance",
|
---|
39 | new Field(MetaType.Int32, "DataSize"),
|
---|
40 | new BinaryPartField(MetaType.SepOffset, "DataOffset", "DataSize")
|
---|
41 | );
|
---|
42 |
|
---|
43 | //
|
---|
44 | // Sound Data template
|
---|
45 | //
|
---|
46 |
|
---|
47 | private static MetaStruct sndd = new MetaStruct("SNDDInstance",
|
---|
48 | new Field(MetaType.Int32, "Flags"),
|
---|
49 | new Field(MetaType.Int32, "Duration"),
|
---|
50 | new Field(MetaType.Int32, "DataSize"),
|
---|
51 | new BinaryPartField(MetaType.RawOffset, "DataOffset", "DataSize")
|
---|
52 | );
|
---|
53 |
|
---|
54 | protected override void InitializeTemplates(IList<Template> templates)
|
---|
55 | {
|
---|
56 | base.InitializeTemplates(templates);
|
---|
57 |
|
---|
58 | templates.Add(new Template(TemplateTag.BINA, bina, 0x15e11, "Binary Data"));
|
---|
59 | templates.Add(new Template(TemplateTag.OSBD, osbd, 0x15e3c, "Oni Sound Binary Data"));
|
---|
60 | templates.Add(new Template(TemplateTag.TXMP, txmp, 0x8911eeb5f, "Texture Map"));
|
---|
61 | templates.Add(new Template(TemplateTag.SNDD, sndd, 0x411eb, "Sound Data"));
|
---|
62 | }
|
---|
63 | }
|
---|
64 | }
|
---|