summaryrefslogtreecommitdiff
path: root/indra/llprimitive
diff options
context:
space:
mode:
authorcallum_linden <none@none>2014-12-10 08:44:08 -0800
committercallum_linden <none@none>2014-12-10 08:44:08 -0800
commit23711c927561ee85b6d46e7e741cdc652649686e (patch)
tree4b8c89671594efb2241f894011f9548ae901df76 /indra/llprimitive
parent6ad2b5f8d3e4c240a48452578d5c3101a2811053 (diff)
Rename llround(..) to ll_round(..) because of a collision with MS llround (long long round) in VS2013
Diffstat (limited to 'indra/llprimitive')
-rw-r--r--indra/llprimitive/llmaterial.cpp20
-rwxr-xr-xindra/llprimitive/llprimitive.cpp16
-rwxr-xr-xindra/llprimitive/llvolumemessage.cpp64
3 files changed, 50 insertions, 50 deletions
diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp
index 7f3c8da434..57ceb3e11b 100644
--- a/indra/llprimitive/llmaterial.cpp
+++ b/indra/llprimitive/llmaterial.cpp
@@ -119,18 +119,18 @@ LLSD LLMaterial::asLLSD() const
LLSD material_data;
material_data[MATERIALS_CAP_NORMAL_MAP_FIELD] = mNormalID;
- material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD] = llround(mNormalOffsetX * MATERIALS_MULTIPLIER);
- material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD] = llround(mNormalOffsetY * MATERIALS_MULTIPLIER);
- material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD] = llround(mNormalRepeatX * MATERIALS_MULTIPLIER);
- material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD] = llround(mNormalRepeatY * MATERIALS_MULTIPLIER);
- material_data[MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD] = llround(mNormalRotation * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD] = ll_round(mNormalOffsetX * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD] = ll_round(mNormalOffsetY * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD] = ll_round(mNormalRepeatX * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD] = ll_round(mNormalRepeatY * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD] = ll_round(mNormalRotation * MATERIALS_MULTIPLIER);
material_data[MATERIALS_CAP_SPECULAR_MAP_FIELD] = mSpecularID;
- material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD] = llround(mSpecularOffsetX * MATERIALS_MULTIPLIER);
- material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD] = llround(mSpecularOffsetY * MATERIALS_MULTIPLIER);
- material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD] = llround(mSpecularRepeatX * MATERIALS_MULTIPLIER);
- material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD] = llround(mSpecularRepeatY * MATERIALS_MULTIPLIER);
- material_data[MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD] = llround(mSpecularRotation * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD] = ll_round(mSpecularOffsetX * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD] = ll_round(mSpecularOffsetY * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD] = ll_round(mSpecularRepeatX * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD] = ll_round(mSpecularRepeatY * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD] = ll_round(mSpecularRotation * MATERIALS_MULTIPLIER);
material_data[MATERIALS_CAP_SPECULAR_COLOR_FIELD] = mSpecularLightColor.getValue();
material_data[MATERIALS_CAP_SPECULAR_EXP_FIELD] = mSpecularLightExponent;
diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp
index 3bbc5d5571..6e4ccb9ea1 100755
--- a/indra/llprimitive/llprimitive.cpp
+++ b/indra/llprimitive/llprimitive.cpp
@@ -1144,12 +1144,12 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const
const LLTextureEntry* te = getTE(face_index);
scale_s[face_index] = (F32) te->mScaleS;
scale_t[face_index] = (F32) te->mScaleT;
- offset_s[face_index] = (S16) llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ;
- offset_t[face_index] = (S16) llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ;
- image_rot[face_index] = (S16) llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR));
+ offset_s[face_index] = (S16) ll_round((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ;
+ offset_t[face_index] = (S16) ll_round((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ;
+ image_rot[face_index] = (S16) ll_round(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR));
bump[face_index] = te->getBumpShinyFullbright();
media_flags[face_index] = te->getMediaTexGen();
- glow[face_index] = (U8) llround((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF));
+ glow[face_index] = (U8) ll_round((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF));
// Directly sending material_ids is not safe!
memcpy(&material_data[face_index*16],getTE(face_index)->getMaterialID().get(),16); /* Flawfinder: ignore */
@@ -1229,12 +1229,12 @@ BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const
const LLTextureEntry* te = getTE(face_index);
scale_s[face_index] = (F32) te->mScaleS;
scale_t[face_index] = (F32) te->mScaleT;
- offset_s[face_index] = (S16) llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ;
- offset_t[face_index] = (S16) llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ;
- image_rot[face_index] = (S16) llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR));
+ offset_s[face_index] = (S16) ll_round((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ;
+ offset_t[face_index] = (S16) ll_round((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ;
+ image_rot[face_index] = (S16) ll_round(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR));
bump[face_index] = te->getBumpShinyFullbright();
media_flags[face_index] = te->getMediaTexGen();
- glow[face_index] = (U8) llround((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF));
+ glow[face_index] = (U8) ll_round((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF));
// Directly sending material_ids is not safe!
memcpy(&material_data[face_index*16],getTE(face_index)->getMaterialID().get(),16); /* Flawfinder: ignore */
diff --git a/indra/llprimitive/llvolumemessage.cpp b/indra/llprimitive/llvolumemessage.cpp
index a2c2666146..8d47a7147f 100755
--- a/indra/llprimitive/llvolumemessage.cpp
+++ b/indra/llprimitive/llvolumemessage.cpp
@@ -52,13 +52,13 @@ bool LLVolumeMessage::packProfileParams(
tempU8 = params->getCurveType();
mesgsys->addU8Fast(_PREHASH_ProfileCurve, tempU8);
- tempU16 = (U16) llround( params->getBegin() / CUT_QUANTA);
+ tempU16 = (U16) ll_round( params->getBegin() / CUT_QUANTA);
mesgsys->addU16Fast(_PREHASH_ProfileBegin, tempU16);
- tempU16 = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA);
+ tempU16 = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA);
mesgsys->addU16Fast(_PREHASH_ProfileEnd, tempU16);
- tempU16 = (U16) llround(params->getHollow() / HOLLOW_QUANTA);
+ tempU16 = (U16) ll_round(params->getHollow() / HOLLOW_QUANTA);
mesgsys->addU16Fast(_PREHASH_ProfileHollow, tempU16);
return true;
@@ -80,13 +80,13 @@ bool LLVolumeMessage::packProfileParams(
tempU8 = params->getCurveType();
dp.packU8(tempU8, "Curve");
- tempU16 = (U16) llround( params->getBegin() / CUT_QUANTA);
+ tempU16 = (U16) ll_round( params->getBegin() / CUT_QUANTA);
dp.packU16(tempU16, "Begin");
- tempU16 = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA);
+ tempU16 = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA);
dp.packU16(tempU16, "End");
- tempU16 = (U16) llround(params->getHollow() / HOLLOW_QUANTA);
+ tempU16 = (U16) ll_round(params->getHollow() / HOLLOW_QUANTA);
dp.packU16(tempU16, "Hollow");
return true;
}
@@ -217,46 +217,46 @@ bool LLVolumeMessage::packPathParams(
U8 curve = params->getCurveType();
mesgsys->addU8Fast(_PREHASH_PathCurve, curve);
- U16 begin = (U16) llround(params->getBegin() / CUT_QUANTA);
+ U16 begin = (U16) ll_round(params->getBegin() / CUT_QUANTA);
mesgsys->addU16Fast(_PREHASH_PathBegin, begin);
- U16 end = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA);
+ U16 end = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA);
mesgsys->addU16Fast(_PREHASH_PathEnd, end);
// Avoid truncation problem with direct F32->U8 cast.
// (e.g., (U8) (0.50 / 0.01) = (U8) 49.9999999 = 49 not 50.
- U8 pack_scale_x = 200 - (U8) llround(params->getScaleX() / SCALE_QUANTA);
+ U8 pack_scale_x = 200 - (U8) ll_round(params->getScaleX() / SCALE_QUANTA);
mesgsys->addU8Fast(_PREHASH_PathScaleX, pack_scale_x );
- U8 pack_scale_y = 200 - (U8) llround(params->getScaleY() / SCALE_QUANTA);
+ U8 pack_scale_y = 200 - (U8) ll_round(params->getScaleY() / SCALE_QUANTA);
mesgsys->addU8Fast(_PREHASH_PathScaleY, pack_scale_y );
- U8 pack_shear_x = (U8) llround(params->getShearX() / SHEAR_QUANTA);
+ U8 pack_shear_x = (U8) ll_round(params->getShearX() / SHEAR_QUANTA);
mesgsys->addU8Fast(_PREHASH_PathShearX, pack_shear_x );
- U8 pack_shear_y = (U8) llround(params->getShearY() / SHEAR_QUANTA);
+ U8 pack_shear_y = (U8) ll_round(params->getShearY() / SHEAR_QUANTA);
mesgsys->addU8Fast(_PREHASH_PathShearY, pack_shear_y );
- S8 twist = (S8) llround(params->getTwist() / SCALE_QUANTA);
+ S8 twist = (S8) ll_round(params->getTwist() / SCALE_QUANTA);
mesgsys->addS8Fast(_PREHASH_PathTwist, twist);
- S8 twist_begin = (S8) llround(params->getTwistBegin() / SCALE_QUANTA);
+ S8 twist_begin = (S8) ll_round(params->getTwistBegin() / SCALE_QUANTA);
mesgsys->addS8Fast(_PREHASH_PathTwistBegin, twist_begin);
- S8 radius_offset = (S8) llround(params->getRadiusOffset() / SCALE_QUANTA);
+ S8 radius_offset = (S8) ll_round(params->getRadiusOffset() / SCALE_QUANTA);
mesgsys->addS8Fast(_PREHASH_PathRadiusOffset, radius_offset);
- S8 taper_x = (S8) llround(params->getTaperX() / TAPER_QUANTA);
+ S8 taper_x = (S8) ll_round(params->getTaperX() / TAPER_QUANTA);
mesgsys->addS8Fast(_PREHASH_PathTaperX, taper_x);
- S8 taper_y = (S8) llround(params->getTaperY() / TAPER_QUANTA);
+ S8 taper_y = (S8) ll_round(params->getTaperY() / TAPER_QUANTA);
mesgsys->addS8Fast(_PREHASH_PathTaperY, taper_y);
- U8 revolutions = (U8) llround( (params->getRevolutions() - 1.0f) / REV_QUANTA);
+ U8 revolutions = (U8) ll_round( (params->getRevolutions() - 1.0f) / REV_QUANTA);
mesgsys->addU8Fast(_PREHASH_PathRevolutions, revolutions);
- S8 skew = (S8) llround(params->getSkew() / SCALE_QUANTA);
+ S8 skew = (S8) ll_round(params->getSkew() / SCALE_QUANTA);
mesgsys->addS8Fast(_PREHASH_PathSkew, skew);
return true;
@@ -274,46 +274,46 @@ bool LLVolumeMessage::packPathParams(
U8 curve = params->getCurveType();
dp.packU8(curve, "Curve");
- U16 begin = (U16) llround(params->getBegin() / CUT_QUANTA);
+ U16 begin = (U16) ll_round(params->getBegin() / CUT_QUANTA);
dp.packU16(begin, "Begin");
- U16 end = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA);
+ U16 end = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA);
dp.packU16(end, "End");
// Avoid truncation problem with direct F32->U8 cast.
// (e.g., (U8) (0.50 / 0.01) = (U8) 49.9999999 = 49 not 50.
- U8 pack_scale_x = 200 - (U8) llround(params->getScaleX() / SCALE_QUANTA);
+ U8 pack_scale_x = 200 - (U8) ll_round(params->getScaleX() / SCALE_QUANTA);
dp.packU8(pack_scale_x, "ScaleX");
- U8 pack_scale_y = 200 - (U8) llround(params->getScaleY() / SCALE_QUANTA);
+ U8 pack_scale_y = 200 - (U8) ll_round(params->getScaleY() / SCALE_QUANTA);
dp.packU8(pack_scale_y, "ScaleY");
- S8 pack_shear_x = (S8) llround(params->getShearX() / SHEAR_QUANTA);
+ S8 pack_shear_x = (S8) ll_round(params->getShearX() / SHEAR_QUANTA);
dp.packU8(*(U8 *)&pack_shear_x, "ShearX");
- S8 pack_shear_y = (S8) llround(params->getShearY() / SHEAR_QUANTA);
+ S8 pack_shear_y = (S8) ll_round(params->getShearY() / SHEAR_QUANTA);
dp.packU8(*(U8 *)&pack_shear_y, "ShearY");
- S8 twist = (S8) llround(params->getTwist() / SCALE_QUANTA);
+ S8 twist = (S8) ll_round(params->getTwist() / SCALE_QUANTA);
dp.packU8(*(U8 *)&twist, "Twist");
- S8 twist_begin = (S8) llround(params->getTwistBegin() / SCALE_QUANTA);
+ S8 twist_begin = (S8) ll_round(params->getTwistBegin() / SCALE_QUANTA);
dp.packU8(*(U8 *)&twist_begin, "TwistBegin");
- S8 radius_offset = (S8) llround(params->getRadiusOffset() / SCALE_QUANTA);
+ S8 radius_offset = (S8) ll_round(params->getRadiusOffset() / SCALE_QUANTA);
dp.packU8(*(U8 *)&radius_offset, "RadiusOffset");
- S8 taper_x = (S8) llround(params->getTaperX() / TAPER_QUANTA);
+ S8 taper_x = (S8) ll_round(params->getTaperX() / TAPER_QUANTA);
dp.packU8(*(U8 *)&taper_x, "TaperX");
- S8 taper_y = (S8) llround(params->getTaperY() / TAPER_QUANTA);
+ S8 taper_y = (S8) ll_round(params->getTaperY() / TAPER_QUANTA);
dp.packU8(*(U8 *)&taper_y, "TaperY");
- U8 revolutions = (U8) llround( (params->getRevolutions() - 1.0f) / REV_QUANTA);
+ U8 revolutions = (U8) ll_round( (params->getRevolutions() - 1.0f) / REV_QUANTA);
dp.packU8(*(U8 *)&revolutions, "Revolutions");
- S8 skew = (S8) llround(params->getSkew() / SCALE_QUANTA);
+ S8 skew = (S8) ll_round(params->getSkew() / SCALE_QUANTA);
dp.packU8(*(U8 *)&skew, "Skew");
return true;