mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 18:19:19 +02:00
texture-related log message filtering
This commit is contained in:
3
Logs.h
3
Logs.h
@@ -14,7 +14,8 @@ enum logtype : unsigned int {
|
||||
|
||||
generic = 0x1,
|
||||
file = 0x2,
|
||||
model = 0x4
|
||||
model = 0x4,
|
||||
texture = 0x8
|
||||
};
|
||||
|
||||
void WriteLog( const char *str, logtype const Type = logtype::generic );
|
||||
|
||||
@@ -1234,7 +1234,7 @@ bool TModel3d::LoadFromFile(std::string const &FileName, bool dynamic)
|
||||
Root ? (iSubModelsCount > 0) : false; // brak pliku albo problem z wczytaniem
|
||||
if (false == result)
|
||||
{
|
||||
ErrorLog("Failed to load 3d model \"" + FileName + "\"");
|
||||
ErrorLog("Bad model: failed to load 3d model \"" + FileName + "\"");
|
||||
}
|
||||
return result;
|
||||
};
|
||||
@@ -1697,7 +1697,7 @@ void TSubModel::BinInit(TSubModel *s, float4x4 *m, std::vector<std::string> *t,
|
||||
|
||||
void TModel3d::LoadFromBinFile(std::string const &FileName, bool dynamic)
|
||||
{ // wczytanie modelu z pliku binarnego
|
||||
WriteLog("Loading binary format 3d model data from \"" + FileName + "\"...");
|
||||
WriteLog( "Loading binary format 3d model data from \"" + FileName + "\"...", logtype::model );
|
||||
|
||||
std::ifstream file(FileName, std::ios::binary);
|
||||
|
||||
@@ -1710,12 +1710,12 @@ void TModel3d::LoadFromBinFile(std::string const &FileName, bool dynamic)
|
||||
deserialize(file, size, dynamic);
|
||||
file.close();
|
||||
|
||||
WriteLog("Finished loading 3d model data from \"" + FileName + "\"");
|
||||
WriteLog( "Finished loading 3d model data from \"" + FileName + "\"", logtype::model );
|
||||
};
|
||||
|
||||
void TModel3d::LoadFromTextFile(std::string const &FileName, bool dynamic)
|
||||
{ // wczytanie submodelu z pliku tekstowego
|
||||
WriteLog("Loading text format 3d model data from \"" + FileName + "\"...");
|
||||
WriteLog( "Loading text format 3d model data from \"" + FileName + "\"...", logtype::model );
|
||||
iFlags |= 0x0200; // wczytano z pliku tekstowego (właścicielami tablic są submodle)
|
||||
cParser parser(FileName, cParser::buffer_FILE); // Ra: tu powinno być "models\\"...
|
||||
TSubModel *SubModel;
|
||||
|
||||
16
Texture.cpp
16
Texture.cpp
@@ -39,7 +39,7 @@ opengl_texture::load() {
|
||||
|
||||
if( name.size() < 3 ) { goto fail; }
|
||||
|
||||
WriteLog( "Loading texture data from \"" + name + "\"" );
|
||||
WriteLog( "Loading texture data from \"" + name + "\"", logtype::texture );
|
||||
|
||||
data_state = resource_state::loading;
|
||||
{
|
||||
@@ -67,7 +67,7 @@ opengl_texture::load() {
|
||||
|
||||
fail:
|
||||
data_state = resource_state::failed;
|
||||
ErrorLog( "Failed to load texture \"" + name + "\"" );
|
||||
ErrorLog( "Bad texture: failed to load texture \"" + name + "\"" );
|
||||
// NOTE: temporary workaround for texture assignment errors
|
||||
id = 0;
|
||||
return;
|
||||
@@ -91,7 +91,7 @@ opengl_texture::load_BMP() {
|
||||
BITMAPINFO info;
|
||||
unsigned int infosize = header.bfOffBits - sizeof( BITMAPFILEHEADER );
|
||||
if( infosize > sizeof( info ) ) {
|
||||
WriteLog( "Warning - BMP header is larger than expected, possible format difference." );
|
||||
WriteLog( "Warning - BMP header is larger than expected, possible format difference.", logtype::texture );
|
||||
}
|
||||
file.read( (char *)&info, std::min( (size_t)infosize, sizeof( info ) ) );
|
||||
|
||||
@@ -100,7 +100,7 @@ opengl_texture::load_BMP() {
|
||||
|
||||
if( info.bmiHeader.biCompression != BI_RGB ) {
|
||||
|
||||
ErrorLog( "Compressed BMP textures aren't supported." );
|
||||
ErrorLog( "Bad texture: compressed BMP textures aren't supported.", logtype::texture );
|
||||
data_state = resource_state::failed;
|
||||
return;
|
||||
}
|
||||
@@ -289,7 +289,7 @@ opengl_texture::load_DDS() {
|
||||
*/
|
||||
if( datasize == 0 ) {
|
||||
// catch malformed .dds files
|
||||
WriteLog( "File \"" + name + "\" is malformed and holds no texture data." );
|
||||
WriteLog( "Bad texture: file \"" + name + "\" is malformed and holds no texture data.", logtype::texture );
|
||||
data_state = resource_state::failed;
|
||||
return;
|
||||
}
|
||||
@@ -330,7 +330,7 @@ opengl_texture::load_TEX() {
|
||||
hasalpha = true;
|
||||
}
|
||||
else {
|
||||
ErrorLog( "Unrecognized TEX texture sub-format: " + std::string(head) );
|
||||
ErrorLog( "Bad texture: unrecognized TEX texture sub-format: " + std::string(head), logtype::texture );
|
||||
data_state = resource_state::failed;
|
||||
return;
|
||||
};
|
||||
@@ -793,7 +793,7 @@ texture_manager::create( std::string Filename, bool const Loadnow ) {
|
||||
|
||||
if( true == filename.empty() ) {
|
||||
// there's nothing matching in the databank nor on the disk, report failure
|
||||
ErrorLog( "Texture file missing: \"" + Filename + "\"" );
|
||||
ErrorLog( "Bad file: failed do locate texture file \"" + Filename + "\"", logtype::file );
|
||||
return npos;
|
||||
}
|
||||
|
||||
@@ -808,7 +808,7 @@ texture_manager::create( std::string Filename, bool const Loadnow ) {
|
||||
m_textures.emplace_back( texture, std::chrono::steady_clock::time_point() );
|
||||
m_texturemappings.emplace( filename, textureindex );
|
||||
|
||||
WriteLog( "Created texture object for \"" + filename + "\"" );
|
||||
WriteLog( "Created texture object for \"" + filename + "\"", logtype::texture );
|
||||
|
||||
if( true == Loadnow ) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user