diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs index 2bbc6c7..8aa2ff3 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs | |||
@@ -102,7 +102,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
102 | { | 102 | { |
103 | m_currentPacket = 2; | 103 | m_currentPacket = 2; |
104 | } | 104 | } |
105 | 105 | ||
106 | while (sendMore && packetsSent < packetsToSend && m_currentPacket <= m_stopPacket) | 106 | while (sendMore && packetsSent < packetsToSend && m_currentPacket <= m_stopPacket) |
107 | { | 107 | { |
108 | sendMore = SendPacket(client); | 108 | sendMore = SendPacket(client); |
@@ -114,17 +114,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
114 | return (m_currentPacket > m_stopPacket); | 114 | return (m_currentPacket > m_stopPacket); |
115 | } | 115 | } |
116 | 116 | ||
117 | /// <summary> | ||
118 | /// This is where we decide what we need to update | ||
119 | /// and assign the real discardLevel and packetNumber | ||
120 | /// assuming of course that the connected client might be bonkers | ||
121 | /// </summary> | ||
117 | public void RunUpdate() | 122 | public void RunUpdate() |
118 | { | 123 | { |
119 | //This is where we decide what we need to update | ||
120 | //and assign the real discardLevel and packetNumber | ||
121 | //assuming of course that the connected client might be bonkers | ||
122 | |||
123 | if (!HasAsset) | 124 | if (!HasAsset) |
124 | { | 125 | { |
125 | if (!m_assetRequested) | 126 | if (!m_assetRequested) |
126 | { | 127 | { |
127 | m_assetRequested = true; | 128 | m_assetRequested = true; |
129 | // m_log.DebugFormat("[J2KIMAGE]: Requesting asset {0}", TextureID); | ||
128 | AssetService.Get(TextureID.ToString(), this, AssetReceived); | 130 | AssetService.Get(TextureID.ToString(), this, AssetReceived); |
129 | } | 131 | } |
130 | } | 132 | } |
@@ -137,6 +139,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
137 | { | 139 | { |
138 | //Request decode | 140 | //Request decode |
139 | m_decodeRequested = true; | 141 | m_decodeRequested = true; |
142 | |||
143 | // m_log.DebugFormat("[J2KIMAGE]: Requesting decode of asset {0}", TextureID); | ||
144 | |||
140 | // Do we have a jpeg decoder? | 145 | // Do we have a jpeg decoder? |
141 | if (J2KDecoder != null) | 146 | if (J2KDecoder != null) |
142 | { | 147 | { |
@@ -149,7 +154,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
149 | // Send it off to the jpeg decoder | 154 | // Send it off to the jpeg decoder |
150 | J2KDecoder.BeginDecode(TextureID, m_asset, J2KDecodedCallback); | 155 | J2KDecoder.BeginDecode(TextureID, m_asset, J2KDecodedCallback); |
151 | } | 156 | } |
152 | |||
153 | } | 157 | } |
154 | else | 158 | else |
155 | { | 159 | { |
@@ -331,14 +335,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
331 | { | 335 | { |
332 | if (m_currentPacket == 0) | 336 | if (m_currentPacket == 0) |
333 | return 0; | 337 | return 0; |
338 | |||
334 | if (m_currentPacket == 1) | 339 | if (m_currentPacket == 1) |
335 | return FIRST_PACKET_SIZE; | 340 | return FIRST_PACKET_SIZE; |
336 | 341 | ||
337 | int result = FIRST_PACKET_SIZE + ((int)m_currentPacket - 2) * IMAGE_PACKET_SIZE; | 342 | int result = FIRST_PACKET_SIZE + ((int)m_currentPacket - 2) * IMAGE_PACKET_SIZE; |
343 | |||
338 | if (result < 0) | 344 | if (result < 0) |
339 | { | ||
340 | result = FIRST_PACKET_SIZE; | 345 | result = FIRST_PACKET_SIZE; |
341 | } | 346 | |
342 | return result; | 347 | return result; |
343 | } | 348 | } |
344 | 349 | ||
@@ -377,7 +382,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
377 | { | 382 | { |
378 | UUID assetID = UUID.Zero; | 383 | UUID assetID = UUID.Zero; |
379 | if (asset != null) | 384 | if (asset != null) |
385 | { | ||
380 | assetID = asset.FullID; | 386 | assetID = asset.FullID; |
387 | } | ||
381 | else if ((InventoryAccessModule != null) && (sender != InventoryAccessModule)) | 388 | else if ((InventoryAccessModule != null) && (sender != InventoryAccessModule)) |
382 | { | 389 | { |
383 | // Unfortunately we need this here, there's no other way. | 390 | // Unfortunately we need this here, there's no other way. |
@@ -398,7 +405,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
398 | } | 405 | } |
399 | 406 | ||
400 | AssetDataCallback(assetID, asset); | 407 | AssetDataCallback(assetID, asset); |
401 | |||
402 | } | 408 | } |
403 | } | 409 | } |
404 | } | 410 | } |