Better handling of FSFlipCEFY.

meow-7.2.2
Nicky 2015-12-31 17:47:36 +01:00
parent 9ebb85e188
commit 0a5956cb20
1 changed files with 31 additions and 31 deletions

View File

@ -3484,37 +3484,6 @@ void LLViewerMediaTexture::addMediaToFace(LLFace* facep)
if(facep)
{
facep->setHasMedia(true);
// <FS:ND> If using CEF then set a texture matrix to flip around the Y Axis.
static bool sFlipY = gSavedSettings.getBOOL( "FSFlipCEFY" );
LLViewerMediaImpl *pMedia = mMediaImplp;
if( !pMedia )
pMedia = LLViewerMedia::getMediaImplFromTextureID(mID);
std::string strMimeType;
if( pMedia )
strMimeType = pMedia->getMimeType();
std::string strImpl = LLMIMETypes::implType( strMimeType );
bool bCoordsOpenGl = sFlipY;
if( pMedia && pMedia->getMediaPlugin() )
bCoordsOpenGl = pMedia->getMediaPlugin()->getTextureCoordsOpenGL();
if( strImpl == "media_plugin_cef" && !bCoordsOpenGl )
{
if( !facep->mTextureMatrix )
{
facep->mTextureMatrix = new LLMatrix4();
facep->mTextureMatrix->mMatrix[ 1 ][ 1 ] = -1.0f;
facep->mTextureMatrix->mMatrix[ 2 ][ 1 ] = 1.0f;
}
else
{
LL_WARNS() << "Matrix for media face is already set." << LL_ENDL;
}
}
// </FS:ND>
}
if(!mIsPlaying)
{
@ -3686,6 +3655,37 @@ void LLViewerMediaTexture::switchTexture(U32 ch, LLFace* facep)
if(mIsPlaying) //old textures switch to the media texture
{
// <FS:ND> If using CEF then set a texture matrix to flip around the Y Axis.
static bool sFlipY = gSavedSettings.getBOOL( "FSFlipCEFY" );
LLViewerMediaImpl *pMedia = mMediaImplp;
if( !pMedia )
pMedia = LLViewerMedia::getMediaImplFromTextureID(mID);
std::string strMimeType;
if( pMedia )
strMimeType = pMedia->getMimeType();
std::string strImpl = LLMIMETypes::implType( strMimeType );
bool bCoordsOpenGl = sFlipY;
if( pMedia && pMedia->getMediaPlugin() )
bCoordsOpenGl = pMedia->getMediaPlugin()->getTextureCoordsOpenGL();
if( strImpl == "media_plugin_cef" && !bCoordsOpenGl )
{
if( !facep->mTextureMatrix )
{
facep->mTextureMatrix = new LLMatrix4();
facep->mTextureMatrix->mMatrix[ 1 ][ 1 ] = -1.0f;
facep->mTextureMatrix->mMatrix[ 2 ][ 1 ] = 1.0f;
}
else
{
LL_WARNS() << "Matrix for media face is already set." << LL_ENDL;
}
}
// </FS:ND>
facep->switchTexture(ch, this);
}
else //switch to old textures.