Merge branch 'master' of git://github.com/Shyotl/SingularityViewer

Conflicts:
	indra/newview/lldrawpoolwlsky.cpp
This commit is contained in:
Inusaito Sayori
2015-06-19 05:42:49 -04:00
634 changed files with 8198 additions and 12212 deletions

View File

@@ -320,7 +320,7 @@ void print_statemachine_diagnostics(U64 total_clocks, AIStateMachine::StateTimer
AIStateMachine::StateTimerBase::DumpTimers(msg);
llwarns << msg.str() << llendl;
LL_WARNS() << msg.str() << LL_ENDL;
}
#endif
@@ -1264,7 +1264,7 @@ void AIStateMachine::abort(void)
// Block until the current run finished.
if (!mRunMutex.try_lock())
{
llwarns << "AIStateMachine::abort() blocks because the statemachine is still executing code in another thread." << llendl;
LL_WARNS() << "AIStateMachine::abort() blocks because the statemachine is still executing code in another thread." << LL_ENDL;
mRunMutex.lock();
}
mRunMutex.unlock();
@@ -1463,6 +1463,6 @@ void stopEngineThread(void)
{
ms_sleep(10);
}
llinfos << "State machine thread" << (!AIEngineThread::sInstance->isStopped() ? " not" : "") << " stopped after " << ((400 - count) * 10) << "ms." << llendl;
LL_INFOS() << "State machine thread" << (!AIEngineThread::sInstance->isStopped() ? " not" : "") << " stopped after " << ((400 - count) * 10) << "ms." << LL_ENDL;
}

View File

@@ -149,7 +149,7 @@ void AIStateMachineThreadBase::abort_impl(void)
{
// The thread is still happily running (and will clean up itself).
// Lets make sure we're not flooded with this situation.
llwarns << "Thread state machine aborted while the thread is still running. That is a waste of CPU and should be avoided." << llendl;
LL_WARNS() << "Thread state machine aborted while the thread is still running. That is a waste of CPU and should be avoided." << LL_ENDL;
}
}
}

View File

@@ -35,9 +35,9 @@
#include "llavatarappearance.h"
#include "llavatarappearancedefines.h"
#include "llavatarjointmesh.h"
#include "llstl.h"
#include "imageids.h"
#include "lldir.h"
#include "lldeleteutils.h"
#include "llpolymorph.h"
#include "llpolymesh.h"
#include "llpolyskeletaldistortion.h"
@@ -134,9 +134,9 @@ LLAvatarAppearance::LLAvatarXmlInfo::~LLAvatarXmlInfo()
std::for_each(mMeshInfoList.begin(), mMeshInfoList.end(), DeletePointer());
std::for_each(mSkeletalDistortionInfoList.begin(), mSkeletalDistortionInfoList.end(), DeletePointer());
std::for_each(mAttachmentInfoList.begin(), mAttachmentInfoList.end(), DeletePointer());
deleteAndClear(mTexSkinColorInfo);
deleteAndClear(mTexHairColorInfo);
deleteAndClear(mTexEyeColorInfo);
delete_and_clear(mTexSkinColorInfo);
delete_and_clear(mTexHairColorInfo);
delete_and_clear(mTexEyeColorInfo);
std::for_each(mLayerInfoList.begin(), mLayerInfoList.end(), DeletePointer());
std::for_each(mDriverInfoList.begin(), mDriverInfoList.end(), DeletePointer());
std::for_each(mMorphMaskInfoList.begin(), mMorphMaskInfoList.end(), DeletePointer());
@@ -218,7 +218,7 @@ void LLAvatarAppearance::initInstance()
mesh->setMeshID(mesh_index);
mesh->setPickName(mesh_dict->mPickName);
mesh->setIsTransparent(FALSE);
switch((int)mesh_index)
switch((S32)mesh_index)
{
case MESH_ID_HAIR:
mesh->setIsTransparent(TRUE);
@@ -254,7 +254,7 @@ void LLAvatarAppearance::initInstance()
++iter)
{
LLAvatarJointMesh* mesh = (*iter);
mBakedTextureDatas[(int)baked_texture_index].mJointMeshes.push_back(mesh);
mBakedTextureDatas[(S32)baked_texture_index].mJointMeshes.push_back(mesh);
}
}
@@ -269,13 +269,13 @@ void LLAvatarAppearance::initInstance()
// virtual
LLAvatarAppearance::~LLAvatarAppearance()
{
deleteAndClear(mTexSkinColor);
deleteAndClear(mTexHairColor);
deleteAndClear(mTexEyeColor);
delete_and_clear(mTexSkinColor);
delete_and_clear(mTexHairColor);
delete_and_clear(mTexEyeColor);
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
{
deleteAndClear(mBakedTextureDatas[i].mTexLayerSet);
delete_and_clear(mBakedTextureDatas[i].mTexLayerSet);
mBakedTextureDatas[i].mJointMeshes.clear();
for (morph_list_t::iterator iter2 = mBakedTextureDatas[i].mMaskedMorphs.begin();
@@ -286,12 +286,15 @@ LLAvatarAppearance::~LLAvatarAppearance()
}
}
if (mRoot) mRoot->removeAllChildren();
deleteAndClear(mRoot);
if (mRoot)
{
mRoot->removeAllChildren();
delete_and_clear(mRoot);
}
mJointMap.clear();
clearSkeleton();
clearCollisionVolumes();
delete_and_clear(mCollisionVolumes);
std::for_each(mPolyMeshes.begin(), mPolyMeshes.end(), DeletePairedPointer());
mPolyMeshes.clear();
@@ -317,14 +320,14 @@ void LLAvatarAppearance::initClass()
BOOL success = sXMLTree.parseFile( xmlFile, FALSE );
if (!success)
{
llerrs << "Problem reading avatar configuration file:" << xmlFile << llendl;
LL_ERRS() << "Problem reading avatar configuration file:" << xmlFile << LL_ENDL;
}
// now sanity check xml file
LLXmlTreeNode* root = sXMLTree.getRoot();
if (!root)
{
llerrs << "No root node found in avatar configuration file: " << xmlFile << llendl;
LL_ERRS() << "No root node found in avatar configuration file: " << xmlFile << LL_ENDL;
return;
}
@@ -333,14 +336,14 @@ void LLAvatarAppearance::initClass()
//-------------------------------------------------------------------------
if( !root->hasName( "linden_avatar" ) )
{
llerrs << "Invalid avatar file header: " << xmlFile << llendl;
LL_ERRS() << "Invalid avatar file header: " << xmlFile << LL_ENDL;
}
std::string version;
static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version");
if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") )
{
llerrs << "Invalid avatar file version: " << version << " in file: " << xmlFile << llendl;
LL_ERRS() << "Invalid avatar file version: " << version << " in file: " << xmlFile << LL_ENDL;
}
S32 wearable_def_version = 1;
@@ -353,7 +356,7 @@ void LLAvatarAppearance::initClass()
LLXmlTreeNode* skeleton_node = root->getChildByName( "skeleton" );
if (!skeleton_node)
{
llerrs << "No skeleton in avatar configuration file: " << xmlFile << llendl;
LL_ERRS() << "No skeleton in avatar configuration file: " << xmlFile << LL_ENDL;
return;
}
@@ -361,14 +364,14 @@ void LLAvatarAppearance::initClass()
static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name");
if (!skeleton_node->getFastAttributeString(file_name_string, skeleton_file_name))
{
llerrs << "No file name in skeleton node in avatar config file: " << xmlFile << llendl;
LL_ERRS() << "No file name in skeleton node in avatar config file: " << xmlFile << LL_ENDL;
}
std::string skeleton_path;
skeleton_path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,skeleton_file_name);
if (!parseSkeletonFile(skeleton_path))
{
llerrs << "Error parsing skeleton file: " << skeleton_path << llendl;
LL_ERRS() << "Error parsing skeleton file: " << skeleton_path << LL_ENDL;
}
// Process XML data
@@ -381,44 +384,44 @@ void LLAvatarAppearance::initClass()
sAvatarSkeletonInfo = new LLAvatarSkeletonInfo;
if (!sAvatarSkeletonInfo->parseXml(sSkeletonXMLTree.getRoot()))
{
llerrs << "Error parsing skeleton XML file: " << skeleton_path << llendl;
LL_ERRS() << "Error parsing skeleton XML file: " << skeleton_path << LL_ENDL;
}
// parse avatar_lad.xml
if (sAvatarXmlInfo)
{ //this can happen if a login attempt failed
deleteAndClear(sAvatarXmlInfo);
delete_and_clear(sAvatarXmlInfo);
}
sAvatarXmlInfo = new LLAvatarXmlInfo;
if (!sAvatarXmlInfo->parseXmlSkeletonNode(root))
{
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
}
if (!sAvatarXmlInfo->parseXmlMeshNodes(root))
{
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
}
if (!sAvatarXmlInfo->parseXmlColorNodes(root))
{
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
}
if (!sAvatarXmlInfo->parseXmlLayerNodes(root))
{
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
}
if (!sAvatarXmlInfo->parseXmlDriverNodes(root))
{
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
}
if (!sAvatarXmlInfo->parseXmlMorphNodes(root))
{
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
}
}
void LLAvatarAppearance::cleanupClass()
{
deleteAndClear(sAvatarXmlInfo);
deleteAndClear(sAvatarSkeletonInfo);
delete_and_clear(sAvatarXmlInfo);
delete_and_clear(sAvatarSkeletonInfo);
sSkeletonXMLTree.cleanup();
sXMLTree.cleanup();
}
@@ -524,7 +527,7 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
if (!parsesuccess)
{
llerrs << "Can't parse skeleton file: " << filename << llendl;
LL_ERRS() << "Can't parse skeleton file: " << filename << LL_ENDL;
return FALSE;
}
@@ -532,13 +535,13 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
LLXmlTreeNode* root = sSkeletonXMLTree.getRoot();
if (!root)
{
llerrs << "No root node found in avatar skeleton file: " << filename << llendl;
LL_ERRS() << "No root node found in avatar skeleton file: " << filename << LL_ENDL;
return FALSE;
}
if( !root->hasName( "linden_skeleton" ) )
{
llerrs << "Invalid avatar skeleton file header: " << filename << llendl;
LL_ERRS() << "Invalid avatar skeleton file header: " << filename << LL_ENDL;
return FALSE;
}
@@ -546,7 +549,7 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version");
if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") )
{
llerrs << "Invalid avatar skeleton file version: " << version << " in file: " << filename << llendl;
LL_ERRS() << "Invalid avatar skeleton file version: " << version << " in file: " << filename << LL_ENDL;
return FALSE;
}
@@ -565,7 +568,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
joint = getCharacterJoint(joint_num);
if (!joint)
{
llwarns << "Too many bones" << llendl;
LL_WARNS() << "Too many bones" << LL_ENDL;
return FALSE;
}
joint->setName( info->mName );
@@ -574,7 +577,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
{
if (volume_num >= (S32)mCollisionVolumes.size())
{
llwarns << "Too many bones" << llendl;
LL_WARNS() << "Too many bones" << LL_ENDL;
return FALSE;
}
joint = (mCollisionVolumes[volume_num]);
@@ -652,7 +655,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
//-------------------------------------------------------------------------
if (!allocateCharacterJoints(info->mNumBones))
{
llerrs << "Can't allocate " << info->mNumBones << " joints" << llendl;
LL_ERRS() << "Can't allocate " << info->mNumBones << " joints" << LL_ENDL;
return FALSE;
}
@@ -663,7 +666,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
{
if (!allocateCollisionVolumes(info->mNumCollisionVolumes))
{
llerrs << "Can't allocate " << info->mNumCollisionVolumes << " collision volumes" << llendl;
LL_ERRS() << "Can't allocate " << info->mNumCollisionVolumes << " collision volumes" << LL_ENDL;
return FALSE;
}
}
@@ -676,7 +679,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
LLAvatarBoneInfo *info = *iter;
if (!setupBone(info, NULL, current_volume_num, current_joint_num))
{
llerrs << "Error parsing bone in skeleton file" << llendl;
LL_ERRS() << "Error parsing bone in skeleton file" << LL_ENDL;
return FALSE;
}
}
@@ -742,17 +745,17 @@ void LLAvatarAppearance::buildCharacter()
}
// gPrintMessagesThisFrame = TRUE;
lldebugs << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << llendl;
LL_DEBUGS() << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << LL_ENDL;
if (!status)
{
if (isSelf())
{
llerrs << "Unable to load user's avatar" << llendl;
LL_ERRS() << "Unable to load user's avatar" << LL_ENDL;
}
else
{
llwarns << "Unable to load other's avatar" << llendl;
LL_WARNS() << "Unable to load other's avatar" << LL_ENDL;
}
return;
}
@@ -801,7 +804,7 @@ void LLAvatarAppearance::buildCharacter()
mEyeLeftp &&
mEyeRightp))
{
llerrs << "Failed to create avatar." << llendl;
LL_ERRS() << "Failed to create avatar." << LL_ENDL;
return;
}
@@ -827,21 +830,21 @@ BOOL LLAvatarAppearance::loadAvatar()
// avatar_skeleton.xml
if( !buildSkeleton(sAvatarSkeletonInfo) )
{
llwarns << "avatar file: buildSkeleton() failed" << llendl;
LL_WARNS() << "avatar file: buildSkeleton() failed" << LL_ENDL;
return FALSE;
}
// avatar_lad.xml : <skeleton>
if( !loadSkeletonNode() )
{
llwarns << "avatar file: loadNodeSkeleton() failed" << llendl;
LL_WARNS() << "avatar file: loadNodeSkeleton() failed" << LL_ENDL;
return FALSE;
}
// avatar_lad.xml : <mesh>
if( !loadMeshNodes() )
{
llwarns << "avatar file: loadNodeMesh() failed" << llendl;
LL_WARNS() << "avatar file: loadNodeMesh() failed" << LL_ENDL;
return FALSE;
}
@@ -851,13 +854,13 @@ BOOL LLAvatarAppearance::loadAvatar()
mTexSkinColor = new LLTexGlobalColor( this );
if( !mTexSkinColor->setInfo( sAvatarXmlInfo->mTexSkinColorInfo ) )
{
llwarns << "avatar file: mTexSkinColor->setInfo() failed" << llendl;
LL_WARNS() << "avatar file: mTexSkinColor->setInfo() failed" << LL_ENDL;
return FALSE;
}
}
else
{
llwarns << "<global_color> name=\"skin_color\" not found" << llendl;
LL_WARNS() << "<global_color> name=\"skin_color\" not found" << LL_ENDL;
return FALSE;
}
if( sAvatarXmlInfo->mTexHairColorInfo )
@@ -865,13 +868,13 @@ BOOL LLAvatarAppearance::loadAvatar()
mTexHairColor = new LLTexGlobalColor( this );
if( !mTexHairColor->setInfo( sAvatarXmlInfo->mTexHairColorInfo ) )
{
llwarns << "avatar file: mTexHairColor->setInfo() failed" << llendl;
LL_WARNS() << "avatar file: mTexHairColor->setInfo() failed" << LL_ENDL;
return FALSE;
}
}
else
{
llwarns << "<global_color> name=\"hair_color\" not found" << llendl;
LL_WARNS() << "<global_color> name=\"hair_color\" not found" << LL_ENDL;
return FALSE;
}
if( sAvatarXmlInfo->mTexEyeColorInfo )
@@ -879,26 +882,26 @@ BOOL LLAvatarAppearance::loadAvatar()
mTexEyeColor = new LLTexGlobalColor( this );
if( !mTexEyeColor->setInfo( sAvatarXmlInfo->mTexEyeColorInfo ) )
{
llwarns << "avatar file: mTexEyeColor->setInfo() failed" << llendl;
LL_WARNS() << "avatar file: mTexEyeColor->setInfo() failed" << LL_ENDL;
return FALSE;
}
}
else
{
llwarns << "<global_color> name=\"eye_color\" not found" << llendl;
LL_WARNS() << "<global_color> name=\"eye_color\" not found" << LL_ENDL;
return FALSE;
}
// avatar_lad.xml : <layer_set>
if (sAvatarXmlInfo->mLayerInfoList.empty())
{
llwarns << "avatar file: missing <layer_set> node" << llendl;
LL_WARNS() << "avatar file: missing <layer_set> node" << LL_ENDL;
return FALSE;
}
if (sAvatarXmlInfo->mMorphMaskInfoList.empty())
{
llwarns << "avatar file: missing <morph_masks> node" << llendl;
LL_WARNS() << "avatar file: missing <morph_masks> node" << LL_ENDL;
return FALSE;
}
@@ -940,14 +943,14 @@ BOOL LLAvatarAppearance::loadAvatar()
LLVisualParam*(LLAvatarAppearance::*avatar_function)(S32)const = &LLAvatarAppearance::getVisualParam;
if( !driver_param->linkDrivenParams(boost::bind(avatar_function,(LLAvatarAppearance*)this,_1 ), false))
{
llwarns << "could not link driven params for avatar " << this->getFullname() << " param id: " << driver_param->getID() << llendl;
LL_WARNS() << "could not link driven params for avatar " << getID().asString() << " param id: " << driver_param->getID() << LL_ENDL;
continue;
}
}
else
{
delete driver_param;
llwarns << "avatar file: driver_param->parseData() failed" << llendl;
LL_WARNS() << "avatar file: driver_param->parseData() failed" << LL_ENDL;
return FALSE;
}
}
@@ -1067,17 +1070,17 @@ BOOL LLAvatarAppearance::loadMeshNodes()
}
else
{
llwarns << "Avatar file: <mesh> has invalid lod setting " << lod << llendl;
LL_WARNS() << "Avatar file: <mesh> has invalid lod setting " << lod << LL_ENDL;
return FALSE;
}
}
else
else
{
llwarns << "Ignoring unrecognized mesh type: " << type << llendl;
LL_WARNS() << "Ignoring unrecognized mesh type: " << type << LL_ENDL;
return FALSE;
}
// llinfos << "Parsing mesh data for " << type << "..." << llendl;
// LL_INFOS() << "Parsing mesh data for " << type << "..." << LL_ENDL;
// If this isn't set to white (1.0), avatars will *ALWAYS* be darker than their surroundings.
// Do not touch!!!
@@ -1107,7 +1110,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
if( !poly_mesh )
{
llwarns << "Failed to load mesh of type " << type << llendl;
LL_WARNS() << "Failed to load mesh of type " << type << LL_ENDL;
return FALSE;
}
@@ -1167,7 +1170,7 @@ BOOL LLAvatarAppearance::loadLayersets()
{
stop_glerror();
delete layer_set;
llwarns << "avatar file: layer_set->setInfo() failed" << llendl;
LL_WARNS() << "avatar file: layer_set->setInfo() failed" << LL_ENDL;
return FALSE;
}
@@ -1190,7 +1193,7 @@ BOOL LLAvatarAppearance::loadLayersets()
// if no baked texture was found, warn and cleanup
if (baked_index == BAKED_NUM_INDICES)
{
llwarns << "<layer_set> has invalid body_region attribute" << llendl;
LL_WARNS() << "<layer_set> has invalid body_region attribute" << LL_ENDL;
delete layer_set;
return FALSE;
}
@@ -1208,7 +1211,7 @@ BOOL LLAvatarAppearance::loadLayersets()
}
else
{
llwarns << "Could not find layer named " << morph->mLayer << " to set morph flag" << llendl;
LL_WARNS() << "Could not find layer named " << morph->mLayer << " to set morph flag" << LL_ENDL;
success = FALSE;
}
}
@@ -1354,7 +1357,7 @@ void LLAvatarAppearance::getMeshInfo (mesh_info_t* mesh_info)
else
{
// Should never happen
llwarns << "Duplicate mesh LOD " << type << " " << lod << " " << file << llendl;
LL_WARNS() << "Duplicate mesh LOD " << type << " " << lod << " " << file << LL_ENDL;
}
}
}
@@ -1367,7 +1370,7 @@ BOOL LLAvatarAppearance::isValid() const
// This should only be called on ourself.
if (!isSelf())
{
llerrs << "Called LLAvatarAppearance::isValid() on when isSelf() == false" << llendl;
LL_ERRS() << "Called LLAvatarAppearance::isValid() on when isSelf() == false" << LL_ENDL;
}
return TRUE;
}
@@ -1460,7 +1463,7 @@ BOOL LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name )
return TRUE;
}
void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color, BOOL upload_bake )
void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color, bool upload_bake )
{
U32 param_name[3];
if( teToColorParams( te, param_name ) )
@@ -1527,18 +1530,12 @@ LLTexLayerSet* LLAvatarAppearance::getAvatarLayerSet(EBakedTextureIndex baked_in
return mBakedTextureDatas[baked_index].mTexLayerSet;
}
void LLAvatarAppearance::clearCollisionVolumes()
{
std::for_each(mCollisionVolumes.begin(), mCollisionVolumes.end(),
DeletePointer());
mCollisionVolumes.clear();
}
//-----------------------------------------------------------------------------
// allocateCollisionVolumes()
//-----------------------------------------------------------------------------
BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num )
{
delete_and_clear(mCollisionVolumes);
mCollisionVolumes.reserve(num);
LLAvatarJointCollisionVolume* cv;
@@ -1551,7 +1548,7 @@ BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num )
}
else
{
clearCollisionVolumes();
delete_and_clear(mCollisionVolumes);
return false;
}
}
@@ -1569,7 +1566,7 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
if (!node->getFastAttributeString(name_string, mName))
{
llwarns << "Bone without name" << llendl;
LL_WARNS() << "Bone without name" << LL_ENDL;
return FALSE;
}
}
@@ -1584,28 +1581,28 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
}
else
{
llwarns << "Invalid node " << node->getName() << llendl;
LL_WARNS() << "Invalid node " << node->getName() << LL_ENDL;
return FALSE;
}
static LLStdStringHandle pos_string = LLXmlTree::addAttributeString("pos");
if (!node->getFastAttributeVector3(pos_string, mPos))
{
llwarns << "Bone without position" << llendl;
LL_WARNS() << "Bone without position" << LL_ENDL;
return FALSE;
}
static LLStdStringHandle rot_string = LLXmlTree::addAttributeString("rot");
if (!node->getFastAttributeVector3(rot_string, mRot))
{
llwarns << "Bone without rotation" << llendl;
LL_WARNS() << "Bone without rotation" << LL_ENDL;
return FALSE;
}
static LLStdStringHandle scale_string = LLXmlTree::addAttributeString("scale");
if (!node->getFastAttributeVector3(scale_string, mScale))
{
llwarns << "Bone without scale" << llendl;
LL_WARNS() << "Bone without scale" << LL_ENDL;
return FALSE;
}
@@ -1614,7 +1611,7 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
static LLStdStringHandle pivot_string = LLXmlTree::addAttributeString("pivot");
if (!node->getFastAttributeVector3(pivot_string, mPivot))
{
llwarns << "Bone without pivot" << llendl;
LL_WARNS() << "Bone without pivot" << LL_ENDL;
return FALSE;
}
}
@@ -1642,7 +1639,7 @@ BOOL LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
static LLStdStringHandle num_bones_string = LLXmlTree::addAttributeString("num_bones");
if (!node->getFastAttributeS32(num_bones_string, mNumBones))
{
llwarns << "Couldn't find number of bones." << llendl;
LL_WARNS() << "Couldn't find number of bones." << LL_ENDL;
return FALSE;
}
@@ -1656,7 +1653,7 @@ BOOL LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
if (!info->parseXml(child))
{
delete info;
llwarns << "Error parsing bone in skeleton file" << llendl;
LL_WARNS() << "Error parsing bone in skeleton file" << LL_ENDL;
return FALSE;
}
mBoneInfoList.push_back(info);
@@ -1673,7 +1670,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
LLXmlTreeNode* node = root->getChildByName( "skeleton" );
if( !node )
{
llwarns << "avatar file: missing <skeleton>" << llendl;
LL_WARNS() << "avatar file: missing <skeleton>" << LL_ENDL;
return FALSE;
}
@@ -1688,11 +1685,11 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
{
if (child->getChildByName("param_morph"))
{
llwarns << "Can't specify morph param in skeleton definition." << llendl;
LL_WARNS() << "Can't specify morph param in skeleton definition." << LL_ENDL;
}
else
{
llwarns << "Unknown param type." << llendl;
LL_WARNS() << "Unknown param type." << LL_ENDL;
}
continue;
}
@@ -1717,7 +1714,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
if (!child->getFastAttributeString(name_string, info->mName))
{
llwarns << "No name supplied for attachment point." << llendl;
LL_WARNS() << "No name supplied for attachment point." << LL_ENDL;
delete info;
continue;
}
@@ -1725,7 +1722,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
static LLStdStringHandle joint_string = LLXmlTree::addAttributeString("joint");
if (!child->getFastAttributeString(joint_string, info->mJointName))
{
llwarns << "No bone declared in attachment point " << info->mName << llendl;
LL_WARNS() << "No bone declared in attachment point " << info->mName << LL_ENDL;
delete info;
continue;
}
@@ -1751,7 +1748,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
static LLStdStringHandle id_string = LLXmlTree::addAttributeString("id");
if (!child->getFastAttributeS32(id_string, info->mAttachmentID))
{
llwarns << "No id supplied for attachment point " << info->mName << llendl;
LL_WARNS() << "No id supplied for attachment point " << info->mName << LL_ENDL;
delete info;
continue;
}
@@ -1786,7 +1783,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
static LLStdStringHandle type_string = LLXmlTree::addAttributeString("type");
if( !node->getFastAttributeString( type_string, info->mType ) )
{
llwarns << "Avatar file: <mesh> is missing type attribute. Ignoring element. " << llendl;
LL_WARNS() << "Avatar file: <mesh> is missing type attribute. Ignoring element. " << LL_ENDL;
delete info;
return FALSE; // Ignore this element
}
@@ -1794,7 +1791,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
static LLStdStringHandle lod_string = LLXmlTree::addAttributeString("lod");
if (!node->getFastAttributeS32( lod_string, info->mLOD ))
{
llwarns << "Avatar file: <mesh> is missing lod attribute. Ignoring element. " << llendl;
LL_WARNS() << "Avatar file: <mesh> is missing lod attribute. Ignoring element. " << LL_ENDL;
delete info;
return FALSE; // Ignore this element
}
@@ -1802,7 +1799,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name");
if( !node->getFastAttributeString( file_name_string, info->mMeshFileName ) )
{
llwarns << "Avatar file: <mesh> is missing file_name attribute. Ignoring: " << info->mType << llendl;
LL_WARNS() << "Avatar file: <mesh> is missing file_name attribute. Ignoring: " << info->mType << LL_ENDL;
delete info;
return FALSE; // Ignore this element
}
@@ -1833,11 +1830,11 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
{
if (child->getChildByName("param_skeleton"))
{
llwarns << "Can't specify skeleton param in a mesh definition." << llendl;
LL_WARNS() << "Can't specify skeleton param in a mesh definition." << LL_ENDL;
}
else
{
llwarns << "Unknown param type." << llendl;
LL_WARNS() << "Unknown param type." << LL_ENDL;
}
continue;
}
@@ -1878,14 +1875,14 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
{
if (mTexSkinColorInfo)
{
llwarns << "avatar file: multiple instances of skin_color" << llendl;
LL_WARNS() << "avatar file: multiple instances of skin_color" << LL_ENDL;
return FALSE;
}
mTexSkinColorInfo = new LLTexGlobalColorInfo;
if( !mTexSkinColorInfo->parseXml( color_node ) )
{
deleteAndClear(mTexSkinColorInfo);
llwarns << "avatar file: mTexSkinColor->parseXml() failed" << llendl;
delete_and_clear(mTexSkinColorInfo);
LL_WARNS() << "avatar file: mTexSkinColor->parseXml() failed" << LL_ENDL;
return FALSE;
}
}
@@ -1893,14 +1890,14 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
{
if (mTexHairColorInfo)
{
llwarns << "avatar file: multiple instances of hair_color" << llendl;
LL_WARNS() << "avatar file: multiple instances of hair_color" << LL_ENDL;
return FALSE;
}
mTexHairColorInfo = new LLTexGlobalColorInfo;
if( !mTexHairColorInfo->parseXml( color_node ) )
{
deleteAndClear(mTexHairColorInfo);
llwarns << "avatar file: mTexHairColor->parseXml() failed" << llendl;
delete_and_clear(mTexHairColorInfo);
LL_WARNS() << "avatar file: mTexHairColor->parseXml() failed" << LL_ENDL;
return FALSE;
}
}
@@ -1908,13 +1905,13 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
{
if (mTexEyeColorInfo)
{
llwarns << "avatar file: multiple instances of eye_color" << llendl;
LL_WARNS() << "avatar file: multiple instances of eye_color" << LL_ENDL;
return FALSE;
}
mTexEyeColorInfo = new LLTexGlobalColorInfo;
if( !mTexEyeColorInfo->parseXml( color_node ) )
{
llwarns << "avatar file: mTexEyeColor->parseXml() failed" << llendl;
LL_WARNS() << "avatar file: mTexEyeColor->parseXml() failed" << LL_ENDL;
return FALSE;
}
}
@@ -1940,7 +1937,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlLayerNodes(LLXmlTreeNode* root
else
{
delete layer_info;
llwarns << "avatar file: layer_set->parseXml() failed" << llendl;
LL_WARNS() << "avatar file: layer_set->parseXml() failed" << LL_ENDL;
return FALSE;
}
}
@@ -1969,7 +1966,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlDriverNodes(LLXmlTreeNode* roo
else
{
delete driver_info;
llwarns << "avatar file: driver_param->parseXml() failed" << llendl;
LL_WARNS() << "avatar file: driver_param->parseXml() failed" << LL_ENDL;
return FALSE;
}
}
@@ -1998,7 +1995,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("morph_name");
if (!grand_child->getFastAttributeString(name_string, info->mName))
{
llwarns << "No name supplied for morph mask." << llendl;
LL_WARNS() << "No name supplied for morph mask." << LL_ENDL;
delete info;
continue;
}
@@ -2006,7 +2003,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
static LLStdStringHandle region_string = LLXmlTree::addAttributeString("body_region");
if (!grand_child->getFastAttributeString(region_string, info->mRegion))
{
llwarns << "No region supplied for morph mask." << llendl;
LL_WARNS() << "No region supplied for morph mask." << LL_ENDL;
delete info;
continue;
}
@@ -2014,7 +2011,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
static LLStdStringHandle layer_string = LLXmlTree::addAttributeString("layer");
if (!grand_child->getFastAttributeString(layer_string, info->mLayer))
{
llwarns << "No layer supplied for morph mask." << llendl;
LL_WARNS() << "No layer supplied for morph mask." << LL_ENDL;
delete info;
continue;
}

View File

@@ -262,7 +262,7 @@ protected:
// Clothing colors (convenience functions to access visual parameters)
//--------------------------------------------------------------------
public:
void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake);
void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, bool upload_bake = false);
LLColor4 getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te);
static BOOL teToColorParams(LLAvatarAppearanceDefines::ETextureIndex te, U32 *param_name);
@@ -271,7 +271,7 @@ public:
//--------------------------------------------------------------------
public:
LLColor4 getGlobalColor(const std::string& color_name ) const;
virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake) = 0;
virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, bool upload_bake = false) = 0;
protected:
LLTexGlobalColor* mTexSkinColor;
LLTexGlobalColor* mTexHairColor;
@@ -339,7 +339,6 @@ protected:
public:
std::vector<LLAvatarJointCollisionVolume*> mCollisionVolumes;
protected:
void clearCollisionVolumes();
BOOL allocateCollisionVolumes(U32 num);
/** Physics

View File

@@ -249,7 +249,7 @@ LLAvatarJointCollisionVolume::LLAvatarJointCollisionVolume()
/*virtual*/
U32 LLAvatarJointCollisionVolume::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy )
{
llerrs << "Cannot call render() on LLAvatarJointCollisionVolume" << llendl;
LL_ERRS() << "Cannot call render() on LLAvatarJointCollisionVolume" << LL_ENDL;
return 0;
}

View File

@@ -91,7 +91,7 @@ void LLSkinJoint::setupSkinJoint( LLJoint *joint)
// find the named joint
if (!(mJoint = joint))
{
llinfos << "Can't find joint" << llendl;
LL_INFOS() << "Can't find joint" << LL_ENDL;
return;
}
@@ -304,7 +304,7 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
U32 jn;
for (jn = 0; jn < numJointNames; jn++)
{
//llinfos << "Setting up joint " << jointNames[jn] << llendl;
//LL_INFOS() << "Setting up joint " << jointNames[jn] << LL_ENDL;
mSkinJoints[jn].setupSkinJoint( getRoot()->findJoint(jointNames[jn]) );
}
}
@@ -315,7 +315,7 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
setupJoint(getRoot());
}
// llinfos << "joint render entries: " << mMesh->mJointRenderData.count() << llendl;
LL_DEBUGS() << "joint render entries: " << mMesh->mJointRenderData.size() << LL_ENDL;
}
//-----------------------------------------------------------------------------
@@ -323,7 +323,7 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
//-----------------------------------------------------------------------------
void LLAvatarJointMesh::setupJoint(LLJoint* current_joint)
{
// llinfos << "Mesh: " << getName() << llendl;
// LL_INFOS() << "Mesh: " << getName() << LL_ENDL;
// S32 joint_count = 0;
U32 sj;
@@ -339,22 +339,22 @@ void LLAvatarJointMesh::setupJoint(LLJoint* current_joint)
// we've found a skinjoint for this joint..
// is the last joint in the array our parent?
if(mMesh->mJointRenderData.count() && mMesh->mJointRenderData[mMesh->mJointRenderData.count() - 1]->mWorldMatrix == &current_joint->getParent()->getWorldMatrix())
if(mMesh->mJointRenderData.size() && mMesh->mJointRenderData[mMesh->mJointRenderData.size() - 1]->mWorldMatrix == &current_joint->getParent()->getWorldMatrix())
{
// ...then just add ourselves
LLJoint* jointp = js.mJoint;
mMesh->mJointRenderData.put(new LLJointRenderData(&jointp->getWorldMatrix(), &js));
// llinfos << "joint " << joint_count << js.mJoint->getName() << llendl;
mMesh->mJointRenderData.push_back(new LLJointRenderData(&jointp->getWorldMatrix(), &js));
// LL_INFOS() << "joint " << joint_count << js.mJoint->getName() << LL_ENDL;
// joint_count++;
}
// otherwise add our parent and ourselves
else
{
mMesh->mJointRenderData.put(new LLJointRenderData(&current_joint->getParent()->getWorldMatrix(), NULL));
// llinfos << "joint " << joint_count << current_joint->getParent()->getName() << llendl;
mMesh->mJointRenderData.push_back(new LLJointRenderData(&current_joint->getParent()->getWorldMatrix(), NULL));
// LL_INFOS() << "joint " << joint_count << current_joint->getParent()->getName() << LL_ENDL;
// joint_count++;
mMesh->mJointRenderData.put(new LLJointRenderData(&current_joint->getWorldMatrix(), &js));
// llinfos << "joint " << joint_count << current_joint->getName() << llendl;
mMesh->mJointRenderData.push_back(new LLJointRenderData(&current_joint->getWorldMatrix(), &js));
// LL_INFOS() << "joint " << joint_count << current_joint->getName() << LL_ENDL;
// joint_count++;
}
}

View File

@@ -89,7 +89,7 @@ BOOL LLDriverParamInfo::parseXml(LLXmlTreeNode* node)
}
else
{
llerrs << "<driven> Unable to resolve driven parameter: " << driven_id << llendl;
LL_ERRS() << "<driven> Unable to resolve driven parameter: " << driven_id << LL_ENDL;
return FALSE;
}
}
@@ -139,9 +139,9 @@ void LLDriverParamInfo::toStream(std::ostream &out)
}
else
{
llwarns << "could not get parameter " << driven.mDrivenID << " from avatar "
LL_WARNS() << "could not get parameter " << driven.mDrivenID << " from avatar "
<< mDriverParam->getAvatarAppearance()
<< " for driver parameter " << getID() << llendl;
<< " for driver parameter " << getID() << LL_ENDL;
}
out << std::endl;
}
@@ -152,19 +152,31 @@ void LLDriverParamInfo::toStream(std::ostream &out)
// LLDriverParam
//-----------------------------------------------------------------------------
LLDriverParam::LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable /* = NULL */) :
LLDriverParam::LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable /* = NULL */)
: LLViewerVisualParam(),
mDefaultVec(),
mDriven(),
mCurrentDistortionParam( NULL ),
mAvatarAppearance(appearance),
mWearablep(wearable)
{
llassert(mAvatarAppearance);
if (mWearablep)
{
llassert(mAvatarAppearance->isSelf());
}
llassert((mWearablep == NULL) || mAvatarAppearance->isSelf());
mDefaultVec.clear();
}
LLDriverParam::LLDriverParam(const LLDriverParam& pOther)
: LLViewerVisualParam(pOther),
mDefaultVec(pOther.mDefaultVec),
mDriven(pOther.mDriven),
mCurrentDistortionParam(pOther.mCurrentDistortionParam),
mAvatarAppearance(pOther.mAvatarAppearance),
mWearablep(pOther.mWearablep)
{
llassert(mAvatarAppearance);
llassert((mWearablep == NULL) || mAvatarAppearance->isSelf());
}
LLDriverParam::~LLDriverParam()
{
}
@@ -178,7 +190,7 @@ BOOL LLDriverParam::setInfo(LLDriverParamInfo *info)
mID = info->mID;
info->mDriverParam = this;
setWeight(getDefaultWeight(), FALSE );
setWeight(getDefaultWeight());
return TRUE;
}
@@ -186,31 +198,10 @@ BOOL LLDriverParam::setInfo(LLDriverParamInfo *info)
/*virtual*/ LLViewerVisualParam* LLDriverParam::cloneParam(LLWearable* wearable) const
{
llassert(wearable);
LLDriverParam *new_param = new LLDriverParam(mAvatarAppearance, wearable);
// FIXME DRANO this clobbers mWearablep, which means any code
// currently using mWearablep is wrong, or at least untested.
*new_param = *this;
//new_param->mWearablep = wearable;
// new_param->mDriven.clear(); // clear driven list to avoid overwriting avatar driven params from wearables.
return new_param;
return new LLDriverParam(*this);
}
#if 0 // obsolete
BOOL LLDriverParam::parseData(LLXmlTreeNode* node)
{
LLDriverParamInfo* info = new LLDriverParamInfo;
info->parseXml(node);
if (!setInfo(info))
{
delete info;
return FALSE;
}
return TRUE;
}
#endif
void LLDriverParam::setWeight(F32 weight, BOOL upload_bake)
void LLDriverParam::setWeight(F32 weight, bool upload_bake)
{
F32 min_weight = getMinWeight();
F32 max_weight = getMaxWeight();
@@ -445,7 +436,7 @@ const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const
//-----------------------------------------------------------------------------
// setAnimationTarget()
//-----------------------------------------------------------------------------
void LLDriverParam::setAnimationTarget( F32 target_value, BOOL upload_bake )
void LLDriverParam::setAnimationTarget( F32 target_value, bool upload_bake )
{
LLVisualParam::setAnimationTarget(target_value, upload_bake);
@@ -463,7 +454,7 @@ void LLDriverParam::setAnimationTarget( F32 target_value, BOOL upload_bake )
//-----------------------------------------------------------------------------
// stopAnimating()
//-----------------------------------------------------------------------------
void LLDriverParam::stopAnimating(BOOL upload_bake)
void LLDriverParam::stopAnimating(bool upload_bake)
{
LLVisualParam::stopAnimating(upload_bake);
@@ -545,7 +536,7 @@ void LLDriverParam::updateCrossDrivenParams(LLWearableType::EType driven_type)
LLWearable *wearable = mAvatarAppearance->getWearableData()->getTopWearable(driver_type);
if (wearable)
{
wearable->setVisualParamWeight(mID, wearable->getVisualParamWeight(mID), false);
wearable->setVisualParamWeight(mID, wearable->getVisualParamWeight(mID));
}
}
}

View File

@@ -112,9 +112,9 @@ public:
// LLVisualParam Virtual functions
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
/*virtual*/ void apply( ESex sex ) {} // apply is called separately for each driven param.
/*virtual*/ void setWeight(F32 weight, BOOL upload_bake);
/*virtual*/ void setAnimationTarget( F32 target_value, BOOL upload_bake );
/*virtual*/ void stopAnimating(BOOL upload_bake);
/*virtual*/ void setWeight(F32 weight, bool upload_bake = false);
/*virtual*/ void setAnimationTarget( F32 target_value, bool upload_bake = false);
/*virtual*/ void stopAnimating(bool upload_bake = false);
/*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params);
/*virtual*/ void resetDrivenParams();
/*virtual*/ char const* getTypeString(void) const { return "param_driver"; }
@@ -131,8 +131,9 @@ public:
const LLViewerVisualParam* getDrivenParam(S32 index) const;
protected:
LLDriverParam(const LLDriverParam& pOther);
F32 getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight);
void setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool upload_bake);
void setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool upload_bake = false);
LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder

View File

@@ -64,7 +64,7 @@ LLLocalTextureObject::LLLocalTextureObject(const LLLocalTextureObject& lto) :
LLTexLayer* original_layer = lto.getTexLayer(index);
if (!original_layer)
{
llerrs << "could not clone Local Texture Object: unable to extract texlayer!" << llendl;
LL_ERRS() << "could not clone Local Texture Object: unable to extract texlayer!" << LL_ENDL;
continue;
}

View File

@@ -162,7 +162,7 @@ void LLPolyMeshSharedData::freeMeshData()
}
// compate_int is used by the qsort function to sort the index array
int compare_int(const void *a, const void *b);
S32 compare_int(const void *a, const void *b);
//-----------------------------------------------------------------------------
// genIndices()
@@ -277,13 +277,13 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
//-------------------------------------------------------------------------
if(fileName.empty())
{
llerrs << "Filename is Empty!" << llendl;
LL_ERRS() << "Filename is Empty!" << LL_ENDL;
return FALSE;
}
LLFILE* fp = LLFile::fopen(fileName, "rb"); /*Flawfinder: ignore*/
if (!fp)
{
llerrs << "can't open: " << fileName << llendl;
LL_ERRS() << "can't open: " << fileName << LL_ENDL;
return FALSE;
}
@@ -293,7 +293,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
char header[128]; /*Flawfinder: ignore*/
if (fread(header, sizeof(char), 128, fp) != 128)
{
llwarns << "Short read" << llendl;
LL_WARNS() << "Short read" << LL_ENDL;
}
//-------------------------------------------------------------------------
@@ -302,7 +302,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
BOOL status = FALSE;
if ( strncmp(header, HEADER_BINARY, strlen(HEADER_BINARY)) == 0 ) /*Flawfinder: ignore*/
{
lldebugs << "Loading " << fileName << llendl;
LL_DEBUGS() << "Loading " << fileName << LL_ENDL;
//----------------------------------------------------------------
// File Header (seek past it)
@@ -316,7 +316,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
size_t numRead = fread(&hasWeights, sizeof(U8), 1, fp);
if (numRead != 1)
{
llerrs << "can't read HasWeights flag from " << fileName << llendl;
LL_ERRS() << "can't read HasWeights flag from " << fileName << LL_ENDL;
return FALSE;
}
if (!isLOD())
@@ -331,7 +331,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
numRead = fread(&hasDetailTexCoords, sizeof(U8), 1, fp);
if (numRead != 1)
{
llerrs << "can't read HasDetailTexCoords flag from " << fileName << llendl;
LL_ERRS() << "can't read HasDetailTexCoords flag from " << fileName << LL_ENDL;
return FALSE;
}
@@ -343,7 +343,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(position.mV, sizeof(float), 3);
if (numRead != 3)
{
llerrs << "can't read Position from " << fileName << llendl;
LL_ERRS() << "can't read Position from " << fileName << LL_ENDL;
return FALSE;
}
setPosition( position );
@@ -356,7 +356,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(rotationAngles.mV, sizeof(float), 3);
if (numRead != 3)
{
llerrs << "can't read RotationAngles from " << fileName << llendl;
LL_ERRS() << "can't read RotationAngles from " << fileName << LL_ENDL;
return FALSE;
}
@@ -365,7 +365,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
if (numRead != 1)
{
llerrs << "can't read RotationOrder from " << fileName << llendl;
LL_ERRS() << "can't read RotationOrder from " << fileName << LL_ENDL;
return FALSE;
}
@@ -384,7 +384,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(scale.mV, sizeof(float), 3);
if (numRead != 3)
{
llerrs << "can't read Scale from " << fileName << llendl;
LL_ERRS() << "can't read Scale from " << fileName << LL_ENDL;
return FALSE;
}
setScale( scale );
@@ -405,7 +405,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(&numVertices, sizeof(U16), 1);
if (numRead != 1)
{
llerrs << "can't read NumVertices from " << fileName << llendl;
LL_ERRS() << "can't read NumVertices from " << fileName << LL_ENDL;
return FALSE;
}
@@ -420,7 +420,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(&mBaseCoords[i], sizeof(float), 3);
if (numRead != 3)
{
llerrs << "can't read Coordinates from " << fileName << llendl;
LL_ERRS() << "can't read Coordinates from " << fileName << LL_ENDL;
return FALSE;
}
}
@@ -434,7 +434,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(&mBaseNormals[i], sizeof(float), 3);
if (numRead != 3)
{
llerrs << " can't read Normals from " << fileName << llendl;
LL_ERRS() << " can't read Normals from " << fileName << LL_ENDL;
return FALSE;
}
}
@@ -448,7 +448,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(&mBaseBinormals[i], sizeof(float), 3);
if (numRead != 3)
{
llerrs << " can't read Binormals from " << fileName << llendl;
LL_ERRS() << " can't read Binormals from " << fileName << LL_ENDL;
return FALSE;
}
}
@@ -460,7 +460,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(mTexCoords, sizeof(float), 2*numVertices);
if (numRead != numVertices)
{
llerrs << "can't read TexCoords from " << fileName << llendl;
LL_ERRS() << "can't read TexCoords from " << fileName << LL_ENDL;
return FALSE;
}
@@ -473,7 +473,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(mDetailTexCoords, sizeof(float), 2*numVertices);
if (numRead != numVertices)
{
llerrs << "can't read DetailTexCoords from " << fileName << llendl;
LL_ERRS() << "can't read DetailTexCoords from " << fileName << LL_ENDL;
return FALSE;
}
}
@@ -487,7 +487,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(mWeights, sizeof(float), numVertices);
if (numRead != numVertices)
{
llerrs << "can't read Weights from " << fileName << llendl;
LL_ERRS() << "can't read Weights from " << fileName << LL_ENDL;
return FALSE;
}
}
@@ -501,7 +501,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(&numFaces, sizeof(U16), 1);
if (numRead != 1)
{
llerrs << "can't read NumFaces from " << fileName << llendl;
LL_ERRS() << "can't read NumFaces from " << fileName << LL_ENDL;
return FALSE;
}
allocateFaceData( numFaces );
@@ -519,7 +519,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(face, sizeof(U16), 3);
if (numRead != 3)
{
llerrs << "can't read Face[" << i << "] from " << fileName << llendl;
LL_ERRS() << "can't read Face[" << i << "] from " << fileName << LL_ENDL;
return FALSE;
}
if (mReferenceData)
@@ -559,10 +559,10 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
numTris++;
}
lldebugs << "verts: " << numVertices
LL_DEBUGS() << "verts: " << numVertices
<< ", faces: " << numFaces
<< ", tris: " << numTris
<< llendl;
<< LL_ENDL;
//----------------------------------------------------------------
// NumSkinJoints
@@ -576,7 +576,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(&numSkinJoints, sizeof(U16), 1);
if (numRead != 1)
{
llerrs << "can't read NumSkinJoints from " << fileName << llendl;
LL_ERRS() << "can't read NumSkinJoints from " << fileName << LL_ENDL;
return FALSE;
}
allocateJointNames( numSkinJoints );
@@ -592,7 +592,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
jointName[sizeof(jointName)-1] = '\0'; // ensure nul-termination
if (numRead != 1)
{
llerrs << "can't read Skin[" << i << "].Name from " << fileName << llendl;
LL_ERRS() << "can't read Skin[" << i << "].Name from " << fileName << LL_ENDL;
return FALSE;
}
@@ -687,12 +687,12 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
S32 remapDst;
if (fread(&remapSrc, sizeof(S32), 1, fp) != 1)
{
llerrs << "can't read source vertex in vertex remap data" << llendl;
LL_ERRS() << "can't read source vertex in vertex remap data" << LL_ENDL;
break;
}
if (fread(&remapDst, sizeof(S32), 1, fp) != 1)
{
llerrs << "can't read destination vertex in vertex remap data" << llendl;
LL_ERRS() << "can't read destination vertex in vertex remap data" << LL_ENDL;
break;
}
llendianswizzle(&remapSrc, sizeof(S32), 1);
@@ -707,7 +707,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
}
else
{
llerrs << "invalid mesh file header: " << fileName << llendl;
LL_ERRS() << "invalid mesh file header: " << fileName << LL_ENDL;
status = FALSE;
}
@@ -808,15 +808,8 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_
//-----------------------------------------------------------------------------
LLPolyMesh::~LLPolyMesh()
{
S32 i;
for (i = 0; i < mJointRenderData.count(); i++)
{
delete mJointRenderData[i];
mJointRenderData[i] = NULL;
}
ll_aligned_free_16(mVertexData);
delete_and_clear(mJointRenderData);
ll_aligned_free_16(mVertexData);
}
@@ -831,7 +824,7 @@ LLPolyMesh *LLPolyMesh::getMesh(const std::string &name, LLPolyMesh* reference_m
LLPolyMeshSharedData* meshSharedData = get_if_there(sGlobalSharedMeshList, name, (LLPolyMeshSharedData*)NULL);
if (meshSharedData)
{
// llinfos << "Polymesh " << name << " found in global mesh table." << llendl;
// LL_INFOS() << "Polymesh " << name << " found in global mesh table." << LL_ENDL;
LLPolyMesh *poly_mesh = new LLPolyMesh(meshSharedData, reference_mesh);
return poly_mesh;
}
@@ -855,7 +848,7 @@ LLPolyMesh *LLPolyMesh::getMesh(const std::string &name, LLPolyMesh* reference_m
LLPolyMesh *poly_mesh = new LLPolyMesh(mesh_data, reference_mesh);
// llinfos << "Polymesh " << name << " added to global mesh table." << llendl;
// LL_INFOS() << "Polymesh " << name << " added to global mesh table." << LL_ENDL;
sGlobalSharedMeshList[name] = poly_mesh->mSharedData;
return poly_mesh;
@@ -887,7 +880,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
//-------------------------------------------------------------------------
if (fwrite(HEADER_BINARY, 1, strlen(HEADER_BINARY), fp) != strlen(HEADER_BINARY))
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
if (strlen(HEADER_BINARY) < 24)
@@ -896,7 +889,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
int pad = 24 - strlen(HEADER_BINARY);
if (fwrite(&padding, 1, pad, fp) != pad)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
}
@@ -906,7 +899,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
U8 hasWeights = (U8) mSharedData->mHasWeights;
if (fwrite(&hasWeights, sizeof(U8), 1, fp) != 1)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
//----------------------------------------------------------------
@@ -915,7 +908,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
U8 hasDetailTexCoords = (U8) mSharedData->mHasDetailTexCoords;
if (fwrite(&hasDetailTexCoords, sizeof(U8), 1, fp) != 1)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
//----------------------------------------------------------------
@@ -925,7 +918,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
llendianswizzle(position.mV, sizeof(float), 3);
if (fwrite(position.mV, sizeof(float), 3, fp) != 3)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
//----------------------------------------------------------------
@@ -946,13 +939,13 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
llendianswizzle(rotationAngles.mV, sizeof(float), 3);
if (fwrite(rotationAngles.mV, sizeof(float), 3, fp) != 3)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
U8 rotationOrder = 0;
if (fwrite(&rotationOrder, sizeof(U8), 1, fp) != 1)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
//----------------------------------------------------------------
@@ -962,7 +955,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
llendianswizzle(scale.mV, sizeof(float), 3);
if (fwrite(scale.mV, sizeof(float), 3, fp) != 3)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
//----------------------------------------------------------------
@@ -975,7 +968,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
llendianswizzle(&numVertices, sizeof(U16), 1);
if (fwrite(&numVertices, sizeof(U16), 1, fp) != 1)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
numVertices = mSharedData->mNumVertices; // without the swizzle again
@@ -989,7 +982,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
llendianswizzle(coords.getF32ptr(), sizeof(float), 3);
if (fwrite(coords.getF32ptr(), 3*sizeof(float), 1, fp) != 1)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
llendianswizzle(coords.getF32ptr(), sizeof(float), 3);
}
@@ -1004,7 +997,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
llendianswizzle(normals.getF32ptr(), sizeof(float), 3);
if (fwrite(normals.getF32ptr(), 3*sizeof(float), 1, fp) != 1)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
llendianswizzle(normals.getF32ptr(), sizeof(float), 3);
}
@@ -1019,7 +1012,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
llendianswizzle(binormals.getF32ptr(), sizeof(float), 3);
if (fwrite(binormals.getF32ptr(), 3*sizeof(float), 1, fp) != 1)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
llendianswizzle(binormals.getF32ptr(), sizeof(float), 3);
}
@@ -1032,7 +1025,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
llendianswizzle(tex, sizeof(float), 2*numVertices);
if (fwrite(tex, 2*sizeof(float), numVertices, fp) != numVertices)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
llendianswizzle(tex, sizeof(float), 2*numVertices);
@@ -1046,7 +1039,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
llendianswizzle(detail, sizeof(float), 2*numVertices);
if (fwrite(detail, 2*sizeof(float), numVertices, fp) != numVertices)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
llendianswizzle(detail, sizeof(float), 2*numVertices);
}
@@ -1061,7 +1054,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
llendianswizzle(weights, sizeof(float), numVertices);
if (fwrite(weights, sizeof(float), numVertices, fp) != numVertices)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
llendianswizzle(weights, sizeof(float), numVertices);
}
@@ -1075,7 +1068,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
llendianswizzle(&numFaces, sizeof(U16), 1);
if (fwrite(&numFaces, sizeof(U16), 1, fp) != 1)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
numFaces = mSharedData->mNumFaces; // without the swizzle again
@@ -1094,7 +1087,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
llendianswizzle(face, sizeof(U16), 3);
if (fwrite(face, sizeof(U16), 3, fp) != 3)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
}
@@ -1121,7 +1114,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
llendianswizzle(&numSkinJoints, sizeof(U16), 1);
if (fwrite(&numSkinJoints, sizeof(U16), 1, fp) != 1)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
llendianswizzle(&numSkinJoints, sizeof(U16), 1);
@@ -1134,7 +1127,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
jn = &mSharedData->mJointNames[i];
if (fwrite(jn->c_str(), 1, jn->length(), fp) != jn->length())
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
if (jn->length() < 64)
@@ -1142,7 +1135,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
int pad = 64 - jn->length();
if (fwrite(&padding, 1, pad, fp) != pad)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
}
}
@@ -1173,7 +1166,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
if (fwrite(morph_name.c_str(), 1, morph_name.length(), fp) != morph_name.length())
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
if (morph_name.length() < 64)
@@ -1181,20 +1174,20 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
int pad = 64 - morph_name.length();
if (fwrite(&padding, 1, pad, fp) != pad)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
}
if (!morph_data->saveLLM(fp))
{
llwarns << "Problem writing morph" << llendl;
LL_WARNS() << "Problem writing morph" << LL_ENDL;
}
}
char end_morphs[64] = "End Morphs"; // padded with zeroes
if (fwrite(end_morphs, sizeof(char), 64, fp) != 64)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
//-------------------------------------------------------------------------
@@ -1204,7 +1197,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
llendianswizzle(&numRemaps, sizeof(S32), 1);
if (fwrite(&numRemaps, sizeof(S32), 1, fp) != 1)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
std::map<S32, S32>::iterator remap_iter = mSharedData->mSharedVerts.begin();
@@ -1217,7 +1210,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
llendianswizzle(&remapSrc, sizeof(S32), 1);
if (fwrite(&remapSrc, sizeof(S32), 1, fp) != 1)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
S32 remapDst = remap_iter->second;
@@ -1225,7 +1218,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
llendianswizzle(&remapDst, sizeof(S32), 1);
if (fwrite(&remapDst, sizeof(S32), 1, fp) != 1)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
}
@@ -1257,7 +1250,7 @@ BOOL LLPolyMesh::saveOBJ(LLFILE *fp)
coords[i].getF32ptr()[2]);
if (fwrite(outstring.c_str(), 1, outstring.length(), fp) != outstring.length())
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
}
@@ -1269,7 +1262,7 @@ BOOL LLPolyMesh::saveOBJ(LLFILE *fp)
normals[i].getF32ptr()[2]);
if (fwrite(outstring.c_str(), 1, outstring.length(), fp) != outstring.length())
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
}
@@ -1280,7 +1273,7 @@ BOOL LLPolyMesh::saveOBJ(LLFILE *fp)
tex[i][1]);
if (fwrite(outstring.c_str(), 1, outstring.length(), fp) != outstring.length())
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
}
@@ -1295,7 +1288,7 @@ BOOL LLPolyMesh::saveOBJ(LLFILE *fp)
f3, f3, f3);
if (fwrite(outstring.c_str(), 1, outstring.length(), fp) != outstring.length())
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
}
@@ -1404,12 +1397,12 @@ BOOL LLPolyMesh::loadOBJ(LLFILE *fp)
values = sscanf (buffer," %255s %f %f %f", keyword, &tempX, &tempY, &tempZ);
if (values != 4)
{
llwarns << "Expecting v x y z, but found: " << buffer <<llendl;
LL_WARNS() << "Expecting v x y z, but found: " << buffer <<LL_ENDL;
continue;
}
if (ncoords == nverts)
{
llwarns << "Too many vertices. Ignoring from: " << buffer <<llendl;
LL_WARNS() << "Too many vertices. Ignoring from: " << buffer <<LL_ENDL;
}
if (ncoords < nverts)
{
@@ -1422,12 +1415,12 @@ BOOL LLPolyMesh::loadOBJ(LLFILE *fp)
values = sscanf (buffer," %255s %f %f %f", keyword, &tempX, &tempY, &tempZ);
if (values != 4)
{
llwarns << "Expecting vn x y z, but found: " << buffer <<llendl;
LL_WARNS() << "Expecting vn x y z, but found: " << buffer <<LL_ENDL;
continue;
}
if (nnormals == nverts)
{
llwarns << "Too many normals. Ignoring from: " << buffer <<llendl;
LL_WARNS() << "Too many normals. Ignoring from: " << buffer <<LL_ENDL;
}
if (nnormals < nverts)
{
@@ -1440,12 +1433,12 @@ BOOL LLPolyMesh::loadOBJ(LLFILE *fp)
values = sscanf (buffer," %255s %f %f", keyword, &tempX, &tempY);
if (values != 3)
{
llwarns << "Expecting vt x y, but found: " << buffer <<llendl;
LL_WARNS() << "Expecting vt x y, but found: " << buffer <<LL_ENDL;
continue;
}
if (ntexcoords == nverts)
{
llwarns << "Too many texture vertices. Ignoring from: " << buffer <<llendl;
LL_WARNS() << "Too many texture vertices. Ignoring from: " << buffer <<LL_ENDL;
}
if (ntexcoords < nverts)
{
@@ -1457,13 +1450,13 @@ BOOL LLPolyMesh::loadOBJ(LLFILE *fp)
{
if (nfaces == 0)
{
llwarns << "Ignoring face keywords for now." <<llendl;
LL_WARNS() << "Ignoring face keywords for now." <<LL_ENDL;
}
nfaces++;
}
else
{
llinfos << "Unrecognized keyword. Ignoring: " << buffer << llendl;
LL_INFOS() << "Unrecognized keyword. Ignoring: " << buffer << LL_ENDL;
}
}
@@ -1625,10 +1618,10 @@ void LLPolyMesh::dumpDiagInfo(void*)
std::string buf;
llinfos << "-----------------------------------------------------" << llendl;
llinfos << " Global PolyMesh Table (DEBUG only)" << llendl;
llinfos << " Verts Faces Mem(KB) Type Name" << llendl;
llinfos << "-----------------------------------------------------" << llendl;
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
LL_INFOS() << " Global PolyMesh Table (DEBUG only)" << LL_ENDL;
LL_INFOS() << " Verts Faces Mem(KB) Name" << LL_ENDL;
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
// print each loaded mesh, and it's memory usage
for(LLPolyMeshSharedDataTable::iterator iter = sGlobalSharedMeshList.begin();
@@ -1649,17 +1642,17 @@ void LLPolyMesh::dumpDiagInfo(void*)
}
buf = llformat("%8d %8d %8d %s %s", num_verts, num_faces, num_kb, type.c_str(), mesh_name.c_str());
llinfos << buf << llendl;
LL_INFOS() << buf << LL_ENDL;
total_verts += num_verts;
total_faces += num_faces;
total_kb += num_kb;
}
llinfos << "-----------------------------------------------------" << llendl;
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
buf = llformat("%8d %8d %8d TOTAL", total_verts, total_faces, total_kb );
llinfos << buf << llendl;
llinfos << "-----------------------------------------------------" << llendl;
LL_INFOS() << buf << LL_ENDL;
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
}
//-----------------------------------------------------------------------------

View File

@@ -36,7 +36,6 @@
#include "llquaternion.h"
#include "llpolymorph.h"
#include "lljoint.h"
#include "lldarray.h"
class LLSkinJoint;
class LLAvatarAppearance;
@@ -343,7 +342,7 @@ public:
void setAvatar(LLAvatarAppearance* avatarp) { mAvatarp = avatarp; }
LLAvatarAppearance* getAvatar() { return mAvatarp; }
LLDynamicArray<LLJointRenderData*> mJointRenderData;
std::vector<LLJointRenderData*> mJointRenderData;
U32 mFaceVertexOffset;
U32 mFaceVertexCount;

View File

@@ -115,7 +115,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
llendianswizzle(&numVertices, sizeof(S32), 1);
if (numRead != 1)
{
llwarns << "Can't read number of morph target vertices" << llendl;
LL_WARNS() << "Can't read number of morph target vertices" << LL_ENDL;
return FALSE;
}
@@ -152,13 +152,13 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
llendianswizzle(&mVertexIndices[v], sizeof(U32), 1);
if (numRead != 1)
{
llwarns << "Can't read morph target vertex number" << llendl;
LL_WARNS() << "Can't read morph target vertex number" << LL_ENDL;
return FALSE;
}
if (mVertexIndices[v] > 10000)
{
llerrs << "Bad morph index: " << mVertexIndices[v] << llendl;
LL_ERRS() << "Bad morph index: " << mVertexIndices[v] << LL_ENDL;
}
@@ -166,7 +166,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
llendianswizzle(&mCoords[v], sizeof(F32), 3);
if (numRead != 3)
{
llwarns << "Can't read morph target vertex coordinates" << llendl;
LL_WARNS() << "Can't read morph target vertex coordinates" << LL_ENDL;
return FALSE;
}
@@ -186,7 +186,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
llendianswizzle(&mNormals[v], sizeof(F32), 3);
if (numRead != 3)
{
llwarns << "Can't read morph target normal" << llendl;
LL_WARNS() << "Can't read morph target normal" << LL_ENDL;
return FALSE;
}
@@ -194,7 +194,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
llendianswizzle(&mBinormals[v], sizeof(F32), 3);
if (numRead != 3)
{
llwarns << "Can't read morph target binormal" << llendl;
LL_WARNS() << "Can't read morph target binormal" << LL_ENDL;
return FALSE;
}
@@ -203,7 +203,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
llendianswizzle(&mTexCoords[v].mV, sizeof(F32), 2);
if (numRead != 2)
{
llwarns << "Can't read morph target uv" << llendl;
LL_WARNS() << "Can't read morph target uv" << LL_ENDL;
return FALSE;
}
@@ -265,7 +265,7 @@ BOOL LLPolyMorphData::saveLLM(LLFILE *fp)
llendianswizzle(&numVertices, sizeof(S32), 1);
if (fwrite(&numVertices, sizeof(S32), 1, fp) != 1)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
numVertices = mNumIndices; // without the swizzle again
@@ -277,35 +277,35 @@ BOOL LLPolyMorphData::saveLLM(LLFILE *fp)
llendianswizzle(&mVertexIndices[v], sizeof(U32), 1);
if (fwrite(&mVertexIndices[v], sizeof(U32), 1, fp) != 1)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
llendianswizzle(&mVertexIndices[v], sizeof(U32), 1);
llendianswizzle(mCoords[v].getF32ptr(), sizeof(F32), 3);
if (fwrite(mCoords[v].getF32ptr(), sizeof(F32), 3, fp) != 3)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
llendianswizzle(mCoords[v].getF32ptr(), sizeof(F32), 3);
llendianswizzle(mNormals[v].getF32ptr(), sizeof(F32), 3);
if (fwrite(mNormals[v].getF32ptr(), sizeof(F32), 3, fp) != 3)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
llendianswizzle(mNormals[v].getF32ptr(), sizeof(F32), 3);
llendianswizzle(mBinormals[v].getF32ptr(), sizeof(F32), 3);
if (fwrite(mBinormals[v].getF32ptr(), sizeof(F32), 3, fp) != 3)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
llendianswizzle(mBinormals[v].getF32ptr(), sizeof(F32), 3);
llendianswizzle(&mTexCoords[v].mV, sizeof(F32), 2);
if (fwrite(&mTexCoords[v].mV, sizeof(F32), 2, fp) != 2)
{
llwarns << "Short write" << llendl;
LL_WARNS() << "Short write" << LL_ENDL;
}
llendianswizzle(&mTexCoords[v].mV, sizeof(F32), 2);
}
@@ -566,7 +566,7 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
if( !node->getFastAttributeString( name_string, mMorphName ) )
{
llwarns << "Avatar file: <param> is missing name attribute" << llendl;
LL_WARNS() << "Avatar file: <param> is missing name attribute" << LL_ENDL;
return FALSE; // Continue, ignoring this tag
}
@@ -577,8 +577,8 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
if (NULL == paramNode)
{
llwarns << "Failed to getChildByName(\"param_morph\")"
<< llendl;
LL_WARNS() << "Failed to getChildByName(\"param_morph\")"
<< LL_ENDL;
return FALSE;
}
@@ -612,10 +612,27 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
// LLPolyMorphTarget()
//-----------------------------------------------------------------------------
LLPolyMorphTarget::LLPolyMorphTarget(LLPolyMesh *poly_mesh)
: mMorphData(NULL), mMesh(poly_mesh),
mVertMask(NULL),
mLastSex(SEX_FEMALE),
mNumMorphMasksPending(0)
: LLViewerVisualParam(),
mMorphData(NULL),
mMesh(poly_mesh),
mVertMask(NULL),
mLastSex(SEX_FEMALE),
mNumMorphMasksPending(0),
mVolumeMorphs()
{
}
//-----------------------------------------------------------------------------
// LLPolyMorphTarget()
//-----------------------------------------------------------------------------
LLPolyMorphTarget::LLPolyMorphTarget(const LLPolyMorphTarget& pOther)
: LLViewerVisualParam(pOther),
mMorphData(pOther.mMorphData),
mMesh(pOther.mMesh),
mVertMask(pOther.mVertMask == NULL ? NULL : new LLPolyVertexMask(*pOther.mVertMask)),
mLastSex(pOther.mLastSex),
mNumMorphMasksPending(pOther.mNumMorphMasksPending),
mVolumeMorphs(pOther.mVolumeMorphs)
{
}
@@ -624,10 +641,8 @@ LLPolyMorphTarget::LLPolyMorphTarget(LLPolyMesh *poly_mesh)
//-----------------------------------------------------------------------------
LLPolyMorphTarget::~LLPolyMorphTarget()
{
if (mVertMask)
{
delete mVertMask;
}
delete mVertMask;
mVertMask = NULL;
}
//-----------------------------------------------------------------------------
@@ -640,7 +655,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
return FALSE;
mInfo = info;
mID = info->mID;
setWeight(getDefaultWeight(), FALSE );
setWeight(getDefaultWeight());
LLAvatarAppearance* avatarp = mMesh->getAvatar();
LLPolyMorphTargetInfo::volume_info_list_t::iterator iter;
@@ -674,7 +689,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
}
if (!mMorphData)
{
llwarns << "No morph target named " << morph_param_name << " found in mesh." << llendl;
LL_WARNS() << "No morph target named " << morph_param_name << " found in mesh." << LL_ENDL;
return FALSE; // Continue, ignoring this tag
}
return TRUE;
@@ -682,9 +697,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
/*virtual*/ LLViewerVisualParam* LLPolyMorphTarget::cloneParam(LLWearable* wearable) const
{
LLPolyMorphTarget *new_param = new LLPolyMorphTarget(mMesh);
*new_param = *this;
return new_param;
return new LLPolyMorphTarget(*this);
}
#if 0 // obsolete
@@ -1019,10 +1032,25 @@ void LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S3
// LLPolyVertexMask()
//-----------------------------------------------------------------------------
LLPolyVertexMask::LLPolyVertexMask(LLPolyMorphData* morph_data)
: mWeights(new F32[morph_data->mNumIndices]),
mMorphData(morph_data),
mWeightsGenerated(FALSE)
{
mWeights = new F32[morph_data->mNumIndices];
mMorphData = morph_data;
mWeightsGenerated = FALSE;
llassert(mMorphData != NULL);
llassert(mMorphData->mNumIndices > 0);
}
//-----------------------------------------------------------------------------
// LLPolyVertexMask()
//-----------------------------------------------------------------------------
LLPolyVertexMask::LLPolyVertexMask(const LLPolyVertexMask& pOther)
: mWeights(new F32[pOther.mMorphData->mNumIndices]),
mMorphData(pOther.mMorphData),
mWeightsGenerated(pOther.mWeightsGenerated)
{
llassert(mMorphData != NULL);
llassert(mMorphData->mNumIndices > 0);
memcpy(mWeights, pOther.mWeights, sizeof(F32) * mMorphData->mNumIndices);
}
//-----------------------------------------------------------------------------
@@ -1030,7 +1058,8 @@ LLPolyVertexMask::LLPolyVertexMask(LLPolyMorphData* morph_data)
//-----------------------------------------------------------------------------
LLPolyVertexMask::~LLPolyVertexMask()
{
delete[] mWeights;
delete [] mWeights;
mWeights = NULL;
}
//-----------------------------------------------------------------------------

View File

@@ -95,6 +95,7 @@ class LLPolyVertexMask
{
public:
LLPolyVertexMask(LLPolyMorphData* morph_data);
LLPolyVertexMask(const LLPolyVertexMask& pOther);
~LLPolyVertexMask();
void generateMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4a *clothing_weights);
@@ -163,16 +164,6 @@ public:
LLPolyMorphTarget(LLPolyMesh *poly_mesh);
~LLPolyMorphTarget();
void* operator new(size_t size)
{
return ll_aligned_malloc_16(size);
}
void operator delete(void* ptr)
{
ll_aligned_free_16(ptr);
}
// Special: These functions are overridden by child classes
LLPolyMorphTargetInfo* getInfo() const { return (LLPolyMorphTargetInfo*)mInfo; }
// This sets mInfo and calls initialization functions
@@ -196,7 +187,19 @@ public:
void applyMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert);
void addPendingMorphMask() { mNumMorphMasksPending++; }
void* operator new(size_t size)
{
return ll_aligned_malloc_16(size);
}
void operator delete(void* ptr)
{
ll_aligned_free_16(ptr);
}
protected:
LLPolyMorphTarget(const LLPolyMorphTarget& pOther);
LLPolyMorphData* mMorphData;
LLPolyMesh* mMesh;
LLPolyVertexMask * mVertMask;

View File

@@ -61,8 +61,8 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
if (NULL == skeletalParam)
{
llwarns << "Failed to getChildByName(\"param_skeleton\")"
<< llendl;
LL_WARNS() << "Failed to getChildByName(\"param_skeleton\")"
<< LL_ENDL;
return FALSE;
}
@@ -78,14 +78,14 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
if (!bone->getFastAttributeString(name_string, name))
{
llwarns << "No bone name specified for skeletal param." << llendl;
LL_WARNS() << "No bone name specified for skeletal param." << LL_ENDL;
continue;
}
static LLStdStringHandle scale_string = LLXmlTree::addAttributeString("scale");
if (!bone->getFastAttributeVector3(scale_string, scale))
{
llwarns << "No scale specified for bone " << name << "." << llendl;
LL_WARNS() << "No scale specified for bone " << name << "." << LL_ENDL;
continue;
}
@@ -99,7 +99,7 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
}
else
{
llwarns << "Unrecognized element " << bone->getName() << " in skeletal distortion" << llendl;
LL_WARNS() << "Unrecognized element " << bone->getName() << " in skeletal distortion" << LL_ENDL;
continue;
}
}
@@ -110,9 +110,25 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
// LLPolySkeletalDistortion()
//-----------------------------------------------------------------------------
LLPolySkeletalDistortion::LLPolySkeletalDistortion(LLAvatarAppearance *avatarp)
: LLViewerVisualParam(),
mDefaultVec(),
mJointScales(),
mJointOffsets(),
mAvatar(avatarp)
{
mDefaultVec.splat(0.001f);
}
//-----------------------------------------------------------------------------
// LLPolySkeletalDistortion()
//-----------------------------------------------------------------------------
LLPolySkeletalDistortion::LLPolySkeletalDistortion(const LLPolySkeletalDistortion &pOther)
: LLViewerVisualParam(pOther),
mDefaultVec(pOther.mDefaultVec),
mJointScales(pOther.mJointScales),
mJointOffsets(pOther.mJointOffsets),
mAvatar(pOther.mAvatar)
{
mAvatar = avatarp;
mDefaultVec.splat(0.001f);
}
//-----------------------------------------------------------------------------
@@ -129,7 +145,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
return FALSE;
mInfo = info;
mID = info->mID;
setWeight(getDefaultWeight(), FALSE );
setWeight(getDefaultWeight());
LLPolySkeletalDistortionInfo::bone_info_list_t::iterator iter;
for (iter = getInfo()->mBoneInfoList.begin(); iter != getInfo()->mBoneInfoList.end(); iter++)
@@ -138,13 +154,13 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
LLJoint* joint = mAvatar->getJoint(bone_info->mBoneName);
if (!joint)
{
llwarns << "Joint " << bone_info->mBoneName << " not found." << llendl;
LL_WARNS() << "Joint " << bone_info->mBoneName << " not found." << LL_ENDL;
continue;
}
if (mJointScales.find(joint) != mJointScales.end())
{
llwarns << "Scale deformation already supplied for joint " << joint->getName() << "." << llendl;
LL_WARNS() << "Scale deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
}
// store it
@@ -167,7 +183,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
{
if (mJointOffsets.find(joint) != mJointOffsets.end())
{
llwarns << "Offset deformation already supplied for joint " << joint->getName() << "." << llendl;
LL_WARNS() << "Offset deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
}
mJointOffsets[joint] = bone_info->mPositionDeformation;
}
@@ -177,9 +193,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
/*virtual*/ LLViewerVisualParam* LLPolySkeletalDistortion::cloneParam(LLWearable* wearable) const
{
LLPolySkeletalDistortion *new_param = new LLPolySkeletalDistortion(mAvatar);
*new_param = *this;
return new_param;
return new LLPolySkeletalDistortion(*this);
}
//-----------------------------------------------------------------------------

View File

@@ -68,6 +68,14 @@ class LLPolySkeletalDistortionInfo : public LLViewerVisualParamInfo
{
friend class LLPolySkeletalDistortion;
public:
LLPolySkeletalDistortionInfo();
/*virtual*/ ~LLPolySkeletalDistortionInfo() {};
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
void* operator new(size_t size)
{
return ll_aligned_malloc_16(size);
@@ -78,10 +86,6 @@ public:
ll_aligned_free_16(ptr);
}
LLPolySkeletalDistortionInfo();
/*virtual*/ ~LLPolySkeletalDistortionInfo() {};
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
protected:
typedef std::vector<LLPolySkeletalBoneInfo> bone_info_list_t;
@@ -129,6 +133,8 @@ public:
/*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return NULL;};
protected:
LLPolySkeletalDistortion(const LLPolySkeletalDistortion& pOther);
LL_ALIGN_16(LLVector4a mDefaultVec);
typedef std::map<LLJoint*, LLVector3> joint_vec_map_t;
joint_vec_map_t mJointScales;

View File

@@ -90,17 +90,31 @@ const std::string& LLTexGlobalColor::getName() const
//-----------------------------------------------------------------------------
// LLTexParamGlobalColor
//-----------------------------------------------------------------------------
LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) :
LLTexLayerParamColor(tex_global_color->getAvatarAppearance()),
LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color)
: LLTexLayerParamColor(tex_global_color->getAvatarAppearance()),
mTexGlobalColor(tex_global_color)
{
}
//-----------------------------------------------------------------------------
// LLTexParamGlobalColor
//-----------------------------------------------------------------------------
LLTexParamGlobalColor::LLTexParamGlobalColor(const LLTexParamGlobalColor& pOther)
: LLTexLayerParamColor(pOther),
mTexGlobalColor(pOther.mTexGlobalColor)
{
}
//-----------------------------------------------------------------------------
// ~LLTexParamGlobalColor
//-----------------------------------------------------------------------------
LLTexParamGlobalColor::~LLTexParamGlobalColor()
{
}
/*virtual*/ LLViewerVisualParam* LLTexParamGlobalColor::cloneParam(LLWearable* wearable) const
{
LLTexParamGlobalColor *new_param = new LLTexParamGlobalColor(mTexGlobalColor);
*new_param = *this;
return new_param;
return new LLTexParamGlobalColor(*this);
}
void LLTexParamGlobalColor::onGlobalColorChanged(bool upload_bake)
@@ -129,7 +143,7 @@ BOOL LLTexGlobalColorInfo::parseXml(LLXmlTreeNode* node)
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
if (!node->getFastAttributeString(name_string, mName))
{
llwarns << "<global_color> element is missing name attribute." << llendl;
LL_WARNS() << "<global_color> element is missing name attribute." << LL_ENDL;
return FALSE;
}
// <param> sub-element

View File

@@ -73,9 +73,11 @@ class LLTexParamGlobalColor : public LLTexLayerParamColor
{
public:
LLTexParamGlobalColor(LLTexGlobalColor *tex_color);
virtual ~LLTexParamGlobalColor();
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const;
protected:
/*virtual*/ void onGlobalColorChanged(bool upload_bake);
LLTexParamGlobalColor(const LLTexParamGlobalColor& pOther);
/*virtual*/ void onGlobalColorChanged(bool upload_bake = false);
private:
LLTexGlobalColor* mTexGlobalColor;
};

View File

@@ -43,6 +43,7 @@
#include "llwearabledata.h"
#include "llvertexbuffer.h"
#include "llviewervisualparam.h"
#include "lllocaltextureobject.h"
//#include "../tools/imdebug/imdebug.h"
@@ -155,7 +156,7 @@ BOOL LLTexLayerSetBuffer::renderTexLayerSet()
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.00f);
}
LLVertexBuffer::unbind();
//LLVertexBuffer::unbind();
// Composite the color data
LLGLSUIDefault gls_ui;
@@ -170,7 +171,7 @@ BOOL LLTexLayerSetBuffer::renderTexLayerSet()
gAlphaMaskProgram.unbind();
}
LLVertexBuffer::unbind();
//LLVertexBuffer::unbind();
// reset GL state
gGL.setColorMask(true, true);
@@ -209,7 +210,7 @@ BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node)
static LLStdStringHandle body_region_string = LLXmlTree::addAttributeString("body_region");
if( !node->getFastAttributeString( body_region_string, mBodyRegion ) )
{
llwarns << "<layer_set> is missing body_region attribute" << llendl;
LL_WARNS() << "<layer_set> is missing body_region attribute" << LL_ENDL;
return FALSE;
}
@@ -737,13 +738,13 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
}
if (mLocalTexture == TEX_NUM_INDICES)
{
llwarns << "<texture> element has invalid local_texture attribute: " << mName << " " << local_texture_name << llendl;
LL_WARNS() << "<texture> element has invalid local_texture attribute: " << mName << " " << local_texture_name << LL_ENDL;
return FALSE;
}
}
else
{
llwarns << "<texture> element is missing a required attribute. " << mName << llendl;
LL_WARNS() << "<texture> element is missing a required attribute. " << mName << LL_ENDL;
return FALSE;
}
}
@@ -806,7 +807,7 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance)
LLTexLayerParamColor* param_color = new LLTexLayerParamColor(appearance);
if (!param_color->setInfo(color_info, TRUE))
{
llwarns << "NULL TexLayer Color Param could not be added to visual param list. Deleting." << llendl;
LL_WARNS() << "NULL TexLayer Color Param could not be added to visual param list. Deleting." << LL_ENDL;
delete param_color;
success = FALSE;
}
@@ -820,7 +821,7 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance)
LLTexLayerParamAlpha* param_alpha = new LLTexLayerParamAlpha(appearance);
if (!param_alpha->setInfo(alpha_info, TRUE))
{
llwarns << "NULL TexLayer Alpha Param could not be added to visual param list. Deleting." << llendl;
LL_WARNS() << "NULL TexLayer Alpha Param could not be added to visual param list. Deleting." << LL_ENDL;
delete param_alpha;
success = FALSE;
}
@@ -853,7 +854,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab
// Not a critical warning, but could be useful for debugging later issues. -Nyx
if (mInfo != NULL)
{
llwarns << "mInfo != NULL" << llendl;
LL_WARNS() << "mInfo != NULL" << LL_ENDL;
}
mInfo = info;
//mID = info->mID; // No ID
@@ -1209,7 +1210,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
}
else
{
llinfos << "lto not defined or image not defined: " << getInfo()->getLocalTexture() << " lto: " << mLocalTextureObject << llendl;
LL_INFOS() << "lto not defined or image not defined: " << getInfo()->getLocalTexture() << " lto: " << mLocalTextureObject << LL_ENDL;
}
// if( mTexLayerSet->getAvatarAppearance()->getLocalTextureGL((ETextureIndex)getInfo()->mLocalTexture, &image_gl ) )
{
@@ -1297,7 +1298,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
if( !success )
{
llinfos << "LLTexLayer::render() partial: " << getInfo()->mName << llendl;
LL_INFOS() << "LLTexLayer::render() partial: " << getInfo()->mName << LL_ENDL;
}
return success;
}
@@ -1434,7 +1435,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
{
if (!force_render && !hasMorph())
{
lldebugs << "skipping renderMorphMasks for " << getUUID() << llendl;
LL_DEBUGS() << "skipping renderMorphMasks for " << getUUID() << LL_ENDL;
return;
}
LLFastTimer t(FTM_RENDER_MORPH_MASKS);
@@ -1475,7 +1476,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
success &= param->render( x, y, width, height );
if (!success && !force_render)
{
lldebugs << "Failed to render param " << param->getID() << " ; skipping morph mask." << llendl;
LL_DEBUGS() << "Failed to render param " << param->getID() << " ; skipping morph mask." << LL_ENDL;
return;
}
}
@@ -1517,8 +1518,8 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
}
else
{
llwarns << "Skipping rendering of " << getInfo()->mStaticImageFileName
<< "; expected 1 or 4 components." << llendl;
LL_WARNS() << "Skipping rendering of " << getInfo()->mStaticImageFileName
<< "; expected 1 or 4 components." << LL_ENDL;
}
}
}
@@ -1556,8 +1557,11 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
}
U32 cache_index = alpha_mask_crc.getCRC();
U8* alpha_data = get_if_there(mAlphaCache,cache_index,(U8*)NULL);
if (!alpha_data)
U8* alpha_data = NULL;//get_if_there(mAlphaCache,cache_index,(U8*)NULL);
// We believe we need to generate morph masks, do not assume that the cached version is accurate.
// We can get bad morph masks during login, on minimize, and occasional gl errors.
// We should only be doing this when we believe something has changed with respect to the user's appearance.
//if (!alpha_data)
{
// clear out a slot if we have filled our cache
S32 max_cache_entries = getTexLayerSet()->getAvatarAppearance()->isSelf() ? 4 : 1;
@@ -1897,18 +1901,18 @@ LLTexLayerStaticImageList::~LLTexLayerStaticImageList()
void LLTexLayerStaticImageList::dumpByteCount() const
{
llinfos << "Avatar Static Textures " <<
LL_INFOS() << "Avatar Static Textures " <<
"KB GL:" << (mGLBytes / 1024) <<
"KB TGA:" << (mTGABytes / 1024) << "KB" << llendl;
"KB TGA:" << (mTGABytes / 1024) << "KB" << LL_ENDL;
}
void LLTexLayerStaticImageList::deleteCachedImages()
{
if( mGLBytes || mTGABytes )
{
llinfos << "Clearing Static Textures " <<
LL_INFOS() << "Clearing Static Textures " <<
"KB GL:" << (mGLBytes / 1024) <<
"KB TGA:" << (mTGABytes / 1024) << "KB" << llendl;
"KB TGA:" << (mTGABytes / 1024) << "KB" << LL_ENDL;
//mStaticImageLists uses LLPointers, clear() will cause deletion

View File

@@ -39,7 +39,8 @@
//-----------------------------------------------------------------------------
// LLTexLayerParam
//-----------------------------------------------------------------------------
LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer) :
LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer)
: LLViewerVisualParam(),
mTexLayer(layer),
mAvatarAppearance(NULL)
{
@@ -49,16 +50,23 @@ LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer) :
}
else
{
llerrs << "LLTexLayerParam constructor passed with NULL reference for layer!" << llendl;
LL_ERRS() << "LLTexLayerParam constructor passed with NULL reference for layer!" << LL_ENDL;
}
}
LLTexLayerParam::LLTexLayerParam(LLAvatarAppearance *appearance) :
LLTexLayerParam::LLTexLayerParam(LLAvatarAppearance *appearance)
: LLViewerVisualParam(),
mTexLayer(NULL),
mAvatarAppearance(appearance)
{
}
LLTexLayerParam::LLTexLayerParam(const LLTexLayerParam& pOther)
: LLViewerVisualParam(pOther),
mTexLayer(pOther.mTexLayer),
mAvatarAppearance(pOther.mAvatarAppearance)
{
}
BOOL LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info, BOOL add_to_appearance)
{
@@ -86,7 +94,7 @@ void LLTexLayerParamAlpha::dumpCacheByteCount()
{
S32 gl_bytes = 0;
getCacheByteCount( &gl_bytes);
llinfos << "Processed Alpha Texture Cache GL:" << (gl_bytes/1024) << "KB" << llendl;
LL_INFOS() << "Processed Alpha Texture Cache GL:" << (gl_bytes/1024) << "KB" << LL_ENDL;
}
// static
@@ -111,9 +119,11 @@ void LLTexLayerParamAlpha::getCacheByteCount(S32* gl_bytes)
}
}
LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer) :
LLTexLayerParam(layer),
LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer)
: LLTexLayerParam(layer),
mCachedProcessedTexture(NULL),
mStaticImageTGA(),
mStaticImageRaw(),
mNeedsCreateTexture(FALSE),
mStaticImageInvalid(FALSE),
mAvgDistortionVec(1.f, 1.f, 1.f),
@@ -122,9 +132,11 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer) :
sInstances.push_front(this);
}
LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance) :
LLTexLayerParam(appearance),
LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance)
: LLTexLayerParam(appearance),
mCachedProcessedTexture(NULL),
mStaticImageTGA(),
mStaticImageRaw(),
mNeedsCreateTexture(FALSE),
mStaticImageInvalid(FALSE),
mAvgDistortionVec(1.f, 1.f, 1.f),
@@ -133,6 +145,18 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance) :
sInstances.push_front(this);
}
LLTexLayerParamAlpha::LLTexLayerParamAlpha(const LLTexLayerParamAlpha& pOther)
: LLTexLayerParam(pOther),
mCachedProcessedTexture(pOther.mCachedProcessedTexture),
mStaticImageTGA(pOther.mStaticImageTGA),
mStaticImageRaw(pOther.mStaticImageRaw),
mNeedsCreateTexture(pOther.mNeedsCreateTexture),
mStaticImageInvalid(pOther.mStaticImageInvalid),
mAvgDistortionVec(pOther.mAvgDistortionVec),
mCachedEffectiveWeight(pOther.mCachedEffectiveWeight)
{
sInstances.push_front(this);
}
LLTexLayerParamAlpha::~LLTexLayerParamAlpha()
{
@@ -142,9 +166,7 @@ LLTexLayerParamAlpha::~LLTexLayerParamAlpha()
/*virtual*/ LLViewerVisualParam* LLTexLayerParamAlpha::cloneParam(LLWearable* wearable) const
{
LLTexLayerParamAlpha *new_param = new LLTexLayerParamAlpha(mTexLayer);
*new_param = *this;
return new_param;
return new LLTexLayerParamAlpha(*this);
}
void LLTexLayerParamAlpha::deleteCaches()
@@ -160,7 +182,7 @@ BOOL LLTexLayerParamAlpha::getMultiplyBlend() const
return ((LLTexLayerParamAlphaInfo *)getInfo())->mMultiplyBlend;
}
void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL upload_bake)
void LLTexLayerParamAlpha::setWeight(F32 weight, bool upload_bake)
{
if (mIsAnimating || mTexLayer == NULL)
{
@@ -184,7 +206,7 @@ void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL upload_bake)
}
}
void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, BOOL upload_bake)
void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, bool upload_bake)
{
// do not animate dummy parameters
if (mIsDummy)
@@ -202,7 +224,7 @@ void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, BOOL upload_bake
}
}
void LLTexLayerParamAlpha::animate(F32 delta, BOOL upload_bake)
void LLTexLayerParamAlpha::animate(F32 delta, bool upload_bake)
{
if (mNext)
{
@@ -278,7 +300,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
if (mStaticImageTGA.isNull())
{
llwarns << "Unable to load static file: " << info->mStaticImageFileName << llendl;
LL_WARNS() << "Unable to load static file: " << info->mStaticImageFileName << LL_ENDL;
mStaticImageInvalid = TRUE; // don't try again.
return FALSE;
}
@@ -309,7 +331,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
mStaticImageRaw = new LLImageRaw;
mStaticImageTGA->decodeAndProcess(mStaticImageRaw, info->mDomain, effective_weight);
mNeedsCreateTexture = TRUE;
lldebugs << "Built Cached Alpha: " << info->mStaticImageFileName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << "Domain: " << info->mDomain << " Weight: " << effective_weight << llendl;
LL_DEBUGS() << "Built Cached Alpha: " << info->mStaticImageFileName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << "Domain: " << info->mDomain << " Weight: " << effective_weight << LL_ENDL;
}
if (mCachedProcessedTexture)
@@ -380,7 +402,7 @@ BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node)
}
// else
// {
// llwarns << "<param_alpha> element is missing tga_file attribute." << llendl;
// LL_WARNS() << "<param_alpha> element is missing tga_file attribute." << LL_ENDL;
// }
static LLStdStringHandle multiply_blend_string = LLXmlTree::addAttributeString("multiply_blend");
@@ -398,27 +420,31 @@ BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node)
LLTexLayerParamColor::LLTexLayerParamColor(LLTexLayerInterface* layer) :
LLTexLayerParam(layer),
LLTexLayerParamColor::LLTexLayerParamColor(LLTexLayerInterface* layer)
: LLTexLayerParam(layer),
mAvgDistortionVec(1.f, 1.f, 1.f)
{
}
LLTexLayerParamColor::LLTexLayerParamColor(LLAvatarAppearance *appearance) :
LLTexLayerParam(appearance),
LLTexLayerParamColor::LLTexLayerParamColor(LLAvatarAppearance *appearance)
: LLTexLayerParam(appearance),
mAvgDistortionVec(1.f, 1.f, 1.f)
{
}
LLTexLayerParamColor::LLTexLayerParamColor(const LLTexLayerParamColor& pOther)
: LLTexLayerParam(pOther),
mAvgDistortionVec(pOther.mAvgDistortionVec)
{
}
LLTexLayerParamColor::~LLTexLayerParamColor()
{
}
/*virtual*/ LLViewerVisualParam* LLTexLayerParamColor::cloneParam(LLWearable* wearable) const
{
LLTexLayerParamColor *new_param = new LLTexLayerParamColor(mTexLayer);
*new_param = *this;
return new_param;
return new LLTexLayerParamColor(*this);
}
LLColor4 LLTexLayerParamColor::getNetColor() const
@@ -449,14 +475,13 @@ LLColor4 LLTexLayerParamColor::getNetColor() const
}
}
void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake)
void LLTexLayerParamColor::setWeight(F32 weight, bool upload_bake)
{
if (mIsAnimating)
{
return;
}
const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)getInfo();
F32 min_weight = getMinWeight();
F32 max_weight = getMaxWeight();
F32 new_weight = llclamp(weight, min_weight, max_weight);
@@ -466,6 +491,8 @@ void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake)
{
mCurWeight = new_weight;
const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)getInfo();
if (info->mNumColors <= 0)
{
// This will happen when we set the default weight the first time.
@@ -481,11 +508,11 @@ void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake)
}
}
// llinfos << "param " << mName << " = " << new_weight << llendl;
// LL_INFOS() << "param " << mName << " = " << new_weight << LL_ENDL;
}
}
void LLTexLayerParamColor::setAnimationTarget(F32 target_value, BOOL upload_bake)
void LLTexLayerParamColor::setAnimationTarget(F32 target_value, bool upload_bake)
{
// set value first then set interpolating flag to ignore further updates
mTargetWeight = target_value;
@@ -497,7 +524,7 @@ void LLTexLayerParamColor::setAnimationTarget(F32 target_value, BOOL upload_bake
}
}
void LLTexLayerParamColor::animate(F32 delta, BOOL upload_bake)
void LLTexLayerParamColor::animate(F32 delta, bool upload_bake)
{
if (mNext)
{
@@ -556,13 +583,13 @@ BOOL LLTexLayerParamColorInfo::parseXml(LLXmlTreeNode *node)
}
if (!mNumColors)
{
llwarns << "<param_color> is missing <value> sub-elements" << llendl;
LL_WARNS() << "<param_color> is missing <value> sub-elements" << LL_ENDL;
return FALSE;
}
if ((mOperation == LLTexLayerParamColor::OP_BLEND) && (mNumColors != 1))
{
llwarns << "<param_color> with operation\"blend\" must have exactly one <value>" << llendl;
LL_WARNS() << "<param_color> with operation\"blend\" must have exactly one <value>" << LL_ENDL;
return FALSE;
}

View File

@@ -52,6 +52,8 @@ public:
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0;
protected:
LLTexLayerParam(const LLTexLayerParam& pOther);
LLTexLayerInterface* mTexLayer;
LLAvatarAppearance* mAvatarAppearance;
};
@@ -83,9 +85,9 @@ public:
// LLVisualParam Virtual functions
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
/*virtual*/ void apply( ESex avatar_sex ) {}
/*virtual*/ void setWeight(F32 weight, BOOL upload_bake);
/*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake);
/*virtual*/ void animate(F32 delta, BOOL upload_bake);
/*virtual*/ void setWeight(F32 weight, bool upload_bake = false);
/*virtual*/ void setAnimationTarget(F32 target_value, bool upload_bake = false);
/*virtual*/ void animate(F32 delta, bool upload_bake = false);
/*virtual*/ char const* getTypeString(void) const { return "param_alpha"; }
// LLViewerVisualParam Virtual functions
@@ -103,6 +105,8 @@ public:
BOOL getMultiplyBlend() const;
private:
LLTexLayerParamAlpha(const LLTexLayerParamAlpha& pOther);
LLPointer<LLGLTexture> mCachedProcessedTexture;
LLPointer<LLImageTGA> mStaticImageTGA;
LLPointer<LLImageRaw> mStaticImageRaw;
@@ -175,9 +179,9 @@ public:
// LLVisualParam Virtual functions
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
/*virtual*/ void apply( ESex avatar_sex ) {}
/*virtual*/ void setWeight(F32 weight, BOOL upload_bake);
/*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake);
/*virtual*/ void animate(F32 delta, BOOL upload_bake);
/*virtual*/ void setWeight(F32 weight, bool upload_bake = false);
/*virtual*/ void setAnimationTarget(F32 target_value, bool upload_bake = false);
/*virtual*/ void animate(F32 delta, bool upload_bake = false);
/*virtual*/ char const* getTypeString(void) const { return "param_color"; }
// LLViewerVisualParam Virtual functions
@@ -191,7 +195,9 @@ public:
// New functions
LLColor4 getNetColor() const;
protected:
virtual void onGlobalColorChanged(bool upload_bake) {}
LLTexLayerParamColor(const LLTexLayerParamColor& pOther);
virtual void onGlobalColorChanged(bool upload_bake = false) {}
private:
LL_ALIGN_16(LLVector4a mAvgDistortionVec);
} LL_ALIGN_POSTFIX(16);

View File

@@ -24,7 +24,6 @@
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "lltexturemanagerbridge.h"
// Define a null texture manager bridge. Applications must provide their own bridge implementaton.

View File

@@ -35,7 +35,8 @@
class LLTextureManagerBridge
{
public:
virtual ~LLTextureManagerBridge(){};
virtual ~LLTextureManagerBridge() {}
virtual LLPointer<LLGLTexture> getLocalTexture(BOOL usemipmaps = TRUE, BOOL generate_gl_tex = TRUE) = 0;
virtual LLPointer<LLGLTexture> getLocalTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps, BOOL generate_gl_tex = TRUE) = 0;
virtual LLGLTexture* getFetchedTexture(const LLUUID &image_id) = 0;

View File

@@ -125,6 +125,22 @@ BOOL LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node)
// LLViewerVisualParam()
//-----------------------------------------------------------------------------
LLViewerVisualParam::LLViewerVisualParam()
: LLVisualParam()
{
}
//-----------------------------------------------------------------------------
// LLViewerVisualParam()
//-----------------------------------------------------------------------------
LLViewerVisualParam::LLViewerVisualParam(const LLViewerVisualParam& pOther)
: LLVisualParam(pOther)
{
}
//-----------------------------------------------------------------------------
// ~LLViewerVisualParam()
//-----------------------------------------------------------------------------
LLViewerVisualParam::~LLViewerVisualParam()
{
}
@@ -139,7 +155,7 @@ BOOL LLViewerVisualParam::setInfo(LLViewerVisualParamInfo *info)
return FALSE;
mInfo = info;
mID = info->mID;
setWeight(getDefaultWeight(), FALSE );
setWeight(getDefaultWeight());
return TRUE;
}

View File

@@ -71,7 +71,7 @@ class LLViewerVisualParam : public LLVisualParam
{
public:
LLViewerVisualParam();
/*virtual*/ ~LLViewerVisualParam(){};
virtual ~LLViewerVisualParam();
// Special: These functions are overridden by child classes
LLViewerVisualParamInfo *getInfo() const { return (LLViewerVisualParamInfo*)mInfo; };
@@ -108,6 +108,8 @@ public:
BOOL getCrossWearable() const { return getInfo()->mCrossWearable; }
protected:
LLViewerVisualParam(const LLViewerVisualParam& pOther);
} LL_ALIGN_POSTFIX(16);
#endif // LL_LLViewerVisualParam_H

View File

@@ -43,15 +43,32 @@ S32 LLWearable::sCurrentDefinitionVersion = 1;
// Private local functions
static std::string terse_F32_to_string(F32 f);
LLWearable::LLWearable() :
mDefinitionVersion(0),
mType(LLWearableType::WT_INVALID)
LLWearable::LLWearable()
: mDefinitionVersion(-1),
mName(),
mDescription(),
mPermissions(),
mSaleInfo(),
mType(LLWearableType::WT_NONE),
mSavedVisualParamMap(),
mVisualParamIndexMap(),
mTEMap(),
mSavedTEMap()
{
}
// virtual
LLWearable::~LLWearable()
{
for (visual_param_index_map_t::iterator vpIter = mVisualParamIndexMap.begin(); vpIter != mVisualParamIndexMap.end(); ++vpIter)
{
LLVisualParam* vp = vpIter->second;
vp->clearNextParam();
delete vp;
vpIter->second = NULL;
}
destroyTextures();
}
const std::string& LLWearable::getTypeLabel() const
@@ -156,7 +173,7 @@ void LLWearable::createVisualParams(LLAvatarAppearance *avatarp)
{
if( !param->linkDrivenParams(boost::bind(param_function,avatarp,_1 ), true))
{
llwarns << "could not link driven params for wearable " << getName() << " id: " << param->getID() << llendl;
LL_WARNS() << "could not link driven params for wearable " << getName() << " id: " << param->getID() << LL_ENDL;
continue;
}
}
@@ -180,7 +197,7 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp)
}
else
{
llerrs << "could not find layerset for LTO in wearable!" << llendl;
LL_ERRS() << "could not find layerset for LTO in wearable!" << LL_ENDL;
}
}
@@ -214,7 +231,7 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
// read header and version
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
{
llwarns << "Failed to read wearable asset input stream." << llendl;
LL_WARNS() << "Failed to read wearable asset input stream." << LL_ENDL;
return LLWearable::FAILURE;
}
if ( 1 != sscanf( /* Flawfinder: ignore */
@@ -232,25 +249,25 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
// these wearables get re-saved with version definition 22.
if( mDefinitionVersion > LLWearable::sCurrentDefinitionVersion && mDefinitionVersion != 24 )
{
llwarns << "Wearable asset has newer version (" << mDefinitionVersion << ") than XML (" << LLWearable::sCurrentDefinitionVersion << ")" << llendl;
LL_WARNS() << "Wearable asset has newer version (" << mDefinitionVersion << ") than XML (" << LLWearable::sCurrentDefinitionVersion << ")" << LL_ENDL;
return LLWearable::FAILURE;
}
// name
if (!input_stream.good())
// name may be empty
if (!input_stream.good())
{
llwarns << "Bad Wearable asset: early end of input stream "
<< "while reading name" << llendl;
LL_WARNS() << "Bad Wearable asset: early end of input stream "
<< "while reading name" << LL_ENDL;
return LLWearable::FAILURE;
}
input_stream.getline(buffer, PARSE_BUFFER_SIZE);
mName = buffer;
// description
// description may be empty
if (!input_stream.good())
{
llwarns << "Bad Wearable asset: early end of input stream "
<< "while reading description" << llendl;
LL_WARNS() << "Bad Wearable asset: early end of input stream "
<< "while reading description" << LL_ENDL;
return LLWearable::FAILURE;
}
input_stream.getline(buffer, PARSE_BUFFER_SIZE);
@@ -259,15 +276,15 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
// permissions may have extra empty lines before the correct line
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
{
llwarns << "Bad Wearable asset: early end of input stream "
<< "while reading permissions" << llendl;
LL_WARNS() << "Bad Wearable asset: early end of input stream "
<< "while reading permissions" << LL_ENDL;
return LLWearable::FAILURE;
}
S32 perm_version = -1;
if ( 1 != sscanf( buffer, " permissions %d\n", &perm_version ) ||
perm_version != 0 )
{
llwarns << "Bad Wearable asset: missing valid permissions" << llendl;
LL_WARNS() << "Bad Wearable asset: missing valid permissions" << LL_ENDL;
return LLWearable::FAILURE;
}
if( !mPermissions.importStream( input_stream ) )
@@ -278,15 +295,15 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
// sale info
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
{
llwarns << "Bad Wearable asset: early end of input stream "
<< "while reading sale info" << llendl;
LL_WARNS() << "Bad Wearable asset: early end of input stream "
<< "while reading sale info" << LL_ENDL;
return LLWearable::FAILURE;
}
S32 sale_info_version = -1;
if ( 1 != sscanf( buffer, " sale_info %d\n", &sale_info_version ) ||
sale_info_version != 0 )
{
llwarns << "Bad Wearable asset: missing valid sale_info" << llendl;
LL_WARNS() << "Bad Wearable asset: missing valid sale_info" << LL_ENDL;
return LLWearable::FAILURE;
}
// Sale info used to contain next owner perm. It is now in the
@@ -312,14 +329,14 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
// wearable type
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
{
llwarns << "Bad Wearable asset: early end of input stream "
<< "while reading type" << llendl;
LL_WARNS() << "Bad Wearable asset: early end of input stream "
<< "while reading type" << LL_ENDL;
return LLWearable::FAILURE;
}
S32 type = -1;
if ( 1 != sscanf( buffer, "type %d\n", &type ) )
{
llwarns << "Bad Wearable asset: bad type" << llendl;
LL_WARNS() << "Bad Wearable asset: bad type" << LL_ENDL;
return LLWearable::FAILURE;
}
if( 0 <= type && type < LLWearableType::WT_COUNT )
@@ -329,36 +346,36 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
else
{
mType = LLWearableType::WT_COUNT;
llwarns << "Bad Wearable asset: bad type #" << type << llendl;
LL_WARNS() << "Bad Wearable asset: bad type #" << type << LL_ENDL;
return LLWearable::FAILURE;
}
// parameters header
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
{
llwarns << "Bad Wearable asset: early end of input stream "
<< "while reading parameters header" << llendl;
LL_WARNS() << "Bad Wearable asset: early end of input stream "
<< "while reading parameters header" << LL_ENDL;
return LLWearable::FAILURE;
}
S32 num_parameters = -1;
if ( 1 != sscanf( buffer, "parameters %d\n", &num_parameters ) )
{
llwarns << "Bad Wearable asset: missing parameters block" << llendl;
LL_WARNS() << "Bad Wearable asset: missing parameters block" << LL_ENDL;
return LLWearable::FAILURE;
}
if ( num_parameters > MAX_WEARABLE_ASSET_PARAMETERS )
{
llwarns << "Bad Wearable asset: too many parameters, "
<< num_parameters << llendl;
LL_WARNS() << "Bad Wearable asset: too many parameters, "
<< num_parameters << LL_ENDL;
return LLWearable::FAILURE;
}
if( num_parameters != mVisualParamIndexMap.size() )
{
llwarns << "Wearable parameter mismatch. Reading in "
LL_WARNS() << "Wearable parameter mismatch. Reading in "
<< num_parameters << " from file, but created "
<< mVisualParamIndexMap.size()
<< " from avatar parameters. type: "
<< getType() << llendl;
<< getType() << LL_ENDL;
}
// parameters
@@ -367,15 +384,15 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
{
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
{
llwarns << "Bad Wearable asset: early end of input stream "
<< "while reading parameter #" << i << llendl;
LL_WARNS() << "Bad Wearable asset: early end of input stream "
<< "while reading parameter #" << i << LL_ENDL;
return LLWearable::FAILURE;
}
S32 param_id = 0;
F32 param_weight = 0.f;
if ( 2 != sscanf( buffer, "%d %f\n", &param_id, &param_weight ) )
{
llwarns << "Bad Wearable asset: bad parameter, #" << i << llendl;
LL_WARNS() << "Bad Wearable asset: bad parameter, #" << i << LL_ENDL;
return LLWearable::FAILURE;
}
mSavedVisualParamMap[param_id] = param_weight;
@@ -384,20 +401,20 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
// textures header
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
{
llwarns << "Bad Wearable asset: early end of input stream "
<< "while reading textures header" << i << llendl;
LL_WARNS() << "Bad Wearable asset: early end of input stream "
<< "while reading textures header" << i << LL_ENDL;
return LLWearable::FAILURE;
}
S32 num_textures = -1;
if ( 1 != sscanf( buffer, "textures %d\n", &num_textures) )
{
llwarns << "Bad Wearable asset: missing textures block" << llendl;
LL_WARNS() << "Bad Wearable asset: missing textures block" << LL_ENDL;
return LLWearable::FAILURE;
}
if ( num_textures > MAX_WEARABLE_ASSET_TEXTURES )
{
llwarns << "Bad Wearable asset: too many textures, "
<< num_textures << llendl;
LL_WARNS() << "Bad Wearable asset: too many textures, "
<< num_textures << LL_ENDL;
return LLWearable::FAILURE;
}
@@ -406,8 +423,8 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
{
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
{
llwarns << "Bad Wearable asset: early end of input stream "
<< "while reading textures #" << i << llendl;
LL_WARNS() << "Bad Wearable asset: early end of input stream "
<< "while reading textures #" << i << LL_ENDL;
return LLWearable::FAILURE;
}
S32 te = 0;
@@ -416,14 +433,14 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
"%d %36s\n",
&te, uuid_buffer) )
{
llwarns << "Bad Wearable asset: bad texture, #" << i << llendl;
LL_WARNS() << "Bad Wearable asset: bad texture, #" << i << LL_ENDL;
return LLWearable::FAILURE;
}
if( !LLUUID::validate( uuid_buffer ) )
{
llwarns << "Bad Wearable asset: bad texture uuid: "
<< uuid_buffer << llendl;
LL_WARNS() << "Bad Wearable asset: bad texture uuid: "
<< uuid_buffer << LL_ENDL;
return LLWearable::FAILURE;
}
LLUUID id = LLUUID(uuid_buffer);
@@ -626,17 +643,10 @@ void LLWearable::syncImages(te_map_t &src, te_map_t &dst)
void LLWearable::destroyTextures()
{
for( te_map_t::iterator iter = mTEMap.begin(); iter != mTEMap.end(); ++iter )
{
LLLocalTextureObject *lto = iter->second;
delete lto;
}
std::for_each(mTEMap.begin(), mTEMap.end(), DeletePairedPointer());
mTEMap.clear();
for( te_map_t::iterator iter = mSavedTEMap.begin(); iter != mSavedTEMap.end(); ++iter )
{
LLLocalTextureObject *lto = iter->second;
delete lto;
}
std::for_each(mSavedTEMap.begin(), mSavedTEMap.end(), DeletePairedPointer());
mSavedTEMap.clear();
}
@@ -653,7 +663,7 @@ void LLWearable::addVisualParam(LLVisualParam *param)
}
void LLWearable::setVisualParamWeight(S32 param_index, F32 value, BOOL upload_bake)
void LLWearable::setVisualParamWeight(S32 param_index, F32 value, bool upload_bake)
{
if( is_in_map(mVisualParamIndexMap, param_index ) )
{
@@ -662,7 +672,7 @@ void LLWearable::setVisualParamWeight(S32 param_index, F32 value, BOOL upload_ba
}
else
{
llerrs << "LLWearable::setVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << llendl;
LL_ERRS() << "LLWearable::setVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL;
}
}
@@ -675,7 +685,7 @@ F32 LLWearable::getVisualParamWeight(S32 param_index) const
}
else
{
llwarns << "LLWerable::getVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << llendl;
LL_WARNS() << "LLWerable::getVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL;
}
return (F32)-1.0;
}
@@ -700,7 +710,7 @@ void LLWearable::getVisualParams(visual_param_vec_t &list)
}
}
void LLWearable::animateParams(F32 delta, BOOL upload_bake)
void LLWearable::animateParams(F32 delta, bool upload_bake)
{
for(visual_param_index_map_t::iterator iter = mVisualParamIndexMap.begin();
iter != mVisualParamIndexMap.end();
@@ -725,7 +735,7 @@ LLColor4 LLWearable::getClothesColor(S32 te) const
return color;
}
void LLWearable::setClothesColor( S32 te, const LLColor4& new_color, BOOL upload_bake )
void LLWearable::setClothesColor( S32 te, const LLColor4& new_color, bool upload_bake )
{
U32 param_name[3];
if( LLAvatarAppearance::teToColorParams( (LLAvatarAppearanceDefines::ETextureIndex)te, param_name ) )

View File

@@ -28,20 +28,17 @@
#define LL_LLWEARABLE_H
#include "llavatarappearancedefines.h"
#include "llextendedstatus.h"
#include "llpermissions.h"
#include "llsaleinfo.h"
#include "llsortedvector.h"
#include "llwearabletype.h"
#include "lllocaltextureobject.h"
class LLAPRFile;
class LLMD5;
class LLVisualParam;
class LLTexGlobalColorInfo;
class LLTexGlobalColor;
class LLLocalTextureObject;
class LLAvatarAppearance;
class AIArchetype;
// Abstract class.
class LLWearable
@@ -99,14 +96,14 @@ public:
void setLocalTextureObject(S32 index, LLLocalTextureObject &lto);
void addVisualParam(LLVisualParam *param);
void setVisualParamWeight(S32 index, F32 value, BOOL upload_bake);
void setVisualParamWeight(S32 index, F32 value, bool upload_bake = false);
F32 getVisualParamWeight(S32 index) const;
LLVisualParam* getVisualParam(S32 index) const;
void getVisualParams(visual_param_vec_t &list);
void animateParams(F32 delta, BOOL upload_bake);
void animateParams(F32 delta, bool upload_bake = false);
LLColor4 getClothesColor(S32 te) const;
void setClothesColor( S32 te, const LLColor4& new_color, BOOL upload_bake );
void setClothesColor( S32 te, const LLColor4& new_color, bool upload_bake = false);
virtual void revertValues();
virtual void saveValues();
@@ -117,6 +114,9 @@ public:
// Update the baked texture hash.
virtual void addToBakedTextureHash(LLMD5& hash) const = 0;
typedef LLSortedVector<S32, LLVisualParam *> visual_param_index_map_t;
visual_param_index_map_t mVisualParamIndexMap;
protected:
typedef std::map<S32, LLLocalTextureObject*> te_map_t;
void syncImages(te_map_t &src, te_map_t &dst);
@@ -136,9 +136,6 @@ protected:
typedef std::map<S32, F32> param_map_t;
param_map_t mSavedVisualParamMap; // last saved version of visual params
typedef LLSortedVector<S32, LLVisualParam *> visual_param_index_map_t;
visual_param_index_map_t mVisualParamIndexMap;
te_map_t mTEMap; // maps TE to LocalTextureObject
te_map_t mSavedTEMap; // last saved version of TEMap
};

View File

@@ -73,17 +73,17 @@ void LLWearableData::setWearable(const LLWearableType::EType type, U32 index, LL
pushWearable(type,wearable);
return;
}
wearableentry_map_t::iterator wearable_iter = mWearableDatas.find(type);
if (wearable_iter == mWearableDatas.end())
{
llwarns << "invalid type, type " << type << " index " << index << llendl;
LL_WARNS() << "invalid type, type " << type << " index " << index << LL_ENDL;
return;
}
wearableentry_vec_t& wearable_vec = wearable_iter->second;
if (index>=wearable_vec.size())
{
llwarns << "invalid index, type " << type << " index " << index << llendl;
LL_WARNS() << "invalid index, type " << type << " index " << index << LL_ENDL;
}
else
{
@@ -101,7 +101,7 @@ U32 LLWearableData::pushWearable(const LLWearableType::EType type,
if (wearable == NULL)
{
// no null wearables please!
llwarns << "Null wearable sent for type " << type << llendl;
LL_WARNS() << "Null wearable sent for type " << type << LL_ENDL;
return MAX_CLOTHING_PER_TYPE;
}
// [RLVa:KB] - Checked: 2010-06-08 (RLVa-1.2.0g) | Added: RLVa-1.2.0g
@@ -140,13 +140,6 @@ U32 LLWearableData::pushWearable(const LLWearableType::EType type,
void LLWearableData::wearableUpdated(LLWearable *wearable, BOOL removed)
{
wearable->setUpdated();
// FIXME DRANO avoid updating params via wearables when rendering server-baked appearance.
#if 0
if (mAvatarAppearance->isUsingServerBakes() && !mAvatarAppearance->isUsingLocalAppearance())
{
return;
}
#endif
if (!removed)
{
pullCrossWearableValues(wearable->getType());
@@ -243,7 +236,7 @@ U32 LLWearableData::getWearableIndex(const LLWearable *wearable) const
wearableentry_map_t::const_iterator wearable_iter = mWearableDatas.find(type);
if (wearable_iter == mWearableDatas.end())
{
llwarns << "tried to get wearable index with an invalid type!" << llendl;
LL_WARNS() << "tried to get wearable index with an invalid type!" << LL_ENDL;
return MAX_CLOTHING_PER_TYPE;
}
const wearableentry_vec_t& wearable_vec = wearable_iter->second;

View File

@@ -27,6 +27,7 @@
#include "linden_common.h"
#include "llwearabletype.h"
#include "llinventorytype.h"
#include "llinventorydefines.h"
static LLTranslationBridge* sTrans = NULL;
@@ -180,3 +181,9 @@ BOOL LLWearableType::getAllowMultiwear(LLWearableType::EType type)
return entry->mAllowMultiwear;
}
// static
LLWearableType::EType LLWearableType::inventoryFlagsToWearableType(U32 flags)
{
return (LLWearableType::EType)(flags & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK);
}

View File

@@ -35,7 +35,9 @@
class LLTranslationBridge
{
public:
virtual ~LLTranslationBridge(){};
// clang needs this to be happy
virtual ~LLTranslationBridge() {}
virtual std::string getString(const std::string &xml_desc) = 0;
};
@@ -81,6 +83,7 @@ public:
static LLInventoryType::EIconName getIconName(EType type);
static BOOL getDisableCameraSwitch(EType type);
static BOOL getAllowMultiwear(EType type);
static EType inventoryFlagsToWearableType(U32 flags);
protected:
LLWearableType() {}

View File

@@ -142,7 +142,7 @@ int vfs_seek(void *datasource, ogg_int64_t offset, int whence)
origin = -1;
break;
default:
llerrs << "Invalid whence argument to vfs_seek" << llendl;
LL_ERRS() << "Invalid whence argument to vfs_seek" << LL_ENDL;
return -1;
}
@@ -196,12 +196,12 @@ BOOL LLVorbisDecodeState::initDecode()
vfs_callbacks.close_func = vfs_close;
vfs_callbacks.tell_func = vfs_tell;
//llinfos << "Initing decode from vfile: " << mUUID << llendl;
//LL_INFOS() << "Initing decode from vfile: " << mUUID << LL_ENDL;
mInFilep = new LLVFile(gVFS, mUUID, LLAssetType::AT_SOUND);
if (!mInFilep || !mInFilep->getSize())
{
llwarns << "unable to open vorbis source vfile for reading" << llendl;
LL_WARNS() << "unable to open vorbis source vfile for reading" << LL_ENDL;
delete mInFilep;
mInFilep = NULL;
return FALSE;
@@ -210,7 +210,7 @@ BOOL LLVorbisDecodeState::initDecode()
int r = ov_open_callbacks(mInFilep, &mVF, NULL, 0, vfs_callbacks);
if(r < 0)
{
llwarns << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << mUUID << llendl;
LL_WARNS() << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << mUUID << LL_ENDL;
return(FALSE);
}
@@ -228,20 +228,20 @@ BOOL LLVorbisDecodeState::initDecode()
if( vi->channels < 1 || vi->channels > LLVORBIS_CLIP_MAX_CHANNELS )
{
abort_decode = true;
llwarns << "Bad channel count: " << vi->channels << llendl;
LL_WARNS() << "Bad channel count: " << vi->channels << LL_ENDL;
}
}
else // !vi
{
abort_decode = true;
llwarns << "No default bitstream found" << llendl;
LL_WARNS() << "No default bitstream found" << LL_ENDL;
}
// <edit>
// This magic value is equivalent to 150MiB of data.
// Prevents griefers from utilizing a huge xbox sound the size of god to instafry the viewer
if(size_guess >= 157286400)
{
llwarns << "Bad sound caught by zmagic" << llendl;
LL_WARNS() << "Bad sound caught by zmagic" << LL_ENDL;
abort_decode = true;
}
else if(!gAudiop->getAllowLargeSounds())
@@ -252,25 +252,25 @@ BOOL LLVorbisDecodeState::initDecode()
(size_t)sample_count <= 0)
{
abort_decode = true;
llwarns << "Illegal sample count: " << sample_count << llendl;
LL_WARNS() << "Illegal sample count: " << sample_count << LL_ENDL;
}
if( size_guess > LLVORBIS_CLIP_REJECT_SIZE ||
size_guess < 0)
{
abort_decode = true;
llwarns << "Illegal sample size: " << size_guess << llendl;
LL_WARNS() << "Illegal sample size: " << size_guess << LL_ENDL;
}
// <edit>
}
// </edit>
if( abort_decode )
{
llwarns << "Canceling initDecode. Bad asset: " << mUUID << llendl;
LL_WARNS() << "Canceling initDecode. Bad asset: " << mUUID << LL_ENDL;
vorbis_comment* comment = ov_comment(&mVF,-1);
if (comment && comment->vendor)
{
llwarns << "Bad asset encoded by: " << comment->vendor << llendl;
LL_WARNS() << "Bad asset encoded by: " << comment->vendor << LL_ENDL;
}
delete mInFilep;
mInFilep = NULL;
@@ -287,7 +287,7 @@ BOOL LLVorbisDecodeState::initDecode()
}
catch(std::bad_alloc)
{
llwarns << "bad_alloc" << llendl;
LL_WARNS() << "bad_alloc" << LL_ENDL;
if(mInFilep)
{
delete mInFilep;
@@ -388,12 +388,12 @@ BOOL LLVorbisDecodeState::decodeSection()
{
if (!mInFilep)
{
llwarns << "No VFS file to decode in vorbis!" << llendl;
LL_WARNS() << "No VFS file to decode in vorbis!" << LL_ENDL;
return TRUE;
}
if (mDone)
{
// llwarns << "Already done with decode, aborting!" << llendl;
// LL_WARNS() << "Already done with decode, aborting!" << LL_ENDL;
return TRUE;
}
char pcmout[4096]; /*Flawfinder: ignore*/
@@ -406,14 +406,14 @@ BOOL LLVorbisDecodeState::decodeSection()
eof = TRUE;
mDone = TRUE;
mValid = TRUE;
// llinfos << "Vorbis EOF" << llendl;
// LL_INFOS() << "Vorbis EOF" << LL_ENDL;
}
else if (ret < 0)
{
/* error in the stream. Not a problem, just reporting it in
case we (the app) cares. In this case, we don't. */
llwarns << "BAD vorbis decode in decodeSection." << llendl;
LL_WARNS() << "BAD vorbis decode in decodeSection." << LL_ENDL;
mValid = FALSE;
mDone = TRUE;
@@ -422,7 +422,7 @@ BOOL LLVorbisDecodeState::decodeSection()
}
else
{
// llinfos << "Vorbis read " << ret << "bytes" << llendl;
// LL_INFOS() << "Vorbis read " << ret << "bytes" << LL_ENDL;
/* we don't bother dealing with sample rate changes, etc, but.
you'll have to*/
std::copy(pcmout, pcmout+ret, std::back_inserter(mWAVBuffer));
@@ -434,7 +434,7 @@ BOOL LLVorbisDecodeState::finishDecode()
{
if (!isValid())
{
llwarns << "Bogus vorbis decode state for " << getUUID() << ", aborting!" << llendl;
LL_WARNS() << "Bogus vorbis decode state for " << getUUID() << ", aborting!" << LL_ENDL;
return TRUE; // We've finished
}
@@ -515,7 +515,7 @@ BOOL LLVorbisDecodeState::finishDecode()
if (36 == data_length)
{
llwarns << "BAD Vorbis decode in finishDecode!" << llendl;
LL_WARNS() << "BAD Vorbis decode in finishDecode!" << LL_ENDL;
mValid = FALSE;
return TRUE; // we've finished
}
@@ -532,7 +532,7 @@ BOOL LLVorbisDecodeState::finishDecode()
{
if (mBytesRead == 0)
{
llwarns << "Unable to write file in LLVorbisDecodeState::finishDecode" << llendl;
LL_WARNS() << "Unable to write file in LLVorbisDecodeState::finishDecode" << LL_ENDL;
mValid = FALSE;
return TRUE; // we've finished
}
@@ -550,7 +550,7 @@ BOOL LLVorbisDecodeState::finishDecode()
LLVFile output(gVFS, mUUID, LLAssetType::AT_SOUND_WAV);
output.write(&mWAVBuffer[0], mWAVBuffer.size());
#endif
//llinfos << "Finished decode for " << getUUID() << llendl;
//LL_INFOS() << "Finished decode for " << getUUID() << LL_ENDL;
return TRUE;
}
@@ -559,7 +559,7 @@ void LLVorbisDecodeState::flushBadFile()
{
if (mInFilep)
{
llwarns << "Flushing bad vorbis file from VFS for " << mUUID << llendl;
LL_WARNS() << "Flushing bad vorbis file from VFS for " << mUUID << LL_ENDL;
mInFilep->remove();
}
}
@@ -603,12 +603,12 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
{
// decodeSection does all of the work above
}
/* <edit> */ }catch(std::bad_alloc){llerrs<<"bad_alloc whilst decoding"<<llendl;} /* </edit> */
/* <edit> */ }catch(std::bad_alloc){LL_ERRS() << "bad_alloc whilst decoding" << LL_ENDL;} /* </edit> */
if (mCurrentDecodep->isDone() && !mCurrentDecodep->isValid())
{
// We had an error when decoding, abort.
llwarns << mCurrentDecodep->getUUID() << " has invalid vorbis data, aborting decode" << llendl;
LL_WARNS() << mCurrentDecodep->getUUID() << " has invalid vorbis data, aborting decode" << LL_ENDL;
mCurrentDecodep->flushBadFile();
LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
if(adp)
@@ -632,7 +632,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
if (!adp)
{
llwarns << "Missing LLAudioData for decode of " << mCurrentDecodep->getUUID() << llendl;
LL_WARNS() << "Missing LLAudioData for decode of " << mCurrentDecodep->getUUID() << LL_ENDL;
}
else if (mCurrentDecodep->isValid() && mCurrentDecodep->isDone())
{
@@ -640,12 +640,12 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
// At this point, we could see if anyone needs this sound immediately, but
// I'm not sure that there's a reason to - we need to poll all of the playing
// sounds anyway.
//llinfos << "Finished the vorbis decode, now what?" << llendl;
//LL_INFOS() << "Finished the vorbis decode, now what?" << LL_ENDL;
}
else
{
adp->setLoadState(LLAudioData::STATE_LOAD_ERROR);
llinfos << "Vorbis decode failed for " << mCurrentDecodep->getUUID() << llendl;
LL_INFOS() << "Vorbis decode failed for " << mCurrentDecodep->getUUID() << LL_ENDL;
}
mCurrentDecodep = NULL;
}
@@ -670,7 +670,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
continue;
}
lldebugs << "Decoding " << uuid << " from audio queue!" << llendl;
LL_DEBUGS() << "Decoding " << uuid << " from audio queue!" << LL_ENDL;
std::string uuid_str;
std::string d_path;

View File

@@ -65,33 +65,33 @@ bool LLAudioEngine_OpenAL::init(const S32 num_channels, void* userdata)
if(!alutInit(NULL, NULL))
{
llwarns << "LLAudioEngine_OpenAL::init() ALUT initialization failed: " << alutGetErrorString (alutGetError ()) << llendl;
LL_WARNS() << "LLAudioEngine_OpenAL::init() ALUT initialization failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL;
return false;
}
llinfos << "LLAudioEngine_OpenAL::init() OpenAL successfully initialized" << llendl;
LL_INFOS() << "LLAudioEngine_OpenAL::init() OpenAL successfully initialized" << LL_ENDL;
llinfos << "OpenAL version: "
<< ll_safe_string(alGetString(AL_VERSION)) << llendl;
llinfos << "OpenAL vendor: "
<< ll_safe_string(alGetString(AL_VENDOR)) << llendl;
llinfos << "OpenAL renderer: "
<< ll_safe_string(alGetString(AL_RENDERER)) << llendl;
LL_INFOS() << "OpenAL version: "
<< ll_safe_string(alGetString(AL_VERSION)) << LL_ENDL;
LL_INFOS() << "OpenAL vendor: "
<< ll_safe_string(alGetString(AL_VENDOR)) << LL_ENDL;
LL_INFOS() << "OpenAL renderer: "
<< ll_safe_string(alGetString(AL_RENDERER)) << LL_ENDL;
ALint major = alutGetMajorVersion ();
ALint minor = alutGetMinorVersion ();
llinfos << "ALUT version: " << major << "." << minor << llendl;
LL_INFOS() << "ALUT version: " << major << "." << minor << LL_ENDL;
ALCdevice *device = alcGetContextsDevice(alcGetCurrentContext());
alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &major);
alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &minor);
llinfos << "ALC version: " << major << "." << minor << llendl;
LL_INFOS() << "ALC version: " << major << "." << minor << LL_ENDL;
llinfos << "ALC default device: "
LL_INFOS() << "ALC default device: "
<< ll_safe_string(alcGetString(device,
ALC_DEFAULT_DEVICE_SPECIFIER))
<< llendl;
<< LL_ENDL;
return true;
}
@@ -131,24 +131,24 @@ void LLAudioEngine_OpenAL::allocateListener()
mListenerp = (LLListener *) new LLListener_OpenAL();
if(!mListenerp)
{
llwarns << "LLAudioEngine_OpenAL::allocateListener() Listener creation failed" << llendl;
LL_WARNS() << "LLAudioEngine_OpenAL::allocateListener() Listener creation failed" << LL_ENDL;
}
}
// virtual
void LLAudioEngine_OpenAL::shutdown()
{
llinfos << "About to LLAudioEngine::shutdown()" << llendl;
LL_INFOS() << "About to LLAudioEngine::shutdown()" << LL_ENDL;
LLAudioEngine::shutdown();
llinfos << "About to alutExit()" << llendl;
LL_INFOS() << "About to alutExit()" << LL_ENDL;
if(!alutExit())
{
llwarns << "Nuts." << llendl;
llwarns << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << llendl;
LL_WARNS() << "Nuts." << LL_ENDL;
LL_WARNS() << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL;
}
llinfos << "LLAudioEngine_OpenAL::shutdown() OpenAL successfully shut down" << llendl;
LL_INFOS() << "LLAudioEngine_OpenAL::shutdown() OpenAL successfully shut down" << LL_ENDL;
delete mListenerp;
mListenerp = NULL;
@@ -166,7 +166,7 @@ LLAudioChannel *LLAudioEngine_OpenAL::createChannel()
void LLAudioEngine_OpenAL::setInternalGain(F32 gain)
{
//llinfos << "LLAudioEngine_OpenAL::setInternalGain() Gain: " << gain << llendl;
//LL_INFOS() << "LLAudioEngine_OpenAL::setInternalGain() Gain: " << gain << LL_ENDL;
alListenerf(AL_GAIN, gain);
}
@@ -196,7 +196,7 @@ void LLAudioChannelOpenAL::play()
{
if (mALSource == AL_NONE)
{
llwarns << "Playing without a mALSource, aborting" << llendl;
LL_WARNS() << "Playing without a mALSource, aborting" << LL_ENDL;
return;
}
@@ -223,8 +223,8 @@ void LLAudioChannelOpenAL::playSynced(LLAudioChannel *channelp)
alGetSourcef(masterchannelp->mALSource, AL_SEC_OFFSET,
&master_offset);
llinfos << "Syncing with master at " << master_offset
<< "sec" << llendl;
LL_INFOS() << "Syncing with master at " << master_offset
<< "sec" << LL_ENDL;
// *TODO: detect when this fails, maybe use AL_SAMPLE_
alSourcef(mALSource, AL_SEC_OFFSET, master_offset);
}
@@ -351,18 +351,18 @@ bool LLAudioBufferOpenAL::loadWAV(const std::string& filename)
ALenum error = alutGetError();
if (gDirUtilp->fileExists(filename))
{
llwarns <<
LL_WARNS() <<
"LLAudioBufferOpenAL::loadWAV() Error loading "
<< filename
<< " " << alutGetErrorString(error) << llendl;
<< " " << alutGetErrorString(error) << LL_ENDL;
}
else
{
// It's common for the file to not actually exist.
lldebugs <<
LL_DEBUGS() <<
"LLAudioBufferOpenAL::loadWAV() Error loading "
<< filename
<< " " << alutGetErrorString(error) << llendl;
<< " " << alutGetErrorString(error) << LL_ENDL;
}
return false;
}
@@ -386,7 +386,7 @@ U32 LLAudioBufferOpenAL::getLength()
bool LLAudioEngine_OpenAL::initWind()
{
ALenum error;
llinfos << "LLAudioEngine_OpenAL::initWind() start" << llendl;
LL_INFOS() << "LLAudioEngine_OpenAL::initWind() start" << LL_ENDL;
mNumEmptyWindALBuffers = MAX_NUM_WIND_BUFFERS;
@@ -396,7 +396,7 @@ bool LLAudioEngine_OpenAL::initWind()
if((error=alGetError()) != AL_NO_ERROR)
{
llwarns << "LLAudioEngine_OpenAL::initWind() Error creating wind sources: "<<error<<llendl;
LL_WARNS() << "LLAudioEngine_OpenAL::initWind() Error creating wind sources: "<<error<<LL_ENDL;
}
mWindGen = new LLWindGen<WIND_SAMPLE_T>;
@@ -409,18 +409,18 @@ bool LLAudioEngine_OpenAL::initWind()
if(mWindBuf==NULL)
{
llerrs << "LLAudioEngine_OpenAL::initWind() Error creating wind memory buffer" << llendl;
LL_ERRS() << "LLAudioEngine_OpenAL::initWind() Error creating wind memory buffer" << LL_ENDL;
return false;
}
llinfos << "LLAudioEngine_OpenAL::initWind() done" << llendl;
LL_INFOS() << "LLAudioEngine_OpenAL::initWind() done" << LL_ENDL;
return true;
}
void LLAudioEngine_OpenAL::cleanupWind()
{
llinfos << "LLAudioEngine_OpenAL::cleanupWind()" << llendl;
LL_INFOS() << "LLAudioEngine_OpenAL::cleanupWind()" << LL_ENDL;
if (mWindSource != AL_NONE)
{
@@ -497,7 +497,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
mNumEmptyWindALBuffers = llmin(mNumEmptyWindALBuffers + processed * 3 - unprocessed, MAX_NUM_WIND_BUFFERS-unprocessed);
mNumEmptyWindALBuffers = llmax(mNumEmptyWindALBuffers, 0);
//llinfos << "mNumEmptyWindALBuffers: " << mNumEmptyWindALBuffers <<" (" << unprocessed << ":" << processed << ")" << llendl;
//LL_INFOS() << "mNumEmptyWindALBuffers: " << mNumEmptyWindALBuffers <<" (" << unprocessed << ":" << processed << ")" << LL_ENDL;
//delete the old wind buffers
buffers = new ALuint[processed];
@@ -506,7 +506,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
error = alGetError();
if(error != AL_NO_ERROR)
{
llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (unqueuing) buffers" << llendl;
LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() error swapping (unqueuing) buffers" << LL_ENDL;
}
else
{
@@ -523,7 +523,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
alGenBuffers(mNumEmptyWindALBuffers,&buffers[0]);
if((error=alGetError()) != AL_NO_ERROR)
{
llwarns << "LLAudioEngine_OpenAL::updateWind() Error creating wind buffer: " << error << llendl;
LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() Error creating wind buffer: " << error << LL_ENDL;
//break;
}
@@ -540,7 +540,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
error = alGetError();
if(error != AL_NO_ERROR)
{
llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (bufferdata) buffers" << llendl;
LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() error swapping (bufferdata) buffers" << LL_ENDL;
errors++;
}
}
@@ -550,7 +550,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
error = alGetError();
if(error != AL_NO_ERROR)
{
llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (queuing) buffers" << llendl;
LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() error swapping (queuing) buffers" << LL_ENDL;
}
mNumEmptyWindALBuffers = errors;
@@ -566,7 +566,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
{
alSourcePlay(mWindSource);
lldebugs << "Wind had stopped - probably ran out of buffers - restarting: " << (unprocessed+mNumEmptyWindALBuffers) << " now queued." << llendl;
LL_DEBUGS() << "Wind had stopped - probably ran out of buffers - restarting: " << (unprocessed+mNumEmptyWindALBuffers) << " now queued." << LL_ENDL;
}
}

View File

@@ -48,13 +48,13 @@ void LLListener_OpenAL::init()
void LLListener_OpenAL::translate(LLVector3 offset)
{
//llinfos << "LLListener_OpenAL::translate() : " << offset << llendl;
//LL_INFOS() << "LLListener_OpenAL::translate() : " << offset << LL_ENDL;
LLListener::translate(offset);
}
void LLListener_OpenAL::setPosition(LLVector3 pos)
{
//llinfos << "LLListener_OpenAL::setPosition() : " << pos << llendl;
//LL_INFOS() << "LLListener_OpenAL::setPosition() : " << pos << LL_ENDL;
LLListener::setPosition(pos);
}
@@ -65,7 +65,7 @@ void LLListener_OpenAL::setVelocity(LLVector3 vel)
void LLListener_OpenAL::orient(LLVector3 up, LLVector3 at)
{
//llinfos << "LLListener_OpenAL::orient() up: " << up << " at: " << at << llendl;
//LL_INFOS() << "LLListener_OpenAL::orient() up: " << up << " at: " << at << LL_ENDL;
LLListener::orient(up, at);
}
@@ -91,7 +91,7 @@ void LLListener_OpenAL::commitDeferredChanges()
void LLListener_OpenAL::setDopplerFactor(F32 factor)
{
//llinfos << "LLListener_OpenAL::setDopplerFactor() : " << factor << llendl;
//LL_INFOS() << "LLListener_OpenAL::setDopplerFactor() : " << factor << LL_ENDL;
alDopplerFactor(factor);
}
@@ -99,7 +99,7 @@ F32 LLListener_OpenAL::getDopplerFactor()
{
ALfloat factor;
factor = alGetFloat(AL_DOPPLER_FACTOR);
//llinfos << "LLListener_OpenAL::getDopplerFactor() : " << factor << llendl;
//LL_INFOS() << "LLListener_OpenAL::getDopplerFactor() : " << factor << LL_ENDL;
return factor;
}

View File

@@ -114,7 +114,7 @@ void LLStreamingAudio_FMODEX::start(const std::string& url)
{
//if (!mInited)
//{
// llwarns << "startInternetStream before audio initialized" << llendl;
// LL_WARNS() << "startInternetStream before audio initialized" << LL_ENDL;
// return;
//}
@@ -125,20 +125,20 @@ void LLStreamingAudio_FMODEX::start(const std::string& url)
{
if(mDeadStreams.empty())
{
llinfos << "Starting internet stream: " << url << llendl;
LL_INFOS() << "Starting internet stream: " << url << LL_ENDL;
mCurrentInternetStreamp = new LLAudioStreamManagerFMODEX(mSystem,url);
mURL = url;
mMetaData = new LLSD;
}
else
{
llinfos << "Deferring stream load until buffer release: " << url << llendl;
LL_INFOS() << "Deferring stream load until buffer release: " << url << LL_ENDL;
mPendingURL = url;
}
}
else
{
llinfos << "Set internet stream to null" << llendl;
LL_INFOS() << "Set internet stream to null" << LL_ENDL;
mURL.clear();
}
}
@@ -194,7 +194,7 @@ void LLStreamingAudio_FMODEX::update()
if(!mPendingURL.empty())
{
llassert_always(mCurrentInternetStreamp == NULL);
llinfos << "Starting internet stream: " << mPendingURL << llendl;
LL_INFOS() << "Starting internet stream: " << mPendingURL << LL_ENDL;
mCurrentInternetStreamp = new LLAudioStreamManagerFMODEX(mSystem,mPendingURL);
mURL = mPendingURL;
mMetaData = new LLSD;
@@ -265,7 +265,7 @@ void LLStreamingAudio_FMODEX::update()
case(FMOD_TAGTYPE_FMOD):
if (!LLStringUtil::compareInsensitive(name, "Sample Rate Change"))
{
llinfos << "Stream forced changing sample rate to " << *((float *)tag.data) << llendl;
LL_INFOS() << "Stream forced changing sample rate to " << *((float *)tag.data) << LL_ENDL;
Check_FMOD_Error(mFMODInternetStreamChannelp->setFrequency(*((float *)tag.data)), "FMOD::Channel::setFrequency");
}
continue;
@@ -280,11 +280,11 @@ void LLStreamingAudio_FMODEX::update()
{
case(FMOD_TAGDATATYPE_INT):
(*mMetaData)[name]=*(LLSD::Integer*)(tag.data);
llinfos << tag.name << ": " << *(int*)(tag.data) << llendl;
LL_INFOS() << tag.name << ": " << *(int*)(tag.data) << LL_ENDL;
break;
case(FMOD_TAGDATATYPE_FLOAT):
(*mMetaData)[name]=*(LLSD::Float*)(tag.data);
llinfos << tag.name << ": " << *(float*)(tag.data) << llendl;
LL_INFOS() << tag.name << ": " << *(float*)(tag.data) << LL_ENDL;
break;
case(FMOD_TAGDATATYPE_STRING):
{
@@ -292,7 +292,7 @@ void LLStreamingAudio_FMODEX::update()
if (out.length() && out[out.size() - 1] == 0)
out.erase(out.size() - 1);
(*mMetaData)[name]=out;
llinfos << tag.name << "(RAW): " << out << llendl;
LL_INFOS() << tag.name << "(RAW): " << out << LL_ENDL;
}
break;
case(FMOD_TAGDATATYPE_STRING_UTF8) :
@@ -304,7 +304,7 @@ void LLStreamingAudio_FMODEX::update()
if (out.length() && out[out.size() - 1] == 0)
out.erase(out.size() - 1);
(*mMetaData)[name] = out;
llinfos << tag.name << "(UTF8): " << out << llendl;
LL_INFOS() << tag.name << "(UTF8): " << out << LL_ENDL;
}
break;
case(FMOD_TAGDATATYPE_STRING_UTF16):
@@ -313,7 +313,7 @@ void LLStreamingAudio_FMODEX::update()
if (out.length() && out[out.size() - 1] == 0)
out.erase(out.size() - 1);
(*mMetaData)[name] = out;
llinfos << tag.name << "(UTF16): " << out << llendl;
LL_INFOS() << tag.name << "(UTF16): " << out << LL_ENDL;
}
break;
case(FMOD_TAGDATATYPE_STRING_UTF16BE):
@@ -322,7 +322,7 @@ void LLStreamingAudio_FMODEX::update()
if (out.length() && out[out.size() - 1] == 0)
out.erase(out.size() - 1);
(*mMetaData)[name] = out;
llinfos << tag.name << "(UTF16BE): " << out << llendl;
LL_INFOS() << tag.name << "(UTF16BE): " << out << LL_ENDL;
}
default:
break;
@@ -334,9 +334,9 @@ void LLStreamingAudio_FMODEX::update()
bool paused = false;
if (mFMODInternetStreamChannelp->getPaused(&paused) == FMOD_OK && !paused)
{
llinfos << "Stream starvation detected! Pausing stream until buffer nearly full." << llendl;
llinfos << " (diskbusy="<<diskbusy<<")" << llendl;
llinfos << " (progress="<<progress<<")" << llendl;
LL_INFOS() << "Stream starvation detected! Pausing stream until buffer nearly full." << LL_ENDL;
LL_INFOS() << " (diskbusy="<<diskbusy<<")" << LL_ENDL;
LL_INFOS() << " (progress="<<progress<<")" << LL_ENDL;
Check_FMOD_Error(mFMODInternetStreamChannelp->setPaused(true), "FMOD::Channel::setPaused");
}
}
@@ -366,14 +366,14 @@ void LLStreamingAudio_FMODEX::stop()
if (mCurrentInternetStreamp)
{
llinfos << "Stopping internet stream: " << mCurrentInternetStreamp->getURL() << llendl;
LL_INFOS() << "Stopping internet stream: " << mCurrentInternetStreamp->getURL() << LL_ENDL;
if (mCurrentInternetStreamp->stopStream())
{
delete mCurrentInternetStreamp;
}
else
{
llwarns << "Pushing stream to dead list: " << mCurrentInternetStreamp->getURL() << llendl;
LL_WARNS() << "Pushing stream to dead list: " << mCurrentInternetStreamp->getURL() << LL_ENDL;
mDeadStreams.push_back(mCurrentInternetStreamp);
}
mCurrentInternetStreamp = NULL;
@@ -492,9 +492,9 @@ LLAudioStreamManagerFMODEX::LLAudioStreamManagerFMODEX(FMOD::System *system, con
if (result!= FMOD_OK)
{
llwarns << "Couldn't open fmod stream, error "
LL_WARNS() << "Couldn't open fmod stream, error "
<< FMOD_ErrorString(result)
<< llendl;
<< LL_ENDL;
mReady = false;
return;
}
@@ -508,7 +508,7 @@ FMOD::Channel *LLAudioStreamManagerFMODEX::startStream()
FMOD_OPENSTATE open_state;
if (getOpenState(open_state) != FMOD_OK || open_state != FMOD_OPENSTATE_READY)
{
llwarns << "No internet stream to start playing!" << llendl;
LL_WARNS() << "No internet stream to start playing!" << LL_ENDL;
return NULL;
}
@@ -582,7 +582,7 @@ bool LLStreamingAudio_FMODEX::releaseDeadStreams()
LLAudioStreamManagerFMODEX *streamp = *iter;
if (streamp->stopStream())
{
llinfos << "Closed dead stream" << llendl;
LL_INFOS() << "Closed dead stream" << LL_ENDL;
delete streamp;
mDeadStreams.erase(iter++);
}

View File

@@ -173,7 +173,7 @@ void LLStreamingAudio_FMODSTUDIO::start(const std::string& url)
{
//if (!mInited)
//{
// llwarns << "startInternetStream before audio initialized" << llendl;
// LL_WARNS() << "startInternetStream before audio initialized" << LL_ENDL;
// return;
//}
@@ -184,20 +184,20 @@ void LLStreamingAudio_FMODSTUDIO::start(const std::string& url)
{
if(mDeadStreams.empty())
{
llinfos << "Starting internet stream: " << url << llendl;
LL_INFOS() << "Starting internet stream: " << url << LL_ENDL;
mCurrentInternetStreamp = new LLAudioStreamManagerFMODSTUDIO(mSystem, mStreamGroup, url);
mURL = url;
mMetaData = new LLSD;
}
else
{
llinfos << "Deferring stream load until buffer release: " << url << llendl;
LL_INFOS() << "Deferring stream load until buffer release: " << url << LL_ENDL;
mPendingURL = url;
}
}
else
{
llinfos << "Set internet stream to null" << llendl;
LL_INFOS() << "Set internet stream to null" << LL_ENDL;
mURL.clear();
}
}
@@ -253,7 +253,7 @@ void LLStreamingAudio_FMODSTUDIO::update()
if(!mPendingURL.empty())
{
llassert_always(mCurrentInternetStreamp == NULL);
llinfos << "Starting internet stream: " << mPendingURL << llendl;
LL_INFOS() << "Starting internet stream: " << mPendingURL << LL_ENDL;
mCurrentInternetStreamp = new LLAudioStreamManagerFMODSTUDIO(mSystem,mStreamGroup, mPendingURL);
mURL = mPendingURL;
mMetaData = new LLSD;
@@ -329,7 +329,7 @@ void LLStreamingAudio_FMODSTUDIO::update()
case(FMOD_TAGTYPE_FMOD):
if (!LLStringUtil::compareInsensitive(name, "Sample Rate Change"))
{
llinfos << "Stream forced changing sample rate to " << *((float *)tag.data) << llendl;
LL_INFOS() << "Stream forced changing sample rate to " << *((float *)tag.data) << LL_ENDL;
Check_FMOD_Error(mFMODInternetStreamChannelp->setFrequency(*((float *)tag.data)), "FMOD::Channel::setFrequency");
}
continue;
@@ -344,11 +344,11 @@ void LLStreamingAudio_FMODSTUDIO::update()
{
case(FMOD_TAGDATATYPE_INT):
(*mMetaData)[name]=*(LLSD::Integer*)(tag.data);
llinfos << tag.name << ": " << *(int*)(tag.data) << llendl;
LL_INFOS() << tag.name << ": " << *(int*)(tag.data) << LL_ENDL;
break;
case(FMOD_TAGDATATYPE_FLOAT):
(*mMetaData)[name]=*(LLSD::Float*)(tag.data);
llinfos << tag.name << ": " << *(float*)(tag.data) << llendl;
LL_INFOS() << tag.name << ": " << *(float*)(tag.data) << LL_ENDL;
break;
case(FMOD_TAGDATATYPE_STRING):
{
@@ -356,7 +356,7 @@ void LLStreamingAudio_FMODSTUDIO::update()
if (out.length() && out[out.size() - 1] == 0)
out.erase(out.size() - 1);
(*mMetaData)[name]=out;
llinfos << tag.name << "(RAW): " << out << llendl;
LL_INFOS() << tag.name << "(RAW): " << out << LL_ENDL;
}
break;
case(FMOD_TAGDATATYPE_STRING_UTF8) :
@@ -368,7 +368,7 @@ void LLStreamingAudio_FMODSTUDIO::update()
if (out.length() && out[out.size() - 1] == 0)
out.erase(out.size() - 1);
(*mMetaData)[name] = out;
llinfos << tag.name << "(UTF8): " << out << llendl;
LL_INFOS() << tag.name << "(UTF8): " << out << LL_ENDL;
}
break;
case(FMOD_TAGDATATYPE_STRING_UTF16):
@@ -377,7 +377,7 @@ void LLStreamingAudio_FMODSTUDIO::update()
if (out.length() && out[out.size() - 1] == 0)
out.erase(out.size() - 1);
(*mMetaData)[name] = out;
llinfos << tag.name << "(UTF16): " << out << llendl;
LL_INFOS() << tag.name << "(UTF16): " << out << LL_ENDL;
}
break;
case(FMOD_TAGDATATYPE_STRING_UTF16BE):
@@ -386,7 +386,7 @@ void LLStreamingAudio_FMODSTUDIO::update()
if (out.length() && out[out.size() - 1] == 0)
out.erase(out.size() - 1);
(*mMetaData)[name] = out;
llinfos << tag.name << "(UTF16BE): " << out << llendl;
LL_INFOS() << tag.name << "(UTF16BE): " << out << LL_ENDL;
}
default:
break;
@@ -398,9 +398,9 @@ void LLStreamingAudio_FMODSTUDIO::update()
bool paused = false;
if (mFMODInternetStreamChannelp->getPaused(&paused) == FMOD_OK && !paused)
{
llinfos << "Stream starvation detected! Pausing stream until buffer nearly full." << llendl;
llinfos << " (diskbusy="<<diskbusy<<")" << llendl;
llinfos << " (progress="<<progress<<")" << llendl;
LL_INFOS() << "Stream starvation detected! Pausing stream until buffer nearly full." << LL_ENDL;
LL_INFOS() << " (diskbusy="<<diskbusy<<")" << LL_ENDL;
LL_INFOS() << " (progress="<<progress<<")" << LL_ENDL;
Check_FMOD_Error(mFMODInternetStreamChannelp->setPaused(true), "FMOD::Channel::setPaused");
}
}
@@ -435,14 +435,14 @@ void LLStreamingAudio_FMODSTUDIO::stop()
if (mCurrentInternetStreamp)
{
llinfos << "Stopping internet stream: " << mCurrentInternetStreamp->getURL() << llendl;
LL_INFOS() << "Stopping internet stream: " << mCurrentInternetStreamp->getURL() << LL_ENDL;
if (mCurrentInternetStreamp->stopStream())
{
delete mCurrentInternetStreamp;
}
else
{
llwarns << "Pushing stream to dead list: " << mCurrentInternetStreamp->getURL() << llendl;
LL_WARNS() << "Pushing stream to dead list: " << mCurrentInternetStreamp->getURL() << LL_ENDL;
mDeadStreams.push_back(mCurrentInternetStreamp);
}
mCurrentInternetStreamp = NULL;
@@ -558,9 +558,9 @@ LLAudioStreamManagerFMODSTUDIO::LLAudioStreamManagerFMODSTUDIO(FMOD::System *sys
if (result!= FMOD_OK)
{
llwarns << "Couldn't open fmod stream, error "
LL_WARNS() << "Couldn't open fmod stream, error "
<< FMOD_ErrorString(result)
<< llendl;
<< LL_ENDL;
mReady = false;
return;
}
@@ -574,7 +574,7 @@ FMOD::Channel *LLAudioStreamManagerFMODSTUDIO::startStream()
FMOD_OPENSTATE open_state;
if (getOpenState(open_state) != FMOD_OK || open_state != FMOD_OPENSTATE_READY)
{
llwarns << "No internet stream to start playing!" << llendl;
LL_WARNS() << "No internet stream to start playing!" << LL_ENDL;
return NULL;
}
@@ -648,7 +648,7 @@ bool LLStreamingAudio_FMODSTUDIO::releaseDeadStreams()
LLAudioStreamManagerFMODSTUDIO *streamp = *iter;
if (streamp->stopStream())
{
llinfos << "Closed dead stream" << llendl;
LL_INFOS() << "Closed dead stream" << LL_ENDL;
delete streamp;
mDeadStreams.erase(iter++);
}

View File

@@ -77,7 +77,7 @@ int vfs_seek(void *datasource, ogg_int64_t offset, int whence)
origin = -1;
break;
default:
llerrs << "Invalid whence argument to vfs_seek" << llendl;
LL_ERRS() << "Invalid whence argument to vfs_seek" << LL_ENDL;
return -1;
}
@@ -124,7 +124,7 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname)
U32 data_length = 0;
llinfos << "Vorbis decode from vfile: " << in_uuid << llendl;
LL_INFOS() << "Vorbis decode from vfile: " << in_uuid << LL_ENDL;
in_vfile = new LLVFile(vfs, in_uuid, LLAssetType::AT_SOUND);
if (! in_vfile->getSize())
@@ -226,7 +226,7 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname)
int r = ov_open_callbacks(in_vfile, &vf, NULL, 0, vfs_callbacks);
if(r < 0)
{
llwarns << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << in_uuid << llendl;
LL_WARNS() << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << in_uuid << LL_ENDL;
return(FALSE);
}
@@ -247,7 +247,7 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname)
if (ret == 0) {
/* EOF */
eof=1;
// llinfos << "Vorbis EOF" << llendl;
// LL_INFOS() << "Vorbis EOF" << LL_ENDL;
} else if (ret < 0) {
/* error in the stream. Not a problem, just reporting it in
case we (the app) cares. In this case, we don't. */
@@ -255,7 +255,7 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname)
break;
} else {
// llinfos << "Vorbis read " << ret << "bytes" << llendl;
// LL_INFOS() << "Vorbis read " << ret << "bytes" << LL_ENDL;
/* we don't bother dealing with sample rate changes, etc, but.
you'll have to*/
data_length += outfile.write(pcmout, ret);

View File

@@ -127,7 +127,7 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
return(LLVORBISENC_CHUNK_SIZE_ERR);
}
// llinfos << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << llendl;
// LL_INFOS() << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << LL_ENDL;
if (!(strncmp((char *)&(wav_header[0]),"fmt ",4)))
{
@@ -224,7 +224,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
std::string error_msg;
if ((format_error = check_for_invalid_wav_formats(in_fname, error_msg)))
{
llwarns << error_msg << ": " << in_fname << llendl;
LL_WARNS() << error_msg << ": " << in_fname << LL_ENDL;
return(format_error);
}
@@ -237,8 +237,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
infile.open(in_fname,LL_APR_RB);
if (!infile.getFileHandle())
{
llwarns << "Couldn't open temporary ogg file for writing: " << in_fname
<< llendl;
LL_WARNS() << "Couldn't open temporary ogg file for writing: " << in_fname
<< LL_ENDL;
return(LLVORBISENC_SOURCE_OPEN_ERR);
}
@@ -246,8 +246,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
outfile.open(out_fname,LL_APR_WPB);
if (!outfile.getFileHandle())
{
llwarns << "Couldn't open upload sound file for reading: " << in_fname
<< llendl;
LL_WARNS() << "Couldn't open upload sound file for reading: " << in_fname
<< LL_ENDL;
return(LLVORBISENC_DEST_OPEN_ERR);
}
@@ -265,7 +265,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
+ ((U32) wav_header[5] << 8)
+ wav_header[4];
// llinfos << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << llendl;
// LL_INFOS() << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << LL_ENDL;
if (!(strncmp((char *)&(wav_header[0]),"fmt ",4)))
{
@@ -308,8 +308,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
// vorbis_encode_ctl(&vi,OV_ECTL_RATEMANAGE_AVG,NULL) ||
// vorbis_encode_setup_init(&vi))
{
llwarns << "unable to initialize vorbis codec at quality " << quality << llendl;
// llwarns << "unable to initialize vorbis codec at bitrate " << bitrate << llendl;
LL_WARNS() << "unable to initialize vorbis codec at quality " << quality << LL_ENDL;
// LL_WARNS() << "unable to initialize vorbis codec at bitrate " << bitrate << LL_ENDL;
return(LLVORBISENC_DEST_OPEN_ERR);
}
@@ -498,7 +498,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
libvorbis. They're never freed or manipulated directly */
// fprintf(stderr,"Vorbis encoding: Done.\n");
llinfos << "Vorbis encoding: Done." << llendl;
LL_INFOS() << "Vorbis encoding: Done." << LL_ENDL;
#endif
return(LLVORBISENC_NOERR);

View File

@@ -29,7 +29,7 @@
#include <map>
#include "string_table.h"
#include "llstringtable.h"
#include "lluuid.h"
//-----------------------------------------------------------------------------

View File

@@ -130,14 +130,14 @@ LLQuaternion::Order bvhStringToOrder( char *str )
if (mStatus == LLBVHLoader::ST_NO_XLT_FILE)
{
llwarns << "NOTE: No translation table found." << llendl;
LL_WARNS() << "NOTE: No translation table found." << LL_ENDL;
return;
}
else
{
if (mStatus != LLBVHLoader::ST_OK)
{
llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl;
LL_WARNS() << "ERROR: [line: " << getLineNumber() << "] " << mStatus << LL_ENDL;
return;
}
}
@@ -147,7 +147,7 @@ LLQuaternion::Order bvhStringToOrder( char *str )
mStatus = loadBVHFile(buffer, error_text, error_line);
if (mStatus != LLBVHLoader::ST_OK)
{
llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl;
LL_WARNS() << "ERROR: [line: " << getLineNumber() << "] " << mStatus << LL_ENDL;
return;
}
@@ -163,10 +163,10 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error
errorLine = 0;
mStatus = loadTranslationTable("anim.ini");
loadStatus = mStatus;
llinfos<<"Load Status 00 : "<< loadStatus << llendl;
LL_INFOS() << "Load Status 00 : " << loadStatus << LL_ENDL;
if (mStatus == E_ST_NO_XLT_FILE)
{
//llwarns << "NOTE: No translation table found." << llendl;
//LL_WARNS() << "NOTE: No translation table found." << LL_ENDL;
loadStatus = mStatus;
return;
}
@@ -174,7 +174,7 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error
{
if (mStatus != E_ST_OK)
{
//llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl;
//LL_WARNS() << "ERROR: [line: " << getLineNumber() << "] " << mStatus << LL_ENDL;
errorLine = getLineNumber();
loadStatus = mStatus;
return;
@@ -187,7 +187,7 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error
if (mStatus != E_ST_OK)
{
//llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl;
//LL_WARNS() << "ERROR: [line: " << getLineNumber() << "] " << mStatus << LL_ENDL;
loadStatus = mStatus;
errorLine = getLineNumber();
return;
@@ -224,7 +224,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName)
if (!fp)
return E_ST_NO_XLT_FILE;
llinfos << "NOTE: Loading translation table: " << fileName << llendl;
LL_INFOS() << "NOTE: Loading translation table: " << fileName << LL_ENDL;
//--------------------------------------------------------------------
// register file to be closed on function exit
@@ -288,7 +288,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName)
return E_ST_NO_XLT_EMOTE;
mEmoteName.assign( emote_str );
// llinfos << "NOTE: Emote: " << mEmoteName.c_str() << llendl;
// LL_INFOS() << "NOTE: Emote: " << mEmoteName.c_str() << LL_ENDL;
continue;
}
@@ -303,7 +303,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName)
return E_ST_NO_XLT_PRIORITY;
mPriority = priority;
// llinfos << "NOTE: Priority: " << mPriority << llendl;
// LL_INFOS() << "NOTE: Priority: " << mPriority << LL_ENDL;
continue;
}
@@ -696,7 +696,7 @@ ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 &
if ( !strstr(line.c_str(), "HIERARCHY") )
{
// llinfos << line << llendl;
// LL_INFOS() << line << LL_ENDL;
return E_ST_NO_HIER;
}
@@ -1043,7 +1043,7 @@ void LLBVHLoader::applyTranslations()
//----------------------------------------------------------------
if ( trans.mIgnore )
{
//llinfos << "NOTE: Ignoring " << joint->mName.c_str() << llendl;
//LL_INFOS() << "NOTE: Ignoring " << joint->mName.c_str() << LL_ENDL;
joint->mIgnore = TRUE;
continue;
}
@@ -1053,7 +1053,7 @@ void LLBVHLoader::applyTranslations()
//----------------------------------------------------------------
if ( ! trans.mOutName.empty() )
{
//llinfos << "NOTE: Changing " << joint->mName.c_str() << " to " << trans.mOutName.c_str() << llendl;
//LL_INFOS() << "NOTE: Changing " << joint->mName.c_str() << " to " << trans.mOutName.c_str() << LL_ENDL;
joint->mOutName = trans.mOutName;
}
@@ -1070,25 +1070,25 @@ void LLBVHLoader::applyTranslations()
//----------------------------------------------------------------
if ( trans.mRelativePositionKey )
{
// llinfos << "NOTE: Removing 1st position offset from all keys for " << joint->mOutName.c_str() << llendl;
// LL_INFOS() << "NOTE: Removing 1st position offset from all keys for " << joint->mOutName.c_str() << LL_ENDL;
joint->mRelativePositionKey = TRUE;
}
if ( trans.mRelativeRotationKey )
{
// llinfos << "NOTE: Removing 1st rotation from all keys for " << joint->mOutName.c_str() << llendl;
// LL_INFOS() << "NOTE: Removing 1st rotation from all keys for " << joint->mOutName.c_str() << LL_ENDL;
joint->mRelativeRotationKey = TRUE;
}
if ( trans.mRelativePosition.magVec() > 0.0f )
{
joint->mRelativePosition = trans.mRelativePosition;
// llinfos << "NOTE: Removing " <<
// LL_INFOS() << "NOTE: Removing " <<
// joint->mRelativePosition.mV[0] << " " <<
// joint->mRelativePosition.mV[1] << " " <<
// joint->mRelativePosition.mV[2] <<
// " from all position keys in " <<
// joint->mOutName.c_str() << llendl;
// joint->mOutName.c_str() << LL_ENDL;
}
//----------------------------------------------------------------
@@ -1102,9 +1102,9 @@ void LLBVHLoader::applyTranslations()
//----------------------------------------------------------------
if ( ! trans.mMergeParentName.empty() )
{
// llinfos << "NOTE: Merging " << joint->mOutName.c_str() <<
// LL_INFOS() << "NOTE: Merging " << joint->mOutName.c_str() <<
// " with parent " <<
// trans.mMergeParentName.c_str() << llendl;
// trans.mMergeParentName.c_str() << LL_ENDL;
joint->mMergeParentName = trans.mMergeParentName;
}
@@ -1113,8 +1113,8 @@ void LLBVHLoader::applyTranslations()
//----------------------------------------------------------------
if ( ! trans.mMergeChildName.empty() )
{
// llinfos << "NOTE: Merging " << joint->mName.c_str() <<
// " with child " << trans.mMergeChildName.c_str() << llendl;
// LL_INFOS() << "NOTE: Merging " << joint->mName.c_str() <<
// " with child " << trans.mMergeChildName.c_str() << LL_ENDL;
joint->mMergeChildName = trans.mMergeChildName;
}
@@ -1309,7 +1309,7 @@ void LLBVHLoader::optimize()
// don't output joints with no motion
if (!(pos_changed || rot_changed))
{
//llinfos << "Ignoring joint " << joint->mName << llendl;
//LL_INFOS() << "Ignoring joint " << joint->mName << LL_ENDL;
joint->mIgnore = TRUE;
}
}

View File

@@ -95,7 +95,7 @@ LLJoint *LLCharacter::getJoint( const std::string &name )
if (!joint)
{
llwarns << "Failed to find joint." << llendl;
LL_WARNS() << "Failed to find joint." << LL_ENDL;
}
return joint;
}
@@ -169,7 +169,7 @@ BOOL LLCharacter::isMotionActive(const LLUUID& id)
//-----------------------------------------------------------------------------
void LLCharacter::requestStopMotion( LLMotion* motion)
{
// llinfos << "DEBUG: Char::onDeactivateMotion( " << motionName << " )" << llendl;
// LL_INFOS() << "DEBUG: Char::onDeactivateMotion( " << motionName << " )" << LL_ENDL;
}
@@ -245,14 +245,14 @@ void LLCharacter::dumpCharacter( LLJoint* joint )
// handle top level entry into recursion
if (joint == NULL)
{
llinfos << "DEBUG: Dumping Character @" << this << llendl;
LL_INFOS() << "DEBUG: Dumping Character @" << this << LL_ENDL;
dumpCharacter( getRootJoint() );
llinfos << "DEBUG: Done." << llendl;
LL_INFOS() << "DEBUG: Done." << LL_ENDL;
return;
}
// print joint info
llinfos << "DEBUG: " << joint->getName() << " (" << (joint->getParent()?joint->getParent()->getName():std::string("ROOT")) << ")" << llendl;
LL_INFOS() << "DEBUG: " << joint->getName() << " (" << (joint->getParent()?joint->getParent()->getName():std::string("ROOT")) << ")" << LL_ENDL;
// recurse
for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
@@ -290,7 +290,7 @@ void LLCharacter::removeAnimationData(std::string name)
//-----------------------------------------------------------------------------
// setVisualParamWeight()
//-----------------------------------------------------------------------------
BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight, BOOL upload_bake)
BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight, bool upload_bake)
{
S32 index = which_param->getID();
visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index);
@@ -305,7 +305,7 @@ BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 wei
//-----------------------------------------------------------------------------
// setVisualParamWeight()
//-----------------------------------------------------------------------------
BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, BOOL upload_bake)
BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, bool upload_bake)
{
std::string tname(param_name);
LLStringUtil::toLower(tname);
@@ -316,14 +316,14 @@ BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, BOOL
name_iter->second->setWeight(weight, upload_bake);
return TRUE;
}
llwarns << "LLCharacter::setVisualParamWeight() Invalid visual parameter: " << param_name << llendl;
LL_WARNS() << "LLCharacter::setVisualParamWeight() Invalid visual parameter: " << param_name << LL_ENDL;
return FALSE;
}
//-----------------------------------------------------------------------------
// setVisualParamWeight()
//-----------------------------------------------------------------------------
BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake)
BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight, bool upload_bake)
{
visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index);
if (index_iter != mVisualParamIndexMap.end())
@@ -331,7 +331,7 @@ BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake)
index_iter->second->setWeight(weight, upload_bake);
return TRUE;
}
llwarns << "LLCharacter::setVisualParamWeight() Invalid visual parameter index: " << index << llendl;
LL_WARNS() << "LLCharacter::setVisualParamWeight() Invalid visual parameter index: " << index << LL_ENDL;
return FALSE;
}
@@ -348,7 +348,7 @@ F32 LLCharacter::getVisualParamWeight(LLVisualParam *which_param)
}
else
{
llwarns << "LLCharacter::getVisualParamWeight() Invalid visual parameter*, index= " << index << llendl;
LL_WARNS() << "LLCharacter::getVisualParamWeight() Invalid visual parameter*, index= " << index << LL_ENDL;
return 0.f;
}
}
@@ -366,7 +366,7 @@ F32 LLCharacter::getVisualParamWeight(const char* param_name)
{
return name_iter->second->getWeight();
}
llwarns << "LLCharacter::getVisualParamWeight() Invalid visual parameter: " << param_name << llendl;
LL_WARNS() << "LLCharacter::getVisualParamWeight() Invalid visual parameter: " << param_name << LL_ENDL;
return 0.f;
}
@@ -382,7 +382,7 @@ F32 LLCharacter::getVisualParamWeight(S32 index)
}
else
{
llwarns << "LLCharacter::getVisualParamWeight() Invalid visual parameter index: " << index << llendl;
LL_WARNS() << "LLCharacter::getVisualParamWeight() Invalid visual parameter index: " << index << LL_ENDL;
return 0.f;
}
}
@@ -437,7 +437,7 @@ LLVisualParam* LLCharacter::getVisualParam(const char *param_name)
{
return name_iter->second;
}
llwarns << "LLCharacter::getVisualParam() Invalid visual parameter: " << param_name << llendl;
LL_WARNS() << "LLCharacter::getVisualParam() Invalid visual parameter: " << param_name << LL_ENDL;
return NULL;
}
@@ -462,8 +462,8 @@ void LLCharacter::addSharedVisualParam(LLVisualParam *param)
}
else
{
llwarns << "Shared visual parameter " << param->getName() << " does not already exist with ID " <<
param->getID() << llendl;
LL_WARNS() << "Shared visual parameter " << param->getName() << " does not already exist with ID " <<
param->getID() << LL_ENDL;
}
}
@@ -479,8 +479,8 @@ void LLCharacter::addVisualParam(LLVisualParam *param)
idxres = mVisualParamIndexMap.insert(visual_param_index_map_t::value_type(index, param));
if (!idxres.second)
{
llwarns << "Visual parameter " << param->getName() << " already exists with same ID as " <<
param->getName() << llendl;
LL_WARNS() << "Visual parameter " << param->getName() << " already exists with same ID as " <<
param->getName() << LL_ENDL;
visual_param_index_map_t::iterator index_iter = idxres.first;
index_iter->second = param;
}
@@ -502,7 +502,7 @@ void LLCharacter::addVisualParam(LLVisualParam *param)
name_iter->second = param;
}
}
//llinfos << "Adding Visual Param '" << param->getName() << "' ( " << index << " )" << llendl;
//LL_INFOS() << "Adding Visual Param '" << param->getName() << "' ( " << index << " )" << LL_ENDL;
}
//-----------------------------------------------------------------------------

View File

@@ -35,7 +35,7 @@
#include "lljoint.h"
#include "llmotioncontroller.h"
#include "llvisualparam.h"
#include "string_table.h"
#include "llstringtable.h"
#include "llpointer.h"
#include "llthread.h"
#include "llsortedvector.h"
@@ -195,9 +195,9 @@ public:
void addVisualParam(LLVisualParam *param);
void addSharedVisualParam(LLVisualParam *param);
virtual BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight, BOOL upload_bake = FALSE );
virtual BOOL setVisualParamWeight(const char* param_name, F32 weight, BOOL upload_bake = FALSE );
virtual BOOL setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake = FALSE );
virtual BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight, bool upload_bake = false );
virtual BOOL setVisualParamWeight(const char* param_name, F32 weight, bool upload_bake = false );
virtual BOOL setVisualParamWeight(S32 index, F32 weight, bool upload_bake = false );
// get visual param weight by param or name
F32 getVisualParamWeight(LLVisualParam *distortion);

View File

@@ -89,7 +89,7 @@ LLMotion::LLMotionInitStatus LLEditingMotion::onInitialize(LLCharacter *characte
!mCharacter->getJoint("mElbowLeft") ||
!mCharacter->getJoint("mWristLeft"))
{
llwarns << "Invalid skeleton for editing motion!" << llendl;
LL_WARNS() << "Invalid skeleton for editing motion!" << LL_ENDL;
return STATUS_FAILURE;
}
@@ -102,7 +102,7 @@ LLMotion::LLMotionInitStatus LLEditingMotion::onInitialize(LLCharacter *characte
if ( ! mParentState->getJoint() )
{
llinfos << getName() << ": Can't get parent joint." << llendl;
LL_INFOS() << getName() << ": Can't get parent joint." << LL_ENDL;
return STATUS_FAILURE;
}
@@ -214,22 +214,22 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
target = target * target_dist;
if (!target.isFinite())
{
llwarns << "Non finite target in editing motion with target distance of " << target_dist <<
LL_WARNS() << "Non finite target in editing motion with target distance of " << target_dist <<
" and focus point " << focus_pt << " and pointAtPt: ";
if (pointAtPt)
{
llcont << *pointAtPt;
LL_CONT << *pointAtPt;
}
else
{
llcont << "NULL";
LL_CONT << "NULL";
}
llcont << llendl;
LL_CONT << LL_ENDL;
}
mTarget.setPosition( target + mParentJoint.getPosition());
// llinfos << "Point At: " << mTarget.getPosition() << llendl;
// LL_INFOS() << "Point At: " << mTarget.getPosition() << LL_ENDL;
// update the ikSolver
if (!mTarget.getPosition().isExactlyZero())

View File

@@ -93,14 +93,14 @@ const LLGesture &LLGesture::operator =(const LLGesture &rhs)
BOOL LLGesture::trigger(KEY key, MASK mask)
{
llwarns << "Parent class trigger called: you probably didn't mean this." << llendl;
LL_WARNS() << "Parent class trigger called: you probably didn't mean this." << LL_ENDL;
return FALSE;
}
BOOL LLGesture::trigger(const std::string& trigger_string)
{
llwarns << "Parent class trigger called: you probably didn't mean this." << llendl;
LL_WARNS() << "Parent class trigger called: you probably didn't mean this." << LL_ENDL;
return FALSE;
}
@@ -130,7 +130,7 @@ U8 *LLGesture::deserialize(U8 *buffer, S32 max_size)
if (tmp + sizeof(mKey) + sizeof(mMask) + 16 > buffer + max_size)
{
llwarns << "Attempt to read past end of buffer, bad data!!!!" << llendl;
LL_WARNS() << "Attempt to read past end of buffer, bad data!!!!" << LL_ENDL;
return buffer;
}
@@ -155,7 +155,7 @@ U8 *LLGesture::deserialize(U8 *buffer, S32 max_size)
if (tmp > buffer + max_size)
{
llwarns << "Read past end of buffer, bad data!!!!" << llendl;
LL_WARNS() << "Read past end of buffer, bad data!!!!" << LL_ENDL;
return tmp;
}
@@ -173,27 +173,7 @@ S32 LLGesture::getMaxSerialSize()
LLGestureList::LLGestureList()
: mList(0)
{
// add some gestures for debugging
// LLGesture *gesture = NULL;
/*
gesture = new LLGesture(KEY_F2, MASK_NONE, ":-)",
SND_CHIRP, "dance2", ":-)" );
mList.put(gesture);
gesture = new LLGesture(KEY_F3, MASK_NONE, "/dance",
SND_OBJECT_CREATE, "dance3", "(dances)" );
mList.put(gesture);
gesture = new LLGesture(KEY_F4, MASK_NONE, "/boogie",
LLUUID::null, "dance4", LLStringUtil::null );
mList.put(gesture);
gesture = new LLGesture(KEY_F5, MASK_SHIFT, "/tongue",
LLUUID::null, "Express_Tongue_Out", LLStringUtil::null );
mList.put(gesture);
*/
}
{}
LLGestureList::~LLGestureList()
{
@@ -203,12 +183,7 @@ LLGestureList::~LLGestureList()
void LLGestureList::deleteAll()
{
S32 count = mList.count();
for (S32 i = 0; i < count; i++)
{
delete mList.get(i);
}
mList.reset();
delete_and_clear(mList);
}
// Iterates through space delimited tokens in string, triggering any gestures found.
@@ -235,9 +210,9 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin
std::string cur_token_lower = *token_iter;
LLStringUtil::toLower(cur_token_lower);
for (S32 i = 0; i < mList.count(); i++)
for (U32 i = 0; i < mList.size(); i++)
{
gesture = mList.get(i);
gesture = mList.at(i);
if (gesture->trigger(cur_token_lower))
{
if( !gesture->getOutputString().empty() )
@@ -286,9 +261,9 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin
BOOL LLGestureList::trigger(KEY key, MASK mask)
{
for (S32 i = 0; i < mList.count(); i++)
for (U32 i = 0; i < mList.size(); i++)
{
LLGesture* gesture = mList.get(i);
LLGesture* gesture = mList.at(i);
if( gesture )
{
if (gesture->trigger(key, mask))
@@ -298,7 +273,7 @@ BOOL LLGestureList::trigger(KEY key, MASK mask)
}
else
{
llwarns << "NULL gesture in gesture list (" << i << ")" << llendl;
LL_WARNS() << "NULL gesture in gesture list (" << i << ")" << LL_ENDL;
}
}
return FALSE;
@@ -308,7 +283,7 @@ BOOL LLGestureList::trigger(KEY key, MASK mask)
U8 *LLGestureList::serialize(U8 *buffer) const
{
// a single S32 serves as the header that tells us how many to read
S32 count = mList.count();
U32 count = mList.size();
htonmemcpy(buffer, &count, MVT_S32, 4);
buffer += sizeof(count);
@@ -331,7 +306,7 @@ U8 *LLGestureList::deserialize(U8 *buffer, S32 max_size)
if (tmp + sizeof(count) > buffer + max_size)
{
llwarns << "Invalid max_size" << llendl;
LL_WARNS() << "Invalid max_size" << LL_ENDL;
return buffer;
}
@@ -339,20 +314,20 @@ U8 *LLGestureList::deserialize(U8 *buffer, S32 max_size)
if (count > MAX_GESTURES)
{
llwarns << "Unreasonably large gesture list count in deserialize: " << count << llendl;
LL_WARNS() << "Unreasonably large gesture list count in deserialize: " << count << LL_ENDL;
return tmp;
}
tmp += sizeof(count);
mList.reserve_block(count);
mList.resize(count);
for (S32 i = 0; i < count; i++)
{
mList[i] = create_gesture(&tmp, max_size - (S32)(tmp - buffer));
if (tmp - buffer > max_size)
{
llwarns << "Deserialization read past end of buffer, bad data!!!!" << llendl;
LL_WARNS() << "Deserialization read past end of buffer, bad data!!!!" << LL_ENDL;
return tmp;
}
}

View File

@@ -31,7 +31,6 @@
#include "llanimationstates.h"
#include "lluuid.h"
#include "llstring.h"
#include "lldarray.h"
class LLGesture
{
@@ -91,9 +90,9 @@ public:
BOOL triggerAndReviseString(const std::string &string, std::string* revised_string);
// Used for construction from UI
S32 count() const { return mList.count(); }
virtual LLGesture* get(S32 i) const { return mList.get(i); }
virtual void put(LLGesture* gesture) { mList.put( gesture ); }
S32 count() const { return mList.size(); }
virtual LLGesture* get(S32 i) const { return mList.at(i); }
virtual void put(LLGesture* gesture) { mList.push_back( gesture ); }
void deleteAll();
// non-endian-neutral serialization
@@ -106,7 +105,7 @@ protected:
virtual LLGesture *create_gesture(U8 **buffer, S32 max_size);
protected:
LLDynamicArray<LLGesture*> mList;
std::vector<LLGesture*> mList;
static const S32 SERIAL_HEADER_SIZE;
};

View File

@@ -192,7 +192,7 @@ BOOL LLHandMotion::onUpdate(F32 time, U8* joint_mask)
}
else
{
llwarns << "Requested hand pose out of range. Ignoring requested pose." << llendl;
LL_WARNS() << "Requested hand pose out of range. Ignoring requested pose." << LL_ENDL;
}
}
@@ -200,7 +200,7 @@ BOOL LLHandMotion::onUpdate(F32 time, U8* joint_mask)
mCharacter->removeAnimationData("Hand Pose Priority");
// if (requestedHandPose)
// llinfos << "Hand Pose " << *requestedHandPose << llendl;
// LL_INFOS() << "Hand Pose " << *requestedHandPose << LL_ENDL;
// if we are still blending...
if (mCurrentPose != mNewPose)

View File

@@ -105,7 +105,7 @@ LLMotion::LLMotionInitStatus LLHeadRotMotion::onInitialize(LLCharacter *characte
{
if (!character)
{
llwarns << "character is NULL." << llendl;
LL_WARNS() << "character is NULL." << LL_ENDL;
return STATUS_FAILURE;
}
mCharacter = character;
@@ -113,49 +113,49 @@ LLMotion::LLMotionInitStatus LLHeadRotMotion::onInitialize(LLCharacter *characte
mPelvisJoint = character->getJoint("mPelvis");
if ( ! mPelvisJoint )
{
llinfos << getName() << ": Can't get pelvis joint." << llendl;
LL_INFOS() << getName() << ": Can't get pelvis joint." << LL_ENDL;
return STATUS_FAILURE;
}
mRootJoint = character->getJoint("mRoot");
if ( ! mRootJoint )
{
llinfos << getName() << ": Can't get root joint." << llendl;
LL_INFOS() << getName() << ": Can't get root joint." << LL_ENDL;
return STATUS_FAILURE;
}
mTorsoJoint = character->getJoint("mTorso");
if ( ! mTorsoJoint )
{
llinfos << getName() << ": Can't get torso joint." << llendl;
LL_INFOS() << getName() << ": Can't get torso joint." << LL_ENDL;
return STATUS_FAILURE;
}
mHeadJoint = character->getJoint("mHead");
if ( ! mHeadJoint )
{
llinfos << getName() << ": Can't get head joint." << llendl;
LL_INFOS() << getName() << ": Can't get head joint." << LL_ENDL;
return STATUS_FAILURE;
}
mTorsoState->setJoint( character->getJoint("mTorso") );
if ( ! mTorsoState->getJoint() )
{
llinfos << getName() << ": Can't get torso joint." << llendl;
LL_INFOS() << getName() << ": Can't get torso joint." << LL_ENDL;
return STATUS_FAILURE;
}
mNeckState->setJoint( character->getJoint("mNeck") );
if ( ! mNeckState->getJoint() )
{
llinfos << getName() << ": Can't get neck joint." << llendl;
LL_INFOS() << getName() << ": Can't get neck joint." << LL_ENDL;
return STATUS_FAILURE;
}
mHeadState->setJoint( character->getJoint("mHead") );
if ( ! mHeadState->getJoint() )
{
llinfos << getName() << ": Can't get head joint." << llendl;
LL_INFOS() << getName() << ": Can't get head joint." << LL_ENDL;
return STATUS_FAILURE;
}
@@ -190,7 +190,7 @@ BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask)
{
LLVector3 headLookAt = *targetPos;
// llinfos << "Look At: " << headLookAt + mHeadJoint->getWorldPosition() << llendl;
// LL_INFOS() << "Look At: " << headLookAt + mHeadJoint->getWorldPosition() << LL_ENDL;
F32 lookatDistance = headLookAt.normVec();
@@ -301,21 +301,21 @@ LLMotion::LLMotionInitStatus LLEyeMotion::onInitialize(LLCharacter *character)
mHeadJoint = character->getJoint("mHead");
if ( ! mHeadJoint )
{
llinfos << getName() << ": Can't get head joint." << llendl;
LL_INFOS() << getName() << ": Can't get head joint." << LL_ENDL;
return STATUS_FAILURE;
}
mLeftEyeState->setJoint( character->getJoint("mEyeLeft") );
if ( ! mLeftEyeState->getJoint() )
{
llinfos << getName() << ": Can't get left eyeball joint." << llendl;
LL_INFOS() << getName() << ": Can't get left eyeball joint." << LL_ENDL;
return STATUS_FAILURE;
}
mRightEyeState->setJoint( character->getJoint("mEyeRight") );
if ( ! mRightEyeState->getJoint() )
{
llinfos << getName() << ": Can't get Right eyeball joint." << llendl;
LL_INFOS() << getName() << ": Can't get Right eyeball joint." << LL_ENDL;
return STATUS_FAILURE;
}

View File

@@ -434,7 +434,7 @@ const LLMatrix4a &LLJoint::getWorldMatrix()
//--------------------------------------------------------------------
void LLJoint::setWorldMatrix( const LLMatrix4& mat )
{
llinfos << "WARNING: LLJoint::setWorldMatrix() not correctly implemented yet" << llendl;
LL_INFOS() << "WARNING: LLJoint::setWorldMatrix() not correctly implemented yet" << LL_ENDL;
// extract global translation
LLVector3 trans( mat.mMatrix[VW][VX],
mat.mMatrix[VW][VY],

View File

@@ -141,8 +141,8 @@ void LLJointSolverRP3::setTwist( F32 twist )
//-----------------------------------------------------------------------------
void LLJointSolverRP3::solve()
{
// llinfos << llendl;
// llinfos << "LLJointSolverRP3::solve()" << llendl;
// LL_INFOS() << LL_ENDL;
// LL_INFOS() << "LLJointSolverRP3::solve()" << LL_ENDL;
//-------------------------------------------------------------------------
// setup joints in their base rotations
@@ -158,15 +158,15 @@ void LLJointSolverRP3::solve()
LLVector3 cPos = mJointC->getWorldPosition();
LLVector3 gPos = mJointGoal->getWorldPosition();
// llinfos << "bPosLocal = " << mJointB->getPosition() << llendl;
// llinfos << "cPosLocal = " << mJointC->getPosition() << llendl;
// llinfos << "bRotLocal = " << mJointB->getRotation() << llendl;
// llinfos << "cRotLocal = " << mJointC->getRotation() << llendl;
// LL_INFOS() << "bPosLocal = " << mJointB->getPosition() << LL_ENDL;
// LL_INFOS() << "cPosLocal = " << mJointC->getPosition() << LL_ENDL;
// LL_INFOS() << "bRotLocal = " << mJointB->getRotation() << LL_ENDL;
// LL_INFOS() << "cRotLocal = " << mJointC->getRotation() << LL_ENDL;
// llinfos << "aPos : " << aPos << llendl;
// llinfos << "bPos : " << bPos << llendl;
// llinfos << "cPos : " << cPos << llendl;
// llinfos << "gPos : " << gPos << llendl;
// LL_INFOS() << "aPos : " << aPos << LL_ENDL;
// LL_INFOS() << "bPos : " << bPos << LL_ENDL;
// LL_INFOS() << "cPos : " << cPos << LL_ENDL;
// LL_INFOS() << "gPos : " << gPos << LL_ENDL;
//-------------------------------------------------------------------------
// get the poleVector in world space
@@ -192,10 +192,10 @@ void LLJointSolverRP3::solve()
LLVector3 acVec = cPos - aPos;
LLVector3 agVec = gPos - aPos;
// llinfos << "abVec : " << abVec << llendl;
// llinfos << "bcVec : " << bcVec << llendl;
// llinfos << "acVec : " << acVec << llendl;
// llinfos << "agVec : " << agVec << llendl;
// LL_INFOS() << "abVec : " << abVec << LL_ENDL;
// LL_INFOS() << "bcVec : " << bcVec << LL_ENDL;
// LL_INFOS() << "acVec : " << acVec << LL_ENDL;
// LL_INFOS() << "agVec : " << agVec << LL_ENDL;
//-------------------------------------------------------------------------
// compute needed lengths of those vectors
@@ -204,16 +204,16 @@ void LLJointSolverRP3::solve()
F32 bcLen = bcVec.magVec();
F32 agLen = agVec.magVec();
// llinfos << "abLen : " << abLen << llendl;
// llinfos << "bcLen : " << bcLen << llendl;
// llinfos << "agLen : " << agLen << llendl;
// LL_INFOS() << "abLen : " << abLen << LL_ENDL;
// LL_INFOS() << "bcLen : " << bcLen << LL_ENDL;
// LL_INFOS() << "agLen : " << agLen << LL_ENDL;
//-------------------------------------------------------------------------
// compute component vector of (A->B) orthogonal to (A->C)
//-------------------------------------------------------------------------
LLVector3 abacCompOrthoVec = abVec - acVec * ((abVec * acVec)/(acVec * acVec));
// llinfos << "abacCompOrthoVec : " << abacCompOrthoVec << llendl;
// LL_INFOS() << "abacCompOrthoVec : " << abacCompOrthoVec << LL_ENDL;
//-------------------------------------------------------------------------
// compute the normal of the original ABC plane (and store for later)
@@ -281,13 +281,13 @@ void LLJointSolverRP3::solve()
LLQuaternion bRot(theta - abbcAng, abbcOrthoVec);
// llinfos << "abbcAng : " << abbcAng << llendl;
// llinfos << "abbcOrthoVec : " << abbcOrthoVec << llendl;
// llinfos << "agLenSq : " << agLenSq << llendl;
// llinfos << "cosTheta : " << cosTheta << llendl;
// llinfos << "theta : " << theta << llendl;
// llinfos << "bRot : " << bRot << llendl;
// llinfos << "theta abbcAng theta-abbcAng: " << theta*180.0/F_PI << " " << abbcAng*180.0f/F_PI << " " << (theta - abbcAng)*180.0f/F_PI << llendl;
// LL_INFOS() << "abbcAng : " << abbcAng << LL_ENDL;
// LL_INFOS() << "abbcOrthoVec : " << abbcOrthoVec << LL_ENDL;
// LL_INFOS() << "agLenSq : " << agLenSq << LL_ENDL;
// LL_INFOS() << "cosTheta : " << cosTheta << LL_ENDL;
// LL_INFOS() << "theta : " << theta << LL_ENDL;
// LL_INFOS() << "bRot : " << bRot << LL_ENDL;
// LL_INFOS() << "theta abbcAng theta-abbcAng: " << theta*180.0/F_PI << " " << abbcAng*180.0f/F_PI << " " << (theta - abbcAng)*180.0f/F_PI << LL_ENDL;
//-------------------------------------------------------------------------
// compute rotation that rotates new A->C to A->G
@@ -301,9 +301,9 @@ void LLJointSolverRP3::solve()
LLQuaternion cgRot;
cgRot.shortestArc( acVec, agVec );
// llinfos << "bcVec : " << bcVec << llendl;
// llinfos << "acVec : " << acVec << llendl;
// llinfos << "cgRot : " << cgRot << llendl;
// LL_INFOS() << "bcVec : " << bcVec << LL_ENDL;
// LL_INFOS() << "acVec : " << acVec << LL_ENDL;
// LL_INFOS() << "cgRot : " << cgRot << LL_ENDL;
// update A->B and B->C with rotation from C to G
abVec = abVec * cgRot;
@@ -361,18 +361,18 @@ void LLJointSolverRP3::solve()
pRot.shortestArc( abcNorm, apgNorm );
}
// llinfos << "abcNorm = " << abcNorm << llendl;
// llinfos << "apgNorm = " << apgNorm << llendl;
// llinfos << "pRot = " << pRot << llendl;
// LL_INFOS() << "abcNorm = " << abcNorm << LL_ENDL;
// LL_INFOS() << "apgNorm = " << apgNorm << LL_ENDL;
// LL_INFOS() << "pRot = " << pRot << LL_ENDL;
//-------------------------------------------------------------------------
// compute twist rotation
//-------------------------------------------------------------------------
LLQuaternion twistRot( mTwist, agVec );
// llinfos << "twist : " << mTwist*180.0/F_PI << llendl;
// llinfos << "agNormVec: " << agNormVec << llendl;
// llinfos << "twistRot : " << twistRot << llendl;
// LL_INFOS() << "twist : " << mTwist*180.0/F_PI << LL_ENDL;
// LL_INFOS() << "agNormVec: " << agNormVec << LL_ENDL;
// LL_INFOS() << "twistRot : " << twistRot << LL_ENDL;
//-------------------------------------------------------------------------
// compute rotation of A

View File

@@ -95,14 +95,14 @@ U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo(bool silent) const
if (!silent)
{
llinfos << "\tJoint " << joint_motion_p->mJointName << llendl;
LL_INFOS() << "\tJoint " << joint_motion_p->mJointName << LL_ENDL;
}
if (joint_motion_p->mUsage & LLJointState::SCALE)
{
if (!silent)
{
llinfos << "\t" << joint_motion_p->mScaleCurve.mNumKeys << " scale keys at "
<< joint_motion_p->mScaleCurve.mNumKeys * sizeof(ScaleKey) << " bytes" << llendl;
LL_INFOS() << "\t" << joint_motion_p->mScaleCurve.mNumKeys << " scale keys at "
<< joint_motion_p->mScaleCurve.mNumKeys * sizeof(ScaleKey) << " bytes" << LL_ENDL;
}
total_size += joint_motion_p->mScaleCurve.mNumKeys * sizeof(ScaleKey);
}
@@ -110,8 +110,8 @@ U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo(bool silent) const
{
if (!silent)
{
llinfos << "\t" << joint_motion_p->mRotationCurve.mNumKeys << " rotation keys at "
<< joint_motion_p->mRotationCurve.mNumKeys * sizeof(RotationKey) << " bytes" << llendl;
LL_INFOS() << "\t" << joint_motion_p->mRotationCurve.mNumKeys << " rotation keys at "
<< joint_motion_p->mRotationCurve.mNumKeys * sizeof(RotationKey) << " bytes" << LL_ENDL;
}
total_size += joint_motion_p->mRotationCurve.mNumKeys * sizeof(RotationKey);
}
@@ -119,8 +119,8 @@ U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo(bool silent) const
{
if (!silent)
{
llinfos << "\t" << joint_motion_p->mPositionCurve.mNumKeys << " position keys at "
<< joint_motion_p->mPositionCurve.mNumKeys * sizeof(PositionKey) << " bytes" << llendl;
LL_INFOS() << "\t" << joint_motion_p->mPositionCurve.mNumKeys << " position keys at "
<< joint_motion_p->mPositionCurve.mNumKeys * sizeof(PositionKey) << " bytes" << LL_ENDL;
}
total_size += joint_motion_p->mPositionCurve.mNumKeys * sizeof(PositionKey);
}
@@ -130,8 +130,8 @@ U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo(bool silent) const
total_size += constraints_size;
if (!silent)
{
llinfos << "\t" << mConstraints.size() << " constraints at " << constraints_size << " bytes" << llendl;
llinfos << "Size: " << total_size << " bytes" << llendl;
LL_INFOS() << "\t" << mConstraints.size() << " constraints at " << constraints_size << " bytes" << LL_ENDL;
LL_INFOS() << "Size: " << total_size << " bytes" << LL_ENDL;
}
return total_size;
@@ -482,7 +482,7 @@ LLPointer<LLJointState>& LLKeyframeMotion::getJointState(U32 index)
//llassert_always (index < (S32)mJointStates.size());
if(index >= (S32)mJointStates.size())
{
llwarns << "LLKeyframeMotion::getJointState: index >= size" << llendl;
LL_WARNS() << "LLKeyframeMotion::getJointState: index >= size" << LL_ENDL;
index = (S32)mJointStates.size() - 1;
}
// </edit>
@@ -533,7 +533,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
case ASSET_FETCHED:
return STATUS_HOLD;
case ASSET_FETCH_FAILED:
llwarns << "Trying to initialize a motion that failed to be fetched." << llendl;
LL_WARNS() << "Trying to initialize a motion that failed to be fetched." << LL_ENDL;
return STATUS_FAILURE;
case ASSET_LOADED:
return STATUS_SUCCESS;
@@ -585,7 +585,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
if (!sVFS)
{
llerrs << "Must call LLKeyframeMotion::setVFS() first before loading a keyframe file!" << llendl;
LL_ERRS() << "Must call LLKeyframeMotion::setVFS() first before loading a keyframe file!" << LL_ENDL;
}
BOOL success = FALSE;
@@ -611,18 +611,18 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
if (!success)
{
llwarns << "Can't open animation file " << mID << llendl;
LL_WARNS() << "Can't open animation file " << mID << LL_ENDL;
mAssetStatus = ASSET_FETCH_FAILED;
return STATUS_FAILURE;
}
lldebugs << "Loading keyframe data for: " << getName() << ":" << getID() << " (" << anim_file_size << " bytes)" << llendl;
LL_DEBUGS() << "Loading keyframe data for: " << getName() << ":" << getID() << " (" << anim_file_size << " bytes)" << LL_ENDL;
LLDataPackerBinaryBuffer dp(anim_data, anim_file_size);
if (!deserialize(dp))
{
llwarns << "Failed to decode asset for animation " << getName() << ":" << getID() << llendl;
LL_WARNS() << "Failed to decode asset for animation " << getName() << ":" << getID() << LL_ENDL;
mAssetStatus = ASSET_FETCH_FAILED;
return STATUS_FAILURE;
}
@@ -1150,7 +1150,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
// convert intermediate joint positions to world coordinates
positions[joint_num] = ( constraint->mPositions[joint_num] * mPelvisp->getWorldRotation()) + mPelvisp->getWorldPosition();
F32 time_constant = 1.f / clamp_rescale(constraint->mFixupDistanceRMS, 0.f, 0.5f, 0.2f, 8.f);
// llinfos << "Interpolant " << LLCriticalDamp::getInterpolant(time_constant, FALSE) << " and fixup distance " << constraint->mFixupDistanceRMS << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << llendl;
// LL_INFOS() << "Interpolant " << LLCriticalDamp::getInterpolant(time_constant, FALSE) << " and fixup distance " << constraint->mFixupDistanceRMS << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << LL_ENDL;
positions[joint_num] = lerp(positions[joint_num], kinematic_position,
LLCriticalDamp::getInterpolant(time_constant, FALSE));
}
@@ -1181,8 +1181,8 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
if ((iteration_count >= MIN_ITERATION_COUNT) &&
(num_joints_finished == shared_data->mChainLength - 1))
{
// llinfos << iteration_count << " iterations on " <<
// mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << llendl;
// LL_INFOS() << iteration_count << " iterations on " <<
// mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << LL_ENDL;
break;
}
}
@@ -1330,13 +1330,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackU16(version, "version"))
{
llwarns << "can't read version number" << llendl;
LL_WARNS() << "can't read version number" << LL_ENDL;
return FALSE;
}
if (!dp.unpackU16(sub_version, "sub_version"))
{
llwarns << "can't read sub version number" << llendl;
LL_WARNS() << "can't read sub version number" << LL_ENDL;
return FALSE;
}
@@ -1347,16 +1347,16 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
else if (version != KEYFRAME_MOTION_VERSION || sub_version != KEYFRAME_MOTION_SUBVERSION)
{
#if LL_RELEASE
llwarns << "Bad animation version " << version << "." << sub_version << llendl;
LL_WARNS() << "Bad animation version " << version << "." << sub_version << LL_ENDL;
return FALSE;
#else
llerrs << "Bad animation version " << version << "." << sub_version << llendl;
LL_ERRS() << "Bad animation version " << version << "." << sub_version << LL_ENDL;
#endif
}
if (!dp.unpackS32(temp_priority, "base_priority"))
{
llwarns << "can't read animation base_priority" << llendl;
LL_WARNS() << "can't read animation base_priority" << LL_ENDL;
return FALSE;
}
mJointMotionList->mBasePriority = (LLJoint::JointPriority) temp_priority;
@@ -1368,7 +1368,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
}
else if (mJointMotionList->mBasePriority < LLJoint::USE_MOTION_PRIORITY)
{
llwarns << "bad animation base_priority " << mJointMotionList->mBasePriority << llendl;
LL_WARNS() << "bad animation base_priority " << mJointMotionList->mBasePriority << LL_ENDL;
return FALSE;
}
@@ -1377,14 +1377,14 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
//-------------------------------------------------------------------------
if (!dp.unpackF32(mJointMotionList->mDuration, "duration"))
{
llwarns << "can't read duration" << llendl;
LL_WARNS() << "can't read duration" << LL_ENDL;
return FALSE;
}
if (mJointMotionList->mDuration > MAX_ANIM_DURATION ||
!llfinite(mJointMotionList->mDuration))
{
llwarns << "invalid animation duration" << llendl;
LL_WARNS() << "invalid animation duration" << LL_ENDL;
return FALSE;
}
@@ -1393,13 +1393,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
//-------------------------------------------------------------------------
if (!dp.unpackString(mJointMotionList->mEmoteName, "emote_name"))
{
llwarns << "can't read optional_emote_animation" << llendl;
LL_WARNS() << "can't read optional_emote_animation" << LL_ENDL;
return FALSE;
}
if(mJointMotionList->mEmoteName==mID.asString())
{
llwarns << "Malformed animation mEmoteName==mID" << llendl;
LL_WARNS() << "Malformed animation mEmoteName==mID" << LL_ENDL;
return FALSE;
}
@@ -1409,20 +1409,20 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackF32(mJointMotionList->mLoopInPoint, "loop_in_point") ||
!llfinite(mJointMotionList->mLoopInPoint))
{
llwarns << "can't read loop point" << llendl;
LL_WARNS() << "can't read loop point" << LL_ENDL;
return FALSE;
}
if (!dp.unpackF32(mJointMotionList->mLoopOutPoint, "loop_out_point") ||
!llfinite(mJointMotionList->mLoopOutPoint))
{
llwarns << "can't read loop point" << llendl;
LL_WARNS() << "can't read loop point" << LL_ENDL;
return FALSE;
}
if (!dp.unpackS32(mJointMotionList->mLoop, "loop"))
{
llwarns << "can't read loop" << llendl;
LL_WARNS() << "can't read loop" << LL_ENDL;
return FALSE;
}
@@ -1432,14 +1432,14 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackF32(mJointMotionList->mEaseInDuration, "ease_in_duration") ||
!llfinite(mJointMotionList->mEaseInDuration))
{
llwarns << "can't read easeIn" << llendl;
LL_WARNS() << "can't read easeIn" << LL_ENDL;
return FALSE;
}
if (!dp.unpackF32(mJointMotionList->mEaseOutDuration, "ease_out_duration") ||
!llfinite(mJointMotionList->mEaseOutDuration))
{
llwarns << "can't read easeOut" << llendl;
LL_WARNS() << "can't read easeOut" << LL_ENDL;
return FALSE;
}
@@ -1449,13 +1449,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
U32 word;
if (!dp.unpackU32(word, "hand_pose"))
{
llwarns << "can't read hand pose" << llendl;
LL_WARNS() << "can't read hand pose" << LL_ENDL;
return FALSE;
}
if(word > LLHandMotion::NUM_HAND_POSES)
{
llwarns << "invalid LLHandMotion::eHandPose index: " << word << llendl;
LL_WARNS() << "invalid LLHandMotion::eHandPose index: " << word << LL_ENDL;
return FALSE;
}
@@ -1467,18 +1467,18 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
U32 num_motions = 0;
if (!dp.unpackU32(num_motions, "num_joints"))
{
llwarns << "can't read number of joints" << llendl;
LL_WARNS() << "can't read number of joints" << LL_ENDL;
return FALSE;
}
if (num_motions == 0)
{
llwarns << "no joints in animation" << llendl;
LL_WARNS() << "no joints in animation" << LL_ENDL;
return FALSE;
}
else if (num_motions > LL_CHARACTER_MAX_JOINTS)
{
llwarns << "too many joints in animation" << llendl;
LL_WARNS() << "too many joints in animation" << LL_ENDL;
return FALSE;
}
@@ -1512,13 +1512,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
std::string joint_name;
if (!dp.unpackString(joint_name, "joint_name"))
{
llwarns << "can't read joint name" << llendl;
LL_WARNS() << "can't read joint name" << LL_ENDL;
return FALSE;
}
if (joint_name == "mScreen" || joint_name == "mRoot")
{
llwarns << "attempted to animate special " << joint_name << " joint" << llendl;
LL_WARNS() << "attempted to animate special " << joint_name << " joint" << LL_ENDL;
return FALSE;
}
@@ -1528,7 +1528,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
LLJoint *joint = mCharacter->getJoint( joint_name );
if (joint)
{
// llinfos << " joint: " << joint_name << llendl;
// LL_INFOS() << " joint: " << joint_name << LL_ENDL;
}
else
{
@@ -1544,7 +1544,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
i++;
}
// </edit>
llwarns << "joint not found: " << joint_name << llendl;
LL_WARNS() << "joint not found: " << joint_name << LL_ENDL;
//return FALSE;
}
@@ -1561,13 +1561,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
S32 joint_priority;
if (!dp.unpackS32(joint_priority, "joint_priority"))
{
llwarns << "can't read joint priority." << llendl;
LL_WARNS() << "can't read joint priority." << LL_ENDL;
return FALSE;
}
if (joint_priority < LLJoint::USE_MOTION_PRIORITY)
{
llwarns << "joint priority unknown - too low." << llendl;
LL_WARNS() << "joint priority unknown - too low." << LL_ENDL;
return FALSE;
}
@@ -1585,7 +1585,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
//---------------------------------------------------------------------
if (!dp.unpackS32(joint_motion->mRotationCurve.mNumKeys, "num_rot_keys") || joint_motion->mRotationCurve.mNumKeys < 0)
{
llwarns << "can't read number of rotation keys" << llendl;
LL_WARNS() << "can't read number of rotation keys" << LL_ENDL;
return FALSE;
}
@@ -1610,7 +1610,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackF32(time, "time") ||
!llfinite(time))
{
llwarns << "can't read rotation key (" << k << ")" << llendl;
LL_WARNS() << "can't read rotation key (" << k << ")" << LL_ENDL;
return FALSE;
}
@@ -1619,7 +1619,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
{
if (!dp.unpackU16(time_short, "time"))
{
llwarns << "can't read rotation key (" << k << ")" << llendl;
LL_WARNS() << "can't read rotation key (" << k << ")" << LL_ENDL;
return FALSE;
}
@@ -1627,7 +1627,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (time < 0 || time > mJointMotionList->mDuration)
{
llwarns << "invalid frame time" << llendl;
LL_WARNS() << "invalid frame time" << LL_ENDL;
return FALSE;
}
}
@@ -1661,13 +1661,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if( !(rot_key.mRotation.isFinite()) )
{
llwarns << "non-finite angle in rotation key" << llendl;
LL_WARNS() << "non-finite angle in rotation key" << LL_ENDL;
success = FALSE;
}
if (!success)
{
llwarns << "can't read rotation key (" << k << ")" << llendl;
LL_WARNS() << "can't read rotation key (" << k << ")" << LL_ENDL;
return FALSE;
}
@@ -1679,7 +1679,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
//---------------------------------------------------------------------
if (!dp.unpackS32(joint_motion->mPositionCurve.mNumKeys, "num_pos_keys") || joint_motion->mPositionCurve.mNumKeys < 0)
{
llwarns << "can't read number of position keys" << llendl;
LL_WARNS() << "can't read number of position keys" << LL_ENDL;
return FALSE;
}
@@ -1704,7 +1704,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackF32(pos_key.mTime, "time") ||
!llfinite(pos_key.mTime))
{
llwarns << "can't read position key (" << k << ")" << llendl;
LL_WARNS() << "can't read position key (" << k << ")" << LL_ENDL;
return FALSE;
}
}
@@ -1712,7 +1712,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
{
if (!dp.unpackU16(time_short, "time"))
{
llwarns << "can't read position key (" << k << ")" << llendl;
LL_WARNS() << "can't read position key (" << k << ")" << LL_ENDL;
return FALSE;
}
@@ -1740,13 +1740,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if( !(pos_key.mPosition.isFinite()) )
{
llwarns << "non-finite position in key" << llendl;
LL_WARNS() << "non-finite position in key" << LL_ENDL;
success = FALSE;
}
if (!success)
{
llwarns << "can't read position key (" << k << ")" << llendl;
LL_WARNS() << "can't read position key (" << k << ")" << LL_ENDL;
return FALSE;
}
@@ -1767,13 +1767,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
S32 num_constraints = 0;
if (!dp.unpackS32(num_constraints, "num_constraints"))
{
llwarns << "can't read number of constraints" << llendl;
LL_WARNS() << "can't read number of constraints" << LL_ENDL;
return FALSE;
}
if (num_constraints > MAX_CONSTRAINTS || num_constraints < 0)
{
llwarns << "Bad number of constraints... ignoring: " << num_constraints << llendl;
LL_WARNS() << "Bad number of constraints... ignoring: " << num_constraints << LL_ENDL;
}
else
{
@@ -1789,7 +1789,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackU8(byte, "chain_length"))
{
llwarns << "can't read constraint chain length" << llendl;
LL_WARNS() << "can't read constraint chain length" << LL_ENDL;
delete constraintp;
return FALSE;
}
@@ -1797,21 +1797,21 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if((U32)constraintp->mChainLength > mJointMotionList->getNumJointMotions())
{
llwarns << "invalid constraint chain length" << llendl;
LL_WARNS() << "invalid constraint chain length" << LL_ENDL;
delete constraintp;
return FALSE;
}
if (!dp.unpackU8(byte, "constraint_type"))
{
llwarns << "can't read constraint type" << llendl;
LL_WARNS() << "can't read constraint type" << LL_ENDL;
delete constraintp;
return FALSE;
}
if( byte >= NUM_CONSTRAINT_TYPES )
{
llwarns << "invalid constraint type" << llendl;
LL_WARNS() << "invalid constraint type" << LL_ENDL;
delete constraintp;
return FALSE;
}
@@ -1821,7 +1821,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
U8 bin_data[BIN_DATA_LENGTH+1];
if (!dp.unpackBinaryDataFixed(bin_data, BIN_DATA_LENGTH, "source_volume"))
{
llwarns << "can't read source volume name" << llendl;
LL_WARNS() << "can't read source volume name" << LL_ENDL;
delete constraintp;
return FALSE;
}
@@ -1833,7 +1833,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
// <edit>
if(constraintp->mSourceConstraintVolume == -1)
{
llwarns << "can't get source constraint volume" << llendl;
LL_WARNS() << "can't get source constraint volume" << LL_ENDL;
delete constraintp;
return FALSE;
}
@@ -1841,21 +1841,21 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackVector3(constraintp->mSourceConstraintOffset, "source_offset"))
{
llwarns << "can't read constraint source offset" << llendl;
LL_WARNS() << "can't read constraint source offset" << LL_ENDL;
delete constraintp;
return FALSE;
}
if( !(constraintp->mSourceConstraintOffset.isFinite()) )
{
llwarns << "non-finite constraint source offset" << llendl;
LL_WARNS() << "non-finite constraint source offset" << LL_ENDL;
delete constraintp;
return FALSE;
}
if (!dp.unpackBinaryDataFixed(bin_data, BIN_DATA_LENGTH, "target_volume"))
{
llwarns << "can't read target volume name" << llendl;
LL_WARNS() << "can't read target volume name" << LL_ENDL;
delete constraintp;
return FALSE;
}
@@ -1875,28 +1875,28 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackVector3(constraintp->mTargetConstraintOffset, "target_offset"))
{
llwarns << "can't read constraint target offset" << llendl;
LL_WARNS() << "can't read constraint target offset" << LL_ENDL;
delete constraintp;
return FALSE;
}
if( !(constraintp->mTargetConstraintOffset.isFinite()) )
{
llwarns << "non-finite constraint target offset" << llendl;
LL_WARNS() << "non-finite constraint target offset" << LL_ENDL;
delete constraintp;
return FALSE;
}
if (!dp.unpackVector3(constraintp->mTargetConstraintDir, "target_dir"))
{
llwarns << "can't read constraint target direction" << llendl;
LL_WARNS() << "can't read constraint target direction" << LL_ENDL;
delete constraintp;
return FALSE;
}
if( !(constraintp->mTargetConstraintDir.isFinite()) )
{
llwarns << "non-finite constraint target direction" << llendl;
LL_WARNS() << "non-finite constraint target direction" << LL_ENDL;
delete constraintp;
return FALSE;
}
@@ -1909,28 +1909,28 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackF32(constraintp->mEaseInStartTime, "ease_in_start") || !llfinite(constraintp->mEaseInStartTime))
{
llwarns << "can't read constraint ease in start time" << llendl;
LL_WARNS() << "can't read constraint ease in start time" << LL_ENDL;
delete constraintp;
return FALSE;
}
if (!dp.unpackF32(constraintp->mEaseInStopTime, "ease_in_stop") || !llfinite(constraintp->mEaseInStopTime))
{
llwarns << "can't read constraint ease in stop time" << llendl;
LL_WARNS() << "can't read constraint ease in stop time" << LL_ENDL;
delete constraintp;
return FALSE;
}
if (!dp.unpackF32(constraintp->mEaseOutStartTime, "ease_out_start") || !llfinite(constraintp->mEaseOutStartTime))
{
llwarns << "can't read constraint ease out start time" << llendl;
LL_WARNS() << "can't read constraint ease out start time" << LL_ENDL;
delete constraintp;
return FALSE;
}
if (!dp.unpackF32(constraintp->mEaseOutStopTime, "ease_out_stop") || !llfinite(constraintp->mEaseOutStopTime))
{
llwarns << "can't read constraint ease out stop time" << llendl;
LL_WARNS() << "can't read constraint ease out stop time" << LL_ENDL;
delete constraintp;
return FALSE;
}
@@ -1958,8 +1958,8 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
LLJoint* parent = joint->getParent();
if (!parent)
{
llwarns << "Joint with no parent: " << joint->getName()
<< " Emote: " << mJointMotionList->mEmoteName << llendl;
LL_WARNS() << "Joint with no parent: " << joint->getName()
<< " Emote: " << mJointMotionList->mEmoteName << LL_ENDL;
return FALSE;
}
joint = parent;
@@ -1970,7 +1970,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if ( !constraint_joint )
{
llwarns << "Invalid joint " << j << llendl;
LL_WARNS() << "Invalid joint " << j << LL_ENDL;
return FALSE;
}
@@ -1982,7 +1982,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
}
if (constraintp->mJointStateIndices[i] < 0 )
{
llwarns << "No joint index for constraint " << i << llendl;
LL_WARNS() << "No joint index for constraint " << i << LL_ENDL;
return FALSE;
}
}
@@ -2300,7 +2300,7 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
U8* buffer = new U8[size];
file.read((U8*)buffer, size); /*Flawfinder: ignore*/
lldebugs << "Loading keyframe data for: " << motionp->getName() << ":" << motionp->getID() << " (" << size << " bytes)" << llendl;
LL_DEBUGS() << "Loading keyframe data for: " << motionp->getName() << ":" << motionp->getID() << " (" << size << " bytes)" << LL_ENDL;
LLDataPackerBinaryBuffer dp(buffer, size);
if (motionp->deserialize(dp))
@@ -2309,7 +2309,7 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
}
else
{
llwarns << "Failed to decode asset for animation " << motionp->getName() << ":" << motionp->getID() << llendl;
LL_WARNS() << "Failed to decode asset for animation " << motionp->getName() << ":" << motionp->getID() << LL_ENDL;
motionp->mAssetStatus = ASSET_FETCH_FAILED;
}
@@ -2317,13 +2317,13 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
}
else
{
llwarns << "Failed to load asset for animation " << motionp->getName() << ":" << motionp->getID() << llendl;
LL_WARNS() << "Failed to load asset for animation " << motionp->getName() << ":" << motionp->getID() << LL_ENDL;
motionp->mAssetStatus = ASSET_FETCH_FAILED;
}
}
else
{
llwarns << "No existing motion for asset data. UUID: " << asset_uuid << llendl;
LL_WARNS() << "No existing motion for asset data. UUID: " << asset_uuid << LL_ENDL;
}
}
@@ -2344,9 +2344,9 @@ void LLKeyframeDataCache::dumpDiagInfo(int quiet)
if (quiet < 2)
{
llinfos << "-----------------------------------------------------" << llendl;
llinfos << " Global Motion Table" << llendl;
llinfos << "-----------------------------------------------------" << llendl;
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
LL_INFOS() << " Global Motion Table" << LL_ENDL;
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
}
// print each loaded mesh, and it's memory usage
@@ -2359,7 +2359,7 @@ void LLKeyframeDataCache::dumpDiagInfo(int quiet)
if (quiet < 2)
{
llinfos << "Motion: " << map_it->key() << llendl;
LL_INFOS() << "Motion: " << map_it->key() << LL_ENDL;
}
if (motion_list_p)
@@ -2371,14 +2371,14 @@ void LLKeyframeDataCache::dumpDiagInfo(int quiet)
if (quiet < 2)
{
llinfos << "-----------------------------------------------------" << llendl;
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
}
llinfos << "Motions\tTotal Size" << llendl;
LL_INFOS() << "Motions\tTotal Size" << LL_ENDL;
snprintf(buf, sizeof(buf), "%d\t\t%d bytes", (S32)sKeyframeDataMap.size(), total_size ); /* Flawfinder: ignore */
llinfos << buf << llendl;
LL_INFOS() << buf << LL_ENDL;
if (quiet < 2)
{
llinfos << "-----------------------------------------------------" << llendl;
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
}
}

View File

@@ -125,7 +125,7 @@ LLMotion::LLMotionInitStatus LLKeyframeStandMotion::onInitialize(LLCharacter *ch
!mKneeRightState ||
!mAnkleRightState )
{
llinfos << getName() << ": Can't find necessary joint states" << llendl;
LL_INFOS() << getName() << ": Can't find necessary joint states" << LL_ENDL;
return STATUS_FAILURE;
}
@@ -333,9 +333,9 @@ BOOL LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask)
mKneeRightState->setRotation( mKneeRightJoint.getRotation() );
mAnkleRightState->setRotation( mAnkleRightJoint.getRotation() );
//llinfos << "Stand drift amount " << (mCharacter->getCharacterPosition() - mLastGoodPosition).magVec() << llendl;
//LL_INFOS() << "Stand drift amount " << (mCharacter->getCharacterPosition() - mLastGoodPosition).magVec() << LL_ENDL;
// llinfos << "DEBUG: " << speed << " : " << mTrackAnkles << llendl;
// LL_INFOS() << "DEBUG: " << speed << " : " << mTrackAnkles << LL_ENDL;
return TRUE;
}

View File

@@ -163,7 +163,7 @@ LLMotion::LLMotionInitStatus LLWalkAdjustMotion::onInitialize(LLCharacter *chara
mPelvisState->setJoint( mPelvisJoint );
if ( !mPelvisJoint )
{
llwarns << getName() << ": Can't get pelvis joint." << llendl;
LL_WARNS() << getName() << ": Can't get pelvis joint." << LL_ENDL;
return STATUS_FAILURE;
}
@@ -351,7 +351,7 @@ LLMotion::LLMotionInitStatus LLFlyAdjustMotion::onInitialize(LLCharacter *charac
mPelvisState->setJoint( pelvisJoint );
if ( !pelvisJoint )
{
llwarns << getName() << ": Can't get pelvis joint." << llendl;
LL_WARNS() << getName() << ": Can't get pelvis joint." << LL_ENDL;
return STATUS_FAILURE;
}

View File

@@ -297,10 +297,10 @@ public:
LLMotionBlendType getBlendType() { return NORMAL_BLEND; }
F32 getMinPixelArea() { return 0.f; }
LLMotionInitStatus onInitialize(LLCharacter*) { llinfos << "LLTestMotion::onInitialize()" << llendl; return STATUS_SUCCESS; }
BOOL onActivate() { llinfos << "LLTestMotion::onActivate()" << llendl; return TRUE; }
BOOL onUpdate(F32 time, U8* joint_mask) { llinfos << "LLTestMotion::onUpdate(" << time << ")" << llendl; return TRUE; }
void onDeactivate() { llinfos << "LLTestMotion::onDeactivate()" << llendl; }
LLMotionInitStatus onInitialize(LLCharacter*) { LL_INFOS() << "LLTestMotion::onInitialize()" << LL_ENDL; return STATUS_SUCCESS; }
BOOL onActivate() { LL_INFOS() << "LLTestMotion::onActivate()" << LL_ENDL; return TRUE; }
BOOL onUpdate(F32 time, U8* joint_mask) { LL_INFOS() << "LLTestMotion::onUpdate(" << time << ")" << LL_ENDL; return TRUE; }
void onDeactivate() { LL_INFOS() << "LLTestMotion::onDeactivate()" << LL_ENDL; }
};

View File

@@ -82,7 +82,7 @@ LLMotionRegistry::~LLMotionRegistry()
//-----------------------------------------------------------------------------
BOOL LLMotionRegistry::registerMotion( const LLUUID& id, LLMotionConstructor constructor )
{
// llinfos << "Registering motion: " << name << llendl;
// LL_INFOS() << "Registering motion: " << name << LL_ENDL;
return mMotionTable.insert(std::make_pair(id,constructor)).second;
}
@@ -236,7 +236,7 @@ void LLMotionController::purgeExcessMotions()
if (mLoadedMotions.size() > 2*MAX_MOTION_INSTANCES)
{
LL_WARNS_ONCE("Animation") << "> " << 2*MAX_MOTION_INSTANCES << " Loaded Motions" << llendl;
LL_WARNS_ONCE("Animation") << "> " << 2*MAX_MOTION_INSTANCES << " Loaded Motions" << LL_ENDL;
}
}
@@ -384,7 +384,7 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id )
switch(stat)
{
case LLMotion::STATUS_FAILURE:
llinfos << "Motion " << id << " init failed." << llendl;
LL_INFOS() << "Motion " << id << " init failed." << LL_ENDL;
sRegistry.markBad(id);
delete motion;
return NULL;
@@ -396,7 +396,7 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id )
mLoadedMotions.insert(motion);
break;
default:
llerrs << "Invalid initialization status" << llendl;
LL_ERRS() << "Invalid initialization status" << LL_ENDL;
break;
}
@@ -443,7 +443,7 @@ BOOL LLMotionController::startMotion(const LLUUID &id, F32 start_offset)
return TRUE;
}
// llinfos << "Starting motion " << name << llendl;
// LL_INFOS() << "Starting motion " << name << LL_ENDL;
//<singu>
F32 start_time = mAnimTime - start_offset;
if (!mDisableSyncing)
@@ -829,7 +829,7 @@ void LLMotionController::updateLoadingMotions()
}
else if (status == LLMotion::STATUS_FAILURE)
{
llinfos << "Motion " << motionp->getID() << " init failed." << llendl;
LL_INFOS() << "Motion " << motionp->getID() << " init failed." << LL_ENDL;
sRegistry.markBad(motionp->getID());
mLoadingMotions.erase(curiter);
// Singu note: a motion in mLoadingMotions will not be in mActiveMotions
@@ -941,7 +941,7 @@ void LLMotionController::updateMotions(bool force_update)
}
mHasRunOnce = TRUE;
// llinfos << "Motion controller time " << motionTimer.getElapsedTimeF32() << llendl;
// LL_INFOS() << "Motion controller time " << motionTimer.getElapsedTimeF32() << LL_ENDL;
}
//-----------------------------------------------------------------------------
@@ -1101,7 +1101,7 @@ LLMotion* LLMotionController::findMotion(const LLUUID& id) const
//-----------------------------------------------------------------------------
void LLMotionController::dumpMotions()
{
llinfos << "=====================================" << llendl;
LL_INFOS() << "=====================================" << LL_ENDL;
for (motion_map_t::iterator iter = mAllMotions.begin();
iter != mAllMotions.end(); iter++)
{
@@ -1115,7 +1115,7 @@ void LLMotionController::dumpMotions()
if (std::find(mActiveMotions.begin(), mActiveMotions.end(), motion)!=mActiveMotions.end())
state_string += std::string("A");
llassert(mDeprecatedMotions.find(motion) == mDeprecatedMotions.end()); // singu: it's impossible that a motion is in mAllMotions and mDeprecatedMotions at the same time.
llinfos << gAnimLibrary.animationName(id) << " " << state_string << llendl;
LL_INFOS() << gAnimLibrary.animationName(id) << " " << state_string << LL_ENDL;
}
//<singu>
// Also dump the deprecated motions.
@@ -1131,7 +1131,7 @@ void LLMotionController::dumpMotions()
if (std::find(mActiveMotions.begin(), mActiveMotions.end(), motion)!=mActiveMotions.end())
state_string += std::string("A");
state_string += "D";
llinfos << gAnimLibrary.animationName(id) << " " << state_string << llendl;
LL_INFOS() << gAnimLibrary.animationName(id) << " " << state_string << LL_ENDL;
}
//</singu>
}
@@ -1312,7 +1312,7 @@ void LLMotionController::pauseAllMotions()
{
if (!mPaused)
{
//llinfos << "Pausing animations..." << llendl;
//LL_INFOS() << "Pausing animations..." << LL_ENDL;
mPaused = TRUE;
}
@@ -1325,7 +1325,7 @@ void LLMotionController::unpauseAllMotions()
{
if (mPaused)
{
//llinfos << "Unpausing animations..." << llendl;
//LL_INFOS() << "Unpausing animations..." << LL_ENDL;
mPaused = FALSE;
}
}

View File

@@ -147,9 +147,9 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
dp.unpackS32(version, "version");
if (version != GESTURE_VERSION)
{
llwarns << "Bad LLMultiGesture version " << version
LL_WARNS() << "Bad LLMultiGesture version " << version
<< " should be " << GESTURE_VERSION
<< llendl;
<< LL_ENDL;
return FALSE;
}
@@ -165,7 +165,7 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
dp.unpackS32(count, "step_count");
if (count < 0)
{
llwarns << "Bad LLMultiGesture step count " << count << llendl;
LL_WARNS() << "Bad LLMultiGesture step count " << count << LL_ENDL;
return FALSE;
}
@@ -212,7 +212,7 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
}
default:
{
llwarns << "Bad LLMultiGesture step type " << type << llendl;
LL_WARNS() << "Bad LLMultiGesture step type " << type << LL_ENDL;
return FALSE;
}
}
@@ -222,10 +222,10 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
void LLMultiGesture::dump()
{
llinfos << "key " << S32(mKey) << " mask " << U32(mMask)
LL_INFOS() << "key " << S32(mKey) << " mask " << U32(mMask)
<< " trigger " << mTrigger
<< " replace " << mReplaceText
<< llendl;
<< LL_ENDL;
U32 i;
for (i = 0; i < mSteps.size(); ++i)
{
@@ -313,10 +313,10 @@ std::vector<std::string> LLGestureStepAnimation::getLabel() const
void LLGestureStepAnimation::dump()
{
llinfos << "step animation " << mAnimName
LL_INFOS() << "step animation " << mAnimName
<< " id " << mAnimAssetID
<< " flags " << mFlags
<< llendl;
<< LL_ENDL;
}
//---------------------------------------------------------------------------
@@ -375,10 +375,10 @@ std::vector<std::string> LLGestureStepSound::getLabel() const
void LLGestureStepSound::dump()
{
llinfos << "step sound " << mSoundName
LL_INFOS() << "step sound " << mSoundName
<< " id " << mSoundAssetID
<< " flags " << mFlags
<< llendl;
<< LL_ENDL;
}
@@ -431,9 +431,9 @@ std::vector<std::string> LLGestureStepChat::getLabel() const
void LLGestureStepChat::dump()
{
llinfos << "step chat " << mChatText
LL_INFOS() << "step chat " << mChatText
<< " flags " << mFlags
<< llendl;
<< LL_ENDL;
}
@@ -504,7 +504,7 @@ std::vector<std::string> LLGestureStepWait::getLabel() const
void LLGestureStepWait::dump()
{
llinfos << "step wait " << mWaitSeconds
LL_INFOS() << "step wait " << mWaitSeconds
<< " flags " << mFlags
<< llendl;
<< LL_ENDL;
}

View File

@@ -88,7 +88,7 @@ BOOL LLStateDiagram::addTransition(LLFSMState& start_state, LLFSMState& end_stat
Transitions::iterator transition_it = state_transitions->find(&transition);
if (transition_it != state_transitions->end())
{
llerrs << "LLStateTable::addDirectedTransition() : transition already exists" << llendl;
LL_ERRS() << "LLStateTable::addDirectedTransition() : transition already exists" << LL_ENDL;
return FALSE; // transition already exists
}
@@ -209,7 +209,7 @@ BOOL LLStateDiagram::saveDotFile(const std::string& filename)
if (!dot_file)
{
llwarns << "LLStateDiagram::saveDotFile() : Couldn't open " << filename << " to save state diagram." << llendl;
LL_WARNS() << "LLStateDiagram::saveDotFile() : Couldn't open " << filename << " to save state diagram." << LL_ENDL;
return FALSE;
}
apr_file_printf(dot_file, "digraph StateMachine {\n\tsize=\"100,100\";\n\tfontsize=40;\n\tlabel=\"Finite State Machine\";\n\torientation=landscape\n\tratio=.77\n");
@@ -363,7 +363,7 @@ void LLStateMachine::processTransition(LLFSMTransition& transition, void* user_d
if (NULL == mCurrentState)
{
llwarns << "mCurrentState == NULL; aborting processTransition()" << llendl;
LL_WARNS() << "mCurrentState == NULL; aborting processTransition()" << LL_ENDL;
return;
}
@@ -371,7 +371,7 @@ void LLStateMachine::processTransition(LLFSMTransition& transition, void* user_d
if (NULL == new_state)
{
llwarns << "new_state == NULL; aborting processTransition()" << llendl;
LL_WARNS() << "new_state == NULL; aborting processTransition()" << LL_ENDL;
return;
}
@@ -384,9 +384,9 @@ void LLStateMachine::processTransition(LLFSMTransition& transition, void* user_d
mCurrentState = new_state;
mCurrentState->onEntry(user_data);
#if FSM_PRINT_STATE_TRANSITIONS
llinfos << "Entering state " << mCurrentState->getName() <<
LL_INFOS() << "Entering state " << mCurrentState->getName() <<
" on transition " << transition.getName() << " from state " <<
mLastState->getName() << llendl;
mLastState->getName() << LL_ENDL;
#endif
}
}

View File

@@ -86,7 +86,7 @@ LLMotion::LLMotionInitStatus LLTargetingMotion::onInitialize(LLCharacter *charac
!mTorsoJoint ||
!mRightHandJoint)
{
llwarns << "Invalid skeleton for targeting motion!" << llendl;
LL_WARNS() << "Invalid skeleton for targeting motion!" << LL_ENDL;
return STATUS_FAILURE;
}

View File

@@ -79,7 +79,7 @@ BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node)
mDefaultWeight = llclamp( default_weight, mMinWeight, mMaxWeight );
if( default_weight != mDefaultWeight )
{
llwarns << "value_default attribute is out of range in node " << mName << " " << default_weight << llendl;
LL_WARNS() << "value_default attribute is out of range in node " << mName << " " << default_weight << LL_ENDL;
}
}
@@ -101,7 +101,7 @@ BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node)
}
else
{
llwarns << "Avatar file: <param> has invalid sex attribute: " << sex << llendl;
LL_WARNS() << "Avatar file: <param> has invalid sex attribute: " << sex << LL_ENDL;
return FALSE;
}
@@ -109,7 +109,7 @@ BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node)
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
if( !node->getFastAttributeString( name_string, mName ) )
{
llwarns << "Avatar file: <param> is missing name attribute" << llendl;
LL_WARNS() << "Avatar file: <param> is missing name attribute" << LL_ENDL;
return FALSE;
}
@@ -159,26 +159,42 @@ void LLVisualParamInfo::toStream(std::ostream &out)
//-----------------------------------------------------------------------------
// LLVisualParam()
//-----------------------------------------------------------------------------
LLVisualParam::LLVisualParam()
:
mCurWeight( 0.f ),
LLVisualParam::LLVisualParam()
: mCurWeight( 0.f ),
mLastWeight( 0.f ),
mNext( NULL ),
mTargetWeight( 0.f ),
mIsAnimating( FALSE ),
mIsDummy(FALSE),
mID( -1 ),
mInfo( 0 ),
mIsDummy(FALSE),
mParamLocation(LOC_UNKNOWN)
{
}
//-----------------------------------------------------------------------------
// LLVisualParam()
//-----------------------------------------------------------------------------
LLVisualParam::LLVisualParam(const LLVisualParam& pOther)
: mCurWeight(pOther.mCurWeight),
mLastWeight(pOther.mLastWeight),
mNext(pOther.mNext),
mTargetWeight(pOther.mTargetWeight),
mIsAnimating(pOther.mIsAnimating),
mIsDummy(pOther.mIsDummy),
mID(pOther.mID),
mInfo(pOther.mInfo),
mParamLocation(pOther.mParamLocation)
{
}
//-----------------------------------------------------------------------------
// ~LLVisualParam()
//-----------------------------------------------------------------------------
LLVisualParam::~LLVisualParam()
{
delete mNext;
mNext = NULL;
}
/*
@@ -220,7 +236,7 @@ BOOL LLVisualParam::parseData(LLXmlTreeNode *node)
//-----------------------------------------------------------------------------
// setWeight()
//-----------------------------------------------------------------------------
void LLVisualParam::setWeight(F32 weight, BOOL upload_bake)
void LLVisualParam::setWeight(F32 weight, bool upload_bake)
{
if (mIsAnimating)
{
@@ -245,7 +261,7 @@ void LLVisualParam::setWeight(F32 weight, BOOL upload_bake)
//-----------------------------------------------------------------------------
// setAnimationTarget()
//-----------------------------------------------------------------------------
void LLVisualParam::setAnimationTarget(F32 target_value, BOOL upload_bake)
void LLVisualParam::setAnimationTarget(F32 target_value, bool upload_bake)
{
// don't animate dummy parameters
if (mIsDummy)
@@ -284,10 +300,18 @@ void LLVisualParam::setNextParam( LLVisualParam *next )
mNext = next;
}
//-----------------------------------------------------------------------------
// clearNextParam()
//-----------------------------------------------------------------------------
void LLVisualParam::clearNextParam()
{
mNext = NULL;
}
//-----------------------------------------------------------------------------
// animate()
//-----------------------------------------------------------------------------
void LLVisualParam::animate( F32 delta, BOOL upload_bake )
void LLVisualParam::animate( F32 delta, bool upload_bake )
{
if (mIsAnimating)
{
@@ -299,7 +323,7 @@ void LLVisualParam::animate( F32 delta, BOOL upload_bake )
//-----------------------------------------------------------------------------
// stopAnimating()
//-----------------------------------------------------------------------------
void LLVisualParam::stopAnimating(BOOL upload_bake)
void LLVisualParam::stopAnimating(bool upload_bake)
{
if (mIsAnimating && isTweakable())
{
@@ -346,7 +370,7 @@ void LLVisualParam::setParamLocation(EParamLocation loc)
}
else
{
lldebugs << "param location is already " << mParamLocation << ", not slamming to " << loc << llendl;
LL_DEBUGS() << "param location is already " << mParamLocation << ", not slamming to " << loc << LL_ENDL;
}
}

View File

@@ -47,6 +47,7 @@ enum EVisualParamGroup
VISUAL_PARAM_GROUP_TWEAKABLE,
VISUAL_PARAM_GROUP_ANIMATABLE,
VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT,
VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE, // deprecated params that used to be tweakable.
NUM_VISUAL_PARAM_GROUPS
};
@@ -99,6 +100,7 @@ protected:
// An interface class for a generalized parametric modification of the avatar mesh
// Contains data that is specific to each Avatar
//-----------------------------------------------------------------------------
LL_ALIGN_PREFIX(16)
class LLVisualParam
{
public:
@@ -118,10 +120,10 @@ public:
//virtual BOOL parseData( LLXmlTreeNode *node ) = 0;
virtual void apply( ESex avatar_sex ) = 0;
// Default functions
virtual void setWeight(F32 weight, BOOL upload_bake);
virtual void setAnimationTarget( F32 target_value, BOOL upload_bake );
virtual void animate(F32 delta, BOOL upload_bake);
virtual void stopAnimating(BOOL upload_bake);
virtual void setWeight(F32 weight, bool upload_bake = false);
virtual void setAnimationTarget(F32 target_value, bool upload_bake = false);
virtual void animate(F32 delta, bool upload_bake = false);
virtual void stopAnimating(bool upload_bake = false);
virtual BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params);
virtual void resetDrivenParams();
@@ -153,6 +155,7 @@ public:
LLVisualParam* getNextParam() { return mNext; }
void setNextParam( LLVisualParam *next );
void clearNextParam();
virtual void setAnimating(BOOL is_animating) { mIsAnimating = is_animating && !mIsDummy; }
BOOL getAnimating() const { return mIsAnimating; }
@@ -167,6 +170,8 @@ public:
virtual std::string getDumpWearableTypeName(void) const = 0;
protected:
LLVisualParam(const LLVisualParam& pOther);
F32 mCurWeight; // current weight
F32 mLastWeight; // last weight
LLVisualParam* mNext; // next param in a shared chain
@@ -178,6 +183,6 @@ protected:
S32 mID; // id for storing weight/morphtarget compares compactly
LLVisualParamInfo *mInfo;
EParamLocation mParamLocation; // where does this visual param live?
};
} LL_ALIGN_POSTFIX(16);
#endif // LL_LLVisualParam_H

View File

@@ -24,7 +24,6 @@ set(llcommon_SOURCE_FILES
aithreadid.cpp
imageids.cpp
indra_constants.cpp
ll_template_cast.h
llallocator.cpp
llallocator_heap_profile.cpp
llapp.cpp
@@ -116,12 +115,10 @@ set(llcommon_HEADER_FILES
aithreadsafe.h
bitpack.h
ctype_workaround.h
doublelinkedlist.h
fix_macros.h
imageids.h
indra_constants.h
linden_common.h
linked_lists.h
llaccountingcost.h
llalignedarray.h
llagentconstants.h
@@ -149,7 +146,6 @@ set(llcommon_HEADER_FILES
lldarrayptr.h
lldate.h
lldefs.h
lldeleteutils.h
lldependencies.h
lldepthstack.h
lldictionary.h
@@ -204,8 +200,6 @@ set(llcommon_HEADER_FILES
llpriqueuemap.h
llprocesslauncher.h
llprocessor.h
llptrskiplist.h
llptrskipmap.h
llptrto.h
llqueuedthread.h
llrand.h
@@ -224,7 +218,6 @@ set(llcommon_HEADER_FILES
llskiplist.h
llskipmap.h
llsortedvector.h
llstack.h
llstacktrace.h
llstat.h
llstatenums.h
@@ -252,7 +245,6 @@ set(llcommon_HEADER_FILES
reflectivet.h
stdenums.h
stdtypes.h
string_table.h
stringize.h
timer.h
timing.h

View File

@@ -85,7 +85,7 @@ public:
*(mBuffer + mBufferSize++) = mLoad;
if (mBufferSize > mMaxSize)
{
llerror("mBufferSize exceeding mMaxSize!", 0);
LL_ERRS() << "mBufferSize exceeding mMaxSize!" << LL_ENDL;
}
mLoadSize = 0;
mLoad = 0x00;
@@ -128,7 +128,7 @@ public:
*(mBuffer + mBufferSize++) = mLoad;
if (mBufferSize > mMaxSize)
{
llerror("mBufferSize exceeding mMaxSize!", 0);
LL_ERRS() << "mBufferSize exceeding mMaxSize!" << LL_ENDL;
}
mLoadSize = 0;
mLoad = 0x00;
@@ -171,8 +171,8 @@ public:
#ifdef _DEBUG
if (mBufferSize > mMaxSize)
{
llerrs << "mBufferSize exceeding mMaxSize" << llendl;
llerrs << mBufferSize << " > " << mMaxSize << llendl;
LL_ERRS() << "mBufferSize exceeding mMaxSize" << LL_ENDL;
LL_ERRS() << mBufferSize << " > " << mMaxSize << LL_ENDL;
}
#endif
mLoad = *(mBuffer + mBufferSize++);
@@ -196,7 +196,7 @@ public:
*(mBuffer + mBufferSize++) = mLoad;
if (mBufferSize > mMaxSize)
{
llerror("mBufferSize exceeding mMaxSize!", 0);
LL_ERRS() << "mBufferSize exceeding mMaxSize!" << LL_ENDL;
}
mLoadSize = 0;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,943 +0,0 @@
/**
* @file linked_lists.h
* @brief LLLinkedList class header amd implementation file.
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#ifndef LL_LINKED_LISTS_H
#define LL_LINKED_LISTS_H
/**
* Provides a standard doubly linked list for fun and profit
* Utilizes a neat trick off of Flipcode where the back pointer is a
* pointer to a pointer, allowing easier transfer of nodes between lists, &c
* And a template class, of course
*/
#include "llerror.h"
template <class DATA_TYPE> class LLLinkedList
{
public:
friend class LLLinkNode;
// External interface
// basic constructor
LLLinkedList() : mHead(NULL), mCurrentp(NULL), mInsertBefore(NULL)
{
mCurrentp = mHead.mNextp;
mCurrentOperatingp = mHead.mNextp;
mCount = 0;
}
// basic constructor
LLLinkedList(BOOL (*insert_before)(DATA_TYPE *data_new, DATA_TYPE *data_tested)) : mHead(NULL), mCurrentp(NULL), mInsertBefore(insert_before)
{
mCurrentp = mHead.mNextp;
mCurrentOperatingp = mHead.mNextp;
mCount = 0;
}
// destructor destroys list and nodes, but not data in nodes
~LLLinkedList()
{
removeAllNodes();
}
// set mInsertBefore
void setInsertBefore(BOOL (*insert_before)(DATA_TYPE *data_new, DATA_TYPE *data_tested))
{
mInsertBefore = insert_before;
}
//
// WARNING!!!!!!!
// addData and addDataSorted are NOT O(1) operations, but O(n) because they check
// for existence of the data in the linked list first. Why, I don't know - djs
// If you don't care about dupes, use addDataNoCheck
//
// put data into a node and stick it at the front of the list
inline BOOL addData(DATA_TYPE *data);
// put data into a node and sort into list by mInsertBefore()
// calls normal add if mInsertBefore isn't set
inline BOOL addDataSorted(DATA_TYPE *data);
inline BOOL addDataNoCheck(DATA_TYPE *data);
// bubbleSortList
// does an improved bubble sort of the list . . . works best with almost sorted data
// does nothing if mInsertBefore isn't set
// Nota Bene: Swaps are accomplished by swapping data pointers
inline void bubbleSortList();
// put data into a node and stick it at the end of the list
inline BOOL addDataAtEnd(DATA_TYPE *data);
// returns number of items in the list
inline S32 getLength() const;
inline BOOL isEmpty();
// search the list starting at mHead.mNextp and remove the link with mDatap == data
// leave mCurrentp and mCurrentOperatingp on the next entry
// return TRUE if found, FALSE if not found
inline BOOL removeData(DATA_TYPE *data);
// search the list starting at mHead.mNextp and delete the link with mDatap == data
// leave mCurrentp and mCurrentOperatingp on the next entry
// return TRUE if found, FALSE if not found
inline BOOL deleteData(DATA_TYPE *data);
// remove all nodes from the list and delete the associated data
inline void deleteAllData();
// remove all nodes from the list but do not delete data
inline void removeAllNodes();
// check to see if data is in list
// if TRUE then mCurrentp and mCurrentOperatingp point to data
inline BOOL checkData(DATA_TYPE *data);
// place mCurrentp on first node
inline void resetList();
// return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
inline DATA_TYPE *getCurrentData();
// same as getCurrentData() but a more intuitive name for the operation
inline DATA_TYPE *getNextData();
// reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
inline DATA_TYPE *getFirstData();
// reset the list and return the data at position n, set mCurentOperatingp to that node and bump mCurrentp
// Note: n is zero-based
inline DATA_TYPE *getNthData( U32 n);
// reset the list and return the last data in it, set mCurentOperatingp to that node and bump mCurrentp
inline DATA_TYPE *getLastData();
// remove the Node at mCurentOperatingp
// leave mCurrentp and mCurentOperatingp on the next entry
inline void removeCurrentData();
// remove the Node at mCurentOperatingp and add it to newlist
// leave mCurrentp and mCurentOperatingp on the next entry
void moveCurrentData(LLLinkedList *newlist, BOOL b_sort);
BOOL moveData(DATA_TYPE *data, LLLinkedList *newlist, BOOL b_sort);
// delete the Node at mCurentOperatingp
// leave mCurrentp anf mCurentOperatingp on the next entry
void deleteCurrentData();
private:
// node that actually contains the data
class LLLinkNode
{
public:
// assign the mDatap pointer
LLLinkNode(DATA_TYPE *data) : mDatap(data), mNextp(NULL), mPrevpp(NULL)
{
}
// destructor does not, by default, destroy associated data
// however, the mDatap must be NULL to ensure that we aren't causing memory leaks
~LLLinkNode()
{
if (mDatap)
{
llerror("Attempting to call LLLinkNode destructor with a non-null mDatap!", 1);
}
}
// delete associated data and NULL out pointer
void deleteData()
{
delete mDatap;
mDatap = NULL;
}
// NULL out pointer
void removeData()
{
mDatap = NULL;
}
DATA_TYPE *mDatap;
LLLinkNode *mNextp;
LLLinkNode **mPrevpp;
};
// add a node at the front of the list
void addData(LLLinkNode *node)
{
// don't allow NULL to be passed to addData
if (!node)
{
llerror("NULL pointer passed to LLLinkedList::addData", 0);
}
// add the node to the front of the list
node->mPrevpp = &mHead.mNextp;
node->mNextp = mHead.mNextp;
// if there's something in the list, fix its back pointer
if (node->mNextp)
{
node->mNextp->mPrevpp = &node->mNextp;
}
mHead.mNextp = node;
}
LLLinkNode mHead; // fake head node. . . makes pointer operations faster and easier
LLLinkNode *mCurrentp; // mCurrentp is the Node that getCurrentData returns
LLLinkNode *mCurrentOperatingp; // this is the node that the various mumbleCurrentData functions act on
BOOL (*mInsertBefore)(DATA_TYPE *data_new, DATA_TYPE *data_tested); // user function set to allow sorted lists
U32 mCount;
};
template <class DATA_TYPE>
BOOL LLLinkedList<DATA_TYPE>::addData(DATA_TYPE *data)
{
// don't allow NULL to be passed to addData
if (!data)
{
llerror("NULL pointer passed to LLLinkedList::addData", 0);
}
LLLinkNode *tcurr = mCurrentp;
LLLinkNode *tcurrop = mCurrentOperatingp;
if ( checkData(data))
{
mCurrentp = tcurr;
mCurrentOperatingp = tcurrop;
return FALSE;
}
// make the new node
LLLinkNode *temp = new LLLinkNode(data);
// add the node to the front of the list
temp->mPrevpp = &mHead.mNextp;
temp->mNextp = mHead.mNextp;
// if there's something in the list, fix its back pointer
if (temp->mNextp)
{
temp->mNextp->mPrevpp = &temp->mNextp;
}
mHead.mNextp = temp;
mCurrentp = tcurr;
mCurrentOperatingp = tcurrop;
mCount++;
return TRUE;
}
template <class DATA_TYPE>
BOOL LLLinkedList<DATA_TYPE>::addDataNoCheck(DATA_TYPE *data)
{
// don't allow NULL to be passed to addData
if (!data)
{
llerror("NULL pointer passed to LLLinkedList::addData", 0);
}
LLLinkNode *tcurr = mCurrentp;
LLLinkNode *tcurrop = mCurrentOperatingp;
// make the new node
LLLinkNode *temp = new LLLinkNode(data);
// add the node to the front of the list
temp->mPrevpp = &mHead.mNextp;
temp->mNextp = mHead.mNextp;
// if there's something in the list, fix its back pointer
if (temp->mNextp)
{
temp->mNextp->mPrevpp = &temp->mNextp;
}
mHead.mNextp = temp;
mCurrentp = tcurr;
mCurrentOperatingp = tcurrop;
mCount++;
return TRUE;
}
template <class DATA_TYPE>
BOOL LLLinkedList<DATA_TYPE>::addDataSorted(DATA_TYPE *data)
{
LLLinkNode *tcurr = mCurrentp;
LLLinkNode *tcurrop = mCurrentOperatingp;
// don't allow NULL to be passed to addData
if (!data)
{
llerror("NULL pointer passed to LLLinkedList::addDataSorted", 0);
}
if (checkData(data))
{
// restore
mCurrentp = tcurr;
mCurrentOperatingp = tcurrop;
return FALSE;
}
// mInsertBefore not set?
if (!mInsertBefore)
{
addData(data);
// restore
mCurrentp = tcurr;
mCurrentOperatingp = tcurrop;
return FALSE;
}
// empty list?
if (!mHead.mNextp)
{
addData(data);
// restore
mCurrentp = tcurr;
mCurrentOperatingp = tcurrop;
return TRUE;
}
// make the new node
LLLinkNode *temp = new LLLinkNode(data);
// walk the list until mInsertBefore returns true
mCurrentp = mHead.mNextp;
while (mCurrentp->mNextp)
{
if (mInsertBefore(data, mCurrentp->mDatap))
{
// insert before the current one
temp->mPrevpp = mCurrentp->mPrevpp;
temp->mNextp = mCurrentp;
*(temp->mPrevpp) = temp;
mCurrentp->mPrevpp = &temp->mNextp;
// restore
mCurrentp = tcurr;
mCurrentOperatingp = tcurrop;
mCount++;
return TRUE;
}
else
{
mCurrentp = mCurrentp->mNextp;
}
}
// on the last element, add before?
if (mInsertBefore(data, mCurrentp->mDatap))
{
// insert before the current one
temp->mPrevpp = mCurrentp->mPrevpp;
temp->mNextp = mCurrentp;
*(temp->mPrevpp) = temp;
mCurrentp->mPrevpp = &temp->mNextp;
// restore
mCurrentp = tcurr;
mCurrentOperatingp = tcurrop;
}
else // insert after
{
temp->mPrevpp = &mCurrentp->mNextp;
temp->mNextp = NULL;
mCurrentp->mNextp = temp;
// restore
mCurrentp = tcurr;
mCurrentOperatingp = tcurrop;
}
mCount++;
return TRUE;
}
template <class DATA_TYPE>
void LLLinkedList<DATA_TYPE>::bubbleSortList()
{
// mInsertBefore not set
if (!mInsertBefore)
{
return;
}
LLLinkNode *tcurr = mCurrentp;
LLLinkNode *tcurrop = mCurrentOperatingp;
BOOL b_swapped = FALSE;
DATA_TYPE *temp;
// Nota Bene: This will break if more than 0x7FFFFFFF members in list!
S32 length = 0x7FFFFFFF;
S32 count = 0;
do
{
b_swapped = FALSE;
mCurrentp = mHead.mNextp;
count = 0;
while ( (count + 1 < length)
&&(mCurrentp))
{
if (mCurrentp->mNextp)
{
if (!mInsertBefore(mCurrentp->mDatap, mCurrentp->mNextp->mDatap))
{
// swap data pointers!
temp = mCurrentp->mDatap;
mCurrentp->mDatap = mCurrentp->mNextp->mDatap;
mCurrentp->mNextp->mDatap = temp;
b_swapped = TRUE;
}
}
else
{
break;
}
count++;
mCurrentp = mCurrentp->mNextp;
}
length = count;
} while (b_swapped);
// restore
mCurrentp = tcurr;
mCurrentOperatingp = tcurrop;
}
template <class DATA_TYPE>
BOOL LLLinkedList<DATA_TYPE>::addDataAtEnd(DATA_TYPE *data)
{
LLLinkNode *tcurr = mCurrentp;
LLLinkNode *tcurrop = mCurrentOperatingp;
// don't allow NULL to be passed to addData
if (!data)
{
llerror("NULL pointer passed to LLLinkedList::addData", 0);
}
if (checkData(data))
{
mCurrentp = tcurr;
mCurrentOperatingp = tcurrop;
return FALSE;
}
// make the new node
LLLinkNode *temp = new LLLinkNode(data);
// add the node to the end of the list
// if empty, add to the front and be done with it
if (!mHead.mNextp)
{
temp->mPrevpp = &mHead.mNextp;
temp->mNextp = NULL;
mHead.mNextp = temp;
}
else
{
// otherwise, walk to the end of the list
mCurrentp = mHead.mNextp;
while (mCurrentp->mNextp)
{
mCurrentp = mCurrentp->mNextp;
}
temp->mPrevpp = &mCurrentp->mNextp;
temp->mNextp = NULL;
mCurrentp->mNextp = temp;
}
// restore
mCurrentp = tcurr;
mCurrentOperatingp = tcurrop;
mCount++;
return TRUE;
}
// returns number of items in the list
template <class DATA_TYPE>
S32 LLLinkedList<DATA_TYPE>::getLength() const
{
// S32 length = 0;
// for (LLLinkNode* temp = mHead.mNextp; temp != NULL; temp = temp->mNextp)
// {
// length++;
// }
return mCount;
}
template <class DATA_TYPE>
BOOL LLLinkedList<DATA_TYPE>::isEmpty()
{
return (mCount == 0);
}
// search the list starting at mHead.mNextp and remove the link with mDatap == data
// leave mCurrentp and mCurrentOperatingp on the next entry
// return TRUE if found, FALSE if not found
template <class DATA_TYPE>
BOOL LLLinkedList<DATA_TYPE>::removeData(DATA_TYPE *data)
{
BOOL b_found = FALSE;
// don't allow NULL to be passed to addData
if (!data)
{
llerror("NULL pointer passed to LLLinkedList::removeData", 0);
}
LLLinkNode *tcurr = mCurrentp;
LLLinkNode *tcurrop = mCurrentOperatingp;
mCurrentp = mHead.mNextp;
mCurrentOperatingp = mHead.mNextp;
while (mCurrentOperatingp)
{
if (mCurrentOperatingp->mDatap == data)
{
b_found = TRUE;
// remove the node
// if there is a next one, fix it
if (mCurrentOperatingp->mNextp)
{
mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
}
*(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
// remove the LLLinkNode
// if we were on the one we want to delete, bump the cached copies
if (mCurrentOperatingp == tcurrop)
{
tcurrop = tcurr = mCurrentOperatingp->mNextp;
}
else if (mCurrentOperatingp == tcurr)
{
tcurrop = tcurr = mCurrentOperatingp->mNextp;
}
mCurrentp = mCurrentOperatingp->mNextp;
mCurrentOperatingp->removeData();
delete mCurrentOperatingp;
mCurrentOperatingp = mCurrentp;
mCount--;
break;
}
mCurrentOperatingp = mCurrentOperatingp->mNextp;
}
// restore
mCurrentp = tcurr;
mCurrentOperatingp = tcurrop;
return b_found;
}
// search the list starting at mHead.mNextp and delete the link with mDatap == data
// leave mCurrentp and mCurrentOperatingp on the next entry
// return TRUE if found, FALSE if not found
template <class DATA_TYPE>
BOOL LLLinkedList<DATA_TYPE>::deleteData(DATA_TYPE *data)
{
BOOL b_found = FALSE;
// don't allow NULL to be passed to addData
if (!data)
{
llerror("NULL pointer passed to LLLinkedList::removeData", 0);
}
LLLinkNode *tcurr = mCurrentp;
LLLinkNode *tcurrop = mCurrentOperatingp;
mCurrentp = mHead.mNextp;
mCurrentOperatingp = mHead.mNextp;
while (mCurrentOperatingp)
{
if (mCurrentOperatingp->mDatap == data)
{
b_found = TRUE;
// remove the node
// if there is a next one, fix it
if (mCurrentOperatingp->mNextp)
{
mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
}
*(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
// delete the LLLinkNode
// if we were on the one we want to delete, bump the cached copies
if (mCurrentOperatingp == tcurrop)
{
tcurrop = tcurr = mCurrentOperatingp->mNextp;
}
// and delete the associated data
llassert(mCurrentOperatingp);
mCurrentp = mCurrentOperatingp->mNextp;
mCurrentOperatingp->deleteData();
delete mCurrentOperatingp;
mCurrentOperatingp = mCurrentp;
mCount--;
break;
}
mCurrentOperatingp = mCurrentOperatingp->mNextp;
}
// restore
mCurrentp = tcurr;
mCurrentOperatingp = tcurrop;
return b_found;
}
// remove all nodes from the list and delete the associated data
template <class DATA_TYPE>
void LLLinkedList<DATA_TYPE>::deleteAllData()
{
LLLinkNode *temp;
// reset mCurrentp
mCurrentp = mHead.mNextp;
while (mCurrentp)
{
temp = mCurrentp->mNextp;
mCurrentp->deleteData();
delete mCurrentp;
mCurrentp = temp;
}
// reset mHead and mCurrentp
mHead.mNextp = NULL;
mCurrentp = mHead.mNextp;
mCurrentOperatingp = mHead.mNextp;
mCount = 0;
}
// remove all nodes from the list but do not delete data
template <class DATA_TYPE>
void LLLinkedList<DATA_TYPE>::removeAllNodes()
{
LLLinkNode *temp;
// reset mCurrentp
mCurrentp = mHead.mNextp;
while (mCurrentp)
{
temp = mCurrentp->mNextp;
mCurrentp->removeData();
delete mCurrentp;
mCurrentp = temp;
}
// reset mHead and mCurrentp
mHead.mNextp = NULL;
mCurrentp = mHead.mNextp;
mCurrentOperatingp = mHead.mNextp;
mCount = 0;
}
// check to see if data is in list
// if TRUE then mCurrentp and mCurrentOperatingp point to data
template <class DATA_TYPE>
BOOL LLLinkedList<DATA_TYPE>::checkData(DATA_TYPE *data)
{
// reset mCurrentp
mCurrentp = mHead.mNextp;
while (mCurrentp)
{
if (mCurrentp->mDatap == data)
{
mCurrentOperatingp = mCurrentp;
return TRUE;
}
mCurrentp = mCurrentp->mNextp;
}
mCurrentOperatingp = mCurrentp;
return FALSE;
}
// place mCurrentp on first node
template <class DATA_TYPE>
void LLLinkedList<DATA_TYPE>::resetList()
{
mCurrentp = mHead.mNextp;
mCurrentOperatingp = mHead.mNextp;
}
// return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
template <class DATA_TYPE>
DATA_TYPE *LLLinkedList<DATA_TYPE>::getCurrentData()
{
if (mCurrentp)
{
mCurrentOperatingp = mCurrentp;
mCurrentp = mCurrentp->mNextp;
return mCurrentOperatingp->mDatap;
}
else
{
return NULL;
}
}
// same as getCurrentData() but a more intuitive name for the operation
template <class DATA_TYPE>
DATA_TYPE *LLLinkedList<DATA_TYPE>::getNextData()
{
if (mCurrentp)
{
mCurrentOperatingp = mCurrentp;
mCurrentp = mCurrentp->mNextp;
return mCurrentOperatingp->mDatap;
}
else
{
return NULL;
}
}
// reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
template <class DATA_TYPE>
DATA_TYPE *LLLinkedList<DATA_TYPE>::getFirstData()
{
mCurrentp = mHead.mNextp;
mCurrentOperatingp = mHead.mNextp;
if (mCurrentp)
{
mCurrentOperatingp = mCurrentp;
mCurrentp = mCurrentp->mNextp;
return mCurrentOperatingp->mDatap;
}
else
{
return NULL;
}
}
// Note: n is zero-based
template <class DATA_TYPE>
DATA_TYPE *LLLinkedList<DATA_TYPE>::getNthData( U32 n )
{
mCurrentOperatingp = mHead.mNextp;
// if empty, return NULL
if (!mCurrentOperatingp)
{
return NULL;
}
for( U32 i = 0; i < n; i++ )
{
mCurrentOperatingp = mCurrentOperatingp->mNextp;
if( !mCurrentOperatingp )
{
return NULL;
}
}
mCurrentp = mCurrentOperatingp->mNextp;
return mCurrentOperatingp->mDatap;
}
// reset the list and return the last data in it, set mCurentOperatingp to that node and bump mCurrentp
template <class DATA_TYPE>
DATA_TYPE *LLLinkedList<DATA_TYPE>::getLastData()
{
mCurrentOperatingp = mHead.mNextp;
// if empty, return NULL
if (!mCurrentOperatingp)
return NULL;
// walk until we're pointing at the last entry
while (mCurrentOperatingp->mNextp)
{
mCurrentOperatingp = mCurrentOperatingp->mNextp;
}
mCurrentp = mCurrentOperatingp->mNextp;
return mCurrentOperatingp->mDatap;
}
// remove the Node at mCurentOperatingp
// leave mCurrentp and mCurentOperatingp on the next entry
// return TRUE if found, FALSE if not found
template <class DATA_TYPE>
void LLLinkedList<DATA_TYPE>::removeCurrentData()
{
if (mCurrentOperatingp)
{
// remove the node
// if there is a next one, fix it
if (mCurrentOperatingp->mNextp)
{
mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
}
*(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
// remove the LLLinkNode
mCurrentp = mCurrentOperatingp->mNextp;
mCurrentOperatingp->removeData();
delete mCurrentOperatingp;
mCount--;
mCurrentOperatingp = mCurrentp;
}
}
// remove the Node at mCurentOperatingp and add it to newlist
// leave mCurrentp and mCurentOperatingp on the next entry
// return TRUE if found, FALSE if not found
template <class DATA_TYPE>
void LLLinkedList<DATA_TYPE>::moveCurrentData(LLLinkedList *newlist, BOOL b_sort)
{
if (mCurrentOperatingp)
{
// remove the node
// if there is a next one, fix it
if (mCurrentOperatingp->mNextp)
{
mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
}
*(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
// remove the LLLinkNode
mCurrentp = mCurrentOperatingp->mNextp;
// move the node to the new list
newlist->addData(mCurrentOperatingp);
if (b_sort)
bubbleSortList();
mCurrentOperatingp = mCurrentp;
}
}
template <class DATA_TYPE>
BOOL LLLinkedList<DATA_TYPE>::moveData(DATA_TYPE *data, LLLinkedList *newlist, BOOL b_sort)
{
BOOL b_found = FALSE;
// don't allow NULL to be passed to addData
if (!data)
{
llerror("NULL pointer passed to LLLinkedList::removeData", 0);
}
LLLinkNode *tcurr = mCurrentp;
LLLinkNode *tcurrop = mCurrentOperatingp;
mCurrentp = mHead.mNextp;
mCurrentOperatingp = mHead.mNextp;
while (mCurrentOperatingp)
{
if (mCurrentOperatingp->mDatap == data)
{
b_found = TRUE;
// remove the node
// if there is a next one, fix it
if (mCurrentOperatingp->mNextp)
{
mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
}
*(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
// if we were on the one we want to delete, bump the cached copies
if ( (mCurrentOperatingp == tcurrop)
||(mCurrentOperatingp == tcurr))
{
tcurrop = tcurr = mCurrentOperatingp->mNextp;
}
// remove the LLLinkNode
mCurrentp = mCurrentOperatingp->mNextp;
// move the node to the new list
newlist->addData(mCurrentOperatingp);
if (b_sort)
newlist->bubbleSortList();
mCurrentOperatingp = mCurrentp;
break;
}
mCurrentOperatingp = mCurrentOperatingp->mNextp;
}
// restore
mCurrentp = tcurr;
mCurrentOperatingp = tcurrop;
return b_found;
}
// delete the Node at mCurentOperatingp
// leave mCurrentp anf mCurentOperatingp on the next entry
// return TRUE if found, FALSE if not found
template <class DATA_TYPE>
void LLLinkedList<DATA_TYPE>::deleteCurrentData()
{
if (mCurrentOperatingp)
{
// remove the node
// if there is a next one, fix it
if (mCurrentOperatingp->mNextp)
{
mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
}
*(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
// remove the LLLinkNode
mCurrentp = mCurrentOperatingp->mNextp;
mCurrentOperatingp->deleteData();
if (mCurrentOperatingp->mDatap)
llerror("This is impossible!", 0);
delete mCurrentOperatingp;
mCurrentOperatingp = mCurrentp;
mCount--;
}
}
#endif

View File

@@ -1,177 +0,0 @@
/**
* @file ll_template_cast.h
* @author Nat Goodspeed
* @date 2009-11-21
* @brief Define ll_template_cast function
*
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#if ! defined(LL_LL_TEMPLATE_CAST_H)
#define LL_LL_TEMPLATE_CAST_H
/**
* Implementation for ll_template_cast() (q.v.).
*
* Default implementation: trying to cast two completely unrelated types
* returns 0. Typically you'd specify T and U as pointer types, but in fact T
* can be any type that can be initialized with 0.
*/
template <typename T, typename U>
struct ll_template_cast_impl
{
T operator()(U)
{
return 0;
}
};
/**
* ll_template_cast<T>(some_value) is for use in a template function when
* some_value might be of arbitrary type, but you want to recognize type T
* specially.
*
* It's designed for use with pointer types. Example:
* @code
* struct SpecialClass
* {
* void someMethod(const std::string&) const;
* };
*
* template <class REALCLASS>
* void somefunc(const REALCLASS& instance)
* {
* const SpecialClass* ptr = ll_template_cast<const SpecialClass*>(&instance);
* if (ptr)
* {
* ptr->someMethod("Call method only available on SpecialClass");
* }
* }
* @endcode
*
* Why is this better than dynamic_cast<>? Because unless OtherClass is
* polymorphic, the following won't even compile (gcc 4.0.1):
* @code
* OtherClass other;
* SpecialClass* ptr = dynamic_cast<SpecialClass*>(&other);
* @endcode
* to say nothing of this:
* @code
* void function(int);
* SpecialClass* ptr = dynamic_cast<SpecialClass*>(&function);
* @endcode
* ll_template_cast handles these kinds of cases by returning 0.
*/
template <typename T, typename U>
T ll_template_cast(U value)
{
return ll_template_cast_impl<T, U>()(value);
}
/**
* Implementation for ll_template_cast() (q.v.).
*
* Implementation for identical types: return same value.
*/
template <typename T>
struct ll_template_cast_impl<T, T>
{
T operator()(T value)
{
return value;
}
};
/**
* LL_TEMPLATE_CONVERTIBLE(dest, source) asserts that, for a value @c s of
* type @c source, <tt>ll_template_cast<dest>(s)</tt> will return @c s --
* presuming that @c source can be converted to @c dest by the normal rules of
* C++.
*
* By default, <tt>ll_template_cast<dest>(s)</tt> will return 0 unless @c s's
* type is literally identical to @c dest. (This is because of the
* straightforward application of template specialization rules.) That can
* lead to surprising results, e.g.:
*
* @code
* Foo myFoo;
* const Foo* fooptr = ll_template_cast<const Foo*>(&myFoo);
* @endcode
*
* Here @c fooptr will be 0 because <tt>&myFoo</tt> is of type <tt>Foo*</tt>
* -- @em not <tt>const Foo*</tt>. (Declaring <tt>const Foo myFoo;</tt> would
* force the compiler to do the right thing.)
*
* More disappointingly:
* @code
* struct Base {};
* struct Subclass: public Base {};
* Subclass object;
* Base* ptr = ll_template_cast<Base*>(&object);
* @endcode
*
* Here @c ptr will be 0 because <tt>&object</tt> is of type
* <tt>Subclass*</tt> rather than <tt>Base*</tt>. We @em want this cast to
* succeed, but without our help ll_template_cast can't recognize it.
*
* The following would suffice:
* @code
* LL_TEMPLATE_CONVERTIBLE(Base*, Subclass*);
* ...
* Base* ptr = ll_template_cast<Base*>(&object);
* @endcode
*
* However, as noted earlier, this is easily fooled:
* @code
* const Base* ptr = ll_template_cast<const Base*>(&object);
* @endcode
* would still produce 0 because we haven't yet seen:
* @code
* LL_TEMPLATE_CONVERTIBLE(const Base*, Subclass*);
* @endcode
*
* @TODO
* This macro should use Boost type_traits facilities for stripping and
* re-adding @c const and @c volatile qualifiers so that invoking
* LL_TEMPLATE_CONVERTIBLE(dest, source) will automatically generate all
* permitted permutations. It's really not fair to the coder to require
* separate:
* @code
* LL_TEMPLATE_CONVERTIBLE(Base*, Subclass*);
* LL_TEMPLATE_CONVERTIBLE(const Base*, Subclass*);
* LL_TEMPLATE_CONVERTIBLE(const Base*, const Subclass*);
* @endcode
*
* (Naturally we omit <tt>LL_TEMPLATE_CONVERTIBLE(Base*, const Subclass*)</tt>
* because that's not permitted by normal C++ assignment anyway.)
*/
#define LL_TEMPLATE_CONVERTIBLE(DEST, SOURCE) \
template <> \
struct ll_template_cast_impl<DEST, SOURCE> \
{ \
DEST operator()(SOURCE wrapper) \
{ \
return wrapper; \
} \
}
#endif /* ! defined(LL_LL_TEMPLATE_CAST_H) */

View File

@@ -59,7 +59,7 @@ void LLAllocatorHeapProfile::parse(std::string const & prof_text)
{
// *TODO - determine if there should be some better error state than
// mLines being empty. -brad
llwarns << "invalid heap profile data passed into parser." << llendl;
LL_WARNS() << "invalid heap profile data passed into parser." << LL_ENDL;
return;
}

View File

@@ -235,8 +235,8 @@ bool LLApp::parseCommandOptions(int argc, char** argv)
{
if(argv[ii][0] != '-')
{
llinfos << "Did not find option identifier while parsing token: "
<< argv[ii] << llendl;
LL_INFOS() << "Did not find option identifier while parsing token: "
<< argv[ii] << LL_ENDL;
return false;
}
int offset = 1;
@@ -415,7 +415,7 @@ void LLApp::startErrorThread()
//
if(!mThreadErrorp)
{
llinfos << "Starting error thread" << llendl;
LL_INFOS() << "Starting error thread" << LL_ENDL;
mThreadErrorp = new LLErrorThread();
mThreadErrorp->setUserData((void *) this);
mThreadErrorp->start();
@@ -432,7 +432,7 @@ void LLApp::stopErrorThread()
}
if (mThreadErrorp && !mThreadErrorp->isStopped())
{
llwarns << "Failed to stop Error Thread." << llendl;
LL_WARNS() << "Failed to stop Error Thread." << LL_ENDL;
}
}
@@ -450,7 +450,7 @@ void LLApp::runErrorHandler()
LLApp::sErrorHandler();
}
//llinfos << "App status now STOPPED" << llendl;
//LL_INFOS() << "App status now STOPPED" << LL_ENDL;
LLApp::setStopped();
}
@@ -512,7 +512,7 @@ void LLApp::setQuitting()
if (!isExiting())
{
// If we're already exiting, we don't want to reset our state back to quitting.
llinfos << "Setting app state to QUITTING" << llendl;
LL_INFOS() << "Setting app state to QUITTING" << LL_ENDL;
setStatus(APP_STATUS_QUITTING);
}
}
@@ -620,7 +620,7 @@ LONG WINAPI default_windows_exception_handler(struct _EXCEPTION_POINTERS *except
if (LLApp::isError())
{
llwarns << "Got another fatal signal while in the error handler, die now!" << llendl;
LL_WARNS() << "Got another fatal signal while in the error handler, die now!" << LL_ENDL;
retval = EXCEPTION_EXECUTE_HANDLER;
return retval;
}
@@ -666,7 +666,7 @@ BOOL ConsoleCtrlHandler(DWORD fdwCtrlType)
// We're already trying to die, just ignore this signal
if (LLApp::sLogInSignal)
{
llinfos << "Signal handler - Already trying to quit, ignoring signal!" << llendl;
LL_INFOS() << "Signal handler - Already trying to quit, ignoring signal!" << LL_ENDL;
}
return TRUE;
}
@@ -698,8 +698,8 @@ pid_t LLApp::fork()
if( pid < 0 )
{
int system_error = errno;
llwarns << "Unable to fork! Operating system error code: "
<< system_error << llendl;
LL_WARNS() << "Unable to fork! Operating system error code: "
<< system_error << LL_ENDL;
}
else if (pid == 0)
{
@@ -712,7 +712,7 @@ pid_t LLApp::fork()
}
else
{
llinfos << "Forked child process " << pid << llendl;
LL_INFOS() << "Forked child process " << pid << LL_ENDL;
}
return pid;
}
@@ -803,7 +803,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
if (LLApp::sLogInSignal)
{
llinfos << "Signal handler - Got signal " << signum << " - " << apr_signal_description_get(signum) << llendl;
LL_INFOS() << "Signal handler - Got signal " << signum << " - " << apr_signal_description_get(signum) << LL_ENDL;
}
@@ -812,7 +812,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
case SIGCHLD:
if (LLApp::sLogInSignal)
{
llinfos << "Signal handler - Got SIGCHLD from " << info->si_pid << llendl;
LL_INFOS() << "Signal handler - Got SIGCHLD from " << info->si_pid << LL_ENDL;
}
// Check result code for all child procs for which we've
@@ -833,7 +833,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
// Abort just results in termination of the app, no funky error handling.
if (LLApp::sLogInSignal)
{
llwarns << "Signal handler - Got SIGABRT, terminating" << llendl;
LL_WARNS() << "Signal handler - Got SIGABRT, terminating" << LL_ENDL;
}
clear_signals();
raise(signum);
@@ -843,7 +843,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
case SIGTERM:
if (LLApp::sLogInSignal)
{
llwarns << "Signal handler - Got SIGINT, HUP, or TERM, exiting gracefully" << llendl;
LL_WARNS() << "Signal handler - Got SIGINT, HUP, or TERM, exiting gracefully" << LL_ENDL;
}
// Graceful exit
// Just set our state to quitting, not error
@@ -852,7 +852,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
// We're already trying to die, just ignore this signal
if (LLApp::sLogInSignal)
{
llinfos << "Signal handler - Already trying to quit, ignoring signal!" << llendl;
LL_INFOS() << "Signal handler - Already trying to quit, ignoring signal!" << LL_ENDL;
}
return;
}
@@ -874,7 +874,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
// Smackdown treated just like any other app termination, for now
if (LLApp::sLogInSignal)
{
llwarns << "Signal handler - Handling smackdown signal!" << llendl;
LL_WARNS() << "Signal handler - Handling smackdown signal!" << LL_ENDL;
}
else
{
@@ -888,7 +888,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
if (LLApp::sLogInSignal)
{
llwarns << "Signal handler - Handling fatal signal!" << llendl;
LL_WARNS() << "Signal handler - Handling fatal signal!" << LL_ENDL;
}
if (LLApp::isError())
{
@@ -898,7 +898,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
if (LLApp::sLogInSignal)
{
llwarns << "Signal handler - Got another fatal signal while in the error handler, die now!" << llendl;
LL_WARNS() << "Signal handler - Got another fatal signal while in the error handler, die now!" << LL_ENDL;
}
raise(signum);
return;
@@ -906,13 +906,13 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
if (LLApp::sLogInSignal)
{
llwarns << "Signal handler - Flagging error status and waiting for shutdown" << llendl;
LL_WARNS() << "Signal handler - Flagging error status and waiting for shutdown" << LL_ENDL;
}
if (LLApp::isCrashloggerDisabled()) // Don't gracefully handle any signal, crash and core for a gdb post mortem
{
clear_signals();
llwarns << "Fatal signal received, not handling the crash here, passing back to operating system" << llendl;
LL_WARNS() << "Fatal signal received, not handling the crash here, passing back to operating system" << LL_ENDL;
raise(signum);
return;
}
@@ -927,7 +927,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
if (LLApp::sLogInSignal)
{
llwarns << "Signal handler - App is stopped, reraising signal" << llendl;
LL_WARNS() << "Signal handler - App is stopped, reraising signal" << LL_ENDL;
}
clear_signals();
raise(signum);
@@ -935,7 +935,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
} else {
if (LLApp::sLogInSignal)
{
llinfos << "Signal handler - Unhandled signal " << signum << ", ignoring!" << llendl;
LL_INFOS() << "Signal handler - Unhandled signal " << signum << ", ignoring!" << LL_ENDL;
}
}
}
@@ -969,7 +969,7 @@ bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_
strncpy(path, minidump_desc.path(), remaining);
llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl;
LL_INFOS() << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL;
LLApp::runErrorHandler();
#ifndef LL_RELEASE_FOR_DOWNLOAD
@@ -1015,7 +1015,7 @@ bool unix_post_minidump_callback(const char *dump_dir,
strncpy(path, ".dmp", remaining);
}
llinfos << "generated minidump: " << path << llendl;
LL_INFOS() << "generated minidump: " << path << LL_ENDL;
LLApp::runErrorHandler();
#ifndef LL_RELEASE_FOR_DOWNLOAD
@@ -1058,16 +1058,16 @@ bool windows_post_minidump_callback(const wchar_t* dump_path,
strncpy(path, ".dmp", remaining);
}
llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl;
LL_INFOS() << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL;
// *NOTE:Mani - this code is stolen from LLApp, where its never actually used.
//OSMessageBox("Attach Debugger Now", "Error", OSMB_OK);
// *TODO: Translate the signals/exceptions into cross-platform stuff
// Windows implementation
llinfos << "Entering Windows Exception Handler..." << llendl;
LL_INFOS() << "Entering Windows Exception Handler..." << LL_ENDL;
if (LLApp::isError())
{
llwarns << "Got another fatal signal while in the error handler, die now!" << llendl;
LL_WARNS() << "Got another fatal signal while in the error handler, die now!" << LL_ENDL;
}
// Flag status to error, so thread_error starts its work

View File

@@ -154,7 +154,7 @@ S32 LLAPRFile::read(void *buf, S32 nbytes)
{
if(!mFile)
{
llwarns << "apr mFile is removed by somebody else. Can not read." << llendl ;
LL_WARNS() << "apr mFile is removed by somebody else. Can not read." << LL_ENDL ;
return 0;
}
@@ -176,7 +176,7 @@ S32 LLAPRFile::write(const void *buf, S32 nbytes)
{
if(!mFile)
{
llwarns << "apr mFile is removed by somebody else. Can not write." << llendl ;
LL_WARNS() << "apr mFile is removed by somebody else. Can not write." << LL_ENDL ;
return 0;
}

View File

@@ -237,8 +237,8 @@ std::string LLBase32::encode(const U8* input, size_t input_size)
size_t encoded = base32_encode(&output[0], output_size, input, input_size);
llinfos << "encoded " << encoded << " into buffer of size "
<< output_size << llendl;
LL_INFOS() << "encoded " << encoded << " into buffer of size "
<< output_size << LL_ENDL;
}
return output;
}

View File

@@ -168,7 +168,7 @@ void LLCRC::update(const std::string& filename)
{
if (filename.empty())
{
llerrs << "No filename specified" << llendl;
LL_ERRS() << "No filename specified" << LL_ENDL;
return;
}
@@ -191,7 +191,7 @@ void LLCRC::update(const std::string& filename)
if (nread < (size_t) size)
{
llwarns << "Short read on " << filename << llendl;
LL_WARNS() << "Short read on " << filename << LL_ENDL;
}
update(data, nread);

View File

@@ -47,7 +47,7 @@
// crc.update(fgetc(fp));
// }
// fclose(fp);
// llinfos << "File crc: " << crc.getCRC() << llendl;
// LL_INFOS() << "File crc: " << crc.getCRC() << LL_ENDL;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class LL_COMMON_API LLCRC

View File

@@ -72,8 +72,8 @@ LLDate::LLDate(const std::string& iso8601_date)
{
if(!fromString(iso8601_date))
{
llwarns << "date " << iso8601_date << " failed to parse; "
<< "ZEROING IT OUT" << llendl;
LL_WARNS() << "date " << iso8601_date << " failed to parse; "
<< "ZEROING IT OUT" << LL_ENDL;
mSecondsSinceEpoch = DATE_EPOCH;
}
}

View File

@@ -1,54 +0,0 @@
/**
* @file lldeleteutils.h
* @brief Utility functions to simplify some common pointer-munging idioms.
*
* $LicenseInfo:firstyear=2009&license=viewergpl$
*
* Copyright (c) 2009-2010, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlife.com/developers/opensource/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlife.com/developers/opensource/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*
*/
#ifndef LL_DELETE_UTILS_H
#define LL_DELETE_UTILS_H
// Simple utility functions to eventually replace the common 2-line
// idiom scattered throughout the viewer codebase. Note that where
// possible we would rather be using smart pointers of some sort.
template <class T>
inline void deleteAndClear(T*& ptr)
{
delete ptr;
ptr = NULL;
}
template <class T>
inline void deleteAndClearArray(T*& array_ptr)
{
delete[] array_ptr;
array_ptr = NULL;
}
#endif

View File

@@ -33,18 +33,19 @@
#ifndef LL_LLDEPTHSTACK_H
#define LL_LLDEPTHSTACK_H
#include "linked_lists.h"
#include "llstl.h"
template <class DATA_TYPE> class LLDepthStack
{
private:
LLLinkedList<DATA_TYPE> mStack;
std::deque<DATA_TYPE*> mStack;
U32 mCurrentDepth;
U32 mMaxDepth;
public:
LLDepthStack() : mCurrentDepth(0), mMaxDepth(0) {}
~LLDepthStack() {}
LLDepthStack()
: mCurrentDepth(0), mMaxDepth(0)
{}
void setDepth(U32 depth)
{
@@ -60,24 +61,27 @@ public:
{
if (mCurrentDepth < mMaxDepth)
{
mStack.addData(data);
mStack.push_back(data);
mCurrentDepth++;
}
else
{
// the last item falls off stack and is deleted
mStack.getLastData();
mStack.deleteCurrentData();
mStack.addData(data);
if (!mStack.empty())
{
mStack.pop_front();
}
mStack.push_back(data);
}
}
DATA_TYPE *pop()
{
DATA_TYPE *tempp = mStack.getFirstData();
if (tempp)
DATA_TYPE *tempp = NULL;
if (!mStack.empty())
{
mStack.removeCurrentData();
tempp = mStack.back();
mStack.pop_back();
mCurrentDepth--;
}
return tempp;
@@ -85,20 +89,13 @@ public:
DATA_TYPE *check()
{
DATA_TYPE *tempp = mStack.getFirstData();
return tempp;
return mStack.empty() ? NULL : mStack.back();
}
void deleteAllData()
{
mCurrentDepth = 0;
mStack.deleteAllData();
}
void removeAllNodes()
{
mCurrentDepth = 0;
mStack.removeAllNodes();
mStack.clear();
}
};

View File

@@ -36,6 +36,7 @@
#include <map>
#include <string>
#include "llpreprocessor.h"
struct LL_COMMON_API LLDictionaryEntry
{
@@ -94,7 +95,7 @@ protected:
{
if (lookup(index))
{
llerrs << "Dictionary entry already added (attempted to add duplicate entry)" << llendl;
LL_ERRS() << "Dictionary entry already added (attempted to add duplicate entry)" << LL_ENDL;
}
(*this)[index] = entry;
}

File diff suppressed because it is too large Load Diff

View File

@@ -31,9 +31,77 @@
#include <sstream>
#include <typeinfo>
#include "llerrorlegacy.h"
#include "stdtypes.h"
#include "llpreprocessor.h"
#include <boost/static_assert.hpp>
const int LL_ERR_NOERR = 0;
// Define one of these for different error levels in release...
// #define RELEASE_SHOW_DEBUG // Define this if you want your release builds to show lldebug output.
#define RELEASE_SHOW_INFO // Define this if you want your release builds to show llinfo output
#define RELEASE_SHOW_WARN // Define this if you want your release builds to show llwarn output.
#ifdef _DEBUG
#define SHOW_DEBUG
#define SHOW_WARN
#define SHOW_INFO
#define SHOW_ASSERT
#else // _DEBUG
#ifdef LL_RELEASE_WITH_DEBUG_INFO
#define SHOW_ASSERT
#endif // LL_RELEASE_WITH_DEBUG_INFO
#ifdef RELEASE_SHOW_DEBUG
#define SHOW_DEBUG
#endif
#ifdef RELEASE_SHOW_WARN
#define SHOW_WARN
#endif
#ifdef RELEASE_SHOW_INFO
#define SHOW_INFO
#endif
#ifdef RELEASE_SHOW_ASSERT
#define SHOW_ASSERT
#endif
#endif // !_DEBUG
#define liru_slashpos std::string(__FILE__).find_last_of("/\\")
#define liru_slashpos2 std::string(__FILE__).substr(0,liru_slashpos).find_last_of("/\\")
#define liru_assert_strip /*strip path down to lastlevel directory and filename for assert.*/\
(liru_slashpos == std::string::npos ? std::string(__FILE__)/*just filename, print as is*/\
: liru_slashpos2 == std::string::npos ? std::string(__FILE__)/*Apparently, we're in / or perhaps the top of the drive, print as is*/\
: std::string(__FILE__).substr(1+liru_slashpos2))/*print foo/bar.cpp or perhaps foo\bar.cpp*/
#define llassert_always_msg(func, msg) do { if (LL_UNLIKELY(!(func))) LL_ERRS() << "ASSERT (" << msg << ")\nfile:" << liru_assert_strip << " line:" << std::dec << __LINE__ << LL_ENDL; } while (0)
#define llassert_always(func) llassert_always_msg(func, #func)
#ifdef SHOW_ASSERT
#define llassert(func) llassert_always_msg(func, #func)
#define llverify(func) llassert_always_msg(func, #func)
#define ASSERT_ONLY(...) __VA_ARGS__
#define ASSERT_ONLY_COMMA(...) , __VA_ARGS__
#else
#define llassert(func)
#define llverify(func) do {if (func) {}} while(0)
#define ASSERT_ONLY(...)
#define ASSERT_ONLY_COMMA(...)
#endif
#ifdef LL_WINDOWS
#define LL_STATIC_ASSERT(func, msg) static_assert(func, msg)
#define LL_BAD_TEMPLATE_INSTANTIATION(type, msg) static_assert(false, msg)
#else
#define LL_STATIC_ASSERT(func, msg) BOOST_STATIC_ASSERT(func)
#define LL_BAD_TEMPLATE_INSTANTIATION(type, msg) BOOST_STATIC_ASSERT(sizeof(type) != 0 && false);
#endif
/** Error Logging Facility
@@ -122,46 +190,62 @@ namespace LLError
They are not intended for general use.
*/
class CallSite;
struct CallSite;
class LL_COMMON_API Log
{
public:
static bool shouldLog(CallSite&);
static std::ostringstream* out();
static void flush(std::ostringstream* out, char* message) ;
static void flush(std::ostringstream* out, char* message);
static void flush(std::ostringstream*, const CallSite&);
};
class LL_COMMON_API CallSite
struct LL_COMMON_API CallSite
{
// Represents a specific place in the code where a message is logged
// This is public because it is used by the macros below. It is not
// intended for public use.
public:
CallSite(ELevel, const char* file, int line,
const std::type_info& class_info, const char* function, const char* broadTag, const char* narrowTag, bool printOnce);
CallSite(ELevel level,
const char* file,
int line,
const std::type_info& class_info,
const char* function,
bool print_once,
const char** tags,
size_t tag_count);
~CallSite();
#ifdef LL_LIBRARY_INCLUDE
bool shouldLog();
#else // LL_LIBRARY_INCLUDE
bool shouldLog()
{ return mCached ? mShouldLog : Log::shouldLog(*this); }
{
return mCached
? mShouldLog
: Log::shouldLog(*this);
}
// this member function needs to be in-line for efficiency
#endif // LL_LIBRARY_INCLUDE
void invalidate();
private:
// these describe the call site and never change
const ELevel mLevel;
const char* const mFile;
const int mLine;
const std::type_info& mClassInfo;
const int mLine;
const std::type_info& mClassInfo;
const char* const mFunction;
const char* const mBroadTag;
const char* const mNarrowTag;
const bool mPrintOnce;
// these implement a cache of the call to shouldLog()
bool mCached;
bool mShouldLog;
const char** mTags;
size_t mTagCount;
const bool mPrintOnce;
const char* mLevelString;
std::string mLocationString,
mFunctionString,
mTagString;
bool mCached,
mShouldLog;
friend class Log;
};
@@ -187,6 +271,9 @@ namespace LLError
private:
static char** sBuffer ;
static S32 sIndex ;
static void allocateStackBuffer();
static void freeStackBuffer();
public:
static void push(const char* function, const int line) ;
@@ -194,21 +281,25 @@ namespace LLError
static void print() ;
static void clear() ;
static void end(std::ostringstream* _out) ;
static void cleanup();
};
}
//this is cheaper than llcallstacks if no need to output other variables to call stacks.
#define llpushcallstacks LLError::LLCallStacks::push(__FUNCTION__, __LINE__)
#define llcallstacks \
{\
#define LL_PUSH_CALLSTACKS() LLError::LLCallStacks::push(__FUNCTION__, __LINE__)
#define llcallstacks \
{ \
std::ostringstream* _out = LLError::LLCallStacks::insert(__FUNCTION__, __LINE__) ; \
(*_out)
#define llcallstacksendl \
LLError::End(); \
#define llcallstacksendl \
LLError::End(); \
LLError::LLCallStacks::end(_out) ; \
}
#define llclearcallstacks LLError::LLCallStacks::clear()
#define llprintcallstacks LLError::LLCallStacks::print()
#define LL_CLEAR_CALLSTACKS() LLError::LLCallStacks::clear()
#define LL_PRINT_CALLSTACKS() LLError::LLCallStacks::print()
/*
Class type information for logging
@@ -222,83 +313,78 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG;
// Outside a class declaration, or in class without LOG_CLASS(), this
// typedef causes the messages to not be associated with any class.
/////////////////////////////////
// Error Logging Macros
// See top of file for common usage.
/////////////////////////////////
// this macro uses a one-shot do statement to avoid parsing errors when writing control flow statements
// without braces:
// if (condition) LL_INFOS() << "True" << LL_ENDL; else LL_INFOS()() << "False" << LL_ENDL
/*
Error Logging Macros
See top of file for common usage.
*/
#define lllog(level, broadTag, narrowTag, once, nofunction) \
do { \
static LLError::CallSite _site( \
level, __FILE__, __LINE__, typeid(_LL_CLASS_TO_LOG), nofunction ? NULL : __FUNCTION__, broadTag, narrowTag, once);\
if (LL_UNLIKELY(_site.shouldLog())) \
{ \
std::ostringstream* _out = LLError::Log::out(); \
#define lllog(level, once, nofunction, ...) \
do { \
const char* tags[] = {"", ##__VA_ARGS__}; \
::size_t tag_count = LL_ARRAY_SIZE(tags) - 1; \
static LLError::CallSite _site( \
level, __FILE__, __LINE__, typeid(_LL_CLASS_TO_LOG), nofunction ? NULL : __FUNCTION__, once, &tags[1], tag_count);\
if (LL_UNLIKELY(_site.shouldLog())) \
{ \
std::ostringstream* _out = LLError::Log::out(); \
(*_out)
// DEPRECATED: Don't call directly, use LL_ENDL instead, which actually looks like a macro
#define llendl \
LLError::End(); \
//Use this construct if you need to do computation in the middle of a
//message:
//
// LL_INFOS("AgentGesture") << "the agent " << agend_id;
// switch (f)
// {
// case FOP_SHRUGS: LL_CONT << "shrugs"; break;
// case FOP_TAPS: LL_CONT << "points at " << who; break;
// case FOP_SAYS: LL_CONT << "says " << message; break;
// }
// LL_CONT << " for " << t << " seconds" << LL_ENDL;
//
//Such computation is done iff the message will be logged.
#define LL_CONT (*_out)
#define LL_NEWLINE '\n'
#define LL_ENDL \
LLError::End(); \
LLError::Log::flush(_out, _site); \
} \
} \
} while(0)
// DEPRECATED: Use the new macros that allow tags and *look* like macros.
#define lldebugs lllog(LLError::LEVEL_DEBUG, NULL, NULL, false, false)
#define llinfos lllog(LLError::LEVEL_INFO, NULL, NULL, false, false)
#define llwarns lllog(LLError::LEVEL_WARN, NULL, NULL, false, false)
#define llerrs lllog(LLError::LEVEL_ERROR, NULL, NULL, false, false)
#define llcont (*_out)
// No function name
#define lldebugs_nf lllog(LLError::LEVEL_DEBUG, NULL, NULL, false, true)
#define llinfos_nf lllog(LLError::LEVEL_INFO, NULL, NULL, false, true)
#define llwarns_nf lllog(LLError::LEVEL_WARN, NULL, NULL, false, true)
#define llerrs_nf lllog(LLError::LEVEL_ERROR, NULL, NULL, false, true)
// NEW Macros for debugging, allow the passing of a string tag
// One Tag
#define LL_DEBUGS(broadTag) lllog(LLError::LEVEL_DEBUG, broadTag, NULL, false, false)
#define LL_INFOS(broadTag) lllog(LLError::LEVEL_INFO, broadTag, NULL, false, false)
#define LL_WARNS(broadTag) lllog(LLError::LEVEL_WARN, broadTag, NULL, false, false)
#define LL_ERRS(broadTag) lllog(LLError::LEVEL_ERROR, broadTag, NULL, false, false)
// Two Tags
#define LL_DEBUGS2(broadTag, narrowTag) lllog(LLError::LEVEL_DEBUG, broadTag, narrowTag, false, false)
#define LL_INFOS2(broadTag, narrowTag) lllog(LLError::LEVEL_INFO, broadTag, narrowTag, false, false)
#define LL_WARNS2(broadTag, narrowTag) lllog(LLError::LEVEL_WARN, broadTag, narrowTag, false, false)
#define LL_ERRS2(broadTag, narrowTag) lllog(LLError::LEVEL_ERROR, broadTag, narrowTag, false, false)
// Pass comma separated list of tags (currently only supports up to 0, 1, or 2)
#define LL_DEBUGS(...) lllog(LLError::LEVEL_DEBUG, false, false, ##__VA_ARGS__)
#define LL_INFOS(...) lllog(LLError::LEVEL_INFO, false, false, ##__VA_ARGS__)
#define LL_WARNS(...) lllog(LLError::LEVEL_WARN, false, false, ##__VA_ARGS__)
#define LL_ERRS(...) lllog(LLError::LEVEL_ERROR, false, false, ##__VA_ARGS__)
// alternative to llassert_always that prints explanatory message
#define LL_ERRS_IF(exp, ...) if (exp) LL_ERRS(##__VA_ARGS__) << "(" #exp ")"
// Only print the log message once (good for warnings or infos that would otherwise
// spam the log file over and over, such as tighter loops).
#define LL_DEBUGS_ONCE(broadTag) lllog(LLError::LEVEL_DEBUG, broadTag, NULL, true, false)
#define LL_INFOS_ONCE(broadTag) lllog(LLError::LEVEL_INFO, broadTag, NULL, true, false)
#define LL_WARNS_ONCE(broadTag) lllog(LLError::LEVEL_WARN, broadTag, NULL, true, false)
#define LL_DEBUGS2_ONCE(broadTag, narrowTag) lllog(LLError::LEVEL_DEBUG, broadTag, narrowTag, true, false)
#define LL_INFOS2_ONCE(broadTag, narrowTag) lllog(LLError::LEVEL_INFO, broadTag, narrowTag, true, false)
#define LL_WARNS2_ONCE(broadTag, narrowTag) lllog(LLError::LEVEL_WARN, broadTag, narrowTag, true, false)
#define LL_DEBUGS_ONCE(...) lllog(LLError::LEVEL_DEBUG, true, false, ##__VA_ARGS__)
#define LL_INFOS_ONCE(...) lllog(LLError::LEVEL_INFO, true, false, ##__VA_ARGS__)
#define LL_WARNS_ONCE(...) lllog(LLError::LEVEL_WARN, true, false, ##__VA_ARGS__)
#define LL_ENDL llendl
#define LL_CONT (*_out)
// No function name
#define LL_DEBUGS_NF(...) lllog(LLError::LEVEL_DEBUG, false, true, ##__VA_ARGS__)
#define LL_INFOS_NF(...) lllog(LLError::LEVEL_INFO, false, true, ##__VA_ARGS__)
#define LL_WARNS_NF(...) lllog(LLError::LEVEL_WARN, false, true, ##__VA_ARGS__)
#define LL_ERRS_NF(...) lllog(LLError::LEVEL_ERROR, false, true, ##__VA_ARGS__)
// DEPRECATED: Use the new macros that allow tags and *look* like macros.
#define lldebugs LL_COMPILE_TIME_MESSAGE("Warning: lldebugs deprecated, use LL_DEBUGS() instead") LL_DEBUGS()
#define llinfos LL_COMPILE_TIME_MESSAGE("Warning: llinfos deprecated, use LL_INFOS() instead") LL_INFOS()
#define llwarns LL_COMPILE_TIME_MESSAGE("Warning: llwarns deprecated, use LL_WARNS() instead") LL_WARNS()
#define llerrs LL_COMPILE_TIME_MESSAGE("Warning: llerrs deprecated, use LL_ERRS() instead") LL_ERRS()
#define llcont LL_COMPILE_TIME_MESSAGE("Warning: llcont deprecated, use LL_CONT instead") LL_CONT
#define llendl LL_COMPILE_TIME_MESSAGE("Warning: llendl deprecated, use LL_ENDL instead") LL_ENDL
/*
Use this construct if you need to do computation in the middle of a
message:
LL_INFOS("AgentGesture") << "the agent " << agend_id;
switch (f)
{
case FOP_SHRUGS: LL_CONT << "shrugs"; break;
case FOP_TAPS: LL_CONT << "points at " << who; break;
case FOP_SAYS: LL_CONT << "says " << message; break;
}
LL_CONT << " for " << t << " seconds" << LL_ENDL;
Such computation is done iff the message will be logged.
*/
#endif // LL_LLERROR_H

View File

@@ -29,7 +29,10 @@
#define LL_LLERRORCONTROL_H
#include "llerror.h"
#include "llpointer.h"
#include "llrefcount.h"
#include "boost/function.hpp"
#include "boost/shared_ptr.hpp"
#include <string>
class LLSD;
@@ -62,7 +65,7 @@ namespace LLError
// logs to stderr, syslog, and windows debug log
// the identity string is used for in the syslog
LL_COMMON_API void initForApplication(const std::string& dir);
LL_COMMON_API void initForApplication(const std::string& dir, bool log_to_stderr = true);
// resets all logging settings to defaults needed by applicaitons
// logs to stderr and windows debug log
// sets up log configuration from the file logcontrol.xml in dir
@@ -72,14 +75,16 @@ namespace LLError
Settings that control what is logged.
Setting a level means log messages at that level or above.
*/
LL_COMMON_API void setPrintLocation(bool);
LL_COMMON_API void setDefaultLevel(LLError::ELevel);
LL_COMMON_API ELevel getDefaultLevel();
LL_COMMON_API void setFunctionLevel(const std::string& function_name, LLError::ELevel);
LL_COMMON_API void setClassLevel(const std::string& class_name, LLError::ELevel);
LL_COMMON_API void setFileLevel(const std::string& file_name, LLError::ELevel);
LL_COMMON_API void setTagLevel(const std::string& file_name, LLError::ELevel);
LL_COMMON_API LLError::ELevel decodeLevel(std::string name);
LL_COMMON_API void configure(const LLSD&);
// the LLSD can configure all of the settings
// usually read automatically from the live errorlog.xml file
@@ -134,26 +139,34 @@ namespace LLError
{
// An object that handles the actual output or error messages.
public:
Recorder();
virtual ~Recorder();
virtual void recordMessage(LLError::ELevel, const std::string& message) = 0;
// use the level for better display, not for filtering
virtual bool wantsTime(); // default returns false
// override and return true if the recorder wants the time string
// included in the text of the message
bool wantsTime();
bool wantsTags();
bool wantsLevel();
bool wantsLocation();
bool wantsFunctionName();
protected:
bool mWantsTime,
mWantsTags,
mWantsLevel,
mWantsLocation,
mWantsFunctionName;
};
typedef boost::shared_ptr<Recorder> RecorderPtr;
/**
* @NOTE: addRecorder() conveys ownership to the underlying Settings
* object -- when destroyed, it will @em delete the passed Recorder*!
* @NOTE: addRecorder() and removeRecorder() uses the boost::shared_ptr to allow for shared ownership
* while still ensuring that the allocated memory is eventually freed
*/
LL_COMMON_API void addRecorder(Recorder*);
/**
* @NOTE: removeRecorder() reclaims ownership of the Recorder*: its
* lifespan becomes the caller's problem.
*/
LL_COMMON_API void removeRecorder(Recorder*);
LL_COMMON_API void addRecorder(RecorderPtr);
LL_COMMON_API void removeRecorder(RecorderPtr);
// each error message is passed to each recorder via recordMessage()
LL_COMMON_API void logToFile(const std::string& filename);
@@ -170,13 +183,12 @@ namespace LLError
Utilities for use by the unit tests of LLError itself.
*/
class ThreadSafeSettings;
LL_COMMON_API ThreadSafeSettings* saveAndResetSettings();
LL_COMMON_API void restoreSettings(ThreadSafeSettings *);
typedef LLPointer<LLRefCount> SettingsStoragePtr;
LL_COMMON_API SettingsStoragePtr saveAndResetSettings();
LL_COMMON_API void restoreSettings(SettingsStoragePtr pSettingsStorage);
LL_COMMON_API std::string abbreviateFile(const std::string& filePath);
LL_COMMON_API int shouldLogCallCount();
};
#endif // LL_LLERRORCONTROL_H

View File

@@ -97,9 +97,9 @@ const int LL_ERR_PRICE_MISMATCH = -23018;
#define llendflush llendl
#define llerror(msg, num) llerrs << "Error # " << num << ": " << msg << llendl;
#define llerror(msg, num) LL_ERRS() << "Error # " << num << ": " << msg << LL_ENDL;
#define llwarning(msg, num) llwarns << "Warning # " << num << ": " << msg << llendl;
#define llwarning(msg, num) LL_WARNS() << "Warning # " << num << ": " << msg << LL_ENDL;
#define liru_slashpos std::string(__FILE__).find_last_of("/\\")
#define liru_slashpos2 std::string(__FILE__).substr(0,liru_slashpos).find_last_of("/\\")
@@ -108,7 +108,7 @@ const int LL_ERR_PRICE_MISMATCH = -23018;
: liru_slashpos2 == std::string::npos ? std::string(__FILE__)/*Apparently, we're in / or perhaps the top of the drive, print as is*/\
: std::string(__FILE__).substr(1+liru_slashpos2))/*print foo/bar.cpp or perhaps foo\bar.cpp*/
#define llassert_always(func) do { if (LL_UNLIKELY(!(func))) llerrs << "\nASSERT(" #func ")\nfile:" << liru_assert_strip << " line:" << std::dec << __LINE__ << llendl; } while(0)
#define llassert_always(func) do { if (LL_UNLIKELY(!(func))) LL_ERRS() << "\nASSERT(" #func ")\nfile:" << liru_assert_strip << " line:" << std::dec << __LINE__ << LL_ENDL; } while(0)
#ifdef SHOW_ASSERT
#define llassert(func) llassert_always(func)

View File

@@ -65,7 +65,7 @@ void get_child_status(const int waitpid_status, int &process_status, bool &exite
exited = true;
if (do_logging)
{
llinfos << "get_child_status - Child exited cleanly with return of " << process_status << llendl;
LL_INFOS() << "get_child_status - Child exited cleanly with return of " << process_status << LL_ENDL;
}
return;
}
@@ -75,15 +75,15 @@ void get_child_status(const int waitpid_status, int &process_status, bool &exite
exited = true;
if (do_logging)
{
llinfos << "get_child_status - Child died because of uncaught signal " << process_status << llendl;
LL_INFOS() << "get_child_status - Child died because of uncaught signal " << process_status << LL_ENDL;
#ifdef WCOREDUMP
if (WCOREDUMP(waitpid_status))
{
llinfos << "get_child_status - Child dumped core" << llendl;
LL_INFOS() << "get_child_status - Child dumped core" << LL_ENDL;
}
else
{
llinfos << "get_child_status - Child didn't dump core" << llendl;
LL_INFOS() << "get_child_status - Child didn't dump core" << LL_ENDL;
}
#endif
}
@@ -93,7 +93,7 @@ void get_child_status(const int waitpid_status, int &process_status, bool &exite
{
// This is weird. I just dump the waitpid status into the status code,
// not that there's any way of telling what it is...
llinfos << "get_child_status - Got SIGCHILD but child didn't exit" << llendl;
LL_INFOS() << "get_child_status - Got SIGCHILD but child didn't exit" << LL_ENDL;
process_status = waitpid_status;
}
@@ -106,7 +106,7 @@ void LLErrorThread::run()
// This thread sits and waits for the sole purpose
// of waiting for the signal/exception handlers to flag the
// application state as APP_STATUS_ERROR.
llinfos << "thread_error - Waiting for an error" << llendl;
LL_INFOS() << "thread_error - Waiting for an error" << LL_ENDL;
S32 counter = 0;
#if !LL_WINDOWS
@@ -124,7 +124,7 @@ void LLErrorThread::run()
last_sig_child_count = current_sig_child_count;
if (LLApp::sLogInSignal)
{
llinfos << "thread_error handling SIGCHLD #" << current_sig_child_count << llendl;
LL_INFOS() << "thread_error handling SIGCHLD #" << current_sig_child_count << LL_ENDL;
}
for (LLApp::child_map::iterator iter = LLApp::sChildMap.begin(); iter != LLApp::sChildMap.end();)
{
@@ -141,7 +141,7 @@ void LLErrorThread::run()
{
if (LLApp::sLogInSignal)
{
llinfos << "Signal handler - Running child callback" << llendl;
LL_INFOS() << "Signal handler - Running child callback" << LL_ENDL;
}
child_info.mCallback(child_pid, exited, status);
}
@@ -172,7 +172,7 @@ void LLErrorThread::run()
{
if (LLApp::sLogInSignal)
{
llinfos << "Signal handler - Running default child callback" << llendl;
LL_INFOS() << "Signal handler - Running default child callback" << LL_ENDL;
}
LLApp::sDefaultChildCallback(child_pid, true, status);
}

View File

@@ -61,7 +61,7 @@
#include "llsd.h"
#include "llsingleton.h"
#include "lldependencies.h"
#include "ll_template_cast.h"
#include "llstl.h"
/*==========================================================================*|
// override this to allow binding free functions with more parameters

View File

@@ -569,8 +569,8 @@ void LLFastTimer::NamedTimer::buildHierarchy()
{
// since ancestors have already been visited, reparenting won't affect tree traversal
//step up tree, bringing our descendants with us
//llinfos << "Moving " << timerp->getName() << " from child of " << timerp->getParent()->getName() <<
// " to child of " << timerp->getParent()->getParent()->getName() << llendl;
//LL_INFOS() << "Moving " << timerp->getName() << " from child of " << timerp->getParent()->getName() <<
// " to child of " << timerp->getParent()->getParent()->getName() << LL_ENDL;
timerp->setParent(timerp->getParent()->getParent());
timerp->getFrameState().mMoveUpTree = false;
@@ -662,12 +662,12 @@ void LLFastTimer::NamedTimer::resetFrame()
static S32 call_count = 0;
if (call_count % 100 == 0)
{
llinfos << "countsPerSecond (32 bit): " << countsPerSecond() << llendl;
llinfos << "get_clock_count (64 bit): " << get_clock_count() << llendl;
llinfos << "LLProcessorInfo().getCPUFrequency() " << LLProcessorInfo().getCPUFrequency() << llendl;
llinfos << "getCPUClockCount32() " << getCPUClockCount32() << llendl;
llinfos << "getCPUClockCount64() " << getCPUClockCount64() << llendl;
llinfos << "elapsed sec " << ((F64)getCPUClockCount64())/((F64)LLProcessorInfo().getCPUFrequency()*1000000.0) << llendl;
LL_INFOS() << "countsPerSecond (32 bit): " << countsPerSecond() << LL_ENDL;
LL_INFOS() << "get_clock_count (64 bit): " << get_clock_count() << LL_ENDL;
LL_INFOS() << "LLProcessorInfo().getCPUFrequency() " << LLProcessorInfo().getCPUFrequency() << LL_ENDL;
LL_INFOS() << "getCPUClockCount32() " << getCPUClockCount32() << LL_ENDL;
LL_INFOS() << "getCPUClockCount64() " << getCPUClockCount64() << LL_ENDL;
LL_INFOS() << "elapsed sec " << ((F64)getCPUClockCount64())/((F64)LLProcessorInfo().getCPUFrequency()*1000000.0) << LL_ENDL;
}
call_count++;
@@ -851,7 +851,7 @@ void LLFastTimer::nextFrame()
U64 frame_time = getCPUClockCount64();
if ((frame_time - sLastFrameTime) >> 8 > 0xffffffff)
{
llinfos << "Slow frame, fast timers inaccurate" << llendl;
LL_INFOS() << "Slow frame, fast timers inaccurate" << LL_ENDL;
}
if (!sPauseHistory)
@@ -896,7 +896,7 @@ void LLFastTimer::dumpCurTimes()
<< std::setprecision(3) << total_time_ms << " ms, "
<< timerp->getHistoricalCalls(0) << " calls";
llinfos << out_str.str() << llendl;
LL_INFOS() << out_str.str() << LL_ENDL;
}
}

View File

@@ -35,7 +35,7 @@
#define LL_LLFORMAT_H
// Use as follows:
// llinfos << llformat("Test:%d (%.2f %.2f)", idx, x, y) << llendl;
// LL_INFOS() << llformat("Test:%d (%.2f %.2f)", idx, x, y) << LL_ENDL;
//
// *NOTE: buffer limited to 1024, (but vsnprintf prevents overrun)
// should perhaps be replaced with boost::format.

View File

@@ -98,7 +98,7 @@ LLHeartbeat::rawSendWithTimeout(F32 timeout_sec)
mTimeoutTimer.setTimerExpirySec(timeout_sec);
do {
result = rawSend();
//llinfos << " HEARTSENDc=" << result << llendl;
//LL_INFOS() << " HEARTSENDc=" << result << LL_ENDL;
} while (result==1 && !mTimeoutTimer.hasExpired());
return result;
@@ -118,7 +118,7 @@ LLHeartbeat::send(F32 timeout_sec)
// zero-timeout; we don't care too much whether our
// heartbeat was digested.
result = rawSend();
//llinfos << " HEARTSENDb=" << result << llendl;
//LL_INFOS() << " HEARTSENDb=" << result << LL_ENDL;
}
}
@@ -146,14 +146,14 @@ LLHeartbeat::send(F32 timeout_sec)
// It's been ages since we successfully had a heartbeat
// digested by the watchdog. Sit here and spin a while
// in the hope that we can force it through.
llwarns << "Unable to deliver heartbeat to launcher for " << mPanicTimer.getElapsedTimeF32() << " seconds. Going to try very hard for up to " << mAggressiveHeartbeatMaxBlockingSecs << " seconds." << llendl;
LL_WARNS() << "Unable to deliver heartbeat to launcher for " << mPanicTimer.getElapsedTimeF32() << " seconds. Going to try very hard for up to " << mAggressiveHeartbeatMaxBlockingSecs << " seconds." << LL_ENDL;
result = rawSendWithTimeout(mAggressiveHeartbeatMaxBlockingSecs);
if (result == 0) {
total_success = true;
} else {
// we couldn't even force it through. That's bad,
// but we'll try again in a while.
llwarns << "Could not deliver heartbeat to launcher even after trying very hard for " << mAggressiveHeartbeatMaxBlockingSecs << " seconds." << llendl;
LL_WARNS() << "Could not deliver heartbeat to launcher even after trying very hard for " << mAggressiveHeartbeatMaxBlockingSecs << " seconds." << LL_ENDL;
}
// in any case, reset the panic timer.

View File

@@ -100,13 +100,13 @@ namespace LLInitParam
void Parser::parserWarning(const std::string& message)
{
if (mParseSilently) return;
llwarns << message << llendl;
LL_WARNS() << message << LL_ENDL;
}
void Parser::parserError(const std::string& message)
{
if (mParseSilently) return;
llerrs << message << llendl;
LL_ERRS() << message << LL_ENDL;
}
@@ -131,7 +131,7 @@ namespace LLInitParam
std::string name(char_name);
if ((size_t)param->mParamHandle > mMaxParamOffset)
{
llerrs << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block<YOUR_CLASS, PARAM_BLOCK_BASE_CLASS>" << llendl;
LL_ERRS() << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block<YOUR_CLASS, PARAM_BLOCK_BASE_CLASS>" << LL_ENDL;
}
if (name.empty())
@@ -214,7 +214,7 @@ namespace LLInitParam
{
if (emit_errors)
{
llwarns << "Invalid param \"" << getParamName(block_data, param) << "\"" << llendl;
LL_WARNS() << "Invalid param \"" << getParamName(block_data, param) << "\"" << LL_ENDL;
}
return false;
}
@@ -417,7 +417,7 @@ namespace LLInitParam
// Block<T, Base_Class>
if ((size_t)handle > block_data.mMaxParamOffset)
{
llerrs << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block<YOUR_CLASS, PARAM_BLOCK_BASE_CLASS>" << llendl;
LL_ERRS() << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block<YOUR_CLASS, PARAM_BLOCK_BASE_CLASS>" << LL_ENDL;
}
ParamDescriptorPtr param_descriptor = findParamDescriptor(param);

View File

@@ -31,7 +31,7 @@
#include <map>
#include <typeinfo>
#include "string_table.h"
#include "llstringtable.h"
#include "llerror.h" // llassert_always
#include <boost/utility.hpp>
#include <boost/function.hpp>

View File

@@ -53,8 +53,8 @@ LLLiveAppConfig::~LLLiveAppConfig()
// virtual
bool LLLiveAppConfig::loadFile()
{
llinfos << "LLLiveAppConfig::loadFile(): reading from "
<< filename() << llendl;
LL_INFOS() << "LLLiveAppConfig::loadFile(): reading from "
<< filename() << LL_ENDL;
llifstream file(filename());
LLSD config;
if (file.is_open())
@@ -62,15 +62,15 @@ bool LLLiveAppConfig::loadFile()
LLSDSerialize::fromXML(config, file);
if(!config.isMap())
{
llwarns << "Live app config not an map in " << filename()
<< " Ignoring the data." << llendl;
LL_WARNS() << "Live app config not an map in " << filename()
<< " Ignoring the data." << LL_ENDL;
return false;
}
file.close();
}
else
{
llinfos << "Live file " << filename() << " does not exit." << llendl;
LL_INFOS() << "Live file " << filename() << " does not exit." << LL_ENDL;
}
// *NOTE: we do not handle the else case here because we would not
// have attempted to load the file unless LLLiveFile had

View File

@@ -250,11 +250,11 @@ void LLLocalIDHashMap<DATA_TYPE, SIZE>::dumpIter()
{
if (mIters[i])
{
llinfos << i << " " << mIters[i]->mCurHashNodep << " " << mIters[i]->mCurHashNodeKey << llendl;
LL_INFOS() << i << " " << mIters[i]->mCurHashNodep << " " << mIters[i]->mCurHashNodeKey << LL_ENDL;
}
else
{
llinfos << i << "null" << llendl;
LL_INFOS() << i << "null" << LL_ENDL;
}
}
}
@@ -701,7 +701,7 @@ void LLLocalIDHashMap<DATA_TYPE, SIZE>::removeIter(LLLocalIDHashMapIter<DATA_TYP
return;
}
}
llerrs << "Iterator " << iter << " not found for removal in hash map!" << llendl;
LL_ERRS() << "Iterator " << iter << " not found for removal in hash map!" << LL_ENDL;
}
template <class DATA_TYPE, int SIZE>
@@ -717,7 +717,7 @@ void LLLocalIDHashMap<DATA_TYPE, SIZE>::addIter(LLLocalIDHashMapIter<DATA_TYPE,
return;
}
}
llerrs << "More than " << MAX_ITERS << " iterating over a map simultaneously!" << llendl;
LL_ERRS() << "More than " << MAX_ITERS << " iterating over a map simultaneously!" << LL_ENDL;
}

View File

@@ -70,8 +70,8 @@ void LLLogImpl::log(const std::string &message, LLSD& info)
}
}
}
llinfos << "LLLOGMESSAGE (" << (sequence++) << ") " << message
<< " " << LLSDNotationStreamer(info) << llendl;
LL_INFOS() << "LLLOGMESSAGE (" << (sequence++) << ") " << message
<< " " << LLSDNotationStreamer(info) << LL_ENDL;
}
//@brief Function to check if specified legacy log message should be sent.

View File

@@ -108,7 +108,7 @@ void LLMemory::updateMemoryInfo()
if (!GetProcessMemoryInfo(self, &counters, sizeof(counters)))
{
llwarns << "GetProcessMemoryInfo failed" << llendl;
LL_WARNS() << "GetProcessMemoryInfo failed" << LL_ENDL;
return ;
}
@@ -150,7 +150,7 @@ void* LLMemory::tryToAlloc(void* address, U32 size)
{
if(!VirtualFree(address, 0, MEM_RELEASE))
{
llerrs << "error happens when free some memory reservation." << llendl ;
LL_ERRS() << "error happens when free some memory reservation." << LL_ENDL ;
}
}
return address ;
@@ -168,14 +168,14 @@ void LLMemory::logMemoryInfo(BOOL update)
LLPrivateMemoryPoolManager::getInstance()->updateStatistics() ;
}
llinfos << "Current allocated physical memory(KB): " << sAllocatedMemInKB << llendl ;
llinfos << "Current allocated page size (KB): " << sAllocatedPageSizeInKB << llendl ;
llinfos << "Current available physical memory(KB): " << sAvailPhysicalMemInKB << llendl ;
llinfos << "Current max usable memory(KB): " << sMaxPhysicalMemInKB << llendl ;
LL_INFOS() << "Current allocated physical memory(KB): " << sAllocatedMemInKB << LL_ENDL ;
LL_INFOS() << "Current allocated page size (KB): " << sAllocatedPageSizeInKB << LL_ENDL ;
LL_INFOS() << "Current available physical memory(KB): " << sAvailPhysicalMemInKB << LL_ENDL ;
LL_INFOS() << "Current max usable memory(KB): " << sMaxPhysicalMemInKB << LL_ENDL ;
llinfos << "--- private pool information -- " << llendl ;
llinfos << "Total reserved (KB): " << LLPrivateMemoryPoolManager::getInstance()->mTotalReservedSize / 1024 << llendl ;
llinfos << "Total allocated (KB): " << LLPrivateMemoryPoolManager::getInstance()->mTotalAllocatedSize / 1024 << llendl ;
LL_INFOS() << "--- private pool information -- " << LL_ENDL ;
LL_INFOS() << "Total reserved (KB): " << LLPrivateMemoryPoolManager::getInstance()->mTotalReservedSize / 1024 << LL_ENDL ;
LL_INFOS() << "Total allocated (KB): " << LLPrivateMemoryPoolManager::getInstance()->mTotalAllocatedSize / 1024 << LL_ENDL ;
}
//return 0: everything is normal;
@@ -257,7 +257,7 @@ U64 LLMemory::getCurrentRSS()
if (!GetProcessMemoryInfo(self, &counters, sizeof(counters)))
{
llwarns << "GetProcessMemoryInfo failed" << llendl;
LL_WARNS() << "GetProcessMemoryInfo failed" << LL_ENDL;
return 0;
}
@@ -295,7 +295,7 @@ U32 LLMemory::getWorkingSetSize()
// if (sysctl(ctl, 2, &page_size, &size, NULL, 0) == -1)
// {
// llwarns << "Couldn't get page size" << llendl;
// LL_WARNS() << "Couldn't get page size" << LL_ENDL;
// return 0;
// } else {
// return page_size;
@@ -314,11 +314,11 @@ U64 LLMemory::getCurrentRSS()
// If we ever wanted it, the process virtual size is also available as:
// virtualSize = basicInfo.virtual_size;
// llinfos << "resident size is " << residentSize << llendl;
// LL_INFOS() << "resident size is " << residentSize << LL_ENDL;
}
else
{
llwarns << "task_info failed" << llendl;
LL_WARNS() << "task_info failed" << LL_ENDL;
}
return residentSize;
@@ -339,7 +339,7 @@ U64 LLMemory::getCurrentRSS()
if (fp == NULL)
{
llwarns << "couldn't open " << statPath << llendl;
LL_WARNS() << "couldn't open " << statPath << LL_ENDL;
goto bail;
}
@@ -352,7 +352,7 @@ U64 LLMemory::getCurrentRSS()
&rss);
if (ret != 1)
{
llwarns << "couldn't parse contents of " << statPath << llendl;
LL_WARNS() << "couldn't parse contents of " << statPath << LL_ENDL;
rss = 0;
}
}
@@ -382,12 +382,12 @@ U64 LLMemory::getCurrentRSS()
sprintf(path, "/proc/%d/psinfo", (int)getpid());
int proc_fd = -1;
if((proc_fd = open(path, O_RDONLY)) == -1){
llwarns << "LLmemory::getCurrentRSS() unable to open " << path << ". Returning 0 RSS!" << llendl;
LL_WARNS() << "LLmemory::getCurrentRSS() unable to open " << path << ". Returning 0 RSS!" << LL_ENDL;
return 0;
}
psinfo_t proc_psinfo;
if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){
llwarns << "LLmemory::getCurrentRSS() Unable to read from " << path << ". Returning 0 RSS!" << llendl;
LL_WARNS() << "LLmemory::getCurrentRSS() Unable to read from " << path << ". Returning 0 RSS!" << LL_ENDL;
close(proc_fd);
return 0;
}
@@ -955,7 +955,7 @@ void LLPrivateMemoryPool::LLMemoryChunk::dump()
total_size += blk_list[i]->getBufferSize() ;
if((U32)blk_list[i]->getBuffer() < (U32)blk_list[i-1]->getBuffer() + blk_list[i-1]->getBufferSize())
{
llerrs << "buffer corrupted." << llendl ;
LL_ERRS() << "buffer corrupted." << LL_ENDL ;
}
}
@@ -976,32 +976,32 @@ void LLPrivateMemoryPool::LLMemoryChunk::dump()
}
else
{
llerrs << "gap happens" << llendl ;
LL_ERRS() << "gap happens" << LL_ENDL ;
}
}
#endif
#if 0
llinfos << "---------------------------" << llendl ;
llinfos << "Chunk buffer: " << (U32)getBuffer() << " size: " << getBufferSize() << llendl ;
LL_INFOS() << "---------------------------" << LL_ENDL ;
LL_INFOS() << "Chunk buffer: " << (U32)getBuffer() << " size: " << getBufferSize() << LL_ENDL ;
llinfos << "available blocks ... " << llendl ;
LL_INFOS() << "available blocks ... " << LL_ENDL ;
for(S32 i = 0 ; i < mBlockLevels ; i++)
{
LLMemoryBlock* blk = mAvailBlockList[i] ;
while(blk)
{
llinfos << "blk buffer " << (U32)blk->getBuffer() << " size: " << blk->getBufferSize() << llendl ;
LL_INFOS() << "blk buffer " << (U32)blk->getBuffer() << " size: " << blk->getBufferSize() << LL_ENDL ;
blk = blk->mNext ;
}
}
llinfos << "free blocks ... " << llendl ;
LL_INFOS() << "free blocks ... " << LL_ENDL ;
for(S32 i = 0 ; i < mPartitionLevels ; i++)
{
LLMemoryBlock* blk = mFreeSpaceList[i] ;
while(blk)
{
llinfos << "blk buffer " << (U32)blk->getBuffer() << " size: " << blk->getBufferSize() << llendl ;
LL_INFOS() << "blk buffer " << (U32)blk->getBuffer() << " size: " << blk->getBufferSize() << LL_ENDL ;
blk = blk->mNext ;
}
}
@@ -1397,7 +1397,7 @@ char* LLPrivateMemoryPool::allocate(U32 size)
if(to_log)
{
llwarns << "The memory pool overflows, now using heap directly!" << llendl ;
LL_WARNS() << "The memory pool overflows, now using heap directly!" << LL_ENDL ;
to_log = false ;
}
@@ -1490,7 +1490,7 @@ void LLPrivateMemoryPool::destroyPool()
if(mNumOfChunks > 0)
{
llwarns << "There is some memory not freed when destroy the memory pool!" << llendl ;
LL_WARNS() << "There is some memory not freed when destroy the memory pool!" << LL_ENDL ;
}
mNumOfChunks = 0 ;
@@ -1508,11 +1508,11 @@ bool LLPrivateMemoryPool::checkSize(U32 asked_size)
{
if(mReservedPoolSize + asked_size > mMaxPoolSize)
{
llinfos << "Max pool size: " << mMaxPoolSize << llendl ;
llinfos << "Total reserved size: " << mReservedPoolSize + asked_size << llendl ;
llinfos << "Total_allocated Size: " << getTotalAllocatedSize() << llendl ;
LL_INFOS() << "Max pool size: " << mMaxPoolSize << LL_ENDL ;
LL_INFOS() << "Total reserved size: " << mReservedPoolSize + asked_size << LL_ENDL ;
LL_INFOS() << "Total_allocated Size: " << getTotalAllocatedSize() << LL_ENDL ;
//llerrs << "The pool is overflowing..." << llendl ;
//LL_ERRS() << "The pool is overflowing..." << LL_ENDL ;
return false ;
}
@@ -1725,7 +1725,7 @@ void LLPrivateMemoryPool::removeFromHashTable(LLMemoryChunk* chunk)
void LLPrivateMemoryPool::rehash()
{
llinfos << "new hash factor: " << mHashFactor << llendl ;
LL_INFOS() << "new hash factor: " << mHashFactor << LL_ENDL ;
mChunkHashList.clear() ;
mChunkHashList.resize(mHashFactor) ;
@@ -1805,7 +1805,7 @@ void LLPrivateMemoryPool::LLChunkHashElement::remove(LLPrivateMemoryPool::LLMemo
}
else
{
llerrs << "This slot does not contain this chunk!" << llendl ;
LL_ERRS() << "This slot does not contain this chunk!" << LL_ENDL ;
}
}
@@ -1837,12 +1837,12 @@ LLPrivateMemoryPoolManager::~LLPrivateMemoryPoolManager()
#if __DEBUG_PRIVATE_MEM__
if(!sMemAllocationTracker.empty())
{
llwarns << "there is potential memory leaking here. The list of not freed memory blocks are from: " <<llendl ;
LL_WARNS() << "there is potential memory leaking here. The list of not freed memory blocks are from: " <<LL_ENDL ;
S32 k = 0 ;
for(mem_allocation_info_t::iterator iter = sMemAllocationTracker.begin() ; iter != sMemAllocationTracker.end() ; ++iter)
{
llinfos << k++ << ", " << (U32)iter->first << " : " << iter->second << llendl ;
LL_INFOS() << k++ << ", " << (U32)iter->first << " : " << iter->second << LL_ENDL ;
}
sMemAllocationTracker.clear() ;
}
@@ -2038,7 +2038,7 @@ void LLPrivateMemoryPoolManager::freeMem(LLPrivateMemoryPool* poolp, void* addr
}
else
{
llerrs << "private pool is used before initialized.!" << llendl ;
LL_ERRS() << "private pool is used before initialized.!" << LL_ENDL ;
}
}
}
@@ -2112,7 +2112,7 @@ void LLPrivateMemoryPoolTester::test(U32 min_size, U32 max_size, U32 stride, U32
//allocate space for p ;
if(!(p = ::new char**[times]) || !(*p = ::new char*[times * levels]))
{
llerrs << "memory initialization for p failed" << llendl ;
LL_ERRS() << "memory initialization for p failed" << LL_ENDL ;
}
//init
@@ -2184,8 +2184,8 @@ void LLPrivateMemoryPoolTester::testAndTime(U32 size, U32 times)
{
LLTimer timer ;
llinfos << " -**********************- " << llendl ;
llinfos << "test size: " << size << " test times: " << times << llendl ;
LL_INFOS() << " -**********************- " << LL_ENDL ;
LL_INFOS() << "test size: " << size << " test times: " << times << LL_ENDL ;
timer.reset() ;
char** p = new char*[times] ;
@@ -2197,7 +2197,7 @@ void LLPrivateMemoryPoolTester::testAndTime(U32 size, U32 times)
p[i] = ALLOCATE_MEM(sPool, size) ;
if(!p[i])
{
llerrs << "allocation failed" << llendl ;
LL_ERRS() << "allocation failed" << LL_ENDL ;
}
}
//de-allocation
@@ -2206,7 +2206,7 @@ void LLPrivateMemoryPoolTester::testAndTime(U32 size, U32 times)
FREE_MEM(sPool, p[i]) ;
p[i] = NULL ;
}
llinfos << "time spent using customized memory pool: " << timer.getElapsedTimeF32() << llendl ;
LL_INFOS() << "time spent using customized memory pool: " << timer.getElapsedTimeF32() << LL_ENDL ;
timer.reset() ;
@@ -2217,7 +2217,7 @@ void LLPrivateMemoryPoolTester::testAndTime(U32 size, U32 times)
p[i] = ::new char[size] ;
if(!p[i])
{
llerrs << "allocation failed" << llendl ;
LL_ERRS() << "allocation failed" << LL_ENDL ;
}
}
//de-allocation
@@ -2226,7 +2226,7 @@ void LLPrivateMemoryPoolTester::testAndTime(U32 size, U32 times)
::delete[] p[i] ;
p[i] = NULL ;
}
llinfos << "time spent using standard allocator/de-allocator: " << timer.getElapsedTimeF32() << llendl ;
LL_INFOS() << "time spent using standard allocator/de-allocator: " << timer.getElapsedTimeF32() << LL_ENDL ;
delete[] p;
}

View File

@@ -51,7 +51,7 @@ void LLMemoryStreamBuf::reset(const U8* start, S32 length)
int LLMemoryStreamBuf::underflow()
{
//lldebugs << "LLMemoryStreamBuf::underflow()" << llendl;
//LL_DEBUGS() << "LLMemoryStreamBuf::underflow()" << LL_ENDL;
if(gptr() < egptr())
{
return *gptr();

View File

@@ -71,7 +71,7 @@ void LLMetricsImpl::recordEventDetails(const std::string& location,
metrics["location"] = location;
metrics["stats"] = stats;
llinfos << "LLMETRICS: " << (LLSDNotationStreamer(metrics)) << llendl;
LL_INFOS() << "LLMETRICS: " << (LLSDNotationStreamer(metrics)) << LL_ENDL;
}
// Store this:
@@ -134,7 +134,7 @@ void LLMetricsImpl::printTotals(LLSD metadata)
out_sd["stats"] = stats;
llinfos << "LLMETRICS: AGGREGATE: " << LLSDOStreamer<LLSDNotationFormatter>(out_sd) << llendl;
LL_INFOS() << "LLMETRICS: AGGREGATE: " << LLSDOStreamer<LLSDNotationFormatter>(out_sd) << LL_ENDL;
}
LLMetrics::LLMetrics()

View File

@@ -35,7 +35,7 @@
#include <map>
#include "string_table.h"
#include "llstringtable.h"
template <class DATA>
class LLNameTable

View File

@@ -157,7 +157,7 @@ protected:
tempp->unref();
if (mPointer != NULL)
{
llwarns << "Unreference did assignment to non-NULL because of destructor" << llendl;
LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL;
unref();
}
}

View File

@@ -90,7 +90,7 @@ public:
pqm_iter iter = mMap.find(LLPQMKey<DATA_TYPE>(priority, data));
if (iter != mMap.end())
{
llerrs << "Pushing already existing data onto queue!" << llendl;
LL_ERRS() << "Pushing already existing data onto queue!" << LL_ENDL;
}
#endif
mMap.insert(pqm_pair(LLPQMKey<DATA_TYPE>(priority, data), data));
@@ -118,14 +118,14 @@ public:
iter = mMap.find(cur_key);
if (iter == mMap.end())
{
llwarns << "Data not on priority queue!" << llendl;
LL_WARNS() << "Data not on priority queue!" << LL_ENDL;
// OK, try iterating through all of the data and seeing if we just screwed up the priority
// somehow.
for (iter = mMap.begin(); iter != mMap.end(); iter++)
{
if ((*(iter)).second == data)
{
llerrs << "Data on priority queue but priority not matched!" << llendl;
LL_ERRS() << "Data on priority queue but priority not matched!" << LL_ENDL;
}
}
return;

View File

@@ -135,7 +135,7 @@ int LLProcessLauncher::launch(void)
char message[256];
wcstombs(message, error_str, 256);
message[255] = 0;
llwarns << "CreateProcessA failed: " << message << llendl;
LL_WARNS() << "CreateProcessA failed: " << message << LL_ENDL;
LocalFree(error_str);
}
@@ -285,7 +285,7 @@ static std::string read_pipe(apr_file_t* in, bool timeout_ok = false)
{
return "TIMEOUT";
}
llwarns << "apr_file_read_full: " << apr_strerror(status, buf, sizeof(buf)) << llendl;
LL_WARNS() << "apr_file_read_full: " << apr_strerror(status, buf, sizeof(buf)) << LL_ENDL;
assert(APR_STATUS_IS_EOF(status));
return "END OF FILE";
}
@@ -293,13 +293,13 @@ static std::string read_pipe(apr_file_t* in, bool timeout_ok = false)
status = apr_file_read_full(in, buf, bytes_to_read, &bytes_read);
if (status != APR_SUCCESS)
{
llwarns << "apr_file_read_full: " << apr_strerror(status, buf, sizeof(buf)) << llendl;
LL_WARNS() << "apr_file_read_full: " << apr_strerror(status, buf, sizeof(buf)) << LL_ENDL;
assert(status == APR_SUCCESS); // Fail
}
assert(bytes_read == bytes_to_read);
std::string received(buf, bytes_read);
llinfos << "Received: \"" << received << "\" (bytes read: " << bytes_read << ")" << llendl;
LL_INFOS() << "Received: \"" << received << "\" (bytes read: " << bytes_read << ")" << LL_ENDL;
return received;
}
@@ -423,7 +423,7 @@ int LLProcessLauncher::launch(void)
if (message != "TIMEOUT" && message != "END OF FILE")
{
// Most likely execv failed.
llwarns << message << llendl;
LL_WARNS() << message << LL_ENDL;
assert(false); // Fail in debug mode.
}
}

View File

@@ -706,7 +706,7 @@ private:
__cpuid(0x1, eax, ebx, ecx, edx);
if(feature_infos[0] != (S32)edx)
{
llerrs << "machdep.cpu.feature_bits doesn't match expected cpuid result!" << llendl;
LL_ERRS() << "machdep.cpu.feature_bits doesn't match expected cpuid result!" << LL_ENDL;
}
#endif // LL_RELEASE_FOR_DOWNLOAD

View File

@@ -1,730 +0,0 @@
/**
* @file llptrskiplist.h
* @brief Skip list implementation.
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#ifndef LL_LLPTRSKIPLIST_H
#define LL_LLPTRSKIPLIST_H
#include "llerror.h"
#include "llrand.h"
//#include "vmath.h"
#include "llrand.h"
/////////////////////////////////////////////
//
// LLPtrSkipList implementation - skip list for pointers to objects
//
template <class DATA_TYPE, S32 BINARY_DEPTH = 8>
class LLPtrSkipList
{
public:
friend class LLPtrSkipNode;
// basic constructor
LLPtrSkipList();
// basic constructor including sorter
LLPtrSkipList(BOOL (*insert_first)(DATA_TYPE *first, DATA_TYPE *second),
BOOL (*equals)(DATA_TYPE *first, DATA_TYPE *second));
~LLPtrSkipList();
inline void setInsertFirst(BOOL (*insert_first)(const DATA_TYPE *first, const DATA_TYPE *second));
inline void setEquals(BOOL (*equals)(const DATA_TYPE *first, const DATA_TYPE *second));
inline BOOL addData(DATA_TYPE *data);
inline BOOL checkData(const DATA_TYPE *data);
inline S32 getLength(); // returns number of items in the list - NOT constant time!
inline BOOL removeData(const DATA_TYPE *data);
// note that b_sort is ignored
inline BOOL moveData(const DATA_TYPE *data, LLPtrSkipList *newlist, BOOL b_sort);
inline BOOL moveCurrentData(LLPtrSkipList *newlist, BOOL b_sort);
// resort -- use when the value we're sorting by changes
/* IW 12/6/02 - This doesn't work!
Instead, remove the data BEFORE you change it
Then re-insert it after you change it
BOOL resortData(DATA_TYPE *data)
*/
// remove all nodes from the list but do not delete data
inline void removeAllNodes();
inline BOOL deleteData(const DATA_TYPE *data);
// remove all nodes from the list and delete data
inline void deleteAllData();
// place mCurrentp on first node
inline void resetList();
// return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
inline DATA_TYPE *getCurrentData();
// same as getCurrentData() but a more intuitive name for the operation
inline DATA_TYPE *getNextData();
// remove the Node at mCurentOperatingp
// leave mCurrentp and mCurentOperatingp on the next entry
inline void removeCurrentData();
// delete the Node at mCurentOperatingp
// leave mCurrentp and mCurentOperatingp on the next entry
inline void deleteCurrentData();
// reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
inline DATA_TYPE *getFirstData();
// TRUE if nodes are not in sorted order
inline BOOL corrupt();
protected:
class LLPtrSkipNode
{
public:
LLPtrSkipNode()
: mData(NULL)
{
S32 i;
for (i = 0; i < BINARY_DEPTH; i++)
{
mForward[i] = NULL;
}
}
LLPtrSkipNode(DATA_TYPE *data)
: mData(data)
{
S32 i;
for (i = 0; i < BINARY_DEPTH; i++)
{
mForward[i] = NULL;
}
}
~LLPtrSkipNode()
{
if (mData)
{
llerror("Attempting to call LLPtrSkipNode destructor with a non-null mDatap!", 1);
}
}
// delete associated data and NULLs out pointer
void deleteData()
{
delete mData;
mData = NULL;
}
// NULLs out pointer
void removeData()
{
mData = NULL;
}
DATA_TYPE *mData;
LLPtrSkipNode *mForward[BINARY_DEPTH];
};
static BOOL defaultEquals(const DATA_TYPE *first, const DATA_TYPE *second)
{
return first == second;
}
LLPtrSkipNode mHead;
LLPtrSkipNode *mUpdate[BINARY_DEPTH];
LLPtrSkipNode *mCurrentp;
LLPtrSkipNode *mCurrentOperatingp;
S32 mLevel;
BOOL (*mInsertFirst)(const DATA_TYPE *first, const DATA_TYPE *second);
BOOL (*mEquals)(const DATA_TYPE *first, const DATA_TYPE *second);
};
// basic constructor
template <class DATA_TYPE, S32 BINARY_DEPTH>
LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::LLPtrSkipList()
: mInsertFirst(NULL), mEquals(defaultEquals)
{
if (BINARY_DEPTH < 2)
{
llerrs << "Trying to create skip list with too little depth, "
"must be 2 or greater" << llendl;
}
S32 i;
for (i = 0; i < BINARY_DEPTH; i++)
{
mUpdate[i] = NULL;
}
mLevel = 1;
mCurrentp = *(mHead.mForward);
mCurrentOperatingp = *(mHead.mForward);
}
// basic constructor including sorter
template <class DATA_TYPE, S32 BINARY_DEPTH>
LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::LLPtrSkipList(BOOL (*insert_first)(DATA_TYPE *first, DATA_TYPE *second),
BOOL (*equals)(DATA_TYPE *first, DATA_TYPE *second))
:mInsertFirst(insert_first), mEquals(equals)
{
if (BINARY_DEPTH < 2)
{
llerrs << "Trying to create skip list with too little depth, "
"must be 2 or greater" << llendl;
}
mLevel = 1;
S32 i;
for (i = 0; i < BINARY_DEPTH; i++)
{
mHead.mForward[i] = NULL;
mUpdate[i] = NULL;
}
mCurrentp = *(mHead.mForward);
mCurrentOperatingp = *(mHead.mForward);
}
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::~LLPtrSkipList()
{
removeAllNodes();
}
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline void LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::setInsertFirst(BOOL (*insert_first)(const DATA_TYPE *first, const DATA_TYPE *second))
{
mInsertFirst = insert_first;
}
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline void LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::setEquals(BOOL (*equals)(const DATA_TYPE *first, const DATA_TYPE *second))
{
mEquals = equals;
}
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline BOOL LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::addData(DATA_TYPE *data)
{
S32 level;
LLPtrSkipNode *current = &mHead;
LLPtrSkipNode *temp;
// find the pointer one in front of the one we want
if (mInsertFirst)
{
for (level = mLevel - 1; level >= 0; level--)
{
temp = *(current->mForward + level);
while ( (temp)
&&(mInsertFirst(temp->mData, data)))
{
current = temp;
temp = *(current->mForward + level);
}
*(mUpdate + level) = current;
}
}
else
{
for (level = mLevel - 1; level >= 0; level--)
{
temp = *(current->mForward + level);
while ( (temp)
&&(temp->mData < data))
{
current = temp;
temp = *(current->mForward + level);
}
*(mUpdate + level) = current;
}
}
// we're now just in front of where we want to be . . . take one step forward
current = *current->mForward;
// now add the new node
S32 newlevel;
for (newlevel = 1; newlevel <= mLevel && newlevel < BINARY_DEPTH; newlevel++)
{
if (ll_frand() < 0.5f)
break;
}
LLPtrSkipNode *snode = new LLPtrSkipNode(data);
if (newlevel > mLevel)
{
mHead.mForward[mLevel] = NULL;
mUpdate[mLevel] = &mHead;
mLevel = newlevel;
}
for (level = 0; level < newlevel; level++)
{
snode->mForward[level] = mUpdate[level]->mForward[level];
mUpdate[level]->mForward[level] = snode;
}
return TRUE;
}
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline BOOL LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::checkData(const DATA_TYPE *data)
{
S32 level;
LLPtrSkipNode *current = &mHead;
LLPtrSkipNode *temp;
// find the pointer one in front of the one we want
if (mInsertFirst)
{
for (level = mLevel - 1; level >= 0; level--)
{
temp = *(current->mForward + level);
while ( (temp)
&&(mInsertFirst(temp->mData, data)))
{
current = temp;
temp = *(current->mForward + level);
}
*(mUpdate + level) = current;
}
}
else
{
for (level = mLevel - 1; level >= 0; level--)
{
temp = *(current->mForward + level);
while ( (temp)
&&(temp->mData < data))
{
current = temp;
temp = *(current->mForward + level);
}
*(mUpdate + level) = current;
}
}
// we're now just in front of where we want to be . . . take one step forward
current = *current->mForward;
if (current)
{
return mEquals(current->mData, data);
}
else
{
return FALSE;
}
}
// returns number of items in the list
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline S32 LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::getLength()
{
U32 length = 0;
for (LLPtrSkipNode* temp = *(mHead.mForward); temp != NULL; temp = temp->mForward[0])
{
length++;
}
return length;
}
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline BOOL LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::removeData(const DATA_TYPE *data)
{
S32 level;
LLPtrSkipNode *current = &mHead;
LLPtrSkipNode *temp;
// find the pointer one in front of the one we want
if (mInsertFirst)
{
for (level = mLevel - 1; level >= 0; level--)
{
temp = *(current->mForward + level);
while ( (temp)
&&(mInsertFirst(temp->mData, data)))
{
current = temp;
temp = *(current->mForward + level);
}
*(mUpdate + level) = current;
}
}
else
{
for (level = mLevel - 1; level >= 0; level--)
{
temp = *(current->mForward + level);
while ( (temp)
&&(temp->mData < data))
{
current = temp;
temp = *(current->mForward + level);
}
*(mUpdate + level) = current;
}
}
// we're now just in front of where we want to be . . . take one step forward
current = *current->mForward;
if (!current)
{
// empty list or beyond the end!
return FALSE;
}
// is this the one we want?
if (!mEquals(current->mData, data))
{
// nope!
return FALSE;
}
else
{
// yes it is! change pointers as required
for (level = 0; level < mLevel; level++)
{
if (mUpdate[level]->mForward[level] != current)
{
// cool, we've fixed all the pointers!
break;
}
mUpdate[level]->mForward[level] = current->mForward[level];
}
// clean up cuurent
current->removeData();
delete current;
// clean up mHead
while ( (mLevel > 1)
&&(!mHead.mForward[mLevel - 1]))
{
mLevel--;
}
}
return TRUE;
}
// note that b_sort is ignored
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline BOOL LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::moveData(const DATA_TYPE *data, LLPtrSkipList *newlist, BOOL b_sort)
{
BOOL removed = removeData(data);
BOOL added = newlist->addData(data);
return removed && added;
}
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline BOOL LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::moveCurrentData(LLPtrSkipList *newlist, BOOL b_sort)
{
if (mCurrentOperatingp)
{
mCurrentp = mCurrentOperatingp->mForward[0];
BOOL removed = removeData(mCurrentOperatingp);
BOOL added = newlist->addData(mCurrentOperatingp);
mCurrentOperatingp = mCurrentp;
return removed && added;
}
return FALSE;
}
// resort -- use when the value we're sorting by changes
/* IW 12/6/02 - This doesn't work!
Instead, remove the data BEFORE you change it
Then re-insert it after you change it
BOOL resortData(DATA_TYPE *data)
{
removeData(data);
addData(data);
}
*/
// remove all nodes from the list but do not delete data
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline void LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::removeAllNodes()
{
LLPtrSkipNode *temp;
// reset mCurrentp
mCurrentp = *(mHead.mForward);
while (mCurrentp)
{
temp = mCurrentp->mForward[0];
mCurrentp->removeData();
delete mCurrentp;
mCurrentp = temp;
}
S32 i;
for (i = 0; i < BINARY_DEPTH; i++)
{
mHead.mForward[i] = NULL;
mUpdate[i] = NULL;
}
mCurrentp = *(mHead.mForward);
mCurrentOperatingp = *(mHead.mForward);
}
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline BOOL LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::deleteData(const DATA_TYPE *data)
{
S32 level;
LLPtrSkipNode *current = &mHead;
LLPtrSkipNode *temp;
// find the pointer one in front of the one we want
if (mInsertFirst)
{
for (level = mLevel - 1; level >= 0; level--)
{
temp = *(current->mForward + level);
while ( (temp)
&&(mInsertFirst(temp->mData, data)))
{
current = temp;
temp = *(current->mForward + level);
}
*(mUpdate + level) = current;
}
}
else
{
for (level = mLevel - 1; level >= 0; level--)
{
temp = *(current->mForward + level);
while ( (temp)
&&(temp->mData < data))
{
current = temp;
temp = *(current->mForward + level);
}
*(mUpdate + level) = current;
}
}
// we're now just in front of where we want to be . . . take one step forward
current = *current->mForward;
if (!current)
{
// empty list or beyond the end!
return FALSE;
}
// is this the one we want?
if (!mEquals(current->mData, data))
{
// nope!
return FALSE;
}
else
{
// do we need to fix current or currentop?
if (current == mCurrentp)
{
mCurrentp = current->mForward[0];
}
if (current == mCurrentOperatingp)
{
mCurrentOperatingp = current->mForward[0];
}
// yes it is! change pointers as required
for (level = 0; level < mLevel; level++)
{
if (mUpdate[level]->mForward[level] != current)
{
// cool, we've fixed all the pointers!
break;
}
mUpdate[level]->mForward[level] = current->mForward[level];
}
// clean up cuurent
current->deleteData();
delete current;
// clean up mHead
while ( (mLevel > 1)
&&(!mHead.mForward[mLevel - 1]))
{
mLevel--;
}
}
return TRUE;
}
// remove all nodes from the list and delete data
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline void LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::deleteAllData()
{
LLPtrSkipNode *temp;
// reset mCurrentp
mCurrentp = *(mHead.mForward);
while (mCurrentp)
{
temp = mCurrentp->mForward[0];
mCurrentp->deleteData();
delete mCurrentp;
mCurrentp = temp;
}
S32 i;
for (i = 0; i < BINARY_DEPTH; i++)
{
mHead.mForward[i] = NULL;
mUpdate[i] = NULL;
}
mCurrentp = *(mHead.mForward);
mCurrentOperatingp = *(mHead.mForward);
}
// place mCurrentp on first node
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline void LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::resetList()
{
mCurrentp = *(mHead.mForward);
mCurrentOperatingp = *(mHead.mForward);
}
// return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline DATA_TYPE *LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::getCurrentData()
{
if (mCurrentp)
{
mCurrentOperatingp = mCurrentp;
mCurrentp = *mCurrentp->mForward;
return mCurrentOperatingp->mData;
}
else
{
//return NULL; // causes compile warning
return 0; // equivalent, but no warning
}
}
// same as getCurrentData() but a more intuitive name for the operation
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline DATA_TYPE *LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::getNextData()
{
if (mCurrentp)
{
mCurrentOperatingp = mCurrentp;
mCurrentp = *mCurrentp->mForward;
return mCurrentOperatingp->mData;
}
else
{
//return NULL; // causes compile warning
return 0; // equivalent, but no warning
}
}
// remove the Node at mCurentOperatingp
// leave mCurrentp and mCurentOperatingp on the next entry
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline void LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::removeCurrentData()
{
if (mCurrentOperatingp)
{
removeData(mCurrentOperatingp->mData);
}
}
// delete the Node at mCurentOperatingp
// leave mCurrentp and mCurentOperatingp on the next entry
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline void LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::deleteCurrentData()
{
if (mCurrentOperatingp)
{
deleteData(mCurrentOperatingp->mData);
}
}
// reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline DATA_TYPE *LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::getFirstData()
{
mCurrentp = *(mHead.mForward);
mCurrentOperatingp = *(mHead.mForward);
if (mCurrentp)
{
mCurrentOperatingp = mCurrentp;
mCurrentp = mCurrentp->mForward[0];
return mCurrentOperatingp->mData;
}
else
{
//return NULL; // causes compile warning
return 0; // equivalent, but no warning
}
}
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline BOOL LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::corrupt()
{
LLPtrSkipNode *previous = mHead.mForward[0];
// Empty lists are not corrupt.
if (!previous) return FALSE;
LLPtrSkipNode *current = previous->mForward[0];
while(current)
{
if (!mInsertFirst(previous->mData, current->mData))
{
// prev shouldn't be in front of cur!
return TRUE;
}
current = current->mForward[0];
}
return FALSE;
}
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -80,7 +80,7 @@ void LLQueuedThread::shutdown()
}
if (timeout == 0)
{
llwarns << "~LLQueuedThread (" << mName << ") timed out!" << llendl;
LL_WARNS() << "~LLQueuedThread (" << mName << ") timed out!" << LL_ENDL;
}
}
else
@@ -101,7 +101,7 @@ void LLQueuedThread::shutdown()
}
if (active_count)
{
llwarns << "~LLQueuedThread() called with active requests: " << active_count << llendl;
LL_WARNS() << "~LLQueuedThread() called with active requests: " << active_count << LL_ENDL;
}
}
@@ -198,11 +198,11 @@ void LLQueuedThread::printQueueStats()
if (!mRequestQueue.empty())
{
QueuedRequest *req = *mRequestQueue.begin();
llinfos << llformat("Pending Requests:%d Current status:%d", mRequestQueue.size(), req->getStatus()) << llendl;
LL_INFOS() << llformat("Pending Requests:%d Current status:%d", mRequestQueue.size(), req->getStatus()) << LL_ENDL;
}
else
{
llinfos << "Queued Thread Idle" << llendl;
LL_INFOS() << "Queued Thread Idle" << LL_ENDL;
}
unlockData();
}
@@ -233,7 +233,7 @@ bool LLQueuedThread::addRequest(QueuedRequest* req)
mRequestQueue.insert(req);
mRequestHash.insert(req);
#if _DEBUG
// llinfos << llformat("LLQueuedThread::Added req [%08d]",handle) << llendl;
// LL_INFOS() << llformat("LLQueuedThread::Added req [%08d]",handle) << LL_ENDL;
#endif
unlockData();
@@ -364,7 +364,7 @@ bool LLQueuedThread::completeRequest(handle_t handle)
llassert_always(req->getStatus() != STATUS_QUEUED);
llassert_always(req->getStatus() != STATUS_INPROGRESS);
#if _DEBUG
// llinfos << llformat("LLQueuedThread::Completed req [%08d]",handle) << llendl;
// LL_INFOS() << llformat("LLQueuedThread::Completed req [%08d]",handle) << LL_ENDL;
#endif
if (!(req->getFlags() & FLAG_LOCKED))
{
@@ -393,7 +393,7 @@ bool LLQueuedThread::check()
{
if (entry->getHashKey() > mNextHandle)
{
llerrs << "Hash Error" << llendl;
LL_ERRS() << "Hash Error" << LL_ENDL;
return false;
}
entry = entry->getNextEntry();
@@ -564,7 +564,7 @@ void LLQueuedThread::run()
}
//LLThread::yield(); // thread should yield after each request
}
llinfos << "LLQueuedThread " << mName << " EXITING." << llendl;
LL_INFOS() << "LLQueuedThread " << mName << " EXITING." << LL_ENDL;
}
// virtual

View File

@@ -60,7 +60,7 @@ LLRefCount::~LLRefCount()
{
if (mRef != 0)
{
llerrs << "deleting non-zero reference" << llendl;
LL_ERRS() << "deleting non-zero reference" << LL_ENDL;
}
}
@@ -70,8 +70,8 @@ void LLRefCount::ref() const
if(mMutex.isLocked())
{
mCrashAtUnlock = TRUE ;
llerrs << "the mutex is locked by the thread: " << mLockedThreadID
<< " Current thread: " << AIThreadID() << llendl ;
LL_ERRS() << "the mutex is locked by the thread: " << mLockedThreadID
<< " Current thread: " << AIThreadID() << LL_ENDL ;
}
mMutex.lock() ;
@@ -91,8 +91,8 @@ S32 LLRefCount::unref() const
if(mMutex.isLocked())
{
mCrashAtUnlock = TRUE ;
llerrs << "the mutex is locked by the thread: " << mLockedThreadID
<< " Current thread: " << AIThreadID() << llendl ;
LL_ERRS() << "the mutex is locked by the thread: " << mLockedThreadID
<< " Current thread: " << AIThreadID() << LL_ENDL ;
}
mMutex.lock() ;

View File

@@ -64,7 +64,7 @@ public:
{
if (mMap.insert(std::make_pair(key, value)).second == false)
{
llwarns << "Tried to register " << key << " but it was already registered!" << llendl;
LL_WARNS() << "Tried to register " << key << " but it was already registered!" << LL_ENDL;
return false;
}
return true;
@@ -309,7 +309,7 @@ public:
{
if (singleton_t::instance().exists(key))
{
llerrs << "Duplicate registry entry under key \"" << key << "\"" << llendl;
LL_ERRS() << "Duplicate registry entry under key \"" << key << "\"" << LL_ENDL;
}
singleton_t::instance().mStaticScope->add(key, value);
}

View File

@@ -134,7 +134,7 @@ protected:
tempp->unref();
if (mPointer != NULL)
{
llwarns << "Unreference did assignment to non-NULL because of destructor" << llendl;
LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL;
unref();
}
}

Some files were not shown because too many files have changed in this diff Show More