mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
minorfixes
This commit is contained in:
@@ -72,9 +72,9 @@ inline constexpr KindMeta kKindMeta[] = {
|
||||
{NodeKind::Bool, "Bool", "bool", 1, 1, 1, KF_None},
|
||||
{NodeKind::Pointer32, "Pointer32", "ptr32", 4, 1, 4, KF_None},
|
||||
{NodeKind::Pointer64, "Pointer64", "ptr64", 8, 1, 8, KF_None},
|
||||
{NodeKind::Vec2, "Vec2", "Vec2", 8, 2, 4, KF_Vector},
|
||||
{NodeKind::Vec3, "Vec3", "Vec3", 12, 3, 4, KF_Vector},
|
||||
{NodeKind::Vec4, "Vec4", "Vec4", 16, 4, 4, KF_Vector},
|
||||
{NodeKind::Vec2, "Vec2", "Vec2", 8, 1, 4, KF_Vector},
|
||||
{NodeKind::Vec3, "Vec3", "Vec3", 12, 1, 4, KF_Vector},
|
||||
{NodeKind::Vec4, "Vec4", "Vec4", 16, 1, 4, KF_Vector},
|
||||
{NodeKind::Mat4x4, "Mat4x4", "Mat4x4", 64, 4, 4, KF_None},
|
||||
{NodeKind::UTF8, "UTF8", "char[]", 1, 1, 1, KF_String},
|
||||
{NodeKind::UTF16, "UTF16", "wchar_t[]", 2, 1, 2, KF_String},
|
||||
|
||||
@@ -245,12 +245,11 @@ static QString readValueImpl(const Node& node, const Provider& prov,
|
||||
case NodeKind::Vec2:
|
||||
case NodeKind::Vec3:
|
||||
case NodeKind::Vec4: {
|
||||
int maxSub = linesForKind(node.kind);
|
||||
if (subLine < 0 || subLine >= maxSub) return QStringLiteral("?");
|
||||
float component = prov.readF32(addr + subLine * 4);
|
||||
if (!display) return fmtFloat(component).trimmed();
|
||||
static const char* labels[] = {"x", "y", "z", "w"};
|
||||
return QString(labels[subLine]) + QStringLiteral(" = ") + fmtFloat(component);
|
||||
int count = sizeForKind(node.kind) / 4;
|
||||
QStringList parts;
|
||||
for (int i = 0; i < count; i++)
|
||||
parts << fmtFloat(prov.readF32(addr + i * 4)).trimmed();
|
||||
return parts.join(QStringLiteral(", "));
|
||||
}
|
||||
case NodeKind::Mat4x4: {
|
||||
if (!display) return {}; // not editable as single value
|
||||
@@ -314,14 +313,6 @@ QString fmtNodeLine(const Node& node, const Provider& prov,
|
||||
return ind + QString(prefixW, ' ') + val + cmtSuffix;
|
||||
}
|
||||
|
||||
// For vector types, subLine selects component
|
||||
if (subLine > 0 && (node.kind == NodeKind::Vec2 ||
|
||||
node.kind == NodeKind::Vec3 ||
|
||||
node.kind == NodeKind::Vec4)) {
|
||||
QString val = fit(readValue(node, prov, addr, subLine), COL_VALUE);
|
||||
return ind + QString(prefixW, ' ') + val + cmtSuffix;
|
||||
}
|
||||
|
||||
// Hex nodes and Padding: hex byte preview
|
||||
if (isHexPreview(node.kind)) {
|
||||
if (node.kind == NodeKind::Padding) {
|
||||
|
||||
Reference in New Issue
Block a user