summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2004-11-21 10:49:40 +0000
committertron <tron@openttd.org>2004-11-21 10:49:40 +0000
commit57adc97733fc0cc226f7d8f71c7e6b62dab690e0 (patch)
tree3fa8e5167fbe6804668a83cddbd662bdb0e8de2c
parent75d002690ac43c3a1c9bdbd16ca0eb48c9a2c50e (diff)
downloadopenttd-57adc97733fc0cc226f7d8f71c7e6b62dab690e0.tar.xz
(svn r724) Remove restriction that a tile can only accept 3 cargo types.
This especially enables houses to accept passengers, mail, goods AND food. Add string templates for up to 5 cargo types for the tile info window. If more are needed just add them. Simplify (de-uglify) the logic for cargo acceptence for houses and split the goods/food table into two. The acceptance is unmodified, but accepting goods AND food is now trivially possible. The exact amounts have to be decided. This is based on Celestar's changes in the map branch plus some further bits that will be merged there soon.
-rw-r--r--clear_cmd.c2
-rw-r--r--dummy_land.c2
-rw-r--r--functions.h2
-rw-r--r--industry_cmd.c17
-rw-r--r--landscape.c2
-rw-r--r--lang/american.txt2
-rw-r--r--lang/catalan.txt2
-rw-r--r--lang/czech.txt2
-rw-r--r--lang/danish.txt2
-rw-r--r--lang/dutch.txt2
-rw-r--r--lang/english.txt2
-rw-r--r--lang/finnish.txt2
-rw-r--r--lang/french.txt2
-rw-r--r--lang/galician.txt2
-rw-r--r--lang/german.txt2
-rw-r--r--lang/hungarian.txt2
-rw-r--r--lang/icelandic.txt2
-rw-r--r--lang/italian.txt2
-rw-r--r--lang/norwegian.txt2
-rw-r--r--lang/polish.txt2
-rw-r--r--lang/portuguese.txt2
-rw-r--r--lang/romanian.txt2
-rw-r--r--lang/slovak.txt2
-rw-r--r--lang/spanish.txt2
-rw-r--r--lang/swedish.txt2
-rw-r--r--misc_gui.c46
-rw-r--r--rail_cmd.c2
-rw-r--r--road_cmd.c2
-rw-r--r--station_cmd.c15
-rw-r--r--table/town_land.h35
-rw-r--r--town_cmd.c18
-rw-r--r--tree_cmd.c2
-rw-r--r--ttd.h88
-rw-r--r--tunnelbridge_cmd.c2
-rw-r--r--unmovable_cmd.c10
-rw-r--r--water_cmd.c2
36 files changed, 152 insertions, 135 deletions
diff --git a/clear_cmd.c b/clear_cmd.c
index d4be4d66e..0c7fb2be7 100644
--- a/clear_cmd.c
+++ b/clear_cmd.c
@@ -523,7 +523,7 @@ uint GetSlopeTileh_Clear(TileInfo *ti)
return ti->tileh;
}
-static void GetAcceptedCargo_Clear(uint tile, AcceptedCargo *ac)
+static void GetAcceptedCargo_Clear(uint tile, AcceptedCargo ac)
{
/* unused */
}
diff --git a/dummy_land.c b/dummy_land.c
index 0b0f4333f..a5e8f0a1b 100644
--- a/dummy_land.c
+++ b/dummy_land.c
@@ -22,7 +22,7 @@ static int32 ClearTile_Dummy(uint tile, byte flags) {
}
-static void GetAcceptedCargo_Dummy(uint tile, AcceptedCargo *ac)
+static void GetAcceptedCargo_Dummy(uint tile, AcceptedCargo ac)
{
/* not used */
}
diff --git a/functions.h b/functions.h
index 47ef642aa..a78b1f7ed 100644
--- a/functions.h
+++ b/functions.h
@@ -23,7 +23,7 @@ void RunTileLoop();
uint GetPartialZ(int x, int y, int corners);
uint GetSlopeZ(int x, int y);
uint32 GetTileTrackStatus(uint tile, TransportType mode);
-void GetAcceptedCargo(uint tile, AcceptedCargo *ac);
+void GetAcceptedCargo(uint tile, AcceptedCargo ac);
void ChangeTileOwner(uint tile, byte old_player, byte new_player);
void AnimateTile(uint tile);
void ClickTile(uint tile);
diff --git a/industry_cmd.c b/industry_cmd.c
index 12b2aec00..81ef17810 100644
--- a/industry_cmd.c
+++ b/industry_cmd.c
@@ -339,28 +339,19 @@ static uint GetSlopeTileh_Industry(TileInfo *ti) {
return 0;
}
-static void GetAcceptedCargo_Industry(uint tile, AcceptedCargo *ac)
+static void GetAcceptedCargo_Industry(uint tile, AcceptedCargo ac)
{
int m5 = _map5[tile];
int a;
a = _industry_map5_accepts_1[m5];
- if (a >= 0) {
- ac->type_1 = a;
- ac->amount_1 = (a == 0) ? 1 : 8;
- }
+ if (a >= 0) ac[a] = (a == 0) ? 1 : 8;
a = _industry_map5_accepts_2[m5];
- if (a >= 0) {
- ac->type_2 = a;
- ac->amount_2 = 8;
- }
+ if (a >= 0) ac[a] = 8;
a = _industry_map5_accepts_3[m5];
- if (a >= 0) {
- ac->type_3 = a;
- ac->amount_3 = 8;
- }
+ if (a >= 0) ac[a] = 8;
}
static void GetTileDesc_Industry(uint tile, TileDesc *td)
diff --git a/landscape.c b/landscape.c
index d93be1ebe..5126115a2 100644
--- a/landscape.c
+++ b/landscape.c
@@ -311,7 +311,7 @@ void ChangeTileOwner(uint tile, byte old_player, byte new_player)
_tile_type_procs[GET_TILETYPE(tile)]->change_tile_owner_proc(tile, old_player, new_player);
}
-void GetAcceptedCargo(uint tile, AcceptedCargo *ac)
+void GetAcceptedCargo(uint tile, AcceptedCargo ac)
{
memset(ac, 0, sizeof(AcceptedCargo));
_tile_type_procs[GET_TILETYPE(tile)]->get_accepted_cargo_proc(tile, ac);
diff --git a/lang/american.txt b/lang/american.txt
index 55032a9bf..3f7c39913 100644
--- a/lang/american.txt
+++ b/lang/american.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Select Tutorial/Demonstration
STR_01CE_CARGO_ACCEPTED :{BLACK}Cargo accepted: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Cargo accepted: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Cargo accepted: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Cargo accepted: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Cargo accepted: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/catalan.txt b/lang/catalan.txt
index ed5c52ae7..c7538b945 100644
--- a/lang/catalan.txt
+++ b/lang/catalan.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Seleccionar Tutorial/Demostrac
STR_01CE_CARGO_ACCEPTED :{BLACK}Cŕrrega acceptada: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Cŕrrega acceptada: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Cŕrrega acceptada: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Cŕrrega acceptada: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Cŕrrega acceptada: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/czech.txt b/lang/czech.txt
index f5468c187..34eaa2e4b 100644
--- a/lang/czech.txt
+++ b/lang/czech.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Zvolit Tutorial/Ukazka
STR_01CE_CARGO_ACCEPTED :{BLACK}Prijimane zbozi: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Prijimane zbozi: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Prijimane zbozi: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Prijimane zbozi: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Prijimane zbozi: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/danish.txt b/lang/danish.txt
index acd7c70dd..06995cfd2 100644
--- a/lang/danish.txt
+++ b/lang/danish.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Vćlg Tutorial/Demonstration
STR_01CE_CARGO_ACCEPTED :{BLACK}Accepteret last: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Accepteret last: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Accepteret last: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Accepteret last: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Accepteret last: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/dutch.txt b/lang/dutch.txt
index 83b30203f..3680e7616 100644
--- a/lang/dutch.txt
+++ b/lang/dutch.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Kies uitleg/demonstratie
STR_01CE_CARGO_ACCEPTED :{BLACK}Accepteert: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Accepteert: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Accepteert: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Accepteert: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Accepteert: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/english.txt b/lang/english.txt
index 99bf0d2e5..78627b400 100644
--- a/lang/english.txt
+++ b/lang/english.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Select Tutorial/Demonstration
STR_01CE_CARGO_ACCEPTED :{BLACK}Cargo accepted: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Cargo accepted: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Cargo accepted: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Cargo accepted: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Cargo accepted: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/finnish.txt b/lang/finnish.txt
index 5da5499c1..ea78220c6 100644
--- a/lang/finnish.txt
+++ b/lang/finnish.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Valitse pikaohje/esitys
STR_01CE_CARGO_ACCEPTED :{BLACK}Vastaanotettava rahti: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Vastaanotettava rahti: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Vastaanotettava rahti: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Vastaanotettava rahti: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Vastaanotettava rahti: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/french.txt b/lang/french.txt
index 19f09edce..8cb0da5bc 100644
--- a/lang/french.txt
+++ b/lang/french.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Choisir Didacticiel/Démonstrat
STR_01CE_CARGO_ACCEPTED :{BLACK}Cargaison acceptée: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Cargaison acceptée: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Cargaison acceptée: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Cargaison acceptée: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Cargaison acceptée: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/galician.txt b/lang/galician.txt
index 7effc3476..473b8d1d0 100644
--- a/lang/galician.txt
+++ b/lang/galician.txt
@@ -493,6 +493,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Seleccionar Tutorial/Demostrac
STR_01CE_CARGO_ACCEPTED :{BLACK}Carga aceptada: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Carga aceptada: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Carga aceptada: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Carga aceptada: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Carga aceptada: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/german.txt b/lang/german.txt
index 66a6bdfe0..a9d76cd0a 100644
--- a/lang/german.txt
+++ b/lang/german.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Einführung / Demonstration wäh
STR_01CE_CARGO_ACCEPTED :{BLACK}Akzeptierte Fracht: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Akzeptierte Fracht: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Akzeptierte Fracht: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Akzeptierte Fracht: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Akzeptierte Fracht: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/hungarian.txt b/lang/hungarian.txt
index dbf72a9e9..a86a50f81 100644
--- a/lang/hungarian.txt
+++ b/lang/hungarian.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Válassz egy tanítást/demót
STR_01CE_CARGO_ACCEPTED :{BLACK}Elfogad: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Elfogad: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Elfogad: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Elfogad: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Elfogad: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/icelandic.txt b/lang/icelandic.txt
index a5880bffb..1e2f70991 100644
--- a/lang/icelandic.txt
+++ b/lang/icelandic.txt
@@ -492,6 +492,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Velja Leiđbeiningar/Sýnikennsl
STR_01CE_CARGO_ACCEPTED :{BLACK}Tekiđ á móti: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Tekiđ á móti: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Tekiđ á móti: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Tekiđ á móti: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Tekiđ á móti: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/italian.txt b/lang/italian.txt
index 98b0f5234..6577c4e3c 100644
--- a/lang/italian.txt
+++ b/lang/italian.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Seleziona Tutorial/Demonstrazi
STR_01CE_CARGO_ACCEPTED :{BLACK}Merci accettate: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Merci accettate: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Merci accettate: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Merci accettate: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Merci accettate: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/norwegian.txt b/lang/norwegian.txt
index b2f2dc1ad..e7d10411d 100644
--- a/lang/norwegian.txt
+++ b/lang/norwegian.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Velg veiledning/demonstrasjon
STR_01CE_CARGO_ACCEPTED :{BLACK}Akseptert gods: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Akseptert gods: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Akseptert gods: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Akseptert gods: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Akseptert gods: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/polish.txt b/lang/polish.txt
index 719dedca6..232a8f42e 100644
--- a/lang/polish.txt
+++ b/lang/polish.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Wybierz Wprowadzenie/Demo
STR_01CE_CARGO_ACCEPTED :{BLACK}Akceptowany ladunek: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Akceptowany ladunek: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Akceptowany ladunek: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Akceptowany ladunek: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Akceptowany ladunek: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/portuguese.txt b/lang/portuguese.txt
index 059e8bd62..bd8c49e3c 100644
--- a/lang/portuguese.txt
+++ b/lang/portuguese.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Seleccionar Tutorial/Demonstra
STR_01CE_CARGO_ACCEPTED :{BLACK}Carga aceite: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Carga aceite: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Carga aceite: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Carga aceite: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Carga aceite: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/romanian.txt b/lang/romanian.txt
index 4b6b8190b..547033a82 100644
--- a/lang/romanian.txt
+++ b/lang/romanian.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Alege vizionarea unui tutorial
STR_01CE_CARGO_ACCEPTED :{BLACK}Încărcături acceptate: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Încărcături acceptate: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Încărcături acceptate: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Încărcături acceptate: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Încărcături acceptate: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/slovak.txt b/lang/slovak.txt
index 2373a3430..9fe2db713 100644
--- a/lang/slovak.txt
+++ b/lang/slovak.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Vybrat Nacvik / Ukazku
STR_01CE_CARGO_ACCEPTED :{BLACK}Prijma naklad: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Prijma naklad: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Prijma naklad: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Prijma naklad: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Prijma naklad: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/spanish.txt b/lang/spanish.txt
index 283d2b82a..c740a21c2 100644
--- a/lang/spanish.txt
+++ b/lang/spanish.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Seleccionar Tutorial/Demonstra
STR_01CE_CARGO_ACCEPTED :{BLACK}Carga aceptada: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Carga aceptada: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Carga aceptada: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Carga aceptada: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Carga aceptada: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/lang/swedish.txt b/lang/swedish.txt
index 9239ca924..9fa52fee9 100644
--- a/lang/swedish.txt
+++ b/lang/swedish.txt
@@ -495,6 +495,8 @@ STR_01CD_SELECT_TUTORIAL_DEMONSTRATION :{WHITE}Välj Tutorial/Demonstration
STR_01CE_CARGO_ACCEPTED :{BLACK}Accepterat gods: {LTBLUE}{STRING}
STR_01CF_CARGO_ACCEPTED :{BLACK}Accepterat gods: {LTBLUE}{STRING}, {STRING}
STR_01D0_CARGO_ACCEPTED :{BLACK}Accepterat gods: {LTBLUE}{STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_4 :{BLACK}Accepterat gods: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}
+STR_CARGO_ACCEPTED_5 :{BLACK}Accepterat gods: {LTBLUE}{STRING}, {STRING}, {STRING}, {STRING}, {STRING}
############ range for cargo acecpted ends
STR_01D1_8 :({COMMA8}/8 {STRING})
diff --git a/misc_gui.c b/misc_gui.c
index 04deaacd4..7ca26c09e 100644
--- a/misc_gui.c
+++ b/misc_gui.c
@@ -32,6 +32,8 @@ static void LandInfoWndProc(Window *w, WindowEvent *e)
uint32 *b;
if (e->event == WE_PAINT) {
+ int i;
+
DrawWindowWidgets(w);
lid = WP(w,void_d).data;
@@ -68,37 +70,19 @@ static void LandInfoWndProc(Window *w, WindowEvent *e)
str = STR_01CE_CARGO_ACCEPTED - 1;
- if (lid->ac.amount_1 != 0) {
- if (lid->ac.amount_1 < 8) {
- SET_DPARAMX16(b, 0, STR_01D1_8);
- SET_DPARAMX8(b, 1, lid->ac.amount_1);
- b += 2;
- }
- SET_DPARAMX16(b, 0, _cargoc.names_s[lid->ac.type_1]);
- b++;
- str++;
- }
-
- if (lid->ac.amount_2 != 0) {
- if (lid->ac.amount_2 < 8) {
- SET_DPARAMX16(b, 0, STR_01D1_8);
- SET_DPARAMX8(b, 1, lid->ac.amount_2);
- b += 2;
- }
- SET_DPARAMX16(b, 0, _cargoc.names_s[lid->ac.type_2]);
- b++;
- str++;
- }
-
- if (lid->ac.amount_3 != 0) {
- if (lid->ac.amount_3 < 8) {
- SET_DPARAMX16(b, 0, STR_01D1_8);
- SET_DPARAMX8(b, 1, lid->ac.amount_3);
- b += 2;
+ /* XXX if a tile accepts more cargo types than there are template strings
+ * this breaks */
+ for (i = 0; i < NUM_CARGO; ++i) {
+ if (lid->ac[i] > 0) {
+ if (lid->ac[i] < 8) {
+ SET_DPARAMX16(b, 0, STR_01D1_8);
+ SET_DPARAMX8(b, 1, lid->ac[i]);
+ b += 2;
+ }
+ SET_DPARAMX16(b, 0, _cargoc.names_s[i]);
+ b++;
+ str++;
}
- SET_DPARAMX16(b, 0, _cargoc.names_s[lid->ac.type_3]);
- b++;
- str++;
}
if (str != (STR_01CE_CARGO_ACCEPTED - 1))
@@ -155,7 +139,7 @@ static void Place_LandInfo(uint tile)
// Becuase build_date is not set yet in every TileDesc, we make sure it is empty
lid.td.build_date = 0;
- GetAcceptedCargo(tile, &lid.ac);
+ GetAcceptedCargo(tile, lid.ac);
GetTileDesc(tile, &lid.td);
#if defined(_DEBUG)
diff --git a/rail_cmd.c b/rail_cmd.c
index 414934fd2..ace3b5a16 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -1965,7 +1965,7 @@ uint GetSlopeTileh_Track(TileInfo *ti)
return ti->tileh;
}
-static void GetAcceptedCargo_Track(uint tile, AcceptedCargo *ac)
+static void GetAcceptedCargo_Track(uint tile, AcceptedCargo ac)
{
/* not used */
}
diff --git a/road_cmd.c b/road_cmd.c
index 19d9d2212..5afc94129 100644
--- a/road_cmd.c
+++ b/road_cmd.c
@@ -903,7 +903,7 @@ uint GetSlopeTileh_Road(TileInfo *ti)
return ti->tileh;
}
-static void GetAcceptedCargo_Road(uint tile, AcceptedCargo *ac)
+static void GetAcceptedCargo_Road(uint tile, AcceptedCargo ac)
{
/* not used */
}
diff --git a/station_cmd.c b/station_cmd.c
index cfaa2cd0e..f1299dca6 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -429,9 +429,8 @@ void GetAcceptanceAroundTiles(uint *accepts, uint tile, int w, int h)
int x,y;
int x1,y1,x2,y2;
int xc,yc;
- AcceptedCargo ac;
- memset(accepts, 0, NUM_CARGO * sizeof(uint));
+ memset(accepts, 0, sizeof(AcceptedCargo));
x = GET_TILE_X(tile);
y = GET_TILE_Y(tile);
@@ -454,10 +453,12 @@ void GetAcceptanceAroundTiles(uint *accepts, uint tile, int w, int h)
do {
uint tile = TILE_XY(xc, yc);
if (!IS_TILETYPE(tile, MP_STATION)) {
- GetAcceptedCargo(tile, &ac);
- accepts[ac.type_1] += ac.amount_1;
- accepts[ac.type_2] += ac.amount_2;
- accepts[ac.type_3] += ac.amount_3;
+ AcceptedCargo ac;
+ int i;
+
+ GetAcceptedCargo(tile, ac);
+ for (i = 0; i < NUM_CARGO; ++i)
+ accepts[i] += ac[i];
}
} while (++xc != x2);
} while (++yc != y2);
@@ -1999,7 +2000,7 @@ static uint GetSlopeTileh_Station(TileInfo *ti)
return 0;
}
-static void GetAcceptedCargo_Station(uint tile, AcceptedCargo *ac)
+static void GetAcceptedCargo_Station(uint tile, AcceptedCargo ac)
{
/* not used */
}
diff --git a/table/town_land.h b/table/town_land.h
index f7c28accc..01b3a26e5 100644
--- a/table/town_land.h
+++ b/table/town_land.h
@@ -2133,21 +2133,38 @@ static const byte _housetype_cargo_mail[110] = {
4, 4, 4, 1, 1, 2,
};
-static const int8 _housetype_cargo_goods[110] = {
+static const byte _housetype_cargo_goods[] = {
4, 4, 1, 0, 6, 6, 0, 2,
2, 0, 0, 0, 0, 4, 3, 3,
3, 6, 8, 6, 0, 0, 0, 0,
0, 0, 0, 2, 3, 3, 3, 2,
- 0, 0, 0, 0, 2,-1,-1, 2,
- 3, 3, 3, 3,-2,-2,-2,-2,
- -2,-2, 4, 4, 4, 4, 5, 5,
- -1,-1,-1,-1, 0, 0,-1,-1,
- 3, 3,-3, 2,-3, 2, 3, 3,
- 4, 4, 2, 2, 2, 2,-2,-2,
- -2,-1, 1, 0,-2, 1, 1, 4,
+ 0, 0, 0, 0, 2, 0, 0, 2,
+ 3, 3, 3, 3, 0, 0, 0, 0,
+ 0, 0, 4, 4, 4, 4, 5, 5,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 3, 0, 2, 0, 2, 3, 3,
+ 4, 4, 2, 2, 2, 2, 0, 0,
+ 0, 0, 1, 0, 0, 1, 1, 4,
4, 1, 4, 0, 2, 1, 2, 2,
2, 2, 2, 2, 2, 2, 1, 1,
- -4,-4, 2, 2, 2,-4,
+ 0, 0, 2, 2, 2, 0
+};
+
+static const byte _housetype_cargo_food[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 1, 0,
+ 0, 0, 0, 0, 2, 2, 2, 2,
+ 2, 2, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 0, 0, 1, 1,
+ 0, 0, 3, 0, 3, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 2, 2,
+ 2, 1, 0, 0, 2, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 4, 4, 0, 0, 0, 4
};
static const byte _house_more_flags[110] = {
diff --git a/town_cmd.c b/town_cmd.c
index b1d3cb93e..7bd9b6301 100644
--- a/town_cmd.c
+++ b/town_cmd.c
@@ -292,22 +292,14 @@ static int32 ClearTile_Town(uint tile, byte flags)
return cost;
}
-static void GetAcceptedCargo_Town(uint tile, AcceptedCargo *ac)
+static void GetAcceptedCargo_Town(uint tile, AcceptedCargo ac)
{
int type = _map2[tile];
- ac->type_1 = CT_PASSENGERS;
- ac->amount_1 = _housetype_cargo_passengers[type];
-
- ac->type_2 = CT_GOODS;
- ac->amount_2 = _housetype_cargo_goods[type];
- if (ac->amount_2 & 0x80) {
- ac->amount_2 &= 0x7F;
- ac->type_2 = CT_FOOD;
- }
-
- ac->type_3 = CT_MAIL;
- ac->amount_3 = _housetype_cargo_mail[type];
+ ac[CT_PASSENGERS] = _housetype_cargo_passengers[type];
+ ac[CT_MAIL] = _housetype_cargo_mail[type];
+ ac[CT_GOODS] = _housetype_cargo_goods[type];
+ ac[CT_FOOD] = _housetype_cargo_food[type];
}
static void GetTileDesc_Town(uint tile, TileDesc *td)
diff --git a/tree_cmd.c b/tree_cmd.c
index 76e89b892..c8a122732 100644
--- a/tree_cmd.c
+++ b/tree_cmd.c
@@ -357,7 +357,7 @@ static int32 ClearTile_Trees(uint tile, byte flags) {
return num * _price.remove_trees;
}
-static void GetAcceptedCargo_Trees(uint tile, AcceptedCargo *ac)
+static void GetAcceptedCargo_Trees(uint tile, AcceptedCargo ac)
{
/* not used */
}
diff --git a/ttd.h b/ttd.h
index a05693f07..656c71640 100644
--- a/ttd.h
+++ b/ttd.h
@@ -222,11 +222,47 @@ typedef struct GameDifficulty {
int town_council_tolerance; // minimum required town ratings to be allowed to demolish stuff
} GameDifficulty;
-typedef struct AcceptedCargo {
- int type_1, amount_1;
- int type_2, amount_2;
- int type_3, amount_3;
-} AcceptedCargo;
+enum {
+ // Temperate
+ CT_PASSENGERS = 0,
+ CT_COAL = 1,
+ CT_MAIL = 2,
+ CT_OIL = 3,
+ CT_LIVESTOCK = 4,
+ CT_GOODS = 5,
+ CT_GRAIN = 6,
+ CT_WOOD = 7,
+ CT_IRON_ORE = 8,
+ CT_STEEL = 9,
+ CT_VALUABLES = 10,
+ CT_FOOD = 11,
+
+ // Arctic
+ CT_HILLY_UNUSED = 8,
+ CT_PAPER = 9,
+
+ // Tropic
+ CT_RUBBER = 1,
+ CT_FRUIT = 4,
+ CT_COPPER_ORE = 8,
+ CT_WATER = 9,
+
+ // Toyland
+ CT_SUGAR = 1,
+ CT_TOYS = 3,
+ CT_BATTERIES = 4,
+ CT_CANDY = 5,
+ CT_TOFFEE = 6,
+ CT_COLA = 7,
+ CT_COTTON_CANDY = 8,
+ CT_BUBBLES = 9,
+ CT_PLASTIC = 10,
+ CT_FIZZY_DRINKS = 11,
+
+ NUM_CARGO = 12,
+};
+
+typedef uint AcceptedCargo[NUM_CARGO];
typedef struct TileDesc {
StringID str;
@@ -253,7 +289,7 @@ typedef int32 CommandProc(int x, int y, uint32 flags, uint32 p1, uint32 p2);
typedef void DrawTileProc(TileInfo *ti);
typedef uint GetSlopeZProc(TileInfo *ti);
typedef int32 ClearTileProc(uint tile, byte flags);
-typedef void GetAcceptedCargoProc(uint tile, AcceptedCargo *res);
+typedef void GetAcceptedCargoProc(uint tile, AcceptedCargo res);
typedef void GetTileDescProc(uint tile, TileDesc *td);
/* GetTileTrackStatusProcs return a value that contains the possible tracks
* that can be taken on a given tile by a given transport. The return value is
@@ -327,46 +363,6 @@ enum {
};
enum {
- // Temperate
- CT_PASSENGERS = 0,
- CT_COAL = 1,
- CT_MAIL = 2,
- CT_OIL = 3,
- CT_LIVESTOCK = 4,
- CT_GOODS = 5,
- CT_GRAIN = 6,
- CT_WOOD = 7,
- CT_IRON_ORE = 8,
- CT_STEEL = 9,
- CT_VALUABLES = 10,
- CT_FOOD = 11,
-
- // Arctic
- CT_HILLY_UNUSED = 8,
- CT_PAPER = 9,
-
- // Tropic
- CT_RUBBER = 1,
- CT_FRUIT = 4,
- CT_COPPER_ORE = 8,
- CT_WATER = 9,
-
- // Toyland
- CT_SUGAR = 1,
- CT_TOYS = 3,
- CT_BATTERIES = 4,
- CT_CANDY = 5,
- CT_TOFFEE = 6,
- CT_COLA = 7,
- CT_COTTON_CANDY = 8,
- CT_BUBBLES = 9,
- CT_PLASTIC = 10,
- CT_FIZZY_DRINKS = 11,
-
- NUM_CARGO = 12,
-};
-
-enum {
WC_MAIN_WINDOW = 0x0,
WC_MAIN_TOOLBAR = 0x1,
WC_STATUS_BAR = 0x2,
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c
index 6fcf71d68..744b0e08b 100644
--- a/tunnelbridge_cmd.c
+++ b/tunnelbridge_cmd.c
@@ -1208,7 +1208,7 @@ static uint GetSlopeTileh_TunnelBridge(TileInfo *ti) {
}
-static void GetAcceptedCargo_TunnelBridge(uint tile, AcceptedCargo *ac)
+static void GetAcceptedCargo_TunnelBridge(uint tile, AcceptedCargo ac)
{
/* not used */
}
diff --git a/unmovable_cmd.c b/unmovable_cmd.c
index 5c37ba7ec..34f71bc9d 100644
--- a/unmovable_cmd.c
+++ b/unmovable_cmd.c
@@ -126,7 +126,7 @@ static int32 ClearTile_Unmovable(uint tile, byte flags)
return 0;
}
-static void GetAcceptedCargo_Unmovable(uint tile, AcceptedCargo *ac)
+static void GetAcceptedCargo_Unmovable(uint tile, AcceptedCargo ac)
{
byte m5 = _map5[tile];
uint level; // HQ level (depends on company performance) in the range 1..5.
@@ -143,17 +143,13 @@ static void GetAcceptedCargo_Unmovable(uint tile, AcceptedCargo *ac)
// Top town building generates 10, so to make HQ interesting, the top
// type makes 20.
- ac->type_1 = CT_PASSENGERS;
- ac->amount_1 = level;
- if (!ac->amount_1) ac->amount_1 = 1;
+ ac[CT_PASSENGERS] = max(1, level);
// Top town building generates 4, HQ can make up to 8. The
// proportion passengers:mail is different because such a huge
// commercial building generates unusually high amount of mail
// correspondence per physical visitor.
- ac->type_2 = CT_MAIL;
- ac->amount_2 = level / 2;
- if (!ac->amount_2) ac->amount_2 = 1;
+ ac[CT_MAIL] = max(1, level / 2);
}
static const StringID _unmovable_tile_str[] = {
diff --git a/water_cmd.c b/water_cmd.c
index 918fd9c1c..8ad8ef9bc 100644
--- a/water_cmd.c
+++ b/water_cmd.c
@@ -450,7 +450,7 @@ static uint GetSlopeTileh_Water(TileInfo *ti)
return ti->tileh;
}
-static void GetAcceptedCargo_Water(uint tile, AcceptedCargo *ac)
+static void GetAcceptedCargo_Water(uint tile, AcceptedCargo ac)
{
/* not used */
}