diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index 0e7051e..d82551e 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | |||
@@ -35,6 +35,7 @@ using System.Net; | |||
35 | using Nini.Config; | 35 | using Nini.Config; |
36 | using OpenMetaverse; | 36 | using OpenMetaverse; |
37 | using OpenMetaverse.Imaging; | 37 | using OpenMetaverse.Imaging; |
38 | using OpenSim.Region.CoreModules.Scripting.DynamicTexture; | ||
38 | using OpenSim.Region.Framework.Interfaces; | 39 | using OpenSim.Region.Framework.Interfaces; |
39 | using OpenSim.Region.Framework.Scenes; | 40 | using OpenSim.Region.Framework.Scenes; |
40 | using log4net; | 41 | using log4net; |
@@ -85,20 +86,14 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
85 | // return lines.Any((str, r) => str.StartsWith("Image")); | 86 | // return lines.Any((str, r) => str.StartsWith("Image")); |
86 | // } | 87 | // } |
87 | 88 | ||
88 | public byte[] ConvertUrl(string url, string extraParams) | 89 | public IDynamicTexture ConvertUrl(string url, string extraParams) |
89 | { | 90 | { |
90 | return null; | 91 | return null; |
91 | } | 92 | } |
92 | 93 | ||
93 | public byte[] ConvertData(string bodyData, string extraParams) | 94 | public IDynamicTexture ConvertData(string bodyData, string extraParams) |
94 | { | 95 | { |
95 | bool reuseable; | 96 | return Draw(bodyData, extraParams); |
96 | return Draw(bodyData, extraParams, out reuseable); | ||
97 | } | ||
98 | |||
99 | private byte[] ConvertData(string bodyData, string extraParams, out bool reuseable) | ||
100 | { | ||
101 | return Draw(bodyData, extraParams, out reuseable); | ||
102 | } | 97 | } |
103 | 98 | ||
104 | public bool AsyncConvertUrl(UUID id, string url, string extraParams) | 99 | public bool AsyncConvertUrl(UUID id, string url, string extraParams) |
@@ -109,10 +104,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
109 | public bool AsyncConvertData(UUID id, string bodyData, string extraParams) | 104 | public bool AsyncConvertData(UUID id, string bodyData, string extraParams) |
110 | { | 105 | { |
111 | // XXX: This isn't actually being done asynchronously! | 106 | // XXX: This isn't actually being done asynchronously! |
112 | bool reuseable; | 107 | m_textureManager.ReturnData(id, ConvertData(bodyData, extraParams)); |
113 | byte[] data = ConvertData(bodyData, extraParams, out reuseable); | ||
114 | |||
115 | m_textureManager.ReturnData(id, data, reuseable); | ||
116 | 108 | ||
117 | return true; | 109 | return true; |
118 | } | 110 | } |
@@ -191,7 +183,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
191 | 183 | ||
192 | #endregion | 184 | #endregion |
193 | 185 | ||
194 | private byte[] Draw(string data, string extraParams, out bool reuseable) | 186 | private IDynamicTexture Draw(string data, string extraParams) |
195 | { | 187 | { |
196 | // We need to cater for old scripts that didnt use extraParams neatly, they use either an integer size which represents both width and height, or setalpha | 188 | // We need to cater for old scripts that didnt use extraParams neatly, they use either an integer size which represents both width and height, or setalpha |
197 | // we will now support multiple comma seperated params in the form width:256,height:512,alpha:255 | 189 | // we will now support multiple comma seperated params in the form width:256,height:512,alpha:255 |
@@ -334,6 +326,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
334 | 326 | ||
335 | Bitmap bitmap = null; | 327 | Bitmap bitmap = null; |
336 | Graphics graph = null; | 328 | Graphics graph = null; |
329 | bool reuseable = false; | ||
337 | 330 | ||
338 | try | 331 | try |
339 | { | 332 | { |
@@ -396,7 +389,8 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
396 | e.Message, e.StackTrace); | 389 | e.Message, e.StackTrace); |
397 | } | 390 | } |
398 | 391 | ||
399 | return imageJ2000; | 392 | return new OpenSim.Region.CoreModules.Scripting.DynamicTexture.DynamicTexture( |
393 | data, extraParams, imageJ2000, new Size(width, height), reuseable); | ||
400 | } | 394 | } |
401 | finally | 395 | finally |
402 | { | 396 | { |