diff options
author | Homer Horwitz | 2008-11-17 22:15:02 +0000 |
---|---|---|
committer | Homer Horwitz | 2008-11-17 22:15:02 +0000 |
commit | 5972eb8848ecd1033e987706e404abdc79bfa5e6 (patch) | |
tree | 3bc47d86c3093e2a4c34d24e8d61cd9db0092212 /OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs | |
parent | Set group on newly rezzed objects to the rezzer's (or rezzing object's) (diff) | |
download | opensim-SC_OLD-5972eb8848ecd1033e987706e404abdc79bfa5e6.zip opensim-SC_OLD-5972eb8848ecd1033e987706e404abdc79bfa5e6.tar.gz opensim-SC_OLD-5972eb8848ecd1033e987706e404abdc79bfa5e6.tar.bz2 opensim-SC_OLD-5972eb8848ecd1033e987706e404abdc79bfa5e6.tar.xz |
Fix a few small issues with the progressive texture-download:
- The initial priority wasn't passed in, so a discardLevel of -1 in the first
request automatically cancelled texture-download.
- One-packet textures weren't handled, as CurrentPacket starts at 1 and
StopPacket == 0 in that case.
- Increased MAX_ALLOWED_TEXTURE_REQUESTS to 15; incremental texture downloads
will cause more requests.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs index 265247c..53be7c5 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs | |||
@@ -146,15 +146,17 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
146 | private bool sendFirstPacket = false; | 146 | private bool sendFirstPacket = false; |
147 | private int initialDiscardLevel = 0; | 147 | private int initialDiscardLevel = 0; |
148 | private int initialPacketNum = 0; | 148 | private int initialPacketNum = 0; |
149 | private float initialPriority = 0.0f; | ||
149 | 150 | ||
150 | private ImageDownload download; | 151 | private ImageDownload download; |
151 | private IClientAPI RequestUser; | 152 | private IClientAPI RequestUser; |
152 | 153 | ||
153 | public TextureSender(IClientAPI client, int discardLevel, uint packetNumber) | 154 | public TextureSender(IClientAPI client, int discardLevel, uint packetNumber, float priority) |
154 | { | 155 | { |
155 | RequestUser = client; | 156 | RequestUser = client; |
156 | initialDiscardLevel = discardLevel; | 157 | initialDiscardLevel = discardLevel; |
157 | initialPacketNum = (int)packetNumber; | 158 | initialPacketNum = (int)packetNumber; |
159 | initialPriority = priority; | ||
158 | } | 160 | } |
159 | 161 | ||
160 | #region ITextureSender Members | 162 | #region ITextureSender Members |
@@ -193,7 +195,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
193 | // See ITextureSender | 195 | // See ITextureSender |
194 | public bool SendTexturePacket() | 196 | public bool SendTexturePacket() |
195 | { | 197 | { |
196 | if (!m_cancel && download.CurrentPacket <= download.StopPacket) | 198 | if (!m_cancel && (sendFirstPacket || download.CurrentPacket <= download.StopPacket)) |
197 | { | 199 | { |
198 | SendPacket(); | 200 | SendPacket(); |
199 | return false; | 201 | return false; |
@@ -224,7 +226,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
224 | OpenMetaverse.AssetTexture texture = new OpenMetaverse.AssetTexture(m_asset.FullID, m_asset.Data); | 226 | OpenMetaverse.AssetTexture texture = new OpenMetaverse.AssetTexture(m_asset.FullID, m_asset.Data); |
225 | if (texture.DecodeLayerBoundaries()) | 227 | if (texture.DecodeLayerBoundaries()) |
226 | { | 228 | { |
227 | download = new ImageDownload(texture, initialDiscardLevel, 0.0f, initialPacketNum); | 229 | download = new ImageDownload(texture, initialDiscardLevel, initialPriority, initialPacketNum); |
228 | ImageLoaded = true; | 230 | ImageLoaded = true; |
229 | m_sending = true; | 231 | m_sending = true; |
230 | m_cancel = false; | 232 | m_cancel = false; |
@@ -258,15 +260,15 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
258 | { | 260 | { |
259 | sendFirstPacket = false; | 261 | sendFirstPacket = false; |
260 | 262 | ||
261 | if (m_asset.Data.Length <= 600) | 263 | if (m_asset.Data.Length <= ImageDownload.FIRST_IMAGE_PACKET_SIZE) |
262 | { | 264 | { |
263 | RequestUser.SendImageFirstPart(1, m_asset.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2); | 265 | RequestUser.SendImageFirstPart(1, m_asset.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2); |
264 | return; | 266 | return; |
265 | } | 267 | } |
266 | else | 268 | else |
267 | { | 269 | { |
268 | byte[] firstImageData = new byte[600]; | 270 | byte[] firstImageData = new byte[ImageDownload.FIRST_IMAGE_PACKET_SIZE]; |
269 | Buffer.BlockCopy(m_asset.Data, 0, firstImageData, 0, 600); | 271 | Buffer.BlockCopy(m_asset.Data, 0, firstImageData, 0, ImageDownload.FIRST_IMAGE_PACKET_SIZE); |
270 | RequestUser.SendImageFirstPart((ushort)download.TexturePacketCount(), m_asset.FullID, (uint)m_asset.Data.Length, firstImageData, 2); | 272 | RequestUser.SendImageFirstPart((ushort)download.TexturePacketCount(), m_asset.FullID, (uint)m_asset.Data.Length, firstImageData, 2); |
271 | } | 273 | } |
272 | } | 274 | } |