aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorUbitUmarov2017-06-24 07:39:22 +0100
committerUbitUmarov2017-06-24 07:39:22 +0100
commit8d1dd44edb187429b5a26ca56fc2d53766f710c7 (patch)
treedfeba90d7efd6e52c3ce51f43f74876c4095167e /OpenSim/Region/CoreModules
parentchange thread level of osSetDynamicTextureDataBlendFace to VeryHigh (diff)
downloadopensim-SC_OLD-8d1dd44edb187429b5a26ca56fc2d53766f710c7.zip
opensim-SC_OLD-8d1dd44edb187429b5a26ca56fc2d53766f710c7.tar.gz
opensim-SC_OLD-8d1dd44edb187429b5a26ca56fc2d53766f710c7.tar.bz2
opensim-SC_OLD-8d1dd44edb187429b5a26ca56fc2d53766f710c7.tar.xz
simplify vectorrender background draw
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs26
1 files changed, 9 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
index 5d4d0f5..a3b53be 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