mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-09-12 19:47:27 +00:00
chore: update all logging to use centralized logging component
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "Csv/CsvStream.h"
|
||||
#include "Game/T6/CommonT6.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <format>
|
||||
@@ -65,14 +66,14 @@ namespace
|
||||
|
||||
if (currentRow.size() < COL_COUNT_MIN)
|
||||
{
|
||||
std::cerr << std::format("{} Column count lower than min column count ({})\n", ErrorPrefix(assetName, currentRowIndex), COL_COUNT_MIN);
|
||||
con::error("{} Column count lower than min column count ({})", ErrorPrefix(assetName, currentRowIndex), COL_COUNT_MIN);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
int index;
|
||||
if (!ParseInt(index, currentRow[ROW_INDEX]) || index < 0)
|
||||
{
|
||||
std::cerr << std::format("{} Failed to parse index\n", ErrorPrefix(assetName, currentRowIndex));
|
||||
con::error("{} Failed to parse index", ErrorPrefix(assetName, currentRowIndex));
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
@@ -118,7 +119,7 @@ namespace
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << std::format("{} Unknown row type \"{}\"\n", ErrorPrefix(assetName, currentRowIndex), currentRow[ROW_TYPE]);
|
||||
con::error("{} Unknown row type \"{}\"", ErrorPrefix(assetName, currentRowIndex), currentRow[ROW_TYPE]);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
}
|
||||
@@ -222,26 +223,26 @@ namespace
|
||||
{
|
||||
if (row.size() < COL_COUNT_ICON)
|
||||
{
|
||||
std::cerr << std::format("{} Column count lower than min column count for entries ({})\n", ErrorPrefix(assetName, rowIndex), COL_COUNT_ICON);
|
||||
con::error("{} Column count lower than min column count for entries ({})", ErrorPrefix(assetName, rowIndex), COL_COUNT_ICON);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ParseInt(icon.fontIconSize, row[ROW_ICON_SIZE]))
|
||||
{
|
||||
std::cerr << std::format("{} Failed to parse size\n", ErrorPrefix(assetName, rowIndex));
|
||||
con::error("{} Failed to parse size", ErrorPrefix(assetName, rowIndex));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ParseFloat(icon.xScale, row[ROW_ICON_XSCALE]) || !ParseFloat(icon.yScale, row[ROW_ICON_YSCALE]))
|
||||
{
|
||||
std::cerr << std::format("{} Failed to parse scale\n", ErrorPrefix(assetName, rowIndex));
|
||||
con::error("{} Failed to parse scale", ErrorPrefix(assetName, rowIndex));
|
||||
return false;
|
||||
}
|
||||
|
||||
auto* materialDependency = context.LoadDependency<AssetMaterial>(row[ROW_ICON_MATERIAL]);
|
||||
if (materialDependency == nullptr)
|
||||
{
|
||||
std::cerr << std::format("{} Failed to load material \"{}\"\n", ErrorPrefix(assetName, rowIndex), row[ROW_ICON_MATERIAL]);
|
||||
con::error("{} Failed to load material \"{}\"", ErrorPrefix(assetName, rowIndex), row[ROW_ICON_MATERIAL]);
|
||||
return false;
|
||||
}
|
||||
registration.AddDependency(materialDependency);
|
||||
@@ -258,19 +259,19 @@ namespace
|
||||
{
|
||||
if (row.size() < COL_COUNT_ALIAS)
|
||||
{
|
||||
std::cerr << std::format("{} Column count lower than min column count for aliases ({})\n", ErrorPrefix(assetName, rowIndex), COL_COUNT_ALIAS);
|
||||
con::error("{} Column count lower than min column count for aliases ({})", ErrorPrefix(assetName, rowIndex), COL_COUNT_ALIAS);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ParseHashStr(alias.aliasHash, row[ROW_ALIAS_NAME]))
|
||||
{
|
||||
std::cerr << std::format("{} Failed to parse alias \"{}\"\n", ErrorPrefix(assetName, rowIndex), row[ROW_ALIAS_NAME]);
|
||||
con::error("{} Failed to parse alias \"{}\"", ErrorPrefix(assetName, rowIndex), row[ROW_ALIAS_NAME]);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ParseHashStr(alias.buttonHash, row[ROW_ALIAS_BUTTON]))
|
||||
{
|
||||
std::cerr << std::format("{} Failed to parse button \"{}\"\n", ErrorPrefix(assetName, rowIndex), row[ROW_ALIAS_BUTTON]);
|
||||
con::error("{} Failed to parse button \"{}\"", ErrorPrefix(assetName, rowIndex), row[ROW_ALIAS_BUTTON]);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/CommonT6.h"
|
||||
#include "Game/T6/FontIcon/JsonFontIconT6.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <format>
|
||||
@@ -45,7 +46,7 @@ namespace
|
||||
|
||||
if (type != "font-icon" || version != 1u)
|
||||
{
|
||||
std::cerr << std::format("Tried to load font icon \"{}\" but did not find expected type font-icon of version 1\n", assetName);
|
||||
con::error("Tried to load font icon \"{}\" but did not find expected type font-icon of version 1", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
@@ -55,7 +56,7 @@ namespace
|
||||
}
|
||||
catch (const json::exception& e)
|
||||
{
|
||||
std::cerr << std::format("Failed to parse json of font icon: {}\n", e.what());
|
||||
con::error("Failed to parse json of font icon: {}", e.what());
|
||||
}
|
||||
|
||||
return AssetCreationResult::Failure();
|
||||
@@ -114,7 +115,7 @@ namespace
|
||||
auto* materialDependency = context.LoadDependency<AssetMaterial>(jFontIconEntry.material);
|
||||
if (materialDependency == nullptr)
|
||||
{
|
||||
std::cerr << std::format("Failed to load material \"{}\" for font icon entry \"{}\"\n", jFontIconEntry.material, jFontIconEntry.name);
|
||||
con::error("Failed to load material \"{}\" for font icon entry \"{}\"", jFontIconEntry.material, jFontIconEntry.name);
|
||||
return false;
|
||||
}
|
||||
registration.AddDependency(materialDependency);
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Image/ImageCommon.h"
|
||||
#include "Image/IwiLoader.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -40,7 +41,7 @@ namespace
|
||||
const auto texture = iwi::LoadIwi(ss);
|
||||
if (!texture)
|
||||
{
|
||||
std::cerr << std::format("Failed to load texture from: {}\n", fileName);
|
||||
con::error("Failed to load texture from: {}", fileName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "InfoStringToStructConverter.h"
|
||||
|
||||
#include "Game/T6/CommonT6.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
@@ -83,7 +84,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (fx == nullptr)
|
||||
{
|
||||
std::cerr << std::format("Failed to load fx asset \"{}\"\n", value);
|
||||
con::error("Failed to load fx asset \"{}\"", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -105,7 +106,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (xmodel == nullptr)
|
||||
{
|
||||
std::cerr << std::format("Failed to load xmodel asset \"{}\"\n", value);
|
||||
con::error("Failed to load xmodel asset \"{}\"", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -128,7 +129,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (material == nullptr)
|
||||
{
|
||||
std::cerr << std::format("Failed to load material asset \"{}\"\n", value);
|
||||
con::error("Failed to load material asset \"{}\"", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -150,7 +151,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (physPreset == nullptr)
|
||||
{
|
||||
std::cerr << std::format("Failed to load physpreset asset \"{}\"\n", value);
|
||||
con::error("Failed to load physpreset asset \"{}\"", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -175,7 +176,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (tracer == nullptr)
|
||||
{
|
||||
std::cerr << std::format("Failed to load tracer asset \"{}\"\n", value);
|
||||
con::error("Failed to load tracer asset \"{}\"", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -190,7 +191,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
unsigned int soundAliasHash;
|
||||
if (!GetHashValue(value, soundAliasHash))
|
||||
{
|
||||
std::cerr << std::format("Failed to parse value \"{}\" as hash\n", value);
|
||||
con::error("Failed to parse value \"{}\" as hash", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/Leaderboard/JsonLeaderboardDef.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Leaderboard/LeaderboardCommon.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -37,7 +38,7 @@ namespace
|
||||
|
||||
if (type != "leaderboard" || version != 1u)
|
||||
{
|
||||
std::cerr << std::format("Tried to load leaderboard \"{}\" but did not find expected type leaderboard of version 1\n", leaderboardDef.name);
|
||||
con::error("Tried to load leaderboard \"{}\" but did not find expected type leaderboard of version 1", leaderboardDef.name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -46,7 +47,7 @@ namespace
|
||||
}
|
||||
catch (const json::exception& e)
|
||||
{
|
||||
std::cerr << std::format("Failed to parse json of leaderboard: {}\n", e.what());
|
||||
con::error("Failed to parse json of leaderboard: {}", e.what());
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -149,7 +150,7 @@ namespace
|
||||
const JsonLoader loader(*file.m_stream, m_memory);
|
||||
if (!loader.Load(*leaderboardDef))
|
||||
{
|
||||
std::cerr << std::format("Failed to load leaderboard \"{}\"\n", assetName);
|
||||
con::error("Failed to load leaderboard \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "Game/T6/Material/JsonMaterialLoaderT6.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Material/MaterialCommon.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <format>
|
||||
#include <iostream>
|
||||
@@ -32,7 +33,7 @@ namespace
|
||||
AssetRegistration<AssetMaterial> registration(assetName, material);
|
||||
if (!LoadMaterialAsJson(*file.m_stream, *material, m_memory, context, registration))
|
||||
{
|
||||
std::cerr << std::format("Failed to load material \"{}\"\n", assetName);
|
||||
con::error("Failed to load material \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include "StringTable/LoaderStringTableT6.h"
|
||||
#include "Tracer/GdtLoaderTracerT6.h"
|
||||
#include "Tracer/RawLoaderTracerT6.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "Vehicle/GdtLoaderVehicleT6.h"
|
||||
#include "Vehicle/RawLoaderVehicleT6.h"
|
||||
#include "Weapon/AttachmentGdtLoaderT6.h"
|
||||
@@ -62,14 +63,12 @@ namespace T6
|
||||
|
||||
SoundBank* ObjLoader::LoadSoundBankForZone(ISearchPath& searchPath, const std::string& soundBankFileName, Zone& zone)
|
||||
{
|
||||
if (ObjLoading::Configuration.Verbose)
|
||||
std::cout << std::format("Trying to load sound bank '{}' for zone '{}'\n", soundBankFileName, zone.m_name);
|
||||
con::debug("Trying to load sound bank '{}' for zone '{}'", soundBankFileName, zone.m_name);
|
||||
|
||||
auto* existingSoundBank = SoundBank::Repository.GetContainerByName(soundBankFileName);
|
||||
if (existingSoundBank != nullptr)
|
||||
{
|
||||
if (ObjLoading::Configuration.Verbose)
|
||||
std::cout << std::format("Referencing loaded sound bank '{}'.\n", soundBankFileName);
|
||||
con::debug("Referencing loaded sound bank '{}'.", soundBankFileName);
|
||||
|
||||
SoundBank::Repository.AddContainerReference(existingSoundBank, &zone);
|
||||
return existingSoundBank;
|
||||
@@ -83,19 +82,18 @@ namespace T6
|
||||
|
||||
if (!sndBank->Initialize())
|
||||
{
|
||||
std::cerr << std::format("Failed to load sound bank '{}'\n", soundBankFileName);
|
||||
con::error("Failed to load sound bank '{}'", soundBankFileName);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SoundBank::Repository.AddContainer(std::move(sndBank), &zone);
|
||||
|
||||
if (ObjLoading::Configuration.Verbose)
|
||||
std::cout << std::format("Found and loaded sound bank '{}'\n", soundBankFileName);
|
||||
con::debug("Found and loaded sound bank '{}'", soundBankFileName);
|
||||
|
||||
return sndBankPtr;
|
||||
}
|
||||
|
||||
std::cerr << std::format("Failed to load sound bank '{}'\n", soundBankFileName);
|
||||
con::error("Failed to load sound bank '{}'", soundBankFileName);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -113,7 +111,7 @@ namespace T6
|
||||
if (soundBank)
|
||||
{
|
||||
if (!VerifySoundBankChecksum(*soundBank, sndBankLinkedInfo))
|
||||
std::cout << std::format("Checksum of sound bank does not match link time checksum for '{}'\n", soundBankFileName);
|
||||
con::warn("Checksum of sound bank does not match link time checksum for '{}'", soundBankFileName);
|
||||
|
||||
loadedBanksForZone.emplace(soundBankFileName);
|
||||
|
||||
@@ -163,14 +161,12 @@ namespace T6
|
||||
|
||||
void ObjLoader::LoadIPakForZone(ISearchPath& searchPath, const std::string& ipakName, Zone& zone)
|
||||
{
|
||||
if (ObjLoading::Configuration.Verbose)
|
||||
std::cout << std::format("Trying to load ipak '{}' for zone '{}'\n", ipakName, zone.m_name);
|
||||
con::debug("Trying to load ipak '{}' for zone '{}'", ipakName, zone.m_name);
|
||||
|
||||
auto* existingIPak = IIPak::Repository.GetContainerByName(ipakName);
|
||||
if (existingIPak != nullptr)
|
||||
{
|
||||
if (ObjLoading::Configuration.Verbose)
|
||||
std::cout << std::format("Referencing loaded ipak '{}'.\n", ipakName);
|
||||
con::debug("Referencing loaded ipak '{}'.", ipakName);
|
||||
|
||||
IIPak::Repository.AddContainerReference(existingIPak, &zone);
|
||||
return;
|
||||
@@ -187,12 +183,11 @@ namespace T6
|
||||
{
|
||||
IIPak::Repository.AddContainer(std::move(ipak), &zone);
|
||||
|
||||
if (ObjLoading::Configuration.Verbose)
|
||||
std::cout << std::format("Found and loaded ipak '{}'.\n", ipakFilename);
|
||||
con::debug("Found and loaded ipak '{}'.", ipakFilename);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << std::format("Failed to load ipak '{}'!\n", ipakFilename);
|
||||
con::error("Failed to load ipak '{}'!", ipakFilename);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,8 +204,7 @@ namespace T6
|
||||
|
||||
void ObjLoader::LoadCommonIPaks(ISearchPath& searchPath, Zone& zone)
|
||||
{
|
||||
if (ObjLoading::Configuration.Verbose)
|
||||
std::cout << std::format("Loading common ipaks for zone \"{}\"\n", zone.m_name);
|
||||
con::debug("Loading common ipaks for zone \"{}\"", zone.m_name);
|
||||
|
||||
LoadIPakForZone(searchPath, "base", zone);
|
||||
const auto& languagePrefixes = IGame::GetGameById(GameId::T6)->GetLanguagePrefixes();
|
||||
@@ -219,23 +213,20 @@ namespace T6
|
||||
|
||||
if (IsMpZone(zone))
|
||||
{
|
||||
if (ObjLoading::Configuration.Verbose)
|
||||
std::cout << std::format("Loading multiplayer ipaks for zone \"{}\"\n", zone.m_name);
|
||||
con::debug("Loading multiplayer ipaks for zone \"{}\"", zone.m_name);
|
||||
|
||||
LoadIPakForZone(searchPath, "mp", zone);
|
||||
LoadIPakForZone(searchPath, "so", zone);
|
||||
}
|
||||
else if (IsZmZone(zone))
|
||||
{
|
||||
if (ObjLoading::Configuration.Verbose)
|
||||
std::cout << std::format("Loading zombie ipak for zone \"{}\"\n", zone.m_name);
|
||||
con::debug("Loading zombie ipak for zone \"{}\"", zone.m_name);
|
||||
|
||||
LoadIPakForZone(searchPath, "zm", zone);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ObjLoading::Configuration.Verbose)
|
||||
std::cout << std::format("Loading singleplayer ipak for zone \"{}\"\n", zone.m_name);
|
||||
con::debug("Loading singleplayer ipak for zone \"{}\"", zone.m_name);
|
||||
|
||||
LoadIPakForZone(searchPath, "sp", zone);
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/T6.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "InfoStringLoaderPhysConstraintsT6.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -31,7 +32,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromGdtProperties(*gdtEntry))
|
||||
{
|
||||
std::cerr << std::format("Failed to read phys constraints gdt entry: \"{}\"\n", assetName);
|
||||
con::error("Failed to read phys constraints gdt entry: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "Game/T6/InfoString/InfoStringToStructConverter.h"
|
||||
#include "Game/T6/PhysConstraints/PhysConstraintsFields.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
@@ -101,7 +102,7 @@ namespace phys_constraints
|
||||
std::extent_v<decltype(phys_constraints_fields)>);
|
||||
if (!converter.Convert())
|
||||
{
|
||||
std::cerr << std::format("Failed to parse phys constraints: \"{}\"\n", assetName);
|
||||
con::error("Failed to parse phys constraints: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "InfoStringLoaderPhysConstraintsT6.h"
|
||||
#include "PhysConstraints/PhysConstraintsCommon.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -33,7 +34,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromStream(ObjConstants::INFO_STRING_PREFIX_PHYS_CONSTRAINTS, *file.m_stream))
|
||||
{
|
||||
std::cerr << std::format("Could not parse as info string file: \"{}\"\n", fileName);
|
||||
con::error("Could not parse as info string file: \"{}\"", fileName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/T6.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "InfoStringLoaderPhysPresetT6.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -31,7 +32,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromGdtProperties(*gdtEntry))
|
||||
{
|
||||
std::cerr << std::format("Failed to read phys preset gdt entry: \"{}\"\n", assetName);
|
||||
con::error("Failed to read phys preset gdt entry: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "Game/T6/InfoString/InfoStringToStructConverter.h"
|
||||
#include "Game/T6/PhysPreset/PhysPresetFields.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
@@ -87,7 +88,7 @@ namespace phys_preset
|
||||
std::extent_v<decltype(phys_preset_fields)>);
|
||||
if (!converter.Convert())
|
||||
{
|
||||
std::cerr << std::format("Failed to parse phys preset: \"{}\"\n", assetName);
|
||||
con::error("Failed to parse phys preset: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "InfoStringLoaderPhysPresetT6.h"
|
||||
#include "PhysPreset/PhysPresetCommon.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -33,7 +34,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromStream(ObjConstants::INFO_STRING_PREFIX_PHYS_PRESET, *file.m_stream))
|
||||
{
|
||||
std::cerr << std::format("Could not parse as info string file: \"{}\"\n", fileName);
|
||||
con::error("Could not parse as info string file: \"{}\"", fileName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Pool/GlobalAssetPool.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <filesystem>
|
||||
@@ -73,7 +74,7 @@ namespace
|
||||
|
||||
if (ret != Z_STREAM_END)
|
||||
{
|
||||
std::cerr << std::format("Deflate failed for loading animtree file \"{}\"\n", assetName);
|
||||
con::error("Deflate failed for loading animtree file \"{}\"", assetName);
|
||||
deflateEnd(&zs);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include "Game/T6/T6.h"
|
||||
#include "ObjContainer/SoundBank/SoundBankWriter.h"
|
||||
#include "Pool/GlobalAssetPool.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "Utils/StringUtils.h"
|
||||
|
||||
#include <cmath>
|
||||
@@ -96,14 +97,14 @@ namespace
|
||||
if (!cell.AsFloat(dbsplValue))
|
||||
{
|
||||
const auto& colName = headerRow.HeaderNameForColumn(columnIndex);
|
||||
std::cerr << std::format("Invalid value for row {} col '{}' - Must be a float\n", rowIndex + 1, colName);
|
||||
con::error("Invalid value for row {} col '{}' - Must be a float", rowIndex + 1, colName);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (dbsplValue < 0.0f || dbsplValue > 100.0f)
|
||||
{
|
||||
const auto& colName = headerRow.HeaderNameForColumn(columnIndex);
|
||||
std::cerr << std::format("Invalid value for row {} col '{}' - {} [0.0, 100.0]\n", rowIndex + 1, colName, dbsplValue);
|
||||
con::error("Invalid value for row {} col '{}' - {} [0.0, 100.0]", rowIndex + 1, colName, dbsplValue);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -121,14 +122,14 @@ namespace
|
||||
if (!cell.AsFloat(centsValue))
|
||||
{
|
||||
const auto& colName = headerRow.HeaderNameForColumn(columnIndex);
|
||||
std::cerr << std::format("Invalid value for row {} col '{}' - Must be a float\n", rowIndex + 1, colName);
|
||||
con::error("Invalid value for row {} col '{}' - Must be a float", rowIndex + 1, colName);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (centsValue < -2400.0f || centsValue > 1200.0f)
|
||||
{
|
||||
const auto& colName = headerRow.HeaderNameForColumn(columnIndex);
|
||||
std::cerr << std::format("Invalid value for row {} col '{}' - {} [-2400.0, 1200.0]\n", rowIndex + 1, colName, centsValue);
|
||||
con::error("Invalid value for row {} col '{}' - {} [-2400.0, 1200.0]", rowIndex + 1, colName, centsValue);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -151,14 +152,14 @@ namespace
|
||||
if (!cell.AsUInt32(value32))
|
||||
{
|
||||
const auto& colName = headerRow.HeaderNameForColumn(columnIndex);
|
||||
std::cerr << std::format("Invalid value for row {} col '{}' - Must be a uint\n", rowIndex + 1, colName);
|
||||
con::error("Invalid value for row {} col '{}' - Must be a uint", rowIndex + 1, colName);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (value32 < min || value32 > max)
|
||||
{
|
||||
const auto& colName = headerRow.HeaderNameForColumn(columnIndex);
|
||||
std::cerr << std::format("Invalid value for row {} col '{}' - {} [{}, {}]\n", rowIndex + 1, colName, value32, min, max);
|
||||
con::error("Invalid value for row {} col '{}' - {} [{}, {}]", rowIndex + 1, colName, value32, min, max);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -181,14 +182,14 @@ namespace
|
||||
if (!cell.AsInt32(value32))
|
||||
{
|
||||
const auto& colName = headerRow.HeaderNameForColumn(columnIndex);
|
||||
std::cerr << std::format("Invalid value for row {} col '{}' - Must be a int\n", rowIndex + 1, colName);
|
||||
con::error("Invalid value for row {} col '{}' - Must be a int", rowIndex + 1, colName);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (value32 < min || value32 > max)
|
||||
{
|
||||
const auto& colName = headerRow.HeaderNameForColumn(columnIndex);
|
||||
std::cerr << std::format("Invalid value for row {} col '{}' - {} [{}, {}]\n", rowIndex + 1, colName, value32, min, max);
|
||||
con::error("Invalid value for row {} col '{}' - {} [{}, {}]", rowIndex + 1, colName, value32, min, max);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -211,14 +212,14 @@ namespace
|
||||
if (!cell.AsUInt32(value32))
|
||||
{
|
||||
const auto& colName = headerRow.HeaderNameForColumn(columnIndex);
|
||||
std::cerr << std::format("Invalid value for row {} col '{}' - Must be a uint\n", rowIndex + 1, colName);
|
||||
con::error("Invalid value for row {} col '{}' - Must be a uint", rowIndex + 1, colName);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (value32 < min || value32 > max)
|
||||
{
|
||||
const auto& colName = headerRow.HeaderNameForColumn(columnIndex);
|
||||
std::cerr << std::format("Invalid value for row {} col '{}' - {} [{}, {}]\n", rowIndex + 1, colName, value32, min, max);
|
||||
con::error("Invalid value for row {} col '{}' - {} [{}, {}]", rowIndex + 1, colName, value32, min, max);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -235,14 +236,14 @@ namespace
|
||||
if (!cell.AsFloat(valueFloat))
|
||||
{
|
||||
const auto& colName = headerRow.HeaderNameForColumn(columnIndex);
|
||||
std::cerr << std::format("Invalid value for row {} col '{}' - Must be a float\n", rowIndex + 1, colName);
|
||||
con::error("Invalid value for row {} col '{}' - Must be a float", rowIndex + 1, colName);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (valueFloat < 0.0f || valueFloat > 1.0f)
|
||||
{
|
||||
const auto& colName = headerRow.HeaderNameForColumn(columnIndex);
|
||||
std::cerr << std::format("Invalid value for row {} col '{}' - {} [0.0, 1.0]\n", rowIndex + 1, colName, valueFloat);
|
||||
con::error("Invalid value for row {} col '{}' - {} [0.0, 1.0]", rowIndex + 1, colName, valueFloat);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -290,9 +291,9 @@ namespace
|
||||
}
|
||||
|
||||
const auto& colName = headerRow.HeaderNameForColumn(columnIndex);
|
||||
std::cerr << std::format("Invalid value for row {} col '{}' - {}. Must be one of:\n", rowIndex + 1, colName, cell.m_value);
|
||||
con::error("Invalid value for row {} col '{}' - {}. Must be one of:", rowIndex + 1, colName, cell.m_value);
|
||||
for (auto i = 0u; i < enumValueCount; i++)
|
||||
std::cerr << std::format(" {}\n", enumValues[i]);
|
||||
con::error(" {}", enumValues[i]);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -341,9 +342,9 @@ namespace
|
||||
if (!foundValue)
|
||||
{
|
||||
const auto& colName = headerRow.HeaderNameForColumn(columnIndex);
|
||||
std::cerr << std::format("Invalid value for row {} col '{}' - {}. Must be one of:\n", rowIndex + 1, colName, entry);
|
||||
con::error("Invalid value for row {} col '{}' - {}. Must be one of:", rowIndex + 1, colName, entry);
|
||||
for (auto i = 0u; i < enumValueCount; i++)
|
||||
std::cerr << std::format(" {}\n", enumValues[i]);
|
||||
con::error(" {}", enumValues[i]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -648,7 +649,7 @@ namespace
|
||||
SoundAliasHeaders headers;
|
||||
if (!headerRow.Read(csv) || !headers.From(headerRow))
|
||||
{
|
||||
std::cerr << std::format("Invalid headers for aliases of sound bank {}\n", sndBank->name);
|
||||
con::error("Invalid headers for aliases of sound bank {}", sndBank->name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -740,7 +741,7 @@ namespace
|
||||
|
||||
if (freeIdx == std::numeric_limits<unsigned short>::max())
|
||||
{
|
||||
std::cerr << "Unable to allocate sound bank alias index list\n";
|
||||
con::error("Unable to allocate sound bank alias index list");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -807,7 +808,7 @@ namespace
|
||||
RadverbHeaders headers;
|
||||
if (!csvHeaders.Read(csv) || !headers.From(csvHeaders))
|
||||
{
|
||||
std::cerr << std::format("Invalid headers for radverbs of sound bank {}\n", sndBank->name);
|
||||
con::error("Invalid headers for radverbs of sound bank {}", sndBank->name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -867,7 +868,7 @@ namespace
|
||||
const auto nameRow = headerRow.GetIndexForHeader("name");
|
||||
if (!nameRow)
|
||||
{
|
||||
std::cerr << std::format("Missing name header for ducks of sound bank {}\n", sndBank->name);
|
||||
con::error("Missing name header for ducks of sound bank {}", sndBank->name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -882,7 +883,7 @@ namespace
|
||||
const auto duckFile = searchPath.Open(std::format("soundbank/ducks/{}.duk", name));
|
||||
if (!duckFile.IsOpen())
|
||||
{
|
||||
std::cerr << std::format("Unable to find .duk file for {} in ducklist for sound bank {}\n", name, sndBank->name);
|
||||
con::error("Unable to find .duk file for {} in ducklist for sound bank {}", name, sndBank->name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -944,7 +945,7 @@ namespace
|
||||
{
|
||||
if (assetName.find('.') == std::string::npos)
|
||||
{
|
||||
std::cerr << "A language must be specific in the sound bank asset name! (Ex: mpl_common.all)\n";
|
||||
con::error("A language must be specific in the sound bank asset name! (Ex: mpl_common.all)");
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
@@ -969,7 +970,7 @@ namespace
|
||||
{
|
||||
if (!LoadSoundRadverbs(m_memory, sndBank, radverbFile))
|
||||
{
|
||||
std::cerr << std::format("Sound bank reverbs file for {} is invalid\n", assetName);
|
||||
con::error("Sound bank reverbs file for {} is invalid", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
}
|
||||
@@ -979,7 +980,7 @@ namespace
|
||||
{
|
||||
if (!LoadSoundDuckList(m_search_path, m_memory, sndBank, duckListFile))
|
||||
{
|
||||
std::cerr << std::format("Sound bank ducklist file for {} is invalid\n", assetName);
|
||||
con::error("Sound bank ducklist file for {} is invalid", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
}
|
||||
@@ -1051,7 +1052,7 @@ namespace
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << std::format("Loaded sound bank for {} failed to generate. Please check your build files.\n", assetName);
|
||||
con::error("Loaded sound bank for {} failed to generate. Please check your build files.", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
}
|
||||
@@ -1065,7 +1066,7 @@ namespace
|
||||
|
||||
if (!result)
|
||||
{
|
||||
std::cerr << std::format("Streamed sound bank for {} failed to generate. Please check your build files.\n", assetName);
|
||||
con::error("Streamed sound bank for {} failed to generate. Please check your build files.", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/T6.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "InfoStringLoaderTracerT6.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -31,7 +32,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromGdtProperties(*gdtEntry))
|
||||
{
|
||||
std::cerr << std::format("Failed to read tracer gdt entry: \"{}\"\n", assetName);
|
||||
con::error("Failed to read tracer gdt entry: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Game/T6/Tracer/TracerFields.h"
|
||||
#include "Tracer/TracerCommon.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
@@ -67,7 +68,7 @@ namespace tracer
|
||||
infoString, *tracer, m_zone.m_script_strings, m_memory, context, registration, tracer_fields, std::extent_v<decltype(tracer_fields)>);
|
||||
if (!converter.Convert())
|
||||
{
|
||||
std::cerr << std::format("Failed to parse tracer: \"{}\"\n", assetName);
|
||||
con::error("Failed to parse tracer: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "InfoStringLoaderTracerT6.h"
|
||||
#include "Tracer/TracerCommon.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -33,7 +34,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromStream(ObjConstants::INFO_STRING_PREFIX_TRACER, *file.m_stream))
|
||||
{
|
||||
std::cerr << std::format("Could not parse as info string file: \"{}\"\n", fileName);
|
||||
con::error("Could not parse as info string file: \"{}\"", fileName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/T6.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "InfoStringLoaderVehicleT6.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -31,7 +32,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromGdtProperties(*gdtEntry))
|
||||
{
|
||||
std::cerr << std::format("Failed to read vehicle gdt entry: \"{}\"\n", assetName);
|
||||
con::error("Failed to read vehicle gdt entry: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "Game/T6/InfoString/InfoStringToStructConverter.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Game/T6/Vehicle/VehicleFields.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
@@ -37,7 +38,7 @@ namespace
|
||||
|
||||
if (endPtr != &value[value.size()])
|
||||
{
|
||||
std::cerr << std::format("Failed to parse value \"{}\" as mph\n", value);
|
||||
con::error("Failed to parse value \"{}\" as mph", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -51,7 +52,7 @@ namespace
|
||||
|
||||
if (endPtr != &value[value.size()])
|
||||
{
|
||||
std::cerr << std::format("Failed to parse value \"{}\" as pounds\n", value);
|
||||
con::error("Failed to parse value \"{}\" as pounds", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -79,7 +80,7 @@ namespace
|
||||
}
|
||||
|
||||
*reinterpret_cast<int*>(reinterpret_cast<uintptr_t>(m_structure) + field.iOffset) = TEAM_BAD;
|
||||
std::cerr << std::format("Failed to parse value \"{}\" as team\n", value);
|
||||
con::error("Failed to parse value \"{}\" as team", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -127,7 +128,7 @@ namespace vehicle
|
||||
infoString, *vehicleDef, m_zone.m_script_strings, m_memory, context, registration, vehicle_fields, std::extent_v<decltype(vehicle_fields)>);
|
||||
if (!converter.Convert())
|
||||
{
|
||||
std::cerr << std::format("Failed to parse vehicle: \"{}\"\n", assetName);
|
||||
con::error("Failed to parse vehicle: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/T6.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "InfoStringLoaderVehicleT6.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "Vehicle/VehicleCommon.h"
|
||||
|
||||
#include <cstring>
|
||||
@@ -33,7 +34,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromStream(ObjConstants::INFO_STRING_PREFIX_VEHICLE, *file.m_stream))
|
||||
{
|
||||
std::cerr << std::format("Could not parse as info string file: \"{}\"\n", fileName);
|
||||
con::error("Could not parse as info string file: \"{}\"", fileName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/ObjConstantsT6.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -31,7 +32,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromGdtProperties(*gdtEntry))
|
||||
{
|
||||
std::cerr << std::format("Failed to read attachment gdt entry: \"{}\"\n", assetName);
|
||||
con::error("Failed to read attachment gdt entry: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Game/T6/Weapon/AttachmentFields.h"
|
||||
#include "Game/T6/Weapon/WeaponStrings.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
@@ -113,7 +114,7 @@ namespace attachment
|
||||
infoString, *attachment, m_zone.m_script_strings, m_memory, context, registration, attachment_fields, std::extent_v<decltype(attachment_fields)>);
|
||||
if (!converter.Convert())
|
||||
{
|
||||
std::cerr << std::format("Failed to parse attachment: \"{}\"\n", assetName);
|
||||
con::error("Failed to parse attachment: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/ObjConstantsT6.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "Weapon/AttachmentCommon.h"
|
||||
|
||||
#include <cstring>
|
||||
@@ -34,7 +35,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromStream(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT, *file.m_stream))
|
||||
{
|
||||
std::cerr << std::format("Could not parse as info string file: \"{}\"\n", fileName);
|
||||
con::error("Could not parse as info string file: \"{}\"", fileName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/ObjConstantsT6.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -31,7 +32,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromGdtProperties(*gdtEntry))
|
||||
{
|
||||
std::cerr << std::format("Failed to read attachment unique gdt entry: \"{}\"\n", assetName);
|
||||
con::error("Failed to read attachment unique gdt entry: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Game/T6/Weapon/AttachmentUniqueFields.h"
|
||||
#include "Game/T6/Weapon/WeaponStrings.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
@@ -48,13 +49,13 @@ namespace
|
||||
std::vector<std::string> valueArray;
|
||||
if (!ParseAsArray(value, valueArray))
|
||||
{
|
||||
std::cerr << "Failed to parse hide tags as array\n";
|
||||
con::error("Failed to parse hide tags as array");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (valueArray.size() > std::extent_v<decltype(WeaponFullDef::hideTags)>)
|
||||
{
|
||||
std::cerr << std::format("Cannot have more than {} hide tags!\n", std::extent_v<decltype(WeaponFullDef::hideTags)>);
|
||||
con::error("Cannot have more than {} hide tags!", std::extent_v<decltype(WeaponFullDef::hideTags)>);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -93,7 +94,7 @@ namespace
|
||||
|
||||
if (camo == nullptr)
|
||||
{
|
||||
std::cerr << std::format("Failed to load camo asset \"{}\"\n", value);
|
||||
con::error("Failed to load camo asset \"{}\"", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -143,7 +144,7 @@ namespace
|
||||
std::vector<eAttachment> attachmentsFromName;
|
||||
if (!attachment_unique::ExtractAttachmentsFromAssetNameT6(assetName, attachmentsFromName))
|
||||
{
|
||||
std::cerr << std::format("Failed to determine attachments from attachment unique name \"{}\"\n", assetName);
|
||||
con::error("Failed to determine attachments from attachment unique name \"{}\"", assetName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -236,7 +237,7 @@ namespace attachment_unique
|
||||
std::extent_v<decltype(attachment_unique_fields)>);
|
||||
if (!converter.Convert())
|
||||
{
|
||||
std::cerr << std::format("Failed to parse attachment unique: \"{}\"\n", assetName);
|
||||
con::error("Failed to parse attachment unique: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/ObjConstantsT6.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "Weapon/AttachmentUniqueCommon.h"
|
||||
|
||||
#include <cstring>
|
||||
@@ -33,7 +34,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromStream(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT_UNIQUE, *file.m_stream))
|
||||
{
|
||||
std::cerr << std::format("Could not parse as info string file: \"{}\"\n", fileName);
|
||||
con::error("Could not parse as info string file: \"{}\"", fileName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "Game/T6/Json/JsonWeaponCamo.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Pool/GlobalAssetPool.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "Weapon/CamoCommon.h"
|
||||
|
||||
#include <cstring>
|
||||
@@ -40,7 +41,7 @@ namespace
|
||||
|
||||
if (type != "weaponCamo" || version != 1u)
|
||||
{
|
||||
std::cerr << std::format("Tried to load weapon camo \"{}\" but did not find expected type weaponCamo of version {}\n", weaponCamo.name, 1u);
|
||||
con::error("Tried to load weapon camo \"{}\" but did not find expected type weaponCamo of version {}", weaponCamo.name, 1u);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -49,7 +50,7 @@ namespace
|
||||
}
|
||||
catch (const json::exception& e)
|
||||
{
|
||||
std::cerr << std::format("Failed to parse json of weapon camo: {}\n", e.what());
|
||||
con::error("Failed to parse json of weapon camo: {}", e.what());
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -58,7 +59,7 @@ namespace
|
||||
private:
|
||||
static void PrintError(const WeaponCamo& weaponCamo, const std::string& message)
|
||||
{
|
||||
std::cerr << std::format("Cannot load weapon camo \"{}\": {}\n", weaponCamo.name, message);
|
||||
con::error("Cannot load weapon camo \"{}\": {}", weaponCamo.name, message);
|
||||
}
|
||||
|
||||
bool CreateWeaponCamoSetFromJson(const JsonWeaponCamoSet& jWeaponCamoSet, WeaponCamoSet& weaponCamoSet, const WeaponCamo& weaponCamo) const
|
||||
@@ -263,7 +264,7 @@ namespace
|
||||
const JsonLoader loader(*file.m_stream, m_memory, context, registration);
|
||||
if (!loader.Load(*weaponCamo))
|
||||
{
|
||||
std::cerr << std::format("Failed to load weapon camo \"{}\"\n", assetName);
|
||||
con::error("Failed to load weapon camo \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "Game/T6/ObjConstantsT6.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "WeaponInfoStringLoaderT6.h"
|
||||
|
||||
#include <cstring>
|
||||
@@ -31,7 +32,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromGdtProperties(*gdtEntry))
|
||||
{
|
||||
std::cerr << std::format("Failed to read weapon gdt entry: \"{}\"\n", assetName);
|
||||
con::error("Failed to read weapon gdt entry: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Game/T6/Weapon/WeaponFields.h"
|
||||
#include "Game/T6/Weapon/WeaponStrings.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "Weapon/AccuracyGraphLoader.h"
|
||||
|
||||
#include <cassert>
|
||||
@@ -126,13 +127,13 @@ namespace
|
||||
std::vector<std::string> valueArray;
|
||||
if (!ParseAsArray(value, valueArray))
|
||||
{
|
||||
std::cerr << "Failed to parse hide tags as array\n";
|
||||
con::error("Failed to parse hide tags as array");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (valueArray.size() > std::extent_v<decltype(WeaponFullDef::hideTags)>)
|
||||
{
|
||||
std::cerr << std::format("Cannot have more than {} hide tags!\n", std::extent_v<decltype(WeaponFullDef::hideTags)>);
|
||||
con::error("Cannot have more than {} hide tags!", std::extent_v<decltype(WeaponFullDef::hideTags)>);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -183,13 +184,13 @@ namespace
|
||||
std::vector<std::array<std::string, 2>> pairs;
|
||||
if (!ParseAsArray(value, pairs))
|
||||
{
|
||||
std::cerr << "Failed to parse notetracksoundmap as pairs\n";
|
||||
con::error("Failed to parse notetracksoundmap as pairs");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pairs.size() > std::extent_v<decltype(WeaponFullDef::notetrackSoundMapKeys)>)
|
||||
{
|
||||
std::cerr << "Cannot have more than " << std::extent_v<decltype(WeaponFullDef::notetrackSoundMapKeys)> << " notetracksoundmap entries!\n";
|
||||
con::error("Cannot have more than {} notetracksoundmap entries!", std::extent_v<decltype(WeaponFullDef::notetrackSoundMapKeys)>);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -239,7 +240,7 @@ namespace
|
||||
|
||||
if (camo == nullptr)
|
||||
{
|
||||
std::cerr << std::format("Failed to load camo asset \"{}\"\n", value);
|
||||
con::error("Failed to load camo asset \"{}\"", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -254,7 +255,7 @@ namespace
|
||||
std::vector<std::string> valueArray;
|
||||
if (!ParseAsArray(value, valueArray))
|
||||
{
|
||||
std::cerr << "Failed to parse attachments as array\n";
|
||||
con::error("Failed to parse attachments as array");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -265,7 +266,7 @@ namespace
|
||||
auto* attachmentAssetInfo = m_context.ForceLoadDependency<AssetAttachment>(attachmentName);
|
||||
if (attachmentAssetInfo == nullptr)
|
||||
{
|
||||
std::cerr << std::format("Failed to load attachment asset \"{}\"\n", attachmentName);
|
||||
con::error("Failed to load attachment asset \"{}\"", attachmentName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -273,17 +274,17 @@ namespace
|
||||
|
||||
if (static_cast<unsigned>(attachmentAsset->attachmentType) >= ATTACHMENT_TYPE_COUNT)
|
||||
{
|
||||
std::cerr << std::format(
|
||||
"Invalid attachment type {} for attachment asset \"{}\"\n", static_cast<unsigned>(attachmentAsset->attachmentType), attachmentName);
|
||||
con::error(
|
||||
"Invalid attachment type {} for attachment asset \"{}\"", static_cast<unsigned>(attachmentAsset->attachmentType), attachmentName);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (attachments[attachmentAsset->attachmentType] != nullptr)
|
||||
{
|
||||
std::cerr << std::format("Already loaded attachment with same type {}: \"{}\", \"{}\"\n",
|
||||
static_cast<unsigned>(attachmentAsset->attachmentType),
|
||||
attachments[attachmentAsset->attachmentType]->szInternalName,
|
||||
attachmentName);
|
||||
con::error("Already loaded attachment with same type {}: \"{}\", \"{}\"",
|
||||
static_cast<unsigned>(attachmentAsset->attachmentType),
|
||||
attachments[attachmentAsset->attachmentType]->szInternalName,
|
||||
attachmentName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -305,7 +306,7 @@ namespace
|
||||
std::vector<std::string> valueArray;
|
||||
if (!ParseAsArray(value, valueArray))
|
||||
{
|
||||
std::cerr << "Failed to parse attachment uniques as array\n";
|
||||
con::error("Failed to parse attachment uniques as array");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -317,7 +318,7 @@ namespace
|
||||
auto* attachmentUniqueAssetInfo = m_context.ForceLoadDependency<AssetAttachmentUnique>(attachmentUniqueName);
|
||||
if (attachmentUniqueAssetInfo == nullptr)
|
||||
{
|
||||
std::cerr << std::format("Failed to load attachment unique asset \"{}\"\n", attachmentUniqueName);
|
||||
con::error("Failed to load attachment unique asset \"{}\"", attachmentUniqueName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -327,9 +328,8 @@ namespace
|
||||
{
|
||||
if (attachmentCombinationIndex >= std::extent_v<decltype(WeaponFullDef::attachmentUniques)>)
|
||||
{
|
||||
std::cerr << std::format(
|
||||
"Cannot have more than {} combined attachment attachment unique entries!\n",
|
||||
(std::extent_v<decltype(WeaponFullDef::attachmentUniques)> - std::extent_v<decltype(WeaponFullDef::attachments)>));
|
||||
con::error("Cannot have more than {} combined attachment attachment unique entries!",
|
||||
(std::extent_v<decltype(WeaponFullDef::attachmentUniques)> - std::extent_v<decltype(WeaponFullDef::attachments)>));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -340,18 +340,18 @@ namespace
|
||||
{
|
||||
if (static_cast<unsigned>(attachmentUniqueAsset->attachmentType) >= ATTACHMENT_TYPE_COUNT)
|
||||
{
|
||||
std::cerr << std::format("Invalid attachment type {} for attachment unique asset \"{}\"\n",
|
||||
static_cast<unsigned>(attachmentUniqueAsset->attachmentType),
|
||||
attachmentUniqueName);
|
||||
con::error("Invalid attachment type {} for attachment unique asset \"{}\"",
|
||||
static_cast<unsigned>(attachmentUniqueAsset->attachmentType),
|
||||
attachmentUniqueName);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (attachmentUniques[attachmentUniqueAsset->attachmentType] != nullptr)
|
||||
{
|
||||
std::cerr << std::format("Already loaded attachment unique with same type {}: \"{}\", \"{}\"\n",
|
||||
static_cast<unsigned>(attachmentUniqueAsset->attachmentType),
|
||||
attachmentUniques[attachmentUniqueAsset->attachmentType]->szInternalName,
|
||||
attachmentUniqueName);
|
||||
con::error("Already loaded attachment unique with same type {}: \"{}\", \"{}\"",
|
||||
static_cast<unsigned>(attachmentUniqueAsset->attachmentType),
|
||||
attachmentUniques[attachmentUniqueAsset->attachmentType]->szInternalName,
|
||||
attachmentUniqueName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -621,7 +621,7 @@ namespace weapon
|
||||
infoString, *weaponFullDef, m_zone.m_script_strings, m_memory, context, registration, weapon_fields, std::extent_v<decltype(weapon_fields)>);
|
||||
if (!converter.Convert())
|
||||
{
|
||||
std::cerr << std::format("Failed to parse weapon: \"{}\"\n", assetName);
|
||||
con::error("Failed to parse weapon: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "Game/T6/ObjConstantsT6.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "Weapon/WeaponCommon.h"
|
||||
#include "WeaponInfoStringLoaderT6.h"
|
||||
|
||||
@@ -33,7 +34,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromStream(ObjConstants::INFO_STRING_PREFIX_WEAPON, *file.m_stream))
|
||||
{
|
||||
std::cerr << std::format("Could not parse as info string file: \"{}\"\n", fileName);
|
||||
con::error("Could not parse as info string file: \"{}\"", fileName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/T6.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "InfoStringLoaderZBarrierT6.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -31,7 +32,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromGdtProperties(*gdtEntry))
|
||||
{
|
||||
std::cerr << std::format("Failed to read zbarrier gdt entry: \"{}\"\n", assetName);
|
||||
con::error("Failed to read zbarrier gdt entry: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "Game/T6/InfoString/InfoStringToStructConverter.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Game/T6/ZBarrier/ZBarrierFields.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
@@ -75,7 +76,7 @@ namespace z_barrier
|
||||
infoString, *zbarrier, m_zone.m_script_strings, m_memory, context, registration, zbarrier_fields, std::extent_v<decltype(zbarrier_fields)>);
|
||||
if (!converter.Convert())
|
||||
{
|
||||
std::cerr << std::format("Failed to parse zbarrier: \"{}\"\n", assetName);
|
||||
con::error("Failed to parse zbarrier: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Game/T6/T6.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "InfoStringLoaderZBarrierT6.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "ZBarrier/ZBarrierCommon.h"
|
||||
|
||||
#include <cstring>
|
||||
@@ -33,7 +34,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromStream(ObjConstants::INFO_STRING_PREFIX_ZBARRIER, *file.m_stream))
|
||||
{
|
||||
std::cerr << std::format("Could not parse as info string file: \"{}\"\n", fileName);
|
||||
con::error("Could not parse as info string file: \"{}\"", fileName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user