* added DebugType debugPathFinder

This commit is contained in:
James McCulloch
2010-07-24 11:43:03 +00:00
parent 1ef403c7b6
commit e73324d317
5 changed files with 156 additions and 24 deletions

View File

@@ -151,6 +151,12 @@ public:
}
};
template <typename T>
std::ostream& operator<<(std::ostream &stream, const Vec2<T> &vec) {
return stream << "(" << vec.x << ", " << vec.y << ")";
}
typedef Vec2<int> Vec2i;
typedef Vec2<bool> Vec2b;
typedef Vec2<char> Vec2c;

View File

@@ -40,7 +40,8 @@ public:
debugNetwork,
debugPerformance,
debugWorldSynch,
debugUnitCommands
debugUnitCommands,
debugPathFinder
};
class SystemFlagsType

View File

@@ -359,14 +359,22 @@ void SystemFlags::handleDebug(DebugType type, const char *fmt, ...) {
MutexSafeWrapper safeMutex(currentDebugLog.mutex);
(*currentDebugLog.fileStream) << "[" << szBuf2 << "] " << szBuf;
if (type != debugPathFinder) {
(*currentDebugLog.fileStream) << "[" << szBuf2 << "] " << szBuf;
} else {
(*currentDebugLog.fileStream) << szBuf;
}
(*currentDebugLog.fileStream).flush();
safeMutex.ReleaseLock();
}
// output to console
else {
printf("[%s] %s", szBuf2, szBuf);
if (type != debugPathFinder) {
printf("[%s] %s", szBuf2, szBuf);
} else {
printf("%s", szBuf);
}
}
va_end(argList);