refactor: use new line character instead of std::endl

This commit is contained in:
Jan
2024-03-24 20:24:22 +01:00
parent 1b13f1f1b4
commit 132cccb971
49 changed files with 213 additions and 217 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 {};
}