new script engine, and things maybe be bugged for a while

This commit is contained in:
Eduardo Bart
2011-07-26 20:13:27 -03:00
parent ab7394f357
commit 70f0b0dace
137 changed files with 2905 additions and 2578 deletions

View File

@@ -0,0 +1,16 @@
#ifndef ALGORITHMS_H
#define ALGORITHMS_H
#include <algorithm>
#include <string>
inline std::string getPathDirectory(const std::string& sourcePath)
{
std::string dir;
std::size_t pos = sourcePath.find_last_of('/');
if(pos != std::string::npos)
dir = sourcePath.substr(0, pos);
return dir;
}
#endif // ALGORITHMS_H

View File

@@ -19,11 +19,11 @@ void log(LogLevel level, const std::string& message, std::string prettyFunction
#define logError(...) log(LogError, make_string(__VA_ARGS__))
#define logFatal(...) log(LogFatal, make_string(__VA_ARGS__))
#define trace() log(LogDebug, "", __PRETTY_FUNCTION__)
#define traceDebug(...) log(LogDebug, make_string(__VA_ARGS__), __PRETTY_FUNCTION__)
#define traceInfo(...) log(LogInfo, make_string(__VA_ARGS__), __PRETTY_FUNCTION__)
#define traceWarning(...) log(LogWarning, make_string(__VA_ARGS__), __PRETTY_FUNCTION__)
#define traceError(...) log(LogError, make_string(__VA_ARGS__), __PRETTY_FUNCTION__)
#define logTrace() log(LogDebug, "", __PRETTY_FUNCTION__)
#define logTraceDebug(...) log(LogDebug, make_string(__VA_ARGS__), __PRETTY_FUNCTION__)
#define logTraceInfo(...) log(LogInfo, make_string(__VA_ARGS__), __PRETTY_FUNCTION__)
#define logTraceWarning(...) log(LogWarning, make_string(__VA_ARGS__), __PRETTY_FUNCTION__)
#define logTraceError(...) log(LogError, make_string(__VA_ARGS__), __PRETTY_FUNCTION__)
// dump utility
struct Dump {

View File

@@ -42,7 +42,7 @@ public:
inline bool operator==(const TPoint<T>& other) const { return other.x==x && other.y==y; }
inline bool operator!=(const TPoint<T>& other) const { return other.x!=x || other.y!=y; }
inline float length() const { return sqrtf((float)(x*x + y*y)); }
inline float length() const { return sqrt((float)(x*x + y*y)); }
inline T manhattanLength() const { return std::abs(x) + std::abs(y); }
inline float distanceFrom(const TPoint<T>& other) const {