Update fmtlib

This commit is contained in:
Jack Andersen 2020-04-11 12:51:39 -10:00
parent 7055b6983f
commit 5b4441ac36
156 changed files with 786 additions and 777 deletions

View File

@ -32,7 +32,7 @@ void LoadAssetMap(athena::io::MemoryReader& ar) {
ar.readBytesToBuf(&magic, 4);
if (magic != FOURCC('AIDM'))
Log.report(logvisor::Warning,
fmt(_SYS_STR("Unable to load asset map; Assets will not have proper filenames for most files.")));
FMT_STRING(_SYS_STR("Unable to load asset map; Assets will not have proper filenames for most files.")));
else {
uint32_t assetCount = ar.readUint32Big();
g_AssetNameMap.reserve(assetCount);
@ -50,7 +50,7 @@ void InitAssetNameMap() {
if (g_AssetNameMapInit)
return;
Log.report(logvisor::Info, fmt("Initializing asset name database..."));
Log.report(logvisor::Info, FMT_STRING("Initializing asset name database..."));
/* First load the 32bit map for MP1/2 */
{

View File

@ -99,7 +99,7 @@ bool ReadANCSToBlender(hecl::blender::Connection& conn, const ANCSDNA& ancs, con
{
hecl::blender::PyOutStream os = conn.beginPythonOut(true);
os.format(fmt(
os.format(FMT_STRING(
"import bpy\n"
"from mathutils import Vector\n"
"bpy.context.scene.name = '{}'\n"
@ -116,7 +116,7 @@ bool ReadANCSToBlender(hecl::blender::Connection& conn, const ANCSDNA& ancs, con
std::unordered_set<typename PAKRouter::IDType> cinfsDone;
for (const auto& info : chResInfo) {
/* Provide data to add-on */
os.format(fmt(
os.format(FMT_STRING(
"actor_subtype = actor_data.subtypes.add()\n"
"actor_subtype.name = '{}'\n\n"),
info.name);
@ -125,7 +125,7 @@ bool ReadANCSToBlender(hecl::blender::Connection& conn, const ANCSDNA& ancs, con
if (cinfsDone.find(info.cinf) == cinfsDone.end()) {
if (const typename PAKRouter::EntryType* cinfE = pakRouter.lookupEntry(info.cinf, nullptr, true, false)) {
hecl::ProjectPath cinfPath = pakRouter.getWorking(cinfE);
os.linkArmature(cinfPath.getAbsolutePathUTF8(), fmt::format(fmt("CINF_{}"), info.cinf));
os.linkArmature(cinfPath.getAbsolutePathUTF8(), fmt::format(FMT_STRING("CINF_{}"), info.cinf));
os << "if obj.name not in bpy.context.scene.objects:\n"
" bpy.context.scene.collection.objects.link(obj)\n";
}
@ -135,7 +135,7 @@ bool ReadANCSToBlender(hecl::blender::Connection& conn, const ANCSDNA& ancs, con
}
cinfsDone.insert(info.cinf);
}
os.format(fmt("arm_obj = bpy.data.objects['CINF_{}']\n"), info.cinf);
os.format(FMT_STRING("arm_obj = bpy.data.objects['CINF_{}']\n"), info.cinf);
os << "actor_subtype.linked_armature = arm_obj.name\n";
/* Link CMDL */
@ -154,7 +154,7 @@ bool ReadANCSToBlender(hecl::blender::Connection& conn, const ANCSDNA& ancs, con
/* Link overlays */
for (const auto& overlay : info.overlays) {
os << "overlay = actor_subtype.overlays.add()\n";
os.format(fmt("overlay.name = '{}'\n"), overlay.first);
os.format(FMT_STRING("overlay.name = '{}'\n"), overlay.first);
/* Link CMDL */
if (const typename PAKRouter::EntryType* cmdlE =
@ -175,7 +175,7 @@ bool ReadANCSToBlender(hecl::blender::Connection& conn, const ANCSDNA& ancs, con
/* Link attachments */
for (auto it = attRange.first; it != attRange.second; ++it) {
os << "attachment = actor_data.attachments.add()\n";
os.format(fmt("attachment.name = '{}'\n"), it->second.second);
os.format(FMT_STRING("attachment.name = '{}'\n"), it->second.second);
auto cinfid = it->second.first.cinf;
auto cmdlid = it->second.first.cmdl;
@ -185,7 +185,7 @@ bool ReadANCSToBlender(hecl::blender::Connection& conn, const ANCSDNA& ancs, con
if (cinfsDone.find(cinfid) == cinfsDone.end()) {
if (const typename PAKRouter::EntryType* cinfE = pakRouter.lookupEntry(cinfid, nullptr, true, false)) {
hecl::ProjectPath cinfPath = pakRouter.getWorking(cinfE);
os.linkArmature(cinfPath.getAbsolutePathUTF8(), fmt::format(fmt("CINF_{}"), cinfid));
os.linkArmature(cinfPath.getAbsolutePathUTF8(), fmt::format(FMT_STRING("CINF_{}"), cinfid));
os << "if obj.name not in bpy.context.scene.objects:\n"
" bpy.context.scene.collection.objects.link(obj)\n";
}
@ -195,7 +195,7 @@ bool ReadANCSToBlender(hecl::blender::Connection& conn, const ANCSDNA& ancs, con
}
cinfsDone.insert(cinfid);
}
os.format(fmt("arm_obj = bpy.data.objects['CINF_{}']\n"), cinfid);
os.format(FMT_STRING("arm_obj = bpy.data.objects['CINF_{}']\n"), cinfid);
os << "attachment.linked_armature = arm_obj.name\n";
}
@ -230,7 +230,7 @@ bool ReadANCSToBlender(hecl::blender::Connection& conn, const ANCSDNA& ancs, con
for (const auto& id : animResInfo) {
typename ANCSDNA::ANIMType anim;
if (pakRouter.lookupAndReadDNA(id.second.animId, anim, true)) {
os.format(fmt(
os.format(FMT_STRING(
"act = bpy.data.actions.new('{}')\n"
"act.use_fake_user = True\n"
"act.anim_id = '{}'\n"),
@ -238,7 +238,7 @@ bool ReadANCSToBlender(hecl::blender::Connection& conn, const ANCSDNA& ancs, con
anim.sendANIMToBlender(os, inverter, id.second.additive);
}
os.format(fmt(
os.format(FMT_STRING(
"actor_action = actor_data.actions.add()\n"
"actor_action.name = '{}'\n"),
id.second.name);

View File

@ -175,7 +175,7 @@ std::vector<std::vector<Value>> BitstreamReader::read(const atUint8* data, size_
for (size_t f = 0; f < keyFrameCount; ++f) {
#if DUMP_KEYS
fmt::print(stderr, fmt("\nFRAME {} {} {}\n"), f, (m_bitCur / 32) * 4, m_bitCur % 32);
fmt::print(stderr, FMT_STRING("\nFRAME {} {} {}\n"), f, (m_bitCur / 32) * 4, m_bitCur % 32);
int lastId = -1;
#endif
auto kit = chanKeys.begin();
@ -197,7 +197,7 @@ std::vector<std::vector<Value>> BitstreamReader::read(const atUint8* data, size_
QuantizedRot qr = {{p[0], p[1], p[2]}, wBit};
kit->emplace_back(DequantizeRotation(qr, rotDiv));
#if DUMP_KEYS
fmt::print(stderr, fmt("{} R: {} {} {} {}\t"), chan.id, wBit, p[0], p[1], p[2]);
fmt::print(stderr, FMT_STRING("{} R: {} {} {} {}\t"), chan.id, wBit, p[0], p[1], p[2]);
#endif
break;
}
@ -210,7 +210,7 @@ std::vector<std::vector<Value>> BitstreamReader::read(const atUint8* data, size_
p[2] += val3;
kit->push_back({p[0] * transMult, p[1] * transMult, p[2] * transMult});
#if DUMP_KEYS
fmt::print(stderr, fmt("{} T: {} {} {}\t"), chan.id, p[0], p[1], p[2]);
fmt::print(stderr, FMT_STRING("{} T: {} {} {}\t"), chan.id, p[0], p[1], p[2]);
#endif
break;
}
@ -220,7 +220,7 @@ std::vector<std::vector<Value>> BitstreamReader::read(const atUint8* data, size_
p[2] += dequantize(data, chan.q[2]);
kit->push_back({p[0] * scaleMult, p[1] * scaleMult, p[2] * scaleMult});
#if DUMP_KEYS
fmt::print(stderr, fmt("{} S: {} {} {}\t"), chan.id, p[0], p[1], p[2]);
fmt::print(stderr, FMT_STRING("{} S: {} {} {}\t"), chan.id, p[0], p[1], p[2]);
#endif
break;
}

View File

@ -140,7 +140,7 @@ void AROTBuilder::Node::nodeCount(size_t& sz, size_t& idxRefs, BitmapPool& bmpPo
sz += 1;
poolIdx = bmpPool.addIndices(childIndices);
if (poolIdx > 65535)
Log.report(logvisor::Fatal, fmt("AROT bitmap exceeds 16-bit node addressing; area too complex"));
Log.report(logvisor::Fatal, FMT_STRING("AROT bitmap exceeds 16-bit node addressing; area too complex"));
uint32_t childCount = AROTChildCounts[compSubdivs];
nodeOff = curOff;
@ -180,7 +180,7 @@ void AROTBuilder::Node::writeNodes(athena::io::MemoryWriter& w, int nodeIdx) {
if (childNodes.size()) {
int curIdx = nodeIdx + 1;
if (curIdx > 65535)
Log.report(logvisor::Fatal, fmt("AROT node exceeds 16-bit node addressing; area too complex"));
Log.report(logvisor::Fatal, FMT_STRING("AROT node exceeds 16-bit node addressing; area too complex"));
std::array<int, 8> childIndices;

View File

@ -24,7 +24,7 @@ bool ATBL::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) {
uint16_t idx = rs.readUint16Big();
if (idx == 0xffff)
continue;
w.writeUint16(fmt::format(fmt("0x{:04X}"), i), idx);
w.writeUint16(fmt::format(FMT_STRING("0x{:04X}"), i), idx);
}
athena::io::FileWriter fw(outPath.getAbsolutePath());

View File

@ -18,13 +18,13 @@ void ReadBabeDeadLightToBlender(hecl::blender::PyOutStream& os, const BabeDeadLi
switch (light.lightType) {
case BabeDeadLight::LightType::LocalAmbient:
case BabeDeadLight::LightType::LocalAmbient2:
os.format(fmt(
os.format(FMT_STRING(
"bg_node.inputs[0].default_value = ({},{},{},1.0)\n"
"bg_node.inputs[1].default_value = {}\n"),
light.color.simd[0], light.color.simd[1], light.color.simd[2], light.q / 8.f);
return;
case BabeDeadLight::LightType::Directional:
os.format(fmt(
os.format(FMT_STRING(
"lamp = bpy.data.lights.new('LAMP_{:01d}_{:03d}', 'SUN')\n"
"lamp.color = ({},{},{})\n"
"lamp_obj = bpy.data.objects.new(lamp.name, lamp)\n"
@ -36,7 +36,7 @@ void ReadBabeDeadLightToBlender(hecl::blender::PyOutStream& os, const BabeDeadLi
light.direction.simd[1], light.direction.simd[2], light.castShadows ? "True" : "False");
return;
case BabeDeadLight::LightType::Custom:
os.format(fmt(
os.format(FMT_STRING(
"lamp = bpy.data.lights.new('LAMP_{:01d}_{:03d}', 'POINT')\n"
"lamp.color = ({},{},{})\n"
"lamp_obj = bpy.data.objects.new(lamp.name, lamp)\n"
@ -48,7 +48,7 @@ void ReadBabeDeadLightToBlender(hecl::blender::PyOutStream& os, const BabeDeadLi
break;
case BabeDeadLight::LightType::Spot:
case BabeDeadLight::LightType::Spot2:
os.format(fmt(
os.format(FMT_STRING(
"lamp = bpy.data.lights.new('LAMP_{:01d}_{:03d}', 'SPOT')\n"
"lamp.color = ({},{},{})\n"
"lamp.spot_size = {:.6g}\n"
@ -66,7 +66,7 @@ void ReadBabeDeadLightToBlender(hecl::blender::PyOutStream& os, const BabeDeadLi
return;
}
os.format(fmt(
os.format(FMT_STRING(
"lamp.retro_layer = {}\n"
"lamp.retro_origtype = {}\n"
"lamp.falloff_type = 'INVERSE_COEFFICIENTS'\n"
@ -90,17 +90,17 @@ void ReadBabeDeadLightToBlender(hecl::blender::PyOutStream& os, const BabeDeadLi
os << "falloff_node.inputs[0].default_value *= 150.0\n"
"lamp.node_tree.links.new(falloff_node.outputs[2], lamp.node_tree.nodes['Emission'].inputs[1])\n";
if (light.q > FLT_EPSILON)
os.format(fmt("lamp.constant_coefficient = 2.0 / {}\n"), light.q);
os.format(FMT_STRING("lamp.constant_coefficient = 2.0 / {}\n"), light.q);
break;
case BabeDeadLight::Falloff::Linear:
os << "lamp.node_tree.links.new(falloff_node.outputs[1], lamp.node_tree.nodes['Emission'].inputs[1])\n";
if (light.q > FLT_EPSILON)
os.format(fmt("lamp.linear_coefficient = 250 / {}\n"), light.q);
os.format(FMT_STRING("lamp.linear_coefficient = 250 / {}\n"), light.q);
break;
case BabeDeadLight::Falloff::Quadratic:
os << "lamp.node_tree.links.new(falloff_node.outputs[0], lamp.node_tree.nodes['Emission'].inputs[1])\n";
if (light.q > FLT_EPSILON)
os.format(fmt("lamp.quadratic_coefficient = 25000 / {}\n"), light.q);
os.format(FMT_STRING("lamp.quadratic_coefficient = 25000 / {}\n"), light.q);
break;
default:
break;

View File

@ -84,7 +84,7 @@ void ReadMaterialSetToBlender_1_2(hecl::blender::PyOutStream& os, const Material
}
hecl::SystemString resPath = pakRouter.getResourceRelativePath(entry, tex);
hecl::SystemUTF8Conv resPathView(resPath);
os.format(fmt(
os.format(FMT_STRING(
"if '{}' in bpy.data.images:\n"
" image = bpy.data.images['{}']\n"
"else:\n"
@ -148,7 +148,7 @@ public:
for (const std::pair<atUint16, std::vector<std::pair<atInt16, atUint16>>>& ev : m_extraVerts) {
for (const std::pair<atInt16, atUint16>& se : ev.second) {
if (se.second == nextVert) {
os.format(fmt(
os.format(FMT_STRING(
"bm.verts.ensure_lookup_table()\n"
"orig_vert = bm.verts[{}]\n"
"vert = bm.verts.new(orig_vert.co)\n"),
@ -466,7 +466,7 @@ void InitGeomBlenderContext(hecl::blender::PyOutStream& os, const hecl::ProjectP
"\n";
/* Link master shader library */
os.format(fmt(
os.format(FMT_STRING(
"# Master shader library\n"
"with bpy.data.libraries.load('{}', link=True, relative=True) as (data_from, data_to):\n"
" data_to.node_groups = data_from.node_groups\n"
@ -485,13 +485,13 @@ void FinishBlenderMesh(hecl::blender::PyOutStream& os, unsigned matSetCount, int
"obj = bpy.data.objects.new(mesh.name, mesh)\n"
"obj.show_transparent = True\n"
"coll.objects.link(obj)\n";
os.format(fmt("mesh.hecl_material_count = {}\n"), matSetCount);
os.format(FMT_STRING("mesh.hecl_material_count = {}\n"), matSetCount);
} else {
os.format(fmt("mesh = bpy.data.meshes.new(bpy.context.scene.name + '_{:03d}')\n"), meshIdx);
os.format(FMT_STRING("mesh = bpy.data.meshes.new(bpy.context.scene.name + '_{:03d}')\n"), meshIdx);
os << "obj = bpy.data.objects.new(mesh.name, mesh)\n"
"obj.show_transparent = True\n"
"coll.objects.link(obj)\n";
os.format(fmt("mesh.hecl_material_count = {}\n"), matSetCount);
os.format(FMT_STRING("mesh.hecl_material_count = {}\n"), matSetCount);
}
os << "mesh.use_auto_smooth = True\n"
@ -701,7 +701,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
for (atUint16 i = 0; i <= maxIdxs.pos; ++i) {
positions.push_back(reader.readVec3fBig());
const atVec3f& pos = positions.back();
os.format(fmt("vert = bm.verts.new(({},{},{}))\n"), pos.simd[0], pos.simd[1], pos.simd[2]);
os.format(FMT_STRING("vert = bm.verts.new(({},{},{}))\n"), pos.simd[0], pos.simd[1], pos.simd[2]);
if (rp.first.second) {
if (SurfaceHeader::UseMatrixSkinning() && !skinIndices.empty())
rp.first.second->weightVertex(os, *rp.second.second, skinIndices[i]);
@ -711,10 +711,10 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
}
if (rp.first.second && SurfaceHeader::UseMatrixSkinning() && !skinIndices.empty())
vertCount += extraTracker.sendAdditionalVertsToBlender(os, rp, 0);
os.format(fmt("two_face_vert = {}\n"), vertCount);
os.format(FMT_STRING("two_face_vert = {}\n"), vertCount);
for (atUint16 i = 0; i <= maxIdxs.pos; ++i) {
const atVec3f& pos = positions[i];
os.format(fmt("vert = bm.verts.new(({},{},{}))\n"), pos.simd[0], pos.simd[1], pos.simd[2]);
os.format(FMT_STRING("vert = bm.verts.new(({},{},{}))\n"), pos.simd[0], pos.simd[1], pos.simd[2]);
if (rp.first.second) {
if (SurfaceHeader::UseMatrixSkinning() && !skinIndices.empty())
rp.first.second->weightVertex(os, *rp.second.second, skinIndices[i]);
@ -735,13 +735,13 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
float x = reader.readInt16Big() / 16384.0f;
float y = reader.readInt16Big() / 16384.0f;
float z = reader.readInt16Big() / 16384.0f;
os.format(fmt("norm_list.append(({},{},{}))\n"), x, y, z);
os.format(FMT_STRING("norm_list.append(({},{},{}))\n"), x, y, z);
}
} else {
atUint32 normCount = secSizes[s] / 12;
for (atUint32 i = 0; i < normCount; ++i) {
const atVec3f norm = reader.readVec3fBig();
os.format(fmt("norm_list.append(({},{},{}))\n"), norm.simd[0], norm.simd[1], norm.simd[2]);
os.format(FMT_STRING("norm_list.append(({},{},{}))\n"), norm.simd[0], norm.simd[1], norm.simd[2]);
}
}
break;
@ -756,7 +756,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
atUint32 uvCount = secSizes[s] / 8;
for (atUint32 i = 0; i < uvCount; ++i) {
const atVec2f uv = reader.readVec2fBig();
os.format(fmt("uv_list.append(({},{}))\n"), uv.simd[0], uv.simd[1]);
os.format(FMT_STRING("uv_list.append(({},{}))\n"), uv.simd[0], uv.simd[1]);
}
break;
}
@ -772,7 +772,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
for (atUint32 i = 0; i < uvCount; ++i) {
float x = reader.readInt16Big() / 32768.0f;
float y = reader.readInt16Big() / 32768.0f;
os.format(fmt("suv_list.append(({},{}))\n"), x, y);
os.format(FMT_STRING("suv_list.append(({},{}))\n"), x, y);
}
break;
}
@ -799,10 +799,10 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
if (SurfaceHeader::UseMatrixSkinning() && rp.first.second)
bankIn = rp.first.second->getMatrixBank(sHead.skinMatrixBankIdx());
os.format(fmt("materials[{}].pass_index = {}\n"), sHead.matIdx, surfIdx++);
os.format(FMT_STRING("materials[{}].pass_index = {}\n"), sHead.matIdx, surfIdx++);
if (matUVCount > createdUVLayers) {
for (unsigned l = createdUVLayers; l < matUVCount; ++l)
os.format(fmt("bm.loops.layers.uv.new('UV_{}')\n"), l);
os.format(FMT_STRING("bm.loops.layers.uv.new('UV_{}')\n"), l);
createdUVLayers = matUVCount;
}
@ -824,7 +824,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
atUint8 flip = 0;
for (int v = 0; v < vertCount - 2; ++v) {
if (flip) {
os.format(fmt(
os.format(FMT_STRING(
"last_face, last_mesh = add_triangle(bm, bm.verts, ({},{},{}), norm_list, ({},{},{}), {}, od_list, "
"two_face_vert)\n"),
primVerts[c % 3].pos, primVerts[(c + 2) % 3].pos, primVerts[(c + 1) % 3].pos, primVerts[c % 3].norm,
@ -833,7 +833,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
os << "if last_face is not None:\n";
for (unsigned j = 0; j < matUVCount; ++j) {
if (j == 0 && matShortUVs)
os.format(fmt(
os.format(FMT_STRING(
" uv_tri = expand_lightmap_triangle(lightmap_tri_tracker, suv_list[{}], suv_list[{}], "
"suv_list[{}])\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
@ -845,7 +845,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
primVerts[c % 3].uvs[j], primVerts[(c + 2) % 3].uvs[j], primVerts[(c + 1) % 3].uvs[j],
primVerts[c % 3].pos, j, primVerts[(c + 2) % 3].pos, j, primVerts[(c + 1) % 3].pos, j);
else
os.format(fmt(
os.format(FMT_STRING(
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
@ -857,7 +857,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
}
}
} else {
os.format(fmt(
os.format(FMT_STRING(
"last_face, last_mesh = add_triangle(bm, bm.verts, ({},{},{}), norm_list, ({},{},{}), {}, od_list, "
"two_face_vert)\n"),
primVerts[c % 3].pos, primVerts[(c + 1) % 3].pos, primVerts[(c + 2) % 3].pos, primVerts[c % 3].norm,
@ -866,7 +866,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
os << "if last_face is not None:\n";
for (unsigned j = 0; j < matUVCount; ++j) {
if (j == 0 && matShortUVs)
os.format(fmt(
os.format(FMT_STRING(
" uv_tri = expand_lightmap_triangle(lightmap_tri_tracker, suv_list[{}], suv_list[{}], "
"suv_list[{}])\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
@ -878,7 +878,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
primVerts[c % 3].uvs[j], primVerts[(c + 1) % 3].uvs[j], primVerts[(c + 2) % 3].uvs[j],
primVerts[c % 3].pos, j, primVerts[(c + 1) % 3].pos, j, primVerts[(c + 2) % 3].pos, j);
else
os.format(fmt(
os.format(FMT_STRING(
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
@ -901,7 +901,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
} else if (ptype == GX::TRIANGLES) {
for (int v = 0; v < vertCount; v += 3) {
os.format(fmt(
os.format(FMT_STRING(
"last_face, last_mesh = add_triangle(bm, bm.verts, ({},{},{}), norm_list, ({},{},{}), {}, od_list, "
"two_face_vert)\n"),
primVerts[0].pos, primVerts[1].pos, primVerts[2].pos, primVerts[0].norm, primVerts[1].norm,
@ -910,7 +910,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
os << "if last_face is not None:\n";
for (unsigned j = 0; j < matUVCount; ++j) {
if (j == 0 && matShortUVs)
os.format(fmt(
os.format(FMT_STRING(
" uv_tri = expand_lightmap_triangle(lightmap_tri_tracker, suv_list[{}], suv_list[{}], "
"suv_list[{}])\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
@ -922,7 +922,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
primVerts[0].uvs[j], primVerts[1].uvs[j], primVerts[2].uvs[j], primVerts[0].pos, j,
primVerts[1].pos, j, primVerts[2].pos, j);
else
os.format(fmt(
os.format(FMT_STRING(
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
@ -945,7 +945,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
} else if (ptype == GX::TRIANGLEFAN) {
++c;
for (int v = 0; v < vertCount - 2; ++v) {
os.format(fmt(
os.format(FMT_STRING(
"last_face, last_mesh = add_triangle(bm, bm.verts, ({},{},{}), norm_list, ({},{},{}), {}, od_list, "
"two_face_vert)\n"),
firstPrimVert.pos, primVerts[c % 3].pos, primVerts[(c + 1) % 3].pos, firstPrimVert.norm,
@ -954,7 +954,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
os << "if last_face is not None:\n";
for (unsigned j = 0; j < matUVCount; ++j) {
if (j == 0 && matShortUVs)
os.format(fmt(
os.format(FMT_STRING(
" uv_tri = expand_lightmap_triangle(lightmap_tri_tracker, suv_list[{}], suv_list[{}], "
"suv_list[{}])\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
@ -966,7 +966,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
firstPrimVert.uvs[j], primVerts[c % 3].uvs[j], primVerts[(c + 1) % 3].uvs[j], firstPrimVert.pos,
j, primVerts[c % 3].pos, j, primVerts[(c + 1) % 3].pos, j);
else
os.format(fmt(
os.format(FMT_STRING(
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
@ -1002,7 +1002,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
FinishBlenderMesh(os, matSetCount, meshIdx);
if (rp.first.second) {
os.format(fmt("mesh.cskr_id = '{}'\n"), rp.first.first);
os.format(FMT_STRING("mesh.cskr_id = '{}'\n"), rp.first.first);
rp.second.second->sendVertexGroupsToBlender(os);
}
@ -1016,18 +1016,18 @@ bool ReadCMDLToBlender(hecl::blender::Connection& conn, athena::io::IStreamReade
head.read(reader);
if (head.magic != 0xDEADBABE) {
LogDNACommon.report(logvisor::Error, fmt("invalid CMDL magic"));
LogDNACommon.report(logvisor::Error, FMT_STRING("invalid CMDL magic"));
return false;
}
if (head.version != Version) {
LogDNACommon.report(logvisor::Error, fmt("invalid CMDL version"));
LogDNACommon.report(logvisor::Error, FMT_STRING("invalid CMDL version"));
return false;
}
/* Open Py Stream and read sections */
hecl::blender::PyOutStream os = conn.beginPythonOut(true);
os.format(fmt(
os.format(FMT_STRING(
"import bpy\n"
"import bmesh\n"
"\n"
@ -1078,7 +1078,7 @@ void NameCMDL(athena::io::IStreamReader& reader, PAKRouter& pakRouter, typename
const SpecBase& dataspec) {
Header head;
head.read(reader);
std::string bestName = fmt::format(fmt("CMDL_{}"), entry.id);
std::string bestName = fmt::format(FMT_STRING("CMDL_{}"), entry.id);
/* Pre-read pass to determine maximum used vert indices */
atUint32 matSecCount = 0;
@ -1152,7 +1152,7 @@ bool WriteCMDL(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPath
size_t endOff = 0;
for (const Material& mat : mset) {
std::string diagName = fmt::format(fmt("{}:{}"), inPath.getLastComponentUTF8(), mat.name);
std::string diagName = fmt::format(FMT_STRING("{}:{}"), inPath.getLastComponentUTF8(), mat.name);
hecl::Frontend::IR matIR = FE.compileSource(mat.source, diagName);
setBackends.emplace_back();
hecl::Backend::GX& matGX = setBackends.back();
@ -1245,7 +1245,7 @@ bool WriteCMDL(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPath
for (const Mesh::Surface& surf : mesh.surfaces) {
size_t vertSz = matSets.at(0).materials.at(surf.materialIdx).getVAFlags().vertDLSize();
if (surf.verts.size() > 65536)
LogDNACommon.report(logvisor::Fatal, fmt("GX DisplayList overflow"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("GX DisplayList overflow"));
size_t secSz = 64;
for (auto it = surf.verts.cbegin(); it != surf.verts.cend();) {
atUint16 vertCount = 0;
@ -1339,7 +1339,7 @@ bool WriteCMDL(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPath
else if (mesh.topology == hecl::HMDLTopology::TriStrips)
prim = GX::TRIANGLESTRIP;
else
LogDNACommon.report(logvisor::Fatal, fmt("unrecognized mesh output mode"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("unrecognized mesh output mode"));
auto surfSizeIt = head.secSizes.begin() + firstSurfSec;
for (const Mesh::Surface& surf : mesh.surfaces) {
const typename MaterialSet::Material::VAFlags& vaFlags = matSets.at(0).materials.at(surf.materialIdx).getVAFlags();
@ -1787,7 +1787,7 @@ bool WriteMREASecs(std::vector<std::vector<uint8_t>>& secsOut, const hecl::Proje
else if (mesh.topology == hecl::HMDLTopology::TriStrips)
prim = GX::TRIANGLESTRIP;
else
LogDNACommon.report(logvisor::Fatal, fmt("unrecognized mesh output mode"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("unrecognized mesh output mode"));
auto surfEndOffIt = surfEndOffs.begin();
size_t lastEndOff = 0;
for (const Mesh::Surface& surf : mesh.surfaces) {

View File

@ -26,11 +26,11 @@ hecl::ProjectPath UniqueIDBridge::TranslatePakIdToPath(const IDType& id, bool si
if (!project) {
if (pakRouter) {
if (hecl::VerbosityLevel >= 1 && !silenceWarnings && id.isValid())
LogDNACommon.report(logvisor::Warning, fmt("unable to translate {} to path"), id);
LogDNACommon.report(logvisor::Warning, FMT_STRING("unable to translate {} to path"), id);
return {};
}
LogDNACommon.report(logvisor::Fatal,
fmt("g_PakRouter or s_Project must be set to non-null before "
FMT_STRING("g_PakRouter or s_Project must be set to non-null before "
"calling UniqueIDBridge::TranslatePakIdToPath"));
return {};
}
@ -38,7 +38,7 @@ hecl::ProjectPath UniqueIDBridge::TranslatePakIdToPath(const IDType& id, bool si
const hecl::ProjectPath* search = project->lookupBridgePath(id.toUint64());
if (!search) {
if (hecl::VerbosityLevel >= 1 && !silenceWarnings && id.isValid())
LogDNACommon.report(logvisor::Warning, fmt("unable to translate {} to path"), id);
LogDNACommon.report(logvisor::Warning, FMT_STRING("unable to translate {} to path"), id);
return {};
}
return *search;
@ -53,7 +53,7 @@ hecl::ProjectPath UniqueIDBridge::MakePathFromString(std::string_view str) {
return {};
hecl::Database::Project* project = s_Project.get();
if (!project)
LogDNACommon.report(logvisor::Fatal, fmt("UniqueIDBridge::setGlobalProject must be called before MakePathFromString"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("UniqueIDBridge::setGlobalProject must be called before MakePathFromString"));
hecl::ProjectPath path = hecl::ProjectPath(*project, str);
project->addBridgePathToCache(IDType(path).toUint64(), path);
return path;
@ -91,7 +91,7 @@ void UniqueID32::Enumerate<BigDNA::BinarySize>(typename BinarySize::StreamT& s)
}
std::string UniqueID32::toString() const {
return fmt::format(fmt("{}"), *this);
return fmt::format(FMT_STRING("{}"), *this);
}
template <>
@ -143,7 +143,7 @@ void UniqueID64::Enumerate<BigDNA::BinarySize>(typename BinarySize::StreamT& s)
}
std::string UniqueID64::toString() const {
return fmt::format(fmt("{}"), *this);
return fmt::format(FMT_STRING("{}"), *this);
}
/** PAK 128-bit Unique ID */
@ -176,7 +176,7 @@ void UniqueID128::Enumerate<BigDNA::BinarySize>(typename BinarySize::StreamT& s)
}
std::string UniqueID128::toString() const {
return fmt::format(fmt("{}"), *this);
return fmt::format(FMT_STRING("{}"), *this);
}
/** Word Bitmap reader/writer */

View File

@ -79,15 +79,15 @@ public:
PAKRouterBase(const SpecBase& dataSpec) : m_dataSpec(dataSpec) {}
hecl::Database::Project& getProject() const { return m_dataSpec.getProject(); }
virtual hecl::ProjectPath getWorking(const UniqueID32&, bool silenceWarnings = false) const {
LogDNACommon.report(logvisor::Fatal, fmt("PAKRouter IDType mismatch; expected UniqueID32 specialization"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKRouter IDType mismatch; expected UniqueID32 specialization"));
return hecl::ProjectPath();
}
virtual hecl::ProjectPath getWorking(const UniqueID64&, bool silenceWarnings = false) const {
LogDNACommon.report(logvisor::Fatal, fmt("PAKRouter IDType mismatch; expected UniqueID64 specialization"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKRouter IDType mismatch; expected UniqueID64 specialization"));
return hecl::ProjectPath();
}
virtual hecl::ProjectPath getWorking(const UniqueID128&, bool silenceWarnings = false) const {
LogDNACommon.report(logvisor::Fatal, fmt("PAKRouter IDType mismatch; expected UniqueID128 specialization"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKRouter IDType mismatch; expected UniqueID128 specialization"));
return hecl::ProjectPath();
}
};

View File

@ -22,7 +22,7 @@ void DeafBabeSendToBlender(hecl::blender::PyOutStream& os, const DEAFBABE& db, b
"col_bm = bmesh.new()\n";
for (const atVec3f& vert : db.verts) {
zeus::simd_floats f(vert.simd);
os.format(fmt("col_bm.verts.new(({},{},{}))\n"), f[0], f[1], f[2]);
os.format(FMT_STRING("col_bm.verts.new(({},{},{}))\n"), f[0], f[1], f[2]);
}
os << "col_bm.verts.ensure_lookup_table()\n";
@ -49,11 +49,11 @@ void DeafBabeSendToBlender(hecl::blender::PyOutStream& os, const DEAFBABE& db, b
}
os << "tri_verts = []\n";
os.format(fmt("tri_verts.append(col_bm.verts[{}])\n"), vindices[0]);
os.format(fmt("tri_verts.append(col_bm.verts[{}])\n"), vindices[1]);
os.format(fmt("tri_verts.append(col_bm.verts[{}])\n"), vindices[2]);
os.format(FMT_STRING("tri_verts.append(col_bm.verts[{}])\n"), vindices[0]);
os.format(FMT_STRING("tri_verts.append(col_bm.verts[{}])\n"), vindices[1]);
os.format(FMT_STRING("tri_verts.append(col_bm.verts[{}])\n"), vindices[2]);
os.format(fmt(
os.format(FMT_STRING(
"face = col_bm.faces.get(tri_verts)\n"
"if face is None:\n"
" face = col_bm.faces.new(tri_verts)\n"
@ -72,7 +72,7 @@ void DeafBabeSendToBlender(hecl::blender::PyOutStream& os, const DEAFBABE& db, b
db.insertNoClimb(os);
if (isDcln)
os.format(fmt("col_mesh = bpy.data.meshes.new('CMESH_{}')\n"), idx);
os.format(FMT_STRING("col_mesh = bpy.data.meshes.new('CMESH_{}')\n"), idx);
else
os << "col_mesh = bpy.data.meshes.new('CMESH')\n";

View File

@ -13,7 +13,7 @@ void FONT<IDType>::_read(athena::io::IStreamReader& __dna_reader) {
DNAFourCC magic;
magic.read(__dna_reader);
if (magic != SBIG('FONT')) {
LogModule.report(logvisor::Fatal, fmt("Invalid FONT magic '{}'"), magic);
LogModule.report(logvisor::Fatal, FMT_STRING("Invalid FONT magic '{}'"), magic);
return;
}
/* version */

View File

@ -16,7 +16,7 @@ template <class Op>
void FSM2<IDType>::Enumerate(typename Op::StreamT& s) {
Do<Op>(athena::io::PropId{"header"}, header, s);
if (header.magic != SBIG('FSM2')) {
LogDNAFSM2.report(logvisor::Fatal, fmt("Invalid FSM2 magic '{}' expected 'FSM2'"), header.magic);
LogDNAFSM2.report(logvisor::Fatal, FMT_STRING("Invalid FSM2 magic '{}' expected 'FSM2'"), header.magic);
return;
}
@ -29,7 +29,7 @@ void FSM2<IDType>::Enumerate(typename Op::StreamT& s) {
detail.reset(new FSMV2);
Do<Op>(athena::io::PropId{"detail"}, static_cast<FSMV2&>(*detail), s);
} else {
LogDNAFSM2.report(logvisor::Fatal, fmt("Invalid FSM2 version '{}'"), header.version);
LogDNAFSM2.report(logvisor::Fatal, FMT_STRING("Invalid FSM2 version '{}'"), header.version);
return;
}
}

View File

@ -21,7 +21,7 @@ void MAPA::Enumerate<BigDNA::Read>(typename Read::StreamT& __dna_reader) {
/* magic */
magic = __dna_reader.readUint32Big();
if (magic != 0xDEADD00D) {
LogDNACommon.report(logvisor::Error, fmt("invalid MAPA magic"));
LogDNACommon.report(logvisor::Error, FMT_STRING("invalid MAPA magic"));
return;
}
/* version */
@ -33,7 +33,7 @@ void MAPA::Enumerate<BigDNA::Read>(typename Read::StreamT& __dna_reader) {
else if (version == 5)
header = std::make_unique<HeaderMP3>();
else {
LogDNACommon.report(logvisor::Error, fmt("invalid MAPA version"));
LogDNACommon.report(logvisor::Error, FMT_STRING("invalid MAPA version"));
return;
}
@ -146,7 +146,7 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
" edge.seam = True\n"
"\n";
os.format(fmt(
os.format(FMT_STRING(
"bpy.context.scene.name = 'MAPA_{}'\n"
"bpy.context.scene.retro_map_vis_mode = '{}'\n"),
entry.id, RetroMapVisModes[mapa.header->visMode()]);
@ -159,7 +159,7 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
zeus::simd_floats mtxF[3];
for (int i = 0; i < 3; ++i)
moMP12->transformMtx[i].simd.copy_to(mtxF[i]);
os.format(fmt(
os.format(FMT_STRING(
"obj = bpy.data.objects.new('MAPOBJ_{:02d}', None)\n"
"bpy.context.scene.collection.objects.link(obj)\n"
"obj.retro_mappable_type = {}\n"
@ -181,7 +181,7 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
zeus::simd_floats mtxF[3];
for (int i = 0; i < 3; ++i)
moMP3->transformMtx[i].simd.copy_to(mtxF[i]);
os.format(fmt(
os.format(FMT_STRING(
"obj = bpy.data.objects.new('MAPOBJ_{:02d}', None)\n"
"bpy.context.scene.collection.objects.link(obj)\n"
"obj.retro_mappable_type = {}\n"
@ -208,7 +208,7 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
/* Read in verts */
for (const atVec3f& vert : mapa.vertices) {
zeus::simd_floats f(vert.simd);
os.format(fmt("bm.verts.new(({},{},{}))\n"), f[0], f[1], f[2]);
os.format(FMT_STRING("bm.verts.new(({},{},{}))\n"), f[0], f[1], f[2]);
}
os << "bm.verts.ensure_lookup_table()\n";
@ -225,10 +225,10 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
atUint8 flip = 0;
for (size_t v = 0; v < prim.indexCount - 2; ++v) {
if (flip) {
os.format(fmt("add_triangle(bm, ({},{},{}))\n"), primVerts[c % 3], primVerts[(c + 2) % 3],
os.format(FMT_STRING("add_triangle(bm, ({},{},{}))\n"), primVerts[c % 3], primVerts[(c + 2) % 3],
primVerts[(c + 1) % 3]);
} else {
os.format(fmt("add_triangle(bm, ({},{},{}))\n"), primVerts[c % 3], primVerts[(c + 1) % 3],
os.format(FMT_STRING("add_triangle(bm, ({},{},{}))\n"), primVerts[c % 3], primVerts[(c + 1) % 3],
primVerts[(c + 2) % 3]);
}
flip ^= 1;
@ -248,7 +248,7 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
}
} else if (GX::Primitive(prim.type) == GX::TRIANGLES) {
for (size_t v = 0; v < prim.indexCount; v += 3) {
os.format(fmt("add_triangle(bm, ({},{},{}))\n"), primVerts[0], primVerts[1], primVerts[2]);
os.format(FMT_STRING("add_triangle(bm, ({},{},{}))\n"), primVerts[0], primVerts[1], primVerts[2]);
/* Break if done */
if (v + 3 >= prim.indexCount)
@ -264,7 +264,7 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
for (const typename MAPA::Surface::Border& border : surf.borders) {
auto iit = border.indices.cbegin();
for (size_t i = 0; i < border.indexCount - 1; ++i) {
os.format(fmt("add_border(bm, ({},{}))\n"), *iit, *(iit + 1));
os.format(FMT_STRING("add_border(bm, ({},{}))\n"), *iit, *(iit + 1));
++iit;
}
}
@ -278,7 +278,7 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
const zeus::CMatrix4f* tmpMtx = pakRouter.lookupMAPATransform(entry.id);
const zeus::CMatrix4f& mtx = tmpMtx ? *tmpMtx : zeus::skIdentityMatrix4f;
os.format(fmt(
os.format(FMT_STRING(
"mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"obj.rotation_mode = 'QUATERNION'\n"
@ -294,7 +294,7 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
if (hecl::StringUtils::BeginsWith(ent.m_name, _SYS_STR("!world_")) &&
hecl::StringUtils::EndsWith(ent.m_name, _SYS_STR(".blend"))) {
hecl::SystemUTF8Conv conv(ent.m_name);
os.linkBackground(fmt::format(fmt("//../{}"), conv), "World"sv);
os.linkBackground(fmt::format(FMT_STRING("//../{}"), conv), "World"sv);
break;
}
}
@ -326,7 +326,7 @@ template bool ReadMAPAToBlender<PAKRouter<DNAMP3::PAKBridge>>(hecl::blender::Con
template <typename MAPAType>
bool Cook(const hecl::blender::MapArea& mapaIn, const hecl::ProjectPath& out) {
if (mapaIn.verts.size() >= 256) {
Log.report(logvisor::Error, fmt(_SYS_STR("MAPA {} vertex range exceeded [{}/{}]")), out.getRelativePath(),
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("MAPA {} vertex range exceeded [{}/{}]")), out.getRelativePath(),
mapaIn.verts.size(), 255);
return false;
}

View File

@ -43,7 +43,7 @@ bool ReadMAPUToBlender(hecl::blender::Connection& conn, const MAPU& mapu, const
for (int i = 0; i < 3; ++i)
wldXf.xf[i].simd.copy_to(wldXfF[i]);
zeus::simd_floats hexColorF(wld.hexColor.mSimd);
os.format(fmt(
os.format(FMT_STRING(
"wldObj = bpy.data.objects.new('{}', None)\n"
"mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
@ -62,7 +62,7 @@ bool ReadMAPUToBlender(hecl::blender::Connection& conn, const MAPU& mapu, const
zeus::simd_floats hexXfF[3];
for (int i = 0; i < 3; ++i)
hexXf.xf[i].simd.copy_to(hexXfF[i]);
os.format(fmt(
os.format(FMT_STRING(
"obj = bpy.data.objects.new('{}_{}', hexMesh)\n"
"mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"

View File

@ -41,7 +41,7 @@ bool ReadMLVLToBlender(hecl::blender::Connection& conn, const MLVL& mlvl, const
zeus::simd_floats xfMtxF[3];
for (int i = 0; i < 3; ++i)
area.transformMtx[i].simd.copy_to(xfMtxF[i]);
os.format(fmt(
os.format(FMT_STRING(
"box_mesh = bpy.data.meshes.new('''{}''')\n"
"bm.to_mesh(box_mesh)\n"
"bm.free()\n"
@ -67,7 +67,7 @@ bool ReadMLVLToBlender(hecl::blender::Connection& conn, const MLVL& mlvl, const
int idx = 0;
for (const atVec3f& pv : dock.planeVerts) {
const zeus::CVector3f pvRel = zeus::CVector3f(pv) - pvAvg;
os.format(fmt(
os.format(FMT_STRING(
"bm.verts.new(({},{},{}))\n"
"bm.verts.ensure_lookup_table()\n"),
pvRel[0], pvRel[1], pvRel[2]);
@ -76,13 +76,13 @@ bool ReadMLVLToBlender(hecl::blender::Connection& conn, const MLVL& mlvl, const
++idx;
}
os << "bm.edges.new((bm.verts[-1], bm.verts[0]))\n";
os.format(fmt("dockMesh = bpy.data.meshes.new('DOCK_{:02d}_{:02d}')\n"), areaIdx, dockIdx);
os.format(FMT_STRING("dockMesh = bpy.data.meshes.new('DOCK_{:02d}_{:02d}')\n"), areaIdx, dockIdx);
os << "dockObj = bpy.data.objects.new(dockMesh.name, dockMesh)\n"
"bpy.context.scene.collection.objects.link(dockObj)\n"
"bm.to_mesh(dockMesh)\n"
"bm.free()\n"
"dockObj.parent = box\n";
os.format(fmt("dockObj.location = ({},{},{})\n"), float(pvAvg[0]), float(pvAvg[1]), float(pvAvg[2]));
os.format(FMT_STRING("dockObj.location = ({},{},{})\n"), float(pvAvg[0]), float(pvAvg[1]), float(pvAvg[2]));
++dockIdx;
}
++areaIdx;

View File

@ -207,7 +207,7 @@ void PAKRouter<BRIDGETYPE>::enterPAKBridge(const BRIDGETYPE& pakBridge) {
++pit;
++bridgeIdx;
}
LogDNACommon.report(logvisor::Fatal, fmt("PAKBridge provided to PAKRouter::enterPAKBridge() was not part of build()"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKBridge provided to PAKRouter::enterPAKBridge() was not part of build()"));
}
template <class BRIDGETYPE>
@ -287,7 +287,7 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getWorking(const EntryType* entry,
return sharedPath.ensureAuxInfo(auxInfo);
}
LogDNACommon.report(logvisor::Fatal, fmt("Unable to find entry {}"), entry->id);
LogDNACommon.report(logvisor::Fatal, FMT_STRING("Unable to find entry {}"), entry->id);
return hecl::ProjectPath();
}
@ -338,7 +338,7 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getCooked(const EntryType* entry) const
if (sharedSearch != m_sharedEntries.end()) {
return hecl::ProjectPath(m_sharedCooked, getBestEntryName(*entry));
}
LogDNACommon.report(logvisor::Fatal, fmt("Unable to find entry {}"), entry->id);
LogDNACommon.report(logvisor::Fatal, FMT_STRING("Unable to find entry {}"), entry->id);
return hecl::ProjectPath();
}
@ -353,7 +353,7 @@ hecl::SystemString PAKRouter<BRIDGETYPE>::getResourceRelativePath(const EntryTyp
const PAKType* pak = m_pak.get();
if (!pak)
LogDNACommon.report(logvisor::Fatal,
fmt("PAKRouter::enterPAKBridge() must be called before PAKRouter::getResourceRelativePath()"));
FMT_STRING("PAKRouter::enterPAKBridge() must be called before PAKRouter::getResourceRelativePath()"));
const typename BRIDGETYPE::PAKType::Entry* be = lookupEntry(b);
if (!be)
return hecl::SystemString();
@ -377,17 +377,17 @@ std::string PAKRouter<BRIDGETYPE>::getBestEntryName(const EntryType& entry, bool
if (stdOverride && !pak.m_noShare) {
if (entry.type == FOURCC('MLVL'))
return fmt::format(fmt("!world_{}"), entry.id);
return fmt::format(FMT_STRING("!world_{}"), entry.id);
else if (entry.type == FOURCC('MREA'))
return fmt::format(fmt("!area_{}"), entry.id);
return fmt::format(FMT_STRING("!area_{}"), entry.id);
else if (entry.type == FOURCC('MAPA'))
return fmt::format(fmt("!map_{}"), entry.id);
return fmt::format(FMT_STRING("!map_{}"), entry.id);
else if (entry.type == FOURCC('PATH'))
return fmt::format(fmt("!path_{}"), entry.id);
return fmt::format(FMT_STRING("!path_{}"), entry.id);
else if (entry.type == FOURCC('MAPW'))
return fmt::format(fmt("!mapw_{}"), entry.id);
return fmt::format(FMT_STRING("!mapw_{}"), entry.id);
else if (entry.type == FOURCC('SAVW'))
return fmt::format(fmt("!savw_{}"), entry.id);
return fmt::format(FMT_STRING("!savw_{}"), entry.id);
}
std::string catalogueName;
@ -409,17 +409,17 @@ std::string PAKRouter<BRIDGETYPE>::getBestEntryName(const IDType& entry, bool st
if (stdOverride && !pak.m_noShare) {
if (e->type == FOURCC('MLVL'))
return fmt::format(fmt("!world_{}"), e->id);
return fmt::format(FMT_STRING("!world_{}"), e->id);
else if (e->type == FOURCC('MREA'))
return fmt::format(fmt("!area_{}"), e->id);
return fmt::format(FMT_STRING("!area_{}"), e->id);
else if (e->type == FOURCC('MAPA'))
return fmt::format(fmt("!map_{}"), e->id);
return fmt::format(FMT_STRING("!map_{}"), e->id);
else if (e->type == FOURCC('PATH'))
return fmt::format(fmt("!path_{}"), e->id);
return fmt::format(FMT_STRING("!path_{}"), e->id);
else if (e->type == FOURCC('MAPW'))
return fmt::format(fmt("!mapw_{}"), e->id);
return fmt::format(FMT_STRING("!mapw_{}"), e->id);
else if (e->type == FOURCC('SAVW'))
return fmt::format(fmt("!savw_{}"), e->id);
return fmt::format(FMT_STRING("!savw_{}"), e->id);
}
std::string catalogueName;
@ -495,7 +495,7 @@ const typename BRIDGETYPE::PAKType::Entry* PAKRouter<BRIDGETYPE>::lookupEntry(co
return nullptr;
if (!m_bridges)
LogDNACommon.report(logvisor::Fatal, fmt("PAKRouter::build() must be called before PAKRouter::lookupEntry()"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKRouter::build() must be called before PAKRouter::lookupEntry()"));
const PAKType* pak = m_pak.get();
const nod::Node* node = m_node.get();
@ -511,7 +511,7 @@ const typename BRIDGETYPE::PAKType::Entry* PAKRouter<BRIDGETYPE>::lookupEntry(co
if (currentPAK) {
#ifndef NDEBUG
if (!silenceWarnings)
LogDNACommon.report(logvisor::Warning, fmt("unable to find PAK entry {} in current PAK"), entry);
LogDNACommon.report(logvisor::Warning, FMT_STRING("unable to find PAK entry {} in current PAK"), entry);
#endif
return nullptr;
}
@ -528,7 +528,7 @@ const typename BRIDGETYPE::PAKType::Entry* PAKRouter<BRIDGETYPE>::lookupEntry(co
#ifndef NDEBUG
if (!silenceWarnings)
LogDNACommon.report(logvisor::Warning, fmt("unable to find PAK entry {}"), entry);
LogDNACommon.report(logvisor::Warning, FMT_STRING("unable to find PAK entry {}"), entry);
#endif
if (nodeOut)
*nodeOut = nullptr;
@ -561,7 +561,7 @@ const zeus::CMatrix4f* PAKRouter<BRIDGETYPE>::lookupMAPATransform(const IDType&
template <class BRIDGETYPE>
hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerWorking(const IDType& areaId, int layerIdx) const {
if (!m_bridges)
LogDNACommon.report(logvisor::Fatal, fmt("PAKRouter::build() must be called before PAKRouter::getAreaLayerWorking()"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKRouter::build() must be called before PAKRouter::getAreaLayerWorking()"));
auto bridgePathIt = m_bridgePaths.cbegin();
for (const BRIDGETYPE& bridge : *m_bridges) {
for (const auto& level : bridge.m_levelDeps)
@ -583,7 +583,7 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerWorking(const IDType& areaI
bool& activeOut) const {
activeOut = false;
if (!m_bridges)
LogDNACommon.report(logvisor::Fatal, fmt("PAKRouter::build() must be called before PAKRouter::getAreaLayerWorking()"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKRouter::build() must be called before PAKRouter::getAreaLayerWorking()"));
auto bridgePathIt = m_bridgePaths.cbegin();
for (const BRIDGETYPE& bridge : *m_bridges) {
for (const auto& level : bridge.m_levelDeps)
@ -605,7 +605,7 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerWorking(const IDType& areaI
template <class BRIDGETYPE>
hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerCooked(const IDType& areaId, int layerIdx) const {
if (!m_bridges)
LogDNACommon.report(logvisor::Fatal, fmt("PAKRouter::build() must be called before PAKRouter::getAreaLayerCooked()"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKRouter::build() must be called before PAKRouter::getAreaLayerCooked()"));
auto bridgePathIt = m_bridgePaths.cbegin();
for (const BRIDGETYPE& bridge : *m_bridges) {
for (const auto& level : bridge.m_levelDeps)
@ -626,7 +626,7 @@ template <class BRIDGETYPE>
hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerCooked(const IDType& areaId, int layerIdx, bool& activeOut) const {
activeOut = false;
if (!m_bridges)
LogDNACommon.report(logvisor::Fatal, fmt("PAKRouter::build() must be called before PAKRouter::getAreaLayerCooked()"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKRouter::build() must be called before PAKRouter::getAreaLayerCooked()"));
auto bridgePathIt = m_bridgePaths.cbegin();
for (const BRIDGETYPE& bridge : *m_bridges) {
for (const auto& level : bridge.m_levelDeps)
@ -648,7 +648,7 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerCooked(const IDType& areaId
template <class BRIDGETYPE>
void PAKRouter<BRIDGETYPE>::enumerateResources(const std::function<bool(const EntryType*)>& func) {
if (!m_bridges)
LogDNACommon.report(logvisor::Fatal, fmt("PAKRouter::build() must be called before PAKRouter::enumerateResources()"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKRouter::build() must be called before PAKRouter::enumerateResources()"));
for (const auto& entryPair : m_uniqueEntries)
if (!func(entryPair.second.second))
return;
@ -662,7 +662,7 @@ bool PAKRouter<BRIDGETYPE>::mreaHasDupeResources(const IDType& id) const {
const PAKType* pak = m_pak.get();
if (!pak)
LogDNACommon.report(logvisor::Fatal,
fmt("PAKRouter::enterPAKBridge() must be called before PAKRouter::mreaHasDupeResources()"));
FMT_STRING("PAKRouter::enterPAKBridge() must be called before PAKRouter::mreaHasDupeResources()"));
return pak->mreaHasDupeResources(id);
}

View File

@ -31,7 +31,7 @@ public:
PAKEntryReadStream(std::unique_ptr<atUint8[]>&& buf, atUint64 sz, atUint64 pos)
: m_buf(std::move(buf)), m_sz(sz), m_pos(pos) {
if (m_pos >= m_sz)
LogDNACommon.report(logvisor::Fatal, fmt("PAK stream cursor overrun"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAK stream cursor overrun"));
}
void seek(atInt64 pos, athena::SeekOrigin origin) override {
if (origin == athena::SeekOrigin::Begin) {
@ -42,7 +42,7 @@ public:
m_pos = m_sz + pos;
}
if (m_pos > m_sz) {
LogDNACommon.report(logvisor::Fatal, fmt("PAK stream cursor overrun"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAK stream cursor overrun"));
}
}
atUint64 position() const override { return m_pos; }

View File

@ -70,7 +70,7 @@ void PATH<PAKBridge>::sendToBlender(hecl::blender::Connection& conn, std::string
" material_index.append(key)\n"
" return len(material_index)-1\n"
"\n";
os.format(fmt("bpy.context.scene.name = '{}'\n"), entryName);
os.format(FMT_STRING("bpy.context.scene.name = '{}'\n"), entryName);
os << "# Clear Scene\n"
"if len(bpy.data.collections):\n"
" bpy.data.collections.remove(bpy.data.collections[0])\n"
@ -80,7 +80,7 @@ void PATH<PAKBridge>::sendToBlender(hecl::blender::Connection& conn, std::string
for (const Node& n : nodes) {
zeus::simd_floats f(n.position.simd);
os.format(fmt("bm.verts.new(({},{},{}))\n"), f[0], f[1], f[2]);
os.format(FMT_STRING("bm.verts.new(({},{},{}))\n"), f[0], f[1], f[2]);
}
os << "bm.verts.ensure_lookup_table()\n";
@ -88,9 +88,9 @@ void PATH<PAKBridge>::sendToBlender(hecl::blender::Connection& conn, std::string
for (const Region& r : regions) {
os << "tri_verts = []\n";
for (atUint32 i = 0; i < r.nodeCount; ++i)
os.format(fmt("tri_verts.append(bm.verts[{}])\n"), r.nodeStart + i);
os.format(FMT_STRING("tri_verts.append(bm.verts[{}])\n"), r.nodeStart + i);
os.format(fmt("face = bm.faces.get(tri_verts)\n"
os.format(FMT_STRING("face = bm.faces.get(tri_verts)\n"
"if face is None:\n"
" face = bm.faces.new(tri_verts)\n"
" face.normal_flip()\n"
@ -103,7 +103,7 @@ void PATH<PAKBridge>::sendToBlender(hecl::blender::Connection& conn, std::string
#if 0
const zeus::CVector3f center = xf->multiplyOneOverW(r.centroid);
zeus::CAABox aabb(xf->multiplyOneOverW(r.aabb[0]), xf->multiplyOneOverW(r.aabb[1]));
os.format(fmt("aabb = bpy.data.objects.new('AABB', None)\n")
os.format(FMT_STRING("aabb = bpy.data.objects.new('AABB', None)\n")
"aabb.location = (%f,%f,%f)\n"
"aabb.scale = (%f,%f,%f)\n"
"aabb.empty_display_type = 'CUBE'\n"
@ -125,7 +125,7 @@ void PATH<PAKBridge>::sendToBlender(hecl::blender::Connection& conn, std::string
for (const Node& n : nodes) {
zeus::simd_floats f(n.position.simd);
zeus::simd_floats no(n.position.simd + n.normal.simd);
os.format(fmt("v = bm.verts.new((%f,%f,%f))\n")
os.format(FMT_STRING("v = bm.verts.new((%f,%f,%f))\n")
"v2 = bm.verts.new((%f,%f,%f))\n"
"bm.edges.new((v, v2))\n", f[0], f[1], f[2], no[0], no[1], no[2]);
}
@ -150,7 +150,7 @@ void PATH<PAKBridge>::sendToBlender(hecl::blender::Connection& conn, std::string
zeus::simd_floats xfMtxF[4];
for (int i = 0; i < 4; ++i)
w.m[i].mSimd.copy_to(xfMtxF[i]);
os.format(fmt("mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
os.format(FMT_STRING("mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"path_mesh_obj.rotation_mode = 'QUATERNION'\n"
"path_mesh_obj.location = mtxd[0]\n"
@ -171,7 +171,7 @@ void PATH<PAKBridge>::sendToBlender(hecl::blender::Connection& conn, std::string
}
#endif
os.linkBackground(fmt::format(fmt("//{}"), areaPath));
os.linkBackground(fmt::format(FMT_STRING("//{}"), areaPath));
os.centerView();
os.close();
}

View File

@ -45,7 +45,7 @@ struct PPImpl : BigDNA, _Basis {
constexpr FourCC RefType = uint32_t(_Basis::Type);
DNAFourCC clsId(r);
if (clsId != RefType) {
LogModule.report(logvisor::Warning, fmt("non {} provided to {} parser"), RefType, RefType);
LogModule.report(logvisor::Warning, FMT_STRING("non {} provided to {} parser"), RefType, RefType);
return;
}
clsId.read(r);
@ -68,7 +68,7 @@ struct PPImpl : BigDNA, _Basis {
p.read(r);
}
})) {
LogModule.report(logvisor::Fatal, fmt("Unknown {} class {} @{}"), RefType, clsId, r.position());
LogModule.report(logvisor::Fatal, FMT_STRING("Unknown {} class {} @{}"), RefType, clsId, r.position());
}
clsId.read(r);
}
@ -124,7 +124,7 @@ struct PPImpl : BigDNA, _Basis {
if (key == "DNAType"sv)
continue;
if (key.size() < 4) {
LogModule.report(logvisor::Warning, fmt("short FourCC in element '{}'"), key);
LogModule.report(logvisor::Warning, FMT_STRING("short FourCC in element '{}'"), key);
continue;
}
@ -142,7 +142,7 @@ struct PPImpl : BigDNA, _Basis {
p.read(r);
}
})) {
LogModule.report(logvisor::Fatal, fmt("Unknown {} class {}"), RefType, clsId);
LogModule.report(logvisor::Fatal, FMT_STRING("Unknown {} class {}"), RefType, clsId);
}
}
}
@ -201,7 +201,7 @@ struct PEImpl : BigDNA {
m_elem = std::make_unique<typename Tp::Type>();
m_elem->read(r);
})) {
LogModule.report(logvisor::Fatal, fmt("Unknown {} class {} @{}"), _PtrType::TypeName, clsId, r.position());
LogModule.report(logvisor::Fatal, FMT_STRING("Unknown {} class {} @{}"), _PtrType::TypeName, clsId, r.position());
}
}
@ -229,7 +229,7 @@ struct PEImpl : BigDNA {
const auto& [key, value] = mapChildren[0];
if (key.size() < 4)
LogModule.report(logvisor::Fatal, fmt("short FourCC in element '{}'"), key);
LogModule.report(logvisor::Fatal, FMT_STRING("short FourCC in element '{}'"), key);
if (auto rec = r.enterSubRecord(key)) {
const DNAFourCC clsId = key.c_str();
@ -238,7 +238,7 @@ struct PEImpl : BigDNA {
m_elem = std::make_unique<typename Tp::Type>();
m_elem->read(r);
})) {
LogModule.report(logvisor::Fatal, fmt("Unknown {} class {}"), _PtrType::TypeName, clsId);
LogModule.report(logvisor::Fatal, FMT_STRING("Unknown {} class {}"), _PtrType::TypeName, clsId);
}
}
}

View File

@ -13,7 +13,7 @@ void ISTRG::gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const {
std::unique_ptr<ISTRG> LoadSTRG(athena::io::IStreamReader& reader) {
uint32_t magic = reader.readUint32Big();
if (magic != 0x87654321) {
LogDNACommon.report(logvisor::Error, fmt("invalid STRG magic"));
LogDNACommon.report(logvisor::Error, FMT_STRING("invalid STRG magic"));
return std::unique_ptr<ISTRG>();
}

View File

@ -826,9 +826,9 @@ static void EncodeCMPR(const uint8_t* rgbaIn, uint8_t* texels, int width, int he
}
}
static void PNGErr(png_structp png, png_const_charp msg) { Log.report(logvisor::Error, fmt("{}"), msg); }
static void PNGErr(png_structp png, png_const_charp msg) { Log.report(logvisor::Error, FMT_STRING("{}"), msg); }
static void PNGWarn(png_structp png, png_const_charp msg) { Log.report(logvisor::Warning, fmt("{}"), msg); }
static void PNGWarn(png_structp png, png_const_charp msg) { Log.report(logvisor::Warning, FMT_STRING("{}"), msg); }
bool TXTR::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) {
const uint32_t format = rs.readUint32Big();
@ -838,7 +838,7 @@ bool TXTR::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) {
auto fp = hecl::FopenUnique(outPath.getAbsolutePath().data(), _SYS_STR("wb"));
if (fp == nullptr) {
Log.report(logvisor::Error, fmt(_SYS_STR("Unable to open '{}' for writing")), outPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("Unable to open '{}' for writing")), outPath.getAbsolutePath());
return false;
}
png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, PNGErr, PNGWarn);
@ -1041,7 +1041,7 @@ static int GetNumPaletteEntriesForGCN(png_structp png, png_infop info) {
bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath) {
auto inf = hecl::FopenUnique(inPath.getAbsolutePath().data(), _SYS_STR("rb"));
if (inf == nullptr) {
Log.report(logvisor::Error, fmt(_SYS_STR("Unable to open '{}' for reading")), inPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("Unable to open '{}' for reading")), inPath.getAbsolutePath());
return false;
}
@ -1049,25 +1049,25 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
char header[8];
std::fread(header, 1, sizeof(header), inf.get());
if (png_sig_cmp((png_const_bytep)header, 0, 8)) {
Log.report(logvisor::Error, fmt(_SYS_STR("invalid PNG signature in '{}'")), inPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("invalid PNG signature in '{}'")), inPath.getAbsolutePath());
return false;
}
/* Setup PNG reader */
png_structp pngRead = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
if (!pngRead) {
Log.report(logvisor::Error, fmt("unable to initialize libpng"));
Log.report(logvisor::Error, FMT_STRING("unable to initialize libpng"));
return false;
}
png_infop info = png_create_info_struct(pngRead);
if (!info) {
Log.report(logvisor::Error, fmt("unable to initialize libpng info"));
Log.report(logvisor::Error, FMT_STRING("unable to initialize libpng info"));
png_destroy_read_struct(&pngRead, nullptr, nullptr);
return false;
}
if (setjmp(png_jmpbuf(pngRead))) {
Log.report(logvisor::Error, fmt(_SYS_STR("unable to initialize libpng I/O for '{}'")), inPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to initialize libpng I/O for '{}'")), inPath.getAbsolutePath());
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1083,7 +1083,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
const png_byte bitDepth = png_get_bit_depth(pngRead, info);
if (width < 4 || height < 4) {
Log.report(logvisor::Error, fmt("image must be 4x4 or larger"));
Log.report(logvisor::Error, FMT_STRING("image must be 4x4 or larger"));
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1112,7 +1112,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
}
if (bitDepth != 8) {
Log.report(logvisor::Error, fmt(_SYS_STR("'{}' is not 8 bits-per-channel")), inPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("'{}' is not 8 bits-per-channel")), inPath.getAbsolutePath());
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1143,7 +1143,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
nComps = 1;
break;
default:
Log.report(logvisor::Error, fmt(_SYS_STR("unsupported color type in '{}'")), inPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("unsupported color type in '{}'")), inPath.getAbsolutePath());
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1163,7 +1163,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
bufOut.reset(new uint8_t[bufLen]);
if (setjmp(png_jmpbuf(pngRead))) {
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to read image in '{}'")), inPath.getAbsolutePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to read image in '{}'")), inPath.getAbsolutePath());
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1344,7 +1344,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
/* Do write out */
athena::io::FileWriter outf(outPath.getAbsolutePath(), true, false);
if (outf.hasError()) {
Log.report(logvisor::Error, fmt(_SYS_STR("Unable to open '{}' for writing")), outPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("Unable to open '{}' for writing")), outPath.getAbsolutePath());
return false;
}
@ -1360,7 +1360,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath) {
auto inf = hecl::FopenUnique(inPath.getAbsolutePath().data(), _SYS_STR("rb"));
if (inf == nullptr) {
Log.report(logvisor::Error, fmt(_SYS_STR("Unable to open '{}' for reading")), inPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("Unable to open '{}' for reading")), inPath.getAbsolutePath());
return false;
}
@ -1368,25 +1368,25 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
char header[8];
std::fread(header, 1, sizeof(header), inf.get());
if (png_sig_cmp((png_const_bytep)header, 0, 8)) {
Log.report(logvisor::Error, fmt(_SYS_STR("invalid PNG signature in '{}'")), inPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("invalid PNG signature in '{}'")), inPath.getAbsolutePath());
return false;
}
/* Setup PNG reader */
png_structp pngRead = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
if (!pngRead) {
Log.report(logvisor::Error, fmt("unable to initialize libpng"));
Log.report(logvisor::Error, FMT_STRING("unable to initialize libpng"));
return false;
}
png_infop info = png_create_info_struct(pngRead);
if (!info) {
Log.report(logvisor::Error, fmt("unable to initialize libpng info"));
Log.report(logvisor::Error, FMT_STRING("unable to initialize libpng info"));
png_destroy_read_struct(&pngRead, nullptr, nullptr);
return false;
}
if (setjmp(png_jmpbuf(pngRead))) {
Log.report(logvisor::Error, fmt(_SYS_STR("unable to initialize libpng I/O for '{}'")), inPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to initialize libpng I/O for '{}'")), inPath.getAbsolutePath());
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1425,7 +1425,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
}
if (bitDepth != 8) {
Log.report(logvisor::Error, fmt(_SYS_STR("'{}' is not 8 bits-per-channel")), inPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("'{}' is not 8 bits-per-channel")), inPath.getAbsolutePath());
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1454,7 +1454,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
paletteBuf = ReadPalette(pngRead, info, paletteSize);
break;
default:
Log.report(logvisor::Error, fmt(_SYS_STR("unsupported color type in '{}'")), inPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("unsupported color type in '{}'")), inPath.getAbsolutePath());
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1472,7 +1472,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
bufOut.reset(new uint8_t[bufLen]);
if (setjmp(png_jmpbuf(pngRead))) {
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to read image in '{}'")), inPath.getAbsolutePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to read image in '{}'")), inPath.getAbsolutePath());
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1593,7 +1593,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
/* Do write out */
athena::io::FileWriter outf(outPath.getAbsolutePath(), true, false);
if (outf.hasError()) {
Log.report(logvisor::Error, fmt(_SYS_STR("Unable to open '{}' for writing")), outPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("Unable to open '{}' for writing")), outPath.getAbsolutePath());
return false;
}

View File

@ -988,19 +988,19 @@ bool ANCS::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
/* Search for yaml */
hecl::ProjectPath yamlPath = inPath.getWithExtension(_SYS_STR(".yaml"), true);
if (!yamlPath.isFile())
Log.report(logvisor::Fatal, fmt(_SYS_STR("'{}' not found as file")), yamlPath.getRelativePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("'{}' not found as file")), yamlPath.getRelativePath());
athena::io::FileReader reader(yamlPath.getAbsolutePath());
if (!reader.isOpen())
Log.report(logvisor::Fatal, fmt(_SYS_STR("can't open '{}' for reading")), yamlPath.getRelativePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("can't open '{}' for reading")), yamlPath.getRelativePath());
if (!athena::io::ValidateFromYAMLStream<ANCS>(reader)) {
Log.report(logvisor::Fatal, fmt(_SYS_STR("'{}' is not urde::DNAMP1::ANCS type")), yamlPath.getRelativePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("'{}' is not urde::DNAMP1::ANCS type")), yamlPath.getRelativePath());
}
athena::io::YAMLDocReader yamlReader;
if (!yamlReader.parse(&reader)) {
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to parse '{}'")), yamlPath.getRelativePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to parse '{}'")), yamlPath.getRelativePath());
}
ANCS ancs;
ancs.read(yamlReader);
@ -1020,9 +1020,9 @@ bool ANCS::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
hecl::SystemStringConv chSysName(ch.name);
if (!sub.cskrId.empty()) {
hecl::SystemStringConv cskrSysName(sub.cskrId);
ch.cskr = inPath.ensureAuxInfo(fmt::format(fmt(_SYS_STR("{}_{}.CSKR")), chSysName, cskrSysName));
ch.cskr = inPath.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}_{}.CSKR")), chSysName, cskrSysName));
} else {
ch.cskr = inPath.ensureAuxInfo(fmt::format(fmt(_SYS_STR("{}.CSKR")), chSysName));
ch.cskr = inPath.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}.CSKR")), chSysName));
}
/* Add subtype AABBs */
@ -1048,10 +1048,10 @@ bool ANCS::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
if (!search->cskrId.empty()) {
hecl::SystemStringConv cskrSys(search->cskrId);
ch.cskrIce = inPath.ensureAuxInfo(
fmt::format(fmt(_SYS_STR("{}.{}_{}.CSKR")), chSysName, overlaySys, cskrSys));
fmt::format(FMT_STRING(_SYS_STR("{}.{}_{}.CSKR")), chSysName, overlaySys, cskrSys));
} else {
ch.cskrIce = inPath.ensureAuxInfo(
fmt::format(fmt(_SYS_STR("{}.{}.CSKR")), chSysName, overlaySys));
fmt::format(FMT_STRING(_SYS_STR("{}.{}.CSKR")), chSysName, overlaySys));
}
}
}
@ -1074,9 +1074,9 @@ bool ANCS::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
hecl::ProjectPath pathOut;
if (!act.animId.empty()) {
hecl::SystemStringConv idSys(act.animId);
pathOut = inPath.ensureAuxInfo(fmt::format(fmt(_SYS_STR("{}_{}.ANIM")), sysStr, idSys));
pathOut = inPath.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}_{}.ANIM")), sysStr, idSys));
} else {
inPath.ensureAuxInfo(fmt::format(fmt(_SYS_STR("{}.ANIM")), sysStr));
inPath.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}.ANIM")), sysStr));
}
prim.animId = pathOut;
break;
@ -1093,9 +1093,9 @@ bool ANCS::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
hecl::ProjectPath pathOut;
if (!act.animId.empty()) {
hecl::SystemStringConv animIdSys(act.animId);
pathOut = inPath.ensureAuxInfo(fmt::format(fmt(_SYS_STR("{}_{}.ANIM")), sysStr, animIdSys));
pathOut = inPath.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}_{}.ANIM")), sysStr, animIdSys));
} else {
pathOut = inPath.ensureAuxInfo(fmt::format(fmt(_SYS_STR("{}.ANIM")), sysStr));
pathOut = inPath.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}.ANIM")), sysStr));
}
ancs.animationSet.animResources.emplace_back();
@ -1103,7 +1103,7 @@ bool ANCS::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
/* Check for associated EVNT YAML */
hecl::SystemString testPrefix(inPath.getWithExtension(
fmt::format(fmt(_SYS_STR(".{}_")), sysStr).c_str(), true).getLastComponent());
fmt::format(FMT_STRING(_SYS_STR(".{}_")), sysStr).c_str(), true).getLastComponent());
hecl::ProjectPath evntYamlPath;
for (const auto& ent : dEnum) {
if (hecl::StringUtils::BeginsWith(ent.m_name, testPrefix.c_str()) &&
@ -1163,7 +1163,7 @@ bool ANCS::CookCSKR(const hecl::ProjectPath& outPath, const hecl::ProjectPath& i
}
}
if (!subtype)
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to find subtype '{}'")), subName);
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to find subtype '{}'")), subName);
}
const hecl::ProjectPath* modelPath = nullptr;
@ -1176,7 +1176,7 @@ bool ANCS::CookCSKR(const hecl::ProjectPath& outPath, const hecl::ProjectPath& i
}
}
if (!attachment)
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to find attachment '{}'")), overName);
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to find attachment '{}'")), overName);
modelPath = &attachment->mesh;
} else if (overName.empty()) {
modelPath = &subtype->mesh;
@ -1188,15 +1188,15 @@ bool ANCS::CookCSKR(const hecl::ProjectPath& outPath, const hecl::ProjectPath& i
}
}
if (!modelPath)
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to resolve model path of {}:{}")), subName, overName);
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to resolve model path of {}:{}")), subName, overName);
if (!modelPath->isFile())
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to resolve '{}'")), modelPath->getRelativePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to resolve '{}'")), modelPath->getRelativePath());
hecl::ProjectPath skinIntPath = modelPath->getCookedPath(SpecEntMP1).getWithExtension(_SYS_STR(".skinint"));
if (!skinIntPath.isFileOrGlob() || skinIntPath.getModtime() < modelPath->getModtime())
if (!modelCookFunc(*modelPath))
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to cook '{}'")), modelPath->getRelativePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to cook '{}'")), modelPath->getRelativePath());
std::vector<std::pair<std::vector<std::pair<uint32_t, float>>, uint32_t>> skins;
uint32_t posCount = 0;
@ -1221,7 +1221,7 @@ bool ANCS::CookCSKR(const hecl::ProjectPath& outPath, const hecl::ProjectPath& i
const std::string& name = boneNames[bIdx];
auto search = boneIdMap.find(name);
if (search == boneIdMap.cend())
Log.report(logvisor::Fatal, fmt("unable to find bone '{}' in {}"), name,
Log.report(logvisor::Fatal, FMT_STRING("unable to find bone '{}' in {}"), name,
inPath.getRelativePathUTF8());
virtualBone.first.emplace_back(search->second, weight);
}
@ -1287,7 +1287,7 @@ bool ANCS::CookCSKRPC(const hecl::ProjectPath& outPath, const hecl::ProjectPath&
}
}
if (!subtype)
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to find subtype '{}'")), subName);
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to find subtype '{}'")), subName);
}
const hecl::ProjectPath* modelPath = nullptr;
@ -1300,7 +1300,7 @@ bool ANCS::CookCSKRPC(const hecl::ProjectPath& outPath, const hecl::ProjectPath&
}
}
if (!attachment)
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to find attachment '{}'")), overName);
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to find attachment '{}'")), overName);
modelPath = &attachment->mesh;
} else if (overName.empty()) {
modelPath = &subtype->mesh;
@ -1312,15 +1312,15 @@ bool ANCS::CookCSKRPC(const hecl::ProjectPath& outPath, const hecl::ProjectPath&
}
}
if (!modelPath)
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to resolve model path of {}:{}")), subName, overName);
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to resolve model path of {}:{}")), subName, overName);
if (!modelPath->isFile())
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to resolve '{}'")), modelPath->getRelativePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to resolve '{}'")), modelPath->getRelativePath());
hecl::ProjectPath skinIntPath = modelPath->getCookedPath(SpecEntMP1PC).getWithExtension(_SYS_STR(".skinint"));
if (!skinIntPath.isFileOrGlob() || skinIntPath.getModtime() < modelPath->getModtime())
if (!modelCookFunc(*modelPath))
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to cook '{}'")), modelPath->getRelativePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to cook '{}'")), modelPath->getRelativePath());
uint32_t bankCount = 0;
std::vector<std::vector<uint32_t>> skinBanks;
@ -1360,7 +1360,7 @@ bool ANCS::CookCSKRPC(const hecl::ProjectPath& outPath, const hecl::ProjectPath&
const std::string& name = boneNames[bIdx];
auto search = boneIdMap.find(name);
if (search == boneIdMap.cend())
Log.report(logvisor::Fatal, fmt("unable to find bone '{}' in {}"), name,
Log.report(logvisor::Fatal, FMT_STRING("unable to find bone '{}' in {}"), name,
inPath.getRelativePathUTF8());
virtualBone.emplace_back(search->second, weight);
}
@ -1381,7 +1381,7 @@ bool ANCS::CookCSKRPC(const hecl::ProjectPath& outPath, const hecl::ProjectPath&
const std::string& name = boneNames[bIdx];
auto search = boneIdMap.find(name);
if (search == boneIdMap.cend())
Log.report(logvisor::Fatal, fmt("unable to find bone '{}' in {}"), name,
Log.report(logvisor::Fatal, FMT_STRING("unable to find bone '{}' in {}"), name,
inPath.getRelativePathUTF8());
skinOut.writeUint32Big(search->second);
}
@ -1420,7 +1420,7 @@ bool ANCS::CookANIM(const hecl::ProjectPath& outPath, const hecl::ProjectPath& i
DNAANCS::Action action = ds.compileActionChannelsOnly(actNameView.str());
if (!actor.armatures.size())
Log.report(logvisor::Fatal, fmt(_SYS_STR("0 armatures in {}")), inPath.getRelativePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("0 armatures in {}")), inPath.getRelativePath());
/* Build bone ID map */
std::unordered_map<std::string, atInt32> boneIdMap;
@ -1440,7 +1440,7 @@ bool ANCS::CookANIM(const hecl::ProjectPath& outPath, const hecl::ProjectPath& i
/* Check for associated EVNT YAML */
hecl::SystemString testPrefix(inPath.getWithExtension(
fmt::format(fmt(_SYS_STR(".{}_")), actName).c_str(), true).getLastComponent());
fmt::format(FMT_STRING(_SYS_STR(".{}_")), actName).c_str(), true).getLastComponent());
hecl::ProjectPath evntYamlPath;
for (const auto& ent : hecl::DirectoryEnumerator(inPath.getParentPath().getAbsolutePath())) {
if (hecl::StringUtils::BeginsWith(ent.m_name, testPrefix.c_str()) &&

View File

@ -7,7 +7,7 @@ namespace DataSpec::DNAMP1 {
using ANIMOutStream = hecl::blender::ANIMOutStream;
void ANIM::IANIM::sendANIMToBlender(hecl::blender::PyOutStream& os, const DNAANIM::RigInverter<CINF>& rig) const {
os.format(fmt(
os.format(FMT_STRING(
"act.hecl_fps = round({})\n"
"act.hecl_looping = {}\n"),
(1.0f / mainInterval), looping ? "True" : "False");
@ -26,7 +26,7 @@ void ANIM::IANIM::sendANIMToBlender(hecl::blender::PyOutStream& os, const DNAANI
continue;
}
os.format(fmt("bone_string = '{}'\n"), *bName);
os.format(FMT_STRING("bone_string = '{}'\n"), *bName);
os << "action_group = act.groups.new(bone_string)\n"
"\n"
"rotCurves = []\n"
@ -111,7 +111,7 @@ UniqueID32 ANIM::GetEVNTId(athena::io::IStreamReader& reader) {
reader.seek(4);
return reader.readUint32Big();
default:
Log.report(logvisor::Error, fmt("unrecognized ANIM version"));
Log.report(logvisor::Error, FMT_STRING("unrecognized ANIM version"));
break;
}
return {};
@ -134,7 +134,7 @@ void ANIM::Enumerate<BigDNA::Read>(typename Read::StreamT& reader) {
m_anim->read(reader);
break;
default:
Log.report(logvisor::Error, fmt("unrecognized ANIM version"));
Log.report(logvisor::Error, FMT_STRING("unrecognized ANIM version"));
break;
}
}
@ -559,7 +559,7 @@ ANIM::ANIM(const BlenderAction& act, const std::unordered_map<std::string, atInt
for (const BlenderAction::Channel& chan : act.channels) {
auto search = idMap.find(chan.boneName);
if (search == idMap.cend()) {
Log.report(logvisor::Warning, fmt("unable to find id for bone '{}'"), chan.boneName);
Log.report(logvisor::Warning, FMT_STRING("unable to find id for bone '{}'"), chan.boneName);
continue;
}
if (addedBones.find(search->second) != addedBones.cend())

View File

@ -192,7 +192,7 @@ struct ANIM : BigDNA {
if (m_anim->evnt.isValid()) {
hecl::SystemStringConv sysStr(animInfo.name);
hecl::ProjectPath evntYamlPath = outPath.getWithExtension(
fmt::format(fmt(_SYS_STR(".{}_{}.evnt.yaml")), sysStr, m_anim->evnt).c_str(), true);
fmt::format(FMT_STRING(_SYS_STR(".{}_{}.evnt.yaml")), sysStr, m_anim->evnt).c_str(), true);
hecl::ProjectPath::Type evntYamlType = evntYamlPath.getPathType();
if (force || evntYamlType == hecl::ProjectPath::Type::None) {

View File

@ -34,7 +34,7 @@ void CINF::sendVertexGroupsToBlender(hecl::blender::PyOutStream& os) const {
for (atUint32 bid : boneIds) {
for (const Name& name : names) {
if (name.boneId == bid) {
os.format(fmt("obj.vertex_groups.new(name='{}')\n"), name.name);
os.format(FMT_STRING("obj.vertex_groups.new(name='{}')\n"), name.name);
break;
}
}
@ -44,7 +44,7 @@ void CINF::sendVertexGroupsToBlender(hecl::blender::PyOutStream& os) const {
void CINF::sendCINFToBlender(hecl::blender::PyOutStream& os, const UniqueID32& cinfId) const {
DNAANIM::RigInverter<CINF> inverter(*this);
os.format(fmt(
os.format(FMT_STRING(
"arm = bpy.data.armatures.new('CINF_{}')\n"
"arm_obj = bpy.data.objects.new(arm.name, arm)\n"
"bpy.context.scene.collection.objects.link(arm_obj)\n"
@ -56,7 +56,7 @@ void CINF::sendCINFToBlender(hecl::blender::PyOutStream& os, const UniqueID32& c
for (const DNAANIM::RigInverter<CINF>::Bone& bone : inverter.getBones()) {
zeus::simd_floats originF(bone.m_origBone.origin.simd);
zeus::simd_floats tailF(bone.m_tail.mSimd);
os.format(fmt(
os.format(FMT_STRING(
"bone = arm.edit_bones.new('{}')\n"
"bone.head = ({},{},{})\n"
"bone.tail = ({},{},{})\n"
@ -68,16 +68,16 @@ void CINF::sendCINFToBlender(hecl::blender::PyOutStream& os, const UniqueID32& c
for (const Bone& bone : bones)
if (bone.parentId != 2)
os.format(fmt("arm_bone_table[{}].parent = arm_bone_table[{}]\n"), bone.id, bone.parentId);
os.format(FMT_STRING("arm_bone_table[{}].parent = arm_bone_table[{}]\n"), bone.id, bone.parentId);
os << "bpy.ops.object.mode_set(mode='OBJECT')\n";
for (const DNAANIM::RigInverter<CINF>::Bone& bone : inverter.getBones())
os.format(fmt("arm_obj.pose.bones['{}'].rotation_mode = 'QUATERNION'\n"),
os.format(FMT_STRING("arm_obj.pose.bones['{}'].rotation_mode = 'QUATERNION'\n"),
*getBoneNameFromId(bone.m_origBone.id));
}
std::string CINF::GetCINFArmatureName(const UniqueID32& cinfId) { return fmt::format(fmt("CINF_{}"), cinfId); }
std::string CINF::GetCINFArmatureName(const UniqueID32& cinfId) { return fmt::format(FMT_STRING("CINF_{}"), cinfId); }
int CINF::RecursiveAddArmatureBone(const Armature& armature, const BlenderBone* bone, int parent, int& curId,
std::unordered_map<std::string, atInt32>& idMap,
@ -167,7 +167,7 @@ bool CINF::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
return false;
auto os = conn.beginPythonOut(true);
os.format(fmt("import bpy\n"
os.format(FMT_STRING("import bpy\n"
"from mathutils import Vector\n"
"bpy.context.scene.name = 'CINF_{}'\n"
"bpy.context.scene.hecl_arm_obj = bpy.context.scene.name\n"

View File

@ -26,7 +26,7 @@ void Material::AddTexture(Stream& out, GX::TexGenSrc type, int mtxIdx, uint32_t
if (mtxIdx == -1)
mtxLabel = "IDENTITY";
else
mtxLabel = fmt::format(fmt("MTX_{}"), mtxIdx);
mtxLabel = fmt::format(FMT_STRING("MTX_{}"), mtxIdx);
std::string texLabel;
if (diffuse)
@ -34,14 +34,14 @@ void Material::AddTexture(Stream& out, GX::TexGenSrc type, int mtxIdx, uint32_t
else
texLabel = "Texture";
out.format(fmt("# Texture\n"
out.format(FMT_STRING("# Texture\n"
"tex_node = new_nodetree.nodes.new('ShaderNodeTexImage')\n"
"tex_node.label = '{} {}'\n"
"texture_nodes.append(tex_node)\n"),
texLabel, texIdx);
if (texIdx != 0xff)
out.format(fmt("tex_node.image = tex_maps[{}]\n"), texIdx);
out.format(FMT_STRING("tex_node.image = tex_maps[{}]\n"), texIdx);
if (type == GX::TG_POS)
out << "tex_uv_node = new_nodetree.nodes.new('ShaderNodeTexCoord')\n"
@ -51,13 +51,13 @@ void Material::AddTexture(Stream& out, GX::TexGenSrc type, int mtxIdx, uint32_t
"tex_links.append(new_nodetree.links.new(tex_uv_node.outputs['Normal'], tex_node.inputs['Vector']))\n";
else if (type >= GX::TG_TEX0 && type <= GX::TG_TEX7) {
uint8_t texIdx = type - GX::TG_TEX0;
out.format(fmt("tex_uv_node = new_nodetree.nodes.new('ShaderNodeUVMap')\n"
out.format(FMT_STRING("tex_uv_node = new_nodetree.nodes.new('ShaderNodeUVMap')\n"
"tex_links.append(new_nodetree.links.new(tex_uv_node.outputs['UV'], tex_node.inputs['Vector']))\n"
"tex_uv_node.uv_map = 'UV_{}'\n"),
texIdx);
}
out.format(fmt("tex_uv_node.label = '{}'\n"), mtxLabel);
out.format(FMT_STRING("tex_uv_node.label = '{}'\n"), mtxLabel);
out << "gridder.place_node(tex_uv_node, 0)\n"
"gridder.place_node(tex_node, 0)\n"
@ -70,7 +70,7 @@ void Material::AddTexture(Stream& out, GX::TexGenSrc type, int mtxIdx, uint32_t
void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx, const float* vals) {
switch (type) {
case UVAnimation::Mode::MvInvNoTranslation:
out.format(fmt("for link in list(tex_links):\n"
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
@ -85,7 +85,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
idx);
break;
case UVAnimation::Mode::MvInv:
out.format(fmt("for link in list(tex_links):\n"
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
@ -100,7 +100,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
idx);
break;
case UVAnimation::Mode::Scroll:
out.format(fmt("for link in list(tex_links):\n"
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
@ -117,7 +117,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
idx, vals[0], vals[1], vals[2], vals[3]);
break;
case UVAnimation::Mode::Rotation:
out.format(fmt("for link in list(tex_links):\n"
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
@ -134,7 +134,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
idx, vals[0], vals[1]);
break;
case UVAnimation::Mode::HStrip:
out.format(fmt("for link in list(tex_links):\n"
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
@ -153,7 +153,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
idx, vals[0], vals[1], vals[2], vals[3]);
break;
case UVAnimation::Mode::VStrip:
out.format(fmt("for link in list(tex_links):\n"
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
@ -172,7 +172,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
idx, vals[0], vals[1], vals[2], vals[3]);
break;
case UVAnimation::Mode::Model:
out.format(fmt("for link in list(tex_links):\n"
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
@ -187,7 +187,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
idx);
break;
case UVAnimation::Mode::CylinderEnvironment:
out.format(fmt("for link in list(tex_links):\n"
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
@ -204,7 +204,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
idx, vals[0], vals[1]);
break;
case UVAnimation::Mode::Eight:
out.format(fmt("for link in list(tex_links):\n"
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
@ -233,7 +233,7 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
}
void Material::AddKcolor(Stream& out, const GX::Color& col, unsigned idx) {
out.format(fmt("kcolors[{}] = ({}, {}, {}, {})\n"
out.format(FMT_STRING("kcolors[{}] = ({}, {}, {}, {})\n"
"kalphas[{}] = {}\n"
"\n"),
idx, (float)col.color[0] / (float)0xff, (float)col.color[1] / (float)0xff,
@ -343,14 +343,14 @@ template <class MAT>
static void _DescribeTEV(const MAT& mat) {
for (uint32_t i = 0; i < mat.tevStageCount; ++i) {
const auto& stage = mat.tevStages[i];
fmt::print(stderr, fmt("A:{} B:{} C:{} D:{} -> {} | A:{} B:{} C:{} D:{} -> {}\n"), ToString(stage.colorInA()),
fmt::print(stderr, FMT_STRING("A:{} B:{} C:{} D:{} -> {} | A:{} B:{} C:{} D:{} -> {}\n"), ToString(stage.colorInA()),
ToString(stage.colorInB()), ToString(stage.colorInC()), ToString(stage.colorInD()),
ToString(stage.colorOpOutReg()), ToString(stage.alphaInA()), ToString(stage.alphaInB()),
ToString(stage.alphaInC()), ToString(stage.alphaInD()), ToString(stage.alphaOpOutReg()));
}
bool hasInd = mat.flags.samusReflectionIndirectTexture();
bool hasLm = mat.flags.lightmap();
fmt::print(stderr, fmt("HasIndirect: {} HasLightmap: {}\n"), hasInd, hasLm);
fmt::print(stderr, FMT_STRING("HasIndirect: {} HasLightmap: {}\n"), hasInd, hasLm);
}
struct TexLink {
@ -440,7 +440,7 @@ template <class MAT>
static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupIdx, unsigned matIdx) {
unsigned i;
out.format(fmt("new_material = bpy.data.materials.new('MAT_{}_{}')\n"), groupIdx, matIdx);
out.format(FMT_STRING("new_material = bpy.data.materials.new('MAT_{}_{}')\n"), groupIdx, matIdx);
out << "new_material.use_fake_user = True\n"
"new_material.use_nodes = True\n"
"new_material.use_backface_culling = True\n"
@ -458,7 +458,7 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
"\n";
/* Material Flags */
out.format(fmt("new_material.retro_depth_sort = {}\n"
out.format(FMT_STRING("new_material.retro_depth_sort = {}\n"
"new_material.retro_alpha_test = {}\n"
"new_material.retro_samus_reflection = {}\n"
"new_material.retro_depth_write = {}\n"
@ -477,7 +477,7 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
/* Texture Indices */
out << "tex_maps = []\n";
for (atUint32 idx : material.textureIdxs)
out.format(fmt("tex_maps.append(texmap_list[{}])\n"), idx);
out.format(FMT_STRING("tex_maps.append(texmap_list[{}])\n"), idx);
/* KColor entries */
if (material.flags.konstValuesEnabled()) {
@ -784,7 +784,7 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
break;
default:
_DescribeTEV(material);
Log.report(logvisor::Fatal, fmt("Unable to resolve shader hash {:08X}\n"), hash);
Log.report(logvisor::Fatal, FMT_STRING("Unable to resolve shader hash {:08X}\n"), hash);
break;
}
@ -1132,7 +1132,7 @@ MaterialSet::Material::UVAnimation::UVAnimation(const std::string& gameFunction,
else if (gameFunction == "RetroUVMode2Node") {
mode = Mode::Scroll;
if (gameArgs.size() < 2)
Log.report(logvisor::Fatal, fmt("Mode2 UV anim requires 2 vector arguments"));
Log.report(logvisor::Fatal, FMT_STRING("Mode2 UV anim requires 2 vector arguments"));
vals[0] = gameArgs[0].simd[0];
vals[1] = gameArgs[0].simd[1];
vals[2] = gameArgs[1].simd[0];
@ -1140,13 +1140,13 @@ MaterialSet::Material::UVAnimation::UVAnimation(const std::string& gameFunction,
} else if (gameFunction == "RetroUVMode3Node") {
mode = Mode::Rotation;
if (gameArgs.size() < 2)
Log.report(logvisor::Fatal, fmt("Mode3 UV anim requires 2 arguments"));
Log.report(logvisor::Fatal, FMT_STRING("Mode3 UV anim requires 2 arguments"));
vals[0] = gameArgs[0].simd[0];
vals[1] = gameArgs[1].simd[0];
} else if (gameFunction == "RetroUVMode4Node") {
mode = Mode::HStrip;
if (gameArgs.size() < 4)
Log.report(logvisor::Fatal, fmt("Mode4 UV anim requires 4 arguments"));
Log.report(logvisor::Fatal, FMT_STRING("Mode4 UV anim requires 4 arguments"));
vals[0] = gameArgs[0].simd[0];
vals[1] = gameArgs[1].simd[0];
vals[2] = gameArgs[2].simd[0];
@ -1154,7 +1154,7 @@ MaterialSet::Material::UVAnimation::UVAnimation(const std::string& gameFunction,
} else if (gameFunction == "RetroUVMode5Node") {
mode = Mode::VStrip;
if (gameArgs.size() < 4)
Log.report(logvisor::Fatal, fmt("Mode5 UV anim requires 4 arguments"));
Log.report(logvisor::Fatal, FMT_STRING("Mode5 UV anim requires 4 arguments"));
vals[0] = gameArgs[0].simd[0];
vals[1] = gameArgs[1].simd[0];
vals[2] = gameArgs[2].simd[0];
@ -1164,11 +1164,11 @@ MaterialSet::Material::UVAnimation::UVAnimation(const std::string& gameFunction,
else if (gameFunction == "RetroUVMode7NodeN") {
mode = Mode::CylinderEnvironment;
if (gameArgs.size() < 2)
Log.report(logvisor::Fatal, fmt("Mode7 UV anim requires 2 arguments"));
Log.report(logvisor::Fatal, FMT_STRING("Mode7 UV anim requires 2 arguments"));
vals[0] = gameArgs[0].simd[0];
vals[1] = gameArgs[1].simd[0];
} else
Log.report(logvisor::Fatal, fmt("unsupported UV anim '{}'"), gameFunction);
Log.report(logvisor::Fatal, FMT_STRING("unsupported UV anim '{}'"), gameFunction);
}
template <class Op>

View File

@ -506,9 +506,9 @@ struct MaterialSet : BigDNA {
continue;
}
if (setIdx < 0)
texEntry->name = fmt::format(fmt("{}_{}_{}"), prefix, matIdx, stageIdx);
texEntry->name = fmt::format(FMT_STRING("{}_{}_{}"), prefix, matIdx, stageIdx);
else
texEntry->name = fmt::format(fmt("{}_{}_{}_{}"), prefix, setIdx, matIdx, stageIdx);
texEntry->name = fmt::format(FMT_STRING("{}_{}_{}_{}"), prefix, setIdx, matIdx, stageIdx);
if (mat.flags.lightmap() && stageIdx == 0) {
texEntry->name += "light";

View File

@ -8,7 +8,7 @@ void CSKR::weightVertex(hecl::blender::PyOutStream& os, const CINF& cinf, atUint
for (const SkinningRule& rule : skinningRules) {
if (idx >= accum && idx < accum + rule.vertCount)
for (const SkinningRule::Weight& weight : rule.weights)
os.format(fmt("vert[dvert_lay][{}] = {}\n"), cinf.getBoneIdxFromId(weight.boneId), weight.weight);
os.format(FMT_STRING("vert[dvert_lay][{}] = {}\n"), cinf.getBoneIdxFromId(weight.boneId), weight.weight);
accum += rule.vertCount;
}
}

View File

@ -44,8 +44,8 @@ bool CSNG::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) {
r.emplace(songsPath.getAbsolutePath());
athena::io::YAMLDocWriter ydw("amuse::Songs", r ? &*r : nullptr);
r = std::nullopt;
ydw.writeString(fmt::format(fmt("{:04X}"), head.midiSetupId),
fmt::format(fmt("../MidiData/{}"), midPath.getLastComponentUTF8()));
ydw.writeString(fmt::format(FMT_STRING("{:04X}"), head.midiSetupId),
fmt::format(FMT_STRING("../MidiData/{}"), midPath.getLastComponentUTF8()));
athena::io::FileWriter w(songsPath.getAbsolutePath());
ydw.finish(&w);

View File

@ -30,7 +30,7 @@ void DCLN::Collision::Node::sendToBlender(hecl::blender::PyOutStream& os) const
void DCLN::sendToBlender(hecl::blender::Connection& conn, std::string_view entryName) {
/* Open Py Stream and read sections */
hecl::blender::PyOutStream os = conn.beginPythonOut(true);
os.format(fmt(
os.format(FMT_STRING(
"import bpy\n"
"import bmesh\n"
"from mathutils import Vector, Matrix\n"

View File

@ -154,7 +154,7 @@ void PAKBridge::build() {
std::string idStr = area.areaMREAId.toString();
areaDeps.name = hecl::SystemString(_SYS_STR("MREA_")) + hecl::SystemStringConv(idStr).c_str();
}
hecl::SystemString num = fmt::format(fmt(_SYS_STR("{:02d} ")), ai);
hecl::SystemString num = fmt::format(FMT_STRING(_SYS_STR("{:02d} ")), ai);
areaDeps.name = num + areaDeps.name;
std::string lowerName(hecl::SystemUTF8Conv(areaDeps.name).str());
@ -178,7 +178,7 @@ void PAKBridge::build() {
layer.active = layerFlags.flags >> (l - 1) & 0x1;
layer.name = hecl::StringUtils::TrimWhitespace(layer.name);
num = fmt::format(fmt(_SYS_STR("{:02d} ")), l - 1);
num = fmt::format(FMT_STRING(_SYS_STR("{:02d} ")), l - 1);
layer.name = num + layer.name;
layer.resources.reserve(area.depLayers[l] - r);
@ -210,35 +210,35 @@ void PAKBridge::addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssoci
for (const ANCS::CharacterSet::CharacterInfo& ci : ancs.characterSet.characters) {
charAssoc.m_cmdlRigs[ci.cmdl] = {ci.cskr, ci.cinf};
charAssoc.m_cskrToCharacter[ci.cskr] =
std::make_pair(entry.id, fmt::format(fmt("{}_{}.CSKR"), ci.name, ci.cskr));
std::make_pair(entry.id, fmt::format(FMT_STRING("{}_{}.CSKR"), ci.name, ci.cskr));
PAK::Entry* cmdlEnt = (PAK::Entry*)m_pak.lookupEntry(ci.cmdl);
PAK::Entry* cskrEnt = (PAK::Entry*)m_pak.lookupEntry(ci.cskr);
PAK::Entry* cinfEnt = (PAK::Entry*)m_pak.lookupEntry(ci.cinf);
cmdlEnt->name = fmt::format(fmt("ANCS_{}_{}_model"), id, ci.name);
cskrEnt->name = fmt::format(fmt("ANCS_{}_{}_skin"), id, ci.name);
cinfEnt->name = fmt::format(fmt("ANCS_{}_{}_skel"), id, ci.name);
cmdlEnt->name = fmt::format(FMT_STRING("ANCS_{}_{}_model"), id, ci.name);
cskrEnt->name = fmt::format(FMT_STRING("ANCS_{}_{}_skin"), id, ci.name);
cinfEnt->name = fmt::format(FMT_STRING("ANCS_{}_{}_skel"), id, ci.name);
if (ci.cmdlIce.isValid() && ci.cskrIce.isValid()) {
charAssoc.m_cmdlRigs[ci.cmdlIce] = {ci.cskrIce, ci.cinf};
charAssoc.m_cskrToCharacter[ci.cskrIce] =
std::make_pair(entry.id, fmt::format(fmt("{}.ICE_{}.CSKR"), ci.name, ci.cskrIce));
std::make_pair(entry.id, fmt::format(FMT_STRING("{}.ICE_{}.CSKR"), ci.name, ci.cskrIce));
PAK::Entry* cmdlEnt = (PAK::Entry*)m_pak.lookupEntry(ci.cmdlIce);
PAK::Entry* cskrEnt = (PAK::Entry*)m_pak.lookupEntry(ci.cskrIce);
cmdlEnt->name = fmt::format(fmt("ANCS_{}_{}_icemodel"), id, ci.name);
cskrEnt->name = fmt::format(fmt("ANCS_{}_{}_iceskin"), id, ci.name);
cmdlEnt->name = fmt::format(FMT_STRING("ANCS_{}_{}_icemodel"), id, ci.name);
cskrEnt->name = fmt::format(FMT_STRING("ANCS_{}_{}_iceskin"), id, ci.name);
}
}
std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID32>> animInfo;
ancs.getAnimationResInfo(&pakRouter, animInfo);
for (auto& [animIdx, animResInfo] : animInfo) {
PAK::Entry* animEnt = (PAK::Entry*)m_pak.lookupEntry(animResInfo.animId);
animEnt->name = fmt::format(fmt("ANCS_{}_{}"), id, animResInfo.name);
animEnt->name = fmt::format(FMT_STRING("ANCS_{}_{}"), id, animResInfo.name);
charAssoc.m_cskrToCharacter[animResInfo.animId] =
std::make_pair(entry.id, fmt::format(fmt("{}_{}.ANIM"), animResInfo.name, animResInfo.animId));
std::make_pair(entry.id, fmt::format(FMT_STRING("{}_{}.ANIM"), animResInfo.name, animResInfo.animId));
if (animResInfo.evntId.isValid()) {
PAK::Entry* evntEnt = (PAK::Entry*)m_pak.lookupEntry(animResInfo.evntId);
evntEnt->name = fmt::format(fmt("ANCS_{}_{}_evnt"), id, animResInfo.name);
evntEnt->name = fmt::format(FMT_STRING("ANCS_{}_{}_evnt"), id, animResInfo.name);
charAssoc.m_cskrToCharacter[animResInfo.evntId] =
std::make_pair(entry.id, fmt::format(fmt("{}_{}.evnt.yaml"), animResInfo.name, animResInfo.evntId));
std::make_pair(entry.id, fmt::format(FMT_STRING("{}_{}.evnt.yaml"), animResInfo.name, animResInfo.evntId));
}
}
} else if (entry.type == FOURCC('MREA')) {
@ -276,7 +276,7 @@ void PAKBridge::addMAPATransforms(PAKRouter<PAKBridge>& pakRouter,
if (mlvl.worldNameId.isValid())
pathOverrides[mlvl.worldNameId] = hecl::ProjectPath(mlvlDirPath,
fmt::format(fmt(_SYS_STR("!name_{}.yaml")), mlvl.worldNameId));
fmt::format(FMT_STRING(_SYS_STR("!name_{}.yaml")), mlvl.worldNameId));
for (const MLVL::Area& area : mlvl.areas) {
{
@ -293,7 +293,7 @@ void PAKBridge::addMAPATransforms(PAKRouter<PAKBridge>& pakRouter,
hecl::ProjectPath areaDirPath = pakRouter.getWorking(area.areaMREAId).getParentPath();
if (area.areaNameId.isValid())
pathOverrides[area.areaNameId] = hecl::ProjectPath(areaDirPath,
fmt::format(fmt(_SYS_STR("!name_{}.yaml")), area.areaNameId));
fmt::format(FMT_STRING(_SYS_STR("!name_{}.yaml")), area.areaNameId));
}
if (mlvl.worldMap.isValid()) {

View File

@ -93,7 +93,7 @@ void FRME::Widget::Enumerate<BigDNA::Read>(athena::io::IStreamReader& __dna_read
widgetInfo = std::make_unique<SLGPInfo>();
break;
default:
Log.report(logvisor::Fatal, fmt(_SYS_STR("Unsupported FRME widget type {}")), type);
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unsupported FRME widget type {}")), type);
}
/* widgetInfo */
@ -174,7 +174,7 @@ void FRME::Widget::CAMRInfo::Enumerate<BigDNA::Read>(athena::io::IStreamReader&
} else if (projectionType == ProjectionType::Orthographic) {
projection = std::make_unique<OrthographicProjection>();
} else {
Log.report(logvisor::Fatal, fmt(_SYS_STR("Invalid CAMR projection mode! {}")), int(projectionType));
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Invalid CAMR projection mode! {}")), int(projectionType));
}
projection->read(__dna_reader);
@ -183,9 +183,9 @@ void FRME::Widget::CAMRInfo::Enumerate<BigDNA::Read>(athena::io::IStreamReader&
template <>
void FRME::Widget::CAMRInfo::Enumerate<BigDNA::Write>(athena::io::IStreamWriter& __dna_writer) {
if (!projection)
Log.report(logvisor::Fatal, fmt(_SYS_STR("Invalid CAMR projection object!")));
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Invalid CAMR projection object!")));
if (projection->type != projectionType)
Log.report(logvisor::Fatal, fmt(_SYS_STR("CAMR projection type does not match actual projection type!")));
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("CAMR projection type does not match actual projection type!")));
__dna_writer.writeUint32Big(atUint32(projectionType));
projection->write(__dna_writer);
@ -306,7 +306,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
" bpy.context.scene.collection.objects.link(ob_new)\n"
" return ob_new\n";
os.format(fmt(
os.format(FMT_STRING(
"bpy.context.scene.name = '{}'\n"
"bpy.context.scene.render.resolution_x = 640\n"
"bpy.context.scene.render.resolution_y = 480\n"
@ -321,7 +321,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
"angle = Quaternion((1.0, 0.0, 0.0), 0)\n";
if (w.type == SBIG('CAMR')) {
using CAMRInfo = Widget::CAMRInfo;
os.format(fmt(
os.format(FMT_STRING(
"cam = bpy.data.cameras.new(name='{}')\n"
"binding = cam\n"),
w.header.name);
@ -329,7 +329,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
if (info->projectionType == CAMRInfo::ProjectionType::Orthographic) {
CAMRInfo::OrthographicProjection* proj =
static_cast<CAMRInfo::OrthographicProjection*>(info->projection.get());
os.format(fmt(
os.format(FMT_STRING(
"cam.type = 'ORTHO'\n"
"cam.ortho_scale = {}\n"
"cam.clip_start = {}\n"
@ -337,7 +337,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
std::fabs(proj->right - proj->left), proj->znear, proj->zfar);
} else if (info->projectionType == CAMRInfo::ProjectionType::Perspective) {
CAMRInfo::PerspectiveProjection* proj = static_cast<CAMRInfo::PerspectiveProjection*>(info->projection.get());
os.format(fmt(
os.format(FMT_STRING(
"cam.type = 'PERSP'\n"
"cam.lens_unit = 'FOV'\n"
"cam.clip_start = {}\n"
@ -345,10 +345,10 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
"bpy.context.scene.render.resolution_x = 480 * {}\n"),
proj->znear, proj->zfar, proj->aspect);
if (proj->aspect > 1.f)
os.format(fmt("cam.angle = math.atan2({}, 1.0 / math.tan(math.radians({} / 2.0))) * 2.0\n"), proj->aspect,
os.format(FMT_STRING("cam.angle = math.atan2({}, 1.0 / math.tan(math.radians({} / 2.0))) * 2.0\n"), proj->aspect,
proj->fov);
else
os.format(fmt("cam.angle = math.radians({})\n"), proj->fov);
os.format(FMT_STRING("cam.angle = math.radians({})\n"), proj->fov);
}
}
os << "angle = Quaternion((1.0, 0.0, 0.0), math.radians(90.0))\n";
@ -358,7 +358,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
switch (info->type) {
case LITEInfo::ELightType::LocalAmbient: {
zeus::simd_floats colorF(w.header.color.simd);
os.format(fmt(
os.format(FMT_STRING(
"bg_node.inputs[0].default_value = ({},{},{},1.0)\n"
"bg_node.inputs[1].default_value = {}\n"),
colorF[0], colorF[1], colorF[2], info->distQ / 8.0);
@ -370,7 +370,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
[[fallthrough]];
default: {
zeus::simd_floats colorF(w.header.color.simd);
os.format(fmt(
os.format(FMT_STRING(
"lamp = bpy.data.lights.new(name='{}', type='POINT')\n"
"lamp.color = ({}, {}, {})\n"
"lamp.hecl_falloff_constant = {}\n"
@ -384,7 +384,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
w.header.name, colorF[0], colorF[1], colorF[2], info->distC, info->distL, info->distQ, info->angC,
info->angL, info->angQ, info->loadedIdx);
if (info->type == LITEInfo::ELightType::Spot)
os.format(fmt(
os.format(FMT_STRING(
"lamp.type = 'SPOT'\n"
"lamp.spot_size = {}\n"),
info->cutoff);
@ -413,7 +413,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
if (resPath.size()) {
hecl::SystemUTF8Conv resPathView(resPath);
os.format(fmt(
os.format(FMT_STRING(
"if '{}' in bpy.data.images:\n"
" image = bpy.data.images['{}']\n"
"else:\n"
@ -424,7 +424,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
os << "image = None\n";
}
os.format(fmt(
os.format(FMT_STRING(
"material = bpy.data.materials.new('{}')\n"
"material.use_nodes = True\n"
"new_nodetree = material.node_tree\n"
@ -445,7 +445,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
else
ti = i;
zeus::simd_floats f(info->quadCoords[ti].simd);
os.format(fmt("verts.append(bm.verts.new(({},{},{})))\n"), f[0], f[1], f[2]);
os.format(FMT_STRING("verts.append(bm.verts.new(({},{},{})))\n"), f[0], f[1], f[2]);
}
os << "bm.faces.new(verts)\n"
"bm.loops.layers.uv.new('UV')\n"
@ -459,9 +459,9 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
else
ti = i;
zeus::simd_floats f(info->uvCoords[ti].simd);
os.format(fmt("bm.verts[{}].link_loops[0][bm.loops.layers.uv[0]].uv = ({},{})\n"), i, f[0], f[1]);
os.format(FMT_STRING("bm.verts[{}].link_loops[0][bm.loops.layers.uv[0]].uv = ({},{})\n"), i, f[0], f[1]);
}
os.format(fmt(
os.format(FMT_STRING(
"binding = bpy.data.meshes.new('{}')\n"
"bm.to_mesh(binding)\n"
"bm.free()\n"
@ -471,7 +471,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
}
zeus::simd_floats colorF(w.header.color.simd);
os.format(fmt(
os.format(FMT_STRING(
"frme_obj = bpy.data.objects.new(name='{}', object_data=binding)\n"
"frme_obj.pass_index = {}\n"
"parentName = '{}'\n"
@ -501,7 +501,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
os.linkMesh(modelPath.getAbsolutePathUTF8(), pakRouter.getBestEntryName(*cmdlE));
os.format(fmt("frme_obj.retro_model_light_mask = {}\n"), info->lightMask);
os.format(FMT_STRING("frme_obj.retro_model_light_mask = {}\n"), info->lightMask);
os << "print(obj.name)\n"
"copy_obj = duplicateObject(obj)\n"
"copy_obj.parent = frme_obj\n"
@ -516,7 +516,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
using PANEInfo = Widget::PANEInfo;
if (PANEInfo* info = static_cast<PANEInfo*>(w.widgetInfo.get())) {
zeus::simd_floats f(info->scaleCenter.simd);
os.format(fmt(
os.format(FMT_STRING(
"frme_obj.retro_pane_dimensions = ({},{})\n"
"frme_obj.retro_pane_scale_center = ({},{},{})\n"),
info->xDim, info->zDim, f[0], f[1], f[2]);
@ -533,7 +533,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
zeus::simd_floats fillF(info->fillColor.simd);
zeus::simd_floats outlineF(info->outlineColor.simd);
zeus::simd_floats extentF(info->blockExtent.simd);
os.format(fmt(
os.format(FMT_STRING(
"frme_obj.retro_pane_dimensions = ({},{})\n"
"frme_obj.retro_pane_scale_center = ({},{},{})\n"
"frme_obj.retro_textpane_font_path = '{}'\n"
@ -557,7 +557,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
} else if (w.type == SBIG('TBGP')) {
using TBGPInfo = Widget::TBGPInfo;
if (TBGPInfo* info = static_cast<TBGPInfo*>(w.widgetInfo.get())) {
os.format(fmt(
os.format(FMT_STRING(
"frme_obj.retro_tablegroup_elem_count = {}\n"
"frme_obj.retro_tablegroup_elem_default = {}\n"
"frme_obj.retro_tablegroup_wraparound = {}\n"),
@ -566,12 +566,12 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
} else if (w.type == SBIG('GRUP')) {
using GRUPInfo = Widget::GRUPInfo;
if (GRUPInfo* info = static_cast<GRUPInfo*>(w.widgetInfo.get())) {
os.format(fmt("frme_obj.retro_group_default_worker = {}\n"), info->defaultWorker);
os.format(FMT_STRING("frme_obj.retro_group_default_worker = {}\n"), info->defaultWorker);
}
} else if (w.type == SBIG('SLGP')) {
using SLGPInfo = Widget::SLGPInfo;
if (SLGPInfo* info = static_cast<SLGPInfo*>(w.widgetInfo.get())) {
os.format(fmt(
os.format(FMT_STRING(
"frme_obj.retro_slider_min = {}\n"
"frme_obj.retro_slider_max = {}\n"
"frme_obj.retro_slider_default = {}\n"
@ -583,12 +583,12 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
if (ENRGInfo* info = static_cast<ENRGInfo*>(w.widgetInfo.get())) {
hecl::ProjectPath txtrPath = pakRouter.getWorking(info->texture);
if (txtrPath)
os.format(fmt("frme_obj.retro_energybar_texture_path = '{}'\n"), txtrPath.getRelativePathUTF8());
os.format(FMT_STRING("frme_obj.retro_energybar_texture_path = '{}'\n"), txtrPath.getRelativePathUTF8());
}
} else if (w.type == SBIG('METR')) {
using METRInfo = Widget::METRInfo;
if (METRInfo* info = static_cast<METRInfo*>(w.widgetInfo.get())) {
os.format(fmt(
os.format(FMT_STRING(
"frme_obj.retro_meter_no_round_up = {}\n"
"frme_obj.retro_meter_max_capacity = {}\n"
"frme_obj.retro_meter_worker_count = {}\n"),
@ -600,7 +600,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
for (int i = 0; i < 3; ++i)
w.basis[i].simd.copy_to(xfMtxF[i]);
zeus::simd_floats originF(w.origin.simd);
os.format(fmt(
os.format(FMT_STRING(
"mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"frme_obj.rotation_mode = 'QUATERNION'\n"

View File

@ -137,7 +137,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
if (!areaPath.isFile())
continue;
Log.report(logvisor::Info, fmt(_SYS_STR("Visiting {}")), area.path.getRelativePath());
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Visiting {}")), area.path.getRelativePath());
hecl::ProjectPath memRelayPath(area.path, _SYS_STR("!memoryrelays.yaml"));
@ -311,7 +311,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
}
if (!areaInit)
Log.report(logvisor::Info, fmt(_SYS_STR("No layer directories for area {}")), area.path.getRelativePath());
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("No layer directories for area {}")), area.path.getRelativePath());
/* Build deplist */
MLVL::Area& areaOut = mlvl.areas.back();

View File

@ -20,7 +20,7 @@ namespace DataSpec::DNAMP1 {
void MREA::ReadBabeDeadToBlender_1_2(hecl::blender::PyOutStream& os, athena::io::IStreamReader& rs) {
atUint32 bdMagic = rs.readUint32Big();
if (bdMagic != 0xBABEDEAD)
Log.report(logvisor::Fatal, fmt("invalid BABEDEAD magic"));
Log.report(logvisor::Fatal, FMT_STRING("invalid BABEDEAD magic"));
os << "bpy.context.scene.world.use_nodes = True\n"
"bg_node = bpy.context.scene.world.node_tree.nodes['Background']\n"
"bg_node.inputs[1].default_value = 0.0\n";
@ -202,7 +202,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
"from mathutils import Vector\n"
"bpy.context.scene.render.fps = 60\n"
"\n";
os.format(fmt("bpy.context.scene.name = '{}'\n"),
os.format(FMT_STRING("bpy.context.scene.name = '{}'\n"),
pakRouter.getBestEntryName(entry, false));
DNACMDL::InitGeomBlenderContext(os, dataSpec.getMasterShaderPath());
MaterialSet::RegisterMaterialProps(os);
@ -244,7 +244,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
rs.seek(secStart + head.secSizes[curSec++], athena::SeekOrigin::Begin);
curSec += DNACMDL::ReadGeomSectionsToBlender<PAKRouter<PAKBridge>, MaterialSet, RigPair, DNACMDL::SurfaceHeader_1>(
os, rs, pakRouter, entry, dummy, true, true, vertAttribs, m, head.secCount, 0, &head.secSizes[curSec]);
os.format(fmt(
os.format(FMT_STRING(
"obj.retro_disable_enviro_visor = {}\n"
"obj.retro_disable_thermal_visor = {}\n"
"obj.retro_disable_xray_visor = {}\n"
@ -314,7 +314,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
"bpy.context.view_layer.layer_collection.children['Collision'].hide_viewport = True\n";
/* Link MLVL scene as background */
os.linkBackground(fmt::format(fmt("//../!world_{}.blend"),
os.linkBackground(fmt::format(FMT_STRING("//../!world_{}.blend"),
pakRouter.getCurrentBridge().getLevelId()), "World"sv);
os.centerView();
@ -332,7 +332,7 @@ void MREA::Name(const SpecBase& dataSpec, PAKEntryReadStream& rs, PAKRouter<PAKB
atUint64 secStart = rs.position();
MaterialSet matSet;
matSet.read(rs);
matSet.nameTextures(pakRouter, fmt::format(fmt("MREA_{}"), entry.id).c_str(), -1);
matSet.nameTextures(pakRouter, fmt::format(FMT_STRING("MREA_{}"), entry.id).c_str(), -1);
rs.seek(secStart + head.secSizes[0], athena::SeekOrigin::Begin);
/* Skip to SCLY */
@ -700,12 +700,12 @@ bool MREA::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
#if _WIN32
VisiGenPath += _SYS_STR(".exe");
#endif
hecl::SystemString thrIdx = fmt::format(fmt(_SYS_STR("{}")), hecl::ClientProcess::GetThreadWorkerIdx());
hecl::SystemString thrIdx = fmt::format(FMT_STRING(_SYS_STR("{}")), hecl::ClientProcess::GetThreadWorkerIdx());
hecl::SystemString parPid;
#if _WIN32
parPid = fmt::format(fmt(_SYS_STR("{}")), reinterpret_cast<unsigned long long>(GetCurrentProcess()));
parPid = fmt::format(FMT_STRING(_SYS_STR("{}")), reinterpret_cast<unsigned long long>(GetCurrentProcess()));
#else
parPid = fmt::format(fmt(_SYS_STR("{}")), (unsigned long long)getpid());
parPid = fmt::format(FMT_STRING(_SYS_STR("{}")), (unsigned long long)getpid());
#endif
const hecl::SystemChar* args[] = {VisiGenPath.c_str(),
visiIntOut.getAbsolutePath().data(),
@ -720,7 +720,7 @@ bool MREA::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
r.readBytesToBuf(secs.back().data(), length);
visiGood = true;
} else {
Log.report(logvisor::Fatal, fmt(_SYS_STR("Unable to launch {}")), VisiGenPath);
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to launch {}")), VisiGenPath);
}
}
#endif

View File

@ -10,7 +10,7 @@ template <>
void PAK::Enumerate<BigDNA::Read>(typename Read::StreamT& reader) {
atUint32 version = reader.readUint32Big();
if (version != 0x00030005)
Log.report(logvisor::Fatal, fmt("unexpected PAK magic"));
Log.report(logvisor::Fatal, FMT_STRING("unexpected PAK magic"));
reader.readUint32Big();
atUint32 nameCount = reader.readUint32Big();
@ -147,6 +147,7 @@ const PAK::Entry* PAK::lookupEntry(const UniqueID32& id) const {
}
const PAK::Entry* PAK::lookupEntry(std::string_view name) const {
// TODO: Heterogeneous lookup when C++20 available
auto result = m_nameMap.find(name.data());
if (result != m_nameMap.end()) {
auto result1 = m_entries.find(result->second);
@ -164,19 +165,19 @@ std::string PAK::bestEntryName(const nod::Node& pakNode, const Entry& entry, std
AGSC::Header header;
header.read(rs);
catalogueName = header.groupName;
return fmt::format(fmt("{}_{}"), header.groupName, entry.id);
return fmt::format(FMT_STRING("{}_{}"), header.groupName, entry.id);
}
/* Prefer named entries first */
for (const NameEntry& nentry : m_nameEntries) {
if (nentry.id == entry.id) {
catalogueName = nentry.name;
return fmt::format(fmt("{}_{}"), nentry.name, entry.id);
return fmt::format(FMT_STRING("{}_{}"), nentry.name, entry.id);
}
}
/* Otherwise return ID format string */
return fmt::format(fmt("{}_{}"), entry.type, entry.id);
return fmt::format(FMT_STRING("{}_{}"), entry.type, entry.id);
}
} // namespace DataSpec::DNAMP1

View File

@ -87,13 +87,13 @@ struct SCAN : BigDNA {
scan.read(rs);
if (scan.string.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(scan.string);
ent->name = fmt::format(fmt("SCAN_{}_strg"), entry.id);
ent->name = fmt::format(FMT_STRING("SCAN_{}_strg"), entry.id);
}
for (int i = 0; i < 4; ++i) {
const Texture& tex = scan.textures[i];
if (tex.texture.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(tex.texture);
ent->name = fmt::format(fmt("SCAN_{}_tex{}"), entry.id, i + 1);
ent->name = fmt::format(FMT_STRING("SCAN_{}_tex{}"), entry.id, i + 1);
}
}
}

View File

@ -115,12 +115,12 @@ void SCLY::ScriptLayer::Enumerate<BigDNA::Read>(athena::io::IStreamReader& rs) {
size_t actualLen = rs.position() - start;
if (actualLen != len)
Log.report(logvisor::Fatal,
fmt(_SYS_STR("Error while reading object of type 0x{:02X}, did not read the expected amount of "
FMT_STRING(_SYS_STR("Error while reading object of type 0x{:02X}, did not read the expected amount of "
"data, read 0x{:x}, expected 0x{:x}")),
(atUint32)type, actualLen, len);
rs.seek(start + len, athena::SeekOrigin::Begin);
} else {
Log.report(logvisor::Fatal, fmt(_SYS_STR("Unable to find type 0x{:X} in object database")), (atUint32)type);
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to find type 0x{:X} in object database")), (atUint32)type);
}
}
}
@ -145,7 +145,7 @@ void SCLY::ScriptLayer::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& r
obj->type = type;
objects.push_back(std::move(obj));
} else
Log.report(logvisor::Fatal, fmt(_SYS_STR("Unable to find type 0x{:X} in object database")), (atUint32)type);
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to find type 0x{:X} in object database")), (atUint32)type);
}
}
} else
@ -165,7 +165,7 @@ void SCLY::ScriptLayer::Enumerate<BigDNA::Write>(athena::io::IStreamWriter& ws)
obj->write(ws);
auto wrote = ws.position() - start;
if (wrote != expLen)
Log.report(logvisor::Error, fmt("expected writing {} byte SCLY obj; wrote {}"), expLen, wrote);
Log.report(logvisor::Error, FMT_STRING("expected writing {} byte SCLY obj; wrote {}"), expLen, wrote);
}
}

View File

@ -62,7 +62,7 @@ static std::u16string_view::const_iterator CookTextureList(std::u16string& ret,
while (true) {
auto end = str.find_first_of(u",;", it - str.begin());
if (end == std::u16string::npos)
Log.report(logvisor::Fatal, fmt("Missing comma/semicolon token while pasing font tag"));
Log.report(logvisor::Fatal, FMT_STRING("Missing comma/semicolon token while pasing font tag"));
auto endIt = str.begin() + end;
hecl::ProjectPath path =
UniqueIDBridge::MakePathFromString<UniqueID32>(hecl::Char16ToUTF8(std::u16string(it, endIt)));
@ -92,7 +92,7 @@ static std::u16string_view::const_iterator GatherTextureList(std::vector<hecl::P
while (true) {
auto end = str.find_first_of(u",;", it - str.begin());
if (end == std::u16string::npos)
Log.report(logvisor::Fatal, fmt("Missing comma/semicolon token while pasing font tag"));
Log.report(logvisor::Fatal, FMT_STRING("Missing comma/semicolon token while pasing font tag"));
auto endIt = str.begin() + end;
hecl::ProjectPath path =
UniqueIDBridge::MakePathFromString<UniqueID32>(hecl::Char16ToUTF8(std::u16string(it, endIt)));
@ -198,7 +198,7 @@ static std::u16string CookString(std::u16string_view str) {
it += 5;
auto scpos = str.find(u';', it - str.begin());
if (scpos == std::u16string::npos)
Log.report(logvisor::Fatal, fmt("Missing semicolon token while pasing font tag"));
Log.report(logvisor::Fatal, FMT_STRING("Missing semicolon token while pasing font tag"));
hecl::ProjectPath path =
UniqueIDBridge::MakePathFromString<UniqueID32>(hecl::Char16ToUTF8(std::u16string(it, str.begin() + scpos)));
ret.append(hecl::UTF8ToChar16(UniqueID32(path).toString()));
@ -249,7 +249,7 @@ void STRG::gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const {
it += 5;
auto scpos = str.find(u';', it - strView.begin());
if (scpos == std::u16string::npos)
Log.report(logvisor::Fatal, fmt("Missing semicolon token while pasing font tag"));
Log.report(logvisor::Fatal, FMT_STRING("Missing semicolon token while pasing font tag"));
hecl::ProjectPath path = UniqueIDBridge::MakePathFromString<UniqueID32>(
hecl::Char16ToUTF8(std::u16string(it, strView.begin() + scpos)));
if (path)
@ -311,11 +311,11 @@ template <>
void STRG::Enumerate<BigDNA::Read>(typename Read::StreamT& reader) {
atUint32 magic = reader.readUint32Big();
if (magic != 0x87654321)
Log.report(logvisor::Error, fmt("invalid STRG magic"));
Log.report(logvisor::Error, FMT_STRING("invalid STRG magic"));
atUint32 version = reader.readUint32Big();
if (version != 0)
Log.report(logvisor::Error, fmt("invalid STRG version"));
Log.report(logvisor::Error, FMT_STRING("invalid STRG version"));
_read(reader);
}
@ -412,22 +412,22 @@ void STRG::Enumerate<BigDNA::ReadYaml>(typename ReadYaml::StreamT& reader) {
continue;
if (lang.first.size() != 4) {
Log.report(logvisor::Warning, fmt("STRG language string '{}' must be exactly 4 characters; skipping"), lang.first);
Log.report(logvisor::Warning, FMT_STRING("STRG language string '{}' must be exactly 4 characters; skipping"), lang.first);
return;
}
if (lang.second->m_type != YAML_SEQUENCE_NODE) {
Log.report(logvisor::Warning, fmt("STRG language string '{}' must contain a sequence; skipping"), lang.first);
Log.report(logvisor::Warning, FMT_STRING("STRG language string '{}' must contain a sequence; skipping"), lang.first);
return;
}
for (const auto& str : lang.second->m_seqChildren) {
if (str->m_type != YAML_SCALAR_NODE) {
Log.report(logvisor::Warning, fmt("STRG language '{}' must contain all scalars; skipping"), lang.first);
Log.report(logvisor::Warning, FMT_STRING("STRG language '{}' must contain all scalars; skipping"), lang.first);
return;
}
}
}
} else {
Log.report(logvisor::Warning, fmt("STRG must have a mapping root node; skipping"));
Log.report(logvisor::Warning, FMT_STRING("STRG must have a mapping root node; skipping"));
return;
}

View File

@ -49,7 +49,7 @@ struct Babygoth : IScriptObject {
charAssoc.m_cmdlRigs[noShellModel] = {noShellSkin, cinf};
charAssoc.m_cskrToCharacter[noShellSkin] =
std::make_pair(patternedInfo.animationParameters.animationCharacterSet,
fmt::format(fmt("ATTACH.SHELLESS_{}.CSKR"), noShellSkin));
fmt::format(FMT_STRING("ATTACH.SHELLESS_{}.CSKR"), noShellSkin));
charAssoc.addAttachmentRig(patternedInfo.animationParameters.animationCharacterSet, {}, noShellModel, "SHELLESS");
}
}

View File

@ -47,7 +47,7 @@ struct Magdolite : IScriptObject {
charAssoc.m_cmdlRigs[cmdlHeadless] = {cskrHeadless, cinf};
charAssoc.m_cskrToCharacter[cskrHeadless] =
std::make_pair(patternedInfo.animationParameters.animationCharacterSet,
fmt::format(fmt("ATTACH.HEADLESS_{}.CSKR"), cskrHeadless));
fmt::format(FMT_STRING("ATTACH.HEADLESS_{}.CSKR"), cskrHeadless));
charAssoc.addAttachmentRig(patternedInfo.animationParameters.animationCharacterSet, {}, cmdlHeadless, "HEADLESS");
}
}

View File

@ -60,7 +60,7 @@ struct OmegaPirate : IScriptObject {
charAssoc.m_cmdlRigs[cmdlPhazonVeins] = {cskrPhazonVeins, cinfPhazonVeins};
charAssoc.m_cskrToCharacter[cskrPhazonVeins] =
std::make_pair(patternedInfo.animationParameters.animationCharacterSet,
fmt::format(fmt("ATTACH.VEINS_{}.CSKR"), cskrPhazonVeins));
fmt::format(FMT_STRING("ATTACH.VEINS_{}.CSKR"), cskrPhazonVeins));
charAssoc.addAttachmentRig(patternedInfo.animationParameters.animationCharacterSet, cinfPhazonVeins,
cmdlPhazonVeins, "VEINS");
}

View File

@ -380,13 +380,13 @@ struct ActorParameters : BigDNA {
if (cmdlXray.isValid() && cskrXray.isValid()) {
charAssoc.m_cmdlRigs[cmdlXray] = {cskrXray, cinf};
charAssoc.m_cskrToCharacter[cskrXray] = std::make_pair(animParms.animationCharacterSet,
fmt::format(fmt("ATTACH.XRAY_{}.CSKR"), cskrXray));
fmt::format(FMT_STRING("ATTACH.XRAY_{}.CSKR"), cskrXray));
charAssoc.addAttachmentRig(animParms.animationCharacterSet, {}, cmdlXray, "XRAY");
}
if (cmdlThermal.isValid() && cskrThermal.isValid()) {
charAssoc.m_cmdlRigs[cmdlThermal] = {cskrThermal, cinf};
charAssoc.m_cskrToCharacter[cskrThermal] =
std::make_pair(animParms.animationCharacterSet, fmt::format(fmt("ATTACH.THERMAL_{}.CSKR"), cskrThermal));
std::make_pair(animParms.animationCharacterSet, fmt::format(FMT_STRING("ATTACH.THERMAL_{}.CSKR"), cskrThermal));
charAssoc.addAttachmentRig(animParms.animationCharacterSet, {}, cmdlThermal, "THERMAL");
}
}

View File

@ -6,7 +6,7 @@ namespace DataSpec::DNAMP2 {
using ANIMOutStream = hecl::blender::ANIMOutStream;
void ANIM::IANIM::sendANIMToBlender(hecl::blender::PyOutStream& os, const DNAANIM::RigInverter<CINF>& rig) const {
os.format(fmt(
os.format(FMT_STRING(
"act.hecl_fps = round({})\n"
"act.hecl_looping = {}\n"),
(1.0f / mainInterval), looping ? "True" : "False");
@ -28,7 +28,7 @@ void ANIM::IANIM::sendANIMToBlender(hecl::blender::PyOutStream& os, const DNAANI
continue;
}
os.format(fmt("bone_string = '{}'\n"), *bName);
os.format(FMT_STRING("bone_string = '{}'\n"), *bName);
os << "action_group = act.groups.new(bone_string)\n"
"\n";
@ -134,7 +134,7 @@ void ANIM::Enumerate<BigDNA::Read>(typename Read::StreamT& reader) {
m_anim->read(reader);
break;
default:
Log.report(logvisor::Fatal, fmt("unrecognized ANIM version"));
Log.report(logvisor::Fatal, FMT_STRING("unrecognized ANIM version"));
break;
}
}

View File

@ -35,7 +35,7 @@ void CINF::sendVertexGroupsToBlender(hecl::blender::PyOutStream& os) const {
for (atUint32 bid : boneIds) {
for (const Name& name : names) {
if (name.boneId == bid) {
os.format(fmt("obj.vertex_groups.new(name='{}')\n"), name.name);
os.format(FMT_STRING("obj.vertex_groups.new(name='{}')\n"), name.name);
break;
}
}
@ -46,7 +46,7 @@ template <class PAKBridge>
void CINF::sendCINFToBlender(hecl::blender::PyOutStream& os, const typename PAKBridge::PAKType::IDType& cinfId) const {
DNAANIM::RigInverter<CINF> inverter(*this);
os.format(fmt(
os.format(FMT_STRING(
"arm = bpy.data.armatures.new('CINF_{}')\n"
"arm_obj = bpy.data.objects.new(arm.name, arm)\n"
"bpy.context.scene.collection.objects.link(arm_obj)\n"
@ -58,7 +58,7 @@ void CINF::sendCINFToBlender(hecl::blender::PyOutStream& os, const typename PAKB
for (const DNAANIM::RigInverter<CINF>::Bone& bone : inverter.getBones()) {
zeus::simd_floats originF(bone.m_origBone.origin.simd);
zeus::simd_floats tailF(bone.m_tail.mSimd);
os.format(fmt(
os.format(FMT_STRING(
"bone = arm.edit_bones.new('{}')\n"
"bone.head = ({},{},{})\n"
"bone.tail = ({},{},{})\n"
@ -73,18 +73,18 @@ void CINF::sendCINFToBlender(hecl::blender::PyOutStream& os, const typename PAKB
atUint32 nullId = bones[0].parentId;
for (const Bone& bone : bones)
if (bone.parentId != nullId)
os.format(fmt("arm_bone_table[{}].parent = arm_bone_table[{}]\n"), bone.id, bone.parentId);
os.format(FMT_STRING("arm_bone_table[{}].parent = arm_bone_table[{}]\n"), bone.id, bone.parentId);
}
} else {
for (const Bone& bone : bones)
if (bone.parentId != 97)
os.format(fmt("arm_bone_table[{}].parent = arm_bone_table[{}]\n"), bone.id, bone.parentId);
os.format(FMT_STRING("arm_bone_table[{}].parent = arm_bone_table[{}]\n"), bone.id, bone.parentId);
}
os << "bpy.ops.object.mode_set(mode='OBJECT')\n";
for (const DNAANIM::RigInverter<CINF>::Bone& bone : inverter.getBones())
os.format(fmt("arm_obj.pose.bones['{}'].rotation_mode = 'QUATERNION'\n"),
os.format(FMT_STRING("arm_obj.pose.bones['{}'].rotation_mode = 'QUATERNION'\n"),
*getBoneNameFromId(bone.m_origBone.id));
}
template void CINF::sendCINFToBlender<PAKBridge>(hecl::blender::PyOutStream& os, const UniqueID32& cinfId) const;
@ -92,7 +92,7 @@ template void CINF::sendCINFToBlender<DNAMP3::PAKBridge>(hecl::blender::PyOutStr
const UniqueID64& cinfId) const;
template <class UniqueID>
std::string CINF::GetCINFArmatureName(const UniqueID& cinfId) { return fmt::format(fmt("CINF_{}"), cinfId); }
std::string CINF::GetCINFArmatureName(const UniqueID& cinfId) { return fmt::format(FMT_STRING("CINF_{}"), cinfId); }
template std::string CINF::GetCINFArmatureName(const UniqueID32& cinfId);
template std::string CINF::GetCINFArmatureName(const UniqueID64& cinfId);
@ -185,7 +185,7 @@ bool CINF::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
return false;
auto os = conn.beginPythonOut(true);
os.format(fmt("import bpy\n"
os.format(FMT_STRING("import bpy\n"
"from mathutils import Vector\n"
"bpy.context.scene.name = 'CINF_{}'\n"
"bpy.context.scene.hecl_arm_obj = bpy.context.scene.name\n"

View File

@ -8,7 +8,7 @@ void CSKR::weightVertex(hecl::blender::PyOutStream& os, const CINF& cinf, atUint
for (const SkinningRule& rule : skinningRules) {
if (idx >= accum && idx < accum + rule.vertCount)
for (const SkinningRule::Weight& weight : rule.weights)
os.format(fmt("vert[dvert_lay][{}] = {}\n"), cinf.getBoneIdxFromId(weight.boneId), weight.weight);
os.format(FMT_STRING("vert[dvert_lay][{}] = {}\n"), cinf.getBoneIdxFromId(weight.boneId), weight.weight);
accum += rule.vertCount;
}
}

View File

@ -119,7 +119,7 @@ void PAKBridge::build() {
areaDeps.name = hecl::SystemString(_SYS_STR("MREA_")) + hecl::SystemStringConv(idStr).c_str();
}
}
hecl::SystemString num = fmt::format(fmt(_SYS_STR("{:02d} ")), ai);
hecl::SystemString num = fmt::format(FMT_STRING(_SYS_STR("{:02d} ")), ai);
areaDeps.name = num + areaDeps.name;
areaDeps.layers.reserve(area.depLayerCount - 1);
@ -130,7 +130,7 @@ void PAKBridge::build() {
layer.name = LayerName(mlvl.layerNames[layerIdx++]);
layer.active = layerFlags.flags >> (l - 1) & 0x1;
layer.name = hecl::StringUtils::TrimWhitespace(layer.name);
num = fmt::format(fmt(_SYS_STR("{:02d} ")), l - 1);
num = fmt::format(FMT_STRING(_SYS_STR("{:02d} ")), l - 1);
layer.name = num + layer.name;
layer.resources.reserve(area.depLayers[l] - r);
@ -163,11 +163,11 @@ void PAKBridge::addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssoci
for (const ANCS::CharacterSet::CharacterInfo& ci : ancs.characterSet.characters) {
charAssoc.m_cmdlRigs[ci.cmdl] = {ci.cskr, ci.cinf};
charAssoc.m_cskrToCharacter[ci.cskr] =
std::make_pair(entry.second.id, fmt::format(fmt("{}_{}.CSKR"), ci.name, ci.cskr));
std::make_pair(entry.second.id, fmt::format(FMT_STRING("{}_{}.CSKR"), ci.name, ci.cskr));
if (ci.cmdlIce.isValid()) {
charAssoc.m_cmdlRigs[ci.cmdlIce] = {ci.cskrIce, ci.cinf};
charAssoc.m_cskrToCharacter[ci.cskrIce] =
std::make_pair(entry.second.id, fmt::format(fmt("{}.ICE_{}.CSKR"), ci.name, ci.cskrIce));
std::make_pair(entry.second.id, fmt::format(FMT_STRING("{}.ICE_{}.CSKR"), ci.name, ci.cskrIce));
}
}
}
@ -202,7 +202,7 @@ void PAKBridge::addMAPATransforms(PAKRouter<PAKBridge>& pakRouter,
if (mlvl.worldNameId.isValid())
pathOverrides[mlvl.worldNameId] = hecl::ProjectPath(mlvlDirPath,
fmt::format(fmt(_SYS_STR("!name_{}.yaml")), mlvl.worldNameId));
fmt::format(FMT_STRING(_SYS_STR("!name_{}.yaml")), mlvl.worldNameId));
for (const MLVL::Area& area : mlvl.areas) {
{
@ -218,7 +218,7 @@ void PAKBridge::addMAPATransforms(PAKRouter<PAKBridge>& pakRouter,
hecl::ProjectPath areaDirPath = pakRouter.getWorking(area.areaMREAId).getParentPath();
if (area.areaNameId.isValid())
pathOverrides[area.areaNameId] = hecl::ProjectPath(areaDirPath,
fmt::format(fmt(_SYS_STR("!name_{}.yaml")), area.areaNameId));
fmt::format(FMT_STRING(_SYS_STR("!name_{}.yaml")), area.areaNameId));
}
if (mlvl.worldMap.isValid()) {

View File

@ -265,7 +265,7 @@ void DeafBabe::insertNoClimb(hecl::blender::PyOutStream& os) const {
if (edgeIdx == -1)
continue;
const Edge& edge = edgeVertConnections[edgeIdx];
os.format(fmt(
os.format(FMT_STRING(
"edge = col_bm.edges.get((col_bm.verts[{}], col_bm.verts[{}]))\n"
"if edge:\n"
" edge.seam = True\n"),

View File

@ -13,7 +13,7 @@ namespace DNAMP2 {
void MREA::StreamReader::nextBlock() {
if (m_nextBlk >= m_blkCount)
Log.report(logvisor::Fatal, fmt("MREA stream overrun"));
Log.report(logvisor::Fatal, FMT_STRING("MREA stream overrun"));
BlockInfo& info = m_blockInfos[m_nextBlk++];
@ -86,7 +86,7 @@ void MREA::StreamReader::seek(atInt64 diff, athena::SeekOrigin whence) {
}
if (target >= m_totalDecompLen)
Log.report(logvisor::Fatal, fmt("MREA stream seek overrun"));
Log.report(logvisor::Fatal, FMT_STRING("MREA stream seek overrun"));
/* Determine which block contains position */
atUint32 dAccum = 0;
@ -225,7 +225,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
/* Open Py Stream and read sections */
hecl::blender::PyOutStream os = conn.beginPythonOut(true);
os.format(fmt(
os.format(FMT_STRING(
"import bpy\n"
"import bmesh\n"
"from mathutils import Vector\n"
@ -272,7 +272,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
drs.seek(secStart + head.secSizes[curSec++], athena::SeekOrigin::Begin);
curSec += DNACMDL::ReadGeomSectionsToBlender<PAKRouter<PAKBridge>, MaterialSet, RigPair, DNACMDL::SurfaceHeader_2>(
os, drs, pakRouter, entry, dummy, true, true, vertAttribs, m, head.secCount, 0, &head.secSizes[curSec]);
os.format(fmt(
os.format(FMT_STRING(
"obj.retro_disable_enviro_visor = {}\n"
"obj.retro_disable_thermal_visor = {}\n"
"obj.retro_disable_xray_visor = {}\n"

View File

@ -11,7 +11,7 @@ std::string PAK::bestEntryName(const nod::Node& pakNode, const Entry& entry, std
AGSC::Header header;
header.read(rs);
catalogueName = header.groupName;
return fmt::format(fmt("{}_{}"), header.groupName, entry.id);
return fmt::format(FMT_STRING("{}_{}"), header.groupName, entry.id);
}
return DNAMP1::PAK::bestEntryName(pakNode, entry, catalogueName);

View File

@ -49,11 +49,11 @@ template <>
void STRG::Enumerate<BigDNA::Read>(athena::io::IStreamReader& reader) {
atUint32 magic = reader.readUint32Big();
if (magic != 0x87654321)
Log.report(logvisor::Error, fmt("invalid STRG magic"));
Log.report(logvisor::Error, FMT_STRING("invalid STRG magic"));
atUint32 version = reader.readUint32Big();
if (version != 1)
Log.report(logvisor::Error, fmt("invalid STRG version"));
Log.report(logvisor::Error, FMT_STRING("invalid STRG version"));
_read(reader);
}
@ -158,22 +158,22 @@ void STRG::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& reader) {
if (lang.first == "names")
continue;
if (lang.first.size() != 4) {
Log.report(logvisor::Warning, fmt("STRG language string '{}' must be exactly 4 characters; skipping"), lang.first);
Log.report(logvisor::Warning, FMT_STRING("STRG language string '{}' must be exactly 4 characters; skipping"), lang.first);
return;
}
if (lang.second->m_type != YAML_SEQUENCE_NODE) {
Log.report(logvisor::Warning, fmt("STRG language string '{}' must contain a sequence; skipping"), lang.first);
Log.report(logvisor::Warning, FMT_STRING("STRG language string '{}' must contain a sequence; skipping"), lang.first);
return;
}
for (const auto& str : lang.second->m_seqChildren) {
if (str->m_type != YAML_SCALAR_NODE) {
Log.report(logvisor::Warning, fmt("STRG language '{}' must contain all scalars; skipping"), lang.first);
Log.report(logvisor::Warning, FMT_STRING("STRG language '{}' must contain all scalars; skipping"), lang.first);
return;
}
}
}
} else {
Log.report(logvisor::Warning, fmt("STRG must have a mapping root node; skipping"));
Log.report(logvisor::Warning, FMT_STRING("STRG must have a mapping root node; skipping"));
return;
}

View File

@ -14,6 +14,7 @@ struct STRG : ISTRG {
std::map<std::string, int32_t> names;
int32_t lookupIdx(std::string_view name) const override {
// TODO: Heterogeneous lookup when C++20 available
auto search = names.find(name.data());
if (search == names.end())
return -1;

View File

@ -9,7 +9,7 @@ using ANIMOutStream = hecl::blender::ANIMOutStream;
void ANIM::IANIM::sendANIMToBlender(hecl::blender::PyOutStream& os, const DNAANIM::RigInverter<CINF>& rig,
bool additive) const {
os.format(fmt(
os.format(FMT_STRING(
"act.hecl_fps = round({})\n"
"act.hecl_additive = {}\n"
"act.hecl_looping = {}\n"),
@ -32,7 +32,7 @@ void ANIM::IANIM::sendANIMToBlender(hecl::blender::PyOutStream& os, const DNAANI
continue;
}
os.format(fmt("bone_string = '{}'\n"), *bName);
os.format(FMT_STRING("bone_string = '{}'\n"), *bName);
os << "action_group = act.groups.new(bone_string)\n"
"\n";
@ -138,7 +138,7 @@ void ANIM::Enumerate<BigDNA::Read>(typename Read::StreamT& reader) {
m_anim->read(reader);
break;
default:
Log.report(logvisor::Fatal, fmt("unrecognized ANIM version"));
Log.report(logvisor::Fatal, FMT_STRING("unrecognized ANIM version"));
break;
}
}

View File

@ -61,7 +61,7 @@ static void LoadTexture(Stream& out, const UniqueID64& tex,
}
hecl::SystemString resPath = pakRouter.getResourceRelativePath(entry, tex);
hecl::SystemUTF8Conv resPathView(resPath);
out.format(fmt("if '{}' in bpy.data.images:\n"
out.format(FMT_STRING("if '{}' in bpy.data.images:\n"
" image = bpy.data.images['{}']\n"
"else:\n"
" image = bpy.data.images.load('''//{}''')\n"
@ -71,7 +71,7 @@ static void LoadTexture(Stream& out, const UniqueID64& tex,
void MaterialSet::ConstructMaterial(Stream& out, const PAKRouter<PAKBridge>& pakRouter, const PAK::Entry& entry,
const Material& material, unsigned groupIdx, unsigned matIdx) {
out.format(fmt("new_material = bpy.data.materials.new('MAT_{}_{}')\n"), groupIdx, matIdx);
out.format(FMT_STRING("new_material = bpy.data.materials.new('MAT_{}_{}')\n"), groupIdx, matIdx);
out << "new_material.use_fake_user = True\n"
"new_material.use_nodes = True\n"
"new_material.use_backface_culling = True\n"
@ -91,7 +91,7 @@ void MaterialSet::ConstructMaterial(Stream& out, const PAKRouter<PAKBridge>& pak
"\n";
/* Material Flags */
out.format(fmt(
out.format(FMT_STRING(
"new_material.retro_enable_bloom = {}\n"
"new_material.retro_force_lighting_stage = {}\n"
"new_material.retro_pre_inca_transparency = {}\n"
@ -146,14 +146,14 @@ void MaterialSet::ConstructMaterial(Stream& out, const PAKRouter<PAKBridge>& pak
"tex_links.append(new_nodetree.links.new(tex_uv_node.outputs['Normal'], tex_node.inputs['Vector']))\n";
break;
case Material::UVAnimationUVSource::UV:
out.format(fmt("tex_uv_node = new_nodetree.nodes.new('ShaderNodeUVMap')\n"
out.format(FMT_STRING("tex_uv_node = new_nodetree.nodes.new('ShaderNodeUVMap')\n"
"tex_links.append(new_nodetree.links.new(tex_uv_node.outputs['UV'], tex_node.inputs['Vector']))\n"
"tex_uv_node.uv_map = 'UV_{}'\n"), pass->uvSrc);
break;
}
out.format(fmt("tex_uv_node.label = 'MTX_{}'\n"), texMtxIdx);
out.format(FMT_STRING("tex_uv_node.label = 'MTX_{}'\n"), texMtxIdx);
} else {
out.format(fmt("tex_uv_node = new_nodetree.nodes.new('ShaderNodeUVMap')\n"
out.format(FMT_STRING("tex_uv_node = new_nodetree.nodes.new('ShaderNodeUVMap')\n"
"tex_links.append(new_nodetree.links.new(tex_uv_node.outputs['UV'], tex_node.inputs['Vector']))\n"
"tex_uv_node.uv_map = 'UV_{}'\n"), pass->uvSrc);
}
@ -179,7 +179,7 @@ void MaterialSet::ConstructMaterial(Stream& out, const PAKRouter<PAKBridge>& pak
"separate_node.location[0] += 350\n"
"separate_node.location[1] += 350\n"
"new_nodetree.links.new(tex_node.outputs['Color'], separate_node.inputs[0])\n";
out.format(fmt("swap_output = separate_node.outputs[{}]\n"), int(pass->flags.swapColorComponent()));
out.format(FMT_STRING("swap_output = separate_node.outputs[{}]\n"), int(pass->flags.swapColorComponent()));
}
};
@ -218,7 +218,7 @@ void MaterialSet::ConstructMaterial(Stream& out, const PAKRouter<PAKBridge>& pak
DoSwap();
out << "new_nodetree.links.new(swap_output, pnode.inputs['INCAA'])\n";
}
out.format(fmt("new_material.retro_inca_color_mod = {}\n"), pass->flags.INCAColorMod() ? "True" : "False");
out.format(FMT_STRING("new_material.retro_inca_color_mod = {}\n"), pass->flags.INCAColorMod() ? "True" : "False");
break;
case Subtype::RFLV:
out << "new_nodetree.links.new(tex_node.outputs['Color'], pnode.inputs['RFLV'])\n";
@ -244,7 +244,7 @@ void MaterialSet::ConstructMaterial(Stream& out, const PAKRouter<PAKBridge>& pak
"new_nodetree.links.new(swap_output, pnode.inputs['XRAYA'])\n";
break;
default:
Log.report(logvisor::Fatal, fmt("Unknown PASS subtype"));
Log.report(logvisor::Fatal, FMT_STRING("Unknown PASS subtype"));
break;
}
} else if (const Material::CLR* clr = chunk.get_if<Material::CLR>()) {
@ -253,39 +253,39 @@ void MaterialSet::ConstructMaterial(Stream& out, const PAKRouter<PAKBridge>& pak
clr->color.toVec4f().simd.copy_to(vec4);
switch (Subtype(clr->subtype.toUint32())) {
case Subtype::CLR:
out.format(fmt("pnode.inputs['CLR'].default_value = ({}, {}, {}, 1.0)\n"
out.format(FMT_STRING("pnode.inputs['CLR'].default_value = ({}, {}, {}, 1.0)\n"
"pnode.inputs['CLRA'].default_value = {}\n"),
vec4[0], vec4[1], vec4[2], vec4[3]);
break;
case Subtype::DIFB:
out.format(fmt("pnode.inputs['DIFBC'].default_value = ({}, {}, {}, 1.0)\n"
out.format(FMT_STRING("pnode.inputs['DIFBC'].default_value = ({}, {}, {}, 1.0)\n"
"pnode.inputs['DIFBA'].default_value = {}\n"),
vec4[0], vec4[1], vec4[2], vec4[3]);
break;
default:
Log.report(logvisor::Fatal, fmt("Unknown CLR subtype"));
Log.report(logvisor::Fatal, FMT_STRING("Unknown CLR subtype"));
break;
}
} else if (const Material::INT* val = chunk.get_if<Material::INT>()) {
using Subtype = Material::INT::Subtype;
switch (Subtype(val->subtype.toUint32())) {
case Subtype::OPAC:
out.format(fmt("pnode.inputs['OPAC'].default_value = {}\n"), val->value / 255.f);
out.format(FMT_STRING("pnode.inputs['OPAC'].default_value = {}\n"), val->value / 255.f);
break;
case Subtype::BLOD:
out.format(fmt("pnode.inputs['BLOD'].default_value = {}\n"), val->value / 255.f);
out.format(FMT_STRING("pnode.inputs['BLOD'].default_value = {}\n"), val->value / 255.f);
break;
case Subtype::BLOI:
out.format(fmt("pnode.inputs['BLOI'].default_value = {}\n"), val->value / 255.f);
out.format(FMT_STRING("pnode.inputs['BLOI'].default_value = {}\n"), val->value / 255.f);
break;
case Subtype::BNIF:
out.format(fmt("pnode.inputs['BNIF'].default_value = {}\n"), val->value / 255.f);
out.format(FMT_STRING("pnode.inputs['BNIF'].default_value = {}\n"), val->value / 255.f);
break;
case Subtype::XRBR:
out.format(fmt("pnode.inputs['XRBR'].default_value = {}\n"), val->value / 255.f);
out.format(FMT_STRING("pnode.inputs['XRBR'].default_value = {}\n"), val->value / 255.f);
break;
default:
Log.report(logvisor::Fatal, fmt("Unknown INT subtype"));
Log.report(logvisor::Fatal, FMT_STRING("Unknown INT subtype"));
break;
}
}

View File

@ -8,7 +8,7 @@ void CSKR::weightVertex(hecl::blender::PyOutStream& os, const CINF& cinf, atInt1
return;
const DNAMP2::CSKR::SkinningRule& rule = data.skinningRules[skinIdx];
for (const DNAMP2::CSKR::SkinningRule::Weight& weight : rule.weights)
os.format(fmt("vert[dvert_lay][{}] = {}\n"), cinf.getBoneIdxFromId(weight.boneId), weight.weight);
os.format(FMT_STRING("vert[dvert_lay][{}] = {}\n"), cinf.getBoneIdxFromId(weight.boneId), weight.weight);
}
} // namespace DataSpec::DNAMP3

View File

@ -124,7 +124,7 @@ void PAKBridge::build() {
areaDeps.name = hecl::SystemString(_SYS_STR("MREA_")) + hecl::SystemStringConv(idStr).c_str();
}
}
hecl::SystemString num = fmt::format(fmt(_SYS_STR("{:02d} ")), ai);
hecl::SystemString num = fmt::format(FMT_STRING(_SYS_STR("{:02d} ")), ai);
areaDeps.name = num + areaDeps.name;
const MLVL::LayerFlags& layerFlags = *layerFlagsIt++;
@ -136,7 +136,7 @@ void PAKBridge::build() {
layer.name = LayerName(mlvl.layerNames[layerIdx++]);
layer.active = layerFlags.flags >> (l - 1) & 0x1;
layer.name = hecl::StringUtils::TrimWhitespace(layer.name);
num = fmt::format(fmt(_SYS_STR("{:02d} ")), l - 1);
num = fmt::format(FMT_STRING(_SYS_STR("{:02d} ")), l - 1);
layer.name = num + layer.name;
}
}
@ -170,11 +170,11 @@ void PAKBridge::addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssoci
const CHAR::CharacterInfo& ci = aChar.characterInfo;
charAssoc.m_cmdlRigs[ci.cmdl] = {ci.cskr, ci.cinf};
charAssoc.m_cskrToCharacter[ci.cskr] =
std::make_pair(entry.second.id, fmt::format(fmt("{}_{}.CSKR"), ci.name, ci.cskr));
std::make_pair(entry.second.id, fmt::format(FMT_STRING("{}_{}.CSKR"), ci.name, ci.cskr));
for (const CHAR::CharacterInfo::Overlay& overlay : ci.overlays) {
charAssoc.m_cmdlRigs[overlay.cmdl] = {overlay.cskr, ci.cinf};
charAssoc.m_cskrToCharacter[overlay.cskr] =
std::make_pair(entry.second.id, fmt::format(fmt("{}.{}_{}.CSKR"), ci.name, overlay.type, overlay.cskr));
std::make_pair(entry.second.id, fmt::format(FMT_STRING("{}.{}_{}.CSKR"), ci.name, overlay.type, overlay.cskr));
}
}
}
@ -196,7 +196,7 @@ void PAKBridge::addMAPATransforms(PAKRouter<PAKBridge>& pakRouter,
if (mlvl.worldNameId.isValid())
pathOverrides[mlvl.worldNameId] = hecl::ProjectPath(mlvlDirPath,
fmt::format(fmt(_SYS_STR("!name_{}.yaml")), mlvl.worldNameId));
fmt::format(FMT_STRING(_SYS_STR("!name_{}.yaml")), mlvl.worldNameId));
for (const MLVL::Area& area : mlvl.areas) {
{
@ -212,7 +212,7 @@ void PAKBridge::addMAPATransforms(PAKRouter<PAKBridge>& pakRouter,
hecl::ProjectPath areaDirPath = pakRouter.getWorking(area.areaMREAId).getParentPath();
if (area.areaNameId.isValid())
pathOverrides[area.areaNameId] = hecl::ProjectPath(areaDirPath,
fmt::format(fmt(_SYS_STR("!name_{}.yaml")), area.areaNameId));
fmt::format(FMT_STRING(_SYS_STR("!name_{}.yaml")), area.areaNameId));
}
if (mlvl.worldMap.isValid()) {

View File

@ -49,7 +49,7 @@ bool MREA::StreamReader::seekToSection(FourCC sec, const std::vector<atUint32>&
void MREA::ReadBabeDeadToBlender_3(hecl::blender::PyOutStream& os, athena::io::IStreamReader& rs) {
atUint32 bdMagic = rs.readUint32Big();
if (bdMagic != 0xBABEDEAD)
Log.report(logvisor::Fatal, fmt("invalid BABEDEAD magic"));
Log.report(logvisor::Fatal, FMT_STRING("invalid BABEDEAD magic"));
os << "bpy.context.scene.world.use_nodes = True\n"
"bg_node = bpy.context.scene.world.node_tree.nodes['Background']\n"
"bg_node.inputs[1].default_value = 0.0\n";
@ -100,7 +100,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
/* Open Py Stream and read sections */
hecl::blender::PyOutStream os = conn.beginPythonOut(true);
os.format(fmt(
os.format(FMT_STRING(
"import bpy\n"
"import bmesh\n"
"from mathutils import Vector\n"

View File

@ -9,7 +9,7 @@ template <>
void PAK::Enumerate<BigDNA::Read>(athena::io::IStreamReader& reader) {
m_header.read(reader);
if (m_header.version != 2)
Log.report(logvisor::Fatal, fmt("unexpected PAK magic"));
Log.report(logvisor::Fatal, FMT_STRING("unexpected PAK magic"));
reader.seek(8, athena::SeekOrigin::Current);
atUint32 strgSz = reader.readUint32Big();
@ -141,7 +141,7 @@ std::unique_ptr<atUint8[]> PAK::Entry::getBuffer(const nod::Node& pak, atUint64&
} head;
strm->read(&head, 8);
if (head.magic != CMPD) {
Log.report(logvisor::Error, fmt("invalid CMPD block"));
Log.report(logvisor::Error, FMT_STRING("invalid CMPD block"));
return nullptr;
}
head.blockCount = hecl::SBig(head.blockCount);
@ -206,6 +206,7 @@ const PAK::Entry* PAK::lookupEntry(const UniqueID64& id) const {
}
const PAK::Entry* PAK::lookupEntry(std::string_view name) const {
// TODO: Heterogeneous lookup when C++20 available
auto result = m_nameMap.find(name.data());
if (result != m_nameMap.end()) {
auto result1 = m_entries.find(result->second);
@ -220,11 +221,11 @@ std::string PAK::bestEntryName(const nod::Node& pakNode, const Entry& entry, std
for (const NameEntry& nentry : m_nameEntries)
if (nentry.id == entry.id) {
catalogueName = nentry.name;
return fmt::format(fmt("{}_{}"), nentry.name, entry.id);
return fmt::format(FMT_STRING("{}_{}"), nentry.name, entry.id);
}
/* Otherwise return ID format string */
return fmt::format(fmt("{}_{}"), entry.type, entry.id);
return fmt::format(FMT_STRING("{}_{}"), entry.type, entry.id);
}
} // namespace DataSpec::DNAMP3

View File

@ -59,13 +59,13 @@ template <>
void STRG::Enumerate<BigDNA::Read>(athena::io::IStreamReader& reader) {
atUint32 magic = reader.readUint32Big();
if (magic != 0x87654321) {
Log.report(logvisor::Error, fmt("invalid STRG magic"));
Log.report(logvisor::Error, FMT_STRING("invalid STRG magic"));
return;
}
atUint32 version = reader.readUint32Big();
if (version != 3) {
Log.report(logvisor::Error, fmt("invalid STRG version"));
Log.report(logvisor::Error, FMT_STRING("invalid STRG version"));
return;
}
@ -82,22 +82,22 @@ void STRG::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& reader) {
if (lang.first == "names")
continue;
if (lang.first.size() != 4) {
Log.report(logvisor::Warning, fmt("STRG language string '{}' must be exactly 4 characters; skipping"), lang.first);
Log.report(logvisor::Warning, FMT_STRING("STRG language string '{}' must be exactly 4 characters; skipping"), lang.first);
return;
}
if (lang.second->m_type != YAML_SEQUENCE_NODE) {
Log.report(logvisor::Warning, fmt("STRG language string '{}' must contain a sequence; skipping"), lang.first);
Log.report(logvisor::Warning, FMT_STRING("STRG language string '{}' must contain a sequence; skipping"), lang.first);
return;
}
for (const auto& str : lang.second->m_seqChildren) {
if (str->m_type != YAML_SCALAR_NODE) {
Log.report(logvisor::Warning, fmt("STRG language '{}' must contain all scalars; skipping"), lang.first);
Log.report(logvisor::Warning, FMT_STRING("STRG language '{}' must contain all scalars; skipping"), lang.first);
return;
}
}
}
} else {
Log.report(logvisor::Warning, fmt("STRG must have a mapping root node; skipping"));
Log.report(logvisor::Warning, FMT_STRING("STRG must have a mapping root node; skipping"));
return;
}

View File

@ -14,6 +14,7 @@ struct STRG : ISTRG {
std::map<std::string, int32_t> names;
int32_t lookupIdx(std::string_view name) const override {
// TODO: Heterogeneous lookup when C++20 available
auto search = names.find(name.data());
if (search == names.end())
return -1;

View File

@ -65,7 +65,7 @@ bool SpecBase::canExtract(const ExtractPassInfo& info, std::vector<ExtractReport
if (!memcmp(gameID, "R3O", 3)) {
std::srand(std::time(0));
int r = std::rand() % MomErrCount;
Log.report(logvisor::Fatal, fmt(_SYS_STR("{}")), MomErr[r]);
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("{}")), MomErr[r]);
}
m_standalone = true;
@ -99,7 +99,7 @@ void SpecBase::doExtract(const ExtractPassInfo& info, const hecl::MultiProgressP
setThreadProject();
DataSpec::g_curSpec.reset(this);
if (!Blender::BuildMasterShader(m_masterShader))
Log.report(logvisor::Fatal, fmt("Unable to build master shader blend"));
Log.report(logvisor::Fatal, FMT_STRING("Unable to build master shader blend"));
if (m_isWii) {
/* Extract root files for repacking later */
hecl::ProjectPath outDir(m_project.getProjectWorkingPath(), _SYS_STR("out"));
@ -182,7 +182,7 @@ const hecl::Database::DataSpecEntry* SpecBase::overrideDataSpec(const hecl::Proj
hecl::blender::BlendType type = hecl::blender::GetBlendType(asBlend.getAbsolutePath());
if (type == hecl::blender::BlendType::None) {
Log.report(logvisor::Error, fmt(_SYS_STR("unable to cook '{}'")), path.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to cook '{}'")), path.getAbsolutePath());
return nullptr;
}
if (type == hecl::blender::BlendType::Mesh || type == hecl::blender::BlendType::Area)
@ -309,9 +309,9 @@ void SpecBase::flattenDependenciesBlend(const hecl::ProjectPath& in, std::vector
hecl::SystemStringConv chSysName(sub.name);
if (!sub.cskrId.empty()) {
hecl::SystemStringConv cskrSysName(sub.cskrId);
pathsOut.push_back(asGlob.ensureAuxInfo(fmt::format(fmt(_SYS_STR("{}_{}.CSKR")), chSysName, cskrSysName)));
pathsOut.push_back(asGlob.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}_{}.CSKR")), chSysName, cskrSysName)));
} else {
pathsOut.push_back(asGlob.ensureAuxInfo(fmt::format(fmt(_SYS_STR("{}.CSKR")), chSysName)));
pathsOut.push_back(asGlob.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}.CSKR")), chSysName)));
}
const auto& arm = actor.armatures[sub.armature];
@ -325,7 +325,7 @@ void SpecBase::flattenDependenciesBlend(const hecl::ProjectPath& in, std::vector
flattenDependenciesBlend(overlay.mesh, pathsOut, btok);
pathsOut.push_back(overlay.mesh);
}
pathsOut.push_back(asGlob.ensureAuxInfo(fmt::format(fmt(_SYS_STR("{}.{}_{}.CSKR")), chSysName, overlaySys, overlayCskrId)));
pathsOut.push_back(asGlob.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}.{}_{}.CSKR")), chSysName, overlaySys, overlayCskrId)));
}
}
};
@ -343,7 +343,7 @@ void SpecBase::flattenDependenciesBlend(const hecl::ProjectPath& in, std::vector
hecl::SystemStringConv chSysName(att.name);
hecl::SystemStringConv sysCskrId(att.cskrId);
pathsOut.push_back(asGlob.ensureAuxInfo(fmt::format(fmt(_SYS_STR("ATTACH.{}_{}.CSKR")), chSysName, sysCskrId)));
pathsOut.push_back(asGlob.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("ATTACH.{}_{}.CSKR")), chSysName, sysCskrId)));
if (att.armature >= 0) {
const auto& arm = actor.armatures[att.armature];
@ -355,9 +355,9 @@ void SpecBase::flattenDependenciesBlend(const hecl::ProjectPath& in, std::vector
for (const auto& act : actNames) {
hecl::SystemStringConv actSysName(act.first);
hecl::SystemStringConv actAnimId(act.second);
pathsOut.push_back(asGlob.ensureAuxInfo(fmt::format(fmt(_SYS_STR("{}_{}.ANIM")), actSysName, actAnimId)));
pathsOut.push_back(asGlob.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}_{}.ANIM")), actSysName, actAnimId)));
hecl::SystemString searchPrefix(asGlob.getWithExtension(
fmt::format(fmt(_SYS_STR(".{}_")), actSysName).c_str(), true).getLastComponent());
fmt::format(FMT_STRING(_SYS_STR(".{}_")), actSysName).c_str(), true).getLastComponent());
hecl::ProjectPath evntPath;
for (const auto& ent : dEnum) {
if (hecl::StringUtils::BeginsWith(ent.m_name, searchPrefix.c_str()) &&
@ -468,7 +468,7 @@ void SpecBase::copyBuildListData(std::vector<std::tuple<size_t, size_t, bool>>&
fileIndex.reserve(buildList.size());
int loadIdx = 0;
for (const auto& tag : buildList) {
hecl::SystemString str = fmt::format(fmt(_SYS_STR("Copying {}")), tag);
hecl::SystemString str = fmt::format(FMT_STRING(_SYS_STR("Copying {}")), tag);
progress.print(str.c_str(), nullptr, ++loadIdx / float(buildList.size()));
auto& [positionOut, sizeOut, compressedOut] = fileIndex.emplace_back();
@ -476,7 +476,7 @@ void SpecBase::copyBuildListData(std::vector<std::tuple<size_t, size_t, bool>>&
if (tag.type == FOURCC('MLVL')) {
auto search = mlvlData.find(tag.id);
if (search == mlvlData.end())
Log.report(logvisor::Fatal, fmt(_SYS_STR("Unable to find MLVL {}")), tag.id);
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to find MLVL {}")), tag.id);
positionOut = pakOut.position();
sizeOut = ROUND_UP_32(search->second.size());
@ -492,7 +492,7 @@ void SpecBase::copyBuildListData(std::vector<std::tuple<size_t, size_t, bool>>&
hecl::ProjectPath cooked = getCookedPath(path, true);
athena::io::FileReader r(cooked.getAbsolutePath());
if (r.hasError())
Log.report(logvisor::Fatal, fmt(_SYS_STR("Unable to open resource {}")), cooked.getRelativePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to open resource {}")), cooked.getRelativePath());
atUint64 size = r.length();
auto data = r.readUBytes(size);
auto compData = compressPakData(tag, data.get(), size);
@ -616,7 +616,7 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da
/* Async cook resource list if using ClientProcess */
if (cp) {
Log.report(logvisor::Info, fmt(_SYS_STR("Validating resources")));
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Validating resources")));
progress.setMainIndeterminate(true);
std::vector<urde::SObjectTag> cookTags;
cookTags.reserve(buildList.size());
@ -640,7 +640,7 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da
for (auto& tag : cookTags) {
hecl::ProjectPath depPath = pathFromTag(tag);
if (!depPath)
Log.report(logvisor::Fatal, fmt(_SYS_STR("Unable to resolve {}")), tag);
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to resolve {}")), tag);
m_project.cookPath(depPath, progress, false, false, fast, entry, cp);
}
progress.setMainIndeterminate(false);
@ -650,7 +650,7 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da
/* Write resource data and build file index */
std::vector<std::tuple<size_t, size_t, bool>> fileIndex;
Log.report(logvisor::Info, fmt(_SYS_STR("Copying data into {}")), outPath.getRelativePath());
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Copying data into {}")), outPath.getRelativePath());
copyBuildListData(fileIndex, buildList, entry, fast, progress, pakOut, mlvlData);
/* Write file index */
@ -688,9 +688,9 @@ hecl::ProjectPath SpecBase::getCookedPath(const hecl::ProjectPath& working, bool
return working.getCookedPath(*spec);
}
static void PNGErr(png_structp png, png_const_charp msg) { Log.report(logvisor::Error, fmt("{}"), msg); }
static void PNGErr(png_structp png, png_const_charp msg) { Log.report(logvisor::Error, FMT_STRING("{}"), msg); }
static void PNGWarn(png_structp png, png_const_charp msg) { Log.report(logvisor::Warning, fmt("{}"), msg); }
static void PNGWarn(png_structp png, png_const_charp msg) { Log.report(logvisor::Warning, FMT_STRING("{}"), msg); }
constexpr uint8_t Convert4To8(uint8_t v) {
/* Swizzle bits: 00001234 -> 12341234 */
@ -703,12 +703,12 @@ void SpecBase::extractRandomStaticEntropy(const uint8_t* buf, const hecl::Projec
entropyPath.makeDirChain(false);
if (const auto fp = hecl::FopenUnique(catalogPath.getAbsolutePath().data(), _SYS_STR("a"))) {
fmt::print(fp.get(), fmt("RandomStaticEntropy: {}\n"), entropyPath.getRelativePathUTF8());
fmt::print(fp.get(), FMT_STRING("RandomStaticEntropy: {}\n"), entropyPath.getRelativePathUTF8());
}
auto fp = hecl::FopenUnique(entropyPath.getAbsolutePath().data(), _SYS_STR("wb"));
if (fp == nullptr) {
Log.report(logvisor::Error, fmt(_SYS_STR("Unable to open '{}' for writing")), entropyPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("Unable to open '{}' for writing")), entropyPath.getAbsolutePath());
return;
}
png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, PNGErr, PNGWarn);
@ -852,7 +852,7 @@ void SpecBase::enumerateNamedResources(
static void WriteTag(athena::io::YAMLDocWriter& cacheWriter, const urde::SObjectTag& pathTag,
const hecl::ProjectPath& path) {
auto key = fmt::format(fmt("{}"), pathTag.id);
auto key = fmt::format(FMT_STRING("{}"), pathTag.id);
if (auto* existing = cacheWriter.getCurNode()->findMapChild(key)) {
existing->m_seqChildren.emplace_back(athena::io::ValToNode(path.getEncodableStringUTF8()));
} else if (auto v = cacheWriter.enterSubVector(key)) {
@ -863,7 +863,7 @@ static void WriteTag(athena::io::YAMLDocWriter& cacheWriter, const urde::SObject
static void WriteNameTag(athena::io::YAMLDocWriter& nameWriter, const urde::SObjectTag& pathTag,
std::string_view name) {
nameWriter.writeString(name.data(), fmt::format(fmt("{}"), pathTag.id));
nameWriter.writeString(name.data(), fmt::format(FMT_STRING("{}"), pathTag.id));
}
void SpecBase::readCatalog(const hecl::ProjectPath& catalogPath, athena::io::YAMLDocWriter& nameWriter) {
@ -907,7 +907,7 @@ void SpecBase::readCatalog(const hecl::ProjectPath& catalogPath, athena::io::YAM
WriteNameTag(nameWriter, pathTag, p.first);
#if 0
fmt::print(stderr, fmt("{} {} {:08X}\n"), p.first, pathTag.type.toString(), pathTag.id.Value());
fmt::print(stderr, FMT_STRING("{} {} {:08X}\n"), p.first, pathTag.type.toString(), pathTag.id.Value());
#endif
}
}
@ -948,7 +948,7 @@ void SpecBase::insertPathTag(athena::io::YAMLDocWriter& cacheWriter, const urde:
if (search != m_tagToPath.end() && search->second != path &&
tag.type != FOURCC('CINF') && tag.type != FOURCC('CSKR') &&
tag.type != FOURCC('ANIM') && tag.type != FOURCC('EVNT')) {
Log.report(logvisor::Fatal, fmt(_SYS_STR("'{}|{}' already exists for tag {} as '{}|{}'")),
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("'{}|{}' already exists for tag {} as '{}|{}'")),
path.getRelativePath(), path.getAuxInfo(), tag,
search->second.getRelativePath(), search->second.getAuxInfo());
}
@ -958,7 +958,7 @@ void SpecBase::insertPathTag(athena::io::YAMLDocWriter& cacheWriter, const urde:
WriteTag(cacheWriter, tag, path);
#if DUMP_CACHE_FILL
if (dump)
fmt::print(stderr, fmt("{} {}\n"), tag, path.getRelativePathUTF8());
fmt::print(stderr, FMT_STRING("{} {}\n"), tag, path.getRelativePathUTF8());
#endif
}
@ -997,9 +997,9 @@ bool SpecBase::addFileToIndex(const hecl::ProjectPath& path, athena::io::YAMLDoc
hecl::ProjectPath subPath;
if (!sub.second.empty()) {
hecl::SystemStringConv cskrId(sub.second);
subPath = asGlob.ensureAuxInfo(fmt::format(fmt(_SYS_STR("{}_{}.CSKR")), subName, cskrId));
subPath = asGlob.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}_{}.CSKR")), subName, cskrId));
} else {
subPath = asGlob.ensureAuxInfo(fmt::format(fmt(_SYS_STR("{}.CSKR")), subName));
subPath = asGlob.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}.CSKR")), subName));
}
insertPathTag(cacheWriter, buildTagFromPath(subPath), subPath);
@ -1009,10 +1009,10 @@ bool SpecBase::addFileToIndex(const hecl::ProjectPath& path, athena::io::YAMLDoc
hecl::SystemStringConv overlayCskrId(overlay.second);
if (!overlay.second.empty()) {
subPath =
asGlob.ensureAuxInfo(fmt::format(fmt(_SYS_STR("{}.{}_{}.CSKR")), subName, overlaySys, overlayCskrId));
asGlob.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}.{}_{}.CSKR")), subName, overlaySys, overlayCskrId));
} else {
subPath =
asGlob.ensureAuxInfo(fmt::format(fmt(_SYS_STR("{}.{}.CSKR")), subName, overlaySys));
asGlob.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}.{}.CSKR")), subName, overlaySys));
}
insertPathTag(cacheWriter, buildTagFromPath(subPath), subPath);
}
@ -1025,10 +1025,10 @@ bool SpecBase::addFileToIndex(const hecl::ProjectPath& path, athena::io::YAMLDoc
hecl::ProjectPath subPath;
if (!attachment.second.empty()) {
subPath =
asGlob.ensureAuxInfo(fmt::format(fmt(_SYS_STR("ATTACH.{}_{}.CSKR")), attachmentSys, attachmentCskrId));
asGlob.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("ATTACH.{}_{}.CSKR")), attachmentSys, attachmentCskrId));
} else {
subPath =
asGlob.ensureAuxInfo(fmt::format(fmt(_SYS_STR("ATTACH.{}.CSKR")), attachmentSys));
asGlob.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("ATTACH.{}.CSKR")), attachmentSys));
}
insertPathTag(cacheWriter, buildTagFromPath(subPath), subPath);
}
@ -1038,9 +1038,9 @@ bool SpecBase::addFileToIndex(const hecl::ProjectPath& path, athena::io::YAMLDoc
hecl::SystemStringConv animId(act.second);
hecl::ProjectPath subPath;
if (!act.second.empty()) {
subPath = asGlob.ensureAuxInfo(fmt::format(fmt(_SYS_STR("{}_{}.ANIM")), sysStr, animId));
subPath = asGlob.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}_{}.ANIM")), sysStr, animId));
} else {
subPath = asGlob.ensureAuxInfo(fmt::format(fmt(_SYS_STR("{}.ANIM")), sysStr));
subPath = asGlob.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}.ANIM")), sysStr));
}
insertPathTag(cacheWriter, buildTagFromPath(subPath), subPath);
}
@ -1108,7 +1108,7 @@ void SpecBase::backgroundIndexProc() {
if (tagCachePath.isFile()) {
athena::io::FileReader reader(tagCachePath.getAbsolutePath());
if (reader.isOpen()) {
Log.report(logvisor::Info, fmt(_SYS_STR("Cache index of '{}' loading")), getOriginalSpec().m_name);
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Cache index of '{}' loading")), getOriginalSpec().m_name);
athena::io::YAMLDocReader cacheReader;
if (cacheReader.parse(&reader)) {
std::unique_lock lk(m_backgroundIndexMutex);
@ -1134,16 +1134,16 @@ void SpecBase::backgroundIndexProc() {
++loadIdx;
if (!(loadIdx % 100))
fmt::print(stderr, fmt("\r {} / {}"), loadIdx, tagCount);
fmt::print(stderr, FMT_STRING("\r {} / {}"), loadIdx, tagCount);
}
fmt::print(stderr, fmt("\r {} / {}\n"), loadIdx, tagCount);
fmt::print(stderr, FMT_STRING("\r {} / {}\n"), loadIdx, tagCount);
}
Log.report(logvisor::Info, fmt(_SYS_STR("Cache index of '{}' loaded; {} tags")), getOriginalSpec().m_name,
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Cache index of '{}' loaded; {} tags")), getOriginalSpec().m_name,
m_tagToPath.size());
if (nameCachePath.isFile()) {
/* Read in name cache */
Log.report(logvisor::Info, fmt(_SYS_STR("Name index of '{}' loading")), getOriginalSpec().m_name);
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Name index of '{}' loading")), getOriginalSpec().m_name);
athena::io::FileReader nreader(nameCachePath.getAbsolutePath());
athena::io::YAMLDocReader nameReader;
if (nameReader.parse(&nreader)) {
@ -1162,13 +1162,13 @@ void SpecBase::backgroundIndexProc() {
}
}
}
Log.report(logvisor::Info, fmt(_SYS_STR("Name index of '{}' loaded; {} names")), getOriginalSpec().m_name,
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Name index of '{}' loaded; {} names")), getOriginalSpec().m_name,
m_catalogNameToTag.size());
}
}
}
Log.report(logvisor::Info, fmt(_SYS_STR("Background index of '{}' started")), getOriginalSpec().m_name);
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Background index of '{}' started")), getOriginalSpec().m_name);
backgroundIndexRecursiveProc(specRoot, cacheWriter, nameWriter, 0);
tagCachePath.makeDirChain(false);
@ -1179,7 +1179,7 @@ void SpecBase::backgroundIndexProc() {
nameWriter.finish(&nwriter);
m_backgroundBlender.shutdown();
Log.report(logvisor::Info, fmt(_SYS_STR("Background index of '{}' complete; {} tags, {} names")),
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Background index of '{}' complete; {} tags, {} names")),
getOriginalSpec().m_name, m_tagToPath.size(), m_catalogNameToTag.size());
m_backgroundRunning = false;
}

View File

@ -69,10 +69,10 @@ struct TextureCache {
texturePath.makeDirChain(false);
if (const auto fp = hecl::FopenUnique(catalogPath.getAbsolutePath().data(), _SYS_STR("a"))) {
fmt::print(fp.get(), fmt("TextureCache: {}\n"), texturePath.getRelativePathUTF8());
fmt::print(fp.get(), FMT_STRING("TextureCache: {}\n"), texturePath.getRelativePathUTF8());
}
Log.report(logvisor::Level::Info, fmt("Gathering Texture metadata (this can take up to 10 seconds)..."));
Log.report(logvisor::Level::Info, FMT_STRING("Gathering Texture metadata (this can take up to 10 seconds)..."));
std::unordered_map<UniqueID32, TXTR::Meta> metaMap;
pakRouter.enumerateResources([&](const DNAMP1::PAK::Entry* ent) {
@ -92,7 +92,7 @@ struct TextureCache {
athena::io::FileWriter fileW(texturePath.getAbsolutePath());
yamlW.finish(&fileW);
Log.report(logvisor::Level::Info, fmt("Done..."));
Log.report(logvisor::Level::Info, FMT_STRING("Done..."));
}
static void Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath) {
@ -740,7 +740,7 @@ struct SpecMP1 : SpecBase {
}
if (!colMesh)
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to find mesh named 'CMESH' in {}")), in.getAbsolutePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to find mesh named 'CMESH' in {}")), in.getAbsolutePath());
std::vector<Light> lights = ds.compileLights();
@ -978,7 +978,7 @@ struct SpecMP1 : SpecBase {
{
athena::io::FileReader r(worldPathCooked.getAbsolutePath());
if (r.hasError())
Log.report(logvisor::Fatal, fmt(_SYS_STR("Unable to open world {}")), worldPathCooked.getRelativePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to open world {}")), worldPathCooked.getRelativePath());
mlvl.read(r);
}
@ -1074,10 +1074,10 @@ struct SpecMP1 : SpecBase {
if (hecl::ProjectPath mapCookedPath = getCookedPath(mapPath, true)) {
athena::io::FileReader r(mapCookedPath.getAbsolutePath());
if (r.hasError())
Log.report(logvisor::Fatal, fmt(_SYS_STR("Unable to open {}")), mapCookedPath.getRelativePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to open {}")), mapCookedPath.getRelativePath());
if (r.readUint32Big() != 0xDEADF00D)
Log.report(logvisor::Fatal, fmt(_SYS_STR("Corrupt MAPW {}")), mapCookedPath.getRelativePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Corrupt MAPW {}")), mapCookedPath.getRelativePath());
r.readUint32Big();
atUint32 mapaCount = r.readUint32Big();
for (atUint32 i = 0; i < mapaCount; ++i) {
@ -1100,7 +1100,7 @@ struct SpecMP1 : SpecBase {
for (const auto& tex : textures) {
urde::SObjectTag texTag = tagFromPath(tex);
if (!texTag)
Log.report(logvisor::Fatal, fmt(_SYS_STR("Unable to resolve {}")), tex.getRelativePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to resolve {}")), tex.getRelativePath());
listOut.push_back(texTag);
}
}

View File

@ -35,10 +35,10 @@ struct TextureCache {
texturePath.makeDirChain(false);
if (const auto fp = hecl::FopenUnique(catalogPath.getAbsolutePath().data(), _SYS_STR("a"))) {
fmt::print(fp.get(), fmt("TextureCache: {}\n"), texturePath.getRelativePathUTF8());
fmt::print(fp.get(), FMT_STRING("TextureCache: {}\n"), texturePath.getRelativePathUTF8());
}
Log.report(logvisor::Level::Info, fmt("Gathering Texture metadata (this can take up to 10 seconds)..."));
Log.report(logvisor::Level::Info, FMT_STRING("Gathering Texture metadata (this can take up to 10 seconds)..."));
std::unordered_map<UniqueID32, TXTR::Meta> metaMap;
pakRouter.enumerateResources([&](const DNAMP2::PAK::Entry* ent) {
@ -58,7 +58,7 @@ struct TextureCache {
athena::io::FileWriter fileW(texturePath.getAbsolutePath());
yamlW.finish(&fileW);
Log.report(logvisor::Level::Info, fmt("Done..."));
Log.report(logvisor::Level::Info, FMT_STRING("Done..."));
}
static void Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath) {

View File

@ -32,10 +32,10 @@ struct TextureCache {
texturePath.makeDirChain(false);
if (const auto fp = hecl::FopenUnique(catalogPath.getAbsolutePath().data(), _SYS_STR("a"))) {
fmt::print(fp.get(), fmt("TextureCache: {}\n"), texturePath.getRelativePathUTF8());
fmt::print(fp.get(), FMT_STRING("TextureCache: {}\n"), texturePath.getRelativePathUTF8());
}
Log.report(logvisor::Level::Info, fmt("Gathering Texture metadata (this can take up to 10 seconds)..."));
Log.report(logvisor::Level::Info, FMT_STRING("Gathering Texture metadata (this can take up to 10 seconds)..."));
std::unordered_map<UniqueID64, TXTR::Meta> metaMap;
pakRouter.enumerateResources([&](const DNAMP3::PAK::Entry* ent) {
@ -55,7 +55,7 @@ struct TextureCache {
athena::io::FileWriter fileW(texturePath.getAbsolutePath());
yamlW.finish(&fileW);
Log.report(logvisor::Level::Info, fmt("Done..."));
Log.report(logvisor::Level::Info, FMT_STRING("Done..."));
}
static void Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath) {

View File

@ -48,7 +48,7 @@ ProjectManager::ProjectManager(ViewManager& vm)
bool ProjectManager::newProject(hecl::SystemStringView path) {
hecl::ProjectRootPath projPath = hecl::SearchForProject(path);
if (projPath) {
Log.report(logvisor::Warning, fmt(_SYS_STR("project already exists at '{}'")), path);
Log.report(logvisor::Warning, FMT_STRING(_SYS_STR("project already exists at '{}'")), path);
return false;
}
@ -63,7 +63,7 @@ bool ProjectManager::newProject(hecl::SystemStringView path) {
m_vm.SetupEditorView();
saveProject();
m_vm.m_mainWindow->setTitle(fmt::format(fmt(_SYS_STR("{} - URDE [{}]")),
m_vm.m_mainWindow->setTitle(fmt::format(FMT_STRING(_SYS_STR("{} - URDE [{}]")),
m_proj->getProjectRootPath().getLastComponent(), m_vm.platformName()));
m_vm.DismissSplash();
m_vm.FadeInEditors();
@ -75,7 +75,7 @@ bool ProjectManager::openProject(hecl::SystemStringView path) {
hecl::SystemString subPath;
hecl::ProjectRootPath projPath = hecl::SearchForProject(path, subPath);
if (!projPath) {
Log.report(logvisor::Warning, fmt(_SYS_STR("project doesn't exist at '{}'")), path);
Log.report(logvisor::Warning, FMT_STRING(_SYS_STR("project doesn't exist at '{}'")), path);
return false;
}
@ -103,7 +103,7 @@ bool ProjectManager::openProject(hecl::SystemStringView path) {
if (needsSave)
saveProject();
m_vm.m_mainWindow->setTitle(fmt::format(fmt(_SYS_STR("{} - URDE [{}]")),
m_vm.m_mainWindow->setTitle(fmt::format(FMT_STRING(_SYS_STR("{} - URDE [{}]")),
m_proj->getProjectRootPath().getLastComponent(), m_vm.platformName()));
m_vm.DismissSplash();
m_vm.FadeInEditors();

View File

@ -22,7 +22,7 @@ void ProjectResourceFactoryBase::BeginBackgroundIndex(hecl::Database::Project& p
}
bool ProjectResourceFactoryBase::SyncCook(const hecl::ProjectPath& working) {
Log.report(logvisor::Warning, fmt(_SYS_STR("sync-cooking {}")), working.getRelativePath());
Log.report(logvisor::Warning, FMT_STRING(_SYS_STR("sync-cooking {}")), working.getRelativePath());
return m_clientProc.syncCook(working, m_cookSpec.get(), hecl::blender::SharedBlenderToken, false, false);
}
@ -38,12 +38,12 @@ CFactoryFnReturn ProjectResourceFactoryBase::BuildSync(const SObjectTag& tag, co
u32 length = fr->length();
std::unique_ptr<u8[]> memBuf = fr->readUBytes(length);
CFactoryFnReturn ret = m_factoryMgr.MakeObjectFromMemory(tag, std::move(memBuf), length, false, paramXfer, selfRef);
Log.report(logvisor::Info, fmt("sync-built {}"), tag);
Log.report(logvisor::Info, FMT_STRING("sync-built {}"), tag);
return ret;
}
CFactoryFnReturn ret = m_factoryMgr.MakeObject(tag, *fr, paramXfer, selfRef);
Log.report(logvisor::Info, fmt("sync-built {}"), tag);
Log.report(logvisor::Info, FMT_STRING("sync-built {}"), tag);
return ret;
}
@ -53,7 +53,7 @@ void ProjectResourceFactoryBase::AsyncTask::EnsurePath(const urde::SObjectTag& t
/* Ensure requested resource is on the filesystem */
if (!path.isFileOrGlob()) {
Log.report(logvisor::Error, fmt(_SYS_STR("unable to find resource path '{}'")), path.getRelativePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to find resource path '{}'")), path.getRelativePath());
m_failed = true;
return;
}
@ -66,7 +66,7 @@ void ProjectResourceFactoryBase::AsyncTask::EnsurePath(const urde::SObjectTag& t
/* Last chance type validation */
urde::SObjectTag verifyTag = m_parent.TagFromPath(path);
if (verifyTag.type != tag.type) {
Log.report(logvisor::Error, fmt(_SYS_STR("{}: expected type '{}', found '{}'")), path.getRelativePath(),
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("{}: expected type '{}', found '{}'")), path.getRelativePath(),
tag.type, verifyTag.type);
m_failed = true;
return;
@ -91,7 +91,7 @@ void ProjectResourceFactoryBase::AsyncTask::CookComplete() {
/* Ensure cooked rep is on the filesystem */
athena::io::FileReader fr(m_cookedPath.getAbsolutePath(), 32 * 1024, false);
if (fr.hasError()) {
Log.report(logvisor::Error, fmt(_SYS_STR("unable to open cooked resource path '{}'")), m_cookedPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to open cooked resource path '{}'")), m_cookedPath.getAbsolutePath());
m_failed = true;
return;
}
@ -171,7 +171,7 @@ bool ProjectResourceFactoryBase::PrepForReadSync(const SObjectTag& tag, const he
std::optional<athena::io::FileReader>& fr) {
/* Ensure requested resource is on the filesystem */
if (!path.isFileOrGlob()) {
Log.report(logvisor::Error, fmt(_SYS_STR("unable to find resource path '{}'")), path.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to find resource path '{}'")), path.getAbsolutePath());
return false;
}
@ -183,7 +183,7 @@ bool ProjectResourceFactoryBase::PrepForReadSync(const SObjectTag& tag, const he
/* Last chance type validation */
urde::SObjectTag verifyTag = TagFromPath(path);
if (verifyTag.type != tag.type) {
Log.report(logvisor::Error, fmt(_SYS_STR("{}: expected type '{}', found '{}'")), path.getRelativePath(),
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("{}: expected type '{}', found '{}'")), path.getRelativePath(),
tag.type, verifyTag.type);
return false;
}
@ -195,7 +195,7 @@ bool ProjectResourceFactoryBase::PrepForReadSync(const SObjectTag& tag, const he
if (!cooked.isFile() || cooked.getModtime() < path.getModtime()) {
/* Do a blocking cook here */
if (!SyncCook(path)) {
Log.report(logvisor::Error, fmt(_SYS_STR("unable to cook resource path '{}'")), path.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to cook resource path '{}'")), path.getAbsolutePath());
return false;
}
}
@ -204,7 +204,7 @@ bool ProjectResourceFactoryBase::PrepForReadSync(const SObjectTag& tag, const he
/* Ensure cooked rep is on the filesystem */
fr.emplace(cooked.getAbsolutePath(), 32 * 1024, false);
if (fr->hasError()) {
Log.report(logvisor::Error, fmt(_SYS_STR("unable to open cooked resource path '{}'")), cooked.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to open cooked resource path '{}'")), cooked.getAbsolutePath());
return false;
}
@ -215,7 +215,7 @@ std::unique_ptr<urde::IObj> ProjectResourceFactoryBase::Build(const urde::SObjec
const urde::CVParamTransfer& paramXfer,
CObjectReference* selfRef) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, fmt("attempted to access null id on type '{}'"), tag.type);
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id on type '{}'"), tag.type);
const hecl::ProjectPath* resPath = nullptr;
if (!WaitForTagReady(tag, resPath))
@ -243,14 +243,14 @@ std::unique_ptr<urde::IObj> ProjectResourceFactoryBase::Build(const urde::SObjec
}
//*task.xc_targetObjPtr = newObj.get();
Log.report(logvisor::Warning, fmt("spin-built {}"), task.x0_tag);
Log.report(logvisor::Warning, FMT_STRING("spin-built {}"), task.x0_tag);
_RemoveTask(asyncSearch);
return newObj;
} else if (task.m_complete) {
Log.report(logvisor::Error, fmt("unable to spin-build {}; Resource requested as cook-only"), task.x0_tag);
Log.report(logvisor::Error, FMT_STRING("unable to spin-build {}; Resource requested as cook-only"), task.x0_tag);
} else {
Log.report(logvisor::Error, fmt("unable to spin-build {}"), task.x0_tag);
Log.report(logvisor::Error, FMT_STRING("unable to spin-build {}"), task.x0_tag);
}
_RemoveTask(asyncSearch);
@ -273,14 +273,14 @@ std::shared_ptr<AsyncTask> ProjectResourceFactoryBase::BuildAsyncInternal(const
void ProjectResourceFactoryBase::BuildAsync(const urde::SObjectTag& tag, const urde::CVParamTransfer& paramXfer,
std::unique_ptr<urde::IObj>* objOut, CObjectReference* selfRef) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, fmt("attempted to access null id on type '{}'"), tag.type);
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id on type '{}'"), tag.type);
BuildAsyncInternal(tag, paramXfer, objOut, selfRef);
}
u32 ProjectResourceFactoryBase::ResourceSize(const SObjectTag& tag) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, fmt("attempted to access null id on type '{}'"), tag.type);
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id on type '{}'"), tag.type);
/* Ensure resource at requested path is indexed and not cooking */
const hecl::ProjectPath* resPath = nullptr;
@ -298,7 +298,7 @@ u32 ProjectResourceFactoryBase::ResourceSize(const SObjectTag& tag) {
std::shared_ptr<urde::IDvdRequest> ProjectResourceFactoryBase::LoadResourceAsync(const urde::SObjectTag& tag,
void* target) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, fmt("attempted to access null id"));
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
return {};
return std::static_pointer_cast<urde::IDvdRequest>(
@ -308,7 +308,7 @@ std::shared_ptr<urde::IDvdRequest> ProjectResourceFactoryBase::LoadResourceAsync
std::shared_ptr<urde::IDvdRequest> ProjectResourceFactoryBase::LoadResourcePartAsync(const urde::SObjectTag& tag,
u32 off, u32 size, void* target) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, fmt("attempted to access null id"));
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
return {};
return std::static_pointer_cast<urde::IDvdRequest>(
@ -317,7 +317,7 @@ std::shared_ptr<urde::IDvdRequest> ProjectResourceFactoryBase::LoadResourcePartA
std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadResourceSync(const urde::SObjectTag& tag) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, fmt("attempted to access null id"));
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
/* Ensure resource at requested path is indexed and not cooking */
const hecl::ProjectPath* resPath = nullptr;
@ -335,7 +335,7 @@ std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadResourceSync(const urde::S
std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadNewResourcePartSync(const urde::SObjectTag& tag, u32 off,
u32 size) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, fmt("attempted to access null id"));
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
/* Ensure resource at requested path is indexed and not cooking */
const hecl::ProjectPath* resPath = nullptr;
@ -354,7 +354,7 @@ std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadNewResourcePartSync(const
std::shared_ptr<AsyncTask> ProjectResourceFactoryBase::CookResourceAsync(const urde::SObjectTag& tag) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, fmt("attempted to access null id"));
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
return {};
return _AddTask(std::make_shared<AsyncTask>(*this, tag));
@ -364,7 +364,7 @@ void ProjectResourceFactoryBase::CancelBuild(const urde::SObjectTag& tag) { _Rem
bool ProjectResourceFactoryBase::CanBuild(const urde::SObjectTag& tag) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, fmt("attempted to access null id"));
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
const hecl::ProjectPath* resPath = nullptr;
if (!WaitForTagReady(tag, resPath))
@ -400,7 +400,7 @@ bool ProjectResourceFactoryBase::AsyncPumpTask(ItType& it) {
hecl::ProjectPath path = static_cast<DataSpec::SpecBase&>(*m_cookSpec).pathFromTag(task.x0_tag);
if (!path) {
if (!static_cast<DataSpec::SpecBase&>(*m_cookSpec).backgroundIndexRunning()) {
Log.report(logvisor::Error, fmt(_SYS_STR("unable to find async load resource ({})")), task.x0_tag);
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to find async load resource ({})")), task.x0_tag);
it = _RemoveTask(it);
}
return true;
@ -423,14 +423,14 @@ bool ProjectResourceFactoryBase::AsyncPumpTask(ItType& it) {
}
*task.xc_targetObjPtr = std::move(newObj);
Log.report(logvisor::Info, fmt("async-built {}"), task.x0_tag);
Log.report(logvisor::Info, FMT_STRING("async-built {}"), task.x0_tag);
} else if (task.xc_targetDataPtr) {
/* Buffer only */
*task.xc_targetDataPtr = std::move(task.x10_loadBuffer);
Log.report(logvisor::Info, fmt("async-loaded {}"), task.x0_tag);
Log.report(logvisor::Info, FMT_STRING("async-loaded {}"), task.x0_tag);
} else if (task.xc_targetDataRawPtr) {
/* Buffer only raw */
Log.report(logvisor::Info, fmt("async-loaded {}"), task.x0_tag);
Log.report(logvisor::Info, FMT_STRING("async-loaded {}"), task.x0_tag);
}
}

View File

@ -100,7 +100,7 @@ specter::View* SplitSpace::buildContentView(specter::ViewResources& res) {
void SplitSpace::setChildSlot(unsigned slot, std::unique_ptr<Space>&& space) {
if (slot > 1)
Log.report(logvisor::Fatal, fmt("invalid slot {} for SplitView"), slot);
Log.report(logvisor::Fatal, FMT_STRING("invalid slot {} for SplitView"), slot);
m_slots[slot] = std::move(space);
m_slots[slot]->m_parent = this;
}
@ -162,7 +162,7 @@ std::unique_ptr<Space> RootSpace::exchangeSpaceSplitJoin(Space* removeSpace, std
m_spaceTree.swap(ret);
m_spaceTree->m_parent = this;
} else
Log.report(logvisor::Fatal, fmt("RootSpace::exchangeSpaceSplitJoin() failure"));
Log.report(logvisor::Fatal, FMT_STRING("RootSpace::exchangeSpaceSplitJoin() failure"));
return ret;
}
@ -177,7 +177,7 @@ std::unique_ptr<Space> SplitSpace::exchangeSpaceSplitJoin(Space* removeSpace, st
m_slots[1].swap(ret);
m_slots[1]->m_parent = this;
} else
Log.report(logvisor::Fatal, fmt("SplitSpace::exchangeSpaceSplitJoin() failure"));
Log.report(logvisor::Fatal, FMT_STRING("SplitSpace::exchangeSpaceSplitJoin() failure"));
return ret;
}

View File

@ -36,12 +36,12 @@ SplashScreen::SplashScreen(ViewManager& vm, specter::ViewResources& res)
if (GIT_COMMIT_DATE[0] != '\0' && GIT_COMMIT_HASH[0] != '\0' && GIT_BRANCH[0] != '\0') {
#ifdef URDE_DLPACKAGE
if ((URDE_DLPACKAGE)[0])
m_buildInfoStr = fmt::format(fmt("{}: {}\n{}: {}\n{}: {}"), vm.translate<locale::release>(),
m_buildInfoStr = fmt::format(FMT_STRING("{}: {}\n{}: {}\n{}: {}"), vm.translate<locale::release>(),
URDE_DLPACKAGE, vm.translate<locale::commit>(), GIT_COMMIT_HASH,
vm.translate<locale::date>(), GIT_COMMIT_DATE);
else
#endif
m_buildInfoStr = fmt::format(fmt("{}: {}\n{}: {}\n{}: {}"), vm.translate<locale::branch>(), GIT_BRANCH,
m_buildInfoStr = fmt::format(FMT_STRING("{}: {}\n{}: {}\n{}: {}"), vm.translate<locale::branch>(), GIT_BRANCH,
vm.translate<locale::commit>(), GIT_COMMIT_HASH,
vm.translate<locale::date>(), GIT_COMMIT_DATE);
}
@ -65,15 +65,15 @@ void SplashScreen::think() {
m_openButt.m_view->think();
if (m_newProjBind.m_deferPath.size()) {
Log.report(logvisor::Info, fmt(_SYS_STR("Making project '{}'")), m_newProjBind.m_deferPath);
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Making project '{}'")), m_newProjBind.m_deferPath);
m_vm.projectManager().newProject(m_newProjBind.m_deferPath);
m_newProjBind.m_deferPath.clear();
} else if (m_openProjBind.m_deferPath.size()) {
Log.report(logvisor::Info, fmt(_SYS_STR("Opening project '{}'")), m_openProjBind.m_deferPath);
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Opening project '{}'")), m_openProjBind.m_deferPath);
m_vm.projectManager().openProject(m_openProjBind.m_deferPath);
m_openProjBind.m_deferPath.clear();
} else if (m_extractProjBind.m_deferPath.size()) {
Log.report(logvisor::Info, fmt(_SYS_STR("Extracting game '{}'")), m_extractProjBind.m_deferPath);
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Extracting game '{}'")), m_extractProjBind.m_deferPath);
m_vm.projectManager().extractGame(m_extractProjBind.m_deferPath);
m_extractProjBind.m_deferPath.clear();
}

View File

@ -70,14 +70,14 @@ void ViewManager::TestGameView::think() {
const hecl::CVar* showResourceStats = hecl::CVarManager::instance()->findCVar("debugOverlay.showResourceStats");
if (g_StateManager) {
if (showFrameIdx && showFrameIdx->toBoolean())
overlayText += fmt::format(fmt("Frame: {}\n"), g_StateManager->GetUpdateFrameIndex());
overlayText += fmt::format(FMT_STRING("Frame: {}\n"), g_StateManager->GetUpdateFrameIndex());
if (showInGameTime && showInGameTime->toBoolean()) {
double igt = g_GameState->GetTotalPlayTime();
u32 ms = u64(igt * 1000) % 1000;
auto pt = std::div(igt, 3600);
overlayText +=
fmt::format(fmt("PlayTime: {:02d}:{:02d}:{:02d}.{:03d}\n"), pt.quot, pt.rem / 60, pt.rem % 60, ms);
fmt::format(FMT_STRING("PlayTime: {:02d}:{:02d}:{:02d}.{:03d}\n"), pt.quot, pt.rem / 60, pt.rem % 60, ms);
}
if (g_StateManager->Player() && playerInfo && playerInfo->toBoolean()) {
@ -85,7 +85,7 @@ void ViewManager::TestGameView::think() {
const zeus::CQuaternion plQ = zeus::CQuaternion(pl.GetTransform().getRotation().buildMatrix3f());
const zeus::CTransform camXf = g_StateManager->GetCameraManager()->GetCurrentCameraTransform(*g_StateManager);
const zeus::CQuaternion camQ = zeus::CQuaternion(camXf.getRotation().buildMatrix3f());
overlayText += fmt::format(fmt("Player Position: x {}, y {}, z {}\n"
overlayText += fmt::format(FMT_STRING("Player Position: x {}, y {}, z {}\n"
" Roll: {}, Pitch: {}, Yaw: {}\n"
" Momentum: x {}, y: {}, z: {}\n"
" Velocity: x {}, y: {}, z: {}\n"
@ -102,7 +102,7 @@ void ViewManager::TestGameView::think() {
TLockedToken<CStringTable> tbl =
g_SimplePool->GetObj({FOURCC('STRG'), g_StateManager->GetWorld()->IGetStringTableAssetId()});
const urde::TAreaId aId = g_GameState->CurrentWorldState().GetCurrentAreaId();
overlayText += fmt::format(fmt("World: 0x{}{}, Area: {}\n"), g_GameState->CurrentWorldAssetId(),
overlayText += fmt::format(FMT_STRING("World: 0x{}{}, Area: {}\n"), g_GameState->CurrentWorldAssetId(),
(tbl.IsLoaded() ? (" " + hecl::Char16ToUTF8(tbl->GetString(0))).c_str() : ""), aId);
}
@ -119,7 +119,7 @@ void ViewManager::TestGameView::think() {
} else
layerBits += "0";
}
overlayText += fmt::format(fmt("Area AssetId: 0x{}, Total Objects: {}\n"
overlayText += fmt::format(FMT_STRING("Area AssetId: 0x{}, Total Objects: {}\n"
"Active Layer bits: {}\n"),
g_StateManager->GetWorld()->GetArea(aId)->GetAreaAssetId(),
g_StateManager->GetAllObjectList().size(), layerBits);
@ -127,7 +127,7 @@ void ViewManager::TestGameView::think() {
}
if (showResourceStats && showResourceStats->toBoolean())
overlayText += fmt::format(fmt("Resource Objects: {}\n"), g_SimplePool->GetLiveObjects());
overlayText += fmt::format(FMT_STRING("Resource Objects: {}\n"), g_SimplePool->GetLiveObjects());
if (!overlayText.empty())
m_debugText->typesetGlyphs(overlayText);
@ -200,8 +200,8 @@ ViewManager::ViewManager(hecl::Runtime::FileStoreManager& fileMgr, hecl::CVarMan
, m_projManager(*this)
, m_fontCache(fileMgr)
, m_locale(locale::SystemLocaleOrEnglish())
, m_recentProjectsPath(fmt::format(fmt(_SYS_STR("{}/recent_projects.txt")), fileMgr.getStoreRoot()))
, m_recentFilesPath(fmt::format(fmt(_SYS_STR("{}/recent_files.txt")), fileMgr.getStoreRoot())) {
, m_recentProjectsPath(fmt::format(FMT_STRING(_SYS_STR("{}/recent_projects.txt")), fileMgr.getStoreRoot()))
, m_recentFilesPath(fmt::format(FMT_STRING(_SYS_STR("{}/recent_files.txt")), fileMgr.getStoreRoot())) {
Space::SpaceMenuNode::InitializeStrings(*this);
char path[2048];
hecl::Sstat theStat;
@ -246,7 +246,7 @@ void ViewManager::pushRecentProject(hecl::SystemStringView path) {
}
for (const hecl::SystemString& pPath : m_recentProjects) {
fmt::print(fp.get(), fmt("{}\n"), hecl::SystemUTF8Conv(pPath));
fmt::print(fp.get(), FMT_STRING("{}\n"), hecl::SystemUTF8Conv(pPath));
}
}
@ -263,7 +263,7 @@ void ViewManager::pushRecentFile(hecl::SystemStringView path) {
}
for (const hecl::SystemString& pPath : m_recentFiles) {
fmt::print(fp.get(), fmt("{}\n"), hecl::SystemUTF8Conv(pPath));
fmt::print(fp.get(), FMT_STRING("{}\n"), hecl::SystemUTF8Conv(pPath));
}
}
@ -278,7 +278,7 @@ void ViewManager::init(boo::IApplication* app) {
m_pipelineConv = hecl::NewPipelineConverter(m_mainBooFactory);
hecl::conv = m_pipelineConv.get();
m_mainPlatformName = m_mainBooFactory->platformName();
m_mainWindow->setTitle(fmt::format(fmt(_SYS_STR("URDE [{}]")), m_mainPlatformName));
m_mainWindow->setTitle(fmt::format(FMT_STRING(_SYS_STR("URDE [{}]")), m_mainPlatformName));
m_mainCommandQueue = m_mainWindow->getCommandQueue();
m_viewResources.init(m_mainBooFactory, &m_fontCache, &m_themeData, pixelFactor);
InitializeIcons(m_viewResources);

View File

@ -16,7 +16,7 @@ void InitializeBadging(specter::ViewResources& viewRes) {
size_t fmt = r.readUint32Big();
if (fmt != 16)
Log.report(logvisor::Fatal, fmt("incorrect icon texture format"));
Log.report(logvisor::Fatal, FMT_STRING("incorrect icon texture format"));
size_t width = r.readUint16Big();
size_t height = r.readUint16Big();
size_t mips = r.readUint32Big();
@ -26,7 +26,7 @@ void InitializeBadging(specter::ViewResources& viewRes) {
uLongf destSz = decompSz;
size_t pos = r.position();
if (uncompress(texels.get(), &destSz, URDE_BADGE + pos, URDE_BADGE_SZ - pos) != Z_OK)
Log.report(logvisor::Fatal, fmt("unable to decompress badge"));
Log.report(logvisor::Fatal, FMT_STRING("unable to decompress badge"));
viewRes.m_factory->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) {
specter::IconAtlas<1, 1> atlas;

View File

@ -14,7 +14,7 @@ void InitializeIcons(specter::ViewResources& viewRes) {
athena::io::MemoryReader r(URDE_ICONS, URDE_ICONS_SZ);
size_t fmt = r.readUint32Big();
if (fmt != 16)
Log.report(logvisor::Fatal, fmt("incorrect icon texture format"));
Log.report(logvisor::Fatal, FMT_STRING("incorrect icon texture format"));
size_t width = r.readUint16Big();
size_t height = r.readUint16Big();
size_t mips = r.readUint32Big();
@ -24,7 +24,7 @@ void InitializeIcons(specter::ViewResources& viewRes) {
uLongf destSz = decompSz;
size_t pos = r.position();
if (uncompress(texels.get(), &destSz, URDE_ICONS + pos, URDE_ICONS_SZ - pos) != Z_OK)
Log.report(logvisor::Fatal, fmt("unable to decompress icons"));
Log.report(logvisor::Fatal, FMT_STRING("unable to decompress icons"));
viewRes.m_factory->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) {
g_IconAtlas.initializeAtlas(ctx.newStaticTexture(width, height, mips, boo::TextureFormat::RGBA8,

@ -1 +1 @@
Subproject commit 9b765b58cf7389014f7e89a9dfb92da98ce89962
Subproject commit c595cf725f657f3542264d7a244c14716ec41bfa

View File

@ -94,16 +94,16 @@ struct Application : boo::IApplicationCallback {
if (arg.find(_SYS_STR("--verbosity=")) == 0 || arg.find(_SYS_STR("-v=")) == 0) {
hecl::SystemUTF8Conv utf8Arg(arg.substr(arg.find_last_of('=') + 1));
hecl::VerbosityLevel = atoi(utf8Arg.c_str());
hecl::LogModule.report(logvisor::Info, fmt("Set verbosity level to {}"), hecl::VerbosityLevel);
hecl::LogModule.report(logvisor::Info, FMT_STRING("Set verbosity level to {}"), hecl::VerbosityLevel);
}
}
m_cvarManager.parseCommandLine(app->getArgs());
const zeus::CPUInfo& cpuInf = zeus::cpuFeatures();
Log.report(logvisor::Info, fmt("CPU Name: {}"), cpuInf.cpuBrand);
Log.report(logvisor::Info, fmt("CPU Vendor: {}"), cpuInf.cpuVendor);
Log.report(logvisor::Info, fmt(_SYS_STR("CPU Features: {}")), CPUFeatureString(cpuInf));
Log.report(logvisor::Info, FMT_STRING("CPU Name: {}"), cpuInf.cpuBrand);
Log.report(logvisor::Info, FMT_STRING("CPU Vendor: {}"), cpuInf.cpuVendor);
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("CPU Features: {}")), CPUFeatureString(cpuInf));
}
std::string getGraphicsApi() const { return m_cvarCommons.getGraphicsApi(); }
@ -145,11 +145,11 @@ static void SetupBasics(bool logging) {
auto result = zeus::validateCPU();
if (!result.first) {
#if _WIN32 && !WINDOWS_STORE
std::wstring msg = fmt::format(fmt(L"ERROR: This build of URDE requires the following CPU features:\n{}\n"),
std::wstring msg = fmt::format(FMT_STRING(L"ERROR: This build of URDE requires the following CPU features:\n{}\n"),
urde::CPUFeatureString(result.second));
MessageBoxW(nullptr, msg.c_str(), L"CPU error", MB_OK | MB_ICONERROR);
#else
fmt::print(stderr, fmt("ERROR: This build of URDE requires the following CPU features:\n{}\n"),
fmt::print(stderr, FMT_STRING("ERROR: This build of URDE requires the following CPU features:\n{}\n"),
urde::CPUFeatureString(result.second));
#endif
exit(1);
@ -176,7 +176,7 @@ int main(int argc, const boo::SystemChar** argv)
#endif
{
if (argc > 1 && !hecl::StrCmp(argv[1], _SYS_STR("--dlpackage"))) {
fmt::print(fmt("{}\n"), URDE_DLPACKAGE);
fmt::print(FMT_STRING("{}\n"), URDE_DLPACKAGE);
return 100;
}

View File

@ -183,7 +183,7 @@ static logvisor::Module Log("CNESEmulator");
CNESEmulator::CNESEmulator() {
if (EmulatorConstructed)
Log.report(logvisor::Fatal, fmt("Attempted constructing more than 1 CNESEmulator"));
Log.report(logvisor::Fatal, FMT_STRING("Attempted constructing more than 1 CNESEmulator"));
EmulatorConstructed = true;
CDvdFile NESEmuFile("NESemuP.rel");
@ -191,7 +191,7 @@ CNESEmulator::CNESEmulator() {
m_nesEmuPBuf.reset(new u8[0x20000]);
m_dvdReq = NESEmuFile.AsyncSeekRead(m_nesEmuPBuf.get(), 0x20000, ESeekOrigin::Begin, NESEMUP_ROM_OFFSET);
} else {
Log.report(logvisor::Fatal, fmt("Unable to open NESemuP.rel"));
Log.report(logvisor::Fatal, FMT_STRING("Unable to open NESemuP.rel"));
}
}

View File

@ -22,6 +22,7 @@ s16 s_DefaultVolumeScale = 0x7f;
CAudioSys* CAudioSys::g_SharedSys = nullptr;
TLockedToken<CAudioGroupSet> CAudioSys::FindGroupSet(std::string_view name) {
// TODO: Heterogeneous lookup when C++20 available
auto search = mpGroupSetDB.find(name.data());
if (search == mpGroupSetDB.cend())
return {};

View File

@ -1048,15 +1048,15 @@ void CAutoMapper::ProcessControllerInput(const CFinalInput& input, CStateManager
x308_textpane_instructions2->TextSupport().SetText(u"");
} else {
x2fc_textpane_hint->TextSupport().SetText(u"");
std::u16string str = fmt::format(fmt(u"&image=SI,0.6,1.0,{};"), g_tweakPlayerRes->x24_lStick[x2e4_lStickPos]);
std::u16string str = fmt::format(FMT_STRING(u"&image=SI,0.6,1.0,{};"), g_tweakPlayerRes->x24_lStick[x2e4_lStickPos]);
str += g_MainStringTable->GetString(46); // Rotate
x300_textpane_instructions->TextSupport().SetText(str);
str = fmt::format(fmt(u"&image=SI,0.6,1.0,{};"), g_tweakPlayerRes->x4c_cStick[x2e8_rStickPos]);
str = fmt::format(FMT_STRING(u"&image=SI,0.6,1.0,{};"), g_tweakPlayerRes->x4c_cStick[x2e8_rStickPos]);
str += g_MainStringTable->GetString(47); // Move
x304_textpane_instructions1->TextSupport().SetText(str);
str = fmt::format(fmt(u"&image={};"), g_tweakPlayerRes->x74_lTrigger[x2ec_lTriggerPos]);
str = fmt::format(FMT_STRING(u"&image={};"), g_tweakPlayerRes->x74_lTrigger[x2ec_lTriggerPos]);
str += g_MainStringTable->GetString(48); // Zoom
str += fmt::format(fmt(u"&image={};"), g_tweakPlayerRes->x80_rTrigger[x2f0_rTriggerPos]);
str += fmt::format(FMT_STRING(u"&image={};"), g_tweakPlayerRes->x80_rTrigger[x2f0_rTriggerPos]);
x308_textpane_instructions2->TextSupport().SetText(str);
}
}
@ -1129,7 +1129,7 @@ void CAutoMapper::Update(float dt, CStateManager& mgr) {
std::u16string string;
if (x1bc_state == EAutoMapperState::MapScreenUniverse ||
(x1bc_state == EAutoMapperState::MapScreen && HasCurrentMapUniverseWorld()))
string = fmt::format(fmt(u"&image={};"), g_tweakPlayerRes->x98_aButton[x2f4_aButtonPos]);
string = fmt::format(FMT_STRING(u"&image={};"), g_tweakPlayerRes->x98_aButton[x2f4_aButtonPos]);
right1->TextSupport().SetText(string);
CGuiTextPane* right = static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_right"));
if (x1bc_state == EAutoMapperState::MapScreenUniverse)

View File

@ -44,7 +44,7 @@ u8* CGameAllocator::Alloc(size_t len) {
void CGameAllocator::Free(u8* ptr) {
SChunkDescription* info = reinterpret_cast<SChunkDescription*>(ptr - sizeof(SChunkDescription));
if (info->magic != 0xE8E8E8E8 || info->sentinal != 0xEFEFEFEF) {
AllocLog.report(logvisor::Fatal, fmt(_SYS_STR("Invalid chunk description, memory corruption!")));
AllocLog.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Invalid chunk description, memory corruption!")));
return;
}

View File

@ -67,7 +67,7 @@ public:
bool ReadFromMemoryCard(std::string_view name) { return true; }
static std::string GetIdentifierForMidiEvent(CAssetId world, CAssetId area, std::string_view midiObj) {
return fmt::format(fmt("World {} Area {} MidiObject: {}"), world, area, midiObj);
return fmt::format(FMT_STRING("World {} Area {} MidiObject: {}"), world, area, midiObj);
}
};

View File

@ -11,13 +11,13 @@ kabufuda::SystemString CMemoryCardSys::ResolveDolphinCardPath(kabufuda::ECardSlo
/* XDG-selected data path */
kabufuda::SystemString path =
((dataHome && dataHome[0] == '/') ? dataHome : hecl::SystemString(home)) + "/.local/share/dolphin-emu";
path += fmt::format(fmt("/GC/MemoryCard{:c}.USA.raw"), slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B');
path += fmt::format(FMT_STRING("/GC/MemoryCard{:c}.USA.raw"), slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B');
hecl::Sstat theStat;
if (hecl::Stat(path.c_str(), &theStat) || !S_ISREG(theStat.st_mode)) {
/* legacy case for older dolphin versions */
path = home;
path += fmt::format(fmt("/.dolphin-emu/GC/MemoryCard{:c}.USA.raw"), slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B');
path += fmt::format(FMT_STRING("/.dolphin-emu/GC/MemoryCard{:c}.USA.raw"), slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B');
if (hecl::Stat(path.c_str(), &theStat) || !S_ISREG(theStat.st_mode))
return {};
}
@ -38,7 +38,7 @@ kabufuda::SystemString CMemoryCardSys::_CreateDolphinCard(kabufuda::ECardSlot sl
if (hecl::RecursiveMakeDir(path.c_str()) < 0)
return {};
path += fmt::format(fmt("/MemoryCard{:c}.USA.raw"), slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B');
path += fmt::format(FMT_STRING("/MemoryCard{:c}.USA.raw"), slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B');
const auto fp = hecl::FopenUnique(path.c_str(), "wb");
if (fp == nullptr) {
return {};

View File

@ -8,7 +8,7 @@ kabufuda::SystemString CMemoryCardSys::ResolveDolphinCardPath(kabufuda::ECardSlo
return {};
kabufuda::SystemString path = home;
path += fmt::format(fmt("/Library/Application Support/Dolphin/GC/MemoryCard{:c}.USA.raw"),
path += fmt::format(FMT_STRING("/Library/Application Support/Dolphin/GC/MemoryCard{:c}.USA.raw"),
slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B');
hecl::Sstat theStat;
@ -28,7 +28,7 @@ kabufuda::SystemString CMemoryCardSys::_CreateDolphinCard(kabufuda::ECardSlot sl
if (hecl::RecursiveMakeDir(path.c_str()) < 0)
return {};
path += fmt::format(fmt("/MemoryCard{:c}.USA.raw"), slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B');
path += fmt::format(FMT_STRING("/MemoryCard{:c}.USA.raw"), slot == kabufuda::ECardSlot::SlotA ? 'A' : 'B');
const auto fp = hecl::FopenUnique(path.c_str(), "wb");
if (fp == nullptr) {
return {};

View File

@ -48,7 +48,7 @@ kabufuda::SystemString CMemoryCardSys::ResolveDolphinCardPath(kabufuda::ECardSlo
kabufuda::SystemString path(localFolder->Path->Data());
#endif
path += fmt::format(fmt(_SYS_STR("/GC/MemoryCard{}.USA.raw")),
path += fmt::format(FMT_STRING(_SYS_STR("/GC/MemoryCard{}.USA.raw")),
slot == kabufuda::ECardSlot::SlotA ? _SYS_STR('A') : _SYS_STR('B'));
hecl::Sstat theStat;
@ -99,7 +99,7 @@ kabufuda::SystemString CMemoryCardSys::_CreateDolphinCard(kabufuda::ECardSlot sl
if (hecl::RecursiveMakeDir(path.c_str()) < 0)
return {};
path += fmt::format(fmt(_SYS_STR("/MemoryCard{}.USA.raw")),
path += fmt::format(FMT_STRING(_SYS_STR("/MemoryCard{}.USA.raw")),
slot == kabufuda::ECardSlot::SlotA ? _SYS_STR('A') : _SYS_STR('B'));
const auto fp = hecl::FopenUnique(path.c_str(), _SYS_STR("wb"));
if (fp == nullptr) {

View File

@ -13,7 +13,7 @@ void CObjectList::AddObject(CEntity& entity) {
#ifndef NDEBUG
if (x0_list[entity.GetUniqueId().Value()].entity != nullptr &&
x0_list[entity.GetUniqueId().Value()].entity != &entity)
Log.report(logvisor::Level::Fatal, fmt("INVALID USAGE DETECTED: Attempting to assign entity '{} ({})' to existing node '{}'!!!"),
Log.report(logvisor::Level::Fatal, FMT_STRING("INVALID USAGE DETECTED: Attempting to assign entity '{} ({})' to existing node '{}'!!!"),
entity.GetName(), entity.GetEditorId(), entity.GetUniqueId().Value());
#endif
s16 prevFirst = -1;

View File

@ -5,7 +5,7 @@ static logvisor::Module Log("urde::CPakFile");
CPakFile::CPakFile(std::string_view filename, bool buildDepList, bool worldPak, bool override) : CDvdFile(filename) {
if (!CDvdFile::operator bool())
Log.report(logvisor::Fatal, fmt("{}: Unable to open"), GetPath());
Log.report(logvisor::Fatal, FMT_STRING("{}: Unable to open"), GetPath());
x28_24_buildDepList = buildDepList;
//x28_24_buildDepList = true; // Always do this so URDE can rapidly pre-warm shaders
x28_25_aramFile = false;
@ -67,7 +67,7 @@ void CPakFile::InitialHeaderLoad() {
u32 version = r.readUint32Big();
if (version != 0x80030005) {
Log.report(logvisor::Fatal,
fmt("{}: Incompatible pak file version -- Current version is {:08X}, you're using {:08X}"),
FMT_STRING("{}: Incompatible pak file version -- Current version is {:08X}, you're using {:08X}"),
GetPath(), 0x80030005, version);
return;
}

View File

@ -28,7 +28,7 @@ CFactoryFnReturn CResFactory::BuildSync(const SObjectTag& tag, const CVParamTran
else
ret = std::make_unique<TObjOwnerDerivedFromIObjUntyped>(nullptr);
}
Log.report(logvisor::Warning, fmt("sync-built {}"), tag);
Log.report(logvisor::Warning, FMT_STRING("sync-built {}"), tag);
return ret;
}
@ -38,7 +38,7 @@ bool CResFactory::PumpResource(SLoadingData& data) {
*data.xc_targetPtr =
x5c_factoryMgr.MakeObjectFromMemory(data.x0_tag, std::move(data.x10_loadBuffer), data.x14_resSize,
data.m_compressed, data.x18_cvXfer, data.m_selfRef);
Log.report(logvisor::Info, fmt("async-built {}"), data.x0_tag);
Log.report(logvisor::Info, FMT_STRING("async-built {}"), data.x0_tag);
return true;
}
return false;

View File

@ -210,7 +210,7 @@ bool CResLoader::FindResource(CAssetId id) const {
return true;
}
Log.report(logvisor::Warning, fmt("Unable to find asset {}"), id);
Log.report(logvisor::Warning, FMT_STRING("Unable to find asset {}"), id);
return false;
}
@ -234,7 +234,7 @@ CPakFile* CResLoader::FindResourceForLoad(CAssetId id) {
}
}
Log.report(logvisor::Error, fmt("Unable to find asset {}"), id);
Log.report(logvisor::Error, FMT_STRING("Unable to find asset {}"), id);
return nullptr;
}

View File

@ -916,7 +916,7 @@ void CStateManager::DrawActorCubeFaces(CActor& actor, int& cubeInst) const {
}
for (int f = 0; f < 6; ++f) {
SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(fmt("CStateManager::DrawActorCubeFaces [{}] {} {} {}"), f,
SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(FMT_STRING("CStateManager::DrawActorCubeFaces [{}] {} {} {}"), f,
actor.GetUniqueId(), actor.GetEditorId(), actor.GetName())
.c_str(),
zeus::skOrange);
@ -1211,7 +1211,7 @@ void CStateManager::RecursiveDrawTree(TUniqueId node) {
void CStateManager::SendScriptMsg(CEntity* dest, TUniqueId src, EScriptObjectMessage msg) {
if (dest && !dest->x30_26_scriptingBlocked) {
if (sm_logScripting && sm_logScripting->toBoolean())
LogModule.report(logvisor::Info, fmt("Sending '{}' to '{}' id= {}"), ScriptObjectMessageToStr(msg),
LogModule.report(logvisor::Info, FMT_STRING("Sending '{}' to '{}' id= {}"), ScriptObjectMessageToStr(msg),
dest->GetName(), dest->GetUniqueId());
dest->AcceptScriptMsg(msg, src, *this);
}
@ -1226,7 +1226,7 @@ void CStateManager::SendScriptMsgAlways(TUniqueId dest, TUniqueId src, EScriptOb
CEntity* dst = ObjectById(dest);
if (dst) {
if (sm_logScripting && sm_logScripting->toBoolean())
LogModule.report(logvisor::Info, fmt("Sending '{}' to '{}' id= {}"), ScriptObjectMessageToStr(msg),
LogModule.report(logvisor::Info, FMT_STRING("Sending '{}' to '{}' id= {}"), ScriptObjectMessageToStr(msg),
dst->GetName(), dst->GetUniqueId());
dst->AcceptScriptMsg(msg, src, *this);
}
@ -1282,7 +1282,7 @@ void CStateManager::FreeScriptObject(TUniqueId id) {
}
if (sm_logScripting && sm_logScripting->toBoolean())
LogModule.report(logvisor::Info, fmt("Removed '{}'"), ent->GetName());
LogModule.report(logvisor::Info, FMT_STRING("Removed '{}'"), ent->GetName());
}
std::pair<const SScriptObjectStream*, TEditorId> CStateManager::GetBuildForScript(TEditorId id) const {
@ -1374,16 +1374,16 @@ std::pair<TEditorId, TUniqueId> CStateManager::LoadScriptObject(TAreaId aid, ESc
u32 readAmt = in.position() - startPos;
if (readAmt > length)
LogModule.report(logvisor::Fatal, fmt("Script object overread while reading {}"), ScriptObjectTypeToStr(type));
LogModule.report(logvisor::Fatal, FMT_STRING("Script object overread while reading {}"), ScriptObjectTypeToStr(type));
u32 leftover = length - readAmt;
for (u32 i = 0; i < leftover; ++i)
in.readByte();
if (error || ent == nullptr) {
LogModule.report(logvisor::Error, fmt("Script load error while loading {}"), ScriptObjectTypeToStr(type));
LogModule.report(logvisor::Error, FMT_STRING("Script load error while loading {}"), ScriptObjectTypeToStr(type));
return {kInvalidEditorId, kInvalidUniqueId};
} else {
LogModule.report(logvisor::Info, fmt("Loaded {} in area {}"), ent->GetName(), ent->GetAreaIdAlways());
LogModule.report(logvisor::Info, FMT_STRING("Loaded {} in area {}"), ent->GetName(), ent->GetAreaIdAlways());
return {id, ent->GetUniqueId()};
}
}
@ -2471,7 +2471,7 @@ void CStateManager::AddObject(CEntity& ent) {
}
if (sm_logScripting && sm_logScripting->toBoolean())
LogModule.report(logvisor::Info, fmt("Added '{}'"), ent.GetName());
LogModule.report(logvisor::Info, FMT_STRING("Added '{}'"), ent.GetName());
}
void CStateManager::AddObject(CEntity* ent) {
@ -2516,7 +2516,7 @@ TUniqueId CStateManager::AllocateUniqueId() {
ourIndex = x0_nextFreeIndex;
x0_nextFreeIndex = (x0_nextFreeIndex + 1) & 0x3ff;
if (x0_nextFreeIndex == lastIndex)
LogModule.report(logvisor::Fatal, fmt("Object List Full!"));
LogModule.report(logvisor::Fatal, FMT_STRING("Object List Full!"));
} while (GetAllObjectList().GetObjectByIndex(ourIndex) != nullptr);
x8_idArr[ourIndex] = (x8_idArr[ourIndex] + 1) & 0x3f;

View File

@ -13,7 +13,7 @@ public:
double t = std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::steady_clock::now() - m_start).count() / 1000000.0;
#ifndef NDEBUG
fmt::print(fmt("{} {}\n"), name, t);
fmt::print(FMT_STRING("{} {}\n"), name, t);
#endif
return t;
}
@ -21,7 +21,7 @@ public:
std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
double t = std::chrono::duration_cast<std::chrono::microseconds>(now - m_start).count() / 1000000.0;
#ifndef NDEBUG
fmt::print(fmt("{} {}\n"), name, t);
fmt::print(FMT_STRING("{} {}\n"), name, t);
#endif
m_start = now;
return t;

View File

@ -21,7 +21,7 @@ void CAnimFormatUnion::SubConstruct(u8* storage, EAnimFormat fmt, CInputStream&
new (storage) CFBStreamedCompression(in, store, true);
break;
default:
Log.report(logvisor::Fatal, fmt("unable to read ANIM format {}"), int(fmt));
Log.report(logvisor::Fatal, FMT_STRING("unable to read ANIM format {}"), int(fmt));
}
}

View File

@ -86,7 +86,7 @@ CAnimData::CAnimData(CAssetId id, const CCharacterInfo& character, int defaultAn
if (defaultAnim == -1) {
defaultAnim = 0;
Log.report(logvisor::Warning, fmt("Character {} has invalid initial animation, so defaulting to first."),
Log.report(logvisor::Warning, FMT_STRING("Character {} has invalid initial animation, so defaulting to first."),
character.GetCharacterName());
}

View File

@ -29,7 +29,7 @@ CModelData::CModelData(const CStaticRes& res, int instCount)
: x0_scale(res.GetScale()), x14_24_renderSorted(false), x14_25_sortThermal(false), m_drawInstCount(instCount) {
x1c_normalModel = g_SimplePool->GetObj({SBIG('CMDL'), res.GetId()});
if (!x1c_normalModel)
Log.report(logvisor::Fatal, fmt("unable to find CMDL {}"), res.GetId());
Log.report(logvisor::Fatal, FMT_STRING("unable to find CMDL {}"), res.GetId());
m_normalModelInst = x1c_normalModel->MakeNewInstance(0, instCount);
}
@ -146,7 +146,7 @@ void CModelData::SetXRayModel(const std::pair<CAssetId, CAssetId>& modelSkin) {
} else {
x2c_xrayModel = g_SimplePool->GetObj({SBIG('CMDL'), modelSkin.first});
if (!x2c_xrayModel)
Log.report(logvisor::Fatal, fmt("unable to find CMDL {}"), modelSkin.first);
Log.report(logvisor::Fatal, FMT_STRING("unable to find CMDL {}"), modelSkin.first);
m_xrayModelInst = x2c_xrayModel->MakeNewInstance(0, m_drawInstCount);
}
}
@ -163,7 +163,7 @@ void CModelData::SetInfraModel(const std::pair<CAssetId, CAssetId>& modelSkin) {
} else {
x3c_infraModel = g_SimplePool->GetObj({SBIG('CMDL'), modelSkin.first});
if (!x3c_infraModel)
Log.report(logvisor::Fatal, fmt("unable to find CMDL {}"), modelSkin.first);
Log.report(logvisor::Fatal, FMT_STRING("unable to find CMDL {}"), modelSkin.first);
m_infraModelInst = x3c_infraModel->MakeNewInstance(0, m_drawInstCount);
}
}

View File

@ -273,6 +273,7 @@ void CParticleDatabase::AddToRendererClipped(const zeus::CFrustum& frustum) cons
}
CParticleGenInfo* CParticleDatabase::GetParticleEffect(std::string_view name) const {
// TODO: Heterogeneous lookup when C++20 available
auto search = x3c_rendererDrawLoop.find(name.data());
if (search != x3c_rendererDrawLoop.end())
return search->second.get();

View File

@ -148,7 +148,7 @@ void Buckets::Sort() {
if (bucket.size() < bucket.capacity())
bucket.push_back(&drawable);
// else
// Log.report(logvisor::Fatal, fmt("Full bucket!!!"));
// Log.report(logvisor::Fatal, FMT_STRING("Full bucket!!!"));
}
u16 bucketIdx = u16(sBuckets->size());
@ -183,7 +183,7 @@ void Buckets::InsertPlaneObject(float closeDist, float farDist, const zeus::CAAB
void Buckets::Insert(const zeus::CVector3f& pos, const zeus::CAABox& aabb, EDrawableType dtype, void* data,
const zeus::CPlane& plane, u16 extraSort) {
if (sData->size() == sData->capacity()) {
Log.report(logvisor::Fatal, fmt("Rendering buckets filled to capacity"));
Log.report(logvisor::Fatal, FMT_STRING("Rendering buckets filled to capacity"));
return;
}

View File

@ -24,7 +24,7 @@ CLineRenderer::CLineRenderer(boo::IGraphicsDataFactory::Context& ctx, EPrimitive
const boo::ObjToken<boo::ITexture>& texture, bool additive, bool zTest, bool zGEqual)
: m_mode(mode), m_maxVerts(maxVerts) {
if (maxVerts < 2) {
LineRendererLog.report(logvisor::Fatal, fmt(_SYS_STR("maxVerts < 2, maxVerts = {}")), maxVerts);
LineRendererLog.report(logvisor::Fatal, FMT_STRING(_SYS_STR("maxVerts < 2, maxVerts = {}")), maxVerts);
return;
}
m_textured = bool(texture);
@ -55,7 +55,7 @@ CLineRenderer::CLineRenderer(EPrimitiveMode mode, u32 maxVerts, const boo::ObjTo
bool additive, bool zTest, bool zGEqual)
: m_mode(mode), m_maxVerts(maxVerts) {
if (maxVerts < 2) {
LineRendererLog.report(logvisor::Fatal, fmt(_SYS_STR("maxVerts < 2, maxVerts = {}")), maxVerts);
LineRendererLog.report(logvisor::Fatal, FMT_STRING(_SYS_STR("maxVerts < 2, maxVerts = {}")), maxVerts);
return;
}
m_textured = bool(texture);

View File

@ -268,7 +268,7 @@ CBooModel::ModelInstance* CBooModel::PushNewModelInstance(int sharedLayoutBuf) {
}
if (m_instances.size() >= 512) {
Log.report(logvisor::Fatal, fmt("Model buffer overflow"));
Log.report(logvisor::Fatal, FMT_STRING("Model buffer overflow"));
}
ModelInstance& newInst = m_instances.emplace_back();
@ -640,7 +640,7 @@ static EExtendedShader ResolveExtendedShader(const MaterialSet::Material& data,
void CBooModel::DrawSurface(const CBooSurface& surf, const CModelFlags& flags) const {
// if (m_uniUpdateCount == 0)
// Log.report(logvisor::Fatal, fmt("UpdateUniformData() not called"));
// Log.report(logvisor::Fatal, FMT_STRING("UpdateUniformData() not called"));
if (m_uniUpdateCount == 0 || m_uniUpdateCount > m_instances.size())
return;
const ModelInstance& inst = m_instances[m_uniUpdateCount - 1];
@ -1175,7 +1175,7 @@ CModel::CModel(std::unique_ptr<u8[]>&& in, u32 /* dataLen */, IObjectStore* stor
u32 version = hecl::SBig(*reinterpret_cast<u32*>(data.get() + 0x4));
m_flags = hecl::SBig(*reinterpret_cast<u32*>(data.get() + 0x8));
if (version != 0x10002)
Log.report(logvisor::Fatal, fmt("invalid CMDL for loading with boo"));
Log.report(logvisor::Fatal, FMT_STRING("invalid CMDL for loading with boo"));
u32 secCount = hecl::SBig(*reinterpret_cast<u32*>(data.get() + 0x24));
u32 matSetCount = hecl::SBig(*reinterpret_cast<u32*>(data.get() + 0x28));

View File

@ -12,13 +12,13 @@ CSkinnedModel::CSkinnedModel(TLockedToken<CModel> model, TLockedToken<CSkinRules
TLockedToken<CCharLayoutInfo> layoutInfo, int shaderIdx, int drawInsts)
: x4_model(std::move(model)), x10_skinRules(std::move(skinRules)), x1c_layoutInfo(std::move(layoutInfo)) {
if (!x4_model) {
Log.report(logvisor::Fatal, fmt("bad model token provided to CSkinnedModel"));
Log.report(logvisor::Fatal, FMT_STRING("bad model token provided to CSkinnedModel"));
}
if (!x10_skinRules) {
Log.report(logvisor::Fatal, fmt("bad skin token provided to CSkinnedModel"));
Log.report(logvisor::Fatal, FMT_STRING("bad skin token provided to CSkinnedModel"));
}
if (!x1c_layoutInfo) {
Log.report(logvisor::Fatal, fmt("bad character layout token provided to CSkinnedModel"));
Log.report(logvisor::Fatal, FMT_STRING("bad character layout token provided to CSkinnedModel"));
}
m_modelInst = x4_model->MakeNewInstance(shaderIdx, drawInsts);
}

View File

@ -552,7 +552,7 @@ void CTexture::BuildRGBA8(const void* data, size_t length) {
size_t texelCount = ComputeMippedTexelCount();
size_t expectedSize = texelCount * 4;
if (expectedSize > length)
Log.report(logvisor::Fatal, fmt("insufficient TXTR length ({}/{})"), length, expectedSize);
Log.report(logvisor::Fatal, FMT_STRING("insufficient TXTR length ({}/{})"), length, expectedSize);
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8, boo::TextureClampMode::Repeat, data,
@ -565,7 +565,7 @@ void CTexture::BuildRGBA8(const void* data, size_t length) {
void CTexture::BuildC8(const void* data, size_t length) {
size_t texelCount = ComputeMippedTexelCount();
if (texelCount > length)
Log.report(logvisor::Fatal, fmt("insufficient TXTR length ({}/{})"), length, texelCount);
Log.report(logvisor::Fatal, FMT_STRING("insufficient TXTR length ({}/{})"), length, texelCount);
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
uint32_t nentries = hecl::SBig(*reinterpret_cast<const uint32_t*>(data));
@ -763,7 +763,7 @@ CTexture::CTexture(std::unique_ptr<u8[]>&& in, u32 length, bool otex, const CTex
BuildDXT3(owned.get() + 12, length - 12);
break;
default:
Log.report(logvisor::Fatal, fmt("invalid texture type {} for boo"), int(x0_fmt));
Log.report(logvisor::Fatal, FMT_STRING("invalid texture type {} for boo"), int(x0_fmt));
}
if (otex)
@ -775,7 +775,7 @@ void CTexture::Load(int slot, EClampMode clamp) const {}
std::unique_ptr<u8[]> CTexture::BuildMemoryCardTex(u32& sizeOut, ETexelFormat& fmtOut,
std::unique_ptr<u8[]>& paletteOut) const {
if (!m_otex)
Log.report(logvisor::Fatal, fmt("MemoryCard TXTR not loaded with 'otex'"));
Log.report(logvisor::Fatal, FMT_STRING("MemoryCard TXTR not loaded with 'otex'"));
size_t texelCount = x4_w * x6_h;
std::unique_ptr<u8[]> ret;
@ -851,7 +851,7 @@ std::unique_ptr<u8[]> CTexture::BuildMemoryCardTex(u32& sizeOut, ETexelFormat& f
}
}
} else
Log.report(logvisor::Fatal, fmt("MemoryCard texture may only use RGBA8PC or C8PC format"));
Log.report(logvisor::Fatal, FMT_STRING("MemoryCard texture may only use RGBA8PC or C8PC format"));
return ret;
}

View File

@ -57,7 +57,7 @@ void CAuiEnergyBarT01::Draw(const CGuiWidgetDrawParms& drawParms) {
if (!xbc_tex || !xbc_tex.IsLoaded() || !xd8_coordFunc) {
return;
}
SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(fmt("CAuiEnergyBarT01::Draw {}"), m_name).c_str(), zeus::skCyan);
SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(FMT_STRING("CAuiEnergyBarT01::Draw {}"), m_name).c_str(), zeus::skCyan);
CGraphics::SetModelMatrix(x34_worldXF);
m_energyBarShader.updateModelMatrix();

View File

@ -106,7 +106,7 @@ void CAuiImagePane::Draw(const CGuiWidgetDrawParms& params) {
if (!GetIsVisible() || !xb8_tex0Tok.IsLoaded()) {
return;
}
SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(fmt("CAuiImagePane::Draw {}"), m_name).c_str(), zeus::skCyan);
SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(FMT_STRING("CAuiImagePane::Draw {}"), m_name).c_str(), zeus::skCyan);
GetIsFinishedLoadingWidgetSpecific();
if (!m_filters || m_filters->m_texId != xb8_tex0Tok.GetObjectTag()->id) {
m_filters.emplace(xb8_tex0Tok);

View File

@ -65,7 +65,7 @@ CCompoundTargetReticle::CCompoundTargetReticle(const CStateManager& mgr)
, x208_lockonTimer(g_tweakTargeting->GetLockonDuration()) {
xe0_outerBeamIconSquares.reserve(9);
for (u32 i = 0; i < 9; ++i)
xe0_outerBeamIconSquares.emplace_back(fmt::format(fmt("{}{}"), skOuterBeamIconSquareNameBase, i));
xe0_outerBeamIconSquares.emplace_back(fmt::format(FMT_STRING("{}{}"), skOuterBeamIconSquareNameBase, i));
x34_crosshairs.Lock();
}

View File

@ -133,7 +133,7 @@ void CGuiFrame::Reset() {
void CGuiFrame::Update(float dt) { xc_headWidget->Update(dt); }
void CGuiFrame::Draw(const CGuiWidgetDrawParms& parms) const {
SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(fmt("CGuiFrame::Draw FRME_{}"), x0_id).c_str(), zeus::skMagenta);
SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(FMT_STRING("CGuiFrame::Draw FRME_{}"), x0_id).c_str(), zeus::skMagenta);
CGraphics::SetCullMode(ERglCullMode::None);
CGraphics::SetAmbientColor(zeus::skWhite);
DisableLights();

View File

@ -51,7 +51,7 @@ void CGuiModel::Draw(const CGuiWidgetDrawParms& parms) {
}
if (GetIsVisible()) {
SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(fmt("CGuiModel::Draw {}"), m_name).c_str(), zeus::skCyan);
SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(FMT_STRING("CGuiModel::Draw {}"), m_name).c_str(), zeus::skCyan);
zeus::CColor moduCol = xa8_color2;
moduCol.a() *= parms.x0_alphaMod;
xb0_frame->EnableLights(xcc_lightMask, model->GetInstance());

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