Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DirectionalLight.cs
Go to the documentation of this file.
2
3public sealed class DirectionalLight
4{
6
8
10
11 private bool enabled;
12
14
16
18
19 public bool Enabled
20 {
21 get
22 {
23 return enabled;
24 }
25 set
26 {
27 if (enabled == value)
28 {
29 return;
30 }
31 enabled = value;
32 if (enabled)
33 {
34 if (diffuseColorParam != null)
35 {
37 }
38 if (specularColorParam != null)
39 {
41 }
42 }
43 else
44 {
45 if (diffuseColorParam != null)
46 {
48 }
49 if (specularColorParam != null)
50 {
52 }
53 }
54 }
55 }
56
58 {
59 get
60 {
61 return cachedDirection;
62 }
63 set
64 {
65 if (directionParam != null)
66 {
68 }
69 cachedDirection = value;
70 }
71 }
72
74 {
75 get
76 {
77 return cachedDiffuseColor;
78 }
79 set
80 {
81 if (enabled && diffuseColorParam != null)
82 {
84 }
85 cachedDiffuseColor = value;
86 }
87 }
88
90 {
91 get
92 {
94 }
95 set
96 {
97 if (enabled && specularColorParam != null)
98 {
100 }
101 cachedSpecularColor = value;
102 }
103 }
104
105 public DirectionalLight(EffectParameter directionParameter, EffectParameter diffuseColorParameter, EffectParameter specularColorParameter, DirectionalLight cloneSource)
106 {
107 directionParam = directionParameter;
108 diffuseColorParam = diffuseColorParameter;
109 specularColorParam = specularColorParameter;
110 if (cloneSource != null)
111 {
112 enabled = cloneSource.enabled;
113 cachedDirection = cloneSource.cachedDirection;
116 }
117 else
118 {
122 }
123 }
124}
DirectionalLight(EffectParameter directionParameter, EffectParameter diffuseColorParameter, EffectParameter specularColorParameter, DirectionalLight cloneSource)