From b4cd96ebddb09dd8e5bac189630917d8a834ca8a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 8 Jun 2007 10:58:22 +0000 Subject: [PATCH] From Jason Daly, "We have a few OpenFlight files that used to display properly with the old loader, but appear very, very wrong with the new one. I traced the problem to the handling of the palette override flags in the external reference records. The current behavior for handling the palette override flags for external references has different offsets for different OpenFlight version (2 bytes for 14.2-15.1 and 4 bytes for 15.2 and later). However, I believe this behavior is incorrect. I know that the original 14.2 OpenFlight spec (dated April 1995) specifies 2 bytes between the filename and the override flags, and the 15.4 and later specs specify 4 bytes. However, I also found a 14.2.4 OpenFlight spec (dated January 1996) that changes the specification to 4 bytes. Also, the databases in question were created using an old IRIX version of MultiGen II, which wrote OpenFlight 14.2 files natively. These files also have 4 bytes between the filename and flags. Furthermore, these databases have always worked properly under earlier versions of OSG, under Performer, and in every MultiGen product we've used. This leads me to believe that the original 14.2 spec was incorrect (the 14.2.4 spec corrected this error), and there should be 4 bytes between the filename and flags for all OpenFlight files version 14.2 and later. The attached fix modifies the OpenFlight loader to behave in this way." --- src/osgPlugins/OpenFlight/PrimaryRecords.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/osgPlugins/OpenFlight/PrimaryRecords.cpp b/src/osgPlugins/OpenFlight/PrimaryRecords.cpp index 320972b94..14e35b9a8 100644 --- a/src/osgPlugins/OpenFlight/PrimaryRecords.cpp +++ b/src/osgPlugins/OpenFlight/PrimaryRecords.cpp @@ -658,10 +658,7 @@ protected: // Set parent pools as user data if (document.version() >= VERSION_14_2) { - in.forward(2); - - if (document.version() >= VERSION_15_1) - in.forward(2); + in.forward(4); uint32 mask = in.readUInt32(~0);