Skip to content

Commit

Permalink
std::string in vertmodel tag
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Aug 1, 2024
1 parent 9a5985a commit c138323
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/engine/model/vertmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ int vertmodel::vertmeshgroup::findtag(std::string_view name)
{
for(int i = 0; i < numtags; ++i)
{
if(!std::strcmp(tags[i].name, name.data()))
if(tags[i].name == name.data())
{
return i;
}
Expand Down Expand Up @@ -246,7 +246,7 @@ bool vertmodel::vertmeshgroup::addtag(std::string_view name, const matrix4x3 &ma
{
std::swap(dst[j].name, src[j].name);
}
dst[numtags].name = newstring(name.data());
dst[numtags].name = name.data();
}
for(int j = 0; j < numtags; ++j)
{
Expand Down
6 changes: 1 addition & 5 deletions src/engine/model/vertmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,10 @@ class vertmodel : public animmodel

struct tag final
{
char *name;
std::string name;
matrix4x3 matrix;

tag() : name(nullptr) {}
~tag()
{
delete[] name;
}
};

struct vertmeshgroup : meshgroup
Expand Down

0 comments on commit c138323

Please sign in to comment.