本文整理汇总了C++中LLSimInfo::setRegionFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ LLSimInfo::setRegionFlags方法的具体用法?C++ LLSimInfo::setRegionFlags怎么用?C++ LLSimInfo::setRegionFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLSimInfo
的用法示例。
在下文中一共展示了LLSimInfo::setRegionFlags方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertRegion
// static public
// Insert a region in the region map
// returns true if region inserted, false otherwise
// <FS:CR> Aurora Sim
//bool LLWorldMap::insertRegion(U32 x_world, U32 y_world, std::string& name, LLUUID& image_id, U32 accesscode, U64 region_flags)
bool LLWorldMap::insertRegion(U32 x_world, U32 y_world, U16 x_size, U16 y_size, std::string& name, LLUUID& image_id, U32 accesscode, U64 region_flags)
// </FS:CR> Aurora Sim
{
// This region doesn't exist
if (accesscode == 255)
{
// Checks if the track point is in it and invalidates it if it is
if (LLWorldMap::getInstance()->isTrackingInRectangle( x_world, y_world, x_world + REGION_WIDTH_UNITS, y_world + REGION_WIDTH_UNITS))
{
LLWorldMap::getInstance()->setTrackingInvalid();
}
// return failure to insert
return false;
}
else
{
U64 handle = to_region_handle(x_world, y_world);
//LL_INFOS("World Map") << "Map sim : " << name << ", ID : " << image_id.getString() << LL_ENDL;
// Insert the region in the region map of the world map
// Loading the LLSimInfo object with what we got and insert it in the map
LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromHandle(handle);
if (siminfo == NULL)
{
siminfo = LLWorldMap::getInstance()->createSimInfoFromHandle(handle);
}
siminfo->setName(name);
siminfo->setAccess(accesscode);
siminfo->setRegionFlags(region_flags);
// siminfo->setWaterHeight((F32) water_height);
siminfo->setLandForSaleImage(image_id);
// <FS:CR> Aurora Sim
siminfo->setSize(x_size, y_size);
// </FS:CR> Aurora Sim
// Handle the location tracking (for teleport, UI feedback and info display)
if (LLWorldMap::getInstance()->isTrackingInRectangle( x_world, y_world, x_world + REGION_WIDTH_UNITS, y_world + REGION_WIDTH_UNITS))
{
if (siminfo->isDown())
{
// We were tracking this location, but it's no available
LLWorldMap::getInstance()->setTrackingInvalid();
}
else
{
// We were tracking this location, and it does exist and is available
LLWorldMap::getInstance()->setTrackingValid();
}
}
// return insert region success
return true;
}
}
示例2: processMapBlockReply
// public static
void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**)
{
U32 agent_flags;
msg->getU32Fast(_PREHASH_AgentData, _PREHASH_Flags, agent_flags);
if ((S32)agent_flags < 0 || agent_flags >= MAP_SIM_IMAGE_TYPES)
{
llwarns << "Invalid map image type returned! " << agent_flags << llendl;
return;
}
S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_Data);
bool found_null_sim = false;
#ifdef IMMEDIATE_IMAGE_LOAD
bool use_web_map_tiles = useWebMapTiles();
#endif
BOOL adjust = FALSE;
for (S32 block=0; block<num_blocks; ++block)
{
U16 x_regions;
U16 y_regions;
U16 x_size = 256;
U16 y_size = 256;
std::string name;
U8 accesscode;
U32 region_flags;
U8 water_height;
U8 agents;
LLUUID image_id;
msg->getU16Fast(_PREHASH_Data, _PREHASH_X, x_regions, block);
msg->getU16Fast(_PREHASH_Data, _PREHASH_Y, y_regions, block);
msg->getStringFast(_PREHASH_Data, _PREHASH_Name, name, block);
msg->getU8Fast(_PREHASH_Data, _PREHASH_Access, accesscode, block);
msg->getU32Fast(_PREHASH_Data, _PREHASH_RegionFlags, region_flags, block);
msg->getU8Fast(_PREHASH_Data, _PREHASH_WaterHeight, water_height, block);
msg->getU8Fast(_PREHASH_Data, _PREHASH_Agents, agents, block);
msg->getUUIDFast(_PREHASH_Data, _PREHASH_MapImageID, image_id, block);
if(msg->getNumberOfBlocksFast(_PREHASH_Size) > 0)
{
msg->getU16Fast(_PREHASH_Size, _PREHASH_SizeX, x_size, block);
msg->getU16Fast(_PREHASH_Size, _PREHASH_SizeY, y_size, block);
}
if(x_size == 0 || (x_size % 16) != 0|| (y_size % 16) != 0)
{
x_size = 256;
y_size = 256;
}
U32 x_meters = x_regions * REGION_WIDTH_UNITS;
U32 y_meters = y_regions * REGION_WIDTH_UNITS;
U64 handle = to_region_handle(x_meters, y_meters);
if (accesscode == 255)
{
// This region doesn't exist
if (LLWorldMap::getInstance()->mIsTrackingUnknownLocation &&
LLWorldMap::getInstance()->mUnknownLocation.mdV[0] >= x_meters &&
LLWorldMap::getInstance()->mUnknownLocation.mdV[0] < x_meters + 256 &&
LLWorldMap::getInstance()->mUnknownLocation.mdV[1] >= y_meters &&
LLWorldMap::getInstance()->mUnknownLocation.mdV[1] < y_meters + 256)
{
// We were tracking this location, but it doesn't exist
LLWorldMap::getInstance()->mInvalidLocation = TRUE;
}
found_null_sim = true;
}
else
{
adjust = LLWorldMap::getInstance()->extendAABB(x_meters,
y_meters,
x_meters+REGION_WIDTH_UNITS,
y_meters+REGION_WIDTH_UNITS) || adjust;
//LL_INFOS("World Map") << "Map sim : " << name << ", ID : " << image_id.getString() << LL_ENDL;
// Insert the region in the region map of the world map
// Loading the LLSimInfo object with what we got and insert it in the map
LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromHandle(handle);
if (siminfo == NULL)
{
siminfo = LLWorldMap::getInstance()->createSimInfoFromHandle(handle);
}
siminfo->setName( name );
siminfo->setAccess( accesscode );
siminfo->setRegionFlags( region_flags );
siminfo->setWaterHeight((F32) water_height);
siminfo->setMapImageID( image_id, agent_flags );
siminfo->setSize( x_size, y_size );
#ifdef IMMEDIATE_IMAGE_LOAD
if (use_web_map_tiles)
{
siminfo->mCurrentImage = loadObjectsTile((U32)x_regions, (U32)y_regions);
}
else
{
//.........这里部分代码省略.........