diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting')
5 files changed, 119 insertions, 89 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index c369d87..090cb7d 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs | |||
@@ -135,17 +135,13 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
135 | m_reuseableDynamicTextures.Store( | 135 | m_reuseableDynamicTextures.Store( |
136 | GenerateReusableTextureKey(texture.InputCommands, texture.InputParams), newTextureID); | 136 | GenerateReusableTextureKey(texture.InputCommands, texture.InputParams), newTextureID); |
137 | } | 137 | } |
138 | updater.newTextureID = newTextureID; | ||
138 | } | 139 | } |
139 | } | ||
140 | 140 | ||
141 | if (updater.UpdateTimer == 0) | ||
142 | { | ||
143 | lock (Updaters) | 141 | lock (Updaters) |
144 | { | 142 | { |
145 | if (!Updaters.ContainsKey(updater.UpdaterID)) | 143 | if (Updaters.ContainsKey(updater.UpdaterID)) |
146 | { | ||
147 | Updaters.Remove(updater.UpdaterID); | 144 | Updaters.Remove(updater.UpdaterID); |
148 | } | ||
149 | } | 145 | } |
150 | } | 146 | } |
151 | } | 147 | } |
@@ -172,21 +168,20 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
172 | } | 168 | } |
173 | 169 | ||
174 | public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, | 170 | public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, |
175 | string extraParams, int updateTimer) | 171 | string extraParams) |
176 | { | 172 | { |
177 | return AddDynamicTextureURL(simID, primID, contentType, url, extraParams, updateTimer, false, 255); | 173 | return AddDynamicTextureURL(simID, primID, contentType, url, extraParams, false, 255); |
178 | } | 174 | } |
179 | 175 | ||
180 | public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, | 176 | public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, |
181 | string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) | 177 | string extraParams, bool SetBlending, byte AlphaValue) |
182 | { | 178 | { |
183 | return AddDynamicTextureURL(simID, primID, contentType, url, | 179 | return AddDynamicTextureURL(simID, primID, contentType, url, extraParams, SetBlending, |
184 | extraParams, updateTimer, SetBlending, | 180 | (DISP_TEMP|DISP_EXPIRE), AlphaValue, ALL_SIDES); |
185 | (int)(DISP_TEMP|DISP_EXPIRE), AlphaValue, ALL_SIDES); | ||
186 | } | 181 | } |
187 | 182 | ||
188 | public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, | 183 | public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, |
189 | string extraParams, int updateTimer, bool SetBlending, | 184 | string extraParams, bool SetBlending, |
190 | int disp, byte AlphaValue, int face) | 185 | int disp, byte AlphaValue, int face) |
191 | { | 186 | { |
192 | if (RenderPlugins.ContainsKey(contentType)) | 187 | if (RenderPlugins.ContainsKey(contentType)) |
@@ -196,7 +191,6 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
196 | updater.PrimID = primID; | 191 | updater.PrimID = primID; |
197 | updater.ContentType = contentType; | 192 | updater.ContentType = contentType; |
198 | updater.Url = url; | 193 | updater.Url = url; |
199 | updater.UpdateTimer = updateTimer; | ||
200 | updater.UpdaterID = UUID.Random(); | 194 | updater.UpdaterID = UUID.Random(); |
201 | updater.Params = extraParams; | 195 | updater.Params = extraParams; |
202 | updater.BlendWithOldTexture = SetBlending; | 196 | updater.BlendWithOldTexture = SetBlending; |
@@ -213,26 +207,27 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
213 | } | 207 | } |
214 | 208 | ||
215 | RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams); | 209 | RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams); |
216 | return updater.UpdaterID; | 210 | return updater.newTextureID; |
217 | } | 211 | } |
218 | return UUID.Zero; | 212 | return UUID.Zero; |
219 | } | 213 | } |
220 | 214 | ||
221 | public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, | 215 | public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, |
222 | string extraParams, int updateTimer) | 216 | string extraParams) |
223 | { | 217 | { |
224 | return AddDynamicTextureData(simID, primID, contentType, data, extraParams, updateTimer, false, 255); | 218 | return AddDynamicTextureData(simID, primID, contentType, data, extraParams, false, |
219 | (DISP_TEMP|DISP_EXPIRE), 255, ALL_SIDES); | ||
225 | } | 220 | } |
226 | 221 | ||
227 | public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, | 222 | public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, |
228 | string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) | 223 | string extraParams, bool SetBlending, byte AlphaValue) |
229 | { | 224 | { |
230 | return AddDynamicTextureData(simID, primID, contentType, data, extraParams, updateTimer, SetBlending, | 225 | return AddDynamicTextureData(simID, primID, contentType, data, extraParams, SetBlending, |
231 | (int) (DISP_TEMP|DISP_EXPIRE), AlphaValue, ALL_SIDES); | 226 | (DISP_TEMP|DISP_EXPIRE), AlphaValue, ALL_SIDES); |
232 | } | 227 | } |
233 | 228 | ||
234 | public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, | 229 | public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, |
235 | string extraParams, int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face) | 230 | string extraParams, bool SetBlending, int disp, byte AlphaValue, int face) |
236 | { | 231 | { |
237 | if (!RenderPlugins.ContainsKey(contentType)) | 232 | if (!RenderPlugins.ContainsKey(contentType)) |
238 | return UUID.Zero; | 233 | return UUID.Zero; |
@@ -258,7 +253,6 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
258 | updater.PrimID = primID; | 253 | updater.PrimID = primID; |
259 | updater.ContentType = contentType; | 254 | updater.ContentType = contentType; |
260 | updater.BodyData = data; | 255 | updater.BodyData = data; |
261 | updater.UpdateTimer = updateTimer; | ||
262 | updater.UpdaterID = UUID.Random(); | 256 | updater.UpdaterID = UUID.Random(); |
263 | updater.Params = extraParams; | 257 | updater.Params = extraParams; |
264 | updater.BlendWithOldTexture = SetBlending; | 258 | updater.BlendWithOldTexture = SetBlending; |
@@ -314,7 +308,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
314 | updater.UpdatePart(part, (UUID)objReusableTextureUUID); | 308 | updater.UpdatePart(part, (UUID)objReusableTextureUUID); |
315 | } | 309 | } |
316 | 310 | ||
317 | return updater.UpdaterID; | 311 | return updater.newTextureID; |
318 | } | 312 | } |
319 | 313 | ||
320 | private string GenerateReusableTextureKey(string data, string extraParams) | 314 | private string GenerateReusableTextureKey(string data, string extraParams) |
@@ -404,17 +398,15 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
404 | public byte FrontAlpha = 255; | 398 | public byte FrontAlpha = 255; |
405 | public string Params; | 399 | public string Params; |
406 | public UUID PrimID; | 400 | public UUID PrimID; |
407 | public bool SetNewFrontAlpha = false; | ||
408 | public UUID SimUUID; | 401 | public UUID SimUUID; |
409 | public UUID UpdaterID; | 402 | public UUID UpdaterID; |
410 | public int UpdateTimer; | ||
411 | public int Face; | 403 | public int Face; |
412 | public int Disp; | 404 | public int Disp; |
413 | public string Url; | 405 | public string Url; |
406 | public UUID newTextureID; | ||
414 | 407 | ||
415 | public DynamicTextureUpdater() | 408 | public DynamicTextureUpdater() |
416 | { | 409 | { |
417 | UpdateTimer = 0; | ||
418 | BodyData = null; | 410 | BodyData = null; |
419 | } | 411 | } |
420 | 412 | ||
@@ -436,16 +428,23 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
436 | // FIXME: Need to return the appropriate ID if only a single face is replaced. | 428 | // FIXME: Need to return the appropriate ID if only a single face is replaced. |
437 | oldID = tmptex.DefaultTexture.TextureID; | 429 | oldID = tmptex.DefaultTexture.TextureID; |
438 | 430 | ||
431 | // not using parts number of faces because that fails on old meshs | ||
439 | if (Face == ALL_SIDES) | 432 | if (Face == ALL_SIDES) |
440 | { | 433 | { |
441 | oldID = tmptex.DefaultTexture.TextureID; | 434 | oldID = tmptex.DefaultTexture.TextureID; |
442 | tmptex.DefaultTexture.TextureID = textureID; | 435 | tmptex.DefaultTexture.TextureID = textureID; |
436 | for(int i = 0; i < tmptex.FaceTextures.Length; i++) | ||
437 | { | ||
438 | if(tmptex.FaceTextures[i] != null) | ||
439 | tmptex.FaceTextures[i].TextureID = textureID; | ||
440 | } | ||
443 | } | 441 | } |
444 | else | 442 | else |
445 | { | 443 | { |
446 | try | 444 | try |
447 | { | 445 | { |
448 | Primitive.TextureEntryFace texface = tmptex.CreateFace((uint)Face); | 446 | Primitive.TextureEntryFace texface = tmptex.CreateFace((uint)Face); |
447 | oldID = texface.TextureID; | ||
449 | texface.TextureID = textureID; | 448 | texface.TextureID = textureID; |
450 | tmptex.FaceTextures[Face] = texface; | 449 | tmptex.FaceTextures[Face] = texface; |
451 | } | 450 | } |
@@ -455,10 +454,6 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
455 | } | 454 | } |
456 | } | 455 | } |
457 | 456 | ||
458 | // I'm pretty sure we always want to force this to true | ||
459 | // I'm pretty sure noone whats to set fullbright true if it wasn't true before. | ||
460 | // tmptex.DefaultTexture.Fullbright = true; | ||
461 | |||
462 | part.UpdateTextureEntry(tmptex.GetBytes()); | 457 | part.UpdateTextureEntry(tmptex.GetBytes()); |
463 | } | 458 | } |
464 | 459 | ||
@@ -491,13 +486,26 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
491 | 486 | ||
492 | if (BlendWithOldTexture) | 487 | if (BlendWithOldTexture) |
493 | { | 488 | { |
494 | Primitive.TextureEntryFace defaultFace = part.Shape.Textures.DefaultTexture; | 489 | Primitive.TextureEntryFace curFace; |
495 | if (defaultFace != null) | 490 | if(Face == ALL_SIDES) |
491 | curFace = part.Shape.Textures.DefaultTexture; | ||
492 | else | ||
493 | { | ||
494 | try | ||
495 | { | ||
496 | curFace = part.Shape.Textures.GetFace((uint)Face); | ||
497 | } | ||
498 | catch | ||
499 | { | ||
500 | curFace = null; | ||
501 | } | ||
502 | } | ||
503 | if (curFace != null) | ||
496 | { | 504 | { |
497 | oldAsset = scene.AssetService.Get(defaultFace.TextureID.ToString()); | 505 | oldAsset = scene.AssetService.Get(curFace.TextureID.ToString()); |
498 | 506 | ||
499 | if (oldAsset != null) | 507 | if (oldAsset != null) |
500 | assetData = BlendTextures(data, oldAsset.Data, SetNewFrontAlpha, FrontAlpha); | 508 | assetData = BlendTextures(data, oldAsset.Data, FrontAlpha); |
501 | } | 509 | } |
502 | } | 510 | } |
503 | 511 | ||
@@ -548,7 +556,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
548 | return asset.FullID; | 556 | return asset.FullID; |
549 | } | 557 | } |
550 | 558 | ||
551 | private byte[] BlendTextures(byte[] frontImage, byte[] backImage, bool setNewAlpha, byte newAlpha) | 559 | private byte[] BlendTextures(byte[] frontImage, byte[] backImage, byte newAlpha) |
552 | { | 560 | { |
553 | ManagedImage managedImage; | 561 | ManagedImage managedImage; |
554 | Image image; | 562 | Image image; |
@@ -568,7 +576,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
568 | Bitmap image2 = new Bitmap(image); | 576 | Bitmap image2 = new Bitmap(image); |
569 | image.Dispose(); | 577 | image.Dispose(); |
570 | 578 | ||
571 | if (setNewAlpha) | 579 | if (newAlpha < 255) |
572 | SetAlpha(ref image1, newAlpha); | 580 | SetAlpha(ref image1, newAlpha); |
573 | 581 | ||
574 | using(Bitmap joint = MergeBitMaps(image1, image2)) | 582 | using(Bitmap joint = MergeBitMaps(image1, image2)) |
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index b499b19..d342163 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs | |||
@@ -379,9 +379,9 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
379 | if (ThreadPool == null) | 379 | if (ThreadPool == null) |
380 | { | 380 | { |
381 | STPStartInfo startInfo = new STPStartInfo(); | 381 | STPStartInfo startInfo = new STPStartInfo(); |
382 | startInfo.IdleTimeout = 20000; | 382 | startInfo.IdleTimeout = 2000; |
383 | startInfo.MaxWorkerThreads = maxThreads; | 383 | startInfo.MaxWorkerThreads = maxThreads; |
384 | startInfo.MinWorkerThreads = 1; | 384 | startInfo.MinWorkerThreads = 0; |
385 | startInfo.ThreadPriority = ThreadPriority.BelowNormal; | 385 | startInfo.ThreadPriority = ThreadPriority.BelowNormal; |
386 | startInfo.StartSuspended = true; | 386 | startInfo.StartSuspended = true; |
387 | startInfo.ThreadPoolName = "ScriptsHttpReq"; | 387 | startInfo.ThreadPoolName = "ScriptsHttpReq"; |
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/Tests/VectorRenderModuleTests.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/Tests/VectorRenderModuleTests.cs index ed255bf..325f7f9 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/Tests/VectorRenderModuleTests.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/Tests/VectorRenderModuleTests.cs | |||
@@ -77,8 +77,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests | |||
77 | so.UUID, | 77 | so.UUID, |
78 | m_vrm.GetContentType(), | 78 | m_vrm.GetContentType(), |
79 | "PenColour BLACK; MoveTo 40,220; FontSize 32; Text Hello World;", | 79 | "PenColour BLACK; MoveTo 40,220; FontSize 32; Text Hello World;", |
80 | "", | 80 | ""); |
81 | 0); | ||
82 | 81 | ||
83 | Assert.That(originalTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); | 82 | Assert.That(originalTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); |
84 | } | 83 | } |
@@ -98,8 +97,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests | |||
98 | so.UUID, | 97 | so.UUID, |
99 | m_vrm.GetContentType(), | 98 | m_vrm.GetContentType(), |
100 | dtText, | 99 | dtText, |
101 | "", | 100 | ""); |
102 | 0); | ||
103 | 101 | ||
104 | UUID firstDynamicTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; | 102 | UUID firstDynamicTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; |
105 | 103 | ||
@@ -108,8 +106,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests | |||
108 | so.UUID, | 106 | so.UUID, |
109 | m_vrm.GetContentType(), | 107 | m_vrm.GetContentType(), |
110 | dtText, | 108 | dtText, |
111 | "", | 109 | ""); |
112 | 0); | ||
113 | 110 | ||
114 | Assert.That(firstDynamicTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); | 111 | Assert.That(firstDynamicTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); |
115 | } | 112 | } |
@@ -129,8 +126,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests | |||
129 | so.UUID, | 126 | so.UUID, |
130 | m_vrm.GetContentType(), | 127 | m_vrm.GetContentType(), |
131 | dtText, | 128 | dtText, |
132 | "", | 129 | ""); |
133 | 0); | ||
134 | 130 | ||
135 | UUID firstDynamicTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; | 131 | UUID firstDynamicTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; |
136 | 132 | ||
@@ -139,8 +135,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests | |||
139 | so.UUID, | 135 | so.UUID, |
140 | m_vrm.GetContentType(), | 136 | m_vrm.GetContentType(), |
141 | dtText, | 137 | dtText, |
142 | "alpha:250", | 138 | "alpha:250"); |
143 | 0); | ||
144 | 139 | ||
145 | Assert.That(firstDynamicTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); | 140 | Assert.That(firstDynamicTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); |
146 | } | 141 | } |
@@ -161,8 +156,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests | |||
161 | so.UUID, | 156 | so.UUID, |
162 | m_vrm.GetContentType(), | 157 | m_vrm.GetContentType(), |
163 | dtText, | 158 | dtText, |
164 | "", | 159 | ""); |
165 | 0); | ||
166 | 160 | ||
167 | UUID firstDynamicTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; | 161 | UUID firstDynamicTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; |
168 | 162 | ||
@@ -171,8 +165,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests | |||
171 | so.UUID, | 165 | so.UUID, |
172 | m_vrm.GetContentType(), | 166 | m_vrm.GetContentType(), |
173 | dtText, | 167 | dtText, |
174 | "", | 168 | ""); |
175 | 0); | ||
176 | 169 | ||
177 | Assert.That(firstDynamicTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); | 170 | Assert.That(firstDynamicTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); |
178 | } | 171 | } |
@@ -191,8 +184,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests | |||
191 | so.UUID, | 184 | so.UUID, |
192 | m_vrm.GetContentType(), | 185 | m_vrm.GetContentType(), |
193 | "PenColour BLACK; MoveTo 40,220; FontSize 32; Text Hello World;", | 186 | "PenColour BLACK; MoveTo 40,220; FontSize 32; Text Hello World;", |
194 | "", | 187 | ""); |
195 | 0); | ||
196 | 188 | ||
197 | Assert.That(originalTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); | 189 | Assert.That(originalTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); |
198 | } | 190 | } |
@@ -213,8 +205,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests | |||
213 | so.UUID, | 205 | so.UUID, |
214 | m_vrm.GetContentType(), | 206 | m_vrm.GetContentType(), |
215 | dtText, | 207 | dtText, |
216 | "", | 208 | ""); |
217 | 0); | ||
218 | 209 | ||
219 | UUID firstDynamicTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; | 210 | UUID firstDynamicTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; |
220 | 211 | ||
@@ -223,8 +214,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests | |||
223 | so.UUID, | 214 | so.UUID, |
224 | m_vrm.GetContentType(), | 215 | m_vrm.GetContentType(), |
225 | dtText, | 216 | dtText, |
226 | "", | 217 | ""); |
227 | 0); | ||
228 | 218 | ||
229 | Assert.That(firstDynamicTextureID, Is.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); | 219 | Assert.That(firstDynamicTextureID, Is.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); |
230 | } | 220 | } |
@@ -253,8 +243,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests | |||
253 | so.UUID, | 243 | so.UUID, |
254 | m_vrm.GetContentType(), | 244 | m_vrm.GetContentType(), |
255 | dtText, | 245 | dtText, |
256 | "1024", | 246 | "1024"); |
257 | 0); | ||
258 | 247 | ||
259 | UUID firstDynamicTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; | 248 | UUID firstDynamicTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; |
260 | 249 | ||
@@ -263,8 +252,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests | |||
263 | so.UUID, | 252 | so.UUID, |
264 | m_vrm.GetContentType(), | 253 | m_vrm.GetContentType(), |
265 | dtText, | 254 | dtText, |
266 | "1024", | 255 | "1024"); |
267 | 0); | ||
268 | 256 | ||
269 | Assert.That(firstDynamicTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); | 257 | Assert.That(firstDynamicTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); |
270 | } | 258 | } |
@@ -284,8 +272,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests | |||
284 | so.UUID, | 272 | so.UUID, |
285 | m_vrm.GetContentType(), | 273 | m_vrm.GetContentType(), |
286 | dtText, | 274 | dtText, |
287 | "", | 275 | ""); |
288 | 0); | ||
289 | 276 | ||
290 | UUID firstDynamicTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; | 277 | UUID firstDynamicTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; |
291 | 278 | ||
@@ -294,8 +281,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests | |||
294 | so.UUID, | 281 | so.UUID, |
295 | m_vrm.GetContentType(), | 282 | m_vrm.GetContentType(), |
296 | dtText, | 283 | dtText, |
297 | "alpha:250", | 284 | "alpha:250"); |
298 | 0); | ||
299 | 285 | ||
300 | Assert.That(firstDynamicTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); | 286 | Assert.That(firstDynamicTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); |
301 | } | 287 | } |
@@ -316,8 +302,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests | |||
316 | so.UUID, | 302 | so.UUID, |
317 | m_vrm.GetContentType(), | 303 | m_vrm.GetContentType(), |
318 | dtText, | 304 | dtText, |
319 | "", | 305 | ""); |
320 | 0); | ||
321 | 306 | ||
322 | UUID firstDynamicTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; | 307 | UUID firstDynamicTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; |
323 | 308 | ||
@@ -326,8 +311,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests | |||
326 | so.UUID, | 311 | so.UUID, |
327 | m_vrm.GetContentType(), | 312 | m_vrm.GetContentType(), |
328 | dtText, | 313 | dtText, |
329 | "", | 314 | ""); |
330 | 0); | ||
331 | 315 | ||
332 | Assert.That(firstDynamicTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); | 316 | Assert.That(firstDynamicTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); |
333 | } | 317 | } |
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index f12286d..8a26ab7 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | |||
@@ -355,30 +355,22 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
355 | lock (this) | 355 | lock (this) |
356 | { | 356 | { |
357 | if (alpha == 256) | 357 | if (alpha == 256) |
358 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppRgb); | ||
359 | else | ||
360 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb); | ||
361 | |||
362 | graph = Graphics.FromImage(bitmap); | ||
363 | |||
364 | // this is really just to save people filling the | ||
365 | // background color in their scripts, only do when fully opaque | ||
366 | if (alpha >= 255) | ||
367 | { | 358 | { |
359 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppRgb); | ||
360 | graph = Graphics.FromImage(bitmap); | ||
368 | using (SolidBrush bgFillBrush = new SolidBrush(bgColor)) | 361 | using (SolidBrush bgFillBrush = new SolidBrush(bgColor)) |
369 | { | 362 | { |
370 | graph.FillRectangle(bgFillBrush, 0, 0, width, height); | 363 | graph.FillRectangle(bgFillBrush, 0, 0, width, height); |
371 | } | 364 | } |
372 | } | 365 | } |
373 | 366 | else | |
374 | for (int w = 0; w < bitmap.Width; w++) | ||
375 | { | 367 | { |
376 | if (alpha <= 255) | 368 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb); |
369 | graph = Graphics.FromImage(bitmap); | ||
370 | Color newbg = Color.FromArgb(alpha,bgColor); | ||
371 | using (SolidBrush bgFillBrush = new SolidBrush(newbg)) | ||
377 | { | 372 | { |
378 | for (int h = 0; h < bitmap.Height; h++) | 373 | graph.FillRectangle(bgFillBrush, 0, 0, width, height); |
379 | { | ||
380 | bitmap.SetPixel(w, h, Color.FromArgb(alpha, bitmap.GetPixel(w, h))); | ||
381 | } | ||
382 | } | 374 | } |
383 | } | 375 | } |
384 | 376 | ||
@@ -519,8 +511,32 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
519 | 511 | ||
520 | // m_log.DebugFormat("[VECTOR RENDER MODULE]: Processing line '{0}'", nextLine); | 512 | // m_log.DebugFormat("[VECTOR RENDER MODULE]: Processing line '{0}'", nextLine); |
521 | 513 | ||
514 | if (nextLine.StartsWith("ResetTransf")) | ||
515 | { | ||
516 | graph.ResetTransform(); | ||
517 | } | ||
518 | else if (nextLine.StartsWith("TransTransf")) | ||
519 | { | ||
520 | float x = 0; | ||
521 | float y = 0; | ||
522 | GetParams(partsDelimiter, ref nextLine, 11, ref x, ref y); | ||
523 | graph.TranslateTransform(x, y); | ||
524 | } | ||
525 | else if (nextLine.StartsWith("ScaleTransf")) | ||
526 | { | ||
527 | float x = 0; | ||
528 | float y = 0; | ||
529 | GetParams(partsDelimiter, ref nextLine, 11, ref x, ref y); | ||
530 | graph.ScaleTransform(x, y); | ||
531 | } | ||
532 | else if (nextLine.StartsWith("RotTransf")) | ||
533 | { | ||
534 | float x = 0; | ||
535 | GetParams(partsDelimiter, ref nextLine, 9, ref x); | ||
536 | graph.RotateTransform(x); | ||
537 | } | ||
522 | //replace with switch, or even better, do some proper parsing | 538 | //replace with switch, or even better, do some proper parsing |
523 | if (nextLine.StartsWith("MoveTo")) | 539 | else if (nextLine.StartsWith("MoveTo")) |
524 | { | 540 | { |
525 | float x = 0; | 541 | float x = 0; |
526 | float y = 0; | 542 | float y = 0; |
@@ -625,6 +641,17 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
625 | startPoint.X += endPoint.X; | 641 | startPoint.X += endPoint.X; |
626 | startPoint.Y += endPoint.Y; | 642 | startPoint.Y += endPoint.Y; |
627 | } | 643 | } |
644 | else if (nextLine.StartsWith("FillEllipse")) | ||
645 | { | ||
646 | float x = 0; | ||
647 | float y = 0; | ||
648 | GetParams(partsDelimiter, ref nextLine, 11, ref x, ref y); | ||
649 | endPoint.X = (int)x; | ||
650 | endPoint.Y = (int)y; | ||
651 | graph.FillEllipse(myBrush, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y); | ||
652 | startPoint.X += endPoint.X; | ||
653 | startPoint.Y += endPoint.Y; | ||
654 | } | ||
628 | else if (nextLine.StartsWith("FontSize")) | 655 | else if (nextLine.StartsWith("FontSize")) |
629 | { | 656 | { |
630 | nextLine = nextLine.Remove(0, 8); | 657 | nextLine = nextLine.Remove(0, 8); |
@@ -790,6 +817,17 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
790 | } | 817 | } |
791 | } | 818 | } |
792 | 819 | ||
820 | private static void GetParams(char[] partsDelimiter, ref string line, int startLength, ref float x) | ||
821 | { | ||
822 | line = line.Remove(0, startLength); | ||
823 | string[] parts = line.Split(partsDelimiter); | ||
824 | if (parts.Length > 0) | ||
825 | { | ||
826 | string xVal = parts[0].Trim(); | ||
827 | x = Convert.ToSingle(xVal, CultureInfo.InvariantCulture); | ||
828 | } | ||
829 | } | ||
830 | |||
793 | private static void GetParams(char[] partsDelimiter, ref string line, int startLength, ref float x, ref float y) | 831 | private static void GetParams(char[] partsDelimiter, ref string line, int startLength, ref float x, ref float y) |
794 | { | 832 | { |
795 | line = line.Remove(0, startLength); | 833 | line = line.Remove(0, startLength); |
diff --git a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs index f68c5f8..6028eef 100644 --- a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs | |||
@@ -658,7 +658,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC | |||
658 | public void Process() | 658 | public void Process() |
659 | { | 659 | { |
660 | _finished = false; | 660 | _finished = false; |
661 | httpThread = WorkManager.StartThread(SendRequest, "HttpRequestThread", ThreadPriority.BelowNormal, true, false, null, int.MaxValue); | 661 | httpThread = WorkManager.StartThread(SendRequest, "XMLRPCreqThread", ThreadPriority.BelowNormal, true, false, null, int.MaxValue); |
662 | } | 662 | } |
663 | 663 | ||
664 | /* | 664 | /* |