Skip to content

Commit bca9ba9

Browse files
authored
Merge pull request #4310 from Ansariel/gltf-import-revert-getjoint
Revert "Fix LLCharacter base class constness."
2 parents 06a9e45 + 75db5e8 commit bca9ba9

18 files changed

+66
-67
lines changed

indra/llappearance/llavatarappearance.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class LLAvatarAppearance : public LLCharacter
140140
LLVector3 mHeadOffset{}; // current head position
141141
LLAvatarJoint* mRoot{ nullptr };
142142

143-
typedef std::map<std::string, LLJoint*> joint_map_t;
143+
typedef std::map<std::string, LLJoint*, std::less<>> joint_map_t;
144144
joint_map_t mJointMap;
145145

146146
typedef std::map<std::string, LLVector3> joint_state_map_t;
@@ -153,7 +153,7 @@ class LLAvatarAppearance : public LLCharacter
153153
public:
154154
typedef std::vector<LLAvatarJoint*> avatar_joint_list_t;
155155
const avatar_joint_list_t& getSkeleton() { return mSkeleton; }
156-
typedef std::map<std::string, std::string> joint_alias_map_t;
156+
typedef std::map<std::string, std::string, std::less<>> joint_alias_map_t;
157157
const joint_alias_map_t& getJointAliases();
158158
typedef std::map<std::string, std::string> joint_parent_map_t; // matrix plus parent
159159
typedef std::map<std::string, glm::mat4> joint_rest_map_t;

indra/llcharacter/llbvhloader.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ LLQuaternion::Order bvhStringToOrder( char *str )
131131
// LLBVHLoader()
132132
//-----------------------------------------------------------------------------
133133

134-
LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map<std::string, std::string>& joint_alias_map )
134+
LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map<std::string, std::string, std::less<>>& joint_alias_map )
135135
{
136136
reset();
137137
errorLine = 0;
@@ -156,9 +156,9 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error
156156
}
157157

158158
// Recognize all names we've been told are legal.
159-
for (std::map<std::string, std::string>::value_type& alias_pair : joint_alias_map)
159+
for (const auto& [alias, joint] : joint_alias_map)
160160
{
161-
makeTranslation( alias_pair.first , alias_pair.second );
161+
makeTranslation(alias, joint);
162162
}
163163

164164
char error_text[128]; /* Flawfinder: ignore */

indra/llcharacter/llbvhloader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class LLBVHLoader
227227
friend class LLKeyframeMotion;
228228
public:
229229
// Constructor
230-
LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map<std::string, std::string>& joint_alias_map );
230+
LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map<std::string, std::string, std::less<>>& joint_alias_map );
231231
~LLBVHLoader();
232232

