vehicle_gui.c
changeset 2477 225b2916fe2a
parent 2466 1aa260b43faa
child 2519 beb11a5ac48c
equal deleted inserted replaced
2476:e6199b3fb582 2477:225b2916fe2a
   415  *	if used compined with show_cars set to false, it will work as intended. Replace window do it like that
   415  *	if used compined with show_cars set to false, it will work as intended. Replace window do it like that
   416  *  this was a big hack even before show_outdated was added. Stupid newgrf :p										*/
   416  *  this was a big hack even before show_outdated was added. Stupid newgrf :p										*/
   417 static void train_engine_drawing_loop(int *x, int *y, int *pos, int *sel, int *selected_id, byte railtype,
   417 static void train_engine_drawing_loop(int *x, int *y, int *pos, int *sel, int *selected_id, byte railtype,
   418 	uint8 lines_drawn, bool is_engine, bool show_cars, bool show_outdated)
   418 	uint8 lines_drawn, bool is_engine, bool show_cars, bool show_outdated)
   419 {
   419 {
   420 	int i;
   420 	EngineID i;
   421 	byte colour;
   421 	byte colour;
   422 
   422 
   423 	for (i = 0; i < NUM_TRAIN_ENGINES; i++) {
   423 	for (i = 0; i < NUM_TRAIN_ENGINES; i++) {
   424 		const Engine *e = GetEngine(i);
   424 		const Engine *e = GetEngine(i);
   425 		const RailVehicleInfo *rvi = RailVehInfo(i);
   425 		const RailVehicleInfo *rvi = RailVehInfo(i);
   465 	byte railtype;
   465 	byte railtype;
   466 	int selected_id[2] = {-1,-1};
   466 	int selected_id[2] = {-1,-1};
   467 	int sel[2];
   467 	int sel[2];
   468 	int count = 0;
   468 	int count = 0;
   469 	int count2 = 0;
   469 	int count2 = 0;
   470 	int engine_id;
   470 	EngineID engine_id;
   471 
   471 
   472 	sel[0] = WP(w,replaceveh_d).sel_index[0];
   472 	sel[0] = WP(w,replaceveh_d).sel_index[0];
   473 	sel[1] = WP(w,replaceveh_d).sel_index[1];
   473 	sel[1] = WP(w,replaceveh_d).sel_index[1];
   474 
   474 
   475 	switch (WP(w,replaceveh_d).vehicletype) {
   475 	switch (WP(w,replaceveh_d).vehicletype) {
   641 		}
   641 		}
   642 
   642 
   643 		case VEH_Road: {
   643 		case VEH_Road: {
   644 			int num = NUM_ROAD_ENGINES;
   644 			int num = NUM_ROAD_ENGINES;
   645 			Engine *e = GetEngine(ROAD_ENGINES_INDEX);
   645 			Engine *e = GetEngine(ROAD_ENGINES_INDEX);
   646 			int engine_id = ROAD_ENGINES_INDEX;
   646 			EngineID engine_id = ROAD_ENGINES_INDEX;
   647 			byte cargo;
   647 			byte cargo;
   648 			EngineInfo *info;
   648 			EngineInfo *info;
   649 
   649 
   650 			if ( selected_id[0] >= ROAD_ENGINES_INDEX && selected_id[0] <= SHIP_ENGINES_INDEX ) {
   650 			if ( selected_id[0] >= ROAD_ENGINES_INDEX && selected_id[0] <= SHIP_ENGINES_INDEX ) {
   651 				cargo = RoadVehInfo(selected_id[0])->cargo_type;
   651 				cargo = RoadVehInfo(selected_id[0])->cargo_type;
   677 		}
   677 		}
   678 
   678 
   679 		case VEH_Ship: {
   679 		case VEH_Ship: {
   680 			int num = NUM_SHIP_ENGINES;
   680 			int num = NUM_SHIP_ENGINES;
   681 			Engine *e = GetEngine(SHIP_ENGINES_INDEX);
   681 			Engine *e = GetEngine(SHIP_ENGINES_INDEX);
   682 			int engine_id = SHIP_ENGINES_INDEX;
   682 			EngineID engine_id = SHIP_ENGINES_INDEX;
   683 			byte cargo, refittable;
   683 			byte cargo, refittable;
   684 			EngineInfo *info;
   684 			EngineInfo *info;
   685 
   685 
   686 			if ( selected_id[0] != -1 ) {
   686 			if ( selected_id[0] != -1 ) {
   687 				cargo = ShipVehInfo(selected_id[0])->cargo_type;
   687 				cargo = ShipVehInfo(selected_id[0])->cargo_type;
   716 
   716 
   717 		case VEH_Aircraft: {
   717 		case VEH_Aircraft: {
   718 			if ( selected_id[0] != -1 ) {
   718 			if ( selected_id[0] != -1 ) {
   719 				int num = NUM_AIRCRAFT_ENGINES;
   719 				int num = NUM_AIRCRAFT_ENGINES;
   720 				Engine *e = GetEngine(AIRCRAFT_ENGINES_INDEX);
   720 				Engine *e = GetEngine(AIRCRAFT_ENGINES_INDEX);
   721 				int engine_id = AIRCRAFT_ENGINES_INDEX;
   721 				EngineID engine_id = AIRCRAFT_ENGINES_INDEX;
   722 				byte subtype = AircraftVehInfo(selected_id[0])->subtype;
   722 				byte subtype = AircraftVehInfo(selected_id[0])->subtype;
   723 				EngineInfo *info;
   723 				EngineInfo *info;
   724 
   724 
   725 				do {
   725 				do {
   726 					info = &_engine_info[engine_id];
   726 					info = &_engine_info[engine_id];