} // namespace
Node* DefaultProcessPolicy::process(Node* node, const string& filename,
- const ReaderWriter::Options* opt)
+ const Options* opt)
{
TextureNameVisitor nameVisitor;
node->accept(nameVisitor);
ReaderWriter::ReadResult
ModelRegistry::readImage(const string& fileName,
- const ReaderWriter::Options* opt)
+ const Options* opt)
{
CallbackMap::iterator iter
= imageCallbackMap.find(getFileExtension(fileName));
// GL_EXT_texture_compression_s3tc
// patented, no way to decompress these
+#ifndef GL_EXT_texture_compression_s3tc
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
+#endif
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
-
+
// GL_EXT_texture_sRGB
// patented, no way to decompress these
+#ifndef GL_EXT_texture_sRGB
+#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
+#endif
case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
-
+
// GL_TDFX_texture_compression_FXT1
// can decompress these in software but
// no code present in simgear.
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
+#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
+#endif
case GL_COMPRESSED_RGB_FXT1_3DFX:
case GL_COMPRESSED_RGBA_FXT1_3DFX:
-
+
// GL_EXT_texture_compression_rgtc
// can decompress these in software but
// no code present in simgear.
+#ifndef GL_EXT_texture_compression_rgtc
+#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
+#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
+#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
+#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
+#endif
case GL_COMPRESSED_RED_RGTC1_EXT:
case GL_COMPRESSED_SIGNED_RED_RGTC1_EXT:
case GL_COMPRESSED_RED_GREEN_RGTC2_EXT:
case GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:
- SG_LOG(SG_IO, SG_ALERT, "Image \"" << res.getImage()->getFileName()
- << "\" contains non portable compressed textures.\n"
- "Usage of these textures depend on an extension that"
- " is not guaranteed to be present.");
+ SG_LOG(SG_IO, SG_ALERT, "Image \"" << fileName << "\"\n"
+ "uses compressed textures which cannot be supported on "
+ "some systems.\n"
+ "Please decompress this texture for improved portability.");
break;
default:
osg::Node* DefaultCachePolicy::find(const string& fileName,
- const ReaderWriter::Options* opt)
+ const Options* opt)
{
Registry* registry = Registry::instance();
osg::Node* cached
osg::Node* OptimizeModelPolicy::optimize(osg::Node* node,
const string& fileName,
- const osgDB::ReaderWriter::Options* opt)
+ const osgDB::Options* opt)
{
osgUtil::Optimizer optimizer;
optimizer.optimize(node, _osgOptions);
}
string OSGSubstitutePolicy::substitute(const string& name,
- const ReaderWriter::Options* opt)
+ const Options* opt)
{
string fileSansExtension = getNameLessExtension(name);
string osgFileName = fileSansExtension + ".osg";
ReaderWriter::ReadResult
ModelRegistry::readNode(const string& fileName,
- const ReaderWriter::Options* opt)
+ const Options* opt)
{
ReaderWriter::ReadResult res;
CallbackMap::iterator iter
Referenced::setThreadSafeReferenceCounting(true);
Registry* registry = Registry::instance();
- ReaderWriter::Options* options = new ReaderWriter::Options;
- int cacheOptions = ReaderWriter::Options::CACHE_ALL;
+ Options* options = new Options;
+ int cacheOptions = Options::CACHE_ALL;
options->
- setObjectCacheHint((ReaderWriter::Options::CacheHintOptions)cacheOptions);
+ setObjectCacheHint((Options::CacheHintOptions)cacheOptions);
registry->setOptions(options);
registry->getOrCreateSharedStateManager()->
setShareMode(SharedStateManager::SHARE_STATESETS);
_osgOptions &= ~Optimizer::TRISTRIP_GEOMETRY;
}
Node* optimize(Node* node, const string& fileName,
- const ReaderWriter::Options* opt)
+ const Options* opt)
{
ref_ptr<Node> optimized
= OptimizeModelPolicy::optimize(node, fileName, opt);
struct ACProcessPolicy {
ACProcessPolicy(const string& extension) {}
Node* process(Node* node, const string& filename,
- const ReaderWriter::Options* opt)
+ const Options* opt)
{
Matrix m(1, 0, 0, 0,
0, 0, 1, 0,