Fix another compiler warning, based on a patch submitted by Leaf. (bug #1978)

0.6.0-stable
Jeff Ames 2008-08-18 01:30:42 +00:00
parent 6bdbf30906
commit 84a0a6645e
2 changed files with 79 additions and 78 deletions

View File

@ -253,11 +253,10 @@ namespace OpenSim.Region.DataSnapshot
private String GetRegionCategory(Scene scene) private String GetRegionCategory(Scene scene)
{ {
//Boolean choice between: //Boolean choice between:
// "PG" - Mormontown // "PG" - Mormontown
// "Mature" - Sodom and Gomorrah // "Mature" - Sodom and Gomorrah
// (Depreciated) "Patriotic Nigra Testing Sandbox" - Abandon Hope All Ye Who Enter Here // (Deprecated) "Patriotic Nigra Testing Sandbox" - Abandon Hope All Ye Who Enter Here
if (scene.RegionInfo.RegionSettings.Maturity == 1) if (scene.RegionInfo.RegionSettings.Maturity == 1)
{ {
return "Mature"; return "Mature";

View File

@ -118,45 +118,46 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
#endregion #endregion
private void ShadeBuildings(Bitmap map) // TODO: unused:
{ // private void ShadeBuildings(Bitmap map)
lock (map) // {
{ // lock (map)
lock (m_scene.Entities) // {
{ // lock (m_scene.Entities)
foreach (EntityBase entity in m_scene.Entities.Values) // {
{ // foreach (EntityBase entity in m_scene.Entities.Values)
if (entity is SceneObjectGroup) // {
{ // if (entity is SceneObjectGroup)
SceneObjectGroup sog = (SceneObjectGroup) entity; // {
// SceneObjectGroup sog = (SceneObjectGroup) entity;
foreach (SceneObjectPart primitive in sog.Children.Values) //
{ // foreach (SceneObjectPart primitive in sog.Children.Values)
int x = (int) (primitive.AbsolutePosition.X - (primitive.Scale.X / 2)); // {
int y = (int) (primitive.AbsolutePosition.Y - (primitive.Scale.Y / 2)); // int x = (int) (primitive.AbsolutePosition.X - (primitive.Scale.X / 2));
int w = (int) primitive.Scale.X; // int y = (int) (primitive.AbsolutePosition.Y - (primitive.Scale.Y / 2));
int h = (int) primitive.Scale.Y; // int w = (int) primitive.Scale.X;
// int h = (int) primitive.Scale.Y;
int dx; //
for (dx = x; dx < x + w; dx++) // int dx;
{ // for (dx = x; dx < x + w; dx++)
int dy; // {
for (dy = y; dy < y + h; dy++) // int dy;
{ // for (dy = y; dy < y + h; dy++)
if (x < 0 || y < 0) // {
continue; // if (x < 0 || y < 0)
if (x >= map.Width || y >= map.Height) // continue;
continue; // if (x >= map.Width || y >= map.Height)
// continue;
map.SetPixel(dx, dy, Color.DarkGray); //
} // map.SetPixel(dx, dy, Color.DarkGray);
} // }
} // }
} // }
} // }
} // }
} // }
} // }
// }
private Bitmap TerrainToBitmap2(Scene whichScene, Bitmap mapbmp) private Bitmap TerrainToBitmap2(Scene whichScene, Bitmap mapbmp)
{ {
@ -532,42 +533,43 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
return mapbmp; return mapbmp;
} }
# region Depreciated Maptile Generation. Adam may update this // TODO: unused:
private Bitmap TerrainToBitmap(string gradientmap) // #region Deprecated Maptile Generation. Adam may update this
{ // private Bitmap TerrainToBitmap(string gradientmap)
Bitmap gradientmapLd = new Bitmap(gradientmap); // {
// Bitmap gradientmapLd = new Bitmap(gradientmap);
int pallete = gradientmapLd.Height; //
// int pallete = gradientmapLd.Height;
Bitmap bmp = new Bitmap(m_scene.Heightmap.Width, m_scene.Heightmap.Height); //
Color[] colours = new Color[pallete]; // Bitmap bmp = new Bitmap(m_scene.Heightmap.Width, m_scene.Heightmap.Height);
// Color[] colours = new Color[pallete];
for (int i = 0; i < pallete; i++) //
{ // for (int i = 0; i < pallete; i++)
colours[i] = gradientmapLd.GetPixel(0, i); // {
} // colours[i] = gradientmapLd.GetPixel(0, i);
// }
lock (m_scene.Heightmap) //
{ // lock (m_scene.Heightmap)
ITerrainChannel copy = m_scene.Heightmap; // {
for (int y = 0; y < copy.Height; y++) // ITerrainChannel copy = m_scene.Heightmap;
{ // for (int y = 0; y < copy.Height; y++)
for (int x = 0; x < copy.Width; x++) // {
{ // for (int x = 0; x < copy.Width; x++)
// 512 is the largest possible height before colours clamp // {
int colorindex = (int) (Math.Max(Math.Min(1.0, copy[x, y] / 512.0), 0.0) * (pallete - 1)); // // 512 is the largest possible height before colours clamp
// int colorindex = (int) (Math.Max(Math.Min(1.0, copy[x, y] / 512.0), 0.0) * (pallete - 1));
// Handle error conditions //
if (colorindex > pallete - 1 || colorindex < 0) // // Handle error conditions
bmp.SetPixel(x, copy.Height - y - 1, Color.Red); // if (colorindex > pallete - 1 || colorindex < 0)
else // bmp.SetPixel(x, copy.Height - y - 1, Color.Red);
bmp.SetPixel(x, copy.Height - y - 1, colours[colorindex]); // else
} // bmp.SetPixel(x, copy.Height - y - 1, colours[colorindex]);
} // }
ShadeBuildings(bmp); // }
return bmp; // ShadeBuildings(bmp);
} // return bmp;
} // }
#endregion // }
// #endregion
} }
} }