• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ LLColor4函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LLColor4函数的典型用法代码示例。如果您正苦于以下问题:C++ LLColor4函数的具体用法?C++ LLColor4怎么用?C++ LLColor4使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LLColor4函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: LLColor4

LLColor4 LLSky::getFogColor() const
{
	if (mVOSkyp)
	{
		return mVOSkyp->getFogColor();
	}

	return LLColor4(1.f, 1.f, 1.f, 1.f);
}
开发者ID:Xara,项目名称:Opensource-V2-SL-Viewer,代码行数:9,代码来源:llsky.cpp


示例2: LLAlphaObject

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);
}
开发者ID:Boy,项目名称:netbook,代码行数:9,代码来源:llvopartgroup.cpp


示例3: LLColor4

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);
	}
}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:56,代码来源:llmanip.cpp


示例4: LLView

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;
}
开发者ID:Barosonix,项目名称:AstraViewer,代码行数:19,代码来源:llstatgraph.cpp


示例5: LLView

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;
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:19,代码来源:llstatgraph.cpp


示例6: LLColor4

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;
}
开发者ID:OS-Development,项目名称:VW.Kirsten,代码行数:10,代码来源:lltexglobalcolor.cpp


示例7: LLColor4

// 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);
}
开发者ID:catface,项目名称:catfacebase,代码行数:55,代码来源:ascentprefsvan.cpp


示例8: llclamp

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;
}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:11,代码来源:lldrawpoolavatar.cpp


示例9: updateValue

	void ParamValue<LLUIColor>::updateValueFromBlock()
	{
		if (control.isProvided() && !control().empty())
		{
			updateValue(LLUIColorTable::instance().getColor(control));
		}
		else
		{
			updateValue(LLColor4(red, green, blue, alpha));
		}
	}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:11,代码来源:llui.cpp


示例10: updateValue

	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));
		}
	}
开发者ID:ArxNet,项目名称:SingularityViewer,代码行数:11,代码来源:llui.cpp


示例11: LLColor4

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);
	}
}
开发者ID:Boy,项目名称:netbook,代码行数:11,代码来源:llsky.cpp


示例12: llcolor3

	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);
	}
开发者ID:HizWylder,项目名称:GIS,代码行数:11,代码来源:v4color_test.cpp


示例13: ssettingName

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;

}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:53,代码来源:lggbeammaps.cpp


示例14: t

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();
	}
}
开发者ID:Xara,项目名称:kris-clone,代码行数:53,代码来源:lldrawpoolsimple.cpp


示例15: switch

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;
}
开发者ID:CharleyLevenque,项目名称:SingularityViewer,代码行数:40,代码来源:llcontrol.cpp


示例16: rect

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);
		}
	}
}
开发者ID:Boy,项目名称:netbook,代码行数:51,代码来源:llfloaterpostcard.cpp


示例17: rect

// 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);
		}
	}
}
开发者ID:Krazy-Bish-Margie,项目名称:Thunderstorm,代码行数:52,代码来源:kvfloaterflickrupload.cpp


示例18: rect

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);
		}
	}
}
开发者ID:IamusNavarathna,项目名称:SingularityViewer,代码行数:51,代码来源:llfloaterpostcard.cpp


示例19: settingNameCached

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;
}
开发者ID:gabeharms,项目名称:firestorm,代码行数:50,代码来源:lggbeammaps.cpp


示例20: drawPalette

//////////////////////////////////////////////////////////////////////////////
// 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 );
	}
}
开发者ID:9skunks,项目名称:imprudence,代码行数:52,代码来源:llfloatercolorpicker.cpp



注:本文中的LLColor4函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LLOG函数代码示例发布时间:2022-05-30
下一篇:
C++ LLColor3函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap