diff --git a/DataSpec/AssetNameMap.cpp b/DataSpec/AssetNameMap.cpp index ace70701c..a720d15e0 100644 --- a/DataSpec/AssetNameMap.cpp +++ b/DataSpec/AssetNameMap.cpp @@ -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 */ { diff --git a/DataSpec/DNACommon/ANCS.cpp b/DataSpec/DNACommon/ANCS.cpp index cbe208d8d..0ee44741d 100644 --- a/DataSpec/DNACommon/ANCS.cpp +++ b/DataSpec/DNACommon/ANCS.cpp @@ -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 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); diff --git a/DataSpec/DNACommon/ANIM.cpp b/DataSpec/DNACommon/ANIM.cpp index 895de4afe..42079d125 100644 --- a/DataSpec/DNACommon/ANIM.cpp +++ b/DataSpec/DNACommon/ANIM.cpp @@ -175,7 +175,7 @@ std::vector> 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> 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> 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> 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; } diff --git a/DataSpec/DNACommon/AROTBuilder.cpp b/DataSpec/DNACommon/AROTBuilder.cpp index c31ae21f0..30a2ede2d 100644 --- a/DataSpec/DNACommon/AROTBuilder.cpp +++ b/DataSpec/DNACommon/AROTBuilder.cpp @@ -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 childIndices; diff --git a/DataSpec/DNACommon/ATBL.cpp b/DataSpec/DNACommon/ATBL.cpp index 10e5f3ead..38757305e 100644 --- a/DataSpec/DNACommon/ATBL.cpp +++ b/DataSpec/DNACommon/ATBL.cpp @@ -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()); diff --git a/DataSpec/DNACommon/BabeDead.cpp b/DataSpec/DNACommon/BabeDead.cpp index 2b4d8eed9..51a43ea19 100644 --- a/DataSpec/DNACommon/BabeDead.cpp +++ b/DataSpec/DNACommon/BabeDead.cpp @@ -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; diff --git a/DataSpec/DNACommon/CMDL.cpp b/DataSpec/DNACommon/CMDL.cpp index 487a113b3..bbb099792 100644 --- a/DataSpec/DNACommon/CMDL.cpp +++ b/DataSpec/DNACommon/CMDL.cpp @@ -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>>& ev : m_extraVerts) { for (const std::pair& 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>& 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) { diff --git a/DataSpec/DNACommon/DNACommon.cpp b/DataSpec/DNACommon/DNACommon.cpp index 0ddf8c344..dcf816b81 100644 --- a/DataSpec/DNACommon/DNACommon.cpp +++ b/DataSpec/DNACommon/DNACommon.cpp @@ -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(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(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(typename BinarySize::StreamT& s) } std::string UniqueID128::toString() const { - return fmt::format(fmt("{}"), *this); + return fmt::format(FMT_STRING("{}"), *this); } /** Word Bitmap reader/writer */ diff --git a/DataSpec/DNACommon/DNACommon.hpp b/DataSpec/DNACommon/DNACommon.hpp index 08587bb3d..6ef5263fb 100644 --- a/DataSpec/DNACommon/DNACommon.hpp +++ b/DataSpec/DNACommon/DNACommon.hpp @@ -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(); } }; diff --git a/DataSpec/DNACommon/DeafBabe.cpp b/DataSpec/DNACommon/DeafBabe.cpp index 5f93be382..c18bb7162 100644 --- a/DataSpec/DNACommon/DeafBabe.cpp +++ b/DataSpec/DNACommon/DeafBabe.cpp @@ -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"; diff --git a/DataSpec/DNACommon/FONT.cpp b/DataSpec/DNACommon/FONT.cpp index 7cab85f3c..3e3e652b8 100644 --- a/DataSpec/DNACommon/FONT.cpp +++ b/DataSpec/DNACommon/FONT.cpp @@ -13,7 +13,7 @@ void FONT::_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 */ diff --git a/DataSpec/DNACommon/FSM2.cpp b/DataSpec/DNACommon/FSM2.cpp index e13d4753a..27b73f457 100644 --- a/DataSpec/DNACommon/FSM2.cpp +++ b/DataSpec/DNACommon/FSM2.cpp @@ -16,7 +16,7 @@ template void FSM2::Enumerate(typename Op::StreamT& s) { Do(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::Enumerate(typename Op::StreamT& s) { detail.reset(new FSMV2); Do(athena::io::PropId{"detail"}, static_cast(*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; } } diff --git a/DataSpec/DNACommon/MAPA.cpp b/DataSpec/DNACommon/MAPA.cpp index 3e8a868f5..2cc8e85d9 100644 --- a/DataSpec/DNACommon/MAPA.cpp +++ b/DataSpec/DNACommon/MAPA.cpp @@ -21,7 +21,7 @@ void MAPA::Enumerate(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(typename Read::StreamT& __dna_reader) { else if (version == 5) header = std::make_unique(); 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>(hecl::blender::Con template 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; } diff --git a/DataSpec/DNACommon/MAPU.cpp b/DataSpec/DNACommon/MAPU.cpp index d6f1210f4..e3e7dcf9f 100644 --- a/DataSpec/DNACommon/MAPU.cpp +++ b/DataSpec/DNACommon/MAPU.cpp @@ -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" diff --git a/DataSpec/DNACommon/MLVL.cpp b/DataSpec/DNACommon/MLVL.cpp index 1db5939b1..94df2d0ca 100644 --- a/DataSpec/DNACommon/MLVL.cpp +++ b/DataSpec/DNACommon/MLVL.cpp @@ -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; diff --git a/DataSpec/DNACommon/PAK.cpp b/DataSpec/DNACommon/PAK.cpp index 6758ed3a9..c285742cf 100644 --- a/DataSpec/DNACommon/PAK.cpp +++ b/DataSpec/DNACommon/PAK.cpp @@ -207,7 +207,7 @@ void PAKRouter::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 @@ -287,7 +287,7 @@ hecl::ProjectPath PAKRouter::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::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::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::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::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::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::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::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::lookupMAPATransform(const IDType& template hecl::ProjectPath PAKRouter::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::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::getAreaLayerWorking(const IDType& areaI template hecl::ProjectPath PAKRouter::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 hecl::ProjectPath PAKRouter::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::getAreaLayerCooked(const IDType& areaId template void PAKRouter::enumerateResources(const std::function& 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::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); } diff --git a/DataSpec/DNACommon/PAK.hpp b/DataSpec/DNACommon/PAK.hpp index c7723eea0..35ca2802e 100644 --- a/DataSpec/DNACommon/PAK.hpp +++ b/DataSpec/DNACommon/PAK.hpp @@ -31,7 +31,7 @@ public: PAKEntryReadStream(std::unique_ptr&& 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; } diff --git a/DataSpec/DNACommon/PATH.cpp b/DataSpec/DNACommon/PATH.cpp index b756b5e73..212cdad6f 100644 --- a/DataSpec/DNACommon/PATH.cpp +++ b/DataSpec/DNACommon/PATH.cpp @@ -70,7 +70,7 @@ void PATH::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::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::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::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::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::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::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(); } diff --git a/DataSpec/DNACommon/ParticleCommon.hpp b/DataSpec/DNACommon/ParticleCommon.hpp index 159cc85fd..f219fe300 100644 --- a/DataSpec/DNACommon/ParticleCommon.hpp +++ b/DataSpec/DNACommon/ParticleCommon.hpp @@ -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(); 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(); 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); } } } diff --git a/DataSpec/DNACommon/STRG.cpp b/DataSpec/DNACommon/STRG.cpp index d49339bee..868f808b0 100644 --- a/DataSpec/DNACommon/STRG.cpp +++ b/DataSpec/DNACommon/STRG.cpp @@ -13,7 +13,7 @@ void ISTRG::gatherDependencies(std::vector& pathsOut) const { std::unique_ptr 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(); } diff --git a/DataSpec/DNACommon/TXTR.cpp b/DataSpec/DNACommon/TXTR.cpp index 413b6f0ba..815164cc2 100644 --- a/DataSpec/DNACommon/TXTR.cpp +++ b/DataSpec/DNACommon/TXTR.cpp @@ -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; } diff --git a/DataSpec/DNAMP1/ANCS.cpp b/DataSpec/DNAMP1/ANCS.cpp index 3a9337759..e3c67b451 100644 --- a/DataSpec/DNAMP1/ANCS.cpp +++ b/DataSpec/DNAMP1/ANCS.cpp @@ -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(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>, 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> 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 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()) && diff --git a/DataSpec/DNAMP1/ANIM.cpp b/DataSpec/DNAMP1/ANIM.cpp index 0fce2c36a..b00bb3988 100644 --- a/DataSpec/DNAMP1/ANIM.cpp +++ b/DataSpec/DNAMP1/ANIM.cpp @@ -7,7 +7,7 @@ namespace DataSpec::DNAMP1 { using ANIMOutStream = hecl::blender::ANIMOutStream; void ANIM::IANIM::sendANIMToBlender(hecl::blender::PyOutStream& os, const DNAANIM::RigInverter& 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(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_mapsecond) != addedBones.cend()) diff --git a/DataSpec/DNAMP1/ANIM.hpp b/DataSpec/DNAMP1/ANIM.hpp index d6a771d73..e1dda6619 100644 --- a/DataSpec/DNAMP1/ANIM.hpp +++ b/DataSpec/DNAMP1/ANIM.hpp @@ -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) { diff --git a/DataSpec/DNAMP1/CINF.cpp b/DataSpec/DNAMP1/CINF.cpp index 974f26d10..9eec50834 100644 --- a/DataSpec/DNAMP1/CINF.cpp +++ b/DataSpec/DNAMP1/CINF.cpp @@ -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 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::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::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& 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" diff --git a/DataSpec/DNAMP1/CMDLMaterials.cpp b/DataSpec/DNAMP1/CMDLMaterials.cpp index 3e51255b6..e8d0babd4 100644 --- a/DataSpec/DNAMP1/CMDLMaterials.cpp +++ b/DataSpec/DNAMP1/CMDLMaterials.cpp @@ -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 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 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 diff --git a/DataSpec/DNAMP1/CMDLMaterials.hpp b/DataSpec/DNAMP1/CMDLMaterials.hpp index 78744e4d3..2a1e3269f 100644 --- a/DataSpec/DNAMP1/CMDLMaterials.hpp +++ b/DataSpec/DNAMP1/CMDLMaterials.hpp @@ -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"; diff --git a/DataSpec/DNAMP1/CSKR.cpp b/DataSpec/DNAMP1/CSKR.cpp index df5139dd9..7c4083a11 100644 --- a/DataSpec/DNAMP1/CSKR.cpp +++ b/DataSpec/DNAMP1/CSKR.cpp @@ -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; } } diff --git a/DataSpec/DNAMP1/CSNG.cpp b/DataSpec/DNAMP1/CSNG.cpp index 5138a0d3b..9fb3f2fdc 100644 --- a/DataSpec/DNAMP1/CSNG.cpp +++ b/DataSpec/DNAMP1/CSNG.cpp @@ -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); diff --git a/DataSpec/DNAMP1/DCLN.cpp b/DataSpec/DNAMP1/DCLN.cpp index 8d1496450..383056e8a 100644 --- a/DataSpec/DNAMP1/DCLN.cpp +++ b/DataSpec/DNAMP1/DCLN.cpp @@ -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" diff --git a/DataSpec/DNAMP1/DNAMP1.cpp b/DataSpec/DNAMP1/DNAMP1.cpp index 386059ff9..631040d25 100644 --- a/DataSpec/DNAMP1/DNAMP1.cpp +++ b/DataSpec/DNAMP1/DNAMP1.cpp @@ -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& 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> 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& 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& 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()) { diff --git a/DataSpec/DNAMP1/FRME.cpp b/DataSpec/DNAMP1/FRME.cpp index 4fdced531..16b83bbcc 100644 --- a/DataSpec/DNAMP1/FRME.cpp +++ b/DataSpec/DNAMP1/FRME.cpp @@ -93,7 +93,7 @@ void FRME::Widget::Enumerate(athena::io::IStreamReader& __dna_read widgetInfo = std::make_unique(); 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(athena::io::IStreamReader& } else if (projectionType == ProjectionType::Orthographic) { projection = std::make_unique(); } 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(athena::io::IStreamReader& template <> void FRME::Widget::CAMRInfo::Enumerate(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(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(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(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(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(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(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(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(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" diff --git a/DataSpec/DNAMP1/MLVL.cpp b/DataSpec/DNAMP1/MLVL.cpp index 5e447ea3d..4eb5c1ee4 100644 --- a/DataSpec/DNAMP1/MLVL.cpp +++ b/DataSpec/DNAMP1/MLVL.cpp @@ -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(); diff --git a/DataSpec/DNAMP1/MREA.cpp b/DataSpec/DNAMP1/MREA.cpp index 89c9e4f0a..2babb2763 100644 --- a/DataSpec/DNAMP1/MREA.cpp +++ b/DataSpec/DNAMP1/MREA.cpp @@ -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, 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(GetCurrentProcess())); + parPid = fmt::format(FMT_STRING(_SYS_STR("{}")), reinterpret_cast(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 diff --git a/DataSpec/DNAMP1/PAK.cpp b/DataSpec/DNAMP1/PAK.cpp index 4b7835662..516f6b110 100644 --- a/DataSpec/DNAMP1/PAK.cpp +++ b/DataSpec/DNAMP1/PAK.cpp @@ -10,7 +10,7 @@ template <> void PAK::Enumerate(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 diff --git a/DataSpec/DNAMP1/SCAN.hpp b/DataSpec/DNAMP1/SCAN.hpp index 701070ddd..f806fe69d 100644 --- a/DataSpec/DNAMP1/SCAN.hpp +++ b/DataSpec/DNAMP1/SCAN.hpp @@ -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); } } } diff --git a/DataSpec/DNAMP1/SCLY.cpp b/DataSpec/DNAMP1/SCLY.cpp index 108391b04..6e24003bf 100644 --- a/DataSpec/DNAMP1/SCLY.cpp +++ b/DataSpec/DNAMP1/SCLY.cpp @@ -115,12 +115,12 @@ void SCLY::ScriptLayer::Enumerate(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(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(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); } } diff --git a/DataSpec/DNAMP1/STRG.cpp b/DataSpec/DNAMP1/STRG.cpp index 6acf994ba..6e893b60c 100644 --- a/DataSpec/DNAMP1/STRG.cpp +++ b/DataSpec/DNAMP1/STRG.cpp @@ -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(hecl::Char16ToUTF8(std::u16string(it, endIt))); @@ -92,7 +92,7 @@ static std::u16string_view::const_iterator GatherTextureList(std::vector(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(hecl::Char16ToUTF8(std::u16string(it, str.begin() + scpos))); ret.append(hecl::UTF8ToChar16(UniqueID32(path).toString())); @@ -249,7 +249,7 @@ void STRG::gatherDependencies(std::vector& 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( hecl::Char16ToUTF8(std::u16string(it, strView.begin() + scpos))); if (path) @@ -311,11 +311,11 @@ template <> void STRG::Enumerate(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(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; } diff --git a/DataSpec/DNAMP1/ScriptObjects/Babygoth.hpp b/DataSpec/DNAMP1/ScriptObjects/Babygoth.hpp index a396d6616..37c3c7607 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Babygoth.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Babygoth.hpp @@ -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"); } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Magdolite.hpp b/DataSpec/DNAMP1/ScriptObjects/Magdolite.hpp index b1e787d6c..59a06adb7 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Magdolite.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Magdolite.hpp @@ -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"); } } diff --git a/DataSpec/DNAMP1/ScriptObjects/OmegaPirate.hpp b/DataSpec/DNAMP1/ScriptObjects/OmegaPirate.hpp index 3e28ec6bd..c65cf752c 100644 --- a/DataSpec/DNAMP1/ScriptObjects/OmegaPirate.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/OmegaPirate.hpp @@ -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"); } diff --git a/DataSpec/DNAMP1/ScriptObjects/Parameters.hpp b/DataSpec/DNAMP1/ScriptObjects/Parameters.hpp index 6ec46990b..8685fd832 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Parameters.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Parameters.hpp @@ -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"); } } diff --git a/DataSpec/DNAMP2/ANIM.cpp b/DataSpec/DNAMP2/ANIM.cpp index 333d543a1..ee7973e05 100644 --- a/DataSpec/DNAMP2/ANIM.cpp +++ b/DataSpec/DNAMP2/ANIM.cpp @@ -6,7 +6,7 @@ namespace DataSpec::DNAMP2 { using ANIMOutStream = hecl::blender::ANIMOutStream; void ANIM::IANIM::sendANIMToBlender(hecl::blender::PyOutStream& os, const DNAANIM::RigInverter& 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(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; } } diff --git a/DataSpec/DNAMP2/CINF.cpp b/DataSpec/DNAMP2/CINF.cpp index 6762c4238..5d413320f 100644 --- a/DataSpec/DNAMP2/CINF.cpp +++ b/DataSpec/DNAMP2/CINF.cpp @@ -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 void CINF::sendCINFToBlender(hecl::blender::PyOutStream& os, const typename PAKBridge::PAKType::IDType& cinfId) const { DNAANIM::RigInverter 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::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::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(hecl::blender::PyOutStream& os, const UniqueID32& cinfId) const; @@ -92,7 +92,7 @@ template void CINF::sendCINFToBlender(hecl::blender::PyOutStr const UniqueID64& cinfId) const; template -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" diff --git a/DataSpec/DNAMP2/CSKR.cpp b/DataSpec/DNAMP2/CSKR.cpp index 5d9353cbf..16ab4f450 100644 --- a/DataSpec/DNAMP2/CSKR.cpp +++ b/DataSpec/DNAMP2/CSKR.cpp @@ -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; } } diff --git a/DataSpec/DNAMP2/DNAMP2.cpp b/DataSpec/DNAMP2/DNAMP2.cpp index 208bc8d14..dd08e1b78 100644 --- a/DataSpec/DNAMP2/DNAMP2.cpp +++ b/DataSpec/DNAMP2/DNAMP2.cpp @@ -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& 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& 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& 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()) { diff --git a/DataSpec/DNAMP2/DeafBabe.cpp b/DataSpec/DNAMP2/DeafBabe.cpp index e1c699914..e33b2893e 100644 --- a/DataSpec/DNAMP2/DeafBabe.cpp +++ b/DataSpec/DNAMP2/DeafBabe.cpp @@ -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"), diff --git a/DataSpec/DNAMP2/MREA.cpp b/DataSpec/DNAMP2/MREA.cpp index a8add1605..57d9f828b 100644 --- a/DataSpec/DNAMP2/MREA.cpp +++ b/DataSpec/DNAMP2/MREA.cpp @@ -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, 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" diff --git a/DataSpec/DNAMP2/PAK.cpp b/DataSpec/DNAMP2/PAK.cpp index a3e209702..b7352cadc 100644 --- a/DataSpec/DNAMP2/PAK.cpp +++ b/DataSpec/DNAMP2/PAK.cpp @@ -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); diff --git a/DataSpec/DNAMP2/STRG.cpp b/DataSpec/DNAMP2/STRG.cpp index 30d0cb24a..16c0632f1 100644 --- a/DataSpec/DNAMP2/STRG.cpp +++ b/DataSpec/DNAMP2/STRG.cpp @@ -49,11 +49,11 @@ template <> void STRG::Enumerate(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(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; } diff --git a/DataSpec/DNAMP2/STRG.hpp b/DataSpec/DNAMP2/STRG.hpp index 5775a96b9..5ec8fd5e1 100644 --- a/DataSpec/DNAMP2/STRG.hpp +++ b/DataSpec/DNAMP2/STRG.hpp @@ -14,6 +14,7 @@ struct STRG : ISTRG { std::map 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; diff --git a/DataSpec/DNAMP3/ANIM.cpp b/DataSpec/DNAMP3/ANIM.cpp index 9abfea7ac..38e91c41a 100644 --- a/DataSpec/DNAMP3/ANIM.cpp +++ b/DataSpec/DNAMP3/ANIM.cpp @@ -9,7 +9,7 @@ using ANIMOutStream = hecl::blender::ANIMOutStream; void ANIM::IANIM::sendANIMToBlender(hecl::blender::PyOutStream& os, const DNAANIM::RigInverter& 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(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; } } diff --git a/DataSpec/DNAMP3/CMDLMaterials.cpp b/DataSpec/DNAMP3/CMDLMaterials.cpp index f12848b14..3466f1122 100644 --- a/DataSpec/DNAMP3/CMDLMaterials.cpp +++ b/DataSpec/DNAMP3/CMDLMaterials.cpp @@ -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& 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& 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& 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& 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& 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& 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()) { @@ -253,39 +253,39 @@ void MaterialSet::ConstructMaterial(Stream& out, const PAKRouter& 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()) { 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; } } diff --git a/DataSpec/DNAMP3/CSKR.cpp b/DataSpec/DNAMP3/CSKR.cpp index b798f7ec7..11711dd5d 100644 --- a/DataSpec/DNAMP3/CSKR.cpp +++ b/DataSpec/DNAMP3/CSKR.cpp @@ -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 diff --git a/DataSpec/DNAMP3/DNAMP3.cpp b/DataSpec/DNAMP3/DNAMP3.cpp index 52efdc8db..60b68b85b 100644 --- a/DataSpec/DNAMP3/DNAMP3.cpp +++ b/DataSpec/DNAMP3/DNAMP3.cpp @@ -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& 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& 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& 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()) { diff --git a/DataSpec/DNAMP3/MREA.cpp b/DataSpec/DNAMP3/MREA.cpp index 293441c11..474acb865 100644 --- a/DataSpec/DNAMP3/MREA.cpp +++ b/DataSpec/DNAMP3/MREA.cpp @@ -49,7 +49,7 @@ bool MREA::StreamReader::seekToSection(FourCC sec, const std::vector& 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" diff --git a/DataSpec/DNAMP3/PAK.cpp b/DataSpec/DNAMP3/PAK.cpp index 2eddb7f08..81a4b016a 100644 --- a/DataSpec/DNAMP3/PAK.cpp +++ b/DataSpec/DNAMP3/PAK.cpp @@ -9,7 +9,7 @@ template <> void PAK::Enumerate(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 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 diff --git a/DataSpec/DNAMP3/STRG.cpp b/DataSpec/DNAMP3/STRG.cpp index a5de8ac98..b40dd735d 100644 --- a/DataSpec/DNAMP3/STRG.cpp +++ b/DataSpec/DNAMP3/STRG.cpp @@ -59,13 +59,13 @@ template <> void STRG::Enumerate(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(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; } diff --git a/DataSpec/DNAMP3/STRG.hpp b/DataSpec/DNAMP3/STRG.hpp index c43858955..8f8d44f50 100644 --- a/DataSpec/DNAMP3/STRG.hpp +++ b/DataSpec/DNAMP3/STRG.hpp @@ -14,6 +14,7 @@ struct STRG : ISTRG { std::map 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; diff --git a/DataSpec/SpecBase.cpp b/DataSpec/SpecBase.cpp index 5d9e23fcc..6d6f5ecaa 100644 --- a/DataSpec/SpecBase.cpp +++ b/DataSpec/SpecBase.cpp @@ -65,7 +65,7 @@ bool SpecBase::canExtract(const ExtractPassInfo& info, std::vector= 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>& 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>& 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>& 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 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> 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; } diff --git a/DataSpec/SpecMP1.cpp b/DataSpec/SpecMP1.cpp index 57150d232..02ad59323 100644 --- a/DataSpec/SpecMP1.cpp +++ b/DataSpec/SpecMP1.cpp @@ -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 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 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); } } diff --git a/DataSpec/SpecMP2.cpp b/DataSpec/SpecMP2.cpp index 1c4614f51..b7789685c 100644 --- a/DataSpec/SpecMP2.cpp +++ b/DataSpec/SpecMP2.cpp @@ -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 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) { diff --git a/DataSpec/SpecMP3.cpp b/DataSpec/SpecMP3.cpp index 4dfd8aaa7..c378bb8c0 100644 --- a/DataSpec/SpecMP3.cpp +++ b/DataSpec/SpecMP3.cpp @@ -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 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) { diff --git a/Editor/ProjectManager.cpp b/Editor/ProjectManager.cpp index a32454488..90ab66886 100644 --- a/Editor/ProjectManager.cpp +++ b/Editor/ProjectManager.cpp @@ -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(); diff --git a/Editor/ProjectResourceFactoryBase.cpp b/Editor/ProjectResourceFactoryBase.cpp index 52a398036..5bf32e6ea 100644 --- a/Editor/ProjectResourceFactoryBase.cpp +++ b/Editor/ProjectResourceFactoryBase.cpp @@ -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 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& 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 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 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 ProjectResourceFactoryBase::BuildAsyncInternal(const void ProjectResourceFactoryBase::BuildAsync(const urde::SObjectTag& tag, const urde::CVParamTransfer& paramXfer, std::unique_ptr* 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 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( @@ -308,7 +308,7 @@ std::shared_ptr ProjectResourceFactoryBase::LoadResourceAsync std::shared_ptr 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( @@ -317,7 +317,7 @@ std::shared_ptr ProjectResourceFactoryBase::LoadResourcePartA std::unique_ptr 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 ProjectResourceFactoryBase::LoadResourceSync(const urde::S std::unique_ptr 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 ProjectResourceFactoryBase::LoadNewResourcePartSync(const std::shared_ptr 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(*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(*m_cookSpec).pathFromTag(task.x0_tag); if (!path) { if (!static_cast(*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); } } diff --git a/Editor/Space.cpp b/Editor/Space.cpp index 02abd50ee..1f1b02a42 100644 --- a/Editor/Space.cpp +++ b/Editor/Space.cpp @@ -100,7 +100,7 @@ specter::View* SplitSpace::buildContentView(specter::ViewResources& res) { void SplitSpace::setChildSlot(unsigned slot, std::unique_ptr&& 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 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 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; } diff --git a/Editor/SplashScreen.cpp b/Editor/SplashScreen.cpp index d0469e6e8..712c92f9c 100644 --- a/Editor/SplashScreen.cpp +++ b/Editor/SplashScreen.cpp @@ -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(), + m_buildInfoStr = fmt::format(FMT_STRING("{}: {}\n{}: {}\n{}: {}"), vm.translate(), URDE_DLPACKAGE, vm.translate(), GIT_COMMIT_HASH, vm.translate(), GIT_COMMIT_DATE); else #endif - m_buildInfoStr = fmt::format(fmt("{}: {}\n{}: {}\n{}: {}"), vm.translate(), GIT_BRANCH, + m_buildInfoStr = fmt::format(FMT_STRING("{}: {}\n{}: {}\n{}: {}"), vm.translate(), GIT_BRANCH, vm.translate(), GIT_COMMIT_HASH, vm.translate(), 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(); } diff --git a/Editor/ViewManager.cpp b/Editor/ViewManager.cpp index 11b29bfeb..99438caab 100644 --- a/Editor/ViewManager.cpp +++ b/Editor/ViewManager.cpp @@ -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 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); diff --git a/Editor/badging/Badging.cpp b/Editor/badging/Badging.cpp index 43b9b9ee6..45215a55a 100644 --- a/Editor/badging/Badging.cpp +++ b/Editor/badging/Badging.cpp @@ -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; diff --git a/Editor/icons/icons.cpp b/Editor/icons/icons.cpp index 660b635db..4701c20b5 100644 --- a/Editor/icons/icons.cpp +++ b/Editor/icons/icons.cpp @@ -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, diff --git a/Editor/locale b/Editor/locale index 9b765b58c..c595cf725 160000 --- a/Editor/locale +++ b/Editor/locale @@ -1 +1 @@ -Subproject commit 9b765b58cf7389014f7e89a9dfb92da98ce89962 +Subproject commit c595cf725f657f3542264d7a244c14716ec41bfa diff --git a/Editor/main.cpp b/Editor/main.cpp index 6fe7f1edb..db97f7188 100644 --- a/Editor/main.cpp +++ b/Editor/main.cpp @@ -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; } diff --git a/NESEmulator/CNESEmulator.cpp b/NESEmulator/CNESEmulator.cpp index fee792896..e408e9e34 100644 --- a/NESEmulator/CNESEmulator.cpp +++ b/NESEmulator/CNESEmulator.cpp @@ -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")); } } diff --git a/Runtime/Audio/CAudioSys.cpp b/Runtime/Audio/CAudioSys.cpp index ec1f82722..eb1c03818 100644 --- a/Runtime/Audio/CAudioSys.cpp +++ b/Runtime/Audio/CAudioSys.cpp @@ -22,6 +22,7 @@ s16 s_DefaultVolumeScale = 0x7f; CAudioSys* CAudioSys::g_SharedSys = nullptr; TLockedToken CAudioSys::FindGroupSet(std::string_view name) { + // TODO: Heterogeneous lookup when C++20 available auto search = mpGroupSetDB.find(name.data()); if (search == mpGroupSetDB.cend()) return {}; diff --git a/Runtime/AutoMapper/CAutoMapper.cpp b/Runtime/AutoMapper/CAutoMapper.cpp index 487b48324..d018c6bd6 100644 --- a/Runtime/AutoMapper/CAutoMapper.cpp +++ b/Runtime/AutoMapper/CAutoMapper.cpp @@ -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(x28_frmeMapScreen->FindWidget("textpane_right")); if (x1bc_state == EAutoMapperState::MapScreenUniverse) diff --git a/Runtime/CGameAllocator.cpp b/Runtime/CGameAllocator.cpp index 399ee3610..59b045635 100644 --- a/Runtime/CGameAllocator.cpp +++ b/Runtime/CGameAllocator.cpp @@ -44,7 +44,7 @@ u8* CGameAllocator::Alloc(size_t len) { void CGameAllocator::Free(u8* ptr) { SChunkDescription* info = reinterpret_cast(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; } diff --git a/Runtime/CInGameTweakManagerBase.hpp b/Runtime/CInGameTweakManagerBase.hpp index 126098f00..32e205ecf 100644 --- a/Runtime/CInGameTweakManagerBase.hpp +++ b/Runtime/CInGameTweakManagerBase.hpp @@ -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); } }; diff --git a/Runtime/CMemoryCardSysNix.cpp b/Runtime/CMemoryCardSysNix.cpp index 8c4921a17..7873df934 100644 --- a/Runtime/CMemoryCardSysNix.cpp +++ b/Runtime/CMemoryCardSysNix.cpp @@ -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 {}; diff --git a/Runtime/CMemoryCardSysOSX.cpp b/Runtime/CMemoryCardSysOSX.cpp index e1e659506..eca7da8d5 100644 --- a/Runtime/CMemoryCardSysOSX.cpp +++ b/Runtime/CMemoryCardSysOSX.cpp @@ -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 {}; diff --git a/Runtime/CMemoryCardSysWin.cpp b/Runtime/CMemoryCardSysWin.cpp index bfdd2406f..6f80119c3 100644 --- a/Runtime/CMemoryCardSysWin.cpp +++ b/Runtime/CMemoryCardSysWin.cpp @@ -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) { diff --git a/Runtime/CObjectList.cpp b/Runtime/CObjectList.cpp index 332d7e4a3..e0c6a89de 100644 --- a/Runtime/CObjectList.cpp +++ b/Runtime/CObjectList.cpp @@ -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; diff --git a/Runtime/CPakFile.cpp b/Runtime/CPakFile.cpp index 7cb34c700..92e73081c 100644 --- a/Runtime/CPakFile.cpp +++ b/Runtime/CPakFile.cpp @@ -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; } diff --git a/Runtime/CResFactory.cpp b/Runtime/CResFactory.cpp index a90a48835..2968b6d02 100644 --- a/Runtime/CResFactory.cpp +++ b/Runtime/CResFactory.cpp @@ -28,7 +28,7 @@ CFactoryFnReturn CResFactory::BuildSync(const SObjectTag& tag, const CVParamTran else ret = std::make_unique(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; diff --git a/Runtime/CResLoader.cpp b/Runtime/CResLoader.cpp index 075e8288b..24318ad84 100644 --- a/Runtime/CResLoader.cpp +++ b/Runtime/CResLoader.cpp @@ -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; } diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index 45cad7fc9..e9d9c8521 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -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 CStateManager::GetBuildForScript(TEditorId id) const { @@ -1374,16 +1374,16 @@ std::pair 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; diff --git a/Runtime/CStopwatch.hpp b/Runtime/CStopwatch.hpp index 7f376d21d..301dff669 100644 --- a/Runtime/CStopwatch.hpp +++ b/Runtime/CStopwatch.hpp @@ -13,7 +13,7 @@ public: double t = std::chrono::duration_cast( 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(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; diff --git a/Runtime/Character/CAllFormatsAnimSource.cpp b/Runtime/Character/CAllFormatsAnimSource.cpp index b36b72b7f..025eed532 100644 --- a/Runtime/Character/CAllFormatsAnimSource.cpp +++ b/Runtime/Character/CAllFormatsAnimSource.cpp @@ -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)); } } diff --git a/Runtime/Character/CAnimData.cpp b/Runtime/Character/CAnimData.cpp index a4c99ce60..9c6431c96 100644 --- a/Runtime/Character/CAnimData.cpp +++ b/Runtime/Character/CAnimData.cpp @@ -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()); } diff --git a/Runtime/Character/CModelData.cpp b/Runtime/Character/CModelData.cpp index 98c0119be..a9db25302 100644 --- a/Runtime/Character/CModelData.cpp +++ b/Runtime/Character/CModelData.cpp @@ -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& 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& 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); } } diff --git a/Runtime/Character/CParticleDatabase.cpp b/Runtime/Character/CParticleDatabase.cpp index 573561484..82df24852 100644 --- a/Runtime/Character/CParticleDatabase.cpp +++ b/Runtime/Character/CParticleDatabase.cpp @@ -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(); diff --git a/Runtime/Graphics/CBooRenderer.cpp b/Runtime/Graphics/CBooRenderer.cpp index 4b23e81da..c0c5ebee8 100644 --- a/Runtime/Graphics/CBooRenderer.cpp +++ b/Runtime/Graphics/CBooRenderer.cpp @@ -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; } diff --git a/Runtime/Graphics/CLineRenderer.cpp b/Runtime/Graphics/CLineRenderer.cpp index d8b4b3472..340377476 100644 --- a/Runtime/Graphics/CLineRenderer.cpp +++ b/Runtime/Graphics/CLineRenderer.cpp @@ -24,7 +24,7 @@ CLineRenderer::CLineRenderer(boo::IGraphicsDataFactory::Context& ctx, EPrimitive const boo::ObjToken& 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); diff --git a/Runtime/Graphics/CModelBoo.cpp b/Runtime/Graphics/CModelBoo.cpp index bb30f753e..f40226568 100644 --- a/Runtime/Graphics/CModelBoo.cpp +++ b/Runtime/Graphics/CModelBoo.cpp @@ -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&& in, u32 /* dataLen */, IObjectStore* stor u32 version = hecl::SBig(*reinterpret_cast(data.get() + 0x4)); m_flags = hecl::SBig(*reinterpret_cast(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(data.get() + 0x24)); u32 matSetCount = hecl::SBig(*reinterpret_cast(data.get() + 0x28)); diff --git a/Runtime/Graphics/CSkinnedModel.cpp b/Runtime/Graphics/CSkinnedModel.cpp index 709a12a22..757859689 100644 --- a/Runtime/Graphics/CSkinnedModel.cpp +++ b/Runtime/Graphics/CSkinnedModel.cpp @@ -12,13 +12,13 @@ CSkinnedModel::CSkinnedModel(TLockedToken model, TLockedToken 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); } diff --git a/Runtime/Graphics/CTextureBoo.cpp b/Runtime/Graphics/CTextureBoo.cpp index 931a497e6..d271c0cad 100644 --- a/Runtime/Graphics/CTextureBoo.cpp +++ b/Runtime/Graphics/CTextureBoo.cpp @@ -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(data)); @@ -763,7 +763,7 @@ CTexture::CTexture(std::unique_ptr&& 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 CTexture::BuildMemoryCardTex(u32& sizeOut, ETexelFormat& fmtOut, std::unique_ptr& 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 ret; @@ -851,7 +851,7 @@ std::unique_ptr 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; } diff --git a/Runtime/GuiSys/CAuiEnergyBarT01.cpp b/Runtime/GuiSys/CAuiEnergyBarT01.cpp index 4da50045c..d30345c86 100644 --- a/Runtime/GuiSys/CAuiEnergyBarT01.cpp +++ b/Runtime/GuiSys/CAuiEnergyBarT01.cpp @@ -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(); diff --git a/Runtime/GuiSys/CAuiImagePane.cpp b/Runtime/GuiSys/CAuiImagePane.cpp index 996e1ad4f..d8a033087 100644 --- a/Runtime/GuiSys/CAuiImagePane.cpp +++ b/Runtime/GuiSys/CAuiImagePane.cpp @@ -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); diff --git a/Runtime/GuiSys/CCompoundTargetReticle.cpp b/Runtime/GuiSys/CCompoundTargetReticle.cpp index 3f08768fa..c54dc531a 100644 --- a/Runtime/GuiSys/CCompoundTargetReticle.cpp +++ b/Runtime/GuiSys/CCompoundTargetReticle.cpp @@ -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(); } diff --git a/Runtime/GuiSys/CGuiFrame.cpp b/Runtime/GuiSys/CGuiFrame.cpp index 03dc93daa..9c721067e 100644 --- a/Runtime/GuiSys/CGuiFrame.cpp +++ b/Runtime/GuiSys/CGuiFrame.cpp @@ -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(); diff --git a/Runtime/GuiSys/CGuiModel.cpp b/Runtime/GuiSys/CGuiModel.cpp index 5a3846514..c8d1ef9c3 100644 --- a/Runtime/GuiSys/CGuiModel.cpp +++ b/Runtime/GuiSys/CGuiModel.cpp @@ -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()); diff --git a/Runtime/GuiSys/CGuiTextPane.cpp b/Runtime/GuiSys/CGuiTextPane.cpp index 681b89cf7..16c7a32c0 100644 --- a/Runtime/GuiSys/CGuiTextPane.cpp +++ b/Runtime/GuiSys/CGuiTextPane.cpp @@ -51,7 +51,7 @@ void CGuiTextPane::Draw(const CGuiWidgetDrawParms& parms) { if (!GetIsVisible()) { return; } - SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(fmt("CGuiTextPane::Draw {}"), m_name).c_str(), zeus::skCyan); + SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(FMT_STRING("CGuiTextPane::Draw {}"), m_name).c_str(), zeus::skCyan); zeus::CVector2f dims = GetDimensions(); diff --git a/Runtime/GuiSys/CGuiTextSupport.cpp b/Runtime/GuiSys/CGuiTextSupport.cpp index a2a6cb993..e190df769 100644 --- a/Runtime/GuiSys/CGuiTextSupport.cpp +++ b/Runtime/GuiSys/CGuiTextSupport.cpp @@ -172,7 +172,7 @@ void CGuiTextSupport::CheckAndRebuildTextBuffer() { std::u16string initStr; if (x5c_fontId.IsValid()) - initStr = fmt::format(fmt(u"&font={};"), x5c_fontId); + initStr = fmt::format(FMT_STRING(u"&font={};"), x5c_fontId); initStr += x0_string; g_TextParser->ParseText(*g_TextExecuteBuf, initStr.c_str(), initStr.size(), x14_props.xc_txtrMap); diff --git a/Runtime/GuiSys/CGuiWidget.cpp b/Runtime/GuiSys/CGuiWidget.cpp index 9d398a4f9..6996ad337 100644 --- a/Runtime/GuiSys/CGuiWidget.cpp +++ b/Runtime/GuiSys/CGuiWidget.cpp @@ -71,7 +71,7 @@ void CGuiWidget::ParseBaseInfo(CGuiFrame* frame, CInputStream& in, const CGuiWid in.readUint16Big(); if (isWorker) { if (!parent->AddWorkerWidget(this)) { - Log.report(logvisor::Warning, fmt("Warning: Discarding useless worker id. Parent is not a compound widget.")); + Log.report(logvisor::Warning, FMT_STRING("Warning: Discarding useless worker id. Parent is not a compound widget.")); xb4_workerId = -1; } } diff --git a/Runtime/GuiSys/CGuiWidgetIdDB.cpp b/Runtime/GuiSys/CGuiWidgetIdDB.cpp index 075534f9b..4455cc85a 100644 --- a/Runtime/GuiSys/CGuiWidgetIdDB.cpp +++ b/Runtime/GuiSys/CGuiWidgetIdDB.cpp @@ -10,6 +10,7 @@ CGuiWidgetIdDB::CGuiWidgetIdDB() { } s16 CGuiWidgetIdDB::FindWidgetID(std::string_view name) const { + // TODO: Heterogeneous lookup when C++20 available auto search = x0_dbMap.find(name.data()); if (search == x0_dbMap.cend()) return -1; diff --git a/Runtime/GuiSys/CGuiWidgetIdDB.hpp b/Runtime/GuiSys/CGuiWidgetIdDB.hpp index 799f6efe1..65197094c 100644 --- a/Runtime/GuiSys/CGuiWidgetIdDB.hpp +++ b/Runtime/GuiSys/CGuiWidgetIdDB.hpp @@ -1,5 +1,7 @@ #pragma once +#include +#include #include #include "Runtime/GCNTypes.hpp" diff --git a/Runtime/GuiSys/CHudBallInterface.cpp b/Runtime/GuiSys/CHudBallInterface.cpp index f2e0a79fd..74677b489 100644 --- a/Runtime/GuiSys/CHudBallInterface.cpp +++ b/Runtime/GuiSys/CHudBallInterface.cpp @@ -18,7 +18,7 @@ CHudBallInterface::CHudBallInterface(CGuiFrame& selHud, int pbAmount, int pbCapa xc_model_bombicon = static_cast(selHud.FindWidget("model_bombicon")); x10_textpane_bombdigits = static_cast(selHud.FindWidget("textpane_bombdigits")); for (int i = 0; i < 3; ++i) { - CGuiGroup* grp = static_cast(selHud.FindWidget(fmt::format(fmt("group_bombcount{}"), i))); + CGuiGroup* grp = static_cast(selHud.FindWidget(fmt::format(FMT_STRING("group_bombcount{}"), i))); CGuiWidget* filled = grp->GetWorkerWidget(1); CGuiWidget* empty = grp->GetWorkerWidget(0); x14_group_bombfilled.push_back(filled); @@ -65,7 +65,7 @@ void CHudBallInterface::UpdatePowerBombReadoutColors() { void CHudBallInterface::SetBombParams(int pbAmount, int pbCapacity, int availableBombs, bool hasBombs, bool hasPb, bool init) { if (pbAmount != x40_pbAmount || init) { - x10_textpane_bombdigits->TextSupport().SetText(fmt::format(fmt("{:02d}"), pbAmount)); + x10_textpane_bombdigits->TextSupport().SetText(fmt::format(FMT_STRING("{:02d}"), pbAmount)); x40_pbAmount = pbAmount; UpdatePowerBombReadoutColors(); } diff --git a/Runtime/GuiSys/CHudEnergyInterface.cpp b/Runtime/GuiSys/CHudEnergyInterface.cpp index 8109e51de..f4275d312 100644 --- a/Runtime/GuiSys/CHudEnergyInterface.cpp +++ b/Runtime/GuiSys/CHudEnergyInterface.cpp @@ -99,7 +99,7 @@ void CHudEnergyInterface::Update(float dt, float energyLowPulse) { x1c_26_barDirty = false; x18_cachedBarEnergy = x2c_energybart01_energybar->GetFilledEnergy(); std::string string = - fmt::format(fmt("{:02d}"), int(std::fmod(x18_cachedBarEnergy, CPlayerState::GetEnergyTankCapacity()))); + fmt::format(FMT_STRING("{:02d}"), int(std::fmod(x18_cachedBarEnergy, CPlayerState::GetEnergyTankCapacity()))); x20_textpane_energydigits->TextSupport().SetText(string); } diff --git a/Runtime/GuiSys/CHudMissileInterface.cpp b/Runtime/GuiSys/CHudMissileInterface.cpp index 6e42b974e..1e3cadd73 100644 --- a/Runtime/GuiSys/CHudMissileInterface.cpp +++ b/Runtime/GuiSys/CHudMissileInterface.cpp @@ -216,7 +216,7 @@ void CHudMissileInterface::SetChargeBeamFactor(float t) { x4c_chargeBeamFactor = void CHudMissileInterface::SetNumMissiles(int numMissiles, const CStateManager& mgr) { numMissiles = zeus::clamp(0, numMissiles, 999); - x60_textpane_missiledigits->TextSupport().SetText(fmt::format(fmt("{:3d}"), numMissiles)); + x60_textpane_missiledigits->TextSupport().SetText(fmt::format(FMT_STRING("{:3d}"), numMissiles)); if (x8_numMissles < numMissiles) { xc_arrowTimer = g_tweakGui->GetMissileArrowVisTime(); diff --git a/Runtime/GuiSys/CHudThreatInterface.cpp b/Runtime/GuiSys/CHudThreatInterface.cpp index 7a4235b19..e5cd207c7 100644 --- a/Runtime/GuiSys/CHudThreatInterface.cpp +++ b/Runtime/GuiSys/CHudThreatInterface.cpp @@ -88,7 +88,7 @@ void CHudThreatInterface::Update(float dt) { if (x70_textpane_threatdigits) { if (x10_threatDist < maxThreatEnergy) { x70_textpane_threatdigits->SetIsVisible(true); - x70_textpane_threatdigits->TextSupport().SetText(fmt::format(fmt("{:01.1f}"), std::max(0.f, x10_threatDist))); + x70_textpane_threatdigits->TextSupport().SetText(fmt::format(FMT_STRING("{:01.1f}"), std::max(0.f, x10_threatDist))); } else { x70_textpane_threatdigits->SetIsVisible(false); } diff --git a/Runtime/GuiSys/CHudVisorBeamMenu.cpp b/Runtime/GuiSys/CHudVisorBeamMenu.cpp index 3153cf848..58748fe84 100644 --- a/Runtime/GuiSys/CHudVisorBeamMenu.cpp +++ b/Runtime/GuiSys/CHudVisorBeamMenu.cpp @@ -68,7 +68,7 @@ CHudVisorBeamMenu::CHudVisorBeamMenu(CGuiFrame& baseHud, EHudVisorBeamMenu type, x18_basewidget_menu = x0_baseHud.FindWidget(BaseMenuNames[size_t(swappedType)]); x24_model_ghost = - static_cast(x0_baseHud.FindWidget(fmt::format(fmt("{}ghost"), ModelNames[size_t(x4_type)]))); + static_cast(x0_baseHud.FindWidget(fmt::format(FMT_STRING("{}ghost"), ModelNames[size_t(x4_type)]))); x28_menuItems.resize(4); for (size_t i = 0; i < x28_menuItems.size(); i++) { @@ -77,9 +77,9 @@ CHudVisorBeamMenu::CHudVisorBeamMenu(CGuiFrame& baseHud, EHudVisorBeamMenu type, SMenuItem& item = x28_menuItems[i]; item.x0_model_loz = - static_cast(x0_baseHud.FindWidget(fmt::format(fmt("{}loz{}"), modelName, menuItemOrder))); + static_cast(x0_baseHud.FindWidget(fmt::format(FMT_STRING("{}loz{}"), modelName, menuItemOrder))); item.x4_model_icon = - static_cast(x0_baseHud.FindWidget(fmt::format(fmt("{}icon{}"), modelName, menuItemOrder))); + static_cast(x0_baseHud.FindWidget(fmt::format(FMT_STRING("{}icon{}"), modelName, menuItemOrder))); item.xc_opacity = enables[i] ? 1.f : 0.f; } diff --git a/Runtime/IOStreams.cpp b/Runtime/IOStreams.cpp index 39ba621a0..2b76b7e67 100644 --- a/Runtime/IOStreams.cpp +++ b/Runtime/IOStreams.cpp @@ -8,7 +8,7 @@ namespace urde { #if DUMP_BITS static void PrintBinary(u32 val, u32 count) { for (u32 i = 0; i < count; ++i) { - fmt::print(fmt("{}"), (val >> (count - i - 1)) & 0x1); + fmt::print(FMT_STRING("{}"), (val >> (count - i - 1)) & 0x1); } } #endif @@ -57,7 +57,7 @@ s32 CBitStreamReader::ReadEncoded(u32 bitCount) { #if DUMP_BITS std::fputs("READ ", stdout); PrintBinary(ret, bitCount); - fmt::print(fmt(" {} {}\n"), pos, boff); + fmt::print(FMT_STRING(" {} {}\n"), pos, boff); #endif return ret; @@ -67,7 +67,7 @@ void CBitStreamWriter::WriteEncoded(u32 val, u32 bitCount) { #if DUMP_BITS std::fputs("WRITE ", stdout); PrintBinary(val, bitCount); - fmt::print(fmt(" {} {}\n"), position(), x18_bitOffset); + fmt::print(FMT_STRING(" {} {}\n"), position(), x18_bitOffset); #endif const s32 shiftAmt = x18_bitOffset - s32(bitCount); diff --git a/Runtime/MP1/CFrontEndUI.cpp b/Runtime/MP1/CFrontEndUI.cpp index 9da2e65db..ae29e8072 100644 --- a/Runtime/MP1/CFrontEndUI.cpp +++ b/Runtime/MP1/CFrontEndUI.cpp @@ -509,7 +509,7 @@ void CFrontEndUI::SNewFileSelectFrame::SetupFrameContents() { // Completion percent if (data) { std::u16string fileStr = g_MainStringTable->GetString((data->x20_hardMode ? 106 : 39) + int(i)); - str = fileStr + fmt::format(fmt(u" {:02d}%"), data->x18_itemPercent); + str = fileStr + fmt::format(FMT_STRING(u" {:02d}%"), data->x18_itemPercent); break; } str = g_MainStringTable->GetString(36); @@ -531,7 +531,7 @@ void CFrontEndUI::SNewFileSelectFrame::SetupFrameContents() { // Formatted time if (data) { auto pt = std::div(data->x0_playTime, 3600); - str = fmt::format(fmt(u"{:02d}:{:02d}:{:02d}"), pt.quot, pt.rem / 60, pt.rem % 60); + str = fmt::format(FMT_STRING(u"{:02d}:{:02d}:{:02d}"), pt.quot, pt.rem / 60, pt.rem % 60); break; } str = g_MainStringTable->GetString(52); @@ -647,11 +647,11 @@ void CFrontEndUI::SNewFileSelectFrame::DoFileMenuAdvance(CGuiTableGroup* caller) CFrontEndUI::SFileMenuOption CFrontEndUI::SNewFileSelectFrame::FindFileSelectOption(CGuiFrame* frame, int idx) { SFileMenuOption ret; - ret.x0_base = frame->FindWidget(fmt::format(fmt("basewidget_file{}"), idx)); - ret.x4_textpanes[0] = FindTextPanePair(frame, fmt::format(fmt("textpane_filename{}"), idx)); - ret.x4_textpanes[1] = FindTextPanePair(frame, fmt::format(fmt("textpane_world{}"), idx)); - ret.x4_textpanes[2] = FindTextPanePair(frame, fmt::format(fmt("textpane_playtime{}"), idx)); - ret.x4_textpanes[3] = FindTextPanePair(frame, fmt::format(fmt("textpane_date{}"), idx)); + ret.x0_base = frame->FindWidget(fmt::format(FMT_STRING("basewidget_file{}"), idx)); + ret.x4_textpanes[0] = FindTextPanePair(frame, fmt::format(FMT_STRING("textpane_filename{}"), idx)); + ret.x4_textpanes[1] = FindTextPanePair(frame, fmt::format(FMT_STRING("textpane_world{}"), idx)); + ret.x4_textpanes[2] = FindTextPanePair(frame, fmt::format(FMT_STRING("textpane_playtime{}"), idx)); + ret.x4_textpanes[3] = FindTextPanePair(frame, fmt::format(FMT_STRING("textpane_date{}"), idx)); return ret; } @@ -1111,14 +1111,14 @@ void CFrontEndUI::SGuiTextPair::SetPairText(std::u16string_view str) { CFrontEndUI::SGuiTextPair CFrontEndUI::FindTextPanePair(CGuiFrame* frame, std::string_view name) { SGuiTextPair ret; ret.x0_panes[0] = static_cast(frame->FindWidget(name)); - ret.x0_panes[1] = static_cast(frame->FindWidget(fmt::format(fmt("{}b"), name))); + ret.x0_panes[1] = static_cast(frame->FindWidget(fmt::format(FMT_STRING("{}b"), name))); return ret; } void CFrontEndUI::FindAndSetPairText(CGuiFrame* frame, std::string_view name, std::u16string_view str) { CGuiTextPane* w1 = static_cast(frame->FindWidget(name)); w1->TextSupport().SetText(str); - CGuiTextPane* w2 = static_cast(frame->FindWidget(fmt::format(fmt("{}b"), name))); + CGuiTextPane* w2 = static_cast(frame->FindWidget(fmt::format(FMT_STRING("{}b"), name))); w2->TextSupport().SetText(str); } @@ -1532,7 +1532,7 @@ void CFrontEndUI::SOptionsFrontEndFrame::SetRightUIText() { const auto& options = GameOptionsRegistry[userSel]; for (int i = 0; i < 5; ++i) { - std::string name = fmt::format(fmt("textpane_right{}"), i); + std::string name = fmt::format(FMT_STRING("textpane_right{}"), i); if (i < static_cast(options.first)) { FindTextPanePair(x1c_loadedFrame, name).SetPairText(x20_loadedPauseStrg->GetString(options.second[i].stringId)); x28_tablegroup_rightmenu->GetWorkerWidget(i)->SetIsSelectable(true); @@ -1594,7 +1594,7 @@ void CFrontEndUI::SOptionsFrontEndFrame::FinishedLoading() { // Visor, Display, Sound, Controller for (int i = 0; i < 4; ++i) { - const std::string name = fmt::format(fmt("textpane_filename{}"), i); + const std::string name = fmt::format(FMT_STRING("textpane_filename{}"), i); FindTextPanePair(x1c_loadedFrame, name).SetPairText(x20_loadedPauseStrg->GetString(16 + i)); } @@ -1766,7 +1766,7 @@ void CFrontEndUI::StartSlideShow(CArchitectureQueue& queue) { queue.Push(MakeMsg::CreateCreateIOWin(EArchMsgTarget::IOWinManager, 12, 11, std::make_shared())); } -std::string CFrontEndUI::GetAttractMovieFileName(int idx) { return fmt::format(fmt("Video/attract{}.thp"), idx); } +std::string CFrontEndUI::GetAttractMovieFileName(int idx) { return fmt::format(FMT_STRING("Video/attract{}.thp"), idx); } std::string CFrontEndUI::GetNextAttractMovieFileName() { std::string ret = GetAttractMovieFileName(xbc_nextAttract); diff --git a/Runtime/MP1/CMemoryCardDriver.cpp b/Runtime/MP1/CMemoryCardDriver.cpp index 0cf7076e4..a8a1b2669 100644 --- a/Runtime/MP1/CMemoryCardDriver.cpp +++ b/Runtime/MP1/CMemoryCardDriver.cpp @@ -667,7 +667,7 @@ void CMemoryCardDriver::InitializeFileInfo() { ExportPersistentOptions(); OSCalendarTime time = CBasics::ToCalendarTime(std::chrono::system_clock::now()); - std::string timeString = fmt::format(fmt("{:02d}.{:02d}.{:02d} {:02d}:{:02d}"), + std::string timeString = fmt::format(FMT_STRING("{:02d}.{:02d}.{:02d} {:02d}:{:02d}"), time.x10_mon + 1, time.xc_mday, time.x14_year % 100, time.x8_hour, time.x4_min); std::string comment("Metroid Prime "); diff --git a/Runtime/MP1/CPauseScreen.cpp b/Runtime/MP1/CPauseScreen.cpp index 706156aa2..0d1af0369 100644 --- a/Runtime/MP1/CPauseScreen.cpp +++ b/Runtime/MP1/CPauseScreen.cpp @@ -224,17 +224,17 @@ void CPauseScreen::ProcessControllerInput(const CStateManager& mgr, const CFinal } x38_textpane_l1->TextSupport().SetText( - fmt::format(fmt("&image={};"), g_tweakPlayerRes->x74_lTrigger[ + fmt::format(FMT_STRING("&image={};"), g_tweakPlayerRes->x74_lTrigger[ ControlMapper::GetDigitalInput(ControlMapper::ECommands::PreviousPauseScreen, useInput) || m_lDown])); x3c_textpane_r->TextSupport().SetText( - fmt::format(fmt("&image={};"), g_tweakPlayerRes->x80_rTrigger[ + fmt::format(FMT_STRING("&image={};"), g_tweakPlayerRes->x80_rTrigger[ ControlMapper::GetDigitalInput(ControlMapper::ECommands::NextPauseScreen, useInput) || m_rDown])); x48_textpane_return->TextSupport().SetText( - fmt::format(fmt("&image={};"), g_tweakPlayerRes->x8c_startButton[useInput.DStart() || m_returnDown])); + fmt::format(FMT_STRING("&image={};"), g_tweakPlayerRes->x8c_startButton[useInput.DStart() || m_returnDown])); x50_textpane_back->TextSupport().SetText( - fmt::format(fmt("&image={};"), g_tweakPlayerRes->x98_aButton[useInput.DA() || m_backDown])); + fmt::format(FMT_STRING("&image={};"), g_tweakPlayerRes->x98_aButton[useInput.DA() || m_backDown])); x4c_textpane_next->TextSupport().SetText( - fmt::format(fmt("&image={};"), g_tweakPlayerRes->xa4_bButton[useInput.DB() || m_nextDown])); + fmt::format(FMT_STRING("&image={};"), g_tweakPlayerRes->xa4_bButton[useInput.DB() || m_nextDown])); } void CPauseScreen::TransitionComplete() { diff --git a/Runtime/MP1/CPauseScreenBase.cpp b/Runtime/MP1/CPauseScreenBase.cpp index f8d4adde5..0351a5c81 100644 --- a/Runtime/MP1/CPauseScreenBase.cpp +++ b/Runtime/MP1/CPauseScreenBase.cpp @@ -79,7 +79,7 @@ void CPauseScreenBase::InitializeFrameGlue() { x17c_model_textalpha = static_cast(x8_frame.FindWidget("model_textalpha")); x184_textpane_yicon = static_cast(x8_frame.FindWidget("textpane_yicon")); x188_textpane_ytext = static_cast(x8_frame.FindWidget("textpane_ytext")); - x184_textpane_yicon->TextSupport().SetText(fmt::format(fmt(u"&image={};"), g_tweakPlayerRes->xbc_yButton[0])); + x184_textpane_yicon->TextSupport().SetText(fmt::format(FMT_STRING(u"&image={};"), g_tweakPlayerRes->xbc_yButton[0])); x188_textpane_ytext->TextSupport().SetText(xc_pauseStrg.GetString(99)); x188_textpane_ytext->SetColor(g_tweakGuiColors->GetPauseItemAmberColor()); x18c_slidergroup_slider = static_cast(x8_frame.FindWidget("slidergroup_slider")); @@ -105,18 +105,18 @@ void CPauseScreenBase::InitializeFrameGlue() { for (int i = 0; i < 5; ++i) { xd8_textpane_titles.push_back( - static_cast(x8_frame.FindWidget(fmt::format(fmt("textpane_title{}"), i + 1)))); + static_cast(x8_frame.FindWidget(fmt::format(FMT_STRING("textpane_title{}"), i + 1)))); xd8_textpane_titles.back()->TextSupport().SetText(u""); - x144_model_titles.push_back(static_cast(x8_frame.FindWidget(fmt::format(fmt("model_title{}"), i + 1)))); + x144_model_titles.push_back(static_cast(x8_frame.FindWidget(fmt::format(FMT_STRING("model_title{}"), i + 1)))); m_model_lefttitledecos.push_back( - static_cast(x8_frame.FindWidget(fmt::format(fmt("model_lefttitledeco{}"), i)))); + static_cast(x8_frame.FindWidget(fmt::format(FMT_STRING("model_lefttitledeco{}"), i)))); m_model_lefttitledecos.back()->SetMouseActive(true); x15c_model_righttitledecos.push_back( - static_cast(x8_frame.FindWidget(fmt::format(fmt("model_righttitledeco{}"), i + 1)))); + static_cast(x8_frame.FindWidget(fmt::format(FMT_STRING("model_righttitledeco{}"), i + 1)))); x15c_model_righttitledecos.back()->SetMouseActive(true); xa8_textpane_categories.push_back( - static_cast(x8_frame.FindWidget(fmt::format(fmt("textpane_category{}"), i)))); - xc0_model_categories.push_back(static_cast(x8_frame.FindWidget(fmt::format(fmt("model_category{}"), i)))); + static_cast(x8_frame.FindWidget(fmt::format(FMT_STRING("textpane_category{}"), i)))); + xc0_model_categories.push_back(static_cast(x8_frame.FindWidget(fmt::format(FMT_STRING("model_category{}"), i)))); } for (int i = 0; i < 20; ++i) @@ -542,7 +542,7 @@ std::string CPauseScreenBase::GetImagePaneName(u32 i) { "4", "5", "6", "7", "45", "56", "67", "456", "567", "4567", }; - return fmt::format(fmt("imagepane_pane{}"), PaneSuffixes[i]); + return fmt::format(FMT_STRING("imagepane_pane{}"), PaneSuffixes[i]); } } // namespace urde::MP1 diff --git a/Runtime/MP1/CSamusHud.cpp b/Runtime/MP1/CSamusHud.cpp index 8d003aa98..8fe61b2b3 100644 --- a/Runtime/MP1/CSamusHud.cpp +++ b/Runtime/MP1/CSamusHud.cpp @@ -116,7 +116,7 @@ void CSamusHud::InitializeFrameGluePermanent(const CStateManager& mgr) { for (size_t i = 0; i < x5a4_videoBands.size(); ++i) { SVideoBand& band = x5a4_videoBands[i]; band.x0_videoband = - static_cast(x274_loadedFrmeBaseHud->FindWidget(fmt::format(fmt("model_videoband{}"), i))); + static_cast(x274_loadedFrmeBaseHud->FindWidget(fmt::format(FMT_STRING("model_videoband{}"), i))); band.x4_randA = 6 + (std::rand() % ((66 - 6) + 1)); band.x8_randB = 16 + (std::rand() % ((256 - 16) + 1)); } @@ -1301,7 +1301,7 @@ void CSamusHud::Update(float dt, const CStateManager& mgr, CInGameGuiManager::EH int minutes = mgr.GetEscapeSequenceTimer() / 60.f; int seconds = std::fmod(mgr.GetEscapeSequenceTimer(), 60.f); int hundredths = std::fmod(mgr.GetEscapeSequenceTimer() * 100.f, 100.f); - std::string timeStr = fmt::format(fmt("{:02d}:{:02d}:{:02d}"), int(minutes), int(seconds), int(hundredths)); + std::string timeStr = fmt::format(FMT_STRING("{:02d}:{:02d}:{:02d}"), int(minutes), int(seconds), int(hundredths)); x594_base_textpane_counter->TextSupport().SetText(timeStr); x594_base_textpane_counter->SetIsVisible(true); diff --git a/Runtime/MP1/CSlideShow.cpp b/Runtime/MP1/CSlideShow.cpp index 9c588f7cd..50338b7ab 100644 --- a/Runtime/MP1/CSlideShow.cpp +++ b/Runtime/MP1/CSlideShow.cpp @@ -101,7 +101,7 @@ CIOWin::EMessageReturn CSlideShow::OnMessage(const CArchitectureMessage& msg, CA if (x18_galleryTXTRDeps.empty()) { x18_galleryTXTRDeps.reserve(5); for (int i = 1; true; ++i) { - std::string depResName = fmt::format(fmt("Gallery{:02d}_DGRP"), i); + std::string depResName = fmt::format(FMT_STRING("Gallery{:02d}_DGRP"), i); if (!LoadTXTRDep(depResName)) break; } diff --git a/Runtime/MP1/MP1.cpp b/Runtime/MP1/MP1.cpp index eb89c9578..ee5eb0094 100644 --- a/Runtime/MP1/MP1.cpp +++ b/Runtime/MP1/MP1.cpp @@ -371,7 +371,7 @@ void CMain::AddOverridePaks() { * the higher the number the higer the priority, e.g: Override0 has less priority than Override1 etc. */ for (size_t i = 999; i > 0; --i) { - const std::string path = fmt::format(fmt("Override{}"), i); + const std::string path = fmt::format(FMT_STRING("Override{}"), i); if (CDvdFile::FileExists(path + ".upak")) { loader->AddPakFileAsync(path, false, false, true); } @@ -459,13 +459,13 @@ void CMain::Give(hecl::Console* console, const std::vector& args) { } else { CPlayerState::EItemType eType = CPlayerState::ItemNameToType(type); if (eType == CPlayerState::EItemType::Invalid) { - console->report(hecl::Console::Level::Info, fmt("Invalid item {}"), type); + console->report(hecl::Console::Level::Info, FMT_STRING("Invalid item {}"), type); return; } if (eType == CPlayerState::EItemType::HealthRefill) { pState->IncrPickup(eType, 9999); console->report(hecl::Console::Level::Info, - fmt("Cheater....., Greatly increasing Metroid encounters, have fun!")); + FMT_STRING("Cheater....., Greatly increasing Metroid encounters, have fun!")); if (g_StateManager) g_StateManager->Player()->AsyncLoadSuit(*g_StateManager); return; @@ -495,7 +495,7 @@ void CMain::Give(hecl::Console* console, const std::vector& args) { } if (g_StateManager) g_StateManager->Player()->AsyncLoadSuit(*g_StateManager); - console->report(hecl::Console::Level::Info, fmt("Cheater....., Greatly increasing Metroid encounters, have fun!")); + console->report(hecl::Console::Level::Info, FMT_STRING("Cheater....., Greatly increasing Metroid encounters, have fun!")); } // namespace MP1 void CMain::Remove(hecl::Console*, const std::vector& args) { @@ -523,9 +523,9 @@ void CMain::God(hecl::Console* con, const std::vector&) { if (g_GameState && g_GameState->GetPlayerState()) { g_GameState->GetPlayerState()->SetCanTakeDamage(!g_GameState->GetPlayerState()->CanTakeDamage()); if (!g_GameState->GetPlayerState()->CanTakeDamage()) - con->report(hecl::Console::Level::Info, fmt("God Mode Enabled")); + con->report(hecl::Console::Level::Info, FMT_STRING("God Mode Enabled")); else - con->report(hecl::Console::Level::Info, fmt("God Mode Disabled")); + con->report(hecl::Console::Level::Info, FMT_STRING("God Mode Disabled")); } } @@ -556,7 +556,7 @@ void CMain::ListWorlds(hecl::Console* con, const std::vector&) { if (pak->IsWorldPak()) { for (const auto& named : pak->GetNameList()) if (named.second.type == SBIG('MLVL')) { - con->report(hecl::Console::Level::Info, fmt("{} '{}'"), named.first, named.second.id); + con->report(hecl::Console::Level::Info, FMT_STRING("{} '{}'"), named.first, named.second.id); } } } @@ -674,7 +674,7 @@ void CMain::UpdateDiscordPresence(CAssetId worldSTRG) { u32 itemPercent = pState->CalculateItemCollectionRate() * 100 / pState->GetPickupTotal(); if (DiscordItemPercent != itemPercent) { DiscordItemPercent = itemPercent; - DiscordState = fmt::format(fmt("{}%"), itemPercent); + DiscordState = fmt::format(FMT_STRING("{}%"), itemPercent); updated = true; } } @@ -690,14 +690,14 @@ void CMain::UpdateDiscordPresence(CAssetId worldSTRG) { } } -void CMain::HandleDiscordReady(const DiscordUser* request) { DiscordLog.report(logvisor::Info, fmt("Discord Ready")); } +void CMain::HandleDiscordReady(const DiscordUser* request) { DiscordLog.report(logvisor::Info, FMT_STRING("Discord Ready")); } void CMain::HandleDiscordDisconnected(int errorCode, const char* message) { - DiscordLog.report(logvisor::Warning, fmt("Discord Disconnected: {}"), message); + DiscordLog.report(logvisor::Warning, FMT_STRING("Discord Disconnected: {}"), message); } void CMain::HandleDiscordErrored(int errorCode, const char* message) { - DiscordLog.report(logvisor::Error, fmt("Discord Error: {}"), message); + DiscordLog.report(logvisor::Error, FMT_STRING("Discord Error: {}"), message); } void CMain::Init(const hecl::Runtime::FileStoreManager& storeMgr, hecl::CVarManager* cvarMgr, boo::IWindow* window, @@ -825,7 +825,7 @@ void CMain::WarmupShaders() { m_warmupIt = m_warmupTags.begin(); - WarmupLog.report(logvisor::Info, fmt("Began warmup of {} objects"), m_warmupTags.size()); + WarmupLog.report(logvisor::Info, FMT_STRING("Began warmup of {} objects"), m_warmupTags.size()); } bool CMain::Proc() { @@ -882,7 +882,7 @@ void CMain::Draw() { } auto startTime = std::chrono::steady_clock::now(); while (m_warmupIt != m_warmupTags.end()) { - WarmupLog.report(logvisor::Info, fmt("[{} / {}] Warming {}"), int(m_warmupIt - m_warmupTags.begin() + 1), + WarmupLog.report(logvisor::Info, FMT_STRING("[{} / {}] Warming {}"), int(m_warmupIt - m_warmupTags.begin() + 1), int(m_warmupTags.size()), *m_warmupIt); if (m_warmupIt->type == FOURCC('CMDL')) @@ -898,7 +898,7 @@ void CMain::Draw() { } if (m_warmupIt == m_warmupTags.end()) { m_warmupTags = std::vector(); - WarmupLog.report(logvisor::Info, fmt("Finished warmup")); + WarmupLog.report(logvisor::Info, FMT_STRING("Finished warmup")); } return; } diff --git a/Runtime/MP1/MP1.hpp b/Runtime/MP1/MP1.hpp index f805dff6a..eea752799 100644 --- a/Runtime/MP1/MP1.hpp +++ b/Runtime/MP1/MP1.hpp @@ -204,7 +204,7 @@ class CMain : public IMain int appMain(boo::IApplication* app); void appQuitting(boo::IApplication*) { xe8_b24_finished = true; } void appFilesOpen(boo::IApplication*, const std::vector& paths) { - fmt::print(stderr, fmt("OPENING: ")); + fmt::print(stderr, FMT_STRING("OPENING: ")); for (const std::string& path : paths) fprintf(stderr, "%s ", path.c_str()); fprintf(stderr, "\n"); diff --git a/Runtime/MP1/World/CSpankWeed.cpp b/Runtime/MP1/World/CSpankWeed.cpp index 223d1dc20..2bdb9bff0 100644 --- a/Runtime/MP1/World/CSpankWeed.cpp +++ b/Runtime/MP1/World/CSpankWeed.cpp @@ -29,7 +29,7 @@ CSpankWeed::CSpankWeed(TUniqueId uid, std::string_view name, const CEntityInfo& GetModelData()->SetScale(zeus::CVector3f(scale)); SpankLog.report(logvisor::Level::Warning, - fmt("WARNING: Non-uniform scale {} applied to Spank Weed" + FMT_STRING("WARNING: Non-uniform scale {} applied to Spank Weed" "...changing scale to ({} {} {})\n"), modelScale, scale, scale, scale); } diff --git a/Runtime/MP1/World/CThardus.cpp b/Runtime/MP1/World/CThardus.cpp index ae6c743a9..0961b8c14 100644 --- a/Runtime/MP1/World/CThardus.cpp +++ b/Runtime/MP1/World/CThardus.cpp @@ -920,7 +920,7 @@ void CThardus::sub801dae2c(CStateManager& mgr, u32 rockIndex) { void CThardus::sub801dc444(CStateManager& mgr, const zeus::CVector3f& pos, CAssetId particle) { u32 w = x6f4_; ++x6f4_; - std::string particleName = fmt::format(fmt("ROCK_EFFECT{}-{}"), particle.Value(), w); + std::string particleName = fmt::format(FMT_STRING("ROCK_EFFECT{}-{}"), particle.Value(), w); GetModelData()->GetAnimationData()->GetParticleDB().AddAuxiliaryParticleEffect( particleName, 0x40, CAuxiliaryParticleData(0, {FOURCC('PART'), particle}, pos, 1.f), 2.f * GetModelData()->GetScale(), mgr, GetAreaIdAlways(), 0); diff --git a/Runtime/Particle/CDecalDataFactory.cpp b/Runtime/Particle/CDecalDataFactory.cpp index 48ea6300a..edb35b7f2 100644 --- a/Runtime/Particle/CDecalDataFactory.cpp +++ b/Runtime/Particle/CDecalDataFactory.cpp @@ -85,7 +85,7 @@ bool CDecalDataFactory::CreateDPSM(CDecalDescription* desc, CInputStream& in, CS desc->x5c_25_DMOO = CPF::GetBool(in); break; default: { - Log.report(logvisor::Fatal, fmt("Unknown DPSC class {} @{}"), clsId, in.position()); + Log.report(logvisor::Fatal, FMT_STRING("Unknown DPSC class {} @{}"), clsId, in.position()); return false; } } diff --git a/Runtime/Particle/CElementGen.cpp b/Runtime/Particle/CElementGen.cpp index 479d44e56..8aece4666 100644 --- a/Runtime/Particle/CElementGen.cpp +++ b/Runtime/Particle/CElementGen.cpp @@ -255,7 +255,7 @@ bool CElementGen::Update(double t) { if (pswtElem && !x26d_25_warmedUp) { int pswt = 0; pswtElem->GetValue(x74_curFrame, pswt); - //Log.report(logvisor::Info, fmt("Running warmup on particle system 0x%08x for %d ticks."), desc, pswt); + //Log.report(logvisor::Info, FMT_STRING("Running warmup on particle system 0x%08x for %d ticks."), desc, pswt); InternalUpdate((1.f / 60.f) * pswt); x26d_25_warmedUp = true; } @@ -813,7 +813,7 @@ u32 CElementGen::GetSystemCount() const { } void CElementGen::Render(const CActorLights* actorLights) { - SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(fmt("CElementGen::Render {}"), + SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(FMT_STRING("CElementGen::Render {}"), *x1c_genDesc.GetObjectTag()).c_str(), zeus::skYellow); CGenDescription* desc = x1c_genDesc.GetObj(); @@ -898,7 +898,7 @@ void CElementGen::RenderModels(const CActorLights* actorLights) { g_instNoTexData.reserve(x30_particles.size()); break; default: - Log.report(logvisor::Fatal, fmt("unexpected particle shader class")); + Log.report(logvisor::Fatal, FMT_STRING("unexpected particle shader class")); break; } @@ -1310,7 +1310,7 @@ void CElementGen::RenderParticles() { g_instNoTexData.reserve(x30_particles.size()); break; default: - Log.report(logvisor::Fatal, fmt("unexpected particle shader class")); + Log.report(logvisor::Fatal, FMT_STRING("unexpected particle shader class")); break; } @@ -1499,7 +1499,7 @@ void CElementGen::RenderParticles() { g_instNoTexData.reserve(x30_particles.size() * mbspVal); break; default: - Log.report(logvisor::Fatal, fmt("unexpected particle shader class")); + Log.report(logvisor::Fatal, FMT_STRING("unexpected particle shader class")); break; } const float mbspFac = 1.f / float(mbspVal); diff --git a/Runtime/Particle/CParticleDataFactory.cpp b/Runtime/Particle/CParticleDataFactory.cpp index cf0b89f2b..ae6c5eedf 100644 --- a/Runtime/Particle/CParticleDataFactory.cpp +++ b/Runtime/Particle/CParticleDataFactory.cpp @@ -18,7 +18,7 @@ s32 CParticleDataFactory::GetInt(CInputStream& in) { return in.readInt32Big(); } bool CParticleDataFactory::GetBool(CInputStream& in) { FourCC cid = GetClassID(in); if (cid != FOURCC('CNST')) - Log.report(logvisor::Fatal, fmt("bool element does not begin with CNST")); + Log.report(logvisor::Fatal, FMT_STRING("bool element does not begin with CNST")); return in.readBool(); } @@ -984,7 +984,7 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i fillDesc->xec_xd8_SELC = GetElectricGeneratorDesc(in, resPool); break; default: { - Log.report(logvisor::Fatal, fmt("Unknown GPSM class {} @{}"), clsId, in.position()); + Log.report(logvisor::Fatal, FMT_STRING("Unknown GPSM class {} @{}"), clsId, in.position()); return false; } } diff --git a/Runtime/Particle/CParticleElectric.cpp b/Runtime/Particle/CParticleElectric.cpp index 679f6a773..777c83593 100644 --- a/Runtime/Particle/CParticleElectric.cpp +++ b/Runtime/Particle/CParticleElectric.cpp @@ -556,7 +556,7 @@ bool CParticleElectric::Update(double dt) { } void CParticleElectric::Render(const CActorLights* lights) { - SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(fmt("CParticleElectric::Render {}"), + SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(FMT_STRING("CParticleElectric::Render {}"), *x1c_elecDesc.GetObjectTag()).c_str(), zeus::skYellow); if (x3e8_electricManagers.size()) { diff --git a/Runtime/Particle/CParticleElectricDataFactory.cpp b/Runtime/Particle/CParticleElectricDataFactory.cpp index fe366b70a..dc88cb621 100644 --- a/Runtime/Particle/CParticleElectricDataFactory.cpp +++ b/Runtime/Particle/CParticleElectricDataFactory.cpp @@ -107,7 +107,7 @@ bool CParticleElectricDataFactory::CreateELSM(CElectricDescription* desc, CInput desc->x70_ZERY = CPF::GetBool(in); break; default: { - Log.report(logvisor::Fatal, fmt("Unknown ELSM class {} @{}"), clsId, in.position()); + Log.report(logvisor::Fatal, FMT_STRING("Unknown ELSM class {} @{}"), clsId, in.position()); return false; } } diff --git a/Runtime/Particle/CParticleSwoosh.cpp b/Runtime/Particle/CParticleSwoosh.cpp index 00501a7bf..01efb394a 100644 --- a/Runtime/Particle/CParticleSwoosh.cpp +++ b/Runtime/Particle/CParticleSwoosh.cpp @@ -882,7 +882,7 @@ void CParticleSwoosh::Render2SidedNoSplineNoGaps() { void CParticleSwoosh::Render(const CActorLights*) { if (x1b4_LENG < 2 || x1ac_particleCount <= 1) return; - SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(fmt("CParticleSwoosh::Render {}"), + SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(FMT_STRING("CParticleSwoosh::Render {}"), *x1c_desc.GetObjectTag()).c_str(), zeus::skYellow); m_cachedVerts.clear(); diff --git a/Runtime/Particle/CParticleSwooshDataFactory.cpp b/Runtime/Particle/CParticleSwooshDataFactory.cpp index 122d93b02..76ef71e19 100644 --- a/Runtime/Particle/CParticleSwooshDataFactory.cpp +++ b/Runtime/Particle/CParticleSwooshDataFactory.cpp @@ -122,7 +122,7 @@ bool CParticleSwooshDataFactory::CreateWPSM(CSwooshDescription* desc, CInputStre desc->x45_26_CRND = CPF::GetBool(in); break; default: { - Log.report(logvisor::Fatal, fmt("Unknown SWSH class {} @{}"), clsId, in.position()); + Log.report(logvisor::Fatal, FMT_STRING("Unknown SWSH class {} @{}"), clsId, in.position()); return false; } } diff --git a/Runtime/Particle/CProjectileWeaponDataFactory.cpp b/Runtime/Particle/CProjectileWeaponDataFactory.cpp index 6727f4295..3eae8c2e4 100644 --- a/Runtime/Particle/CProjectileWeaponDataFactory.cpp +++ b/Runtime/Particle/CProjectileWeaponDataFactory.cpp @@ -150,7 +150,7 @@ bool CProjectileWeaponDataFactory::CreateWPSM(CWeaponDescription* desc, CInputSt desc->xb0_FOFF = CPF::GetRealElement(in); break; default: { - Log.report(logvisor::Fatal, fmt("Unknown WPSM class {} @{}"), clsId, in.position()); + Log.report(logvisor::Fatal, FMT_STRING("Unknown WPSM class {} @{}"), clsId, in.position()); return false; } } diff --git a/Runtime/RetroTypes.cpp b/Runtime/RetroTypes.cpp index d9fc73d5d..3a94df7d5 100644 --- a/Runtime/RetroTypes.cpp +++ b/Runtime/RetroTypes.cpp @@ -15,9 +15,9 @@ CAssetId::CAssetId(CInputStream& in) { else if (g_Main->GetExpectedIdSize() == sizeof(u64)) Assign(in.readUint64Big()); else - Log.report(logvisor::Fatal, fmt("Unsupported id length {}"), g_Main->GetExpectedIdSize()); + Log.report(logvisor::Fatal, FMT_STRING("Unsupported id length {}"), g_Main->GetExpectedIdSize()); } else - Log.report(logvisor::Fatal, fmt("Input constructor called before runtime Main entered!")); + Log.report(logvisor::Fatal, FMT_STRING("Input constructor called before runtime Main entered!")); } void CAssetId::PutTo(COutputStream& out) { @@ -27,9 +27,9 @@ void CAssetId::PutTo(COutputStream& out) { else if (g_Main->GetExpectedIdSize() == sizeof(u64)) out.writeUint64Big(id); else - Log.report(logvisor::Fatal, fmt("Unsupported id length {}"), g_Main->GetExpectedIdSize()); + Log.report(logvisor::Fatal, FMT_STRING("Unsupported id length {}"), g_Main->GetExpectedIdSize()); } else - Log.report(logvisor::Fatal, fmt("PutTo called before runtime Main entered!")); + Log.report(logvisor::Fatal, FMT_STRING("PutTo called before runtime Main entered!")); } } // namespace urde \ No newline at end of file diff --git a/Runtime/Weapon/CEnergyProjectile.cpp b/Runtime/Weapon/CEnergyProjectile.cpp index bd0c83d8f..e829d3c13 100644 --- a/Runtime/Weapon/CEnergyProjectile.cpp +++ b/Runtime/Weapon/CEnergyProjectile.cpp @@ -190,7 +190,7 @@ void CEnergyProjectile::Think(float dt, CStateManager& mgr) { } void CEnergyProjectile::Render(CStateManager& mgr) { - SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(fmt("CEnergyProjectile::Render WPSC_{}"), x2cc_wpscId).c_str(), zeus::skOrange); + SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(FMT_STRING("CEnergyProjectile::Render WPSC_{}"), x2cc_wpscId).c_str(), zeus::skOrange); CPlayerState::EPlayerVisor visor = mgr.GetPlayerState()->GetActiveVisor(mgr); if (visor == CPlayerState::EPlayerVisor::Combat) { diff --git a/Runtime/World/CActor.cpp b/Runtime/World/CActor.cpp index cf6b100e5..ee78f3806 100644 --- a/Runtime/World/CActor.cpp +++ b/Runtime/World/CActor.cpp @@ -222,7 +222,7 @@ void CActor::DrawTouchBounds() const { void CActor::RenderInternal(const CStateManager& mgr) const { SCOPED_GRAPHICS_DEBUG_GROUP( - fmt::format(fmt("CActor::RenderInternal {} {} {}"), x8_uid, xc_editorId, x10_name).c_str(), zeus::skOrange); + fmt::format(FMT_STRING("CActor::RenderInternal {} {} {}"), x8_uid, xc_editorId, x10_name).c_str(), zeus::skOrange); CModelData::EWhichModel which = CModelData::GetRenderingModel(mgr); if (which == CModelData::EWhichModel::ThermalHot) { diff --git a/Runtime/World/CFishCloud.cpp b/Runtime/World/CFishCloud.cpp index 750467784..a518c3fc2 100644 --- a/Runtime/World/CFishCloud.cpp +++ b/Runtime/World/CFishCloud.cpp @@ -530,7 +530,7 @@ void CFishCloud::RenderBoid(int idx, const CBoid& boid, u32& drawMask, void CFishCloud::Render(CStateManager& mgr) { if (!GetActive()) return; - SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(fmt("CFishCloud::Render {} {} {}"), + SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(FMT_STRING("CFishCloud::Render {} {} {}"), x8_uid, xc_editorId, x10_name).c_str(), zeus::skOrange); bool thermalHot = mgr.GetThermalDrawFlag() == EThermalDrawFlag::Hot; CModelFlags flags(0, 0, 3, zeus::skWhite); diff --git a/Runtime/World/CGameArea.cpp b/Runtime/World/CGameArea.cpp index 050adf9f7..28c5f04d2 100644 --- a/Runtime/World/CGameArea.cpp +++ b/Runtime/World/CGameArea.cpp @@ -253,7 +253,7 @@ std::pair, s32> GetScriptingMemoryAlways(const IGameArea& CMemoryInStream r(data.get() + 4, 96 - 4); u32 version = r.readUint32Big(); if (!(version & 0x10000)) - Log.report(logvisor::Fatal, fmt("Attempted to load non-URDE MREA")); + Log.report(logvisor::Fatal, FMT_STRING("Attempted to load non-URDE MREA")); version &= ~0x10000; header.version = (version >= 12 && version <= 15) ? version : 0; @@ -1148,7 +1148,7 @@ SMREAHeader CGameArea::VerifyHeader() const { CMemoryInStream r(x110_mreaSecBufs[0].first.get() + 4, x110_mreaSecBufs[0].second - 4); u32 version = r.readUint32Big(); if (!(version & 0x10000)) - Log.report(logvisor::Fatal, fmt("Attempted to load non-URDE MREA")); + Log.report(logvisor::Fatal, FMT_STRING("Attempted to load non-URDE MREA")); version &= ~0x10000; header.version = (version >= 12 && version <= 15) ? version : 0; if (!header.version) diff --git a/Runtime/World/CPathFindArea.cpp b/Runtime/World/CPathFindArea.cpp index 568dcbd85..ec3aae84b 100644 --- a/Runtime/World/CPathFindArea.cpp +++ b/Runtime/World/CPathFindArea.cpp @@ -123,7 +123,7 @@ CPFArea::CPFArea(std::unique_ptr&& buf, u32 len) { u32 version = r.readUint32Big(); if (version != 4) - Log.report(logvisor::Fatal, fmt("Unexpected PATH version {}, should be 4"), version); + Log.report(logvisor::Fatal, FMT_STRING("Unexpected PATH version {}, should be 4"), version); u32 numNodes = r.readUint32Big(); x140_nodes.reserve(numNodes); diff --git a/Runtime/World/CPlayer.cpp b/Runtime/World/CPlayer.cpp index e8c81ad00..a8a374f64 100644 --- a/Runtime/World/CPlayer.cpp +++ b/Runtime/World/CPlayer.cpp @@ -3948,7 +3948,7 @@ void CPlayer::SetOrbitState(EPlayerOrbitState state, CStateManager& mgr) { #ifndef NDEBUG if (x310_orbitTargetId != kInvalidUniqueId) { if (const CEntity* ent = mgr.GetObjectById(x310_orbitTargetId)) { - Log.report(logvisor::Info, fmt("Orbiting {} {}"), ent->GetEditorId(), ent->GetName()); + Log.report(logvisor::Info, FMT_STRING("Orbiting {} {}"), ent->GetEditorId(), ent->GetName()); } } #endif diff --git a/Runtime/World/CScriptGunTurret.cpp b/Runtime/World/CScriptGunTurret.cpp index 596a52c27..134ce33f8 100644 --- a/Runtime/World/CScriptGunTurret.cpp +++ b/Runtime/World/CScriptGunTurret.cpp @@ -395,7 +395,7 @@ void CScriptGunTurret::SetTurretState(ETurretState state, CStateManager& mgr) { if (state != ETurretState::Invalid && x520_state != state) { #ifndef NDEBUG - fmt::print(fmt("{} {} {} - {}\n"), GetUniqueId(), GetEditorId(), GetName(), StateNames[size_t(state)]); + fmt::print(FMT_STRING("{} {} {} - {}\n"), GetUniqueId(), GetEditorId(), GetName(), StateNames[size_t(state)]); #endif } diff --git a/Runtime/World/CScriptStreamedMusic.cpp b/Runtime/World/CScriptStreamedMusic.cpp index 841861bf4..0cf0e9e2e 100644 --- a/Runtime/World/CScriptStreamedMusic.cpp +++ b/Runtime/World/CScriptStreamedMusic.cpp @@ -27,7 +27,7 @@ void CScriptStreamedMusic::StartStream(CStateManager& mgr) { void CScriptStreamedMusic::TweakOverride(CStateManager& mgr) { const CWorld* wld = mgr.GetWorld(); const CGameArea* area = wld->GetAreaAlways(x4_areaId); - std::string twkName = fmt::format(fmt("Area {} MusicObject: {}"), area->GetAreaAssetId(), x10_name); + std::string twkName = fmt::format(FMT_STRING("Area {} MusicObject: {}"), area->GetAreaAssetId(), x10_name); if (g_TweakManager->HasTweakValue(twkName)) { const CTweakValue::Audio& audio = g_TweakManager->GetTweakValue(twkName)->GetAudio(); x34_fileName = audio.GetFileName(); diff --git a/Runtime/World/CStateMachine.cpp b/Runtime/World/CStateMachine.cpp index 14ddf2e4e..a0274536d 100644 --- a/Runtime/World/CStateMachine.cpp +++ b/Runtime/World/CStateMachine.cpp @@ -79,7 +79,7 @@ void CStateMachineState::Update(CStateManager& mgr, CAi& ai, float delta) { x4_state->CallFunc(mgr, ai, EStateMsg::Deactivate, 0.f); x4_state = state; #ifndef NDEBUG - fmt::print(fmt("{} {} {} - {} {}\n"), ai.GetUniqueId(), ai.GetEditorId(), ai.GetName(), + fmt::print(FMT_STRING("{} {} {} - {} {}\n"), ai.GetUniqueId(), ai.GetEditorId(), ai.GetName(), state->xc_name, int(state - x0_machine->GetStateVector().data())); #endif x8_time = 0.f; diff --git a/Runtime/World/CWallCrawlerSwarm.cpp b/Runtime/World/CWallCrawlerSwarm.cpp index b71d0aa43..ef29f96e7 100644 --- a/Runtime/World/CWallCrawlerSwarm.cpp +++ b/Runtime/World/CWallCrawlerSwarm.cpp @@ -1083,7 +1083,7 @@ void CWallCrawlerSwarm::RenderBoid(const CBoid* boid, u32& drawMask, bool therma } void CWallCrawlerSwarm::Render(CStateManager& mgr) { - SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(fmt("CWallCrawlerSwarm::Render {} {} {}"), + SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(FMT_STRING("CWallCrawlerSwarm::Render {} {} {}"), x8_uid, xc_editorId, x10_name).c_str(), zeus::skOrange); u32 drawMask = 0xffffffff; const bool r24 = x560_24_enableLighting; diff --git a/Runtime/World/CWorld.cpp b/Runtime/World/CWorld.cpp index 3566ac5d7..7d38acbf7 100644 --- a/Runtime/World/CWorld.cpp +++ b/Runtime/World/CWorld.cpp @@ -350,7 +350,7 @@ bool CWorld::CheckWorldComplete(CStateManager* mgr, TAreaId id, CAssetId mreaId) if (version > 12) { x84_defAudioTrack = r.readString(); - std::string trackKey = fmt::format(fmt("WorldDefault: {}"), x8_mlvlId); + std::string trackKey = fmt::format(FMT_STRING("WorldDefault: {}"), x8_mlvlId); if (g_TweakManager->HasTweakValue(trackKey)) x84_defAudioTrack = g_TweakManager->GetTweakValue(trackKey)->GetAudio().GetFileName(); } diff --git a/Runtime/World/ScriptLoader.cpp b/Runtime/World/ScriptLoader.cpp index 1f2ad0087..68dde9d09 100644 --- a/Runtime/World/ScriptLoader.cpp +++ b/Runtime/World/ScriptLoader.cpp @@ -132,7 +132,7 @@ constexpr int skElitePiratePropCount = 41; static bool EnsurePropertyCount(int count, int expected, const char* structName) { if (count < expected) { - Log.report(logvisor::Warning, fmt("Insufficient number of props ({}/{}) for {} entity"), count, expected, + Log.report(logvisor::Warning, FMT_STRING("Insufficient number of props ({}/{}) for {} entity"), count, expected, structName); return false; } @@ -698,7 +698,7 @@ CEntity* ScriptLoader::LoadSound(CStateManager& mgr, CInputStream& in, int propC s32 pitch = in.readInt32Big(); if (soundId < 0) { - Log.report(logvisor::Warning, fmt("Invalid sound ID specified in Sound {} ({}), dropping..."), head.x0_name, + Log.report(logvisor::Warning, FMT_STRING("Invalid sound ID specified in Sound {} ({}), dropping..."), head.x0_name, info.GetEditorId()); return nullptr; } @@ -854,7 +854,7 @@ CEntity* ScriptLoader::LoadSpawnPoint(CStateManager& mgr, CInputStream& in, int CEntity* ScriptLoader::LoadCameraHint(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) { if (propCount > 25) { - Log.report(logvisor::Warning, fmt("Too many props ({} > 25) for CameraHint entity"), propCount); + Log.report(logvisor::Warning, FMT_STRING("Too many props ({} > 25) for CameraHint entity"), propCount); return nullptr; } @@ -1362,7 +1362,7 @@ CEntity* ScriptLoader::LoadSpacePirate(CStateManager& mgr, CInputStream& in, int if (animParms.GetCharacter() == 0) { Log.report(logvisor::Warning, - fmt("SpacePirate <{}> has AnimationInformation property with invalid character selected"), head.x0_name); + FMT_STRING("SpacePirate <{}> has AnimationInformation property with invalid character selected"), head.x0_name); animParms.SetCharacter(2); } @@ -1591,7 +1591,7 @@ CEntity* ScriptLoader::LoadFlickerBat(CStateManager& mgr, CInputStream& in, int CEntity* ScriptLoader::LoadPathCamera(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) { if (propCount > 15) { - Log.report(logvisor::Warning, fmt("Too many props ({} > 15) for PathCamera entity"), propCount); + Log.report(logvisor::Warning, FMT_STRING("Too many props ({} > 15) for PathCamera entity"), propCount); return nullptr; } @@ -2382,7 +2382,7 @@ CEntity* ScriptLoader::LoadVisorFlare(CStateManager& mgr, CInputStream& in, int CEntity* ScriptLoader::LoadWorldTeleporter(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) { if (propCount < 4 || propCount > 26) { - Log.report(logvisor::Warning, fmt("Incorrect number of props for WorldTeleporter")); + Log.report(logvisor::Warning, FMT_STRING("Incorrect number of props for WorldTeleporter")); return nullptr; } diff --git a/Runtime/rstl.hpp b/Runtime/rstl.hpp index eaf42903e..d1ceb77b3 100644 --- a/Runtime/rstl.hpp +++ b/Runtime/rstl.hpp @@ -363,7 +363,7 @@ public: void push_back(const T& d) { #ifndef NDEBUG if (x0_size == N) { - Log.report(logvisor::Fatal, fmt("push_back() called on full rstl::reserved_vector.")); + Log.report(logvisor::Fatal, FMT_STRING("push_back() called on full rstl::reserved_vector.")); } #endif @@ -374,7 +374,7 @@ public: void push_back(T&& d) { #ifndef NDEBUG if (x0_size == N) { - Log.report(logvisor::Fatal, fmt("push_back() called on full rstl::reserved_vector.")); + Log.report(logvisor::Fatal, FMT_STRING("push_back() called on full rstl::reserved_vector.")); } #endif @@ -386,7 +386,7 @@ public: T& emplace_back(_Args&&... args) { #ifndef NDEBUG if (x0_size == N) { - Log.report(logvisor::Fatal, fmt("emplace_back() called on full rstl::reserved_vector.")); + Log.report(logvisor::Fatal, FMT_STRING("emplace_back() called on full rstl::reserved_vector.")); } #endif @@ -400,7 +400,7 @@ public: void pop_back() { #ifndef NDEBUG if (x0_size == 0) { - Log.report(logvisor::Fatal, fmt("pop_back() called on empty rstl::reserved_vector.")); + Log.report(logvisor::Fatal, FMT_STRING("pop_back() called on empty rstl::reserved_vector.")); } #endif @@ -411,7 +411,7 @@ public: iterator insert(const_iterator pos, const T& value) { #ifndef NDEBUG if (x0_size == N) { - Log.report(logvisor::Fatal, fmt("insert() called on full rstl::reserved_vector.")); + Log.report(logvisor::Fatal, FMT_STRING("insert() called on full rstl::reserved_vector.")); } #endif @@ -432,7 +432,7 @@ public: iterator insert(const_iterator pos, T&& value) { #ifndef NDEBUG if (x0_size == N) - Log.report(logvisor::Fatal, fmt("insert() called on full rstl::reserved_vector.")); + Log.report(logvisor::Fatal, FMT_STRING("insert() called on full rstl::reserved_vector.")); #endif auto target_it = base::_const_cast_iterator(pos); if (pos == cend()) { @@ -451,7 +451,7 @@ public: void resize(size_t size) { #ifndef NDEBUG if (size > N) { - Log.report(logvisor::Fatal, fmt("resize() call overflows rstl::reserved_vector.")); + Log.report(logvisor::Fatal, FMT_STRING("resize() call overflows rstl::reserved_vector.")); } #endif @@ -473,7 +473,7 @@ public: void resize(size_t size, const T& value) { #ifndef NDEBUG if (size > N) { - Log.report(logvisor::Fatal, fmt("resize() call overflows rstl::reserved_vector.")); + Log.report(logvisor::Fatal, FMT_STRING("resize() call overflows rstl::reserved_vector.")); } #endif @@ -495,7 +495,7 @@ public: iterator erase(const_iterator pos) { #ifndef NDEBUG if (x0_size == 0) { - Log.report(logvisor::Fatal, fmt("erase() called on empty rstl::reserved_vector.")); + Log.report(logvisor::Fatal, FMT_STRING("erase() called on empty rstl::reserved_vector.")); } #endif @@ -554,7 +554,7 @@ public: [[nodiscard]] T& operator[](size_t idx) { #ifndef NDEBUG if (idx >= x0_size) { - Log.report(logvisor::Fatal, fmt("out of bounds access on reserved_vector.")); + Log.report(logvisor::Fatal, FMT_STRING("out of bounds access on reserved_vector.")); } #endif return _value(idx); @@ -562,7 +562,7 @@ public: [[nodiscard]] const T& operator[](size_t idx) const { #ifndef NDEBUG if (idx >= x0_size) { - Log.report(logvisor::Fatal, fmt("out of bounds access on reserved_vector.")); + Log.report(logvisor::Fatal, FMT_STRING("out of bounds access on reserved_vector.")); } #endif return _value(idx); diff --git a/Shaders/shader_CFluidPlaneShaderGLSL.cpp b/Shaders/shader_CFluidPlaneShaderGLSL.cpp index 9a2646d0c..7e7e218f4 100644 --- a/Shaders/shader_CFluidPlaneShaderGLSL.cpp +++ b/Shaders/shader_CFluidPlaneShaderGLSL.cpp @@ -332,19 +332,19 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { out << "#define TEXTURE_DECLS "; if (info.m_hasPatternTex1) - fmt::print(out, fmt("TBINDING{} uniform sampler2D patternTex1;"), nextTex++); + fmt::print(out, FMT_STRING("TBINDING{} uniform sampler2D patternTex1;"), nextTex++); if (info.m_hasPatternTex2) - fmt::print(out, fmt("TBINDING{} uniform sampler2D patternTex2;"), nextTex++); + fmt::print(out, FMT_STRING("TBINDING{} uniform sampler2D patternTex2;"), nextTex++); if (info.m_hasColorTex) - fmt::print(out, fmt("TBINDING{} uniform sampler2D colorTex;"), nextTex++); + fmt::print(out, FMT_STRING("TBINDING{} uniform sampler2D colorTex;"), nextTex++); if (info.m_hasBumpMap) - fmt::print(out, fmt("TBINDING{} uniform sampler2D bumpMap;"), nextTex++); + fmt::print(out, FMT_STRING("TBINDING{} uniform sampler2D bumpMap;"), nextTex++); if (info.m_hasEnvMap) - fmt::print(out, fmt("TBINDING{} uniform sampler2D envMap;"), nextTex++); + fmt::print(out, FMT_STRING("TBINDING{} uniform sampler2D envMap;"), nextTex++); if (info.m_hasEnvBumpMap) - fmt::print(out, fmt("TBINDING{} uniform sampler2D envBumpMap;"), nextTex++); + fmt::print(out, FMT_STRING("TBINDING{} uniform sampler2D envBumpMap;"), nextTex++); if (info.m_hasLightmap) - fmt::print(out, fmt("TBINDING{} uniform sampler2D lightMap;"), nextTex++); + fmt::print(out, FMT_STRING("TBINDING{} uniform sampler2D lightMap;"), nextTex++); out << '\n'; if (info.m_hasBumpMap) @@ -362,7 +362,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { case EFluidType::PhazonFluid: case EFluidType::Four: if (info.m_hasLightmap) { - fmt::print(out, fmt("vec4 lightMapTexel = texture(lightMap, vtf.uvs[{}]);"), lightmapUv); + fmt::print(out, FMT_STRING("vec4 lightMapTexel = texture(lightMap, vtf.uvs[{}]);"), lightmapUv); // 0: Tex4TCG, Tex4, doubleLightmapBlend ? NULL : GX_COLOR1A1 // ZERO, TEX, KONST, doubleLightmapBlend ? ZERO : RAS // Output reg 2 @@ -407,7 +407,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { if (info.m_hasColorTex && !info.m_hasEnvMap && info.m_hasEnvBumpMap) { // Make previous stage indirect, mtx0 - fmt::print(out, fmt( + fmt::print(out, FMT_STRING( "vec2 indUvs = (texture(envBumpMap, vtf.uvs[{}]).ra - vec2(0.5, 0.5)) * " "vec2(fog.indScale, -fog.indScale);"), envBumpMapUv); @@ -421,11 +421,11 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { // Make previous stage indirect, mtx0 if (info.m_hasColorTex) out << "colorOut += texture(colorTex, vtf.uvs[2]) * lighting;"; - fmt::print(out, fmt( + fmt::print(out, FMT_STRING( "vec2 indUvs = (texture(envBumpMap, vtf.uvs[{}]).ra - vec2(0.5, 0.5)) * " "vec2(fog.indScale, -fog.indScale);"), envBumpMapUv); - fmt::print(out, fmt("colorOut = mix(colorOut, texture(envMap, indUvs + vtf.uvs[{}]), kColor1);"), envMapUv); + fmt::print(out, FMT_STRING("colorOut = mix(colorOut, texture(envMap, indUvs + vtf.uvs[{}]), kColor1);"), envMapUv); } else if (info.m_hasColorTex) { out << "colorOut += texture(colorTex, vtf.uvs[2]) * lighting;"; } @@ -434,7 +434,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { case EFluidType::PoisonWater: if (info.m_hasLightmap) { - fmt::print(out, fmt("vec4 lightMapTexel = texture(lightMap, vtf.uvs[{}]);"), lightmapUv); + fmt::print(out, FMT_STRING("vec4 lightMapTexel = texture(lightMap, vtf.uvs[{}]);"), lightmapUv); // 0: Tex4TCG, Tex4, doubleLightmapBlend ? NULL : GX_COLOR1A1 // ZERO, TEX, KONST, doubleLightmapBlend ? ZERO : RAS // Output reg 2 @@ -480,7 +480,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { if (info.m_hasColorTex) { if (info.m_hasEnvBumpMap) { // Make previous stage indirect, mtx0 - fmt::print(out, fmt( + fmt::print(out, FMT_STRING( "vec2 indUvs = (texture(envBumpMap, vtf.uvs[{}]).ra - vec2(0.5, 0.5)) * " "vec2(fog.indScale, -fog.indScale);"), envBumpMapUv); @@ -534,7 +534,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { "vec3 lightVec = lights[3].pos.xyz - vtf.mvPos.xyz;" "float lx = dot(vtf.mvTangent.xyz, lightVec);" "float ly = dot(vtf.mvBinorm.xyz, lightVec);"; - fmt::print(out, fmt( + fmt::print(out, FMT_STRING( "vec4 emboss1 = texture(bumpMap, vtf.uvs[{}]) + vec4(0.5);" "vec4 emboss2 = texture(bumpMap, vtf.uvs[{}] + vec2(lx, ly));"), bumpMapUv, bumpMapUv); @@ -582,7 +582,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { // 3: bumpMapTCG, bumpMap, NULL // ZERO, TEX, PREV, ZERO // Output reg prev, scale 2 - fmt::print(out, fmt("vec4 emboss1 = texture(bumpMap, vtf.uvs[{}]) + vec4(0.5);"), bumpMapUv); + fmt::print(out, FMT_STRING("vec4 emboss1 = texture(bumpMap, vtf.uvs[{}]) + vec4(0.5);"), bumpMapUv); out << "colorOut *= emboss1 * vec4(2.0);"; } @@ -602,13 +602,13 @@ static void _BuildAdditionalTCGs(std::stringstream& out, const SFluidPlaneShader out << "#define ADDITIONAL_TCGS "; if (info.m_hasBumpMap) - fmt::print(out, fmt("vtf.uvs[{}] = (texMtxs[0] * pos).xy;"), nextTCG++); + fmt::print(out, FMT_STRING("vtf.uvs[{}] = (texMtxs[0] * pos).xy;"), nextTCG++); if (info.m_hasEnvBumpMap) - fmt::print(out, fmt("vtf.uvs[{}] = (texMtxs[3] * vec4(normalIn.xyz, 1.0)).xy;"), nextTCG++); + fmt::print(out, FMT_STRING("vtf.uvs[{}] = (texMtxs[3] * vec4(normalIn.xyz, 1.0)).xy;"), nextTCG++); if (info.m_hasEnvMap) - fmt::print(out, fmt("vtf.uvs[{}] = (texMtxs[{}] * pos).xy;"), nextTCG++, nextMtx++); + fmt::print(out, FMT_STRING("vtf.uvs[{}] = (texMtxs[{}] * pos).xy;"), nextTCG++, nextMtx++); if (info.m_hasLightmap) - fmt::print(out, fmt("vtf.uvs[{}] = (texMtxs[{}] * pos).xy;"), nextTCG, nextMtx); + fmt::print(out, FMT_STRING("vtf.uvs[{}] = (texMtxs[{}] * pos).xy;"), nextTCG, nextMtx); out << '\n'; } @@ -721,11 +721,11 @@ static std::string _BuildFS(const SFluidPlaneDoorShaderInfo& info) { out << "#define TEXTURE_DECLS "; if (info.m_hasPatternTex1) - fmt::print(out, fmt("TBINDING{} uniform sampler2D patternTex1;"), nextTex++); + fmt::print(out, FMT_STRING("TBINDING{} uniform sampler2D patternTex1;"), nextTex++); if (info.m_hasPatternTex2) - fmt::print(out, fmt("TBINDING{} uniform sampler2D patternTex2;"), nextTex++); + fmt::print(out, FMT_STRING("TBINDING{} uniform sampler2D patternTex2;"), nextTex++); if (info.m_hasColorTex) - fmt::print(out, fmt("TBINDING{} uniform sampler2D colorTex;"), nextTex++); + fmt::print(out, FMT_STRING("TBINDING{} uniform sampler2D colorTex;"), nextTex++); out << '\n'; // Tex0 * kColor0 * Tex1 + Tex2 diff --git a/Shaders/shader_CFluidPlaneShaderHLSL.cpp b/Shaders/shader_CFluidPlaneShaderHLSL.cpp index 32eff6cae..ebf81e869 100644 --- a/Shaders/shader_CFluidPlaneShaderHLSL.cpp +++ b/Shaders/shader_CFluidPlaneShaderHLSL.cpp @@ -368,37 +368,37 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { out << "#define TEXTURE_DECLS "; if (info.m_hasPatternTex1) - fmt::print(out, fmt("Texture2D patternTex1 : register(t{});"), nextTex++); + fmt::print(out, FMT_STRING("Texture2D patternTex1 : register(t{});"), nextTex++); if (info.m_hasPatternTex2) - fmt::print(out, fmt("Texture2D patternTex2 : register(t{});"), nextTex++); + fmt::print(out, FMT_STRING("Texture2D patternTex2 : register(t{});"), nextTex++); if (info.m_hasColorTex) - fmt::print(out, fmt("Texture2D colorTex : register(t{});"), nextTex++); + fmt::print(out, FMT_STRING("Texture2D colorTex : register(t{});"), nextTex++); if (info.m_hasBumpMap) - fmt::print(out, fmt("Texture2D bumpMap : register(t{});"), nextTex++); + fmt::print(out, FMT_STRING("Texture2D bumpMap : register(t{});"), nextTex++); if (info.m_hasEnvMap) - fmt::print(out, fmt("Texture2D envMap : register(t{});"), nextTex++); + fmt::print(out, FMT_STRING("Texture2D envMap : register(t{});"), nextTex++); if (info.m_hasEnvBumpMap) - fmt::print(out, fmt("Texture2D envBumpMap : register(t{});"), nextTex++); + fmt::print(out, FMT_STRING("Texture2D envBumpMap : register(t{});"), nextTex++); if (info.m_hasLightmap) - fmt::print(out, fmt("Texture2D lightMap : register(t{});"), nextTex++); + fmt::print(out, FMT_STRING("Texture2D lightMap : register(t{});"), nextTex++); out << '\n'; out << "#define ADDITIONAL_TCGS "; if (info.m_hasBumpMap) { bumpMapUv = nextTCG; - fmt::print(out, fmt("vtf.uvs[{}] = mul(texMtxs[0], pos).xy;"), nextTCG++); + fmt::print(out, FMT_STRING("vtf.uvs[{}] = mul(texMtxs[0], pos).xy;"), nextTCG++); } if (info.m_hasEnvBumpMap) { envBumpMapUv = nextTCG; - fmt::print(out, fmt("vtf.uvs[{}] = mul(texMtxs[3], float4(normalIn.xyz, 1.0)).xy;"), nextTCG++); + fmt::print(out, FMT_STRING("vtf.uvs[{}] = mul(texMtxs[3], float4(normalIn.xyz, 1.0)).xy;"), nextTCG++); } if (info.m_hasEnvMap) { envMapUv = nextTCG; - fmt::print(out, fmt("vtf.uvs[{}] = mul(texMtxs[{}], pos).xy;"), nextTCG++, nextMtx++); + fmt::print(out, FMT_STRING("vtf.uvs[{}] = mul(texMtxs[{}], pos).xy;"), nextTCG++, nextMtx++); } if (info.m_hasLightmap) { lightmapUv = nextTCG; - fmt::print(out, fmt("vtf.uvs[{}] = mul(texMtxs[{}], pos).xy;"), nextTCG++, nextMtx++); + fmt::print(out, FMT_STRING("vtf.uvs[{}] = mul(texMtxs[{}], pos).xy;"), nextTCG++, nextMtx++); } out << '\n'; @@ -408,7 +408,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { case EFluidType::PhazonFluid: case EFluidType::Four: if (info.m_hasLightmap) { - fmt::print(out, fmt("float4 lightMapTexel = lightMap.Sample(samp, vtf.uvs[{}]);"), lightmapUv); + fmt::print(out, FMT_STRING("float4 lightMapTexel = lightMap.Sample(samp, vtf.uvs[{}]);"), lightmapUv); // 0: Tex4TCG, Tex4, doubleLightmapBlend ? NULL : GX_COLOR1A1 // ZERO, TEX, KONST, doubleLightmapBlend ? ZERO : RAS // Output reg 2 @@ -453,7 +453,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { if (info.m_hasColorTex && !info.m_hasEnvMap && info.m_hasEnvBumpMap) { // Make previous stage indirect, mtx0 - fmt::print(out, fmt( + fmt::print(out, FMT_STRING( "float2 indUvs = (envBumpMap.Sample(samp, vtf.uvs[{}]).ra - float2(0.5, 0.5)) * " "float2(fog.indScale, -fog.indScale);"), envBumpMapUv); @@ -467,11 +467,11 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { // Make previous stage indirect, mtx0 if (info.m_hasColorTex) out << "colorOut += colorTex.Sample(samp, vtf.uvs[2]) * lighting;"; - fmt::print(out, fmt( + fmt::print(out, FMT_STRING( "float2 indUvs = (envBumpMap.Sample(samp, vtf.uvs[{}]).ra - float2(0.5, 0.5)) * " "float2(fog.indScale, -fog.indScale);"), envBumpMapUv); - fmt::print(out, fmt("colorOut = lerp(colorOut, envMap.Sample(samp, indUvs + vtf.uvs[{}]), kColor1);"), envMapUv); + fmt::print(out, FMT_STRING("colorOut = lerp(colorOut, envMap.Sample(samp, indUvs + vtf.uvs[{}]), kColor1);"), envMapUv); } else if (info.m_hasColorTex) { out << "colorOut += colorTex.Sample(samp, vtf.uvs[2]) * lighting;"; } @@ -480,7 +480,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { case EFluidType::PoisonWater: if (info.m_hasLightmap) { - fmt::print(out, fmt("float4 lightMapTexel = lightMap.Sample(samp, vtf.uvs[{}]);"), lightmapUv); + fmt::print(out, FMT_STRING("float4 lightMapTexel = lightMap.Sample(samp, vtf.uvs[{}]);"), lightmapUv); // 0: Tex4TCG, Tex4, doubleLightmapBlend ? NULL : GX_COLOR1A1 // ZERO, TEX, KONST, doubleLightmapBlend ? ZERO : RAS // Output reg 2 @@ -526,7 +526,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { if (info.m_hasColorTex) { if (info.m_hasEnvBumpMap) { // Make previous stage indirect, mtx0 - fmt::print(out, fmt( + fmt::print(out, FMT_STRING( "float2 indUvs = (envBumpMap.Sample(samp, vtf.uvs[{}]).ra - float2(0.5, 0.5)) * " "float2(fog.indScale, -fog.indScale);"), envBumpMapUv); @@ -580,7 +580,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { "float3 lightVec = lights[3].pos.xyz - vtf.mvPos.xyz;" "float lx = dot(vtf.mvTangent.xyz, lightVec);" "float ly = dot(vtf.mvBinorm.xyz, lightVec);"; - fmt::print(out, fmt( + fmt::print(out, FMT_STRING( "float4 emboss1 = bumpMap.Sample(samp, vtf.uvs[{}]) + float4(0.5);" "float4 emboss2 = bumpMap.Sample(samp, vtf.uvs[{}] + float2(lx, ly));"), bumpMapUv, bumpMapUv); @@ -628,7 +628,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { // 3: bumpMapTCG, bumpMap, NULL // ZERO, TEX, PREV, ZERO // Output reg prev, scale 2 - fmt::print(out, fmt("float4 emboss1 = bumpMap.Sample(samp, vtf.uvs[{}]) + float4(0.5);"), bumpMapUv); + fmt::print(out, FMT_STRING("float4 emboss1 = bumpMap.Sample(samp, vtf.uvs[{}]) + float4(0.5);"), bumpMapUv); out << "colorOut *= emboss1 * float4(2.0);"; } @@ -648,13 +648,13 @@ static void _BuildAdditionalTCGs(std::stringstream& out, const SFluidPlaneShader out << "#define ADDITIONAL_TCGS "; if (info.m_hasBumpMap) - fmt::print(out, fmt("vtf.uvs[{}] = mul(texMtxs[0], pos).xy;"), nextTCG++); + fmt::print(out, FMT_STRING("vtf.uvs[{}] = mul(texMtxs[0], pos).xy;"), nextTCG++); if (info.m_hasEnvBumpMap) - fmt::print(out, fmt("vtf.uvs[{}] = mul(texMtxs[3], float4(normalIn.xyz, 1.0)).xy;"), nextTCG++); + fmt::print(out, FMT_STRING("vtf.uvs[{}] = mul(texMtxs[3], float4(normalIn.xyz, 1.0)).xy;"), nextTCG++); if (info.m_hasEnvMap) - fmt::print(out, fmt("vtf.uvs[{}] = mul(texMtxs[{}], pos).xy;"), nextTCG++, nextMtx++); + fmt::print(out, FMT_STRING("vtf.uvs[{}] = mul(texMtxs[{}], pos).xy;"), nextTCG++, nextMtx++); if (info.m_hasLightmap) - fmt::print(out, fmt("vtf.uvs[{}] = mul(texMtxs[{}], pos).xy;"), nextTCG, nextMtx); + fmt::print(out, FMT_STRING("vtf.uvs[{}] = mul(texMtxs[{}], pos).xy;"), nextTCG, nextMtx); out << '\n'; } @@ -727,11 +727,11 @@ static std::string _BuildFS(const SFluidPlaneDoorShaderInfo& info) { out << "#define TEXTURE_DECLS "; if (info.m_hasPatternTex1) - fmt::print(out, fmt("Texture2D patternTex1 : register(t{});"), nextTex++); + fmt::print(out, FMT_STRING("Texture2D patternTex1 : register(t{});"), nextTex++); if (info.m_hasPatternTex2) - fmt::print(out, fmt("Texture2D patternTex2 : register(t{});"), nextTex++); + fmt::print(out, FMT_STRING("Texture2D patternTex2 : register(t{});"), nextTex++); if (info.m_hasColorTex) - fmt::print(out, fmt("Texture2D colorTex : register(t{});"), nextTex++); + fmt::print(out, FMT_STRING("Texture2D colorTex : register(t{});"), nextTex++); out << '\n'; // Tex0 * kColor0 * Tex1 + Tex2 diff --git a/Shaders/shader_CFluidPlaneShaderMetal.cpp b/Shaders/shader_CFluidPlaneShaderMetal.cpp index cc988a511..f8bda5069 100644 --- a/Shaders/shader_CFluidPlaneShaderMetal.cpp +++ b/Shaders/shader_CFluidPlaneShaderMetal.cpp @@ -366,19 +366,19 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { out << "#define TEXTURE_PARAMS "; if (info.m_hasPatternTex1) - fmt::print(out, fmt(",texture2d patternTex1 [[ texture({}) ]]"), nextTex++); + fmt::print(out, FMT_STRING(",texture2d patternTex1 [[ texture({}) ]]"), nextTex++); if (info.m_hasPatternTex2) - fmt::print(out, fmt(",texture2d patternTex2 [[ texture({}) ]]"), nextTex++); + fmt::print(out, FMT_STRING(",texture2d patternTex2 [[ texture({}) ]]"), nextTex++); if (info.m_hasColorTex) - fmt::print(out, fmt(",texture2d colorTex [[ texture({}) ]]"), nextTex++); + fmt::print(out, FMT_STRING(",texture2d colorTex [[ texture({}) ]]"), nextTex++); if (info.m_hasBumpMap) - fmt::print(out, fmt(",texture2d bumpMap [[ texture({}) ]]"), nextTex++); + fmt::print(out, FMT_STRING(",texture2d bumpMap [[ texture({}) ]]"), nextTex++); if (info.m_hasEnvMap) - fmt::print(out, fmt(",texture2d envMap [[ texture({}) ]]"), nextTex++); + fmt::print(out, FMT_STRING(",texture2d envMap [[ texture({}) ]]"), nextTex++); if (info.m_hasEnvBumpMap) - fmt::print(out, fmt(",exture2d envBumpMap [[ texture({}) ]]"), nextTex++); + fmt::print(out, FMT_STRING(",exture2d envBumpMap [[ texture({}) ]]"), nextTex++); if (info.m_hasLightmap) - fmt::print(out, fmt(",texture2d lightMap [[ texture({}) ]]"), nextTex++); + fmt::print(out, FMT_STRING(",texture2d lightMap [[ texture({}) ]]"), nextTex++); out << '\n'; if (info.m_hasBumpMap) { @@ -400,7 +400,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { case EFluidType::PhazonFluid: case EFluidType::Four: if (info.m_hasLightmap) { - fmt::print(out, fmt("float4 lightMapTexel = lightMap.sample(samp, vtf.uv{});"), lightmapUv); + fmt::print(out, FMT_STRING("float4 lightMapTexel = lightMap.sample(samp, vtf.uv{});"), lightmapUv); // 0: Tex4TCG, Tex4, doubleLightmapBlend ? NULL : GX_COLOR1A1 // ZERO, TEX, KONST, doubleLightmapBlend ? ZERO : RAS // Output reg 2 @@ -445,7 +445,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { if (info.m_hasColorTex && !info.m_hasEnvMap && info.m_hasEnvBumpMap) { // Make previous stage indirect, mtx0 - fmt::print(out, fmt( + fmt::print(out, FMT_STRING( "float2 indUvs = (envBumpMap.sample(samp, vtf.uv{}).ra - float2(0.5, 0.5)) * " "float2(lu.fog.indScale, -lu.fog.indScale);"), envBumpMapUv); @@ -459,11 +459,11 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { // Make previous stage indirect, mtx0 if (info.m_hasColorTex) out << "colorOut += colorTex.sample(samp, vtf.uv2) * lighting;"; - fmt::print(out, fmt( + fmt::print(out, FMT_STRING( "float2 indUvs = (envBumpMap.sample(samp, vtf.uv{}).ra - float2(0.5, 0.5)) * " "float2(lu.fog.indScale, -lu.fog.indScale);"), envBumpMapUv); - fmt::print(out, fmt( + fmt::print(out, FMT_STRING( "colorOut = mix(colorOut, envMap.sample(samp, indUvs + vtf.uv{}), lu.kColor1);"), envMapUv); } else if (info.m_hasColorTex) { out << "colorOut += colorTex.sample(samp, vtf.uv2) * lighting;"; @@ -473,7 +473,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { case EFluidType::PoisonWater: if (info.m_hasLightmap) { - fmt::print(out, fmt("float4 lightMapTexel = lightMap.sample(samp, vtf.uv{});"), lightmapUv); + fmt::print(out, FMT_STRING("float4 lightMapTexel = lightMap.sample(samp, vtf.uv{});"), lightmapUv); // 0: Tex4TCG, Tex4, doubleLightmapBlend ? NULL : GX_COLOR1A1 // ZERO, TEX, KONST, doubleLightmapBlend ? ZERO : RAS // Output reg 2 @@ -519,7 +519,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { if (info.m_hasColorTex) { if (info.m_hasEnvBumpMap) { // Make previous stage indirect, mtx0 - fmt::print(out, fmt( + fmt::print(out, FMT_STRING( "float2 indUvs = (envBumpMap.sample(samp, vtf.uv{}).ra - float2(0.5, 0.5)) * " "float2(lu.fog.indScale, -lu.fog.indScale);"), envBumpMapUv); @@ -573,7 +573,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { "float3 lightVec = lu.lights[3].pos.xyz - vtf.mvPos.xyz;" "float lx = dot(vtf.mvTangent.xyz, lightVec);" "float ly = dot(vtf.mvBinorm.xyz, lightVec);"; - fmt::print(out, fmt( + fmt::print(out, FMT_STRING( "float4 emboss1 = bumpMap.sample(samp, vtf.uv{}) + float4(0.5);" "float4 emboss2 = bumpMap.sample(samp, vtf.uv{} + float2(lx, ly));"), bumpMapUv, bumpMapUv); @@ -621,7 +621,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { // 3: bumpMapTCG, bumpMap, NULL // ZERO, TEX, PREV, ZERO // Output reg prev, scale 2 - fmt::print(out, fmt("float4 emboss1 = bumpMap.sample(samp, vtf.uv{}) + float4(0.5);"), bumpMapUv); + fmt::print(out, FMT_STRING("float4 emboss1 = bumpMap.sample(samp, vtf.uv{}) + float4(0.5);"), bumpMapUv); out << "colorOut *= emboss1 * float4(2.0);"; } @@ -641,13 +641,13 @@ static void _BuildAdditionalTCGs(std::stringstream& out, const SFluidPlaneShader out << "#define ADDITIONAL_TCGS "; if (info.m_hasBumpMap) - fmt::print(out, fmt("vtf.uv{} = (fu.texMtxs[0] * pos).xy;"), nextTCG++); + fmt::print(out, FMT_STRING("vtf.uv{} = (fu.texMtxs[0] * pos).xy;"), nextTCG++); if (info.m_hasEnvBumpMap) - fmt::print(out, fmt("vtf.uv{} = (fu.texMtxs[3] * float4(normalIn.xyz, 1.0)).xy;"), nextTCG++); + fmt::print(out, FMT_STRING("vtf.uv{} = (fu.texMtxs[3] * float4(normalIn.xyz, 1.0)).xy;"), nextTCG++); if (info.m_hasEnvMap) - fmt::print(out, fmt("vtf.uv{} = (fu.texMtxs[{}] * pos).xy;"), nextTCG++, nextMtx++); + fmt::print(out, FMT_STRING("vtf.uv{} = (fu.texMtxs[{}] * pos).xy;"), nextTCG++, nextMtx++); if (info.m_hasLightmap) - fmt::print(out, fmt("vtf.uv{} = (fu.texMtxs[{}] * pos).xy;"), nextTCG++, nextMtx++); + fmt::print(out, FMT_STRING("vtf.uv{} = (fu.texMtxs[{}] * pos).xy;"), nextTCG++, nextMtx++); out << '\n'; } @@ -718,11 +718,11 @@ static std::string _BuildFS(const SFluidPlaneDoorShaderInfo& info) { out << "#define TEXTURE_PARAMS "; if (info.m_hasPatternTex1) - fmt::print(out, fmt(",texture2d patternTex1 [[ texture({}) ]]"), nextTex++); + fmt::print(out, FMT_STRING(",texture2d patternTex1 [[ texture({}) ]]"), nextTex++); if (info.m_hasPatternTex2) - fmt::print(out, fmt(",texture2d patternTex2 [[ texture({}) ]]"), nextTex++); + fmt::print(out, FMT_STRING(",texture2d patternTex2 [[ texture({}) ]]"), nextTex++); if (info.m_hasColorTex) - fmt::print(out, fmt(",texture2d colorTex [[ texture({}) ]]"), nextTex++); + fmt::print(out, FMT_STRING(",texture2d colorTex [[ texture({}) ]]"), nextTex++); out << '\n'; // Tex0 * kColor0 * Tex1 + Tex2 diff --git a/amuse b/amuse index 40efdcc38..5112228ab 160000 --- a/amuse +++ b/amuse @@ -1 +1 @@ -Subproject commit 40efdcc38cc59dbb66a8c12d96583f2133d534f7 +Subproject commit 5112228abd4d2a468f36ee4289a789fb2c2a921c diff --git a/assetnameparser/main.cpp b/assetnameparser/main.cpp index 7f4eaa0c1..839488da3 100644 --- a/assetnameparser/main.cpp +++ b/assetnameparser/main.cpp @@ -180,7 +180,7 @@ int main(int argc, const char* argv[]) logvisor::RegisterStandardExceptions(); logvisor::RegisterConsoleLogger(); if (argc < 3) { - Log.report(logvisor::Error, fmt(_SYS_STR("Usage: {} ")), argv[0]); + Log.report(logvisor::Error, FMT_STRING(_SYS_STR("Usage: {} ")), argv[0]); return 1; } @@ -193,13 +193,13 @@ int main(int argc, const char* argv[]) if (!doc.LoadFile(docF)) { const tinyxml2::XMLElement* elm = doc.RootElement(); if (strcmp(elm->Name(), "AssetNameMap")) { - Log.report(logvisor::Fatal, fmt(_SYS_STR("Invalid database supplied"))); + Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Invalid database supplied"))); return 1; } elm = elm->FirstChildElement("AssetNameMap"); if (elm == nullptr) { - Log.report(logvisor::Fatal, fmt(_SYS_STR("Malformed AssetName database"))); + Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Malformed AssetName database"))); return 1; } @@ -210,7 +210,7 @@ int main(int argc, const char* argv[]) const tinyxml2::XMLElement* valueElm = elm->FirstChildElement("Value"); if (!keyElm || !valueElm) { - Log.report(logvisor::Fatal, fmt(_SYS_STR("Malformed Asset entry, [Key,Value] required"))); + Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Malformed Asset entry, [Key,Value] required"))); return 0; } @@ -219,7 +219,7 @@ int main(int argc, const char* argv[]) const tinyxml2::XMLElement* typeElm = valueElm->FirstChildElement("Type"); if (!nameElm || !dirElm || !typeElm) { - Log.report(logvisor::Fatal, fmt(_SYS_STR("Malformed Value entry, [Name,Directory,Type] required"))); + Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Malformed Value entry, [Name,Directory,Type] required"))); return 0; } assets.emplace_back(); @@ -233,7 +233,7 @@ int main(int argc, const char* argv[]) FILE* f = Fopen(outPath.c_str(), _SYS_STR("wb")); if (!f) { - Log.report(logvisor::Fatal, fmt(_SYS_STR("Unable to open destination"))); + Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to open destination"))); return 0; } @@ -261,6 +261,6 @@ int main(int argc, const char* argv[]) if (docF) fclose(docF); - Log.report(logvisor::Fatal, fmt(_SYS_STR("failed to load"))); + Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("failed to load"))); return 1; } diff --git a/hecl b/hecl index 8f31e8bb7..f64ed44fe 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit 8f31e8bb7d5f3d0fde26e17824456d1b88fb084d +Subproject commit f64ed44fe8164b06ed5bef6344d9f743e2c5d638 diff --git a/nod b/nod index dffcac50c..2783337c3 160000 --- a/nod +++ b/nod @@ -1 +1 @@ -Subproject commit dffcac50c5fe3eb67fdee222553fc508cd241579 +Subproject commit 2783337c36bacdf832f78182340e4aa6063dece9 diff --git a/specter b/specter index a2c154db8..fc0d79ace 160000 --- a/specter +++ b/specter @@ -1 +1 @@ -Subproject commit a2c154db8fde276206ae87628d6baa40f1e399a9 +Subproject commit fc0d79ace7063f24efaeaf8153753855eb3e2b95 diff --git a/visigen/MainMac.mm b/visigen/MainMac.mm index ddd0cb276..aba699c1a 100644 --- a/visigen/MainMac.mm +++ b/visigen/MainMac.mm @@ -113,7 +113,7 @@ int main(int argc, const char** argv) { if (argc > 1 && !strcmp(argv[1], "--dlpackage")) { - fmt::print(fmt("{}\n"), URDE_DLPACKAGE); + fmt::print(FMT_STRING("{}\n"), URDE_DLPACKAGE); return 100; } diff --git a/visigen/MainWin.cpp b/visigen/MainWin.cpp index fe347a85c..34ce7cd5a 100644 --- a/visigen/MainWin.cpp +++ b/visigen/MainWin.cpp @@ -41,7 +41,7 @@ static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l int wmain(int argc, const hecl::SystemChar** argv) { if (argc > 1 && !wcscmp(argv[1], L"--dlpackage")) { - fmt::print(fmt("{}\n"), URDE_DLPACKAGE); + fmt::print(FMT_STRING("{}\n"), URDE_DLPACKAGE); return 100; } @@ -125,7 +125,7 @@ int wmain(int argc, const hecl::SystemChar** argv) { continue; case WM_USER + 1: { /* Update window title from client thread */ - std::wstring title = fmt::format(fmt(L"VISIGen [{:g}%]"), s_Percent * 100.f); + std::wstring title = fmt::format(FMT_STRING(L"VISIGen [{:g}%]"), s_Percent * 100.f); SetWindowTextW(window, title.c_str()); continue; } diff --git a/visigen/MainXlib.cpp b/visigen/MainXlib.cpp index 333d3920d..90a3a04f4 100644 --- a/visigen/MainXlib.cpp +++ b/visigen/MainXlib.cpp @@ -64,7 +64,7 @@ static Window windowId; static void UpdatePercent(float percent) { XLockDisplay(xDisp); - std::string title = fmt::format(fmt("VISIGen [{:g}%]"), double(percent * 100.f)); + std::string title = fmt::format(FMT_STRING("VISIGen [{:g}%]"), double(percent * 100.f)); XChangeProperty(xDisp, windowId, XA_WM_NAME, XA_STRING, 8, PropModeReplace, reinterpret_cast(title.c_str()), int(title.size())); XUnlockDisplay(xDisp); @@ -75,7 +75,7 @@ static void _sigint(int) {} int main(int argc, const char** argv) { if (argc > 1 && !strcmp(argv[1], "--dlpackage")) { - fmt::print(fmt("{}\n"), URDE_DLPACKAGE); + fmt::print(FMT_STRING("{}\n"), URDE_DLPACKAGE); return 100; } @@ -88,14 +88,14 @@ int main(int argc, const char** argv) { VISIRenderer renderer(argc, argv); if (!XInitThreads()) { - Log.report(logvisor::Error, fmt("X doesn't support multithreading")); + Log.report(logvisor::Error, FMT_STRING("X doesn't support multithreading")); return 1; } /* Open Xlib Display */ xDisp = XOpenDisplay(nullptr); if (!xDisp) { - Log.report(logvisor::Error, fmt("Can't open X display")); + Log.report(logvisor::Error, FMT_STRING("Can't open X display")); return 1; } @@ -108,7 +108,7 @@ int main(int argc, const char** argv) { int numFBConfigs = 0; fbConfigs = glXGetFBConfigs(xDisp, xDefaultScreen, &numFBConfigs); if (!fbConfigs || numFBConfigs == 0) { - Log.report(logvisor::Error, fmt("glXGetFBConfigs failed")); + Log.report(logvisor::Error, FMT_STRING("glXGetFBConfigs failed")); return 1; } @@ -135,7 +135,7 @@ int main(int argc, const char** argv) { XFree(fbConfigs); if (!selFBConfig) { - Log.report(logvisor::Error, fmt("unable to find suitable pixel format")); + Log.report(logvisor::Error, FMT_STRING("unable to find suitable pixel format")); return 1; } @@ -179,7 +179,7 @@ int main(int argc, const char** argv) { glXCreateContextAttribsARB = reinterpret_cast( glXGetProcAddressARB(reinterpret_cast("glXCreateContextAttribsARB"))); if (!glXCreateContextAttribsARB) { - Log.report(logvisor::Error, fmt("unable to resolve glXCreateContextAttribsARB")); + Log.report(logvisor::Error, FMT_STRING("unable to resolve glXCreateContextAttribsARB")); return 1; } } @@ -194,12 +194,12 @@ int main(int argc, const char** argv) { } XSetErrorHandler(oldHandler); if (!glxCtx) { - Log.report(logvisor::Fatal, fmt("unable to make new GLX context")); + Log.report(logvisor::Fatal, FMT_STRING("unable to make new GLX context")); return 1; } GLXWindow glxWindow = glXCreateWindow(xDisp, selFBConfig, windowId, nullptr); if (!glxWindow) { - Log.report(logvisor::Fatal, fmt("unable to make new GLX window")); + Log.report(logvisor::Fatal, FMT_STRING("unable to make new GLX window")); return 1; } @@ -251,7 +251,7 @@ int main(int argc, const char** argv) { XLockDisplay(xDisp); if (!glXMakeContextCurrent(xDisp, glxWindow, glxWindow, glxCtx)) - Log.report(logvisor::Fatal, fmt("unable to make GLX context current")); + Log.report(logvisor::Fatal, FMT_STRING("unable to make GLX context current")); XUnlockDisplay(xDisp); UpdatePercent(0); diff --git a/visigen/VISIBuilder.cpp b/visigen/VISIBuilder.cpp index 3aa472f87..b9a90effe 100644 --- a/visigen/VISIBuilder.cpp +++ b/visigen/VISIBuilder.cpp @@ -18,11 +18,11 @@ static std::unique_ptr RGBABuf(new VISIRenderer::RGBA8[25 const VISIBuilder::Leaf& VISIBuilder::PVSRenderCache::GetLeaf(const zeus::CVector3f& vec) { auto search = m_cache.find(vec); if (search != m_cache.cend()) { - // Log.report(logvisor::Info, fmt("Cache hit")); + // Log.report(logvisor::Info, FMT_STRING("Cache hit")); return *search->second; } - // Log.report(logvisor::Info, fmt("Rendering")); + // Log.report(logvisor::Info, FMT_STRING("Rendering")); bool needsTransparent = false; m_renderer.RenderPVSOpaque(RGBABuf.get(), vec, needsTransparent); std::unique_ptr leafOut = std::make_unique(); @@ -107,19 +107,19 @@ void VISIBuilder::Node::buildChildren(int level, int divisions, const zeus::CAAB if (flags & 0x4 && childNodes[0] == childNodes[4] && (!(flags & 0x1) || childNodes[1] == childNodes[5]) && (!(flags & 0x2) || childNodes[2] == childNodes[6]) && (!(flags & 0x3) || childNodes[3] == childNodes[7])) { flags &= ~0x4; - // Log.report(logvisor::Info, fmt("Unsub Z")); + // Log.report(logvisor::Info, FMT_STRING("Unsub Z")); continue; } if (flags & 0x2 && childNodes[0] == childNodes[2] && (!(flags & 0x1) || childNodes[1] == childNodes[3]) && (!(flags & 0x4) || childNodes[4] == childNodes[6]) && (!(flags & 0x5) || childNodes[5] == childNodes[7])) { flags &= ~0x2; - // Log.report(logvisor::Info, fmt("Unsub Y")); + // Log.report(logvisor::Info, FMT_STRING("Unsub Y")); continue; } if (flags & 0x1 && childNodes[0] == childNodes[1] && (!(flags & 0x2) || childNodes[2] == childNodes[3]) && (!(flags & 0x4) || childNodes[4] == childNodes[5]) && (!(flags & 0x6) || childNodes[6] == childNodes[7])) { flags &= ~0x1; - // Log.report(logvisor::Info, fmt("Unsub X")); + // Log.report(logvisor::Info, FMT_STRING("Unsub X")); continue; } break; @@ -129,7 +129,7 @@ void VISIBuilder::Node::buildChildren(int level, int divisions, const zeus::CAAB // This is now a leaf node for (int i = 0; i < 8; ++i) leaf |= childNodes[i].leaf; - // Log.report(logvisor::Info, fmt("Leaf Promote")); + // Log.report(logvisor::Info, FMT_STRING("Leaf Promote")); return; } } @@ -258,7 +258,7 @@ std::vector VISIBuilder::build(const zeus::CAABox& fullAabb, size_t mod const std::vector& entities, const std::vector& lights, size_t layer2LightCount, FPercent updatePercent, ProcessType parentPid) { - // Log.report(logvisor::Info, fmt("Started!")); + // Log.report(logvisor::Info, FMT_STRING("Started!")); size_t featureCount = modelCount + entities.size(); renderCache.m_lightMetaBit = featureCount; @@ -322,6 +322,6 @@ std::vector VISIBuilder::build(const zeus::CAABox& fullAabb, size_t mod w.seekAlign32(); - // Log.report(logvisor::Info, fmt("Finished!")); + // Log.report(logvisor::Info, FMT_STRING("Finished!")); return dataOut; } diff --git a/visigen/VISIRenderer.cpp b/visigen/VISIRenderer.cpp index 95cb38262..a95463e27 100644 --- a/visigen/VISIRenderer.cpp +++ b/visigen/VISIRenderer.cpp @@ -59,7 +59,7 @@ bool VISIRenderer::SetupShaders() { glGetShaderiv(m_vtxShader, GL_INFO_LOG_LENGTH, &logLen); char* log = (char*)malloc(logLen); glGetShaderInfoLog(m_vtxShader, logLen, nullptr, log); - Log.report(logvisor::Error, fmt("unable to compile vert source\n{}\n{}\n"), log, VS); + Log.report(logvisor::Error, FMT_STRING("unable to compile vert source\n{}\n{}\n"), log, VS); free(log); return false; } @@ -72,7 +72,7 @@ bool VISIRenderer::SetupShaders() { glGetShaderiv(m_fragShader, GL_INFO_LOG_LENGTH, &logLen); char* log = (char*)malloc(logLen); glGetShaderInfoLog(m_fragShader, logLen, nullptr, log); - Log.report(logvisor::Error, fmt("unable to compile frag source\n{}\n{}\n"), log, FS); + Log.report(logvisor::Error, FMT_STRING("unable to compile frag source\n{}\n{}\n"), log, FS); free(log); return false; } @@ -87,7 +87,7 @@ bool VISIRenderer::SetupShaders() { glGetProgramiv(m_program, GL_INFO_LOG_LENGTH, &logLen); char* log = (char*)malloc(logLen); glGetProgramInfoLog(m_program, logLen, nullptr, log); - Log.report(logvisor::Error, fmt("unable to link shader program\n{}\n"), log); + Log.report(logvisor::Error, FMT_STRING("unable to link shader program\n{}\n"), log); free(log); return false; } @@ -414,13 +414,13 @@ void VISIRenderer::Run(FPercent updatePercent) { CalculateProjMatrix(); if (glewInit() != GLEW_OK) { - Log.report(logvisor::Error, fmt("unable to init glew")); + Log.report(logvisor::Error, FMT_STRING("unable to init glew")); m_return = 1; return; } if (!GLEW_ARB_occlusion_query2) { - Log.report(logvisor::Error, fmt("GL_ARB_occlusion_query2 extension not present")); + Log.report(logvisor::Error, FMT_STRING("GL_ARB_occlusion_query2 extension not present")); m_return = 1; return; } @@ -431,7 +431,7 @@ void VISIRenderer::Run(FPercent updatePercent) { } if (m_argc < 3) { - Log.report(logvisor::Error, fmt("Missing input/output file args")); + Log.report(logvisor::Error, FMT_STRING("Missing input/output file args")); m_return = 1; return; }