diff options
author | rubidium <rubidium@openttd.org> | 2008-05-15 13:39:36 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-05-15 13:39:36 +0000 |
commit | 76b8970a33a9dfad23fe14d92813f21385594986 (patch) | |
tree | dbf82a81f389a63eb11a06152870ba44cc07d456 /src/industry_cmd.cpp | |
parent | 009a748ab33a77613aad7d269a79eb74a3be5080 (diff) | |
download | openttd-76b8970a33a9dfad23fe14d92813f21385594986.tar.xz |
(svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r-- | src/industry_cmd.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index ea233a230..66f7c840b 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1651,7 +1651,7 @@ CommandCost CmdBuildIndustry(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) SetDParam(1, ind->town->index); } AddNewsItem(indspec->new_industry_text, - NM_THIN, NF_VIEWPORT | NF_TILE, NT_OPENCLOSE, DNC_NONE, ind->xy, 0); + NS_OPENCLOSE, ind->xy, 0); break; } } @@ -1870,7 +1870,7 @@ static void MaybeNewIndustry(void) SetDParam(1, ind->town->index); } AddNewsItem(ind_spc->new_industry_text, - NM_THIN, NF_VIEWPORT | NF_TILE, NT_OPENCLOSE, DNC_NONE, ind->xy, 0); + NS_OPENCLOSE, ind->xy, 0); } /** @@ -2002,12 +2002,12 @@ int WhoCanServiceIndustry(Industry* ind) */ static void ReportNewsProductionChangeIndustry(Industry *ind, CargoID type, int percent) { - NewsType nt; + NewsSubtype ns; switch (WhoCanServiceIndustry(ind)) { - case 0: nt = NT_INDUSTRY_NOBODY; break; - case 1: nt = NT_INDUSTRY_OTHER; break; - case 2: nt = NT_INDUSTRY_PLAYER; break; + case 0: ns = NS_INDUSTRY_NOBODY; break; + case 1: ns = NS_INDUSTRY_OTHER; break; + case 2: ns = NS_INDUSTRY_PLAYER; break; default: NOT_REACHED(); break; } SetDParam(2, abs(percent)); @@ -2015,7 +2015,7 @@ static void ReportNewsProductionChangeIndustry(Industry *ind, CargoID type, int SetDParam(1, ind->index); AddNewsItem( percent >= 0 ? STR_INDUSTRY_PROD_GOUP : STR_INDUSTRY_PROD_GODOWN, - NM_THIN, NF_VIEWPORT | NF_TILE, nt, DNC_NONE, + ns, ind->xy + TileDiffXY(1, 1), 0 ); } @@ -2183,15 +2183,15 @@ static void ChangeIndustryProduction(Industry *i, bool monthly) } if (!suppress_message && str != STR_NULL) { - NewsType nt; + NewsSubtype ns; /* Compute news category */ if (closeit) { - nt = NT_OPENCLOSE; + ns = NS_OPENCLOSE; } else { switch (WhoCanServiceIndustry(i)) { - case 0: nt = NT_INDUSTRY_NOBODY; break; - case 1: nt = NT_INDUSTRY_OTHER; break; - case 2: nt = NT_INDUSTRY_PLAYER; break; + case 0: ns = NS_INDUSTRY_NOBODY; break; + case 1: ns = NS_INDUSTRY_OTHER; break; + case 2: ns = NS_INDUSTRY_PLAYER; break; default: NOT_REACHED(); break; } } @@ -2209,7 +2209,7 @@ static void ChangeIndustryProduction(Industry *i, bool monthly) } /* and report the news to the user */ AddNewsItem(str, - NM_THIN, NF_VIEWPORT | NF_TILE, nt, DNC_NONE, + ns, i->xy + TileDiffXY(1, 1), 0); } } |