Minor Update - Log pour plus de fichier

This commit is contained in:
2024-04-11 11:03:53 +02:00
parent 56e58f88a6
commit a84e42ce2c
35 changed files with 460 additions and 33 deletions

View File

@@ -18,6 +18,8 @@ FontClass::~FontClass()
bool FontClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceContext, int fontChoice)
{
logger.Log("Initializing font class", __FILE__, __LINE__);
char fontFilename[128];
char fontTextureFilename[128];
bool result;
@@ -47,6 +49,7 @@ bool FontClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceCont
result = LoadFontData(fontFilename);
if (!result)
{
logger.Log("Failed to load font data", __FILE__, __LINE__);
return false;
}
@@ -54,9 +57,12 @@ bool FontClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceCont
result = LoadTexture(device, deviceContext, fontTextureFilename);
if (!result)
{
logger.Log("Failed to load font texture", __FILE__, __LINE__);
return false;
}
logger.Log("Font class initialized", __FILE__, __LINE__);
return true;
}
@@ -73,6 +79,8 @@ void FontClass::Shutdown()
bool FontClass::LoadFontData(char* filename)
{
logger.Log(("Loading font data from %s", filename), __FILE__, __LINE__);
std::ifstream fin;
int i;
char temp;
@@ -84,6 +92,7 @@ bool FontClass::LoadFontData(char* filename)
fin.open(filename);
if (fin.fail())
{
logger.Log("Failed to open font file", __FILE__, __LINE__, Logger::LogLevel::Error);
return false;
}
@@ -109,6 +118,8 @@ bool FontClass::LoadFontData(char* filename)
// Close the file.
fin.close();
logger.Log("Font data loaded", __FILE__, __LINE__);
return true;
}
@@ -126,6 +137,8 @@ void FontClass::ReleaseFontData()
bool FontClass::LoadTexture(ID3D11Device* device, ID3D11DeviceContext* deviceContext, char* filename)
{
logger.Log(("Loading font texture from %s", filename), __FILE__, __LINE__);
bool result;
@@ -135,9 +148,12 @@ bool FontClass::LoadTexture(ID3D11Device* device, ID3D11DeviceContext* deviceCon
result = m_Texture->Initialize(device, deviceContext, filename);
if (!result)
{
logger.Log("Failed to initialize font texture", __FILE__, __LINE__);
return false;
}
logger.Log("Font texture loaded", __FILE__, __LINE__);
return true;
}