station_cmd.c
changeset 3554 86230061c3e7
parent 3553 4aab99ade276
child 3568 c60d7aceed1a
equal deleted inserted replaced
3553:4aab99ade276 3554:86230061c3e7
  1488 	 26, 23, 23, 23, 23, 26
  1488 	 26, 23, 23, 23, 23, 26
  1489 };
  1489 };
  1490 
  1490 
  1491 // International Airport (large) - 2 runways
  1491 // International Airport (large) - 2 runways
  1492 static const byte _airport_sections_international[] = {
  1492 static const byte _airport_sections_international[] = {
  1493   88, 89, 89, 89, 89, 89,  88,
  1493 	88, 89, 89, 89, 89, 89,  88,
  1494  	51,  8,  8,  8,  8,  8,  32,
  1494 	51,  8,  8,  8,  8,  8,  32,
  1495 	30,  8, 11, 27, 11,  8,  10,
  1495 	30,  8, 11, 27, 11,  8,  10,
  1496 	32,  8, 11, 27, 11,  8, 114,
  1496 	32,  8, 11, 27, 11,  8, 114,
  1497 	87,  8, 11, 85, 11,  8, 114,
  1497 	87,  8, 11, 85, 11,  8, 114,
  1498 	87,  8,  8,  8,  8,  8,  90,
  1498 	87,  8,  8,  8,  8,  8,  90,
  1499 	26, 23, 23, 23, 23, 23,  26
  1499 	26, 23, 23, 23, 23, 23,  26
  1503 static const byte _airport_sections_heliport[] = {
  1503 static const byte _airport_sections_heliport[] = {
  1504 	66,
  1504 	66,
  1505 };
  1505 };
  1506 
  1506 
  1507 static const byte * const _airport_sections[] = {
  1507 static const byte * const _airport_sections[] = {
  1508 	_airport_sections_country,				// Country Airfield (small)
  1508 	_airport_sections_country,        // Country Airfield (small)
  1509 	_airport_sections_town,						// City Airport (large)
  1509 	_airport_sections_town,           // City Airport (large)
  1510 	_airport_sections_heliport,				// Heliport
  1510 	_airport_sections_heliport,       // Heliport
  1511 	_airport_sections_metropolitan,   // Metropolitain Airport (large)
  1511 	_airport_sections_metropolitan,   // Metropolitain Airport (large)
  1512 	_airport_sections_international,	// International Airport (xlarge)
  1512 	_airport_sections_international,  // International Airport (xlarge)
  1513 };
  1513 };
  1514 
  1514 
  1515 /** Place an Airport.
  1515 /** Place an Airport.
  1516  * @param tile tile where airport will be built
  1516  * @param tile tile where airport will be built
  1517  * @param p1 airport type, @see airport.h
  1517  * @param p1 airport type, @see airport.h
  2067 	// FIXME -- GetTileTrackStatus_Station -> animated stationtiles
  2067 	// FIXME -- GetTileTrackStatus_Station -> animated stationtiles
  2068 	// hardcoded.....not good
  2068 	// hardcoded.....not good
  2069 	switch (GetStationGfx(tile)) {
  2069 	switch (GetStationGfx(tile)) {
  2070 		case GFX_RADAR_LARGE_FIRST:
  2070 		case GFX_RADAR_LARGE_FIRST:
  2071 		case GFX_WINDSACK_FIRST : // for small airport
  2071 		case GFX_WINDSACK_FIRST : // for small airport
  2072 		case GFX_RADAR_INTERNATIONAL_FIRST: // radar international airport
  2072 		case GFX_RADAR_INTERNATIONAL_FIRST:
  2073 		case GFX_RADAR_METROPOLITAN_FIRST: // radar metropolitan airport
  2073 		case GFX_RADAR_METROPOLITAN_FIRST:
  2074 			AddAnimatedTile(tile);
  2074 			AddAnimatedTile(tile);
  2075 			break;
  2075 			break;
  2076 
  2076 
  2077 		case GFX_OILRIG_BASE: //(station part)
  2077 		case GFX_OILRIG_BASE: //(station part)
  2078 		case GFX_BUOY_BASE:
  2078 		case GFX_BUOY_BASE:
  2741 	_global_station_sort_dirty = true; // load of savegame
  2741 	_global_station_sort_dirty = true; // load of savegame
  2742 }
  2742 }
  2743 
  2743 
  2744 
  2744 
  2745 const TileTypeProcs _tile_type_station_procs = {
  2745 const TileTypeProcs _tile_type_station_procs = {
  2746 	DrawTile_Station,						/* draw_tile_proc */
  2746 	DrawTile_Station,           /* draw_tile_proc */
  2747 	GetSlopeZ_Station,					/* get_slope_z_proc */
  2747 	GetSlopeZ_Station,          /* get_slope_z_proc */
  2748 	ClearTile_Station,					/* clear_tile_proc */
  2748 	ClearTile_Station,          /* clear_tile_proc */
  2749 	GetAcceptedCargo_Station,		/* get_accepted_cargo_proc */
  2749 	GetAcceptedCargo_Station,   /* get_accepted_cargo_proc */
  2750 	GetTileDesc_Station,				/* get_tile_desc_proc */
  2750 	GetTileDesc_Station,        /* get_tile_desc_proc */
  2751 	GetTileTrackStatus_Station,	/* get_tile_track_status_proc */
  2751 	GetTileTrackStatus_Station, /* get_tile_track_status_proc */
  2752 	ClickTile_Station,					/* click_tile_proc */
  2752 	ClickTile_Station,          /* click_tile_proc */
  2753 	AnimateTile_Station,				/* animate_tile_proc */
  2753 	AnimateTile_Station,        /* animate_tile_proc */
  2754 	TileLoop_Station,						/* tile_loop_clear */
  2754 	TileLoop_Station,           /* tile_loop_clear */
  2755 	ChangeTileOwner_Station,		/* change_tile_owner_clear */
  2755 	ChangeTileOwner_Station,    /* change_tile_owner_clear */
  2756 	NULL,												/* get_produced_cargo_proc */
  2756 	NULL,                       /* get_produced_cargo_proc */
  2757 	VehicleEnter_Station,				/* vehicle_enter_tile_proc */
  2757 	VehicleEnter_Station,       /* vehicle_enter_tile_proc */
  2758 	NULL,												/* vehicle_leave_tile_proc */
  2758 	NULL,                       /* vehicle_leave_tile_proc */
  2759 	GetSlopeTileh_Station,			/* get_slope_tileh_proc */
  2759 	GetSlopeTileh_Station,      /* get_slope_tileh_proc */
  2760 };
  2760 };
  2761 
  2761 
  2762 static const SaveLoad _roadstop_desc[] = {
  2762 static const SaveLoad _roadstop_desc[] = {
  2763 	SLE_VAR(RoadStop,xy,           SLE_UINT32),
  2763 	SLE_VAR(RoadStop,xy,           SLE_UINT32),
  2764 	SLE_VAR(RoadStop,used,         SLE_UINT8),
  2764 	SLE_VAR(RoadStop,used,         SLE_UINT8),
  2776 
  2776 
  2777 	SLE_END()
  2777 	SLE_END()
  2778 };
  2778 };
  2779 
  2779 
  2780 static const SaveLoad _station_desc[] = {
  2780 static const SaveLoad _station_desc[] = {
  2781 	SLE_CONDVAR(Station, xy,           SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2781 	SLE_CONDVAR(Station, xy,                  SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2782 	SLE_CONDVAR(Station, xy,           SLE_UINT32, 6, SL_MAX_VERSION),
  2782 	SLE_CONDVAR(Station, xy,                  SLE_UINT32, 6, SL_MAX_VERSION),
  2783 	SLE_CONDVAR(Station, bus_tile_obsolete,    SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2783 	SLE_CONDVAR(Station, bus_tile_obsolete,   SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2784 	SLE_CONDVAR(Station, lorry_tile_obsolete,  SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2784 	SLE_CONDVAR(Station, lorry_tile_obsolete, SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2785 	SLE_CONDVAR(Station, train_tile,   SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2785 	SLE_CONDVAR(Station, train_tile,          SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2786 	SLE_CONDVAR(Station, train_tile,   SLE_UINT32, 6, SL_MAX_VERSION),
  2786 	SLE_CONDVAR(Station, train_tile,          SLE_UINT32, 6, SL_MAX_VERSION),
  2787 	SLE_CONDVAR(Station, airport_tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2787 	SLE_CONDVAR(Station, airport_tile,        SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2788 	SLE_CONDVAR(Station, airport_tile, SLE_UINT32, 6, SL_MAX_VERSION),
  2788 	SLE_CONDVAR(Station, airport_tile,        SLE_UINT32, 6, SL_MAX_VERSION),
  2789 	SLE_CONDVAR(Station, dock_tile,    SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2789 	SLE_CONDVAR(Station, dock_tile,           SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2790 	SLE_CONDVAR(Station, dock_tile,    SLE_UINT32, 6, SL_MAX_VERSION),
  2790 	SLE_CONDVAR(Station, dock_tile,           SLE_UINT32, 6, SL_MAX_VERSION),
  2791 	SLE_REF(Station,town,						REF_TOWN),
  2791 	SLE_REF(Station,     town,                REF_TOWN),
  2792 	SLE_VAR(Station,trainst_w,			SLE_UINT8),
  2792 	SLE_VAR(Station,     trainst_w,           SLE_UINT8),
  2793 	SLE_CONDVAR(Station,trainst_h,	SLE_UINT8, 2, SL_MAX_VERSION),
  2793 	SLE_CONDVAR(Station, trainst_h,           SLE_UINT8,  2, SL_MAX_VERSION),
  2794 
  2794 
  2795 	// alpha_order was stored here in savegame format 0 - 3
  2795 	// alpha_order was stored here in savegame format 0 - 3
  2796 	SLE_CONDNULL(1, 0, 3),
  2796 	SLE_CONDNULL(1, 0, 3),
  2797 
  2797 
  2798 	SLE_VAR(Station,string_id,			SLE_STRINGID),
  2798 	SLE_VAR(Station,string_id,          SLE_STRINGID),
  2799 	SLE_VAR(Station,had_vehicle_of_type,SLE_UINT16),
  2799 	SLE_VAR(Station,had_vehicle_of_type,SLE_UINT16),
  2800 
  2800 
  2801 	SLE_VAR(Station,time_since_load,		SLE_UINT8),
  2801 	SLE_VAR(Station,time_since_load,    SLE_UINT8),
  2802 	SLE_VAR(Station,time_since_unload,	SLE_UINT8),
  2802 	SLE_VAR(Station,time_since_unload,  SLE_UINT8),
  2803 	SLE_VAR(Station,delete_ctr,					SLE_UINT8),
  2803 	SLE_VAR(Station,delete_ctr,         SLE_UINT8),
  2804 	SLE_VAR(Station,owner,							SLE_UINT8),
  2804 	SLE_VAR(Station,owner,              SLE_UINT8),
  2805 	SLE_VAR(Station,facilities,					SLE_UINT8),
  2805 	SLE_VAR(Station,facilities,         SLE_UINT8),
  2806 	SLE_VAR(Station,airport_type,				SLE_UINT8),
  2806 	SLE_VAR(Station,airport_type,       SLE_UINT8),
  2807 
  2807 
  2808 	// truck/bus_stop_status was stored here in savegame format 0 - 6
  2808 	// truck/bus_stop_status was stored here in savegame format 0 - 6
  2809 	SLE_CONDVAR(Station,truck_stop_status_obsolete,	SLE_UINT8, 0, 5),
  2809 	SLE_CONDVAR(Station,truck_stop_status_obsolete, SLE_UINT8, 0, 5),
  2810 	SLE_CONDVAR(Station,bus_stop_status_obsolete,		SLE_UINT8, 0, 5),
  2810 	SLE_CONDVAR(Station,bus_stop_status_obsolete,   SLE_UINT8, 0, 5),
  2811 
  2811 
  2812 	// blocked_months was stored here in savegame format 0 - 4.0
  2812 	// blocked_months was stored here in savegame format 0 - 4.0
  2813 	SLE_CONDVAR(Station,blocked_months_obsolete,	SLE_UINT8, 0, 4),
  2813 	SLE_CONDVAR(Station,blocked_months_obsolete,    SLE_UINT8, 0, 4),
  2814 
  2814 
  2815 	SLE_CONDVAR(Station,airport_flags,			SLE_VAR_U32 | SLE_FILE_U16, 0, 2),
  2815 	SLE_CONDVAR(Station,airport_flags,     SLE_VAR_U32 | SLE_FILE_U16, 0, 2),
  2816 	SLE_CONDVAR(Station,airport_flags,			SLE_UINT32, 3, SL_MAX_VERSION),
  2816 	SLE_CONDVAR(Station,airport_flags,     SLE_UINT32, 3, SL_MAX_VERSION),
  2817 
  2817 
  2818 	SLE_VAR(Station,last_vehicle,				SLE_UINT16),
  2818 	SLE_VAR(Station,last_vehicle,          SLE_UINT16),
  2819 
  2819 
  2820 	SLE_CONDVAR(Station,class_id,				SLE_UINT8, 3, SL_MAX_VERSION),
  2820 	SLE_CONDVAR(Station,class_id,          SLE_UINT8, 3, SL_MAX_VERSION),
  2821 	SLE_CONDVAR(Station,stat_id,				SLE_UINT8, 3, SL_MAX_VERSION),
  2821 	SLE_CONDVAR(Station,stat_id,           SLE_UINT8, 3, SL_MAX_VERSION),
  2822 	SLE_CONDVAR(Station,build_date,			SLE_UINT16, 3, SL_MAX_VERSION),
  2822 	SLE_CONDVAR(Station,build_date,        SLE_UINT16, 3, SL_MAX_VERSION),
  2823 
  2823 
  2824 	SLE_CONDREF(Station,bus_stops,					REF_ROADSTOPS, 6, SL_MAX_VERSION),
  2824 	SLE_CONDREF(Station,bus_stops,         REF_ROADSTOPS, 6, SL_MAX_VERSION),
  2825 	SLE_CONDREF(Station,truck_stops,				REF_ROADSTOPS, 6, SL_MAX_VERSION),
  2825 	SLE_CONDREF(Station,truck_stops,       REF_ROADSTOPS, 6, SL_MAX_VERSION),
  2826 
  2826 
  2827 	// reserve extra space in savegame here. (currently 32 bytes)
  2827 	// reserve extra space in savegame here. (currently 32 bytes)
  2828 	SLE_CONDNULL(32, 2, SL_MAX_VERSION),
  2828 	SLE_CONDNULL(32, 2, SL_MAX_VERSION),
  2829 
  2829 
  2830 	SLE_END()
  2830 	SLE_END()
  2831 };
  2831 };
  2832 
  2832 
  2833 static const SaveLoad _goods_desc[] = {
  2833 static const SaveLoad _goods_desc[] = {
  2834 	SLE_VAR(GoodsEntry,waiting_acceptance,SLE_UINT16),
  2834 	SLE_VAR(GoodsEntry,waiting_acceptance, SLE_UINT16),
  2835 	SLE_VAR(GoodsEntry,days_since_pickup,	SLE_UINT8),
  2835 	SLE_VAR(GoodsEntry,days_since_pickup,  SLE_UINT8),
  2836 	SLE_VAR(GoodsEntry,rating,						SLE_UINT8),
  2836 	SLE_VAR(GoodsEntry,rating,             SLE_UINT8),
  2837 	SLE_CONDVAR(GoodsEntry,enroute_from,			SLE_FILE_U8 | SLE_VAR_U16, 0, 6),
  2837 	SLE_CONDVAR(GoodsEntry,enroute_from,   SLE_FILE_U8 | SLE_VAR_U16, 0, 6),
  2838 	SLE_CONDVAR(GoodsEntry,enroute_from,			SLE_UINT16, 7, SL_MAX_VERSION),
  2838 	SLE_CONDVAR(GoodsEntry,enroute_from,   SLE_UINT16, 7, SL_MAX_VERSION),
  2839 	SLE_VAR(GoodsEntry,enroute_time,			SLE_UINT8),
  2839 	SLE_VAR(GoodsEntry,enroute_time,       SLE_UINT8),
  2840 	SLE_VAR(GoodsEntry,last_speed,				SLE_UINT8),
  2840 	SLE_VAR(GoodsEntry,last_speed,         SLE_UINT8),
  2841 	SLE_VAR(GoodsEntry,last_age,					SLE_UINT8),
  2841 	SLE_VAR(GoodsEntry,last_age,           SLE_UINT8),
  2842 	SLE_CONDVAR(GoodsEntry,feeder_profit,			SLE_INT32, 14, SL_MAX_VERSION),
  2842 	SLE_CONDVAR(GoodsEntry,feeder_profit,  SLE_INT32, 14, SL_MAX_VERSION),
  2843 
  2843 
  2844 	SLE_END()
  2844 	SLE_END()
  2845 };
  2845 };
  2846 
  2846 
  2847 
  2847