mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-19 07:42:54 +00:00
refactor: use new line character instead of std::endl
This commit is contained in:
parent
1b13f1f1b4
commit
132cccb971
@ -39,7 +39,7 @@ bool ZoneCreator::CreateIgnoredAssetMap(const ZoneCreationContext& context, std:
|
||||
const auto foundAssetTypeEntry = m_asset_types_by_name.find(ignoreEntry.m_type);
|
||||
if (foundAssetTypeEntry == m_asset_types_by_name.end())
|
||||
{
|
||||
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"" << std::endl;
|
||||
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ std::unique_ptr<Zone> ZoneCreator::CreateZoneForDefinition(ZoneCreationContext&
|
||||
const auto foundAssetTypeEntry = m_asset_types_by_name.find(assetEntry.m_asset_type);
|
||||
if (foundAssetTypeEntry == m_asset_types_by_name.end())
|
||||
{
|
||||
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"" << std::endl;
|
||||
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"\n";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ bool ZoneCreator::CreateIgnoredAssetMap(const ZoneCreationContext& context, std:
|
||||
const auto foundAssetTypeEntry = m_asset_types_by_name.find(ignoreEntry.m_type);
|
||||
if (foundAssetTypeEntry == m_asset_types_by_name.end())
|
||||
{
|
||||
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"" << std::endl;
|
||||
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ std::unique_ptr<Zone> ZoneCreator::CreateZoneForDefinition(ZoneCreationContext&
|
||||
const auto foundAssetTypeEntry = m_asset_types_by_name.find(assetEntry.m_asset_type);
|
||||
if (foundAssetTypeEntry == m_asset_types_by_name.end())
|
||||
{
|
||||
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"" << std::endl;
|
||||
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"\n";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ bool ZoneCreator::CreateIgnoredAssetMap(const ZoneCreationContext& context, std:
|
||||
const auto foundAssetTypeEntry = m_asset_types_by_name.find(ignoreEntry.m_type);
|
||||
if (foundAssetTypeEntry == m_asset_types_by_name.end())
|
||||
{
|
||||
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"" << std::endl;
|
||||
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ std::unique_ptr<Zone> ZoneCreator::CreateZoneForDefinition(ZoneCreationContext&
|
||||
const auto foundAssetTypeEntry = m_asset_types_by_name.find(assetEntry.m_asset_type);
|
||||
if (foundAssetTypeEntry == m_asset_types_by_name.end())
|
||||
{
|
||||
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"" << std::endl;
|
||||
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"\n";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ bool ZoneCreator::CreateIgnoredAssetMap(const ZoneCreationContext& context, std:
|
||||
const auto foundAssetTypeEntry = m_asset_types_by_name.find(ignoreEntry.m_type);
|
||||
if (foundAssetTypeEntry == m_asset_types_by_name.end())
|
||||
{
|
||||
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"" << std::endl;
|
||||
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ std::unique_ptr<Zone> ZoneCreator::CreateZoneForDefinition(ZoneCreationContext&
|
||||
const auto foundAssetTypeEntry = m_asset_types_by_name.find(assetEntry.m_asset_type);
|
||||
if (foundAssetTypeEntry == m_asset_types_by_name.end())
|
||||
{
|
||||
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"" << std::endl;
|
||||
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"\n";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ bool ZoneCreator::CreateIgnoredAssetMap(const ZoneCreationContext& context, std:
|
||||
const auto foundAssetTypeEntry = m_asset_types_by_name.find(ignoreEntry.m_type);
|
||||
if (foundAssetTypeEntry == m_asset_types_by_name.end())
|
||||
{
|
||||
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"" << std::endl;
|
||||
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ void ZoneCreator::HandleMetadata(Zone* zone, const ZoneCreationContext& context)
|
||||
|
||||
if (endPtr != &strValue[strValue.size()])
|
||||
{
|
||||
std::cout << "Could not parse metadata key \"" << metaData->m_key << "\" as hash" << std::endl;
|
||||
std::cout << "Could not parse metadata key \"" << metaData->m_key << "\" as hash\n";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -135,7 +135,7 @@ std::unique_ptr<Zone> ZoneCreator::CreateZoneForDefinition(ZoneCreationContext&
|
||||
const auto foundAssetTypeEntry = m_asset_types_by_name.find(assetEntry.m_asset_type);
|
||||
if (foundAssetTypeEntry == m_asset_types_by_name.end())
|
||||
{
|
||||
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"" << std::endl;
|
||||
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"\n";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ class LinkerImpl final : public Linker
|
||||
const auto definitionStream = sourceSearchPath->Open(definitionFileName);
|
||||
if (!definitionStream.IsOpen())
|
||||
{
|
||||
std::cout << "Could not find zone definition file for project \"" << source << "\"." << std::endl;
|
||||
std::cout << "Could not find zone definition file for project \"" << source << "\".\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ class LinkerImpl final : public Linker
|
||||
|
||||
if (!includeDefinition)
|
||||
{
|
||||
std::cout << "Failed to read zone definition file for project \"" << source << "\"." << std::endl;
|
||||
std::cout << "Failed to read zone definition file for project \"" << source << "\".\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -183,7 +183,7 @@ class LinkerImpl final : public Linker
|
||||
{
|
||||
if (name != i->second->m_value)
|
||||
{
|
||||
std::cout << "Conflicting names in target \"" << targetName << "\": " << name << " != " << i->second << std::endl;
|
||||
std::cout << "Conflicting names in target \"" << targetName << "\": " << name << " != " << i->second << "\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -203,7 +203,7 @@ class LinkerImpl final : public Linker
|
||||
const auto definitionStream = sourceSearchPath->Open(definitionFileName);
|
||||
if (!definitionStream.IsOpen())
|
||||
{
|
||||
std::cout << "Could not find zone definition file for target \"" << targetName << "\"." << std::endl;
|
||||
std::cout << "Could not find zone definition file for target \"" << targetName << "\".\n";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -213,7 +213,7 @@ class LinkerImpl final : public Linker
|
||||
|
||||
if (!zoneDefinition)
|
||||
{
|
||||
std::cout << "Failed to read zone definition file for target \"" << targetName << "\"." << std::endl;
|
||||
std::cout << "Failed to read zone definition file for target \"" << targetName << "\".\n";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -248,7 +248,7 @@ class LinkerImpl final : public Linker
|
||||
std::vector<AssetListEntry> assetList;
|
||||
if (!ReadAssetList(ignore, context.m_ignored_assets, sourceSearchPath))
|
||||
{
|
||||
std::cout << "Failed to read asset listing for ignoring assets of project \"" << ignore << "\"." << std::endl;
|
||||
std::cout << "Failed to read asset listing for ignoring assets of project \"" << ignore << "\".\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -292,7 +292,7 @@ class LinkerImpl final : public Linker
|
||||
if (projectType != parsedProjectType)
|
||||
{
|
||||
std::cerr << "Conflicting types in target \"" << targetName << "\": " << PROJECT_TYPE_NAMES[static_cast<unsigned>(projectType)]
|
||||
<< " != " << PROJECT_TYPE_NAMES[static_cast<unsigned>(parsedProjectType)] << std::endl;
|
||||
<< " != " << PROJECT_TYPE_NAMES[static_cast<unsigned>(parsedProjectType)] << "\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -324,7 +324,7 @@ class LinkerImpl final : public Linker
|
||||
{
|
||||
if (gameName != i->second->m_value)
|
||||
{
|
||||
std::cout << "Conflicting game names in target \"" << targetName << "\": " << gameName << " != " << i->second << std::endl;
|
||||
std::cout << "Conflicting game names in target \"" << targetName << "\": " << gameName << " != " << i->second << "\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -332,7 +332,7 @@ class LinkerImpl final : public Linker
|
||||
|
||||
if (firstGameEntry)
|
||||
{
|
||||
std::cout << "No game name was specified for target \"" << targetName << "\"" << std::endl;
|
||||
std::cout << "No game name was specified for target \"" << targetName << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -347,7 +347,7 @@ class LinkerImpl final : public Linker
|
||||
const auto gdtFile = gdtSearchPath->Open(i->second->m_value + ".gdt");
|
||||
if (!gdtFile.IsOpen())
|
||||
{
|
||||
std::cout << "Failed to open file for gdt \"" << i->second->m_value << "\"" << std::endl;
|
||||
std::cout << "Failed to open file for gdt \"" << i->second->m_value << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -355,7 +355,7 @@ class LinkerImpl final : public Linker
|
||||
auto gdt = std::make_unique<Gdt>();
|
||||
if (!gdtReader.Read(*gdt))
|
||||
{
|
||||
std::cout << "Failed to read gdt file \"" << i->second << "\"" << std::endl;
|
||||
std::cout << "Failed to read gdt file \"" << i->second << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -402,7 +402,7 @@ class LinkerImpl final : public Linker
|
||||
|
||||
if (!ZoneWriting::WriteZone(stream, zone))
|
||||
{
|
||||
std::cout << "Writing zone failed." << std::endl;
|
||||
std::cout << "Writing zone failed.\n";
|
||||
stream.close();
|
||||
return false;
|
||||
}
|
||||
@ -454,7 +454,7 @@ class LinkerImpl final : public Linker
|
||||
|
||||
if (!ipakWriter->Write())
|
||||
{
|
||||
std::cout << "Writing ipak failed." << std::endl;
|
||||
std::cout << "Writing ipak failed.\n";
|
||||
stream.close();
|
||||
return false;
|
||||
}
|
||||
|
@ -45,12 +45,12 @@ SearchPaths LinkerSearchPaths::GetAssetSearchPathsForProject(const std::string&
|
||||
if (!fs::is_directory(absolutePath))
|
||||
{
|
||||
if (m_args.m_verbose)
|
||||
std::cout << "Adding asset search path (Not found): " << absolutePath.string() << std::endl;
|
||||
std::cout << "Adding asset search path (Not found): " << absolutePath.string() << "\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_args.m_verbose)
|
||||
std::cout << "Adding asset search path: " << absolutePath.string() << std::endl;
|
||||
std::cout << "Adding asset search path: " << absolutePath.string() << "\n";
|
||||
|
||||
auto searchPath = std::make_unique<SearchPathFilesystem>(searchPathStr);
|
||||
LoadSearchPath(searchPath.get());
|
||||
@ -79,12 +79,12 @@ SearchPaths LinkerSearchPaths::GetGdtSearchPathsForProject(const std::string& ga
|
||||
if (!fs::is_directory(absolutePath))
|
||||
{
|
||||
if (m_args.m_verbose)
|
||||
std::cout << "Adding gdt search path (Not found): " << absolutePath.string() << std::endl;
|
||||
std::cout << "Adding gdt search path (Not found): " << absolutePath.string() << "\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_args.m_verbose)
|
||||
std::cout << "Adding gdt search path: " << absolutePath.string() << std::endl;
|
||||
std::cout << "Adding gdt search path: " << absolutePath.string() << "\n";
|
||||
|
||||
searchPathsForProject.CommitSearchPath(std::make_unique<SearchPathFilesystem>(searchPathStr));
|
||||
}
|
||||
@ -105,12 +105,12 @@ SearchPaths LinkerSearchPaths::GetSourceSearchPathsForProject(const std::string&
|
||||
if (!fs::is_directory(absolutePath))
|
||||
{
|
||||
if (m_args.m_verbose)
|
||||
std::cout << "Adding source search path (Not found): " << absolutePath.string() << std::endl;
|
||||
std::cout << "Adding source search path (Not found): " << absolutePath.string() << "\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_args.m_verbose)
|
||||
std::cout << "Adding source search path: " << absolutePath.string() << std::endl;
|
||||
std::cout << "Adding source search path: " << absolutePath.string() << "\n";
|
||||
|
||||
searchPathsForProject.CommitSearchPath(std::make_unique<SearchPathFilesystem>(searchPathStr));
|
||||
}
|
||||
@ -129,12 +129,12 @@ bool LinkerSearchPaths::BuildProjectIndependentSearchPaths()
|
||||
if (!fs::is_directory(absolutePath))
|
||||
{
|
||||
if (m_args.m_verbose)
|
||||
std::cout << "Adding asset search path (Not found): " << absolutePath.string() << std::endl;
|
||||
std::cout << "Adding asset search path (Not found): " << absolutePath.string() << "\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_args.m_verbose)
|
||||
std::cout << "Adding asset search path: " << absolutePath.string() << std::endl;
|
||||
std::cout << "Adding asset search path: " << absolutePath.string() << "\n";
|
||||
|
||||
auto searchPath = std::make_unique<SearchPathFilesystem>(absolutePath.string());
|
||||
LoadSearchPath(searchPath.get());
|
||||
@ -148,12 +148,12 @@ bool LinkerSearchPaths::BuildProjectIndependentSearchPaths()
|
||||
if (!fs::is_directory(absolutePath))
|
||||
{
|
||||
if (m_args.m_verbose)
|
||||
std::cout << "Loading gdt search path (Not found): " << absolutePath.string() << std::endl;
|
||||
std::cout << "Loading gdt search path (Not found): " << absolutePath.string() << "\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_args.m_verbose)
|
||||
std::cout << "Adding gdt search path: " << absolutePath.string() << std::endl;
|
||||
std::cout << "Adding gdt search path: " << absolutePath.string() << "\n";
|
||||
|
||||
m_gdt_search_paths.CommitSearchPath(std::make_unique<SearchPathFilesystem>(absolutePath.string()));
|
||||
}
|
||||
@ -165,12 +165,12 @@ bool LinkerSearchPaths::BuildProjectIndependentSearchPaths()
|
||||
if (!fs::is_directory(absolutePath))
|
||||
{
|
||||
if (m_args.m_verbose)
|
||||
std::cout << "Loading source search path (Not found): " << absolutePath.string() << std::endl;
|
||||
std::cout << "Loading source search path (Not found): " << absolutePath.string() << "\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_args.m_verbose)
|
||||
std::cout << "Adding source search path: " << absolutePath.string() << std::endl;
|
||||
std::cout << "Adding source search path: " << absolutePath.string() << "\n";
|
||||
|
||||
m_source_search_paths.CommitSearchPath(std::make_unique<SearchPathFilesystem>(absolutePath.string()));
|
||||
}
|
||||
|
@ -11,9 +11,9 @@ std::string ParsedCsvRow::GetValue(const std::string& header, const bool require
|
||||
if (this->headers.find(header) == this->headers.end())
|
||||
{
|
||||
if (required)
|
||||
std::cerr << "ERROR: Required column \"" << header << "\" was not found" << std::endl;
|
||||
std::cerr << "ERROR: Required column \"" << header << "\" was not found\n";
|
||||
else
|
||||
std::cerr << "WARNING: Expected column \"" << header << "\" was not found" << std::endl;
|
||||
std::cerr << "WARNING: Expected column \"" << header << "\" was not found\n";
|
||||
|
||||
return {};
|
||||
}
|
||||
@ -21,7 +21,7 @@ std::string ParsedCsvRow::GetValue(const std::string& header, const bool require
|
||||
auto& value = this->values.at(this->headers[header]);
|
||||
if (required && value.empty())
|
||||
{
|
||||
std::cerr << "ERROR: Required column \"" << header << "\" does not have a value" << std::endl;
|
||||
std::cerr << "ERROR: Required column \"" << header << "\" does not have a value\n";
|
||||
return {};
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ bool AssetLoaderGfxImage::LoadFromRaw(
|
||||
|
||||
if (texture == nullptr)
|
||||
{
|
||||
std::cout << "Failed to load dds file for image asset \"" << assetName << "\"" << std::endl;
|
||||
std::cout << "Failed to load dds file for image asset \"" << assetName << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ bool AssetLoaderPhysPreset::LoadFromInfoString(
|
||||
infoString, presetInfo.get(), zone->m_script_strings, memory, manager, phys_preset_fields, std::extent_v<decltype(phys_preset_fields)>);
|
||||
if (!converter.Convert())
|
||||
{
|
||||
std::cout << "Failed to parse phys preset: \"" << assetName << "\"" << std::endl;
|
||||
std::cout << "Failed to parse phys preset: \"" << assetName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ bool AssetLoaderPhysPreset::LoadFromGdt(
|
||||
InfoString infoString;
|
||||
if (!infoString.FromGdtProperties(*gdtEntry))
|
||||
{
|
||||
std::cout << "Failed to read phys preset gdt entry: \"" << assetName << "\"" << std::endl;
|
||||
std::cout << "Failed to read phys preset gdt entry: \"" << assetName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ bool AssetLoaderPhysPreset::LoadFromRaw(
|
||||
InfoString infoString;
|
||||
if (!infoString.FromStream(ObjConstants::INFO_STRING_PREFIX_PHYS_PRESET, *file.m_stream))
|
||||
{
|
||||
std::cout << "Failed to read phys preset raw file: \"" << fileName << "\"" << std::endl;
|
||||
std::cout << "Failed to read phys preset raw file: \"" << fileName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (fx == nullptr)
|
||||
{
|
||||
std::cout << "Failed to load fx asset \"" << value << "\"" << std::endl;
|
||||
std::cout << "Failed to load fx asset \"" << value << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (xmodel == nullptr)
|
||||
{
|
||||
std::cout << "Failed to load xmodel asset \"" << value << "\"" << std::endl;
|
||||
std::cout << "Failed to load xmodel asset \"" << value << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (material == nullptr)
|
||||
{
|
||||
std::cout << "Failed to load material asset \"" << value << "\"" << std::endl;
|
||||
std::cout << "Failed to load material asset \"" << value << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -128,7 +128,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (tracer == nullptr)
|
||||
{
|
||||
std::cout << "Failed to load tracer asset \"" << value << "\"" << std::endl;
|
||||
std::cout << "Failed to load tracer asset \"" << value << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (endPtr != &value[value.size()])
|
||||
{
|
||||
std::cout << "Failed to parse value \"" << value << "\" as mph" << std::endl;
|
||||
std::cout << "Failed to parse value \"" << value << "\" as mph\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (collmap == nullptr)
|
||||
{
|
||||
std::cout << "Failed to load collmap asset \"" << value << "\"" << std::endl;
|
||||
std::cout << "Failed to load collmap asset \"" << value << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (sound == nullptr)
|
||||
{
|
||||
std::cout << "Failed to load sound asset \"" << value << "\"" << std::endl;
|
||||
std::cout << "Failed to load sound asset \"" << value << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ bool AssetLoaderRawFile::LoadFromRaw(
|
||||
|
||||
if (ret != Z_STREAM_END)
|
||||
{
|
||||
std::cout << "Deflate failed for loading rawfile \"" << assetName << "\"" << std::endl;
|
||||
std::cout << "Deflate failed for loading rawfile \"" << assetName << "\"\n";
|
||||
deflateEnd(&zs);
|
||||
return false;
|
||||
}
|
||||
|
@ -55,13 +55,13 @@ bool AssetLoaderScriptFile::LoadFromRaw(
|
||||
|
||||
if (scriptFile->compressedLen <= 0 || scriptFile->bytecodeLen <= 0)
|
||||
{
|
||||
std::cerr << "Error: Invalid length of the buffers in " << assetName << " specified" << std::endl;
|
||||
std::cerr << "Error: Invalid length of the buffers in " << assetName << " specified\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (offset + (scriptFile->compressedLen + scriptFile->bytecodeLen) > file.m_length)
|
||||
{
|
||||
std::cerr << "Error: Specified length in " << assetName << " GSC BIN structure exceeds the actual file size" << std::endl;
|
||||
std::cerr << "Error: Specified length in " << assetName << " GSC BIN structure exceeds the actual file size\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ bool AssetLoaderRawFile::LoadGsc(
|
||||
|
||||
if (ret != Z_STREAM_END)
|
||||
{
|
||||
std::cout << "Deflate failed for loading gsc file \"" << assetName << "\"" << std::endl;
|
||||
std::cout << "Deflate failed for loading gsc file \"" << assetName << "\"\n";
|
||||
deflateEnd(&zs);
|
||||
return false;
|
||||
}
|
||||
|
@ -102,26 +102,26 @@ bool AssetLoaderFontIcon::ReadIconRow(const std::vector<std::string>& row,
|
||||
{
|
||||
if (row.size() < COL_COUNT_ICON)
|
||||
{
|
||||
std::cout << ErrorPrefix(assetName, rowIndex) << "Column count lower than min column count for entries (" << COL_COUNT_ICON << ")" << std::endl;
|
||||
std::cout << ErrorPrefix(assetName, rowIndex) << "Column count lower than min column count for entries (" << COL_COUNT_ICON << ")\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ParseInt(icon.fontIconSize, row[ROW_ICON_SIZE]))
|
||||
{
|
||||
std::cout << ErrorPrefix(assetName, rowIndex) << "Failed to parse size" << std::endl;
|
||||
std::cout << ErrorPrefix(assetName, rowIndex) << "Failed to parse size\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ParseFloat(icon.xScale, row[ROW_ICON_XSCALE]) || !ParseFloat(icon.yScale, row[ROW_ICON_YSCALE]))
|
||||
{
|
||||
std::cout << ErrorPrefix(assetName, rowIndex) << "Failed to parse scale" << std::endl;
|
||||
std::cout << ErrorPrefix(assetName, rowIndex) << "Failed to parse scale\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
auto* materialDependency = manager->LoadDependency(ASSET_TYPE_MATERIAL, row[ROW_ICON_MATERIAL]);
|
||||
if (materialDependency == nullptr)
|
||||
{
|
||||
std::cout << ErrorPrefix(assetName, rowIndex) << "Failed to load material \"" << row[ROW_ICON_MATERIAL] << "\"" << std::endl;
|
||||
std::cout << ErrorPrefix(assetName, rowIndex) << "Failed to load material \"" << row[ROW_ICON_MATERIAL] << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -141,19 +141,19 @@ bool AssetLoaderFontIcon::ReadAliasRow(const std::vector<std::string>& row,
|
||||
{
|
||||
if (row.size() < COL_COUNT_ALIAS)
|
||||
{
|
||||
std::cout << ErrorPrefix(assetName, rowIndex) << "Column count lower than min column count for aliases (" << COL_COUNT_ALIAS << ")" << std::endl;
|
||||
std::cout << ErrorPrefix(assetName, rowIndex) << "Column count lower than min column count for aliases (" << COL_COUNT_ALIAS << ")\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ParseHashStr(alias.aliasHash, row[ROW_ALIAS_NAME]))
|
||||
{
|
||||
std::cout << ErrorPrefix(assetName, rowIndex) << "Failed to parse alias \"" << row[ROW_ALIAS_NAME] << "\"" << std::endl;
|
||||
std::cout << ErrorPrefix(assetName, rowIndex) << "Failed to parse alias \"" << row[ROW_ALIAS_NAME] << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ParseHashStr(alias.buttonHash, row[ROW_ALIAS_BUTTON]))
|
||||
{
|
||||
std::cout << ErrorPrefix(assetName, rowIndex) << "Failed to parse button \"" << row[ROW_ALIAS_BUTTON] << "\"" << std::endl;
|
||||
std::cout << ErrorPrefix(assetName, rowIndex) << "Failed to parse button \"" << row[ROW_ALIAS_BUTTON] << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -187,14 +187,14 @@ bool AssetLoaderFontIcon::LoadFromRaw(
|
||||
|
||||
if (currentRow.size() < COL_COUNT_MIN)
|
||||
{
|
||||
std::cout << ErrorPrefix(assetName, currentRowIndex) << "Column count lower than min column count (" << COL_COUNT_MIN << ")" << std::endl;
|
||||
std::cout << ErrorPrefix(assetName, currentRowIndex) << "Column count lower than min column count (" << COL_COUNT_MIN << ")\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
int index;
|
||||
if (!ParseInt(index, currentRow[ROW_INDEX]) || index < 0)
|
||||
{
|
||||
std::cout << ErrorPrefix(assetName, currentRowIndex) << "Failed to parse index" << std::endl;
|
||||
std::cout << ErrorPrefix(assetName, currentRowIndex) << "Failed to parse index\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ bool AssetLoaderFontIcon::LoadFromRaw(
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << ErrorPrefix(assetName, currentRowIndex) << "Unknown row type \"" << currentRow[ROW_TYPE] << "\"" << std::endl;
|
||||
std::cout << ErrorPrefix(assetName, currentRowIndex) << "Unknown row type \"" << currentRow[ROW_TYPE] << "\"\n";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ bool AssetLoaderPhysConstraints::LoadFromInfoString(
|
||||
infoString, physConstraints, zone->m_script_strings, memory, manager, phys_constraints_fields, std::extent_v<decltype(phys_constraints_fields)>);
|
||||
if (!converter.Convert())
|
||||
{
|
||||
std::cout << "Failed to parse phys constraints: \"" << assetName << "\"" << std::endl;
|
||||
std::cout << "Failed to parse phys constraints: \"" << assetName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ bool AssetLoaderPhysConstraints::LoadFromGdt(
|
||||
InfoString infoString;
|
||||
if (!infoString.FromGdtProperties(*gdtEntry))
|
||||
{
|
||||
std::cout << "Failed to read phys constraints gdt entry: \"" << assetName << "\"" << std::endl;
|
||||
std::cout << "Failed to read phys constraints gdt entry: \"" << assetName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ bool AssetLoaderPhysConstraints::LoadFromRaw(
|
||||
InfoString infoString;
|
||||
if (!infoString.FromStream(ObjConstants::INFO_STRING_PREFIX_PHYS_CONSTRAINTS, *file.m_stream))
|
||||
{
|
||||
std::cout << "Failed to read phys constraints raw file: \"" << fileName << "\"" << std::endl;
|
||||
std::cout << "Failed to read phys constraints raw file: \"" << fileName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ bool AssetLoaderPhysPreset::LoadFromInfoString(
|
||||
infoString, presetInfo.get(), zone->m_script_strings, memory, manager, phys_preset_fields, std::extent_v<decltype(phys_preset_fields)>);
|
||||
if (!converter.Convert())
|
||||
{
|
||||
std::cout << "Failed to parse phys preset: \"" << assetName << "\"" << std::endl;
|
||||
std::cout << "Failed to parse phys preset: \"" << assetName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ bool AssetLoaderPhysPreset::LoadFromGdt(
|
||||
InfoString infoString;
|
||||
if (!infoString.FromGdtProperties(*gdtEntry))
|
||||
{
|
||||
std::cout << "Failed to read phys preset gdt entry: \"" << assetName << "\"" << std::endl;
|
||||
std::cout << "Failed to read phys preset gdt entry: \"" << assetName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ bool AssetLoaderPhysPreset::LoadFromRaw(
|
||||
InfoString infoString;
|
||||
if (!infoString.FromStream(ObjConstants::INFO_STRING_PREFIX_PHYS_PRESET, *file.m_stream))
|
||||
{
|
||||
std::cout << "Failed to read phys preset raw file: \"" << fileName << "\"" << std::endl;
|
||||
std::cout << "Failed to read phys preset raw file: \"" << fileName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ bool AssetLoaderRawFile::LoadAnimtree(
|
||||
|
||||
if (ret != Z_STREAM_END)
|
||||
{
|
||||
std::cerr << "Deflate failed for loading animtree file \"" << assetName << "\"" << std::endl;
|
||||
std::cerr << "Deflate failed for loading animtree file \"" << assetName << "\"\n";
|
||||
deflateEnd(&zs);
|
||||
return false;
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ bool LoadSoundAliasIndexList(MemoryManager* memory, SndBank* sndBank)
|
||||
|
||||
if (freeIdx == std::numeric_limits<unsigned short>::max())
|
||||
{
|
||||
std::cerr << "Unable to allocate sound bank alias index list" << std::endl;
|
||||
std::cerr << "Unable to allocate sound bank alias index list\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -397,7 +397,7 @@ bool LoadSoundDuckList(ISearchPath* searchPath, MemoryManager* memory, SndBank*
|
||||
const auto duckFile = searchPath->Open("soundbank/ducks/" + name + ".duk");
|
||||
if (!duckFile.IsOpen())
|
||||
{
|
||||
std::cerr << "Unable to find .duk file for " << name << " in ducklist for sound bank " << sndBank->name << std::endl;
|
||||
std::cerr << "Unable to find .duk file for " << name << " in ducklist for sound bank " << sndBank->name << "\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -443,7 +443,7 @@ bool AssetLoaderSoundBank::LoadFromRaw(
|
||||
{
|
||||
if (assetName.find('.') == std::string::npos)
|
||||
{
|
||||
std::cerr << "A language must be specific in the soundbank asset name! (Ex: mpl_common.all)" << std::endl;
|
||||
std::cerr << "A language must be specific in the soundbank asset name! (Ex: mpl_common.all)\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -470,7 +470,7 @@ bool AssetLoaderSoundBank::LoadFromRaw(
|
||||
{
|
||||
if (!LoadSoundRadverbs(memory, sndBank, radverbFile))
|
||||
{
|
||||
std::cerr << "Sound Bank reverbs file for " << assetName << " is invalid" << std::endl;
|
||||
std::cerr << "Sound Bank reverbs file for " << assetName << " is invalid\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -481,7 +481,7 @@ bool AssetLoaderSoundBank::LoadFromRaw(
|
||||
{
|
||||
if (!LoadSoundDuckList(searchPath, memory, sndBank, duckListFile))
|
||||
{
|
||||
std::cerr << "Sound Bank ducklist file for " << assetName << " is invalid" << std::endl;
|
||||
std::cerr << "Sound Bank ducklist file for " << assetName << " is invalid\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -555,7 +555,7 @@ bool AssetLoaderSoundBank::LoadFromRaw(
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "Loaded Sound Bank for " << assetName << " failed to generate. Please check your build files." << std::endl;
|
||||
std::cerr << "Loaded Sound Bank for " << assetName << " failed to generate. Please check your build files.\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -569,7 +569,7 @@ bool AssetLoaderSoundBank::LoadFromRaw(
|
||||
|
||||
if (!result)
|
||||
{
|
||||
std::cerr << "Streamed Sound Bank for " << assetName << " failed to generate. Please check your build files." << std::endl;
|
||||
std::cerr << "Streamed Sound Bank for " << assetName << " failed to generate. Please check your build files.\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ bool AssetLoaderTracer::LoadFromInfoString(
|
||||
InfoStringToTracerConverter converter(infoString, tracer, zone->m_script_strings, memory, manager, tracer_fields, std::extent_v<decltype(tracer_fields)>);
|
||||
if (!converter.Convert())
|
||||
{
|
||||
std::cout << "Failed to parse tracer: \"" << assetName << "\"" << std::endl;
|
||||
std::cout << "Failed to parse tracer: \"" << assetName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ bool AssetLoaderTracer::LoadFromGdt(
|
||||
InfoString infoString;
|
||||
if (!infoString.FromGdtProperties(*gdtEntry))
|
||||
{
|
||||
std::cout << "Failed to read tracer gdt entry: \"" << assetName << "\"" << std::endl;
|
||||
std::cout << "Failed to read tracer gdt entry: \"" << assetName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ bool AssetLoaderTracer::LoadFromRaw(
|
||||
InfoString infoString;
|
||||
if (!infoString.FromStream(ObjConstants::INFO_STRING_PREFIX_TRACER, *file.m_stream))
|
||||
{
|
||||
std::cout << "Failed to read tracer raw file: \"" << fileName << "\"" << std::endl;
|
||||
std::cout << "Failed to read tracer raw file: \"" << fileName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ namespace T6
|
||||
|
||||
if (endPtr != &value[value.size()])
|
||||
{
|
||||
std::cout << "Failed to parse value \"" << value << "\" as mph" << std::endl;
|
||||
std::cout << "Failed to parse value \"" << value << "\" as mph\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ namespace T6
|
||||
|
||||
if (endPtr != &value[value.size()])
|
||||
{
|
||||
std::cout << "Failed to parse value \"" << value << "\" as pounds" << std::endl;
|
||||
std::cout << "Failed to parse value \"" << value << "\" as pounds\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ namespace T6
|
||||
}
|
||||
|
||||
*reinterpret_cast<int*>(reinterpret_cast<uintptr_t>(m_structure) + field.iOffset) = TEAM_BAD;
|
||||
std::cout << "Failed to parse value \"" << value << "\" as team" << std::endl;
|
||||
std::cout << "Failed to parse value \"" << value << "\" as team\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ bool AssetLoaderVehicle::LoadFromInfoString(
|
||||
infoString, vehicleDef, zone->m_script_strings, memory, manager, vehicle_fields, std::extent_v<decltype(vehicle_fields)>);
|
||||
if (!converter.Convert())
|
||||
{
|
||||
std::cout << "Failed to parse vehicle: \"" << assetName << "\"" << std::endl;
|
||||
std::cout << "Failed to parse vehicle: \"" << assetName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@ bool AssetLoaderVehicle::LoadFromGdt(
|
||||
InfoString infoString;
|
||||
if (!infoString.FromGdtProperties(*gdtEntry))
|
||||
{
|
||||
std::cout << "Failed to read vehicle gdt entry: \"" << assetName << "\"" << std::endl;
|
||||
std::cout << "Failed to read vehicle gdt entry: \"" << assetName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ bool AssetLoaderVehicle::LoadFromRaw(
|
||||
InfoString infoString;
|
||||
if (!infoString.FromStream(ObjConstants::INFO_STRING_PREFIX_VEHICLE, *file.m_stream))
|
||||
{
|
||||
std::cout << "Failed to read vehicle raw file: \"" << fileName << "\"" << std::endl;
|
||||
std::cout << "Failed to read vehicle raw file: \"" << fileName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ bool AssetLoaderZBarrier::LoadFromInfoString(
|
||||
infoString, zbarrier, zone->m_script_strings, memory, manager, zbarrier_fields, std::extent_v<decltype(zbarrier_fields)>);
|
||||
if (!converter.Convert())
|
||||
{
|
||||
std::cout << "Failed to parse zbarrier: \"" << assetName << "\"" << std::endl;
|
||||
std::cout << "Failed to parse zbarrier: \"" << assetName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ bool AssetLoaderZBarrier::LoadFromGdt(
|
||||
InfoString infoString;
|
||||
if (!infoString.FromGdtProperties(*gdtEntry))
|
||||
{
|
||||
std::cout << "Failed to read zbarrier gdt entry: \"" << assetName << "\"" << std::endl;
|
||||
std::cout << "Failed to read zbarrier gdt entry: \"" << assetName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ bool AssetLoaderZBarrier::LoadFromRaw(
|
||||
InfoString infoString;
|
||||
if (!infoString.FromStream(ObjConstants::INFO_STRING_PREFIX_ZBARRIER, *file.m_stream))
|
||||
{
|
||||
std::cout << "Failed to read zbarrier raw file: \"" << fileName << "\"" << std::endl;
|
||||
std::cout << "Failed to read zbarrier raw file: \"" << fileName << "\"\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (fx == nullptr)
|
||||
{
|
||||
std::cout << "Failed to load fx asset \"" << value << "\"" << std::endl;
|
||||
std::cout << "Failed to load fx asset \"" << value << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (xmodel == nullptr)
|
||||
{
|
||||
std::cout << "Failed to load xmodel asset \"" << value << "\"" << std::endl;
|
||||
std::cout << "Failed to load xmodel asset \"" << value << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -125,7 +125,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (material == nullptr)
|
||||
{
|
||||
std::cout << "Failed to load material asset \"" << value << "\"" << std::endl;
|
||||
std::cout << "Failed to load material asset \"" << value << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (physPreset == nullptr)
|
||||
{
|
||||
std::cout << "Failed to load physpreset asset \"" << value << "\"" << std::endl;
|
||||
std::cout << "Failed to load physpreset asset \"" << value << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (tracer == nullptr)
|
||||
{
|
||||
std::cout << "Failed to load tracer asset \"" << value << "\"" << std::endl;
|
||||
std::cout << "Failed to load tracer asset \"" << value << "\"\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
unsigned int soundAliasHash;
|
||||
if (!GetHashValue(value, soundAliasHash))
|
||||
{
|
||||
std::cout << "Failed to parse value \"" << value << "\" as hash" << std::endl;
|
||||
std::cout << "Failed to parse value \"" << value << "\" as hash\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -118,13 +118,13 @@ namespace T6
|
||||
SoundBank* ObjLoader::LoadSoundBankForZone(ISearchPath* searchPath, const std::string& soundBankFileName, Zone* zone)
|
||||
{
|
||||
if (ObjLoading::Configuration.Verbose)
|
||||
std::cout << "Trying to load sound bank '" << soundBankFileName << "' for zone '" << zone->m_name << "'" << std::endl;
|
||||
std::cout << "Trying to load sound bank '" << soundBankFileName << "' for zone '" << zone->m_name << "'\n";
|
||||
|
||||
auto* existingSoundBank = SoundBank::Repository.GetContainerByName(soundBankFileName);
|
||||
if (existingSoundBank != nullptr)
|
||||
{
|
||||
if (ObjLoading::Configuration.Verbose)
|
||||
std::cout << "Referencing loaded sound bank '" << soundBankFileName << "'." << std::endl;
|
||||
std::cout << "Referencing loaded sound bank '" << soundBankFileName << "'.\n";
|
||||
|
||||
SoundBank::Repository.AddContainerReference(existingSoundBank, zone);
|
||||
return existingSoundBank;
|
||||
@ -138,19 +138,19 @@ namespace T6
|
||||
|
||||
if (!sndBank->Initialize())
|
||||
{
|
||||
std::cout << "Failed to load sound bank '" << soundBankFileName << "'" << std::endl;
|
||||
std::cout << "Failed to load sound bank '" << soundBankFileName << "'\n";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SoundBank::Repository.AddContainer(std::move(sndBank), zone);
|
||||
|
||||
if (ObjLoading::Configuration.Verbose)
|
||||
std::cout << "Found and loaded sound bank '" << soundBankFileName << "'" << std::endl;
|
||||
std::cout << "Found and loaded sound bank '" << soundBankFileName << "'\n";
|
||||
|
||||
return sndBankPtr;
|
||||
}
|
||||
|
||||
std::cout << "Failed to load sound bank '" << soundBankFileName << "'" << std::endl;
|
||||
std::cout << "Failed to load sound bank '" << soundBankFileName << "'\n";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ namespace T6
|
||||
{
|
||||
if (!VerifySoundBankChecksum(soundBank, *sndBankLinkedInfo))
|
||||
{
|
||||
std::cout << "Checksum of sound bank does not match link time checksum for '" << soundBankFileName << "'" << std::endl;
|
||||
std::cout << "Checksum of sound bank does not match link time checksum for '" << soundBankFileName << "'\n";
|
||||
}
|
||||
loadedBanksForZone.emplace(soundBankFileName);
|
||||
|
||||
|
@ -26,13 +26,13 @@ class DdsLoaderInternal
|
||||
m_stream.read(reinterpret_cast<char*>(&magic), sizeof(magic));
|
||||
if (m_stream.gcount() != sizeof(magic))
|
||||
{
|
||||
std::cout << "Failed to read dds data" << std::endl;
|
||||
std::cout << "Failed to read dds data\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (magic != DDS_MAGIC)
|
||||
{
|
||||
std::cout << "Invalid magic for dds" << std::endl;
|
||||
std::cout << "Invalid magic for dds\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ class DdsLoaderInternal
|
||||
m_stream.read(reinterpret_cast<char*>(&headerDx10), sizeof(headerDx10));
|
||||
if (m_stream.gcount() != sizeof(headerDx10))
|
||||
{
|
||||
std::cout << "Failed to read dds data" << std::endl;
|
||||
std::cout << "Failed to read dds data\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ class DdsLoaderInternal
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Unsupported dds resourceDimension " << headerDx10.resourceDimension << std::endl;
|
||||
std::cout << "Unsupported dds resourceDimension " << headerDx10.resourceDimension << "\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ class DdsLoaderInternal
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "Unsupported dds dxgi format " << headerDx10.dxgiFormat << std::endl;
|
||||
std::cout << "Unsupported dds dxgi format " << headerDx10.dxgiFormat << "\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ class DdsLoaderInternal
|
||||
return ReadDxt10Header();
|
||||
|
||||
default:
|
||||
std::cout << "Unknown dds FourCC " << pf.dwFourCC << std::endl;
|
||||
std::cout << "Unknown dds FourCC " << pf.dwFourCC << "\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -155,7 +155,7 @@ class DdsLoaderInternal
|
||||
}
|
||||
|
||||
std::cout << "Failed to find dds pixel format: R=" << std::hex << pf.dwRBitMask << " G=" << std::hex << pf.dwGBitMask << " B=" << std::hex
|
||||
<< pf.dwBBitMask << " A=" << std::hex << pf.dwABitMask << std::endl;
|
||||
<< pf.dwBBitMask << " A=" << std::hex << pf.dwABitMask << "\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -174,7 +174,7 @@ class DdsLoaderInternal
|
||||
m_stream.read(reinterpret_cast<char*>(&header), sizeof(header));
|
||||
if (m_stream.gcount() != sizeof(header))
|
||||
{
|
||||
std::cout << "Failed to read dds data" << std::endl;
|
||||
std::cout << "Failed to read dds data\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -230,7 +230,7 @@ class DdsLoaderInternal
|
||||
|
||||
if (m_stream.gcount() != mipSize)
|
||||
{
|
||||
std::cout << "Failed to read texture data from dds" << std::endl;
|
||||
std::cout << "Failed to read texture data from dds\n";
|
||||
delete result;
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ bool InfoStringToStructConverterBase::ParseAsPairs(const std::string& value, std
|
||||
|
||||
if (c == '\n' && !isKey)
|
||||
{
|
||||
std::cout << "Expected value but got new line" << std::endl;
|
||||
std::cout << "Expected value but got new line\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ bool InfoStringToStructConverterBase::ParseAsPairs(const std::string& value, std
|
||||
{
|
||||
if (separator == '\n' || separator == EOF)
|
||||
{
|
||||
std::cout << "Expected value but got new line" << std::endl;
|
||||
std::cout << "Expected value but got new line\n";
|
||||
return false;
|
||||
}
|
||||
key = std::string(value, startPos, ci - startPos);
|
||||
@ -122,7 +122,7 @@ bool InfoStringToStructConverterBase::ConvertInt(const std::string& value, const
|
||||
|
||||
if (endPtr != &value[value.size()])
|
||||
{
|
||||
std::cout << "Failed to parse value \"" << value << "\" as int" << std::endl;
|
||||
std::cout << "Failed to parse value \"" << value << "\" as int\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ bool InfoStringToStructConverterBase::ConvertUint(const std::string& value, cons
|
||||
|
||||
if (endPtr != &value[value.size()])
|
||||
{
|
||||
std::cout << "Failed to parse value \"" << value << "\" as uint" << std::endl;
|
||||
std::cout << "Failed to parse value \"" << value << "\" as uint\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -151,7 +151,7 @@ bool InfoStringToStructConverterBase::ConvertBool(const std::string& value, cons
|
||||
*reinterpret_cast<bool*>(reinterpret_cast<uintptr_t>(m_structure) + offset) = intValue != 0;
|
||||
if (endPtr != &value[value.size()])
|
||||
{
|
||||
std::cout << "Failed to parse value \"" << value << "\" as bool" << std::endl;
|
||||
std::cout << "Failed to parse value \"" << value << "\" as bool\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ bool InfoStringToStructConverterBase::ConvertQBoolean(const std::string& value,
|
||||
*reinterpret_cast<int*>(reinterpret_cast<uintptr_t>(m_structure) + offset) = intValue != 0 ? 1 : 0;
|
||||
if (endPtr != &value[value.size()])
|
||||
{
|
||||
std::cout << "Failed to parse value \"" << value << "\" as qboolean" << std::endl;
|
||||
std::cout << "Failed to parse value \"" << value << "\" as qboolean\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -180,7 +180,7 @@ bool InfoStringToStructConverterBase::ConvertFloat(const std::string& value, con
|
||||
|
||||
if (endPtr != &value[value.size()])
|
||||
{
|
||||
std::cout << "Failed to parse value \"" << value << "\" as float" << std::endl;
|
||||
std::cout << "Failed to parse value \"" << value << "\" as float\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ bool InfoStringToStructConverterBase::ConvertMilliseconds(const std::string& val
|
||||
|
||||
if (endPtr != &value[value.size()])
|
||||
{
|
||||
std::cout << "Failed to parse value \"" << value << "\" as milliseconds" << std::endl;
|
||||
std::cout << "Failed to parse value \"" << value << "\" as milliseconds\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -46,6 +46,6 @@ bool LocalizeFileReader::ReadLocalizeFile(std::vector<CommonLocalizeEntry>& entr
|
||||
return true;
|
||||
}
|
||||
|
||||
std::cerr << "Parsing localization file failed!" << std::endl;
|
||||
std::cerr << "Parsing localization file failed!\n";
|
||||
return false;
|
||||
}
|
||||
|
@ -136,44 +136,43 @@ bool SoundBank::ReadHeader()
|
||||
|
||||
if (m_header.magic != MAGIC)
|
||||
{
|
||||
std::cout << "Invalid sndbank magic 0x" << std::hex << m_header.magic << std::endl;
|
||||
std::cout << "Invalid sndbank magic 0x" << std::hex << m_header.magic << "\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_header.version != VERSION)
|
||||
{
|
||||
std::cout << "Unsupported sndbank version " << m_header.version << " (should be " << VERSION << ")" << std::endl;
|
||||
std::cout << "Unsupported sndbank version " << m_header.version << " (should be " << VERSION << ")\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_header.entrySize != sizeof(SoundAssetBankEntry))
|
||||
{
|
||||
std::cout << "Invalid sndbank entry size 0x" << std::hex << m_header.entrySize << " (should be 0x" << std::hex << sizeof(SoundAssetBankEntry) << ")"
|
||||
<< std::endl;
|
||||
std::cout << "Invalid sndbank entry size 0x" << std::hex << m_header.entrySize << " (should be 0x" << std::hex << sizeof(SoundAssetBankEntry) << ")\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_header.fileSize != m_file_size)
|
||||
{
|
||||
std::cout << "Invalid sndbank " << m_file_size << " (header expects " << m_header.fileSize << ")" << std::endl;
|
||||
std::cout << "Invalid sndbank " << m_file_size << " (header expects " << m_header.fileSize << ")\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_header.entryCount && (m_header.entryOffset <= 0 || m_header.entryOffset + sizeof(SoundAssetBankEntry) * m_header.entryCount > m_file_size))
|
||||
{
|
||||
std::cout << "Invalid sndbank entry offset " << m_header.entryOffset << " (filesize is " << m_file_size << ")" << std::endl;
|
||||
std::cout << "Invalid sndbank entry offset " << m_header.entryOffset << " (filesize is " << m_file_size << ")\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_header.checksumOffset <= 0 || m_header.checksumOffset + sizeof(SoundAssetBankChecksum) * m_header.entryCount > m_file_size)
|
||||
{
|
||||
std::cout << "Invalid sndbank checksum offset " << m_header.checksumOffset << " (filesize is " << m_file_size << ")" << std::endl;
|
||||
std::cout << "Invalid sndbank checksum offset " << m_header.checksumOffset << " (filesize is " << m_file_size << ")\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_header.dependencyCount * m_header.dependencySize > sizeof(SoundAssetBankHeader::dependencies))
|
||||
{
|
||||
std::cout << "Invalid sndbank dependency sizes (count is " << m_header.dependencyCount << "; size is " << m_header.dependencySize << ")" << std::endl;
|
||||
std::cout << "Invalid sndbank dependency sizes (count is " << m_header.dependencyCount << "; size is " << m_header.dependencySize << ")\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -202,13 +201,13 @@ bool SoundBank::ReadEntries()
|
||||
|
||||
if (m_stream->gcount() != sizeof(entry))
|
||||
{
|
||||
std::cout << "Failed to read sound bank entry at index " << i << std::endl;
|
||||
std::cout << "Failed to read sound bank entry at index " << i << "\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (entry.offset == 0 || entry.offset + entry.size >= m_file_size)
|
||||
{
|
||||
std::cout << "Invalid sound bank entry data offset " << entry.offset << " (filesize is " << m_header.fileSize << ")" << std::endl;
|
||||
std::cout << "Invalid sound bank entry data offset " << entry.offset << " (filesize is " << m_header.fileSize << ")\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -230,7 +229,7 @@ bool SoundBank::ReadChecksums()
|
||||
|
||||
if (m_stream->gcount() != sizeof(checksum))
|
||||
{
|
||||
std::cout << "Failed to read sound bank checksum at index " << i << std::endl;
|
||||
std::cout << "Failed to read sound bank checksum at index " << i << "\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -188,13 +188,13 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "Unable to decode .flac file for sound " << soundFilePath << std::endl;
|
||||
std::cerr << "Unable to decode .flac file for sound " << soundFilePath << "\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "Unable to find a compatible file for sound " << soundFilePath << std::endl;
|
||||
std::cerr << "Unable to find a compatible file for sound " << soundFilePath << "\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -203,7 +203,7 @@ public:
|
||||
if (!sound.m_streamed && lastEntry->frameRateIndex != 6)
|
||||
{
|
||||
std::cout << "WARNING: Loaded sound \"" << soundFilePath
|
||||
<< "\" should have a framerate of 48000 but doesn't. This sound may not work on all games!" << std::endl;
|
||||
<< "\" should have a framerate of 48000 but doesn't. This sound may not work on all games!\n";
|
||||
}
|
||||
|
||||
// calculate checksum
|
||||
@ -255,7 +255,7 @@ public:
|
||||
{
|
||||
if (!WriteEntries())
|
||||
{
|
||||
std::cerr << "An error occurred writing the sound bank entries. Please check output." << std::endl;
|
||||
std::cerr << "An error occurred writing the sound bank entries. Please check output.\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -269,7 +269,7 @@ public:
|
||||
|
||||
if (m_current_offset > UINT32_MAX)
|
||||
{
|
||||
std::cerr << "Sound bank files must be under 4GB. Please reduce the number of sounds being written!" << std::endl;
|
||||
std::cerr << "Sound bank files must be under 4GB. Please reduce the number of sounds being written!\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -139,11 +139,11 @@ std::unique_ptr<ParsingResult> MenuFileReader::ReadMenuFile()
|
||||
|
||||
if (!parser->Parse())
|
||||
{
|
||||
std::cerr << "Parsing menu file failed!" << std::endl;
|
||||
std::cerr << "Parsing menu file failed!\n";
|
||||
|
||||
const auto* parserEndState = parser->GetState();
|
||||
if (parserEndState->m_current_event_handler_set && !parserEndState->m_permissive_mode)
|
||||
std::cerr << "You can use the --menu-permissive option to try to compile the event handler script anyway." << std::endl;
|
||||
std::cerr << "You can use the --menu-permissive option to try to compile the event handler script anyway.\n";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,6 @@ std::vector<std::unique_ptr<CommonStructuredDataDef>> StructuredDataDefReader::R
|
||||
if (success)
|
||||
return parser->GetDefs();
|
||||
|
||||
std::cout << "Parsing structured data def file \"" << m_file_name << "\" failed!" << std::endl;
|
||||
std::cout << "Parsing structured data def file \"" << m_file_name << "\" failed!\n";
|
||||
return {};
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ void AssetDumperRawFile::DumpAsset(AssetDumpingContext& context, XAssetInfo<RawF
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cerr << "Inflate failed when attempting to dump rawfile " << rawFile->name << std::endl;
|
||||
std::cerr << "Inflate failed when attempting to dump rawfile " << rawFile->name << "\n";
|
||||
inflateEnd(&zs);
|
||||
return;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ void AssetDumperRawFile::DumpGsc(AssetDumpingContext& context, XAssetInfo<RawFil
|
||||
|
||||
if (rawFile->len <= 8)
|
||||
{
|
||||
std::cout << "Invalid len of gsc file \"" << rawFile->name << "\"" << std::endl;
|
||||
std::cout << "Invalid len of gsc file \"" << rawFile->name << "\"\n";
|
||||
return;
|
||||
}
|
||||
|
||||
@ -25,13 +25,13 @@ void AssetDumperRawFile::DumpGsc(AssetDumpingContext& context, XAssetInfo<RawFil
|
||||
|
||||
if (inLen > static_cast<unsigned>(rawFile->len - 8) + 1)
|
||||
{
|
||||
std::cout << "Invalid compression of gsc file \"" << rawFile->name << "\": " << inLen << std::endl;
|
||||
std::cout << "Invalid compression of gsc file \"" << rawFile->name << "\": " << inLen << "\n";
|
||||
return;
|
||||
}
|
||||
|
||||
if (outLen > GSC_MAX_SIZE)
|
||||
{
|
||||
std::cout << "Invalid size of gsc file \"" << rawFile->name << "\": " << outLen << std::endl;
|
||||
std::cout << "Invalid size of gsc file \"" << rawFile->name << "\": " << outLen << "\n";
|
||||
return;
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ void AssetDumperRawFile::DumpGsc(AssetDumpingContext& context, XAssetInfo<RawFil
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Inflate failed for dumping gsc file \"" << rawFile->name << "\"" << std::endl;
|
||||
std::cout << "Inflate failed for dumping gsc file \"" << rawFile->name << "\"\n";
|
||||
inflateEnd(&zs);
|
||||
return;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ void AssetDumperRawFile::DumpAnimtree(AssetDumpingContext& context, XAssetInfo<R
|
||||
|
||||
if (rawFile->len <= 4)
|
||||
{
|
||||
std::cerr << "Invalid len of animtree file \"" << rawFile->name << "\"" << std::endl;
|
||||
std::cerr << "Invalid len of animtree file \"" << rawFile->name << "\"\n";
|
||||
return;
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ void AssetDumperRawFile::DumpAnimtree(AssetDumpingContext& context, XAssetInfo<R
|
||||
|
||||
if (outLen > ANIMTREE_MAX_SIZE)
|
||||
{
|
||||
std::cerr << "Invalid size of animtree file \"" << rawFile->name << "\": " << outLen << std::endl;
|
||||
std::cerr << "Invalid size of animtree file \"" << rawFile->name << "\": " << outLen << "\n";
|
||||
return;
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ void AssetDumperRawFile::DumpAnimtree(AssetDumpingContext& context, XAssetInfo<R
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cerr << "Inflate failed for dumping animtree file \"" << rawFile->name << "\"" << std::endl;
|
||||
std::cerr << "Inflate failed for dumping animtree file \"" << rawFile->name << "\"\n";
|
||||
inflateEnd(&zs);
|
||||
return;
|
||||
}
|
||||
|
@ -638,7 +638,7 @@ class AssetDumperSndBank::Internal
|
||||
}
|
||||
|
||||
duckObj["values"] = values;
|
||||
*duckFile << duckObj.dump(4) << std::endl;
|
||||
*duckFile << duckObj.dump(4) << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ class AssetDumperSndDriverGlobals::Internal
|
||||
auto outputFile = this->m_context.OpenAssetFile(filename);
|
||||
if (outputFile == nullptr)
|
||||
{
|
||||
std::cout << "Failed to open sound driver globals output file for: \"" << filename << "\"" << std::endl;
|
||||
std::cout << "Failed to open sound driver globals output file for: \"" << filename << "\"\n";
|
||||
}
|
||||
|
||||
return outputFile;
|
||||
|
@ -64,12 +64,11 @@ public:
|
||||
if (!line.IsEof())
|
||||
{
|
||||
std::cerr << "Error: " << pos.m_filename.get() << " L" << pos.m_line << ':' << pos.m_column << " Could not parse expression:\n"
|
||||
<< line.m_line.substr(pos.m_column - 1) << std::endl;
|
||||
<< line.m_line.substr(pos.m_column - 1) << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "Error: " << pos.m_filename.get() << " L" << pos.m_line << ':' << pos.m_column << " Could not parse expression."
|
||||
<< std::endl;
|
||||
std::cerr << "Error: " << pos.m_filename.get() << " L" << pos.m_line << ':' << pos.m_column << " Could not parse expression.\n";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -82,11 +81,11 @@ public:
|
||||
|
||||
if (!line.IsEof() && line.m_line.size() > static_cast<unsigned>(pos.m_column - 1))
|
||||
{
|
||||
std::cerr << "Error: " << e.FullMessage() << "\n" << line.m_line.substr(pos.m_column - 1) << std::endl;
|
||||
std::cerr << "Error: " << e.FullMessage() << "\n" << line.m_line.substr(pos.m_column - 1) << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "Error: " << e.FullMessage() << std::endl;
|
||||
std::cerr << "Error: " << e.FullMessage() << "\n";
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -412,7 +412,7 @@ bool Templater::TemplateToDirectory(const std::string& outputDirectory) const
|
||||
}
|
||||
catch (ParsingException& e)
|
||||
{
|
||||
std::cerr << "Error: " << e.FullMessage() << std::endl;
|
||||
std::cerr << "Error: " << e.FullMessage() << "\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -41,11 +41,11 @@ void UsageInformation::Print()
|
||||
std::stringstream str;
|
||||
std::map<std::string, std::vector<const CommandLineOption*>> categories;
|
||||
|
||||
str << "Usage:" << std::endl;
|
||||
str << "Usage:\n";
|
||||
|
||||
PrintUsageOverview(str);
|
||||
|
||||
str << "The following options are available:" << std::endl;
|
||||
str << "The following options are available:\n";
|
||||
|
||||
str.fill(' ');
|
||||
|
||||
@ -78,13 +78,13 @@ void UsageInformation::Print()
|
||||
for (auto& category : categories)
|
||||
{
|
||||
if (!firstCategory)
|
||||
str << std::endl;
|
||||
str << "\n";
|
||||
else
|
||||
firstCategory = false;
|
||||
|
||||
if (!category.first.empty())
|
||||
{
|
||||
str << "== " << category.first << " ==" << std::endl;
|
||||
str << "== " << category.first << " ==\n";
|
||||
}
|
||||
|
||||
for (auto option : category.second)
|
||||
@ -101,11 +101,11 @@ void UsageInformation::Print()
|
||||
str << " ";
|
||||
str << std::setw(longestArgumentLength) << GetOptionArgument(option);
|
||||
|
||||
str << " " << option->m_description << std::endl;
|
||||
str << " " << option->m_description << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << str.str() << std::endl;
|
||||
std::cout << str.str() << "\n";
|
||||
}
|
||||
|
||||
void UsageInformation::PrintUsageOverview(std::stringstream& str)
|
||||
@ -126,7 +126,7 @@ void UsageInformation::PrintUsageOverview(std::stringstream& str)
|
||||
{
|
||||
str << "...";
|
||||
}
|
||||
str << std::endl << std::endl;
|
||||
str << "\n\n";
|
||||
}
|
||||
|
||||
std::string UsageInformation::GetOptionArgument(const CommandLineOption* option)
|
||||
|
@ -41,7 +41,7 @@ bool CodeGenerator::GenerateCodeForTemplate(RenderingContext* context, ICodeTemp
|
||||
|
||||
if (!stream.is_open())
|
||||
{
|
||||
std::cout << "Failed to open file '" << p.string() << "'" << std::endl;
|
||||
std::cout << "Failed to open file '" << p.string() << "'\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ bool CodeGenerator::GetAssetWithName(IDataRepository* repository, const std::str
|
||||
auto* def = repository->GetDataDefinitionByName(name);
|
||||
if (def == nullptr)
|
||||
{
|
||||
std::cout << "Could not find type with name '" << name << "'" << std::endl;
|
||||
std::cout << "Could not find type with name '" << name << "'\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -66,13 +66,13 @@ bool CodeGenerator::GetAssetWithName(IDataRepository* repository, const std::str
|
||||
auto* info = defWithMembers != nullptr ? repository->GetInformationFor(defWithMembers) : nullptr;
|
||||
if (info == nullptr)
|
||||
{
|
||||
std::cout << "Could not find type with name '" << name << "'" << std::endl;
|
||||
std::cout << "Could not find type with name '" << name << "'\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!StructureComputations(info).IsAsset())
|
||||
{
|
||||
std::cout << "Type is not an asset '" << name << "'" << std::endl;
|
||||
std::cout << "Type is not an asset '" << name << "'\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ bool CodeGenerator::GenerateCode(IDataRepository* repository)
|
||||
const auto foundTemplate = m_template_mapping.find(templateName);
|
||||
if (foundTemplate == m_template_mapping.end())
|
||||
{
|
||||
std::cout << "Unknown template '" << generationTask.m_template_name << "'." << std::endl;
|
||||
std::cout << "Unknown template '" << generationTask.m_template_name << "'.\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@ bool CodeGenerator::GenerateCode(IDataRepository* repository)
|
||||
const auto end = std::chrono::steady_clock::now();
|
||||
if (m_args->m_verbose)
|
||||
{
|
||||
std::cout << "Generating code took " << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << "ms" << std::endl;
|
||||
std::cout << "Generating code took " << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << "ms\n";
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -30,7 +30,7 @@ bool CommandsFileReader::OpenBaseStream()
|
||||
auto stream = std::make_unique<ParserFilesystemStream>(m_filename);
|
||||
if (!stream->IsOpen())
|
||||
{
|
||||
std::cout << "Could not open commands file" << std::endl;
|
||||
std::cout << "Could not open commands file\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ bool CommandsFileReader::ReadCommandsFile(IDataRepository* repository)
|
||||
{
|
||||
if (m_args->m_verbose)
|
||||
{
|
||||
std::cout << "Reading commands file: " << m_filename << std::endl;
|
||||
std::cout << "Reading commands file: " << m_filename << "\n";
|
||||
}
|
||||
|
||||
if (!OpenBaseStream())
|
||||
@ -85,7 +85,7 @@ bool CommandsFileReader::ReadCommandsFile(IDataRepository* repository)
|
||||
|
||||
if (m_args->m_verbose)
|
||||
{
|
||||
std::cout << "Processing commands took " << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << "ms" << std::endl;
|
||||
std::cout << "Processing commands took " << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << "ms\n";
|
||||
}
|
||||
|
||||
if (!result)
|
||||
|
@ -29,7 +29,7 @@ bool HeaderFileReader::OpenBaseStream()
|
||||
auto stream = std::make_unique<ParserFilesystemStream>(m_filename);
|
||||
if (!stream->IsOpen())
|
||||
{
|
||||
std::cout << "Could not open header file" << std::endl;
|
||||
std::cout << "Could not open header file\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ bool HeaderFileReader::ReadHeaderFile(IDataRepository* repository)
|
||||
{
|
||||
if (m_args->m_verbose)
|
||||
{
|
||||
std::cout << "Reading header file: " << m_filename << std::endl;
|
||||
std::cout << "Reading header file: " << m_filename << "\n";
|
||||
}
|
||||
|
||||
if (!OpenBaseStream())
|
||||
@ -85,7 +85,7 @@ bool HeaderFileReader::ReadHeaderFile(IDataRepository* repository)
|
||||
|
||||
if (m_args->m_verbose)
|
||||
{
|
||||
std::cout << "Processing header took " << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << "ms" << std::endl;
|
||||
std::cout << "Processing header took " << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << "ms\n";
|
||||
}
|
||||
|
||||
if (!result)
|
||||
|
@ -96,7 +96,7 @@ bool HeaderParserState::ResolveForwardDeclarations()
|
||||
|
||||
if (dataDefinition == nullptr)
|
||||
{
|
||||
std::cout << "Forward declaration \"" << forwardDeclaration->GetFullName() << "\" was not defined" << std::endl;
|
||||
std::cout << "Forward declaration \"" << forwardDeclaration->GetFullName() << "\" was not defined\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -269,7 +269,7 @@ bool CalculateSizeAndAlignPostProcessor::PostProcess(IDataRepository* repository
|
||||
{
|
||||
if (repository->GetArchitecture() == Architecture::UNKNOWN)
|
||||
{
|
||||
std::cout << "You must set an architecture!" << std::endl;
|
||||
std::cout << "You must set an architecture!\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -277,7 +277,7 @@ bool CalculateSizeAndAlignPostProcessor::PostProcess(IDataRepository* repository
|
||||
{
|
||||
if (!CalculateFields(repository, structDefinition))
|
||||
{
|
||||
std::cout << std::endl;
|
||||
std::cout << "\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -286,7 +286,7 @@ bool CalculateSizeAndAlignPostProcessor::PostProcess(IDataRepository* repository
|
||||
{
|
||||
if (!CalculateFields(repository, unionDefinition))
|
||||
{
|
||||
std::cout << std::endl;
|
||||
std::cout << "\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -295,7 +295,7 @@ bool CalculateSizeAndAlignPostProcessor::PostProcess(IDataRepository* repository
|
||||
{
|
||||
if (!CalculateFields(repository, typedefDeclaration->m_type_declaration.get()))
|
||||
{
|
||||
std::cout << std::endl;
|
||||
std::cout << "\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ bool UnionsPostProcessor::ProcessUnion(StructureInformation* info)
|
||||
|
||||
if (entriesWithoutConditionCount > 1 && !info->m_usages.empty() && !info->m_is_leaf)
|
||||
{
|
||||
std::cout << "Union '" << info->m_definition->GetFullName() << "' has more than one entry without a condition!" << std::endl;
|
||||
std::cout << "Union '" << info->m_definition->GetFullName() << "' has more than one entry without a condition!\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -14,9 +14,7 @@ PrettyPrinter::PrettyPrinter(std::ostream& stream, const IDataRepository* reposi
|
||||
|
||||
void PrettyPrinter::PrintSeparator() const
|
||||
{
|
||||
m_stream << std::endl
|
||||
<< "==========================================================================================================" << std::endl
|
||||
<< std::endl;
|
||||
m_stream << "\n==========================================================================================================\n\n";
|
||||
}
|
||||
|
||||
void PrettyPrinter::PrintVariablePointerToArray(Variable* variable) const
|
||||
@ -51,7 +49,7 @@ void PrettyPrinter::PrintVariablePointerToArray(Variable* variable) const
|
||||
m_stream << variable->m_name << ")";
|
||||
for (auto size : arraySize)
|
||||
m_stream << '[' << size << ']';
|
||||
m_stream << std::endl;
|
||||
m_stream << "\n";
|
||||
}
|
||||
|
||||
void PrettyPrinter::PrintVariableArrayOfPointers(Variable* variable) const
|
||||
@ -86,7 +84,7 @@ void PrettyPrinter::PrintVariableArrayOfPointers(Variable* variable) const
|
||||
m_stream << " " << variable->m_name;
|
||||
for (auto size : arraySize)
|
||||
m_stream << '[' << size << ']';
|
||||
m_stream << std::endl;
|
||||
m_stream << "\n";
|
||||
}
|
||||
|
||||
void PrettyPrinter::PrintVariable(Variable* variable) const
|
||||
@ -94,7 +92,7 @@ void PrettyPrinter::PrintVariable(Variable* variable) const
|
||||
const auto& declarationModifiers = variable->m_type_declaration->m_declaration_modifiers;
|
||||
if (declarationModifiers.empty())
|
||||
{
|
||||
std::cout << " " << variable->m_type_declaration->m_type->GetFullName() << " " << variable->m_name << std::endl;
|
||||
std::cout << " " << variable->m_type_declaration->m_type->GetFullName() << " " << variable->m_name << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -147,7 +145,7 @@ void PrettyPrinter::PrintTypedefPointerToArray(TypedefDefinition* typedefDefinit
|
||||
m_stream << typedefDefinition->m_name << ")";
|
||||
for (auto size : arraySize)
|
||||
m_stream << '[' << size << ']';
|
||||
m_stream << std::endl;
|
||||
m_stream << "\n";
|
||||
}
|
||||
|
||||
void PrettyPrinter::PrintTypedefArrayOfPointers(TypedefDefinition* typedefDefinition) const
|
||||
@ -182,84 +180,84 @@ void PrettyPrinter::PrintTypedefArrayOfPointers(TypedefDefinition* typedefDefini
|
||||
m_stream << " " << typedefDefinition->m_name;
|
||||
for (auto size : arraySize)
|
||||
m_stream << '[' << size << ']';
|
||||
m_stream << std::endl;
|
||||
m_stream << "\n";
|
||||
}
|
||||
|
||||
void PrettyPrinter::PrintEnums() const
|
||||
{
|
||||
const auto& allEnums = m_repository->GetAllEnums();
|
||||
m_stream << allEnums.size() << " enums:" << std::endl;
|
||||
m_stream << allEnums.size() << " enums:\n";
|
||||
|
||||
for (auto* enumDefinition : allEnums)
|
||||
{
|
||||
m_stream << " Name: " << enumDefinition->GetFullName() << std::endl;
|
||||
m_stream << " Alignment: " << enumDefinition->GetAlignment() << std::endl;
|
||||
m_stream << " Size: " << enumDefinition->GetSize() << std::endl;
|
||||
m_stream << " Name: " << enumDefinition->GetFullName() << "\n";
|
||||
m_stream << " Alignment: " << enumDefinition->GetAlignment() << "\n";
|
||||
m_stream << " Size: " << enumDefinition->GetSize() << "\n";
|
||||
|
||||
for (const auto& enumMember : enumDefinition->m_members)
|
||||
{
|
||||
m_stream << " " << enumMember->m_name << " = " << enumMember->m_value << std::endl;
|
||||
m_stream << " " << enumMember->m_name << " = " << enumMember->m_value << "\n";
|
||||
}
|
||||
|
||||
m_stream << std::endl;
|
||||
m_stream << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
void PrettyPrinter::PrintStructs() const
|
||||
{
|
||||
const auto& allStructs = m_repository->GetAllStructs();
|
||||
m_stream << allStructs.size() << " structs:" << std::endl;
|
||||
m_stream << allStructs.size() << " structs:\n";
|
||||
|
||||
for (auto* structDefinition : allStructs)
|
||||
{
|
||||
m_stream << " Name: " << structDefinition->GetFullName() << std::endl;
|
||||
m_stream << " Alignment: " << structDefinition->GetAlignment() << std::endl;
|
||||
m_stream << " Size: " << structDefinition->GetSize() << std::endl;
|
||||
m_stream << " Name: " << structDefinition->GetFullName() << "\n";
|
||||
m_stream << " Alignment: " << structDefinition->GetAlignment() << "\n";
|
||||
m_stream << " Size: " << structDefinition->GetSize() << "\n";
|
||||
|
||||
for (const auto& variable : structDefinition->m_members)
|
||||
{
|
||||
PrintVariable(variable.get());
|
||||
}
|
||||
|
||||
m_stream << std::endl;
|
||||
m_stream << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
void PrettyPrinter::PrintUnions() const
|
||||
{
|
||||
const auto& allUnions = m_repository->GetAllUnions();
|
||||
m_stream << allUnions.size() << " unions:" << std::endl;
|
||||
m_stream << allUnions.size() << " unions:\n";
|
||||
|
||||
for (auto* unionDefinition : allUnions)
|
||||
{
|
||||
m_stream << " Name: " << unionDefinition->GetFullName() << std::endl;
|
||||
m_stream << " Alignment: " << unionDefinition->GetAlignment() << std::endl;
|
||||
m_stream << " Size: " << unionDefinition->GetSize() << std::endl;
|
||||
m_stream << " Name: " << unionDefinition->GetFullName() << "\n";
|
||||
m_stream << " Alignment: " << unionDefinition->GetAlignment() << "\n";
|
||||
m_stream << " Size: " << unionDefinition->GetSize() << "\n";
|
||||
|
||||
for (const auto& variable : unionDefinition->m_members)
|
||||
{
|
||||
PrintVariable(variable.get());
|
||||
}
|
||||
|
||||
m_stream << std::endl;
|
||||
m_stream << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
void PrettyPrinter::PrintTypedefs() const
|
||||
{
|
||||
const auto& allTypedefs = m_repository->GetAllTypedefs();
|
||||
m_stream << allTypedefs.size() << " typedefs:" << std::endl;
|
||||
m_stream << allTypedefs.size() << " typedefs:\n";
|
||||
|
||||
for (auto* typedefDefinition : allTypedefs)
|
||||
{
|
||||
m_stream << " Name: " << typedefDefinition->GetFullName() << std::endl;
|
||||
m_stream << " Alignment: " << typedefDefinition->GetAlignment() << std::endl;
|
||||
m_stream << " Size: " << typedefDefinition->GetSize() << std::endl;
|
||||
m_stream << " Name: " << typedefDefinition->GetFullName() << "\n";
|
||||
m_stream << " Alignment: " << typedefDefinition->GetAlignment() << "\n";
|
||||
m_stream << " Size: " << typedefDefinition->GetSize() << "\n";
|
||||
|
||||
const auto& declarationModifiers = typedefDefinition->m_type_declaration->m_declaration_modifiers;
|
||||
if (declarationModifiers.empty())
|
||||
{
|
||||
std::cout << " " << typedefDefinition->m_type_declaration->m_type->GetFullName() << std::endl;
|
||||
std::cout << " " << typedefDefinition->m_type_declaration->m_type->GetFullName() << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -279,7 +277,7 @@ void PrettyPrinter::PrintTypedefs() const
|
||||
}
|
||||
}
|
||||
|
||||
m_stream << std::endl;
|
||||
m_stream << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,7 @@ bool ZoneCodeGeneratorArguments::ParseArgs(const int argc, const char** argv, bo
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "At least one header file must be specified via -h / --header." << std::endl;
|
||||
std::cout << "At least one header file must be specified via -h / --header.\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@ bool ZoneCodeGeneratorArguments::ParseArgs(const int argc, const char** argv, bo
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "At least one commands file must be specified via -c / --commands-file." << std::endl;
|
||||
std::cout << "At least one commands file must be specified via -c / --commands-file.\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@ bool ZoneCodeGeneratorArguments::ParseArgs(const int argc, const char** argv, bo
|
||||
|
||||
if (m_task_flags == 0)
|
||||
{
|
||||
std::cout << "There was no output task specified." << std::endl;
|
||||
std::cout << "There was no output task specified.\n";
|
||||
PrintUsage();
|
||||
return false;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ std::unique_ptr<ZoneDefinition> ZoneDefinitionInputStream::ReadDefinition()
|
||||
{
|
||||
if (m_verbose)
|
||||
{
|
||||
std::cout << "Reading zone definition file: " << m_file_name << std::endl;
|
||||
std::cout << "Reading zone definition file: " << m_file_name << "\n";
|
||||
}
|
||||
|
||||
const auto lexer = std::make_unique<ZoneDefinitionLexer>(m_stream);
|
||||
@ -53,7 +53,7 @@ std::unique_ptr<ZoneDefinition> ZoneDefinitionInputStream::ReadDefinition()
|
||||
|
||||
if (m_verbose)
|
||||
{
|
||||
std::cout << "Processing zone definition took " << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << "ms" << std::endl;
|
||||
std::cout << "Processing zone definition took " << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << "ms\n";
|
||||
}
|
||||
|
||||
return std::move(definition);
|
||||
|
@ -72,12 +72,12 @@ bool ZoneWriter::WriteZone(std::ostream& stream)
|
||||
}
|
||||
catch (WritingException& e)
|
||||
{
|
||||
std::cout << "Writing fastfile failed: " << e.Message() << std::endl;
|
||||
std::cout << "Writing fastfile failed: " << e.Message() << "\n";
|
||||
return false;
|
||||
}
|
||||
catch (std::runtime_error& e)
|
||||
{
|
||||
std::cout << "Writing fastfile failed: " << e.what() << std::endl;
|
||||
std::cout << "Writing fastfile failed: " << e.what() << "\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user