LLColor4 LLSky::getFogColor() const { if (mVOSkyp) { return mVOSkyp->getFogColor(); } return LLColor4(1.f, 1.f, 1.f, 1.f); }
LLVOPartGroup::LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) : LLAlphaObject(id, pcode, regionp), mViewerPartGroupp(NULL) { setNumTEs(1); setTETexture(0, LLUUID::null); mbCanSelect = FALSE; // users can't select particle systems mDebugColor = LLColor4(ll_frand(), ll_frand(), ll_frand(), 1.f); }
void LLManip::renderXYZ(const LLVector3 &vec) { const S32 PAD = 10; std::string feedback_string; LLVector3 camera_pos = LLViewerCamera::getInstance()->getOrigin() + LLViewerCamera::getInstance()->getAtAxis(); S32 window_center_x = gViewerWindow->getWorldViewRectScaled().getWidth() / 2; S32 window_center_y = gViewerWindow->getWorldViewRectScaled().getHeight() / 2; S32 vertical_offset = window_center_y - VERTICAL_OFFSET; gGL.pushMatrix(); { LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga"); gViewerWindow->setup2DRender(); const LLVector2& display_scale = gViewerWindow->getDisplayScale(); gGL.scalef(display_scale.mV[VX], display_scale.mV[VY], 1.f); gGL.color4f(0.f, 0.f, 0.f, 0.7f); imagep->draw( window_center_x - 115, window_center_y + vertical_offset - PAD, 235, PAD * 2 + 10, LLColor4(0.f, 0.f, 0.f, 0.7f) ); } gGL.popMatrix(); gViewerWindow->setup3DRender(); { LLFontGL* font = LLFontGL::getFontSansSerif(); LLLocale locale(LLLocale::USER_LOCALE); LLGLDepthTest gls_depth(GL_FALSE); // render drop shadowed text feedback_string = llformat("X: %.3f", vec.mV[VX]); hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -102.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); feedback_string = llformat("Y: %.3f", vec.mV[VY]); hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -27.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); feedback_string = llformat("Z: %.3f", vec.mV[VZ]); hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 48.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); // render text on top feedback_string = llformat("X: %.3f", vec.mV[VX]); hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -102.f, (F32)vertical_offset, LLColor4(1.f, 0.5f, 0.5f, 1.f), FALSE); gGL.diffuseColor3f(0.5f, 1.f, 0.5f); feedback_string = llformat("Y: %.3f", vec.mV[VY]); hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -27.f, (F32)vertical_offset, LLColor4(0.5f, 1.f, 0.5f, 1.f), FALSE); gGL.diffuseColor3f(0.5f, 0.5f, 1.f); feedback_string = llformat("Z: %.3f", vec.mV[VZ]); hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 48.f, (F32)vertical_offset, LLColor4(0.5f, 0.5f, 1.f, 1.f), FALSE); } }
LLStatGraph::LLStatGraph(const std::string& name, const LLRect& rect) : LLView(name, rect, TRUE) { mStatp = NULL; setToolTip(name); mNumThresholds = 3; mThresholdColors[0] = LLColor4(0.f, 1.f, 0.f, 1.f); mThresholdColors[1] = LLColor4(1.f, 1.f, 0.f, 1.f); mThresholdColors[2] = LLColor4(1.f, 0.f, 0.f, 1.f); mThresholdColors[3] = LLColor4(1.f, 0.f, 0.f, 1.f); mThresholds[0] = 50.f; mThresholds[1] = 75.f; mThresholds[2] = 100.f; mMin = 0.f; mMax = 125.f; mPerSec = TRUE; mValue = 0.f; mPrecision = 0; }
LLStatGraph::LLStatGraph(const LLView::Params& p) : LLView(p) { mStatp = NULL; setToolTip(p.name()); mNumThresholds = 3; mThresholdColors[0] = LLColor4(0.f, 1.f, 0.f, 1.f); mThresholdColors[1] = LLColor4(1.f, 1.f, 0.f, 1.f); mThresholdColors[2] = LLColor4(1.f, 0.f, 0.f, 1.f); mThresholdColors[3] = LLColor4(1.f, 0.f, 0.f, 1.f); mThresholds[0] = 50.f; mThresholds[1] = 75.f; mThresholds[2] = 100.f; mMin = 0.f; mMax = 125.f; mPerSec = TRUE; mValue = 0.f; mPrecision = 0; }
LLColor4 LLTexGlobalColor::getColor() const { // Sum of color params if (mParamGlobalColorList.empty()) return LLColor4(1.f, 1.f, 1.f, 1.f); LLColor4 net_color(0.f, 0.f, 0.f, 0.f); LLTexLayer::calculateTexLayerColor(mParamGlobalColorList, net_color); return net_color; }
LLColor4U LLSky::getFadeColor() const { if (mVOSkyp) { return mVOSkyp->getFadeColor(); } else { return LLColor4(1.f, 1.f, 1.f, 1.f); } }
LLColor4 LLSky::getTotalAmbientColor() const { if (mVOSkyp) { return mVOSkyp->getTotalAmbientColor(); } else { return LLColor4(1.f, 1.f, 1.f, 1.f); } }
// Update controls based on current settings void LLPrefsAscentVan::refresh() { //General -------------------------------------------------------------------------------- //Tags\Colors ---------------------------------------------------------------------------- //Colors --------------------------------------------------------------------------------- LLComboBox* combo = getChild<LLComboBox>("tag_spoofing_combobox"); if(LLVOAvatar::sClientResolutionList.has("isComplete")) { //combo->setColor(LLColor4::black); combo->clear(); for(LLSD::map_iterator itr = LLVOAvatar::sClientResolutionList.beginMap(); itr != LLVOAvatar::sClientResolutionList.endMap(); itr++) { LLSD value = (*itr).second; if(value.has("name")) { std::string name = value.get("name"); std::string uuid = (*itr).first; LLColor4 color = LLColor4(value.get("color")); if(value["multiple"].asReal() != 0) { color *= 1.0/(value["multiple"].asReal()+1.0f); } LLScrollListItem* item = combo->add(name,uuid); //bad practice item->getColumn(0)->setColor(color); } } //add Viewer 2.0 LLScrollListItem* item = combo->add("Viewer 2.0",IMG_DEFAULT_AVATAR); //bad practice item->getColumn(0)->setColor(LLColor4::black); } combo->setCurrentByIndex(mSelectedClient); childSetEnabled("friends_color_textbox", mUseStatusColors); childSetEnabled("friend_color_swatch", mUseStatusColors); childSetEnabled("estate_owner_color_swatch", mUseStatusColors); childSetEnabled("linden_color_swatch", mUseStatusColors); childSetEnabled("muted_color_swatch", mUseStatusColors); childSetEnabled("custom_tag_label_text", mCustomTagOn); childSetEnabled("custom_tag_label_box", mCustomTagOn); childSetValue("custom_tag_label_box", gSavedSettings.getString("AscentCustomTagLabel")); childSetEnabled("custom_tag_color_text", mCustomTagOn); childSetEnabled("custom_tag_color_swatch", mCustomTagOn); //Body Dynamics -------------------------------------------------------------------------- childSetEnabled("EmeraldBoobMass", mBreastPhysicsToggle); childSetEnabled("EmeraldBoobHardness", mBreastPhysicsToggle); childSetEnabled("EmeraldBoobVelMax", mBreastPhysicsToggle); childSetEnabled("EmeraldBoobFriction", mBreastPhysicsToggle); childSetEnabled("EmeraldBoobVelMin", mBreastPhysicsToggle); }
void LLDrawPoolAvatar::beginImpostor() { if (!LLPipeline::sReflectionRender) { LLVOAvatar::sRenderDistance = llclamp(LLVOAvatar::sRenderDistance, 16.f, 256.f); LLVOAvatar::sNumVisibleAvatars = 0; } gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); sDiffuseChannel = 0; }
void ParamValue<LLUIColor>::updateValueFromBlock() { if (control.isProvided() && !control().empty()) { updateValue(LLUIColorTable::instance().getColor(control)); } else { updateValue(LLColor4(red, green, blue, alpha)); } }
void ParamValue<LLUIColor>::updateValueFromBlock() { if (control.isProvided() && !control().empty()) { updateValue(LLUI::sColorsGroup->controlExists(control) ? LLUI::sColorsGroup->getColor(control) : LLUI::sConfigGroup->getColor(control)); // Singu Note: Most of our colors will be in sColorsGroup (skin), but some may be moved to settings for users. } else { updateValue(LLColor4(red, green, blue, alpha)); } }
LLColor4 LLSky::calcInScatter(LLColor4& transp, const LLVector3 &point, F32 exag) const { if (mVOSkyp) { return mVOSkyp->calcInScatter(transp, point, exag); } else { return LLColor4(1.f, 1.f, 1.f, 1.f); } }
void v4color_object::test<10>() { F32 r = 0x20, g = 0xFFFF, b = 0xFF; LLColor3 llcolor3(r,g,b); LLColor4 llcolor4a,llcolor4b; llcolor4a = llcolor3; ensure("Operator=:Fail to initialize ", ((llcolor3.mV[0] == llcolor4a.mV[VX]) && (llcolor3.mV[1] == llcolor4a.mV[VY]) && (llcolor3.mV[2] == llcolor4a.mV[VZ]))); LLSD sd = llcolor4a.getValue(); llcolor4b = LLColor4(sd); ensure_equals("Operator= LLSD:Fail ", llcolor4a, llcolor4b); }
F32 lggBeamMaps::setUpAndGetDuration() { static LLCachedControl<std::string> ssettingName(gSavedSettings, "PhoenixBeamShape"); std::string settingName(ssettingName); if(settingName != lastFileName) { lastFileName = settingName; if(settingName != "===OFF===" && settingName != "") { std::string path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "beams", "")); std::string path_name2(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "beams", "")); std::string filename = path_name + settingName + ".xml"; if(gDirUtilp->fileExists(filename)) { } else { filename =path_name2 + settingName +".xml"; } LLSD mydata = getPic(filename); scale = (F32)mydata["scale"].asReal()/10.0f; LLSD myPicture = mydata["data"]; dots.clear(); for(int i = 0; i < myPicture.size(); i++) { LLSD beamData = myPicture[i]; lggBeamData dot; dot.p = LLVector3d(beamData["offset"]); dot.p *= (gSavedSettings.getF32("PhoenixBeamShapeScale")*2.0f); LLColor4 color = LLColor4(beamData["color"]); dot.c = LLColor4U(color); dots.push_back(dot); } F32 maxBPerQS = gSavedSettings.getF32("PhoenixMaxBeamsPerSecond") / 4.0f; duration = llceil((F32)(myPicture.size()) / maxBPerQS) * 0.25f; llinfos << "reading it all now size is " << myPicture.size() << " and duration is " << duration << llendl; } else { dots.clear(); scale = 0.0f;//used as a flag too duration = 0.25f; } } //llinfos << "sent final dur of " << duration << llendl; return duration; }
void LLDrawPoolGlow::render(S32 pass) { S32 mode = gViewerWindow->getMaskMode(); LLFastTimer t(FTM_RENDER_GLOW); LLGLEnable blend(GL_BLEND); LLGLDisable test(GL_ALPHA_TEST); gGL.flush(); /// Get rid of z-fighting with non-glow pass. LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL); glPolygonOffset(-1.0f, -1.0f); gGL.setSceneBlendType(LLRender::BT_ADD); U32 shader_level = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); if (shader_level > 0 && fullbright_shader) { fullbright_shader->bind(); } else { gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); } LLGLDepthTest depth(GL_TRUE, GL_FALSE); gGL.setColorMask(false, true); if (shader_level > 1) { pushBatches(LLRenderPass::PASS_GLOW, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE); } else { renderTexture(LLRenderPass::PASS_GLOW, getVertexDataMask()); } if(mode == MASK_MODE_RIGHT) { gGL.setColorMask(false,true,true,false); } if(mode == MASK_MODE_LEFT) { gGL.setColorMask(true,false,false,false); } if(mode == MASK_MODE_NONE) { gGL.setColorMask(true, false); } gGL.setSceneBlendType(LLRender::BT_ALPHA); if (shader_level > 0 && fullbright_shader) { fullbright_shader->unbind(); } }
bool LLControlVariable::llsd_compare(const LLSD& a, const LLSD & b) { bool result = false; switch (mType) { case TYPE_U32: case TYPE_S32: result = a.asInteger() == b.asInteger(); break; case TYPE_BOOLEAN: result = a.asBoolean() == b.asBoolean(); break; case TYPE_F32: result = a.asReal() == b.asReal(); break; case TYPE_VEC3: case TYPE_VEC3D: result = LLVector3d(a) == LLVector3d(b); break; case TYPE_RECT: result = LLRect(a) == LLRect(b); break; case TYPE_COL4: result = LLColor4(a) == LLColor4(b); break; case TYPE_COL3: result = LLColor3(a) == LLColor3(b); break; case TYPE_COL4U: result = LLColor4U(a) == LLColor4U(b); break; case TYPE_STRING: result = a.asString() == b.asString(); break; default: break; } return result; }
void LLFloaterPostcard::draw() { LLGLSUIDefault gls_ui; LLFloater::draw(); if(getVisible() && !mMinimized && mViewerImage.notNull() && mJPEGImage.notNull()) { LLRect rect(mRect); // first set the max extents of our preview rect.translate(-rect.mLeft, -rect.mBottom); rect.mLeft += 280; rect.mRight -= 10; rect.mTop -= 20; rect.mBottom = rect.mTop - 130; // then fix the aspect ratio F32 ratio = (F32)mJPEGImage->getWidth() / (F32)mJPEGImage->getHeight(); if ((F32)rect.getWidth() / (F32)rect.getHeight() >= ratio) { rect.mRight = (S32)((F32)rect.mLeft + ((F32)rect.getHeight() * ratio)); } else { rect.mBottom = (S32)((F32)rect.mTop - ((F32)rect.getWidth() / ratio)); } { LLGLSNoTexture gls_no_texture; gl_rect_2d(rect, LLColor4(0.f, 0.f, 0.f, 1.f)); rect.stretch(-1); } { glMatrixMode(GL_TEXTURE); glPushMatrix(); { glScalef(mImageScale.mV[VX], mImageScale.mV[VY], 1.f); glMatrixMode(GL_MODELVIEW); gl_draw_scaled_image(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), mViewerImage, LLColor4::white); } glMatrixMode(GL_TEXTURE); glPopMatrix(); glMatrixMode(GL_MODELVIEW); } } }
// This function stolen from LLFloaterPostcard void KVFloaterFlickrUpload::draw() { LLGLSUIDefault gls_ui; LLFloater::draw(); if(!isMinimized() && mViewerImage.notNull() && mCompressedImage.notNull()) { LLRect rect(getRect()); // first set the max extents of our preview rect.translate(-rect.mLeft, -rect.mBottom); rect.mLeft += 280; rect.mRight -= 10; rect.mTop -= 27; rect.mBottom = rect.mTop - 130; // then fix the aspect ratio F32 ratio = (F32)mCompressedImage->getWidth() / (F32)mCompressedImage->getHeight(); if ((F32)rect.getWidth() / (F32)rect.getHeight() >= ratio) { rect.mRight = LLRect::tCoordType((F32)rect.mLeft + ((F32)rect.getHeight() * ratio)); } else { rect.mBottom = LLRect::tCoordType((F32)rect.mTop - ((F32)rect.getWidth() / ratio)); } { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gl_rect_2d(rect, LLColor4(0.f, 0.f, 0.f, 1.f)); rect.stretch(-1); } { glMatrixMode(GL_TEXTURE); glPushMatrix(); { glScalef(mImageScale.mV[VX], mImageScale.mV[VY], 1.f); glMatrixMode(GL_MODELVIEW); gl_draw_scaled_image(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), mViewerImage.get(), LLColor4::white); } glMatrixMode(GL_TEXTURE); glPopMatrix(); glMatrixMode(GL_MODELVIEW); } } }
void LLFloaterPostcard::draw() { LLGLSUIDefault gls_ui; LLFloater::draw(); if(!isMinimized() && mViewerImage.notNull() && mJPEGImage.notNull()) { LLRect rect(getRect()); // first set the max extents of our preview rect.translate(-rect.mLeft, -rect.mBottom); rect.mLeft += 280; rect.mRight -= 10; rect.mTop -= 20; rect.mBottom = rect.mTop - 130; // then fix the aspect ratio F32 ratio = (F32)mJPEGImage->getWidth() / (F32)mJPEGImage->getHeight(); if ((F32)rect.getWidth() / (F32)rect.getHeight() >= ratio) { rect.mRight = (S32)((F32)rect.mLeft + ((F32)rect.getHeight() * ratio)); } else { rect.mBottom = (S32)((F32)rect.mTop - ((F32)rect.getWidth() / ratio)); } { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gl_rect_2d(rect, LLColor4(0.f, 0.f, 0.f, 1.f)); rect.stretch(-1); } { gGL.matrixMode(LLRender::MM_TEXTURE); gGL.pushMatrix(); { gGL.scalef(mImageScale.mV[VX], mImageScale.mV[VY], 1.f); gGL.matrixMode(LLRender::MM_MODELVIEW); gl_draw_scaled_image(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), mViewerImage, LLColor4::white); } gGL.matrixMode(LLRender::MM_TEXTURE); gGL.popMatrix(); gGL.matrixMode(LLRender::MM_MODELVIEW); } } }
F32 lggBeamMaps::setUpAndGetDuration() { static LLCachedControl<std::string> settingNameCached(gSavedSettings, "FSBeamShape"); std::string settingName(settingNameCached); if (settingName != mLastFileName) { mLastFileName = settingName; if (!settingName.empty()) { std::string path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "beams", "")); std::string path_name2(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS , "beams", "")); std::string filename = path_name + settingName + ".xml"; if (!gDirUtilp->fileExists(filename)) { filename = path_name2 + settingName + ".xml"; } LLSD mydata = getPic(filename); mScale = (F32)mydata["scale"].asReal() / 10.0f; LLSD myPicture = mydata["data"]; mDots.clear(); for (LLSD::array_iterator it = myPicture.beginArray(); it != myPicture.endArray(); ++it) { LLSD beamData = *it; lggBeamData dot; dot.p = LLVector3d(beamData["offset"]); static LLCachedControl<F32> FSBeamShapeScale(gSavedSettings, "FSBeamShapeScale"); dot.p *= (FSBeamShapeScale * 2.0f); LLColor4 color = LLColor4(beamData["color"]); dot.c = LLColor4U(color); mDots.push_back(dot); } static LLCachedControl<F32> FSMaxBeamsPerSecond(gSavedSettings, "FSMaxBeamsPerSecond"); F32 maxBPerQS = FSMaxBeamsPerSecond / 4.0f; mDuration = llceil((F32)(myPicture.size()) / maxBPerQS) * 0.25f; LL_INFOS("LGG_Beams") << "reading it all now size is " << myPicture.size() << " and duration is " << mDuration << LL_ENDL; } else { mDots.clear(); mScale = 0.0f; //used as a flag too mDuration = 0.25f; } } return mDuration; }
////////////////////////////////////////////////////////////////////////////// // draw color palette void LLFloaterColorPicker:: drawPalette () { S32 curEntry = 0; for ( S32 y = 0; y < numPaletteRows; ++y ) { for ( S32 x = 0; x < numPaletteColumns; ++x ) { // calculate position S32 x1 = mPaletteRegionLeft + ( mPaletteRegionWidth * x ) / numPaletteColumns; S32 y1 = mPaletteRegionTop - ( mPaletteRegionHeight * y ) / numPaletteRows; S32 x2 = ( mPaletteRegionLeft + ( mPaletteRegionWidth * ( x + 1 ) ) / numPaletteColumns ); S32 y2 = ( mPaletteRegionTop - ( mPaletteRegionHeight * ( y + 1 ) ) / numPaletteRows ); // draw palette entry color if ( mPalette [ curEntry ] ) { gl_rect_2d ( x1 + 2, y1 - 2, x2 - 2, y2 + 2, *mPalette [ curEntry++ ], TRUE ); gl_rect_2d ( x1 + 1, y1 - 1, x2 - 1, y2 + 1, LLColor4 ( 0.0f, 0.0f, 0.0f, 1.0f ), FALSE ); } } } // if there is something to highlight (mouse down in swatch & hovering over palette) if ( highlightEntry >= 0 ) { // extract row/column from palette index S32 entryColumn = highlightEntry % numPaletteColumns; S32 entryRow = highlightEntry / numPaletteColumns; // calculate position of this entry S32 x1 = mPaletteRegionLeft + ( mPaletteRegionWidth * entryColumn ) / numPaletteColumns; S32 y1 = mPaletteRegionTop - ( mPaletteRegionHeight * entryRow ) / numPaletteRows; S32 x2 = ( mPaletteRegionLeft + ( mPaletteRegionWidth * ( entryColumn + 1 ) ) / numPaletteColumns ); S32 y2 = ( mPaletteRegionTop - ( mPaletteRegionHeight * ( entryRow + 1 ) ) / numPaletteRows ); // center position of entry S32 xCenter = x1 + ( x2 - x1 ) / 2; S32 yCenter = y1 - ( y1 - y2 ) / 2; // find a color that works well as a highlight color LLColor4 hlColor ( getComplimentaryColor ( *mPalette [ highlightEntry ] ) ); // mark a cross for entry that is being hovered gl_line_2d ( xCenter - 4, yCenter - 4, xCenter + 4, yCenter + 4, hlColor ); gl_line_2d ( xCenter + 4, yCenter - 4, xCenter - 4, yCenter + 4, hlColor ); } }
void LLTextureEntry::init(const LLUUID& tex_id, F32 scale_s, F32 scale_t, F32 offset_s, F32 offset_t, F32 rotation, U8 bump) { setID(tex_id); mScaleS = scale_s; mScaleT = scale_t; mOffsetS = offset_s; mOffsetT = offset_t; mRotation = rotation; mBump = bump; mMediaFlags = 0x0; mGlow = 0; setColor(LLColor4(1.f, 1.f, 1.f, 1.f)); }
void LLContainerView::draw() { { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.f, 0.f, 0.f, mRectAlpha)); } // Draw the label if (mShowLabel) { LLResMgr::getInstance()->getRes( LLFONT_OCRA )->renderUTF8(mLabel, 0, 2, getRect().getHeight() - 2, LLColor4(1,1,1,1), LLFontGL::LEFT, LLFontGL::TOP); } LLView::draw(); }
LLComboBox::LLComboBox( const std::string& name, const LLRect &rect, const std::string& label, void (*commit_callback)(LLUICtrl*,void*), void *callback_userdata ) : LLUICtrl(name, rect, TRUE, commit_callback, callback_userdata, FOLLOWS_LEFT | FOLLOWS_TOP), mTextEntry(NULL), mArrowImage(NULL), mAllowTextEntry(FALSE), mMaxChars(20), mTextEntryTentative(TRUE), mListPosition(BELOW), mPrearrangeCallback( NULL ), mTextEntryCallback( NULL ) { // Always use text box // Text label button mButton = new LLButton(label, LLRect(), LLStringUtil::null, NULL, this); mButton->setImageUnselected(std::string("square_btn_32x128.tga")); mButton->setImageSelected(std::string("square_btn_selected_32x128.tga")); mButton->setImageDisabled(std::string("square_btn_32x128.tga")); mButton->setImageDisabledSelected(std::string("square_btn_selected_32x128.tga")); mButton->setScaleImage(TRUE); mButton->setMouseDownCallback(onButtonDown); mButton->setFont(LLFontGL::sSansSerifSmall); mButton->setFollows(FOLLOWS_LEFT | FOLLOWS_BOTTOM | FOLLOWS_RIGHT); mButton->setHAlign( LLFontGL::LEFT ); mButton->setRightHPad(2); addChild(mButton); // disallow multiple selection mList = new LLScrollListCtrl(std::string("ComboBox"), LLRect(), &LLComboBox::onItemSelected, this, FALSE); mList->setVisible(FALSE); mList->setBgWriteableColor( LLColor4(1,1,1,1) ); mList->setCommitOnKeyboardMovement(FALSE); addChild(mList); mArrowImage = LLUI::sImageProvider->getUIImage("combobox_arrow.tga"); mButton->setImageOverlay("combobox_arrow.tga", LLFontGL::RIGHT); updateLayout(); }
// virtual void LLPanelLogin::draw() { gGL.pushMatrix(); { F32 image_aspect = 1.333333f; F32 view_aspect = (F32)getRect().getWidth() / (F32)getRect().getHeight(); // stretch image to maintain aspect ratio if (image_aspect > view_aspect) { gGL.translatef(-0.5f * (image_aspect / view_aspect - 1.f) * getRect().getWidth(), 0.f, 0.f); gGL.scalef(image_aspect / view_aspect, 1.f, 1.f); } S32 width = getRect().getWidth(); S32 height = getRect().getHeight(); /*//------ added impru type news bar ---------- S32 news_bar_height = 8; LLMediaCtrl* news_bar = getChild<LLMediaCtrl>("news_bar"); if (news_bar) { news_bar_height = news_bar->getRect().getHeight(); } //---------------------------------------------*/ if ( mHtmlAvailable ) { #if !USE_VIEWER_AUTH // draw a background box in black gl_rect_2d( 0, height - 264, width, 264, LLColor4( 0.0f, 0.0f, 0.0f, 1.f ) ); // draw the bottom part of the background image - just the blue background to the native client UI mLogoImage->draw(0, -264, width + 8, mLogoImage->getHeight()); //gl_rect_2d( 0, height - 264 + news_bar_height, width, 264, LLColor4( 0.0f, 0.0f, 0.0f, 1.f ) ); // draw the bottom part of the background image - just the blue background to the native client UI //mLogoImage->draw(0, -264 + news_bar_height, width + 8, mLogoImage->getHeight()); #endif } else { // the HTML login page is not available so default to the original screen S32 offscreen_part = height / 3; mLogoImage->draw(0, -offscreen_part, width, height+offscreen_part); }; } gGL.popMatrix(); LLPanel::draw(); }
void LLDrawPoolAvatar::beginImpostor() { if (!LLPipeline::sReflectionRender) { LLVOAvatar::sRenderDistance = llclamp(LLVOAvatar::sRenderDistance, 16.f, 256.f); LLVOAvatar::sNumVisibleAvatars = 0; } if (LLGLSLShader::sNoFixedFunction) { gImpostorProgram.bind(); gImpostorProgram.setMinimumAlpha(0.01f); } gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); sDiffuseChannel = 0; }
void LLDrawPoolAlpha::renderAlphaHighlight(U32 mask) { for (LLCullResult::sg_list_t::iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i) { LLSpatialGroup* group = *i; if (group->mSpatialPartition->mRenderByGroup && !group->isDead()) { LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[LLRenderPass::PASS_ALPHA]; for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k) { LLDrawInfo& params = **k; if (params.mParticle) { continue; } LLRenderPass::applyModelMatrix(params); if (params.mGroup) { params.mGroup->rebuildMesh(); } // KL Batching Textures, taken from renderAlpha and fiddled to enable highlighting transparent to work if (params.mTextureList.size() > 1) { gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); // not sure on this glColor4f(1,0,0,1); // KL someone set us up the bomb... make your peace for (U32 i = 0; i < params.mTextureList.size(); ++i) { if (params.mTextureList[i].notNull()) { gGL.getTexUnit(i)->bind(LLViewerFetchedTexture::sSmokeImagep, TRUE); } } } params.mVertexBuffer->setBuffer(mask); params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); } } } }
void lggAutoCorrectFloater::updateEnabledStuff() { static BOOL *enabledd = rebind_llcontrol<BOOL>("EmeraldEnableAutoCorrect", &gSavedSettings, true); if(!(*enabledd)) { getChild<LLCheckBoxCtrl>("em_ac_enable")->setEnabledColor(LLColor4(1.0f,0.0f,0.0f,1.0f)); }else { getChild<LLCheckBoxCtrl>("em_ac_enable")->setEnabledColor(LLUI::sColorsGroup->getColor( "LabelTextColor" )); } childSetEnabled("em_ac_list_name",*enabledd); childSetEnabled("em_ac_list_entry",*enabledd); updateListControlsEnabled(*enabledd); updateNamesList(); LGGAutoCorrect::getInstance()->save(); }
void draw_shockwave(F32 center_z, F32 t, S32 steps, LLColor4 color) { if (!LLTracker::sCheesyBeacon) { return; } t *= 0.6284f/3.14159f; t -= (F32) (S32) t; t = llmax(t, 0.5f); t -= 0.5f; t *= 2.0f; F32 radius = t*16536.f; // Inexact, but reasonably fast. F32 delta = F_TWO_PI / steps; F32 sin_delta = sin( delta ); F32 cos_delta = cos( delta ); F32 x = radius; F32 y = 0.f; LLColor4 ccol = LLColor4(1,1,1,(1.f-t)*0.25f); gGL.begin(LLVertexBuffer::TRIANGLE_FAN); gGL.color4fv(ccol.mV); gGL.vertex3f(0.f, 0.f, center_z); // make sure circle is complete steps += 1; color.mV[3] = (1.f-t*t); gGL.color4fv(color.mV); while( steps-- ) { // Successive rotations gGL.vertex3f( x, y, center_z ); F32 x_new = x * cos_delta - y * sin_delta; y = x * sin_delta + y * cos_delta; x = x_new; } gGL.end(); }