Added support for compressing textures to osgconv, can be accessed by
running --compressed when outputting to a .ive file.
This commit is contained in:
@@ -422,6 +422,9 @@ Package=<4>
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name Core osgUtil
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name Core osgProducer
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -51,7 +51,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 /nologo /subsystem:console /pdb:none /machine:I386 /out:"../../../bin/osgconv.exe" /libpath:"../../../lib"
|
||||
# ADD LINK32 opengl32.lib Producer.lib OpenThreadsWin32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../../../bin/osgconv.exe" /libpath:"../../../lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "Example osgconv - Win32 Debug"
|
||||
|
||||
@@ -76,7 +76,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /out:"../../../bin/osgconvd.exe" /pdbtype:sept /libpath:"../../../lib"
|
||||
# ADD LINK32opengl32.lib Producerd.lib OpenThreadsWin32d.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /out:"../../../bin/osgconvd.exe" /pdbtype:sept /libpath:"../../../lib"
|
||||
# SUBTRACT LINK32 /incremental:no
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgDB/WriteFile>
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/ReaderWriter>
|
||||
|
||||
#include <osgUtil/Optimizer>
|
||||
@@ -360,12 +361,17 @@ int main( int argc, char **argv )
|
||||
|
||||
if (compressTextures)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Need to implement compressed textures."<< std::endl;
|
||||
|
||||
CompressTexturesVisitor ctv;
|
||||
root->accept(ctv);
|
||||
ctv.compress();
|
||||
|
||||
std::string ext = osgDB::getFileExtension(fileNameOut);
|
||||
if (ext=="ive")
|
||||
{
|
||||
CompressTexturesVisitor ctv;
|
||||
root->accept(ctv);
|
||||
ctv.compress();
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout<<"Warning: compressing texture only supported when outputing to .ive"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (osgDB::writeNodeFile(*root,fileNameOut))
|
||||
|
||||
Reference in New Issue
Block a user