diff options
author | Melanie | 2012-03-31 02:31:57 +0100 |
---|---|---|
committer | Melanie | 2012-03-31 02:31:57 +0100 |
commit | a6c26b093c3c8aa392cb0ce029527311882d23c4 (patch) | |
tree | d9a13587fe25b0b6bfd39d82724d6d534e1f1b8a /OpenSim/Region/CoreModules | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Implement bulk inventory update over CAPS (not recursive by design, (diff) | |
download | opensim-SC_OLD-a6c26b093c3c8aa392cb0ce029527311882d23c4.zip opensim-SC_OLD-a6c26b093c3c8aa392cb0ce029527311882d23c4.tar.gz opensim-SC_OLD-a6c26b093c3c8aa392cb0ce029527311882d23c4.tar.bz2 opensim-SC_OLD-a6c26b093c3c8aa392cb0ce029527311882d23c4.tar.xz |
Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs | 19 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs | 30 |
2 files changed, 33 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs index 6d3ace9..3b862da 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs | |||
@@ -93,8 +93,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
93 | if (config == null) | 93 | if (config == null) |
94 | return; | 94 | return; |
95 | 95 | ||
96 | int refreshminutes = Convert.ToInt32(config.GetString("RefreshTime")); | 96 | int refreshminutes = Convert.ToInt32(config.GetString("RefreshTime", "-1")); |
97 | if (refreshminutes <= 0) | 97 | if (refreshminutes < 0) |
98 | { | 98 | { |
99 | m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: No refresh time given in config. Module disabled."); | 99 | m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: No refresh time given in config. Module disabled."); |
100 | return; | 100 | return; |
@@ -117,12 +117,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
117 | return; | 117 | return; |
118 | } | 118 | } |
119 | 119 | ||
120 | m_refreshTimer.Enabled = true; | 120 | if (m_refreshtime > 0) |
121 | m_refreshTimer.AutoReset = true; | 121 | { |
122 | m_refreshTimer.Interval = m_refreshtime; | 122 | m_refreshTimer.Enabled = true; |
123 | m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh); | 123 | m_refreshTimer.AutoReset = true; |
124 | m_refreshTimer.Interval = m_refreshtime; | ||
125 | m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh); | ||
126 | } | ||
124 | 127 | ||
125 | m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0}min and service object {1}", | 128 | m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0} min and service object {1}", |
126 | refreshminutes, service); | 129 | refreshminutes, service); |
127 | 130 | ||
128 | m_enabled = true; | 131 | m_enabled = true; |
@@ -238,4 +241,4 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
238 | } | 241 | } |
239 | } | 242 | } |
240 | } | 243 | } |
241 | } \ No newline at end of file | 244 | } |
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs index 6163fd1..e6f2855 100644 --- a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs | |||
@@ -64,6 +64,9 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
64 | private bool m_useAntiAliasing = false; // TODO: Make this a config option | 64 | private bool m_useAntiAliasing = false; // TODO: Make this a config option |
65 | private bool m_Enabled = false; | 65 | private bool m_Enabled = false; |
66 | 66 | ||
67 | private Bitmap lastImage = null; | ||
68 | private DateTime lastImageTime = DateTime.MinValue; | ||
69 | |||
67 | #region IRegionModule Members | 70 | #region IRegionModule Members |
68 | 71 | ||
69 | public void Initialise(IConfigSource source) | 72 | public void Initialise(IConfigSource source) |
@@ -86,14 +89,9 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
86 | 89 | ||
87 | List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory()); | 90 | List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory()); |
88 | if (renderers.Count > 0) | 91 | if (renderers.Count > 0) |
89 | { | 92 | m_log.Info("[MAPTILE]: Loaded prim mesher " + renderers[0]); |
90 | m_primMesher = RenderingLoader.LoadRenderer(renderers[0]); | ||
91 | m_log.Info("[MAPTILE]: Loaded prim mesher " + m_primMesher.ToString()); | ||
92 | } | ||
93 | else | 93 | else |
94 | { | ||
95 | m_log.Info("[MAPTILE]: No prim mesher loaded, prim rendering will be disabled"); | 94 | m_log.Info("[MAPTILE]: No prim mesher loaded, prim rendering will be disabled"); |
96 | } | ||
97 | 95 | ||
98 | m_scene.RegisterModuleInterface<IMapImageGenerator>(this); | 96 | m_scene.RegisterModuleInterface<IMapImageGenerator>(this); |
99 | } | 97 | } |
@@ -126,9 +124,25 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
126 | 124 | ||
127 | public Bitmap CreateMapTile() | 125 | public Bitmap CreateMapTile() |
128 | { | 126 | { |
127 | if ((DateTime.Now - lastImageTime).TotalSeconds < 3600) | ||
128 | { | ||
129 | return lastImage.Clone(new Rectangle(0, 0, 256, 256), lastImage.PixelFormat); | ||
130 | } | ||
131 | |||
132 | List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory()); | ||
133 | if (renderers.Count > 0) | ||
134 | { | ||
135 | m_primMesher = RenderingLoader.LoadRenderer(renderers[0]); | ||
136 | } | ||
137 | |||
129 | Vector3 camPos = new Vector3(127.5f, 127.5f, 221.7025033688163f); | 138 | Vector3 camPos = new Vector3(127.5f, 127.5f, 221.7025033688163f); |
130 | Viewport viewport = new Viewport(camPos, -Vector3.UnitZ, 1024f, 0.1f, (int)Constants.RegionSize, (int)Constants.RegionSize, (float)Constants.RegionSize, (float)Constants.RegionSize); | 139 | Viewport viewport = new Viewport(camPos, -Vector3.UnitZ, 1024f, 0.1f, (int)Constants.RegionSize, (int)Constants.RegionSize, (float)Constants.RegionSize, (float)Constants.RegionSize); |
131 | return CreateMapTile(viewport, false); | 140 | Bitmap tile = CreateMapTile(viewport, false); |
141 | m_primMesher = null; | ||
142 | |||
143 | lastImage = tile; | ||
144 | lastImageTime = DateTime.Now; | ||
145 | return lastImage.Clone(new Rectangle(0, 0, 256, 256), lastImage.PixelFormat); | ||
132 | } | 146 | } |
133 | 147 | ||
134 | public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures) | 148 | public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures) |
@@ -655,4 +669,4 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
655 | return result; | 669 | return result; |
656 | } | 670 | } |
657 | } | 671 | } |
658 | } \ No newline at end of file | 672 | } |