diff options
author | ludde <ludde@openttd.org> | 2005-07-19 11:42:40 +0000 |
---|---|---|
committer | ludde <ludde@openttd.org> | 2005-07-19 11:42:40 +0000 |
commit | 3e97dda275f59b2bcaea44c48ceba7a0ed054d9c (patch) | |
tree | 4d3f43a36f40b9b8d244fda8f0cdb2bba4bc64ec /functions.h | |
parent | 29f6ada06a0cbf3954e9c5f61657d4ed763cee79 (diff) | |
download | openttd-3e97dda275f59b2bcaea44c48ceba7a0ed054d9c.tar.xz |
(svn r2635) Fix: [ntp/misc] Improve the old pathfinder. Changed it to A* instead of Dijkstra.
- Benchmark shows that NTP is now around 10x faster than NPF.
- Made IsTunnelTile macro to determine if a tile is a tunnel.
- Added some useful debugging functions for making tiles red / getting accurate timestamps.
- Remove old depot finding algorithm.
- Disable warning for signed/unsigned comparisons.
Diffstat (limited to 'functions.h')
-rw-r--r-- | functions.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/functions.h b/functions.h index 74d6980f4..ea755ab76 100644 --- a/functions.h +++ b/functions.h @@ -128,8 +128,8 @@ uint InteractiveRandomRange(uint max); // Used for profiling -#define TIC() { extern uint32 rdtsc(void); uint32 _xxx_ = rdtsc(); -#define TOC(s) _xxx_ = rdtsc() - _xxx_; printf("%s: %d\n", s, _xxx_); } +#define TIC() { extern uint32 rdtsc(void); uint32 _xxx_ = rdtsc(); static float __avg__; +#define TOC(s) _xxx_ = rdtsc() - _xxx_; __avg__=__avg__*0.99+_xxx_*0.01; printf("%s: %8d %f\n", s, _xxx_,__avg__); } void SetDate(uint date); |