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.ThreadPoolClientBranch
							parent
							
								
									59b224a901
								
							
						
					
					
						commit
						c654df5dfd
					
				| 
						 | 
				
			
			@ -374,12 +374,13 @@ namespace OpenSim.Framework.Data.MySQL
 | 
			
		|||
                int rev = 0;
 | 
			
		||||
                if (row.Read())
 | 
			
		||||
                {
 | 
			
		||||
                    byte[] heightmap = (byte[]) row["Heightfield"];
 | 
			
		||||
                    MemoryStream str = new MemoryStream((byte[]) row["Heightfield"]);
 | 
			
		||||
                    BinaryReader br = new BinaryReader(str);
 | 
			
		||||
                    for (int x = 0; x < 256; x++)
 | 
			
		||||
                    {
 | 
			
		||||
                        for (int y = 0; y < 256; y++)
 | 
			
		||||
                        {
 | 
			
		||||
                            terret[x, y] = BitConverter.ToDouble(heightmap, ((x*256) + y)*8);
 | 
			
		||||
                            terret[x, y] = br.ReadDouble();
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    rev = (int) row["Revision"];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -436,12 +436,13 @@ namespace OpenSim.Framework.Data.SQLite
 | 
			
		|||
                        if (row.Read())
 | 
			
		||||
                        {
 | 
			
		||||
                            // TODO: put this into a function
 | 
			
		||||
                            byte[] heightmap = (byte[]) row["Heightfield"];
 | 
			
		||||
                            MemoryStream str = new MemoryStream((byte[]) row["Heightfield"]);
 | 
			
		||||
                            BinaryReader br = new BinaryReader(str);
 | 
			
		||||
                            for (int x = 0; x < 256; x++)
 | 
			
		||||
                            {
 | 
			
		||||
                                for (int y = 0; y < 256; y++)
 | 
			
		||||
                                {
 | 
			
		||||
                                    terret[x, y] = BitConverter.ToDouble(heightmap, ((x*256) + y)*8);
 | 
			
		||||
                                    terret[x, y] = br.ReadDouble();
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            rev = (int) row["Revision"];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue