# HG changeset patch # User tron # Date 1101034180 0 # Node ID 77f0ef57e7cf1936bb1cb8a8252a7aff875ebbc8 # Parent ba697666956e9268377b67004f0dddd73cc4d585 (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. diff -r ba697666956e -r 77f0ef57e7cf clear_cmd.c --- a/clear_cmd.c Sun Nov 21 10:42:01 2004 +0000 +++ b/clear_cmd.c Sun Nov 21 10:49:40 2004 +0000 @@ -523,7 +523,7 @@ return ti->tileh; } -static void GetAcceptedCargo_Clear(uint tile, AcceptedCargo *ac) +static void GetAcceptedCargo_Clear(uint tile, AcceptedCargo ac) { /* unused */ } diff -r ba697666956e -r 77f0ef57e7cf dummy_land.c --- a/dummy_land.c Sun Nov 21 10:42:01 2004 +0000 +++ b/dummy_land.c Sun Nov 21 10:49:40 2004 +0000 @@ -22,7 +22,7 @@ } -static void GetAcceptedCargo_Dummy(uint tile, AcceptedCargo *ac) +static void GetAcceptedCargo_Dummy(uint tile, AcceptedCargo ac) { /* not used */ } diff -r ba697666956e -r 77f0ef57e7cf functions.h --- a/functions.h Sun Nov 21 10:42:01 2004 +0000 +++ b/functions.h Sun Nov 21 10:49:40 2004 +0000 @@ -23,7 +23,7 @@ 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 -r ba697666956e -r 77f0ef57e7cf industry_cmd.c --- a/industry_cmd.c Sun Nov 21 10:42:01 2004 +0000 +++ b/industry_cmd.c Sun Nov 21 10:49:40 2004 +0000 @@ -339,28 +339,19 @@ 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 -r ba697666956e -r 77f0ef57e7cf landscape.c --- a/landscape.c Sun Nov 21 10:42:01 2004 +0000 +++ b/landscape.c Sun Nov 21 10:49:40 2004 +0000 @@ -311,7 +311,7 @@ _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 -r ba697666956e -r 77f0ef57e7cf lang/american.txt --- a/lang/american.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/american.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/catalan.txt --- a/lang/catalan.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/catalan.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/czech.txt --- a/lang/czech.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/czech.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/danish.txt --- a/lang/danish.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/danish.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/dutch.txt --- a/lang/dutch.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/dutch.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/english.txt --- a/lang/english.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/english.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/finnish.txt --- a/lang/finnish.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/finnish.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/french.txt --- a/lang/french.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/french.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/galician.txt --- a/lang/galician.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/galician.txt Sun Nov 21 10:49:40 2004 +0000 @@ -493,6 +493,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/german.txt --- a/lang/german.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/german.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/hungarian.txt --- a/lang/hungarian.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/hungarian.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/icelandic.txt --- a/lang/icelandic.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/icelandic.txt Sun Nov 21 10:49:40 2004 +0000 @@ -492,6 +492,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/italian.txt --- a/lang/italian.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/italian.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/norwegian.txt --- a/lang/norwegian.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/norwegian.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/polish.txt --- a/lang/polish.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/polish.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/portuguese.txt --- a/lang/portuguese.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/portuguese.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/romanian.txt --- a/lang/romanian.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/romanian.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/slovak.txt --- a/lang/slovak.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/slovak.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/spanish.txt --- a/lang/spanish.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/spanish.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf lang/swedish.txt --- a/lang/swedish.txt Sun Nov 21 10:42:01 2004 +0000 +++ b/lang/swedish.txt Sun Nov 21 10:49:40 2004 +0000 @@ -495,6 +495,8 @@ 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 -r ba697666956e -r 77f0ef57e7cf misc_gui.c --- a/misc_gui.c Sun Nov 21 10:42:01 2004 +0000 +++ b/misc_gui.c Sun Nov 21 10:49:40 2004 +0000 @@ -32,6 +32,8 @@ uint32 *b; if (e->event == WE_PAINT) { + int i; + DrawWindowWidgets(w); lid = WP(w,void_d).data; @@ -68,37 +70,19 @@ 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; + /* 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_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; - } - SET_DPARAMX16(b, 0, _cargoc.names_s[lid->ac.type_3]); - b++; - str++; } if (str != (STR_01CE_CARGO_ACCEPTED - 1)) @@ -155,7 +139,7 @@ // 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 -r ba697666956e -r 77f0ef57e7cf rail_cmd.c --- a/rail_cmd.c Sun Nov 21 10:42:01 2004 +0000 +++ b/rail_cmd.c Sun Nov 21 10:49:40 2004 +0000 @@ -1965,7 +1965,7 @@ return ti->tileh; } -static void GetAcceptedCargo_Track(uint tile, AcceptedCargo *ac) +static void GetAcceptedCargo_Track(uint tile, AcceptedCargo ac) { /* not used */ } diff -r ba697666956e -r 77f0ef57e7cf road_cmd.c --- a/road_cmd.c Sun Nov 21 10:42:01 2004 +0000 +++ b/road_cmd.c Sun Nov 21 10:49:40 2004 +0000 @@ -903,7 +903,7 @@ return ti->tileh; } -static void GetAcceptedCargo_Road(uint tile, AcceptedCargo *ac) +static void GetAcceptedCargo_Road(uint tile, AcceptedCargo ac) { /* not used */ } diff -r ba697666956e -r 77f0ef57e7cf station_cmd.c --- a/station_cmd.c Sun Nov 21 10:42:01 2004 +0000 +++ b/station_cmd.c Sun Nov 21 10:49:40 2004 +0000 @@ -429,9 +429,8 @@ 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 @@ 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 @@ return 0; } -static void GetAcceptedCargo_Station(uint tile, AcceptedCargo *ac) +static void GetAcceptedCargo_Station(uint tile, AcceptedCargo ac) { /* not used */ } diff -r ba697666956e -r 77f0ef57e7cf table/town_land.h --- a/table/town_land.h Sun Nov 21 10:42:01 2004 +0000 +++ b/table/town_land.h Sun Nov 21 10:49:40 2004 +0000 @@ -2133,21 +2133,38 @@ 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 -r ba697666956e -r 77f0ef57e7cf town_cmd.c --- a/town_cmd.c Sun Nov 21 10:42:01 2004 +0000 +++ b/town_cmd.c Sun Nov 21 10:49:40 2004 +0000 @@ -292,22 +292,14 @@ 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 -r ba697666956e -r 77f0ef57e7cf tree_cmd.c --- a/tree_cmd.c Sun Nov 21 10:42:01 2004 +0000 +++ b/tree_cmd.c Sun Nov 21 10:49:40 2004 +0000 @@ -357,7 +357,7 @@ return num * _price.remove_trees; } -static void GetAcceptedCargo_Trees(uint tile, AcceptedCargo *ac) +static void GetAcceptedCargo_Trees(uint tile, AcceptedCargo ac) { /* not used */ } diff -r ba697666956e -r 77f0ef57e7cf ttd.h --- a/ttd.h Sun Nov 21 10:42:01 2004 +0000 +++ b/ttd.h Sun Nov 21 10:49:40 2004 +0000 @@ -222,11 +222,47 @@ 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 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 { - // 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 -r ba697666956e -r 77f0ef57e7cf tunnelbridge_cmd.c --- a/tunnelbridge_cmd.c Sun Nov 21 10:42:01 2004 +0000 +++ b/tunnelbridge_cmd.c Sun Nov 21 10:49:40 2004 +0000 @@ -1208,7 +1208,7 @@ } -static void GetAcceptedCargo_TunnelBridge(uint tile, AcceptedCargo *ac) +static void GetAcceptedCargo_TunnelBridge(uint tile, AcceptedCargo ac) { /* not used */ } diff -r ba697666956e -r 77f0ef57e7cf unmovable_cmd.c --- a/unmovable_cmd.c Sun Nov 21 10:42:01 2004 +0000 +++ b/unmovable_cmd.c Sun Nov 21 10:49:40 2004 +0000 @@ -126,7 +126,7 @@ 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 @@ // 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 -r ba697666956e -r 77f0ef57e7cf water_cmd.c --- a/water_cmd.c Sun Nov 21 10:42:01 2004 +0000 +++ b/water_cmd.c Sun Nov 21 10:49:40 2004 +0000 @@ -450,7 +450,7 @@ return ti->tileh; } -static void GetAcceptedCargo_Water(uint tile, AcceptedCargo *ac) +static void GetAcceptedCargo_Water(uint tile, AcceptedCargo ac) { /* not used */ }