From 6e20c32859ee4518f398a12b65586463ddeecaab Mon Sep 17 00:00:00 2001 From: oy Date: Sat, 10 Dec 2011 18:23:29 +0100 Subject: [PATCH] removed some resource loading spam. Closes #894 --- src/engine/client/graphics.cpp | 2 ++ src/game/client/components/countryflags.cpp | 8 ++++++-- src/game/client/components/skins.cpp | 8 ++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/engine/client/graphics.cpp b/src/engine/client/graphics.cpp index a6b1a47a2..617162aee 100644 --- a/src/engine/client/graphics.cpp +++ b/src/engine/client/graphics.cpp @@ -381,6 +381,8 @@ int CGraphics_OpenGL::LoadTexture(const char *pFilename, int StorageType, int St ID = LoadTextureRaw(Img.m_Width, Img.m_Height, Img.m_Format, Img.m_pData, StoreFormat, Flags); mem_free(Img.m_pData); + if(ID != m_InvalidTexture && g_Config.m_Debug) + dbg_msg("graphics/texture", "loaded %s", pFilename); return ID; } diff --git a/src/game/client/components/countryflags.cpp b/src/game/client/components/countryflags.cpp index 6daf3c2ec..c2af9a591 100644 --- a/src/game/client/components/countryflags.cpp +++ b/src/game/client/components/countryflags.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "countryflags.h" @@ -72,8 +73,11 @@ void CCountryFlags::LoadCountryflagsIndexfile() str_copy(CountryFlag.m_aCountryCodeString, aOrigin, sizeof(CountryFlag.m_aCountryCodeString)); CountryFlag.m_Texture = Graphics()->LoadTextureRaw(Info.m_Width, Info.m_Height, Info.m_Format, Info.m_pData, Info.m_Format, 0); mem_free(Info.m_pData); - str_format(aBuf, sizeof(aBuf), "loaded country flag '%s'", aOrigin); - Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "countryflags", aBuf); + if(g_Config.m_Debug) + { + str_format(aBuf, sizeof(aBuf), "loaded country flag '%s'", aOrigin); + Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "countryflags", aBuf); + } m_aCountryFlags.add(CountryFlag); } io_close(File); diff --git a/src/game/client/components/skins.cpp b/src/game/client/components/skins.cpp index dd38e9eab..babf49bb4 100644 --- a/src/game/client/components/skins.cpp +++ b/src/game/client/components/skins.cpp @@ -7,6 +7,7 @@ #include #include +#include #include "skins.h" @@ -103,8 +104,11 @@ int CSkins::SkinScan(const char *pName, int IsDir, int DirType, void *pUser) // set skin data str_copy(Skin.m_aName, pName, min((int)sizeof(Skin.m_aName),l-3)); - str_format(aBuf, sizeof(aBuf), "load skin %s", Skin.m_aName); - pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "game", aBuf); + if(g_Config.m_Debug) + { + str_format(aBuf, sizeof(aBuf), "load skin %s", Skin.m_aName); + pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "game", aBuf); + } pSelf->m_aSkins.add(Skin); return 0;