diff options
-rw-r--r-- | indra/newview/llprogressview.cpp | 132 | ||||
-rw-r--r-- | indra/newview/llprogressview.h | 19 | ||||
-rw-r--r-- | indra/newview/skins/default/textures/3p_icons/fmod_logo.png | bin | 0 -> 14486 bytes | |||
-rw-r--r-- | indra/newview/skins/default/textures/3p_icons/havok_logo.png | bin | 0 -> 41488 bytes | |||
-rw-r--r-- | indra/newview/skins/default/xui/de/panel_progress.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_progress.xml | 32 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/es/panel_progress.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/fr/panel_progress.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/it/panel_progress.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/ja/panel_progress.xml | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/pl/panel_progress.xml | 5 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/pt/panel_progress.xml | 2 |
12 files changed, 202 insertions, 0 deletions
diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 2c09943b83..c77fc6dc84 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -81,6 +81,8 @@ bool LLProgressView::postBuild() { mProgressBar = getChild<LLProgressBar>("login_progress_bar"); + mLogosLabel = getChild<LLTextBox>("logos_lbl"); + mProgressText = getChild<LLTextBox>("progress_text"); mMessageText = getChild<LLTextBox>("message_text"); mMessageTextRectInitial = mMessageText->getRect(); // auto resizes, save initial size @@ -239,6 +241,33 @@ void LLProgressView::drawStartTexture(F32 alpha) gGL.popMatrix(); } +void LLProgressView::drawLogos(F32 alpha) +{ + if (mLogosList.empty()) + { + return; + } + + // logos are tied to label, + // due to potential resizes we have to figure offsets out on draw or resize + S32 offset_x, offset_y; + mLogosLabel->localPointToScreen(0, 0, &offset_x, &offset_y); + std::vector<TextureData>::const_iterator iter = mLogosList.begin(); + std::vector<TextureData>::const_iterator end = mLogosList.end(); + for (; iter != end; iter++) + { + gl_draw_scaled_image_with_border(iter->mDrawRect.mLeft + offset_x, + iter->mDrawRect.mBottom + offset_y, + iter->mDrawRect.getWidth(), + iter->mDrawRect.getHeight(), + iter->mTexturep.get(), + UI_VERTEX_COLOR % alpha, + false, + iter->mClipRect, + iter->mOffsetRect); + } +} + void LLProgressView::draw() { static LLTimer timer; @@ -254,6 +283,7 @@ void LLProgressView::draw() } LLPanel::draw(); + drawLogos(alpha); return; } @@ -266,6 +296,7 @@ void LLProgressView::draw() drawStartTexture(alpha); LLPanel::draw(); + drawLogos(alpha); // faded out completely - remove panel and reveal world if (mFadeToWorldTimer.getElapsedTimeF32() > FADE_TO_WORLD_TIME ) @@ -300,6 +331,7 @@ void LLProgressView::draw() drawStartTexture(1.0f); // draw children LLPanel::draw(); + drawLogos(1.0f); } void LLProgressView::setText(const std::string& text) @@ -330,6 +362,98 @@ void LLProgressView::setMessage(const std::string& msg) } } +void LLProgressView::loadLogo(const std::string &path, + const U8 image_codec, + const LLRect &pos_rect, + const LLRectf &clip_rect, + const LLRectf &offset_rect) +{ + // We need these images very early, so we have to force-load them, otherwise they might not load in time. + if (!gDirUtilp->fileExists(path)) + { + return; + } + + LLPointer<LLImageFormatted> start_image_frmted = LLImageFormatted::createFromType(image_codec); + if (!start_image_frmted->load(path)) + { + LL_WARNS("AppInit") << "Image load failed: " << path << LL_ENDL; + return; + } + + LLPointer<LLImageRaw> raw = new LLImageRaw; + if (!start_image_frmted->decode(raw, 0.0f)) + { + LL_WARNS("AppInit") << "Image decode failed " << path << LL_ENDL; + return; + } + // HACK: getLocalTexture allows only power of two dimentions + raw->expandToPowerOfTwo(); + + TextureData data; + data.mTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), false); + data.mDrawRect = pos_rect; + data.mClipRect = clip_rect; + data.mOffsetRect = offset_rect; + mLogosList.push_back(data); +} + +void LLProgressView::initLogos() +{ + mLogosList.clear(); + +#if LL_FMODSTUDIO || LL_HAVOK + const U8 image_codec = IMG_CODEC_PNG; + const LLRectf default_clip(0.f, 1.f, 1.f, 0.f); + //const S32 default_height = 28; + const S32 default_pad = 15; + + S32 icon_width, icon_height; + + // We don't know final screen rect yet, so we can't precalculate position fully + S32 texture_start_x = (S32)mLogosLabel->getFont()->getWidthF32(mLogosLabel->getWText().c_str()) + default_pad; + S32 texture_start_y = -7; +#endif //LL_FMODSTUDIO || LL_HAVOK + + // Normally we would just preload these textures from textures.xml, + // and display them via icon control, but they are only needed on + // startup and preloaded/UI ones stay forever + // (and this code was done already so simply reused it) + std::string temp_str = gDirUtilp->getExpandedFilename(LL_PATH_DEFAULT_SKIN, "textures", "3p_icons"); + + temp_str += gDirUtilp->getDirDelimiter(); + +#ifdef LL_FMODSTUDIO + // original image size is 264x96, it is on longer side but + // with no internal paddings so it gets additional padding + icon_width = 77; + icon_height = 21; + S32 pad_fmod_y = 4; + texture_start_x++; + loadLogo(temp_str + "fmod_logo.png", + image_codec, + LLRect(texture_start_x, texture_start_y + pad_fmod_y + icon_height, texture_start_x + icon_width, texture_start_y + pad_fmod_y), + default_clip, + default_clip); + + texture_start_x += icon_width + default_pad + 1; +#endif //LL_FMODSTUDIO +#ifdef LL_HAVOK + // original image size is 342x113, central element is on a larger side + // plus internal padding, so it gets slightly more height than desired 32 + icon_width = 88; + icon_height = 29; + S32 pad_havok_y = -1; + loadLogo(temp_str + "havok_logo.png", + image_codec, + LLRect(texture_start_x, texture_start_y + pad_havok_y + icon_height, texture_start_x + icon_width, texture_start_y + pad_havok_y), + default_clip, + default_clip); + + texture_start_x += icon_width + default_pad; +#endif //LL_HAVOK +} + void LLProgressView::initStartTexture(S32 location_id, bool is_in_production) { if (gStartTexture.notNull()) @@ -408,11 +532,19 @@ void LLProgressView::initStartTexture(S32 location_id, bool is_in_production) void LLProgressView::initTextures(S32 location_id, bool is_in_production) { initStartTexture(location_id, is_in_production); + initLogos(); + + childSetVisible("panel_icons", !mLogosList.empty()); + childSetVisible("panel_top_spacer", mLogosList.empty()); } void LLProgressView::releaseTextures() { gStartTexture = NULL; + mLogosList.clear(); + + childSetVisible("panel_top_spacer", true); + childSetVisible("panel_icons", false); } void LLProgressView::setCancelButtonVisible(bool b, const std::string& label) diff --git a/indra/newview/llprogressview.h b/indra/newview/llprogressview.h index 250ee511d7..f529c16c1d 100644 --- a/indra/newview/llprogressview.h +++ b/indra/newview/llprogressview.h @@ -53,6 +53,7 @@ public: /*virtual*/ void draw(); void drawStartTexture(F32 alpha); + void drawLogos(F32 alpha); /*virtual*/ bool handleHover(S32 x, S32 y, MASK mask); /*virtual*/ bool handleKeyHere(KEY key, MASK mask); @@ -85,6 +86,7 @@ public: protected: LLProgressBar* mProgressBar; LLMediaCtrl* mMediaCtrl; + LLTextBox* mLogosLabel = nullptr; LLTextBox* mProgressText = nullptr; LLTextBox* mMessageText = nullptr; F32 mPercentDone; @@ -110,8 +112,25 @@ protected: bool handleUpdate(const LLSD& event_data); static void onIdle(void* user_data); + void loadLogo(const std::string &path, const U8 image_codec, const LLRect &pos_rect, const LLRectf &clip_rect, const LLRectf &offset_rect); + // logos have unusual location and need to be preloaded to not appear grey, then deleted + void initLogos(); // Loads a bitmap to display during load void initStartTexture(S32 location_id, bool is_in_production); + +private: + // We need to draw textures on login, but only once. + // So this vector gets filled up for textures to render and gets cleaned later + // Some textures have unusual requirements, so we are rendering directly + class TextureData + { + public: + LLPointer<LLViewerTexture> mTexturep; + LLRect mDrawRect; + LLRectf mClipRect; + LLRectf mOffsetRect; + }; + std::vector<TextureData> mLogosList; }; #endif // LL_LLPROGRESSVIEW_H diff --git a/indra/newview/skins/default/textures/3p_icons/fmod_logo.png b/indra/newview/skins/default/textures/3p_icons/fmod_logo.png Binary files differnew file mode 100644 index 0000000000..5a50e0ad34 --- /dev/null +++ b/indra/newview/skins/default/textures/3p_icons/fmod_logo.png diff --git a/indra/newview/skins/default/textures/3p_icons/havok_logo.png b/indra/newview/skins/default/textures/3p_icons/havok_logo.png Binary files differnew file mode 100644 index 0000000000..ff1ea3a72e --- /dev/null +++ b/indra/newview/skins/default/textures/3p_icons/havok_logo.png diff --git a/indra/newview/skins/default/xui/de/panel_progress.xml b/indra/newview/skins/default/xui/de/panel_progress.xml index c9bed9fd9b..8d1abdcac1 100644 --- a/indra/newview/skins/default/xui/de/panel_progress.xml +++ b/indra/newview/skins/default/xui/de/panel_progress.xml @@ -1,8 +1,10 @@ <?xml version="1.0" ?> <panel name="login_progress_panel"> + <layout_panel name="panel_icons"/> <layout_stack name="vertical_centering"/> <layout_panel name="panel4"/> <layout_panel name="center"/> <layout_stack name="horizontal_centering"> + <text name="logos_lbl">Second Life verwendet</text> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_progress.xml b/indra/newview/skins/default/xui/en/panel_progress.xml index 6b19907372..8e0e6408ed 100644 --- a/indra/newview/skins/default/xui/en/panel_progress.xml +++ b/indra/newview/skins/default/xui/en/panel_progress.xml @@ -70,6 +70,14 @@ width="670"> <layout_panel auto_resize="false" + height="30" + layout="topleft" + min_height="30" + name="panel_top_spacer" + width="670"> + </layout_panel> + <layout_panel + auto_resize="false" height="100" layout="topleft" min_height="100" @@ -134,6 +142,30 @@ right="-90" word_wrap="true"/> </layout_panel> + <layout_panel + auto_resize="false" + height="40" + layout="topleft" + min_height="40" + name="panel_icons" + width="670"> + <!--Logos are tied to following label from code--> + <text + follows="left|right|top" + layout="topleft" + font="SansSerifLarge" + font_shadow="none" + halign="left" + height="16" + width="240" + left="47" + top="6" + line_spacing.pixels="2" + name="logos_lbl" + text_color="LoginProgressBoxTextColor"> + Megapahit uses + </text> + </layout_panel> </layout_stack> </layout_panel> <layout_panel diff --git a/indra/newview/skins/default/xui/es/panel_progress.xml b/indra/newview/skins/default/xui/es/panel_progress.xml index c9bed9fd9b..64aaf246f8 100644 --- a/indra/newview/skins/default/xui/es/panel_progress.xml +++ b/indra/newview/skins/default/xui/es/panel_progress.xml @@ -1,8 +1,10 @@ <?xml version="1.0" ?> <panel name="login_progress_panel"> + <layout_panel name="panel_icons"/> <layout_stack name="vertical_centering"/> <layout_panel name="panel4"/> <layout_panel name="center"/> <layout_stack name="horizontal_centering"> + <text name="logos_lbl">Usos de Second Life</text> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/fr/panel_progress.xml b/indra/newview/skins/default/xui/fr/panel_progress.xml index c9bed9fd9b..673ec63642 100644 --- a/indra/newview/skins/default/xui/fr/panel_progress.xml +++ b/indra/newview/skins/default/xui/fr/panel_progress.xml @@ -1,8 +1,10 @@ <?xml version="1.0" ?> <panel name="login_progress_panel"> + <layout_panel name="panel_icons"/> <layout_stack name="vertical_centering"/> <layout_panel name="panel4"/> <layout_panel name="center"/> <layout_stack name="horizontal_centering"> + <text name="logos_lbl">Second Life utilise</text> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/it/panel_progress.xml b/indra/newview/skins/default/xui/it/panel_progress.xml index c9bed9fd9b..fd2892a88f 100644 --- a/indra/newview/skins/default/xui/it/panel_progress.xml +++ b/indra/newview/skins/default/xui/it/panel_progress.xml @@ -1,8 +1,10 @@ <?xml version="1.0" ?> <panel name="login_progress_panel"> + <layout_panel name="panel_icons"/> <layout_stack name="vertical_centering"/> <layout_panel name="panel4"/> <layout_panel name="center"/> <layout_stack name="horizontal_centering"> + <text name="logos_lbl">Utilizzi di Second Life</text> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/ja/panel_progress.xml b/indra/newview/skins/default/xui/ja/panel_progress.xml index 1edada6098..7fd7d5ab5c 100644 --- a/indra/newview/skins/default/xui/ja/panel_progress.xml +++ b/indra/newview/skins/default/xui/ja/panel_progress.xml @@ -1,8 +1,12 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel name="login_progress_panel"> + <layout_panel name="panel_icons"/> <layout_stack name="vertical_centering"/> <layout_panel name="panel4"/> <layout_panel name="center"/> <layout_stack name="horizontal_centering"> + <text name="logos_lbl"> + セカンドライフ使用 + </text> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_progress.xml b/indra/newview/skins/default/xui/pl/panel_progress.xml index 8da982cc3f..a701d98398 100644 --- a/indra/newview/skins/default/xui/pl/panel_progress.xml +++ b/indra/newview/skins/default/xui/pl/panel_progress.xml @@ -5,6 +5,11 @@ <layout_stack name="vertical_centering1"> <layout_panel name="panel4"> <layout_stack name="vertical_centering2"> + <layout_panel name="panel_icons"> + <text name="logos_lbl"> + Second Life używa + </text> + </layout_panel> </layout_stack> </layout_panel> </layout_stack> diff --git a/indra/newview/skins/default/xui/pt/panel_progress.xml b/indra/newview/skins/default/xui/pt/panel_progress.xml index c9bed9fd9b..63bb663cfc 100644 --- a/indra/newview/skins/default/xui/pt/panel_progress.xml +++ b/indra/newview/skins/default/xui/pt/panel_progress.xml @@ -1,8 +1,10 @@ <?xml version="1.0" ?> <panel name="login_progress_panel"> + <layout_panel name="panel_icons"/> <layout_stack name="vertical_centering"/> <layout_panel name="panel4"/> <layout_panel name="center"/> <layout_stack name="horizontal_centering"> + <text name="logos_lbl">Usos do Second Life</text> </layout_stack> </panel> |