mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-26 08:14:38 +01:00
Downgrade “Image table longer than expected” to a verbose warning (#14722)
There are lots of custom objects like this and there is little point spewing the console full of them, since they’re unlikely to cause many problems.
This commit is contained in:
committed by
GitHub
parent
dbd84f9f40
commit
9a76224a22
@@ -315,7 +315,7 @@ void ImageTable::Read(IReadObjectContext* context, OpenRCT2::IStream* stream)
|
||||
uint64_t remainingBytes = stream->GetLength() - stream->GetPosition() - headerTableSize;
|
||||
if (remainingBytes > imageDataSize)
|
||||
{
|
||||
context->LogWarning(ObjectError::BadImageTable, "Image table size longer than expected.");
|
||||
context->LogVerbose(ObjectError::BadImageTable, "Image table size longer than expected.");
|
||||
imageDataSize = static_cast<uint32_t>(remainingBytes);
|
||||
}
|
||||
|
||||
|
||||
@@ -237,6 +237,7 @@ struct IReadObjectContext
|
||||
virtual std::vector<uint8_t> GetData(std::string_view path) abstract;
|
||||
virtual ObjectAsset GetAsset(std::string_view path) abstract;
|
||||
|
||||
virtual void LogVerbose(ObjectError code, const utf8* text) abstract;
|
||||
virtual void LogWarning(ObjectError code, const utf8* text) abstract;
|
||||
virtual void LogError(ObjectError code, const utf8* text) abstract;
|
||||
};
|
||||
|
||||
@@ -105,10 +105,15 @@ private:
|
||||
std::string _identifier;
|
||||
bool _loadImages;
|
||||
std::string _basePath;
|
||||
bool _wasVerbose = false;
|
||||
bool _wasWarning = false;
|
||||
bool _wasError = false;
|
||||
|
||||
public:
|
||||
bool WasVerbose() const
|
||||
{
|
||||
return _wasVerbose;
|
||||
}
|
||||
bool WasWarning() const
|
||||
{
|
||||
return _wasWarning;
|
||||
@@ -161,6 +166,16 @@ public:
|
||||
return {};
|
||||
}
|
||||
|
||||
void LogVerbose(ObjectError code, const utf8* text) override
|
||||
{
|
||||
_wasVerbose = true;
|
||||
|
||||
if (!String::IsNullOrEmpty(text))
|
||||
{
|
||||
log_verbose("[%s] Info (%d): %s", _identifier.c_str(), code, text);
|
||||
}
|
||||
}
|
||||
|
||||
void LogWarning(ObjectError code, const utf8* text) override
|
||||
{
|
||||
_wasWarning = true;
|
||||
|
||||
Reference in New Issue
Block a user