本文整理汇总了C++中LLTextureEntry::setAlpha方法的典型用法代码示例。如果您正苦于以下问题:C++ LLTextureEntry::setAlpha方法的具体用法?C++ LLTextureEntry::setAlpha怎么用?C++ LLTextureEntry::setAlpha使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLTextureEntry
的用法示例。
在下文中一共展示了LLTextureEntry::setAlpha方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_update
void ImportTracker::get_update(S32 newid, BOOL justCreated, BOOL createSelected)
{
switch (state)
{
//lgg crap to change remaining prim parameters from the ascent system build preferences subtab
case WAND:
if(justCreated && createSelected)
{
numberExpected--;
if(numberExpected<=0)
state=IDLE;
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectImage);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, (U32)newid);
msg->addStringFast(_PREHASH_MediaURL, NULL);
//sets texture stuff
LLPrimitive obj;
obj.setNumTEs(U8(10));
S32 shinnyLevel = 0;
static LLCachedControl<std::string> sshinystr(gSavedSettings, "EmeraldBuildPrefs_Shiny");
std::string shinystr = sshinystr;
//if(shinystr == "None") shinnyLevel = 0; //We're already 0.
if(shinystr == "Low") shinnyLevel = 1;
else if(shinystr == "Medium") shinnyLevel = 2;
else if(shinystr == "High") shinnyLevel = 3;
for (int i = 0; i < 10; i++)
{
LLTextureEntry tex = LLTextureEntry(LLUUID(gSavedSettings.getString("EmeraldBuildPrefs_Texture")));
tex.setColor(gSavedSettings.getColor4("EmeraldBuildPrefs_Color"));
tex.setAlpha(1.0 - ((gSavedSettings.getF32("EmeraldBuildPrefs_Alpha")) / 100.0));
tex.setGlow(gSavedSettings.getF32("EmeraldBuildPrefs_Glow"));
if(gSavedSettings.getBOOL("EmeraldBuildPrefs_FullBright"))
{
tex.setFullbright(TEM_FULLBRIGHT_MASK);
}
tex.setShiny((U8) shinnyLevel & TEM_SHINY_MASK);
obj.setTE(U8(i), tex);
}
obj.packTEMessage(gMessageSystem);
msg->sendReliable(gAgent.getRegion()->getHost());
//sets some object parameters
msg->newMessage("ObjectFlagUpdate");
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addU32Fast(_PREHASH_ObjectLocalID, (U32)newid );
msg->addBOOLFast(_PREHASH_UsePhysics, gSavedSettings.getBOOL("EmeraldBuildPrefs_Physical"));
msg->addBOOLFast(_PREHASH_IsTemporary, gSavedSettings.getBOOL("EmeraldBuildPrefs_Temporary"));
msg->addBOOLFast(_PREHASH_IsPhantom, gSavedSettings.getBOOL("EmeraldBuildPrefs_Phantom") );
msg->addBOOL("CastsShadows", false );
msg->sendReliable(gAgent.getRegion()->getHost());
if(gSavedSettings.getBOOL("EmeraldBuildPrefs_EmbedItem"))
{
LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem((LLUUID)gSavedPerAccountSettings.getString("EmeraldBuildPrefs_Item"));
LLViewerObject* objectp = find((U32)newid);
if(objectp)
if(item)
{
if(item->getType()==LLAssetType::AT_LSL_TEXT)
{
LLToolDragAndDrop::dropScript(objectp,
item,
TRUE,
LLToolDragAndDrop::SOURCE_AGENT,
gAgent.getID());
}else
{
LLToolDragAndDrop::dropInventory(objectp,item,LLToolDragAndDrop::SOURCE_AGENT,gAgent.getID());
}
}
}
msg->newMessageFast(_PREHASH_ObjectPermissions);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_HeaderData);
msg->addBOOLFast(_PREHASH_Override, FALSE);
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, (U32)newid);
msg->addU8Fast(_PREHASH_Field, PERM_NEXT_OWNER);
msg->addU8Fast(_PREHASH_Set, PERM_SET_TRUE);
U32 flags = 0;
if ( gSavedSettings.getBOOL("NextOwnerCopy") )
{
flags |= PERM_COPY;
}
if ( gSavedSettings.getBOOL("NextOwnerModify") )
{
flags |= PERM_MODIFY;
//.........这里部分代码省略.........
示例2: get_update
void ImportTracker::get_update(S32 newid, BOOL justCreated, BOOL createSelected)
{
switch (state)
{
//lgg crap
case WAND:
if(justCreated && createSelected)
{
numberExpected--;
if(numberExpected<=0)
state=IDLE;
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectImage);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, (U32)newid);
msg->addStringFast(_PREHASH_MediaURL, NULL);
LLPrimitive obj;
obj.setNumTEs(U8(10));
S32 shinnyLevel = 0;
static std::string* shinystr = rebind_llcontrol<std::string>("EmeraldBuildPrefs_Shiny", &gSavedSettings, true);
if(*shinystr == "None") shinnyLevel = 0;
if(*shinystr == "Low") shinnyLevel = 1;
if(*shinystr == "Medium") shinnyLevel = 2;
if(*shinystr == "High") shinnyLevel = 3;
for (int i = 0; i < 10; i++)
{
static std::string* buildpreftex = rebind_llcontrol<std::string>("EmeraldBuildPrefs_Texture", &gSavedSettings, true);
LLTextureEntry tex = LLTextureEntry(LLUUID(*buildpreftex));
tex.setColor(gSavedSettings.getColor4("EmeraldBuildPrefs_Color"));
tex.setAlpha(1.0 - ((gSavedSettings.getF32("EmeraldBuildPrefs_Alpha")) / 100.0));
tex.setGlow(gSavedSettings.getF32("EmeraldBuildPrefs_Glow"));
if(gSavedSettings.getBOOL("EmeraldBuildPrefs_FullBright"))
{
tex.setFullbright(TEM_FULLBRIGHT_MASK);
}
tex.setShiny((U8) shinnyLevel & TEM_SHINY_MASK);
obj.setTE(U8(i), tex);
}
obj.packTEMessage(gMessageSystem);
msg->sendReliable(gAgent.getRegion()->getHost());
msg->newMessage("ObjectFlagUpdate");
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addU32Fast(_PREHASH_ObjectLocalID, (U32)newid );
msg->addBOOLFast(_PREHASH_UsePhysics, gSavedSettings.getBOOL("EmeraldBuildPrefs_Physical"));
msg->addBOOL("IsTemporary", gSavedSettings.getBOOL("EmeraldBuildPrefs_Temporary"));
msg->addBOOL("IsPhantom", gSavedSettings.getBOOL("EmeraldBuildPrefs_Phantom") );
msg->addBOOL("CastsShadows", true );
msg->sendReliable(gAgent.getRegion()->getHost());
if(gSavedSettings.getBOOL("EmeraldBuildPrefs_EmbedItem"))
{
LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem((LLUUID)gSavedSettings.getString("EmeraldBuildPrefs_Item"));
LLViewerObject* objectp = find((U32)newid);
if(objectp)
if(item)
{
if(item->getType()==LLAssetType::AT_LSL_TEXT)
{
LLToolDragAndDrop::dropScript(objectp,
item,
TRUE,
LLToolDragAndDrop::SOURCE_AGENT,
gAgent.getID());
}else
{
LLToolDragAndDrop::dropInventory(objectp,item,LLToolDragAndDrop::SOURCE_AGENT,gAgent.getID());
}
}
}
//llinfos << "LGG SENDING CUBE TEXTURE.." << llendl;
}
break;
case BUILDING:
if (justCreated && (int)localids.size() < linkset.size())
{
localids.push_back(newid);
localids.sort();
localids.unique();
linkset[localids.size() -1]["LocalID"] = newid;
LLSD prim = linkset[localids.size() -1];
//MAKERIGHT
if (!(prim).has("Updated"))
{
//.........这里部分代码省略.........