diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpanelface.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/linden/indra/newview/llpanelface.cpp b/linden/indra/newview/llpanelface.cpp index 68e603e..b9a40da 100644 --- a/linden/indra/newview/llpanelface.cpp +++ b/linden/indra/newview/llpanelface.cpp | |||
@@ -66,6 +66,7 @@ | |||
66 | #include "llviewerstats.h" | 66 | #include "llviewerstats.h" |
67 | #include "llviewerwindow.h" | 67 | #include "llviewerwindow.h" |
68 | #include "lluictrlfactory.h" | 68 | #include "lluictrlfactory.h" |
69 | #include "llpluginclassmedia.h" | ||
69 | 70 | ||
70 | // | 71 | // |
71 | // Methods | 72 | // Methods |
@@ -77,7 +78,6 @@ BOOL LLPanelFace::postBuild() | |||
77 | LLTextureCtrl* mTextureCtrl; | 78 | LLTextureCtrl* mTextureCtrl; |
78 | LLColorSwatchCtrl* mColorSwatch; | 79 | LLColorSwatchCtrl* mColorSwatch; |
79 | 80 | ||
80 | LLTextBox* mLabelTexGen; | ||
81 | LLComboBox* mComboTexGen; | 81 | LLComboBox* mComboTexGen; |
82 | 82 | ||
83 | LLCheckBoxCtrl *mCheckFullbright; | 83 | LLCheckBoxCtrl *mCheckFullbright; |
@@ -85,7 +85,6 @@ BOOL LLPanelFace::postBuild() | |||
85 | LLTextBox* mLabelColorTransp; | 85 | LLTextBox* mLabelColorTransp; |
86 | LLSpinCtrl* mCtrlColorTransp; // transparency = 1 - alpha | 86 | LLSpinCtrl* mCtrlColorTransp; // transparency = 1 - alpha |
87 | 87 | ||
88 | LLTextBox* mLabelGlow; | ||
89 | LLSpinCtrl* mCtrlGlow; | 88 | LLSpinCtrl* mCtrlGlow; |
90 | 89 | ||
91 | setMouseOpaque(FALSE); | 90 | setMouseOpaque(FALSE); |
@@ -156,7 +155,7 @@ BOOL LLPanelFace::postBuild() | |||
156 | mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright); | 155 | mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright); |
157 | mCheckFullbright->setCallbackUserData( this ); | 156 | mCheckFullbright->setCallbackUserData( this ); |
158 | } | 157 | } |
159 | mLabelTexGen = getChild<LLTextBox>("tex gen"); | 158 | |
160 | mComboTexGen = getChild<LLComboBox>("combobox texgen"); | 159 | mComboTexGen = getChild<LLComboBox>("combobox texgen"); |
161 | if(mComboTexGen) | 160 | if(mComboTexGen) |
162 | { | 161 | { |
@@ -165,7 +164,6 @@ BOOL LLPanelFace::postBuild() | |||
165 | mComboTexGen->setCallbackUserData( this ); | 164 | mComboTexGen->setCallbackUserData( this ); |
166 | } | 165 | } |
167 | 166 | ||
168 | mLabelGlow = getChild<LLTextBox>("glow label"); | ||
169 | mCtrlGlow = getChild<LLSpinCtrl>("glow"); | 167 | mCtrlGlow = getChild<LLSpinCtrl>("glow"); |
170 | if(mCtrlGlow) | 168 | if(mCtrlGlow) |
171 | { | 169 | { |
@@ -507,11 +505,6 @@ void LLPanelFace::getState() | |||
507 | childSetEnabled("button align",FALSE); | 505 | childSetEnabled("button align",FALSE); |
508 | //mBtnAutoFix->setEnabled ( FALSE ); | 506 | //mBtnAutoFix->setEnabled ( FALSE ); |
509 | 507 | ||
510 | if(LLViewerMedia::hasMedia()) | ||
511 | { | ||
512 | childSetEnabled("textbox autofix",editable); | ||
513 | childSetEnabled("button align",editable); | ||
514 | } | ||
515 | //if ( LLMediaEngine::getInstance()->getMediaRenderer () ) | 508 | //if ( LLMediaEngine::getInstance()->getMediaRenderer () ) |
516 | // if ( LLMediaEngine::getInstance()->getMediaRenderer ()->isLoaded () ) | 509 | // if ( LLMediaEngine::getInstance()->getMediaRenderer ()->isLoaded () ) |
517 | // { | 510 | // { |
@@ -568,7 +561,15 @@ void LLPanelFace::getState() | |||
568 | } | 561 | } |
569 | } | 562 | } |
570 | } | 563 | } |
564 | |||
565 | if(LLViewerMedia::textureHasMedia(id)) | ||
566 | { | ||
567 | childSetEnabled("textbox autofix",editable); | ||
568 | childSetEnabled("button align",editable); | ||
569 | } | ||
570 | |||
571 | } | 571 | } |
572 | |||
572 | 573 | ||
573 | LLAggregatePermissions texture_perms; | 574 | LLAggregatePermissions texture_perms; |
574 | if(texture_ctrl) | 575 | if(texture_ctrl) |
@@ -1117,14 +1118,18 @@ struct LLPanelFaceSetMediaFunctor : public LLSelectedTEFunctor | |||
1117 | { | 1118 | { |
1118 | virtual bool apply(LLViewerObject* object, S32 te) | 1119 | virtual bool apply(LLViewerObject* object, S32 te) |
1119 | { | 1120 | { |
1121 | // TODO: the media impl pointer should actually be stored by the texture | ||
1122 | viewer_media_t pMediaImpl = LLViewerMedia::getMediaImplFromTextureID(object->getTE ( te )->getID()); | ||
1120 | // only do this if it's a media texture | 1123 | // only do this if it's a media texture |
1121 | if ( object->getTE ( te )->getID() == LLViewerMedia::getMediaTextureID() ) | 1124 | if ( pMediaImpl.notNull()) |
1122 | { | 1125 | { |
1123 | S32 media_width, media_height; | 1126 | LLPluginClassMedia *media = pMediaImpl->getMediaPlugin(); |
1124 | S32 texture_width, texture_height; | 1127 | if(media) |
1125 | if ( LLViewerMedia::getMediaSize( &media_width, &media_height ) | ||
1126 | && LLViewerMedia::getTextureSize( &texture_width, &texture_height ) ) | ||
1127 | { | 1128 | { |
1129 | S32 media_width = media->getWidth(); | ||
1130 | S32 media_height = media->getHeight(); | ||
1131 | S32 texture_width = media->getTextureWidth(); | ||
1132 | S32 texture_height = media->getTextureHeight(); | ||
1128 | F32 scale_s = (F32)media_width / (F32)texture_width; | 1133 | F32 scale_s = (F32)media_width / (F32)texture_width; |
1129 | F32 scale_t = (F32)media_height / (F32)texture_height; | 1134 | F32 scale_t = (F32)media_height / (F32)texture_height; |
1130 | 1135 | ||