Reduce accessibility of some J2KImage/LLImageManager properties and methods to reduce potential code complexity and make code reading easier.
parent
1b3ae566e8
commit
a2071e5b13
|
@ -56,9 +56,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
public IAssetService AssetService;
|
public IAssetService AssetService;
|
||||||
public UUID AgentID;
|
public UUID AgentID;
|
||||||
public IInventoryAccessModule InventoryAccessModule;
|
public IInventoryAccessModule InventoryAccessModule;
|
||||||
public OpenJPEG.J2KLayerInfo[] Layers;
|
private OpenJPEG.J2KLayerInfo[] m_layers;
|
||||||
public bool IsDecoded;
|
public bool IsDecoded { get; private set; }
|
||||||
public bool HasAsset;
|
public bool HasAsset { get; private set; }
|
||||||
public C5.IPriorityQueueHandle<J2KImage> PriorityQueueHandle;
|
public C5.IPriorityQueueHandle<J2KImage> PriorityQueueHandle;
|
||||||
|
|
||||||
private uint m_currentPacket;
|
private uint m_currentPacket;
|
||||||
|
@ -170,14 +170,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
if (DiscardLevel >= 0 || m_stopPacket == 0)
|
if (DiscardLevel >= 0 || m_stopPacket == 0)
|
||||||
{
|
{
|
||||||
// This shouldn't happen, but if it does, we really can't proceed
|
// This shouldn't happen, but if it does, we really can't proceed
|
||||||
if (Layers == null)
|
if (m_layers == null)
|
||||||
{
|
{
|
||||||
m_log.Warn("[J2KIMAGE]: RunUpdate() called with missing Layers. Canceling texture transfer");
|
m_log.Warn("[J2KIMAGE]: RunUpdate() called with missing Layers. Canceling texture transfer");
|
||||||
m_currentPacket = m_stopPacket;
|
m_currentPacket = m_stopPacket;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int maxDiscardLevel = Math.Max(0, Layers.Length - 1);
|
int maxDiscardLevel = Math.Max(0, m_layers.Length - 1);
|
||||||
|
|
||||||
// Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel
|
// Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel
|
||||||
if (DiscardLevel < 0 && m_stopPacket == 0)
|
if (DiscardLevel < 0 && m_stopPacket == 0)
|
||||||
|
@ -187,9 +187,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
DiscardLevel = (sbyte)Math.Min(DiscardLevel, maxDiscardLevel);
|
DiscardLevel = (sbyte)Math.Min(DiscardLevel, maxDiscardLevel);
|
||||||
|
|
||||||
//Calculate the m_stopPacket
|
//Calculate the m_stopPacket
|
||||||
if (Layers.Length > 0)
|
if (m_layers.Length > 0)
|
||||||
{
|
{
|
||||||
m_stopPacket = (uint)GetPacketForBytePosition(Layers[(Layers.Length - 1) - DiscardLevel].End);
|
m_stopPacket = (uint)GetPacketForBytePosition(m_layers[(m_layers.Length - 1) - DiscardLevel].End);
|
||||||
//I don't know why, but the viewer seems to expect the final packet if the file
|
//I don't know why, but the viewer seems to expect the final packet if the file
|
||||||
//is just one packet bigger.
|
//is just one packet bigger.
|
||||||
if (TexturePacketCount() == m_stopPacket + 1)
|
if (TexturePacketCount() == m_stopPacket + 1)
|
||||||
|
@ -341,7 +341,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
private void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers)
|
private void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers)
|
||||||
{
|
{
|
||||||
Layers = layers;
|
m_layers = layers;
|
||||||
IsDecoded = true;
|
IsDecoded = true;
|
||||||
RunUpdate();
|
RunUpdate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,7 +211,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
#region Priority Queue Helpers
|
#region Priority Queue Helpers
|
||||||
|
|
||||||
J2KImage GetHighestPriorityImage()
|
private J2KImage GetHighestPriorityImage()
|
||||||
{
|
{
|
||||||
J2KImage image = null;
|
J2KImage image = null;
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddImageToQueue(J2KImage image)
|
private void AddImageToQueue(J2KImage image)
|
||||||
{
|
{
|
||||||
image.PriorityQueueHandle = null;
|
image.PriorityQueueHandle = null;
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveImageFromQueue(J2KImage image)
|
private void RemoveImageFromQueue(J2KImage image)
|
||||||
{
|
{
|
||||||
lock (m_syncRoot)
|
lock (m_syncRoot)
|
||||||
{
|
{
|
||||||
|
@ -246,7 +246,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateImageInQueue(J2KImage image)
|
private void UpdateImageInQueue(J2KImage image)
|
||||||
{
|
{
|
||||||
lock (m_syncRoot)
|
lock (m_syncRoot)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue