Changeset - r8793:779ed14d9cc0
[Not reviewed]
master
0 8 0
frosch - 16 years ago 2008-04-01 14:03:20
frosch@openttd.org
(svn r12531) -Codechange: Rename some variables for consistency.
8 files changed with 26 insertions and 26 deletions:
0 comments (0 inline, 0 general)
src/aircraft_cmd.cpp
Show inline comments
 
@@ -51,23 +51,23 @@ void Aircraft::UpdateDeltaXY(Direction d
 
				case ENDTAKEOFF:
 
				case LANDING:
 
				case HELILANDING:
 
				case FLYING:     x = MKIT(24, 24, -1, -1); break;
 
				default:         x = MKIT( 2,  2, -1, -1); break;
 
			}
 
			this->z_height = 5;
 
			this->z_extent = 5;
 
			break;
 
		case AIR_SHADOW:     this->z_height = 1; x = MKIT(2,  2,  0,  0); break;
 
		case AIR_ROTOR:      this->z_height = 1; x = MKIT(2,  2, -1, -1); 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);
 
	this->y_offs        = GB(x,  8, 8);
 
	this->sprite_width  = GB(x, 16, 8);
 
	this->sprite_height = GB(x, 24, 8);
 
	this->x_extent      = GB(x, 16, 8);
 
	this->y_extent      = GB(x, 24, 8);
 
}
 

	
 

	
 
/** this maps the terminal to its corresponding state and block flag
 
 *  currently set for 10 terms, 4 helipads */
 
static const byte _airport_terminal_state[] = {2, 3, 4, 5, 6, 7, 19, 20, 0, 0, 8, 9, 21, 22};
src/disaster_cmd.cpp
Show inline comments
 
@@ -1058,10 +1058,10 @@ void StartupDisasters()
 
}
 

	
 
void DisasterVehicle::UpdateDeltaXY(Direction direction)
 
{
 
	this->x_offs        = -1;
 
	this->y_offs        = -1;
 
	this->sprite_width  =  2;
 
	this->sprite_height =  2;
 
	this->z_height      =  5;
 
	this->x_extent      =  2;
 
	this->y_extent      =  2;
 
	this->z_extent      =  5;
 
}
src/oldloader.cpp
Show inline comments
 
@@ -1152,14 +1152,14 @@ static const OldChunks vehicle_chunk[] =
 

	
 
	OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Vehicle, x_pos ),
 
	OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Vehicle, y_pos ),
 
	OCL_SVAR(  OC_UINT8, Vehicle, z_pos ),
 
	OCL_SVAR(  OC_UINT8, Vehicle, direction ),
 
	OCL_NULL( 2 ),         ///< x_offs and y_offs, calculated automatically
 
	OCL_NULL( 2 ),         ///< sprite_width and sprite_height, calculated automatically
 
	OCL_NULL( 1 ),         ///< z_height, calculated automatically
 
	OCL_NULL( 2 ),         ///< x_extent and y_extent, calculated automatically
 
	OCL_NULL( 1 ),         ///< z_extent, calculated automatically
 

	
 
	OCL_SVAR(  OC_UINT8, Vehicle, owner ),
 
	OCL_SVAR(   OC_TILE, Vehicle, tile ),
 
	OCL_SVAR( OC_UINT16, Vehicle, cur_image ),
 

	
 
	OCL_NULL( 8 ),        ///< Vehicle sprite box, calculated automatically
src/roadveh_cmd.cpp
Show inline comments
 
@@ -582,15 +582,15 @@ void RoadVehicle::UpdateDeltaXY(Directio
 
	};
 
#undef MKIT
 

	
 
	uint32 x = _delta_xy_table[direction];
 
	this->x_offs        = GB(x,  0, 8);
 
	this->y_offs        = GB(x,  8, 8);
 
	this->sprite_width  = GB(x, 16, 8);
 
	this->sprite_height = GB(x, 24, 8);
 
	this->z_height      = 6;
 
	this->x_extent      = GB(x, 16, 8);
 
	this->y_extent      = GB(x, 24, 8);
 
	this->z_extent      = 6;
 
}
 

	
 
static void ClearCrashedStation(Vehicle *v)
 
