FIRE-16588: Replace llround with ll_round in Firestorm-specific code
parent
307bace175
commit
272bce84a6
|
|
@ -117,7 +117,7 @@ inline U32 F32_to_U32(F32 val, F32 lower, F32 upper)
|
|||
val -= lower;
|
||||
val /= (upper - lower);
|
||||
|
||||
return (U32)(llround(val*U24MAX));
|
||||
return (U32)(ll_round(val*U24MAX));
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
|
|
|
|||
|
|
@ -794,9 +794,9 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
|
|||
if (revised_text.length() > command.length() + 1) //Typing this command with no argument was causing a crash. -Madgeek
|
||||
{
|
||||
LLVector3d agentPos = gAgent.getPositionGlobal();
|
||||
S32 agent_x = llround( (F32)fmod( agentPos.mdV[VX], (F64)REGION_WIDTH_METERS ) );
|
||||
S32 agent_y = llround( (F32)fmod( agentPos.mdV[VY], (F64)REGION_WIDTH_METERS ) );
|
||||
S32 agent_z = llround( (F32)agentPos.mdV[VZ] );
|
||||
S32 agent_x = ll_round( (F32)fmod( agentPos.mdV[VX], (F64)REGION_WIDTH_METERS ) );
|
||||
S32 agent_y = ll_round( (F32)fmod( agentPos.mdV[VY], (F64)REGION_WIDTH_METERS ) );
|
||||
S32 agent_z = ll_round( (F32)agentPos.mdV[VZ] );
|
||||
std::string region_name = LLWeb::escapeURL(revised_text.substr(command.length() + 1));
|
||||
std::string url;
|
||||
|
||||
|
|
|
|||
|
|
@ -434,9 +434,9 @@ void FSFloaterSearch::displayParcelDetails(const LLParcelData& parcel_data)
|
|||
S32 region_x;
|
||||
S32 region_y;
|
||||
S32 region_z;
|
||||
region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS;
|
||||
region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS;
|
||||
region_z = llround(parcel_data.global_z);
|
||||
region_x = ll_round(parcel_data.global_x) % REGION_WIDTH_UNITS;
|
||||
region_y = ll_round(parcel_data.global_y) % REGION_WIDTH_UNITS;
|
||||
region_z = ll_round(parcel_data.global_z);
|
||||
// HACK: Flag 0x2 == adult region,
|
||||
// Flag 0x1 == mature region, otherwise assume PG
|
||||
if (parcel_data.flags & 0x2)
|
||||
|
|
@ -560,9 +560,9 @@ void FSFloaterSearch::displayEventDetails(U32 eventId, F64 eventEpoch, const std
|
|||
S32 region_x;
|
||||
S32 region_y;
|
||||
S32 region_z;
|
||||
region_x = llround(eventGlobalPos.mdV[VX]) % REGION_WIDTH_UNITS;
|
||||
region_y = llround(eventGlobalPos.mdV[VY]) % REGION_WIDTH_UNITS;
|
||||
region_z = llround(eventGlobalPos.mdV[VZ]);
|
||||
region_x = ll_round(eventGlobalPos.mdV[VX]) % REGION_WIDTH_UNITS;
|
||||
region_y = ll_round(eventGlobalPos.mdV[VY]) % REGION_WIDTH_UNITS;
|
||||
region_z = ll_round(eventGlobalPos.mdV[VZ]);
|
||||
LLStringUtil::format_map_t map;
|
||||
map["DURATION"] = llformat("%d:%.2d", eventDuration / 60, eventDuration % 60);
|
||||
map["LOCATION"] = llformat("%s (%d, %d, %d)", simName.c_str(), region_x, region_y, region_z);
|
||||
|
|
|
|||
|
|
@ -477,9 +477,9 @@ std::string FSPanelClassifiedInfo::createLocationText(
|
|||
|
||||
if (!pos_global.isNull())
|
||||
{
|
||||
S32 region_x = llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS;
|
||||
S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
|
||||
S32 region_z = llround((F32)pos_global.mdV[VZ]);
|
||||
S32 region_x = ll_round((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS;
|
||||
S32 region_y = ll_round((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
|
||||
S32 region_z = ll_round((F32)pos_global.mdV[VZ]);
|
||||
location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1582,9 +1582,9 @@ std::string FSPanelPick::createLocationText(const std::string& owner_name, const
|
|||
|
||||
if (!pos_global.isNull())
|
||||
{
|
||||
S32 region_x = llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS;
|
||||
S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
|
||||
S32 region_z = llround((F32)pos_global.mdV[VZ]);
|
||||
S32 region_x = ll_round((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS;
|
||||
S32 region_y = ll_round((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
|
||||
S32 region_z = ll_round((F32)pos_global.mdV[VZ]);
|
||||
location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z));
|
||||
}
|
||||
return location_text;
|
||||
|
|
|
|||
|
|
@ -425,9 +425,9 @@ LLSLURL::LLSLURL(const std::string& grid, const std::string& region, const LLVec
|
|||
mGrid = grid;
|
||||
mRegion = region;
|
||||
// <FS:CR> FIRE-8063 - Aurora sim var region teleports
|
||||
//S32 x = llround( (F32)fmod( position[VX], (F32)REGION_WIDTH_METERS ) );
|
||||
//S32 y = llround( (F32)fmod( position[VY], (F32)REGION_WIDTH_METERS ) );
|
||||
//S32 z = llround( (F32)position[VZ] );
|
||||
//S32 x = ll_round( (F32)fmod( position[VX], (F32)REGION_WIDTH_METERS ) );
|
||||
//S32 y = ll_round( (F32)fmod( position[VY], (F32)REGION_WIDTH_METERS ) );
|
||||
//S32 z = ll_round( (F32)position[VZ] );
|
||||
mPosition = position;
|
||||
// </FS:CR>
|
||||
mType = LOCATION;
|
||||
|
|
@ -436,9 +436,9 @@ LLSLURL::LLSLURL(const std::string& grid, const std::string& region, const LLVec
|
|||
|
||||
if(!LLGridManager::getInstance()->isInOpenSim())
|
||||
{
|
||||
S32 x = llround( (F32)fmod( position[VX], (F32)REGION_WIDTH_METERS ) );
|
||||
S32 y = llround( (F32)fmod( position[VY], (F32)REGION_WIDTH_METERS ) );
|
||||
S32 z = llround( (F32)position[VZ] );
|
||||
S32 x = ll_round( (F32)fmod( position[VX], (F32)REGION_WIDTH_METERS ) );
|
||||
S32 y = ll_round( (F32)fmod( position[VY], (F32)REGION_WIDTH_METERS ) );
|
||||
S32 z = ll_round( (F32)position[VZ] );
|
||||
mPosition = LLVector3(x, y, z);
|
||||
}
|
||||
// </FS:CR>
|
||||
|
|
@ -460,9 +460,9 @@ LLSLURL::LLSLURL(const std::string& grid, const std::string& region, const LLVec
|
|||
// region, LLVector3(global_position.mdV[VX],
|
||||
// global_position.mdV[VY],
|
||||
// global_position.mdV[VZ]));
|
||||
S32 x = llround( (F32)fmod( (F32)global_position.mdV[VX], (F32)REGION_WIDTH_METERS ) );
|
||||
S32 y = llround( (F32)fmod( (F32)global_position.mdV[VY], (F32)REGION_WIDTH_METERS ) );
|
||||
S32 z = llround( (F32)global_position.mdV[VZ] );
|
||||
S32 x = ll_round( (F32)fmod( (F32)global_position.mdV[VX], (F32)REGION_WIDTH_METERS ) );
|
||||
S32 y = ll_round( (F32)fmod( (F32)global_position.mdV[VY], (F32)REGION_WIDTH_METERS ) );
|
||||
S32 z = ll_round( (F32)global_position.mdV[VZ] );
|
||||
|
||||
*this = LLSLURL(grid, region, LLVector3(x, y, z));
|
||||
// </FS:CR>
|
||||
|
|
@ -525,9 +525,9 @@ std::string LLSLURL::getSLURLString() const
|
|||
case LOCATION:
|
||||
{
|
||||
// lookup the grid
|
||||
S32 x = llround( (F32)mPosition[VX] );
|
||||
S32 y = llround( (F32)mPosition[VY] );
|
||||
S32 z = llround( (F32)mPosition[VZ] );
|
||||
S32 x = ll_round( (F32)mPosition[VX] );
|
||||
S32 y = ll_round( (F32)mPosition[VY] );
|
||||
S32 z = ll_round( (F32)mPosition[VZ] );
|
||||
std::string ret = LLGridManager::getInstance()->getSLURLBase(mGrid);
|
||||
// ret.append(LLURI::escape(mRegion));
|
||||
// ret.append(llformat("/%d/%d/%d",x,y,z));
|
||||
|
|
@ -572,9 +572,9 @@ std::string LLSLURL::getLoginString() const
|
|||
case LOCATION:
|
||||
unescaped_start << "uri:"
|
||||
<< mRegion << "&"
|
||||
<< llround(mPosition[0]) << "&"
|
||||
<< llround(mPosition[1]) << "&"
|
||||
<< llround(mPosition[2]);
|
||||
<< ll_round(mPosition[0]) << "&"
|
||||
<< ll_round(mPosition[1]) << "&"
|
||||
<< ll_round(mPosition[2]);
|
||||
break;
|
||||
case HOME_LOCATION:
|
||||
unescaped_start << "home";
|
||||
|
|
@ -618,9 +618,9 @@ std::string LLSLURL::getLocationString() const
|
|||
{
|
||||
return llformat("%s/%d/%d/%d",
|
||||
mRegion.c_str(),
|
||||
(int)llround(mPosition[0]),
|
||||
(int)llround(mPosition[1]),
|
||||
(int)llround(mPosition[2]));
|
||||
(S32)ll_round(mPosition[0]),
|
||||
(S32)ll_round(mPosition[1]),
|
||||
(S32)ll_round(mPosition[2]));
|
||||
}
|
||||
std::string LLSLURL::asString() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ F32 convertXToHue(S32 place)
|
|||
|
||||
S32 convertHueToX(F32 place)
|
||||
{
|
||||
return llround((place / 720.0f) * 396.0f) + 6;
|
||||
return ll_round((place / 720.0f) * 396.0f) + 6;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ LLColor4U lggBeamMaps::beamColorFromData(const lggBeamsColors& data)
|
|||
LLColor4U toReturn;
|
||||
F32 timeinc = timer.getElapsedTimeF32() * 0.3f * ((data.mRotateSpeed + .01f)) * (360 / (data.mEndHue - data.mStartHue));
|
||||
|
||||
S32 diference = llround(data.mEndHue - data.mStartHue);
|
||||
S32 diference = ll_round(data.mEndHue - data.mStartHue);
|
||||
if (diference == 360 || diference == 720)
|
||||
{
|
||||
//full rainbow
|
||||
|
|
|
|||
|
|
@ -776,11 +776,11 @@ BOOL LLFacebookPhotoPanel::checkImageSize(LLSnapshotLivePreview* previewp, S32&
|
|||
//change another value proportionally
|
||||
if(isWidthChanged)
|
||||
{
|
||||
height = llround(width / aspect_ratio) ;
|
||||
height = ll_round(width / aspect_ratio) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
width = llround(height * aspect_ratio) ;
|
||||
width = ll_round(height * aspect_ratio) ;
|
||||
}
|
||||
|
||||
//bound w/h by the max_value
|
||||
|
|
|
|||
|
|
@ -685,11 +685,11 @@ BOOL LLFlickrPhotoPanel::checkImageSize(LLSnapshotLivePreview* previewp, S32& wi
|
|||
//change another value proportionally
|
||||
if(isWidthChanged)
|
||||
{
|
||||
height = llround(width / aspect_ratio) ;
|
||||
height = ll_round(width / aspect_ratio) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
width = llround(height * aspect_ratio) ;
|
||||
width = ll_round(height * aspect_ratio) ;
|
||||
}
|
||||
|
||||
//bound w/h by the max_value
|
||||
|
|
|
|||
|
|
@ -610,11 +610,11 @@ BOOL LLTwitterPhotoPanel::checkImageSize(LLSnapshotLivePreview* previewp, S32& w
|
|||
//change another value proportionally
|
||||
if(isWidthChanged)
|
||||
{
|
||||
height = llround(width / aspect_ratio) ;
|
||||
height = ll_round(width / aspect_ratio) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
width = llround(height * aspect_ratio) ;
|
||||
width = ll_round(height * aspect_ratio) ;
|
||||
}
|
||||
|
||||
//bound w/h by the max_value
|
||||
|
|
|
|||
|
|
@ -686,9 +686,9 @@ void LLFloaterWorldMap::processParcelInfo(const LLParcelData& parcel_data, const
|
|||
F32 region_y = pos_global.mdV[VY] - locY;
|
||||
std::string full_name = llformat("%s (%d, %d, %d)",
|
||||
sim_name.c_str(),
|
||||
llround(region_x),
|
||||
llround(region_y),
|
||||
llround((F32)pos_global.mdV[VZ]));
|
||||
ll_round(region_x),
|
||||
ll_round(region_y),
|
||||
ll_round((F32)pos_global.mdV[VZ]));
|
||||
|
||||
LLTracker::trackLocation(pos_global, parcel_data.name, full_name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1265,8 +1265,8 @@ void LLNetMap::renderPropertyLinesForRegion(const LLViewerRegion* pRegion, const
|
|||
const S32 imgHeight = (S32)mParcelImagep->getHeight();
|
||||
|
||||
const LLVector3 originLocal(pRegion->getOriginGlobal() - mParcelImageCenterGlobal);
|
||||
const S32 originX = llround(originLocal.mV[VX] * mObjectMapTPM + imgWidth / 2);
|
||||
const S32 originY = llround(originLocal.mV[VY] * mObjectMapTPM + imgHeight / 2);
|
||||
const S32 originX = ll_round(originLocal.mV[VX] * mObjectMapTPM + imgWidth / 2);
|
||||
const S32 originY = ll_round(originLocal.mV[VY] * mObjectMapTPM + imgHeight / 2);
|
||||
|
||||
U32* pTextureData = (U32*)mParcelRawImagep->getData();
|
||||
|
||||
|
|
@ -1274,14 +1274,14 @@ void LLNetMap::renderPropertyLinesForRegion(const LLViewerRegion* pRegion, const
|
|||
// Draw the north and east region borders
|
||||
//
|
||||
const F32 real_width(pRegion->getWidth());
|
||||
const S32 borderY = originY + llround(real_width * mObjectMapTPM);
|
||||
const S32 borderY = originY + ll_round(real_width * mObjectMapTPM);
|
||||
if ( (borderY >= 0) && (borderY < imgHeight) )
|
||||
{
|
||||
S32 curX = llclamp(originX, 0, imgWidth), endX = llclamp(originX + ll_round(real_width * mObjectMapTPM), 0, imgWidth - 1);
|
||||
for (; curX <= endX; curX++)
|
||||
pTextureData[borderY * imgWidth + curX] = clrOverlay.asRGBA();
|
||||
}
|
||||
const S32 borderX = originX + llround(real_width * mObjectMapTPM);
|
||||
const S32 borderX = originX + ll_round(real_width * mObjectMapTPM);
|
||||
if ( (borderX >= 0) && (borderX < imgWidth) )
|
||||
{
|
||||
S32 curY = llclamp(originY, 0, imgHeight), endY = llclamp(originY + ll_round(real_width * mObjectMapTPM), 0, imgHeight - 1);
|
||||
|
|
@ -1309,8 +1309,8 @@ void LLNetMap::renderPropertyLinesForRegion(const LLViewerRegion* pRegion, const
|
|||
if ( (!fForSale) && (!fCollision) && (!fAuction) && (0 == (overlay & (PARCEL_SOUTH_LINE | PARCEL_WEST_LINE))) )
|
||||
continue;
|
||||
|
||||
const S32 posX = originX + llround(idxCol * GRID_STEP * mObjectMapTPM);
|
||||
const S32 posY = originY + llround(idxRow * GRID_STEP * mObjectMapTPM);
|
||||
const S32 posX = originX + ll_round(idxCol * GRID_STEP * mObjectMapTPM);
|
||||
const S32 posY = originY + ll_round(idxRow * GRID_STEP * mObjectMapTPM);
|
||||
|
||||
static LLCachedControl<bool> s_fForSaleParcels(gSavedSettings, "MiniMapForSaleParcels");
|
||||
static LLCachedControl<bool> s_fShowCollisionParcels(gSavedSettings, "MiniMapCollisionParcels");
|
||||
|
|
|
|||
|
|
@ -6117,7 +6117,7 @@ void LLPickInfo::getSurfaceInfo()
|
|||
|
||||
if (objectp)
|
||||
{
|
||||
// if (gViewerWindow->cursorIntersect(llround((F32)mMousePt.mX), ll_round((F32)mMousePt.mY), 1024.f,
|
||||
// if (gViewerWindow->cursorIntersect(ll_round((F32)mMousePt.mX), ll_round((F32)mMousePt.mY), 1024.f,
|
||||
// objectp, -1, mPickTransparent,
|
||||
// &mObjectFace,
|
||||
// &mIntersection,
|
||||
|
|
|
|||
|
|
@ -463,13 +463,13 @@ void LLWorldMapView::draw()
|
|||
// Inform the fetch mechanism of the size we need
|
||||
// <FS:CR> Aurora Sim
|
||||
//S32 draw_size = ll_round(sMapScale);
|
||||
//overlayimage->setKnownDrawSize(llround(draw_size * LLUI::getScaleFactor().mV[VX]), llround(draw_size * LLUI::getScaleFactor().mV[VY]));
|
||||
//overlayimage->setKnownDrawSize(ll_round(draw_size * LLUI::getScaleFactor().mV[VX]), ll_round(draw_size * LLUI::getScaleFactor().mV[VY]));
|
||||
S32 x_draw_size = ll_round(sMapScale);
|
||||
S32 y_draw_size = ll_round(sMapScale);
|
||||
x_draw_size *= (info->mSizeX / REGION_WIDTH_METERS);
|
||||
y_draw_size *= (info->mSizeY / REGION_WIDTH_METERS);
|
||||
|
||||
overlayimage->setKnownDrawSize(llround(x_draw_size * LLUI::getScaleFactor().mV[VX]), llround(y_draw_size * LLUI::getScaleFactor().mV[VY]));
|
||||
overlayimage->setKnownDrawSize(ll_round(x_draw_size * LLUI::getScaleFactor().mV[VX]), ll_round(y_draw_size * LLUI::getScaleFactor().mV[VY]));
|
||||
// </FS:CR> Aurora Sim
|
||||
// Draw something whenever we have enough info
|
||||
if (overlayimage->hasGLTexture())
|
||||
|
|
|
|||
|
|
@ -1080,11 +1080,11 @@ void FloaterQuickPrefs::updateControl(const std::string& controlName, ControlEnt
|
|||
// if it's an integer entry, round the numbers
|
||||
if (entry.integer)
|
||||
{
|
||||
entry.min_value = llround(entry.min_value);
|
||||
entry.max_value = llround(entry.max_value);
|
||||
entry.min_value = ll_round(entry.min_value);
|
||||
entry.max_value = ll_round(entry.max_value);
|
||||
|
||||
// recalculate increment
|
||||
entry.increment = llround(entry.increment);
|
||||
entry.increment = ll_round(entry.increment);
|
||||
if (entry.increment == 0.f)
|
||||
{
|
||||
entry.increment = 1.f;
|
||||
|
|
|
|||
Loading…
Reference in New Issue