diff --git a/src/osg/glu/libutil/mipmap.cpp b/src/osg/glu/libutil/mipmap.cpp index 58b309da9..b27ab4503 100644 --- a/src/osg/glu/libutil/mipmap.cpp +++ b/src/osg/glu/libutil/mipmap.cpp @@ -908,10 +908,11 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height, for (j = 0; j < newwidth; j++) { for (k = 0; k < components; k++) { /* need to cast to double to hold large unsigned ints */ - s[0] = ((double)*(const GLuint*)t + - (double)*(const GLuint*)(t+group_size) + - (double)*(const GLuint*)(t+ysize) + - (double)*(const GLuint*)(t+ysize+group_size))/4 + 0.5; + GLdouble buf = (double)*(const GLuint*)t + + (double)*(const GLuint*)(t+group_size) + + (double)*(const GLuint*)(t+ysize) + + (double)*(const GLuint*)(t+ysize+group_size); + s[0] = (GLuint)(buf/4.0 + 0.5); s++; t += element_size; } @@ -925,12 +926,11 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height, for (j = 0; j < newwidth; j++) { for (k = 0; k < components; k++) { /* need to cast to double to hold large unsigned ints */ - GLdouble buf; - buf = (GLdouble)__GLU_SWAP_4_BYTES(t) + - (GLdouble)__GLU_SWAP_4_BYTES(t+group_size) + - (GLdouble)__GLU_SWAP_4_BYTES(t+ysize) + - (GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size); - s[0] = (GLuint)(buf/4 + 0.5); + GLdouble buf = (GLdouble)__GLU_SWAP_4_BYTES(t) + + (GLdouble)__GLU_SWAP_4_BYTES(t+group_size) + + (GLdouble)__GLU_SWAP_4_BYTES(t+ysize) + + (GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size); + s[0] = (GLuint)(buf/4.0 + 0.5); s++; t += element_size; } diff --git a/src/osgGA/MultiTouchTrackballManipulator.cpp b/src/osgGA/MultiTouchTrackballManipulator.cpp index e612fbd36..a7e71d126 100644 --- a/src/osgGA/MultiTouchTrackballManipulator.cpp +++ b/src/osgGA/MultiTouchTrackballManipulator.cpp @@ -37,8 +37,6 @@ MultiTouchTrackballManipulator::MultiTouchTrackballManipulator( const MultiTouch void MultiTouchTrackballManipulator::handleMultiTouchDrag(const GUIEventAdapter* now, const GUIEventAdapter* last, const double eventTimeDelta) { - const float zoom_threshold = 0.0001f; - osg::Vec2 pt_1_now(now->getTouchPointNormalizedX(0),now->getTouchPointNormalizedY(0)); osg::Vec2 pt_2_now(now->getTouchPointNormalizedX(1),now->getTouchPointNormalizedY(1)); osg::Vec2 pt_1_last(last->getTouchPointNormalizedX(0),last->getTouchPointNormalizedY(0)); @@ -51,7 +49,7 @@ void MultiTouchTrackballManipulator::handleMultiTouchDrag(const GUIEventAdapter* // osg::notify(osg::ALWAYS) << gap_now << " " << gap_last << std::endl; - + // zoom gesture if (fabs(gap_last - gap_now) > 0.02) zoomModel( (gap_last - gap_now) , true ); diff --git a/src/osgShadow/DebugShadowMap.cpp b/src/osgShadow/DebugShadowMap.cpp index 5bc2afad3..19094ff3c 100644 --- a/src/osgShadow/DebugShadowMap.cpp +++ b/src/osgShadow/DebugShadowMap.cpp @@ -401,14 +401,14 @@ void DebugShadowMap::ViewData::init( ThisClass *st, osgUtil::CullVisitor *cv ) { // view can be a slave that covers only a fraction of the screen // so adjust debug hud location to proper viewport location - _viewportOrigin[0] += vp->x(); - _viewportOrigin[1] += vp->y(); + _viewportOrigin[0] += static_cast(vp->x()); + _viewportOrigin[1] += static_cast(vp->y()); - if( _viewportSize[0] > vp->width() - _viewportOrigin[0] ) - _viewportSize[0] = vp->width() - _viewportOrigin[0]; + if( _viewportSize[0] > (static_cast(vp->width()) - _viewportOrigin[0]) ) + _viewportSize[0] = static_cast(vp->width()) - _viewportOrigin[0]; - if( _viewportSize[1] > vp->height() - _viewportOrigin[1] ) - _viewportSize[1] = vp->height() - _viewportOrigin[1]; + if( _viewportSize[1] > (static_cast(vp->height()) - _viewportOrigin[1]) ) + _viewportSize[1] = static_cast(vp->height()) - _viewportOrigin[1]; } _orthoSize = st->_orthoSize; diff --git a/src/osgViewer/ViewerEventHandlers.cpp b/src/osgViewer/ViewerEventHandlers.cpp index 7a6a3d7a6..2ef8e838c 100644 --- a/src/osgViewer/ViewerEventHandlers.cpp +++ b/src/osgViewer/ViewerEventHandlers.cpp @@ -712,14 +712,14 @@ InteractiveImageHandler::InteractiveImageHandler(osg::Image* image, osg::Texture double width = _camera->getViewport()->width(); double height = _camera->getViewport()->height(); - resize(width, height); + resize(static_cast(width), static_cast(height)); } } bool InteractiveImageHandler::mousePosition(osgViewer::View* view, osg::NodeVisitor* nv, const osgGA::GUIEventAdapter& ea, int& x, int &y) const { if (!view) return false; - + osgUtil::LineSegmentIntersector::Intersections intersections; bool foundIntersection = (nv==0) ? view->computeIntersections(ea, intersections) : view->computeIntersections(ea, nv->getNodePath(), intersections);