Changeset - r2758:4a0142546d39
[Not reviewed]
master
0 1 0
peter1138 - 19 years ago 2005-12-14 09:15:06
peter1138@openttd.org
(svn r3303) Change #if PF_BENCHMARK to #ifdef PF_BENCHMARK
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
train_cmd.c
Show inline comments
 
@@ -2156,13 +2156,13 @@ static const byte _search_directions[6][
 
	{ 1, 9, 9, 2 }, // track lower
 
	{ 3, 2, 9, 9 }, // track left
 
	{ 9, 9, 1, 0 }, // track right
 
};
 

	
 
static const byte _pick_track_table[6] = {1, 3, 2, 2, 0, 0};
 
#if PF_BENCHMARK
 
#ifdef PF_BENCHMARK
 
#if !defined(_MSC_VER)
 
unsigned int _rdtsc()
 
{
 
	unsigned int high, low;
 

	
 
	__asm__ __volatile__ ("rdtsc" : "=a" (low), "=d" (high));
 
@@ -2185,13 +2185,13 @@ static unsigned int _declspec(naked) _rd
 

	
 
/* choose a track */
 
static byte ChooseTrainTrack(Vehicle *v, TileIndex tile, int enterdir, TrackdirBits trackdirbits)
 
{
 
	TrainTrackFollowerData fd;
 
	uint best_track;
 
#if PF_BENCHMARK
 
#ifdef PF_BENCHMARK
 
	int time = _rdtsc();
 
	static float f;
 
#endif
 

	
 
	assert( (trackdirbits & ~0x3F) == 0);
 

	
 
@@ -2256,13 +2256,13 @@ static byte ChooseTrainTrack(Vehicle *v,
 
			best_track = FIND_FIRST_BIT(trackdirbits);
 
		} else {
 
			best_track = fd.best_track & 7;
 
		}
 
	}
 

	
 
#if PF_BENCHMARK
 
#ifdef PF_BENCHMARK
 
	time = _rdtsc() - time;
 
	f = f * 0.99 + 0.01 * time;
 
	printf("PF time = %d %f\n", time, f);
 
#endif
 

	
 
	return best_track;
0 comments (0 inline, 0 general)