{
 
	RoadStop *rs = GetRoadStopByTile(v->tile, GetRoadStopType(v->tile));
 

	
src/ship_cmd.cpp
Show inline comments
 
@@ -319,15 +319,15 @@ void Ship::UpdateDeltaXY(Direction direc
 
	};
 
#undef MKIT
 

	
 
	uint32 x = _delta_xy_table[direction];
 
	this->x_offs        = GB(x,  0, 8);
 
	this->y_offs        = GB(x,  8, 8);
 
	this->sprite_width  = GB(x, 16, 8);
 
	this->sprite_height = GB(x, 24, 8);
 
	this->z_height      = 6;
 
	this->x_extent      = GB(x, 16, 8);
 
	this->y_extent      = GB(x, 24, 8);
 
	this->z_extent      = 6;
 
}
 

	
 
void RecalcShipStuff(Vehicle *v)
 
{
 
	v->UpdateDeltaXY(v->direction);
 
	v->cur_image = v->GetImage(v->direction);
src/train_cmd.cpp
Show inline comments
 
@@ -1526,15 +1526,15 @@ void Train::UpdateDeltaXY(Direction dire
 
	};
 
#undef MKIT
 

	
 
	uint32 x = _delta_xy_table[direction];
 
	this->x_offs        = GB(x,  0, 8);
 
	this->y_offs        = GB(x,  8, 8);
 
	this->sprite_width  = GB(x, 16, 8);
 
	this->sprite_height = GB(x, 24, 8);
 
	this->z_height      = 6;
 
	this->x_extent      = GB(x, 16, 8);
 
	this->y_extent      = GB(x, 24, 8);
 
	this->z_extent      = 6;
 
}
 

	
 
static void UpdateVarsAfterSwap(Vehicle *v)
 
{
 
	v->UpdateDeltaXY(v->direction);
 
	v->cur_image = v->GetImage(v->direction);
src/vehicle.cpp
Show inline comments
 
@@ -764,13 +764,13 @@ static void DoDrawVehicle(const Vehicle 
 
		pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
 
	} else {
 
		pal = PAL_NONE;
 
	}
 

	
 
	AddSortableSpriteToDraw(image, pal, v->x_pos + v->x_offs, v->y_pos + v->y_offs,
 
		v->sprite_width, v->sprite_height, v->z_height, v->z_pos, (v->vehstatus & VS_SHADOW) != 0);
 
		v->x_extent, v->y_extent, v->z_extent, v->z_pos, (v->vehstatus & VS_SHADOW) != 0);
 
}
 

	
 
void ViewportAddVehicles(DrawPixelInfo *dpi)
 
{
 
	/* The bounding rectangle */
 
	const int l = dpi->left;
 
@@ -3231,15 +3231,15 @@ void Vehicle::SetNext(Vehicle *next)
 
}
 

	
 
void SpecialVehicle::UpdateDeltaXY(Direction direction)
 
{
 
	this->x_offs        = 0;
 
	this->y_offs        = 0;
 
	this->sprite_width  = 1;
 
	this->sprite_height = 1;
 
	this->z_height      = 1;
 
	this->x_extent      = 1;
 
	this->y_extent      = 1;
 
	this->z_extent      = 1;
 
}
 

	
 
void StopAllVehicles()
 
{
 
	Vehicle *v;
 
	FOR_ALL_VEHICLES(v) {
src/vehicle_base.h
Show inline comments
 
@@ -220,15 +220,15 @@ public:
 
	DirectionByte direction; // facing
 

	
 
	byte spritenum;          // currently displayed sprite index
 
	                         // 0xfd == custom sprite, 0xfe == custom second head sprite
 
	                         // 0xff == reserved for another custom sprite
 
	uint16 cur_image;        // sprite number for this vehicle
 
	byte sprite_width;       // width of vehicle sprite
 
	byte sprite_height;      // height of vehicle sprite
 
	byte z_height;           // z-height of vehicle sprite
 
	byte x_extent;           // x-extent of vehicle bounding box
 
	byte y_extent;           // y-extent of vehicle bounding box
 
	byte z_extent;           // z-extent of vehicle bounding box
 
	int8 x_offs;             // x offset for vehicle sprite
 
	int8 y_offs;             // y offset for vehicle sprite
 
	EngineID engine_type;
 

	
 
	TextEffectID fill_percent_te_id; // a text-effect id to a loading indicator object
 

	
0 comments (0 inline, 0 general)