diff --git a/CMakeLists.txt b/CMakeLists.txt index 67d27d319..083edc0b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -530,9 +530,9 @@ ENDIF(MSVC AND NOT MSVC_IDE) #SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib/${CMAKE_SYSTEM_NAME}) SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib) MAKE_DIRECTORY(${OUTPUT_LIBDIR}) -IF(NOT MSVC) +IF(NOT MSVC OR MSVC_IDE) MAKE_DIRECTORY(${OUTPUT_LIBDIR}/${OSG_PLUGINS}) -ENDIF(NOT MSVC) +ENDIF(NOT MSVC OR MSVC_IDE) # On CMake 2.4.x use EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH and later # we work around the DLL placement by use of the PREFIX target property hack diff --git a/applications/present3D/Cluster.cpp b/applications/present3D/Cluster.cpp index 251cf7902..1792a25af 100644 --- a/applications/present3D/Cluster.cpp +++ b/applications/present3D/Cluster.cpp @@ -50,7 +50,7 @@ #elif defined (WIN32) #include #include -#elif defined (__hpux__) +#elif defined (__hpux) #include #else #error Teach me how to build on this system diff --git a/examples/osgQtBrowser/QGraphicsViewAdapter.cpp b/examples/osgQtBrowser/QGraphicsViewAdapter.cpp index 23bff778d..c313c65e2 100644 --- a/examples/osgQtBrowser/QGraphicsViewAdapter.cpp +++ b/examples/osgQtBrowser/QGraphicsViewAdapter.cpp @@ -70,7 +70,9 @@ QGraphicsViewAdapter::QGraphicsViewAdapter(osg::Image* image, QWidget* widget): _graphicsView = new QGraphicsView; _graphicsScene->addWidget(widget); _graphicsView->setScene(_graphicsScene); +#if (QT_VERSION_CHECK(4, 5, 0) <= QT_VERSION) _graphicsScene->setStickyFocus(true); +#endif _graphicsView->viewport()->setParent(0); int width = _graphicsScene->width(); @@ -455,4 +457,4 @@ void QGraphicsViewAdapter::assignImage(unsigned int i) GL_RGBA,GL_UNSIGNED_BYTE, data, osg::Image::NO_DELETE, 1); -} \ No newline at end of file +} diff --git a/examples/osgautocapture/CMakeLists.txt b/examples/osgautocapture/CMakeLists.txt index 4c2302d75..18d580ed1 100644 --- a/examples/osgautocapture/CMakeLists.txt +++ b/examples/osgautocapture/CMakeLists.txt @@ -1,4 +1,5 @@ SET(TARGET_SRC osgautocapture.cpp ) +SET(TARGET_ADDED_LIBRARIES osgTerrain ) #### end var setup ### SETUP_EXAMPLE(osgautocapture) diff --git a/examples/osgcluster/broadcaster.cpp b/examples/osgcluster/broadcaster.cpp index 742c0bf1b..ead97d10b 100644 --- a/examples/osgcluster/broadcaster.cpp +++ b/examples/osgcluster/broadcaster.cpp @@ -54,7 +54,7 @@ #elif defined (WIN32) #include #include -#elif defined (__hpux__) +#elif defined (__hpux) #include #else #error Teach me how to build on this system diff --git a/examples/osgintrospection/osgintrospection.cpp b/examples/osgintrospection/osgintrospection.cpp index 1e4a5525a..644cccb2e 100644 --- a/examples/osgintrospection/osgintrospection.cpp +++ b/examples/osgintrospection/osgintrospection.cpp @@ -50,11 +50,8 @@ std::string createLibraryNameForWrapper(const std::string& ext) #endif #elif macintosh return "osgwrapper_"+ext; -#elif defined(__hpux__) - // why don't we use PLUGIN_EXT from the makefiles here? - return "osgwrapper_"+ext+".sl"; #else - return "osgwrapper_"+ext+".so"; + return "osgwrapper_"+ext+ ADDQUOTES(OSG_PLUGIN_EXTENSION); #endif } diff --git a/include/osg/Math b/include/osg/Math index f5ae51618..ee5a1e350 100644 --- a/include/osg/Math +++ b/include/osg/Math @@ -86,6 +86,10 @@ inline float atan2f(float value1, float value2) { return static_cast(atan2(value1,value2)); } #endif + #ifndef fmodf + inline float fmodf(float value1, float value2) { return static_cast(fmod(value1,value2)); } + #endif + #ifndef tanf inline float tanf(float value) { return static_cast(tan(value)); } #endif @@ -199,7 +203,7 @@ inline double RadiansToDegrees(double angle) { return angle*180.0/PI; } inline float round(float v) { return v>=0.0f?floorf(v+0.5f):ceilf(v-0.5f); } inline double round(double v) { return v>=0.0?floor(v+0.5):ceil(v-0.5); } -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MWERKS__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MWERKS__) inline bool isNaN(float v) { return _isnan(v)!=0; } inline bool isNaN(double v) { return _isnan(v)!=0; } #else diff --git a/include/osgPresentation/AnimationMaterial b/include/osgPresentation/AnimationMaterial index b7b74301d..fa924c250 100644 --- a/include/osgPresentation/AnimationMaterial +++ b/include/osgPresentation/AnimationMaterial @@ -18,6 +18,7 @@ #include +#include #include #include diff --git a/src/osgDB/DynamicLibrary.cpp b/src/osgDB/DynamicLibrary.cpp index f69e7b87d..4560dec8e 100644 --- a/src/osgDB/DynamicLibrary.cpp +++ b/src/osgDB/DynamicLibrary.cpp @@ -27,7 +27,7 @@ #include #else // all other unix #include -#ifdef __hpux__ +#ifdef __hpux // Although HP-UX has dlopen() it is broken! We therefore need to stick // to shl_load()/shl_unload()/shl_findsym() #include @@ -63,7 +63,7 @@ DynamicLibrary::~DynamicLibrary() FreeLibrary((HMODULE)_handle); #elif defined(__APPLE__) && defined(APPLE_PRE_10_3) NSUnLinkModule(static_cast(_handle), FALSE); -#elif defined(__hpux__) +#elif defined(__hpux) // fortunately, shl_t is a pointer shl_unload (static_cast(_handle)); #else // other unix @@ -103,7 +103,7 @@ DynamicLibrary::HANDLE DynamicLibrary::getLibraryHandle( const std::string& libr handle = NSLinkModule(image, libraryName.c_str(), TRUE); NSDestroyObjectFileImage(image); } -#elif defined(__hpux__) +#elif defined(__hpux) // BIND_FIRST is neccessary for some reason handle = shl_load ( libraryName.c_str(), BIND_DEFERRED|BIND_FIRST|BIND_VERBOSE, 0); return handle; @@ -146,7 +146,7 @@ DynamicLibrary::PROC_ADDRESS DynamicLibrary::getProcAddress(const std::string& p temp += procName; // Mac OS X prepends an underscore on function names symbol = NSLookupSymbolInModule(static_cast(_handle), temp.c_str()); return NSAddressOfSymbol(symbol); -#elif defined(__hpux__) +#elif defined(__hpux) void* result = NULL; if (shl_findsym (reinterpret_cast(&_handle), procName.c_str(), TYPE_PROCEDURE, result) == 0) { diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp index d8a3422b8..f8b86754a 100644 --- a/src/osgDB/Registry.cpp +++ b/src/osgDB/Registry.cpp @@ -718,14 +718,11 @@ std::string Registry::createLibraryNameForExtension(const std::string& ext) #else return prepend+"osgdb_"+lowercase_ext; #endif -#elif defined(__hpux__) - // why don't we use PLUGIN_EXT from the makefiles here? - return prepend+"osgdb_"+lowercase_ext+".sl"; #else #ifdef _DEBUG - return prepend+"osgdb_"+lowercase_ext+ OSG_DEBUG_POSTFIX_WITH_QUOTES + ".so"; + return prepend+"osgdb_"+lowercase_ext+ OSG_DEBUG_POSTFIX_WITH_QUOTES + ADDQUOTES(OSG_PLUGIN_EXTENSION); #else - return prepend+"osgdb_"+lowercase_ext+".so"; + return prepend+"osgdb_"+lowercase_ext+ADDQUOTES(OSG_PLUGIN_EXTENSION); #endif #endif @@ -749,14 +746,11 @@ std::string Registry::createLibraryNameForNodeKit(const std::string& name) #else return name; #endif -#elif defined(__hpux__) - // why don't we use PLUGIN_EXT from the makefiles here? - return "lib"+name+".sl"; #else #ifdef _DEBUG - return "lib"+name+OSG_DEBUG_POSTFIX_WITH_QUOTES +".so"; + return "lib"+name+OSG_DEBUG_POSTFIX_WITH_QUOTES + ADDQUOTES(OSG_PLUGIN_EXTENSION); #else - return "lib"+name+".so"; + return "lib"+name+ADDQUOTES(OSG_PLUGIN_EXTENSION); #endif #endif } diff --git a/src/osgPlugins/dxf/DXFWriterNodeVisitor.h b/src/osgPlugins/dxf/DXFWriterNodeVisitor.h index 4768ab3d4..86758b3ac 100644 --- a/src/osgPlugins/dxf/DXFWriterNodeVisitor.h +++ b/src/osgPlugins/dxf/DXFWriterNodeVisitor.h @@ -78,7 +78,7 @@ public: int findColor(unsigned int rgb) { int aci = 255; - itr = _indexColors.find(rgb); + ColorMap::const_iterator itr = _indexColors.find(rgb); if (itr != _indexColors.end() ) { aci = itr->second; } else { @@ -156,11 +156,9 @@ protected: protected: - std::map _indexColors; // maps RGB to autocad index colour - std::map _hueColors; // maps hue angle to autocad index colour - - typedef std::pair ColorPair; - std::map::iterator itr; + typedef std::map ColorMap; + ColorMap _indexColors; // maps RGB to autocad index colour + ColorMap _hueColors; // maps hue angle to autocad index colour }; class DXFWriterNodeVisitor: public osg::NodeVisitor { diff --git a/src/osgSim/LightPointNode.cpp b/src/osgSim/LightPointNode.cpp index ff8bd301e..a29c37163 100644 --- a/src/osgSim/LightPointNode.cpp +++ b/src/osgSim/LightPointNode.cpp @@ -204,7 +204,7 @@ void LightPointNode::traverse(osg::NodeVisitor& nv) // as this will be our special light point drawable. osgUtil::StateGraph::LeafList::iterator litr; for(litr = rg->_leaves.begin(); - litr != rg->_leaves.end() && (*litr)->_drawable!=drawable; + litr != rg->_leaves.end() && (*litr)->_drawable.get()!=drawable; ++litr) {} diff --git a/src/osgUtil/ShaderGen.cpp b/src/osgUtil/ShaderGen.cpp index fa4e5f8e7..2be459516 100644 --- a/src/osgUtil/ShaderGen.cpp +++ b/src/osgUtil/ShaderGen.cpp @@ -104,7 +104,7 @@ osg::StateSet *ShaderGenCache::getOrCreateStateSet(unsigned int stateMask) if (it == _stateSetMap.end()) { osg::StateSet *stateSet = createStateSet(stateMask); - _stateSetMap.insert(it, std::make_pair(stateMask, stateSet)); + _stateSetMap.insert(it, StateSetMap::value_type(stateMask, stateSet)); return stateSet; } return it->second.get();