Changeset 14037

Show
Ignore:
Timestamp:
11/24/14 16:24:31 (5 hours ago)
Author:
robert
Message:

From Jan Klimke, "i noticed, that there are a couple of additional flaws when building osg for Mac OS X 10.10 Yosemite.

The mac os sdk version is recognized by the current CMAKE script as 10.1 instead of 10.10 since it cuts the version string from the 4th place. I introduced a more reliable version checking based on splitting the returned version code into MAJOR MINOR and PATCH parts and reassemble the OSG sdk version afterwards.

I replaced the existing CMake code against the following (returning now version 10.10 as expected):

# Determine the canonical name of the selected Platform SDK

EXECUTE_PROCESS(COMMAND "/usr/bin/sw_vers" "-productVersion"

OUTPUT_VARIABLE OSG_OSX_SDK_NAME
OUTPUT_STRIP_TRAILING_WHITESPACE)

STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME})
LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR)
LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR)
LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)

SET(OSG_OSX_SDK_NAME "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")

Also i added the check for the new Version to some more find scripts.

Additionally the nil object in Objective C now seems to be equivalent with a null_ptr that cannot be passed as GLInt anymore. So i switched this in the PixelBufferCocoa?.mm to pass a zero instead of nil.
"

Location:
OpenSceneGraph/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osg/ComputeBoundsVisitor

    r13307 r14037  
    4949    void applyDrawable(osg::Drawable* drawable); 
    5050 
    51 protected: 
     51    void applyBoundingBox(const osg::BoundingBox&); 
    5252 
    5353    typedef std::vector<osg::Matrix> MatrixStack; 
    5454 
     55    const MatrixStack& getMatrixStack() const { return _matrixStack; } 
     56 
     57protected: 
    5558    MatrixStack         _matrixStack; 
    5659    osg::BoundingBox    _bb; 
  • OpenSceneGraph/trunk/src/osg/ComputeBoundsVisitor.cpp

    r13041 r14037  
    7878void ComputeBoundsVisitor::applyDrawable(osg::Drawable* drawable) 
    7979{ 
    80     if (_matrixStack.empty()) _bb.expandBy(drawable->getBound()); 
    81     else 
     80    applyBoundingBox(drawable->getBound()); 
     81} 
     82 
     83void ComputeBoundsVisitor::applyBoundingBox(const osg::BoundingBox& bbox) 
     84{ 
     85    if (_matrixStack.empty()) _bb.expandBy(bbox); 
     86    else if (bbox.valid()) 
    8287    { 
    83         osg::Matrix& matrix = _matrixStack.back(); 
    84         const osg::BoundingBox& dbb = drawable->getBound(); 
    85         if (dbb.valid()) 
    86         { 
    87             _bb.expandBy(dbb.corner(0) * matrix); 
    88             _bb.expandBy(dbb.corner(1) * matrix); 
    89             _bb.expandBy(dbb.corner(2) * matrix); 
    90             _bb.expandBy(dbb.corner(3) * matrix); 
    91             _bb.expandBy(dbb.corner(4) * matrix); 
    92             _bb.expandBy(dbb.corner(5) * matrix); 
    93             _bb.expandBy(dbb.corner(6) * matrix); 
    94             _bb.expandBy(dbb.corner(7) * matrix); 
    95         } 
     88        const osg::Matrix& matrix = _matrixStack.back(); 
     89        _bb.expandBy(bbox.corner(0) * matrix); 
     90        _bb.expandBy(bbox.corner(1) * matrix); 
     91        _bb.expandBy(bbox.corner(2) * matrix); 
     92        _bb.expandBy(bbox.corner(3) * matrix); 
     93        _bb.expandBy(bbox.corner(4) * matrix); 
     94        _bb.expandBy(bbox.corner(5) * matrix); 
     95        _bb.expandBy(bbox.corner(6) * matrix); 
     96        _bb.expandBy(bbox.corner(7) * matrix); 
    9697    } 
    9798}