Changeset - r11034:b133414fb70f
[Not reviewed]
master
0 3 0
rubidium - 16 years ago 2009-02-06 15:39:34
rubidium@openttd.org
(svn r15374) -Codechange: remove a magic constant.
3 files changed with 22 insertions and 19 deletions:
0 comments (0 inline, 0 general)
src/road_cmd.cpp
Show inline comments
 
@@ -24,12 +24,13 @@
 
#include "sound_func.h"
 
#include "tunnelbridge.h"
 
#include "cheat_type.h"
 
#include "functions.h"
 
#include "effectvehicle_func.h"
 
#include "elrail_func.h"
 
#include "roadveh.h"
 

	
 
#include "table/sprites.h"
 
#include "table/strings.h"
 

	
 
/**
 
 * Verify whether a road vehicle is available.
 
@@ -1534,13 +1535,13 @@ static VehicleEnterTileStatus VehicleEnt
 
				assert(IsCrossingBarred(tile));
 
			}
 
			break;
 

	
 
		case ROAD_TILE_DEPOT:
 
			if (v->type == VEH_ROAD &&
 
					v->u.road.frame == 11 &&
 
					v->u.road.frame == RVC_DEPOT_STOP_FRAME &&
 
					_roadveh_enter_depot_dir[GetRoadDepotDirection(tile)] == v->u.road.state) {
 
				v->u.road.state = RVSB_IN_DEPOT;
 
				v->vehstatus |= VS_HIDDEN;
 
				v->direction = ReverseDir(v->direction);
 
				if (v->Next() == NULL) VehicleEnterDepot(v);
 
				v->tile = tile;
src/roadveh.h
Show inline comments
 
@@ -7,12 +7,32 @@
 

	
 
#include "vehicle_base.h"
 
#include "engine_func.h"
 
#include "engine_base.h"
 
#include "economy_func.h"
 

	
 
/** State information about the Road Vehicle controller */
 
enum {
 
	RDE_NEXT_TILE = 0x80, ///< We should enter the next tile
 
	RDE_TURNED    = 0x40, ///< We just finished turning
 

	
 
	/* Start frames for when a vehicle enters a tile/changes its state.
 
	 * The start frame is different for vehicles that turned around or
 
	 * are leaving the depot as the do not start at the edge of the tile.
 
	 * For trams there are a few different start frames as there are two
 
	 * places where trams can turn. */
 
	RVC_DEFAULT_START_FRAME                =  0,
 
	RVC_TURN_AROUND_START_FRAME            =  1,
 
	RVC_DEPOT_START_FRAME                  =  6,
 
	RVC_START_FRAME_AFTER_LONG_TRAM        = 21,
 
	RVC_TURN_AROUND_START_FRAME_SHORT_TRAM = 16,
 
	/* Stop frame for a vehicle in a drive-through stop */
 
	RVC_DRIVE_THROUGH_STOP_FRAME           =  7,
 
	RVC_DEPOT_STOP_FRAME                   = 11,
 
};
 

	
 
enum RoadVehicleSubType {
 
	RVST_FRONT,
 
	RVST_ARTIC_PART,
 
};
 

	
 
static inline bool IsRoadVehFront(const Vehicle *v)
src/roadveh_cmd.cpp
Show inline comments
 
@@ -1199,30 +1199,12 @@ static uint RoadFindPathToStop(const Veh
 
	/* change units from NPF_TILE_LENGTH to # of tiles */
 
	if (dist != UINT_MAX) dist = (dist + NPF_TILE_LENGTH - 1) / NPF_TILE_LENGTH;
 

	
 
	return dist;
 
}
 

	
 
enum {
 
	RDE_NEXT_TILE = 0x80,
 
	RDE_TURNED    = 0x40,
 

	
 
	/* Start frames for when a vehicle enters a tile/changes its state.
 
	 * The start frame is different for vehicles that turned around or
 
	 * are leaving the depot as the do not start at the edge of the tile.
 
	 * For trams there are a few different start frames as there are two
 
	 * places where trams can turn. */
 
	RVC_DEFAULT_START_FRAME                =  0,
 
	RVC_TURN_AROUND_START_FRAME            =  1,
 
	RVC_DEPOT_START_FRAME                  =  6,
 
	RVC_START_FRAME_AFTER_LONG_TRAM        = 21,
 
	RVC_TURN_AROUND_START_FRAME_SHORT_TRAM = 16,
 
	/* Stop frame for a vehicle in a drive-through stop */
 
	RVC_DRIVE_THROUGH_STOP_FRAME           =  7
 
};
 

	
 
struct RoadDriveEntry {
 
	byte x, y;
 
};
 

	
 
#include "table/roadveh_movement.h"
 

	
0 comments (0 inline, 0 general)