* Insulate maptile volume draw routine against TextureEntry oddities.

0.6.0-stable
Teravus Ovares 2008-06-12 11:06:31 +00:00
parent 2b6487c832
commit 049cfe80e4
1 changed files with 28 additions and 14 deletions

View File

@ -1168,24 +1168,38 @@ namespace OpenSim.Region.Environment.Scenes
// Draw if the object is at least 1 meter wide in any direction
if (part.Scale.X > 1f || part.Scale.Y > 1f || part.Scale.Z > 1f)
{
LLColor texcolor = part.Shape.Textures.DefaultTexture.RGBA;
int colorr = 255 - (int)(texcolor.R * 255f);
int colorg = 255 - (int)(texcolor.G * 255f);
int colorb = 255 - (int)(texcolor.B * 255f);
if (colorr == 255 && colorg == 255 && colorb == 255)
{ }
else
// Try to get the RGBA of the default texture entry..
//
try
{
try
{
// If the color gets goofy somehow, skip it *shakes fist at LLColor
mapdotspot = Color.FromArgb(colorr, colorg, colorb);
}
catch (ArgumentException)
LLColor texcolor = part.Shape.Textures.DefaultTexture.RGBA;
int colorr = 255 - (int)(texcolor.R * 255f);
int colorg = 255 - (int)(texcolor.G * 255f);
int colorb = 255 - (int)(texcolor.B * 255f);
if (colorr == 255 && colorg == 255 && colorb == 255)
{ }
else
{
//Try to set the map spot color
try
{
// If the color gets goofy somehow, skip it *shakes fist at LLColor
mapdotspot = Color.FromArgb(colorr, colorg, colorb);
}
catch (ArgumentException)
{
}
}
}
catch (IndexOutOfRangeException)
{
// Windows Array
}
catch (ArgumentOutOfRangeException)
{
// Mono Array
}
LLVector3 pos = part.GetWorldPosition();