forked from teamnwah/openmw-tes3coop
esmtool/labels: bodyPartLabel, meshPartLabel, meshTypeLabel
Signed chars, unsigned chars... Just use int for index everywhere.
This commit is contained in:
parent
df5919f2c5
commit
a3e421167b
2 changed files with 12 additions and 12 deletions
|
@ -16,7 +16,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <boost/format.hpp>
|
#include <boost/format.hpp>
|
||||||
|
|
||||||
std::string bodyPartLabel(signed char idx)
|
std::string bodyPartLabel(int idx)
|
||||||
{
|
{
|
||||||
const char *bodyPartLabels[] = {
|
const char *bodyPartLabels[] = {
|
||||||
"Head",
|
"Head",
|
||||||
|
@ -48,13 +48,13 @@ std::string bodyPartLabel(signed char idx)
|
||||||
"Tail"
|
"Tail"
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((int)idx >= 0 && (int)(idx) <= 26)
|
if (idx >= 0 && idx <= 26)
|
||||||
return bodyPartLabels[(int)(idx)];
|
return bodyPartLabels[idx];
|
||||||
else
|
else
|
||||||
return "Invalid";
|
return "Invalid";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string meshPartLabel(signed char idx)
|
std::string meshPartLabel(int idx)
|
||||||
{
|
{
|
||||||
const char *meshPartLabels[] = {
|
const char *meshPartLabels[] = {
|
||||||
"Head",
|
"Head",
|
||||||
|
@ -74,13 +74,13 @@ std::string meshPartLabel(signed char idx)
|
||||||
"Tail"
|
"Tail"
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((int)(idx) >= 0 && (int)(idx) <= ESM::BodyPart::MP_Tail)
|
if (idx >= 0 && idx <= ESM::BodyPart::MP_Tail)
|
||||||
return meshPartLabels[(int)(idx)];
|
return meshPartLabels[idx];
|
||||||
else
|
else
|
||||||
return "Invalid";
|
return "Invalid";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string meshTypeLabel(signed char idx)
|
std::string meshTypeLabel(int idx)
|
||||||
{
|
{
|
||||||
const char *meshTypeLabels[] = {
|
const char *meshTypeLabels[] = {
|
||||||
"Skin",
|
"Skin",
|
||||||
|
@ -88,8 +88,8 @@ std::string meshTypeLabel(signed char idx)
|
||||||
"Armor"
|
"Armor"
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((int)(idx) >= 0 && (int)(idx) <= ESM::BodyPart::MT_Armor)
|
if (idx >= 0 && idx <= ESM::BodyPart::MT_Armor)
|
||||||
return meshTypeLabels[(int)(idx)];
|
return meshTypeLabels[idx];
|
||||||
else
|
else
|
||||||
return "Invalid";
|
return "Invalid";
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
std::string bodyPartLabel(signed char idx);
|
std::string bodyPartLabel(int idx);
|
||||||
std::string meshPartLabel(signed char idx);
|
std::string meshPartLabel(int idx);
|
||||||
std::string meshTypeLabel(signed char idx);
|
std::string meshTypeLabel(int idx);
|
||||||
std::string clothingTypeLabel(int idx);
|
std::string clothingTypeLabel(int idx);
|
||||||
std::string armorTypeLabel(int idx);
|
std::string armorTypeLabel(int idx);
|
||||||
std::string dialogTypeLabel(int idx);
|
std::string dialogTypeLabel(int idx);
|
||||||
|
|
Loading…
Reference in a new issue