[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src log.cpp log.hpp unit.cpp pathfind.hpp
From: |
Guillaume Melquiond |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src log.cpp log.hpp unit.cpp pathfind.hpp |
Date: |
Sun, 19 Sep 2004 07:20:10 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Guillaume Melquiond <address@hidden> 04/09/19 11:13:56
Modified files:
src : log.cpp log.hpp unit.cpp pathfind.hpp
Log message:
Switched A* resolution to the new logging system
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/log.cpp.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/log.hpp.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit.cpp.diff?tr1=1.97&tr2=1.98&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/pathfind.hpp.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
Patches:
Index: wesnoth/src/log.cpp
diff -u wesnoth/src/log.cpp:1.14 wesnoth/src/log.cpp:1.15
--- wesnoth/src/log.cpp:1.14 Sat Sep 18 21:23:24 2004
+++ wesnoth/src/log.cpp Sun Sep 19 11:13:56 2004
@@ -1,4 +1,4 @@
-/* $Id: log.cpp,v 1.14 2004/09/18 21:23:24 silene Exp $ */
+/* $Id: log.cpp,v 1.15 2004/09/19 11:13:56 silene Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -44,7 +44,7 @@
namespace lg {
logger err("error", 0), warn("warning", 1), info("info", 2);
-log_domain general("general"), ai("ai"), config("config"), display("display"),
network("network");
+log_domain general("general"), ai("ai"), config("config"), display("display"),
engine("engine"), network("network");
log_domain::log_domain(char const *name) : domain_(log_domains.size())
{
Index: wesnoth/src/log.hpp
diff -u wesnoth/src/log.hpp:1.15 wesnoth/src/log.hpp:1.16
--- wesnoth/src/log.hpp:1.15 Sat Sep 18 21:23:24 2004
+++ wesnoth/src/log.hpp Sun Sep 19 11:13:56 2004
@@ -1,4 +1,4 @@
-/* $Id: log.hpp,v 1.15 2004/09/18 21:23:24 silene Exp $ */
+/* $Id: log.hpp,v 1.16 2004/09/19 11:13:56 silene Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -38,7 +38,7 @@
};
extern logger err, warn, info;
-extern log_domain general, ai, config, display, network;
+extern log_domain general, ai, config, display, engine, network;
class scope_logger
{
Index: wesnoth/src/pathfind.hpp
diff -u wesnoth/src/pathfind.hpp:1.32 wesnoth/src/pathfind.hpp:1.33
--- wesnoth/src/pathfind.hpp:1.32 Thu Sep 2 19:15:19 2004
+++ wesnoth/src/pathfind.hpp Sun Sep 19 11:13:56 2004
@@ -1,4 +1,4 @@
-/* $Id: pathfind.hpp,v 1.32 2004/09/02 19:15:19 ydirson Exp $ */
+/* $Id: pathfind.hpp,v 1.33 2004/09/19 11:13:56 silene Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -15,9 +15,10 @@
#include "array.hpp"
#include "gamestatus.hpp"
+#include "log.hpp"
#include "map.hpp"
-#include "unit.hpp"
#include "pathutils.hpp"
+#include "unit.hpp"
#include <algorithm>
#include <cassert>
@@ -27,6 +28,8 @@
#include <list>
#include <vector>
+#define LOG_PF lg::info(lg::engine)
+
//this module contains various pathfinding functions and utilities.
//a convenient type for storing a list of tiles adjacent to a certain tile
@@ -160,7 +163,7 @@
const gamemap::location& dst, double stop_at, T obj,
const std::set<gamemap::location>* teleports=NULL)
{
- std::cerr << "a* search: " << src.x << ", " << src.y << " -> " <<
dst.x << ", " << dst.y << "\n";
+ LOG_PF << "a* search: " << src.x << ", " << src.y << " -> " << dst.x <<
", " << dst.y << "\n";
using namespace detail;
typedef gamemap::location location;
@@ -199,7 +202,7 @@
//if we have found a solution
if(locs[j] == dst) {
- std::cerr << "found solution; calculating
it...\n";
+ LOG_PF << "found solution; calculating it...\n";
paths::route rt;
for(location loc = lowest->second.loc;
loc.valid(); ) {
@@ -219,7 +222,7 @@
assert(rt.steps.front() == src);
- std::cerr << "exiting a* search (solved)\n";
+ LOG_PF << "exiting a* search (solved)\n";
return rt;
}
@@ -268,10 +271,12 @@
}
}
- std::cerr << "aborted a* search\n";
+ LOG_PF << "aborted a* search\n";
paths::route val;
val.move_left = 100000;
return val;
}
+#undef LOG_PF
+
#endif
Index: wesnoth/src/unit.cpp
diff -u wesnoth/src/unit.cpp:1.97 wesnoth/src/unit.cpp:1.98
--- wesnoth/src/unit.cpp:1.97 Sat Sep 18 22:56:49 2004
+++ wesnoth/src/unit.cpp Sun Sep 19 11:13:56 2004
@@ -1,4 +1,4 @@
-/* $Id: unit.cpp,v 1.97 2004/09/18 22:56:49 silene Exp $ */
+/* $Id: unit.cpp,v 1.98 2004/09/19 11:13:56 silene Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -26,10 +26,6 @@
#include <iostream>
#include <sstream>
-namespace lg {
-log_domain engine("engine");
-}
-
#define LOG_UT lg::info(lg::engine)
namespace {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src log.cpp log.hpp unit.cpp pathfind.hpp,
Guillaume Melquiond <=