(svn r8773) [cpp_gui] -Sync with trunk (r8768..r8772) - needed r8772 cpp_gui
authorKUDr
Sat, 17 Feb 2007 13:01:45 +0000
branchcpp_gui
changeset 6255 7215bc7cb877
parent 6254 abc6ad7c035c
child 6256 220cd0db67a4
(svn r8773) [cpp_gui] -Sync with trunk (r8768..r8772) - needed r8772
projects/generate
src/build_vehicle_gui.cpp
src/depot_gui.cpp
--- a/projects/generate	Sat Feb 17 11:12:50 2007 +0000
+++ b/projects/generate	Sat Feb 17 13:01:45 2007 +0000
@@ -53,6 +53,8 @@
 
 			if ($0 == "SDL"         && "'$sdl_config'" == "")          { next; }
 			if ($0 == "OSX"         && "'$os'" != "OSX")               { next; }
+			if ($0 == "OS2"         && "'$os'" != "OS2")               { next; }
+			if ($0 == "PSP"         && "'$os'" != "PSP")               { next; }
 			if ($0 == "DEDICATED"   && "'$enable_dedicated'" != "1")   { next; }
 			if ($0 == "COCOA"       && "'$with_cocoa'" == "0")         { next; }
 			if ($0 == "BEOS"        && "'$os'" != "BEOS")              { next; }
@@ -61,6 +63,7 @@
 			if ($0 == "WINCE"       && "'$os'" != "WINCE")             { next; }
 			if ($0 == "MSVC"        && "'$os'" != "MSVC")              { next; }
 			if ($0 == "DIRECTMUSIC" && "'$enable_directmusic'" != "1") { next; }
+			if ($0 == "LIBTIMIDITY" && "'$libtimidity'" == "" )        { next; }
 
 			skip += 1;
 
--- a/src/build_vehicle_gui.cpp	Sat Feb 17 11:12:50 2007 +0000
+++ b/src/build_vehicle_gui.cpp	Sat Feb 17 13:01:45 2007 +0000
@@ -692,6 +692,24 @@
 	sel_id = INVALID_ENGINE;
 	for (eid = AIRCRAFT_ENGINES_INDEX; eid < AIRCRAFT_ENGINES_INDEX + NUM_AIRCRAFT_ENGINES; eid++) {
 		if (IsEngineBuildable(eid, VEH_Aircraft, _local_player)) {
+			const AircraftVehicleInfo *avi = AircraftVehInfo(eid);
+			switch (bv->filter.flags & ~AirportFTAClass::SHORT_STRIP /* we don't care about the length of the runway here */) {
+				case AirportFTAClass::HELICOPTERS:
+					if (avi->subtype != AIR_HELICOPTER) continue;
+					break;
+
+				case AirportFTAClass::AIRPLANES:
+					if (avi->subtype != AIR_AIRCRAFT) continue;
+					break;
+
+				case AirportFTAClass::ALL: break;
+				default:
+					NOT_REACHED();
+			}
+
+			if (bv->filter.flags & AirportFTAClass::SHORT_STRIP &&
+				avi->subtype & AIR_FAST && !_cheats.no_jetcrash.value) continue; // don't build large aircraft in small airports
+
 			EngList_Add(&bv->eng_list, eid);
 
 			if (eid == bv->sel_engine) sel_id = eid;
--- a/src/depot_gui.cpp	Sat Feb 17 11:12:50 2007 +0000
+++ b/src/depot_gui.cpp	Sat Feb 17 13:01:45 2007 +0000
@@ -185,8 +185,9 @@
 		case VEH_Ship:     DrawShipImage(    v, x + 19, sprite_y - 1, WP(w, depot_d).sel); break;
 		case VEH_Aircraft: {
 			const Sprite *spr = GetSprite(GetAircraftImage(v, DIR_W));
-			int diff_y = spr->y_offs + spr->height - 12;
-			DrawAircraftImage(v, x + 12, y + diff_y, WP(w, depot_d).sel);
+			DrawAircraftImage(v, x + 12,
+							  y + max(spr->height + spr->y_offs - 14, 0), // tall sprites needs an y offset
+							  WP(w, depot_d).sel);
 		} break;
 		default: NOT_REACHED();
 	}