Warning fixes
This commit is contained in:
parent
91033a3a1f
commit
f02ed3c629
@ -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;
|
||||
}
|
||||
|
@ -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 );
|
||||
|
@ -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<unsigned short>(vp->x());
|
||||
_viewportOrigin[1] += static_cast<unsigned short>(vp->y());
|
||||
|
||||
if( _viewportSize[0] > vp->width() - _viewportOrigin[0] )
|
||||
_viewportSize[0] = vp->width() - _viewportOrigin[0];
|
||||
if( _viewportSize[0] > (static_cast<unsigned short>(vp->width()) - _viewportOrigin[0]) )
|
||||
_viewportSize[0] = static_cast<unsigned short>(vp->width()) - _viewportOrigin[0];
|
||||
|
||||
if( _viewportSize[1] > vp->height() - _viewportOrigin[1] )
|
||||
_viewportSize[1] = vp->height() - _viewportOrigin[1];
|
||||
if( _viewportSize[1] > (static_cast<unsigned short>(vp->height()) - _viewportOrigin[1]) )
|
||||
_viewportSize[1] = static_cast<unsigned short>(vp->height()) - _viewportOrigin[1];
|
||||
}
|
||||
|
||||
_orthoSize = st->_orthoSize;
|
||||
|
@ -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<int>(width), static_cast<int>(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);
|
||||
|
Loading…
Reference in New Issue
Block a user