From a70768b6e917e8bc2a53155b3ad36c30a5a5c2b6 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 8 Nov 2005 16:41:34 +0000 Subject: [PATCH] Added .ive support for osg::Texture SourceFormat and SourceType --- src/osgPlugins/ive/IveVersion.h | 3 ++- src/osgPlugins/ive/Texture.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/osgPlugins/ive/IveVersion.h b/src/osgPlugins/ive/IveVersion.h index 0e481cd0b..1a33c619d 100644 --- a/src/osgPlugins/ive/IveVersion.h +++ b/src/osgPlugins/ive/IveVersion.h @@ -22,8 +22,9 @@ #define VERSION_0011 11 #define VERSION_0012 12 #define VERSION_0013 13 +#define VERSION_0014 14 -#define VERSION VERSION_0013 +#define VERSION VERSION_0014 /* The BYTE_SEX tag is used to check the endian diff --git a/src/osgPlugins/ive/Texture.cpp b/src/osgPlugins/ive/Texture.cpp index 759ca2124..d829afaa7 100644 --- a/src/osgPlugins/ive/Texture.cpp +++ b/src/osgPlugins/ive/Texture.cpp @@ -56,6 +56,12 @@ void Texture::write(DataOutputStream* out){ out->writeBool(_clientStorageHint); out->writeBool(_resizeNonPowerOfTwoHint); } + + if ( out->getVersion() >= VERSION_0014 ) + { + out->writeInt(_sourceFormat); + out->writeInt(_sourceType); + } } void Texture::read(DataInputStream* in) @@ -101,6 +107,11 @@ void Texture::read(DataInputStream* in) _resizeNonPowerOfTwoHint = in->readBool(); } + if ( in->getVersion() >= VERSION_0014 ) + { + _sourceFormat = in->readInt(); + _sourceType = in->readInt(); + } } else {