Prep for animesh.

This commit is contained in:
Shyotl
2019-03-09 01:51:50 -06:00
parent cd340f0fb6
commit 5d75b3b223
28 changed files with 700 additions and 333 deletions

View File

@@ -175,7 +175,7 @@ LLPrimitive::~LLPrimitive()
{
clearTextureList();
// Cleanup handled by volume manager
if (mVolumep)
if (mVolumep && sVolumeManager)
{
sVolumeManager->unrefVolume(mVolumep);
}
@@ -586,7 +586,7 @@ U8 LLPrimitive::pCodeToLegacy(const LLPCode pcode)
// static
// Don't crash or llerrs here! This function is used for debug strings.
// Don't crash or LL_ERRS() here! This function is used for debug strings.
std::string LLPrimitive::pCodeToString(const LLPCode pcode)
{
std::string pcode_string;
@@ -729,6 +729,16 @@ S32 face_index_from_id(LLFaceID face_ID, const std::vector<LLProfile::Face>& fac
BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume)
{
if (NO_LOD == detail)
{
// build the new object
setChanged(GEOMETRY);
sVolumeManager->unrefVolume(mVolumep);
mVolumep = new LLVolume(volume_params, 1, TRUE, TRUE);
setNumTEs(mVolumep->getNumFaces());
return FALSE;
}
LLVolume *volumep;
if (unique_volume)
{
@@ -1577,6 +1587,8 @@ BOOL LLNetworkData::isValid(U16 param_type, U32 size)
return (size == 17);
case PARAMS_LIGHT_IMAGE:
return (size == 28);
case PARAMS_EXTENDED_MESH:
return (size == 4);
}
return FALSE;
@@ -2004,3 +2016,67 @@ bool LLLightImageParams::fromLLSD(LLSD& sd)
return false;
}
//============================================================================
LLExtendedMeshParams::LLExtendedMeshParams()
{
mType = PARAMS_EXTENDED_MESH;
mFlags = 0;
}
BOOL LLExtendedMeshParams::pack(LLDataPacker &dp) const
{
dp.packU32(mFlags, "flags");
return TRUE;
}
BOOL LLExtendedMeshParams::unpack(LLDataPacker &dp)
{
dp.unpackU32(mFlags, "flags");
return TRUE;
}
bool LLExtendedMeshParams::operator==(const LLNetworkData& data) const
{
if (data.mType != PARAMS_EXTENDED_MESH)
{
return false;
}
const LLExtendedMeshParams *param = (const LLExtendedMeshParams*)&data;
if ( (param->mFlags != mFlags) )
{
return false;
}
return true;
}
void LLExtendedMeshParams::copy(const LLNetworkData& data)
{
const LLExtendedMeshParams *param = (LLExtendedMeshParams*)&data;
mFlags = param->mFlags;
}
LLSD LLExtendedMeshParams::asLLSD() const
{
LLSD sd;
sd["flags"] = LLSD::Integer(mFlags);
return sd;
}
bool LLExtendedMeshParams::fromLLSD(LLSD& sd)
{
if (sd.has("flags"))
{
setFlags( sd["flags"].asInteger());
return true;
}
return false;
}