From 7b53511251435ef108dca2f96954d0dab9a1132f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 14 Aug 2006 07:59:28 +0000 Subject: [PATCH] From Paul Martz, "The gist of this change is, if the OpenFlight version of the parent file is so old that it doesn't support Light Point palettes or Shader palettes, then the parent file is not allowed to override those palettes in the child." --- src/osgPlugins/OpenFlight/PrimaryRecords.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/OpenFlight/PrimaryRecords.cpp b/src/osgPlugins/OpenFlight/PrimaryRecords.cpp index 7245ed8f8..59a394334 100644 --- a/src/osgPlugins/OpenFlight/PrimaryRecords.cpp +++ b/src/osgPlugins/OpenFlight/PrimaryRecords.cpp @@ -672,12 +672,18 @@ protected: if (document.version() == 1541) mask = ~0; + // Only override light points and shader palettes if + // we are the correct version. + bool parentLightPoints( (document.version() >= VERSION_15_8) && + ((mask & LIGHT_POINT_PALETTE_OVERRIDE) == 0) ); + bool parentShaders( (document.version() >= VERSION_16_0) && + ((mask & SHADER_PALETTE_OVERRIDE) == 0) ); _external->setUserData(new ParentPools( ((mask & COLOR_PALETTE_OVERRIDE) ? NULL : document.getColorPool()), ((mask & MATERIAL_PALETTE_OVERRIDE) ? NULL : document.getOrCreateMaterialPool()), ((mask & TEXTURE_PALETTE_OVERRIDE) ? NULL : document.getOrCreateTexturePool()), - ((mask & LIGHT_POINT_PALETTE_OVERRIDE) ? NULL : document.getOrCreateLightPointAppearancePool()), - ((mask & SHADER_PALETTE_OVERRIDE) ? NULL : document.getOrCreateShaderPool()) )); + ((!parentLightPoints) ? NULL : document.getOrCreateLightPointAppearancePool()), + ((!parentShaders) ? NULL : document.getOrCreateShaderPool()) )); } // Add this implementation to parent implementation.