diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/YEngine/MMRScriptConsts.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/YEngine/MMRScriptConsts.cs | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/OpenSim/Region/ScriptEngine/YEngine/MMRScriptConsts.cs b/OpenSim/Region/ScriptEngine/YEngine/MMRScriptConsts.cs index 63a6ee9..b44c4e2 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/MMRScriptConsts.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/MMRScriptConsts.cs | |||
@@ -64,9 +64,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
64 | { | 64 | { |
65 | Dictionary<string, ScriptConst> sc = new Dictionary<string, ScriptConst>(); | 65 | Dictionary<string, ScriptConst> sc = new Dictionary<string, ScriptConst>(); |
66 | 66 | ||
67 | /* | 67 | // For every event code, define XMREVENTCODE_<eventname> and XMREVENTMASKn_<eventname> symbols. |
68 | * For every event code, define XMREVENTCODE_<eventname> and XMREVENTMASKn_<eventname> symbols. | ||
69 | */ | ||
70 | for(int i = 0; i < 64; i++) | 68 | for(int i = 0; i < 64; i++) |
71 | { | 69 | { |
72 | try | 70 | try |
@@ -87,9 +85,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
87 | catch { } | 85 | catch { } |
88 | } | 86 | } |
89 | 87 | ||
90 | /* | 88 | // Also get all the constants from XMRInstAbstract and ScriptBaseClass etc as well. |
91 | * Also get all the constants from XMRInstAbstract and ScriptBaseClass etc as well. | ||
92 | */ | ||
93 | for(Type t = typeof(XMRInstAbstract); t != typeof(object); t = t.BaseType) | 89 | for(Type t = typeof(XMRInstAbstract); t != typeof(object); t = t.BaseType) |
94 | { | 90 | { |
95 | AddInterfaceConstants(sc, t.GetFields()); | 91 | AddInterfaceConstants(sc, t.GetFields()); |
@@ -132,10 +128,8 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
132 | Type fieldType = constField.FieldType; | 128 | Type fieldType = constField.FieldType; |
133 | CompValu cv; | 129 | CompValu cv; |
134 | 130 | ||
135 | /* | 131 | // The location of a simple number is the number itself. |
136 | * The location of a simple number is the number itself. | 132 | // Access to the value gets compiled as an ldc instruction. |
137 | * Access to the value gets compiled as an ldc instruction. | ||
138 | */ | ||
139 | if(fieldType == typeof(double)) | 133 | if(fieldType == typeof(double)) |
140 | { | 134 | { |
141 | cv = new CompValuFloat(new TokenTypeFloat(null), | 135 | cv = new CompValuFloat(new TokenTypeFloat(null), |
@@ -152,10 +146,8 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
152 | ((LSL_Integer)constField.GetValue(null)).value); | 146 | ((LSL_Integer)constField.GetValue(null)).value); |
153 | } | 147 | } |
154 | 148 | ||
155 | /* | 149 | // The location of a string is the string itself. |
156 | * The location of a string is the string itself. | 150 | // Access to the value gets compiled as an ldstr instruction. |
157 | * Access to the value gets compiled as an ldstr instruction. | ||
158 | */ | ||
159 | else if(fieldType == typeof(string)) | 151 | else if(fieldType == typeof(string)) |
160 | { | 152 | { |
161 | cv = new CompValuString(new TokenTypeStr(null), | 153 | cv = new CompValuString(new TokenTypeStr(null), |
@@ -167,18 +159,14 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
167 | (string)(LSL_String)constField.GetValue(null)); | 159 | (string)(LSL_String)constField.GetValue(null)); |
168 | } | 160 | } |
169 | 161 | ||
170 | /* | 162 | // The location of everything else (objects) is the static field in the interface definition. |
171 | * The location of everything else (objects) is the static field in the interface definition. | 163 | // Access to the value gets compiled as an ldsfld instruction. |
172 | * Access to the value gets compiled as an ldsfld instruction. | ||
173 | */ | ||
174 | else | 164 | else |
175 | { | 165 | { |
176 | cv = new CompValuSField(TokenType.FromSysType(null, fieldType), constField); | 166 | cv = new CompValuSField(TokenType.FromSysType(null, fieldType), constField); |
177 | } | 167 | } |
178 | 168 | ||
179 | /* | 169 | // Add to dictionary. |
180 | * Add to dictionary. | ||
181 | */ | ||
182 | new ScriptConst(sc, constField.Name, cv); | 170 | new ScriptConst(sc, constField.Name, cv); |
183 | } | 171 | } |
184 | } | 172 | } |