aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Land/LandObject.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/LandObject.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs23
1 files changed, 20 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 74c2144..7321054 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -895,13 +895,31 @@ namespace OpenSim.Region.CoreModules.World.Land
895 private byte[] ConvertLandBitmapToBytes() 895 private byte[] ConvertLandBitmapToBytes()
896 { 896 {
897 byte[] tempConvertArr = new byte[512]; 897 byte[] tempConvertArr = new byte[512];
898 byte tempByte = 0; 898 int tempByte = 0;
899 int x, y, i, byteNum = 0; 899 int x, y, i, byteNum = 0;
900 int mask = 1;
900 i = 0; 901 i = 0;
901 for (y = 0; y < 64; y++) 902 for (y = 0; y < 64; y++)
902 { 903 {
903 for (x = 0; x < 64; x++) 904 for (x = 0; x < 64; x++)
904 { 905 {
906 if (LandBitmap[x, y])
907 tempByte |= mask;
908 mask = mask << 1;
909 if (mask == 0x100)
910 {
911 mask = 1;
912 tempConvertArr[byteNum++] = (byte)tempByte;
913 tempByte = 0;
914 }
915 }
916 }
917
918 if(tempByte != 0 && byteNum < 512)
919 tempConvertArr[byteNum] = (byte)tempByte;
920
921
922/*
905 tempByte = Convert.ToByte(tempByte | Convert.ToByte(LandBitmap[x, y]) << (i++ % 8)); 923 tempByte = Convert.ToByte(tempByte | Convert.ToByte(LandBitmap[x, y]) << (i++ % 8));
906 if (i % 8 == 0) 924 if (i % 8 == 0)
907 { 925 {
@@ -910,8 +928,7 @@ namespace OpenSim.Region.CoreModules.World.Land
910 i = 0; 928 i = 0;
911 byteNum++; 929 byteNum++;
912 } 930 }
913 } 931 */
914 }
915 return tempConvertArr; 932 return tempConvertArr;
916 } 933 }
917 934