diff options
| author | oy <Tom_Adams@web.de> | 2010-08-18 00:06:00 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-08-18 00:06:00 +0200 |
| commit | cabecb7fa937b5e4efa859ea62722468f91a5089 (patch) | |
| tree | d9da92814dd049dfef7bdcfa9069955504341b8c /src/game/localization.cpp | |
| parent | 16f201794de61e237b4a7644d28f043dc1b987bb (diff) | |
| download | zcatch-cabecb7fa937b5e4efa859ea62722468f91a5089.tar.gz zcatch-cabecb7fa937b5e4efa859ea62722468f91a5089.zip | |
added output level for console print function, categorised the debug messages and merged them into the new functionality. Closes #8
Diffstat (limited to 'src/game/localization.cpp')
| -rw-r--r-- | src/game/localization.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/game/localization.cpp b/src/game/localization.cpp index 02065e36..fc9ac3df 100644 --- a/src/game/localization.cpp +++ b/src/game/localization.cpp @@ -3,6 +3,7 @@ #include <base/tl/algorithm.h> #include <engine/shared/linereader.h> +#include <engine/console.h> const char *Localize(const char *pStr) { @@ -39,7 +40,7 @@ void CLocalizationDatabase::AddString(const char *pOrgStr, const char *pNewStr) m_Strings.add(s); } -bool CLocalizationDatabase::Load(const char *pFilename) +bool CLocalizationDatabase::Load(const char *pFilename, IConsole *pConsole) { // empty string means unload if(pFilename[0] == 0) @@ -53,7 +54,9 @@ bool CLocalizationDatabase::Load(const char *pFilename) if(!IoHandle) return false; - dbg_msg("localization", "loaded '%s'", pFilename); + char aBuf[256]; + str_format(aBuf, sizeof(aBuf), "loaded '%s'", pFilename); + pConsole->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "localization", aBuf); m_Strings.clear(); CLineReader LineReader; @@ -70,13 +73,14 @@ bool CLocalizationDatabase::Load(const char *pFilename) char *pReplacement = LineReader.Get(); if(!pReplacement) { - dbg_msg("", "unexpected end of file"); + pConsole->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "localization", "unexpected end of file"); break; } if(pReplacement[0] != '=' || pReplacement[1] != '=' || pReplacement[2] != ' ') { - dbg_msg("", "malform replacement line for '%s'", pLine); + str_format(aBuf, sizeof(aBuf), "malform replacement line for '%s'", pLine); + pConsole->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "localization", aBuf); continue; } |