From a4ea331f3a72e18195db2dfee4e274bbfde297b1 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 7 Feb 2002 01:05:52 +0000 Subject: [PATCH] Added extensions code submitted by Yefrei. --- src/osgPlugins/flt/Record.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/osgPlugins/flt/Record.cpp b/src/osgPlugins/flt/Record.cpp index 18c499e47..b382d4a22 100644 --- a/src/osgPlugins/flt/Record.cpp +++ b/src/osgPlugins/flt/Record.cpp @@ -153,13 +153,23 @@ void PrimNodeRecord::removeAllChildren() bool PrimNodeRecord::readExtensionLevel(Input& fr) { + int extensionState = 1; Record* pRec; while (pRec=fr.readCreateRecord(_pFltFile)) { - if (pRec->isOfType(POP_EXTENSION_OP)) - return true; - // ignore extensions for now + if (pRec->isOfType(PUSH_EXTENSION_OP)) + { + ++extensionState; + } + else if (pRec->isOfType(POP_EXTENSION_OP)) + { + --extensionState; + if ( !extensionState ) // PUSH'es and POP's have cancelled out + { + return true; + } + } } return false; }