1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-31 20:45:34 +00:00

Merge remote-tracking branch 'scrawl/videoplayback' into videoplayback

This commit is contained in:
Chris Robinson 2012-12-15 09:15:47 -08:00
commit e6d27cd6d0

View file

@ -416,7 +416,7 @@ public:
break;
}
mFramePos = std::min(mFrameSize, sample_skip);
mFramePos = std::min(static_cast<int>(mFrameSize), sample_skip);
sample_skip -= mFramePos;
}
@ -939,14 +939,16 @@ VideoPlayer::VideoPlayer(Ogre::SceneManager* sceneMgr)
, mRectangle(NULL)
, mNode(NULL)
{
mVideoMaterial = Ogre::MaterialManager::getSingleton().create("VideoMaterial", "General");
mVideoMaterial->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
mVideoMaterial->getTechnique(0)->getPass(0)->setDepthCheckEnabled(false);
mVideoMaterial->getTechnique(0)->getPass(0)->setLightingEnabled(false);
if(mVideoMaterial->getTechnique(0)->getPass(0)->getNumTextureUnitStates() == 0)
mVideoMaterial = Ogre::MaterialManager::getSingleton().getByName("VideoMaterial", "General");
if (mVideoMaterial.isNull ())
{
mVideoMaterial = Ogre::MaterialManager::getSingleton().create("VideoMaterial", "General");
mVideoMaterial->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
mVideoMaterial->getTechnique(0)->getPass(0)->setDepthCheckEnabled(false);
mVideoMaterial->getTechnique(0)->getPass(0)->setLightingEnabled(false);
mVideoMaterial->getTechnique(0)->getPass(0)->createTextureUnitState()->setTextureName("black.png");
else
mVideoMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName("black.png");
}
mVideoMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName("black.png");
mRectangle = new Ogre::Rectangle2D(true);
mRectangle->setCorners(-1.0, 1.0, 1.0, -1.0);
@ -1006,6 +1008,8 @@ void VideoPlayer::playVideo(const std::string &resourceName)
mState = new VideoState;
mState->init(resourceName);
mVideoMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName("black.png");
}
void VideoPlayer::update ()