From 9d1b42c39a779c84dd091a817d2f6e5f434777c4 Mon Sep 17 00:00:00 2001
From: Jeff Ames
Date: Tue, 25 Mar 2008 03:49:08 +0000
Subject: Comment out unused private methods.
---
.../Environment/Modules/AssetDownloadModule.cs | 204 +++++++++++----------
.../Environment/Modules/DynamicTextureModule.cs | 9 +-
.../Modules/Terrain/PaintBrushes/FlattenSphere.cs | 65 +++----
3 files changed, 141 insertions(+), 137 deletions(-)
(limited to 'OpenSim/Region/Environment/Modules')
diff --git a/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs b/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs
index 07f13ce..d5f1b36 100644
--- a/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs
@@ -175,117 +175,119 @@ namespace OpenSim.Region.Environment.Modules
}
}
- private void RunAssetQueue()
- {
- while (true)
- {
- try
- {
- ProcessAssetQueue();
- Thread.Sleep(500);
- }
- catch (Exception)
- {
- // m_log.Error("[ASSET CACHE]: " + e.ToString());
- }
- }
- }
+// TODO: unused
+// private void RunAssetQueue()
+// {
+// while (true)
+// {
+// try
+// {
+// ProcessAssetQueue();
+// Thread.Sleep(500);
+// }
+// catch (Exception)
+// {
+// // m_log.Error("[ASSET CACHE]: " + e.ToString());
+// }
+// }
+// }
- ///
- /// Process the asset queue which sends packets directly back to the client.
- ///
- private void ProcessAssetQueue()
- {
- //should move the asset downloading to a module, like has been done with texture downloading
- if (AssetRequests.Count == 0)
- {
- //no requests waiting
- return;
- }
- // if less than 5, do all of them
- int num = Math.Min(5, AssetRequests.Count);
+// TODO: unused
+// ///
+// /// Process the asset queue which sends packets directly back to the client.
+// ///
+// private void ProcessAssetQueue()
+// {
+// //should move the asset downloading to a module, like has been done with texture downloading
+// if (AssetRequests.Count == 0)
+// {
+// //no requests waiting
+// return;
+// }
+// // if less than 5, do all of them
+// int num = Math.Min(5, AssetRequests.Count);
- AssetRequest req;
- for (int i = 0; i < num; i++)
- {
- req = (AssetRequest)AssetRequests[i];
- //Console.WriteLine("sending asset " + req.RequestAssetID);
- TransferInfoPacket Transfer = new TransferInfoPacket();
- Transfer.TransferInfo.ChannelType = 2;
- Transfer.TransferInfo.Status = 0;
- Transfer.TransferInfo.TargetType = 0;
- if (req.AssetRequestSource == 2)
- {
- Transfer.TransferInfo.Params = new byte[20];
- Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
- int assType = (int)req.AssetInf.Type;
- Array.Copy(Helpers.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4);
- }
- else if (req.AssetRequestSource == 3)
- {
- Transfer.TransferInfo.Params = req.Params;
- // Transfer.TransferInfo.Params = new byte[100];
- //Array.Copy(req.RequestUser.AgentId.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
- //Array.Copy(req.RequestUser.SessionId.GetBytes(), 0, Transfer.TransferInfo.Params, 16, 16);
- }
- Transfer.TransferInfo.Size = (int)req.AssetInf.Data.Length;
- Transfer.TransferInfo.TransferID = req.TransferRequestID;
- req.RequestUser.OutPacket(Transfer, ThrottleOutPacketType.Asset);
+// AssetRequest req;
+// for (int i = 0; i < num; i++)
+// {
+// req = (AssetRequest)AssetRequests[i];
+// //Console.WriteLine("sending asset " + req.RequestAssetID);
+// TransferInfoPacket Transfer = new TransferInfoPacket();
+// Transfer.TransferInfo.ChannelType = 2;
+// Transfer.TransferInfo.Status = 0;
+// Transfer.TransferInfo.TargetType = 0;
+// if (req.AssetRequestSource == 2)
+// {
+// Transfer.TransferInfo.Params = new byte[20];
+// Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
+// int assType = (int)req.AssetInf.Type;
+// Array.Copy(Helpers.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4);
+// }
+// else if (req.AssetRequestSource == 3)
+// {
+// Transfer.TransferInfo.Params = req.Params;
+// // Transfer.TransferInfo.Params = new byte[100];
+// //Array.Copy(req.RequestUser.AgentId.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
+// //Array.Copy(req.RequestUser.SessionId.GetBytes(), 0, Transfer.TransferInfo.Params, 16, 16);
+// }
+// Transfer.TransferInfo.Size = (int)req.AssetInf.Data.Length;
+// Transfer.TransferInfo.TransferID = req.TransferRequestID;
+// req.RequestUser.OutPacket(Transfer, ThrottleOutPacketType.Asset);
- if (req.NumPackets == 1)
- {
- TransferPacketPacket TransferPacket = new TransferPacketPacket();
- TransferPacket.TransferData.Packet = 0;
- TransferPacket.TransferData.ChannelType = 2;
- TransferPacket.TransferData.TransferID = req.TransferRequestID;
- TransferPacket.TransferData.Data = req.AssetInf.Data;
- TransferPacket.TransferData.Status = 1;
- req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
- }
- else
- {
- int processedLength = 0;
- // libsecondlife hardcodes 1500 as the maximum data chunk size
- int maxChunkSize = 1250;
- int packetNumber = 0;
+// if (req.NumPackets == 1)
+// {
+// TransferPacketPacket TransferPacket = new TransferPacketPacket();
+// TransferPacket.TransferData.Packet = 0;
+// TransferPacket.TransferData.ChannelType = 2;
+// TransferPacket.TransferData.TransferID = req.TransferRequestID;
+// TransferPacket.TransferData.Data = req.AssetInf.Data;
+// TransferPacket.TransferData.Status = 1;
+// req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
+// }
+// else
+// {
+// int processedLength = 0;
+// // libsecondlife hardcodes 1500 as the maximum data chunk size
+// int maxChunkSize = 1250;
+// int packetNumber = 0;
- while (processedLength < req.AssetInf.Data.Length)
- {
- TransferPacketPacket TransferPacket = new TransferPacketPacket();
- TransferPacket.TransferData.Packet = packetNumber;
- TransferPacket.TransferData.ChannelType = 2;
- TransferPacket.TransferData.TransferID = req.TransferRequestID;
+// while (processedLength < req.AssetInf.Data.Length)
+// {
+// TransferPacketPacket TransferPacket = new TransferPacketPacket();
+// TransferPacket.TransferData.Packet = packetNumber;
+// TransferPacket.TransferData.ChannelType = 2;
+// TransferPacket.TransferData.TransferID = req.TransferRequestID;
- int chunkSize = Math.Min(req.AssetInf.Data.Length - processedLength, maxChunkSize);
- byte[] chunk = new byte[chunkSize];
- Array.Copy(req.AssetInf.Data, processedLength, chunk, 0, chunk.Length);
+// int chunkSize = Math.Min(req.AssetInf.Data.Length - processedLength, maxChunkSize);
+// byte[] chunk = new byte[chunkSize];
+// Array.Copy(req.AssetInf.Data, processedLength, chunk, 0, chunk.Length);
- TransferPacket.TransferData.Data = chunk;
+// TransferPacket.TransferData.Data = chunk;
- // 0 indicates more packets to come, 1 indicates last packet
- if (req.AssetInf.Data.Length - processedLength > maxChunkSize)
- {
- TransferPacket.TransferData.Status = 0;
- }
- else
- {
- TransferPacket.TransferData.Status = 1;
- }
+// // 0 indicates more packets to come, 1 indicates last packet
+// if (req.AssetInf.Data.Length - processedLength > maxChunkSize)
+// {
+// TransferPacket.TransferData.Status = 0;
+// }
+// else
+// {
+// TransferPacket.TransferData.Status = 1;
+// }
- req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
+// req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
- processedLength += chunkSize;
- packetNumber++;
- }
- }
- }
+// processedLength += chunkSize;
+// packetNumber++;
+// }
+// }
+// }
- //remove requests that have been completed
- for (int i = 0; i < num; i++)
- {
- AssetRequests.RemoveAt(0);
- }
- }
+// //remove requests that have been completed
+// for (int i = 0; i < num; i++)
+// {
+// AssetRequests.RemoveAt(0);
+// }
+// }
///
/// Calculate the number of packets required to send the asset to the client.
diff --git a/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
index e16eb92..ee84499 100644
--- a/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
+++ b/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
@@ -228,10 +228,11 @@ namespace OpenSim.Region.Environment.Modules
part.ScheduleFullUpdate();
}
- private byte[] BlendTextures(byte[] frontImage, byte[] backImage)
- {
- return BlendTextures(frontImage, backImage, false, 0);
- }
+// TODO: unused
+// private byte[] BlendTextures(byte[] frontImage, byte[] backImage)
+// {
+// return BlendTextures(frontImage, backImage, false, 0);
+// }
private byte[] BlendTextures(byte[] frontImage, byte[] backImage, bool setNewAlpha, byte newAlpha)
{
diff --git a/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/FlattenSphere.cs b/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/FlattenSphere.cs
index 6cbd390..9bfb981 100644
--- a/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/FlattenSphere.cs
+++ b/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/FlattenSphere.cs
@@ -37,38 +37,39 @@ namespace OpenSim.Region.Environment.Modules.Terrain.PaintBrushes
return z;
}
- private double GetBilinearInterpolate(double x, double y, ITerrainChannel map)
- {
- int w = map.Width;
- int h = map.Height;
-
- if (x > w - 2.0)
- x = w - 2.0;
- if (y > h - 2.0)
- y = h - 2.0;
- if (x < 0.0)
- x = 0.0;
- if (y < 0.0)
- y = 0.0;
-
- int stepSize = 1;
- double h00 = map[(int)x, (int)y];
- double h10 = map[(int)x + stepSize, (int)y];
- double h01 = map[(int)x, (int)y + stepSize];
- double h11 = map[(int)x + stepSize, (int)y + stepSize];
- double h1 = h00;
- double h2 = h10;
- double h3 = h01;
- double h4 = h11;
- double a00 = h1;
- double a10 = h2 - h1;
- double a01 = h3 - h1;
- double a11 = h1 - h2 - h3 + h4;
- double partialx = x - (int)x;
- double partialz = y - (int)y;
- double hi = a00 + (a10 * partialx) + (a01 * partialz) + (a11 * partialx * partialz);
- return hi;
- }
+// TODO: unused
+// private double GetBilinearInterpolate(double x, double y, ITerrainChannel map)
+// {
+// int w = map.Width;
+// int h = map.Height;
+
+// if (x > w - 2.0)
+// x = w - 2.0;
+// if (y > h - 2.0)
+// y = h - 2.0;
+// if (x < 0.0)
+// x = 0.0;
+// if (y < 0.0)
+// y = 0.0;
+
+// int stepSize = 1;
+// double h00 = map[(int)x, (int)y];
+// double h10 = map[(int)x + stepSize, (int)y];
+// double h01 = map[(int)x, (int)y + stepSize];
+// double h11 = map[(int)x + stepSize, (int)y + stepSize];
+// double h1 = h00;
+// double h2 = h10;
+// double h3 = h01;
+// double h4 = h11;
+// double a00 = h1;
+// double a10 = h2 - h1;
+// double a01 = h3 - h1;
+// double a11 = h1 - h2 - h3 + h4;
+// double partialx = x - (int)x;
+// double partialz = y - (int)y;
+// double hi = a00 + (a10 * partialx) + (a01 * partialz) + (a11 * partialx * partialz);
+// return hi;
+// }
#region ITerrainPaintableEffect Members
--
cgit v1.1