1 | using System;
|
---|
2 | using Oni.Imaging;
|
---|
3 |
|
---|
4 | namespace Oni.Particles
|
---|
5 | {
|
---|
6 | internal class Appearance
|
---|
7 | {
|
---|
8 | #region Private data
|
---|
9 | private Value scale;
|
---|
10 | private Value yScale;
|
---|
11 | private Value rotation;
|
---|
12 | private Value alpha;
|
---|
13 | private Value xOffset;
|
---|
14 | private Value xShorten;
|
---|
15 | private Value tint;
|
---|
16 | private Value edgeFadeMin;
|
---|
17 | private Value edgeFadeMax;
|
---|
18 | private Value maxContrail;
|
---|
19 | private Value lensFlareDistance;
|
---|
20 | private int fadeInFrames;
|
---|
21 | private int fadeOutFrames;
|
---|
22 | private int maxDecals;
|
---|
23 | private int decalFadeFrames;
|
---|
24 | private Value decalWrapAngle;
|
---|
25 | private string textureName;
|
---|
26 | #endregion
|
---|
27 |
|
---|
28 | public Appearance()
|
---|
29 | {
|
---|
30 | scale = Value.FloatOne;
|
---|
31 | yScale = Value.FloatOne;
|
---|
32 | rotation = Value.FloatZero;
|
---|
33 | alpha = Value.FloatOne;
|
---|
34 | textureName = "notfoundtex";
|
---|
35 | xOffset = Value.FloatZero;
|
---|
36 | xShorten = Value.FloatZero;
|
---|
37 | tint = new Value(new Color(255, 255, 255));
|
---|
38 | edgeFadeMin = Value.FloatZero;
|
---|
39 | edgeFadeMax = Value.FloatZero;
|
---|
40 | maxContrail = Value.FloatZero;
|
---|
41 | lensFlareDistance = Value.FloatZero;
|
---|
42 | maxDecals = 100;
|
---|
43 | decalFadeFrames = 60;
|
---|
44 | decalWrapAngle = new Value(60.0f);
|
---|
45 | }
|
---|
46 |
|
---|
47 | public Appearance(BinaryReader reader)
|
---|
48 | {
|
---|
49 | scale = Value.Read(reader);
|
---|
50 | yScale = Value.Read(reader);
|
---|
51 | rotation = Value.Read(reader);
|
---|
52 | alpha = Value.Read(reader);
|
---|
53 | textureName = reader.ReadString(32);
|
---|
54 | xOffset = Value.Read(reader);
|
---|
55 | xShorten = Value.Read(reader);
|
---|
56 | tint = Value.Read(reader);
|
---|
57 | edgeFadeMin = Value.Read(reader);
|
---|
58 | edgeFadeMax = Value.Read(reader);
|
---|
59 | maxContrail = Value.Read(reader);
|
---|
60 | lensFlareDistance = Value.Read(reader);
|
---|
61 | fadeInFrames = reader.ReadInt16();
|
---|
62 | fadeOutFrames = reader.ReadInt16();
|
---|
63 | maxDecals = reader.ReadInt16();
|
---|
64 | decalFadeFrames = reader.ReadInt16();
|
---|
65 | decalWrapAngle = Value.Read(reader);
|
---|
66 | }
|
---|
67 |
|
---|
68 | public void Write(BinaryWriter writer)
|
---|
69 | {
|
---|
70 | scale.Write(writer);
|
---|
71 | yScale.Write(writer);
|
---|
72 | rotation.Write(writer);
|
---|
73 | alpha.Write(writer);
|
---|
74 | writer.Write(textureName, 32);
|
---|
75 | xOffset.Write(writer);
|
---|
76 | xShorten.Write(writer);
|
---|
77 | tint.Write(writer);
|
---|
78 | edgeFadeMin.Write(writer);
|
---|
79 | edgeFadeMax.Write(writer);
|
---|
80 | maxContrail.Write(writer);
|
---|
81 | lensFlareDistance.Write(writer);
|
---|
82 | writer.WriteInt16(fadeInFrames);
|
---|
83 | writer.WriteInt16(fadeOutFrames);
|
---|
84 | writer.WriteInt16(maxDecals);
|
---|
85 | writer.WriteInt16(decalFadeFrames);
|
---|
86 | decalWrapAngle.Write(writer);
|
---|
87 | }
|
---|
88 |
|
---|
89 | public string TextureName
|
---|
90 | {
|
---|
91 | get { return textureName; }
|
---|
92 | set { textureName = value; }
|
---|
93 | }
|
---|
94 |
|
---|
95 | public Value Scale
|
---|
96 | {
|
---|
97 | get { return scale; }
|
---|
98 | set { scale = value; }
|
---|
99 | }
|
---|
100 |
|
---|
101 | public Value YScale
|
---|
102 | {
|
---|
103 | get { return yScale; }
|
---|
104 | set { yScale = value; }
|
---|
105 | }
|
---|
106 |
|
---|
107 | public Value Rotation
|
---|
108 | {
|
---|
109 | get { return rotation; }
|
---|
110 | set { rotation = value; }
|
---|
111 | }
|
---|
112 |
|
---|
113 | public Value Alpha
|
---|
114 | {
|
---|
115 | get { return alpha; }
|
---|
116 | set { alpha = value; }
|
---|
117 | }
|
---|
118 |
|
---|
119 | public Value XOffset
|
---|
120 | {
|
---|
121 | get { return xOffset; }
|
---|
122 | set { xOffset = value; }
|
---|
123 | }
|
---|
124 |
|
---|
125 | public Value XShorten
|
---|
126 | {
|
---|
127 | get { return xShorten; }
|
---|
128 | set { xShorten = value; }
|
---|
129 | }
|
---|
130 |
|
---|
131 | public Value Tint
|
---|
132 | {
|
---|
133 | get { return tint; }
|
---|
134 | set { tint = value; }
|
---|
135 | }
|
---|
136 |
|
---|
137 | public Value EdgeFadeMin
|
---|
138 | {
|
---|
139 | get { return edgeFadeMin; }
|
---|
140 | set { edgeFadeMin = value; }
|
---|
141 | }
|
---|
142 |
|
---|
143 | public Value EdgeFadeMax
|
---|
144 | {
|
---|
145 | get { return edgeFadeMax; }
|
---|
146 | set { edgeFadeMax = value; }
|
---|
147 | }
|
---|
148 |
|
---|
149 | public Value MaxContrail
|
---|
150 | {
|
---|
151 | get { return maxContrail; }
|
---|
152 | set { maxContrail = value; }
|
---|
153 | }
|
---|
154 |
|
---|
155 | public Value LensFlareDistance
|
---|
156 | {
|
---|
157 | get { return lensFlareDistance; }
|
---|
158 | set { lensFlareDistance = value; }
|
---|
159 | }
|
---|
160 |
|
---|
161 | public int LensFlareFadeInFrames
|
---|
162 | {
|
---|
163 | get { return fadeInFrames; }
|
---|
164 | set { fadeInFrames = value; }
|
---|
165 | }
|
---|
166 |
|
---|
167 | public int LensFlareFadeOutFrames
|
---|
168 | {
|
---|
169 | get { return fadeOutFrames; }
|
---|
170 | set { fadeOutFrames = value; }
|
---|
171 | }
|
---|
172 |
|
---|
173 | public int MaxDecals
|
---|
174 | {
|
---|
175 | get { return maxDecals; }
|
---|
176 | set { maxDecals = value; }
|
---|
177 | }
|
---|
178 |
|
---|
179 | public int DecalFadeFrames
|
---|
180 | {
|
---|
181 | get { return decalFadeFrames; }
|
---|
182 | set { decalFadeFrames = value; }
|
---|
183 | }
|
---|
184 |
|
---|
185 | public Value DecalWrapAngle
|
---|
186 | {
|
---|
187 | get { return decalWrapAngle; }
|
---|
188 | set { decalWrapAngle = value; }
|
---|
189 | }
|
---|
190 | }
|
---|
191 | }
|
---|