From a31d603f9a51a0518e07bd933d1222892aaf57c4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 22 Nov 2012 15:13:46 +0000 Subject: [PATCH] From Stephan Huber, "Attached you'll find a new ImageSequence.cpp which will fix an issue I had when moving the mouse cursor over the left window-border, as the index becomes negative. And I added a UdpSocket.cpp-file with more debuggin-output via some sprinkled printf-calls. " --- src/osg/ImageSequence.cpp | 4 ++-- src/osgPlugins/osc/ip/posix/UdpSocket.cpp | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/osg/ImageSequence.cpp b/src/osg/ImageSequence.cpp index 8faec34e8..344fa81c7 100644 --- a/src/osg/ImageSequence.cpp +++ b/src/osg/ImageSequence.cpp @@ -353,10 +353,10 @@ void ImageSequence::update(osg::NodeVisitor* nv) if (useDirectTimeRequest) { - int i = int(time/_timePerImage); + int i = osg::maximum(0, int(time/_timePerImage)); if ((i>=int(_imageDataList.size()) || !_imageDataList[i]._image)) { - i = osg::clampTo(i, 0, _imageDataList.size()-1); + i = osg::minimum(i, _imageDataList.size()-1); OSG_INFO<<"Requesting file, entry="<second->impl_->Socket(), &tempfds ) ){ - + printf("UdpSocket::Run() reading from socket \n"); int size = i->second->ReceiveFrom( remoteEndpoint, data, MAX_BUFFER_SIZE ); if( size > 0 ){ i->first->ProcessPacket( data, size, remoteEndpoint );