src/industry_cmd.cpp
branchNewGRF_ports
changeset 10184 fcf5fb2548eb
parent 6878 7d1ff2f621c7
child 10242 52b4a9006029
--- a/src/industry_cmd.cpp	Mon Apr 14 20:32:36 2008 +0000
+++ b/src/industry_cmd.cpp	Tue Apr 15 00:47:19 2008 +0000
@@ -13,7 +13,7 @@
 #include "command_func.h"
 #include "industry.h"
 #include "town.h"
-#include "news.h"
+#include "news_func.h"
 #include "saveload.h"
 #include "variables.h"
 #include "genworld.h"
@@ -36,6 +36,8 @@
 #include "date_func.h"
 #include "vehicle_func.h"
 #include "sound_func.h"
+#include "station_base.h"
+#include "oldpool_func.h"
 
 #include "table/strings.h"
 #include "table/sprites.h"
@@ -302,6 +304,9 @@
 
 	DrawGroundSprite(image, pal);
 
+	/* If industries are transparent and invisible, do not draw the upper part */
+	if (IsInvisibilitySet(TO_INDUSTRIES)) return;
+
 	/* Add industry on top of the ground? */
 	image = dits->building.sprite;
 	if (image != 0) {
@@ -1641,7 +1646,7 @@
 							SetDParam(1, ind->town->index);
 						}
 						AddNewsItem(indspec->new_industry_text,
-								NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_TILE, NT_OPENCLOSE, 0), ind->xy, 0);
+								NM_THIN, NF_VIEWPORT | NF_TILE, NT_OPENCLOSE, DNC_NONE, ind->xy, 0);
 						break;
 					}
 				}
@@ -1860,7 +1865,7 @@
 		SetDParam(1, ind->town->index);
 	}
 	AddNewsItem(ind_spc->new_industry_text,
-		NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_TILE, NT_OPENCLOSE, 0), ind->xy, 0);
+		NM_THIN, NF_VIEWPORT | NF_TILE, NT_OPENCLOSE, DNC_NONE, ind->xy, 0);
 }
 
 /**
@@ -1963,13 +1968,13 @@
 		 */
 		const Order *o;
 		FOR_VEHICLE_ORDERS(v, o) {
-			if (o->type == OT_GOTO_STATION && !HasBit(o->flags, OF_TRANSFER)) {
+			if (o->IsType(OT_GOTO_STATION) && !(o->GetUnloadType() & OUFB_TRANSFER)) {
 				/* Vehicle visits a station to load or unload */
-				Station *st = GetStation(o->dest);
+				Station *st = GetStation(o->GetDestination());
 				if (!st->IsValid()) continue;
 
 				/* Same cargo produced by industry is dropped here => not serviced by vehicle v */
-				if (HasBit(o->flags, OF_UNLOAD) && !c_accepts) break;
+				if ((o->GetUnloadType() & OUFB_UNLOAD) && !c_accepts) break;
 
 				if (stations.find(st) != stations.end()) {
 					if (v->owner == _local_player) return 2; // Player services industry
@@ -2003,7 +2008,7 @@
 	SetDParam(1, ind->index);
 	AddNewsItem(
 		percent >= 0 ? STR_INDUSTRY_PROD_GOUP : STR_INDUSTRY_PROD_GODOWN,
-		NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_TILE, nt, 0),
+		NM_THIN, NF_VIEWPORT | NF_TILE, nt, DNC_NONE,
 		ind->xy + TileDiffXY(1, 1), 0
 	);
 }
@@ -2196,7 +2201,7 @@
 		}
 		/* and report the news to the user */
 		AddNewsItem(str,
-			NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_TILE, nt, 0),
+			NM_THIN, NF_VIEWPORT | NF_TILE, nt, DNC_NONE,
 			i->xy + TileDiffXY(1, 1), 0);
 	}
 }