From 3ce382fd45ba505bed199d7b5ed4c937385141eb Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 9 Feb 2005 16:18:44 +0000 Subject: [PATCH] Changed the mpeg plugin to read movies the original way up rather than the OpenGL way up to keep them consistent with the xine and quicktime movie codes --- examples/osgmovie/osgmovie.cpp | 8 ++++---- src/osgPlugins/mpeg/MpegImageStream.cpp | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/osgmovie/osgmovie.cpp b/examples/osgmovie/osgmovie.cpp index a1145b2ed..a1969a0bb 100644 --- a/examples/osgmovie/osgmovie.cpp +++ b/examples/osgmovie/osgmovie.cpp @@ -183,10 +183,10 @@ osg::Geometry* createTexturedQuadGeometry(const osg::Vec3& pos,float width,float bool useTextureRectangle = true; if (useTextureRectangle) { - osg::Geometry* pictureQuad = osg::createTexturedQuadGeometry(pos, + osg::Geometry* pictureQuad = createTexturedQuadGeometry(pos, osg::Vec3(width,0.0f,0.0f), osg::Vec3(0.0f,0.0f,height), - image->s(),image->t()); + 0.0f,image->t(), image->s(),0.0f); pictureQuad->getOrCreateStateSet()->setTextureAttributeAndModes(0, new osg::TextureRectangle(image), @@ -196,10 +196,10 @@ osg::Geometry* createTexturedQuadGeometry(const osg::Vec3& pos,float width,float } else { - osg::Geometry* pictureQuad = osg::createTexturedQuadGeometry(pos, + osg::Geometry* pictureQuad = createTexturedQuadGeometry(pos, osg::Vec3(width,0.0f,0.0f), osg::Vec3(0.0f,0.0f,height), - 1.0f,1.0f); + 0.0f,0.0f, 1.0f,1.0f); pictureQuad->getOrCreateStateSet()->setTextureAttributeAndModes(0, new osg::Texture2D(image), diff --git a/src/osgPlugins/mpeg/MpegImageStream.cpp b/src/osgPlugins/mpeg/MpegImageStream.cpp index ba7cce3da..48853a941 100644 --- a/src/osgPlugins/mpeg/MpegImageStream.cpp +++ b/src/osgPlugins/mpeg/MpegImageStream.cpp @@ -198,7 +198,12 @@ void MpegImageStream::swapData() unsigned char* dp = _videoWriteData; for (int i = 0; i < t(); i++) { +// #define FLIP_VERTICAL_SO_ORIENTATED_LIKE_OPENGL_WITH_ORIGIN_AT_BOTTOM_LEFT +#ifdef FLIP_VERTICAL_SO_ORIENTATED_LIKE_OPENGL_WITH_ORIGIN_AT_BOTTOM_LEFT _rows[t()-i-1] = dp; +#else + _rows[i] = dp; +#endif dp += (s() * 4); } }