mirror of https://github.com/OpenTTD/OpenTTD
(svn r20525) -Codechange: make Aircraft::UpdateDeltaXY more readable by removing the MKIT macro
parent
cf1f337e4d
commit
c263f25309
|
@ -45,30 +45,39 @@
|
||||||
|
|
||||||
void Aircraft::UpdateDeltaXY(Direction direction)
|
void Aircraft::UpdateDeltaXY(Direction direction)
|
||||||
{
|
{
|
||||||
uint32 x;
|
this->x_offs = -1;
|
||||||
#define MKIT(a, b, c, d) ((a & 0xFF) << 24) | ((b & 0xFF) << 16) | ((c & 0xFF) << 8) | ((d & 0xFF) << 0)
|
this->y_offs = -1;
|
||||||
|
this->x_extent = 2;
|
||||||
|
this->y_extent = 2;
|
||||||
|
|
||||||
switch (this->subtype) {
|
switch (this->subtype) {
|
||||||
default: NOT_REACHED();
|
default: NOT_REACHED();
|
||||||
|
|
||||||
case AIR_AIRCRAFT:
|
case AIR_AIRCRAFT:
|
||||||
case AIR_HELICOPTER:
|
case AIR_HELICOPTER:
|
||||||
switch (this->state) {
|
switch (this->state) {
|
||||||
|
default: break;
|
||||||
case ENDTAKEOFF:
|
case ENDTAKEOFF:
|
||||||
case LANDING:
|
case LANDING:
|
||||||
case HELILANDING:
|
case HELILANDING:
|
||||||
case FLYING: x = MKIT(24, 24, -1, -1); break;
|
case FLYING:
|
||||||
default: x = MKIT( 2, 2, -1, -1); break;
|
this->x_extent = 24;
|
||||||
|
this->y_extent = 24;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
this->z_extent = 5;
|
this->z_extent = 5;
|
||||||
break;
|
break;
|
||||||
case AIR_SHADOW: this->z_extent = 1; x = MKIT(2, 2, 0, 0); break;
|
|
||||||
case AIR_ROTOR: this->z_extent = 1; x = MKIT(2, 2, -1, -1); break;
|
|
||||||
}
|
|
||||||
#undef MKIT
|
|
||||||
|
|
||||||
this->x_offs = GB(x, 0, 8);
|
case AIR_SHADOW:
|
||||||
this->y_offs = GB(x, 8, 8);
|
this->z_extent = 1;
|
||||||
this->x_extent = GB(x, 16, 8);
|
this->x_offs = 0;
|
||||||
this->y_extent = GB(x, 24, 8);
|
this->y_offs = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AIR_ROTOR:
|
||||||
|
this->z_extent = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool AirportMove(Aircraft *v, const AirportFTAClass *apc);
|
static bool AirportMove(Aircraft *v, const AirportFTAClass *apc);
|
||||||
|
|
Loading…
Reference in New Issue