From: Andreas K. <and...@we...> - 2004-10-11 16:19:45
|
Hi! > - I would love to remove the configure test for endianness and replace it with > a class like you did, but unfortunately this breaks the binary stream classes > (kernel/bstream.h) in the respect that you can no longer write > bistream<file_is_lsb> inputfile("foo.bin"); > This only works if "file_is_lsb" is a compile-time constant, and this can only > be done as long as we use a configure mechanism. Ah, didn't think of that :-( I'll change it back. I have to do some changes for MSVC++ anyway. > If we could do it via expression templates (like we do with the datatypes) that > would work, but I don't know how to do that. The expression template code you introduced for compile time selection of types is really cool. But I have no idea how to use something like this for a endianess test either. First I wanted to do something like const byte swap_test[2] = { 0, 1}; const bool big_endian = (*(uint2*)swap_test) != 1; But this cannot be done either because the order the constants are getting initailized is not defined. But I guess it wouldn't work for the bistream class anyway... Another option would be to change the bistream class to not use templates. Would be a bit less elegant and performance would be a bit worse, but the class is not really a central point of ray++. So I think it would be worth to chnage it if we get rid of the configure problems. Other opinions? > - In trianglemesh.cxx a function filelength() is called, which does not exist > on Linux. We will have to find something more portable. Yeah, I thought that might be a problem, but didn't change it yet. > - TRIANGLE_MESH::All_Intersections() appears to return only the first intersection > with the mesh. I'll have a look. The class is far from being finished so there might be a few more problems (apart from the fact that it is still veeeery sloooow). But I was able to render my first teapot already! > TRIANGLE_MESH::Load3DS() might be a good candidate for using the bistream class. > (I expect that the 3DS files are always little-endian, so they have to be swapped > on a big-endian machine). Yes, I guess so as well. Thanks for the code review, Andreas |