From cabecb7fa937b5e4efa859ea62722468f91a5089 Mon Sep 17 00:00:00 2001 From: oy Date: Wed, 18 Aug 2010 00:06:00 +0200 Subject: added output level for console print function, categorised the debug messages and merged them into the new functionality. Closes #8 --- src/game/editor/ed_io.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/game/editor/ed_io.cpp') diff --git a/src/game/editor/ed_io.cpp b/src/game/editor/ed_io.cpp index 4d514051..6eae9fb5 100644 --- a/src/game/editor/ed_io.cpp +++ b/src/game/editor/ed_io.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -197,11 +198,14 @@ int CEditor::Save(const char *pFilename) int CEditorMap::Save(class IStorage *pStorage, const char *pFileName) { - dbg_msg("editor", "saving to '%s'...", pFileName); + char aBuf[256]; + str_format(aBuf, sizeof(aBuf), "saving to '%s'...", pFileName); + m_pEditor->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "editor", aBuf); CDataFileWriter df; if(!df.Open(pStorage, pFileName)) { - dbg_msg("editor", "failed to open file '%s'...", pFileName); + str_format(aBuf, sizeof(aBuf), "failed to open file '%s'...", pFileName); + m_pEditor->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "editor", aBuf); return 0; } @@ -259,7 +263,7 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName) { if(pGroup->m_lLayers[l]->m_Type == LAYERTYPE_TILES) { - dbg_msg("editor", "saving tiles layer"); + m_pEditor->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "editor", "saving tiles layer"); CLayerTiles *pLayer = (CLayerTiles *)pGroup->m_lLayers[l]; pLayer->PrepareForSave(); @@ -288,7 +292,7 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName) } else if(pGroup->m_lLayers[l]->m_Type == LAYERTYPE_QUADS) { - dbg_msg("editor", "saving quads layer"); + m_pEditor->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "editor", "saving quads layer"); CLayerQuads *pLayer = (CLayerQuads *)pGroup->m_lLayers[l]; if(pLayer->m_lQuads.size()) { @@ -346,7 +350,7 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName) // finish the data file df.Finish(); - dbg_msg("editor", "done"); + m_pEditor->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "editor", "saving done"); // send rcon.. if we can /* -- cgit 1.4.1