aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSean Dague2008-02-11 12:38:51 +0000
committerSean Dague2008-02-11 12:38:51 +0000
commitc654df5dfdc77dd24d52f94a154d1e5aba739aaf (patch)
tree6c06b1d230cd55021baedc86fc1c62adda8b726a
parentUnhandled exception handler hookup is now the first thing to happen when Open... (diff)
downloadopensim-SC_OLD-c654df5dfdc77dd24d52f94a154d1e5aba739aaf.zip
opensim-SC_OLD-c654df5dfdc77dd24d52f94a154d1e5aba739aaf.tar.gz
opensim-SC_OLD-c654df5dfdc77dd24d52f94a154d1e5aba739aaf.tar.bz2
opensim-SC_OLD-c654df5dfdc77dd24d52f94a154d1e5aba739aaf.tar.xz
From: dirk husemann <hud@zurich.ibm.com>
these two patches fixe the terrain load exception that occurs when restarting OpenSim on PPC32 by making terrain loading endian clean. it does NOT fix the client crash exception. need to hunt that one down.
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLDataStore.cs5
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs5
2 files changed, 6 insertions, 4 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs
index fcc7cc1..9518724 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs
@@ -374,12 +374,13 @@ namespace OpenSim.Framework.Data.MySQL
374 int rev = 0; 374 int rev = 0;
375 if (row.Read()) 375 if (row.Read())
376 { 376 {
377 byte[] heightmap = (byte[]) row["Heightfield"]; 377 MemoryStream str = new MemoryStream((byte[]) row["Heightfield"]);
378 BinaryReader br = new BinaryReader(str);
378 for (int x = 0; x < 256; x++) 379 for (int x = 0; x < 256; x++)
379 { 380 {
380 for (int y = 0; y < 256; y++) 381 for (int y = 0; y < 256; y++)
381 { 382 {
382 terret[x, y] = BitConverter.ToDouble(heightmap, ((x*256) + y)*8); 383 terret[x, y] = br.ReadDouble();
383 } 384 }
384 } 385 }
385 rev = (int) row["Revision"]; 386 rev = (int) row["Revision"];
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs b/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs
index a724875..5d9580e 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs
@@ -436,12 +436,13 @@ namespace OpenSim.Framework.Data.SQLite
436 if (row.Read()) 436 if (row.Read())
437 { 437 {
438 // TODO: put this into a function 438 // TODO: put this into a function
439 byte[] heightmap = (byte[]) row["Heightfield"]; 439 MemoryStream str = new MemoryStream((byte[]) row["Heightfield"]);
440 BinaryReader br = new BinaryReader(str);
440 for (int x = 0; x < 256; x++) 441 for (int x = 0; x < 256; x++)
441 { 442 {
442 for (int y = 0; y < 256; y++) 443 for (int y = 0; y < 256; y++)
443 { 444 {
444 terret[x, y] = BitConverter.ToDouble(heightmap, ((x*256) + y)*8); 445 terret[x, y] = br.ReadDouble();
445 } 446 }
446 } 447 }
447 rev = (int) row["Revision"]; 448 rev = (int) row["Revision"];