aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2015-12-24 11:20:46 +0000
committerUbitUmarov2015-12-24 11:20:46 +0000
commit7430c629aa72e5947153af8362105133f2f4b9b9 (patch)
tree6196cfb215d027fb8a7843d277acfc200dc50306
parent add prim estimated center of mass correction also for tortured prims meshs. ... (diff)
downloadopensim-SC_OLD-7430c629aa72e5947153af8362105133f2f4b9b9.zip
opensim-SC_OLD-7430c629aa72e5947153af8362105133f2f4b9b9.tar.gz
opensim-SC_OLD-7430c629aa72e5947153af8362105133f2f4b9b9.tar.bz2
opensim-SC_OLD-7430c629aa72e5947153af8362105133f2f4b9b9.tar.xz
enable the upload region map texture asset for large regions for large regions that i had disabled, but with max size reduced to 512pixels. New viewers don't use this, but osGetRegionMapTexture needs it ( mantis 7787 )
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs31
1 files changed, 26 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index b8645e2..6f10f51 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -1544,16 +1544,37 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1544 needRegionSave = true; 1544 needRegionSave = true;
1545 } 1545 }
1546 1546
1547 // bypass terrain image for large regions 1547 if(mapbmp != null)
1548 if (m_scene.RegionInfo.RegionSizeX <= Constants.RegionSize &&
1549 m_scene.RegionInfo.RegionSizeY <= Constants.RegionSize
1550 && mapbmp != null)
1551 { 1548 {
1552 try 1549 try
1553 { 1550 {
1554 byte[] data; 1551 byte[] data;
1555 1552
1556 data = OpenJPEG.EncodeFromImage(mapbmp, true); 1553 // if large region limit its size since new viewers will not use it
1554 // but it is still usable for ossl
1555 if(m_scene.RegionInfo.RegionSizeX > Constants.RegionSize ||
1556 m_scene.RegionInfo.RegionSizeY > Constants.RegionSize)
1557 {
1558 int bx = mapbmp.Width;
1559 int by = mapbmp.Height;
1560 int mb = bx;
1561 if(mb < by)
1562 mb = by;
1563 if(mb > 2 * Constants.RegionSize && mb > 0)
1564 {
1565 float scale = 2.0f * (float)Constants.RegionSize/(float)mb;
1566 Size newsize = new Size();
1567 newsize.Width = (int)(bx * scale);
1568 newsize.Height = (int)(by * scale);
1569
1570 using(Bitmap scaledbmp = new Bitmap(mapbmp,newsize))
1571 data = OpenJPEG.EncodeFromImage(scaledbmp, true);
1572 }
1573 else
1574 data = OpenJPEG.EncodeFromImage(mapbmp, true);
1575 }
1576 else
1577 data = OpenJPEG.EncodeFromImage(mapbmp, true);
1557 1578
1558 if (data != null && data.Length > 0) 1579 if (data != null && data.Length > 0)
1559 { 1580 {