Commit f644f52d authored by Rye Mutt's avatar Rye Mutt 🍞
Browse files

Null checks, cleanup, alignment cleanup

parent 321de447
......@@ -4733,7 +4733,7 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src)
if (mNumIndices)
{
S32 idx_size = (mNumIndices*sizeof(U16)+0xF) & ~0xF;
size_t idx_size = (mNumIndices*sizeof(U16)+0xF) & ~0xF;
LLVector4a::memcpyNonAliased16((F32*) mIndices, (F32*) src.mIndices, idx_size);
}
......
......@@ -91,18 +91,19 @@ LLUUID find_ui_sound(const char * namep)
std::string name = ll_safe_string(namep);
LLUUID uuid = LLUUID(NULL);
LLUI *ui_inst = LLUI::getInstance();
if (!ui_inst->mSettingGroups["config"]->controlExists(name))
auto config_group = ui_inst->mSettingGroups["config"];
if (!config_group->controlExists(name))
{
LL_WARNS() << "tried to make UI sound for unknown sound name: " << name << LL_ENDL;
}
else
{
uuid = LLUUID(ui_inst->mSettingGroups["config"]->getString(name));
uuid = LLUUID(config_group->getString(name));
if (uuid.isNull())
{
if (ui_inst->mSettingGroups["config"]->getString(name) == LLUUID::null.asString())
if (config_group->getString(name) == LLUUID::null.asString())
{
if (ui_inst->mSettingGroups["config"]->getBOOL("UISndDebugSpamToggle"))
if (config_group->getBOOL("UISndDebugSpamToggle"))
{
LL_INFOS() << "UI sound name: " << name << " triggered but silent (null uuid)" << LL_ENDL;
}
......@@ -114,7 +115,7 @@ LLUUID find_ui_sound(const char * namep)
}
else if (ui_inst->mAudioCallback != NULL)
{
if (ui_inst->mSettingGroups["config"]->getBOOL("UISndDebugSpamToggle"))
if (config_group->getBOOL("UISndDebugSpamToggle"))
{
LL_INFOS() << "UI sound name: " << name << LL_ENDL;
}
......
......@@ -371,60 +371,63 @@ void LLControlAvatar::updateDebugText()
for (auto volp : volumes)
{
S32 verts = 0;
total_tris += volp->getTriangleCount(&verts);
total_verts += verts;
est_tris += volp->getEstTrianglesMax();
est_streaming_tris += volp->getEstTrianglesStreamingCost();
streaming_cost += volp->getStreamingCost();
lod_string += llformat("%d",volp->getLOD());
if (volp && volp->mDrawable)
if (volp)
{
bool is_animated_flag = volp->getExtendedMeshFlags() & LLExtendedMeshParams::ANIMATED_MESH_ENABLED_FLAG;
if (is_animated_flag)
S32 verts = 0;
total_tris += volp->getTriangleCount(&verts);
total_verts += verts;
est_tris += volp->getEstTrianglesMax();
est_streaming_tris += volp->getEstTrianglesStreamingCost();
streaming_cost += volp->getStreamingCost();
lod_string += llformat("%d", volp->getLOD());
if (volp->mDrawable)
{
animated_object_flag_string += "1";
}
else
{
animated_object_flag_string += "0";
}
if (volp->mDrawable->isActive())
{
active_string += "A";
}
else
{
active_string += "S";
}
if (volp->isRiggedMesh())
{
// Rigged/animatable mesh
type_string += "R";
lod_radius = volp->mLODRadius;
}
else if (volp->isMesh())
{
// Static mesh
type_string += "M";
bool is_animated_flag = volp->getExtendedMeshFlags() & LLExtendedMeshParams::ANIMATED_MESH_ENABLED_FLAG;
if (is_animated_flag)
{
animated_object_flag_string += "1";
}
else
{
animated_object_flag_string += "0";
}
if (volp->mDrawable->isActive())
{
active_string += "A";
}
else
{
active_string += "S";
}
if (volp->isRiggedMesh())
{
// Rigged/animatable mesh
type_string += "R";
lod_radius = volp->mLODRadius;
}
else if (volp->isMesh())
{
// Static mesh
type_string += "M";
}
else
{
// Any other prim
type_string += "P";
}
if (cam_dist_count < 4)
{
cam_dist_string += LLStringOps::getReadableNumber(volp->mLODDistance) + "/" +
LLStringOps::getReadableNumber(volp->mLODAdjustedDistance) + " ";
cam_dist_count++;
}
}
else
{
// Any other prim
type_string += "P";
}
if (cam_dist_count < 4)
{
cam_dist_string += LLStringOps::getReadableNumber(volp->mLODDistance) + "/" +
LLStringOps::getReadableNumber(volp->mLODAdjustedDistance) + " ";
cam_dist_count++;
active_string += "-";
type_string += "-";
}
}
else
{
active_string += "-";
type_string += "-";
}
}
addDebugText(llformat("CAV obj %d anim %d active %s impost %d upprd %d strcst %f",
total_linkset_count, animated_volume_count,
......@@ -504,7 +507,8 @@ void LLControlAvatar::updateAnimations()
{
LLVOVolume *volp = *vol_it;
//LL_INFOS("AnimatedObjects") << "updating anim for vol " << volp->getID() << " root " << mRootVolp->getID() << LL_ENDL;
signaled_animation_map_t& signaled_animations = LLObjectSignaledAnimationMap::instance().getMap()[volp->getID()];
auto& signaled_anim_map = LLObjectSignaledAnimationMap::instance().getMap();
signaled_animation_map_t& signaled_animations = signaled_anim_map[volp->getID()];
for (auto anim_it = signaled_animations.begin(), anim_it_end = signaled_animations.end();
anim_it != anim_it_end;
++anim_it)
......
......@@ -793,7 +793,7 @@ LLSD LLFastTimerView::analyzePerformanceLogDefault(std::istream& is)
stats_map_t time_stats;
stats_map_t sample_stats;
while (!is.eof() && LLSDParser::PARSE_FAILURE != LLSDSerialize::fromXML(cur, is))
while (!is.eof() && !is.fail() && LLSDParser::PARSE_FAILURE != LLSDSerialize::fromXML(cur, is))
{
for (LLSD::map_iterator iter = cur.beginMap(); iter != cur.endMap(); ++iter)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment