diff options
author | Teravus Ovares | 2009-01-22 09:31:01 +0000 |
---|---|---|
committer | Teravus Ovares | 2009-01-22 09:31:01 +0000 |
commit | a7ccbb3de0405c14ea9b6cd46f23f66471212e9e (patch) | |
tree | 23b439c47adee1c6c023d684bfc7b492c9eaee9e /OpenSim/Region/Environment | |
parent | * Adds a Scene Getter property called SceneContents for the Scene's m_sceneGr... (diff) | |
download | opensim-SC-a7ccbb3de0405c14ea9b6cd46f23f66471212e9e.zip opensim-SC-a7ccbb3de0405c14ea9b6cd46f23f66471212e9e.tar.gz opensim-SC-a7ccbb3de0405c14ea9b6cd46f23f66471212e9e.tar.bz2 opensim-SC-a7ccbb3de0405c14ea9b6cd46f23f66471212e9e.tar.xz |
* Added some more comments
* Fixed up an outgoing packet
* I <3 OpenSimulator
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Agent/TextureSender/J2KDecoderModule.cs | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/Environment/Modules/Agent/TextureSender/J2KDecoderModule.cs index 518766e..2a565ee 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureSender/J2KDecoderModule.cs | |||
@@ -256,6 +256,10 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
256 | private static readonly ILog m_log | 256 | private static readonly ILog m_log |
257 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 257 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
258 | 258 | ||
259 | /// <summary> | ||
260 | /// Creates a new instance of a file cache | ||
261 | /// </summary> | ||
262 | /// <param name="pFolder">base folder for the cache. Will be created if it doesn't exist</param> | ||
259 | public J2KDecodeFileCache(string pFolder) | 263 | public J2KDecodeFileCache(string pFolder) |
260 | { | 264 | { |
261 | m_cacheDecodeFolder = pFolder; | 265 | m_cacheDecodeFolder = pFolder; |
@@ -266,6 +270,12 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
266 | 270 | ||
267 | } | 271 | } |
268 | 272 | ||
273 | /// <summary> | ||
274 | /// Save Layers to Disk Cache | ||
275 | /// </summary> | ||
276 | /// <param name="AssetId">Asset to Save the layers. Used int he file name by default</param> | ||
277 | /// <param name="Layers">The Layer Data from OpenJpeg</param> | ||
278 | /// <returns></returns> | ||
269 | public bool SaveFileCacheForAsset(UUID AssetId, OpenJPEG.J2KLayerInfo[] Layers) | 279 | public bool SaveFileCacheForAsset(UUID AssetId, OpenJPEG.J2KLayerInfo[] Layers) |
270 | { | 280 | { |
271 | if (Layers.Length > 0 && enabled) | 281 | if (Layers.Length > 0 && enabled) |
@@ -295,7 +305,13 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
295 | } | 305 | } |
296 | 306 | ||
297 | 307 | ||
298 | 308 | /// <summary> | |
309 | /// Loads the Layer data from the disk cache | ||
310 | /// Returns true if load succeeded | ||
311 | /// </summary> | ||
312 | /// <param name="AssetId">AssetId that we're checking the cache for</param> | ||
313 | /// <param name="Layers">out layers to save to</param> | ||
314 | /// <returns>true if load succeeded</returns> | ||
299 | public bool TryLoadCacheForAsset(UUID AssetId, out OpenJPEG.J2KLayerInfo[] Layers) | 315 | public bool TryLoadCacheForAsset(UUID AssetId, out OpenJPEG.J2KLayerInfo[] Layers) |
300 | { | 316 | { |
301 | string filename = String.Format("{0}/{1}", m_cacheDecodeFolder, FileNameFromAssetId(AssetId)); | 317 | string filename = String.Format("{0}/{1}", m_cacheDecodeFolder, FileNameFromAssetId(AssetId)); |
@@ -428,11 +444,20 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
428 | return true; | 444 | return true; |
429 | } | 445 | } |
430 | 446 | ||
447 | /// <summary> | ||
448 | /// Routine which converts assetid to file name | ||
449 | /// </summary> | ||
450 | /// <param name="AssetId">asset id of the image</param> | ||
451 | /// <returns>string filename</returns> | ||
431 | public string FileNameFromAssetId(UUID AssetId) | 452 | public string FileNameFromAssetId(UUID AssetId) |
432 | { | 453 | { |
433 | return String.Format("j2kCache_{0}.cache", AssetId); | 454 | return String.Format("j2kCache_{0}.cache", AssetId); |
434 | } | 455 | } |
435 | 456 | ||
457 | /// <summary> | ||
458 | /// Creates the Cache Folder | ||
459 | /// </summary> | ||
460 | /// <param name="pFolder">Folder to Create</param> | ||
436 | public void Createj2KCacheFolder(string pFolder) | 461 | public void Createj2KCacheFolder(string pFolder) |
437 | { | 462 | { |
438 | try | 463 | try |