[Opensim-dev] terrain load-tile

Diva Canto diva at metaverseink.com
Tue May 27 02:18:52 UTC 2008


Hi,

I'm making a synthetic terrain of size 512x512, and I'm having trouble
loading it to a 2x2 region. I always get this:

18:55:53 - [Console]: Command [terrain load-tile synthetic.r32 512 512 999
999]
failed with exception System.IO.EndOfStreamException: Unable to read beyond
the
end of the stream.

I wrote the program that's generating the file synthetic.r32. It works well
when the file is of size 256x256 and is loaded into one single region.
However, for tiles, I always get the exception above.

The most important function is this, which was copied from the Terrain
module (slightly modified, names of vars mostly):

        public static void SaveFile(string filename, ITerrain map)
        {
            FileInfo file = new FileInfo(filename);
            FileStream s = file.Open(FileMode.Create, FileAccess.Write);
            BinaryWriter bs = new BinaryWriter(s);

            Console.WriteLine("Writing file... " + map.Length + "x" +
map.Width);
            int y;
            for (y = 0; y < map.Length; y++)
            {
                int x;
                for (x = 0; x < map.Width; x++)
                {
                    bs.Write((float)map[x, y]);
                }
            }

            bs.Close();
            s.Close();
        }

The Length and Width of map have the right numbers, i.e. in one case 256
and in the other 512.
The files have exactly the right sizes, in one case
-rwx------+ 1 Crista Lopes None  262144 May 26 19:09 synthetic.r32
and in the other
-rwx------+ 1 Crista Lopes None 1048576 May 26 19:16 synthetic.r32

Any ideas?? What else is the terrain loader trying to read?!

Thanks,
Crista


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20080526/1e2c665e/attachment-0001.html>


More information about the Opensim-dev mailing list