summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelface.cpp')
-rw-r--r--indra/newview/llpanelface.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index e9e71644b1..08a50d4b6e 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -62,6 +62,7 @@
#include "llviewerobject.h"
#include "llviewerstats.h"
#include "lluictrlfactory.h"
+#include "llpluginclassmedia.h"
//
// Methods
@@ -386,11 +387,6 @@ void LLPanelFace::getState()
childSetEnabled("button align",FALSE);
//mBtnAutoFix->setEnabled ( FALSE );
- if(LLViewerMedia::hasMedia())
- {
- childSetEnabled("textbox autofix",editable);
- childSetEnabled("button align",editable);
- }
//if ( LLMediaEngine::getInstance()->getMediaRenderer () )
// if ( LLMediaEngine::getInstance()->getMediaRenderer ()->isLoaded () )
// {
@@ -447,7 +443,15 @@ void LLPanelFace::getState()
}
}
}
+
+ if(LLViewerMedia::textureHasMedia(id))
+ {
+ childSetEnabled("textbox autofix",editable);
+ childSetEnabled("button align",editable);
+ }
+
}
+
LLAggregatePermissions texture_perms;
if(texture_ctrl)
@@ -919,14 +923,18 @@ struct LLPanelFaceSetMediaFunctor : public LLSelectedTEFunctor
{
virtual bool apply(LLViewerObject* object, S32 te)
{
+ // TODO: the media impl pointer should actually be stored by the texture
+ viewer_media_t pMediaImpl = LLViewerMedia::getMediaImplFromTextureID(object->getTE ( te )->getID());
// only do this if it's a media texture
- if ( object->getTE ( te )->getID() == LLViewerMedia::getMediaTextureID() )
+ if ( pMediaImpl.notNull())
{
- S32 media_width, media_height;
- S32 texture_width, texture_height;
- if ( LLViewerMedia::getMediaSize( &media_width, &media_height )
- && LLViewerMedia::getTextureSize( &texture_width, &texture_height ) )
+ LLPluginClassMedia *media = pMediaImpl->getMediaPlugin();
+ if(media)
{
+ S32 media_width = media->getWidth();
+ S32 media_height = media->getHeight();
+ S32 texture_width = media->getTextureWidth();
+ S32 texture_height = media->getTextureHeight();
F32 scale_s = (F32)media_width / (F32)texture_width;
F32 scale_t = (F32)media_height / (F32)texture_height;