233233
/*

indra/llcharacter/llcharacter.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,11 @@ LLCharacter::~LLCharacter()
7777
//-----------------------------------------------------------------------------
7878
// getJoint()
7979
//-----------------------------------------------------------------------------
80-
LLJoint *LLCharacter::getJoint( const std::string &name )
80+
LLJoint* LLCharacter::getJoint(std::string_view name)
8181
{
82-
LLJoint* joint = NULL;
82+
LLJoint* joint = nullptr;
8383

84-
LLJoint *root = getRootJoint();
85-
if (root)
84+
if (LLJoint* root = getRootJoint())
8685
{
8786
joint = root->findJoint(name);
8887
}

indra/llcharacter/llcharacter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class LLCharacter
7676
// get the specified joint
7777
// default implementation does recursive search,
7878
// subclasses may optimize/cache results.
79-
virtual LLJoint *getJoint( const std::string &name );
79+
virtual LLJoint* getJoint(std::string_view name);
8080

8181
// get the position of the character
8282
virtual LLVector3 getCharacterPosition() = 0;

indra/llprimitive/lldaeloader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ LLDAELoader::LLDAELoader(
880880
void* opaque_userdata,
881881
JointTransformMap& jointTransformMap,
882882
JointNameSet& jointsFromNodes,
883-
std::map<std::string, std::string>& jointAliasMap,
883+
std::map<std::string, std::string, std::less<>>& jointAliasMap,
884884
U32 maxJointsPerMesh,
885885
U32 modelLimit,
886886
bool preprocess)

indra/llprimitive/lldaeloader.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,19 @@ class LLDAELoader : public LLModelLoader
4747
dae_model_map mModelsMap;
4848

4949
LLDAELoader(
50-
std::string filename,
51-
S32 lod,
52-
LLModelLoader::load_callback_t load_cb,
53-
LLModelLoader::joint_lookup_func_t joint_lookup_func,
54-
LLModelLoader::texture_load_func_t texture_load_func,
55-
LLModelLoader::state_callback_t state_cb,
56-
void* opaque_userdata,
57-
JointTransformMap& jointTransformMap,
58-
JointNameSet& jointsFromNodes,
59-
std::map<std::string, std::string>& jointAliasMap,
60-
U32 maxJointsPerMesh,
61-
U32 modelLimit,
62-
bool preprocess);
50+
std::string filename,
51+
S32 lod,
52+
LLModelLoader::load_callback_t load_cb,
53+
LLModelLoader::joint_lookup_func_t joint_lookup_func,
54+
LLModelLoader::texture_load_func_t texture_load_func,
55+
LLModelLoader::state_callback_t state_cb,
56+
void* opaque_userdata,
57+
JointTransformMap& jointTransformMap,
58+
JointNameSet& jointsFromNodes,
59+
std::map<std::string, std::string, std::less<>>& jointAliasMap,
60+
U32 maxJointsPerMesh,
61+
U32 modelLimit,
62+
bool preprocess);
6363
virtual ~LLDAELoader() ;
6464

6565
virtual bool OpenFile(const std::string& filename);

indra/llprimitive/llmodelloader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class LLJoint;
3636

3737
typedef std::map<std::string, LLMatrix4> JointTransformMap;
3838
typedef std::map<std::string, LLMatrix4>::iterator JointTransformMapIt;
39-
typedef std::map<std::string, std::string> JointMap;
39+
typedef std::map<std::string, std::string, std::less<>> JointMap;
4040
typedef std::deque<std::string> JointNameSet;
4141

4242
const S32 SLM_SUPPORTED_VERSION = 3;

indra/newview/gltf/llgltfloader.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,20 @@ static const glm::mat4 coord_system_rotationxy(
8686
0.f, 0.f, 0.f, 1.f
8787
);
8888

89-
LLGLTFLoader::LLGLTFLoader(std::string filename,
90-
S32 lod,
91-
LLModelLoader::load_callback_t load_cb,
92-
LLModelLoader::joint_lookup_func_t joint_lookup_func,
93-
LLModelLoader::texture_load_func_t texture_load_func,
94-
LLModelLoader::state_callback_t state_cb,
95-
void * opaque_userdata,
96-
JointTransformMap & jointTransformMap,
97-
JointNameSet & jointsFromNodes,
98-
std::map<std::string, std::string> &jointAliasMap,
99-
U32 maxJointsPerMesh,
100-
U32 modelLimit,
101-
std::vector<LLJointData> viewer_skeleton) //,
102-
//bool preprocess)
89+
LLGLTFLoader::LLGLTFLoader(std::string filename,
90+
S32 lod,
91+
LLModelLoader::load_callback_t load_cb,
92+
LLModelLoader::joint_lookup_func_t joint_lookup_func,
93+
LLModelLoader::texture_load_func_t texture_load_func,
94+
LLModelLoader::state_callback_t state_cb,
95+
void * opaque_userdata,
96+
JointTransformMap & jointTransformMap,
97+
JointNameSet & jointsFromNodes,
98+
std::map<std::string, std::string, std::less<>> & jointAliasMap,
99+
U32 maxJointsPerMesh,
100+
U32 modelLimit,
101+
std::vector<LLJointData> viewer_skeleton) //,
102+
//bool preprocess)
103103
: LLModelLoader( filename,
104104
lod,
105105
load_cb,

indra/newview/gltf/llgltfloader.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,19 @@ class LLGLTFLoader : public LLModelLoader
7272
typedef std::map <std::string, S32> joints_name_to_node_map_t;
7373

7474
LLGLTFLoader(std::string filename,
75-
S32 lod,
76-
LLModelLoader::load_callback_t load_cb,
77-
LLModelLoader::joint_lookup_func_t joint_lookup_func,
78-
LLModelLoader::texture_load_func_t texture_load_func,
79-
LLModelLoader::state_callback_t state_cb,
80-
void * opaque_userdata,
81-
JointTransformMap & jointTransformMap,
82-
JointNameSet & jointsFromNodes,
83-
std::map<std::string, std::string> &jointAliasMap,
84-
U32 maxJointsPerMesh,
85-
U32 modelLimit,
86-
std::vector<LLJointData> viewer_skeleton); //,
87-
//bool preprocess );
75+
S32 lod,
76+
LLModelLoader::load_callback_t load_cb,
77+
LLModelLoader::joint_lookup_func_t joint_lookup_func,
78+
LLModelLoader::texture_load_func_t texture_load_func,
79+
LLModelLoader::state_callback_t state_cb,
80+
void * opaque_userdata,
81+
JointTransformMap & jointTransformMap,
82+
JointNameSet & jointsFromNodes,
83+
std::map<std::string, std::string, std::less<>> & jointAliasMap,
84+
U32 maxJointsPerMesh,
85+
U32 modelLimit,
86+
std::vector<LLJointData> viewer_skeleton); //,
87+
//bool preprocess );
8888
virtual ~LLGLTFLoader();
8989

9090
virtual bool OpenFile(const std::string &filename);

0 commit comments

Comments
 (0)