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. --- .../Communications/RestClient/RestClient.cs | 101 +++++----- OpenSim/Framework/Data.MSSQL/MSSQLDataStore.cs | 13 +- OpenSim/Framework/Data.MySQL/MySQLDataStore.cs | 78 ++++---- OpenSim/Framework/Data.SQLite/SQLiteManager.cs | 134 +++++++------- OpenSim/Framework/Data.SQLite/SQLiteUserData.cs | 27 +-- .../ScriptServer/Region/RegionConnectionManager.cs | 19 +- .../Environment/Modules/AssetDownloadModule.cs | 204 +++++++++++---------- .../Environment/Modules/DynamicTextureModule.cs | 9 +- .../Modules/Terrain/PaintBrushes/FlattenSphere.cs | 65 +++---- OpenSim/Region/Environment/Scenes/Scene.cs | 39 ++-- .../Engines/CSharp/Examples/ExportRegionToLSL.cs | 35 ++-- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 59 +++--- OpenSim/Region/Physics/Meshing/SimpleHull.cs | 11 +- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 41 +++-- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 11 +- .../Common/ScriptEngineBase/ScriptManager.cs | 82 +++++---- .../Region/ScriptEngine/Common/TRPC/TCPClient.cs | 13 +- .../LSOEngine/LSO/IL_common_functions.cs | 27 +-- .../LSOEngine/LSO/LSL_OPCODE_IL_processor.cs | 9 +- .../Region/Terrain.BasicTerrain/TerrainEngine.cs | 48 +++-- .../libTerrainBSD/Channel/Editing/Flatten.cs | 85 ++++----- .../Channel/Manipulators/NavierStokes.cs | 13 +- 22 files changed, 572 insertions(+), 551 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Communications/RestClient/RestClient.cs b/OpenSim/Framework/Communications/RestClient/RestClient.cs index 7212e5e..1178fed 100644 --- a/OpenSim/Framework/Communications/RestClient/RestClient.cs +++ b/OpenSim/Framework/Communications/RestClient/RestClient.cs @@ -195,15 +195,16 @@ namespace OpenSim.Framework.Communications return s.Substring(s.Length - 1, 1) == "/"; } - /// - /// return a slash or blank. A slash will be returned if the string does not contain one - /// - /// stromg to be examined - /// slash '/' if not already present - private string slash(string s) - { - return isSlashed(s) ? String.Empty : "/"; - } +// TODO: unused +// /// +// /// return a slash or blank. A slash will be returned if the string does not contain one +// /// +// /// stromg to be examined +// /// slash '/' if not already present +// private string slash(string s) +// { +// return isSlashed(s) ? String.Empty : "/"; +// } /// /// Build a Uri based on the initial Url, path elements and parameters @@ -278,46 +279,48 @@ namespace OpenSim.Framework.Communications } } - /// - /// Async method, invoked when the initial response if received from the server - /// - /// - private void ResponseIsReadyDelegate(IAsyncResult ar) - { - try - { - // grab response - WebRequest wr = (WebRequest) ar.AsyncState; - _response = (HttpWebResponse) wr.EndGetResponse(ar); - - // get response stream, and setup async reading - Stream s = _response.GetResponseStream(); - IAsyncResult asynchronousResult = - s.BeginRead(_readbuf, 0, BufferSize, new AsyncCallback(StreamIsReadyDelegate), s); - - // TODO! Implement timeout, without killing the server - // wait until completed, or we timed out - // ThreadPool.RegisterWaitForSingleObject(asynchronousResult.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), _request, DefaultTimeout, true); - } - catch (Exception e) - { - _allDone.Set(); - _asyncException = e; - } - } - - // Abort the request if the timer fires. - private static void TimeoutCallback(object state, bool timedOut) - { - if (timedOut) - { - HttpWebRequest request = state as HttpWebRequest; - if (request != null) - { - request.Abort(); - } - } - } +// TODO: unused +// /// +// /// Async method, invoked when the initial response if received from the server +// /// +// /// +// private void ResponseIsReadyDelegate(IAsyncResult ar) +// { +// try +// { +// // grab response +// WebRequest wr = (WebRequest) ar.AsyncState; +// _response = (HttpWebResponse) wr.EndGetResponse(ar); + +// // get response stream, and setup async reading +// Stream s = _response.GetResponseStream(); +// IAsyncResult asynchronousResult = +// s.BeginRead(_readbuf, 0, BufferSize, new AsyncCallback(StreamIsReadyDelegate), s); + +// // TODO! Implement timeout, without killing the server +// // wait until completed, or we timed out +// // ThreadPool.RegisterWaitForSingleObject(asynchronousResult.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), _request, DefaultTimeout, true); +// } +// catch (Exception e) +// { +// _allDone.Set(); +// _asyncException = e; +// } +// } + +// TODO: unused +// // Abort the request if the timer fires. +// private static void TimeoutCallback(object state, bool timedOut) +// { +// if (timedOut) +// { +// HttpWebRequest request = state as HttpWebRequest; +// if (request != null) +// { +// request.Abort(); +// } +// } +// } #endregion Async communications with server diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLDataStore.cs b/OpenSim/Framework/Data.MSSQL/MSSQLDataStore.cs index c86cfb6..d34abe3 100644 --- a/OpenSim/Framework/Data.MSSQL/MSSQLDataStore.cs +++ b/OpenSim/Framework/Data.MSSQL/MSSQLDataStore.cs @@ -1351,12 +1351,13 @@ namespace OpenSim.Framework.Data.MSSQL return param; } - private SqlParameter createParamWithValue(string name, Type type, Object o) - { - SqlParameter param = createSqlParameter(name, type); - param.Value = o; - return param; - } +// TODO: unused +// private SqlParameter createParamWithValue(string name, Type type, Object o) +// { +// SqlParameter param = createSqlParameter(name, type); +// param.Value = o; +// return param; +// } private void setupPrimCommands(SqlDataAdapter da, SqlConnection conn) { diff --git a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs index b1ab42fd..eaa7f14 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs @@ -478,38 +478,39 @@ namespace OpenSim.Framework.Data.MySQL return landDataForRegion; } - private void DisplayDataSet(DataSet ds, string title) - { - Debug.WriteLine(title); - //--- Loop through the DataTables - foreach (DataTable table in ds.Tables) - { - Debug.WriteLine("*** DataTable: " + table.TableName + "***"); - //--- Loop through each DataTable's DataRows - foreach (DataRow row in table.Rows) - { - //--- Display the original values, if there are any. - if (row.HasVersion(DataRowVersion.Original)) - { - Debug.Write("Original Row Values ===> "); - foreach (DataColumn column in table.Columns) - Debug.Write(column.ColumnName + " = " + - row[column, DataRowVersion.Original] + ", "); - Debug.WriteLine(String.Empty); - } - //--- Display the current values, if there are any. - if (row.HasVersion(DataRowVersion.Current)) - { - Debug.Write("Current Row Values ====> "); - foreach (DataColumn column in table.Columns) - Debug.Write(column.ColumnName + " = " + - row[column, DataRowVersion.Current] + ", "); - Debug.WriteLine(String.Empty); - } - Debug.WriteLine(String.Empty); - } - } - } +// TODO: unused +// private void DisplayDataSet(DataSet ds, string title) +// { +// Debug.WriteLine(title); +// //--- Loop through the DataTables +// foreach (DataTable table in ds.Tables) +// { +// Debug.WriteLine("*** DataTable: " + table.TableName + "***"); +// //--- Loop through each DataTable's DataRows +// foreach (DataRow row in table.Rows) +// { +// //--- Display the original values, if there are any. +// if (row.HasVersion(DataRowVersion.Original)) +// { +// Debug.Write("Original Row Values ===> "); +// foreach (DataColumn column in table.Columns) +// Debug.Write(column.ColumnName + " = " + +// row[column, DataRowVersion.Original] + ", "); +// Debug.WriteLine(String.Empty); +// } +// //--- Display the current values, if there are any. +// if (row.HasVersion(DataRowVersion.Current)) +// { +// Debug.Write("Current Row Values ====> "); +// foreach (DataColumn column in table.Columns) +// Debug.Write(column.ColumnName + " = " + +// row[column, DataRowVersion.Current] + ", "); +// Debug.WriteLine(String.Empty); +// } +// Debug.WriteLine(String.Empty); +// } +// } +// } public void Commit() { @@ -1397,12 +1398,13 @@ namespace OpenSim.Framework.Data.MySQL return param; } - private MySqlParameter createParamWithValue(string name, Type type, Object o) - { - MySqlParameter param = createMySqlParameter(name, type); - param.Value = o; - return param; - } +// TODO: unused +// private MySqlParameter createParamWithValue(string name, Type type, Object o) +// { +// MySqlParameter param = createMySqlParameter(name, type); +// param.Value = o; +// return param; +// } private void SetupPrimCommands(MySqlDataAdapter da, MySqlConnection conn) { diff --git a/OpenSim/Framework/Data.SQLite/SQLiteManager.cs b/OpenSim/Framework/Data.SQLite/SQLiteManager.cs index 4dd89f5..bec0cd8 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteManager.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteManager.cs @@ -92,72 +92,74 @@ namespace OpenSim.Framework.Data.SQLite return (IDbCommand) dbcommand; } - private bool TestTables(SQLiteConnection conn) - { - SQLiteCommand cmd = new SQLiteCommand("SELECT * FROM regions", conn); - SQLiteDataAdapter pDa = new SQLiteDataAdapter(cmd); - DataSet tmpDS = new DataSet(); - try - { - pDa.Fill(tmpDS, "regions"); - } - catch (SqliteSyntaxException) - { - m_log.Info("[DATASTORE]: SQLite Database doesn't exist... creating"); - InitDB(conn); - } - return true; - } - - private DataTable createRegionsTable() - { - DataTable regions = new DataTable("regions"); - - createCol(regions, "regionHandle", typeof (ulong)); - createCol(regions, "regionName", typeof (String)); - createCol(regions, "uuid", typeof (String)); - - createCol(regions, "regionRecvKey", typeof (String)); - createCol(regions, "regionSecret", typeof (String)); - createCol(regions, "regionSendKey", typeof (String)); - - createCol(regions, "regionDataURI", typeof (String)); - createCol(regions, "serverIP", typeof (String)); - createCol(regions, "serverPort", typeof (String)); - createCol(regions, "serverURI", typeof (String)); - - - createCol(regions, "locX", typeof (uint)); - createCol(regions, "locY", typeof (uint)); - createCol(regions, "locZ", typeof (uint)); - - createCol(regions, "eastOverrideHandle", typeof (ulong)); - createCol(regions, "westOverrideHandle", typeof (ulong)); - createCol(regions, "southOverrideHandle", typeof (ulong)); - createCol(regions, "northOverrideHandle", typeof (ulong)); - - createCol(regions, "regionAssetURI", typeof (String)); - createCol(regions, "regionAssetRecvKey", typeof (String)); - createCol(regions, "regionAssetSendKey", typeof (String)); - - createCol(regions, "regionUserURI", typeof (String)); - createCol(regions, "regionUserRecvKey", typeof (String)); - createCol(regions, "regionUserSendKey", typeof (String)); - - // Add in contraints - regions.PrimaryKey = new DataColumn[] {regions.Columns["UUID"]}; - return regions; - } - - private void InitDB(SQLiteConnection conn) - { - string createUsers = defineTable(createRegionsTable()); - SQLiteCommand pcmd = new SQLiteCommand(createUsers, conn); - conn.Open(); - pcmd.ExecuteNonQuery(); - conn.Close(); - } - +// TODO: unused +// private bool TestTables(SQLiteConnection conn) +// { +// SQLiteCommand cmd = new SQLiteCommand("SELECT * FROM regions", conn); +// SQLiteDataAdapter pDa = new SQLiteDataAdapter(cmd); +// DataSet tmpDS = new DataSet(); +// try +// { +// pDa.Fill(tmpDS, "regions"); +// } +// catch (SqliteSyntaxException) +// { +// m_log.Info("[DATASTORE]: SQLite Database doesn't exist... creating"); +// InitDB(conn); +// } +// return true; +// } + +// TODO: unused +// private DataTable createRegionsTable() +// { +// DataTable regions = new DataTable("regions"); + +// createCol(regions, "regionHandle", typeof (ulong)); +// createCol(regions, "regionName", typeof (String)); +// createCol(regions, "uuid", typeof (String)); + +// createCol(regions, "regionRecvKey", typeof (String)); +// createCol(regions, "regionSecret", typeof (String)); +// createCol(regions, "regionSendKey", typeof (String)); + +// createCol(regions, "regionDataURI", typeof (String)); +// createCol(regions, "serverIP", typeof (String)); +// createCol(regions, "serverPort", typeof (String)); +// createCol(regions, "serverURI", typeof (String)); + + +// createCol(regions, "locX", typeof (uint)); +// createCol(regions, "locY", typeof (uint)); +// createCol(regions, "locZ", typeof (uint)); + +// createCol(regions, "eastOverrideHandle", typeof (ulong)); +// createCol(regions, "westOverrideHandle", typeof (ulong)); +// createCol(regions, "southOverrideHandle", typeof (ulong)); +// createCol(regions, "northOverrideHandle", typeof (ulong)); + +// createCol(regions, "regionAssetURI", typeof (String)); +// createCol(regions, "regionAssetRecvKey", typeof (String)); +// createCol(regions, "regionAssetSendKey", typeof (String)); + +// createCol(regions, "regionUserURI", typeof (String)); +// createCol(regions, "regionUserRecvKey", typeof (String)); +// createCol(regions, "regionUserSendKey", typeof (String)); + +// // Add in contraints +// regions.PrimaryKey = new DataColumn[] {regions.Columns["UUID"]}; +// return regions; +// } + +// TODO: unused +// private void InitDB(SQLiteConnection conn) +// { +// string createUsers = defineTable(createRegionsTable()); +// SQLiteCommand pcmd = new SQLiteCommand(createUsers, conn); +// conn.Open(); +// pcmd.ExecuteNonQuery(); +// conn.Close(); +// } /// /// Reads a region row from a database reader diff --git a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs index d65e8d5..0b2df9d 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs @@ -624,19 +624,20 @@ namespace OpenSim.Framework.Data.SQLite return user; } - private void fillFriendRow(DataRow row, LLUUID ownerID, LLUUID friendID, uint perms) - { - row["ownerID"] = ownerID.UUID.ToString(); - row["friendID"] = friendID.UUID.ToString(); - row["friendPerms"] = perms; - foreach (DataColumn col in ds.Tables["userfriends"].Columns) - { - if (row[col] == null) - { - row[col] = String.Empty; - } - } - } +// TODO: unused +// private void fillFriendRow(DataRow row, LLUUID ownerID, LLUUID friendID, uint perms) +// { +// row["ownerID"] = ownerID.UUID.ToString(); +// row["friendID"] = friendID.UUID.ToString(); +// row["friendPerms"] = perms; +// foreach (DataColumn col in ds.Tables["userfriends"].Columns) +// { +// if (row[col] == null) +// { +// row[col] = String.Empty; +// } +// } +// } private void fillUserRow(DataRow row, UserProfileData user) { diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs index c0cce93..a3d014d 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs @@ -41,16 +41,17 @@ namespace OpenSim.Grid.ScriptServer m_Connection = Connection; } - private void DataReceived(object objectID, object scriptID) - { - // TODO: HOW DO WE RECEIVE DATA? ASYNC? - // ANYHOW WE END UP HERE? +// TODO: unused: +// private void DataReceived(object objectID, object scriptID) +// { +// // TODO: HOW DO WE RECEIVE DATA? ASYNC? +// // ANYHOW WE END UP HERE? - // NEW SCRIPT? ASK SCRIPTENGINE TO INITIALIZE IT - ScriptRez(); +// // NEW SCRIPT? ASK SCRIPTENGINE TO INITIALIZE IT +// ScriptRez(); - // EVENT? DELIVER EVENT DIRECTLY TO SCRIPTENGINE - touch_start(); - } +// // EVENT? DELIVER EVENT DIRECTLY TO SCRIPTENGINE +// touch_start(); +// } } } 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 diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index e8708a1..bba5ae1 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -790,25 +790,26 @@ namespace OpenSim.Region.Environment.Scenes } //Updates the time in the viewer. - private void UpdateInWorldTime() - { - m_timeUpdateCount++; - if (m_timeUpdateCount > 600) - { - List avatars = GetAvatars(); - foreach (ScenePresence avatar in avatars) - { - avatar.ControllingClient.SendViewerTime(m_timePhase); - } - - m_timeUpdateCount = 0; - m_timePhase++; - if (m_timePhase > 94) - { - m_timePhase = 0; - } - } - } +// TODO: unused +// private void UpdateInWorldTime() +// { +// m_timeUpdateCount++; +// if (m_timeUpdateCount > 600) +// { +// List avatars = GetAvatars(); +// foreach (ScenePresence avatar in avatars) +// { +// avatar.ControllingClient.SendViewerTime(m_timePhase); +// } + +// m_timeUpdateCount = 0; +// m_timePhase++; +// if (m_timePhase > 94) +// { +// m_timePhase = 0; +// } +// } +// } private void SendSimStatsPackets(SimStatsPacket pack) { diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs index 529ff6d..00a7df3 100644 --- a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs +++ b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs @@ -72,22 +72,23 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples }*/ } - private string processPrimitiveToString(SceneObjectPart prim) - { - /*string desc = prim.Description; - string name = prim.Name; - LLVector3 pos = prim.Pos; - LLQuaternion rot = new LLQuaternion(prim.Rotation.x, prim.Rotation.y, prim.Rotation.z, prim.Rotation.w); - LLVector3 scale = prim.Scale; - LLVector3 rootPos = prim.WorldPos; - - string setPrimParams = String.Empty; - - setPrimParams += "[PRIM_SCALE, " + scale.ToString() + ", PRIM_POS, " + rootPos.ToString() + ", PRIM_ROTATION, " + rot.ToString() + "]\n"; - - return setPrimParams; - */ - return System.String.Empty; - } +// TODO: unused +// private string processPrimitiveToString(SceneObjectPart prim) +// { +// /*string desc = prim.Description; +// string name = prim.Name; +// LLVector3 pos = prim.Pos; +// LLQuaternion rot = new LLQuaternion(prim.Rotation.x, prim.Rotation.y, prim.Rotation.z, prim.Rotation.w); +// LLVector3 scale = prim.Scale; +// LLVector3 rootPos = prim.WorldPos; + +// string setPrimParams = String.Empty; + +// setPrimParams += "[PRIM_SCALE, " + scale.ToString() + ", PRIM_POS, " + rootPos.ToString() + ", PRIM_ROTATION, " + rot.ToString() + "]\n"; + +// return setPrimParams; +// */ +// return System.String.Empty; +// } } } diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 48a1c0e..ce46dae 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -59,35 +59,36 @@ namespace OpenSim.Region.Physics.Meshing // const string baseDir = "rawFiles"; private const string baseDir = null; //"rawFiles"; - private static void IntersectionParameterPD(PhysicsVector p1, PhysicsVector r1, PhysicsVector p2, - PhysicsVector r2, ref float lambda, ref float mu) - { - // p1, p2, points on the straight - // r1, r2, directional vectors of the straight. Not necessarily of length 1! - // note, that l, m can be scaled such, that the range 0..1 is mapped to the area between two points, - // thus allowing to decide whether an intersection is between two points - - float r1x = r1.X; - float r1y = r1.Y; - float r2x = r2.X; - float r2y = r2.Y; - - float denom = r1y*r2x - r1x*r2y; - - if (denom == 0.0) - { - lambda = Single.NaN; - mu = Single.NaN; - return; - } - - float p1x = p1.X; - float p1y = p1.Y; - float p2x = p2.X; - float p2y = p2.Y; - lambda = (-p2x*r2y + p1x*r2y + (p2y - p1y)*r2x)/denom; - mu = (-p2x*r1y + p1x*r1y + (p2y - p1y)*r1x)/denom; - } +// TODO: unused +// private static void IntersectionParameterPD(PhysicsVector p1, PhysicsVector r1, PhysicsVector p2, +// PhysicsVector r2, ref float lambda, ref float mu) +// { +// // p1, p2, points on the straight +// // r1, r2, directional vectors of the straight. Not necessarily of length 1! +// // note, that l, m can be scaled such, that the range 0..1 is mapped to the area between two points, +// // thus allowing to decide whether an intersection is between two points + +// float r1x = r1.X; +// float r1y = r1.Y; +// float r2x = r2.X; +// float r2y = r2.Y; + +// float denom = r1y*r2x - r1x*r2y; + +// if (denom == 0.0) +// { +// lambda = Single.NaN; +// mu = Single.NaN; +// return; +// } + +// float p1x = p1.X; +// float p1y = p1.Y; +// float p2x = p2.X; +// float p2y = p2.Y; +// lambda = (-p2x*r2y + p1x*r2y + (p2y - p1y)*r2x)/denom; +// mu = (-p2x*r1y + p1x*r1y + (p2y - p1y)*r1x)/denom; +// } private static List FindInfluencedTriangles(List triangles, Vertex v) { diff --git a/OpenSim/Region/Physics/Meshing/SimpleHull.cs b/OpenSim/Region/Physics/Meshing/SimpleHull.cs index 3d3f42c..c518b78 100644 --- a/OpenSim/Region/Physics/Meshing/SimpleHull.cs +++ b/OpenSim/Region/Physics/Meshing/SimpleHull.cs @@ -170,11 +170,12 @@ namespace OpenSim.Region.Physics.Meshing return result; } - private bool InsertVertex(Vertex v, int iAfter) - { - vertices.Insert(iAfter + 1, v); - return true; - } +// TODO: unused +// private bool InsertVertex(Vertex v, int iAfter) +// { +// vertices.Insert(iAfter + 1, v); +// return true; +// } private Vertex getNextVertex(Vertex currentVertex) { diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index b870a77..62978fd 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -504,26 +504,27 @@ namespace OpenSim.Region.Physics.OdePlugin { } - private void standupStraight() - { - - // The purpose of this routine here is to quickly stabilize the Body while it's popped up in the air. - // The amotor needs a few seconds to stabilize so without it, the avatar shoots up sky high when you - // change appearance and when you enter the simulator - // After this routine is done, the amotor stabilizes much quicker - d.Vector3 feet; - d.Vector3 head; - d.BodyGetRelPointPos(Body, 0.0f, 0.0f, -1.0f, out feet); - d.BodyGetRelPointPos(Body, 0.0f, 0.0f, 1.0f, out head); - float posture = head.Z - feet.Z; - - // restoring force proportional to lack of posture: - float servo = (2.5f - posture) * POSTURE_SERVO; - d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, servo, 0.0f, 0.0f, 1.0f); - d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, -servo, 0.0f, 0.0f, -1.0f); - //d.Matrix3 bodyrotation = d.BodyGetRotation(Body); - //m_log.Info("[PHYSICSAV]: Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22); - } + +// TODO: unused: +// private void standupStraight() +// { +// // The purpose of this routine here is to quickly stabilize the Body while it's popped up in the air. +// // The amotor needs a few seconds to stabilize so without it, the avatar shoots up sky high when you +// // change appearance and when you enter the simulator +// // After this routine is done, the amotor stabilizes much quicker +// d.Vector3 feet; +// d.Vector3 head; +// d.BodyGetRelPointPos(Body, 0.0f, 0.0f, -1.0f, out feet); +// d.BodyGetRelPointPos(Body, 0.0f, 0.0f, 1.0f, out head); +// float posture = head.Z - feet.Z; + +// // restoring force proportional to lack of posture: +// float servo = (2.5f - posture) * POSTURE_SERVO; +// d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, servo, 0.0f, 0.0f, 1.0f); +// d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, -servo, 0.0f, 0.0f, -1.0f); +// //d.Matrix3 bodyrotation = d.BodyGetRotation(Body); +// //m_log.Info("[PHYSICSAV]: Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22); +// } public override PhysicsVector Force { diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index abac967..8529234 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -981,12 +981,11 @@ namespace OpenSim.Region.Physics.OdePlugin #endregion - private float GetTerrainHeightAtXY(float x, float y) - { - return (float)_origheightmap[(int)y * Constants.RegionSize + (int)x]; - - - } +// TODO: unused +// private float GetTerrainHeightAtXY(float x, float y) +// { +// return (float)_origheightmap[(int)y * Constants.RegionSize + (int)x]; +// } #region Add/Remove Entities diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs index 04de990..09f84d6 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs @@ -141,26 +141,27 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase } private static int privateThreadCount = 0; - private Thread StartScriptLoadUnloadThread() - { - Thread t = new Thread(ScriptLoadUnloadThreadLoop); - string name = "ScriptLoadUnloadThread:"; - if (PrivateThread) - { - name += "Private:" + privateThreadCount; - privateThreadCount++; - } - else - { - name += "Shared"; - } - t.Name = name; - t.IsBackground = true; - t.Priority = ThreadPriority.Normal; - t.Start(); - OpenSim.Framework.ThreadTracker.Add(t); - return t; - } +// TODO: unused +// private Thread StartScriptLoadUnloadThread() +// { +// Thread t = new Thread(ScriptLoadUnloadThreadLoop); +// string name = "ScriptLoadUnloadThread:"; +// if (PrivateThread) +// { +// name += "Private:" + privateThreadCount; +// privateThreadCount++; +// } +// else +// { +// name += "Shared"; +// } +// t.Name = name; +// t.IsBackground = true; +// t.Priority = ThreadPriority.Normal; +// t.Start(); +// OpenSim.Framework.ThreadTracker.Add(t); +// return t; +// } ~ScriptManager() { @@ -184,26 +185,27 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase #region Load / Unload scripts (Thread loop) - private void ScriptLoadUnloadThreadLoop() - { - try - { - while (true) - { - if (LUQueue.Count == 0) - Thread.Sleep(scriptLoadUnloadThread_IdleSleepms); - //if (PleaseShutdown) - // return; - DoScriptLoadUnload(); - } - } - catch (ThreadAbortException tae) - { - string a = tae.ToString(); - a = String.Empty; - // Expected - } - } +// TODO: unused +// private void ScriptLoadUnloadThreadLoop() +// { +// try +// { +// while (true) +// { +// if (LUQueue.Count == 0) +// Thread.Sleep(scriptLoadUnloadThread_IdleSleepms); +// //if (PleaseShutdown) +// // return; +// DoScriptLoadUnload(); +// } +// } +// catch (ThreadAbortException tae) +// { +// string a = tae.ToString(); +// a = String.Empty; +// // Expected +// } +// } public void DoScriptLoadUnload() { diff --git a/OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs b/OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs index 1187287..7689d69 100644 --- a/OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs +++ b/OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs @@ -74,12 +74,13 @@ namespace OpenSim.Region.ScriptEngine.Common.TRPC Clients[ID].Disconnect(); } - void asyncConnected(IAsyncResult iar) - { - Socket client = (Socket)iar.AsyncState; - client.EndConnect(iar); - ProcessConnection(client); - } +// TODO: unused +// void asyncConnected(IAsyncResult iar) +// { +// Socket client = (Socket)iar.AsyncState; +// client.EndConnect(iar); +// ProcessConnection(client); +// } private int ProcessConnection(Socket client) { diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/IL_common_functions.cs b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/IL_common_functions.cs index a36ab1b..60d68f5 100644 --- a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/IL_common_functions.cs +++ b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/IL_common_functions.cs @@ -34,18 +34,19 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO { internal partial class LSO_Parser { - private static TypeBuilder CreateType(ModuleBuilder modBuilder, string typeName) - { - TypeBuilder typeBuilder = modBuilder.DefineType(typeName, - TypeAttributes.Public | - TypeAttributes.Class | - TypeAttributes.AutoClass | - TypeAttributes.AnsiClass | - TypeAttributes.BeforeFieldInit | - TypeAttributes.AutoLayout, - typeof (object), - new Type[] {typeof (object)}); - return typeBuilder; - } +// TODO: unused: +// private static TypeBuilder CreateType(ModuleBuilder modBuilder, string typeName) +// { +// TypeBuilder typeBuilder = modBuilder.DefineType(typeName, +// TypeAttributes.Public | +// TypeAttributes.Class | +// TypeAttributes.AutoClass | +// TypeAttributes.AnsiClass | +// TypeAttributes.BeforeFieldInit | +// TypeAttributes.AutoLayout, +// typeof (object), +// new Type[] {typeof (object)}); +// return typeBuilder; +// } } } diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_OPCODE_IL_processor.cs b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_OPCODE_IL_processor.cs index ff0fe77..34a784c 100644 --- a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_OPCODE_IL_processor.cs +++ b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_OPCODE_IL_processor.cs @@ -342,10 +342,11 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO return false; } - private void IL_PopToStack(ILGenerator il) - { - IL_PopToStack(il, 1); - } +// TODO: unused +// private void IL_PopToStack(ILGenerator il) +// { +// IL_PopToStack(il, 1); +// } private void IL_PopToStack(ILGenerator il, int count) { diff --git a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs index 308f35b..4ab535b 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs @@ -310,37 +310,33 @@ namespace OpenSim.Region.Terrain } } - lastEdit = DateTime.Now; return; } - - - - /// - /// Checks to make sure the terrain is within baked values +/- maxRaise/minLower - /// - private void SetTerrainWithinBounds() - { - int x, y; - for (x = 0; x < w; x++) - { - for (y = 0; y < h; y++) - { - if ((heightmap.Get(x, y) > revertmap.Get(x, y) + maxRaise)) - { - heightmap.map[x, y] = revertmap.Get(x, y) + maxRaise; - } - if ((heightmap.Get(x, y) > revertmap.Get(x, y) - minLower)) - { - heightmap.map[x, y] = revertmap.Get(x, y) - minLower; - } - } - } - } - +// TODO: unused +// /// +// /// Checks to make sure the terrain is within baked values +/- maxRaise/minLower +// /// +// private void SetTerrainWithinBounds() +// { +// int x, y; +// for (x = 0; x < w; x++) +// { +// for (y = 0; y < h; y++) +// { +// if ((heightmap.Get(x, y) > revertmap.Get(x, y) + maxRaise)) +// { +// heightmap.map[x, y] = revertmap.Get(x, y) + maxRaise; +// } +// if ((heightmap.Get(x, y) > revertmap.Get(x, y) - minLower)) +// { +// heightmap.map[x, y] = revertmap.Get(x, y) - minLower; +// } +// } +// } +// } /// /// Converts the heightmap to a 65536 value 1D floating point array diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Flatten.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Flatten.cs index aa102b8..ba076c2 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Flatten.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Flatten.cs @@ -70,48 +70,49 @@ namespace libTerrain Blend(flat, temp); } - private void FlattenFast(double rx, double ry, double size, double amount) - { - int x, y; - double avg = 0; - double div = 0; - - int minX = Math.Max(0, (int) (rx - (size + 1))); - int maxX = Math.Min(w, (int) (rx + (size + 1))); - int minY = Math.Max(0, (int) (ry - (size + 1))); - int maxY = Math.Min(h, (int) (ry + (size + 1))); - - for (x = minX; x < maxX; x++) - { - for (y = minY; y < maxY; y++) - { - double z = size; - z *= z; - z -= ((x - rx)*(x - rx)) + ((y - ry)*(y - ry)); - - if (z < 0) - z = 0; - - avg += z*amount; - div += z; - } - } - - double height = avg/div; - - for (x = minX; x < maxX; x++) - { - for (y = minY; y < maxY; y++) - { - double z = size; - z *= z; - z -= ((x - rx)*(x - rx)) + ((y - ry)*(y - ry)); - - if (z > 0.0) - Set(x, y, Tools.LinearInterpolate(map[x, y], height, z)); - } - } - } +// TODO: unused +// private void FlattenFast(double rx, double ry, double size, double amount) +// { +// int x, y; +// double avg = 0; +// double div = 0; + +// int minX = Math.Max(0, (int) (rx - (size + 1))); +// int maxX = Math.Min(w, (int) (rx + (size + 1))); +// int minY = Math.Max(0, (int) (ry - (size + 1))); +// int maxY = Math.Min(h, (int) (ry + (size + 1))); + +// for (x = minX; x < maxX; x++) +// { +// for (y = minY; y < maxY; y++) +// { +// double z = size; +// z *= z; +// z -= ((x - rx)*(x - rx)) + ((y - ry)*(y - ry)); + +// if (z < 0) +// z = 0; + +// avg += z*amount; +// div += z; +// } +// } + +// double height = avg/div; + +// for (x = minX; x < maxX; x++) +// { +// for (y = minY; y < maxY; y++) +// { +// double z = size; +// z *= z; +// z -= ((x - rx)*(x - rx)) + ((y - ry)*(y - ry)); + +// if (z > 0.0) +// Set(x, y, Tools.LinearInterpolate(map[x, y], height, z)); +// } +// } +// } public void Flatten(Channel mask, double amount) { diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs index 7840f8b..8f12637 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs @@ -40,12 +40,13 @@ namespace libTerrain return ((i) + (N + 2)*(j)); } - private static void nsSwap(ref double x0, ref double x) - { - double tmp = x0; - x0 = x; - x = tmp; - } +// TODO: unused +// private static void nsSwap(ref double x0, ref double x) +// { +// double tmp = x0; +// x0 = x; +// x = tmp; +// } private static void nsSwap(ref double[] x0, ref double[] x) { -- cgit v1.1