From b65a5aceb0d6552d8ba4878bed5326c614dd3046 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 16 Oct 2011 14:57:53 +0300 Subject: Use the logger; also, default to not showing much crap in console. Use --info-on-stderr to enable crap. --- src/game.cpp | 91 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 46 insertions(+), 45 deletions(-) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index 16cbb4637..414a37759 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -41,6 +41,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "profiler.h" #include "mainmenumanager.h" #include "gettext.h" +#include "log.h" /* TODO: Move content-aware stuff to separate file by adding properties @@ -122,7 +123,7 @@ struct TextDestSignNode : public TextDest void gotText(std::wstring text) { std::string ntext = wide_to_narrow(text); - dstream<<"Changing text of a sign node: " + infostream<<"Changing text of a sign node: " <sendSignNodeText(m_p, ntext); } @@ -161,7 +162,7 @@ void draw_hotbar(video::IVideoDriver *driver, gui::IGUIFont *font, InventoryList *mainlist = inventory->getList("main"); if(mainlist == NULL) { - dstream<<"WARNING: draw_hotbar(): mainlist == NULL"< server; if(address == ""){ draw_load_screen(L"Creating server...", driver, font); - dstream<start(port); } @@ -716,7 +717,7 @@ void the_game( */ draw_load_screen(L"Creating client...", driver, font); - dstream<remove(); @@ -742,9 +743,9 @@ void the_game( Attempt to connect to the server */ - dstream<remove(); return; @@ -963,7 +964,7 @@ void the_game( { error_message = L"Access denied. Reason: " +client.accessDeniedReason(); - dstream<print(dstream); + infostream<<"Profiler:"<print(infostream); g_profiler->clear(); } } @@ -1185,7 +1186,7 @@ void the_game( */ if(input->wasKeyDown(getKeySetting("keymap_inventory"))) { - dstream<wasKeyDown(EscapeKey)) { - dstream<writeImageToFile(image, filename)) { std::wstringstream sstr; sstr<<"Saved screenshot to '"<drop(); } @@ -1327,7 +1328,7 @@ void the_game( { g_selected_item = i; - dstream<getMousePos().Y - displaycenter.Y; if(invert_mouse) dy = -dy; - //dstream<<"window active, pos difference "<isKeyDown(irr::KEY_UP)) @@ -1406,7 +1407,7 @@ void the_game( if(device->getCursorControl()->isVisible() == false) device->getCursorControl()->setVisible(true); - //dstream<<"window inactive"<= 2){ damage_flash_timer += 0.05 * event.player_damage.amount; @@ -1575,7 +1576,7 @@ void the_game( nodepos_old = v3s16(-32768,-32768,-32768); } - //dstream<<"Client returned selected_active_object != NULL"< *selection_box = selected_active_object->getSelectionBox(); @@ -1610,7 +1611,7 @@ void the_game( do_punch = true; } if(do_punch){ - dstream<getRightClicked()) { - dstream<getId(), g_selected_item); } @@ -1687,7 +1688,7 @@ void the_game( { if(nodepos != nodepos_old) { - dstream<getLeftClicked() || (input->getLeftState() && nodepos != nodepos_old)) { - dstream<getLeftClicked()) @@ -1734,7 +1735,7 @@ void the_game( if(prop.diggable == false) { - /*dstream<<"Material "<<(int)material + /*infostream<<"Material "<<(int)material <<" not diggable with \"" <getRightClicked()) { - dstream<getInventoryDrawSpecString() != "" && !random_input) { - dstream<typeId() == CONTENT_SIGN_WALL && !random_input) { - dstream<<"Sign node right-clicked"<getLeftReleased()) { - dstream<getRightReleased()) { - //dstream<drawAll()"<drawAll()"< >::Iterator i=hilightboxes.begin(); i != hilightboxes.end(); i++) { - /*dstream<<"hilightbox min=" + /*infostream<<"hilightbox min=" <<"("<MinEdge.X<<","<MinEdge.Y<<","<MinEdge.Z<<")" <<" max=" <<"("<MaxEdge.X<<","<MaxEdge.Y<<","<MaxEdge.Z<<")" -- cgit v1.2.3