From 0509495340c987fe10a3f4d00059282e10e80b42 Mon Sep 17 00:00:00 2001 From: Don BURNS Date: Mon, 17 Dec 2001 17:34:17 +0000 Subject: [PATCH] Fixed IRIX compile issues with the flt loader. ReaderWriterATTR.cpp had a variable "mips" defined, which is predefined for the IRIX preprocessor. Changed this to _mips. FltFile.cpp had a class and transient variable defined within the scope of member function FltFile::readExternals(), which was causing the IRIX 7.3 compiles to hork. Moved the class definition to outside of the member function scope. --- src/osgPlugins/Makefile | 3 +-- src/osgPlugins/flt/FltFile.cpp | 7 +++++-- src/osgPlugins/flt/Makefile | 3 ++- src/osgPlugins/flt/ReaderWriterATTR.cpp | 8 ++++---- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/osgPlugins/Makefile b/src/osgPlugins/Makefile index 7e3beed9c..eea69a44d 100644 --- a/src/osgPlugins/Makefile +++ b/src/osgPlugins/Makefile @@ -2,8 +2,7 @@ SHELL=/bin/sh #DIRS = osg rgb lib3ds flt pfb obj lwo dw bmp pic png jpeg tga tiff gif osgtgz tgz zip -#DIRS = osg rgb lib3ds flt obj lwo dw bmp pic png jpeg tga tiff gif osgtgz tgz zip -DIRS = osg rgb lib3ds obj lwo dw bmp pic png jpeg tga tiff gif osgtgz tgz zip +DIRS = osg rgb lib3ds flt obj lwo dw bmp pic png jpeg tga tiff gif osgtgz tgz zip all : for f in $(DIRS) ; do cd $$f; $(MAKE) || exit 1; cd ..; done diff --git a/src/osgPlugins/flt/FltFile.cpp b/src/osgPlugins/flt/FltFile.cpp index 2068b15e1..60d754904 100644 --- a/src/osgPlugins/flt/FltFile.cpp +++ b/src/osgPlugins/flt/FltFile.cpp @@ -138,8 +138,9 @@ bool FltFile::readFile(const std::string& fileName) #define REGISTER_FLT 1 -void FltFile::readExternals() -{ +// This class was originally scoped within FltFile::readExternals() function. +// Irix 7.3 compilers hork on this. + class ReadExternal : public RecordVisitor { public: @@ -202,6 +203,8 @@ void FltFile::readExternals() FltFile* _pFltFile; }; +void FltFile::readExternals() +{ ReadExternal visitor(this); _headerRecord->accept(visitor); } diff --git a/src/osgPlugins/flt/Makefile b/src/osgPlugins/flt/Makefile index 25ea3225c..e5d9bcf27 100644 --- a/src/osgPlugins/flt/Makefile +++ b/src/osgPlugins/flt/Makefile @@ -16,10 +16,10 @@ C++FILES = \ ExternalRecord.cpp\ Record.cpp\ FaceRecord.cpp\ - FltFile.cpp\ RecordVisitor.cpp\ GeoSetBuilder.cpp\ Registry.cpp\ + FltFile.cpp\ GroupRecord.cpp\ SwitchRecord.cpp\ HeaderRecord.cpp\ @@ -42,6 +42,7 @@ C++FILES = \ # PointLight.cpp\ + C++FLAGS += -I../../../include LIB = ../../../lib/osgPlugins/osgdb_flt.so diff --git a/src/osgPlugins/flt/ReaderWriterATTR.cpp b/src/osgPlugins/flt/ReaderWriterATTR.cpp index dd4c11018..0a1265f32 100644 --- a/src/osgPlugins/flt/ReaderWriterATTR.cpp +++ b/src/osgPlugins/flt/ReaderWriterATTR.cpp @@ -244,7 +244,7 @@ class Attr // 1 - TX_PACK_8 // 2 - TX_PACK_16 int32 useMips; // TRUE if using following 8 floats for MIPMAP kernel - float32 mips[8]; // 8 floats for kernel of separable symmetric filter + float32 _mips[8]; // 8 floats for kernel of separable symmetric filter int32 useLodScale; // Boolean if TRUE send: float32 lod0; // LOD0 for TX_CONTROL_POINT float32 scale0; // SCALE0 for TX_CONTROL_POINT @@ -415,7 +415,7 @@ void Attr::init() intFormat = 0; // 0 - Default extFormat = 0; // 0 - Default useMips = 0; - // float32 mips[8]; + // float32 _mips[8]; useLodScale = 0; // float32 lod0; // float32 scale0; @@ -499,7 +499,7 @@ bool Attr::readAttrFile(const char* szName) READ( extFormat ); READ( useMips ); for (n=0; n<8; n++) { - READ(mips[n]); } + READ(_mips[n]); } READ( useLodScale ); READ( lod0 ); READ( scale0 ); @@ -684,7 +684,7 @@ class ReaderWriterATTR : public osgDB::ReaderWriter char buf[256]; int version=0; - const ReaderWriter::Options* rwOptions= + const osgDB::ReaderWriter::Options* rwOptions= osgDB::Registry::instance()->getOptions(); if (rwOptions)