summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-12-02 19:23:46 +0000
committerrubidium <rubidium@openttd.org>2007-12-02 19:23:46 +0000
commit8ae661b1765122de7c789339b340e2af1ce8ce97 (patch)
tree80db1610c37851fa580923e8c35f308b896764b6
parent8c0122f42902363ba682566cd7671dc55f4d0c8c (diff)
downloadopenttd-8ae661b1765122de7c789339b340e2af1ce8ce97.tar.xz
(svn r11560) -Codechange: replace 'custom' version of FindLastBit with the generic.
-rw-r--r--src/airport.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/airport.cpp b/src/airport.cpp
index 937adca2f..5654d4efc 100644
--- a/src/airport.cpp
+++ b/src/airport.cpp
@@ -431,18 +431,6 @@ static const char* const _airport_heading_strings[] = {
"DUMMY" // extra heading for 255
};
-static uint AirportBlockToString(uint32 block)
-{
- uint i = 0;
- if (block & 0xffff0000) { block >>= 16; i += 16; }
- if (block & 0x0000ff00) { block >>= 8; i += 8; }
- if (block & 0x000000f0) { block >>= 4; i += 4; }
- if (block & 0x0000000c) { block >>= 2; i += 2; }
- if (block & 0x00000002) { i += 1; }
- return i;
-}
-
-
static void AirportPrintOut(uint nofelements, const AirportFTA *layout, bool full_report)
{
if (!full_report) printf("(P = Current Position; NP = Next Position)\n");
@@ -453,7 +441,7 @@ static void AirportPrintOut(uint nofelements, const AirportFTA *layout, bool ful
byte heading = (current->heading == 255) ? MAX_HEADINGS + 1 : current->heading;
printf("\tPos:%2d NPos:%2d Heading:%15s Block:%2d\n", current->position,
current->next_position, _airport_heading_strings[heading],
- AirportBlockToString(current->block));
+ FindLastBit(current->block));
} else {
printf("P:%2d NP:%2d", current->position, current->next_position);
}