From fc5f67123acfd977cd74d5e5a8d2d13a049b357a Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 10 Mar 2019 17:45:15 +0000 Subject: [PATCH 01/82] Fix e66cec8f86: Permit loading of industry production callback with invalid cargo type. It is only an error if the invalid result is actually used. This will be silently ignored at the moment. It is still an error if a duplicate cargo type is returned. --- src/lang/english.txt | 3 ++- src/newgrf.cpp | 12 ++++++++++-- src/newgrf_industries.cpp | 11 +++++++++++ src/newgrf_spritegroup.h | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/lang/english.txt b/src/lang/english.txt index 8bcfd95885..b6146718f2 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3002,7 +3002,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :Requested GRF r STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:RAW_STRING} was disabled by {2:RAW_STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Invalid/unknown sprite layout format (sprite {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Too many elements in property value list (sprite {3:NUM}, property {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Invalid industry production callback (sprite {3:NUM}, "{1:RAW_STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Invalid industry production callback (sprite {3:NUM}, "{2:RAW_STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Caution! @@ -3034,6 +3034,7 @@ STR_NEWGRF_BUGGY :{WHITE}NewGRF ' STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Cargo/refit information for '{1:ENGINE}' differs from purchase list after construction. This might cause autorenew/-replace to fail refitting correctly STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' caused an endless loop in the production callback STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}Callback {1:HEX} returned unknown/invalid result {2:HEX} +STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' returned invalid cargo type in the production callback at {2:HEX} # 'User removed essential NewGRFs'-placeholders for stuff without specs STR_NEWGRF_INVALID_CARGO : diff --git a/src/newgrf.cpp b/src/newgrf.cpp index ff10287981..13d1377d07 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -5005,7 +5005,12 @@ static void NewSpriteGroup(ByteReader *buf) for (uint i = 0; i < group->num_input; i++) { byte rawcargo = buf->ReadByte(); CargoID cargo = GetCargoTranslation(rawcargo, _cur.grffile); - if (std::find(group->cargo_input, group->cargo_input + i, cargo) != group->cargo_input + i) { + if (cargo == CT_INVALID) { + /* The mapped cargo is invalid. This is permitted at this point, + * as long as the result is not used. Mark it invalid so this + * can be tested later. */ + group->version = 0xFF; + } else if (std::find(group->cargo_input, group->cargo_input + i, cargo) != group->cargo_input + i) { GRFError *error = DisableGrf(STR_NEWGRF_ERROR_INDPROD_CALLBACK); error->data = stredup("duplicate input cargo"); return; @@ -5022,7 +5027,10 @@ static void NewSpriteGroup(ByteReader *buf) for (uint i = 0; i < group->num_output; i++) { byte rawcargo = buf->ReadByte(); CargoID cargo = GetCargoTranslation(rawcargo, _cur.grffile); - if (std::find(group->cargo_output, group->cargo_output + i, cargo) != group->cargo_output + i) { + if (cargo == CT_INVALID) { + /* Mark this result as invalid to use */ + group->version = 0xFF; + } else if (std::find(group->cargo_output, group->cargo_output + i, cargo) != group->cargo_output + i) { GRFError *error = DisableGrf(STR_NEWGRF_ERROR_INDPROD_CALLBACK); error->data = stredup("duplicate output cargo"); return; diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp index de388c0234..980059cabb 100644 --- a/src/newgrf_industries.cpp +++ b/src/newgrf_industries.cpp @@ -605,6 +605,17 @@ void IndustryProductionCallback(Industry *ind, int reason) if (tgroup == NULL || tgroup->type != SGT_INDUSTRY_PRODUCTION) break; const IndustryProductionSpriteGroup *group = (const IndustryProductionSpriteGroup *)tgroup; + if (group->version == 0xFF) { + /* Result was marked invalid on load, display error message */ + SetDParamStr(0, spec->grf_prop.grffile->filename); + SetDParam(1, spec->name); + SetDParam(2, ind->location.tile); + ShowErrorMessage(STR_NEWGRF_BUGGY, STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK, WL_WARNING); + + /* abort the function early, this error isn't critical and will allow the game to continue to run */ + break; + } + bool deref = (group->version >= 1); if (group->version < 2) { diff --git a/src/newgrf_spritegroup.h b/src/newgrf_spritegroup.h index 6f038fd138..2db78f6bad 100644 --- a/src/newgrf_spritegroup.h +++ b/src/newgrf_spritegroup.h @@ -277,7 +277,7 @@ struct TileLayoutSpriteGroup : SpriteGroup { struct IndustryProductionSpriteGroup : SpriteGroup { IndustryProductionSpriteGroup() : SpriteGroup(SGT_INDUSTRY_PRODUCTION) {} - uint8 version; + uint8 version; ///< Production callback version used, or 0xFF if marked invalid uint8 num_input; ///< How many subtract_input values are valid int16 subtract_input[INDUSTRY_NUM_INPUTS]; ///< Take this much of the input cargo (can be negative, is indirect in cb version 1+) CargoID cargo_input[INDUSTRY_NUM_INPUTS]; ///< Which input cargoes to take from (only cb version 2) From 35967effd3cef008dd18d38214ebd7def68613d5 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 10 Mar 2019 18:02:22 +0000 Subject: [PATCH 02/82] Cleanup: Update changed string in language files. --- src/lang/catalan.txt | 2 +- src/lang/croatian.txt | 2 +- src/lang/danish.txt | 2 +- src/lang/dutch.txt | 2 +- src/lang/english_US.txt | 2 +- src/lang/finnish.txt | 2 +- src/lang/french.txt | 2 +- src/lang/german.txt | 2 +- src/lang/hungarian.txt | 2 +- src/lang/italian.txt | 2 +- src/lang/korean.txt | 2 +- src/lang/norwegian_bokmal.txt | 2 +- src/lang/portuguese.txt | 2 +- src/lang/russian.txt | 2 +- src/lang/spanish_MX.txt | 2 +- src/lang/swedish.txt | 2 +- src/lang/turkish.txt | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index 29752bb058..85692edc37 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -3001,7 +3001,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :Els recursos GR STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} ha estat desactivat per {STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Format de disposició de sprite no vàlid o desconegut (sprite {3:NUM}). STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Hi ha massa elements a la llista de valors de propietats (sprite {3:NUM}, propietat {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :«Callback» de producció d'indústria no vàlid (sprite {3:NUM}, «{1:STRING}»). +STR_NEWGRF_ERROR_INDPROD_CALLBACK :«Callback» de producció d'indústria no vàlid (sprite {3:NUM}, «{2:STRING}»). # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Alerta! diff --git a/src/lang/croatian.txt b/src/lang/croatian.txt index 9a98f3b731..3b659bbf1c 100644 --- a/src/lang/croatian.txt +++ b/src/lang/croatian.txt @@ -3098,7 +3098,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :Zatraženi GRF STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} je isključen od strane {STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Pogrešan/nepoznat format raspored sprite-a (sprite {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Previše elemenata na listi postavki varijabli (sprite {3:NUM}, postavka {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Pogrešna callback funkcija za industrijsku proizvodnju (sprite {3:NUM}, "{1:STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Pogrešna callback funkcija za industrijsku proizvodnju (sprite {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Oprez! diff --git a/src/lang/danish.txt b/src/lang/danish.txt index 162962e3d8..9301a698b0 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -3002,7 +3002,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :De ønskede GRF STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} blev deaktiveret af {2:STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Ugyldigt/ukendt sprite layoutformat (sprite {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :For mange elementer i værdiliste for egenskab (sprite {3:NUM}, egenskab {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Ugyldig produktion-callback for industri (sprite {3:NUM}, "{1:STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Ugyldig produktion-callback for industri (sprite {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Advarsel! diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index 797fd9f7c5..df7024f7f7 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -3000,7 +3000,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :Gevraagde GRF-m STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} is uitgeschakeld door {STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Ongeldige/onbekende indeling voor spritelay-out (sprite {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Te veel elementen in eigenschappenwaardelijst (affbeelding {3:NUM}, eigenschap {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Ongeldige terugroep voor industriële productie (sprite {3:NUM}, "{1:STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Ongeldige terugroep voor industriële productie (sprite {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Waarschuwing! diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index 28137bd521..aaedcbb656 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -3000,7 +3000,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :Requested GRF r STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} was disabled by {2:STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Invalid/unknown sprite layout format (sprite {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Too many elements in property value list (sprite {3:NUM}, property {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Invalid industry production callback (sprite {3:NUM}, "{1:STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Invalid industry production callback (sprite {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Caution! diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index 5fad7b4dbf..543e091f1d 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -3002,7 +3002,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :Pyydetyt GRF-re STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{2:STRING} poisti käytöstä NewGRF:n {1:STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Virheellinen/tuntematon spriten asettelumuoto (sprite {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Liian monta elementtiä ominaisuusarvolistassa (sprite {3:NUM}, ominaisuus {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Virhe teollisuuden tuotannon takaisinkutsussa (sprite {3:NUM}, "{1:STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Virhe teollisuuden tuotannon takaisinkutsussa (sprite {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Varoitus! diff --git a/src/lang/french.txt b/src/lang/french.txt index 2a8cf8dab3..15d9149f07 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -2997,7 +2997,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :Indisponibilit STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} a été désactivé par {STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Format de sprite invalide ou inconnu (sprite {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Trop d'éléments dans la liste des valeurs de la propriété (sprite {3:NUM}, propriété {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Fonction de rappel de production d'industrie invalide (sprite {3:NUM}, "{1:STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Fonction de rappel de production d'industrie invalide (sprite {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Attention{NBSP}! diff --git a/src/lang/german.txt b/src/lang/german.txt index a2cf57371f..3020bee3f6 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -2984,7 +2984,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :Die angefordert STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} wurde von {STRING} deaktiviert STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Ungültiges oder unbekanntes Format für Spritelayout (Sprite {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Zu viele Elemente in Eigenschaftswert-Liste (Sprite {3:NUM}, Eigenschaft {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Ungültige Produktions-Rückruffunktion (Sprite {3:NUM}, "{1:STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Ungültige Produktions-Rückruffunktion (Sprite {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Achtung! diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index 40ab899660..e76394be51 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -3066,7 +3066,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :Kért GRF forr STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} kikapcsolva {STRING} által STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Érvénytelen/ismeretlen sprite szerkezet formátum (sprite {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Túl sok érték a tulajdonságlistában (sprite {3:NUM}, property {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Érvénytelen termelési callback gazdasági épületben (sprite {3:NUM}, "{1:STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Érvénytelen termelési callback gazdasági épületben (sprite {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Figyelem! diff --git a/src/lang/italian.txt b/src/lang/italian.txt index 2d931b6bbe..fe63ab589c 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -3026,7 +3026,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :Risorsa GRF ric STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} è stato disabilitato da {STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Formato di layout dello sprite sconosciuto o non valido (sprite {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Troppi elementi nella lista valori di una proprietà (sprite {3:NUM}, proprietà {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Callback di produzione industria non valido (sprite {3:NUM}, "{1:STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Callback di produzione industria non valido (sprite {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Attenzione! diff --git a/src/lang/korean.txt b/src/lang/korean.txt index ffbbbad2b3..b74219005f 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -2997,7 +2997,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :요청한 GRF STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING}(은)는 {STRING} 때문에 사용할 수 없습니다 STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :유효하지 않은/알 수 없는 스프라이트 구조 유형 (스프라이트 {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :속성값 목록에 너무 많은 요소가 있음 (스프라이트 {3:NUM}, 속성 {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :유효하지 않은 산업 생산 콜백 (스프라이트 {3:NUM}, "{1:STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :유효하지 않은 산업 생산 콜백 (스프라이트 {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}경고! diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt index 7c1609c7c8..3999aee6c2 100644 --- a/src/lang/norwegian_bokmal.txt +++ b/src/lang/norwegian_bokmal.txt @@ -3006,7 +3006,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :Etterspurte GRF STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} ble deaktivert av {STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Ugyldig/ukjent sprite layout-format (figur {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :For mange elementer i fortegnelse over eiendomsverdier (sprite {3:NUM}, property {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Ugyldig industriprodukjson callback (sprite {3:NUM}, "{1:STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Ugyldig industriprodukjson callback (sprite {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Advarsel! diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index 794df12be8..329af3ca48 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -2997,7 +2997,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :Recursos GRF pe STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} foi desactivado por {STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Formato de Gráfico Inválido ou desconhecido (sprite {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Demasiados elementos na lista de valores de propriedade (sprite {3:NUM}, propriedade {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Revogação da produção industrial inválida (sprite {3:NUM}, "{1:STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Revogação da produção industrial inválida (sprite {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Alerta! diff --git a/src/lang/russian.txt b/src/lang/russian.txt index 0dea4ef89b..c78b2cdc0b 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -3182,7 +3182,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :Запроше STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} был отключён из-за {2:STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Недопустимый/неизвестный формат расположения спрайтов (спрайт {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Слишком много элементов в списке значений (спрайт {3:NUM}, свойство {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Неверная обработка продукции предприятия (спрайт {3:NUM}, "{1:STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Неверная обработка продукции предприятия (спрайт {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Осторожно! diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt index 09d44e7166..c440f95bb5 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -2997,7 +2997,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :Recursos GRF so STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} fue desactivado por {STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Formato de colocación de sprites no válido o desconocido (sprite {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Demasiados elementos en la lista de valores de propiedad (sprite {3:NUM}, property {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Llamada de producción de industria no válida (sprite {3:NUM}, "{1:STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Llamada de producción de industria no válida (sprite {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}¡Precaución! diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index 63c4b75a16..3aa154a2e7 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -2983,7 +2983,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :Efterfrågade G STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} har inaktiverats av {2:STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Felaktigt/okänt layout-format av spriteobjekt (spriteobjekt {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :För många poster i listan med egenskapsvärden (spriteobjekt {3:NUM}, egenskap {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Ogiltig industriproduktions-callback (spriteobjekt {3:NUM}, "{1:STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Ogiltig industriproduktions-callback (spriteobjekt {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Varning! diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index a5d60f7f2e..b801e5c26c 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -2990,7 +2990,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :İstenen GRF ka STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} {STRING} tarafından deaktive edildi STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Geçersiz/bilinmeyen nesne yerleşim biçimi (nesne {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Özellik değeri listesinde çok fazla öğe (sprite {3:NUM}, özellik {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Geçersiz endüstri üretim geri çağrımı (sprite {3:NUM}, "{1:STRING}") +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Geçersiz endüstri üretim geri çağrımı (sprite {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Uyarı! From 1100418063c90783f2bdd6aedcf91229f5882a50 Mon Sep 17 00:00:00 2001 From: translators Date: Fri, 15 Mar 2019 19:45:44 +0100 Subject: [PATCH 03/82] Update: Translations from eints romanian: 8 changes by alexmerlin1985 dutch: 2 changes by JanWillem --- src/lang/dutch.txt | 2 ++ src/lang/romanian.txt | 8 ++++++++ src/lang/ukrainian.txt | 1 - 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index df7024f7f7..d20fcafede 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -1184,6 +1184,8 @@ STR_CONFIG_SETTING_AUTOSLOPE :Omgeving aanpas STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :Staat het aanpassen van funderingen onder gebouwen en sporen toe zonder deze te verwijderen STR_CONFIG_SETTING_CATCHMENT :Meer realistische verzorgingsgebieden toestaan: {STRING} STR_CONFIG_SETTING_CATCHMENT_HELPTEXT :Verzorgingsgebieden met verschillende groottes voor verschillende typen stations en luchthavens +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES :Stations van het bedrijf kunnen leveren aan industrieën met bijbehorend neutraal station: {STRING} +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES_HELPTEXT :Wanneer dit is ingeschakeld, kunnen industrieën met bijbehorende stations (zoals olievelden) ook worden voorzien door stations van het bedrijf die in de buurt zijn gebouwd. Wanneer dit is uitgeschakeld, kunnen deze industrieën alleen worden voorzien door het bijbehorende station. Eventuele stations van het bedrijif in de buurt kunnen niet aan ze leveren; ook levert het bijbehorende station alleen aan de industrie zelf. STR_CONFIG_SETTING_EXTRADYNAMITE :Verwijderen van meer stedelijke wegen, bruggen en tunnels toestaan: {STRING} STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT :Maakt het gemakkelijker om door de stad beheerde infrastructuur en gebouwen te verwijderen. STR_CONFIG_SETTING_TRAIN_LENGTH :Maximale lengte van treinen: {STRING} diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index cb24055ff8..074c65fce9 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -1105,6 +1105,7 @@ STR_CONFIG_SETTING_TYPE_COMPANY_MENU :Setări compani STR_CONFIG_SETTING_TYPE_COMPANY_INGAME :Setări companie (stocate în fişierul de salvare; afectează doar compania curentă) STR_CONFIG_SETTING_RESTRICT_CATEGORY :{BLACK}Categorie: +STR_CONFIG_SETTING_RESTRICT_TYPE :{BLACK}Tip: STR_CONFIG_SETTING_RESTRICT_DROPDOWN_HELPTEXT :{BLACK}Arată în lista de mai jos doar setările modificate STR_CONFIG_SETTING_RESTRICT_BASIC :Setări de bază (afişează numai setări importante) STR_CONFIG_SETTING_RESTRICT_ADVANCED :Setări avansate (afişează majoritatea setărilor) @@ -1312,6 +1313,7 @@ STR_CONFIG_SETTING_TREE_PLACER_HELPTEXT :Alegeți distri STR_CONFIG_SETTING_TREE_PLACER_NONE :Niciunul STR_CONFIG_SETTING_TREE_PLACER_ORIGINAL :Original STR_CONFIG_SETTING_TREE_PLACER_IMPROVED :Îmbunătăţit +STR_CONFIG_SETTING_ROAD_SIDE :Autovehicule: {STRING} STR_CONFIG_SETTING_ROAD_SIDE_HELPTEXT :Alege banda pentru condus STR_CONFIG_SETTING_HEIGHTMAP_ROTATION :Rotaţie hartă înălţimi: {STRING} STR_CONFIG_SETTING_HEIGHTMAP_ROTATION_COUNTER_CLOCKWISE :Spre stânga @@ -1364,6 +1366,7 @@ STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_CONTROL :Control+Click STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_OFF :Oprit +STR_CONFIG_SETTING_AUTOSAVE :Autosalvare: {STRING} STR_CONFIG_SETTING_DATE_FORMAT_IN_SAVE_NAMES :Foloseşte formatul datei {STRING} pentru numele salvărilor STR_CONFIG_SETTING_DATE_FORMAT_IN_SAVE_NAMES_HELPTEXT :Formatul datei in numele salvărilor @@ -1643,6 +1646,7 @@ STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_METRIC :Metric (m) STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_SI :SI (m) STR_CONFIG_SETTING_LOCALISATION :{ORANGE}Localizare +STR_CONFIG_SETTING_GRAPHICS :{ORANGE}Grafică STR_CONFIG_SETTING_SOUND :{ORANGE}Efecte sonore STR_CONFIG_SETTING_INTERFACE :{ORANGE}Interfaţă STR_CONFIG_SETTING_INTERFACE_GENERAL :{ORANGE}General @@ -2662,6 +2666,7 @@ STR_ABOUT_COPYRIGHT_OPENTTD :{BLACK}OpenTTD STR_FRAMERATE_RATE_GAMELOOP_TOOLTIP :{BLACK}Număr de evenimente de joc simulate per secundă. STR_FRAMERATE_AVERAGE :{WHITE}Medie STR_FRAMERATE_DATA_POINTS :{BLACK}Date bazate pe măsurători {COMMA} +STR_FRAMERATE_MS_GOOD :{LTBLUE}{DECIMAL} ms STR_FRAMERATE_GRAPH_MILLISECONDS :{TINY_FONT}{COMMA} ms ############ Leave those lines in this order!! STR_FRAMERATE_VIDEO :{BLACK}Ieșire video: @@ -2818,6 +2823,7 @@ STR_NEWGRF_SETTINGS_DISABLED :{RED}Dezactivat STR_NEWGRF_SETTINGS_INCOMPATIBLE :{RED}Incompatibil cu această versiune de OpenTTD # NewGRF save preset window +STR_SAVE_PRESET_TITLE :{BLACK}Adaugă denumire presetare STR_SAVE_PRESET_CANCEL :{BLACK}Anulează STR_SAVE_PRESET_CANCEL_TOOLTIP :{BLACK}Nu schimba setarea implicită STR_SAVE_PRESET_SAVE_TOOLTIP :{BLACK}Salvează setarea pe numele selectat @@ -3326,6 +3332,7 @@ STR_GROUP_REMOVE_ALL_VEHICLES :Elimină toate STR_GROUP_RENAME_CAPTION :{BLACK}Redenumeşte un grup STR_GROUP_OCCUPANCY :Utilizare curentă: +STR_GROUP_OCCUPANCY_VALUE :{NUM}% # Build vehicle window STR_BUY_VEHICLE_TRAIN_RAIL_CAPTION :Noi vehicule feroviare @@ -3492,6 +3499,7 @@ STR_ENGINE_PREVIEW_MAGLEV_LOCOMOTIVE :locomotivă per STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER :{BLACK}Cost: {CURRENCY_LONG} Greutate: {WEIGHT_SHORT}{}Vitezã: {VELOCITY} Putere: {POWER}{}Cost de rulare: {CURRENCY_LONG}/an{}Capacitate: {CARGO_LONG} STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE :{BLACK}Cost: {CURRENCY_LONG} Greutate: {WEIGHT_SHORT}{}Viteză: {VELOCITY} Putere: {POWER} Ef. T. Max.: {6:FORCE}{}Cost rulaj: {4:CURRENCY_LONG}/an{}Capacitate: {5:CARGO_LONG} STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Viteză max.: {VELOCITY}{}Capacitate: {CARGO_LONG}{}Mentenanţă: {CURRENCY_LONG}/an +STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Viteza maximă: {VELOCITY}{}Tip avion: {STRING} Rază: {COMMA} pătrățele{}Capacitate: {CARGO_LONG}, {CARGO_LONG}{}Cost întreținere: {CURRENCY_LONG}/an # Autoreplace window STR_REPLACE_VEHICLES_WHITE :{WHITE}Înlocuieşte {STRING} - {STRING} diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt index e0e8124234..ba2f2c4ee2 100644 --- a/src/lang/ukrainian.txt +++ b/src/lang/ukrainian.txt @@ -3133,7 +3133,6 @@ STR_NEWGRF_ERROR_GRM_FAILED :Недосту STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} був вимкнений {STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Некоректний або невідомий формат розміщення спрайтів (спрайт {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Дуже багато елементів у списку значень (спрайт {3:NUM}, властивість {4:HEX}) -STR_NEWGRF_ERROR_INDPROD_CALLBACK :Невірна обробка продукції підприємства (спрайт {3:NUM}, "{1:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Обережно! From 7bd43f7413aed2dc544f0f9ec269c5693ef2c69f Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sat, 16 Mar 2019 10:00:58 +0100 Subject: [PATCH 04/82] Fix: [AzurePipelines] vcpkg is now preinstalled on Windows images So instead of integrating our own, we only copy our precompiled binaries into the right folder. --- azure-pipelines/templates/windows-dependencies.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/azure-pipelines/templates/windows-dependencies.yml b/azure-pipelines/templates/windows-dependencies.yml index c6fc6e407c..72368b9d71 100644 --- a/azure-pipelines/templates/windows-dependencies.yml +++ b/azure-pipelines/templates/windows-dependencies.yml @@ -1,10 +1,14 @@ steps: - bash: | set -ex + curl -L https://github.com/OpenTTD/CompileFarm/releases/download/latest/windows-dependencies.zip > windows-dependencies.zip unzip windows-dependencies.zip rm -f windows-dependencies.zip - displayName: 'Download dependencies' - workingDirectory: $(Build.ArtifactStagingDirectory) -- script: $(Build.ArtifactStagingDirectory)\windows-dependencies\vcpkg.exe integrate install + + mv windows-dependencies/installed /c/vcpkg/ + rm -rf windows-dependencies displayName: 'Install dependencies' + workingDirectory: $(Build.ArtifactStagingDirectory) +- script: c:\vcpkg\vcpkg.exe integrate install + displayName: 'Integrate vcpkg' From bcfc9620b0b94e05d732ddc0cede71141d590efc Mon Sep 17 00:00:00 2001 From: PeterN Date: Sat, 16 Mar 2019 16:52:07 +0000 Subject: [PATCH 05/82] Change: Use default value for invalid multi-string settings instead of clamping to min or max value. (#7361) --- src/settings.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/settings.cpp b/src/settings.cpp index d324ffc298..1fc2682cd0 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -448,13 +448,30 @@ static void Write_ValidateSetting(void *ptr, const SettingDesc *sd, int32 val) case SLE_VAR_U16: case SLE_VAR_I32: { /* Override the minimum value. No value below sdb->min, except special value 0 */ - if (!(sdb->flags & SGF_0ISDISABLED) || val != 0) val = Clamp(val, sdb->min, sdb->max); + if (!(sdb->flags & SGF_0ISDISABLED) || val != 0) { + if (!(sdb->flags & SGF_MULTISTRING)) { + /* Clamp value-type setting to its valid range */ + val = Clamp(val, sdb->min, sdb->max); + } else if (val < sdb->min || val > (int32)sdb->max) { + /* Reset invalid discrete setting (where different values change gameplay) to its default value */ + val = (int32)(size_t)sdb->def; + } + } break; } case SLE_VAR_U32: { /* Override the minimum value. No value below sdb->min, except special value 0 */ - uint min = ((sdb->flags & SGF_0ISDISABLED) && (uint)val <= (uint)sdb->min) ? 0 : sdb->min; - WriteValue(ptr, SLE_VAR_U32, (int64)ClampU(val, min, sdb->max)); + uint32 uval = (uint32)val; + if (!(sdb->flags & SGF_0ISDISABLED) || uval != 0) { + if (!(sdb->flags & SGF_MULTISTRING)) { + /* Clamp value-type setting to its valid range */ + uval = ClampU(uval, sdb->min, sdb->max); + } else if (uval < (uint)sdb->min || uval > sdb->max) { + /* Reset invalid discrete setting to its default value */ + uval = (uint32)(size_t)sdb->def; + } + } + WriteValue(ptr, SLE_VAR_U32, (int64)uval); return; } case SLE_VAR_I64: From c7b5f34138cf08016239c6f5732e5ae8c0262230 Mon Sep 17 00:00:00 2001 From: translators Date: Sat, 16 Mar 2019 19:45:41 +0100 Subject: [PATCH 06/82] Update: Translations from eints norwegian (bokmal): 1 change by Leifbk --- src/lang/norwegian_bokmal.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt index 3999aee6c2..78e72ea0ab 100644 --- a/src/lang/norwegian_bokmal.txt +++ b/src/lang/norwegian_bokmal.txt @@ -3038,6 +3038,7 @@ STR_NEWGRF_BUGGY :{WHITE}NewGRF ' STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Vare-/ombyggingsinformasjon for '{1:ENGINE}' er forskjellig fra kjøpelisten etter konstruksjonen. Dette kan resultere i at autofornying ikke fungerer på riktig måte. STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' forårsaket en uendelig løkke i produksjonstilbakekallet. STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}Tilbakekall {1:HEX} rapporterte ukjent/ugyldig resultat {2:HEX} +STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' ugyldig varetype i produksjonscallback at {2:HEX} # 'User removed essential NewGRFs'-placeholders for stuff without specs STR_NEWGRF_INVALID_CARGO : From fe448a26166dbde1933be797951f0c6329523911 Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Mon, 18 Feb 2019 23:55:45 +0000 Subject: [PATCH 07/82] Remove: OPF --- projects/openttd_vs140.vcxproj | 2 - projects/openttd_vs140.vcxproj.filters | 6 - projects/openttd_vs141.vcxproj | 2 - projects/openttd_vs141.vcxproj.filters | 6 - projects/openttd_vs142.vcxproj | 2 - projects/openttd_vs142.vcxproj.filters | 6 - source.list | 2 - src/openttd.cpp | 1 - src/pathfinder/opf/opf_ship.cpp | 222 ------------------------- src/pathfinder/opf/opf_ship.h | 31 ---- src/saveload/afterload.cpp | 2 +- src/saveload/saveload.h | 1 + src/settings.cpp | 12 -- src/settings_func.h | 1 - src/settings_type.h | 7 - src/ship_cmd.cpp | 8 +- src/table/settings.ini | 25 +-- src/vehicle_type.h | 2 +- 18 files changed, 10 insertions(+), 328 deletions(-) delete mode 100644 src/pathfinder/opf/opf_ship.cpp delete mode 100644 src/pathfinder/opf/opf_ship.h diff --git a/projects/openttd_vs140.vcxproj b/projects/openttd_vs140.vcxproj index 26267f6a03..473dfcda40 100644 --- a/projects/openttd_vs140.vcxproj +++ b/projects/openttd_vs140.vcxproj @@ -1291,8 +1291,6 @@ - - diff --git a/projects/openttd_vs140.vcxproj.filters b/projects/openttd_vs140.vcxproj.filters index 3c4fc43d98..9a468836b0 100644 --- a/projects/openttd_vs140.vcxproj.filters +++ b/projects/openttd_vs140.vcxproj.filters @@ -2961,12 +2961,6 @@ Pathfinder - - Pathfinder - - - Pathfinder - Pathfinder diff --git a/projects/openttd_vs141.vcxproj b/projects/openttd_vs141.vcxproj index 0cd3fe7488..2a963bfa20 100644 --- a/projects/openttd_vs141.vcxproj +++ b/projects/openttd_vs141.vcxproj @@ -1291,8 +1291,6 @@ - - diff --git a/projects/openttd_vs141.vcxproj.filters b/projects/openttd_vs141.vcxproj.filters index 3c4fc43d98..9a468836b0 100644 --- a/projects/openttd_vs141.vcxproj.filters +++ b/projects/openttd_vs141.vcxproj.filters @@ -2961,12 +2961,6 @@ Pathfinder - - Pathfinder - - - Pathfinder - Pathfinder diff --git a/projects/openttd_vs142.vcxproj b/projects/openttd_vs142.vcxproj index 20c3d1b210..f4c76e0978 100644 --- a/projects/openttd_vs142.vcxproj +++ b/projects/openttd_vs142.vcxproj @@ -1291,8 +1291,6 @@ - - diff --git a/projects/openttd_vs142.vcxproj.filters b/projects/openttd_vs142.vcxproj.filters index 3c4fc43d98..9a468836b0 100644 --- a/projects/openttd_vs142.vcxproj.filters +++ b/projects/openttd_vs142.vcxproj.filters @@ -2961,12 +2961,6 @@ Pathfinder - - Pathfinder - - - Pathfinder - Pathfinder diff --git a/source.list b/source.list index b567a0026d..7a6e6661ab 100644 --- a/source.list +++ b/source.list @@ -1049,8 +1049,6 @@ network/core/udp.h # Pathfinder pathfinder/follow_track.hpp -pathfinder/opf/opf_ship.cpp -pathfinder/opf/opf_ship.h pathfinder/pathfinder_func.h pathfinder/pathfinder_type.h pathfinder/pf_performance_timer.hpp diff --git a/src/openttd.cpp b/src/openttd.cpp index c2e7455667..c833583609 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -434,7 +434,6 @@ struct AfterNewGRFScan : NewGRFScanCallback { Game::Uninitialize(true); AI::Uninitialize(true); - CheckConfig(); LoadFromHighScore(); LoadHotkeysFromConfig(); WindowDesc::LoadFromConfig(); diff --git a/src/pathfinder/opf/opf_ship.cpp b/src/pathfinder/opf/opf_ship.cpp deleted file mode 100644 index c993f82033..0000000000 --- a/src/pathfinder/opf/opf_ship.cpp +++ /dev/null @@ -1,222 +0,0 @@ -/* $Id$ */ - -/* - * This file is part of OpenTTD. - * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. - * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . - */ - -/** @file opf_ship.cpp Implementation of the oldest supported ship pathfinder. */ - -#include "../../stdafx.h" -#include "../../tunnelbridge_map.h" -#include "../../tunnelbridge.h" -#include "../../ship.h" -#include "../../core/random_func.hpp" - -#include "../../safeguards.h" - -struct RememberData { - uint16 cur_length; - byte depth; - Track last_choosen_track; -}; - -struct TrackPathFinder { - TileIndex skiptile; - TileIndex dest_coords; - uint best_bird_dist; - uint best_length; - RememberData rd; - TrackdirByte the_dir; -}; - -static bool ShipTrackFollower(TileIndex tile, TrackPathFinder *pfs, uint length) -{ - /* Found dest? */ - if (tile == pfs->dest_coords) { - pfs->best_bird_dist = 0; - - pfs->best_length = minu(pfs->best_length, length); - return true; - } - - /* Skip this tile in the calculation */ - if (tile != pfs->skiptile) { - pfs->best_bird_dist = minu(pfs->best_bird_dist, DistanceMaxPlusManhattan(pfs->dest_coords, tile)); - } - - return false; -} - -static void TPFModeShip(TrackPathFinder *tpf, TileIndex tile, DiagDirection direction) -{ - if (IsTileType(tile, MP_TUNNELBRIDGE)) { - /* wrong track type */ - if (GetTunnelBridgeTransportType(tile) != TRANSPORT_WATER) return; - - DiagDirection dir = GetTunnelBridgeDirection(tile); - /* entering tunnel / bridge? */ - if (dir == direction) { - TileIndex endtile = GetOtherTunnelBridgeEnd(tile); - - tpf->rd.cur_length += GetTunnelBridgeLength(tile, endtile) + 1; - - tile = endtile; - } else { - /* leaving tunnel / bridge? */ - if (ReverseDiagDir(dir) != direction) return; - } - } - - /* This addition will sometimes overflow by a single tile. - * The use of TILE_MASK here makes sure that we still point at a valid - * tile, and then this tile will be in the sentinel row/col, so GetTileTrackStatus will fail. */ - tile = TILE_MASK(tile + TileOffsByDiagDir(direction)); - - if (++tpf->rd.cur_length > 50) return; - - TrackBits bits = TrackStatusToTrackBits(GetTileTrackStatus(tile, TRANSPORT_WATER, 0)) & DiagdirReachesTracks(direction); - if (bits == TRACK_BIT_NONE) return; - - assert(TileX(tile) != MapMaxX() && TileY(tile) != MapMaxY()); - - bool only_one_track = true; - do { - Track track = RemoveFirstTrack(&bits); - if (bits != TRACK_BIT_NONE) only_one_track = false; - RememberData rd = tpf->rd; - - /* Change direction 4 times only */ - if (!only_one_track && track != tpf->rd.last_choosen_track) { - if (++tpf->rd.depth > 4) { - tpf->rd = rd; - return; - } - tpf->rd.last_choosen_track = track; - } - - tpf->the_dir = TrackEnterdirToTrackdir(track, direction); - - if (!ShipTrackFollower(tile, tpf, tpf->rd.cur_length)) { - TPFModeShip(tpf, tile, TrackdirToExitdir(tpf->the_dir)); - } - - tpf->rd = rd; - } while (bits != TRACK_BIT_NONE); -} - -static void OPFShipFollowTrack(TileIndex tile, DiagDirection direction, TrackPathFinder *tpf) -{ - assert(IsValidDiagDirection(direction)); - - /* initialize path finder variables */ - tpf->rd.cur_length = 0; - tpf->rd.depth = 0; - tpf->rd.last_choosen_track = INVALID_TRACK; - - ShipTrackFollower(tile, tpf, 0); - TPFModeShip(tpf, tile, direction); -} - -/** Directions to search towards given track bits and the ship's enter direction. */ -static const DiagDirection _ship_search_directions[6][4] = { - { DIAGDIR_NE, INVALID_DIAGDIR, DIAGDIR_SW, INVALID_DIAGDIR }, - { INVALID_DIAGDIR, DIAGDIR_SE, INVALID_DIAGDIR, DIAGDIR_NW }, - { INVALID_DIAGDIR, DIAGDIR_NE, DIAGDIR_NW, INVALID_DIAGDIR }, - { DIAGDIR_SE, INVALID_DIAGDIR, INVALID_DIAGDIR, DIAGDIR_SW }, - { DIAGDIR_NW, DIAGDIR_SW, INVALID_DIAGDIR, INVALID_DIAGDIR }, - { INVALID_DIAGDIR, INVALID_DIAGDIR, DIAGDIR_SE, DIAGDIR_NE }, -}; - -/** Track to "direction (& 3)" mapping. */ -static const byte _pick_shiptrack_table[6] = {DIR_NE, DIR_SE, DIR_E, DIR_E, DIR_N, DIR_N}; - -static uint FindShipTrack(const Ship *v, TileIndex tile, DiagDirection dir, TrackBits bits, TileIndex skiptile, Track *track) -{ - TrackPathFinder pfs; - uint best_bird_dist = 0; - uint best_length = 0; - byte ship_dir = v->direction & 3; - - pfs.dest_coords = v->dest_tile; - pfs.skiptile = skiptile; - - Track best_track = INVALID_TRACK; - - assert(bits != TRACK_BIT_NONE); - do { - Track i = RemoveFirstTrack(&bits); - - pfs.best_bird_dist = UINT_MAX; - pfs.best_length = UINT_MAX; - - OPFShipFollowTrack(tile, _ship_search_directions[i][dir], &pfs); - - if (best_track != INVALID_TRACK) { - if (pfs.best_bird_dist != 0) { - /* neither reached the destination, pick the one with the smallest bird dist */ - if (pfs.best_bird_dist > best_bird_dist) goto bad; - if (pfs.best_bird_dist < best_bird_dist) goto good; - } else { - if (pfs.best_length > best_length) goto bad; - if (pfs.best_length < best_length) goto good; - } - - /* if we reach this position, there's two paths of equal value so far. - * pick one randomly. */ - uint r = GB(Random(), 0, 8); - if (_pick_shiptrack_table[i] == ship_dir) r += 80; - if (_pick_shiptrack_table[best_track] == ship_dir) r -= 80; - if (r <= 127) goto bad; - } -good:; - best_track = i; - best_bird_dist = pfs.best_bird_dist; - best_length = pfs.best_length; -bad:; - - } while (bits != TRACK_BIT_NONE); - - *track = best_track; - return best_bird_dist; -} - -/** - * Finds the best track to choose on the next tile and - * returns INVALID_TRACK when it is better to reverse. - * @param v The ship. - * @param tile The tile we are about to enter. - * @param enterdir The direction entering the tile. - * @param tracks The tracks available on new tile. - * @param[out] path_found Whether a path has been found. - * @return Best track on next tile or INVALID_TRACK when better to reverse. - */ -Track OPFShipChooseTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool &path_found) -{ - assert(IsValidDiagDirection(enterdir)); - - TileIndex tile2 = TILE_ADD(tile, -TileOffsByDiagDir(enterdir)); - Track track; - - /* Let's find out how far it would be if we would reverse first */ - uint rev_dist = UINT_MAX; // distance if we reverse - Track cur_track = TrackdirToTrack(v->GetVehicleTrackdir()); // track on the current tile - DiagDirection rev_enterdir = ReverseDiagDir(enterdir); - TrackBits rev_tracks = TrackStatusToTrackBits(GetTileTrackStatus(tile2, TRANSPORT_WATER, 0)) & - DiagdirReachesTracks(rev_enterdir); - - if (HasTrack(rev_tracks, cur_track)) { - rev_dist = FindShipTrack(v, tile2, rev_enterdir, TrackToTrackBits(cur_track), tile, &track); - if (rev_dist != UINT_MAX) rev_dist++; // penalty for reversing - } - - /* And if we would not reverse? */ - uint dist = FindShipTrack(v, tile, enterdir, tracks, 0, &track); - - /* Due to the way this pathfinder works we cannot determine whether we're lost or not. */ - path_found = true; - if (dist <= rev_dist) return track; - return INVALID_TRACK; // We could better reverse -} diff --git a/src/pathfinder/opf/opf_ship.h b/src/pathfinder/opf/opf_ship.h deleted file mode 100644 index 62668b206a..0000000000 --- a/src/pathfinder/opf/opf_ship.h +++ /dev/null @@ -1,31 +0,0 @@ -/* $Id$ */ - -/* - * This file is part of OpenTTD. - * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. - * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . - */ - -/** @file opf_ship.h Original pathfinder for ships; very simple. */ - -#ifndef OPF_SHIP_H -#define OPF_SHIP_H - -#include "../../direction_type.h" -#include "../../tile_type.h" -#include "../../track_type.h" -#include "../../vehicle_type.h" - -/** - * Finds the best path for given ship using OPF. - * @param v the ship that needs to find a path - * @param tile the tile to find the path from (should be next tile the ship is about to enter) - * @param enterdir diagonal direction which the ship will enter this new tile from - * @param tracks available tracks on the new tile (to choose from) - * @param path_found [out] Whether a path has been found (true) or has been guessed (false) - * @return the best trackdir for next turn or INVALID_TRACK if the path could not be found - */ -Track OPFShipChooseTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool &path_found); - -#endif /* OPF_SHIP_H */ diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index ea7882e895..6f32c5506f 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -1875,7 +1875,7 @@ bool AfterLoadGame() if (_settings_game.pf.yapf.ship_use_yapf) { _settings_game.pf.pathfinder_for_ships = VPF_YAPF; } else { - _settings_game.pf.pathfinder_for_ships = (_settings_game.pf.new_pathfinding_all ? VPF_NPF : VPF_OPF); + _settings_game.pf.pathfinder_for_ships = VPF_NPF; } } diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h index 77cce4c4a4..61d5273401 100644 --- a/src/saveload/saveload.h +++ b/src/saveload/saveload.h @@ -296,6 +296,7 @@ enum SaveLoadVersion : uint16 { SLV_SERVE_NEUTRAL_INDUSTRIES, ///< 210 PR#7234 Company stations can serve industries with attached neutral stations. SLV_ROADVEH_PATH_CACHE, ///< 211 PR#7261 Add path cache for road vehicles. + SLV_REMOVE_OPF, ///< 212 PR#7245 Remove OPF. SL_MAX_VERSION, ///< Highest possible saveload version }; diff --git a/src/settings.cpp b/src/settings.cpp index 1fc2682cd0..6ea5c081a3 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -2275,18 +2275,6 @@ static void Save_PATS() SaveSettings(_settings, &_settings_game); } -void CheckConfig() -{ - /* - * Increase old default values for pf_maxdepth and pf_maxlength - * to support big networks. - */ - if (_settings_newgame.pf.opf.pf_maxdepth == 16 && _settings_newgame.pf.opf.pf_maxlength == 512) { - _settings_newgame.pf.opf.pf_maxdepth = 48; - _settings_newgame.pf.opf.pf_maxlength = 4096; - } -} - extern const ChunkHandler _setting_chunk_handlers[] = { { 'OPTS', NULL, Load_OPTS, NULL, NULL, CH_RIFF}, { 'PATS', Save_PATS, Load_PATS, NULL, Check_PATS, CH_RIFF | CH_LAST}, diff --git a/src/settings_func.h b/src/settings_func.h index 3b3387b5fd..c258cb6404 100644 --- a/src/settings_func.h +++ b/src/settings_func.h @@ -24,7 +24,6 @@ void IConsoleListSettings(const char *prefilter); void LoadFromConfig(bool minimal = false); void SaveToConfig(); -void CheckConfig(); void IniLoadWindowSettings(IniFile *ini, const char *grpname, void *desc); void IniSaveWindowSettings(IniFile *ini, const char *grpname, void *desc); diff --git a/src/settings_type.h b/src/settings_type.h index 503342545f..42f8b45170 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -346,12 +346,6 @@ struct ScriptSettings { uint32 script_max_opcode_till_suspend; ///< max opcode calls till scripts will suspend }; -/** Settings related to the old pathfinder. */ -struct OPFSettings { - uint16 pf_maxlength; ///< maximum length when searching for a train route for new pathfinder - byte pf_maxdepth; ///< maximum recursion depth when searching for a train route for new pathfinder -}; - /** Settings related to the new pathfinder. */ struct NPFSettings { /** @@ -440,7 +434,6 @@ struct PathfinderSettings { byte wait_for_pbs_path; ///< how long to wait for a path reservation. byte path_backoff_interval; ///< ticks between checks for a free path. - OPFSettings opf; ///< pathfinder settings for the old pathfinder NPFSettings npf; ///< pathfinder settings for the new pathfinder YAPFSettings yapf; ///< pathfinder settings for the yet another pathfinder }; diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 6d6f8415c8..c04d3e1e2f 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -29,7 +29,6 @@ #include "sound_func.h" #include "ai/ai.hpp" #include "game/game.hpp" -#include "pathfinder/opf/opf_ship.h" #include "engine_base.h" #include "company_base.h" #include "tunnelbridge_map.h" @@ -178,7 +177,6 @@ static void CheckIfShipNeedsService(Vehicle *v) uint max_distance; switch (_settings_game.pf.pathfinder_for_ships) { - case VPF_OPF: max_distance = 12; break; case VPF_NPF: max_distance = _settings_game.pf.npf.maximum_go_to_depot_penalty / NPF_TILE_LENGTH; break; case VPF_YAPF: max_distance = _settings_game.pf.yapf.maximum_go_to_depot_penalty / YAPF_TILE_LENGTH; break; default: NOT_REACHED(); @@ -369,9 +367,7 @@ static bool CheckShipLeaveDepot(Ship *v) if (north_tracks && south_tracks) { /* Ask pathfinder for best direction */ bool reverse = false; - bool path_found; switch (_settings_game.pf.pathfinder_for_ships) { - case VPF_OPF: reverse = OPFShipChooseTrack(v, north_neighbour, north_dir, north_tracks, path_found) == INVALID_TRACK; break; // OPF always allows reversing case VPF_NPF: reverse = NPFShipCheckReverse(v); break; case VPF_YAPF: reverse = YapfShipCheckReverse(v); break; default: NOT_REACHED(); @@ -492,7 +488,6 @@ static Track ChooseShipTrack(Ship *v, TileIndex tile, DiagDirection enterdir, Tr } switch (_settings_game.pf.pathfinder_for_ships) { - case VPF_OPF: track = OPFShipChooseTrack(v, tile, enterdir, tracks, path_found); break; case VPF_NPF: track = NPFShipChooseTrack(v, path_found); break; case VPF_YAPF: track = YapfShipChooseTrack(v, tile, enterdir, tracks, path_found, v->path); break; default: NOT_REACHED(); @@ -514,8 +509,7 @@ static inline TrackBits GetAvailShipTracks(TileIndex tile, DiagDirection dir, Tr { TrackBits tracks = GetTileShipTrackStatus(tile) & DiagdirReachesTracks(dir); - /* Do not remove 90 degree turns for OPF, as it isn't able to find paths taking it into account. */ - if (_settings_game.pf.forbid_90_deg && _settings_game.pf.pathfinder_for_ships != VPF_OPF) tracks &= ~TrackCrossesTracks(TrackdirToTrack(trackdir)); + if (_settings_game.pf.forbid_90_deg) tracks &= ~TrackCrossesTracks(TrackdirToTrack(trackdir)); return tracks; } diff --git a/src/table/settings.ini b/src/table/settings.ini index 13d8483627..7ab00d5a34 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -953,12 +953,12 @@ type = SLE_UINT8 from = SLV_87 guiflags = SGF_MULTISTRING def = 2 -min = 0 +min = 1 max = 2 interval = 1 str = STR_CONFIG_SETTING_PATHFINDER_FOR_SHIPS strhelp = STR_CONFIG_SETTING_PATHFINDER_FOR_SHIPS_HELPTEXT -strval = STR_CONFIG_SETTING_PATHFINDER_OPF +strval = STR_CONFIG_SETTING_PATHFINDER_NPF proc = InvalidateShipPathCache cat = SC_EXPERT @@ -1670,23 +1670,10 @@ max = 255 cat = SC_EXPERT ## -[SDT_VAR] -base = GameSettings -var = pf.opf.pf_maxlength -type = SLE_UINT16 -def = 4096 -min = 64 -max = 65535 -cat = SC_EXPERT - -[SDT_VAR] -base = GameSettings -var = pf.opf.pf_maxdepth -type = SLE_UINT8 -def = 48 -min = 4 -max = 255 -cat = SC_EXPERT +; Used to be pf.opf.pf_maxlength & pf.opf.pf_maxdepth +[SDT_NULL] +length = 3 +to = SLV_REMOVE_OPF ## [SDT_VAR] diff --git a/src/vehicle_type.h b/src/vehicle_type.h index f3e7d535fd..1bc5bcef41 100644 --- a/src/vehicle_type.h +++ b/src/vehicle_type.h @@ -60,7 +60,7 @@ static const VehicleID INVALID_VEHICLE = 0xFFFFF; ///< Constant representing a n /** Pathfinding option states */ enum VehiclePathFinders { - VPF_OPF = 0, ///< The Original PathFinder (only for ships) + // Original PathFinder (OPF) used to be 0 VPF_NPF = 1, ///< New PathFinder VPF_YAPF = 2, ///< Yet Another PathFinder }; From 592f591a4b7bbc2b2142015a463d8cae1d396f35 Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Mon, 18 Feb 2019 23:56:04 +0000 Subject: [PATCH 08/82] Cleanup: Unused lang strings --- src/lang/afrikaans.txt | 1 - src/lang/arabic_egypt.txt | 1 - src/lang/basque.txt | 1 - src/lang/belarusian.txt | 1 - src/lang/brazilian_portuguese.txt | 1 - src/lang/bulgarian.txt | 1 - src/lang/catalan.txt | 1 - src/lang/croatian.txt | 1 - src/lang/czech.txt | 1 - src/lang/danish.txt | 1 - src/lang/dutch.txt | 1 - src/lang/english.txt | 1 - src/lang/english_AU.txt | 1 - src/lang/english_US.txt | 1 - src/lang/esperanto.txt | 1 - src/lang/estonian.txt | 1 - src/lang/faroese.txt | 1 - src/lang/finnish.txt | 1 - src/lang/french.txt | 1 - src/lang/gaelic.txt | 1 - src/lang/galician.txt | 1 - src/lang/german.txt | 1 - src/lang/greek.txt | 1 - src/lang/hebrew.txt | 1 - src/lang/hungarian.txt | 1 - src/lang/icelandic.txt | 1 - src/lang/indonesian.txt | 1 - src/lang/irish.txt | 1 - src/lang/italian.txt | 1 - src/lang/japanese.txt | 1 - src/lang/korean.txt | 1 - src/lang/latin.txt | 1 - src/lang/latvian.txt | 1 - src/lang/lithuanian.txt | 1 - src/lang/luxembourgish.txt | 1 - src/lang/malay.txt | 1 - src/lang/norwegian_bokmal.txt | 1 - src/lang/norwegian_nynorsk.txt | 1 - src/lang/polish.txt | 1 - src/lang/portuguese.txt | 1 - src/lang/romanian.txt | 1 - src/lang/russian.txt | 1 - src/lang/serbian.txt | 1 - src/lang/simplified_chinese.txt | 1 - src/lang/slovak.txt | 1 - src/lang/slovenian.txt | 1 - src/lang/spanish.txt | 1 - src/lang/spanish_MX.txt | 1 - src/lang/swedish.txt | 1 - src/lang/tamil.txt | 1 - src/lang/thai.txt | 1 - src/lang/traditional_chinese.txt | 1 - src/lang/turkish.txt | 1 - src/lang/ukrainian.txt | 1 - src/lang/unfinished/frisian.txt | 1 - src/lang/unfinished/persian.txt | 1 - src/lang/unfinished/urdu.txt | 1 - src/lang/vietnamese.txt | 1 - src/lang/welsh.txt | 1 - 59 files changed, 59 deletions(-) diff --git a/src/lang/afrikaans.txt b/src/lang/afrikaans.txt index 9ac3830e6a..488332081c 100644 --- a/src/lang/afrikaans.txt +++ b/src/lang/afrikaans.txt @@ -1685,7 +1685,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Vragver STR_CONFIG_SETTING_AI :{ORANGE}Mededingers STR_CONFIG_SETTING_AI_NPC :{ORANGE}Rekenaar spelers -STR_CONFIG_SETTING_PATHFINDER_OPF :Oorspronklik STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Aanbevole) diff --git a/src/lang/arabic_egypt.txt b/src/lang/arabic_egypt.txt index 7fe2ac1da0..3da270ad32 100644 --- a/src/lang/arabic_egypt.txt +++ b/src/lang/arabic_egypt.txt @@ -1369,7 +1369,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :توزيع ال STR_CONFIG_SETTING_AI :{ORANGE}المتنافسين STR_CONFIG_SETTING_AI_NPC :{ORANGE} لاعبين الحاسوب -STR_CONFIG_SETTING_PATHFINDER_OPF :اصلي STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(مفضل) diff --git a/src/lang/basque.txt b/src/lang/basque.txt index 1c3b038844..046e0f7816 100644 --- a/src/lang/basque.txt +++ b/src/lang/basque.txt @@ -1598,7 +1598,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Zama ba STR_CONFIG_SETTING_AI :{ORANGE}Lehiakideak STR_CONFIG_SETTING_AI_NPC :{ORANGE}Ordenagailu jokalariak -STR_CONFIG_SETTING_PATHFINDER_OPF :Jatorrizkoa STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Gomendatua) diff --git a/src/lang/belarusian.txt b/src/lang/belarusian.txt index 64bf4ce1da..3baf40f69f 100644 --- a/src/lang/belarusian.txt +++ b/src/lang/belarusian.txt @@ -2009,7 +2009,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Раз STR_CONFIG_SETTING_AI :{ORANGE}Канкурэнты STR_CONFIG_SETTING_AI_NPC :{ORANGE}Кампутарныя гульцы -STR_CONFIG_SETTING_PATHFINDER_OPF :арыґінальны STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(рэкамэндуецца) diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt index 0bf7addacc..fb9cce3057 100644 --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -1700,7 +1700,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distrib STR_CONFIG_SETTING_AI :{ORANGE}Oponentes STR_CONFIG_SETTING_AI_NPC :{ORANGE}Computadores -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Recomendado) diff --git a/src/lang/bulgarian.txt b/src/lang/bulgarian.txt index 3ae4974b48..0ed560da1b 100644 --- a/src/lang/bulgarian.txt +++ b/src/lang/bulgarian.txt @@ -1634,7 +1634,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Инд STR_CONFIG_SETTING_AI :{ORANGE}Съперници STR_CONFIG_SETTING_AI_NPC :{ORANGE}Компютърни играчи -STR_CONFIG_SETTING_PATHFINDER_OPF :Оригинален STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(препоръчва се) diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index 85692edc37..4d889fd3b4 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -1715,7 +1715,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distrib STR_CONFIG_SETTING_AI :{ORANGE}Competidors STR_CONFIG_SETTING_AI_NPC :{ORANGE}Jugadors IA -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Recomanat) diff --git a/src/lang/croatian.txt b/src/lang/croatian.txt index 3b659bbf1c..701bd7fb98 100644 --- a/src/lang/croatian.txt +++ b/src/lang/croatian.txt @@ -1812,7 +1812,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distrib STR_CONFIG_SETTING_AI :{ORANGE}Suparnici STR_CONFIG_SETTING_AI_NPC :{ORANGE}Računalni igrači -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Preporučljivo) diff --git a/src/lang/czech.txt b/src/lang/czech.txt index e8b8c2a292..5a22128758 100644 --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -1778,7 +1778,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distrib STR_CONFIG_SETTING_AI :{ORANGE}Konkurenti STR_CONFIG_SETTING_AI_NPC :{ORANGE}Umělá inteligence -STR_CONFIG_SETTING_PATHFINDER_OPF :Původní STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(doporučený) diff --git a/src/lang/danish.txt b/src/lang/danish.txt index 9301a698b0..5a30026efe 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -1716,7 +1716,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Fragtdi STR_CONFIG_SETTING_AI :{ORANGE}Modstandere STR_CONFIG_SETTING_AI_NPC :{ORANGE}Computerstyrede spillere -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Anbefalet) diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index d20fcafede..e2ee98fdad 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -1716,7 +1716,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Vrachtd STR_CONFIG_SETTING_AI :{ORANGE}Tegenstanders STR_CONFIG_SETTING_AI_NPC :{ORANGE}Computerspelers -STR_CONFIG_SETTING_PATHFINDER_OPF :Origineel STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Aanbevolen) diff --git a/src/lang/english.txt b/src/lang/english.txt index b6146718f2..209c452e2d 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1716,7 +1716,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Cargo d STR_CONFIG_SETTING_AI :{ORANGE}Competitors STR_CONFIG_SETTING_AI_NPC :{ORANGE}Computer players -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Recommended) diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt index 5deb9abd49..10bed1fb42 100644 --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -1663,7 +1663,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Cargo d STR_CONFIG_SETTING_AI :{ORANGE}Competitors STR_CONFIG_SETTING_AI_NPC :{ORANGE}Computer players -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Recommended) diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index aaedcbb656..6fccdf640e 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -1714,7 +1714,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Cargo d STR_CONFIG_SETTING_AI :{ORANGE}Competitors STR_CONFIG_SETTING_AI_NPC :{ORANGE}Computer players -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Recommended) diff --git a/src/lang/esperanto.txt b/src/lang/esperanto.txt index 910be6be85..964f1f44d8 100644 --- a/src/lang/esperanto.txt +++ b/src/lang/esperanto.txt @@ -1368,7 +1368,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Industr STR_CONFIG_SETTING_AI :{ORANGE}Konkurantoj STR_CONFIG_SETTING_AI_NPC :{ORANGE}Komputil-ludantoj -STR_CONFIG_SETTING_PATHFINDER_OPF :Originale STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Rekomendite) diff --git a/src/lang/estonian.txt b/src/lang/estonian.txt index f031b77def..f8210e6596 100644 --- a/src/lang/estonian.txt +++ b/src/lang/estonian.txt @@ -1745,7 +1745,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Kaubaja STR_CONFIG_SETTING_AI :{ORANGE}Konkurendid STR_CONFIG_SETTING_AI_NPC :{ORANGE}Arvuti -STR_CONFIG_SETTING_PATHFINDER_OPF :Algne STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(soovitatud) diff --git a/src/lang/faroese.txt b/src/lang/faroese.txt index a9f862e87c..d85ad04ccf 100644 --- a/src/lang/faroese.txt +++ b/src/lang/faroese.txt @@ -1523,7 +1523,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Ídnað STR_CONFIG_SETTING_AI :{ORANGE}Kappingarneytar STR_CONFIG_SETTING_AI_NPC :{ORANGE}Teldu spælarir -STR_CONFIG_SETTING_PATHFINDER_OPF :Upprunaligur STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Viðmældur) diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index 543e091f1d..829ac56867 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -1716,7 +1716,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Rahdin STR_CONFIG_SETTING_AI :{ORANGE}Kilpailijat STR_CONFIG_SETTING_AI_NPC :{ORANGE}Tietokonepelaajat -STR_CONFIG_SETTING_PATHFINDER_OPF :Alkuperäinen STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Suositeltu) diff --git a/src/lang/french.txt b/src/lang/french.txt index 15d9149f07..97d2f9110d 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -1711,7 +1711,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distrib STR_CONFIG_SETTING_AI :{ORANGE}Compétiteurs STR_CONFIG_SETTING_AI_NPC :{ORANGE}Intelligence artificielle -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(recommandé) diff --git a/src/lang/gaelic.txt b/src/lang/gaelic.txt index 958a185c10..36df72dcee 100644 --- a/src/lang/gaelic.txt +++ b/src/lang/gaelic.txt @@ -1894,7 +1894,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Sgaoile STR_CONFIG_SETTING_AI :{ORANGE}Co-farpaisichean STR_CONFIG_SETTING_AI_NPC :{ORANGE}Cluicheadairean coimpiutair -STR_CONFIG_SETTING_PATHFINDER_OPF :Tùsail STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(molta) diff --git a/src/lang/galician.txt b/src/lang/galician.txt index 5741587d7a..7f4e97f733 100644 --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -1687,7 +1687,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distrib STR_CONFIG_SETTING_AI :{ORANGE}Competidores STR_CONFIG_SETTING_AI_NPC :{ORANGE}Xogadores da computadora -STR_CONFIG_SETTING_PATHFINDER_OPF :Orixinal STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Recomendado) diff --git a/src/lang/german.txt b/src/lang/german.txt index 3020bee3f6..0a0501e614 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -1705,7 +1705,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Warenve STR_CONFIG_SETTING_AI :{ORANGE}Mitbewerber STR_CONFIG_SETTING_AI_NPC :{ORANGE}Computerspieler -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(empfohlen) diff --git a/src/lang/greek.txt b/src/lang/greek.txt index b185997c4e..4ac355e6d8 100644 --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -1807,7 +1807,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Κατ STR_CONFIG_SETTING_AI :{ORANGE}Ανταγωνιστές STR_CONFIG_SETTING_AI_NPC :{ORANGE}Παίκτες υπολογιστή -STR_CONFIG_SETTING_PATHFINDER_OPF :Αρχικό STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Συνίσταται) diff --git a/src/lang/hebrew.txt b/src/lang/hebrew.txt index 3f7f1457eb..e730e0c3ea 100644 --- a/src/lang/hebrew.txt +++ b/src/lang/hebrew.txt @@ -1709,7 +1709,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}התפ STR_CONFIG_SETTING_AI :{ORANGE}מתחרים STR_CONFIG_SETTING_AI_NPC :{ORANGE}שחקני מחשב -STR_CONFIG_SETTING_PATHFINDER_OPF :מקורי STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(מומלץ) diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index e76394be51..914b2a2a4d 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -1780,7 +1780,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Rakomá STR_CONFIG_SETTING_AI :{ORANGE}Ellenfelek STR_CONFIG_SETTING_AI_NPC :{ORANGE}Számítógép által vezérelt ellenfelek -STR_CONFIG_SETTING_PATHFINDER_OPF :Eredeti STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Ajánlott) diff --git a/src/lang/icelandic.txt b/src/lang/icelandic.txt index 466616e062..5ef33b5b28 100644 --- a/src/lang/icelandic.txt +++ b/src/lang/icelandic.txt @@ -1551,7 +1551,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Iðnað STR_CONFIG_SETTING_AI :{ORANGE}Mótherji STR_CONFIG_SETTING_AI_NPC :{ORANGE}Gervigreind -STR_CONFIG_SETTING_PATHFINDER_OPF :Upprunalegt STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Ráðlegt) diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index 3937bcd763..f2f52e7a7e 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -1694,7 +1694,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distrib STR_CONFIG_SETTING_AI :{ORANGE}Pesaing STR_CONFIG_SETTING_AI_NPC :{ORANGE}Pemain Komputer -STR_CONFIG_SETTING_PATHFINDER_OPF :Asli STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Recommended) diff --git a/src/lang/irish.txt b/src/lang/irish.txt index 3581552a4c..61fb68954d 100644 --- a/src/lang/irish.txt +++ b/src/lang/irish.txt @@ -1684,7 +1684,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Dáilea STR_CONFIG_SETTING_AI :{ORANGE}Iomaitheoirí STR_CONFIG_SETTING_AI_NPC :{ORANGE}Ríomh-imreoirí -STR_CONFIG_SETTING_PATHFINDER_OPF :Bunaidh STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Molta) diff --git a/src/lang/italian.txt b/src/lang/italian.txt index fe63ab589c..7a7f799d69 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -1734,7 +1734,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distrib STR_CONFIG_SETTING_AI :{ORANGE}Avversari STR_CONFIG_SETTING_AI_NPC :{ORANGE}Giocatori controllati dal computer -STR_CONFIG_SETTING_PATHFINDER_OPF :Originale STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(raccomandato) diff --git a/src/lang/japanese.txt b/src/lang/japanese.txt index eac47fcef2..6977a8a5be 100644 --- a/src/lang/japanese.txt +++ b/src/lang/japanese.txt @@ -1684,7 +1684,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}貨物 STR_CONFIG_SETTING_AI :{ORANGE}競争会社 STR_CONFIG_SETTING_AI_NPC :{ORANGE}コンピュータプレイヤー -STR_CONFIG_SETTING_PATHFINDER_OPF :オリジナル STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF{BLUE}(おすすめ) diff --git a/src/lang/korean.txt b/src/lang/korean.txt index b74219005f..fb0cc1052c 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -1711,7 +1711,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}화물 STR_CONFIG_SETTING_AI :{ORANGE}경쟁자 STR_CONFIG_SETTING_AI_NPC :{ORANGE}컴퓨터 플레이어 -STR_CONFIG_SETTING_PATHFINDER_OPF :오리지널 STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(권장) diff --git a/src/lang/latin.txt b/src/lang/latin.txt index ad37801bcc..63ebbcbc12 100644 --- a/src/lang/latin.txt +++ b/src/lang/latin.txt @@ -1884,7 +1884,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Partiti STR_CONFIG_SETTING_AI :{ORANGE}Competitores STR_CONFIG_SETTING_AI_NPC :{ORANGE}Lusores computatrales -STR_CONFIG_SETTING_PATHFINDER_OPF :Originale STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Commendatum) diff --git a/src/lang/latvian.txt b/src/lang/latvian.txt index c96d7a433d..05ff2588b4 100644 --- a/src/lang/latvian.txt +++ b/src/lang/latvian.txt @@ -1632,7 +1632,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Kravu s STR_CONFIG_SETTING_AI :{ORANGE}Sāncenši STR_CONFIG_SETTING_AI_NPC :{ORANGE}Nespēlētāju tēli (datora vadīti) -STR_CONFIG_SETTING_PATHFINDER_OPF :Sākotnējais STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(ieteicamais) diff --git a/src/lang/lithuanian.txt b/src/lang/lithuanian.txt index 5edd5cb95c..742e192eea 100644 --- a/src/lang/lithuanian.txt +++ b/src/lang/lithuanian.txt @@ -1903,7 +1903,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Krovini STR_CONFIG_SETTING_AI :{ORANGE}Konkurentai STR_CONFIG_SETTING_AI_NPC :{ORANGE}Kompiuterio žaidėjai -STR_CONFIG_SETTING_PATHFINDER_OPF :Originalus STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Rekomenduojama) diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt index ac29b6e65a..916b263e9a 100644 --- a/src/lang/luxembourgish.txt +++ b/src/lang/luxembourgish.txt @@ -1686,7 +1686,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Wuereve STR_CONFIG_SETTING_AI :{ORANGE}Géigner STR_CONFIG_SETTING_AI_NPC :{ORANGE}Computerspiller -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(recommandéiert) diff --git a/src/lang/malay.txt b/src/lang/malay.txt index a7b69866ba..a5553ad6ad 100644 --- a/src/lang/malay.txt +++ b/src/lang/malay.txt @@ -1450,7 +1450,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Industr STR_CONFIG_SETTING_AI :{ORANGE}Pesaing STR_CONFIG_SETTING_AI_NPC :{ORANGE}Pemain komputer -STR_CONFIG_SETTING_PATHFINDER_OPF :Asal STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Disyorkan) diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt index 78e72ea0ab..3fae530b8f 100644 --- a/src/lang/norwegian_bokmal.txt +++ b/src/lang/norwegian_bokmal.txt @@ -1719,7 +1719,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Gods-di STR_CONFIG_SETTING_AI :{ORANGE}Motstandere STR_CONFIG_SETTING_AI_NPC :{ORANGE}Datamaskinstyrte spillere -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Anbefalt) diff --git a/src/lang/norwegian_nynorsk.txt b/src/lang/norwegian_nynorsk.txt index 2a71571c22..e998101d34 100644 --- a/src/lang/norwegian_nynorsk.txt +++ b/src/lang/norwegian_nynorsk.txt @@ -1607,7 +1607,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Varefor STR_CONFIG_SETTING_AI :{ORANGE}Motstandarar STR_CONFIG_SETTING_AI_NPC :{ORANGE}Datamaskinspelarar -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Anbefalt) diff --git a/src/lang/polish.txt b/src/lang/polish.txt index 6ff0d135d3..2b7ee1b4a8 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -2084,7 +2084,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Dystryb STR_CONFIG_SETTING_AI :{ORANGE}Rywale STR_CONFIG_SETTING_AI_NPC :{ORANGE}Gracze komputerowi -STR_CONFIG_SETTING_PATHFINDER_OPF :Oryginalne STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Zalecane) diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index 329af3ca48..e2ba14b44b 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -1711,7 +1711,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distrib STR_CONFIG_SETTING_AI :{ORANGE}Oponentes STR_CONFIG_SETTING_AI_NPC :{ORANGE}Jogadores Computador -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Recomendado) diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index 074c65fce9..e1deb9971f 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -1665,7 +1665,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distrib STR_CONFIG_SETTING_AI :{ORANGE}Concurenţi STR_CONFIG_SETTING_AI_NPC :{ORANGE}Jucători virtuali -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Recomandat) diff --git a/src/lang/russian.txt b/src/lang/russian.txt index c78b2cdc0b..400cc1b8db 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -1868,7 +1868,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Рас STR_CONFIG_SETTING_AI :{ORANGE}Конкуренты STR_CONFIG_SETTING_AI_NPC :{ORANGE}Искусственный интеллект -STR_CONFIG_SETTING_PATHFINDER_OPF :оригинальный STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Рекомендуется) diff --git a/src/lang/serbian.txt b/src/lang/serbian.txt index 9704d5c92d..fd8da75b77 100644 --- a/src/lang/serbian.txt +++ b/src/lang/serbian.txt @@ -1891,7 +1891,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distrib STR_CONFIG_SETTING_AI :{ORANGE}Suparnici STR_CONFIG_SETTING_AI_NPC :{ORANGE}Računar -STR_CONFIG_SETTING_PATHFINDER_OPF :Originalno STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Preporučuje se) diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index f79922a6fd..78e0623429 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -1694,7 +1694,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}货物 STR_CONFIG_SETTING_AI :{ORANGE}竞争 STR_CONFIG_SETTING_AI_NPC :{ORANGE}电脑玩家 -STR_CONFIG_SETTING_PATHFINDER_OPF :原始的 STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(推荐) diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt index ae47703491..6aec809897 100644 --- a/src/lang/slovak.txt +++ b/src/lang/slovak.txt @@ -1752,7 +1752,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distrib STR_CONFIG_SETTING_AI :{ORANGE}Konkurenti STR_CONFIG_SETTING_AI_NPC :{ORANGE}Počítačový hráči -STR_CONFIG_SETTING_PATHFINDER_OPF :Pôvodný STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(odporučený) diff --git a/src/lang/slovenian.txt b/src/lang/slovenian.txt index b9f22e74dc..2adfe3343a 100644 --- a/src/lang/slovenian.txt +++ b/src/lang/slovenian.txt @@ -1838,7 +1838,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Razpore STR_CONFIG_SETTING_AI :{ORANGE}Tekmeci STR_CONFIG_SETTING_AI_NPC :{ORANGE}Računalniški igralci -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Priporočeno) diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index 938fcbc7b3..158998666c 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -1696,7 +1696,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distrib STR_CONFIG_SETTING_AI :{ORANGE}Competidores STR_CONFIG_SETTING_AI_NPC :{ORANGE}Jugadores de la CPU (IA) -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Recomendado) diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt index c440f95bb5..b57aea35b3 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -1711,7 +1711,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distrib STR_CONFIG_SETTING_AI :{ORANGE}Competidores STR_CONFIG_SETTING_AI_NPC :{ORANGE}Jugadores no humanos -STR_CONFIG_SETTING_PATHFINDER_OPF :Original STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(recomendado) diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index 3aa154a2e7..e4016174dc 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -1704,7 +1704,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Godsdis STR_CONFIG_SETTING_AI :{ORANGE}Motståndare STR_CONFIG_SETTING_AI_NPC :{ORANGE}Datorspelare -STR_CONFIG_SETTING_PATHFINDER_OPF :Standard STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Rekommenderad) diff --git a/src/lang/tamil.txt b/src/lang/tamil.txt index ae273e4a19..c67f9ab064 100644 --- a/src/lang/tamil.txt +++ b/src/lang/tamil.txt @@ -1468,7 +1468,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}சர STR_CONFIG_SETTING_AI :{ORANGE}போட்டியாளர்கள் STR_CONFIG_SETTING_AI_NPC :{ORANGE}கணினி வீரர்கள் -STR_CONFIG_SETTING_PATHFINDER_OPF :அசல் STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(பரிந்துரைக்கப்பட்டது) diff --git a/src/lang/thai.txt b/src/lang/thai.txt index 4a33e7d6b5..99a011be6d 100644 --- a/src/lang/thai.txt +++ b/src/lang/thai.txt @@ -1635,7 +1635,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}กา STR_CONFIG_SETTING_AI :{ORANGE}คู่แข่ง STR_CONFIG_SETTING_AI_NPC :{ORANGE}ผู้เล่นคอมพิวเตอร์ -STR_CONFIG_SETTING_PATHFINDER_OPF :ดั้งเดิม STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(แนะนำ) diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt index 0148767bee..18e146e1ff 100644 --- a/src/lang/traditional_chinese.txt +++ b/src/lang/traditional_chinese.txt @@ -1684,7 +1684,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}貨物 STR_CONFIG_SETTING_AI :{ORANGE}競爭對手 STR_CONFIG_SETTING_AI_NPC :{ORANGE}電腦玩家 -STR_CONFIG_SETTING_PATHFINDER_OPF :預設 STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(建議) diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index b801e5c26c..16e8ccfa34 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -1709,7 +1709,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Kargo d STR_CONFIG_SETTING_AI :{ORANGE}Rakipler STR_CONFIG_SETTING_AI_NPC :{ORANGE}Bilgisayar oyuncuları -STR_CONFIG_SETTING_PATHFINDER_OPF :Özgün STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Önerilen) diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt index ba2f2c4ee2..a04f8b6e7b 100644 --- a/src/lang/ukrainian.txt +++ b/src/lang/ukrainian.txt @@ -1844,7 +1844,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Роз STR_CONFIG_SETTING_AI :{ORANGE}Конкуренти STR_CONFIG_SETTING_AI_NPC :{ORANGE}Віртуальні гравці -STR_CONFIG_SETTING_PATHFINDER_OPF :стандартний STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(рекомендовано) diff --git a/src/lang/unfinished/frisian.txt b/src/lang/unfinished/frisian.txt index 2c399a5208..9e6b3d470d 100644 --- a/src/lang/unfinished/frisian.txt +++ b/src/lang/unfinished/frisian.txt @@ -1635,7 +1635,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Frachtd STR_CONFIG_SETTING_AI :{ORANGE}Tsjinstânners STR_CONFIG_SETTING_AI_NPC :{ORANGE}Computer spilers -STR_CONFIG_SETTING_PATHFINDER_OPF :Orizjiniel STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Recommended) diff --git a/src/lang/unfinished/persian.txt b/src/lang/unfinished/persian.txt index 7818d765bf..5fd8737539 100644 --- a/src/lang/unfinished/persian.txt +++ b/src/lang/unfinished/persian.txt @@ -1414,7 +1414,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}توز STR_CONFIG_SETTING_AI :{ORANGE}رقیبان STR_CONFIG_SETTING_AI_NPC :{ORANGE}بازیگران رایانه -STR_CONFIG_SETTING_PATHFINDER_OPF :اصلی STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(توصیه می گردد) diff --git a/src/lang/unfinished/urdu.txt b/src/lang/unfinished/urdu.txt index 988a6c7862..af1a108c1d 100644 --- a/src/lang/unfinished/urdu.txt +++ b/src/lang/unfinished/urdu.txt @@ -1311,7 +1311,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}صنع STR_CONFIG_SETTING_AI :{ORANGE}مد مقابل STR_CONFIG_SETTING_AI_NPC :{ORANGE}کمپیوٹر کے کھلاڑی -STR_CONFIG_SETTING_PATHFINDER_OPF :اصلی STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Recommended) diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt index 1de743a340..0e72993f8e 100644 --- a/src/lang/vietnamese.txt +++ b/src/lang/vietnamese.txt @@ -1699,7 +1699,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Phân b STR_CONFIG_SETTING_AI :{ORANGE}Đối Thủ STR_CONFIG_SETTING_AI_NPC :{ORANGE}Nhân vật máy -STR_CONFIG_SETTING_PATHFINDER_OPF :Nguyên bản STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Nên dùng) diff --git a/src/lang/welsh.txt b/src/lang/welsh.txt index d991c3db33..131c05d6c2 100644 --- a/src/lang/welsh.txt +++ b/src/lang/welsh.txt @@ -1686,7 +1686,6 @@ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Dosrani STR_CONFIG_SETTING_AI :{ORANGE}Cystadleuwyr STR_CONFIG_SETTING_AI_NPC :{ORANGE}Chwaraewyr Cyfrifiadurol -STR_CONFIG_SETTING_PATHFINDER_OPF :Gwreiddiol STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(Argymellir) From c66b9c657a90a988076abedc43e66c39a7b41763 Mon Sep 17 00:00:00 2001 From: translators Date: Sun, 17 Mar 2019 19:45:44 +0100 Subject: [PATCH 09/82] Update: Translations from eints dutch: 1 change by JanWillem russian: 1 change by Lone_Wolf --- src/lang/dutch.txt | 1 + src/lang/russian.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index e2ee98fdad..ced8ca5b03 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -3033,6 +3033,7 @@ STR_NEWGRF_BUGGY :{WHITE}NewGRF ' STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Vracht- of ombouwinformatie voor '{1:ENGINE}' wijkt af van aanschaflijst na het bouwen. Dit kan resulteren in problemen bij ombouwen door automatisch vernieuwen/vervangen STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' heeft een eindeloze loop veroorzaakt in de productiecallback STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}Callback {1:HEX} gaf onbekend/ongeldig resultaat {2:HEX} +STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' retourneerde een ongeldig vrachttype in de productie-terugroep op {2:HEX} # 'User removed essential NewGRFs'-placeholders for stuff without specs STR_NEWGRF_INVALID_CARGO : diff --git a/src/lang/russian.txt b/src/lang/russian.txt index 400cc1b8db..af60eb745b 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -3213,6 +3213,7 @@ STR_NEWGRF_BUGGY :{WHITE}NewGRF STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Информация о вместимости/переоборудовании для локомотива «{1:ENGINE}» после постройки отличается от сведений в списке покупки, что может помешать функции автообновления/автозамены корректно произвести переоборудование. STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK :{WHITE}Модуль «{1:STRING}» вызвал бесконечный цикл STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}Функция обратного вызова {1:HEX} вернула непонятный/неверный результат {2:HEX} +STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK :{WHITE}«{1:STRING}» вернул неверный тип груза по адресу {2:HEX} # 'User removed essential NewGRFs'-placeholders for stuff without specs STR_NEWGRF_INVALID_CARGO :<неизвестный груз> From 43caef2968bccdab63896e816ee86f9d70f3c769 Mon Sep 17 00:00:00 2001 From: stormcone <48624099+stormcone@users.noreply.github.com> Date: Sun, 17 Mar 2019 21:28:37 +0100 Subject: [PATCH 10/82] Fix f58fa80e: Wrong company performance rating when money exceeds INT_MAX. (#7382) Company performance rating calculation does not take into account the companies' money when those exceeds INT_MAX. --- src/economy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/economy.cpp b/src/economy.cpp index 197298d9b2..19b36e7c9e 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -260,7 +260,7 @@ int UpdateCompanyRatingAndValue(Company *c, bool update) /* Skip the total */ if (i == SCORE_TOTAL) continue; /* Check the score */ - s = Clamp(_score_part[owner][i], 0, _score_info[i].needed) * _score_info[i].score / _score_info[i].needed; + s = Clamp(_score_part[owner][i], 0, _score_info[i].needed) * _score_info[i].score / _score_info[i].needed; score += s; total_score += _score_info[i].score; } From fe13fadcfb2b00738faeae532ed4308875e3fcb5 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sun, 17 Mar 2019 21:50:32 +0100 Subject: [PATCH 11/82] Codechange: fix Intel C++ Compiler linking issues. GetAircraftFlightLevel is only used in static functions inside aircraft_cmd.cpp. With GCC, Clang and MSVC this is not an issue, but on ICC fails linking, because it doesn't find this version of this template. Possibly these two pieces of information are linked. Explicit defining the function fixes the issue. --- src/aircraft_cmd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index b08cb188d3..99c86d6e17 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -783,6 +783,7 @@ int GetAircraftFlightLevel(T *v, bool takeoff) } template int GetAircraftFlightLevel(DisasterVehicle *v, bool takeoff); +template int GetAircraftFlightLevel(Aircraft *v, bool takeoff); /** * Find the entry point to an airport depending on direction which From 559d4e833560bfd0a62ea65f5556920122a4930d Mon Sep 17 00:00:00 2001 From: translators Date: Tue, 19 Mar 2019 19:45:46 +0100 Subject: [PATCH 12/82] Update: Translations from eints korean: 7 changes by telk5093 --- src/lang/korean.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lang/korean.txt b/src/lang/korean.txt index fb0cc1052c..803ec85b07 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -1185,6 +1185,8 @@ STR_CONFIG_SETTING_AUTOSLOPE :건물, 트랙 STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :건물이나 도로/선로 등을 제거하지 않고도 하부의 지형을 편집할 수 있게 허용합니다. STR_CONFIG_SETTING_CATCHMENT :더 현실적인 역세권 지정: {STRING} STR_CONFIG_SETTING_CATCHMENT_HELPTEXT :역과 공항의 종류에 따라 다른 크기의 역세권을 가지도록 만듭니다. +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES :역이 붙어 있는 산업 시설의 화물을 회사의 역이 취급 가능: {STRING} +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES_HELPTEXT :이 설정을 켜면, (유전과 같이) 역이 붙어 있는 산업시설이 근처에 지은 회사 소유의 역에서도 화물을 취급할 수 있습니다. 이 설정을 끄면, 반드시 산업시설에 붙어 있는 역에서만 화물을 취급할 수 있습니다. 인근에 있는 모든 회사 소유의 역은 화물을 취급할 수 없게 되며, 산업시설에 붙어 있는 역도 그 산업시설 이외의 화물을 취급할 수 없게 됩니다. STR_CONFIG_SETTING_EXTRADYNAMITE :도시 소유의 도로, 다리 등의 제거 허용: {STRING} STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT :도시 소유의 기반시설이나 건물을 제거할 수 있게 합니다. STR_CONFIG_SETTING_TRAIN_LENGTH :열차의 최대 길이: {STRING} @@ -1584,6 +1586,10 @@ STR_CONFIG_SETTING_TOWN_FOUNDING_HELPTEXT :플레이어가 STR_CONFIG_SETTING_TOWN_FOUNDING_FORBIDDEN :금지 STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED :허용 STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED_CUSTOM_LAYOUT :허용, 도시 구조 선택 가능 +STR_CONFIG_SETTING_TOWN_CARGOGENMODE :도시 화물 생성: {STRING} +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_HELPTEXT :도시의 전반적인 인구에 따라, 도시가 얼마나 많은 화물을 생산하는 지를 설정합니다.{}제곱 성장: 도시의 규모가 2배 커지면 승객을 4배 더 생산합니다.{}선형 성장: 도시의 규모가 2배 커지면 승객을 2배 더 생산합니다. +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_ORIGINAL :제곱 (기본) +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_BITCOUNT :선형 STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT :게임 진행 중에 나무가 자동적으로 번식: {STRING} STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_HELPTEXT :게임 중에 나무가 자동적으로 번식하는지 여부를 조절합니다. 이 설정을 조정하면, 아열대 기후의 벌목소처럼 나무의 성장에 의존하는 산업시설에 영향을 끼칠 수 있습니다. @@ -3028,6 +3034,7 @@ STR_NEWGRF_BUGGY :{WHITE}NewGRF ' STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}{1:ENGINE}(을)를 만들기 이전과 이후의 화물/개조 정보가 현재의 구매 목록과 다릅니다. 이 경우 자동 교체시 열차 개조에 실패할 수도 있습니다. STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' 때문에 결과물 콜백 과정에서 무한 루프가 발생하고 있습니다. STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}콜백 함수({1:HEX})가 알 수 없거나 잘못된 결과 값({2:HEX})을 반환했습니다. +STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' - 생산 콜백 함수의 {2:HEX}에서 잘못된 화물 종류를 반환했습니다. # 'User removed essential NewGRFs'-placeholders for stuff without specs STR_NEWGRF_INVALID_CARGO :<알 수 없는 화물> From 72c5f2b3eed77120d86ecf636e07c71eb23b4bd5 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Tue, 19 Mar 2019 22:23:09 +0100 Subject: [PATCH 13/82] Remove: DOS support In 10 years there was no active development on DOS. Although it turned out to still work, the FPS was very bad. There is little interest in the current community to look into this. Further more, we like to switch to c++11 functions for threads, which are not implemented by DJGPP, the only current compiler for DOS. Additionally, DOS is the only platform which does not support networking. It is the reason we have tons of #ifdefs to support disabling networking. By removing DOS support, we can both use c++11 functions for threads, and remove all the code related to disabling network. Sadly, this means we have to see DOS go. Of course, if you feel up for the task, simply revert this commit, and implement stub c++11 functions for threads and stub functions for networking. We are more than happy to accept such Pull Request. --- Makefile.bundle.in | 6 - Makefile.src.in | 4 - README.md | 22 -- config.lib | 36 +- configure | 3 +- os/dos/cwsdpmi/README.licensing | 3 - os/dos/cwsdpmi/cwsdpmi.exe | Bin 20125 -> 0 bytes os/dos/cwsdpmi/cwsdpmi.txt | 173 --------- os/dos/cwsdpmi/cwsdstub.exe | Bin 21504 -> 0 bytes os/dos/exe2coff/README.licensing | 3 - os/dos/exe2coff/copying | 339 ----------------- os/dos/exe2coff/copying.dj | 48 --- os/dos/exe2coff/copying.lib | 481 ------------------------ os/dos/exe2coff/exe2coff.c | 94 ----- os/dos/make_dos_binary_selfcontained.sh | 11 - source.list | 5 +- src/core/endian_type.hpp | 2 +- src/cpu.cpp | 2 +- src/fileio.cpp | 6 +- src/intro_gui.cpp | 2 - src/lang/afrikaans.txt | 1 - src/lang/arabic_egypt.txt | 1 - src/lang/basque.txt | 1 - src/lang/belarusian.txt | 1 - src/lang/brazilian_portuguese.txt | 1 - src/lang/bulgarian.txt | 1 - src/lang/catalan.txt | 1 - src/lang/croatian.txt | 1 - src/lang/czech.txt | 1 - src/lang/danish.txt | 1 - src/lang/dutch.txt | 1 - src/lang/english.txt | 1 - src/lang/english_AU.txt | 1 - src/lang/english_US.txt | 1 - src/lang/esperanto.txt | 1 - src/lang/estonian.txt | 1 - src/lang/faroese.txt | 1 - src/lang/finnish.txt | 1 - src/lang/french.txt | 1 - src/lang/gaelic.txt | 1 - src/lang/galician.txt | 1 - src/lang/german.txt | 1 - src/lang/greek.txt | 1 - src/lang/hebrew.txt | 1 - src/lang/hungarian.txt | 1 - src/lang/icelandic.txt | 1 - src/lang/indonesian.txt | 1 - src/lang/irish.txt | 1 - src/lang/italian.txt | 1 - src/lang/japanese.txt | 1 - src/lang/korean.txt | 1 - src/lang/latin.txt | 1 - src/lang/latvian.txt | 1 - src/lang/lithuanian.txt | 1 - src/lang/luxembourgish.txt | 1 - src/lang/malay.txt | 1 - src/lang/norwegian_bokmal.txt | 1 - src/lang/norwegian_nynorsk.txt | 1 - src/lang/polish.txt | 1 - src/lang/portuguese.txt | 1 - src/lang/romanian.txt | 1 - src/lang/russian.txt | 1 - src/lang/serbian.txt | 1 - src/lang/simplified_chinese.txt | 1 - src/lang/slovak.txt | 1 - src/lang/slovenian.txt | 1 - src/lang/spanish.txt | 1 - src/lang/spanish_MX.txt | 1 - src/lang/swedish.txt | 1 - src/lang/tamil.txt | 1 - src/lang/thai.txt | 1 - src/lang/traditional_chinese.txt | 1 - src/lang/turkish.txt | 1 - src/lang/ukrainian.txt | 1 - src/lang/unfinished/chuvash.txt | 1 - src/lang/unfinished/frisian.txt | 1 - src/lang/unfinished/persian.txt | 1 - src/lang/unfinished/urdu.txt | 1 - src/lang/vietnamese.txt | 1 - src/lang/welsh.txt | 1 - src/stdafx.h | 14 +- src/video/allegro_v.cpp | 12 +- 82 files changed, 21 insertions(+), 1305 deletions(-) delete mode 100644 os/dos/cwsdpmi/README.licensing delete mode 100644 os/dos/cwsdpmi/cwsdpmi.exe delete mode 100644 os/dos/cwsdpmi/cwsdpmi.txt delete mode 100644 os/dos/cwsdpmi/cwsdstub.exe delete mode 100644 os/dos/exe2coff/README.licensing delete mode 100644 os/dos/exe2coff/copying delete mode 100644 os/dos/exe2coff/copying.dj delete mode 100644 os/dos/exe2coff/copying.lib delete mode 100644 os/dos/exe2coff/exe2coff.c delete mode 100755 os/dos/make_dos_binary_selfcontained.sh diff --git a/Makefile.bundle.in b/Makefile.bundle.in index eaf7134dde..3b0dc6798f 100644 --- a/Makefile.bundle.in +++ b/Makefile.bundle.in @@ -89,12 +89,6 @@ ifdef MENU_DIR endif ifeq ($(TTD), openttd.exe) $(Q)unix2dos "$(BUNDLE_DIR)/docs/"* "$(BUNDLE_DIR)/README.md" "$(BUNDLE_DIR)/COPYING" "$(BUNDLE_DIR)/changelog.txt" "$(BUNDLE_DIR)/known-bugs.txt" -ifeq ($(OS), DOS) - $(Q)cp "$(ROOT_DIR)/os/dos/cwsdpmi/cwsdpmi.txt" "$(BUNDLE_DIR)/docs/" -ifndef STRIP - $(Q)cp "$(ROOT_DIR)/os/dos/cwsdpmi/cwsdpmi.exe" "$(TTD_DIR)/" -endif -endif endif ### Packing the current bundle into several compressed file formats ### diff --git a/Makefile.src.in b/Makefile.src.in index 6b235be9d3..a64a5d5dff 100644 --- a/Makefile.src.in +++ b/Makefile.src.in @@ -270,10 +270,6 @@ $(TTD): $(OBJS) $(CONFIG_CACHE_LINKER) ifdef STRIP $(Q)$(STRIP) $@ endif -ifeq ($(OS), DOS) - $(E) '$(STAGE) Adding CWSDPMI stub to $@' - $(Q)$(ROOT_DIR)/os/dos/make_dos_binary_selfcontained.sh $(SRC_OBJS_DIR)/$@ -endif # Revision files diff --git a/README.md b/README.md index 2d681d0d16..1bfc8716cc 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,6 @@ OpenTTD has been ported to several platforms and operating systems. It should not be very difficult to port it to a new platform. The currently working platforms are: -- DOS (Allegro) - FreeBSD (SDL) - Haiku (SDL) - Linux (SDL or Allegro) @@ -555,17 +554,6 @@ Use '`make`', but do a '`./configure`' before the first build. A comprehensive GNU build environment is required to build the OS/2 version. See the docs/Readme_OS2.txt file for more information. -### DOS: - -A build environment with DJGPP is needed as well as libraries such as -Allegro, zlib and libpng, which all can be downloaded from the DJGPP -website. Compilation is straight forward: use '`make`', but do a '`./configure`' -before the first build. The build binary will need cwsdpmi.exe to be in -the same directory as the openttd executable. cwsdpmi.exe can be found in -the os/dos/cwsdpmi subdirectory. If you compile with stripping turned on a -binary will be generated that does not need cwsdpmi.exe by adding the -cswdstub.exe to the created OpenTTD binary. - ### 7.1) Required/optional libraries The following libraries are used by OpenTTD for: @@ -752,16 +740,6 @@ License 2.1, and partly under the (3-clause) BSD license. The exact licensing terms can be found in src/3rdparty/os2/getaddrinfo.c resp. src/3rdparty/os2/getnameinfo.c. -The exe2coff implementation in os/dos/exe2coff is available under the -GPL, with a number of additional terms. See os/dos/exe2coff/copying and -os/dos/exe2coff/copying.dj for the exact licensing terms. - -The CWSDPMI implementation in os/dos/cwsdpmi is distributed under a -custom binary-only license that prohibits modification. The exact -licensing terms can be found in os/dos/cwsdpmi/cwsdpmi.txt. The sources -for these files can be downloaded at its author site, at -http://homer.rice.edu/~sandmann/cwsdpmi/csdpmi5s.zip. - CONTRIBUTING.md is adapted from [Bootstrap](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md) under the [Creative Commons Attribution 3.0 Unported diff --git a/config.lib b/config.lib index bab1ca4ea4..18ea119c43 100644 --- a/config.lib +++ b/config.lib @@ -553,10 +553,10 @@ check_params() { # Check if all params have valid values - # OS only allows DETECT, UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HAIKU, SUNOS, CYGWIN, MINGW, OS2, and DOS - if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS)$'`" ]; then + # OS only allows DETECT, UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HAIKU, SUNOS, CYGWIN, MINGW, and OS2 + if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|HAIKU|SUNOS|CYGWIN|MINGW|OS2)$'`" ]; then log 1 "configure: error: invalid option --os=$os" - log 1 " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS]" + log 1 " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|HAIKU|SUNOS|CYGWIN|MINGW|OS2]" exit 1 fi # cpu_type can be either 32 or 64 @@ -623,7 +623,7 @@ check_params() { detect_sse_capable_architecture if [ "$enable_static" = "1" ]; then - if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "DOS" ]; then + if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then enable_static="2" else enable_static="0" @@ -633,8 +633,8 @@ check_params() { if [ "$enable_static" != "0" ]; then log 1 "checking static... yes" - if [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ]; then - log 1 "WARNING: static is only known to work on Windows, DOS, and MacOSX" + if [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ] && [ "$os" != "OSX" ]; then + log 1 "WARNING: static is only known to work on Windows, and MacOSX" log 1 "WARNING: use static at your own risk on this platform" sleep 5 @@ -644,7 +644,7 @@ check_params() { fi if [ "$enable_unicode" = "1" ]; then - if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "DOS" ]; then + if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then enable_unicode="2" else enable_unicode="0" @@ -784,10 +784,7 @@ check_params() { log 1 "checking console application... enabled" fi - if [ "$enable_network" = "1" ] && [ "$os" = "DOS" ]; then - log 1 "checking network... DOS, skipping" - enable_network=0 - elif [ "$enable_network" != "0" ]; then + if [ "$enable_network" != "0" ]; then log 1 "checking network... found" else log 1 "checking network... disabled" @@ -1023,10 +1020,6 @@ check_params() { grfcodec="" fi - if [ "$os" = "DOS" ]; then - with_threads="0" - fi - if [ "$os" != "OSX" ] && [ "$with_application_bundle" != "0" ]; then if [ "$with_application_bundle" = "1" ]; then with_application_bundle="0" @@ -1129,7 +1122,7 @@ check_params() { fi if [ "$personal_dir" = "1" ]; then - if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "DOS" ] || [ "$os" = "HAIKU" ]; then + if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "HAIKU" ]; then personal_dir="OpenTTD" elif [ "$os" = "OSX" ]; then personal_dir="Documents/OpenTTD" @@ -1603,11 +1596,11 @@ make_cflags_and_ldflags() { fi fi - if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "OS2" ]; then + if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "OSX" ] && [ "$os" != "OS2" ]; then LIBS="$LIBS -lpthread" fi - if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "MINGW" ] && [ "$os" != "DOS" ]; then + if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "MINGW" ]; then LIBS="$LIBS -lc" fi @@ -2328,7 +2321,7 @@ detect_awk() { detect_os() { if [ "$os" = "DETECT" ]; then - # Detect UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, SUNOS, CYGWIN, MINGW, OS2, and DOS + # Detect UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, SUNOS, CYGWIN, MINGW, and OS2 # Try first via dumpmachine, then via uname os=`echo "$host" | tr '[A-Z]' '[a-z]' | $awk ' @@ -2345,7 +2338,6 @@ detect_os() { /cygwin/ { print "CYGWIN"; exit} /mingw/ { print "MINGW"; exit} /os2/ { print "OS2"; exit} - /dos/ { print "DOS"; exit} '` if [ -z "$os" ]; then @@ -2369,7 +2361,7 @@ detect_os() { if [ -z "$os" ]; then log 1 "detecting OS... none detected" log 1 "I couldn't detect your OS. Please use --os=OS to force one" - log 1 "Allowed values are: UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, HAIKU, SUNOS, CYGWIN, MINGW, OS2, and DOS" + log 1 "Allowed values are: UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, HAIKU, SUNOS, CYGWIN, MINGW, and OS2" exit 1 fi @@ -3453,7 +3445,7 @@ showhelp() { echo " --os=OS the OS we are compiling for [DETECT]" echo " DETECT/UNIX/OSX/FREEBSD/DRAGONFLY/OPENBSD/" echo " NETBSD/HPUX/SUNOS/CYGWIN/" - echo " MINGW/OS2/DOS/HAIKU" + echo " MINGW/OS2/HAIKU" echo "" echo "Paths:" echo " --prefix-dir=dir specifies the prefix for all installed" diff --git a/configure b/configure index f6c6a2eec9..7a13a96c88 100755 --- a/configure +++ b/configure @@ -75,7 +75,7 @@ save_params make_cflags_and_ldflags EXE="" -if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "OS2" ] || [ "$os" = "DOS" ]; then +if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "OS2" ]; then EXE=".exe" fi @@ -116,7 +116,6 @@ AWKCOMMAND=' if ($0 == "DEDICATED" && "'$enable_dedicated'" != "1") { next; } if ($0 == "AI" && "'$enable_ai'" == "0") { next; } if ($0 == "COCOA" && "'$with_cocoa'" == "0") { next; } - if ($0 == "DOS" && "'$os'" != "DOS") { next; } if ($0 == "HAIKU" && "'$os'" != "HAIKU") { next; } if ($0 == "WIN32" && "'$os'" != "MINGW" && "'$os'" != "CYGWIN" && "'$os'" != "MSVC") { next; } diff --git a/os/dos/cwsdpmi/README.licensing b/os/dos/cwsdpmi/README.licensing deleted file mode 100644 index 112b02a087..0000000000 --- a/os/dos/cwsdpmi/README.licensing +++ /dev/null @@ -1,3 +0,0 @@ -The files in this directory are not licensed under the same terms as the -rest of OpenTTD. Licensing details can be found in OpenTTD's readme.txt -and in this directory or subdirectories as well. diff --git a/os/dos/cwsdpmi/cwsdpmi.exe b/os/dos/cwsdpmi/cwsdpmi.exe deleted file mode 100644 index 17e3220023ca085fadf981932c9347247a9ac794..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20125 zcmeHve|%KcweOxeCub%aefH0_*Is+?wbx!}9)9d)GMn5+EaV0Lg@{LuUZVZw<4Z@bWmQ&(Bfj-3 z8nN>@LS_Ifjf5-!vH=wd{{S{d5n?wHvOJ!Uvw&*?A?NiC{OC+V27wQNcYqdP2XI?5 zAxrKc#F4V!SG=sy`S1gl>U%8rt>5s&>a`Uvw`KNyb1ZjfWo23JE4D0K zwQkMRtJbZv%&rNC3RYLGU7uOKc6E7X`5Moh%vccf|Np+m0huGgHz!D$deYIrH=k}2 zj3oWMls}2o_4V7{l zZ%aRs-5I+4T3gn!nSm(MC-mEhw;6TywCffho7uKN;j`awvpp(Zkc#+YGiwstRAo|I z0exO#l!^qYjK=D-J0I_9`<^1VlZDEsNNmej{@z0~mGKXGP2Pv@O`1Tec|SfMXVFEx zubcCp9hDFx8FqATilaF^yiS-vxKqjn@42mc-PL@0w=yxh)AOIw@44UAb$PkGKWv=Y zPQ3mp-0A2}cZBy3UcW)=N$N)n!bTO=HtIfF$c z8A8R<7QWFgpdXiCTgf7u?NN#hs*8$~n#=ejwSu%IN?H;Vy8OzFm1QgkQhr;@AK79I z$8{UY)lYj&uXbmDWP0^fk94~0n#uHfzv=bUJ&!oW$HWiLi;t8%M!Veh%T%sZ}V|@=}p`s9W!j5hc4IcF8fKA5_@|KOc@TTTKmxh>7wS>Jb%%Jm!W%n#zJ* zvazAi&}ffqD2!(|g+iEGR4%#*xkQTODAjjF=qp^DNNClCmUavA7cTb~I{k&l zo!bZTkn1nx`wE}fL{RuBmV%<ieetbqj5@`g3A z-`vt_4ZLRd-oi<}pvrF_R^lc5NQ99{!&2FZ_{zKFPp*S6a!cU|75cUZj?ILev_bM$mc37ht%!|};OpfM z@`7X)XPUgXsuH3a_aE#4t=ouYe$1^#Fk>(@jAIV>(5wfBX6tm#7ckj_36Q;pQ)wF zaf}BcefAMTShQrIe4b&;s*bbeZj5Rp5&f#)9#Ud#RUV@h0gj`r9rbMTe5BTn?6eO$ z*r!EP-i`Aqogv{J2@AtAi0@8I`KUZrJHJok_ zIfMBs>Wu0%?U<(CO!cSN(5G?UCG9hNw^qbg^Vyw{1Uxl5D%uFwDV>t)pCHm;^pM9i z9_@53($0!qhuVnubM%e6`;zl3PPn}5kn+y+;bPHr46rJ2-?R^+g_ zJUV$3au{hGA_{>5APdLj+kV~M(Pk-BlYx^Xdb z`#O0Jawb;lMxsqCFP&DYjfNL7NUA-A2d-=+wbwwhhk`$+ zY22Aq@AvLB?bu1|Qm=&PQ^*}-X|R9gO47^H^-}MauQqrLy#i!hS&N5F9)mA#IpLKR zc<^{45J`~?4?BNqhuMprbR1(+oB*~S;%XO(3Yb=(odTem6 zR9==xd`IHK>HCcGsjWKFZQ{u5Bp4kCzvWr$d!-{e+kIhs(c2nvRO5cRIzc z0bWG?s*3cvyxb5j|2%0r^^Np=UUso`&UJ~1mH4l^igxK6~m2v6|IYAfUAdEu0i zZ)?rY%TvRxUHZ1xmhke(SG2b}R}j6~pDfp;gt_q#%8h4v`E)qlkMx(U^0HgfxA1bu zP38CH$=SE0H}mpKEd4I|{BY^JSonHU{Rz(a)WDK>>Buhix0CN^tLRZ|4MoLG_E4X& z&-{{=Z55{N+pvV4#}YPo3#SOG{k-HhVl@~#yp<@rr9RcXB}V!iHUaNpYy$3!lKngu z_2^-`n?1pH0lFW^kAUTaE@Q7;#bP}*l+ zEe+1nx$@H~&p$*hJPm`tN5{fVDe`+`;Vr3hD+`y{T;TC5G)yTWJQcv!tKi>Z6J3(c z_!y4I$It|PT$xD3KH(K;#)Qbf)noCLpUN$jtIs6Wl`6V4bP%CF3IbztAMP}=`K1ZK0%Gqq1Bi5Eyq zw>3pam$H@w64+<;=kK>l_7K$!_L~E5SfM=xTCLfgfgx+)k`)trgkZV}pIL97kXV(v z2DpfQyi*=T{c+lJtbqhRvtrAnlMrPteyz;#Sef@|88G>fRev`jRLAm{4NCSws3d;- z#XkE5s<~W9l?>2SB>NQ=39%duCc{U#cscj-ni&VQ{Jm&QsCeTk9^G`wNt$7i_Fi(n_sLkT!%5!h1h4wCYX{__i2{JNih{0W)_x)o6IU zM+*-1r&{m;4QH%Sv+#zQ6AqXqy2ohc-_o5tJF8pMS?zq_kXb8`-6;mz&0?U<49>Tj zRs8w#4`EZDCnX&+d%s8A-=Uh?A+y|b88aoYS0CN^jEP3LUeU{c1eq-K&@PTrLGm<+rb3Q`xIW z+q9vg%cbx49Hk3$ORE|Bb4bC?51CD(x(zm@%t{@5{tMM0(BqI;AO?^#PiQwoN2c9T zg*LNPG>WwMdqnKUELWbef>i&;)u)$}hUmKS*_G1lli8h2HN@ti*7EYR;VOAl)@rUn zWvEw;YXh^G7OnMR8f8tR!8)U{zilo~0)zgt5&x25->B*lXpPGEq~5FRhS`2(dZ%ba zH2qsQ?FWXFo(Do=3rN)6L{+U(Y*|5Ql14PtRoZ{~$CnYs81};DQjo~b6az7$lQFOC z67(Y%F@tdSoP%cpjHbL=bGfu`%P28F6YKi3Ue5fI_IHT!m5xUq>K$eE+PXlH{OJ<6#vL0u%P>(3(cbY|M?h$-s9>qseKRyyZ#7EpI zv)J;nxmh@CZchEo+?*+!dv=dxHYI%+=W5_*>=FhbGPJaxmiE)qep=d3OZ#c*z{ln$ zlx{-lCX{YU7&K?Ld>9uvXYQ#a%8E*zQc|f`mRE9$vyxX9S4Jp{Dg~vm(x4Pn8Wme* zq>@`1rQ}pbD_NB>N=9X@GP^QPu~wQCOQl(vUKy_>R!&eRRZdjQm6Md1%E^kcGC|=h zrzk{TuKvIeF0kI#T_9X2!Qi`4aHzv7g$`QCGzVm+FVjnSsgp9x(^Htx=usgqHJGEO4SP^Q1LLY&mHa z181xX_*Nf6&(Bz;dJ>Oxw#a5-#&=l1z*(mc3wb&|vEH#IdQe*yP46UKG>cr17&wg* zmncbn!f|USN~m-9nKczawq@>uE-)H*2^iHU8Kf(RJFKiX^4w82=-(J{@!)L`6|qPx z7NyIV*HpYJt`y6}Wu`qzh;xd&#g{Zm5=+Fg8MIeo#p_~fh2L>U#q0FTl3L+&WD3Fz zQMzhCSytWUidVBg8W+UPuyYY2koolqp2WW-*21P@CzVY$>LK~v zA!uEOJ4GyJ=%$y5z6-qgs3=`X5*SCmFCL7b+>x$}zCJ#|AXfa=V-C^DCYDk@Rc6ni zj5f>=9~V!Em}9%?B+Kq>9%z>7RHKKX=He`=BB$ArAxi6QI62_})x2`{@5iYSm(g5( zjuMQ$V+A38$8!JDMgC$ZI+p9lxyirPLVG}GDNW6WR)(J06TDVOG-RA0`rSK2A&?ONX9ZXroF-_Q}@x zi+F16x!CHx*n0cLM*HZ+_j@{KhSNJNgl3q@GVm8$b>R$jRV;#%^kC!m2xvH61NuJu zD9C5$EfK1L7}%D4P)C$$K6{9#2QtZ_PnD+R3EPuBlkyU_C41r)_`Wi39?&XKBB5eM zZGN*Ih7xVfrDsB(Bc>g{!`X)Cbecx?)JH;J{U(@Ak=?ZUi<=@(YLOE*f6iZVFR zj(GE@!h#YbH|OkC_40E$d-a?*U)38uD`lIym*9b>PhhH>lc{%3xjF{|5e^?6EoGsb z`geF~K3YwrUGjeqozv4$lZl3WeH_R#R)4ApdsIEDM_JymSI41#d~@72s!}l4X?=r* zi1v+);AmRUv{b$Cux%o7{|MDQ6Umz9dKDA2&u8KokvJ_5tI|;=7EzvvgVSMGIGC)J zlXB7sXqH8j5M$*!Q7*l>TNeiI`oa(FX-ub@zSY2ELw#0A|jFH?L%J1*a@bl zYE|RYQjJ4eyqwyU@cqX1an6V@il$e(&HkcM41f0fN&-02vOQVCAgB5<>i#KI z2H0r-{hDR~YS(E7#iC*={>*+M4G%dMbEfV8Aaw1GFxAVXE}tH4OgqlNCWC?Z9mc?$ zw)e9P#2s;H+eC#s^kj1T<#@Kk`*~k4FZS`&NRAM#S(F@Aq82YXFp*de(>rvXU_r@Y z9S`N+NOmH~b^v#h=v$v_sk9`ywoPOe!j1v!hD_%8j>IUFw8`ttChboqYcx1=8Le37 z-4j>=ERrlng4ogsKN|0ISoK+i(5(bY3I}e4EuoqjCW5g?{?$}!j+OsB`gjku1T(wY zIJX9Uqjx_8lOFex`cpHfaPqIxs4<1ka^#U5v#9~ou6nnqi#-OIXyiJjRIX2BIu^}Q zw{`Zj37*J4$820tpmzDGG}c685$_!_R!{Pdm^PXkyZPb0&nD{y!Zr3QbLS=Kx$24Y z5;$&SY-9Hwu)y#}BrCUjN2XJI$+O93CEh!dtcBwh*lnIoRvWw9!h;Q~Ux%3}(;*|e z1$oD7;-u3Y1U7se{ZGV1EtI;s-uYfq`%yTsaWQh|!vy>(m)+^F-_Nt4zkZ(PxZ>^r=VS3P%!W5GrY84l0(kS7|pZFVLL?ldv$baeoV z^844rl)Y~Xa~dRLhi8TRzz0=jK|iY0Dzt}~7-*Jm&=uUpOra2SBMJIU@;$I1v(BwI zu>um6C{}5fRso|(3;y(V{%z8A))?Kb<;VywG|5-4OT(;!OcOJuNYKBe!Yn44)U?uA zn87Gu{LjE7w5lv071N;JB)44;6L2w(@pWsKg|H;c!DKADTK9MT ziZ=&;9m`m_GzSxrp3i+FW|QwHu|r+FY5T6&8`IddqfUGJe_TO=4{8mq%xPPMQ|7S0 zEW{*Y>+G6HIw2i7K}#%{HT7DUSyN+gW>yxaQIR|YHxE3<7qf^;CleSp+VqKvOz>O` ztrezqc@3?IN!d}Yzf?@SuFT@ndk6$ar_gH{v^`<=gh-t@{gcgCOOYf1O zO0w!SRr00;sFODmFwWTccukQ!n0TWCO_dDpCBCl`Jqg&sV_8PuVQ8Fg0jgkP^+kM` zd~zhEj12{?N%Z4H&9Z9iDh6va=S@rX0`k_L%w3aFx`e zO!HHV@>oW64l6BfNs|`ZQ;`*5)!3ovm|E^sO7g z$!DZxfL>qIENTc=W;7DcLOge3rn8e__DSg!P9!iFpJ%CGk9X(;7tHcw{~7L!rGwrw zi>ZO{<+q#jsaDMrs2=TD%+gW=_vO>LKF8v89M2uOVEjFo>3c8Qz_qOoRA5hJ(3k%99q9b01~js$O$=cG?d)-+o4})zYP+Gh%u|ZJNl@^ls?LG59`InUz4>poEO63?IY(kiXYZDGcW`+ z6%!W(*LT- z-aqdINChj>c^L1dq9Kj*m&8Y8ca+xZ4(1edNz@hczRkGysHOR(6-F`7P+ch%8vPN9 zL5hfA?kKnWwi=1&AO4L-2t4KQMeyPxcySTdMAnS`5<+T@{Ky0h3`-be($Kds=>~@i zXn!$@=yvHSpeomIxEo_<+7YD&cVnf7lMEewWI^L2^!}B1=LNTMVU~C@!pS)>`;XL# zBN$Wa#!x$gRn6d`2X6%$iBtX;bFfsWiN%rNHg=)<&5A36bH*z!2`6WSg%MnJutu)J z3&G@>a@CQAFHizl+Bb4jeDeIgX68{$KkppIHY6!{3gklzO`$p-nTUe-FTao z)6Stb9o$&z>~Omv<~po8nD(q^muT;ThuA5Yt@a5RUgC*hYd&qZ*D+fcbhDc1c7~Lt zR>Jy=6cT()*YZj-wn^p>6#Q4xXdlsc;#k&r^n;PBr>C7b1i=cL;#E|Gg)YIEo zG}3ui@9j1>{!aX0K#as?H_K)pp<;iCsBk{oGQyj-Rj9%JY=(mf)Cqzizl}>m9}HaW zpDFAC1tEQBn1ZV(XMzUAbPniwv)F-Q0%hU{XT_^0MVh3D8ZF_PT2LG{$uts&3T4qP zskgSHq|?M9M~>bduU)}E)oF+*$PJt^D!81WSKbQKR5a5IHG)!aT0P;2Kn%o4B1sg9 zCNU%y(K?+TNjkk=&*^zRJP$b?r{_41=OQ?PBfO3$5xNL{1Q#Jh7$S@jkr71D33`DO zctLOASarHceI$w2MeC!vXkFZeMBQzZZu{W2zujh;`oz@trjltZru}f*zfDV=zGeFH z>37~kVqLTBHi;_Pk`cHbHlJ!{mk-VTnGz}!vpY?*`o)%pWK(jd z*wTcrqhiZ*_(J3h_&OzGlugNlBBb4vJUk?9NHe>QCd)vK*)(f_S$;ifbZD`bO&77p zO)||og;qt36Y$9*9Rb;Xs(QC(WB$$RAFaLR(6~cD2RSWY39akIoYvVi^E35P82{2veHV$~t8T21x zp4Rouo9Nq$i@wN8VlcgZ3Q=SCq;;9H-b-BitW*_unX*3kozWkxEbGyj66MXGhI@lZ zId57|EBDzDqH&MrxpMA#>ve^E_Ix;-Np=wTc;0B_)!)dwd*s~nF?yO?o=M!d%lV}B zKR#O{f0wlW?XxH3EYhmtX%3NLPrLSV&$1+(tWPa!?#%v3GD!Vb`%~*3W*pr9Bh~LP z`=`wKK@Zeb@+mpDX1{)5sK=xmfD;MgcK^WpxoO$UyGx+G%qN5Hh29f`;YW9l^r7!u zsC9yT7m?1^q_j?!Q%TM3RBHBOuv;VCu?QEK_BI~DrR|2a6cg!LfIq3Lr${utJ&4=E z5>bM)*Smul#FyD)c8|CWK~rF`jG0&MxQ2g|m$N_Q>^!7DY;zUhQSoM?eD{Y~^_qoe zIZoKl!9hYQ*5i->LZj_QEhqdwi}=S;;7@2u3p66anLN+ zKT#gS(ebpH>Nmi=YSwN3n=(FVuCy zj4f>MzOH|*G#raTeO*7r}dF@;7+VE$lCBG}LikYgwnR8!_(Me>r9vlF)1qb zMn}isAw!M7Kj3=UttQMNMd7`|h0z(t(dc<97T7k*H1(iL=UHAS4l_+~SPn3mVSJ)D zsEnC!5y~gteWx_{CtRQK6K+c?(r#kfp#0z@f6)+p4XJztPQ}R?EOd^0LX4SQim&Z<=dbj z$Iz;MX}?5KoMTXjVx%#3CK5$khn$4(bXyv@0{Evt3y1R?;|`j1{CpknDaX*#L9HZ> zn8NJv?36!0jscc`emX42m~@mR34{nYRYLnSs`Ur+Zy<)vXNfKgn9z|1|J(*nt5ZqX zS*UxL@ISkHO}dnaXw!~r6&F~PLOMRh(%eS+7QqdvH0WRj$Zz6s>QP%7xm!|9+rNNz z*$B(z+x6cNhn6OmnR!o-_0hEB2)Svnu3%0GDBd-IW$ti76GCTWpd(Z1NWE$(FuFZ- z$SicoC_AYO)lIy=hJ$sCy!9{sqDy{w6o!Xu{b}&#rp766&S<=$UWYLf+QDi^-MSfb zw5;^;RCx3z-cq{HK&2lCU&xA5&?hu;DyQNTndTGTlSpGQJJ1iXhsFqf2=h&1bab6A#t{k5?`Be6 z%wqqQn%VtDa95<(gBWe46|~8wZ35`4dQEJff_*@Yw!^Jrh%V?j0mYyef^VLE)53H) z{3V86BZkLu*QilI*H*L;+^spxgN`VwJArbla^Hjbu>qphlxyN|Uu2L?3&*9=DgTF= zRpQBHlQ-?~Rpl<0o31xg!y&zU+D#=k{23*XLU%_hBx2n>&NMO|Hk3t(u)uGeXEu`}`JUgE(v>Ujh84qeIJ=WN0%-3E)rkTb zgk#7wofli6+fu2Abt~kQdbv)KnFB=50b4S?80$AuV~ScU$Pd#7VBN(OJ5n}`>4h<* z#XZ?6I*3xJT~DsAqt|e_Z`5yzz^f@bGGrgsyLsP|kP$FT_ED^&k#P2OV|7n4;4PzQ z)sskTXDxWKZesx)X2Ye-^rpiJ2=|ljNLs*W(kliQNV|?$ zvwNcU@Jrgx6Yx$N#$pB`7ATV$(f_Q^TMXzk-kFFpZ96kc`KAfGvH?``^8M7Cd|W2j zpwc~QY$WLlG=D&G**+GlaBO_D=gk~|Dt z0S18!fDD`i27r%&Q^1EnKkx_OC~ySm1l|MMfi|EOH~{PiUIF$1yMY&h7l7x0CZGY> z4tRmhz$U;AYyheN7qA9+0$2f*0LuX1SSDy zAOiZL31|Se172V=unBMj8-Oan1*`#{09F7cz;eI|ECv<< zg+Kvd19E{JAPdL8h0!#-Ifk}WFhyjcM4-g=PIWP=d0S18!fDD`i27r%&Q^1En zKkx_OC~ySm1l|MMfi|EOH~{PiUIF$1yMY&h7l7x0CZGY>4tRmhz$U;AYyheN7qA9+ z0$2f*0LuX1SSDyAOz z;9oW7Nei}U9@SCe&ir-BmDvU*T9me!o9&ZC-xrgpBV5?o*7VMo=rFu&=fcg__k{)C z#(fSW^_HUn`1a8V!&NvH*O%eF-Cf5gh<`ox@ih~V6fKbXHx95bFc7J1@W)QMx!CyvFOI2L>2Slo$YrV}?g z0i1q~v*v&Vbxx-z%{;0VcwztMn1BR6J6Apx0 z5Vpr5kO86dI~GClqY_*QPq7rE*`ito}_p4$oDX9m+WQ{e5s{5DQ?C#ZAVIQhEi4heh8oaTh=#OobN12iiENEEr11tr?;4l_PykC2#=a!%Pd{ zTKLtKMR*;?h8Jr3gabAmI)gx~jdqGDr1IZ814nGW{B9d@oAZQjn;UO=be1YY z%Mn|k+eTlvji|P?lM?(u!693_o_=@Q+I1!Gda1`aR{|IP@XPdC-bsj)k~(egFo$vk z583cq;t?CGKf)<*?$q2OamIuix=C$Y^scJHi72VVhEc&yF(>pQbBAr?nwDPM90ce& z)JS7$=q0~ULh!23FKjhYEI!a-Q_@(76CNWhm!ah`Ld&&u*kFK4??s_bn1y~}Lw!10 zADW_L6==8B#P$kDZA30msfPUkebBYE+b9Xr@YOz*xF@Eltg>dIT`LHOCpli-xkDwW zJh0Cec+JL2blC1BIvTa#7FN!25}@y|d-LC--swMt+sIVdg6FcqpkpAPkMJkFWy1)` zpGQP@yN$iVuQ^@t8ex)R+I|T>-@oRFtXvO%uEn`$$Y-w051ywtaUT-b+ng+PmCAds zV@e$V_tIb&a#64Sg<2CBaOP#TM+e`@2+%ta0S|06C)VY++UWh8X-Bh`rR9YP@Hot< zR-3Y^t>M_@E?JLKEE0vhn|?m@5rgZrm)*`h^-PiPO#VlDGs!0Bwock$F(%A)kcHfd~gG{ z^bY#IatZc@7IY;Yl1<+x`vv5<2<(lfzd^u}z~vt3#CA>tq-$;5bgEc3??f(3(XK5Dj}4m zV z{W{BAHi~x^XW6f7S+!yM4m>DAln7-y&RHS(AT@~N#h@tmG?~NGO|SX2+G_v8mLxV= z+;Q^p5&12Z(of{J&$K-ZSv|1^sZI)#L}U93xpWQX9Z3k=za$^V&YB6WH6Gw{fN|X zL7Kc0$+*J!#_NyZ3ohjL+O!of8^l7s(jl^W!fUqLWL5>(qT-32J#qUnc0KZDj6Bkz zaB}7a##naP&C#fEXN7M)WJo7|(Sc4YY8Bw+XJBvQ73}-;q$;%8YG%^Os7yl}^yZme zufP%v+cfOqo;Wq`HFP6xFBS(}*@WLckP`OTF!8jDnS@ttAph|m_yyf}>@J(v4Krv@ zyBT4B((i0d!XIeSp0)-RPf;IvU<2vL^fULg8EH)R$)2_dCALjaBHN-gFZ{=8d{0}f zGKl9kxIptP22)J`;~uGBd!-hU)FTKt5N>^&*Lx(A7NS|6?^%Q!W%}1%aSwiXkS8KcPScMlq%YloD34D)yOm&Y)2t}WCUuwJmSVfQg zuIk1C1UIhU3%Y5Y?6r$xL8>(#*}}K$5G_hQ>=MU7O*QR$#3&QnIr?R8=kc}uoSPG~ zPolpulvwl{T@q=JsQt4&0$F<6qwp#9gulDkU0E4*{eQeYnx<==!Dqh>KOKbCf$sA7 z%_rx=#Sf9y^H!|hShHrs(`z$pHf|Wt`cDI1>-GfQEL|QNvFi%g)~>BtyMCSJ$sbxCE3aNp3d^7LRFEYPKR^~%m#=zi!}_)B++=BO zd9_%zej{19-m`8^jpaU9`Rb?01M6y6RjplPS-N5M`ZeXm?tIkZS+}Zo)!M36Pga$a z!u1|}S?sGkRc@BJ9<@|^){U22zHAv;R$lRR`8u~{$$GcNSzTU(Fj?kawfd=WIY;@r z^6FJpNL%kNU+t!pY85(HRoq53LoBPS@1CEMm0Pum zSk|tyJo4~;3yEcw+fu%E!~B%0O?eivYE?ze{FF^mqY+vMgA*Z0X`hm*2m*)Usr$rFg+3k1SZSyfli0`B%Qi@-)WE zvJUKCwR&}VP0d=2Q6?HMuUTEac7uC;b&aKblWUcyhQ4_jMO3wTRrR{H>ni41R^#`@ zP;C8%@^zM)jjJ|T#I+dSl$t2AWW5$qvtiZh@|jU&8BJZYw&p2|=&7ng1R)K4;y3n$^g&Nv-)N73m>QwmKQ<38Y#e{91<A}vVqF5n@$$X(`cdk Qhm=$IKm2eB{<6q_0n{}T+5i9m diff --git a/os/dos/cwsdpmi/cwsdpmi.txt b/os/dos/cwsdpmi/cwsdpmi.txt deleted file mode 100644 index 14b09c4d76..0000000000 --- a/os/dos/cwsdpmi/cwsdpmi.txt +++ /dev/null @@ -1,173 +0,0 @@ -CWSDPMI is Copyright (C) 1995-2000 Charles W Sandmann (sandmann@clio.rice.edu) - 1206 Braelinn, Sugar Land, TX 77479 - -This is release 5. The files in this binary distribution may be redistributed -under the GPL (with source) or without the source code provided: - -* CWSDPMI.EXE or CWSDPR0.EXE are not modified in any way except via CWSPARAM. - -* CWSDSTUB.EXE internal contents are not modified in any way except via - CWSPARAM or STUBEDIT. It may have a COFF image plus data appended to it. - -* Notice to users that they have the right to receive the source code and/or - binary updates for CWSDPMI. Distributors should indicate a site for the - source in their documentation. - -------------------------------------------------------------------------------- - -CWSDPMI was written to provide DPMI services for V2 of DJGPP. It currently -does not support 16-bit DPMI applications, or DPMI applications requiring a -built in extender. It does support virtual memory and hardware interrupt -reflection from real mode to protected mode. DJGPP V1.1x and RSX applications -will also run using this server, which can be used to provide enhanced control -over hardware interrupts. Some DPMI 1.0 extensions (0x506, 0x507, 0x508) have -been implemented. - -CWSDPR0.EXE is an alternate version which runs at ring 0 with virtual memory -disabled. It may be used if access to ring-0 features are desired. It -currently does not switch stacks on HW interrupts, so some DJGPP features -such as SIGINT and SIGFPE are not supported and will generate a double fault -or stack fault error (to be fixed someday). - -CWSDSTUB.EXE is a stub loader image for DJGPP which includes CWSDPMI. This -allows single executable image distributions. You can use the EXE2COFF -program and COPY /B CWSDSTUB.EXE+yourimage yourimage.exe to create a -standalone executable image. - -Some of the internal tuning and configuration parameters may be modified -in the image using CWSPARAM.EXE (see CWSPARAM.DOC). - -If you want to use CWSDPMI with DJGPP, you expand the distribution into the -DJGPP directory tree. CWSDPMI.EXE will be put in the BIN directory with your -DJGPP images and it will automatically be loaded when they run. - -Directions for use (server can be used in either of two different ways): - -1) "cwsdpmi" alone with no parameters will terminate and stay resident - FOR A SINGLE DPMI PROCESS. This means it unloads itself when your - DPMI application exits. This mode is useful in software which needs - DPMI services, since CWSDPMI can be exec'ed and then will unload on exit. - -2) "cwsdpmi -p" will terminate and stay resident until you remove it. - It can be loaded into UMBs with LH. "cwsdpmi -u" will unload the TSR. - -3) The file used for virtual memory swapping, if desired, is controlled - by the "-sc:\cwsdpmi.swp" syntax on the command line. You must specify - either a file with full disk/directory syntax, or "-s-" which disables - virtual memory. - -4) The default swap file name is c:\cwsdpmi.swp, but this can be changed - with the CWSPARAM image, as can some other parameters. - -5) You can disable the DPMI 1.0 extensions by starting the image with the - "cwsdpmi -x" syntax. This feature allows you to run programs developed - under other DPMI providers which do not behave properly with these - extensions enabled (typically use of NULL pointers). - -I would like to give special thanks to DJ Delorie who wrote the original -GO32 code on which CWSDPMI is based. Morten Welinder also provided and -improved much of the code in this program. - -------------------------------------------------------------------------------- - -This section contains a list of the error messages you might see out of -CWSDPMI and some details on what they mean. - -Exceptions are only handled by CWSDPMI if the application does not establish -an exception handler, exceptions nest 5 deep, or the error is particularly bad: - -"Page fault" - - 1) an illegal page fault happens in a RMCB or HW interrupt, (lock all pages!) - 2) all available pages have been locked, - 3) the application is using non-committed pages for null pointer protection. -"Double Fault" - multiple exceptions occurred -"Invalid TSS" - typically due to RMCB or HW interrupt being called after the - selectors/memory have been deallocated (remember to reset the mouse) -"General Protection Fault" - bad parameter sent to a DPMI call - -"80386 required." - -Since 80286 and lesser processors don't have the hardware necessary to -run CWSDPMI. No workaround, upgrade. - -"DOS 3 required." - -A few interrupts are used which need DOS 3.0 or higher. I don't expect to -ever see this message, since 80386 machines were introduced after DOS 3.0 -and that check is made first. - -"CWSDPMI V0.90+ (r5) Copyright (C) 2000 CW Sandmann ABSOLUTELY NO WARRANTY" - -An informational message displayed if the program is not run in one-pass mode. - -"Protected mode not accessible." - -This message should only be displayed if running CWSDPMI in a protected -environment with no access to protected mode. In this case, DPMI should -already be available and CWSDPMI would not be needed. This might happen if -a 16-bit DPMI client is loaded and a DJGPP image attempts to load CWSDPMI -to provide 32-bit DPMI services under Windows. - -"Warning: cannot open swap file c:\cwsdpmi.swp" - -Maybe you are out of file handles, or the swap file name is incorrectly -specified in the image (change the name with cwsparam). - -"No swap space!" - -This message means you tried to use more paging file than CWSDPMI was -configured to handle. Since this is protected against in the memory -allocation code, you should never see this message. - -"Swap disk full!" - -This means the paging file could not be expanded when trying to page -memory out to disk. This would normally not be seen, unless you are -writing output to the same disk which holds the paging file. Decrease -the amount of memory your DPMI application is using or free up disk space. - -"Interrupt 0x??" - -Your application tried to call an interrupt from protected mode which -normally shouldn't be called (something like a data pointer). If the -request was allowed to continue it would likely hang your machine. If you -see this message and think the interrupt should be allowed to continue, let -me know. - -"Error: Using XMS switched CPU into V86 mode." - -This message might be seen if you have your memory manager in AUTO mode. The -only workaround in this case is to stop using AUTO mode. - -"Error: could not allocate page table memory" - -The page table memory (a minimum of 16Kb) is allocated from conventional -memory (either in the 640Kb region or UMBs). If CWSDPMI cannot allocate the -minimum necessary memory, you would see this message. Free up some -conventional memory. You may also see this message if a page directory needs -to be faulted in, and there are no available pages. This means too many pages -have been locked for the allocated page tables available. While CWSDPMI -tries to dynamically allocate these if needed, this effort failed. You need -to increase the number of page tables with CWSPARAM, or increase the amount -of free conventional memory if it is low. If the application which calls -CWSDPMI internally manages all the DOS memory, the page tables may need to -be pre-allocated at DPMI startup time (if this is needed, try using the -run option flag 2 in cwsparam). - -"16-bit DPMI unsupported." - -CWSDPMI is a 32-bit only DPMI server. Ideally, on the request to enter DPMI's -PM with a 16-bit request, we would just fail the call setting the carry bit -like the DPMI specification describes. Some buggy 16-bit compiler tools don't -check the return status and will hang the machine in this case. So, I issue -an error message and exit the image instead. - -"Descriptors exhausted." - -An attempt to nest a DPMI client failed in the setup phase due to insufficient -free selectors in the LDT. - -"CWSDPMI not removed" - -When the -u parameter is specified, if DPMI is not detected this message is -printed. Informational. diff --git a/os/dos/cwsdpmi/cwsdstub.exe b/os/dos/cwsdpmi/cwsdstub.exe deleted file mode 100644 index fabaf3bf4f158a72ca8cb9d77ef43bf64bbaccf0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21504 zcmeHveRxwYo#SttVvabj9@{QkZ)X zQUXG{Yws@QT>s{~8!z&4yL#7ckY2({8uj+`3kQIaw8=xZBGAe5k z_`81tNVx!9<3UA7h#n}6C!{KlkflIA(5EM)6G)s$Nb)2?-T-nE37Num^6#e*(hdZG zUBC~4M}eS)5R;V<^BsgN1fB%w-}spOikBBSAAZ1Gd#CxnnvFlIttfZ7&8hdLnHOYa zWSH+OHZNaSz2T{K)z#+Ix@ahWeN{z`wYFk?nYC<#C(SxOW`(QFT<7*YVXmrKx1p@o zTv7KeV)O65J98dB?lc!XXf7zLs;R9gLpf(z?Nb$Xbrm($=JMKg)$XzlW_OL*Q&(md zYiiBws()nO=&9XUgXfL4HT4x6Xu1o;*N?Vzd`xZGQ|l_K>yV+WuB_UPLL1DU>ZfWp zREQO28(7;=pr*R&N9J`KH&#`Y)zK>4(FUip{M9vXb9LGJvbwr;wH3%nQ#ZM4s#vvX z*i#^*@aw<-EU(F2Kv|J)t~W2RW-Op%PY8x_^e=xj@PGa-|D10UR`KE1jNYU?u1?!M}0)EBRL2;fbU-313EhW&Sn9%Ut69ZMzbC?}%;pTpsLFxi9){`6$1b_h%RI zuk-JiN$g+Uiw8`@$v1=u@qX5S>a&{(#ZQ(#8|gU}YDSw|AM8!i zZ%^l}P4UTuMp&AKbOLgGWI_9-U;WB+?bmbKiw{O3mwt8i4_3cz4q1I4O4!?$F=()_cI3lbOd`{>Cp_qH<4L^zcgkPM=yz{F?7LH%>BL=3~#g zHQtMA?vy|AD({c~hHoQ_C6gVr4!#N!*BFW14v)}ayT&h3>31$si!C!WV!+9ZQv6k3 zY`I4xavfrz5W#XKxCBY2T?m^bjo7Bb>=$!S*KwkBT5RZwLQs_Z7gLb99UQ}K~FlbE!b?FUt)cYdulu!7HQ@13vT z{$Hv<5ie#-@zY70N|P;_Oi0&n?^gLuE77GAKHHx?m1O&EQ%IYZNTwCM6u**}5=;2r z`EBD!({bOYT*s%HA2b~QSI}$I5s)&G2M$Fdc%lW0ZY@ySaQw&L%}7*-iN1G!oneuV z=yztR+K7s_Vy-H%iuWh3<~u&){ie0xOg1nfBTp8~$4Sd7KJYvq zw__>p79{?j78j2xHLgYEbA`2hJ=e094?M%mKPO`5aVfr$w)F{KRK?>XjaHI5i1wNU z+Kpz@Y91|rMLR>}kmUJw*8%a+coK>`P=07C326?v4keRE4)5bbN%AgopyJSdBsB3r z<)KwH%aezyX_l%(USuIeoK?h#X5=m-Hsx=WJE?CY3Z!_6`%zr7q_WiZk1f zRPzUKBbR@%rnIE1jc|vPNak^IZUoW2^SivZN?ubtqm7jGChf1{+tl>?NwBQsuosI+ z8&~ohRc}()UM1fY=W@g}nx5nrM3AULunP0yv67#4(G^VQNbsL0NLDpD)X6uWX%e0% zbH9{q|3(^m`tNz2KlPO(_p924M~ET!E37lur9YqgqNMqx^o5f<<2StoNj~zj=3xIl zb5CTphcEvJUEu;RkRGA`9^!2Vt*$l|y4ZSeh|fIUn)j%5K`KJ!byHd+p@i0a`n*&p z6$ui=AgNBB+5UJ}>pdYEvp4h^5?gJdzjV<|tNDk#dhbJboA#1g4D(*{IEyageVv^5 z+=zr2NxQRsb3D!A;Z?$3!krFX@Sfk6+gZ!c?F>!C(En9>m-~G~hnLHJZ&Okm@%kro zXJWAodEfK;wNlsI&bv{}!^msYN)4@dHqu3;sq@FI!qyZMo_|*)^d`+<5hiW8SlY@r z+6DCE@_(#hkz?BR5BbalAJYP5je*;Y$Sx+SoWv}9QVR%1)HC6HnC z+4f<(c&g~qg8(UP-uc=AJ*uIG$gGamK=y0mh3~3r9&9izxWmrw_dtk zjNB#PyTEspPVx&4pGQb2M*5`VGp>8re1X^-M!aOpSCwmBW{atkM6&l0dDV#TXiTVB zeoNPS8#c@wgZy#+pzsM%yNxaVM57@c{klVhG+;M63I4As=Pz~^g8$=-+SLM75df(dXpe0baJm*eVh(k5gQ-D*UcT|u{1PxChI%C zx>EyZ_x+4zkVdxO7c?lJAX-T&iWIU+Q{eCdB#hB_VuX2rk_MgL+@ie2o!yo}oTyqrxjtwhro@!P|pxV$QlPSSwmC~F6u&7QN7`r&8o15P;w!oWxB zhn}@xamrKZgKuk?c+4QJBOxxbG<;Y`=B^GSGk4m1PliW8x@y}Ok$OZ8&9#S}L0beg zW7_pQr$ugV^=H@6r!n4{(v9A2#$km^cQ%gd2zs#35jvdJ0Qv?{WxB(kY6vS~$R(-P#$0rFhS)p8ng zPN`JMUxiDR8AZiR<<@iyFA!)d1I_K02HWL`_qr#hTgc!H-9mtP%h-%9U<6hY*DkF1uGcj3yWnqpG(9~=P99B4Gdp%m0)#9TW9$VQcT_MbM{ek?U=Z{A9HJ^Q7tYchZk)z@#h+-NWC@riVbOHW zq02+(HxRkMySVr*i5#Xr&VWV5P4;k)kZv?v*jlLHu^n^tOU%*i*SL@nv41JKbrAQ# zBil$wwagbWY>kutj8)Ei1go6;qGbOPt5)m~U9Q)%WsWX*@()pc45Z}2_)<({1n#AQ zAp~-0U=V>jXy8gLX5s>s>n*kHxkkk*f2cG#Q{{@kgYxY%sPHrl9(^$yHqMsMj)wVE z`2-86=DWbBE*hpSAv_hL6GPy^5j|aV4EPwDfR8~VKCVn8VvjHf$6Tl*zf)s%kdtys z%LE^5z-x{Pr(12SazU^}J`7HD)e}1~X#F#Wq8p6aBt=aV6KsqWv$XD@%XR zt_3*vVeKcXEnOfGH%4FzvHM00TfW+7!vs@CsIuHVsj&Zb^mCeY!71xOKVEqruO)#h3-$y$kx<6{ ztujNSWzJqj88ErPqFz75NS20LjU+JKD~I_Erzm9ylfgOE4+RF_zpEa%gw=#B!F2j>Qv zllmH$^4?Fi2UI8feOqaPSQ9gGC zGbPZcj%|NhPa|9>)$$c|mJjLWaf5-y3IR4hP7;5jOah-nKRu?#eEITg2$s**rzTrc zBH4?L^7*ezBiVgw`N)-0uvGr=YitaCYSc|D@?0rB-gS&Ft}WR{D2U+@wl>JDiEiH5 zRIHUM_WUQhMWV-HF<%TIXRcr~LJ6eZi3kggQqc&~j(3R>J;e4D{aZ!DqW;&Nv>zBws_=%z7Bo?HQ>*HAV$0`*CMk`E zK1Ta5zi|aojA6gIQi>)r9l1YFbTZ~WeHjXXix|*w_PiX=0vJts<-1bauyuqOo*wVg zaPq^0w7-+SrhKL2u@ZDg7~RLdhi=NZ=uV(?=`dO8z|aA1>`+e0uOxGg$1az@jJ2Px zpx^p?w5T|eoygIRL!L|YZ&=*Mc-Q;JNVW*n0vnCZrb^=pc@a%alVQZ7=WuvQ;pRq>}Au+VH zpO*I1(tcXnPfPo0>A(}lCX{YM=_ZtJN~||pTV6H>Dve#0B($nh6)LGzhgMW_A!j8Y zT2iSA6;=wNf=X>Dzfu>)6l|>HbMcAg zj;+x3%BrY;%j7nST$dPFixQh@lX`>|7Q2yPK}a_$8i1T<-2+u%Bz`lH&Y85*l_U8U z)*Cr{gbn(423&;M0JFPDEEc89mp7EZBCZivi_7)y6)}ywWlTKJ8R@0%6Z&z|>0h1<+5)}HD*&&G{4 zwXhn)KAUV3mkTpsQrqLm+T&QU$6@xbnYqWYMD#mSMgOvN(O;b5FVFF>St$Bz@5h+kjk@~9qFP}lZTT5 z4hYR_Qr{hGg}9vN>T#4{>>aBJ@jF)dmlgVpo#)iv~ ziJXkgoNRM#*$+JxwTvBd!c^;i%cMN6mJ9Y?j-PR;KCw0bu$mm4KrK9!m2|a%3BYT^ zS;1pIq$U?ysg99(^1y_Pcxvprc))w{!0i_s?IRbDcO6QKrXMmBnjwj0;4dCfMKjPv zu?RZSgN-{fq2P4%t9$GtXuds+GrI`QKn&oSKH3^fct_;m`tI?Pnoj-#iZF zQI^;4zk>sPe9z~uQH_GJPU#ygAhd5}ICC(#iz%sU-;vG);{G2X^Yl1YHP;=|L-~9< zo;8x|)(l0YW1;bg@@NiD$GQ37ETyEht35&bQ^#lO%#$!ez-9t-hFaRyd2^&g-MC{a z8!wp4d$4H1*olZKEN>6;Dm>IT)kYLPEmJt8RPLl5xVwj z^t)uzV527+{mxHdbHKp+j$q*RJNj4#;?}&Qn-t>Sk(1lHCb13P&-=Q0v4@|FNsADr zEJ}_lQHhrvm`E&#{w=yru%P5f9t-8%NOmH~b^y0Y^ws2;E6paCZW1Gib2?7%GD-6t zjSD3xlh>I^+T>)V4UQbvR;=^G6IlT)k}O7o*wP3;D(`V5t1}3pTM2X&4%~=Z`V=#R zhOtNf#Z+o;l>a#Lco(&FGP}?iw+4J83!cWgg*zL0(Z+>1`4_XPJ&4Y7gev`hj zlONh2m!cM|Tw`A-dtqV*S37ZG;(Tt?_{PpTus!fPB!_PI4o~-JyM?$ELui6`c$N~L z5Q4=bE+x{~*%}>eShWrrNN74_M0IcO`*rcs84dy)J&pbqF)@p!POf{Am(-t)1~x50 zZW~OTpMh2WT~>hw{kzhYzyY#*SEdr&y(>crbnjXq&fEE5=HaVO#&njti z?IUiTuSJTOwp>tWD>QB1#My&<$&o=EL@iy{&IjwR4%!@=LMeN1v> zp&_s`;#-bGj(0GS#q5CWJ+eR`o(H4hOoVML>^qV!L_7I1I3by zb_Mq^Qy;`!M}j`Rd?zfVtaCMbRzRW>#fWAo1Xzod;ES2Uo228MF1Az2kse&Em#o>@{P=wDJn29r!`S!patXDwj-Psb!oj<9@GOoM8@+Cbn?H3qm22G zrA6sGDU)CrEr6v|4$i`&t8{&3MMbWm%Yr^my(YHt2o-bNpZjuivp}{Eca> z-`Su%{a>yi!3UL!)@0EOTWQF@I?N^WHr0kf|Un-^@vQo0~#SA8waa?C}JH0yq zQ|pul(zc`qUx+J`AHP`svhHyBmJg0ZP22jv8=$qpuo^D6+Dz+Q)opx3i^xH zx5Q=8xXHnHW1|IOe8V8?^}g3*r8Ce7ZtSV)?3wMlp{?J}?ThASQ#IWm-H4$ZWGJQl z*sFu$XeCbh>JYl)wPEjaFWMKE^3s#-f^^z<1RAD$-q^FWtAuU;en;5T>=}#xuBagr!50@`?5?9^={? zv}=g9OTXiNRg_Z-zv*Bp+@#OAoEfH#l1?}7qUxS>jMDIJOP}khZaQ|iJ*?lURkb}f zabEGnt3gfi#9aHZe&^SO7J;Tq?@6FaGIEM4c~b(^$r}k6XKZ}DqDUT`a)W@PN(T26 z-#1e{iP*u%vy8qY&^X-!RKY2=7xAI@$?(TuYFY-%Ao_8lW+7!=#b9k!p1X0fzPZUa zwL*KN=S|DhV{K)cw8uR9Tojg0`(Nx#7<(S3&+Y74I=y?(R2&AN!04ad!**uIteKQD zH@3v5$I!w|8hSAL@UxmfuI;0IXOtv0DAWAZpgfupox@5?Yf_|z3Z2LbFfuq-`yn#H zpw1W3>UW&eF_k~JXH%?VRqoOI-q+pK2=D_^!x}~R9LP(QdoXAjl*(bm4*pc(rKJX zU@hLrQokMVPzP#_^2)zP`(kFdsG=pHU)K9jY2a%`8MV*C4ne!I!ZcS1*w!}mLt8HuzG z+K^F|p=25)IM}G67h>=b5OIeD+qRw>;^51GyR2smbkMWdE!l<282OJM(=EJRzhfEO ztiUUnZZr}2Uy3PYAQBO!;w-i>vzmuRr~Gg%Hb)%PbVai7<{jsH&Axd)-458@Ol zO1#L~hp7fn{Ty^q@!7!?t3HN+refkkf$%%>gXfhaE2>07asFsEPWdMjSQYvmhxp(T zKH3%5%Wvn!x*r_Clz`QoF6kdDviFZWfu@2Lb9vbArJ_NF^OwX&WOs~G>rUqMaYt73ln$kXF)Yn7hU8zHK_<`I~=}4gyd4dl9_22wq%-HIY?g zzl2aEOMb+Nfnf=wOd9+iCf(prKJ70i5#25w`BdflEq7z=^gClB!M#|i;RHfQA6ZcO zFug+M-MPW-aKmFP@uWwSvtacfZV-ntru3S=ei*Bo)1!mj~0v2$w{Y)1$%&t~yvHSM9?Qy=U@OM+Uwib`S;*qERU37Vz~{Od|1UZRo6ILjOSEmN)($^4cyepeg@#fGiJn9v6O_NQ67Mn@`L z;s5C_S?Sgp2r z+?E6fRji-iZStk>?Hb7Ywq>CkZ?baAIW$iNH;o4SAnjlSRvkmMj!U$6!FSjxn637S z7+&Jhur;4n+wDkI1>KAi-OiA*ESa$WB83E3s#@lxV4GzAF2R2$jrL)6JC0?I$4(7j zJu~g(;=xYNy_vP2j&eu80c|c$hqeZXBj~i))ZyLB=cLf=*!^)NOyO{e z>>E*gRQ70OA=IvvI1)PmI^B&$!|mtP-cCc~@5NL7;yB!OvuyTZD)#S?2%KxS4#QEj zJQ94B&2TgVG|^zlZ{yPNss5{dNrD9}2&>zpEx39z32i`3d%v1Dh=(vtXqkBGoOt!5 zNRvXM(v~Qt78D01nMUGJ5h}bT_11bqb7|tBBTMa`pxnSe*{;Q5zHQ|UrwD6W5M`B1Ui6i3?tx~Cxq*ANZoSIj|vyM}7YL4T0PQwWt;Z;1* zs5EK~rx7$-jZQO8Lj;we7C3_Q;k!PBeAMjbu1UFihq0hAEuw59=QG2w-4N& zVQMn}5`kC!t`mIyQFkI`JPs4#5mk-T- zRtd!5L#vW?r_8@k#PeB0E-Gp>?o^>3a=)aX5FgEf)!5|=u|62V<&A{U%L z^4OZyaHhqDfhWdmdjE4Vc4b5{e#8tF!(3Wc&rQRD*23@-|(usf3Qoh>W2>r;`Tn~{X)O|XM0Pa zy(}UF?#12{1JOr!mh^$|eE5J-zJo~T>QW9&k}ag}b}BXdG1vz*?(qoc>-RSv#ii|F zYKoq8-HSh|qpL{Nzd3;0!4m4-u0K40LHrqe%&RWe4UqR6C;S?V;IpqjYI=i%p9RY> zqv12;P<&e929#DvTo*K0?{PITmEO81rltifX;CkNJ#bV&RD4<>F3sd3X>tYiT<|9v z(*g!W2x)SO5|Nk|NJ#4urlf7g?d#Mu7isg;c?g$`>4-L`O@XghT$(&b$(@`Qn3<+n zY>RLc8-@*?kPzF{yvF%#ui+Z`3;8`o>+a~EqFj|E9^eAM;^g0c zE1KP)_!C>Xz#AOY{oANf6rKMS$DI}}J#e<8*EQ*B%twje@~JY5a zP(F%I6ZJ>BnJVHtrj`DS@^E#SJ0n{BT9{W2sx5yGO;o5OdW<;red4!#;nGrFBrN}c z`e4xNsbK~sp}bJf2?MsU{po2fuW14VOoYSWL}Ub4`LuvKt)*2H5D*PN!7#jB5gn5j z(6IrbO}u`cYW|=r2J&zxZcfEZ6pO@wb+#CIFeQ3BhI*hE4^f?-7kyiKvP~|mj|bWoKq3{^A`PNmKz*tDYFwHPOGi0Y%ccD^=V zQ4aY{O#K_DC|sYiD}rNq0jmgisLB9!--|9@12{4LLZ)mE`xw{7ZZ&b0SQOnWTT4+HRMN7l%pVK27eAA+HKqXN+|G%T;Z@&h4Q^&2-2pJE;fNO}xK`gLRzj{gc1wk{=F*(c#*72E4hca>|=e z6y8v$!#D}`V70?wDa=u_(#O-$(VKWn=^ibWejI!uE1~=z;Sd+$BKSn6MTGZEp)r^p z=m*$CV}u@rRU{Xj)bD(EBp1xn@9Y}Ei&J1Un+b3th2+KIn5V-r4_bMH7)J&gL>`h) z&t7qIo{Fy1#W*5ieKC;QVix<))XeTLg0~{I9>hgg9A&a8n*jP6xhA$v#y%j%+Tm6) zNEdXRfZ{-f;G1XPv@l%`e~w{S8iN;=>^h|dbS*;-!M%!~-E^f=+{_Gn(HhV6=sc&3 z9c~YA2n4Mf20uDc-Q#Ii_d|5h;F!hAv6Bod>vy=i9aTiWa1B#`8axDPjdRf_+V?@Z z3R`FlTZ-9g(c^H@ZH-c9ox9Nox;X3V;<1iA2#0B`BX|ujLf3J6QQ9Et$Uw*giaNQJ zCMz?DPE6Xs6lIbx9+O6=yxYKtc&u#l&OUNAbO*~#*PE%)klH=%rV>B=BT68JZoO1U z#D;2Jl)tQP^$p5)f?36kOQA*4jl=_sf*TI*@G`?V)5y8lY6=lyrasQhW>O?S`fe#* zx#DkFF+4{y+o>af@*YfsD3Ad-hD=j=u?4!#m18LR! zQZL94(+XhS#S}ZbdI-}CV@Qj8GE-C-&v2WXT&kx(Pr<8zL$MLh6iS`d;KjO)1#pNBS18FBQF*4*GAitiu@Se1M#Lh0 zlxu^ypLCC-1$=sSNXr7VuOrsro~S(hoYu1z-bq7P%pk-9Wio5@KkD;VE&6QFt&h=f z|73*nO%e9cMzoTb?}yj(4VhqrO82DEk))Gw=B-)aAWSFIp#2-3O@bTq58le7yZ9|4 zIy&vBd_z?0pTV)#B!@YZJOo?;27n8I44eo0fscUGzz0Ad@E&jsI101_Zv$;WD{ugK z4R{rJ8Q2Hx1zrMP0GgTtN@(A5}*($0P=x6 zAP2|-GJtd-6-Wlmz;s{=kN_BfI6w#R00F{k^dGna3;-7Z88{F010MmWfe(N_;630N za1>|<-Uix$R^R~e8t^LcGO!QW3%mrp06YgY0lR@6fEU;TYzExGMxY9C0ULm|z$%~w zSOGYJB|sri0OSLCKn{=vWB}AmXL!RI?kUebC*oNU{cvA{E1TYo>kx-4bUR}8zl|>|m+l?O z>-EIvl$U$PNhj3tR&MvQ^3ft@8i4NMcO=sQFD+X_oz8sSahV;ja_;dg((iE6Y}s&) z&7t-u70&w9b_9zN8tfv$B@sAb=fUAR2hP=5aHP(toB}6n6P&D*;bc7rPSzQ4vd)H+ zbsn6o7sJWA5Kh)h;bgr6PSz_!1O|XnPg<}=@u-dwpS4{{uFTYiVnu1Iq1m1w`o2n_ zj&MpB&4!z;?<+IBje8tA>MchD@a>}!+8#I+?^>-Er9CSWL_a*S_LL;} zm+E@#aq0}wztzwLy39vcJLB=k#1q~ybhO#m^3?i0N!Lc(#GIB7W|HO(@d)*#R-Bi^ z@LnD*8oV;RmpVchi$9?G{v^JmXyn1rh?_)bK+{{u14I;C>%X|L1GxK&VU%^i_*3N>X$4^YqCyYwB!dv%$VkxL=W9=cDW3rJ8@5tXPgRsDsTBCG`chL zPr5@NDz1iYUL!SbKvZj=m}uyxV=Y zV_d|Y7|A}y$@yBm3WM)C+R`2Y(eV4DnwWf5h+b9>iM}D?&W9d%2b2#!aE!z2Roc=q zBSbiQQ%Dc^fdw|SgIWa8+2{)=g?Nd@hSy+vgatPINC9=?&$dy4VS1#zv@`Ia&1WmL z5w{^%D73i^k?ca7ytuP8B(ywe3l!SCwik$|*34ez4;0wgtNa1G?WR}x;aMMj$6Lvp zfS394TL-qcm>)QT1-9NK5M%T;PWdk#iZ>&UhR_~2M_LOH;};;3{HA;xn29qgCoDnc zeA}iCElX@^2+-rBj>gp4FqFbM{LF=rY^#f5@qv6>Xf_LR!g<1SX|9eZQazV{6}iVc$UougN}iG zS>sR4v0;Sd0ZnYDTh}f0aH`-n!X!n%;}Tr8dpIJ8t_QzR;@mUjPp->9{*qpxeL!5l z=j58sQhEP%Nb+4rN`oE9MV;*zD^*~?nRC=W6_2;2(cXRy9H&v8*kH@H(Q7mP&SoV` z%L^LtILfGOTWE9Z?%qiqvKpmWBnq{u7kID4{eN4vNW}g$}guO8lG&{c3a-Fyb3M{epU{(;KycnC#WaZfc z0|bXk2xaN02tWd%lM1LCby;m8Gv2VmuVBcNs6i5In8Ec8CwI1&%3oi@U^V_{DP$%v z6XeYx?_@pkwNpbK=d2`nNu=Z*dXA$VM5{Q+UVb18Z`~}wt`W)3!h29??=1yp(*iwc z6`SO#Y?5~i-JD83{{=m$V0B~1;%~iG$Q-tn7Yofc7`%1b<9M-<1{>`W_HLna`W-Ec zk-hOs;%@tOmUs0C-ZY$Pzpi9ehG{+=A0PoRQcuV6C@deOc5J-Q6T_ZN9G-4^IWOB* z|0lL2vB~0&m){?j--yum6Z!h*%FYO7!3wPDV>@04?|H3<1OqPlr*;@*M1 z$|^r~&4-uZJo;NEXJ~=wQsWv>ewrE~*srZvZIO5k*lqG_7w8pf#50}_)#M}et+_w{ zXQ|XpxreE&bSo9wdvt9Mv$c7h7!gu!usJxD*Y?NWJZymwacMDn ztMPiAy#DPFCvUpI7|YJ6SxPJ18PUrM8PbU#8lcmP9_H~5B+Nv72-`J1U|KKCi7%ht0pwQRS1o1jiJ{( zMf~G5zN>Y7XaLWxaA8(rFxS*S?vnbHH)0VP@PhCY^4@rX_zCaT~C`wcgiT?#0hW;9|kTcgejG_b~d%$DVXw zYQ4X=yh}bDapM4i8&mHE)wFi@+C;G+)$5LK#c$pqT9mrjC5)DuTH4fz2~BL{=$E05 z$JdVYZcfZRiT=jX#-i8gl1O_*?U!vDWa(;)!Kc&}{qA6QU8||<{^M=2G<}r4WC?yD z&0JPnTT{ExOct8gudANzHrH${tHuNU9WwlsRWx+pGP@nW#O5kn|0Mf4wEBu#{4!cy z8mX=^7c5(DeyZ%Ln%WN5N)8hy?r3bDFP74G#eGkyZCjAf<2?p9Y;Rkq$;Q(HF{ z6D@ty51aMhgCE_2p@k|U_*FRP;w2A}^$S<6-&D6@<5LyZx=kC$I`Iz!UTjr}F!8WVw4C z_^p(4lvS72uB$>?jT`KvKU1e9IMbKRzO8_i+` zh9IRbhAgd7BI-7-TVIwGLzdIj4Hb0|Y)@4cA_(c^r+nv+=ydvxo5=3xUfTESfwm#n zW|DVX-fed+rk~2ctg%quZA+%ov|ImWjm2c$ru^G8bu>i3Z_WJ%(i*30sPxk}OmC5L zIxFxSZuE~BXVZSiuwh?lezXp~Hn;>O>Qc-(K$`|asR^)m*5Y_-2eag{}KoOH>2l{-2eap diff --git a/os/dos/exe2coff/README.licensing b/os/dos/exe2coff/README.licensing deleted file mode 100644 index 112b02a087..0000000000 --- a/os/dos/exe2coff/README.licensing +++ /dev/null @@ -1,3 +0,0 @@ -The files in this directory are not licensed under the same terms as the -rest of OpenTTD. Licensing details can be found in OpenTTD's readme.txt -and in this directory or subdirectories as well. diff --git a/os/dos/exe2coff/copying b/os/dos/exe2coff/copying deleted file mode 100644 index a43ea2126f..0000000000 --- a/os/dos/exe2coff/copying +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/os/dos/exe2coff/copying.dj b/os/dos/exe2coff/copying.dj deleted file mode 100644 index 8a55047845..0000000000 --- a/os/dos/exe2coff/copying.dj +++ /dev/null @@ -1,48 +0,0 @@ -This is the file "copying.dj". It does NOT apply to any sources or -binaries copyrighted by UCB Berkeley, the Free Software Foundation, or -any other agency besides DJ Delorie and others who have agreed to -allow their sources to be distributed under these terms. - - Copyright Information for sources and executables that are marked - Copyright (C) DJ Delorie - 7 Kim Lane - Rochester NH 03867-2954 - -This document is Copyright (C) DJ Delorie and may be distributed -verbatim, but changing it is not allowed. - -Source code copyright DJ Delorie is distributed under the terms of the -GNU General Public Licence, with the following exceptions: - -* Sources used to build crt0.o, gcrt0.o, libc.a, libdbg.a, and - libemu.a are distributed under the terms of the GNU Library General - Public License, rather than the GNU GPL. - -* Any existing copyright or authorship information in any given source - file must remain intact. If you modify a source file, a notice to that - effect must be added to the authorship information in the source file. - -* Runtime binaries, as provided by DJ in DJGPP, may be distributed - without sources ONLY if the recipient is given sufficient information - to obtain a copy of djgpp themselves. This primarily applies to - go32-v2.exe, emu387.dxe, and stubedit.exe. - -* Runtime objects and libraries, as provided by DJ in DJGPP, when - linked into an application, may be distributed without sources ONLY - if the recipient is given sufficient information to obtain a copy of - djgpp themselves. This primarily applies to crt0.o and libc.a. - ------ - -Changes to source code copyright BSD, FSF, or others, by DJ Delorie -fall under the terms of the original copyright. Such files usually -have multiple copyright notices in them. - -A copy of the files "COPYING" and "COPYING.LIB" are included with this -document. If you did not receive a copy of these files, you may -obtain one from whence this document was obtained, or by writing: - - Free Software Foundation - 59 Temple Place - Suite 330 - Boston, MA 02111-1307 - USA diff --git a/os/dos/exe2coff/copying.lib b/os/dos/exe2coff/copying.lib deleted file mode 100644 index bbe3fe1987..0000000000 --- a/os/dos/exe2coff/copying.lib +++ /dev/null @@ -1,481 +0,0 @@ - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/os/dos/exe2coff/exe2coff.c b/os/dos/exe2coff/exe2coff.c deleted file mode 100644 index aa072e8e41..0000000000 --- a/os/dos/exe2coff/exe2coff.c +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ -/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -/* Updated 2008 to use fread/fopen and friends instead of read/open so it compiles with GCC on Unix (Rubidium) */ -#include -#include -#include -#include -#include -#include -#include - - -static void -exe2aout(char *fname) -{ - unsigned short header[3]; - FILE *ifile; - FILE *ofile; - char buf[4096]; - int rbytes; - char *dot = strrchr(fname, '.'); - if (!dot || strlen(dot) != 4 - || tolower(dot[1]) != 'e' - || tolower(dot[2]) != 'x' - || tolower(dot[3]) != 'e') - { - fprintf(stderr, "%s: Arguments MUST end with a .exe extension\n", fname); - return; - } - - ifile = fopen(fname, "rb"); - if (!ifile) - { - perror(fname); - return; - } - fread(header, sizeof(header), 1, ifile); - if (header[0] == 0x5a4d) - { - long header_offset = (long)header[2]*512L; - if (header[1]) - header_offset += (long)header[1] - 512L; - fseek(ifile, header_offset, SEEK_SET); - header[0] = 0; - fread(header, sizeof(header), 1, ifile); - if ((header[0] != 0x010b) && (header[0] != 0x014c)) - { - fprintf(stderr, "`%s' does not have a COFF/AOUT program appended to it\n", fname); - return; - } - fseek(ifile, header_offset, SEEK_SET); - } - else - { - fprintf(stderr, "`%s' is not an .EXE file\n", fname); - return; - } - - *dot = 0; - ofile = fopen(fname, "w+b"); - if (!ofile) - { - perror(fname); - return; - } - - while ((rbytes=fread(buf, 1, 4096, ifile)) > 0) - { - int wb = fwrite(buf, 1, rbytes, ofile); - if (wb < 0) - { - perror(fname); - break; - } - if (wb < rbytes) - { - fprintf(stderr, "`%s': disk full\n", fname); - exit(1); - } - } - fclose(ifile); - fclose(ofile); -} - -int -main(int argc, char **argv) -{ - int i; - if (argc == 1) printf("Usage: %s ", argv[0]); - for (i=1; i binary.exe || exit -mv binary.exe $1 -rm binary exe2coff/exe2coff diff --git a/source.list b/source.list index 7a6e6661ab..3055816876 100644 --- a/source.list +++ b/source.list @@ -1114,10 +1114,7 @@ music/midifile.cpp #if WIN32 music/win32_m.cpp #else - #if DOS - #else - music/extmidi.cpp - #end + music/extmidi.cpp #end #if HAIKU music/bemidi.cpp diff --git a/src/core/endian_type.hpp b/src/core/endian_type.hpp index 6e5defc647..1cacf6c0cb 100644 --- a/src/core/endian_type.hpp +++ b/src/core/endian_type.hpp @@ -26,7 +26,7 @@ #define TTD_BIG_ENDIAN 1 /* Windows has always LITTLE_ENDIAN */ -#if defined(_WIN32) || defined(__OS2__) || defined(__HAIKU__) || defined(__DJGPP__) +#if defined(_WIN32) || defined(__OS2__) || defined(__HAIKU__) # define TTD_ENDIAN TTD_LITTLE_ENDIAN #elif defined(OSX) # include diff --git a/src/cpu.cpp b/src/cpu.cpp index 9393ea0613..8d5eb5e5e7 100644 --- a/src/cpu.cpp +++ b/src/cpu.cpp @@ -35,7 +35,7 @@ unsigned __int64 ottd_rdtsc(); #endif /* rdtsc for all other *nix-en (hopefully). Use GCC syntax */ -#if (defined(__i386__) || defined(__x86_64__)) && !defined(__DJGPP__) && !defined(RDTSC_AVAILABLE) +#if (defined(__i386__) || defined(__x86_64__)) && !defined(RDTSC_AVAILABLE) uint64 ottd_rdtsc() { uint32 high, low; diff --git a/src/fileio.cpp b/src/fileio.cpp index 9f0db9e652..22adb76d52 100644 --- a/src/fileio.cpp +++ b/src/fileio.cpp @@ -1000,10 +1000,6 @@ static bool ChangeWorkingDirectoryToExecutable(const char *exe) char *s = strrchr(tmp, PATHSEPCHAR); if (s != NULL) { *s = '\0'; -#if defined(__DJGPP__) - /* If we want to go to the root, we can't use cd C:, but we must use '/' */ - if (s > tmp && *(s - 1) == ':') chdir("/"); -#endif if (chdir(tmp) != 0) { DEBUG(misc, 0, "Directory with the binary does not exist?"); } else { @@ -1056,7 +1052,7 @@ void DetermineBasePaths(const char *exe) AppendPathSeparator(tmp, lastof(tmp)); _searchpaths[SP_PERSONAL_DIR_XDG] = stredup(tmp); #endif -#if defined(DOS) || defined(OS2) || !defined(WITH_PERSONAL_DIR) +#if defined(OS2) || !defined(WITH_PERSONAL_DIR) _searchpaths[SP_PERSONAL_DIR] = NULL; #else #ifdef __HAIKU__ diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index a7a444cc86..c0d78028bd 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -299,8 +299,6 @@ void AskExitGame() SetDParam(0, STR_OSNAME_OS2); #elif defined(SUNOS) SetDParam(0, STR_OSNAME_SUNOS); -#elif defined(DOS) - SetDParam(0, STR_OSNAME_DOS); #else SetDParam(0, STR_OSNAME_UNIX); #endif diff --git a/src/lang/afrikaans.txt b/src/lang/afrikaans.txt index 488332081c..d8b05cac75 100644 --- a/src/lang/afrikaans.txt +++ b/src/lang/afrikaans.txt @@ -1767,7 +1767,6 @@ STR_QUIT_NO :{BLACK}Nee # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/arabic_egypt.txt b/src/lang/arabic_egypt.txt index 3da270ad32..ec0017d675 100644 --- a/src/lang/arabic_egypt.txt +++ b/src/lang/arabic_egypt.txt @@ -1439,7 +1439,6 @@ STR_QUIT_NO :{BLACK}لا # Supported OSes STR_OSNAME_WINDOWS :ويندوز -STR_OSNAME_DOS :دوس STR_OSNAME_UNIX :يونكس STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :هايكو diff --git a/src/lang/basque.txt b/src/lang/basque.txt index 046e0f7816..6cec7bfd29 100644 --- a/src/lang/basque.txt +++ b/src/lang/basque.txt @@ -1679,7 +1679,6 @@ STR_QUIT_NO :{BLACK}Ez # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/belarusian.txt b/src/lang/belarusian.txt index 3baf40f69f..917374e5d1 100644 --- a/src/lang/belarusian.txt +++ b/src/lang/belarusian.txt @@ -2092,7 +2092,6 @@ STR_QUIT_NO :{BLACK}Не # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt index fb9cce3057..b0c8a58167 100644 --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -1783,7 +1783,6 @@ STR_QUIT_NO :{BLACK}Não # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/bulgarian.txt b/src/lang/bulgarian.txt index 0ed560da1b..ff4487443e 100644 --- a/src/lang/bulgarian.txt +++ b/src/lang/bulgarian.txt @@ -1715,7 +1715,6 @@ STR_QUIT_NO :{BLACK}Не # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :ДОС STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index 4d889fd3b4..012a5d3168 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -1798,7 +1798,6 @@ STR_QUIT_NO :{BLACK}No # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/croatian.txt b/src/lang/croatian.txt index 701bd7fb98..8bc45b1699 100644 --- a/src/lang/croatian.txt +++ b/src/lang/croatian.txt @@ -1895,7 +1895,6 @@ STR_QUIT_NO :{BLACK}Ne # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/czech.txt b/src/lang/czech.txt index 5a22128758..618527bd9d 100644 --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -1861,7 +1861,6 @@ STR_QUIT_NO :{BLACK}Ne # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unixu STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/danish.txt b/src/lang/danish.txt index 5a30026efe..5adbdff762 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -1799,7 +1799,6 @@ STR_QUIT_NO :{BLACK}Nej # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index ced8ca5b03..546cb31aa6 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -1799,7 +1799,6 @@ STR_QUIT_NO :{BLACK}Nee # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/english.txt b/src/lang/english.txt index 209c452e2d..45bbbc0bfa 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1799,7 +1799,6 @@ STR_QUIT_NO :{BLACK}No # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt index 10bed1fb42..1f3d9eef5d 100644 --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -1743,7 +1743,6 @@ STR_QUIT_NO :{BLACK}No # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index 6fccdf640e..f02b1a2cd5 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -1797,7 +1797,6 @@ STR_QUIT_NO :{BLACK}No # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/esperanto.txt b/src/lang/esperanto.txt index 964f1f44d8..12e550a16c 100644 --- a/src/lang/esperanto.txt +++ b/src/lang/esperanto.txt @@ -1426,7 +1426,6 @@ STR_QUIT_NO :{BLACK}Ne # Supported OSes STR_OSNAME_WINDOWS :Vindozo -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unikso STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/estonian.txt b/src/lang/estonian.txt index f8210e6596..39e74edd39 100644 --- a/src/lang/estonian.txt +++ b/src/lang/estonian.txt @@ -1827,7 +1827,6 @@ STR_QUIT_NO :{BLACK}Ei # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/faroese.txt b/src/lang/faroese.txt index d85ad04ccf..803c761caf 100644 --- a/src/lang/faroese.txt +++ b/src/lang/faroese.txt @@ -1590,7 +1590,6 @@ STR_QUIT_NO :{BLACK}Nei # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index 829ac56867..3cdf100dd9 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -1799,7 +1799,6 @@ STR_QUIT_NO :{BLACK}Ei # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/french.txt b/src/lang/french.txt index 97d2f9110d..e8e14582c3 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -1794,7 +1794,6 @@ STR_QUIT_NO :{BLACK}Non # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/gaelic.txt b/src/lang/gaelic.txt index 36df72dcee..3ed107d8b8 100644 --- a/src/lang/gaelic.txt +++ b/src/lang/gaelic.txt @@ -1977,7 +1977,6 @@ STR_QUIT_NO :{BLACK}Chan eil # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/galician.txt b/src/lang/galician.txt index 7f4e97f733..3fcc850c4c 100644 --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -1770,7 +1770,6 @@ STR_QUIT_NO :{BLACK}Non # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/german.txt b/src/lang/german.txt index 0a0501e614..713257785e 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -1788,7 +1788,6 @@ STR_QUIT_NO :{BLACK}Nein # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/greek.txt b/src/lang/greek.txt index 4ac355e6d8..2591066016 100644 --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -1890,7 +1890,6 @@ STR_QUIT_NO :{BLACK}Όχι # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/hebrew.txt b/src/lang/hebrew.txt index e730e0c3ea..18845ea441 100644 --- a/src/lang/hebrew.txt +++ b/src/lang/hebrew.txt @@ -1792,7 +1792,6 @@ STR_QUIT_NO :{BLACK}לא # Supported OSes STR_OSNAME_WINDOWS :חלונות -STR_OSNAME_DOS :דוס STR_OSNAME_UNIX :יוניקס STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :הייקו diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index 914b2a2a4d..3f2c2b40eb 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -1863,7 +1863,6 @@ STR_QUIT_NO :{BLACK}Nem # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/icelandic.txt b/src/lang/icelandic.txt index 5ef33b5b28..1fada9f414 100644 --- a/src/lang/icelandic.txt +++ b/src/lang/icelandic.txt @@ -1631,7 +1631,6 @@ STR_QUIT_NO :{BLACK}Nei # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index f2f52e7a7e..ff220fc1d5 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -1776,7 +1776,6 @@ STR_QUIT_NO :{BLACK}Tidak # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/irish.txt b/src/lang/irish.txt index 61fb68954d..c845d4c5f5 100644 --- a/src/lang/irish.txt +++ b/src/lang/irish.txt @@ -1766,7 +1766,6 @@ STR_QUIT_NO :{BLACK}Níl # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/italian.txt b/src/lang/italian.txt index 7a7f799d69..2b629806de 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -1817,7 +1817,6 @@ STR_QUIT_NO :{BLACK}No # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/japanese.txt b/src/lang/japanese.txt index 6977a8a5be..c3c5fe89f9 100644 --- a/src/lang/japanese.txt +++ b/src/lang/japanese.txt @@ -1766,7 +1766,6 @@ STR_QUIT_NO :{BLACK}いい # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/korean.txt b/src/lang/korean.txt index 803ec85b07..a57e08bda5 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -1800,7 +1800,6 @@ STR_QUIT_NO :{BLACK}아니 # Supported OSes STR_OSNAME_WINDOWS :{G=f}Windows -STR_OSNAME_DOS :{G=f}DOS STR_OSNAME_UNIX :{G=f}Unix STR_OSNAME_OSX :{G=f}OS{NBSP}X STR_OSNAME_HAIKU :{G=f}Haiku diff --git a/src/lang/latin.txt b/src/lang/latin.txt index 63ebbcbc12..10a0ea29be 100644 --- a/src/lang/latin.txt +++ b/src/lang/latin.txt @@ -1967,7 +1967,6 @@ STR_QUIT_NO :{BLACK}Non # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/latvian.txt b/src/lang/latvian.txt index 05ff2588b4..c457ac0019 100644 --- a/src/lang/latvian.txt +++ b/src/lang/latvian.txt @@ -1713,7 +1713,6 @@ STR_QUIT_NO :{BLACK}Nē # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/lithuanian.txt b/src/lang/lithuanian.txt index 742e192eea..cf5290f6d6 100644 --- a/src/lang/lithuanian.txt +++ b/src/lang/lithuanian.txt @@ -1985,7 +1985,6 @@ STR_QUIT_NO :{BLACK}Ne # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt index 916b263e9a..bfebe82f87 100644 --- a/src/lang/luxembourgish.txt +++ b/src/lang/luxembourgish.txt @@ -1769,7 +1769,6 @@ STR_QUIT_NO :{BLACK}Nee # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/malay.txt b/src/lang/malay.txt index a5553ad6ad..ddaf825a83 100644 --- a/src/lang/malay.txt +++ b/src/lang/malay.txt @@ -1527,7 +1527,6 @@ STR_QUIT_NO :{BLACK}Tidak # Supported OSes STR_OSNAME_WINDOWS :Tetingkap -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt index 3fae530b8f..8c565bec81 100644 --- a/src/lang/norwegian_bokmal.txt +++ b/src/lang/norwegian_bokmal.txt @@ -1802,7 +1802,6 @@ STR_QUIT_NO :{BLACK}Nei # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/norwegian_nynorsk.txt b/src/lang/norwegian_nynorsk.txt index e998101d34..8e6948d9ab 100644 --- a/src/lang/norwegian_nynorsk.txt +++ b/src/lang/norwegian_nynorsk.txt @@ -1689,7 +1689,6 @@ STR_QUIT_NO :{BLACK}Nei # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/polish.txt b/src/lang/polish.txt index 2b7ee1b4a8..f44de0b917 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -2167,7 +2167,6 @@ STR_QUIT_NO :{BLACK}Nie # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index e2ba14b44b..503dcacf63 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -1794,7 +1794,6 @@ STR_QUIT_NO :{BLACK}Não # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index e1deb9971f..b1c80d97dc 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -1747,7 +1747,6 @@ STR_QUIT_NO :{BLACK}Nu # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/russian.txt b/src/lang/russian.txt index af60eb745b..e6b7237b33 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -1951,7 +1951,6 @@ STR_QUIT_NO :{BLACK}Нет # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/serbian.txt b/src/lang/serbian.txt index fd8da75b77..b1efd373e3 100644 --- a/src/lang/serbian.txt +++ b/src/lang/serbian.txt @@ -1973,7 +1973,6 @@ STR_QUIT_NO :{BLACK}Ne # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index 78e0623429..61983f80a3 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -1776,7 +1776,6 @@ STR_QUIT_NO :{BLACK}否 # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt index 6aec809897..8cb3a35042 100644 --- a/src/lang/slovak.txt +++ b/src/lang/slovak.txt @@ -1834,7 +1834,6 @@ STR_QUIT_NO :{BLACK}Nie # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/slovenian.txt b/src/lang/slovenian.txt index 2adfe3343a..63bbff4ef7 100644 --- a/src/lang/slovenian.txt +++ b/src/lang/slovenian.txt @@ -1920,7 +1920,6 @@ STR_QUIT_NO :{BLACK}Ne # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index 158998666c..b2ed3fc171 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -1779,7 +1779,6 @@ STR_QUIT_NO :{BLACK}No # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt index b57aea35b3..946c35f0c3 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -1794,7 +1794,6 @@ STR_QUIT_NO :{BLACK}No # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index e4016174dc..e0351daa7a 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -1787,7 +1787,6 @@ STR_QUIT_NO :{BLACK}Nej # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/tamil.txt b/src/lang/tamil.txt index c67f9ab064..34b413eea0 100644 --- a/src/lang/tamil.txt +++ b/src/lang/tamil.txt @@ -1536,7 +1536,6 @@ STR_QUIT_NO :{BLACK}இல # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/thai.txt b/src/lang/thai.txt index 99a011be6d..a315f95639 100644 --- a/src/lang/thai.txt +++ b/src/lang/thai.txt @@ -1717,7 +1717,6 @@ STR_QUIT_NO :{BLACK}ไม # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :ระบบปฏิบัติการ Haiku diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt index 18e146e1ff..c9cbddb9ca 100644 --- a/src/lang/traditional_chinese.txt +++ b/src/lang/traditional_chinese.txt @@ -1766,7 +1766,6 @@ STR_QUIT_NO :{BLACK}否 # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index 16e8ccfa34..93a386398c 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -1792,7 +1792,6 @@ STR_QUIT_NO :{BLACK}Hayır # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt index a04f8b6e7b..4e7b87d229 100644 --- a/src/lang/ukrainian.txt +++ b/src/lang/ukrainian.txt @@ -1927,7 +1927,6 @@ STR_QUIT_NO :{BLACK}Ні # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/unfinished/chuvash.txt b/src/lang/unfinished/chuvash.txt index 8d93f19360..e858a0bbc8 100644 --- a/src/lang/unfinished/chuvash.txt +++ b/src/lang/unfinished/chuvash.txt @@ -662,7 +662,6 @@ STR_QUIT_NO :{BLACK}Ҫук # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/unfinished/frisian.txt b/src/lang/unfinished/frisian.txt index 9e6b3d470d..df1ffd3c04 100644 --- a/src/lang/unfinished/frisian.txt +++ b/src/lang/unfinished/frisian.txt @@ -1700,7 +1700,6 @@ STR_QUIT_NO :{BLACK}Nee # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/unfinished/persian.txt b/src/lang/unfinished/persian.txt index 5fd8737539..763f267c6f 100644 --- a/src/lang/unfinished/persian.txt +++ b/src/lang/unfinished/persian.txt @@ -1483,7 +1483,6 @@ STR_QUIT_NO :{BLACK}خیر # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :هایکو diff --git a/src/lang/unfinished/urdu.txt b/src/lang/unfinished/urdu.txt index af1a108c1d..73e794ca7c 100644 --- a/src/lang/unfinished/urdu.txt +++ b/src/lang/unfinished/urdu.txt @@ -1380,7 +1380,6 @@ STR_QUIT_NO :{BLACK}نہیں # Supported OSes STR_OSNAME_WINDOWS :ونڈوز -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :یونیکس STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt index 0e72993f8e..190541c7a1 100644 --- a/src/lang/vietnamese.txt +++ b/src/lang/vietnamese.txt @@ -1782,7 +1782,6 @@ STR_QUIT_NO :{BLACK}Không # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/lang/welsh.txt b/src/lang/welsh.txt index 131c05d6c2..e5e451d8b9 100644 --- a/src/lang/welsh.txt +++ b/src/lang/welsh.txt @@ -1769,7 +1769,6 @@ STR_QUIT_NO :{BLACK}Na # Supported OSes STR_OSNAME_WINDOWS :Windows -STR_OSNAME_DOS :DOS STR_OSNAME_UNIX :Unix STR_OSNAME_OSX :OS{NBSP}X STR_OSNAME_HAIKU :Haiku diff --git a/src/stdafx.h b/src/stdafx.h index 98f5d13b91..a9ed460c26 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -242,15 +242,6 @@ #endif /* defined(_MSC_VER) */ -#if defined(DOS) - /* The DOS port does not have all signals/signal functions. */ - #define strsignal(sig) "" - /* Use 'no floating point' for bus errors; SIGBUS does not exist - * for DOS, SIGNOFP for other platforms. So it's fairly safe - * to interchange those. */ - #define SIGBUS SIGNOFP -#endif - /* NOTE: the string returned by these functions is only valid until the next * call to the same function and is not thread- or reentrancy-safe */ #if !defined(STRGEN) && !defined(SETTINGSGEN) @@ -436,10 +427,7 @@ void NORETURN CDECL error(const char *str, ...) WARN_FORMAT(1, 2); #define OTTD_ASSERT #endif -#if defined(__DJGPP__) - /* DJGPP doesn't have C++ conformant _stricmp... */ - #define _stricmp stricmp -#elif defined(OPENBSD) +#if defined(OPENBSD) /* OpenBSD uses strcasecmp(3) */ #define _stricmp strcasecmp #endif diff --git a/src/video/allegro_v.cpp b/src/video/allegro_v.cpp index 960d7fb7c8..53a42393ee 100644 --- a/src/video/allegro_v.cpp +++ b/src/video/allegro_v.cpp @@ -440,12 +440,6 @@ const char *VideoDriver_Allegro::Start(const char * const *parm) signal(SIGSEGV, NULL); #endif -#if defined(DOS) - /* Force DOS builds to ALWAYS use full screen as - * it can't do windowed. */ - _fullscreen = true; -#endif - GetVideoModes(); if (!CreateMainSurface(_cur_resolution.width, _cur_resolution.height)) { return "Failed to set up Allegro video"; @@ -461,7 +455,7 @@ void VideoDriver_Allegro::Stop() if (--_allegro_instance_count == 0) allegro_exit(); } -#if defined(UNIX) || defined(__OS2__) || defined(DOS) +#if defined(UNIX) || defined(__OS2__) # include /* gettimeofday */ static uint32 GetTime() @@ -548,9 +542,6 @@ bool VideoDriver_Allegro::ChangeResolution(int w, int h) bool VideoDriver_Allegro::ToggleFullscreen(bool fullscreen) { -#ifdef DOS - return false; -#else _fullscreen = fullscreen; GetVideoModes(); // get the list of available video modes if (_num_resolutions == 0 || !this->ChangeResolution(_cur_resolution.width, _cur_resolution.height)) { @@ -559,7 +550,6 @@ bool VideoDriver_Allegro::ToggleFullscreen(bool fullscreen) return false; } return true; -#endif } bool VideoDriver_Allegro::AfterBlitterChange() From e3c639a09f1d2251477f69496120d057dd8320a9 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Wed, 20 Mar 2019 17:01:13 +0100 Subject: [PATCH 14/82] Remove: ENABLE_NETWORK switch This switch has been a pain for years. Often disabling broke compilation, as no developer compiles OpenTTD without, neither do any of our official binaries. Additionaly, it has grown so hugely in our codebase, that it clearly shows that the current solution was a poor one. 350+ instances of "#ifdef ENABLE_NETWORK" were in the code, of which only ~30 in the networking code itself. The rest were all around the code to do the right thing, from GUI to NewGRF. A more proper solution would be to stub all the functions, and make sure the rest of the code can simply assume network is available. This was also partially done, and most variables were correct if networking was disabled. Despite that, often the #ifdefs were still used. With the recent removal of DOS, there is also no platform anymore which we support where networking isn't working out-of-the-box. All in all, it is time to remove the ENABLE_NETWORK switch. No replacement is planned, but if you feel we really need this option, we welcome any Pull Request which implements this in a way that doesn't crawl through the code like this diff shows we used to. --- Doxyfile | 3 +- config.lib | 31 +++---------------- src/ai/ai.hpp | 2 -- src/ai/ai_core.cpp | 4 --- src/ai/ai_gui.cpp | 2 -- src/base_media_func.h | 17 ---------- src/bootstrap_gui.cpp | 6 ++-- src/command.cpp | 6 ---- src/command_func.h | 2 -- src/company_cmd.cpp | 12 -------- src/company_gui.cpp | 8 ----- src/console.cpp | 6 ---- src/console_cmds.cpp | 24 ++------------- src/date.cpp | 8 ----- src/debug.cpp | 6 ---- src/dedicated.cpp | 9 ------ src/economy.cpp | 2 -- src/fileio.cpp | 9 ------ src/fios.cpp | 12 +++----- src/fios_gui.cpp | 4 --- src/game/game.hpp | 2 -- src/game/game_core.cpp | 4 --- src/gfx.cpp | 4 --- src/goal.cpp | 8 ----- src/intro_gui.cpp | 2 -- src/lang/english.txt | 2 +- src/main_gui.cpp | 28 ++++++----------- src/misc.cpp | 2 -- src/misc_cmd.cpp | 6 ---- src/network/core/address.cpp | 4 --- src/network/core/address.h | 3 -- src/network/core/core.cpp | 4 --- src/network/core/core.h | 4 --- src/network/core/game.h | 4 --- src/network/core/host.cpp | 4 --- src/network/core/os_abstraction.h | 4 --- src/network/core/packet.cpp | 4 --- src/network/core/packet.h | 4 --- src/network/core/tcp.cpp | 4 --- src/network/core/tcp.h | 4 --- src/network/core/tcp_admin.cpp | 4 --- src/network/core/tcp_admin.h | 4 --- src/network/core/tcp_connect.cpp | 4 --- src/network/core/tcp_content.cpp | 4 --- src/network/core/tcp_content.h | 4 --- src/network/core/tcp_game.cpp | 4 --- src/network/core/tcp_game.h | 4 --- src/network/core/tcp_http.cpp | 4 --- src/network/core/tcp_http.h | 4 --- src/network/core/tcp_listen.h | 4 --- src/network/core/udp.cpp | 4 --- src/network/core/udp.h | 4 --- src/network/network.cpp | 4 --- src/network/network.h | 18 ----------- src/network/network_admin.cpp | 4 --- src/network/network_admin.h | 3 -- src/network/network_base.h | 3 -- src/network/network_chat_gui.cpp | 4 --- src/network/network_client.cpp | 4 --- src/network/network_client.h | 4 --- src/network/network_command.cpp | 4 --- src/network/network_content.cpp | 4 --- src/network/network_content.h | 6 ---- src/network/network_content_gui.cpp | 3 -- src/network/network_func.h | 3 -- src/network/network_gamelist.cpp | 4 --- src/network/network_gui.cpp | 3 -- src/network/network_gui.h | 12 -------- src/network/network_internal.h | 3 -- src/network/network_server.cpp | 4 --- src/network/network_server.h | 10 ------ src/network/network_type.h | 3 -- src/network/network_udp.cpp | 4 --- src/network/network_udp.h | 4 --- src/newgrf_config.cpp | 7 ----- src/newgrf_config.h | 2 -- src/newgrf_gui.cpp | 4 --- src/openttd.cpp | 39 +---------------------- src/order_backup.cpp | 4 --- src/script/api/script_admin.cpp | 2 -- src/script/api/script_client.cpp | 18 ----------- src/script/api/script_clientlist.cpp | 4 --- src/script/api/script_game.cpp | 4 --- src/script/api/script_goal.cpp | 4 --- src/script/api/script_object.cpp | 2 -- src/script/script_scanner.cpp | 6 ---- src/settings.cpp | 10 ------ src/settings_func.h | 4 --- src/settings_type.h | 5 --- src/strings.cpp | 10 +----- src/table/gameopt_settings.ini | 2 -- src/table/settings.ini | 46 +--------------------------- src/toolbar_gui.cpp | 10 ------ src/video/dedicated_v.cpp | 4 --- src/viewport.cpp | 4 --- src/window.cpp | 5 +-- 96 files changed, 29 insertions(+), 600 deletions(-) diff --git a/Doxyfile b/Doxyfile index b6b46257a7..5677118c54 100644 --- a/Doxyfile +++ b/Doxyfile @@ -289,8 +289,7 @@ EXPAND_ONLY_PREDEF = YES SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = -PREDEFINED = ENABLE_NETWORK \ - WITH_ZLIB \ +PREDEFINED = WITH_ZLIB \ WITH_LZO \ WITH_LIBLZMA \ WITH_SDL \ diff --git a/config.lib b/config.lib index 18ea119c43..026f7bfb3c 100644 --- a/config.lib +++ b/config.lib @@ -52,7 +52,6 @@ set_default() { enable_profiling="0" enable_lto="0" enable_dedicated="0" - enable_network="1" enable_static="1" enable_translator="0" enable_unicode="1" @@ -130,7 +129,6 @@ set_default() { enable_profiling enable_lto enable_dedicated - enable_network enable_static enable_translator enable_unicode @@ -289,9 +287,6 @@ detect_params() { --enable-ipo=*) enable_lto="$optarg";; --enable-dedicated) enable_dedicated="1";; --enable-dedicated=*) enable_dedicated="$optarg";; - --enable-network) enable_network="2";; - --enable-network=*) enable_network="$optarg";; - --disable-network) enable_network="0";; --disable-static) enable_static="0";; --enable-static) enable_static="2";; --enable-static=*) enable_static="$optarg";; @@ -749,11 +744,6 @@ check_params() { if [ "$enable_dedicated" != "0" ]; then log 1 "checking GDI video driver... dedicated server, skipping" log 1 "checking dedicated... found" - - if [ "$enable_network" = "0" ]; then - log 1 "configure: error: building a dedicated server without network support is pointless" - exit 1 - fi else if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then log 1 "checking GDI video driver... found" @@ -784,12 +774,6 @@ check_params() { log 1 "checking console application... enabled" fi - if [ "$enable_network" != "0" ]; then - log 1 "checking network... found" - else - log 1 "checking network... disabled" - fi - log 1 "checking squirrel... found" SCRIPT_SRC_DIR="$ROOT_DIR/src/3rdparty/squirrel/include" @@ -1833,16 +1817,12 @@ make_cflags_and_ldflags() { CFLAGS="$CFLAGS -DUNICODE -D_UNICODE" fi - if [ "$enable_network" != "0" ]; then - CFLAGS="$CFLAGS -DENABLE_NETWORK" - - if [ "$os" = "HAIKU" ]; then - LDFLAGS="$LDFLAGS -lnetwork" - fi + if [ "$os" = "HAIKU" ]; then + LDFLAGS="$LDFLAGS -lnetwork" + fi - if [ "$os" = "SUNOS" ]; then - LDFLAGS="$LDFLAGS -lnsl -lsocket" - fi + if [ "$os" = "SUNOS" ]; then + LDFLAGS="$LDFLAGS -lnsl -lsocket" fi if [ "$enable_static" != "0" ]; then @@ -3499,7 +3479,6 @@ showhelp() { echo " --enable-console compile as a console application instead of as a GUI application." echo " If this setting is active, debug output will appear in the same" echo " console instead of opening a new window. (Win32 ONLY)" - echo " --disable-network disable network support" echo " --disable-assert disable asserts (continue on errors)" echo " --enable-strip enable any possible stripping" echo " --without-osx-sysroot disable the automatic adding of sysroot " diff --git a/src/ai/ai.hpp b/src/ai/ai.hpp index 1b5b6c07da..bd9544b9f3 100644 --- a/src/ai/ai.hpp +++ b/src/ai/ai.hpp @@ -164,11 +164,9 @@ public: /** Gets the ScriptScanner instance that is used to find AI Libraries */ static AIScannerLibrary *GetScannerLibrary(); -#if defined(ENABLE_NETWORK) /** Wrapper function for AIScanner::HasAI */ static bool HasAI(const struct ContentInfo *ci, bool md5sum); static bool HasAILibrary(const ContentInfo *ci, bool md5sum); -#endif private: static uint frame_counter; ///< Tick counter for the AI code static class AIScannerInfo *scanner_info; ///< ScriptScanner instance that is used to find AIs diff --git a/src/ai/ai_core.cpp b/src/ai/ai_core.cpp index 51522edaff..ff2fc286a0 100644 --- a/src/ai/ai_core.cpp +++ b/src/ai/ai_core.cpp @@ -362,8 +362,6 @@ InvalidateWindowClassesData(WC_AI_SETTINGS); } -#if defined(ENABLE_NETWORK) - /** * Check whether we have an AI (library) with the exact characteristics as ci. * @param ci the characteristics to search on (shortname and md5sum) @@ -380,8 +378,6 @@ return AI::scanner_library->HasScript(ci, md5sum); } -#endif /* defined(ENABLE_NETWORK) */ - /* static */ AIScannerInfo *AI::GetScannerInfo() { return AI::scanner_info; diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 73806da15e..8e7e12a63b 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -928,9 +928,7 @@ struct AIConfigWindow : public Window { if (!_network_available) { ShowErrorMessage(STR_NETWORK_ERROR_NOTAVAILABLE, INVALID_STRING_ID, WL_ERROR); } else { -#if defined(ENABLE_NETWORK) ShowNetworkContentListWindow(NULL, CONTENT_TYPE_AI, CONTENT_TYPE_GAME); -#endif } break; } diff --git a/src/base_media_func.h b/src/base_media_func.h index f7afca0edb..ed954360a0 100644 --- a/src/base_media_func.h +++ b/src/base_media_func.h @@ -277,7 +277,6 @@ template return p; } -#if defined(ENABLE_NETWORK) #include "network/network_content.h" template const char *TryGetBaseSetFile(const ContentInfo *ci, bool md5sum, const Tbase_set *s) @@ -307,22 +306,6 @@ template (TryGetBaseSetFile(ci, md5sum, BaseMedia::duplicate_sets) != NULL); } -#else - -template -const char *TryGetBaseSetFile(const ContentInfo *ci, bool md5sum, const Tbase_set *s) -{ - return NULL; -} - -template -/* static */ bool BaseMedia::HasSet(const ContentInfo *ci, bool md5sum) -{ - return false; -} - -#endif /* ENABLE_NETWORK */ - /** * Count the number of available graphics sets. * @return the number of sets diff --git a/src/bootstrap_gui.cpp b/src/bootstrap_gui.cpp index 3fb52a1f9e..01d83848b8 100644 --- a/src/bootstrap_gui.cpp +++ b/src/bootstrap_gui.cpp @@ -13,7 +13,7 @@ #include "base_media_base.h" #include "blitter/factory.hpp" -#if defined(ENABLE_NETWORK) && defined(WITH_FREETYPE) +#if defined(WITH_FREETYPE) #include "core/geometry_func.hpp" #include "fontcache.h" @@ -204,7 +204,7 @@ public: } }; -#endif /* defined(ENABLE_NETWORK) && defined(WITH_FREETYPE) */ +#endif /* defined(WITH_FREETYPE) */ /** * Handle all procedures for bootstrapping OpenTTD without a base graphics set. @@ -220,7 +220,7 @@ bool HandleBootstrap() if (BlitterFactory::GetCurrentBlitter()->GetScreenDepth() == 0) goto failure; /* If there is no network or no freetype, then there is nothing we can do. Go straight to failure. */ -#if defined(ENABLE_NETWORK) && defined(WITH_FREETYPE) && (defined(WITH_FONTCONFIG) || defined(_WIN32) || defined(__APPLE__)) +#if defined(WITH_FREETYPE) && (defined(WITH_FONTCONFIG) || defined(_WIN32) || defined(__APPLE__)) if (!_network_available) goto failure; /* First tell the game we're bootstrapping. */ diff --git a/src/command.cpp b/src/command.cpp index 72b3f4302e..7500a170bd 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -573,10 +573,8 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac return false; } -#ifdef ENABLE_NETWORK /* Only set p2 when the command does not come from the network. */ if (!(cmd & CMD_NETWORK_COMMAND) && GetCommandFlags(cmd) & CMD_CLIENT_ID && p2 == 0) p2 = CLIENT_ID_SERVER; -#endif CommandCost res = DoCommandPInternal(tile, p1, p2, cmd, callback, text, my_cmd, estimate_only); if (res.Failed()) { @@ -646,10 +644,8 @@ CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, /* Flags get send to the DoCommand */ DoCommandFlag flags = CommandFlagsToDCFlags(cmd_flags); -#ifdef ENABLE_NETWORK /* Make sure p2 is properly set to a ClientID. */ assert(!(cmd_flags & CMD_CLIENT_ID) || p2 != 0); -#endif /* Do not even think about executing out-of-bounds tile-commands */ if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (cmd_flags & CMD_ALL_TILES) == 0))) return_dcpi(CMD_ERROR); @@ -696,7 +692,6 @@ CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, return_dcpi(res); } -#ifdef ENABLE_NETWORK /* * If we are in network, and the command is not from the network * send it to the command-queue and abort execution @@ -711,7 +706,6 @@ CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, * reset the storages as we've not executed the command. */ return_dcpi(CommandCost()); } -#endif /* ENABLE_NETWORK */ DEBUG(desync, 1, "cmd: %08x; %02x; %02x; %06x; %08x; %08x; %08x; \"%s\" (%s)", _date, _date_fract, (int)_current_company, tile, p1, p2, cmd & ~CMD_NETWORK_COMMAND, text, GetCommandName(cmd)); /* Actually try and execute the command. If no cost-type is given diff --git a/src/command_func.h b/src/command_func.h index 3369475675..ea42f25d35 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -42,9 +42,7 @@ bool DoCommandP(const CommandContainer *container, bool my_cmd = true); CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback, const char *text, bool my_cmd, bool estimate_only); -#ifdef ENABLE_NETWORK void NetworkSendCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback, const char *text, CompanyID company); -#endif /* ENABLE_NETWORK */ extern Money _additional_cash_required; diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 8cc876751c..4d8750851f 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -104,10 +104,8 @@ void SetLocalCompany(CompanyID new_company) /* company could also be COMPANY_SPECTATOR or OWNER_NONE */ assert(Company::IsValidID(new_company) || new_company == COMPANY_SPECTATOR || new_company == OWNER_NONE); -#ifdef ENABLE_NETWORK /* Delete the chat window, if you were team chatting. */ InvalidateWindowData(WC_SEND_NETWORK_MSG, DESTTYPE_TEAM, _local_company); -#endif assert(IsLocalCompany()); @@ -597,9 +595,7 @@ void StartupCompanies() /** Start a new competitor company if possible. */ static bool MaybeStartNewCompany() { -#ifdef ENABLE_NETWORK if (_networking && Company::GetNumItems() >= _settings_client.network.max_companies) return false; -#endif /* ENABLE_NETWORK */ Company *c; @@ -792,9 +788,7 @@ void CompanyNewsInformation::FillData(const Company *c, const Company *other) */ void CompanyAdminUpdate(const Company *company) { -#ifdef ENABLE_NETWORK if (_network_server) NetworkAdminCompanyUpdate(company); -#endif /* ENABLE_NETWORK */ } /** @@ -804,9 +798,7 @@ void CompanyAdminUpdate(const Company *company) */ void CompanyAdminRemove(CompanyID company_id, CompanyRemoveReason reason) { -#ifdef ENABLE_NETWORK if (_network_server) NetworkAdminCompanyRemove(company_id, (AdminCompanyRemoveReason)reason); -#endif /* ENABLE_NETWORK */ } /** @@ -832,7 +824,6 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 /* This command is only executed in a multiplayer game */ if (!_networking) return CMD_ERROR; -#ifdef ENABLE_NETWORK /* Has the network client a correct ClientIndex? */ if (!(flags & DC_EXEC)) return CommandCost(); @@ -876,7 +867,6 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 } NetworkServerNewCompany(c, ci); -#endif /* ENABLE_NETWORK */ break; } @@ -885,9 +875,7 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 if (company_id != INVALID_COMPANY && (company_id >= MAX_COMPANIES || Company::IsValidID(company_id))) return CMD_ERROR; Company *c = DoStartupNewCompany(true, company_id); -#ifdef ENABLE_NETWORK if (c != NULL) NetworkServerNewCompany(c, NULL); -#endif /* ENABLE_NETWORK */ break; } diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 74e1cab57b..de5498102d 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -2387,11 +2387,9 @@ struct CompanyWindow : Window break; } -#ifdef ENABLE_NETWORK case WID_C_HAS_PASSWORD: *size = maxdim(*size, GetSpriteSize(SPR_LOCK)); break; -#endif /* ENABLE_NETWORK */ } } @@ -2498,13 +2496,11 @@ struct CompanyWindow : Window break; } -#ifdef ENABLE_NETWORK case WID_C_HAS_PASSWORD: if (_networking && NetworkCompanyIsPassworded(c->index)) { DrawSprite(SPR_LOCK, PAL_NONE, r.left, r.top); } break; -#endif /* ENABLE_NETWORK */ } } @@ -2594,7 +2590,6 @@ struct CompanyWindow : Window DoCommandP(0, this->window_number, 0, CMD_SELL_SHARE_IN_COMPANY | CMD_MSG(STR_ERROR_CAN_T_SELL_25_SHARE_IN)); break; -#ifdef ENABLE_NETWORK case WID_C_COMPANY_PASSWORD: if (this->window_number == _local_company) ShowNetworkCompanyPasswordWindow(this); break; @@ -2614,7 +2609,6 @@ struct CompanyWindow : Window } break; } -#endif /* ENABLE_NETWORK */ } } @@ -2652,11 +2646,9 @@ struct CompanyWindow : Window DoCommandP(0, 0, 0, CMD_RENAME_COMPANY | CMD_MSG(STR_ERROR_CAN_T_CHANGE_COMPANY_NAME), NULL, str); break; -#ifdef ENABLE_NETWORK case WID_C_COMPANY_JOIN: NetworkClientRequestMove((CompanyID)this->window_number, str); break; -#endif /* ENABLE_NETWORK */ } } diff --git a/src/console.cpp b/src/console.cpp index 2cf9d96958..c7f24a9dc5 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -33,10 +33,8 @@ FILE *_iconsole_output_file; void IConsoleInit() { _iconsole_output_file = NULL; -#ifdef ENABLE_NETWORK /* Initialize network only variables */ _redirect_console_to_client = INVALID_CLIENT_ID; _redirect_console_to_admin = INVALID_ADMIN_ID; -#endif IConsoleGUIInit(); @@ -90,7 +88,6 @@ void IConsolePrint(TextColour colour_code, const char *string) assert(IsValidConsoleColour(colour_code)); char *str; -#ifdef ENABLE_NETWORK if (_redirect_console_to_client != INVALID_CLIENT_ID) { /* Redirect the string to the client */ NetworkServerSendRcon(_redirect_console_to_client, colour_code, string); @@ -101,7 +98,6 @@ void IConsolePrint(TextColour colour_code, const char *string) NetworkServerSendAdminRcon(_redirect_console_to_admin, colour_code, string); return; } -#endif /* Create a copy of the string, strip if of colours and invalid * characters and (when applicable) assign it to the console buffer */ @@ -110,9 +106,7 @@ void IConsolePrint(TextColour colour_code, const char *string) str_validate(str, str + strlen(str)); if (_network_dedicated) { -#ifdef ENABLE_NETWORK NetworkAdminConsole("console", str); -#endif /* ENABLE_NETWORK */ fprintf(stdout, "%s%s\n", GetLogPrefix(), str); fflush(stdout); IConsoleWriteToLogFile(str); diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 732ace6a2b..6c8e927c96 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -86,8 +86,6 @@ static ConsoleFileList _console_file_list; ///< File storage cache for the conso * command hooks ****************/ -#ifdef ENABLE_NETWORK - /** * Check network availability and inform in console about failure of detection. * @return Network availability. @@ -159,10 +157,6 @@ DEF_CONSOLE_HOOK(ConHookNoNetwork) return CHR_ALLOW; } -#else -# define ConHookNoNetwork NULL -#endif /* ENABLE_NETWORK */ - DEF_CONSOLE_HOOK(ConHookNewGRFDeveloperTool) { if (_settings_client.gui.newgrf_developer_tools) { @@ -170,11 +164,7 @@ DEF_CONSOLE_HOOK(ConHookNewGRFDeveloperTool) if (echo) IConsoleError("This command is only available in game and editor."); return CHR_DISALLOW; } -#ifdef ENABLE_NETWORK return ConHookNoNetwork(echo); -#else - return CHR_ALLOW; -#endif } return CHR_HIDE; } @@ -479,7 +469,6 @@ DEF_CONSOLE_CMD(ConClearBuffer) /********************************** * Network Core Console Commands **********************************/ -#ifdef ENABLE_NETWORK static bool ConKickOrBan(const char *argv, bool ban) { @@ -930,8 +919,6 @@ DEF_CONSOLE_CMD(ConNetworkConnect) return true; } -#endif /* ENABLE_NETWORK */ - /********************************* * script file console commands *********************************/ @@ -1547,12 +1534,9 @@ DEF_CONSOLE_CMD(ConCompanies) const char *password_state = ""; if (c->is_ai) { password_state = "AI"; - } -#ifdef ENABLE_NETWORK - else if (_network_server) { + } else if (_network_server) { password_state = StrEmpty(_network_company_states[c->index].password) ? "unprotected" : "protected"; } -#endif char colour[512]; GetString(colour, STR_COLOUR_DARK_BLUE + _company_colours[c->index], lastof(colour)); @@ -1569,8 +1553,6 @@ DEF_CONSOLE_CMD(ConCompanies) return true; } -#ifdef ENABLE_NETWORK - DEF_CONSOLE_CMD(ConSay) { if (argc == 0) { @@ -1812,7 +1794,6 @@ DEF_CONSOLE_CMD(ConContent) return false; } #endif /* defined(WITH_ZLIB) */ -#endif /* ENABLE_NETWORK */ DEF_CONSOLE_CMD(ConSetting) { @@ -1992,7 +1973,7 @@ void IConsoleStdLibRegister() IConsoleAliasRegister("players", "companies"); /* networking functions */ -#ifdef ENABLE_NETWORK + /* Content downloading is only available with ZLIB */ #if defined(WITH_ZLIB) IConsoleCmdRegister("content", ConContent); @@ -2050,7 +2031,6 @@ void IConsoleStdLibRegister() IConsoleAliasRegister("restart_game_year", "setting restart_game_year %+"); IConsoleAliasRegister("min_players", "setting min_active_clients %+"); IConsoleAliasRegister("reload_cfg", "setting reload_cfg %+"); -#endif /* ENABLE_NETWORK */ /* debugging stuff */ #ifdef _DEBUG diff --git a/src/date.cpp b/src/date.cpp index 9c25af40ee..8b8fab5b0a 100644 --- a/src/date.cpp +++ b/src/date.cpp @@ -195,9 +195,7 @@ static void OnNewYear() VehiclesYearlyLoop(); TownsYearlyLoop(); InvalidateWindowClassesData(WC_BUILD_STATION); -#ifdef ENABLE_NETWORK if (_network_server) NetworkServerYearlyLoop(); -#endif /* ENABLE_NETWORK */ if (_cur_year == _settings_client.gui.semaphore_build_before) ResetSignalVariant(); @@ -217,11 +215,9 @@ static void OnNewYear() LinkGraph *lg; FOR_ALL_LINK_GRAPHS(lg) lg->ShiftDates(-days_this_year); -#ifdef ENABLE_NETWORK /* Because the _date wraps here, and text-messages expire by game-days, we have to clean out * all of them if the date is set back, else those messages will hang for ever */ NetworkInitChatMessage(); -#endif /* ENABLE_NETWORK */ } if (_settings_client.gui.auto_euro) CheckSwitchToEuro(); @@ -244,9 +240,7 @@ static void OnNewMonth() IndustryMonthlyLoop(); SubsidyMonthlyLoop(); StationMonthlyLoop(); -#ifdef ENABLE_NETWORK if (_network_server) NetworkServerMonthlyLoop(); -#endif /* ENABLE_NETWORK */ } /** @@ -254,9 +248,7 @@ static void OnNewMonth() */ static void OnNewDay() { -#ifdef ENABLE_NETWORK if (_network_server) NetworkServerDailyLoop(); -#endif /* ENABLE_NETWORK */ DisasterDailyLoop(); IndustryDailyLoop(); diff --git a/src/debug.cpp b/src/debug.cpp index 13df98db34..422f730389 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -23,10 +23,8 @@ #include -#if defined(ENABLE_NETWORK) #include "network/network_admin.h" SOCKET _debug_socket = INVALID_SOCKET; -#endif /* ENABLE_NETWORK */ #include "safeguards.h" @@ -111,7 +109,6 @@ char *DumpDebugFacilityNames(char *buf, char *last) */ static void debug_print(const char *dbg, const char *buf) { -#if defined(ENABLE_NETWORK) if (_debug_socket != INVALID_SOCKET) { char buf2[1024 + 32]; @@ -121,7 +118,6 @@ static void debug_print(const char *dbg, const char *buf) send(_debug_socket, buf2, (int)strlen(buf2), 0); return; } -#endif /* ENABLE_NETWORK */ if (strcmp(dbg, "desync") == 0) { static FILE *f = FioFOpenFile("commands-out.log", "wb", AUTOSAVE_DIR); if (f == NULL) return; @@ -146,9 +142,7 @@ static void debug_print(const char *dbg, const char *buf) #else fputs(buffer, stderr); #endif -#ifdef ENABLE_NETWORK NetworkAdminConsole(dbg, buf); -#endif /* ENABLE_NETWORK */ IConsoleDebug(dbg, buf); } } diff --git a/src/dedicated.cpp b/src/dedicated.cpp index 574cbb0c34..141a917208 100644 --- a/src/dedicated.cpp +++ b/src/dedicated.cpp @@ -11,8 +11,6 @@ #include "stdafx.h" -#ifdef ENABLE_NETWORK - char *_log_file = NULL; ///< File to reroute output of a forked OpenTTD to FILE *_log_fd = NULL; ///< File to reroute output of a forked OpenTTD to @@ -67,10 +65,3 @@ void DedicatedFork() } } #endif - -#else - -/** Empty helper function call for NOT(UNIX) systems */ -void DedicatedFork() {} - -#endif /* ENABLE_NETWORK */ diff --git a/src/economy.cpp b/src/economy.cpp index 19b36e7c9e..bf520c3f6f 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -292,10 +292,8 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner) * the client. This is needed as it needs to know whether "you" really * are the current local company. */ Backup cur_company(_current_company, old_owner, FILE_LINE); -#ifdef ENABLE_NETWORK /* In all cases, make spectators of clients connected to that company */ if (_networking) NetworkClientsToSpectators(old_owner); -#endif /* ENABLE_NETWORK */ if (old_owner == _local_company) { /* Single player cheated to AI company. * There are no spectators in single player, so we must pick some other company. */ diff --git a/src/fileio.cpp b/src/fileio.cpp index 22adb76d52..caaa0fed53 100644 --- a/src/fileio.cpp +++ b/src/fileio.cpp @@ -1240,7 +1240,6 @@ void DeterminePaths(const char *exe) /* If we have network we make a directory for the autodownloading of content */ _searchpaths[SP_AUTODOWNLOAD_DIR] = str_fmt("%s%s", _personal_dir, "content_download" PATHSEP); -#ifdef ENABLE_NETWORK FioCreateDirectory(_searchpaths[SP_AUTODOWNLOAD_DIR]); /* Create the directory for each of the types of content */ @@ -1253,14 +1252,6 @@ void DeterminePaths(const char *exe) extern char *_log_file; _log_file = str_fmt("%sopenttd.log", _personal_dir); -#else /* ENABLE_NETWORK */ - /* If we don't have networking, we don't need to make the directory. But - * if it exists we keep it, otherwise remove it from the search paths. */ - if (!FileExists(_searchpaths[SP_AUTODOWNLOAD_DIR])) { - free(_searchpaths[SP_AUTODOWNLOAD_DIR]); - _searchpaths[SP_AUTODOWNLOAD_DIR] = NULL; - } -#endif /* ENABLE_NETWORK */ } /** diff --git a/src/fios.cpp b/src/fios.cpp index aef3a8407d..835c04ddb2 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -13,11 +13,13 @@ */ #include "stdafx.h" -#include "fios.h" +#include "3rdparty/md5/md5.h" #include "fileio_func.h" -#include "tar_type.h" +#include "fios.h" +#include "network/network_content.h" #include "screenshot.h" #include "string_func.h" +#include "tar_type.h" #include #ifndef _WIN32 @@ -632,10 +634,6 @@ const char *FiosGetScreenshotDir() return fios_screenshot_path; } -#if defined(ENABLE_NETWORK) -#include "network/network_content.h" -#include "3rdparty/md5/md5.h" - /** Basic data to distinguish a scenario. Used in the server list window */ struct ScenarioIdentifier { uint32 scenid; ///< ID for the scenario (generated by content). @@ -754,5 +752,3 @@ void ScanScenarios() { _scanner.Scan(true); } - -#endif /* ENABLE_NETWORK */ diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index 9911de2133..fd9e0c06a8 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -634,9 +634,7 @@ public: if (!_network_available) { ShowErrorMessage(STR_NETWORK_ERROR_NOTAVAILABLE, INVALID_STRING_ID, WL_ERROR); } else if (_load_check_data.HasNewGrfs()) { -#if defined(ENABLE_NETWORK) ShowMissingContentWindow(_load_check_data.grfconfig); -#endif } break; @@ -698,14 +696,12 @@ public: if (!_network_available) { ShowErrorMessage(STR_NETWORK_ERROR_NOTAVAILABLE, INVALID_STRING_ID, WL_ERROR); } else { -#if defined(ENABLE_NETWORK) assert(this->fop == SLO_LOAD); switch (this->abstract_filetype) { default: NOT_REACHED(); case FT_SCENARIO: ShowNetworkContentListWindow(NULL, CONTENT_TYPE_SCENARIO); break; case FT_HEIGHTMAP: ShowNetworkContentListWindow(NULL, CONTENT_TYPE_HEIGHTMAP); break; } -#endif } break; diff --git a/src/game/game.hpp b/src/game/game.hpp index 329ba5e500..95d9aa0a13 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -112,11 +112,9 @@ public: */ static class GameInstance *GetInstance() { return Game::instance; } -#if defined(ENABLE_NETWORK) /** Wrapper function for GameScanner::HasGame */ static bool HasGame(const struct ContentInfo *ci, bool md5sum); static bool HasGameLibrary(const ContentInfo *ci, bool md5sum); -#endif /** Gets the ScriptScanner instance that is used to find Game scripts */ static GameScannerInfo *GetScannerInfo(); /** Gets the ScriptScanner instance that is used to find Game Libraries */ diff --git a/src/game/game_core.cpp b/src/game/game_core.cpp index 10b079bee3..7b05abb40d 100644 --- a/src/game/game_core.cpp +++ b/src/game/game_core.cpp @@ -257,8 +257,6 @@ return Game::scanner_library->FindLibrary(library, version); } -#if defined(ENABLE_NETWORK) - /** * Check whether we have an Game (library) with the exact characteristics as ci. * @param ci the characteristics to search on (shortname and md5sum) @@ -275,8 +273,6 @@ return Game::scanner_library->HasScript(ci, md5sum); } -#endif /* defined(ENABLE_NETWORK) */ - /* static */ GameScannerInfo *Game::GetScannerInfo() { return Game::scanner_info; diff --git a/src/gfx.cpp b/src/gfx.cpp index 7a6b827b7a..aedd2c17e3 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -86,9 +86,7 @@ void GfxScroll(int left, int top, int width, int height, int xo, int yo) if (_cursor.visible) UndrawMouseCursor(); -#ifdef ENABLE_NETWORK if (_networking) NetworkUndrawChatMessage(); -#endif /* ENABLE_NETWORK */ blitter->ScrollBuffer(_screen.dst_ptr, left, top, width, height, xo, yo); /* This part of the screen is now dirty. */ @@ -1288,9 +1286,7 @@ void RedrawScreenRect(int left, int top, int right, int bottom) } } -#ifdef ENABLE_NETWORK if (_networking) NetworkUndrawChatMessage(); -#endif /* ENABLE_NETWORK */ DrawOverlappedWindowForAll(left, top, right, bottom); diff --git a/src/goal.cpp b/src/goal.cpp index f7aae350e5..eba72b7f40 100644 --- a/src/goal.cpp +++ b/src/goal.cpp @@ -247,20 +247,14 @@ CommandCost CmdGoalQuestion(TileIndex tile, DoCommandFlag flags, uint32 p1, uint { uint16 uniqueid = (GoalType)GB(p1, 0, 16); CompanyID company = (CompanyID)GB(p1, 16, 8); -#ifdef ENABLE_NETWORK ClientIndex client = (ClientIndex)GB(p1, 16, 8); -#endif byte type = GB(p1, 24, 2); bool is_client = HasBit(p1, 31); if (_current_company != OWNER_DEITY) return CMD_ERROR; if (StrEmpty(text)) return CMD_ERROR; if (is_client) { -#ifdef ENABLE_NETWORK if (!NetworkClientInfo::IsValidID(client)) return CMD_ERROR; -#else - return CMD_ERROR; -#endif } else { if (company != INVALID_COMPANY && !Company::IsValidID(company)) return CMD_ERROR; } @@ -270,9 +264,7 @@ CommandCost CmdGoalQuestion(TileIndex tile, DoCommandFlag flags, uint32 p1, uint if (flags & DC_EXEC) { if (is_client) { -#ifdef ENABLE_NETWORK if (NetworkClientInfo::Get(client)->client_id != _network_own_client_id) return CommandCost(); -#endif } else { if (company == INVALID_COMPANY && !Company::IsValidID(_local_company)) return CommandCost(); if (company != INVALID_COMPANY && company != _local_company) return CommandCost(); diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index c0d78028bd..001afde1d4 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -113,11 +113,9 @@ struct SelectGameWindow : public Window { virtual void OnClick(Point pt, int widget, int click_count) { -#ifdef ENABLE_NETWORK /* Do not create a network server when you (just) have closed one of the game * creation/load windows for the network server. */ if (IsInsideMM(widget, WID_SGI_GENERATE_GAME, WID_SGI_EDIT_SCENARIO + 1)) _is_network_server = false; -#endif /* ENABLE_NETWORK */ switch (widget) { case WID_SGI_GENERATE_GAME: diff --git a/src/lang/english.txt b/src/lang/english.txt index 45bbbc0bfa..3661e74c30 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -2139,7 +2139,7 @@ STR_NETWORK_CHAT_ALL :[All] {RAW_STRI STR_NETWORK_CHAT_OSKTITLE :{BLACK}Enter text for network chat # Network messages -STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}No network devices found or compiled without ENABLE_NETWORK +STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}No network devices found STR_NETWORK_ERROR_NOSERVER :{WHITE}Could not find any network games STR_NETWORK_ERROR_NOCONNECTION :{WHITE}The server didn't answer the request STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Could not connect due to NewGRF mismatch diff --git a/src/main_gui.cpp b/src/main_gui.cpp index cdd3831576..7ab9bebb16 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -53,7 +53,6 @@ static int _rename_what = -1; void CcGiveMoney(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) { -#ifdef ENABLE_NETWORK if (result.Failed() || !_settings_game.economy.give_money) return; /* Inform the company of the action of one of its clients (controllers). */ @@ -66,25 +65,22 @@ void CcGiveMoney(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2 } else { NetworkServerSendChat(NETWORK_ACTION_GIVE_MONEY, DESTTYPE_TEAM, p2, msg, CLIENT_ID_SERVER, p1); } -#endif /* ENABLE_NETWORK */ } void HandleOnEditText(const char *str) { switch (_rename_what) { -#ifdef ENABLE_NETWORK - case 3: { // Give money, you can only give money in excess of loan - const Company *c = Company::GetIfValid(_local_company); - if (c == NULL) break; - Money money = min(c->money - c->current_loan, (Money)(atoi(str) / _currency->rate)); + case 3: { // Give money, you can only give money in excess of loan + const Company *c = Company::GetIfValid(_local_company); + if (c == NULL) break; + Money money = min(c->money - c->current_loan, (Money)(atoi(str) / _currency->rate)); - uint32 money_c = Clamp(ClampToI32(money), 0, 20000000); // Clamp between 20 million and 0 + uint32 money_c = Clamp(ClampToI32(money), 0, 20000000); // Clamp between 20 million and 0 - /* Give 'id' the money, and subtract it from ourself */ - DoCommandP(0, money_c, _rename_id, CMD_GIVE_MONEY | CMD_MSG(STR_ERROR_INSUFFICIENT_FUNDS), CcGiveMoney, str); - break; - } -#endif /* ENABLE_NETWORK */ + /* Give 'id' the money, and subtract it from ourself */ + DoCommandP(0, money_c, _rename_id, CMD_GIVE_MONEY | CMD_MSG(STR_ERROR_INSUFFICIENT_FUNDS), CcGiveMoney, str); + break; + } default: NOT_REACHED(); } @@ -124,14 +120,12 @@ void CcPlaySound_EXPLOSION(const CommandCost &result, TileIndex tile, uint32 p1, if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_12_EXPLOSION, tile); } -#ifdef ENABLE_NETWORK void ShowNetworkGiveMoneyWindow(CompanyID company) { _rename_id = company; _rename_what = 3; ShowQueryString(STR_EMPTY, STR_NETWORK_GIVE_MONEY_CAPTION, 30, NULL, CS_NUMERAL, QSF_NONE); } -#endif /* ENABLE_NETWORK */ /** @@ -397,7 +391,6 @@ struct MainWindow : Window ResetRestoreAllTransparency(); break; -#ifdef ENABLE_NETWORK case GHK_CHAT: // smart chat; send to team if any, otherwise to all if (_networking) { const NetworkClientInfo *cio = NetworkClientInfo::GetByClientID(_network_own_client_id); @@ -425,7 +418,6 @@ struct MainWindow : Window ShowNetworkChatQueryWindow(DESTTYPE_CLIENT, CLIENT_ID_SERVER); } break; -#endif default: return ES_NOT_HANDLED; } @@ -516,12 +508,10 @@ static Hotkey global_hotkeys[] = { Hotkey('8' | WKC_CTRL | WKC_SHIFT, "invisibility_catenary", GHK_TOGGLE_INVISIBILITY + 7), Hotkey('X' | WKC_CTRL, "transparency_toolbar", GHK_TRANSPARENCY_TOOLBAR), Hotkey('X', "toggle_transparency", GHK_TRANSPARANCY), -#ifdef ENABLE_NETWORK Hotkey(_ghk_chat_keys, "chat", GHK_CHAT), Hotkey(_ghk_chat_all_keys, "chat_all", GHK_CHAT_ALL), Hotkey(_ghk_chat_company_keys, "chat_company", GHK_CHAT_COMPANY), Hotkey(_ghk_chat_server_keys, "chat_server", GHK_CHAT_SERVER), -#endif HOTKEY_LIST_END }; HotkeyList MainWindow::hotkeys("global", global_hotkeys); diff --git a/src/misc.cpp b/src/misc.cpp index 4e3086fcea..3d09f26f26 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -111,9 +111,7 @@ void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settin InitializeCheats(); InitTextEffects(); -#ifdef ENABLE_NETWORK NetworkInitChatMessage(); -#endif /* ENABLE_NETWORK */ InitializeAnimatedTiles(); InitializeEconomy(); diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp index e7da13c7aa..09fbc78c6b 100644 --- a/src/misc_cmd.cpp +++ b/src/misc_cmd.cpp @@ -154,12 +154,10 @@ CommandCost CmdPause(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, case PM_PAUSED_GAME_SCRIPT: break; -#ifdef ENABLE_NETWORK case PM_PAUSED_JOIN: case PM_PAUSED_ACTIVE_CLIENTS: if (!_networking) return CMD_ERROR; break; -#endif /* ENABLE_NETWORK */ default: return CMD_ERROR; } @@ -172,9 +170,7 @@ CommandCost CmdPause(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, AskUnsafeUnpauseCallback ); } else { -#ifdef ENABLE_NETWORK PauseMode prev_mode = _pause_mode; -#endif /* ENABLE_NETWORK */ if (p2 == 0) { _pause_mode = _pause_mode & ~p1; @@ -182,9 +178,7 @@ CommandCost CmdPause(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, _pause_mode = _pause_mode | p1; } -#ifdef ENABLE_NETWORK NetworkHandlePauseChange(prev_mode, (PauseMode)p1); -#endif /* ENABLE_NETWORK */ } SetWindowDirty(WC_STATUS_BAR, 0); diff --git a/src/network/core/address.cpp b/src/network/core/address.cpp index 62af3a40bf..9522297768 100644 --- a/src/network/core/address.cpp +++ b/src/network/core/address.cpp @@ -11,8 +11,6 @@ #include "../../stdafx.h" -#ifdef ENABLE_NETWORK - #include "address.h" #include "../../debug.h" @@ -433,5 +431,3 @@ void NetworkAddress::Listen(int socktype, SocketList *sockets) default: return "unsupported"; } } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/core/address.h b/src/network/core/address.h index 9fd40eaeef..b5c78c79b7 100644 --- a/src/network/core/address.h +++ b/src/network/core/address.h @@ -17,8 +17,6 @@ #include "../../string_func.h" #include "../../core/smallmap_type.hpp" -#ifdef ENABLE_NETWORK - class NetworkAddress; typedef SmallVector NetworkAddressList; ///< Type for a list of addresses. typedef SmallMap SocketList; ///< Type for a mapping between address and socket. @@ -192,5 +190,4 @@ public: static const char *AddressFamilyAsString(int family); }; -#endif /* ENABLE_NETWORK */ #endif /* NETWORK_CORE_ADDRESS_H */ diff --git a/src/network/core/core.cpp b/src/network/core/core.cpp index e5f1df7214..1726e4176e 100644 --- a/src/network/core/core.cpp +++ b/src/network/core/core.cpp @@ -11,8 +11,6 @@ * @file core.cpp Functions used to initialize/shut down the core network */ -#ifdef ENABLE_NETWORK - #include "../../stdafx.h" #include "../../debug.h" #include "os_abstraction.h" @@ -80,5 +78,3 @@ void NetworkSocketHandler::ReceiveGRFIdentifier(Packet *p, GRFIdentifier *grf) grf->md5sum[j] = p->Recv_uint8(); } } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/core/core.h b/src/network/core/core.h index a250dbb081..1536c08a7a 100644 --- a/src/network/core/core.h +++ b/src/network/core/core.h @@ -17,8 +17,6 @@ #include "../../newgrf_config.h" #include "config.h" -#ifdef ENABLE_NETWORK - bool NetworkCoreInitialize(); void NetworkCoreShutdown(); @@ -80,6 +78,4 @@ public: void SendCompanyInformation(Packet *p, const struct Company *c, const struct NetworkCompanyStats *stats, uint max_len = NETWORK_COMPANY_NAME_LENGTH); }; -#endif /* ENABLE_NETWORK */ - #endif /* NETWORK_CORE_CORE_H */ diff --git a/src/network/core/game.h b/src/network/core/game.h index a9da29118e..57eba5812f 100644 --- a/src/network/core/game.h +++ b/src/network/core/game.h @@ -19,8 +19,6 @@ #include "../../newgrf_config.h" #include "../../date_type.h" -#ifdef ENABLE_NETWORK - /** * The game information that is not generated on-the-fly and has to * be sent to the clients. @@ -58,6 +56,4 @@ struct NetworkGameInfo : NetworkServerGameInfo { const char * GetNetworkRevisionString(); -#endif /* ENABLE_NETWORK */ - #endif /* NETWORK_CORE_GAME_H */ diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp index c2faf4c8b5..05ad84153b 100644 --- a/src/network/core/host.cpp +++ b/src/network/core/host.cpp @@ -9,8 +9,6 @@ /** @file host.cpp Functions related to getting host specific data (IPs). */ -#ifdef ENABLE_NETWORK - #include "../../stdafx.h" #include "../../debug.h" #include "address.h" @@ -207,5 +205,3 @@ void NetworkFindBroadcastIPs(NetworkAddressList *broadcast) DEBUG(net, 3, "%d) %s", i++, addr->GetHostname()); } } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/core/os_abstraction.h b/src/network/core/os_abstraction.h index 16c85d5660..ef5c0f2ab4 100644 --- a/src/network/core/os_abstraction.h +++ b/src/network/core/os_abstraction.h @@ -18,8 +18,6 @@ /* Include standard stuff per OS */ -#ifdef ENABLE_NETWORK - /* Windows stuff */ #if defined(_WIN32) #include @@ -172,6 +170,4 @@ static inline bool SetNoDelay(SOCKET d) assert_compile(sizeof(in_addr) == 4); ///< IPv4 addresses should be 4 bytes. assert_compile(sizeof(in6_addr) == 16); ///< IPv6 addresses should be 16 bytes. -#endif /* ENABLE_NETWORK */ - #endif /* NETWORK_CORE_OS_ABSTRACTION_H */ diff --git a/src/network/core/packet.cpp b/src/network/core/packet.cpp index 7548132e0b..8cecd9bd2f 100644 --- a/src/network/core/packet.cpp +++ b/src/network/core/packet.cpp @@ -11,8 +11,6 @@ * @file packet.cpp Basic functions to create, fill and read packets. */ -#ifdef ENABLE_NETWORK - #include "../../stdafx.h" #include "../../string_func.h" @@ -310,5 +308,3 @@ void Packet::Recv_string(char *buffer, size_t size, StringValidationSettings set str_validate(bufp, last, settings); } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/core/packet.h b/src/network/core/packet.h index 7f344d0179..7b4bf26f37 100644 --- a/src/network/core/packet.h +++ b/src/network/core/packet.h @@ -18,8 +18,6 @@ #include "core.h" #include "../../string_type.h" -#ifdef ENABLE_NETWORK - typedef uint16 PacketSize; ///< Size of the whole packet. typedef uint8 PacketType; ///< Identifier for the packet @@ -87,6 +85,4 @@ public: void Recv_string(char *buffer, size_t size, StringValidationSettings settings = SVS_REPLACE_WITH_QUESTION_MARK); }; -#endif /* ENABLE_NETWORK */ - #endif /* NETWORK_CORE_PACKET_H */ diff --git a/src/network/core/tcp.cpp b/src/network/core/tcp.cpp index a2f789c096..33b61688d0 100644 --- a/src/network/core/tcp.cpp +++ b/src/network/core/tcp.cpp @@ -11,8 +11,6 @@ * @file tcp.cpp Basic functions to receive and send TCP packets. */ -#ifdef ENABLE_NETWORK - #include "../../stdafx.h" #include "../../debug.h" @@ -243,5 +241,3 @@ bool NetworkTCPSocketHandler::CanSendReceive() this->writable = !!FD_ISSET(this->sock, &write_fd); return FD_ISSET(this->sock, &read_fd) != 0; } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/core/tcp.h b/src/network/core/tcp.h index b736189b4e..00642c2dd3 100644 --- a/src/network/core/tcp.h +++ b/src/network/core/tcp.h @@ -17,8 +17,6 @@ #include "address.h" #include "packet.h" -#ifdef ENABLE_NETWORK - /** The states of sending the packets. */ enum SendPacketsState { SPS_CLOSED, ///< The connection got closed. @@ -99,6 +97,4 @@ public: static void KillAll(); }; -#endif /* ENABLE_NETWORK */ - #endif /* NETWORK_CORE_TCP_H */ diff --git a/src/network/core/tcp_admin.cpp b/src/network/core/tcp_admin.cpp index 284ceda9b1..226bae0245 100644 --- a/src/network/core/tcp_admin.cpp +++ b/src/network/core/tcp_admin.cpp @@ -11,8 +11,6 @@ * @file tcp_admin.cpp Basic functions to receive and send TCP packets to and from the admin network. */ -#ifdef ENABLE_NETWORK - #include "../../stdafx.h" #include "../network_internal.h" @@ -172,5 +170,3 @@ NetworkRecvStatus NetworkAdminSocketHandler::Receive_SERVER_CMD_NAMES(Packet *p) NetworkRecvStatus NetworkAdminSocketHandler::Receive_SERVER_CMD_LOGGING(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_SERVER_CMD_LOGGING); } NetworkRecvStatus NetworkAdminSocketHandler::Receive_SERVER_RCON_END(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_SERVER_RCON_END); } NetworkRecvStatus NetworkAdminSocketHandler::Receive_SERVER_PONG(Packet *p) { return this->ReceiveInvalidPacket(ADMIN_PACKET_SERVER_PONG); } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/core/tcp_admin.h b/src/network/core/tcp_admin.h index e141a191a8..497c24b48a 100644 --- a/src/network/core/tcp_admin.h +++ b/src/network/core/tcp_admin.h @@ -19,8 +19,6 @@ #include "../network_type.h" #include "../../core/pool_type.hpp" -#ifdef ENABLE_NETWORK - /** * Enum with types of TCP packets specific to the admin network. * This protocol may only be extended to ensure stability. @@ -500,6 +498,4 @@ public: } }; -#endif /* ENABLE_NETWORK */ - #endif /* NETWORK_CORE_TCP_ADMIN_H */ diff --git a/src/network/core/tcp_connect.cpp b/src/network/core/tcp_connect.cpp index 2dc7898824..95f9662cd6 100644 --- a/src/network/core/tcp_connect.cpp +++ b/src/network/core/tcp_connect.cpp @@ -11,8 +11,6 @@ * @file tcp_connect.cpp Basic functions to create connections without blocking. */ -#ifdef ENABLE_NETWORK - #include "../../stdafx.h" #include "../../thread/thread.h" @@ -97,5 +95,3 @@ void TCPConnecter::Connect() { for (TCPConnecter **iter = _tcp_connecters.Begin(); iter != _tcp_connecters.End(); iter++) (*iter)->killed = true; } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/core/tcp_content.cpp b/src/network/core/tcp_content.cpp index fc22c4491f..8257a72526 100644 --- a/src/network/core/tcp_content.cpp +++ b/src/network/core/tcp_content.cpp @@ -11,8 +11,6 @@ * @file tcp_content.cpp Basic functions to receive and send Content packets. */ -#ifdef ENABLE_NETWORK - #include "../../stdafx.h" #ifndef OPENTTD_MSU #include "../../textfile_gui.h" @@ -266,5 +264,3 @@ Subdirectory GetContentInfoSubDir(ContentType type) } } #endif /* OPENTTD_MSU */ - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/core/tcp_content.h b/src/network/core/tcp_content.h index a506439da9..c359fb6679 100644 --- a/src/network/core/tcp_content.h +++ b/src/network/core/tcp_content.h @@ -19,8 +19,6 @@ #include "packet.h" #include "../../debug.h" -#ifdef ENABLE_NETWORK - /** The values in the enum are important; they are used as database 'keys' */ enum ContentType { CONTENT_TYPE_BEGIN = 1, ///< Helper to mark the begin of the types @@ -213,6 +211,4 @@ public: Subdirectory GetContentInfoSubDir(ContentType type); #endif /* OPENTTD_MSU */ -#endif /* ENABLE_NETWORK */ - #endif /* NETWORK_CORE_TCP_CONTENT_H */ diff --git a/src/network/core/tcp_game.cpp b/src/network/core/tcp_game.cpp index caa378fc4c..2d8a74a118 100644 --- a/src/network/core/tcp_game.cpp +++ b/src/network/core/tcp_game.cpp @@ -11,8 +11,6 @@ * @file tcp_game.cpp Basic functions to receive and send TCP packets for game purposes. */ -#ifdef ENABLE_NETWORK - #include "../../stdafx.h" #include "../network.h" @@ -199,5 +197,3 @@ NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_MOVE(Packet *p) { ret NetworkRecvStatus NetworkGameSocketHandler::Receive_CLIENT_MOVE(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CLIENT_MOVE); } NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_COMPANY_UPDATE(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_COMPANY_UPDATE); } NetworkRecvStatus NetworkGameSocketHandler::Receive_SERVER_CONFIG_UPDATE(Packet *p) { return this->ReceiveInvalidPacket(PACKET_SERVER_CONFIG_UPDATE); } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h index 5c6cb5c34d..c41ad4dc16 100644 --- a/src/network/core/tcp_game.h +++ b/src/network/core/tcp_game.h @@ -19,8 +19,6 @@ #include "../network_type.h" #include "../../core/pool_type.hpp" -#ifdef ENABLE_NETWORK - /** * Enum with all types of TCP packets. * For the exact meaning, look at #NetworkGameSocketHandler. @@ -558,6 +556,4 @@ public: void SendCommand(Packet *p, const CommandPacket *cp); }; -#endif /* ENABLE_NETWORK */ - #endif /* NETWORK_CORE_TCP_GAME_H */ diff --git a/src/network/core/tcp_http.cpp b/src/network/core/tcp_http.cpp index 4cd92e5fe2..3a40e3eec2 100644 --- a/src/network/core/tcp_http.cpp +++ b/src/network/core/tcp_http.cpp @@ -11,8 +11,6 @@ * @file tcp_http.cpp Basic functions to receive and send HTTP TCP packets. */ -#ifdef ENABLE_NETWORK - #include "../../stdafx.h" #include "../../debug.h" #include "../../rev.h" @@ -331,5 +329,3 @@ int NetworkHTTPSocketHandler::Receive() iter++; } } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/core/tcp_http.h b/src/network/core/tcp_http.h index 36520f1364..ec969264b1 100644 --- a/src/network/core/tcp_http.h +++ b/src/network/core/tcp_http.h @@ -16,8 +16,6 @@ #include "tcp.h" -#ifdef ENABLE_NETWORK - /** Callback for when the HTTP handler has something to tell us. */ struct HTTPCallback { /** @@ -122,6 +120,4 @@ public: } }; -#endif /* ENABLE_NETWORK */ - #endif /* NETWORK_CORE_TCP_HTTP_H */ diff --git a/src/network/core/tcp_listen.h b/src/network/core/tcp_listen.h index 8cd8257b25..21bcaea3c0 100644 --- a/src/network/core/tcp_listen.h +++ b/src/network/core/tcp_listen.h @@ -20,8 +20,6 @@ #include "../../debug.h" #include "table/strings.h" -#ifdef ENABLE_NETWORK - /** * Template for TCP listeners. * @param Tsocket The class we create sockets for. @@ -173,6 +171,4 @@ public: template SocketList TCPListenHandler::sockets; -#endif /* ENABLE_NETWORK */ - #endif /* NETWORK_CORE_TCP_LISTEN_H */ diff --git a/src/network/core/udp.cpp b/src/network/core/udp.cpp index 1f34d15b0c..4a2f773682 100644 --- a/src/network/core/udp.cpp +++ b/src/network/core/udp.cpp @@ -11,8 +11,6 @@ * @file core/udp.cpp Basic functions to receive and send UDP packets. */ -#ifdef ENABLE_NETWORK - #include "../../stdafx.h" #include "../../date_func.h" #include "../../debug.h" @@ -347,5 +345,3 @@ void NetworkUDPSocketHandler::Receive_SERVER_UNREGISTER(Packet *p, NetworkAddres void NetworkUDPSocketHandler::Receive_CLIENT_GET_NEWGRFS(Packet *p, NetworkAddress *client_addr) { this->ReceiveInvalidPacket(PACKET_UDP_CLIENT_GET_NEWGRFS, client_addr); } void NetworkUDPSocketHandler::Receive_SERVER_NEWGRFS(Packet *p, NetworkAddress *client_addr) { this->ReceiveInvalidPacket(PACKET_UDP_SERVER_NEWGRFS, client_addr); } void NetworkUDPSocketHandler::Receive_MASTER_SESSION_KEY(Packet *p, NetworkAddress *client_addr) { this->ReceiveInvalidPacket(PACKET_UDP_MASTER_SESSION_KEY, client_addr); } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/core/udp.h b/src/network/core/udp.h index 9aa0c9dc49..2f77a94df2 100644 --- a/src/network/core/udp.h +++ b/src/network/core/udp.h @@ -18,8 +18,6 @@ #include "game.h" #include "packet.h" -#ifdef ENABLE_NETWORK - /** Enum with all types of UDP packets. The order MUST not be changed **/ enum PacketUDPType { PACKET_UDP_CLIENT_FIND_SERVER, ///< Queries a game server for game information @@ -246,6 +244,4 @@ public: void ReceiveNetworkGameInfo(Packet *p, NetworkGameInfo *info); }; -#endif /* ENABLE_NETWORK */ - #endif /* NETWORK_CORE_UDP_H */ diff --git a/src/network/network.cpp b/src/network/network.cpp index 4727e33443..ea770e5001 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -11,8 +11,6 @@ #include "../stdafx.h" -#ifdef ENABLE_NETWORK - #include "../strings_func.h" #include "../command_func.h" #include "../date_func.h" @@ -1172,5 +1170,3 @@ bool IsNetworkCompatibleVersion(const char *other) const char *hash2 = ExtractNetworkRevisionHash(other); return hash1 && hash2 && (strncmp(hash1, hash2, GITHASH_SUFFIX_LEN) == 0); } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/network.h b/src/network/network.h index 26f94482ec..9f8e3b790b 100644 --- a/src/network/network.h +++ b/src/network/network.h @@ -12,9 +12,6 @@ #ifndef NETWORK_H #define NETWORK_H - -#ifdef ENABLE_NETWORK - void NetworkStartUp(); void NetworkShutDown(); void NetworkDrawChatMessage(); @@ -26,19 +23,4 @@ extern bool _network_available; ///< is network mode available? extern bool _network_dedicated; ///< are we a dedicated server? extern bool _is_network_server; ///< Does this client wants to be a network-server? -#else /* ENABLE_NETWORK */ -/* Network function stubs when networking is disabled */ - -static inline void NetworkStartUp() {} -static inline void NetworkShutDown() {} -static inline void NetworkDrawChatMessage() {} -static inline bool HasClients() { return false; } - -#define _networking 0 -#define _network_server 0 -#define _network_available 0 -#define _network_dedicated 0 -#define _is_network_server 0 - -#endif /* ENABLE_NETWORK */ #endif /* NETWORK_H */ diff --git a/src/network/network_admin.cpp b/src/network/network_admin.cpp index f70f3d1a51..73ad0e192a 100644 --- a/src/network/network_admin.cpp +++ b/src/network/network_admin.cpp @@ -9,8 +9,6 @@ /** @file network_admin.cpp Server part of the admin network protocol. */ -#ifdef ENABLE_NETWORK - #include "../stdafx.h" #include "../strings_func.h" #include "../date_func.h" @@ -1045,5 +1043,3 @@ void NetworkAdminUpdate(AdminUpdateFrequency freq) } } } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/network_admin.h b/src/network/network_admin.h index cb478fc7e7..6d06d5b9ff 100644 --- a/src/network/network_admin.h +++ b/src/network/network_admin.h @@ -12,8 +12,6 @@ #ifndef NETWORK_ADMIN_H #define NETWORK_ADMIN_H -#ifdef ENABLE_NETWORK - #include "network_internal.h" #include "core/tcp_listen.h" #include "core/tcp_admin.h" @@ -124,5 +122,4 @@ void NetworkAdminConsole(const char *origin, const char *string); void NetworkAdminGameScript(const char *json); void NetworkAdminCmdLogging(const NetworkClientSocket *owner, const CommandPacket *cp); -#endif /* ENABLE_NETWORK */ #endif /* NETWORK_ADMIN_H */ diff --git a/src/network/network_base.h b/src/network/network_base.h index 1644b3558a..817d0e4c89 100644 --- a/src/network/network_base.h +++ b/src/network/network_base.h @@ -12,8 +12,6 @@ #ifndef NETWORK_BASE_H #define NETWORK_BASE_H -#ifdef ENABLE_NETWORK - #include "network_type.h" #include "core/address.h" #include "../core/pool_type.hpp" @@ -54,5 +52,4 @@ struct NetworkClientInfo : NetworkClientInfoPool::PoolItem<&_networkclientinfo_p */ #define FOR_ALL_CLIENT_INFOS(var) FOR_ALL_CLIENT_INFOS_FROM(var, 0) -#endif /* ENABLE_NETWORK */ #endif /* NETWORK_BASE_H */ diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index 68e1489874..94e2898852 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -11,8 +11,6 @@ #include /* va_list */ -#ifdef ENABLE_NETWORK - #include "../stdafx.h" #include "../strings_func.h" #include "../blitter/factory.hpp" @@ -562,5 +560,3 @@ void ShowNetworkChatQueryWindow(DestType type, int dest) DeleteWindowByClass(WC_SEND_NETWORK_MSG); new NetworkChatWindow(&_chat_window_desc, type, dest); } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index 62db6a5552..0bb42c86ff 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -9,8 +9,6 @@ /** @file network_client.cpp Client part of the network protocol. */ -#ifdef ENABLE_NETWORK - #include "../stdafx.h" #include "network_gui.h" #include "../saveload/saveload.h" @@ -1320,5 +1318,3 @@ bool NetworkMaxSpectatorsReached() { return NetworkSpectatorCount() >= (_network_server ? _settings_client.network.max_spectators : _network_server_max_spectators); } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/network_client.h b/src/network/network_client.h index 23878b5067..5e9988d9aa 100644 --- a/src/network/network_client.h +++ b/src/network/network_client.h @@ -12,8 +12,6 @@ #ifndef NETWORK_CLIENT_H #define NETWORK_CLIENT_H -#ifdef ENABLE_NETWORK - #include "network_internal.h" /** Class for handling the client side of the game connection. */ @@ -118,6 +116,4 @@ extern CompanyID _network_join_as; extern const char *_network_join_server_password; extern const char *_network_join_company_password; -#endif /* ENABLE_NETWORK */ - #endif /* NETWORK_CLIENT_H */ diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index bc08bc5f14..51317288e7 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -9,8 +9,6 @@ /** @file network_command.cpp Command handling over network connections. */ -#ifdef ENABLE_NETWORK - #include "../stdafx.h" #include "network_admin.h" #include "network_client.h" @@ -344,5 +342,3 @@ void NetworkGameSocketHandler::SendCommand(Packet *p, const CommandPacket *cp) } p->Send_uint8 (callback); } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index 551abb4420..1a80c5d99d 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -9,8 +9,6 @@ /** @file network_content.cpp Content sending/receiving part of the network protocol. */ -#if defined(ENABLE_NETWORK) - #include "../stdafx.h" #include "../rev.h" #include "../ai/ai.hpp" @@ -1090,5 +1088,3 @@ void ClientNetworkContentSocketHandler::OnDownloadComplete(ContentID cid) if (iter != this->callbacks.End() && *iter == cb) iter++; } } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/network_content.h b/src/network/network_content.h index 25788065fd..b1e9dd66b6 100644 --- a/src/network/network_content.h +++ b/src/network/network_content.h @@ -15,8 +15,6 @@ #include "core/tcp_content.h" #include "core/tcp_http.h" -#if defined(ENABLE_NETWORK) - /** Vector with content info */ typedef SmallVector ContentVector; /** Vector with constant content info */ @@ -153,8 +151,4 @@ void ShowNetworkContentListWindow(ContentVector *cv = NULL, ContentType type1 = void ShowMissingContentWindow(const struct GRFConfig *list); -#else -static inline void ShowNetworkContentListWindow() {} -#endif /* ENABLE_NETWORK */ - #endif /* NETWORK_CONTENT_H */ diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 877dea9786..230a62134f 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -9,7 +9,6 @@ /** @file network_content_gui.cpp Implementation of the Network Content related GUIs. */ -#if defined(ENABLE_NETWORK) #include "../stdafx.h" #include "../strings_func.h" #include "../gfx_func.h" @@ -1168,5 +1167,3 @@ void ShowNetworkContentListWindow(ContentVector *cv, ContentType type1, ContentT } #endif /* WITH_ZLIB */ } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/network_func.h b/src/network/network_func.h index 4f1525b5a4..9adbb6e60f 100644 --- a/src/network/network_func.h +++ b/src/network/network_func.h @@ -26,8 +26,6 @@ #include "../openttd.h" #include "../company_type.h" -#ifdef ENABLE_NETWORK - extern NetworkServerGameInfo _network_game_info; extern NetworkCompanyState *_network_company_states; @@ -90,5 +88,4 @@ void NetworkChatMessageLoop(); void NetworkAfterNewGRFScan(); -#endif /* ENABLE_NETWORK */ #endif /* NETWORK_FUNC_H */ diff --git a/src/network/network_gamelist.cpp b/src/network/network_gamelist.cpp index e5d80630e1..6c65c52c98 100644 --- a/src/network/network_gamelist.cpp +++ b/src/network/network_gamelist.cpp @@ -12,8 +12,6 @@ * Also, it handles the request to a server for data about the server */ -#ifdef ENABLE_NETWORK - #include "../stdafx.h" #include "../debug.h" #include "../window_func.h" @@ -206,5 +204,3 @@ void NetworkAfterNewGRFScan() InvalidateWindowClassesData(WC_NETWORK_WINDOW); } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 93cd3d9733..cb64261423 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -9,7 +9,6 @@ /** @file network_gui.cpp Implementation of the Network related GUIs. */ -#ifdef ENABLE_NETWORK #include "../stdafx.h" #include "../strings_func.h" #include "../date_func.h" @@ -2241,5 +2240,3 @@ void ShowNetworkCompanyPasswordWindow(Window *parent) new NetworkCompanyPasswordWindow(&_network_company_password_window_desc, parent); } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/network_gui.h b/src/network/network_gui.h index a196c75e9f..d9dfb57dd6 100644 --- a/src/network/network_gui.h +++ b/src/network/network_gui.h @@ -17,8 +17,6 @@ #include "../window_type.h" #include "network_type.h" -#ifdef ENABLE_NETWORK - void ShowNetworkNeedPassword(NetworkPasswordType npt); void ShowNetworkGiveMoneyWindow(CompanyID company); void ShowNetworkChatQueryWindow(DestType type, int dest); @@ -42,14 +40,4 @@ struct NetworkCompanyInfo : NetworkCompanyStats { NetworkCompanyInfo *GetLobbyCompanyInfo(CompanyID company); -#else /* ENABLE_NETWORK */ -/* Network function stubs when networking is disabled */ - -static inline void ShowNetworkChatQueryWindow(byte desttype, int dest) {} -static inline void ShowClientList() {} -static inline void ShowNetworkGameWindow() {} -static inline void ShowNetworkCompanyPasswordWindow(Window *parent) {} - -#endif /* ENABLE_NETWORK */ - #endif /* NETWORK_GUI_H */ diff --git a/src/network/network_internal.h b/src/network/network_internal.h index ed9a8de6f6..2498d50d4f 100644 --- a/src/network/network_internal.h +++ b/src/network/network_internal.h @@ -17,8 +17,6 @@ #include "../command_type.h" -#ifdef ENABLE_NETWORK - #ifdef RANDOM_DEBUG /** * If this line is enable, every frame will have a sync test @@ -171,5 +169,4 @@ StringID GetNetworkErrorMsg(NetworkErrorCode err); bool NetworkFindName(char *new_name, const char *last); const char *GenerateCompanyPasswordHash(const char *password, const char *password_server_id, uint32 password_game_seed); -#endif /* ENABLE_NETWORK */ #endif /* NETWORK_INTERNAL_H */ diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 05fb27fc87..bd78acf92d 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -9,8 +9,6 @@ /** @file network_server.cpp Server part of the network protocol. */ -#ifdef ENABLE_NETWORK - #include "../stdafx.h" #include "../strings_func.h" #include "../date_func.h" @@ -2206,5 +2204,3 @@ void NetworkServerNewCompany(const Company *c, NetworkClientInfo *ci) NetworkServerSendChat(NETWORK_ACTION_COMPANY_NEW, DESTTYPE_BROADCAST, 0, "", ci->client_id, c->index + 1); } } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/network_server.h b/src/network/network_server.h index a52b2c9366..1cd8feb677 100644 --- a/src/network/network_server.h +++ b/src/network/network_server.h @@ -12,8 +12,6 @@ #ifndef NETWORK_SERVER_H #define NETWORK_SERVER_H -#ifdef ENABLE_NETWORK - #include "network_internal.h" #include "core/tcp_listen.h" #include "../thread/thread.h" @@ -138,12 +136,4 @@ void NetworkServerUpdateCompanyPassworded(CompanyID company_id, bool passworded) */ #define FOR_ALL_CLIENT_SOCKETS(var) FOR_ALL_CLIENT_SOCKETS_FROM(var, 0) -#else /* ENABLE_NETWORK */ -/* Network function stubs when networking is disabled */ - -static inline void NetworkServerMonthlyLoop() {} -static inline void NetworkServerYearlyLoop() {} - -#endif /* ENABLE_NETWORK */ - #endif /* NETWORK_SERVER_H */ diff --git a/src/network/network_type.h b/src/network/network_type.h index 3c390c29be..9b598716f1 100644 --- a/src/network/network_type.h +++ b/src/network/network_type.h @@ -14,8 +14,6 @@ #include "core/game.h" -#ifdef ENABLE_NETWORK - /** How many clients can we have */ static const uint MAX_CLIENTS = 255; @@ -130,5 +128,4 @@ enum NetworkErrorCode { NETWORK_ERROR_END, }; -#endif /* ENABLE_NETWORK */ #endif /* NETWORK_TYPE_H */ diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp index 3fd0dd4853..289b07520a 100644 --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -14,8 +14,6 @@ * communication before the game is being joined. */ -#ifdef ENABLE_NETWORK - #include "../stdafx.h" #include "../date_func.h" #include "../map_func.h" @@ -714,5 +712,3 @@ void NetworkBackgroundUDPLoop() _network_udp_mutex->EndCritical(); } - -#endif /* ENABLE_NETWORK */ diff --git a/src/network/network_udp.h b/src/network/network_udp.h index 3dfd076720..12de30bca3 100644 --- a/src/network/network_udp.h +++ b/src/network/network_udp.h @@ -12,8 +12,6 @@ #ifndef NETWORK_UDP_H #define NETWORK_UDP_H -#ifdef ENABLE_NETWORK - #include "core/address.h" void NetworkUDPInitialize(); @@ -25,6 +23,4 @@ void NetworkUDPRemoveAdvertise(bool blocking); void NetworkUDPClose(); void NetworkBackgroundUDPLoop(); -#endif /* ENABLE_NETWORK */ - #endif /* NETWORK_UDP_H */ diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index 593851e288..f19c79c9a8 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -757,9 +757,7 @@ void DoScanNewGRFFiles(void *callback) free(to_sort); -#ifdef ENABLE_NETWORK NetworkAfterNewGRFScan(); -#endif } _modal_progress_work_mutex->EndCritical(); @@ -826,8 +824,6 @@ const GRFConfig *FindGRFConfig(uint32 grfid, FindGRFConfigMode mode, const uint8 return best; } -#ifdef ENABLE_NETWORK - /** Structure for UnknownGRFs; this is a lightweight variant of GRFConfig */ struct UnknownGRF : public GRFIdentifier { UnknownGRF *next; ///< The next unknown GRF. @@ -877,9 +873,6 @@ GRFTextWrapper *FindUnknownGRFName(uint32 grfid, uint8 *md5sum, bool create) return grf->name; } -#endif /* ENABLE_NETWORK */ - - /** * Retrieve a NewGRF from the current config by its grfid. * @param grfid grf to look for. diff --git a/src/newgrf_config.h b/src/newgrf_config.h index dc3b884dd3..4266dd1fdf 100644 --- a/src/newgrf_config.h +++ b/src/newgrf_config.h @@ -229,11 +229,9 @@ char *GRFBuildParamList(char *dst, const GRFConfig *c, const char *last); /* In newgrf_gui.cpp */ void ShowNewGRFSettings(bool editable, bool show_params, bool exec_changes, GRFConfig **config); -#ifdef ENABLE_NETWORK /** For communication about GRFs over the network */ #define UNKNOWN_GRF_NAME_PLACEHOLDER "" GRFTextWrapper *FindUnknownGRFName(uint32 grfid, uint8 *md5sum, bool create); -#endif /* ENABLE_NETWORK */ void UpdateNewGRFScanStatus(uint num, const char *name); bool UpdateNewGRFConfigPalette(int32 p1 = 0); diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 4e66d2e52a..1af2c72461 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -1126,11 +1126,9 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { if (!_network_available) { ShowErrorMessage(STR_NETWORK_ERROR_NOTAVAILABLE, INVALID_STRING_ID, WL_ERROR); } else { -#if defined(ENABLE_NETWORK) this->DeleteChildWindows(WC_QUERY_STRING); // Remove the parameter query window ShowMissingContentWindow(this->actives); -#endif } break; @@ -1543,7 +1541,6 @@ private: } }; -#if defined(ENABLE_NETWORK) /** * Show the content list window with all missing grfs from the given list. * @param list The list of grfs to check for missing / not exactly matching ones. @@ -1565,7 +1562,6 @@ void ShowMissingContentWindow(const GRFConfig *list) } ShowNetworkContentListWindow(cv.Length() == 0 ? NULL : &cv, CONTENT_TYPE_NEWGRF); } -#endif Listing NewGRFWindow::last_sorting = {false, 0}; Filtering NewGRFWindow::last_filtering = {false, 0}; diff --git a/src/openttd.cpp b/src/openttd.cpp index c833583609..b78084145d 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -164,7 +164,6 @@ static void ShowHelp() " -e = Start Editor\n" " -g [savegame] = Start new/save game immediately\n" " -G seed = Set random seed\n" -#if defined(ENABLE_NETWORK) " -n [ip:port#company]= Join network game\n" " -p password = Password to join server\n" " -P password = Password to join company\n" @@ -173,7 +172,6 @@ static void ShowHelp() #if !defined(_WIN32) " -f = Fork into the background (dedicated only)\n" #endif -#endif /* ENABLE_NETWORK */ " -I graphics_set = Force the graphics set (see below)\n" " -S sounds_set = Force the sounds set (see below)\n" " -M music_set = Force the music set (see below)\n" @@ -300,9 +298,7 @@ static void ShutdownGame() /* Uninitialize variables that are allocated dynamically */ GamelogReset(); -#ifdef ENABLE_NETWORK free(_config_file); -#endif LinkGraphSchedule::Clear(); PoolBase::Clean(PT_ALL); @@ -447,13 +443,11 @@ struct AfterNewGRFScan : NewGRFScanCallback { if (startyear != INVALID_YEAR) _settings_newgame.game_creation.starting_year = startyear; if (generation_seed != GENERATE_NEW_SEED) _settings_newgame.game_creation.generation_seed = generation_seed; -#if defined(ENABLE_NETWORK) if (dedicated_host != NULL) { _network_bind_list.Clear(); *_network_bind_list.Append() = stredup(dedicated_host); } if (dedicated_port != 0) _settings_client.network.server_port = dedicated_port; -#endif /* ENABLE_NETWORK */ /* initialize the ingame console */ IConsoleInit(); @@ -463,7 +457,6 @@ struct AfterNewGRFScan : NewGRFScanCallback { /* Make sure _settings is filled with _settings_newgame if we switch to a game directly */ if (_switch_mode != SM_NONE) MakeNewgameSettingsLive(); -#ifdef ENABLE_NETWORK if (_network_available && network_conn != NULL) { const char *port = NULL; const char *company = NULL; @@ -489,7 +482,6 @@ struct AfterNewGRFScan : NewGRFScanCallback { _switch_mode = SM_NONE; NetworkClientConnectGame(NetworkAddress(network_conn, rport), join_as, join_server_password, join_company_password); } -#endif /* ENABLE_NETWORK */ /* After the scan we're not used anymore. */ delete this; @@ -509,7 +501,6 @@ static const OptionData _options[] = { GETOPT_SHORT_VALUE('s'), GETOPT_SHORT_VALUE('v'), GETOPT_SHORT_VALUE('b'), -#if defined(ENABLE_NETWORK) GETOPT_SHORT_OPTVAL('D'), GETOPT_SHORT_OPTVAL('n'), GETOPT_SHORT_VALUE('l'), @@ -518,7 +509,6 @@ static const OptionData _options[] = { #if !defined(_WIN32) GETOPT_SHORT_NOVAL('f'), #endif -#endif /* ENABLE_NETWORK */ GETOPT_SHORT_VALUE('r'), GETOPT_SHORT_VALUE('t'), GETOPT_SHORT_OPTVAL('d'), @@ -551,13 +541,11 @@ int openttd_main(int argc, char *argv[]) /* AfterNewGRFScan sets save_config to true after scanning completed. */ bool save_config = false; AfterNewGRFScan *scanner = new AfterNewGRFScan(&save_config); -#if defined(ENABLE_NETWORK) bool dedicated = false; char *debuglog_conn = NULL; extern bool _dedicated_forks; _dedicated_forks = false; -#endif /* ENABLE_NETWORK */ _game_mode = GM_MENU; _switch_mode = SM_MENU; @@ -576,7 +564,6 @@ int openttd_main(int argc, char *argv[]) case 's': free(sounddriver); sounddriver = stredup(mgo.opt); break; case 'v': free(videodriver); videodriver = stredup(mgo.opt); break; case 'b': free(blitter); blitter = stredup(mgo.opt); break; -#if defined(ENABLE_NETWORK) case 'D': free(musicdriver); free(sounddriver); @@ -611,7 +598,6 @@ int openttd_main(int argc, char *argv[]) case 'P': scanner->join_company_password = mgo.opt; break; -#endif /* ENABLE_NETWORK */ case 'r': ParseResolution(&resolution, mgo.opt); break; case 't': scanner->startyear = atoi(mgo.opt); break; case 'd': { @@ -702,14 +688,12 @@ int openttd_main(int argc, char *argv[]) DeterminePaths(argv[0]); TarScanner::DoScan(TarScanner::BASESET); -#if defined(ENABLE_NETWORK) if (dedicated) DEBUG(net, 0, "Starting dedicated version %s", _openttd_revision); if (_dedicated_forks && !dedicated) _dedicated_forks = false; #if defined(UNIX) /* We must fork here, or we'll end up without some resources we need (like sockets) */ if (_dedicated_forks) DedicatedFork(); -#endif #endif LoadFromConfig(true); @@ -787,7 +771,6 @@ int openttd_main(int argc, char *argv[]) NetworkStartUp(); // initialize network-core -#if defined(ENABLE_NETWORK) if (debuglog_conn != NULL && _network_available) { const char *not_used = NULL; const char *port = NULL; @@ -800,7 +783,6 @@ int openttd_main(int argc, char *argv[]) NetworkStartDebugLog(NetworkAddress(debuglog_conn, rport)); } -#endif /* ENABLE_NETWORK */ if (!HandleBootstrap()) { ShutdownGame(); @@ -903,12 +885,10 @@ exit_normal: delete scanner; -#ifdef ENABLE_NETWORK extern FILE *_log_fd; if (_log_fd != NULL) { fclose(_log_fd); } -#endif /* ENABLE_NETWORK */ return ret; } @@ -957,13 +937,11 @@ static void MakeNewGameDone() InitializeRailGUI(); -#ifdef ENABLE_NETWORK /* We are the server, we start a new company (not dedicated), * so set the default password *if* needed. */ if (_network_server && !StrEmpty(_settings_client.network.default_company_pass)) { NetworkChangeCompanyPassword(_local_company, _settings_client.network.default_company_pass); } -#endif /* ENABLE_NETWORK */ if (_settings_client.gui.pause_on_newgame) DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE); @@ -1019,7 +997,6 @@ bool SafeLoad(const char *filename, SaveLoadOperation fop, DetailedFileType dft, case SL_OK: return true; case SL_REINIT: -#ifdef ENABLE_NETWORK if (_network_dedicated) { /* * We need to reinit a network map... @@ -1035,7 +1012,6 @@ bool SafeLoad(const char *filename, SaveLoadOperation fop, DetailedFileType dft, /* We can't load the intro game as server, so disconnect first. */ NetworkDisconnect(); } -#endif /* ENABLE_NETWORK */ switch (ogm) { default: @@ -1052,7 +1028,6 @@ bool SafeLoad(const char *filename, SaveLoadOperation fop, DetailedFileType dft, void SwitchToMode(SwitchMode new_mode) { -#ifdef ENABLE_NETWORK /* If we are saving something, the network stays in his current state */ if (new_mode != SM_SAVE_GAME) { /* If the network is active, make it not-active */ @@ -1081,7 +1056,7 @@ void SwitchToMode(SwitchMode new_mode) } } } -#endif /* ENABLE_NETWORK */ + /* Make sure all AI controllers are gone at quitting game */ if (new_mode != SM_SAVE_GAME) AI::KillAll(); @@ -1092,11 +1067,9 @@ void SwitchToMode(SwitchMode new_mode) case SM_RESTARTGAME: // Restart --> 'Random game' with current settings case SM_NEWGAME: // New Game --> 'Random game' -#ifdef ENABLE_NETWORK if (_network_server) { seprintf(_network_game_info.map_name, lastof(_network_game_info.map_name), "Random Map"); } -#endif /* ENABLE_NETWORK */ MakeNewGame(false, new_mode == SM_NEWGAME); break; @@ -1119,21 +1092,17 @@ void SwitchToMode(SwitchMode new_mode) IConsoleCmdExec("exec scripts/game_start.scr 0"); /* Decrease pause counter (was increased from opening load dialog) */ DoCommandP(0, PM_PAUSED_SAVELOAD, 0, CMD_PAUSE); -#ifdef ENABLE_NETWORK if (_network_server) { seprintf(_network_game_info.map_name, lastof(_network_game_info.map_name), "%s (Loaded game)", _file_to_saveload.title); } -#endif /* ENABLE_NETWORK */ } break; } case SM_START_HEIGHTMAP: // Load a heightmap and start a new game from it -#ifdef ENABLE_NETWORK if (_network_server) { seprintf(_network_game_info.map_name, lastof(_network_game_info.map_name), "%s (Heightmap)", _file_to_saveload.title); } -#endif /* ENABLE_NETWORK */ MakeNewGame(true, true); break; @@ -1451,10 +1420,8 @@ static void DoAutosave() void GameLoop() { if (_game_mode == GM_BOOTSTRAP) { -#ifdef ENABLE_NETWORK /* Check for UDP stuff */ if (_network_available) NetworkBackgroundLoop(); -#endif InputLoop(); return; } @@ -1477,7 +1444,6 @@ void GameLoop() IncreaseSpriteLRU(); InteractiveRandom(); -#ifdef ENABLE_NETWORK /* Check for UDP stuff */ if (_network_available) NetworkBackgroundLoop(); @@ -1493,9 +1459,6 @@ void GameLoop() /* Singleplayer */ StateGameLoop(); } -#else - StateGameLoop(); -#endif /* ENABLE_NETWORK */ if (!_pause_mode && HasBit(_display_opt, DO_FULL_ANIMATION)) DoPaletteAnimations(); diff --git a/src/order_backup.cpp b/src/order_backup.cpp index 181e3e59da..1d490e7264 100644 --- a/src/order_backup.cpp +++ b/src/order_backup.cpp @@ -193,11 +193,7 @@ CommandCost CmdClearOrderBackup(TileIndex tile, DoCommandFlag flags, uint32 p1, * but compiled it. A network client has its own variable for the unique * client/user identifier. Finally if networking isn't compiled in the * default is just plain and simple: 0. */ -#ifdef ENABLE_NETWORK uint32 user = _networking && !_network_server ? _network_own_client_id : CLIENT_ID_SERVER; -#else - uint32 user = 0; -#endif OrderBackup *ob; FOR_ALL_ORDER_BACKUPS(ob) { diff --git a/src/script/api/script_admin.cpp b/src/script/api/script_admin.cpp index f66d9fc8a8..7a0fe627a3 100644 --- a/src/script/api/script_admin.cpp +++ b/src/script/api/script_admin.cpp @@ -135,7 +135,6 @@ std::string json; ScriptAdmin::MakeJSON(vm, -1, SQUIRREL_MAX_DEPTH, json); -#ifdef ENABLE_NETWORK if (json.length() > NETWORK_GAMESCRIPT_JSON_LENGTH) { ScriptLog::Error("You are trying to send a table that is too large to the AdminPort. No data sent."); sq_pushinteger(vm, 0); @@ -143,7 +142,6 @@ } NetworkAdminGameScript(json.c_str()); -#endif /* ENABLE_NETWORK */ sq_pushinteger(vm, 1); return 1; diff --git a/src/script/api/script_client.cpp b/src/script/api/script_client.cpp index 771a0ae4ec..855ad86a0b 100644 --- a/src/script/api/script_client.cpp +++ b/src/script/api/script_client.cpp @@ -16,7 +16,6 @@ #include "../../safeguards.h" -#ifdef ENABLE_NETWORK /** * Finds NetworkClientInfo given client-identifier, * is used by other methods to resolve client-identifier. @@ -29,46 +28,29 @@ static NetworkClientInfo *FindClientInfo(ScriptClient::ClientID client) if (!_networking) return NULL; return NetworkClientInfo::GetByClientID((::ClientID)client); } -#endif /* static */ ScriptClient::ClientID ScriptClient::ResolveClientID(ScriptClient::ClientID client) { -#ifdef ENABLE_NETWORK return (FindClientInfo(client) == NULL ? ScriptClient::CLIENT_INVALID : client); -#else - return CLIENT_INVALID; -#endif } /* static */ char *ScriptClient::GetName(ScriptClient::ClientID client) { -#ifdef ENABLE_NETWORK NetworkClientInfo *ci = FindClientInfo(client); if (ci == NULL) return NULL; return stredup(ci->client_name); -#else - return NULL; -#endif } /* static */ ScriptCompany::CompanyID ScriptClient::GetCompany(ScriptClient::ClientID client) { -#ifdef ENABLE_NETWORK NetworkClientInfo *ci = FindClientInfo(client); if (ci == NULL) return ScriptCompany::COMPANY_INVALID; return (ScriptCompany::CompanyID)ci->client_playas; -#else - return ScriptCompany::COMPANY_INVALID; -#endif } /* static */ ScriptDate::Date ScriptClient::GetJoinDate(ScriptClient::ClientID client) { -#ifdef ENABLE_NETWORK NetworkClientInfo *ci = FindClientInfo(client); if (ci == NULL) return ScriptDate::DATE_INVALID; return (ScriptDate::Date)ci->join_date; -#else - return ScriptDate::DATE_INVALID; -#endif } diff --git a/src/script/api/script_clientlist.cpp b/src/script/api/script_clientlist.cpp index 2f7a19a9ff..dbbbce0ec4 100644 --- a/src/script/api/script_clientlist.cpp +++ b/src/script/api/script_clientlist.cpp @@ -19,18 +19,15 @@ ScriptClientList::ScriptClientList() { -#ifdef ENABLE_NETWORK if (!_networking) return; NetworkClientInfo *ci; FOR_ALL_CLIENT_INFOS(ci) { this->AddItem(ci->client_id); } -#endif } ScriptClientList_Company::ScriptClientList_Company(ScriptCompany::CompanyID company) { -#ifdef ENABLE_NETWORK if (!_networking) return; CompanyID c; if (company == ScriptCompany::COMPANY_SPECTATOR) { @@ -45,5 +42,4 @@ ScriptClientList_Company::ScriptClientList_Company(ScriptCompany::CompanyID comp FOR_ALL_CLIENT_INFOS(ci) { if (ci->client_playas == c) this->AddItem(ci->client_id); } -#endif } diff --git a/src/script/api/script_game.cpp b/src/script/api/script_game.cpp index c24757a3cc..3e26174885 100644 --- a/src/script/api/script_game.cpp +++ b/src/script/api/script_game.cpp @@ -39,9 +39,5 @@ /* static */ bool ScriptGame::IsMultiplayer() { -#ifdef ENABLE_NETWORK return _network_server; -#else - return false; -#endif } diff --git a/src/script/api/script_goal.cpp b/src/script/api/script_goal.cpp index c183b75834..54312cd9d4 100644 --- a/src/script/api/script_goal.cpp +++ b/src/script/api/script_goal.cpp @@ -137,12 +137,8 @@ { EnforcePrecondition(false, ScriptGame::IsMultiplayer()); EnforcePrecondition(false, ScriptClient::ResolveClientID(client) != ScriptClient::CLIENT_INVALID); -#ifdef ENABLE_NETWORK ClientIndex c = NetworkClientInfo::GetByClientID((::ClientID)client)->index; return DoQuestion(uniqueid, c, true, question, type, buttons); -#else - return false; -#endif } /* static */ bool ScriptGoal::CloseQuestion(uint16 uniqueid) diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp index 49dba6bb73..7a22e3ab7e 100644 --- a/src/script/api/script_object.cpp +++ b/src/script/api/script_object.cpp @@ -301,10 +301,8 @@ ScriptObject::ActiveInstance::~ActiveInstance() /* Are we only interested in the estimate costs? */ bool estimate_only = GetDoCommandMode() != NULL && !GetDoCommandMode()(); -#ifdef ENABLE_NETWORK /* Only set p2 when the command does not come from the network. */ if (GetCommandFlags(cmd) & CMD_CLIENT_ID && p2 == 0) p2 = UINT32_MAX; -#endif /* Try to perform the command. */ CommandCost res = ::DoCommandPInternal(tile, p1, p2, cmd, (_networking && !_generating_world) ? ScriptObject::GetActiveInstance()->GetDoCommandCallback() : NULL, text, false, estimate_only); diff --git a/src/script/script_scanner.cpp b/src/script/script_scanner.cpp index fe6d41cf92..168a852a51 100644 --- a/src/script/script_scanner.cpp +++ b/src/script/script_scanner.cpp @@ -18,11 +18,9 @@ #include "script_scanner.hpp" #include "script_info.hpp" -#if defined(ENABLE_NETWORK) #include "../network/network_content.h" #include "../3rdparty/md5/md5.h" #include "../tar_type.h" -#endif /* ENABLE_NETWORK */ #include "../safeguards.h" @@ -180,8 +178,6 @@ char *ScriptScanner::GetConsoleList(char *p, const char *last, bool newest_only) return p; } -#if defined(ENABLE_NETWORK) - /** Helper for creating a MD5sum of all files within of a script. */ struct ScriptFileChecksumCreator : FileScanner { byte md5sum[16]; ///< The final md5sum. @@ -287,5 +283,3 @@ const char *ScriptScanner::FindMainScript(const ContentInfo *ci, bool md5sum) } return NULL; } - -#endif /* ENABLE_NETWORK */ diff --git a/src/settings.cpp b/src/settings.cpp index 6ea5c081a3..8f57b6bda7 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1339,9 +1339,6 @@ static bool InvalidateShipPathCache(int32 p1) return true; } - -#ifdef ENABLE_NETWORK - static bool UpdateClientName(int32 p1) { NetworkUpdateClientName(); @@ -1373,9 +1370,6 @@ static bool UpdateClientConfigValues(int32 p1) return true; } -#endif /* ENABLE_NETWORK */ - - /* End - Callback Functions */ /** @@ -1705,11 +1699,9 @@ static void HandleSettingDescs(IniFile *ini, SettingDescProc *proc, SettingDescP proc(ini, _currency_settings,"currency", &_custom_currency); proc(ini, _company_settings, "company", &_settings_client.company); -#ifdef ENABLE_NETWORK proc_list(ini, "server_bind_addresses", &_network_bind_list); proc_list(ini, "servers", &_network_host_list); proc_list(ini, "bans", &_network_ban_list); -#endif /* ENABLE_NETWORK */ } } @@ -2009,7 +2001,6 @@ void SetDefaultCompanySettings(CompanyID cid) } } -#if defined(ENABLE_NETWORK) /** * Sync all company settings in a multiplayer game. */ @@ -2025,7 +2016,6 @@ void SyncCompanySettings() if (old_value != new_value) NetworkSendCommand(0, i, new_value, CMD_CHANGE_COMPANY_SETTING, NULL, NULL, _local_company); } } -#endif /* ENABLE_NETWORK */ /** * Get the index in the _company_settings array of a setting diff --git a/src/settings_func.h b/src/settings_func.h index c258cb6404..ee63e2bf4c 100644 --- a/src/settings_func.h +++ b/src/settings_func.h @@ -40,10 +40,6 @@ void DeleteGRFPresetFromConfig(const char *config_name); uint GetCompanySettingIndex(const char *name); void SetDefaultCompanySettings(CompanyID cid); -#if defined(ENABLE_NETWORK) void SyncCompanySettings(); -#else /* ENABLE_NETWORK */ -static inline void SyncCompanySettings() {} -#endif /* ENABLE_NETWORK */ #endif /* SETTINGS_FUNC_H */ diff --git a/src/settings_type.h b/src/settings_type.h index 42f8b45170..2459058979 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -154,11 +154,9 @@ struct GUISettings { uint8 station_gui_group_order; ///< the order of grouping cargo entries in the station gui uint8 station_gui_sort_by; ///< sort cargo entries in the station gui by station name or amount uint8 station_gui_sort_order; ///< the sort order of entries in the station gui - ascending or descending -#ifdef ENABLE_NETWORK uint16 network_chat_box_width_pct; ///< width of the chat box in percent uint8 network_chat_box_height; ///< height of the chat box in lines uint16 network_chat_timeout; ///< timeout of chat messages in seconds -#endif uint8 developer; ///< print non-fatal warnings in console (>= 1), copy debug output to console (== 2) bool show_date_in_logs; ///< whether to show dates in console logs @@ -237,7 +235,6 @@ struct NewsSettings { /** All settings related to the network. */ struct NetworkSettings { -#ifdef ENABLE_NETWORK uint16 sync_freq; ///< how often do we check whether we are still in-sync uint8 frame_freq; ///< how often do we send commands to the clients uint16 commands_per_frame; ///< how many commands may be sent each frame_freq frames? @@ -277,8 +274,6 @@ struct NetworkSettings { char last_host[NETWORK_HOSTNAME_LENGTH]; ///< IP address of the last joined server uint16 last_port; ///< port of the last joined server bool no_http_content_downloads; ///< do not do content downloads over HTTP -#else /* ENABLE_NETWORK */ -#endif }; /** Settings related to the creation of games. */ diff --git a/src/strings.cpp b/src/strings.cpp index b5fb36d4d9..c4ae5218a3 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -35,9 +35,7 @@ #include "window_func.h" #include "debug.h" #include "game/game_text.hpp" -#ifdef ENABLE_NETWORK -# include "network/network_content_gui.h" -#endif /* ENABLE_NETWORK */ +#include "network/network_content_gui.h" #include #include "table/strings.h" @@ -1681,11 +1679,7 @@ static char *GetSpecialNameString(char *buff, int ind, StringParameters *args, c NOT_REACHED(); } -#ifdef ENABLE_NETWORK extern void SortNetworkLanguages(); -#else /* ENABLE_NETWORK */ -static inline void SortNetworkLanguages() {} -#endif /* ENABLE_NETWORK */ /** * Check whether the header is a valid header for OpenTTD. @@ -1821,9 +1815,7 @@ bool ReadLanguagePack(const LanguageMetadata *lang) SortIndustryTypes(); BuildIndustriesLegend(); SortNetworkLanguages(); -#ifdef ENABLE_NETWORK BuildContentTypeStringList(); -#endif /* ENABLE_NETWORK */ InvalidateWindowClassesData(WC_BUILD_VEHICLE); // Build vehicle window. InvalidateWindowClassesData(WC_TRAINS_LIST); // Train group window. InvalidateWindowClassesData(WC_ROADVEH_LIST); // Road vehicle group window. diff --git a/src/table/gameopt_settings.ini b/src/table/gameopt_settings.ini index 624d475c31..29d6a31779 100644 --- a/src/table/gameopt_settings.ini +++ b/src/table/gameopt_settings.ini @@ -21,9 +21,7 @@ static const char *_climates = "temperate|arctic|tropic|toyland"; static const char *_autosave_interval = "off|monthly|quarterly|half year|yearly"; static const char *_roadsides = "left|right"; static const char *_savegame_date = "long|short|iso"; -#ifdef ENABLE_NETWORK static const char *_server_langs = "ANY|ENGLISH|GERMAN|FRENCH|BRAZILIAN|BULGARIAN|CHINESE|CZECH|DANISH|DUTCH|ESPERANTO|FINNISH|HUNGARIAN|ICELANDIC|ITALIAN|JAPANESE|KOREAN|LITHUANIAN|NORWEGIAN|POLISH|PORTUGUESE|ROMANIAN|RUSSIAN|SLOVAK|SLOVENIAN|SPANISH|SWEDISH|TURKISH|UKRAINIAN|AFRIKAANS|CROATIAN|CATALAN|ESTONIAN|GALICIAN|GREEK|LATVIAN"; -#endif /* ENABLE_NETWORK */ static const char *_osk_activation = "disabled|double|single|immediately"; static const char *_settings_profiles = "easy|medium|hard"; static const char *_news_display = "off|summarized|full"; diff --git a/src/table/settings.ini b/src/table/settings.ini index 7ab00d5a34..e7b625e4b0 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -44,12 +44,11 @@ static bool ZoomMinMaxChanged(int32 p1); static bool MaxVehiclesChanged(int32 p1); static bool InvalidateShipPathCache(int32 p1); -#ifdef ENABLE_NETWORK static bool UpdateClientName(int32 p1); static bool UpdateServerPassword(int32 p1); static bool UpdateRconPassword(int32 p1); static bool UpdateClientConfigValues(int32 p1); -#endif /* ENABLE_NETWORK */ + /* End - Callback Functions for the various settings */ /* Some settings do not need to be synchronised when playing in multiplayer. @@ -3565,7 +3564,6 @@ strhelp = STR_CONFIG_SETTING_NEWS_GENERAL_INFORMATION_HELPTEXT strval = STR_CONFIG_SETTING_NEWS_MESSAGES_OFF [SDTC_VAR] -ifdef = ENABLE_NETWORK var = gui.network_chat_box_width_pct type = SLE_UINT16 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3575,7 +3573,6 @@ max = 100 cat = SC_EXPERT [SDTC_VAR] -ifdef = ENABLE_NETWORK var = gui.network_chat_box_height type = SLE_UINT8 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3585,7 +3582,6 @@ max = 255 cat = SC_EXPERT [SDTC_VAR] -ifdef = ENABLE_NETWORK var = gui.network_chat_timeout type = SLE_UINT16 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3595,7 +3591,6 @@ max = 65535 cat = SC_EXPERT [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.sync_freq type = SLE_UINT16 flags = SLF_NOT_IN_SAVE | SLF_NOT_IN_CONFIG | SLF_NO_NETWORK_SYNC @@ -3606,7 +3601,6 @@ max = 100 cat = SC_EXPERT [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.frame_freq type = SLE_UINT8 flags = SLF_NOT_IN_SAVE | SLF_NOT_IN_CONFIG | SLF_NO_NETWORK_SYNC @@ -3617,7 +3611,6 @@ max = 100 cat = SC_EXPERT [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.commands_per_frame type = SLE_UINT16 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3628,7 +3621,6 @@ max = 65535 cat = SC_EXPERT [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.max_commands_in_queue type = SLE_UINT16 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3639,7 +3631,6 @@ max = 65535 cat = SC_EXPERT [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.bytes_per_frame type = SLE_UINT16 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3650,7 +3641,6 @@ max = 65535 cat = SC_EXPERT [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.bytes_per_frame_burst type = SLE_UINT16 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3661,7 +3651,6 @@ max = 65535 cat = SC_EXPERT [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.max_init_time type = SLE_UINT16 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3672,7 +3661,6 @@ max = 32000 cat = SC_EXPERT [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.max_join_time type = SLE_UINT16 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3682,7 +3670,6 @@ min = 0 max = 32000 [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.max_download_time type = SLE_UINT16 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3692,7 +3679,6 @@ min = 0 max = 32000 [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.max_password_time type = SLE_UINT16 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3702,7 +3688,6 @@ min = 0 max = 32000 [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.max_lag_time type = SLE_UINT16 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3712,14 +3697,12 @@ min = 0 max = 32000 [SDTC_BOOL] -ifdef = ENABLE_NETWORK var = network.pause_on_join flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC guiflags = SGF_NETWORK_ONLY def = true [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.server_port type = SLE_UINT16 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3730,7 +3713,6 @@ max = 65535 cat = SC_EXPERT [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.server_admin_port type = SLE_UINT16 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3741,7 +3723,6 @@ max = 65535 cat = SC_EXPERT [SDTC_BOOL] -ifdef = ENABLE_NETWORK var = network.server_admin_chat flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC guiflags = SGF_NETWORK_ONLY @@ -3749,14 +3730,12 @@ def = true cat = SC_EXPERT [SDTC_BOOL] -ifdef = ENABLE_NETWORK var = network.server_advertise flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC guiflags = SGF_NETWORK_ONLY def = false [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.lan_internet type = SLE_UINT8 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3766,7 +3745,6 @@ min = 0 max = 1 [SDTC_STR] -ifdef = ENABLE_NETWORK var = network.client_name type = SLE_STRB flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3774,8 +3752,6 @@ def = NULL proc = UpdateClientName cat = SC_BASIC -[SDTC_STR] -ifdef = ENABLE_NETWORK var = network.server_password type = SLE_STRB flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3785,7 +3761,6 @@ proc = UpdateServerPassword cat = SC_BASIC [SDTC_STR] -ifdef = ENABLE_NETWORK var = network.rcon_password type = SLE_STRB flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3795,7 +3770,6 @@ proc = UpdateRconPassword cat = SC_BASIC [SDTC_STR] -ifdef = ENABLE_NETWORK var = network.admin_password type = SLE_STRB flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3804,14 +3778,12 @@ def = NULL cat = SC_BASIC [SDTC_STR] -ifdef = ENABLE_NETWORK var = network.default_company_pass type = SLE_STRB flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC def = NULL [SDTC_STR] -ifdef = ENABLE_NETWORK var = network.server_name type = SLE_STRB flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3820,14 +3792,12 @@ def = NULL cat = SC_BASIC [SDTC_STR] -ifdef = ENABLE_NETWORK var = network.connect_to_ip type = SLE_STRB flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC def = NULL [SDTC_STR] -ifdef = ENABLE_NETWORK var = network.network_id type = SLE_STRB flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3835,14 +3805,12 @@ guiflags = SGF_NETWORK_ONLY def = NULL [SDTC_BOOL] -ifdef = ENABLE_NETWORK var = network.autoclean_companies flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC guiflags = SGF_NETWORK_ONLY def = false [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.autoclean_unprotected type = SLE_UINT8 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3852,7 +3820,6 @@ min = 0 max = 240 [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.autoclean_protected type = SLE_UINT8 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3862,7 +3829,6 @@ min = 0 max = 240 [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.autoclean_novehicles type = SLE_UINT8 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3872,7 +3838,6 @@ min = 0 max = 240 [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.max_companies type = SLE_UINT8 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3884,7 +3849,6 @@ proc = UpdateClientConfigValues cat = SC_BASIC [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.max_clients type = SLE_UINT8 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3895,7 +3859,6 @@ max = MAX_CLIENTS cat = SC_BASIC [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.max_spectators type = SLE_UINT8 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3907,7 +3870,6 @@ proc = UpdateClientConfigValues cat = SC_BASIC [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.restart_game_year type = SLE_INT32 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3918,7 +3880,6 @@ max = MAX_YEAR interval = 1 [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.min_active_clients type = SLE_UINT8 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3928,7 +3889,6 @@ min = 0 max = MAX_CLIENTS [SDTC_OMANY] -ifdef = ENABLE_NETWORK var = network.server_lang type = SLE_UINT8 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3939,7 +3899,6 @@ full = _server_langs cat = SC_BASIC [SDTC_BOOL] -ifdef = ENABLE_NETWORK var = network.reload_cfg flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC guiflags = SGF_NETWORK_ONLY @@ -3947,7 +3906,6 @@ def = false cat = SC_EXPERT [SDTC_STR] -ifdef = ENABLE_NETWORK var = network.last_host type = SLE_STRB flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3955,7 +3913,6 @@ def = """" cat = SC_EXPERT [SDTC_VAR] -ifdef = ENABLE_NETWORK var = network.last_port type = SLE_UINT16 flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC @@ -3965,7 +3922,6 @@ max = UINT16_MAX cat = SC_EXPERT [SDTC_BOOL] -ifdef = ENABLE_NETWORK var = network.no_http_content_downloads flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC def = false diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index cff86c3b3e..2277a5cf6f 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -158,11 +158,9 @@ public: int lock_offset = (bottom - top - lock_size.height) / 2; DrawCompanyIcon(company, rtl ? right - this->icon_size.width - WD_FRAMERECT_RIGHT : left + WD_FRAMERECT_LEFT, top + icon_offset); -#ifdef ENABLE_NETWORK if (NetworkCompanyIsPassworded(company)) { DrawSprite(SPR_LOCK, PAL_NONE, rtl ? left + WD_FRAMERECT_LEFT : right - this->lock_size.width - WD_FRAMERECT_RIGHT, top + lock_offset); } -#endif SetDParam(0, company); SetDParam(1, company); @@ -223,7 +221,6 @@ static void PopupMainCompanyToolbMenu(Window *w, int widget, int grey = 0) switch (widget) { case WID_TN_COMPANIES: -#ifdef ENABLE_NETWORK if (!_networking) break; /* Add the client list button for the companies menu */ @@ -234,7 +231,6 @@ static void PopupMainCompanyToolbMenu(Window *w, int widget, int grey = 0) } else { *list->Append() = new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_SPECTATE, CTMN_SPECTATE, NetworkMaxSpectatorsReached()); } -#endif /* ENABLE_NETWORK */ break; case WID_TN_STORY: @@ -610,7 +606,6 @@ static CallBackFunction ToolbarCompaniesClick(Window *w) */ static CallBackFunction MenuClickCompany(int index) { -#ifdef ENABLE_NETWORK if (_networking) { switch (index) { case CTMN_CLIENT_LIST: @@ -635,7 +630,6 @@ static CallBackFunction MenuClickCompany(int index) return CBF_NONE; } } -#endif /* ENABLE_NETWORK */ ShowCompany((CompanyID)index); return CBF_NONE; } @@ -2076,9 +2070,7 @@ struct MainToolbarWindow : Window { case MTHK_CHEATS: if (!_networking) ShowCheatWindow(); break; case MTHK_TERRAFORM: ShowTerraformToolbar(); break; case MTHK_EXTRA_VIEWPORT: ShowExtraViewPortWindowForTileUnderCursor(); break; -#ifdef ENABLE_NETWORK case MTHK_CLIENT_LIST: if (_networking) ShowClientList(); break; -#endif case MTHK_SIGN_LIST: ShowSignList(); break; default: return ES_NOT_HANDLED; } @@ -2189,9 +2181,7 @@ static Hotkey maintoolbar_hotkeys[] = { Hotkey(WKC_CTRL | WKC_ALT | 'C', "cheats", MTHK_CHEATS), Hotkey('L', "terraform", MTHK_TERRAFORM), Hotkey('V', "extra_viewport", MTHK_EXTRA_VIEWPORT), -#ifdef ENABLE_NETWORK Hotkey((uint16)0, "client_list", MTHK_CLIENT_LIST), -#endif Hotkey((uint16)0, "sign_list", MTHK_SIGN_LIST), HOTKEY_LIST_END }; diff --git a/src/video/dedicated_v.cpp b/src/video/dedicated_v.cpp index 3b053c7d64..58d7d04e0b 100644 --- a/src/video/dedicated_v.cpp +++ b/src/video/dedicated_v.cpp @@ -11,8 +11,6 @@ #include "../stdafx.h" -#ifdef ENABLE_NETWORK - #include "../gfx_func.h" #include "../network/network.h" #include "../network/network_internal.h" @@ -316,5 +314,3 @@ void VideoDriver_Dedicated::MainLoop() } } } - -#endif /* ENABLE_NETWORK */ diff --git a/src/viewport.cpp b/src/viewport.cpp index 5e82971435..8d9f4513e5 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -3318,12 +3318,8 @@ CommandCost CmdScrollViewport(TileIndex tile, DoCommandFlag flags, uint32 p1, ui if (_local_company != (CompanyID)p2) return CommandCost(); break; case VST_CLIENT: -#ifdef ENABLE_NETWORK if (_network_own_client_id != (ClientID)p2) return CommandCost(); break; -#else - return CommandCost(); -#endif default: return CMD_ERROR; } diff --git a/src/window.cpp b/src/window.cpp index 857029622f..f0cc5025f3 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -3120,13 +3120,11 @@ void UpdateWindows() CallWindowRealtimeTickEvent(delta_ms); -#ifdef ENABLE_NETWORK static GUITimer network_message_timer = GUITimer(1); if (network_message_timer.Elapsed(delta_ms)) { network_message_timer.SetInterval(1000); NetworkChatMessageLoop(); } -#endif Window *w; @@ -3443,10 +3441,9 @@ void ReInitAllWindows() FOR_ALL_WINDOWS_FROM_BACK(w) { w->ReInit(); } -#ifdef ENABLE_NETWORK + void NetworkReInitChatBoxSize(); NetworkReInitChatBoxSize(); -#endif /* Make sure essential parts of all windows are visible */ RelocateAllWindows(_cur_resolution.width, _cur_resolution.height); From 4da83d2f661691b40eb53591d2a998596f5d16a0 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Wed, 20 Mar 2019 01:21:10 +0000 Subject: [PATCH 15/82] Fix #7386: Measurement tooltip for tunnels, aqueducts & docks did not display or flickered. Measurement tooltip was auto-closed as the hover/right-click test for tooltips was not satisfied in this case. This is fixed by keeping the tooltip visible and instead explicitly closing the tooltip when the PlaceObject is cancelled/completed. --- src/misc_gui.cpp | 2 +- src/viewport.cpp | 18 +++++++++++++++--- src/window_gui.h | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 149ebe7177..061070a2b5 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -724,8 +724,8 @@ struct TooltipsWindow : public Window * we are dragging the tool. Normal tooltips work with hover or rmb. */ switch (this->close_cond) { case TCC_RIGHT_CLICK: if (!_right_button_down) delete this; break; - case TCC_LEFT_CLICK: if (!_left_button_down) delete this; break; case TCC_HOVER: if (!_mouse_hovering) delete this; break; + case TCC_NONE: break; } } }; diff --git a/src/viewport.cpp b/src/viewport.cpp index 8d9f4513e5..729dfca7b3 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -2508,12 +2508,17 @@ void UpdateTileSelection() * @param params (optional) up to 5 pieces of additional information that may be added to a tooltip * @param close_cond Condition for closing this tooltip. */ -static inline void ShowMeasurementTooltips(StringID str, uint paramcount, const uint64 params[], TooltipCloseCondition close_cond = TCC_LEFT_CLICK) +static inline void ShowMeasurementTooltips(StringID str, uint paramcount, const uint64 params[], TooltipCloseCondition close_cond = TCC_NONE) { if (!_settings_client.gui.measure_tooltip) return; GuiShowTooltips(_thd.GetCallbackWnd(), str, paramcount, params, close_cond); } +void HideMeasurementTooltips() +{ + DeleteWindowById(WC_TOOLTIPS, 0); +} + /** highlighting tiles while only going over them with the mouse */ void VpStartPlaceSizing(TileIndex tile, ViewportPlaceMethod method, ViewportDragDropSelectionProcess process) { @@ -2569,7 +2574,11 @@ void VpSetPresizeRange(TileIndex from, TileIndex to) _thd.next_drawstyle = HT_RECT; /* show measurement only if there is any length to speak of */ - if (distance > 1) ShowMeasurementTooltips(STR_MEASURE_LENGTH, 1, &distance, TCC_HOVER); + if (distance > 1) { + ShowMeasurementTooltips(STR_MEASURE_LENGTH, 1, &distance); + } else { + HideMeasurementTooltips(); + } } static void VpStartPreSizing() @@ -3221,7 +3230,10 @@ void SetObjectToPlace(CursorID icon, PaletteID pal, HighLightStyle mode, WindowC * this function might in some cases reset the newly set object to * place or not properly reset the original selection. */ _thd.window_class = WC_INVALID; - if (w != NULL) w->OnPlaceObjectAbort(); + if (w != NULL) { + w->OnPlaceObjectAbort(); + HideMeasurementTooltips(); + } } /* Mark the old selection dirty, in case the selection shape or colour changes */ diff --git a/src/window_gui.h b/src/window_gui.h index 0abf79cca2..05a2b3c5a2 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -873,8 +873,8 @@ void RelocateAllWindows(int neww, int newh); /* misc_gui.cpp */ enum TooltipCloseCondition { TCC_RIGHT_CLICK, - TCC_LEFT_CLICK, TCC_HOVER, + TCC_NONE, }; void GuiShowTooltips(Window *parent, StringID str, uint paramcount = 0, const uint64 params[] = NULL, TooltipCloseCondition close_tooltip = TCC_HOVER); From f5f33da126a072ddacfdb8e5887054f4225d4d86 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Wed, 20 Mar 2019 02:13:36 +0000 Subject: [PATCH 16/82] Codechange: Implement OnTooltip event for custom window tooltips. This avoids windows from needing to know or care about tooltip delay settings. --- src/linkgraph/linkgraph_gui.cpp | 15 +-------------- src/linkgraph/linkgraph_gui.h | 4 +--- src/window.cpp | 10 ++++++---- src/window_gui.h | 24 ++++++++++++++++-------- 4 files changed, 24 insertions(+), 29 deletions(-) diff --git a/src/linkgraph/linkgraph_gui.cpp b/src/linkgraph/linkgraph_gui.cpp index 4db9f95b35..6844092c2e 100644 --- a/src/linkgraph/linkgraph_gui.cpp +++ b/src/linkgraph/linkgraph_gui.cpp @@ -559,7 +559,7 @@ void LinkGraphLegendWindow::DrawWidget(const Rect &r, int widget) const } } -bool LinkGraphLegendWindow::OnHoverCommon(Point pt, int widget, TooltipCloseCondition close_cond) +bool LinkGraphLegendWindow::OnTooltip(Point pt, int widget, TooltipCloseCondition close_cond) { if (IsInsideMM(widget, WID_LGL_COMPANY_FIRST, WID_LGL_COMPANY_LAST + 1)) { if (this->IsWidgetDisabled(widget)) { @@ -584,19 +584,6 @@ bool LinkGraphLegendWindow::OnHoverCommon(Point pt, int widget, TooltipCloseCond return false; } -void LinkGraphLegendWindow::OnHover(Point pt, int widget) -{ - this->OnHoverCommon(pt, widget, TCC_HOVER); -} - -bool LinkGraphLegendWindow::OnRightClick(Point pt, int widget) -{ - if (_settings_client.gui.hover_delay_ms == 0) { - return this->OnHoverCommon(pt, widget, TCC_RIGHT_CLICK); - } - return false; -} - /** * Update the overlay with the new company selection. */ diff --git a/src/linkgraph/linkgraph_gui.h b/src/linkgraph/linkgraph_gui.h index 93ec666299..17fcd28b28 100644 --- a/src/linkgraph/linkgraph_gui.h +++ b/src/linkgraph/linkgraph_gui.h @@ -106,8 +106,7 @@ public: virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize); virtual void DrawWidget(const Rect &r, int widget) const; - virtual void OnHover(Point pt, int widget); - virtual bool OnRightClick(Point pt, int widget); + virtual bool OnTooltip(Point pt, int widget, TooltipCloseCondition close_cond); virtual void OnClick(Point pt, int widget, int click_count); virtual void OnInvalidateData(int data = 0, bool gui_scope = true); @@ -116,7 +115,6 @@ private: void UpdateOverlayCompanies(); void UpdateOverlayCargoes(); - bool OnHoverCommon(Point pt, int widget, TooltipCloseCondition close_cond); }; #endif /* LINKGRAPH_GUI_H */ diff --git a/src/window.cpp b/src/window.cpp index f0cc5025f3..243114e206 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -770,16 +770,17 @@ static void DispatchRightClickEvent(Window *w, int x, int y) NWidgetCore *wid = w->nested_root->GetWidgetFromPos(x, y); if (wid == NULL) return; + Point pt = { x, y }; + /* No widget to handle, or the window is not interested in it. */ if (wid->index >= 0) { - Point pt = { x, y }; if (w->OnRightClick(pt, wid->index)) return; } /* Right-click close is enabled and there is a closebox */ if (_settings_client.gui.right_mouse_wnd_close && w->nested_root->GetWidgetOfType(WWT_CLOSEBOX)) { delete w; - } else if (_settings_client.gui.hover_delay_ms == 0 && wid->tool_tip != 0) { + } else if (_settings_client.gui.hover_delay_ms == 0 && !w->OnTooltip(pt, wid->index, TCC_RIGHT_CLICK) && wid->tool_tip != 0) { GuiShowTooltips(w, wid->tool_tip, 0, NULL, TCC_RIGHT_CLICK); } } @@ -797,8 +798,10 @@ static void DispatchHoverEvent(Window *w, int x, int y) /* No widget to handle */ if (wid == NULL) return; + Point pt = { x, y }; + /* Show the tooltip if there is any */ - if (wid->tool_tip != 0) { + if (!w->OnTooltip(pt, wid->index, TCC_HOVER) && wid->tool_tip != 0) { GuiShowTooltips(w, wid->tool_tip); return; } @@ -806,7 +809,6 @@ static void DispatchHoverEvent(Window *w, int x, int y) /* Widget has no index, so the window is not interested in it. */ if (wid->index < 0) return; - Point pt = { x, y }; w->OnHover(pt, wid->index); } diff --git a/src/window_gui.h b/src/window_gui.h index 05a2b3c5a2..b2bba675b2 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -265,6 +265,13 @@ struct ViewportData : ViewPort { struct QueryString; +/* misc_gui.cpp */ +enum TooltipCloseCondition { + TCC_RIGHT_CLICK, + TCC_HOVER, + TCC_NONE, +}; + /** * Data structure for an opened window */ @@ -629,12 +636,20 @@ public: virtual bool OnRightClick(Point pt, int widget) { return false; } /** - * The mouse is hovering over a widget in the window, perform an action for it, like opening a custom tooltip. + * The mouse is hovering over a widget in the window, perform an action for it. * @param pt The point where the mouse is hovering. * @param widget The widget where the mouse is hovering. */ virtual void OnHover(Point pt, int widget) {} + /** + * Event to display a custom tooltip. + * @param pt The point where the mouse is located. + * @param widget The widget where the mouse is located. + * @return True if the event is handled, false if it is ignored. + */ + virtual bool OnTooltip(Point pt, int widget, TooltipCloseCondition close_cond) { return false; } + /** * An 'object' is being dragged at the provided position, highlight the target if possible. * @param pt The point inside the window that the mouse hovers over. @@ -870,13 +885,6 @@ Wcls *AllocateWindowDescFront(WindowDesc *desc, int window_number, bool return_e void RelocateAllWindows(int neww, int newh); -/* misc_gui.cpp */ -enum TooltipCloseCondition { - TCC_RIGHT_CLICK, - TCC_HOVER, - TCC_NONE, -}; - void GuiShowTooltips(Window *parent, StringID str, uint paramcount = 0, const uint64 params[] = NULL, TooltipCloseCondition close_tooltip = TCC_HOVER); /* widget.cpp */ From b3ef06fdf35c4ddadb6396a61aa7f9d1adee2da3 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Wed, 20 Mar 2019 02:16:05 +0000 Subject: [PATCH 17/82] Fix #7384: Industry Chain tooltips did not display on right-click. This is fixed by handling the new Window::OnTooltip() event instead of OnHover() --- src/industry_gui.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index a1030122e5..78bf3f4a01 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -2753,12 +2753,12 @@ struct IndustryCargoesWindow : public Window { } } - virtual void OnHover(Point pt, int widget) + bool OnTooltip(Point pt, int widget, TooltipCloseCondition close_cond) { - if (widget != WID_IC_PANEL) return; + if (widget != WID_IC_PANEL) return false; Point fieldxy, xy; - if (!CalculatePositionInWidget(pt, &fieldxy, &xy)) return; + if (!CalculatePositionInWidget(pt, &fieldxy, &xy)) return false; const CargoesField *fld = this->fields[fieldxy.y].columns + fieldxy.x; CargoID cid = INVALID_CARGO; @@ -2777,9 +2777,9 @@ struct IndustryCargoesWindow : public Window { case CFT_INDUSTRY: if (fld->u.industry.ind_type < NUM_INDUSTRYTYPES && (this->ind_cargo >= NUM_INDUSTRYTYPES || fieldxy.x != 2)) { - GuiShowTooltips(this, STR_INDUSTRY_CARGOES_INDUSTRY_TOOLTIP, 0, NULL, TCC_HOVER); + GuiShowTooltips(this, STR_INDUSTRY_CARGOES_INDUSTRY_TOOLTIP, 0, NULL, close_cond); } - return; + return true; default: break; @@ -2788,8 +2788,11 @@ struct IndustryCargoesWindow : public Window { const CargoSpec *csp = CargoSpec::Get(cid); uint64 params[5]; params[0] = csp->name; - GuiShowTooltips(this, STR_INDUSTRY_CARGOES_CARGO_TOOLTIP, 1, params, TCC_HOVER); + GuiShowTooltips(this, STR_INDUSTRY_CARGOES_CARGO_TOOLTIP, 1, params, close_cond); + return true; } + + return false; } virtual void OnResize() From c34f07d5fd529043a58f85778fcbfdc30485ff18 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Wed, 20 Mar 2019 23:26:58 +0000 Subject: [PATCH 18/82] Fix #7390: Extra line removed by mistake caused server_password to disappear from settings. --- src/table/settings.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/src/table/settings.ini b/src/table/settings.ini index e7b625e4b0..78ed234ce2 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -3752,6 +3752,7 @@ def = NULL proc = UpdateClientName cat = SC_BASIC +[SDTC_STR] var = network.server_password type = SLE_STRB flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC From 0837a1a398b4c9bd192b0575e9ace6c069ec93a8 Mon Sep 17 00:00:00 2001 From: translators Date: Thu, 21 Mar 2019 19:45:42 +0100 Subject: [PATCH 19/82] Update: Translations from eints dutch: 28 changes by JanWillem russian: 1 change by Lone_Wolf --- src/lang/dutch.txt | 56 ++++++++++++++++++++++---------------------- src/lang/russian.txt | 2 +- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index 546cb31aa6..221caab94c 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -1124,7 +1124,7 @@ STR_CONFIG_SETTING_RESTRICT_BASIC :Basis (alleen b STR_CONFIG_SETTING_RESTRICT_ADVANCED :Geavanceerd (meeste instellingen weergeven) STR_CONFIG_SETTING_RESTRICT_ALL :Expert (alle instellingen weergeven, inclusief vreemde) STR_CONFIG_SETTING_RESTRICT_CHANGED_AGAINST_DEFAULT :Instellingen met een andere waarde dan de standaard -STR_CONFIG_SETTING_RESTRICT_CHANGED_AGAINST_NEW :Instellingen met een andere waarde dan je 'nieuw spel' instellingen +STR_CONFIG_SETTING_RESTRICT_CHANGED_AGAINST_NEW :Instellingen met een andere waarde dan je instellingen voor 'Nieuw spel' STR_CONFIG_SETTING_TYPE_DROPDOWN_HELPTEXT :{BLACK}Filter de lijst hieronder op bepaalde instellingstypen STR_CONFIG_SETTING_TYPE_DROPDOWN_ALL :Alle instellingen @@ -1169,7 +1169,7 @@ STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Instellen hoeve STR_CONFIG_SETTING_CONSTRUCTION_COSTS :Bouwkosten: {STRING} STR_CONFIG_SETTING_CONSTRUCTION_COSTS_HELPTEXT :Het niveau van bouw- en aankoopkosten instellen STR_CONFIG_SETTING_RECESSIONS :Recessies: {STRING} -STR_CONFIG_SETTING_RECESSIONS_HELPTEXT :Wanneer ingeschakeld kunnen recessies om de paar jaar optreden. Tijdens een recessie is alle productie aanzienlijk lager (deze keert terug naar het vorige niveau als de recessie voorbij is) +STR_CONFIG_SETTING_RECESSIONS_HELPTEXT :Wanneer dit is ingeschakeld, kunnen om de paar jaar recessies optreden. Tijdens een recessie is alle productie aanzienlijk lager (deze keert terug naar het vorige niveau als de recessie voorbij is). STR_CONFIG_SETTING_TRAIN_REVERSING :Niet toestaan dat treinen keren in stations: {STRING} STR_CONFIG_SETTING_TRAIN_REVERSING_HELPTEXT :Indien ingeschakeld zullen treinen niet omkeren in niet-eind stations, zelfs als er een kortere weg naar hun volgende bestemming is bij omkeren STR_CONFIG_SETTING_DISASTERS :Rampen: {STRING} @@ -1192,7 +1192,7 @@ STR_CONFIG_SETTING_TRAIN_LENGTH :Maximale lengte STR_CONFIG_SETTING_TRAIN_LENGTH_HELPTEXT :Stel de maximale lengte van treinen in STR_CONFIG_SETTING_TILE_LENGTH :{COMMA} tegel{P 0 "" s} STR_CONFIG_SETTING_SMOKE_AMOUNT :Hoeveelheid rook/vonken: {STRING} -STR_CONFIG_SETTING_SMOKE_AMOUNT_HELPTEXT :Bepaal hoeveel rook of hoeveel vonken door de voertuigen worden uitgestoten. +STR_CONFIG_SETTING_SMOKE_AMOUNT_HELPTEXT :Bepaal hoeveel rook en vonken voertuigen uitstoten STR_CONFIG_SETTING_TRAIN_ACCELERATION_MODEL :Treinacceleratiemodel: {STRING} STR_CONFIG_SETTING_TRAIN_ACCELERATION_MODEL_HELPTEXT :Natuurkundig model selecteren voor treinacceleratie. In het 'originele' model hebben hellingen dezelfde invloed op alle voertuigen. In het 'realistische' model hebben hellingen en bochten een verschillende invloed, afhankelijk van verschillende eigenschappen van de samenstelling, zoals lengte en trekkracht. STR_CONFIG_SETTING_ROAD_VEHICLE_ACCELERATION_MODEL :Acceleratiemodel voor wegvoertuigen: {STRING} @@ -1222,16 +1222,16 @@ STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_PROSPECTING :Onderzoeken STR_CONFIG_SETTING_INDUSTRY_PLATFORM :Vlak gebied rond industrieën: {STRING} STR_CONFIG_SETTING_INDUSTRY_PLATFORM_HELPTEXT :Hoeveelheid ruimte rond een industrie. Dit zorgt ervoor dat lege ruimte rond een industrie beschikbaar blijft voor sporen, stations, wegen enz. STR_CONFIG_SETTING_MULTIPINDTOWN :Meerdere vergelijkbare industrieën per stad toestaan: {STRING} -STR_CONFIG_SETTING_MULTIPINDTOWN_HELPTEXT :Normaal zal een stad niet meer dan één industrie van ieder type toestaan. Door deze optie in te schakelen zullen steden meerdere industrieën van één soort accepteren. +STR_CONFIG_SETTING_MULTIPINDTOWN_HELPTEXT :Normaal staat een stad niet meer dan één industrie van ieder type toe. Wanneer je deze optie inschakelt, accepteren steden meerdere industrieën van één soort. STR_CONFIG_SETTING_SIGNALSIDE :Seinen weergeven: {STRING} STR_CONFIG_SETTING_SIGNALSIDE_HELPTEXT :Kiest aan welke kant van het spoor seinen worden geplaatst STR_CONFIG_SETTING_SIGNALSIDE_LEFT :Links STR_CONFIG_SETTING_SIGNALSIDE_DRIVING_SIDE :Aan de rij zijde STR_CONFIG_SETTING_SIGNALSIDE_RIGHT :Rechts STR_CONFIG_SETTING_SHOWFINANCES :Financieel overzicht aan het einde van het jaar weergeven: {STRING} -STR_CONFIG_SETTING_SHOWFINANCES_HELPTEXT :Indien ingeschakeld verschijnt het financiën venster aan het eind van elk jaar voor een gemakkelijke controle van de financiële status van het bedrijf +STR_CONFIG_SETTING_SHOWFINANCES_HELPTEXT :Indien dit is ingeschakeld, verschijnt het venster met financiën aan het eind van elk jaar. Zo kun je gemakkelijk de financiële status van het bedrijf in de gaten houden. STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT :Nieuwe orders zijn standaard 'non-stop': {STRING} -STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT_HELPTEXT :Normaal gesproken zal een voertuig stoppen op elk station dit wordt gepasseerd. Door het inschakelen van deze instelling, zal het rijden door alle station op weg naar de eindbestemming zonder te stoppen. Merk op dat deze instelling alleen een standaardwaarde voor nieuwe orders bepaalt. Individuele opdrachten kan expliciet worden ingesteld op het gedrag +STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT_HELPTEXT :Normaal gesproken stopt een voertuig op elk station dat wordt gepasseerd. Wanneer je deze instelling inschakelt, passeert het alle stations op weg naar de eindbestemming zonder te stoppen. Merk op dat deze instelling alleen een standaardwaarde voor nieuwe orders bepaalt. Individuele opdrachten kunnen expliciet worden ingesteld op elk gewenst gedrag. STR_CONFIG_SETTING_STOP_LOCATION :Nieuwe treinorders stoppen de trein standaard {STRING} van het perron STR_CONFIG_SETTING_STOP_LOCATION_HELPTEXT :Plaats waar een trein standaard stopt aan het perron. 'Aan het begin' betekent in de buurt van de ingang, 'In het midden' betekent in het midden van het perron, en 'Aan het einde' betekent ver weg van de ingang. Merk op dat deze instelling alleen een standaardwaarde voor nieuwe orders bepaalt. Je kunt opdrachten expliciet instellen op elk gewenst gedrag. STR_CONFIG_SETTING_STOP_LOCATION_NEAR_END :aan het begin @@ -1280,7 +1280,7 @@ STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Het inschakelen STR_CONFIG_SETTING_WARN_LOST_VEHICLE :Waarschuwen wanneer voertuig verdwaald is: {STRING} STR_CONFIG_SETTING_WARN_LOST_VEHICLE_HELPTEXT :Veroorzaakt berichten over voertuigen die niet in staat zijn om een pad naar hun bestemming te vinden STR_CONFIG_SETTING_ORDER_REVIEW :Orders van voertuigen controleren: {STRING} -STR_CONFIG_SETTING_ORDER_REVIEW_HELPTEXT :Wanneer ingeschakeld, worden de orders van de voertuigen regelmatig gecontroleerd, en sommige voor de hand liggende problemen worden gemeld met een nieuwsbericht bij detectie +STR_CONFIG_SETTING_ORDER_REVIEW_HELPTEXT :Wanneer dit is ingeschakeld, worden de orders van de voertuigen regelmatig gecontroleerd, en sommige duidelijke problemen worden gemeld met een nieuwsbericht STR_CONFIG_SETTING_ORDER_REVIEW_OFF :Nee STR_CONFIG_SETTING_ORDER_REVIEW_EXDEPOT :Ja, maar gestopte voertuigen uitsluiten STR_CONFIG_SETTING_ORDER_REVIEW_ON :Alle voertuigen @@ -1318,8 +1318,8 @@ STR_CONFIG_SETTING_TERRAIN_TYPE :Terreintype: {S STR_CONFIG_SETTING_TERRAIN_TYPE_HELPTEXT :(Alleen TerraGenesis) Heuvelachtigheid van het landschap STR_CONFIG_SETTING_INDUSTRY_DENSITY :Industriedichtheid: {STRING} STR_CONFIG_SETTING_INDUSTRY_DENSITY_HELPTEXT :Stelt in hoeveel industrieën worden gegenereerd en welk niveau tijdens het spel moet worden gehandhaafd -STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Maximumafstand van de rand voor Olierafinaderijen: {STRING} -STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Olieraffinaderijen worden alleen gebouwd nabij de kaart grens, dat is aan de kust van eiland kaarten +STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Maximumafstand van de rand voor olieraffinaderijen: {STRING} +STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Olieraffinaderijen worden alleen gebouwd nabij de kaartgrens, dat is aan de kust van eilandkaarten STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Sneeuwhoogte: {STRING} STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Stelt in op welke hoogte de sneeuw begint in subarctisch landschap. Sneeuw heeft ook invloed op het ontstaan van industrieën en op de vereisten voor stadsgroei. STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Ruwheid van het terrein: {STRING} @@ -1385,8 +1385,8 @@ STR_CONFIG_SETTING_OSK_ACTIVATION :Toetsenbord op STR_CONFIG_SETTING_OSK_ACTIVATION_HELPTEXT :Selecteer de methode om het toetsenbord op het scherm te openen voor tekst invoeren in bewerkingsvensters met alleen het aanwijsapparaat. Dit is bedoeld voor kleine apparaten zonder toetsenbord. STR_CONFIG_SETTING_OSK_ACTIVATION_DISABLED :Uitgeschakeld STR_CONFIG_SETTING_OSK_ACTIVATION_DOUBLE_CLICK :Dubbelklik -STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Enkel klik (met focus) -STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Enkel klik (onmiddelijk) +STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Enkele klik (met focus) +STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Enkele klik (onmiddelijk) STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :Rechtsklikemulatie: {STRING} STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_HELPTEXT :Methode selecteeren voor nabootsen van rechtsklikken @@ -1395,7 +1395,7 @@ STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_CONTROL :Ctrl+klik STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_OFF :Uit STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE :Vensters sluiten met rechtsklik: {STRING} -STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE_HELPTEXT :Venster sluiten met de rechtermuisknop. Schakelt knopinfo met de rechtermuisknop uit! +STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE_HELPTEXT :Sluit vensters met de rechtermuisknop. Schakelt knopinfo met de rechtermuisknop uit! STR_CONFIG_SETTING_AUTOSAVE :Automatisch opslaan: {STRING} STR_CONFIG_SETTING_AUTOSAVE_HELPTEXT :Tijdsduur kiezen voor automatische spelopslag @@ -1407,7 +1407,7 @@ STR_CONFIG_SETTING_DATE_FORMAT_IN_SAVE_NAMES_SHORT :kort (31-12-200 STR_CONFIG_SETTING_DATE_FORMAT_IN_SAVE_NAMES_ISO :ISO (2008-12-31) STR_CONFIG_SETTING_PAUSE_ON_NEW_GAME :Automatisch pauzeren als je een nieuw spel start: {STRING} -STR_CONFIG_SETTING_PAUSE_ON_NEW_GAME_HELPTEXT :Wanneer ingeschakeld, het spel zal automatisch pauzeren bij het starten van een nieuw spel, waardoor nadere bestudering van de kaart mogelijk is +STR_CONFIG_SETTING_PAUSE_ON_NEW_GAME_HELPTEXT :Wanneer dit is ingeschakeld, pauzeert het spel automatisch wanneer je een nieuw spel start; zo kun je rustig de kaart bestuderen STR_CONFIG_SETTING_COMMAND_PAUSE_LEVEL :Toestaan wanneer gepauzeerd: {STRING} STR_CONFIG_SETTING_COMMAND_PAUSE_LEVEL_HELPTEXT :Selecteer welke acties kunnen worden uitgevoerd terwijl het spel is gepauzeerd STR_CONFIG_SETTING_COMMAND_PAUSE_LEVEL_NO_ACTIONS :Niets @@ -1423,25 +1423,25 @@ STR_CONFIG_SETTING_TIMETABLE_IN_TICKS_HELPTEXT :Reistijden in t STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE :Aankomst- en vertrektijden in dienstregeling weergeven: {STRING} STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE_HELPTEXT :Geef de verwachte aankomst-en vertrektijden in de dienstregeling weer STR_CONFIG_SETTING_QUICKGOTO :Snel voertuigorders maken: {STRING} -STR_CONFIG_SETTING_QUICKGOTO_HELPTEXT :Pre-selecteer de 'Ga naar cursor' bij het openen van de orders venster +STR_CONFIG_SETTING_QUICKGOTO_HELPTEXT :Selecteer meteen de 'ga-naar-cursor' wanneer je het ordervenster opent STR_CONFIG_SETTING_DEFAULT_RAIL_TYPE :Standaard spoorsoort (bij nieuw of opgeslagen spel): {STRING} STR_CONFIG_SETTING_DEFAULT_RAIL_TYPE_HELPTEXT :Spoortype om te selecteren na het starten of het laden van een spel. 'eerst beschikbare' selecteert de oudste vorm van sporen, 'laatst beschikbare' selecteert het nieuwste type van sporen, en 'meest gebruikte' selecteert het type dat op dit moment het meest in gebruik is STR_CONFIG_SETTING_DEFAULT_RAIL_TYPE_FIRST :Eerst beschikbare STR_CONFIG_SETTING_DEFAULT_RAIL_TYPE_LAST :Laatst beschikbare STR_CONFIG_SETTING_DEFAULT_RAIL_TYPE_MOST_USED :Meest gebruikte STR_CONFIG_SETTING_SHOW_TRACK_RESERVATION :Gereserveerd spoor weergeven: {STRING} -STR_CONFIG_SETTING_SHOW_TRACK_RESERVATION_HELPTEXT :Geef gereserveerde tracks een andere kleur om te helpen met de problemen met treinen te weigeren een route op basis van blokken in te gaan +STR_CONFIG_SETTING_SHOW_TRACK_RESERVATION_HELPTEXT :Geeft gereserveerde sporen een andere kleur. Dit is handig om te bepalen waarom treinen een routeblok niet ingaan. STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS :Bouwgereedschappen actief houden na gebruik: {STRING} STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS_HELPTEXT :Houd de bouwhulpmiddelen voor bruggen, tunnels, enz. open na gebruik STR_CONFIG_SETTING_EXPENSES_LAYOUT :Uitgaven in bedrijfsfinanciënvenster groeperen: {STRING} STR_CONFIG_SETTING_EXPENSES_LAYOUT_HELPTEXT :Definieer de lay-out voor het bedrijfsuitgavenvenster STR_CONFIG_SETTING_SOUND_TICKER :Nieuwsticker: {STRING} -STR_CONFIG_SETTING_SOUND_TICKER_HELPTEXT :Geluidseffect afspelen bij korte nieuwsberichten +STR_CONFIG_SETTING_SOUND_TICKER_HELPTEXT :Speel geluidseffecten af bij korte nieuwsberichten STR_CONFIG_SETTING_SOUND_NEWS :Krant: {STRING} -STR_CONFIG_SETTING_SOUND_NEWS_HELPTEXT :Geluidseffect weergeven bij nieuwsbericht +STR_CONFIG_SETTING_SOUND_NEWS_HELPTEXT :Speel geluidseffecten af bij nieuwsberichten STR_CONFIG_SETTING_SOUND_NEW_YEAR :Einde jaar: {STRING} -STR_CONFIG_SETTING_SOUND_NEW_YEAR_HELPTEXT :Geluidseffect afspelen bij jaaroverzicht van bedrijf t.o.v. vorig jaar +STR_CONFIG_SETTING_SOUND_NEW_YEAR_HELPTEXT :Speel geluidseffecten af bij jaaroverzicht van bedrijf t.o.v. vorig jaar STR_CONFIG_SETTING_SOUND_CONFIRM :Bouw: {STRING} STR_CONFIG_SETTING_SOUND_CONFIRM_HELPTEXT :Speel geluidseffecten af wanneer constructies of andere acties zijn gelukt STR_CONFIG_SETTING_SOUND_CLICK :Klikgeluid knoppen: {STRING} @@ -1542,7 +1542,7 @@ STR_CONFIG_SETTING_COLOURED_NEWS_YEAR :Kleurenfoto's v STR_CONFIG_SETTING_COLOURED_NEWS_YEAR_HELPTEXT :Jaar dat de krant aankondigt in kleur te gaan afdrukken. Voor dit jaar wordt zwart-wit gebruikt STR_CONFIG_SETTING_STARTING_YEAR :Startjaar: {STRING} STR_CONFIG_SETTING_SMOOTH_ECONOMY :Vloeiende economie inschakelen (meer, kleinere veranderingen): {STRING} -STR_CONFIG_SETTING_SMOOTH_ECONOMY_HELPTEXT :Wanneer ingeschakeld, industrie produktie verandert vaker en in kleinere stappen. Deze instelling heeft meestal geen effect, als de industrie soorten worden geleverd door een NewGRF +STR_CONFIG_SETTING_SMOOTH_ECONOMY_HELPTEXT :Wanneer dit is ingeschakeld, verandert de productie van industrieën vaker en in kleinere stappen. Deze instelling heeft meestal geen effect als de industriesoorten worden geleverd door een NewGRF. STR_CONFIG_SETTING_ALLOW_SHARES :Kopen van aandelen in andere bedrijven toestaan: {STRING} STR_CONFIG_SETTING_ALLOW_SHARES_HELPTEXT :Wanneer ingeschakeld is het toegestaan om bedrijfsaandelen te kopen en te verkopen. Aandelen zullen alleen beschikbaar zijn voor bedrijven die een bepaalde leeftijd hebben bereikt STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE :Percentage van routeopbrengst in overdrachtssysteem: {STRING} @@ -1553,7 +1553,7 @@ STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY_VALUE :{COMMA} tegel{P STR_CONFIG_SETTING_DRAG_SIGNALS_FIXED_DISTANCE :Bij slepen vaste afstand tussen seinen aanhouden: {STRING} STR_CONFIG_SETTING_DRAG_SIGNALS_FIXED_DISTANCE_HELPTEXT :Selecteer het gedrag van seinplaatsing wanneer je met Ctrl+slepen seinen plaatst. Indien dit uitgeschakeld is, dan worden seinen rondom tunnels of bruggen geplaatst om lange stukken te vermijden zonder seinen. Indien dit ingeschakeld is, dan worden seinen om de N tegels geplaatst, waardoor de uitlijning van de seinen op parallelle sporen makkelijker is STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :Automatisch armseinen plaatsen voor: {STRING} -STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Stel het jaar waarin elektrische seinen zal worden gebruikt voor sporen. Voor dit jaar zal niet-elektrische seinen worden gebruikt (die exact dezelfde functie hebben, maar verschillend uiterlijk) +STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Stelt het jaar in waarin elektrische seinen worden gebruikt voor sporen. Eerder dan dit jaar worden niet-elektrische seinen gebruikt (die exact op dezelfde manier werken, maar een verschillend uiterlijk hebben). STR_CONFIG_SETTING_ENABLE_SIGNAL_GUI :Seinenvenster inschakelen: {STRING} STR_CONFIG_SETTING_ENABLE_SIGNAL_GUI_HELPTEXT :Een venster weergeven waar je de soorten seinen kunt kiezen om te bouwen in plaats van alleen bladeren door seintypes met Ctrl+klikken op gebouwde seinen STR_CONFIG_SETTING_DEFAULT_SIGNAL_TYPE :Seintype dat standaard moet worden gebouwd: {STRING} @@ -1579,7 +1579,7 @@ STR_CONFIG_SETTING_ALLOW_TOWN_ROADS_HELPTEXT :Steden toestaan STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS :Steden mogen gelijkvloerse kruisingen bouwen: {STRING} STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS_HELPTEXT :Door deze optie in te schakelen, kunnen steden gelijkvloerse kruisingen bouwen. STR_CONFIG_SETTING_NOISE_LEVEL :Geluidsniveaucontrole door steden voor vliegvelden toestaan: {STRING} -STR_CONFIG_SETTING_NOISE_LEVEL_HELPTEXT :Met deze instelling uitgeschakeld kunnen er twee luchthavens in elke stad zijn. Als deze instelling is ingeschakeld, wordt het aantal luchthavens in een stad beperkt door het lawaai tollerantie van de stad, die afhankelijk is van de bevolking en de luchthaven grootte en afstand +STR_CONFIG_SETTING_NOISE_LEVEL_HELPTEXT :Als je deze instelling uitschakelt, mogen er twee luchthavens per stad zijn. Als je deze instelling ingeschakelt, wordt het aantal luchthavens in een stad beperkt door de lawaaitolerantie van de stad; deze is afhankelijk van de bevolking en de grootte en afstand van de luchthaven. STR_CONFIG_SETTING_TOWN_FOUNDING :Steden stichten in spel: {STRING} STR_CONFIG_SETTING_TOWN_FOUNDING_HELPTEXT :Wanneer deze instelling is ingeschakeld, kunnen spelers nieuwe steden stichten tijdens het spel. STR_CONFIG_SETTING_TOWN_FOUNDING_FORBIDDEN :Verboden @@ -1599,9 +1599,9 @@ STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_ALL :Overal STR_CONFIG_SETTING_TOOLBAR_POS :Positie van algemene knoppenbalk: {STRING} STR_CONFIG_SETTING_TOOLBAR_POS_HELPTEXT :Horizontale positie van de algemene taakbalk aan de bovenkant van het scherm. STR_CONFIG_SETTING_STATUSBAR_POS :Positie van de statusbalk: {STRING} -STR_CONFIG_SETTING_STATUSBAR_POS_HELPTEXT :De horizontale positie van de statusbalk aan de onderkant van het scherm. +STR_CONFIG_SETTING_STATUSBAR_POS_HELPTEXT :De horizontale positie van de statusbalk aan de onderkant van het scherm STR_CONFIG_SETTING_SNAP_RADIUS :Straal voor vensters vastmaken: {STRING} -STR_CONFIG_SETTING_SNAP_RADIUS_HELPTEXT :Afstand tussen vensters voordat het venster wordt verplaatst wordt automatisch uitgelijnd naar de nabijgelegen vensters +STR_CONFIG_SETTING_SNAP_RADIUS_HELPTEXT :Afstand tussen vensters voordat het venster automatisch wordt uitgelijnd op nabijgelegen vensters STR_CONFIG_SETTING_SNAP_RADIUS_VALUE :{COMMA} pixel{P 0 "" s} STR_CONFIG_SETTING_SNAP_RADIUS_DISABLED :Uitgeschakeld STR_CONFIG_SETTING_SOFT_LIMIT :Maximumaantal (niet-blijvende) vensters: {STRING} @@ -1728,7 +1728,7 @@ STR_CONFIG_SETTING_PATHFINDER_FOR_SHIPS_HELPTEXT :Routezoeker voo STR_CONFIG_SETTING_REVERSE_AT_SIGNALS :Automatisch omdraaien bij seinen: {STRING} STR_CONFIG_SETTING_REVERSE_AT_SIGNALS_HELPTEXT :Treinen mogen keren bij een sein als ze hier lang staan wachten -STR_CONFIG_SETTING_QUERY_CAPTION :{WHITE}Verander waarde +STR_CONFIG_SETTING_QUERY_CAPTION :{WHITE}Instelwaarde wijzigen # Config errors STR_CONFIG_ERROR :{WHITE}Fout in het configuratiebestand... @@ -2139,7 +2139,7 @@ STR_NETWORK_CHAT_ALL :[Iedereen] {STR STR_NETWORK_CHAT_OSKTITLE :{BLACK}Geef tekst voor netwerkchat # Network messages -STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Geen netwerkapparaten gevonden of gecompileerd zonder ENABLE_NETWORK +STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Geen netwerkapparaten gevonden STR_NETWORK_ERROR_NOSERVER :{WHITE}Kon geen enkel netwerkspel vinden STR_NETWORK_ERROR_NOCONNECTION :{WHITE}De server beantwoordde het verzoek niet STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Kan geen verbinding maken, je hebt niet dezelfde NewGRF-bestanden als de server @@ -2585,7 +2585,7 @@ STR_INDUSTRY_CARGOES_INDUSTRY_TOOLTIP :{BLACK}Klik op STR_INDUSTRY_CARGOES_CARGO_TOOLTIP :{BLACK}{STRING}{}Klik op de vracht om de leveranciers en klanten te zien STR_INDUSTRY_DISPLAY_CHAIN :{BLACK}Keten weergeven STR_INDUSTRY_DISPLAY_CHAIN_TOOLTIP :{BLACK}Industrieën weergeven die vracht leveren en accepteren -STR_INDUSTRY_CARGOES_NOTIFY_SMALLMAP :{BLACK}Link naar de kleine kaart +STR_INDUSTRY_CARGOES_NOTIFY_SMALLMAP :{BLACK}Koppeling naar de kleine kaart STR_INDUSTRY_CARGOES_NOTIFY_SMALLMAP_TOOLTIP :{BLACK}Weergegeven industrieën ook op de kleine kaart selecteren STR_INDUSTRY_CARGOES_SELECT_CARGO :{BLACK}Vracht selecteren STR_INDUSTRY_CARGOES_SELECT_CARGO_TOOLTIP :{BLACK}Vracht selecteren voor weergeven @@ -2760,7 +2760,7 @@ STR_FRAMETIME_CAPTION_GL_ROADVEHS :Wegvoertuigtikk STR_FRAMETIME_CAPTION_GL_SHIPS :Scheepstikken STR_FRAMETIME_CAPTION_GL_AIRCRAFT :Vliegtuigtikken STR_FRAMETIME_CAPTION_GL_LANDSCAPE :Wereldtikken -STR_FRAMETIME_CAPTION_GL_LINKGRAPH :Link grafiekvertraging +STR_FRAMETIME_CAPTION_GL_LINKGRAPH :Vertraging koppelinggrafiek STR_FRAMETIME_CAPTION_DRAWING :Grafische elementen realiseren STR_FRAMETIME_CAPTION_DRAWING_VIEWPORTS :Wereldkijkvenster weergeven STR_FRAMETIME_CAPTION_VIDEO :Video-output @@ -3516,7 +3516,7 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_TOOLTIP :{BLACK}Hiermee STR_BUY_VEHICLE_SHIP_RENAME_TOOLTIP :{BLACK}Hernoem type schip STR_BUY_VEHICLE_AIRCRAFT_RENAME_TOOLTIP :{BLACK}Hiermee hernoem je dit type vliegtuig -STR_BUY_VEHICLE_TRAIN_HIDE_TOGGLE_BUTTON :{BLACK}Verberg +STR_BUY_VEHICLE_TRAIN_HIDE_TOGGLE_BUTTON :{BLACK}Verbergen STR_BUY_VEHICLE_ROAD_VEHICLE_HIDE_TOGGLE_BUTTON :{BLACK}Verbergen STR_BUY_VEHICLE_SHIP_HIDE_TOGGLE_BUTTON :{BLACK}Verbergen STR_BUY_VEHICLE_AIRCRAFT_HIDE_TOGGLE_BUTTON :{BLACK}Verbergen diff --git a/src/lang/russian.txt b/src/lang/russian.txt index e6b7237b33..5106114e39 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -2291,7 +2291,7 @@ STR_NETWORK_CHAT_ALL :[Всем] {STR STR_NETWORK_CHAT_OSKTITLE :{BLACK}Введите текст для сетевого сообщения # Network messages -STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Не найдены сетевые устройства или игра скомпилирована без поддержки сети +STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Не найдены сетевые устройства STR_NETWORK_ERROR_NOSERVER :{WHITE}Не найдены сетевые игры STR_NETWORK_ERROR_NOCONNECTION :{WHITE}Сервер не ответил на запрос STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Невозможно присоединиться из-за несоответствия NewGRF From 1585c12bb9b0306739320e70513195d11206da2c Mon Sep 17 00:00:00 2001 From: peter1138 Date: Thu, 21 Mar 2019 18:03:39 +0000 Subject: [PATCH 20/82] Fix 4da83d2f66: Remove measurement tooltips when completed. --- src/viewport.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/viewport.cpp b/src/viewport.cpp index 729dfca7b3..2cb3baa576 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -2514,7 +2514,7 @@ static inline void ShowMeasurementTooltips(StringID str, uint paramcount, const GuiShowTooltips(_thd.GetCallbackWnd(), str, paramcount, params, close_cond); } -void HideMeasurementTooltips() +static void HideMeasurementTooltips() { DeleteWindowById(WC_TOOLTIPS, 0); } @@ -3192,6 +3192,7 @@ EventState VpHandlePlaceSizingDrag() } SetTileSelectSize(1, 1); + HideMeasurementTooltips(); w->OnPlaceMouseUp(_thd.select_method, _thd.select_proc, _thd.selend, TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y)); return ES_HANDLED; From 2cf7ac2863028181bfdb5e3d63dc1f37bf604e72 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Wed, 20 Mar 2019 22:46:02 +0100 Subject: [PATCH 21/82] Fix #7391, 9b99b95: Don't invalidate go to depot orders of non-aircraft when invalidating hangar orders that happen to share IDs. This was caused because hangars are referred to by station ID, which is not unique with respect to depot IDs. --- src/order_backup.cpp | 1 + src/order_cmd.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/order_backup.cpp b/src/order_backup.cpp index 1d490e7264..38c4c8e676 100644 --- a/src/order_backup.cpp +++ b/src/order_backup.cpp @@ -263,6 +263,7 @@ CommandCost CmdClearOrderBackup(TileIndex tile, DoCommandFlag flags, uint32 p1, for (Order *order = ob->orders; order != NULL; order = order->next) { OrderType ot = order->GetType(); if (ot == OT_GOTO_DEPOT && (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) != 0) continue; + if (ot == OT_GOTO_DEPOT && hangar && !IsHangarTile(ob->tile)) continue; // Not an aircraft? Can't have a hangar order. if (ot == OT_IMPLICIT || (IsHangarTile(ob->tile) && ot == OT_GOTO_DEPOT && !hangar)) ot = OT_GOTO_STATION; if (ot == type && order->GetDestination() == destination) { /* Remove the order backup! If a station/depot gets removed, we can't/shouldn't restore those broken orders. */ diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 007cfa5ec0..dae6e58ad6 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -1851,7 +1851,7 @@ void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination, bool order = &v->current_order; if ((v->type == VEH_AIRCRAFT && order->IsType(OT_GOTO_DEPOT) && !hangar ? OT_GOTO_STATION : order->GetType()) == type && - v->current_order.GetDestination() == destination) { + (!hangar || v->type == VEH_AIRCRAFT) && v->current_order.GetDestination() == destination) { order->MakeDummy(); SetWindowDirty(WC_VEHICLE_VIEW, v->index); } @@ -1864,6 +1864,7 @@ restart: OrderType ot = order->GetType(); if (ot == OT_GOTO_DEPOT && (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) != 0) continue; + if (ot == OT_GOTO_DEPOT && hangar && v->type != VEH_AIRCRAFT) continue; // Not an aircraft? Can't have a hangar order. if (ot == OT_IMPLICIT || (v->type == VEH_AIRCRAFT && ot == OT_GOTO_DEPOT && !hangar)) ot = OT_GOTO_STATION; if (ot == type && order->GetDestination() == destination) { /* We want to clear implicit orders, but we don't want to make them From 054d05b1328e2c733d3910c9d55de724b61995dc Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Mon, 18 Mar 2019 01:47:11 +0000 Subject: [PATCH 22/82] Codechange: NewGRF features are documented in hex, so display as hex. --- src/newgrf.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 13d1377d07..75cc4b6354 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -2103,7 +2103,7 @@ static ChangeInfoResult CanalChangeInfo(uint id, int numinfo, int prop, ByteRead ChangeInfoResult ret = CIR_SUCCESS; if (id + numinfo > CF_END) { - grfmsg(1, "CanalChangeInfo: Canal feature %u is invalid, max %u, ignoring", id + numinfo, CF_END); + grfmsg(1, "CanalChangeInfo: Canal feature 0x%02X is invalid, max %u, ignoring", id + numinfo, CF_END); return CIR_INVALID_ID; } @@ -4530,11 +4530,11 @@ static void FeatureChangeInfo(ByteReader *buf) uint numinfo = buf->ReadByte(); uint engine = buf->ReadExtendedByte(); - grfmsg(6, "FeatureChangeInfo: feature %d, %d properties, to apply to %d+%d", + grfmsg(6, "FeatureChangeInfo: Feature 0x%02X, %d properties, to apply to %d+%d", feature, numprops, engine, numinfo); if (feature >= lengthof(handler) || handler[feature] == NULL) { - if (feature != GSF_CARGOES) grfmsg(1, "FeatureChangeInfo: Unsupported feature %d, skipping", feature); + if (feature != GSF_CARGOES) grfmsg(1, "FeatureChangeInfo: Unsupported feature 0x%02X, skipping", feature); return; } @@ -4651,7 +4651,7 @@ static void NewSpriteSet(ByteReader *buf) _cur.AddSpriteSets(feature, _cur.spriteid, first_set, num_sets, num_ents); - grfmsg(7, "New sprite set at %d of type %d, consisting of %d sets with %d views each (total %d)", + grfmsg(7, "New sprite set at %d of feature 0x%02X, consisting of %d sets with %d views each (total %d)", _cur.spriteid, feature, num_sets, num_ents, num_sets * num_ents ); @@ -5046,7 +5046,7 @@ static void NewSpriteGroup(ByteReader *buf) } /* Loading of Tile Layout and Production Callback groups would happen here */ - default: grfmsg(1, "NewSpriteGroup: Unsupported feature %d, skipping", feature); + default: grfmsg(1, "NewSpriteGroup: Unsupported feature 0x%02X, skipping", feature); } } } @@ -5580,7 +5580,7 @@ static void FeatureMapSpriteGroup(ByteReader *buf) uint16 groupid = buf->ReadWord(); if (!IsValidGroupID(groupid, "FeatureMapSpriteGroup")) return; - grfmsg(6, "FeatureMapSpriteGroup: Adding generic feature callback for feature %d", feature); + grfmsg(6, "FeatureMapSpriteGroup: Adding generic feature callback for feature 0x%02X", feature); AddGenericCallback(feature, _cur.grffile, _cur.spritegroups[groupid]); return; @@ -5589,7 +5589,7 @@ static void FeatureMapSpriteGroup(ByteReader *buf) /* Mark the feature as used by the grf (generic callbacks do not count) */ SetBit(_cur.grffile->grf_features, feature); - grfmsg(6, "FeatureMapSpriteGroup: Feature %d, %d ids", feature, idcount); + grfmsg(6, "FeatureMapSpriteGroup: Feature 0x%02X, %d ids", feature, idcount); switch (feature) { case GSF_TRAINS: @@ -5640,7 +5640,7 @@ static void FeatureMapSpriteGroup(ByteReader *buf) return; default: - grfmsg(1, "FeatureMapSpriteGroup: Unsupported feature %d, skipping", feature); + grfmsg(1, "FeatureMapSpriteGroup: Unsupported feature 0x%02X, skipping", feature); return; } } @@ -5683,7 +5683,7 @@ static void FeatureNewName(ByteReader *buf) uint16 endid = id + num; - grfmsg(6, "FeatureNewName: About to rename engines %d..%d (feature %d) in language 0x%02X", + grfmsg(6, "FeatureNewName: About to rename engines %d..%d (feature 0x%02X) in language 0x%02X", id, endid, feature, lang); for (; id < endid && buf->HasData(); id++) { From 3357cac847ac7637c3a27f1e399cba78ff304829 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Mon, 18 Mar 2019 02:05:06 +0000 Subject: [PATCH 23/82] Fix: Bounds check NewGRF feature. --- src/newgrf.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 75cc4b6354..2fc546d4eb 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -4530,6 +4530,11 @@ static void FeatureChangeInfo(ByteReader *buf) uint numinfo = buf->ReadByte(); uint engine = buf->ReadExtendedByte(); + if (feature >= GSF_END) { + grfmsg(1, "FeatureChangeInfo: Unsupported feature 0x%02X, skipping", feature); + return; + } + grfmsg(6, "FeatureChangeInfo: Feature 0x%02X, %d properties, to apply to %d+%d", feature, numprops, engine, numinfo); @@ -4649,6 +4654,12 @@ static void NewSpriteSet(ByteReader *buf) } uint16 num_ents = buf->ReadExtendedByte(); + if (feature >= GSF_END) { + _cur.skip_sprites = num_sets * num_ents; + grfmsg(1, "NewSpriteSet: Unsupported feature 0x%02X, skipping %d sprites", feature, _cur.skip_sprites); + return; + } + _cur.AddSpriteSets(feature, _cur.spriteid, first_set, num_sets, num_ents); grfmsg(7, "New sprite set at %d of feature 0x%02X, consisting of %d sets with %d views each (total %d)", @@ -4743,6 +4754,11 @@ static void NewSpriteGroup(ByteReader *buf) SpriteGroup *act_group = NULL; uint8 feature = buf->ReadByte(); + if (feature >= GSF_END) { + grfmsg(1, "NewSpriteGroup: Unsupported feature 0x%02X, skipping", feature); + return; + } + uint8 setid = buf->ReadByte(); uint8 type = buf->ReadByte(); @@ -5573,6 +5589,11 @@ static void FeatureMapSpriteGroup(ByteReader *buf) uint8 feature = buf->ReadByte(); uint8 idcount = buf->ReadByte(); + if (feature >= GSF_END) { + grfmsg(1, "FeatureMapSpriteGroup: Unsupported feature 0x%02X, skipping", feature); + return; + } + /* If idcount is zero, this is a feature callback */ if (idcount == 0) { /* Skip number of cargo ids? */ @@ -5667,6 +5688,11 @@ static void FeatureNewName(ByteReader *buf) bool new_scheme = _cur.grffile->grf_version >= 7; uint8 feature = buf->ReadByte(); + if (feature >= GSF_END) { + grfmsg(1, "FeatureNewName: Unsupported feature 0x%02X, skipping", feature); + return; + } + uint8 lang = buf->ReadByte(); uint8 num = buf->ReadByte(); bool generic = HasBit(lang, 7); From d7553759661e5c32937ae37b19f0aae1652cb2d7 Mon Sep 17 00:00:00 2001 From: translators Date: Fri, 22 Mar 2019 19:45:43 +0100 Subject: [PATCH 24/82] Update: Translations from eints luxembourgish: 31 changes by Phreeze croatian: 2 changes by VoyagerOne --- src/lang/croatian.txt | 3 ++- src/lang/luxembourgish.txt | 32 +++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/lang/croatian.txt b/src/lang/croatian.txt index 8bc45b1699..831b159fd5 100644 --- a/src/lang/croatian.txt +++ b/src/lang/croatian.txt @@ -2235,7 +2235,7 @@ STR_NETWORK_CHAT_ALL :[Svima] {STRING STR_NETWORK_CHAT_OSKTITLE :{BLACK}Upišite tekst mrežnog razgovora # Network messages -STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Nisu pronađeni mrežni uređaji ili je kompajlirano bez opcije ENABLE_NETWORK +STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Nisu pronađeni mrežni uređaji STR_NETWORK_ERROR_NOSERVER :{WHITE}Niti jedna mrežna igra nije pronađena STR_NETWORK_ERROR_NOCONNECTION :{WHITE}Poslužitelj nije odgovorio na zahtjev STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Spajanje nije moguće zbog razlike u NewGRF datotekama @@ -3128,6 +3128,7 @@ STR_NEWGRF_BUGGY :{WHITE}NewGRF ' STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Informacija o teretu/remontu za '{1:ENGINE}' je različita od kupovne liste nakon izgradnje. Zbog toga bi automatsko obnavljanje/zamjena mogla biti neuspješna STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK :{G=male}{WHITE}'{1:STRING}' je uzrokovao beskonačnu petlju u pozivu za povrat produkcije STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}Povratnica {1:HEX} je vratio nepoznat/nemoguć rezultat {2:HEX} +STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' callback funkcija za proizvodnju je vratila nevažeći teret na {2:HEX} # 'User removed essential NewGRFs'-placeholders for stuff without specs STR_NEWGRF_INVALID_CARGO : diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt index bfebe82f87..4f2d85377f 100644 --- a/src/lang/luxembourgish.txt +++ b/src/lang/luxembourgish.txt @@ -189,6 +189,7 @@ STR_COLOUR_ORANGE :Orange STR_COLOUR_BROWN :Brong STR_COLOUR_GREY :Gro STR_COLOUR_WHITE :Wäiss +STR_COLOUR_RANDOM :Zoufälleg # Units used in OpenTTD STR_UNITS_VELOCITY_IMPERIAL :{COMMA}{NBSP}mph @@ -475,6 +476,7 @@ STR_ABOUT_MENU_SCREENSHOT :Screenshot (Ctr STR_ABOUT_MENU_ZOOMIN_SCREENSHOT :Voll eragezoomte Screenshot STR_ABOUT_MENU_DEFAULTZOOM_SCREENSHOT :Standard Zoom Screenshot STR_ABOUT_MENU_GIANT_SCREENSHOT :Screenshot vun der ganzer Kaart +STR_ABOUT_MENU_SHOW_FRAMERATE :Biller pro Sekonn uweisen STR_ABOUT_MENU_ABOUT_OPENTTD :Iwwert 'OpenTTD' STR_ABOUT_MENU_SPRITE_ALIGNER :Sprite Alignéirer STR_ABOUT_MENU_TOGGLE_BOUNDING_BOXES :Zeechen-Boxen un/aus @@ -650,6 +652,7 @@ STR_MUSIC_RULER_MARKER :{TINY_FONT}{BLA STR_MUSIC_TRACK_NONE :{TINY_FONT}{DKGREEN}-- STR_MUSIC_TRACK_DIGIT :{TINY_FONT}{DKGREEN}{ZEROFILL_NUM} STR_MUSIC_TITLE_NONE :{TINY_FONT}{DKGREEN}------ +STR_MUSIC_TITLE_NOMUSIC :{TINY_FONT}{DKGREEN}Keng Musik verfügbar STR_MUSIC_TITLE_NAME :{TINY_FONT}{DKGREEN}"{STRING}" STR_MUSIC_TRACK :{TINY_FONT}{BLACK}Nummer STR_MUSIC_XTITLE :{TINY_FONT}{BLACK}Titel @@ -674,7 +677,9 @@ STR_PLAYLIST_TRACK_NAME :{TINY_FONT}{LTB STR_PLAYLIST_TRACK_INDEX :{TINY_FONT}{BLACK}Lidder Index STR_PLAYLIST_PROGRAM :{TINY_FONT}{BLACK}Programm - '{STRING}' STR_PLAYLIST_CLEAR :{TINY_FONT}{BLACK}Läschen +STR_PLAYLIST_CHANGE_SET :{BLACK}Set wiesselen STR_PLAYLIST_TOOLTIP_CLEAR_CURRENT_PROGRAM_CUSTOM1 :{BLACK}De gewielte Program reseten (nëmmen Benotzerdéf.1 oder Benotzerdéf.2) +STR_PLAYLIST_TOOLTIP_CHANGE_SET :{BLACK}Wiessel d'Musikselektioun op en anert installéiert Set STR_PLAYLIST_TOOLTIP_CLICK_TO_ADD_TRACK :{BLACK}Klick op d'Lidd fir et zum aktuellen Program dobäi zesetzen (nëmme Benotzerdéf.1 oder Benotzerdéf.2) STR_PLAYLIST_TOOLTIP_CLICK_TO_REMOVE_TRACK :{BLACK}Klick op d'Lidd fir et vum aktuellen Programm ze läschen (Benotzerdefinéiert 1 an 2 nëmmen) @@ -810,6 +815,7 @@ STR_NEWS_MERGER_TAKEOVER_TITLE :{BIG_FONT}{BLAC STR_PRESIDENT_NAME_MANAGER :{BLACK}{PRESIDENT_NAME}{}(Manager) STR_NEWS_NEW_TOWN :{BLACK}{BIG_FONT}{STRING} huet Kontruktioun vun der Stad {TOWN} gesponsort! +STR_NEWS_NEW_TOWN_UNSPONSORED :{BLACK}{BIG_FONT}En neit Duerf mam Numm {TOWN} gouf gegrënnt! STR_NEWS_INDUSTRY_CONSTRUCTION :{BIG_FONT}{BLACK}{STRING} gëtt bei {TOWN} gebaut! STR_NEWS_INDUSTRY_PLANTED :{BIG_FONT}{BLACK}{STRING} gëtt bei {TOWN} geplanzt! @@ -985,6 +991,8 @@ STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Duebel STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Véierfach +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Véierfach STR_GAME_OPTIONS_BASE_GRF :{BLACK}Basis Grafikset STR_GAME_OPTIONS_BASE_GRF_TOOLTIP :{BLACK}Wielt de Basis Grafikset dee soll benotzt ginn @@ -1168,6 +1176,7 @@ STR_CONFIG_SETTING_AUTOSLOPE :Erlaabt Landfor STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :Erlaabt Terraintransformatioun ënnert Gebaier an Schinnen ouni dës ewechzehuelen STR_CONFIG_SETTING_CATCHMENT :Erlaabt méi realistësch Einzugsberäicher: {STRING} STR_CONFIG_SETTING_CATCHMENT_HELPTEXT :Statiounen a Fluchhäfen hunn verschidde grouss Einzugsberäicher +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES :Gare vun der Firma kënnen Industrie beliwwere mat neutrale Statiounen: {STRING} STR_CONFIG_SETTING_EXTRADYNAMITE :Erlaabt d'Ewechhuelen vu méi Stroossen, Brécken, etc. vun der Stad: {STRING} STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT :Mach et méi einfach fir Infrastruktur oder Gebaier ewechzehuelen déi enger Stad gehéiren STR_CONFIG_SETTING_TRAIN_LENGTH :Maximal Längt vun Zich: {STRING} @@ -1337,6 +1346,7 @@ STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_HELPTEXT :Faarf vum Terra STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_GREEN :Gréng STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_DARK_GREEN :Donkelgréng STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_VIOLET :Mof +STR_CONFIG_SETTING_SCROLLMODE_LMB :Kaart mat der lénker Maustast bewegen STR_CONFIG_SETTING_SMOOTH_SCROLLING :Feine Scrolling: {STRING} STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :Kontrolléiert wéi d'Haptusiicht op eng bestëmmten Positioun scrollt, wann een op déi kléng Kaart klickt oder en Befehl fir ob en spezifescht Objet ze scrollen gëtt. Wann ugeschalt, gëtt bis dohin gescrollt, wann ausgeschalt, spréngt d'Vue op den Zielobjet STR_CONFIG_SETTING_MEASURE_TOOLTIP :Weis en Mooss-Tooltip wann verschidde Bau-Tools benotzt ginn: {STRING} @@ -1559,6 +1569,8 @@ STR_CONFIG_SETTING_TOWN_FOUNDING_HELPTEXT :Wann dës Astel STR_CONFIG_SETTING_TOWN_FOUNDING_FORBIDDEN :Verbueden STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED :Erlaabt STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED_CUSTOM_LAYOUT :Erlaabt, custom Stad-Layout +STR_CONFIG_SETTING_TOWN_CARGOGENMODE :Duerfwuerengeneratioun: {STRING} +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_BITCOUNT :Linear STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT :Bamplazéirung: {STRING} STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_HELPTEXT :Kontrolléiert zoufälleg Optauche vu Beem während dem Spill. Dëst kann Industrie beaflossen, déi op d'Wuessen vu Beem ugewisen sinn @@ -1579,7 +1591,7 @@ STR_CONFIG_SETTING_SOFT_LIMIT_HELPTEXT :Unzuel un net-g STR_CONFIG_SETTING_SOFT_LIMIT_VALUE :{COMMA} STR_CONFIG_SETTING_SOFT_LIMIT_DISABLED :ausgeschalt STR_CONFIG_SETTING_ZOOM_MIN :Maximalen Ranzoom Level: {STRING} -STR_CONFIG_SETTING_ZOOM_MIN_HELPTEXT :Maximal Ranzoomstuf fir Usiichtsfënsteren. Et gëtt méi Späicher gebraucht wann d'Stufen ze grouss ginn +STR_CONFIG_SETTING_ZOOM_MIN_HELPTEXT :Maximal Razoomstuf fir Usiichtsfënsteren. Et gëtt méi Späicher gebraucht wann d'Stufen ze grouss ginn STR_CONFIG_SETTING_ZOOM_MAX :Maximalen Rauszoom Level: {STRING} STR_CONFIG_SETTING_ZOOM_MAX_HELPTEXT :Maximal Rauszoom-Stuf fir Usiichtsfënsteren. Méi grouss Rauszoom-Stufen kënnen Ruckeler verursaachen STR_CONFIG_SETTING_ZOOM_LVL_MIN :4x @@ -1800,6 +1812,7 @@ STR_CHEAT_CHANGE_DATE_QUERY_CAPT :{WHITE}Wiessel STR_CHEAT_SETUP_PROD :{LTBLUE}Erlaabt d'ännere vun de Produktiounswäerter: {ORANGE}{STRING} # Livery window +STR_LIVERY_CAPTION :{WHITE}{COMPANY} - Neie Faarfschema STR_LIVERY_GENERAL_TOOLTIP :{BLACK}Weis generell Faarfschemen STR_LIVERY_TRAIN_TOOLTIP :{BLACK}Weis Zuch Faarfschemen @@ -2683,9 +2696,21 @@ STR_ABOUT_VERSION :{BLACK}OpenTTD STR_ABOUT_COPYRIGHT_OPENTTD :{BLACK}OpenTTD {COPYRIGHT} 2002-2019 D'OpenTTD team # Framerate display window +STR_FRAMERATE_AVERAGE :{WHITE}Mëttel +STR_FRAMERATE_MS_GOOD :{LTBLUE}{DECIMAL} ms +STR_FRAMERATE_MS_WARN :{YELLOW}{DECIMAL} ms +STR_FRAMERATE_FPS_GOOD :{LTBLUE}{DECIMAL} Biller/s +STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL} Biller/s +STR_FRAMERATE_GRAPH_SECONDS :{TINY_FONT}{COMMA} s ############ Leave those lines in this order!! +STR_FRAMERATE_GL_ROADVEHS :{BLACK} Stroossegefierer Ticken: +STR_FRAMERATE_DRAWING :{BLACK}Graphikrendering: +STR_FRAMERATE_VIDEO :{BLACK}Video-output: ############ End of leave-in-this-order ############ Leave those lines in this order!! +STR_FRAMETIME_CAPTION_GL_ROADVEHS :Stroossegefierer Ticken +STR_FRAMETIME_CAPTION_GL_SHIPS :Schëffticker +STR_FRAMETIME_CAPTION_SOUND :Soundmixing ############ End of leave-in-this-order @@ -2828,6 +2853,7 @@ STR_NEWGRF_SETTINGS_VERSION :{BLACK}Versioun STR_NEWGRF_SETTINGS_MIN_VERSION :{BLACK}Min. kompatibel Versioun: {SILVER}{NUM} STR_NEWGRF_SETTINGS_MD5SUM :{BLACK}MD5sum: {SILVER}{STRING} STR_NEWGRF_SETTINGS_PALETTE :{BLACK}Palette: {SILVER}{STRING} +STR_NEWGRF_SETTINGS_PALETTE_LEGACY :Legacy (W) STR_NEWGRF_SETTINGS_PARAMETER :{BLACK}Parameter: {SILVER}{STRING} STR_NEWGRF_SETTINGS_NO_INFO :{BLACK}Keng Info verfügbar @@ -2909,6 +2935,7 @@ STR_NEWGRF_ERROR_READ_BOUNDS :Lanscht d'Enn v STR_NEWGRF_ERROR_GRM_FAILED :Ugefroten GRF Ressource net verfügbar (sprite {3:NUM}) STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} gouf ausgeschalt vun {STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Invalid/onbekannten Sprite Layout Format (Sprite {3:NUM}) +STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Zevill Elementer an der Eegeschaftewert-Lëscht (Sprite {3:NUM}, Eegeschaft {4:HEX}) # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Opgepasst! @@ -3341,6 +3368,7 @@ STR_GROUPS_CLICK_ON_GROUP_FOR_TOOLTIP :{BLACK}Gruppen STR_GROUP_CREATE_TOOLTIP :{BLACK}Klick fir eng Grupp ze maachen STR_GROUP_DELETE_TOOLTIP :{BLACK}Déi ungewielte Grupp läschen STR_GROUP_RENAME_TOOLTIP :{BLACK}Déi ungewielte Grupp ëmbenennen +STR_GROUP_LIVERY_TOOLTIP :{BLACK}Wiessel d'Faarwschema vun dem ausgewielte Grupp STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Klick fir déi Grupp vum globalen "Autoersetzen" auszeschléissen STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}Grupp läschen @@ -4215,6 +4243,7 @@ STR_ERROR_DRIVE_THROUGH_ON_TOWN_ROAD :{WHITE}... d'St STR_ERROR_DRIVE_THROUGH_DIRECTION :{WHITE}... Strooss geet an dei falsch Richtung STR_ERROR_DRIVE_THROUGH_CORNER :{WHITE}... Duerchfahrtstops kënnen keng Kéiren hunn STR_ERROR_DRIVE_THROUGH_JUNCTION :{WHITE}... Duerchfahrtstops kënnen keng Kräizungen hunn +STR_ERROR_DRIVE_THROUGH_ON_ONEWAY_ROAD :{WHITE}... Einbahnstrooss oder blockéiert # Station destruction related errors STR_ERROR_CAN_T_REMOVE_PART_OF_STATION :{WHITE}Kann den Deel vun der Gare net ofrappen... @@ -4466,6 +4495,7 @@ STR_BASESOUNDS_DOS_DESCRIPTION :Original Transp STR_BASESOUNDS_WIN_DESCRIPTION :Original Transport Tycoon Deluxe Windows Editioun Sound. STR_BASESOUNDS_NONE_DESCRIPTION :E Soundpack ouni iergendee Sound. STR_BASEMUSIC_WIN_DESCRIPTION :Original Transport Tycoon Deluxe Windows Editioun Musik. +STR_BASEMUSIC_TTO_DESCRIPTION :Original Transport Tycoon (Original/World Editor) DOS Editioun-Musik. STR_BASEMUSIC_NONE_DESCRIPTION :E Musikpack ouni aktuell Musik. ##id 0x2000 From 4feea8db67ca6d50d6bb02718ba38f0081df4649 Mon Sep 17 00:00:00 2001 From: PeterN Date: Sat, 23 Mar 2019 17:59:19 +0000 Subject: [PATCH 25/82] Fix: Filtered file list did not scroll properly. (#7402) --- src/fios_gui.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index fd9e0c06a8..a4eb12e3a2 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -437,12 +437,15 @@ public: GfxFillRect(r.left + 1, r.top + 1, r.right, r.bottom, PC_BLACK); uint y = r.top + WD_FRAMERECT_TOP; - for (uint pos = this->vscroll->GetPosition(); pos < this->fios_items.Length(); pos++) { - if (!this->fios_items_shown[pos]) { + uint scroll_pos = this->vscroll->GetPosition(); + for (uint row = 0; row < this->fios_items.Length(); row++) { + if (!this->fios_items_shown[row]) { /* The current item is filtered out : we do not show it */ + scroll_pos++; continue; } - const FiosItem *item = this->fios_items.Get(pos); + if (row < scroll_pos) continue; + const FiosItem *item = this->fios_items.Get(row); if (item == this->selected) { GfxFillRect(r.left + 1, y, r.right, y + this->resize.step_height, PC_DARK_BLUE); From 685f822c63d642372157895f3975c5ac25546c40 Mon Sep 17 00:00:00 2001 From: translators Date: Sat, 23 Mar 2019 19:45:42 +0100 Subject: [PATCH 26/82] Update: Translations from eints finnish: 13 changes by hpiirai danish: 2 changes by nielsmh --- src/lang/danish.txt | 3 ++- src/lang/finnish.txt | 25 +++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/lang/danish.txt b/src/lang/danish.txt index 5adbdff762..c9ed344aa3 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -2139,7 +2139,7 @@ STR_NETWORK_CHAT_ALL :[Alle] {STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Skriv tekst i netværks-chat # Network messages -STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Ingen netværksheder fundet eller kompilet uden ENABLE_NETWORK +STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Ingen netværksheder fundet STR_NETWORK_ERROR_NOSERVER :{WHITE}Kunne ikke finde nogen netværksspil STR_NETWORK_ERROR_NOCONNECTION :{WHITE}Serveren besvarede ikke denne forspørgsel STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Kunne ikke tilslutte grundet NewGRF ulighed @@ -3032,6 +3032,7 @@ STR_NEWGRF_BUGGY :{WHITE}NewGRF ' STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Fragt-/ombygningsinformation for '{1:ENGINE}' afviger fra indkøbslisten efter konstruktion. Dette kan medføre, at autofornyelse ikke fungerer korrekt. STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' forårsagede en uendelig løkke i produktions-callback'en. STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}Callback {1:HEX} returnerede ukendt/ugyldigt resultat {2:HEX} +STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' returnerede ugyldig godstype i produktion-callback ved {2:HEX} # 'User removed essential NewGRFs'-placeholders for stuff without specs STR_NEWGRF_INVALID_CARGO : diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index 3cdf100dd9..4dd1efa4ae 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -785,12 +785,12 @@ STR_NEWS_MESSAGE_CAPTION :{WHITE}Viesti STR_NEWS_CUSTOM_ITEM :{BIG_FONT}{BLACK}{STRING} STR_NEWS_FIRST_TRAIN_ARRIVAL :{BIG_FONT}{BLACK}Asukkaat juhlivat . . .{}Ensimmäinen juna saapuu asemalle {STATION}! -STR_NEWS_FIRST_BUS_ARRIVAL :{BIG_FONT}{BLACK}Kaupunkilaiset juhlivat . . .{}{STATION} vastaanottaa ensimmäisen linja-auton! -STR_NEWS_FIRST_TRUCK_ARRIVAL :{BIG_FONT}{BLACK}Kaupunkilaiset juhlivat . . .{}{STATION} vastaanottaa ensimmäisen kuorma-auton! -STR_NEWS_FIRST_PASSENGER_TRAM_ARRIVAL :{BIG_FONT}{BLACK}Kaupunkilaiset juhlivat . . .{}{STATION} vastaanottaa ensimmäisen raitiovaunun! -STR_NEWS_FIRST_CARGO_TRAM_ARRIVAL :{BIG_FONT}{BLACK}Kaupunkilaiset juhlivat . . .{}{STATION} vastaanottaa ensimmäisen rahtiraitiovaunun! -STR_NEWS_FIRST_SHIP_ARRIVAL :{BIG_FONT}{BLACK}Kaupunkilaiset juhlivat . . .{}{STATION} vastaanottaa ensimmäisen laivan! -STR_NEWS_FIRST_AIRCRAFT_ARRIVAL :{BIG_FONT}{BLACK}Kaupunkilaiset juhlivat . . .{}{STATION} vastaanottaa ensimmäisen lentokoneen! +STR_NEWS_FIRST_BUS_ARRIVAL :{BIG_FONT}{BLACK}Asukkaat juhlivat . . .{}{STATION} vastaanottaa ensimmäisen linja-auton! +STR_NEWS_FIRST_TRUCK_ARRIVAL :{BIG_FONT}{BLACK}Asukkaat juhlivat . . .{}{STATION} vastaanottaa ensimmäisen kuorma-auton! +STR_NEWS_FIRST_PASSENGER_TRAM_ARRIVAL :{BIG_FONT}{BLACK}Asukkaat juhlivat . . .{}{STATION} vastaanottaa ensimmäisen raitiovaunun! +STR_NEWS_FIRST_CARGO_TRAM_ARRIVAL :{BIG_FONT}{BLACK}Asukkaat juhlivat . . .{}{STATION} vastaanottaa ensimmäisen rahtiraitiovaunun! +STR_NEWS_FIRST_SHIP_ARRIVAL :{BIG_FONT}{BLACK}Asukkaat juhlivat . . .{}{STATION} vastaanottaa ensimmäisen laivan! +STR_NEWS_FIRST_AIRCRAFT_ARRIVAL :{BIG_FONT}{BLACK}Asukkaat juhlivat . . .{}{STATION} vastaanottaa ensimmäisen lentokoneen! STR_NEWS_TRAIN_CRASH :{BIG_FONT}{BLACK}Junaonnettomuus!{}{COMMA} kuolee törmäyksen jälkeisessä tulipallossa. STR_NEWS_ROAD_VEHICLE_CRASH_DRIVER :{BIG_FONT}{BLACK}Tasoristeysturma!{}Kuljettaja kuolee junan ja auton törmäyksen jälkeisessä tulipallossa @@ -1626,7 +1626,7 @@ STR_CONFIG_SETTING_TOWN_GROWTH_NORMAL :Tavallinen STR_CONFIG_SETTING_TOWN_GROWTH_FAST :Nopea STR_CONFIG_SETTING_TOWN_GROWTH_VERY_FAST :Erittäin nopea STR_CONFIG_SETTING_LARGER_TOWNS :Kaupunkien osuus: {STRING} -STR_CONFIG_SETTING_LARGER_TOWNS_HELPTEXT :Suurkaupungiksi muuttuvien kaupunkien määrä, eli suurempana aloittavat ja nopeammin kasvavat kaupungit +STR_CONFIG_SETTING_LARGER_TOWNS_HELPTEXT :Kaupunkien määrä: kaupungit ovat isompia jo alussa ja kasvavat nopeammin kuin muut kunnat STR_CONFIG_SETTING_LARGER_TOWNS_VALUE :1 / {COMMA} STR_CONFIG_SETTING_LARGER_TOWNS_DISABLED :Ei yhtään STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER :Kasvukerroin alussa: {STRING} @@ -2139,7 +2139,7 @@ STR_NETWORK_CHAT_ALL :[Kaikki] {STRIN STR_NETWORK_CHAT_OSKTITLE :{BLACK}Syötä teksti verkkokeskustelua varten # Network messages -STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Verkkolaitteita ei löytynyt tai käännetty ilman ENABLE_NETWORK-valintaa +STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Verkkolaitteita ei löytynyt STR_NETWORK_ERROR_NOSERVER :{WHITE}Verkkopelejä ei löytynyt STR_NETWORK_ERROR_NOCONNECTION :{WHITE}Palvelin ei vastannut pyyntöön STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Yhteyden muodostaminen epäonnistui NewGRF-virheen vuoksi @@ -2536,7 +2536,7 @@ STR_RESET_LANDSCAPE_CONFIRMATION_TEXT :{WHITE}Haluatko # Town generation window (SE) STR_FOUND_TOWN_CAPTION :{WHITE}Luo kuntia STR_FOUND_TOWN_NEW_TOWN_BUTTON :{BLACK}Uusi kunta -STR_FOUND_TOWN_NEW_TOWN_TOOLTIP :{BLACK}Perusta uusi kaupunki. Shift+Klik näyttää vain kustannusarvion +STR_FOUND_TOWN_NEW_TOWN_TOOLTIP :{BLACK}Perusta uusi kunta. Shift+Klik näyttää vain kustannusarvion STR_FOUND_TOWN_RANDOM_TOWN_BUTTON :{BLACK}Satunnainen kunta STR_FOUND_TOWN_RANDOM_TOWN_TOOLTIP :{BLACK}Perusta kunta satunnaiseen paikkaan STR_FOUND_TOWN_MANY_RANDOM_TOWNS :{BLACK}Monta satunnaista kuntaa @@ -2544,7 +2544,7 @@ STR_FOUND_TOWN_RANDOM_TOWNS_TOOLTIP :{BLACK}Täytä STR_FOUND_TOWN_NAME_TITLE :{YELLOW}Kunnan nimi: STR_FOUND_TOWN_NAME_EDITOR_TITLE :{BLACK}Syötä kunnan nimi -STR_FOUND_TOWN_NAME_EDITOR_HELP :{BLACK}Syötä kaupungin nimi napsauttamalla +STR_FOUND_TOWN_NAME_EDITOR_HELP :{BLACK}Syötä kunnan nimi napsauttamalla STR_FOUND_TOWN_NAME_RANDOM_BUTTON :{BLACK}Satunnainen nimi STR_FOUND_TOWN_NAME_RANDOM_TOOLTIP :{BLACK}Arvo uusi satunnainen nimi @@ -2804,7 +2804,7 @@ STR_MAPGEN_WORLD_GENERATION_CAPTION :{WHITE}Maailman STR_MAPGEN_MAPSIZE :{BLACK}Kartan koko: STR_MAPGEN_MAPSIZE_TOOLTIP :{BLACK}Valitse kartan koko ruutuina. Saatavilla olevien ruutujen määrä on hieman alhaisempi STR_MAPGEN_BY :{BLACK}× -STR_MAPGEN_NUMBER_OF_TOWNS :{BLACK}Kaupunkien määrä: +STR_MAPGEN_NUMBER_OF_TOWNS :{BLACK}Kuntien määrä: STR_MAPGEN_DATE :{BLACK}Päivämäärä: STR_MAPGEN_NUMBER_OF_INDUSTRIES :{BLACK}Teollisuuden määrä: STR_MAPGEN_MAX_HEIGHTLEVEL :{BLACK}Suurin sallittu kartan korkeus: @@ -3032,6 +3032,7 @@ STR_NEWGRF_BUGGY :{WHITE}NewGRF STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Kulkuneuvon ”{1:ENGINE}” rahti-/uudelleensovitustiedot ovat toiset kuin ostolistassa rakentamisen jälkeen. Tämä voi johtaa uudelleensovituksen epäonnistumiseen, kun kulkuneuvo uudistetaan tai korvataan automaattisesti STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK :{WHITE}”{1:STRING}” aiheutti ikuisen silmukan tuotannon takaisinkutsussa STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}Callback-funktio {1:HEX} palautti tuntemattoman/kelvottoman tuloksen {2:HEX} +STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK :{WHITE}”{1:STRING}” palautti virheellisen rahtityypin tuotannon takaisinkutsun kohdassa {2:HEX} # 'User removed essential NewGRFs'-placeholders for stuff without specs STR_NEWGRF_INVALID_CARGO : @@ -3134,7 +3135,7 @@ STR_GOALS_SPECTATOR_NONE :{ORANGE}- Ei sa STR_GOALS_PROGRESS :{ORANGE}{STRING} STR_GOALS_PROGRESS_COMPLETE :{GREEN}{STRING} STR_GOALS_COMPANY_TITLE :{BLACK}Yhtiön tavoitteet: -STR_GOALS_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Keskitä päänäkymä teollisuuteen/kaupunkiin/ruutuun napsauttamalla tavoitetta. Ctrl+Klik avaa uuden näkymän teollisuuden/kaupungin/ruudun sijaintiin +STR_GOALS_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Keskitä päänäkymä laitokseen/kuntaan/ruutuun napsauttamalla tavoitetta. Ctrl+Klik avaa uuden näkymän laitoksen/kunnan/ruudun sijaintiin # Goal question window STR_GOAL_QUESTION_CAPTION_QUESTION :Kysymys From 31260e66252fb4d0dda6f992520faeeb96929cfe Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Sun, 24 Mar 2019 12:35:19 +0000 Subject: [PATCH 27/82] Cleanup: Stop OSX compilation complaining about C++11 extensions --- config.lib | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config.lib b/config.lib index 026f7bfb3c..f65aaa535e 100644 --- a/config.lib +++ b/config.lib @@ -1321,6 +1321,9 @@ make_compiler_cflags() { # it happens when using the FOR_ALL_WINDOWS_FROM_BACK_FROM macro flags="$flags -Wno-self-assign" + # warning: is a C++11 extension + flags="$flags -Wno-c++11-extensions" + if [ "$cc_version" -lt "30" ]; then # warning: equality comparison with extraneous parentheses flags="$flags -Wno-parentheses" From af7d9020a15c1b1a14b3981ac73c70d2e58cc877 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Sun, 3 Mar 2019 22:25:13 +0000 Subject: [PATCH 28/82] Codechange: Use override specifer for overriding member declarations This is a C++11 feature that allows the compiler to check that a virtual member declaration overrides a base-class member with the same signature. Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked as virtual despite being a template. --- src/ai/ai_config.hpp | 12 +-- src/ai/ai_gui.cpp | 2 +- src/ai/ai_instance.hpp | 12 +-- src/ai/ai_scanner.hpp | 24 ++--- src/base_media_base.h | 2 +- src/blitter/32bpp_anim.hpp | 30 +++--- src/blitter/32bpp_anim_sse2.hpp | 6 +- src/blitter/32bpp_anim_sse4.hpp | 10 +- src/blitter/32bpp_base.hpp | 26 ++--- src/blitter/32bpp_optimized.hpp | 8 +- src/blitter/32bpp_simple.hpp | 10 +- src/blitter/32bpp_sse2.hpp | 8 +- src/blitter/32bpp_sse4.hpp | 6 +- src/blitter/32bpp_ssse3.hpp | 6 +- src/blitter/8bpp_base.hpp | 28 ++--- src/blitter/8bpp_optimized.hpp | 8 +- src/blitter/8bpp_simple.hpp | 8 +- src/blitter/null.hpp | 38 +++---- src/fileio_func.h | 2 +- src/fios.cpp | 4 +- src/game/game_config.hpp | 2 +- src/game/game_info.hpp | 2 +- src/game/game_instance.hpp | 12 +-- src/game/game_scanner.hpp | 24 ++--- src/game/game_text.cpp | 4 +- src/goal_gui.cpp | 20 ++-- src/ground_vehicle.hpp | 4 +- src/music/allegro_m.h | 16 +-- src/music/bemidi.h | 16 +-- src/music/cocoa_m.h | 16 +-- src/music/dmusic.h | 16 +-- src/music/extmidi.h | 16 +-- src/music/fluidsynth.h | 16 +-- src/music/null_m.h | 16 +-- src/music/os2_m.h | 16 +-- src/music/qtmidi.h | 16 +-- src/music/win32_m.h | 16 +-- src/network/network_client.cpp | 4 +- src/network/network_content_gui.cpp | 2 +- src/network/network_gui.cpp | 8 +- src/network/network_server.cpp | 4 +- src/newgrf_airport.cpp | 10 +- src/newgrf_airporttiles.h | 6 +- src/newgrf_canal.cpp | 8 +- src/newgrf_cargo.cpp | 2 +- src/newgrf_config.cpp | 2 +- src/newgrf_engine.h | 10 +- src/newgrf_generic.cpp | 6 +- src/newgrf_gui.cpp | 2 +- src/newgrf_house.h | 8 +- src/newgrf_industries.h | 10 +- src/newgrf_industrytiles.h | 8 +- src/newgrf_object.h | 6 +- src/newgrf_railtype.h | 8 +- src/newgrf_station.h | 10 +- src/newgrf_town.h | 2 +- src/os/macosx/crashlog_osx.cpp | 6 +- src/os/unix/crashlog_unix.cpp | 6 +- src/os/windows/crashlog_win.cpp | 12 +-- src/saveload/saveload.cpp | 28 ++--- src/script/api/script_text.hpp | 2 +- src/script/script_scanner.hpp | 2 +- src/settings_gui.cpp | 2 +- src/sound/allegro_s.h | 8 +- src/sound/cocoa_s.h | 8 +- src/sound/null_s.h | 8 +- src/sound/sdl_s.h | 8 +- src/sound/win32_s.h | 8 +- src/sound/xaudio2_s.h | 8 +- src/station_base.h | 12 +-- src/strgen/strgen.cpp | 6 +- src/strings.cpp | 10 +- src/table/newgrf_debug_data.h | 154 ++++++++++++++-------------- src/thread/thread_os2.cpp | 14 +-- src/thread/thread_pthread.cpp | 14 +-- src/thread/thread_win32.cpp | 16 +-- src/toolbar_gui.cpp | 14 +-- src/video/allegro_v.h | 20 ++-- src/video/cocoa/cocoa_v.h | 20 ++-- src/video/dedicated_v.h | 18 ++-- src/video/null_v.h | 18 ++-- src/video/sdl_v.h | 24 ++--- src/video/win32_v.h | 26 ++--- src/waypoint_base.h | 12 +-- src/widget_type.h | 72 ++++++------- 85 files changed, 575 insertions(+), 575 deletions(-) diff --git a/src/ai/ai_config.hpp b/src/ai/ai_config.hpp index 30c6f84bbd..9f667a6127 100644 --- a/src/ai/ai_config.hpp +++ b/src/ai/ai_config.hpp @@ -30,9 +30,9 @@ public: class AIInfo *GetInfo() const; - /* virtual */ int GetSetting(const char *name) const; - /* virtual */ void SetSetting(const char *name, int value); - /* virtual */ void AddRandomDeviation(); + int GetSetting(const char *name) const override; + void SetSetting(const char *name, int value) override; + void AddRandomDeviation() override; /** * When ever the AI Scanner is reloaded, all infos become invalid. This @@ -45,9 +45,9 @@ public: bool ResetInfo(bool force_exact_match); protected: - /* virtual */ void PushExtraConfigList(); - /* virtual */ void ClearConfigList(); - /* virtual */ ScriptInfo *FindInfo(const char *name, int version, bool force_exact_match); + void PushExtraConfigList() override; + void ClearConfigList() override; + ScriptInfo *FindInfo(const char *name, int version, bool force_exact_match) override; }; #endif /* AI_CONFIG_HPP */ diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 8e7e12a63b..5a4c772468 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -646,7 +646,7 @@ struct ScriptTextfileWindow : public TextfileWindow { this->LoadTextfile(textfile, (slot == OWNER_DEITY) ? GAME_DIR : AI_DIR); } - /* virtual */ void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_TF_CAPTION) { SetDParam(0, (slot == OWNER_DEITY) ? STR_CONTENT_TYPE_GAME_SCRIPT : STR_CONTENT_TYPE_AI); diff --git a/src/ai/ai_instance.hpp b/src/ai/ai_instance.hpp index 204bf9712a..06998558b3 100644 --- a/src/ai/ai_instance.hpp +++ b/src/ai/ai_instance.hpp @@ -25,14 +25,14 @@ public: */ void Initialize(class AIInfo *info); - /* virtual */ int GetSetting(const char *name); - /* virtual */ ScriptInfo *FindLibrary(const char *library, int version); + int GetSetting(const char *name) override; + ScriptInfo *FindLibrary(const char *library, int version) override; private: - /* virtual */ void RegisterAPI(); - /* virtual */ void Died(); - /* virtual */ CommandCallback *GetDoCommandCallback(); - /* virtual */ void LoadDummyScript(); + void RegisterAPI() override; + void Died() override; + CommandCallback *GetDoCommandCallback() override; + void LoadDummyScript() override; }; #endif /* AI_INSTANCE_HPP */ diff --git a/src/ai/ai_scanner.hpp b/src/ai/ai_scanner.hpp index d8e8a6993d..dafc340beb 100644 --- a/src/ai/ai_scanner.hpp +++ b/src/ai/ai_scanner.hpp @@ -19,7 +19,7 @@ public: AIScannerInfo(); ~AIScannerInfo(); - /* virtual */ void Initialize(); + void Initialize() override; /** * Select a random AI. @@ -42,11 +42,11 @@ public: void SetDummyAI(class AIInfo *info); protected: - /* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last); - /* virtual */ const char *GetFileName() const { return PATHSEP "info.nut"; } - /* virtual */ Subdirectory GetDirectory() const { return AI_DIR; } - /* virtual */ const char *GetScannerName() const { return "AIs"; } - /* virtual */ void RegisterAPI(class Squirrel *engine); + void GetScriptName(ScriptInfo *info, char *name, const char *last) override; + const char *GetFileName() const override { return PATHSEP "info.nut"; } + Subdirectory GetDirectory() const override { return AI_DIR; } + const char *GetScannerName() const override { return "AIs"; } + void RegisterAPI(class Squirrel *engine) override; private: AIInfo *info_dummy; ///< The dummy AI. @@ -54,7 +54,7 @@ private: class AIScannerLibrary : public ScriptScanner { public: - /* virtual */ void Initialize(); + void Initialize() override; /** * Find a library in the pool. @@ -65,11 +65,11 @@ public: class AILibrary *FindLibrary(const char *library, int version); protected: - /* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last); - /* virtual */ const char *GetFileName() const { return PATHSEP "library.nut"; } - /* virtual */ Subdirectory GetDirectory() const { return AI_LIBRARY_DIR; } - /* virtual */ const char *GetScannerName() const { return "AI Libraries"; } - /* virtual */ void RegisterAPI(class Squirrel *engine); + void GetScriptName(ScriptInfo *info, char *name, const char *last) override; + const char *GetFileName() const override { return PATHSEP "library.nut"; } + Subdirectory GetDirectory() const override { return AI_LIBRARY_DIR; } + const char *GetScannerName() const override { return "AI Libraries"; } + void RegisterAPI(class Squirrel *engine) override; }; #endif /* AI_SCANNER_HPP */ diff --git a/src/base_media_base.h b/src/base_media_base.h index b040abcf9d..bcffa11a08 100644 --- a/src/base_media_base.h +++ b/src/base_media_base.h @@ -176,7 +176,7 @@ protected: static Tbase_set *duplicate_sets; ///< All sets that aren't available, but needed for not downloading base sets when a newer version than the one on BaNaNaS is loaded. static const Tbase_set *used_set; ///< The currently used set - /* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename); + bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override; /** * Get the extension that is used to identify this set. diff --git a/src/blitter/32bpp_anim.hpp b/src/blitter/32bpp_anim.hpp index ecf6dcfca0..f8fd892813 100644 --- a/src/blitter/32bpp_anim.hpp +++ b/src/blitter/32bpp_anim.hpp @@ -37,21 +37,21 @@ public: ~Blitter_32bppAnim(); - /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); - /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal); - /* virtual */ void SetPixel(void *video, int x, int y, uint8 colour); - /* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash); - /* virtual */ void DrawRect(void *video, int width, int height, uint8 colour); - /* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height); - /* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height); - /* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y); - /* virtual */ int BufferSize(int width, int height); - /* virtual */ void PaletteAnimate(const Palette &palette); - /* virtual */ Blitter::PaletteAnimation UsePaletteAnimation(); + void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override; + void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override; + void SetPixel(void *video, int x, int y, uint8 colour) override; + void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override; + void DrawRect(void *video, int width, int height, uint8 colour) override; + void CopyFromBuffer(void *video, const void *src, int width, int height) override; + void CopyToBuffer(const void *video, void *dst, int width, int height) override; + void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override; + int BufferSize(int width, int height) override; + void PaletteAnimate(const Palette &palette) override; + Blitter::PaletteAnimation UsePaletteAnimation() override; - /* virtual */ const char *GetName() { return "32bpp-anim"; } - /* virtual */ int GetBytesPerPixel() { return 6; } - /* virtual */ void PostResize(); + const char *GetName() override { return "32bpp-anim"; } + int GetBytesPerPixel() override { return 6; } + void PostResize() override; /** * Look up the colour in the current palette. @@ -77,7 +77,7 @@ public: class FBlitter_32bppAnim : public BlitterFactory { public: FBlitter_32bppAnim() : BlitterFactory("32bpp-anim", "32bpp Animation Blitter (palette animation)") {} - /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppAnim(); } + Blitter *CreateInstance() override { return new Blitter_32bppAnim(); } }; #endif /* BLITTER_32BPP_ANIM_HPP */ diff --git a/src/blitter/32bpp_anim_sse2.hpp b/src/blitter/32bpp_anim_sse2.hpp index 0d4a5f1e65..aed11026c0 100644 --- a/src/blitter/32bpp_anim_sse2.hpp +++ b/src/blitter/32bpp_anim_sse2.hpp @@ -28,15 +28,15 @@ /** A partially 32 bpp blitter with palette animation. */ class Blitter_32bppSSE2_Anim : public Blitter_32bppAnim { public: - /* virtual */ void PaletteAnimate(const Palette &palette); - /* virtual */ const char *GetName() { return "32bpp-sse2-anim"; } + void PaletteAnimate(const Palette &palette) override; + const char *GetName() override { return "32bpp-sse2-anim"; } }; /** Factory for the partially 32bpp blitter with animation. */ class FBlitter_32bppSSE2_Anim : public BlitterFactory { public: FBlitter_32bppSSE2_Anim() : BlitterFactory("32bpp-sse2-anim", "32bpp partially SSE2 Animation Blitter (palette animation)", HasCPUIDFlag(1, 3, 26)) {} - /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE2_Anim(); } + Blitter *CreateInstance() override { return new Blitter_32bppSSE2_Anim(); } }; #endif /* WITH_SSE */ diff --git a/src/blitter/32bpp_anim_sse4.hpp b/src/blitter/32bpp_anim_sse4.hpp index 5ff1fb01be..2fefd3001f 100644 --- a/src/blitter/32bpp_anim_sse4.hpp +++ b/src/blitter/32bpp_anim_sse4.hpp @@ -35,19 +35,19 @@ private: public: template - /* virtual */ void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom); - /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); - /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) { + void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom); + void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override; + Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override { return Blitter_32bppSSE_Base::Encode(sprite, allocator); } - /* virtual */ const char *GetName() { return "32bpp-sse4-anim"; } + const char *GetName() override { return "32bpp-sse4-anim"; } }; /** Factory for the SSE4 32 bpp blitter (with palette animation). */ class FBlitter_32bppSSE4_Anim: public BlitterFactory { public: FBlitter_32bppSSE4_Anim() : BlitterFactory("32bpp-sse4-anim", "SSE4 Blitter (palette animation)", HasCPUIDFlag(1, 2, 19)) {} - /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE4_Anim(); } + Blitter *CreateInstance() override { return new Blitter_32bppSSE4_Anim(); } }; #endif /* WITH_SSE */ diff --git a/src/blitter/32bpp_base.hpp b/src/blitter/32bpp_base.hpp index 697593da6a..e481c15ccb 100644 --- a/src/blitter/32bpp_base.hpp +++ b/src/blitter/32bpp_base.hpp @@ -20,19 +20,19 @@ /** Base for all 32bpp blitters. */ class Blitter_32bppBase : public Blitter { public: - /* virtual */ uint8 GetScreenDepth() { return 32; } - /* virtual */ void *MoveTo(void *video, int x, int y); - /* virtual */ void SetPixel(void *video, int x, int y, uint8 colour); - /* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash); - /* virtual */ void DrawRect(void *video, int width, int height, uint8 colour); - /* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height); - /* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height); - /* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch); - /* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y); - /* virtual */ int BufferSize(int width, int height); - /* virtual */ void PaletteAnimate(const Palette &palette); - /* virtual */ Blitter::PaletteAnimation UsePaletteAnimation(); - /* virtual */ int GetBytesPerPixel() { return 4; } + uint8 GetScreenDepth() override { return 32; } + void *MoveTo(void *video, int x, int y) override; + void SetPixel(void *video, int x, int y, uint8 colour) override; + void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override; + void DrawRect(void *video, int width, int height, uint8 colour) override; + void CopyFromBuffer(void *video, const void *src, int width, int height) override; + void CopyToBuffer(const void *video, void *dst, int width, int height) override; + void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override; + void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override; + int BufferSize(int width, int height) override; + void PaletteAnimate(const Palette &palette) override; + Blitter::PaletteAnimation UsePaletteAnimation() override; + int GetBytesPerPixel() override { return 4; } /** * Look up the colour in the current palette. diff --git a/src/blitter/32bpp_optimized.hpp b/src/blitter/32bpp_optimized.hpp index c261aa33d6..fc8a406537 100644 --- a/src/blitter/32bpp_optimized.hpp +++ b/src/blitter/32bpp_optimized.hpp @@ -23,10 +23,10 @@ public: byte data[]; ///< Data, all zoomlevels. }; - /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); - /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator); + void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override; + Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override; - /* virtual */ const char *GetName() { return "32bpp-optimized"; } + const char *GetName() override { return "32bpp-optimized"; } template void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom); }; @@ -35,7 +35,7 @@ public: class FBlitter_32bppOptimized : public BlitterFactory { public: FBlitter_32bppOptimized() : BlitterFactory("32bpp-optimized", "32bpp Optimized Blitter (no palette animation)") {} - /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppOptimized(); } + Blitter *CreateInstance() override { return new Blitter_32bppOptimized(); } }; #endif /* BLITTER_32BPP_OPTIMIZED_HPP */ diff --git a/src/blitter/32bpp_simple.hpp b/src/blitter/32bpp_simple.hpp index 0751f6f753..3d43971e9e 100644 --- a/src/blitter/32bpp_simple.hpp +++ b/src/blitter/32bpp_simple.hpp @@ -26,18 +26,18 @@ class Blitter_32bppSimple : public Blitter_32bppBase { uint8 v; ///< Brightness-channel }; public: - /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); - /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal); - /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator); + void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override; + void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override; + Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override; - /* virtual */ const char *GetName() { return "32bpp-simple"; } + const char *GetName() override { return "32bpp-simple"; } }; /** Factory for the simple 32 bpp blitter. */ class FBlitter_32bppSimple : public BlitterFactory { public: FBlitter_32bppSimple() : BlitterFactory("32bpp-simple", "32bpp Simple Blitter (no palette animation)") {} - /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSimple(); } + Blitter *CreateInstance() override { return new Blitter_32bppSimple(); } }; #endif /* BLITTER_32BPP_SIMPLE_HPP */ diff --git a/src/blitter/32bpp_sse2.hpp b/src/blitter/32bpp_sse2.hpp index d6b17f679c..1628f1fa26 100644 --- a/src/blitter/32bpp_sse2.hpp +++ b/src/blitter/32bpp_sse2.hpp @@ -82,22 +82,22 @@ DECLARE_ENUM_AS_BIT_SET(Blitter_32bppSSE_Base::SpriteFlags); /** The SSE2 32 bpp blitter (without palette animation). */ class Blitter_32bppSSE2 : public Blitter_32bppSimple, public Blitter_32bppSSE_Base { public: - /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); + void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override; template void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom); - /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) { + Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override { return Blitter_32bppSSE_Base::Encode(sprite, allocator); } - /* virtual */ const char *GetName() { return "32bpp-sse2"; } + const char *GetName() override { return "32bpp-sse2"; } }; /** Factory for the SSE2 32 bpp blitter (without palette animation). */ class FBlitter_32bppSSE2 : public BlitterFactory { public: FBlitter_32bppSSE2() : BlitterFactory("32bpp-sse2", "32bpp SSE2 Blitter (no palette animation)", HasCPUIDFlag(1, 3, 26)) {} - /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE2(); } + Blitter *CreateInstance() override { return new Blitter_32bppSSE2(); } }; #endif /* WITH_SSE */ diff --git a/src/blitter/32bpp_sse4.hpp b/src/blitter/32bpp_sse4.hpp index 9c59d253f5..36b5b16d4c 100644 --- a/src/blitter/32bpp_sse4.hpp +++ b/src/blitter/32bpp_sse4.hpp @@ -27,17 +27,17 @@ /** The SSE4 32 bpp blitter (without palette animation). */ class Blitter_32bppSSE4 : public Blitter_32bppSSSE3 { public: - /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); + void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override; template void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom); - /* virtual */ const char *GetName() { return "32bpp-sse4"; } + const char *GetName() override { return "32bpp-sse4"; } }; /** Factory for the SSE4 32 bpp blitter (without palette animation). */ class FBlitter_32bppSSE4: public BlitterFactory { public: FBlitter_32bppSSE4() : BlitterFactory("32bpp-sse4", "32bpp SSE4 Blitter (no palette animation)", HasCPUIDFlag(1, 2, 19)) {} - /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE4(); } + Blitter *CreateInstance() override { return new Blitter_32bppSSE4(); } }; #endif /* WITH_SSE */ diff --git a/src/blitter/32bpp_ssse3.hpp b/src/blitter/32bpp_ssse3.hpp index e9cac8ff0b..3d6152e9e7 100644 --- a/src/blitter/32bpp_ssse3.hpp +++ b/src/blitter/32bpp_ssse3.hpp @@ -27,17 +27,17 @@ /** The SSSE3 32 bpp blitter (without palette animation). */ class Blitter_32bppSSSE3 : public Blitter_32bppSSE2 { public: - /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); + void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override; template void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom); - /* virtual */ const char *GetName() { return "32bpp-ssse3"; } + const char *GetName() override { return "32bpp-ssse3"; } }; /** Factory for the SSSE3 32 bpp blitter (without palette animation). */ class FBlitter_32bppSSSE3: public BlitterFactory { public: FBlitter_32bppSSSE3() : BlitterFactory("32bpp-ssse3", "32bpp SSSE3 Blitter (no palette animation)", HasCPUIDFlag(1, 2, 9)) {} - /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSSE3(); } + Blitter *CreateInstance() override { return new Blitter_32bppSSSE3(); } }; #endif /* WITH_SSE */ diff --git a/src/blitter/8bpp_base.hpp b/src/blitter/8bpp_base.hpp index 8f75dda5d3..7ab3f6378a 100644 --- a/src/blitter/8bpp_base.hpp +++ b/src/blitter/8bpp_base.hpp @@ -17,20 +17,20 @@ /** Base for all 8bpp blitters. */ class Blitter_8bppBase : public Blitter { public: - /* virtual */ uint8 GetScreenDepth() { return 8; } - /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal); - /* virtual */ void *MoveTo(void *video, int x, int y); - /* virtual */ void SetPixel(void *video, int x, int y, uint8 colour); - /* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash); - /* virtual */ void DrawRect(void *video, int width, int height, uint8 colour); - /* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height); - /* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height); - /* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch); - /* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y); - /* virtual */ int BufferSize(int width, int height); - /* virtual */ void PaletteAnimate(const Palette &palette); - /* virtual */ Blitter::PaletteAnimation UsePaletteAnimation(); - /* virtual */ int GetBytesPerPixel() { return 1; } + uint8 GetScreenDepth() override { return 8; } + void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override; + void *MoveTo(void *video, int x, int y) override; + void SetPixel(void *video, int x, int y, uint8 colour) override; + void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override; + void DrawRect(void *video, int width, int height, uint8 colour) override; + void CopyFromBuffer(void *video, const void *src, int width, int height) override; + void CopyToBuffer(const void *video, void *dst, int width, int height) override; + void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override; + void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override; + int BufferSize(int width, int height) override; + void PaletteAnimate(const Palette &palette) override; + Blitter::PaletteAnimation UsePaletteAnimation() override; + int GetBytesPerPixel() override { return 1; } }; #endif /* BLITTER_8BPP_BASE_HPP */ diff --git a/src/blitter/8bpp_optimized.hpp b/src/blitter/8bpp_optimized.hpp index b5b5324b91..509edb8c40 100644 --- a/src/blitter/8bpp_optimized.hpp +++ b/src/blitter/8bpp_optimized.hpp @@ -24,17 +24,17 @@ public: byte data[]; ///< Data, all zoomlevels. }; - /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); - /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator); + void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override; + Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override; - /* virtual */ const char *GetName() { return "8bpp-optimized"; } + const char *GetName() override { return "8bpp-optimized"; } }; /** Factory for the 8bpp blitter optimised for speed. */ class FBlitter_8bppOptimized : public BlitterFactory { public: FBlitter_8bppOptimized() : BlitterFactory("8bpp-optimized", "8bpp Optimized Blitter (compression + all-ZoomLevel cache)") {} - /* virtual */ Blitter *CreateInstance() { return new Blitter_8bppOptimized(); } + Blitter *CreateInstance() override { return new Blitter_8bppOptimized(); } }; #endif /* BLITTER_8BPP_OPTIMIZED_HPP */ diff --git a/src/blitter/8bpp_simple.hpp b/src/blitter/8bpp_simple.hpp index c00c75ac04..e48bc37585 100644 --- a/src/blitter/8bpp_simple.hpp +++ b/src/blitter/8bpp_simple.hpp @@ -18,17 +18,17 @@ /** Most trivial 8bpp blitter. */ class Blitter_8bppSimple FINAL : public Blitter_8bppBase { public: - /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); - /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator); + void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override; + Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override; - /* virtual */ const char *GetName() { return "8bpp-simple"; } + const char *GetName() override { return "8bpp-simple"; } }; /** Factory for the most trivial 8bpp blitter. */ class FBlitter_8bppSimple : public BlitterFactory { public: FBlitter_8bppSimple() : BlitterFactory("8bpp-simple", "8bpp Simple Blitter (relative slow, but never wrong)") {} - /* virtual */ Blitter *CreateInstance() { return new Blitter_8bppSimple(); } + Blitter *CreateInstance() override { return new Blitter_8bppSimple(); } }; #endif /* BLITTER_8BPP_SIMPLE_HPP */ diff --git a/src/blitter/null.hpp b/src/blitter/null.hpp index a6fed2ebca..8dc98646c2 100644 --- a/src/blitter/null.hpp +++ b/src/blitter/null.hpp @@ -17,31 +17,31 @@ /** Blitter that does nothing. */ class Blitter_Null : public Blitter { public: - /* virtual */ uint8 GetScreenDepth() { return 0; } - /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) {}; - /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) {}; - /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator); - /* virtual */ void *MoveTo(void *video, int x, int y) { return NULL; }; - /* virtual */ void SetPixel(void *video, int x, int y, uint8 colour) {}; - /* virtual */ void DrawRect(void *video, int width, int height, uint8 colour) {}; - /* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) {}; - /* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height) {}; - /* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height) {}; - /* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) {}; - /* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) {}; - /* virtual */ int BufferSize(int width, int height) { return 0; }; - /* virtual */ void PaletteAnimate(const Palette &palette) { }; - /* virtual */ Blitter::PaletteAnimation UsePaletteAnimation() { return Blitter::PALETTE_ANIMATION_NONE; }; - - /* virtual */ const char *GetName() { return "null"; } - /* virtual */ int GetBytesPerPixel() { return 0; } + uint8 GetScreenDepth() override { return 0; } + void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override {}; + void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override {}; + Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override; + void *MoveTo(void *video, int x, int y) override { return NULL; }; + void SetPixel(void *video, int x, int y, uint8 colour) override {}; + void DrawRect(void *video, int width, int height, uint8 colour) override {}; + void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override {}; + void CopyFromBuffer(void *video, const void *src, int width, int height) override {}; + void CopyToBuffer(const void *video, void *dst, int width, int height) override {}; + void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override {}; + void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override {}; + int BufferSize(int width, int height) override { return 0; }; + void PaletteAnimate(const Palette &palette) override { }; + Blitter::PaletteAnimation UsePaletteAnimation() override { return Blitter::PALETTE_ANIMATION_NONE; }; + + const char *GetName() override { return "null"; } + int GetBytesPerPixel() override { return 0; } }; /** Factory for the blitter that does nothing. */ class FBlitter_Null : public BlitterFactory { public: FBlitter_Null() : BlitterFactory("null", "Null Blitter (does nothing)") {} - /* virtual */ Blitter *CreateInstance() { return new Blitter_Null(); } + Blitter *CreateInstance() override { return new Blitter_Null(); } }; #endif /* BLITTER_NULL_HPP */ diff --git a/src/fileio_func.h b/src/fileio_func.h index f5ef58ac06..8263b7872c 100644 --- a/src/fileio_func.h +++ b/src/fileio_func.h @@ -107,7 +107,7 @@ public: ALL = BASESET | NEWGRF | AI | SCENARIO | GAME, ///< Scan for everything. }; - /* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename = NULL); + bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename = NULL) override; bool AddFile(Subdirectory sd, const char *filename); diff --git a/src/fios.cpp b/src/fios.cpp index 835c04ddb2..f849b9a165 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -276,7 +276,7 @@ public: fop(fop), callback_proc(callback_proc), file_list(file_list) {} - /* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename); + bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override; }; /** @@ -673,7 +673,7 @@ public: this->scanned = true; } - /* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) + bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override { FILE *f = FioFOpenFile(filename, "r", SCENARIO_DIR); if (f == NULL) return false; diff --git a/src/game/game_config.hpp b/src/game/game_config.hpp index e9ebdc38c1..dfae62c3a9 100644 --- a/src/game/game_config.hpp +++ b/src/game/game_config.hpp @@ -42,7 +42,7 @@ public: bool ResetInfo(bool force_exact_match); protected: - /* virtual */ ScriptInfo *FindInfo(const char *name, int version, bool force_exact_match); + ScriptInfo *FindInfo(const char *name, int version, bool force_exact_match) override; }; #endif /* GAME_CONFIG_HPP */ diff --git a/src/game/game_info.hpp b/src/game/game_info.hpp index f4fc5ed86b..a799ed7d6d 100644 --- a/src/game/game_info.hpp +++ b/src/game/game_info.hpp @@ -40,7 +40,7 @@ public: */ const char *GetAPIVersion() const { return this->api_version; } - /* virtual */ bool IsDeveloperOnly() const { return this->is_developer_only; } + bool IsDeveloperOnly() const override { return this->is_developer_only; } private: int min_loadable_version; ///< The Game can load savegame data if the version is equal or greater than this. diff --git a/src/game/game_instance.hpp b/src/game/game_instance.hpp index 08ce344247..dd0e7950aa 100644 --- a/src/game/game_instance.hpp +++ b/src/game/game_instance.hpp @@ -25,14 +25,14 @@ public: */ void Initialize(class GameInfo *info); - /* virtual */ int GetSetting(const char *name); - /* virtual */ ScriptInfo *FindLibrary(const char *library, int version); + int GetSetting(const char *name) override; + ScriptInfo *FindLibrary(const char *library, int version) override; private: - /* virtual */ void RegisterAPI(); - /* virtual */ void Died(); - /* virtual */ CommandCallback *GetDoCommandCallback(); - /* virtual */ void LoadDummyScript() {} + void RegisterAPI() override; + void Died() override; + CommandCallback *GetDoCommandCallback() override; + void LoadDummyScript() override {} }; #endif /* GAME_INSTANCE_HPP */ diff --git a/src/game/game_scanner.hpp b/src/game/game_scanner.hpp index 071d19d38d..492545c2b1 100644 --- a/src/game/game_scanner.hpp +++ b/src/game/game_scanner.hpp @@ -16,7 +16,7 @@ class GameScannerInfo : public ScriptScanner { public: - /* virtual */ void Initialize(); + void Initialize() override; /** * Check if we have a game by name and version available in our list. @@ -28,17 +28,17 @@ public: class GameInfo *FindInfo(const char *nameParam, int versionParam, bool force_exact_match); protected: - /* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last); - /* virtual */ const char *GetFileName() const { return PATHSEP "info.nut"; } - /* virtual */ Subdirectory GetDirectory() const { return GAME_DIR; } - /* virtual */ const char *GetScannerName() const { return "Game Scripts"; } - /* virtual */ void RegisterAPI(class Squirrel *engine); + void GetScriptName(ScriptInfo *info, char *name, const char *last) override; + const char *GetFileName() const override { return PATHSEP "info.nut"; } + Subdirectory GetDirectory() const override { return GAME_DIR; } + const char *GetScannerName() const override { return "Game Scripts"; } + void RegisterAPI(class Squirrel *engine) override; }; class GameScannerLibrary : public ScriptScanner { public: - /* virtual */ void Initialize(); + void Initialize() override; /** * Find a library in the pool. @@ -49,11 +49,11 @@ public: class GameLibrary *FindLibrary(const char *library, int version); protected: - /* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last); - /* virtual */ const char *GetFileName() const { return PATHSEP "library.nut"; } - /* virtual */ Subdirectory GetDirectory() const { return GAME_LIBRARY_DIR; } - /* virtual */ const char *GetScannerName() const { return "GS Libraries"; } - /* virtual */ void RegisterAPI(class Squirrel *engine); + void GetScriptName(ScriptInfo *info, char *name, const char *last) override; + const char *GetFileName() const override { return PATHSEP "library.nut"; } + Subdirectory GetDirectory() const override { return GAME_LIBRARY_DIR; } + const char *GetScannerName() const override { return "GS Libraries"; } + void RegisterAPI(class Squirrel *engine) override; }; #endif /* GAME_SCANNER_HPP */ diff --git a/src/game/game_text.cpp b/src/game/game_text.cpp index a32e5b41d7..4673e732c2 100644 --- a/src/game/game_text.cpp +++ b/src/game/game_text.cpp @@ -151,7 +151,7 @@ struct StringListReader : StringReader { { } - /* virtual */ char *ReadLine(char *buffer, const char *last) + char *ReadLine(char *buffer, const char *last) override { if (this->p == this->end) return NULL; @@ -242,7 +242,7 @@ public: this->FileScanner::Scan(".txt", directory, false); } - /* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) + bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override { if (strcmp(filename, exclude) == 0) return true; diff --git a/src/goal_gui.cpp b/src/goal_gui.cpp index ee4d8170e1..7c3e330043 100644 --- a/src/goal_gui.cpp +++ b/src/goal_gui.cpp @@ -50,7 +50,7 @@ struct GoalListWindow : public Window { this->OnInvalidateData(0); } - /* virtual */ void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget != WID_GOAL_CAPTION) return; @@ -62,7 +62,7 @@ struct GoalListWindow : public Window { } } - /* virtual */ void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (widget != WID_GOAL_LIST) return; @@ -177,7 +177,7 @@ struct GoalListWindow : public Window { return 3 + num_global + num_company; } - /* virtual */ void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_GOAL_LIST) return; Dimension d = maxdim(GetStringBoundingBox(STR_GOALS_GLOBAL_TITLE), GetStringBoundingBox(STR_GOALS_COMPANY_TITLE)); @@ -272,7 +272,7 @@ struct GoalListWindow : public Window { DrawPartialGoalList(pos, cap, x, y, right, progress_col_width, false, column); } - /* virtual */ void OnPaint() + void OnPaint() override { this->DrawWidgets(); @@ -299,7 +299,7 @@ struct GoalListWindow : public Window { } - /* virtual */ void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_GOAL_LIST); } @@ -309,7 +309,7 @@ struct GoalListWindow : public Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - /* virtual */ void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; this->vscroll->SetCount(this->CountLines()); @@ -388,7 +388,7 @@ struct GoalQuestionWindow : public Window { free(this->question); } - /* virtual */ void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_GQ_CAPTION: @@ -409,7 +409,7 @@ struct GoalQuestionWindow : public Window { } } - /* virtual */ void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_GQ_BUTTON_1: @@ -429,7 +429,7 @@ struct GoalQuestionWindow : public Window { } } - /* virtual */ void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_GQ_QUESTION) return; @@ -437,7 +437,7 @@ struct GoalQuestionWindow : public Window { size->height = GetStringHeight(STR_JUST_RAW_STRING, size->width) + WD_PAR_VSEP_WIDE; } - /* virtual */ void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_GQ_QUESTION) return; diff --git a/src/ground_vehicle.hpp b/src/ground_vehicle.hpp index 56b97875fc..25106ab1c6 100644 --- a/src/ground_vehicle.hpp +++ b/src/ground_vehicle.hpp @@ -92,14 +92,14 @@ struct GroundVehicle : public SpecializedVehicle { void PowerChanged(); void CargoChanged(); int GetAcceleration() const; - bool IsChainInDepot() const; + bool IsChainInDepot() const override; /** * Common code executed for crashed ground vehicles * @param flooded was this vehicle flooded? * @return number of victims */ - /* virtual */ uint Crash(bool flooded) + uint Crash(bool flooded) override { /* Crashed vehicles aren't going up or down */ for (T *v = T::From(this); v != NULL; v = v->Next()) { diff --git a/src/music/allegro_m.h b/src/music/allegro_m.h index 65d8ab811d..9451162a21 100644 --- a/src/music/allegro_m.h +++ b/src/music/allegro_m.h @@ -17,18 +17,18 @@ /** Allegro's music player. */ class MusicDriver_Allegro : public MusicDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void PlaySong(const MusicSongInfo &song); + void PlaySong(const MusicSongInfo &song) override; - /* virtual */ void StopSong(); + void StopSong() override; - /* virtual */ bool IsSongPlaying(); + bool IsSongPlaying() override; - /* virtual */ void SetVolume(byte vol); - /* virtual */ const char *GetName() const { return "allegro"; } + void SetVolume(byte vol) override; + const char *GetName() const override { return "allegro"; } }; /** Factory for allegro's music player. */ @@ -43,7 +43,7 @@ public: static const int PRIORITY = 2; #endif FMusicDriver_Allegro() : DriverFactoryBase(Driver::DT_MUSIC, PRIORITY, "allegro", "Allegro MIDI Driver") {} - /* virtual */ Driver *CreateInstance() const { return new MusicDriver_Allegro(); } + Driver *CreateInstance() const override { return new MusicDriver_Allegro(); } }; #endif /* MUSIC_ALLEGRO_H */ diff --git a/src/music/bemidi.h b/src/music/bemidi.h index 7c546525d2..8591ec0159 100644 --- a/src/music/bemidi.h +++ b/src/music/bemidi.h @@ -17,25 +17,25 @@ /** The midi player for BeOS. */ class MusicDriver_BeMidi : public MusicDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void PlaySong(const MusicSongInfo &song); + void PlaySong(const MusicSongInfo &song) override; - /* virtual */ void StopSong(); + void StopSong() override; - /* virtual */ bool IsSongPlaying(); + bool IsSongPlaying() override; - /* virtual */ void SetVolume(byte vol); - /* virtual */ const char *GetName() const { return "bemidi"; } + void SetVolume(byte vol) override; + const char *GetName() const override { return "bemidi"; } }; /** Factory for the BeOS midi player. */ class FMusicDriver_BeMidi : public DriverFactoryBase { public: FMusicDriver_BeMidi() : DriverFactoryBase(Driver::DT_MUSIC, 10, "bemidi", "BeOS MIDI Driver") {} - /* virtual */ Driver *CreateInstance() const { return new MusicDriver_BeMidi(); } + Driver *CreateInstance() const override { return new MusicDriver_BeMidi(); } }; #endif /* MUSIC_BEMIDI_H */ diff --git a/src/music/cocoa_m.h b/src/music/cocoa_m.h index fdb10b84e6..7694927993 100644 --- a/src/music/cocoa_m.h +++ b/src/music/cocoa_m.h @@ -16,24 +16,24 @@ class MusicDriver_Cocoa : public MusicDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void PlaySong(const MusicSongInfo &song); + void PlaySong(const MusicSongInfo &song) override; - /* virtual */ void StopSong(); + void StopSong() override; - /* virtual */ bool IsSongPlaying(); + bool IsSongPlaying() override; - /* virtual */ void SetVolume(byte vol); - /* virtual */ const char *GetName() const { return "cocoa"; } + void SetVolume(byte vol) override; + const char *GetName() const override { return "cocoa"; } }; class FMusicDriver_Cocoa : public DriverFactoryBase { public: FMusicDriver_Cocoa() : DriverFactoryBase(Driver::DT_MUSIC, 10, "cocoa", "Cocoa MIDI Driver") {} - /* virtual */ Driver *CreateInstance() const { return new MusicDriver_Cocoa(); } + Driver *CreateInstance() const override { return new MusicDriver_Cocoa(); } }; #endif /* MUSIC_MACOSX_COCOA_H */ diff --git a/src/music/dmusic.h b/src/music/dmusic.h index 527e064e49..5b363b8917 100644 --- a/src/music/dmusic.h +++ b/src/music/dmusic.h @@ -19,25 +19,25 @@ class MusicDriver_DMusic : public MusicDriver { public: virtual ~MusicDriver_DMusic(); - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void PlaySong(const MusicSongInfo &song); + void PlaySong(const MusicSongInfo &song) override; - /* virtual */ void StopSong(); + void StopSong() override; - /* virtual */ bool IsSongPlaying(); + bool IsSongPlaying() override; - /* virtual */ void SetVolume(byte vol); - /* virtual */ const char *GetName() const { return "dmusic"; } + void SetVolume(byte vol) override; + const char *GetName() const override { return "dmusic"; } }; /** Factory for the DirectX music player. */ class FMusicDriver_DMusic : public DriverFactoryBase { public: FMusicDriver_DMusic() : DriverFactoryBase(Driver::DT_MUSIC, 10, "dmusic", "DirectMusic MIDI Driver") {} - /* virtual */ Driver *CreateInstance() const { return new MusicDriver_DMusic(); } + Driver *CreateInstance() const override { return new MusicDriver_DMusic(); } }; #endif /* MUSIC_DMUSIC_H */ diff --git a/src/music/extmidi.h b/src/music/extmidi.h index e174dc9b08..55050c0d2b 100644 --- a/src/music/extmidi.h +++ b/src/music/extmidi.h @@ -24,24 +24,24 @@ private: void DoStop(); public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void PlaySong(const MusicSongInfo &song); + void PlaySong(const MusicSongInfo &song) override; - /* virtual */ void StopSong(); + void StopSong() override; - /* virtual */ bool IsSongPlaying(); + bool IsSongPlaying() override; - /* virtual */ void SetVolume(byte vol); - /* virtual */ const char *GetName() const { return "extmidi"; } + void SetVolume(byte vol) override; + const char *GetName() const override { return "extmidi"; } }; class FMusicDriver_ExtMidi : public DriverFactoryBase { public: FMusicDriver_ExtMidi() : DriverFactoryBase(Driver::DT_MUSIC, 3, "extmidi", "External MIDI Driver") {} - /* virtual */ Driver *CreateInstance() const { return new MusicDriver_ExtMidi(); } + Driver *CreateInstance() const override { return new MusicDriver_ExtMidi(); } }; #endif /* MUSIC_EXTERNAL_H */ diff --git a/src/music/fluidsynth.h b/src/music/fluidsynth.h index 171128a8e9..e8a294b77b 100644 --- a/src/music/fluidsynth.h +++ b/src/music/fluidsynth.h @@ -17,25 +17,25 @@ /** Music driver making use of FluidSynth. */ class MusicDriver_FluidSynth : public MusicDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void PlaySong(const MusicSongInfo &song); + void PlaySong(const MusicSongInfo &song) override; - /* virtual */ void StopSong(); + void StopSong() override; - /* virtual */ bool IsSongPlaying(); + bool IsSongPlaying() override; - /* virtual */ void SetVolume(byte vol); - /* virtual */ const char *GetName() const { return "fluidsynth"; } + void SetVolume(byte vol) override; + const char *GetName() const override { return "fluidsynth"; } }; /** Factory for the fluidsynth driver. */ class FMusicDriver_FluidSynth : public DriverFactoryBase { public: FMusicDriver_FluidSynth() : DriverFactoryBase(Driver::DT_MUSIC, 5, "fluidsynth", "FluidSynth MIDI Driver") {} - /* virtual */ Driver *CreateInstance() const { return new MusicDriver_FluidSynth(); } + Driver *CreateInstance() const override { return new MusicDriver_FluidSynth(); } }; #endif /* MUSIC_FLUIDSYNTH_H */ diff --git a/src/music/null_m.h b/src/music/null_m.h index 51e1a06656..837eeb092b 100644 --- a/src/music/null_m.h +++ b/src/music/null_m.h @@ -17,25 +17,25 @@ /** The music player that does nothing. */ class MusicDriver_Null : public MusicDriver { public: - /* virtual */ const char *Start(const char * const *param) { return NULL; } + const char *Start(const char * const *param) override { return NULL; } - /* virtual */ void Stop() { } + void Stop() override { } - /* virtual */ void PlaySong(const MusicSongInfo &song) { } + void PlaySong(const MusicSongInfo &song) override { } - /* virtual */ void StopSong() { } + void StopSong() override { } - /* virtual */ bool IsSongPlaying() { return true; } + bool IsSongPlaying() override { return true; } - /* virtual */ void SetVolume(byte vol) { } - /* virtual */ const char *GetName() const { return "null"; } + void SetVolume(byte vol) override { } + const char *GetName() const override { return "null"; } }; /** Factory for the null music player. */ class FMusicDriver_Null : public DriverFactoryBase { public: FMusicDriver_Null() : DriverFactoryBase(Driver::DT_MUSIC, 1, "null", "Null Music Driver") {} - /* virtual */ Driver *CreateInstance() const { return new MusicDriver_Null(); } + Driver *CreateInstance() const override { return new MusicDriver_Null(); } }; #endif /* MUSIC_NULL_H */ diff --git a/src/music/os2_m.h b/src/music/os2_m.h index ac7cd03197..e320946edb 100644 --- a/src/music/os2_m.h +++ b/src/music/os2_m.h @@ -17,25 +17,25 @@ /** OS/2's music player. */ class MusicDriver_OS2 : public MusicDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void PlaySong(const MusicSongInfo &song); + void PlaySong(const MusicSongInfo &song) override; - /* virtual */ void StopSong(); + void StopSong() override; - /* virtual */ bool IsSongPlaying(); + bool IsSongPlaying() override; - /* virtual */ void SetVolume(byte vol); - /* virtual */ const char *GetName() const { return "os2"; } + void SetVolume(byte vol) override; + const char *GetName() const override { return "os2"; } }; /** Factory for OS/2's music player. */ class FMusicDriver_OS2 : public DriverFactoryBase { public: FMusicDriver_OS2() : DriverFactoryBase(Driver::DT_MUSIC, 10, "os2", "OS/2 Music Driver") {} - /* virtual */ Driver *CreateInstance() const { return new MusicDriver_OS2(); } + Driver *CreateInstance() const override { return new MusicDriver_OS2(); } }; #endif /* MUSIC_OS2_H */ diff --git a/src/music/qtmidi.h b/src/music/qtmidi.h index 32163db939..631f04d2db 100644 --- a/src/music/qtmidi.h +++ b/src/music/qtmidi.h @@ -16,24 +16,24 @@ class MusicDriver_QtMidi : public MusicDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void PlaySong(const MusicSongInfo &song); + void PlaySong(const MusicSongInfo &song) override; - /* virtual */ void StopSong(); + void StopSong() override; - /* virtual */ bool IsSongPlaying(); + bool IsSongPlaying() override; - /* virtual */ void SetVolume(byte vol); - /* virtual */ const char *GetName() const { return "qt"; } + void SetVolume(byte vol) override; + const char *GetName() const override { return "qt"; } }; class FMusicDriver_QtMidi : public DriverFactoryBase { public: FMusicDriver_QtMidi() : DriverFactoryBase(Driver::DT_MUSIC, 5, "qt", "QuickTime MIDI Driver") {} - /* virtual */ Driver *CreateInstance() const { return new MusicDriver_QtMidi(); } + Driver *CreateInstance() const override { return new MusicDriver_QtMidi(); } }; #endif /* MUSIC_MACOSX_QUICKTIME_H */ diff --git a/src/music/win32_m.h b/src/music/win32_m.h index 1ac8ae69e4..5366cf5d71 100644 --- a/src/music/win32_m.h +++ b/src/music/win32_m.h @@ -17,25 +17,25 @@ /** The Windows music player. */ class MusicDriver_Win32 : public MusicDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void PlaySong(const MusicSongInfo &song); + void PlaySong(const MusicSongInfo &song) override; - /* virtual */ void StopSong(); + void StopSong() override; - /* virtual */ bool IsSongPlaying(); + bool IsSongPlaying() override; - /* virtual */ void SetVolume(byte vol); - /* virtual */ const char *GetName() const { return "win32"; } + void SetVolume(byte vol) override; + const char *GetName() const override { return "win32"; } }; /** Factory for Windows' music player. */ class FMusicDriver_Win32 : public DriverFactoryBase { public: FMusicDriver_Win32() : DriverFactoryBase(Driver::DT_MUSIC, 5, "win32", "Win32 Music Driver") {} - /* virtual */ Driver *CreateInstance() const { return new MusicDriver_Win32(); } + Driver *CreateInstance() const override { return new MusicDriver_Win32(); } }; #endif /* MUSIC_WIN32_H */ diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index 0bb42c86ff..a99a5069ac 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -84,7 +84,7 @@ struct PacketReader : LoadFilter { this->buf += to_write; } - /* virtual */ size_t Read(byte *rbuf, size_t size) + size_t Read(byte *rbuf, size_t size) override { /* Limit the amount to read to whatever we still have. */ size_t ret_size = size = min(this->written_bytes - this->read_bytes, size); @@ -106,7 +106,7 @@ struct PacketReader : LoadFilter { return ret_size; } - /* virtual */ void Reset() + void Reset() override { this->read_bytes = 0; diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 230a62134f..321a53bc7d 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -64,7 +64,7 @@ struct ContentTextfileWindow : public TextfileWindow { } } - /* virtual */ void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_TF_CAPTION) { SetDParam(0, this->GetTypeString()); diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index cb64261423..f90370312b 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -117,7 +117,7 @@ public: *lastof(this->visible) = true; } - void SetupSmallestSize(Window *w, bool init_array) + void SetupSmallestSize(Window *w, bool init_array) override { /* Oh yeah, we ought to be findable! */ w->nested_array[WID_NG_HEADER] = this; @@ -143,7 +143,7 @@ public: this->smallest_x = this->head->smallest_x + this->tail->smallest_x; // First and last are always shown, rest not } - void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) + void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) override { assert(given_width >= this->smallest_x && given_height >= this->smallest_y); @@ -183,7 +183,7 @@ public: } } - /* virtual */ void Draw(const Window *w) + void Draw(const Window *w) override { int i = 0; for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) { @@ -193,7 +193,7 @@ public: } } - /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y) + NWidgetCore *GetWidgetFromPos(int x, int y) override { if (!IsInsideBS(x, this->pos_x, this->current_x) || !IsInsideBS(y, this->pos_y, this->current_y)) return NULL; diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index bd78acf92d..67f4c6fd91 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -163,7 +163,7 @@ struct PacketWriter : SaveFilter { this->current = NULL; } - /* virtual */ void Write(byte *buf, size_t size) + void Write(byte *buf, size_t size) override { /* We want to abort the saving when the socket is closed. */ if (this->cs == NULL) SlError(STR_NETWORK_ERROR_LOSTCONNECTION); @@ -190,7 +190,7 @@ struct PacketWriter : SaveFilter { this->total_size += size; } - /* virtual */ void Finish() + void Finish() override { /* We want to abort the saving when the socket is closed. */ if (this->cs == NULL) SlError(STR_NETWORK_ERROR_LOSTCONNECTION); diff --git a/src/newgrf_airport.cpp b/src/newgrf_airport.cpp index 6213097bd0..14af15a371 100644 --- a/src/newgrf_airport.cpp +++ b/src/newgrf_airport.cpp @@ -39,9 +39,9 @@ struct AirportScopeResolver : public ScopeResolver { { } - /* virtual */ uint32 GetRandomBits() const; - /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; - /* virtual */ void StorePSA(uint pos, int32 value); + uint32 GetRandomBits() const override; + uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override; + void StorePSA(uint pos, int32 value) override; }; /** Resolver object for airports. */ @@ -51,7 +51,7 @@ struct AirportResolverObject : public ResolverObject { AirportResolverObject(TileIndex tile, Station *st, byte airport_id, byte layout, CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0); - /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) + ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override { switch (scope) { case VSG_SCOPE_SELF: return &this->airport_scope; @@ -59,7 +59,7 @@ struct AirportResolverObject : public ResolverObject { } } - /* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const; + const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override; }; /** diff --git a/src/newgrf_airporttiles.h b/src/newgrf_airporttiles.h index dc04642037..e55409c1b3 100644 --- a/src/newgrf_airporttiles.h +++ b/src/newgrf_airporttiles.h @@ -38,8 +38,8 @@ struct AirportTileScopeResolver : public ScopeResolver { this->airport_id = st->airport.type; } - /* virtual */ uint32 GetRandomBits() const; - /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; + uint32 GetRandomBits() const override; + uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override; }; /** Resolver for tiles of an airport. */ @@ -49,7 +49,7 @@ struct AirportTileResolverObject : public ResolverObject { AirportTileResolverObject(const AirportTileSpec *ats, TileIndex tile, Station *st, CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0); - /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) + ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override { switch (scope) { case VSG_SCOPE_SELF: return &tiles_scope; diff --git a/src/newgrf_canal.cpp b/src/newgrf_canal.cpp index 3438bb9850..32180ee1a5 100644 --- a/src/newgrf_canal.cpp +++ b/src/newgrf_canal.cpp @@ -30,8 +30,8 @@ struct CanalScopeResolver : public ScopeResolver { { } - /* virtual */ uint32 GetRandomBits() const; - /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; + uint32 GetRandomBits() const override; + uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override; }; /** Resolver object for canals. */ @@ -41,7 +41,7 @@ struct CanalResolverObject : public ResolverObject { CanalResolverObject(CanalFeature feature, TileIndex tile, CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0); - /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) + ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override { switch (scope) { case VSG_SCOPE_SELF: return &this->canal_scope; @@ -49,7 +49,7 @@ struct CanalResolverObject : public ResolverObject { } } - /* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const; + const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override; }; /* virtual */ uint32 CanalScopeResolver::GetRandomBits() const diff --git a/src/newgrf_cargo.cpp b/src/newgrf_cargo.cpp index 7d830c5730..97db4855e6 100644 --- a/src/newgrf_cargo.cpp +++ b/src/newgrf_cargo.cpp @@ -19,7 +19,7 @@ struct CargoResolverObject : public ResolverObject { CargoResolverObject(const CargoSpec *cs, CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0); - /* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const; + const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override; }; /* virtual */ const SpriteGroup *CargoResolverObject::ResolveReal(const RealSpriteGroup *group) const diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index f19c79c9a8..d21d767cdc 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -633,7 +633,7 @@ public: { } - /* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename); + bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override; /** Do the scan for GRFs. */ static uint DoScan() diff --git a/src/newgrf_engine.h b/src/newgrf_engine.h index 51adb0b7fb..644ff5f015 100644 --- a/src/newgrf_engine.h +++ b/src/newgrf_engine.h @@ -40,9 +40,9 @@ struct VehicleScopeResolver : public ScopeResolver { void SetVehicle(const Vehicle *v) { this->v = v; } - /* virtual */ uint32 GetRandomBits() const; - /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; - /* virtual */ uint32 GetTriggers() const; + uint32 GetRandomBits() const override; + uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override; + uint32 GetTriggers() const override; }; /** Resolver for a vehicle (chain) */ @@ -64,9 +64,9 @@ struct VehicleResolverObject : public ResolverObject { VehicleResolverObject(EngineID engine_type, const Vehicle *v, WagonOverride wagon_override, bool info_view = false, CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0); - /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0); + ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override; - /* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const; + const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override; }; static const uint TRAININFO_DEFAULT_VEHICLE_WIDTH = 29; diff --git a/src/newgrf_generic.cpp b/src/newgrf_generic.cpp index eb2cbf08f1..d29a03929e 100644 --- a/src/newgrf_generic.cpp +++ b/src/newgrf_generic.cpp @@ -42,7 +42,7 @@ struct GenericScopeResolver : public ScopeResolver { { } - /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; + uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override; private: bool ai_callback; ///< Callback comes from the AI. @@ -55,7 +55,7 @@ struct GenericResolverObject : public ResolverObject { GenericResolverObject(bool ai_callback, CallbackID callback = CBID_NO_CALLBACK); - /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) + ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override { switch (scope) { case VSG_SCOPE_SELF: return &this->generic_scope; @@ -63,7 +63,7 @@ struct GenericResolverObject : public ResolverObject { } } - /* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const; + const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override; }; struct GenericCallback { diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 1af2c72461..adf38b1648 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -550,7 +550,7 @@ struct NewGRFTextfileWindow : public TextfileWindow { this->LoadTextfile(textfile, NEWGRF_DIR); } - /* virtual */ void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_TF_CAPTION) { SetDParam(0, STR_CONTENT_TYPE_NEWGRF); diff --git a/src/newgrf_house.h b/src/newgrf_house.h index bb364f6fc6..10d61a9e99 100644 --- a/src/newgrf_house.h +++ b/src/newgrf_house.h @@ -44,9 +44,9 @@ struct HouseScopeResolver : public ScopeResolver { { } - /* virtual */ uint32 GetRandomBits() const; - /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; - /* virtual */ uint32 GetTriggers() const; + uint32 GetRandomBits() const override; + uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override; + uint32 GetTriggers() const override; }; /** Resolver object to be used for houses (feature 07 spritegroups). */ @@ -58,7 +58,7 @@ struct HouseResolverObject : public ResolverObject { CallbackID callback = CBID_NO_CALLBACK, uint32 param1 = 0, uint32 param2 = 0, bool not_yet_constructed = false, uint8 initial_random_bits = 0, CargoTypes watched_cargo_triggers = 0); - /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) + ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override { switch (scope) { case VSG_SCOPE_SELF: return &this->house_scope; diff --git a/src/newgrf_industries.h b/src/newgrf_industries.h index fa809fcd73..2fa8f7d36b 100644 --- a/src/newgrf_industries.h +++ b/src/newgrf_industries.h @@ -34,10 +34,10 @@ struct IndustriesScopeResolver : public ScopeResolver { { } - /* virtual */ uint32 GetRandomBits() const; - /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; - /* virtual */ uint32 GetTriggers() const; - /* virtual */ void StorePSA(uint pos, int32 value); + uint32 GetRandomBits() const override; + uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override; + uint32 GetTriggers() const override; + void StorePSA(uint pos, int32 value) override; }; /** Resolver for industries. */ @@ -51,7 +51,7 @@ struct IndustriesResolverObject : public ResolverObject { TownScopeResolver *GetTown(); - /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) + ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override { switch (scope) { case VSG_SCOPE_SELF: return &industries_scope; diff --git a/src/newgrf_industrytiles.h b/src/newgrf_industrytiles.h index 6051c1062b..8b72932333 100644 --- a/src/newgrf_industrytiles.h +++ b/src/newgrf_industrytiles.h @@ -32,9 +32,9 @@ struct IndustryTileScopeResolver : public ScopeResolver { { } - /* virtual */ uint32 GetRandomBits() const; - /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; - /* virtual */ uint32 GetTriggers() const; + uint32 GetRandomBits() const override; + uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override; + uint32 GetTriggers() const override; }; /** Resolver for industry tiles. */ @@ -45,7 +45,7 @@ struct IndustryTileResolverObject : public ResolverObject { IndustryTileResolverObject(IndustryGfx gfx, TileIndex tile, Industry *indus, CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0); - /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) + ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override { switch (scope) { case VSG_SCOPE_SELF: return &indtile_scope; diff --git a/src/newgrf_object.h b/src/newgrf_object.h index 43c8de031c..1ab351be91 100644 --- a/src/newgrf_object.h +++ b/src/newgrf_object.h @@ -116,8 +116,8 @@ struct ObjectScopeResolver : public ScopeResolver { { } - /* virtual */ uint32 GetRandomBits() const; - /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; + uint32 GetRandomBits() const override; + uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override; }; /** A resolver object to be used with feature 0F spritegroups. */ @@ -129,7 +129,7 @@ struct ObjectResolverObject : public ResolverObject { CallbackID callback = CBID_NO_CALLBACK, uint32 param1 = 0, uint32 param2 = 0); ~ObjectResolverObject(); - /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) + ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override { switch (scope) { case VSG_SCOPE_SELF: diff --git a/src/newgrf_railtype.h b/src/newgrf_railtype.h index 5fadcd2ab5..829c166cb8 100644 --- a/src/newgrf_railtype.h +++ b/src/newgrf_railtype.h @@ -32,8 +32,8 @@ struct RailTypeScopeResolver : public ScopeResolver { { } - /* virtual */ uint32 GetRandomBits() const; - /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; + uint32 GetRandomBits() const override; + uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override; }; /** Resolver object for rail types. */ @@ -42,7 +42,7 @@ struct RailTypeResolverObject : public ResolverObject { RailTypeResolverObject(const RailtypeInfo *rti, TileIndex tile, TileContext context, RailTypeSpriteGroup rtsg, uint32 param1 = 0, uint32 param2 = 0); - /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) + ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override { switch (scope) { case VSG_SCOPE_SELF: return &this->railtype_scope; @@ -50,7 +50,7 @@ struct RailTypeResolverObject : public ResolverObject { } } - /* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const; + const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override; }; SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSpriteGroup rtsg, TileContext context = TCX_NORMAL, uint *num_results = NULL); diff --git a/src/newgrf_station.h b/src/newgrf_station.h index 123330d0ad..2a19b5811d 100644 --- a/src/newgrf_station.h +++ b/src/newgrf_station.h @@ -42,10 +42,10 @@ struct StationScopeResolver : public ScopeResolver { { } - /* virtual */ uint32 GetRandomBits() const; - /* virtual */ uint32 GetTriggers() const; + uint32 GetRandomBits() const override; + uint32 GetTriggers() const override; - /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; + uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override; }; /** Station resolver. */ @@ -59,7 +59,7 @@ struct StationResolverObject : public ResolverObject { TownScopeResolver *GetTown(); - /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) + ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override { switch (scope) { case VSG_SCOPE_SELF: @@ -76,7 +76,7 @@ struct StationResolverObject : public ResolverObject { } } - /* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const; + const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override; }; enum StationClassID { diff --git a/src/newgrf_town.h b/src/newgrf_town.h index 7c4fb5395c..a55f71f369 100644 --- a/src/newgrf_town.h +++ b/src/newgrf_town.h @@ -46,7 +46,7 @@ struct TownResolverObject : public ResolverObject { TownResolverObject(const struct GRFFile *grffile, Town *t, bool readonly); - /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) + ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override { switch (scope) { case VSG_SCOPE_SELF: return &town_scope; diff --git a/src/os/macosx/crashlog_osx.cpp b/src/os/macosx/crashlog_osx.cpp index ad258bbc91..c1b3213402 100644 --- a/src/os/macosx/crashlog_osx.cpp +++ b/src/os/macosx/crashlog_osx.cpp @@ -52,7 +52,7 @@ class CrashLogOSX : public CrashLog { char filename_save[MAX_PATH]; ///< Path of crash.sav char filename_screenshot[MAX_PATH]; ///< Path of crash.(png|bmp|pcx) - /* virtual */ char *LogOSVersion(char *buffer, const char *last) const + char *LogOSVersion(char *buffer, const char *last) const override { int ver_maj, ver_min, ver_bug; GetMacOSVersion(&ver_maj, &ver_min, &ver_bug); @@ -71,7 +71,7 @@ class CrashLogOSX : public CrashLog { ); } - /* virtual */ char *LogError(char *buffer, const char *last, const char *message) const + char *LogError(char *buffer, const char *last, const char *message) const override { return buffer + seprintf(buffer, last, "Crash reason:\n" @@ -83,7 +83,7 @@ class CrashLogOSX : public CrashLog { ); } - /* virtual */ char *LogStacktrace(char *buffer, const char *last) const + char *LogStacktrace(char *buffer, const char *last) const override { /* As backtrace() is only implemented in 10.5 or later, * we're rolling our own here. Mostly based on diff --git a/src/os/unix/crashlog_unix.cpp b/src/os/unix/crashlog_unix.cpp index 47de057f7e..2e9f4215fe 100644 --- a/src/os/unix/crashlog_unix.cpp +++ b/src/os/unix/crashlog_unix.cpp @@ -40,7 +40,7 @@ class CrashLogUnix : public CrashLog { /** Signal that has been thrown. */ int signum; - /* virtual */ char *LogOSVersion(char *buffer, const char *last) const + char *LogOSVersion(char *buffer, const char *last) const override { struct utsname name; if (uname(&name) < 0) { @@ -60,7 +60,7 @@ class CrashLogUnix : public CrashLog { ); } - /* virtual */ char *LogError(char *buffer, const char *last, const char *message) const + char *LogError(char *buffer, const char *last, const char *message) const override { return buffer + seprintf(buffer, last, "Crash reason:\n" @@ -105,7 +105,7 @@ class CrashLogUnix : public CrashLog { } #endif - /* virtual */ char *LogStacktrace(char *buffer, const char *last) const + char *LogStacktrace(char *buffer, const char *last) const override { buffer += seprintf(buffer, last, "Stacktrace:\n"); #if defined(__GLIBC__) diff --git a/src/os/windows/crashlog_win.cpp b/src/os/windows/crashlog_win.cpp index 1abb0e725c..6bcaed837e 100644 --- a/src/os/windows/crashlog_win.cpp +++ b/src/os/windows/crashlog_win.cpp @@ -43,14 +43,14 @@ class CrashLogWindows : public CrashLog { /** Information about the encountered exception */ EXCEPTION_POINTERS *ep; - /* virtual */ char *LogOSVersion(char *buffer, const char *last) const; - /* virtual */ char *LogError(char *buffer, const char *last, const char *message) const; - /* virtual */ char *LogStacktrace(char *buffer, const char *last) const; - /* virtual */ char *LogRegisters(char *buffer, const char *last) const; - /* virtual */ char *LogModules(char *buffer, const char *last) const; + char *LogOSVersion(char *buffer, const char *last) const override; + char *LogError(char *buffer, const char *last, const char *message) const override; + char *LogStacktrace(char *buffer, const char *last) const override; + char *LogRegisters(char *buffer, const char *last) const override; + char *LogModules(char *buffer, const char *last) const override; public: #if defined(_MSC_VER) - /* virtual */ int WriteCrashDump(char *filename, const char *filename_last) const; + int WriteCrashDump(char *filename, const char *filename_last) const override; char *AppendDecodedStacktrace(char *buffer, const char *last) const; #else char *AppendDecodedStacktrace(char *buffer, const char *last) const { return buffer; } diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index cd30ed8592..f066d014d3 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -1844,7 +1844,7 @@ struct FileReader : LoadFilter { _sl.sf = NULL; } - /* virtual */ size_t Read(byte *buf, size_t size) + size_t Read(byte *buf, size_t size) override { /* We're in the process of shutting down, i.e. in "failure" mode. */ if (this->file == NULL) return 0; @@ -1852,7 +1852,7 @@ struct FileReader : LoadFilter { return fread(buf, 1, size, this->file); } - /* virtual */ void Reset() + void Reset() override { clearerr(this->file); if (fseek(this->file, this->begin, SEEK_SET)) { @@ -1882,7 +1882,7 @@ struct FileWriter : SaveFilter { _sl.sf = NULL; } - /* virtual */ void Write(byte *buf, size_t size) + void Write(byte *buf, size_t size) override { /* We're in the process of shutting down, i.e. in "failure" mode. */ if (this->file == NULL) return; @@ -1890,7 +1890,7 @@ struct FileWriter : SaveFilter { if (fwrite(buf, 1, size, this->file) != size) SlError(STR_GAME_SAVELOAD_ERROR_FILE_NOT_WRITEABLE); } - /* virtual */ void Finish() + void Finish() override { if (this->file != NULL) fclose(this->file); this->file = NULL; @@ -1918,7 +1918,7 @@ struct LZOLoadFilter : LoadFilter { if (lzo_init() != LZO_E_OK) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "cannot initialize decompressor"); } - /* virtual */ size_t Read(byte *buf, size_t ssize) + size_t Read(byte *buf, size_t ssize) override { assert(ssize >= LZO_BUFFER_SIZE); @@ -1966,7 +1966,7 @@ struct LZOSaveFilter : SaveFilter { if (lzo_init() != LZO_E_OK) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "cannot initialize compressor"); } - /* virtual */ void Write(byte *buf, size_t size) + void Write(byte *buf, size_t size) override { const lzo_bytep in = buf; /* Buffer size is from the LZO docs plus the chunk header size. */ @@ -2005,7 +2005,7 @@ struct NoCompLoadFilter : LoadFilter { { } - /* virtual */ size_t Read(byte *buf, size_t size) + size_t Read(byte *buf, size_t size) override { return this->chain->Read(buf, size); } @@ -2022,7 +2022,7 @@ struct NoCompSaveFilter : SaveFilter { { } - /* virtual */ void Write(byte *buf, size_t size) + void Write(byte *buf, size_t size) override { this->chain->Write(buf, size); } @@ -2056,7 +2056,7 @@ struct ZlibLoadFilter : LoadFilter { inflateEnd(&this->z); } - /* virtual */ size_t Read(byte *buf, size_t size) + size_t Read(byte *buf, size_t size) override { this->z.next_out = buf; this->z.avail_out = (uint)size; @@ -2135,12 +2135,12 @@ struct ZlibSaveFilter : SaveFilter { } while (this->z.avail_in || !this->z.avail_out); } - /* virtual */ void Write(byte *buf, size_t size) + void Write(byte *buf, size_t size) override { this->WriteLoop(buf, size, 0); } - /* virtual */ void Finish() + void Finish() override { this->WriteLoop(NULL, 0, Z_FINISH); this->chain->Finish(); @@ -2185,7 +2185,7 @@ struct LZMALoadFilter : LoadFilter { lzma_end(&this->lzma); } - /* virtual */ size_t Read(byte *buf, size_t size) + size_t Read(byte *buf, size_t size) override { this->lzma.next_out = buf; this->lzma.avail_out = size; @@ -2254,12 +2254,12 @@ struct LZMASaveFilter : SaveFilter { } while (this->lzma.avail_in || !this->lzma.avail_out); } - /* virtual */ void Write(byte *buf, size_t size) + void Write(byte *buf, size_t size) override { this->WriteLoop(buf, size, LZMA_RUN); } - /* virtual */ void Finish() + void Finish() override { this->WriteLoop(NULL, 0, LZMA_FINISH); this->chain->Finish(); diff --git a/src/script/api/script_text.hpp b/src/script/api/script_text.hpp index ed14e391d0..0b82ffb20c 100644 --- a/src/script/api/script_text.hpp +++ b/src/script/api/script_text.hpp @@ -45,7 +45,7 @@ public: RawText(const char *text); ~RawText(); - /* virtual */ const char *GetEncodedText() { return this->text; } + const char *GetEncodedText() override { return this->text; } private: const char *text; }; diff --git a/src/script/script_scanner.hpp b/src/script/script_scanner.hpp index 50dad02ad2..7fecf6eb29 100644 --- a/src/script/script_scanner.hpp +++ b/src/script/script_scanner.hpp @@ -77,7 +77,7 @@ public: */ const char *FindMainScript(const ContentInfo *ci, bool md5sum); - /* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename); + bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override; /** * Rescan the script dir. diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 60430b4906..c92701f0dd 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -152,7 +152,7 @@ struct BaseSetTextfileWindow : public TextfileWindow { this->LoadTextfile(textfile, BASESET_DIR); } - /* virtual */ void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_TF_CAPTION) { SetDParam(0, content_type); diff --git a/src/sound/allegro_s.h b/src/sound/allegro_s.h index e0a247f7b3..255be66c74 100644 --- a/src/sound/allegro_s.h +++ b/src/sound/allegro_s.h @@ -17,12 +17,12 @@ /** Implementation of the allegro sound driver. */ class SoundDriver_Allegro : public SoundDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param); - /* virtual */ void Stop(); + void Stop(); - /* virtual */ void MainLoop(); - /* virtual */ const char *GetName() const { return "allegro"; } + void MainLoop(); + const char *GetName() const { return "allegro"; } }; /** Factory for the allegro sound driver. */ diff --git a/src/sound/cocoa_s.h b/src/sound/cocoa_s.h index 7010914258..dd2d740204 100644 --- a/src/sound/cocoa_s.h +++ b/src/sound/cocoa_s.h @@ -16,16 +16,16 @@ class SoundDriver_Cocoa : public SoundDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); - /* virtual */ const char *GetName() const { return "cocoa"; } + void Stop() override; + const char *GetName() const override { return "cocoa"; } }; class FSoundDriver_Cocoa : public DriverFactoryBase { public: FSoundDriver_Cocoa() : DriverFactoryBase(Driver::DT_SOUND, 10, "cocoa", "Cocoa Sound Driver") {} - /* virtual */ Driver *CreateInstance() const { return new SoundDriver_Cocoa(); } + Driver *CreateInstance() const override { return new SoundDriver_Cocoa(); } }; #endif /* SOUND_COCOA_H */ diff --git a/src/sound/null_s.h b/src/sound/null_s.h index b2acd90937..ca9adb546a 100644 --- a/src/sound/null_s.h +++ b/src/sound/null_s.h @@ -17,17 +17,17 @@ /** Implementation of the null sound driver. */ class SoundDriver_Null : public SoundDriver { public: - /* virtual */ const char *Start(const char * const *param) { return NULL; } + const char *Start(const char * const *param) override { return NULL; } - /* virtual */ void Stop() { } - /* virtual */ const char *GetName() const { return "null"; } + void Stop() override { } + const char *GetName() const override { return "null"; } }; /** Factory for the null sound driver. */ class FSoundDriver_Null : public DriverFactoryBase { public: FSoundDriver_Null() : DriverFactoryBase(Driver::DT_SOUND, 1, "null", "Null Sound Driver") {} - /* virtual */ Driver *CreateInstance() const { return new SoundDriver_Null(); } + Driver *CreateInstance() const override { return new SoundDriver_Null(); } }; #endif /* SOUND_NULL_H */ diff --git a/src/sound/sdl_s.h b/src/sound/sdl_s.h index 544ce2070d..2d36b46297 100644 --- a/src/sound/sdl_s.h +++ b/src/sound/sdl_s.h @@ -17,17 +17,17 @@ /** Implementation of the SDL sound driver. */ class SoundDriver_SDL : public SoundDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); - /* virtual */ const char *GetName() const { return "sdl"; } + void Stop() override; + const char *GetName() const override { return "sdl"; } }; /** Factory for the SDL sound driver. */ class FSoundDriver_SDL : public DriverFactoryBase { public: FSoundDriver_SDL() : DriverFactoryBase(Driver::DT_SOUND, 5, "sdl", "SDL Sound Driver") {} - /* virtual */ Driver *CreateInstance() const { return new SoundDriver_SDL(); } + Driver *CreateInstance() const override { return new SoundDriver_SDL(); } }; #endif /* SOUND_SDL_H */ diff --git a/src/sound/win32_s.h b/src/sound/win32_s.h index c6c8e8d149..a0d53a2dae 100644 --- a/src/sound/win32_s.h +++ b/src/sound/win32_s.h @@ -17,17 +17,17 @@ /** Implementation of the sound driver for Windows. */ class SoundDriver_Win32 : public SoundDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); - /* virtual */ const char *GetName() const { return "win32"; } + void Stop() override; + const char *GetName() const override { return "win32"; } }; /** Factory for the sound driver for Windows. */ class FSoundDriver_Win32 : public DriverFactoryBase { public: FSoundDriver_Win32() : DriverFactoryBase(Driver::DT_SOUND, 9, "win32", "Win32 WaveOut Sound Driver") {} - /* virtual */ Driver *CreateInstance() const { return new SoundDriver_Win32(); } + Driver *CreateInstance() const override { return new SoundDriver_Win32(); } }; #endif /* SOUND_WIN32_H */ diff --git a/src/sound/xaudio2_s.h b/src/sound/xaudio2_s.h index 2385f49ee2..f3525251cf 100644 --- a/src/sound/xaudio2_s.h +++ b/src/sound/xaudio2_s.h @@ -17,17 +17,17 @@ /** Implementation of the XAudio2 sound driver. */ class SoundDriver_XAudio2 : public SoundDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); - /* virtual */ const char *GetName() const { return "xaudio2"; } + void Stop() override; + const char *GetName() const override { return "xaudio2"; } }; /** Factory for the XAudio2 sound driver. */ class FSoundDriver_XAudio2 : public DriverFactoryBase { public: FSoundDriver_XAudio2() : DriverFactoryBase(Driver::DT_SOUND, 10, "xaudio2", "XAudio2 Sound Driver") {} - /* virtual */ Driver *CreateInstance() const { return new SoundDriver_XAudio2(); } + Driver *CreateInstance() const override { return new SoundDriver_XAudio2(); } }; #endif /* SOUND_XAUDIO2_H */ diff --git a/src/station_base.h b/src/station_base.h index b3a4a76c71..243a2f0cec 100644 --- a/src/station_base.h +++ b/src/station_base.h @@ -490,12 +490,12 @@ public: void MarkTilesDirty(bool cargo_change) const; - void UpdateVirtCoord(); + void UpdateVirtCoord() override; void AfterStationTileSetChange(bool adding, StationType type); - /* virtual */ uint GetPlatformLength(TileIndex tile, DiagDirection dir) const; - /* virtual */ uint GetPlatformLength(TileIndex tile) const; + uint GetPlatformLength(TileIndex tile, DiagDirection dir) const override; + uint GetPlatformLength(TileIndex tile) const override; void RecomputeCatchment(); static void RecomputeCatchmentForAll(); @@ -509,7 +509,7 @@ public: return this->catchment_tiles.HasTile(tile); } - /* virtual */ inline bool TileBelongsToRailStation(TileIndex tile) const + inline bool TileBelongsToRailStation(TileIndex tile) const override { return IsRailStationTile(tile) && GetStationIndex(tile) == this->index; } @@ -519,9 +519,9 @@ public: return IsAirportTile(tile) && GetStationIndex(tile) == this->index; } - /* virtual */ uint32 GetNewGRFVariable(const ResolverObject &object, byte variable, byte parameter, bool *available) const; + uint32 GetNewGRFVariable(const ResolverObject &object, byte variable, byte parameter, bool *available) const override; - /* virtual */ void GetTileArea(TileArea *ta, StationType type) const; + void GetTileArea(TileArea *ta, StationType type) const override; }; #define FOR_ALL_STATIONS(var) FOR_ALL_BASE_STATIONS_OF_TYPE(Station, var) diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index 11e6b8dbde..5b361430f5 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -115,14 +115,14 @@ struct FileStringReader : StringReader { fclose(this->fh); } - /* virtual */ char *ReadLine(char *buffer, const char *last) + char *ReadLine(char *buffer, const char *last) override { return fgets(buffer, ClampToU16(last - buffer + 1), this->fh); } - /* virtual */ void HandlePragma(char *str); + void HandlePragma(char *str) override; - /* virtual */ void ParseFile() + void ParseFile() override { this->StringReader::ParseFile(); diff --git a/src/strings.cpp b/src/strings.cpp index c4ae5218a3..57a1757021 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -2032,18 +2032,18 @@ class LanguagePackGlyphSearcher : public MissingGlyphSearcher { uint i; ///< Iterator for the primary language tables. uint j; ///< Iterator for the secondary language tables. - /* virtual */ void Reset() + void Reset() override { this->i = 0; this->j = 0; } - /* virtual */ FontSize DefaultSize() + FontSize DefaultSize() override { return FS_NORMAL; } - /* virtual */ const char *NextString() + const char *NextString() override { if (this->i >= TEXT_TAB_END) return NULL; @@ -2058,12 +2058,12 @@ class LanguagePackGlyphSearcher : public MissingGlyphSearcher { return ret; } - /* virtual */ bool Monospace() + bool Monospace() override { return false; } - /* virtual */ void SetFontNames(FreeTypeSettings *settings, const char *font_name) + void SetFontNames(FreeTypeSettings *settings, const char *font_name) override { #ifdef WITH_FREETYPE strecpy(settings->small.font, font_name, lastof(settings->small.font)); diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index 19b411fed0..d04827c772 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -69,14 +69,14 @@ static const NIVariable _niv_vehicles[] = { }; class NIHVehicle : public NIHelper { - bool IsInspectable(uint index) const { return Vehicle::Get(index)->GetGRF() != NULL; } - uint GetParent(uint index) const { const Vehicle *first = Vehicle::Get(index)->First(); return GetInspectWindowNumber(GetGrfSpecFeature(first->type), first->index); } - const void *GetInstance(uint index)const { return Vehicle::Get(index); } - const void *GetSpec(uint index) const { return Vehicle::Get(index)->GetEngine(); } - void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_VEHICLE_NAME, index); } - uint32 GetGRFID(uint index) const { return Vehicle::Get(index)->GetGRFID(); } - - /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const + bool IsInspectable(uint index) const override { return Vehicle::Get(index)->GetGRF() != NULL; } + uint GetParent(uint index) const override { const Vehicle *first = Vehicle::Get(index)->First(); return GetInspectWindowNumber(GetGrfSpecFeature(first->type), first->index); } + const void *GetInstance(uint index)const override { return Vehicle::Get(index); } + const void *GetSpec(uint index) const override { return Vehicle::Get(index)->GetEngine(); } + void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_VEHICLE_NAME, index); } + uint32 GetGRFID(uint index) const override { return Vehicle::Get(index)->GetGRFID(); } + + uint Resolve(uint index, uint var, uint param, bool *avail) const override { Vehicle *v = Vehicle::Get(index); VehicleResolverObject ro(v->engine_type, v, VehicleResolverObject::WO_CACHED); @@ -132,14 +132,14 @@ static const NIVariable _niv_stations[] = { }; class NIHStation : public NIHelper { - bool IsInspectable(uint index) const { return GetStationSpec(index) != NULL; } - uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); } - const void *GetInstance(uint index)const { return NULL; } - const void *GetSpec(uint index) const { return GetStationSpec(index); } - void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); } - uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? GetStationSpec(index)->grf_prop.grffile->grfid : 0; } - - /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const + bool IsInspectable(uint index) const override { return GetStationSpec(index) != NULL; } + uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); } + const void *GetInstance(uint index)const override { return NULL; } + const void *GetSpec(uint index) const override { return GetStationSpec(index); } + void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); } + uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetStationSpec(index)->grf_prop.grffile->grfid : 0; } + + uint Resolve(uint index, uint var, uint param, bool *avail) const override { StationResolverObject ro(GetStationSpec(index), Station::GetByTile(index), index); return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail); @@ -197,14 +197,14 @@ static const NIVariable _niv_house[] = { }; class NIHHouse : public NIHelper { - bool IsInspectable(uint index) const { return HouseSpec::Get(GetHouseType(index))->grf_prop.grffile != NULL; } - uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, GetTownIndex(index)); } - const void *GetInstance(uint index)const { return NULL; } - const void *GetSpec(uint index) const { return HouseSpec::Get(GetHouseType(index)); } - void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_TOWN_NAME, GetTownIndex(index), index); } - uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? HouseSpec::Get(GetHouseType(index))->grf_prop.grffile->grfid : 0; } - - /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const + bool IsInspectable(uint index) const override { return HouseSpec::Get(GetHouseType(index))->grf_prop.grffile != NULL; } + uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, GetTownIndex(index)); } + const void *GetInstance(uint index)const override { return NULL; } + const void *GetSpec(uint index) const override { return HouseSpec::Get(GetHouseType(index)); } + void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_TOWN_NAME, GetTownIndex(index), index); } + uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? HouseSpec::Get(GetHouseType(index))->grf_prop.grffile->grfid : 0; } + + uint Resolve(uint index, uint var, uint param, bool *avail) const override { HouseResolverObject ro(GetHouseType(index), index, Town::GetByTile(index)); return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail); @@ -247,14 +247,14 @@ static const NIVariable _niv_industrytiles[] = { }; class NIHIndustryTile : public NIHelper { - bool IsInspectable(uint index) const { return GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile != NULL; } - uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_INDUSTRIES, GetIndustryIndex(index)); } - const void *GetInstance(uint index)const { return NULL; } - const void *GetSpec(uint index) const { return GetIndustryTileSpec(GetIndustryGfx(index)); } - void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_INDUSTRY_NAME, GetIndustryIndex(index), index); } - uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile->grfid : 0; } - - /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const + bool IsInspectable(uint index) const override { return GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile != NULL; } + uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_INDUSTRIES, GetIndustryIndex(index)); } + const void *GetInstance(uint index)const override { return NULL; } + const void *GetSpec(uint index) const override { return GetIndustryTileSpec(GetIndustryGfx(index)); } + void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_INDUSTRY_NAME, GetIndustryIndex(index), index); } + uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile->grfid : 0; } + + uint Resolve(uint index, uint var, uint param, bool *avail) const override { IndustryTileResolverObject ro(GetIndustryGfx(index), index, Industry::GetByTile(index)); return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail); @@ -346,23 +346,23 @@ static const NIVariable _niv_industries[] = { }; class NIHIndustry : public NIHelper { - bool IsInspectable(uint index) const { return GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile != NULL; } - uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Industry::Get(index)->town->index); } - const void *GetInstance(uint index)const { return Industry::Get(index); } - const void *GetSpec(uint index) const { return GetIndustrySpec(Industry::Get(index)->type); } - void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_INDUSTRY_NAME, index); } - uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile->grfid : 0; } - - /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const + bool IsInspectable(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile != NULL; } + uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Industry::Get(index)->town->index); } + const void *GetInstance(uint index)const override { return Industry::Get(index); } + const void *GetSpec(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type); } + void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_INDUSTRY_NAME, index); } + uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile->grfid : 0; } + + uint Resolve(uint index, uint var, uint param, bool *avail) const override { Industry *i = Industry::Get(index); IndustriesResolverObject ro(i->location.tile, i, i->type); return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail); } - uint GetPSASize(uint index, uint32 grfid) const { return cpp_lengthof(PersistentStorage, storage); } + uint GetPSASize(uint index, uint32 grfid) const override { return cpp_lengthof(PersistentStorage, storage); } - const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const + const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const override { const Industry *i = (const Industry *)this->GetInstance(index); if (i->psa == NULL) return NULL; @@ -411,14 +411,14 @@ static const NIVariable _niv_objects[] = { }; class NIHObject : public NIHelper { - bool IsInspectable(uint index) const { return ObjectSpec::GetByTile(index)->grf_prop.grffile != NULL; } - uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Object::GetByTile(index)->town->index); } - const void *GetInstance(uint index)const { return Object::GetByTile(index); } - const void *GetSpec(uint index) const { return ObjectSpec::GetByTile(index); } - void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_OBJECT, INVALID_STRING_ID, index); } - uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? ObjectSpec::GetByTile(index)->grf_prop.grffile->grfid : 0; } - - /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const + bool IsInspectable(uint index) const override { return ObjectSpec::GetByTile(index)->grf_prop.grffile != NULL; } + uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Object::GetByTile(index)->town->index); } + const void *GetInstance(uint index)const override { return Object::GetByTile(index); } + const void *GetSpec(uint index) const override { return ObjectSpec::GetByTile(index); } + void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_OBJECT, INVALID_STRING_ID, index); } + uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? ObjectSpec::GetByTile(index)->grf_prop.grffile->grfid : 0; } + + uint Resolve(uint index, uint var, uint param, bool *avail) const override { ObjectResolverObject ro(ObjectSpec::GetByTile(index), Object::GetByTile(index), index); return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail); @@ -445,14 +445,14 @@ static const NIVariable _niv_railtypes[] = { }; class NIHRailType : public NIHelper { - bool IsInspectable(uint index) const { return true; } - uint GetParent(uint index) const { return UINT32_MAX; } - const void *GetInstance(uint index)const { return NULL; } - const void *GetSpec(uint index) const { return NULL; } - void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, INVALID_STRING_ID, index); } - uint32 GetGRFID(uint index) const { return 0; } - - /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const + bool IsInspectable(uint index) const override { return true; } + uint GetParent(uint index) const override { return UINT32_MAX; } + const void *GetInstance(uint index)const override { return NULL; } + const void *GetSpec(uint index) const override { return NULL; } + void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, INVALID_STRING_ID, index); } + uint32 GetGRFID(uint index) const override { return 0; } + + uint Resolve(uint index, uint var, uint param, bool *avail) const override { /* There is no unique GRFFile for the tile. Multiple GRFs can define different parts of the railtype. * However, currently the NewGRF Debug GUI does not display variables depending on the GRF (like 0x7F) anyway. */ @@ -481,14 +481,14 @@ static const NICallback _nic_airporttiles[] = { }; class NIHAirportTile : public NIHelper { - bool IsInspectable(uint index) const { return AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile != NULL; } - uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); } - const void *GetInstance(uint index)const { return NULL; } - const void *GetSpec(uint index) const { return AirportTileSpec::Get(GetAirportGfx(index)); } - void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); } - uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile->grfid : 0; } - - /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const + bool IsInspectable(uint index) const override { return AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile != NULL; } + uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); } + const void *GetInstance(uint index)const override { return NULL; } + const void *GetSpec(uint index) const override { return AirportTileSpec::Get(GetAirportGfx(index)); } + void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); } + uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile->grfid : 0; } + + uint Resolve(uint index, uint var, uint param, bool *avail) const override { AirportTileResolverObject ro(AirportTileSpec::GetByTile(index), index, Station::GetByTile(index)); return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail); @@ -519,22 +519,22 @@ static const NIVariable _niv_towns[] = { }; class NIHTown : public NIHelper { - bool IsInspectable(uint index) const { return Town::IsValidID(index); } - uint GetParent(uint index) const { return UINT32_MAX; } - const void *GetInstance(uint index)const { return Town::Get(index); } - const void *GetSpec(uint index) const { return NULL; } - void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_TOWN_NAME, index); } - uint32 GetGRFID(uint index) const { return 0; } - bool PSAWithParameter() const { return true; } - uint GetPSASize(uint index, uint32 grfid) const { return cpp_lengthof(PersistentStorage, storage); } - - /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const + bool IsInspectable(uint index) const override { return Town::IsValidID(index); } + uint GetParent(uint index) const override { return UINT32_MAX; } + const void *GetInstance(uint index)const override { return Town::Get(index); } + const void *GetSpec(uint index) const override { return NULL; } + void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_TOWN_NAME, index); } + uint32 GetGRFID(uint index) const override { return 0; } + bool PSAWithParameter() const override { return true; } + uint GetPSASize(uint index, uint32 grfid) const override { return cpp_lengthof(PersistentStorage, storage); } + + uint Resolve(uint index, uint var, uint param, bool *avail) const override { TownResolverObject ro(NULL, Town::Get(index), true); return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail); } - const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const + const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const override { Town *t = Town::Get(index); diff --git a/src/thread/thread_os2.cpp b/src/thread/thread_os2.cpp index c66e2ad643..976283f231 100644 --- a/src/thread/thread_os2.cpp +++ b/src/thread/thread_os2.cpp @@ -41,13 +41,13 @@ public: thread = _beginthread(stThreadProc, NULL, 1048576, this); } - /* virtual */ bool Exit() + bool Exit() override { _endthread(); return true; } - /* virtual */ void Join() + void Join() override { DosWaitThread(&this->thread, DCWW_WAIT); this->thread = 0; @@ -106,13 +106,13 @@ public: DosCreateEventSem(NULL, &event, 0, FALSE); } - /* virtual */ ~ThreadMutex_OS2() + ~ThreadMutex_OS2() override { DosCloseMutexSem(mutex); DosCloseEventSem(event); } - /* virtual */ void BeginCritical(bool allow_recursive = false) + void BeginCritical(bool allow_recursive = false) override { /* os2 mutex is recursive by itself */ DosRequestMutexSem(mutex, (unsigned long) SEM_INDEFINITE_WAIT); @@ -120,14 +120,14 @@ public: if (!allow_recursive && this->recursive_count != 1) NOT_REACHED(); } - /* virtual */ void EndCritical(bool allow_recursive = false) + void EndCritical(bool allow_recursive = false) override { if (!allow_recursive && this->recursive_count != 1) NOT_REACHED(); this->recursive_count--; DosReleaseMutexSem(mutex); } - /* virtual */ void WaitForSignal() + void WaitForSignal() override { assert(this->recursive_count == 1); // Do we need to call Begin/EndCritical multiple times otherwise? this->EndCritical(); @@ -135,7 +135,7 @@ public: this->BeginCritical(); } - /* virtual */ void SendSignal() + void SendSignal() override { DosPostEventSem(event); } diff --git a/src/thread/thread_pthread.cpp b/src/thread/thread_pthread.cpp index 8aed5ee136..afb259183e 100644 --- a/src/thread/thread_pthread.cpp +++ b/src/thread/thread_pthread.cpp @@ -45,14 +45,14 @@ public: pthread_create(&this->thread, NULL, &stThreadProc, this); } - /* virtual */ bool Exit() + bool Exit() override { assert(pthread_self() == this->thread); /* For now we terminate by throwing an error, gives much cleaner cleanup */ throw OTTDThreadExitSignal(); } - /* virtual */ void Join() + void Join() override { /* You cannot join yourself */ assert(pthread_self() != this->thread); @@ -129,7 +129,7 @@ public: pthread_cond_init(&this->condition, NULL); } - /* virtual */ ~ThreadMutex_pthread() + ~ThreadMutex_pthread() override { int err = pthread_cond_destroy(&this->condition); assert(err != EBUSY); @@ -142,7 +142,7 @@ public: return this->owner == pthread_self(); } - /* virtual */ void BeginCritical(bool allow_recursive = false) + void BeginCritical(bool allow_recursive = false) override { /* pthread mutex is not recursive by itself */ if (this->IsOwnedByCurrentThread()) { @@ -156,7 +156,7 @@ public: this->recursive_count++; } - /* virtual */ void EndCritical(bool allow_recursive = false) + void EndCritical(bool allow_recursive = false) override { assert(this->IsOwnedByCurrentThread()); if (!allow_recursive && this->recursive_count != 1) NOT_REACHED(); @@ -167,7 +167,7 @@ public: assert(err == 0); } - /* virtual */ void WaitForSignal() + void WaitForSignal() override { uint old_recursive_count = this->recursive_count; this->recursive_count = 0; @@ -178,7 +178,7 @@ public: this->recursive_count = old_recursive_count; } - /* virtual */ void SendSignal() + void SendSignal() override { int err = pthread_cond_signal(&this->condition); assert(err == 0); diff --git a/src/thread/thread_win32.cpp b/src/thread/thread_win32.cpp index a01ea8e108..506faa069e 100644 --- a/src/thread/thread_win32.cpp +++ b/src/thread/thread_win32.cpp @@ -49,7 +49,7 @@ public: ResumeThread(this->thread); } - /* virtual */ ~ThreadObject_Win32() + ~ThreadObject_Win32() override { if (this->thread != NULL) { CloseHandle(this->thread); @@ -57,14 +57,14 @@ public: } } - /* virtual */ bool Exit() + bool Exit() override { assert(GetCurrentThreadId() == this->id); /* For now we terminate by throwing an error, gives much cleaner cleanup */ throw OTTDThreadExitSignal(); } - /* virtual */ void Join() + void Join() override { /* You cannot join yourself */ assert(GetCurrentThreadId() != this->id); @@ -126,13 +126,13 @@ public: this->event = CreateEvent(NULL, FALSE, FALSE, NULL); } - /* virtual */ ~ThreadMutex_Win32() + ~ThreadMutex_Win32() override { DeleteCriticalSection(&this->critical_section); CloseHandle(this->event); } - /* virtual */ void BeginCritical(bool allow_recursive = false) + void BeginCritical(bool allow_recursive = false) override { /* windows mutex is recursive by itself */ EnterCriticalSection(&this->critical_section); @@ -140,14 +140,14 @@ public: if (!allow_recursive && this->recursive_count != 1) NOT_REACHED(); } - /* virtual */ void EndCritical(bool allow_recursive = false) + void EndCritical(bool allow_recursive = false) override { if (!allow_recursive && this->recursive_count != 1) NOT_REACHED(); this->recursive_count--; LeaveCriticalSection(&this->critical_section); } - /* virtual */ void WaitForSignal() + void WaitForSignal() override { assert(this->recursive_count == 1); // Do we need to call Begin/EndCritical multiple times otherwise? this->EndCritical(); @@ -155,7 +155,7 @@ public: this->BeginCritical(); } - /* virtual */ void SendSignal() + void SendSignal() override { SetEvent(this->event); } diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index 2277a5cf6f..c3bf5953d7 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -1332,7 +1332,7 @@ public: return type == WWT_IMGBTN || type == WWT_IMGBTN_2 || type == WWT_PUSHIMGBTN; } - void SetupSmallestSize(Window *w, bool init_array) + void SetupSmallestSize(Window *w, bool init_array) override { this->smallest_x = 0; // Biggest child this->smallest_y = 0; // Biggest child @@ -1365,7 +1365,7 @@ public: _toolbar_width = nbuttons * this->smallest_x; } - void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) + void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) override { assert(given_width >= this->smallest_x && given_height >= this->smallest_y); @@ -1428,7 +1428,7 @@ public: } } - /* virtual */ void Draw(const Window *w) + void Draw(const Window *w) override { /* Draw brown-red toolbar bg. */ GfxFillRect(this->pos_x, this->pos_y, this->pos_x + this->current_x - 1, this->pos_y + this->current_y - 1, PC_VERY_DARK_RED); @@ -1443,7 +1443,7 @@ public: } } - /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y) + NWidgetCore *GetWidgetFromPos(int x, int y) override { if (!IsInsideBS(x, this->pos_x, this->current_x) || !IsInsideBS(y, this->pos_y, this->current_y)) return NULL; @@ -1470,7 +1470,7 @@ public: /** Container for the 'normal' main toolbar */ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer { - /* virtual */ const byte *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const + const byte *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const override { static const uint SMALLEST_ARRANGEMENT = 14; static const uint BIGGEST_ARRANGEMENT = 20; @@ -1793,7 +1793,7 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer { class NWidgetScenarioToolbarContainer : public NWidgetToolbarContainer { uint panel_widths[2]; ///< The width of the two panels (the text panel and date panel) - void SetupSmallestSize(Window *w, bool init_array) + void SetupSmallestSize(Window *w, bool init_array) override { this->NWidgetToolbarContainer::SetupSmallestSize(w, init_array); @@ -1808,7 +1808,7 @@ class NWidgetScenarioToolbarContainer : public NWidgetToolbarContainer { } } - /* virtual */ const byte *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const + const byte *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const override { static const byte arrange_all[] = { WID_TE_PAUSE, diff --git a/src/video/allegro_v.h b/src/video/allegro_v.h index a770635da0..f68ce5781d 100644 --- a/src/video/allegro_v.h +++ b/src/video/allegro_v.h @@ -17,30 +17,30 @@ /** The allegro video driver. */ class VideoDriver_Allegro : public VideoDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void MakeDirty(int left, int top, int width, int height); + void MakeDirty(int left, int top, int width, int height) override; - /* virtual */ void MainLoop(); + void MainLoop() override; - /* virtual */ bool ChangeResolution(int w, int h); + bool ChangeResolution(int w, int h) override; - /* virtual */ bool ToggleFullscreen(bool fullscreen); + bool ToggleFullscreen(bool fullscreen) override; - /* virtual */ bool AfterBlitterChange(); + bool AfterBlitterChange() override; - /* virtual */ bool ClaimMousePointer(); + bool ClaimMousePointer() override; - /* virtual */ const char *GetName() const { return "allegro"; } + const char *GetName() const override { return "allegro"; } }; /** Factory for the allegro video driver. */ class FVideoDriver_Allegro : public DriverFactoryBase { public: FVideoDriver_Allegro() : DriverFactoryBase(Driver::DT_VIDEO, 4, "allegro", "Allegro Video Driver") {} - /* virtual */ Driver *CreateInstance() const { return new VideoDriver_Allegro(); } + Driver *CreateInstance() const override { return new VideoDriver_Allegro(); } }; #endif /* VIDEO_ALLEGRO_H */ diff --git a/src/video/cocoa/cocoa_v.h b/src/video/cocoa/cocoa_v.h index 564daefe0f..2614eef537 100644 --- a/src/video/cocoa/cocoa_v.h +++ b/src/video/cocoa/cocoa_v.h @@ -16,10 +16,10 @@ class VideoDriver_Cocoa : public VideoDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; /** Stop the video driver */ - /* virtual */ void Stop(); + void Stop() override; /** Mark dirty a screen region * @param left x-coordinate of left border @@ -27,44 +27,44 @@ public: * @param width width or dirty rectangle * @param height height of dirty rectangle */ - /* virtual */ void MakeDirty(int left, int top, int width, int height); + void MakeDirty(int left, int top, int width, int height) override; /** Programme main loop */ - /* virtual */ void MainLoop(); + void MainLoop() override; /** Change window resolution * @param w New window width * @param h New window height * @return Whether change was successful */ - /* virtual */ bool ChangeResolution(int w, int h); + bool ChangeResolution(int w, int h) override; /** Set a new window mode * @param fullscreen Whether to set fullscreen mode or not * @return Whether changing the screen mode was successful */ - /* virtual */ bool ToggleFullscreen(bool fullscreen); + bool ToggleFullscreen(bool fullscreen) override; /** Callback invoked after the blitter was changed. * @return True if no error. */ - /* virtual */ bool AfterBlitterChange(); + bool AfterBlitterChange() override; /** * An edit box lost the input focus. Abort character compositing if necessary. */ - /* virtual */ void EditBoxLostFocus(); + void EditBoxLostFocus() override; /** Return driver name * @return driver name */ - /* virtual */ const char *GetName() const { return "cocoa"; } + const char *GetName() const override { return "cocoa"; } }; class FVideoDriver_Cocoa : public DriverFactoryBase { public: FVideoDriver_Cocoa() : DriverFactoryBase(Driver::DT_VIDEO, 10, "cocoa", "Cocoa Video Driver") {} - /* virtual */ Driver *CreateInstance() const { return new VideoDriver_Cocoa(); } + Driver *CreateInstance() const override { return new VideoDriver_Cocoa(); } }; diff --git a/src/video/dedicated_v.h b/src/video/dedicated_v.h index 0c1477d66d..bdf873c3d7 100644 --- a/src/video/dedicated_v.h +++ b/src/video/dedicated_v.h @@ -17,19 +17,19 @@ /** The dedicated server video driver. */ class VideoDriver_Dedicated : public VideoDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void MakeDirty(int left, int top, int width, int height); + void MakeDirty(int left, int top, int width, int height) override; - /* virtual */ void MainLoop(); + void MainLoop() override; - /* virtual */ bool ChangeResolution(int w, int h); + bool ChangeResolution(int w, int h) override; - /* virtual */ bool ToggleFullscreen(bool fullscreen); - /* virtual */ const char *GetName() const { return "dedicated"; } - /* virtual */ bool HasGUI() const { return false; } + bool ToggleFullscreen(bool fullscreen) override; + const char *GetName() const override { return "dedicated"; } + bool HasGUI() const override { return false; } }; /** Factory for the dedicated server video driver. */ @@ -43,7 +43,7 @@ public: static const int PRIORITY = 0; #endif FVideoDriver_Dedicated() : DriverFactoryBase(Driver::DT_VIDEO, PRIORITY, "dedicated", "Dedicated Video Driver") {} - /* virtual */ Driver *CreateInstance() const { return new VideoDriver_Dedicated(); } + Driver *CreateInstance() const override { return new VideoDriver_Dedicated(); } }; #endif /* VIDEO_DEDICATED_H */ diff --git a/src/video/null_v.h b/src/video/null_v.h index 9e04e177ef..a3b2cb5a81 100644 --- a/src/video/null_v.h +++ b/src/video/null_v.h @@ -20,26 +20,26 @@ private: uint ticks; ///< Amount of ticks to run. public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void MakeDirty(int left, int top, int width, int height); + void MakeDirty(int left, int top, int width, int height) override; - /* virtual */ void MainLoop(); + void MainLoop() override; - /* virtual */ bool ChangeResolution(int w, int h); + bool ChangeResolution(int w, int h) override; - /* virtual */ bool ToggleFullscreen(bool fullscreen); - /* virtual */ const char *GetName() const { return "null"; } - /* virtual */ bool HasGUI() const { return false; } + bool ToggleFullscreen(bool fullscreen) override; + const char *GetName() const override { return "null"; } + bool HasGUI() const override { return false; } }; /** Factory the null video driver. */ class FVideoDriver_Null : public DriverFactoryBase { public: FVideoDriver_Null() : DriverFactoryBase(Driver::DT_VIDEO, 0, "null", "Null Video Driver") {} - /* virtual */ Driver *CreateInstance() const { return new VideoDriver_Null(); } + Driver *CreateInstance() const override { return new VideoDriver_Null(); } }; #endif /* VIDEO_NULL_H */ diff --git a/src/video/sdl_v.h b/src/video/sdl_v.h index 8855c3566e..cafdbbc614 100644 --- a/src/video/sdl_v.h +++ b/src/video/sdl_v.h @@ -17,27 +17,27 @@ /** The SDL video driver. */ class VideoDriver_SDL : public VideoDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void MakeDirty(int left, int top, int width, int height); + void MakeDirty(int left, int top, int width, int height) override; - /* virtual */ void MainLoop(); + void MainLoop() override; - /* virtual */ bool ChangeResolution(int w, int h); + bool ChangeResolution(int w, int h) override; - /* virtual */ bool ToggleFullscreen(bool fullscreen); + bool ToggleFullscreen(bool fullscreen) override; - /* virtual */ bool AfterBlitterChange(); + bool AfterBlitterChange() override; - /* virtual */ void AcquireBlitterLock(); + void AcquireBlitterLock() override; - /* virtual */ void ReleaseBlitterLock(); + void ReleaseBlitterLock() override; - /* virtual */ bool ClaimMousePointer(); + bool ClaimMousePointer() override; - /* virtual */ const char *GetName() const { return "sdl"; } + const char *GetName() const override { return "sdl"; } private: int PollEvent(); bool CreateMainSurface(uint w, uint h); @@ -48,7 +48,7 @@ private: class FVideoDriver_SDL : public DriverFactoryBase { public: FVideoDriver_SDL() : DriverFactoryBase(Driver::DT_VIDEO, 5, "sdl", "SDL Video Driver") {} - /* virtual */ Driver *CreateInstance() const { return new VideoDriver_SDL(); } + Driver *CreateInstance() const override { return new VideoDriver_SDL(); } }; #endif /* VIDEO_SDL_H */ diff --git a/src/video/win32_v.h b/src/video/win32_v.h index 7609d0422d..aa6bb7c0d5 100644 --- a/src/video/win32_v.h +++ b/src/video/win32_v.h @@ -17,29 +17,29 @@ /** The video driver for windows. */ class VideoDriver_Win32 : public VideoDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void MakeDirty(int left, int top, int width, int height); + void MakeDirty(int left, int top, int width, int height) override; - /* virtual */ void MainLoop(); + void MainLoop() override; - /* virtual */ bool ChangeResolution(int w, int h); + bool ChangeResolution(int w, int h) override; - /* virtual */ bool ToggleFullscreen(bool fullscreen); + bool ToggleFullscreen(bool fullscreen) override; - /* virtual */ bool AfterBlitterChange(); + bool AfterBlitterChange() override; - /* virtual */ void AcquireBlitterLock(); + void AcquireBlitterLock() override; - /* virtual */ void ReleaseBlitterLock(); + void ReleaseBlitterLock() override; - /* virtual */ bool ClaimMousePointer(); + bool ClaimMousePointer() override; - /* virtual */ void EditBoxLostFocus(); + void EditBoxLostFocus() override; - /* virtual */ const char *GetName() const { return "win32"; } + const char *GetName() const override { return "win32"; } bool MakeWindow(bool full_screen); }; @@ -48,7 +48,7 @@ public: class FVideoDriver_Win32 : public DriverFactoryBase { public: FVideoDriver_Win32() : DriverFactoryBase(Driver::DT_VIDEO, 10, "win32", "Win32 GDI Video Driver") {} - /* virtual */ Driver *CreateInstance() const { return new VideoDriver_Win32(); } + Driver *CreateInstance() const override { return new VideoDriver_Win32(); } }; #endif /* VIDEO_WIN32_H */ diff --git a/src/waypoint_base.h b/src/waypoint_base.h index 8d544a3b99..c11c2f2b2f 100644 --- a/src/waypoint_base.h +++ b/src/waypoint_base.h @@ -25,23 +25,23 @@ struct Waypoint FINAL : SpecializedStation { Waypoint(TileIndex tile = INVALID_TILE) : SpecializedStation(tile) { } ~Waypoint(); - void UpdateVirtCoord(); + void UpdateVirtCoord() override; - /* virtual */ inline bool TileBelongsToRailStation(TileIndex tile) const + inline bool TileBelongsToRailStation(TileIndex tile) const override { return IsRailWaypointTile(tile) && GetStationIndex(tile) == this->index; } - /* virtual */ uint32 GetNewGRFVariable(const struct ResolverObject &object, byte variable, byte parameter, bool *available) const; + uint32 GetNewGRFVariable(const struct ResolverObject &object, byte variable, byte parameter, bool *available) const override; - /* virtual */ void GetTileArea(TileArea *ta, StationType type) const; + void GetTileArea(TileArea *ta, StationType type) const override; - /* virtual */ uint GetPlatformLength(TileIndex tile, DiagDirection dir) const + uint GetPlatformLength(TileIndex tile, DiagDirection dir) const override { return 1; } - /* virtual */ uint GetPlatformLength(TileIndex tile) const + uint GetPlatformLength(TileIndex tile) const override { return 1; } diff --git a/src/widget_type.h b/src/widget_type.h index 33fb8bce08..0467630c9d 100644 --- a/src/widget_type.h +++ b/src/widget_type.h @@ -293,11 +293,11 @@ public: inline void SetDisabled(bool disabled); inline bool IsDisabled() const; - /* virtual */ void FillNestedArray(NWidgetBase **array, uint length); - /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y); - /* virtual */ bool IsHighlighted() const; - /* virtual */ TextColour GetHighlightColour() const; - /* virtual */ void SetHighlighted(TextColour highlight_colour); + void FillNestedArray(NWidgetBase **array, uint length) override; + NWidgetCore *GetWidgetFromPos(int x, int y) override; + bool IsHighlighted() const override; + TextColour GetHighlightColour() const override; + void SetHighlighted(TextColour highlight_colour) override; NWidgetDisplay disp_flags; ///< Flags that affect display and interaction with the widget. Colours colour; ///< Colour of this widget. @@ -371,12 +371,12 @@ public: ~NWidgetContainer(); void Add(NWidgetBase *wid); - /* virtual */ void FillNestedArray(NWidgetBase **array, uint length); + void FillNestedArray(NWidgetBase **array, uint length) override; /** Return whether the container is empty. */ inline bool IsEmpty() { return head == NULL; } - /* virtual */ NWidgetBase *GetWidgetOfType(WidgetType tp); + NWidgetBase *GetWidgetOfType(WidgetType tp) override; protected: NWidgetBase *head; ///< Pointer to first widget in container. @@ -408,12 +408,12 @@ public: void SetIndex(int index); - void SetupSmallestSize(Window *w, bool init_array); - void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl); - /* virtual */ void FillNestedArray(NWidgetBase **array, uint length); + void SetupSmallestSize(Window *w, bool init_array) override; + void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) override; + void FillNestedArray(NWidgetBase **array, uint length) override; - /* virtual */ void Draw(const Window *w); - /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y); + void Draw(const Window *w) override; + NWidgetCore *GetWidgetFromPos(int x, int y) override; void SetDisplayedPlane(int plane); @@ -437,8 +437,8 @@ public: void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post); - /* virtual */ void Draw(const Window *w); - /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y); + void Draw(const Window *w) override; + NWidgetCore *GetWidgetFromPos(int x, int y) override; protected: NWidContainerFlags flags; ///< Flags of the container. @@ -500,12 +500,12 @@ public: void SetCount(int count); void SetScrollbar(Scrollbar *sb); - void SetupSmallestSize(Window *w, bool init_array); - void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl); - /* virtual */ void FillNestedArray(NWidgetBase **array, uint length); + void SetupSmallestSize(Window *w, bool init_array) override; + void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) override; + void FillNestedArray(NWidgetBase **array, uint length) override; - /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y); - /* virtual */ void Draw(const Window *w); + NWidgetCore *GetWidgetFromPos(int x, int y) override; + void Draw(const Window *w) override; protected: int index; ///< If non-negative, index in the #Window::nested_array. Colours colour; ///< Colour of this widget. @@ -530,12 +530,12 @@ class NWidgetSpacer : public NWidgetResizeBase { public: NWidgetSpacer(int length, int height); - void SetupSmallestSize(Window *w, bool init_array); - /* virtual */ void FillNestedArray(NWidgetBase **array, uint length); + void SetupSmallestSize(Window *w, bool init_array) override; + void FillNestedArray(NWidgetBase **array, uint length) override; - /* virtual */ void Draw(const Window *w); - /* virtual */ void SetDirty(const Window *w) const; - /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y); + void Draw(const Window *w) override; + void SetDirty(const Window *w) const override; + NWidgetCore *GetWidgetFromPos(int x, int y) override; }; /** @@ -550,14 +550,14 @@ public: void Add(NWidgetBase *nwid); void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post); - void SetupSmallestSize(Window *w, bool init_array); - void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl); + void SetupSmallestSize(Window *w, bool init_array) override; + void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) override; - /* virtual */ void FillNestedArray(NWidgetBase **array, uint length); + void FillNestedArray(NWidgetBase **array, uint length) override; - /* virtual */ void Draw(const Window *w); - /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y); - /* virtual */ NWidgetBase *GetWidgetOfType(WidgetType tp); + void Draw(const Window *w) override; + NWidgetCore *GetWidgetFromPos(int x, int y) override; + NWidgetBase *GetWidgetOfType(WidgetType tp) override; private: NWidgetPIPContainer *child; ///< Child widget. @@ -576,8 +576,8 @@ class NWidgetViewport : public NWidgetCore { public: NWidgetViewport(int index); - /* virtual */ void SetupSmallestSize(Window *w, bool init_array); - /* virtual */ void Draw(const Window *w); + void SetupSmallestSize(Window *w, bool init_array) override; + void Draw(const Window *w) override; void InitializeViewport(Window *w, uint32 follow_flags, ZoomLevel zoom); void UpdateViewportCoordinates(Window *w); @@ -751,8 +751,8 @@ class NWidgetScrollbar : public NWidgetCore, public Scrollbar { public: NWidgetScrollbar(WidgetType tp, Colours colour, int index); - /* virtual */ void SetupSmallestSize(Window *w, bool init_array); - /* virtual */ void Draw(const Window *w); + void SetupSmallestSize(Window *w, bool init_array) override; + void Draw(const Window *w) override; static void InvalidateDimensionCache(); static Dimension GetVerticalDimension(); @@ -771,8 +771,8 @@ class NWidgetLeaf : public NWidgetCore { public: NWidgetLeaf(WidgetType tp, Colours colour, int index, uint32 data, StringID tip); - /* virtual */ void SetupSmallestSize(Window *w, bool init_array); - /* virtual */ void Draw(const Window *w); + void SetupSmallestSize(Window *w, bool init_array) override; + void Draw(const Window *w) override; bool ButtonHit(const Point &pt); From aafce475963e2d2df59de9b02242a04856e78f93 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Mon, 4 Mar 2019 07:28:52 +0000 Subject: [PATCH 29/82] Codechange: Use override specifier for DropDownListItem classes. --- src/company_gui.cpp | 6 +++--- src/toolbar_gui.cpp | 8 ++++---- src/widgets/dropdown_type.h | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/company_gui.cpp b/src/company_gui.cpp index de5498102d..3862cd9da3 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -524,17 +524,17 @@ public: return this->result >= COLOUR_END ? STR_COLOUR_DEFAULT : _colour_dropdown[this->result]; } - uint Height(uint width) const + uint Height(uint width) const override { return max(FONT_HEIGHT_NORMAL, ScaleGUITrad(12) + 2); } - bool Selectable() const + bool Selectable() const override { return true; } - void Draw(int left, int right, int top, int bottom, bool sel, Colours bg_colour) const + void Draw(int left, int right, int top, int bottom, bool sel, Colours bg_colour) const override { bool rtl = _current_text_dir == TD_RTL; int height = bottom - top; diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index c3bf5953d7..c3555f107a 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -127,12 +127,12 @@ public: this->lock_size = GetSpriteSize(SPR_LOCK); } - bool Selectable() const + bool Selectable() const override { return true; } - uint Width() const + uint Width() const override { CompanyID company = (CompanyID)this->result; SetDParam(0, company); @@ -140,12 +140,12 @@ public: return GetStringBoundingBox(STR_COMPANY_NAME_COMPANY_NUM).width + this->icon_size.width + this->lock_size.width + 6; } - uint Height(uint width) const + uint Height(uint width) const override { return max(max(this->icon_size.height, this->lock_size.height) + 2U, (uint)FONT_HEIGHT_NORMAL); } - void Draw(int left, int right, int top, int bottom, bool sel, Colours bg_colour) const + void Draw(int left, int right, int top, int bottom, bool sel, Colours bg_colour) const override { CompanyID company = (CompanyID)this->result; bool rtl = _current_text_dir == TD_RTL; diff --git a/src/widgets/dropdown_type.h b/src/widgets/dropdown_type.h index 8300dd26d7..56510b0abe 100644 --- a/src/widgets/dropdown_type.h +++ b/src/widgets/dropdown_type.h @@ -44,9 +44,9 @@ public: DropDownListStringItem(StringID string, int result, bool masked) : DropDownListItem(result, masked), string(string) {} - virtual bool Selectable() const { return true; } - virtual uint Width() const; - virtual void Draw(int left, int right, int top, int bottom, bool sel, Colours bg_colour) const; + bool Selectable() const override { return true; } + uint Width() const override; + void Draw(int left, int right, int top, int bottom, bool sel, Colours bg_colour) const override; virtual StringID String() const { return this->string; } static int CDECL NatSortFunc(const DropDownListItem * const *first, const DropDownListItem * const *second); @@ -61,8 +61,8 @@ public: DropDownListParamStringItem(StringID string, int result, bool masked) : DropDownListStringItem(string, result, masked) {} - virtual StringID String() const; - virtual void SetParam(uint index, uint64 value) { decode_params[index] = value; } + StringID String() const override; + void SetParam(uint index, uint64 value) { decode_params[index] = value; } }; /** @@ -74,7 +74,7 @@ public: DropDownListCharStringItem(const char *raw_string, int result, bool masked) : DropDownListStringItem(STR_JUST_RAW_STRING, result, masked), raw_string(raw_string) {} - virtual StringID String() const; + StringID String() const override; }; /** From 317f69c1520a3e60335c56d358686609d3decf86 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Mon, 4 Mar 2019 07:49:37 +0000 Subject: [PATCH 30/82] Codechange: Use override specifier in Window-derived classes. --- src/ai/ai_gui.cpp | 60 +++++++++++----------- src/airport_gui.cpp | 26 +++++----- src/autoreplace_gui.cpp | 16 +++--- src/bootstrap_gui.cpp | 14 ++--- src/bridge_gui.cpp | 14 ++--- src/build_vehicle_gui.cpp | 20 ++++---- src/cheat_gui.cpp | 10 ++-- src/company_gui.cpp | 76 +++++++++++++-------------- src/console_gui.cpp | 26 +++++----- src/date_gui.cpp | 10 ++-- src/depot_gui.cpp | 30 +++++------ src/dock_gui.cpp | 26 +++++----- src/engine_gui.cpp | 8 +-- src/error_gui.cpp | 16 +++--- src/fios_gui.cpp | 18 +++---- src/framerate_gui.cpp | 20 ++++---- src/genworld_gui.cpp | 36 ++++++------- src/graph_gui.cpp | 62 +++++++++++----------- src/group_gui.cpp | 26 +++++----- src/highscore_gui.cpp | 8 +-- src/industry_gui.cpp | 78 ++++++++++++++-------------- src/intro_gui.cpp | 10 ++-- src/linkgraph/linkgraph_gui.h | 10 ++-- src/main_gui.cpp | 14 ++--- src/misc_gui.cpp | 44 ++++++++-------- src/music_gui.cpp | 20 ++++---- src/network/network_chat_gui.cpp | 16 +++--- src/network/network_content_gui.cpp | 26 +++++----- src/network/network_content_gui.h | 4 +- src/network/network_gui.cpp | 80 ++++++++++++++--------------- src/newgrf_debug_gui.cpp | 28 +++++----- src/newgrf_gui.cpp | 68 ++++++++++++------------ src/news_gui.cpp | 28 +++++----- src/object_gui.cpp | 14 ++--- src/order_gui.cpp | 30 +++++------ src/osk_gui.cpp | 12 ++--- src/rail_gui.cpp | 58 ++++++++++----------- src/road_gui.cpp | 34 ++++++------ src/settings_gui.cpp | 46 ++++++++--------- src/signs_gui.cpp | 26 +++++----- src/smallmap_gui.cpp | 8 +-- src/station_gui.cpp | 46 ++++++++--------- src/statusbar_gui.cpp | 14 ++--- src/story_gui.cpp | 16 +++--- src/subsidy_gui.cpp | 10 ++-- src/terraform_gui.cpp | 32 ++++++------ src/timetable_gui.cpp | 16 +++--- src/toolbar_gui.cpp | 46 ++++++++--------- src/town_gui.cpp | 52 +++++++++---------- src/transparency_gui.cpp | 10 ++-- src/tree_gui.cpp | 16 +++--- src/vehicle_gui.cpp | 74 +++++++++++++------------- src/viewport_gui.cpp | 12 ++--- src/waypoint_gui.cpp | 10 ++-- 54 files changed, 765 insertions(+), 765 deletions(-) diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 5a4c772468..0609696e12 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -98,7 +98,7 @@ struct AIListWindow : public Window { } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_AIL_CAPTION: @@ -107,7 +107,7 @@ struct AIListWindow : public Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget == WID_AIL_LIST) { this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM; @@ -118,7 +118,7 @@ struct AIListWindow : public Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_AIL_LIST: { @@ -183,7 +183,7 @@ struct AIListWindow : public Window { DeleteWindowByClass(WC_QUERY_STRING); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_AIL_LIST: { // Select one of the AIs @@ -211,7 +211,7 @@ struct AIListWindow : public Window { } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_AIL_LIST); } @@ -221,7 +221,7 @@ struct AIListWindow : public Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (_game_mode == GM_NORMAL && Company::IsValidID(this->slot)) { delete this; @@ -317,7 +317,7 @@ struct AISettingsWindow : public Window { this->RebuildVisibleSettings(); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_AIS_CAPTION: @@ -346,7 +346,7 @@ struct AISettingsWindow : public Window { this->vscroll->SetCount((int)this->visible_settings.size()); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget == WID_AIS_BACKGROUND) { this->line_height = max(SETTING_BUTTON_HEIGHT, FONT_HEIGHT_NORMAL) + WD_MATRIX_TOP + WD_MATRIX_BOTTOM; @@ -357,7 +357,7 @@ struct AISettingsWindow : public Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_AIS_BACKGROUND) return; @@ -421,7 +421,7 @@ struct AISettingsWindow : public Window { } } - virtual void OnPaint() + void OnPaint() override { if (this->closing_dropdown) { this->closing_dropdown = false; @@ -430,7 +430,7 @@ struct AISettingsWindow : public Window { this->DrawWidgets(); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_AIS_BACKGROUND: { @@ -530,7 +530,7 @@ struct AISettingsWindow : public Window { } } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (StrEmpty(str)) return; VisibleSettingsList::const_iterator it = this->visible_settings.begin(); @@ -542,7 +542,7 @@ struct AISettingsWindow : public Window { this->SetDirty(); } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { assert(this->clicked_dropdown); VisibleSettingsList::const_iterator it = this->visible_settings.begin(); @@ -553,7 +553,7 @@ struct AISettingsWindow : public Window { this->SetDirty(); } - virtual void OnDropdownClose(Point pt, int widget, int index, bool instant_close) + void OnDropdownClose(Point pt, int widget, int index, bool instant_close) override { /* We cannot raise the dropdown button just yet. OnClick needs some hint, whether * the same dropdown button was clicked again, and then not open the dropdown again. @@ -564,12 +564,12 @@ struct AISettingsWindow : public Window { this->SetDirty(); } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_AIS_BACKGROUND); } - virtual void OnRealtimeTick(uint delta_ms) + void OnRealtimeTick(uint delta_ms) override { if (this->timeout.Elapsed(delta_ms)) { this->clicked_button = -1; @@ -582,7 +582,7 @@ struct AISettingsWindow : public Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { this->RebuildVisibleSettings(); HideDropDownMenu(this); @@ -743,7 +743,7 @@ struct AIConfigWindow : public Window { DeleteWindowByClass(WC_AI_SETTINGS); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_AIC_NUMBER: @@ -767,7 +767,7 @@ struct AIConfigWindow : public Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_AIC_GAMELIST: @@ -819,7 +819,7 @@ struct AIConfigWindow : public Window { return slot < max_slot; } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_AIC_GAMELIST: { @@ -858,7 +858,7 @@ struct AIConfigWindow : public Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (widget >= WID_AIC_TEXTFILE && widget < WID_AIC_TEXTFILE + TFT_END) { if (this->selected_slot == INVALID_COMPANY || GetConfig(this->selected_slot) == NULL) return; @@ -939,7 +939,7 @@ struct AIConfigWindow : public Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!IsEditable(this->selected_slot)) { this->selected_slot = INVALID_COMPANY; @@ -1096,7 +1096,7 @@ struct AIDebugWindow : public Window { this->InvalidateData(-1); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget == WID_AID_LOG_PANEL) { resize->height = FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; @@ -1104,7 +1104,7 @@ struct AIDebugWindow : public Window { } } - virtual void OnPaint() + void OnPaint() override { this->SelectValidDebugCompany(); @@ -1182,7 +1182,7 @@ struct AIDebugWindow : public Window { this->last_vscroll_pos = this->vscroll->GetPosition(); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_AID_NAME_TEXT: @@ -1205,7 +1205,7 @@ struct AIDebugWindow : public Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (ai_debug_company == INVALID_COMPANY) return; @@ -1264,7 +1264,7 @@ struct AIDebugWindow : public Window { this->last_vscroll_pos = this->vscroll->GetPosition(); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { /* Also called for hotkeys, so check for disabledness */ if (this->IsWidgetDisabled(widget)) return; @@ -1334,7 +1334,7 @@ struct AIDebugWindow : public Window { } } - virtual void OnEditboxChanged(int wid) + void OnEditboxChanged(int wid) override { if (wid == WID_AID_BREAK_STR_EDIT_BOX) { /* Save the current string to static member so it can be restored next time the window is opened. */ @@ -1349,7 +1349,7 @@ struct AIDebugWindow : public Window { * This is the company ID of the AI/GS which wrote a new log message, or -1 in other cases. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { /* If the log message is related to the active company tab, check the break string. * This needs to be done in gameloop-scope, so the AI is suspended immediately. */ @@ -1406,7 +1406,7 @@ struct AIDebugWindow : public Window { (ai_debug_company == OWNER_DEITY ? !Game::IsPaused() : !AI::IsPaused(ai_debug_company))); } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_AID_LOG_PANEL); } diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 243f91b247..353e080805 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -87,14 +87,14 @@ struct BuildAirToolbarWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; if (!CanBuildVehicleInfrastructure(VEH_AIRCRAFT)) delete this; } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_AT_AIRPORT: @@ -114,7 +114,7 @@ struct BuildAirToolbarWindow : Window { } - virtual void OnPlaceObject(Point pt, TileIndex tile) + void OnPlaceObject(Point pt, TileIndex tile) override { switch (this->last_user_action) { case WID_AT_AIRPORT: @@ -129,19 +129,19 @@ struct BuildAirToolbarWindow : Window { } } - virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) + void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) override { VpSelectTilesWithMethod(pt.x, pt.y, select_method); } - virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) + void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) override { if (pt.x != -1 && select_proc == DDSP_DEMOLISH_AREA) { GUIPlaceProcDragXY(select_proc, start_tile, end_tile); } } - virtual void OnPlaceObjectAbort() + void OnPlaceObjectAbort() override { this->RaiseButtons(); @@ -268,7 +268,7 @@ public: DeleteWindowById(WC_SELECT_STATION, 0); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_AP_CLASS_DROPDOWN: @@ -293,7 +293,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_AP_CLASS_DROPDOWN: { @@ -357,7 +357,7 @@ public: } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_AP_AIRPORT_LIST: { @@ -394,7 +394,7 @@ public: } } - virtual void OnPaint() + void OnPaint() override { this->DrawWidgets(); @@ -462,7 +462,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_AP_CLASS_DROPDOWN: @@ -535,7 +535,7 @@ public: this->SelectOtherAirport(-1); } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { assert(widget == WID_AP_CLASS_DROPDOWN); _selected_airport_class = (AirportClassID)index; @@ -543,7 +543,7 @@ public: this->SelectFirstAvailableAirport(false); } - virtual void OnRealtimeTick(uint delta_ms) + void OnRealtimeTick(uint delta_ms) override { CheckRedrawStationCoverage(this); } diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index eae0a378eb..196d076da7 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -237,7 +237,7 @@ public: this->sel_group = id_g; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_RV_SORT_ASCENDING_DESCENDING: { @@ -316,7 +316,7 @@ public: } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_RV_CAPTION: @@ -353,7 +353,7 @@ public: } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_RV_SORT_ASCENDING_DESCENDING: @@ -394,7 +394,7 @@ public: } } - virtual void OnPaint() + void OnPaint() override { if (this->engines[0].NeedRebuild() || this->engines[1].NeedRebuild()) this->GenerateLists(); @@ -437,7 +437,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_RV_SORT_ASCENDING_DESCENDING: @@ -516,7 +516,7 @@ public: } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { switch (widget) { case WID_RV_SORT_DROPDOWN: @@ -557,7 +557,7 @@ public: } } - virtual void OnResize() + void OnResize() override { this->vscroll[0]->SetCapacityFromWidget(this, WID_RV_LEFT_MATRIX); this->vscroll[1]->SetCapacityFromWidget(this, WID_RV_RIGHT_MATRIX); @@ -568,7 +568,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (data != 0) { /* This needs to be done in command-scope to enforce rebuilding before resorting invalid data */ diff --git a/src/bootstrap_gui.cpp b/src/bootstrap_gui.cpp index 01d83848b8..b6fb35bffd 100644 --- a/src/bootstrap_gui.cpp +++ b/src/bootstrap_gui.cpp @@ -56,7 +56,7 @@ public: ResizeWindow(this, _screen.width, _screen.height); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { GfxFillRect(r.left, r.top, r.right, r.bottom, 4, FILLRECT_OPAQUE); GfxFillRect(r.left, r.top, r.right, r.bottom, 0, FILLRECT_CHECKER); @@ -88,7 +88,7 @@ public: { } - virtual void OnDownloadComplete(ContentID cid) + void OnDownloadComplete(ContentID cid) override { /* We have completed downloading. We can trigger finding the right set now. */ BaseGraphics::FindSets(); @@ -142,7 +142,7 @@ public: _network_content_client.RemoveCallback(this); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { /* We cache the button size. This is safe as no reinit can happen here. */ if (this->button_size.width == 0) { @@ -165,14 +165,14 @@ public: } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != 0) return; DrawStringMultiLine(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, r.top + WD_FRAMETEXT_TOP, r.bottom - WD_FRAMETEXT_BOTTOM, STR_MISSING_GRAPHICS_SET_MESSAGE, TC_FROMSTRING, SA_CENTER); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_BAFD_YES: @@ -189,13 +189,13 @@ public: } } - virtual void OnConnect(bool success) + void OnConnect(bool success) override { /* Once connected, request the metadata. */ _network_content_client.RequestContentList(CONTENT_TYPE_BASE_GRAPHICS); } - virtual void OnReceiveContentInfo(const ContentInfo *ci) + void OnReceiveContentInfo(const ContentInfo *ci) override { /* And once the meta data is received, start downloading it. */ _network_content_client.Select(ci->id); diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 768691f080..29cb5a085f 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -163,7 +163,7 @@ public: delete bridges; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_BBS_DROPDOWN_ORDER: { @@ -207,7 +207,7 @@ public: } } - virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) + Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override { /* Position the window so hopefully the first bridge from the list is under the mouse pointer. */ NWidgetBase *list = this->GetWidget(WID_BBS_BRIDGE_LIST); @@ -217,7 +217,7 @@ public: return corner; } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_BBS_DROPDOWN_ORDER: @@ -243,7 +243,7 @@ public: } } - virtual EventState OnKeyPress(WChar key, uint16 keycode) + EventState OnKeyPress(WChar key, uint16 keycode) override { const uint8 i = keycode - '1'; if (i < 9 && i < this->bridges->Length()) { @@ -255,7 +255,7 @@ public: return ES_NOT_HANDLED; } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { default: break; @@ -279,7 +279,7 @@ public: } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { if (widget == WID_BBS_DROPDOWN_CRITERIA && this->bridges->SortType() != index) { this->bridges->SetSortType(index); @@ -288,7 +288,7 @@ public: } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_BBS_BRIDGE_LIST); } diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 0ac23cfde6..77c175ee7b 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1100,7 +1100,7 @@ struct BuildVehicleWindow : Window { this->eng_list.SetFilterState(this->cargo_filter[this->cargo_filter_criteria] != CF_ANY); } - void OnInit() + void OnInit() override { this->SetCargoFilterArray(); } @@ -1272,7 +1272,7 @@ struct BuildVehicleWindow : Window { this->eng_list.RebuildDone(); } - void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_BV_SORT_ASCENDING_DESCENDING: @@ -1345,7 +1345,7 @@ struct BuildVehicleWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; /* When switching to original acceleration model for road vehicles, clear the selected sort criteria if it is not available now. */ @@ -1358,7 +1358,7 @@ struct BuildVehicleWindow : Window { this->eng_list.ForceRebuild(); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_BV_CAPTION: @@ -1390,7 +1390,7 @@ struct BuildVehicleWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_BV_LIST: @@ -1420,7 +1420,7 @@ struct BuildVehicleWindow : Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_BV_LIST: @@ -1433,7 +1433,7 @@ struct BuildVehicleWindow : Window { } } - virtual void OnPaint() + void OnPaint() override { this->GenerateBuildList(); this->vscroll->SetCount(this->eng_list.Length()); @@ -1460,14 +1460,14 @@ struct BuildVehicleWindow : Window { } } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (str == NULL) return; DoCommandP(0, this->rename_engine, 0, CMD_RENAME_ENGINE | CMD_MSG(STR_ERROR_CAN_T_RENAME_TRAIN_TYPE + this->vehicle_type), NULL, str); } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { switch (widget) { case WID_BV_SORT_DROPDOWN: @@ -1491,7 +1491,7 @@ struct BuildVehicleWindow : Window { this->SetDirty(); } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_BV_LIST); } diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp index fda2b246e4..e6bfc8c0a2 100644 --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -221,7 +221,7 @@ struct CheatWindow : Window { this->InitNested(); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_C_PANEL) return; @@ -283,7 +283,7 @@ struct CheatWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_C_PANEL) return; @@ -330,7 +330,7 @@ struct CheatWindow : Window { size->height = this->header_height + WD_FRAMERECT_TOP + WD_PAR_VSEP_NORMAL + WD_FRAMERECT_BOTTOM + this->line_height * lengthof(_cheats_ui); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { const NWidgetBase *wid = this->GetWidget(WID_C_PANEL); uint btn = (pt.y - wid->pos_y - WD_FRAMERECT_TOP - this->header_height) / this->line_height; @@ -384,13 +384,13 @@ struct CheatWindow : Window { this->SetDirty(); } - virtual void OnTimeout() + void OnTimeout() override { this->clicked = 0; this->SetDirty(); } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { /* Was 'cancel' pressed or nothing entered? */ if (str == NULL || StrEmpty(str)) return; diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 3862cd9da3..58f972364b 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -284,7 +284,7 @@ struct CompanyFinancesWindow : Window { this->owner = (Owner)this->window_number; } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_CF_CAPTION: @@ -303,7 +303,7 @@ struct CompanyFinancesWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { int type = _settings_client.gui.expenses_layout; switch (widget) { @@ -331,7 +331,7 @@ struct CompanyFinancesWindow : Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_CF_EXPS_CATEGORY: @@ -392,7 +392,7 @@ struct CompanyFinancesWindow : Window { this->GetWidget(WID_CF_SEL_BUTTONS)->SetDisplayedPlane(plane); } - virtual void OnPaint() + void OnPaint() override { if (!this->IsShaded()) { if (!this->small) { @@ -422,7 +422,7 @@ struct CompanyFinancesWindow : Window { this->DrawWidgets(); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_CF_TOGGLE_SIZE: // toggle size @@ -451,7 +451,7 @@ struct CompanyFinancesWindow : Window { } } - virtual void OnHundredthTick() + void OnHundredthTick() override { const Company *c = Company::Get((CompanyID)this->window_number); if (c->money > CompanyFinancesWindow::max_money) { @@ -740,7 +740,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_SCL_SPACER_DROPDOWN: { @@ -793,7 +793,7 @@ public: } } - virtual void OnPaint() + void OnPaint() override { bool local = (CompanyID)this->window_number == _local_company; @@ -807,7 +807,7 @@ public: this->DrawWidgets(); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_SCL_CAPTION: @@ -847,7 +847,7 @@ public: } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_SCL_MATRIX) return; @@ -911,7 +911,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { /* Livery Class buttons */ @@ -985,12 +985,12 @@ public: } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_SCL_MATRIX); } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { bool local = (CompanyID)this->window_number == _local_company; if (!local) return; @@ -1016,7 +1016,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; @@ -1368,7 +1368,7 @@ public: } } - virtual void OnInit() + void OnInit() override { /* Size of the boolean yes/no button. */ Dimension yesno_dim = maxdim(GetStringBoundingBox(STR_FACE_YES), GetStringBoundingBox(STR_FACE_NO)); @@ -1391,7 +1391,7 @@ public: this->number_dim = number_dim; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_SCMF_FACE: { @@ -1450,7 +1450,7 @@ public: } } - virtual void OnPaint() + void OnPaint() override { /* lower the non-selected gender button */ this->SetWidgetsLoweredState(!this->is_female, WID_SCMF_MALE, WID_SCMF_MALE2, WIDGET_LIST_END); @@ -1511,7 +1511,7 @@ public: this->DrawWidgets(); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_SCMF_HAS_MOUSTACHE_EARRING_TEXT: @@ -1600,7 +1600,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { /* Toggle size, advanced/simple face selection */ @@ -1709,7 +1709,7 @@ public: } } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (str == NULL) return; /* Set a new company manager face number */ @@ -1864,7 +1864,7 @@ struct CompanyInfrastructureWindow : Window return total; } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_CI_CAPTION: @@ -1873,7 +1873,7 @@ struct CompanyInfrastructureWindow : Window } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { const Company *c = Company::Get((CompanyID)this->window_number); @@ -1996,7 +1996,7 @@ struct CompanyInfrastructureWindow : Window } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { const Company *c = Company::Get((CompanyID)this->window_number); int y = r.top; @@ -2099,7 +2099,7 @@ struct CompanyInfrastructureWindow : Window * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; @@ -2265,7 +2265,7 @@ struct CompanyWindow : Window this->OnInvalidateData(); } - virtual void OnPaint() + void OnPaint() override { const Company *c = Company::Get((CompanyID)this->window_number); bool local = this->window_number == _local_company; @@ -2334,7 +2334,7 @@ struct CompanyWindow : Window this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_C_FACE: { @@ -2393,7 +2393,7 @@ struct CompanyWindow : Window } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { const Company *c = Company::Get((CompanyID)this->window_number); switch (widget) { @@ -2504,7 +2504,7 @@ struct CompanyWindow : Window } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_C_CAPTION: @@ -2522,7 +2522,7 @@ struct CompanyWindow : Window } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_C_NEW_FACE: DoSelectCompanyManagerFace(this); break; @@ -2612,13 +2612,13 @@ struct CompanyWindow : Window } } - virtual void OnHundredthTick() + void OnHundredthTick() override { /* redraw the window every now and then */ this->SetDirty(); } - virtual void OnPlaceObject(Point pt, TileIndex tile) + void OnPlaceObject(Point pt, TileIndex tile) override { if (DoCommandP(tile, OBJECT_HQ, 0, CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_BUILD_COMPANY_HEADQUARTERS)) && !_shift_pressed) { ResetObjectToPlace(); @@ -2626,12 +2626,12 @@ struct CompanyWindow : Window } } - virtual void OnPlaceObjectAbort() + void OnPlaceObjectAbort() override { this->RaiseButtons(); } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (str == NULL) return; @@ -2658,7 +2658,7 @@ struct CompanyWindow : Window * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (this->window_number == _local_company) return; @@ -2717,7 +2717,7 @@ struct BuyCompanyWindow : Window { this->InitNested(window_number); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_BC_FACE: @@ -2733,7 +2733,7 @@ struct BuyCompanyWindow : Window { } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_BC_CAPTION: @@ -2743,7 +2743,7 @@ struct BuyCompanyWindow : Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_BC_FACE: { @@ -2762,7 +2762,7 @@ struct BuyCompanyWindow : Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_BC_NO: diff --git a/src/console_gui.cpp b/src/console_gui.cpp index ed46938cd5..3ee13946f2 100644 --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -201,7 +201,7 @@ struct IConsoleWindow : Window this->SetDirty(); } - virtual void OnPaint() + void OnPaint() override { const int right = this->width - 5; @@ -229,7 +229,7 @@ struct IConsoleWindow : Window } } - virtual void OnHundredthTick() + void OnHundredthTick() override { if (IConsoleLine::Truncate() && (IConsoleWindow::scroll > IConsoleLine::size)) { @@ -238,12 +238,12 @@ struct IConsoleWindow : Window } } - virtual void OnMouseLoop() + void OnMouseLoop() override { if (_iconsole_cmdline.HandleCaret()) this->SetDirty(); } - virtual EventState OnKeyPress(WChar key, uint16 keycode) + EventState OnKeyPress(WChar key, uint16 keycode) override { if (_focused_window != this) return ES_NOT_HANDLED; @@ -314,7 +314,7 @@ struct IConsoleWindow : Window return ES_HANDLED; } - virtual void InsertTextString(int wid, const char *str, bool marked, const char *caret, const char *insert_location, const char *replacement_end) + void InsertTextString(int wid, const char *str, bool marked, const char *caret, const char *insert_location, const char *replacement_end) override { if (_iconsole_cmdline.InsertString(str, marked, caret, insert_location, replacement_end)) { IConsoleWindow::scroll = 0; @@ -323,17 +323,17 @@ struct IConsoleWindow : Window } } - virtual const char *GetFocusedText() const + const char *GetFocusedText() const override { return _iconsole_cmdline.buf; } - virtual const char *GetCaret() const + const char *GetCaret() const override { return _iconsole_cmdline.buf + _iconsole_cmdline.caretpos; } - virtual const char *GetMarkedText(size_t *length) const + const char *GetMarkedText(size_t *length) const override { if (_iconsole_cmdline.markend == 0) return NULL; @@ -341,7 +341,7 @@ struct IConsoleWindow : Window return _iconsole_cmdline.buf + _iconsole_cmdline.markpos; } - virtual Point GetCaretPosition() const + Point GetCaretPosition() const override { int delta = min(this->width - this->line_offset - _iconsole_cmdline.pixels - ICON_RIGHT_BORDERWIDTH, 0); Point pt = {this->line_offset + delta + _iconsole_cmdline.caretxoffs, this->height - this->line_height}; @@ -349,7 +349,7 @@ struct IConsoleWindow : Window return pt; } - virtual Rect GetTextBoundingRect(const char *from, const char *to) const + Rect GetTextBoundingRect(const char *from, const char *to) const override { int delta = min(this->width - this->line_offset - _iconsole_cmdline.pixels - ICON_RIGHT_BORDERWIDTH, 0); @@ -360,7 +360,7 @@ struct IConsoleWindow : Window return r; } - virtual const char *GetTextCharacterAtPosition(const Point &pt) const + const char *GetTextCharacterAtPosition(const Point &pt) const override { int delta = min(this->width - this->line_offset - _iconsole_cmdline.pixels - ICON_RIGHT_BORDERWIDTH, 0); @@ -369,12 +369,12 @@ struct IConsoleWindow : Window return GetCharAtPosition(_iconsole_cmdline.buf, pt.x - delta); } - virtual void OnMouseWheel(int wheel) + void OnMouseWheel(int wheel) override { this->Scroll(-wheel); } - virtual void OnFocusLost() + void OnFocusLost() override { VideoDriver::GetInstance()->EditBoxLostFocus(); } diff --git a/src/date_gui.cpp b/src/date_gui.cpp index 468a74db99..53e0cf7359 100644 --- a/src/date_gui.cpp +++ b/src/date_gui.cpp @@ -55,7 +55,7 @@ struct SetDateWindow : Window { this->date.year = Clamp(this->date.year, min_year, max_year); } - virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) + Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override { Point pt = { this->parent->left + this->parent->width / 2 - sm_width / 2, this->parent->top + this->parent->height / 2 - sm_height / 2 }; return pt; @@ -100,7 +100,7 @@ struct SetDateWindow : Window { ShowDropDownList(this, list, selected, widget); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { Dimension d = {0, 0}; switch (widget) { @@ -129,7 +129,7 @@ struct SetDateWindow : Window { *size = d; } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_SD_DAY: SetDParam(0, this->date.day - 1 + STR_DAY_NUMBER_1ST); break; @@ -138,7 +138,7 @@ struct SetDateWindow : Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_SD_DAY: @@ -154,7 +154,7 @@ struct SetDateWindow : Window { } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { switch (widget) { case WID_SD_DAY: diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 39accd65f1..f2da7330ea 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -364,7 +364,7 @@ struct DepotWindow : Window { } } - void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_D_MATRIX) return; @@ -422,7 +422,7 @@ struct DepotWindow : Window { } } - void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget != WID_D_CAPTION) return; @@ -650,7 +650,7 @@ struct DepotWindow : Window { uint flag_width; uint flag_height; - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_D_MATRIX: { @@ -701,12 +701,12 @@ struct DepotWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { this->generate_list = true; } - virtual void OnPaint() + void OnPaint() override { if (this->generate_list) { /* Generate the vehicle list @@ -758,7 +758,7 @@ struct DepotWindow : Window { this->DrawWidgets(); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_D_MATRIX: { // List @@ -837,7 +837,7 @@ struct DepotWindow : Window { } } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (str == NULL) return; @@ -845,7 +845,7 @@ struct DepotWindow : Window { DoCommandP(0, GetDepotIndex(this->window_number), 0, CMD_RENAME_DEPOT | CMD_MSG(STR_ERROR_CAN_T_RENAME_DEPOT), NULL, str); } - virtual bool OnRightClick(Point pt, int widget) + bool OnRightClick(Point pt, int widget) override { if (widget != WID_D_MATRIX) return false; @@ -906,7 +906,7 @@ struct DepotWindow : Window { * @param v the original vehicle to clone * @return Always true. */ - virtual bool OnVehicleSelect(const Vehicle *v) + bool OnVehicleSelect(const Vehicle *v) override { if (_ctrl_pressed) { /* Share-clone, do not open new viewport, and keep tool active */ @@ -921,7 +921,7 @@ struct DepotWindow : Window { return true; } - virtual void OnPlaceObjectAbort() + void OnPlaceObjectAbort() override { /* abort clone */ this->RaiseWidget(WID_D_CLONE); @@ -939,7 +939,7 @@ struct DepotWindow : Window { } } - virtual void OnMouseDrag(Point pt, int widget) + void OnMouseDrag(Point pt, int widget) override { if (this->sel == INVALID_VEHICLE) return; if (widget != this->hovered_widget) { @@ -991,7 +991,7 @@ struct DepotWindow : Window { this->SetWidgetDirty(widget); } - virtual void OnDragDrop(Point pt, int widget) + void OnDragDrop(Point pt, int widget) override { switch (widget) { case WID_D_MATRIX: { @@ -1046,7 +1046,7 @@ struct DepotWindow : Window { _cursor.vehchain = false; } - virtual void OnTimeout() + void OnTimeout() override { if (!this->IsWidgetDisabled(WID_D_SELL)) { this->RaiseWidget(WID_D_SELL); @@ -1058,7 +1058,7 @@ struct DepotWindow : Window { } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_D_MATRIX); NWidgetCore *nwi = this->GetWidget(WID_D_MATRIX); @@ -1069,7 +1069,7 @@ struct DepotWindow : Window { } } - virtual EventState OnCTRLStateChange() + EventState OnCTRLStateChange() override { if (this->sel != INVALID_VEHICLE) { _cursor.vehchain = _ctrl_pressed; diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index e2224dfa28..f5ebd1f7f0 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -113,7 +113,7 @@ struct BuildDocksToolbarWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; @@ -129,7 +129,7 @@ struct BuildDocksToolbarWindow : Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_DT_CANAL: // Build canal button @@ -173,7 +173,7 @@ struct BuildDocksToolbarWindow : Window { this->last_clicked_widget = (DockToolbarWidgets)widget; } - virtual void OnPlaceObject(Point pt, TileIndex tile) + void OnPlaceObject(Point pt, TileIndex tile) override { switch (this->last_clicked_widget) { case WID_DT_CANAL: // Build canal button @@ -222,12 +222,12 @@ struct BuildDocksToolbarWindow : Window { } } - virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) + void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) override { VpSelectTilesWithMethod(pt.x, pt.y, select_method); } - virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) + void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) override { if (pt.x != -1) { switch (select_proc) { @@ -246,7 +246,7 @@ struct BuildDocksToolbarWindow : Window { } } - virtual void OnPlaceObjectAbort() + void OnPlaceObjectAbort() override { this->RaiseButtons(); @@ -256,7 +256,7 @@ struct BuildDocksToolbarWindow : Window { DeleteWindowByClass(WC_BUILD_BRIDGE); } - virtual void OnPlacePresize(Point pt, TileIndex tile_from) + void OnPlacePresize(Point pt, TileIndex tile_from) override { TileIndex tile_to = tile_from; @@ -410,7 +410,7 @@ public: DeleteWindowById(WC_SELECT_STATION, 0); } - virtual void OnPaint() + void OnPaint() override { int rad = (_settings_game.station.modified_catchment) ? CA_DOCK : CA_UNMODIFIED; @@ -437,7 +437,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case BDSW_LT_OFF: @@ -451,7 +451,7 @@ public: } } - virtual void OnRealtimeTick(uint delta_ms) + void OnRealtimeTick(uint delta_ms) override { CheckRedrawStationCoverage(this); } @@ -505,7 +505,7 @@ public: UpdateDocksDirection(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_BDD_X: @@ -516,7 +516,7 @@ public: } } - virtual void OnPaint() + void OnPaint() override { this->DrawWidgets(); @@ -531,7 +531,7 @@ public: DrawShipDepotSprite(this->GetWidget(WID_BDD_Y)->pos_x + x1, this->GetWidget(WID_BDD_Y)->pos_y + y2, AXIS_Y, DEPOT_PART_SOUTH); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_BDD_X: diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 51c7e14836..8e7f1a8246 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -75,7 +75,7 @@ struct EnginePreviewWindow : Window { this->flags |= WF_STICKY; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_EP_QUESTION) return; @@ -102,7 +102,7 @@ struct EnginePreviewWindow : Window { size->height += GetStringHeight(GetEngineInfoString(engine), size->width); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_EP_QUESTION) return; @@ -121,7 +121,7 @@ struct EnginePreviewWindow : Window { DrawStringMultiLine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, r.bottom, GetEngineInfoString(engine), TC_FROMSTRING, SA_CENTER); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_EP_YES: @@ -133,7 +133,7 @@ struct EnginePreviewWindow : Window { } } - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; diff --git a/src/error_gui.cpp b/src/error_gui.cpp index 1c59b7e8d0..47bca2638b 100644 --- a/src/error_gui.cpp +++ b/src/error_gui.cpp @@ -180,7 +180,7 @@ public: this->InitNested(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_EM_MESSAGE: { @@ -208,7 +208,7 @@ public: } } - virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) + Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override { /* Position (0, 0) given, center the window. */ if (this->position.x == 0 && this->position.y == 0) { @@ -244,18 +244,18 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { /* If company gets shut down, while displaying an error about it, remove the error message. */ if (this->face != INVALID_COMPANY && !Company::IsValidID(this->face)) delete this; } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_EM_CAPTION) CopyInDParam(0, this->decode_params, lengthof(this->decode_params)); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_EM_FACE: { @@ -292,13 +292,13 @@ public: } } - virtual void OnMouseLoop() + void OnMouseLoop() override { /* Disallow closing the window too easily, if timeout is disabled */ if (_right_button_down && this->duration != 0) delete this; } - virtual void OnHundredthTick() + void OnHundredthTick() override { /* Timeout enabled? */ if (this->duration != 0) { @@ -313,7 +313,7 @@ public: if (_window_system_initialized) ShowFirstError(); } - virtual EventState OnKeyPress(WChar key, uint16 keycode) + EventState OnKeyPress(WChar key, uint16 keycode) override { if (keycode != WKC_SPACE) return ES_NOT_HANDLED; delete this; diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index a4eb12e3a2..f2f96cd283 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -407,7 +407,7 @@ public: } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_SL_SORT_BYNAME: @@ -553,7 +553,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_SL_BACKGROUND: @@ -575,7 +575,7 @@ public: } } - virtual void OnPaint() + void OnPaint() override { if (_savegame_sort_dirty) { _savegame_sort_dirty = false; @@ -586,7 +586,7 @@ public: this->DrawWidgets(); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_SL_SORT_BYNAME: // Sort save names by name @@ -718,7 +718,7 @@ public: } } - virtual EventState OnKeyPress(WChar key, uint16 keycode) + EventState OnKeyPress(WChar key, uint16 keycode) override { if (keycode == WKC_ESC) { delete this; @@ -728,7 +728,7 @@ public: return ES_NOT_HANDLED; } - virtual void OnTimeout() + void OnTimeout() override { /* Widgets WID_SL_DELETE_SELECTION and WID_SL_SAVE_GAME only exist when saving to a file. */ if (this->fop != SLO_SAVE) return; @@ -763,7 +763,7 @@ public: } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_SL_DRIVES_DIRECTORIES_LIST); } @@ -773,7 +773,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { switch (data) { case SLIWD_RESCAN_FILES: @@ -851,7 +851,7 @@ public: } } - virtual void OnEditboxChanged(int wid) + void OnEditboxChanged(int wid) override { if (wid == WID_SL_FILTER) { this->string_filter.SetFilterTerm(this->filter_editbox.text.buf); diff --git a/src/framerate_gui.cpp b/src/framerate_gui.cpp index 060b19a4a1..fe8338899d 100644 --- a/src/framerate_gui.cpp +++ b/src/framerate_gui.cpp @@ -432,7 +432,7 @@ struct FramerateWindow : Window { ResizeWindow(this, 0, (max(MIN_ELEMENTS, this->num_displayed) - MIN_ELEMENTS) * FONT_HEIGHT_NORMAL); } - virtual void OnRealtimeTick(uint delta_ms) + void OnRealtimeTick(uint delta_ms) override { bool elapsed = this->next_update.Elapsed(delta_ms); @@ -475,7 +475,7 @@ struct FramerateWindow : Window { } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_FRW_CAPTION: @@ -503,7 +503,7 @@ struct FramerateWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_FRW_RATE_GAMELOOP: @@ -582,7 +582,7 @@ struct FramerateWindow : Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_FRW_TIMES_NAMES: { @@ -621,7 +621,7 @@ struct FramerateWindow : Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_FRW_TIMES_NAMES: @@ -646,7 +646,7 @@ struct FramerateWindow : Window { } } - virtual void OnResize() + void OnResize() override { auto *wid = this->GetWidget(WID_FRW_TIMES_NAMES); this->num_displayed = (wid->current_y - wid->min_y - VSPACING) / FONT_HEIGHT_NORMAL - 1; // subtract 1 for headings @@ -694,7 +694,7 @@ struct FrametimeGraphWindow : Window { this->InitNested(number); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_FGW_CAPTION: @@ -709,7 +709,7 @@ struct FrametimeGraphWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget == WID_FGW_GRAPH) { SetDParam(0, 100); @@ -807,7 +807,7 @@ struct FrametimeGraphWindow : Window { this->SelectVerticalScale(peak_value); } - virtual void OnRealtimeTick(uint delta_ms) + void OnRealtimeTick(uint delta_ms) override { this->SetDirty(); @@ -826,7 +826,7 @@ struct FrametimeGraphWindow : Window { return (value - src_min) * dst_diff / src_diff + dst_min; } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget == WID_FGW_GRAPH) { const TimingMeasurement *durations = _pf_data[this->element].durations; diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index b22ba5287e..4631d02ee4 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -332,7 +332,7 @@ struct GenerateLandscapeWindow : public Window { } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_GL_START_DATE_TEXT: SetDParam(0, ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1)); break; @@ -393,7 +393,7 @@ struct GenerateLandscapeWindow : public Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; /* Update the climate buttons */ @@ -440,7 +440,7 @@ struct GenerateLandscapeWindow : public Window { } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { const StringID *strs = NULL; switch (widget) { @@ -518,7 +518,7 @@ struct GenerateLandscapeWindow : public Window { size->height = max(size->height, (uint)(FONT_HEIGHT_NORMAL + WD_DROPDOWNTEXT_TOP + WD_DROPDOWNTEXT_BOTTOM)); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_GL_HEIGHTMAP_NAME_TEXT: { @@ -528,7 +528,7 @@ struct GenerateLandscapeWindow : public Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_GL_TEMPERATE: @@ -703,7 +703,7 @@ struct GenerateLandscapeWindow : public Window { } } - virtual void OnTimeout() + void OnTimeout() override { static const int raise_widgets[] = {WID_GL_MAX_HEIGHTLEVEL_DOWN, WID_GL_MAX_HEIGHTLEVEL_UP, WID_GL_START_DATE_DOWN, WID_GL_START_DATE_UP, WID_GL_SNOW_LEVEL_UP, WID_GL_SNOW_LEVEL_DOWN, WIDGET_LIST_END}; for (const int *widget = raise_widgets; *widget != WIDGET_LIST_END; widget++) { @@ -714,7 +714,7 @@ struct GenerateLandscapeWindow : public Window { } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { switch (widget) { case WID_GL_MAPSIZE_X_PULLDOWN: _settings_newgame.game_creation.map_x = index; break; @@ -758,7 +758,7 @@ struct GenerateLandscapeWindow : public Window { this->InvalidateData(); } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { /* Was 'cancel' pressed? */ if (str == NULL) return; @@ -888,7 +888,7 @@ struct CreateScenarioWindow : public Window this->LowerWidget(_settings_newgame.game_creation.landscape + WID_CS_TEMPERATE); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_CS_START_DATE_TEXT: @@ -909,7 +909,7 @@ struct CreateScenarioWindow : public Window } } - virtual void OnPaint() + void OnPaint() override { this->SetWidgetDisabledState(WID_CS_START_DATE_DOWN, _settings_newgame.game_creation.starting_year <= MIN_YEAR); this->SetWidgetDisabledState(WID_CS_START_DATE_UP, _settings_newgame.game_creation.starting_year >= MAX_YEAR); @@ -924,7 +924,7 @@ struct CreateScenarioWindow : public Window this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { StringID str = STR_JUST_INT; switch (widget) { @@ -950,7 +950,7 @@ struct CreateScenarioWindow : public Window size->height += padding.height; } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_CS_TEMPERATE: @@ -1015,7 +1015,7 @@ struct CreateScenarioWindow : public Window } } - virtual void OnTimeout() + void OnTimeout() override { static const int raise_widgets[] = {WID_CS_START_DATE_DOWN, WID_CS_START_DATE_UP, WID_CS_FLAT_LAND_HEIGHT_DOWN, WID_CS_FLAT_LAND_HEIGHT_UP, WIDGET_LIST_END}; for (const int *widget = raise_widgets; *widget != WIDGET_LIST_END; widget++) { @@ -1026,7 +1026,7 @@ struct CreateScenarioWindow : public Window } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { switch (widget) { case WID_CS_MAPSIZE_X_PULLDOWN: _settings_newgame.game_creation.map_x = index; break; @@ -1035,7 +1035,7 @@ struct CreateScenarioWindow : public Window this->SetDirty(); } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (!StrEmpty(str)) { int32 value = atoi(str); @@ -1187,7 +1187,7 @@ struct GenerateProgressWindow : public Window { this->InitNested(); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_GP_ABORT: @@ -1202,7 +1202,7 @@ struct GenerateProgressWindow : public Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_GP_PROGRESS_BAR: { @@ -1223,7 +1223,7 @@ struct GenerateProgressWindow : public Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_GP_PROGRESS_BAR: diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 39df8ab6e2..d74f833cee 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -56,7 +56,7 @@ struct GraphLegendWindow : Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (!IsInsideMM(widget, WID_GL_FIRST_COMPANY, MAX_COMPANIES + WID_GL_FIRST_COMPANY)) return; @@ -74,7 +74,7 @@ struct GraphLegendWindow : Window { DrawString(r.left + (rtl ? (uint)WD_FRAMERECT_LEFT : (d.width + 4)), r.right - (rtl ? (d.width + 4) : (uint)WD_FRAMERECT_RIGHT), r.top + (r.bottom - r.top + 1 - FONT_HEIGHT_NORMAL) / 2, STR_COMPANY_NAME_COMPANY_NUM, HasBit(_legend_excluded_companies, cid) ? TC_BLACK : TC_WHITE); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (!IsInsideMM(widget, WID_GL_FIRST_COMPANY, MAX_COMPANIES + WID_GL_FIRST_COMPANY)) return; @@ -93,7 +93,7 @@ struct GraphLegendWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; if (Company::IsValidID(data)) return; @@ -485,7 +485,7 @@ protected: } public: - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != this->graph_widget) return; @@ -521,7 +521,7 @@ public: size->height = max(size->height, size->width / 3); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != this->graph_widget) return; @@ -533,13 +533,13 @@ public: return INVALID_DATAPOINT; } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { /* Clicked on legend? */ if (widget == WID_CV_KEY_BUTTON) ShowGraphLegend(); } - virtual void OnGameTick() + void OnGameTick() override { this->UpdateStatistics(false); } @@ -549,7 +549,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; this->UpdateStatistics(true); @@ -621,7 +621,7 @@ struct OperatingProfitGraphWindow : BaseGraphWindow { this->InitializeWindow(window_number); } - virtual OverflowSafeInt64 GetGraphData(const Company *c, int j) + OverflowSafeInt64 GetGraphData(const Company *c, int j) override { return c->old_economy[j].income + c->old_economy[j].expenses; } @@ -672,7 +672,7 @@ struct IncomeGraphWindow : BaseGraphWindow { this->InitializeWindow(window_number); } - virtual OverflowSafeInt64 GetGraphData(const Company *c, int j) + OverflowSafeInt64 GetGraphData(const Company *c, int j) override { return c->old_economy[j].income; } @@ -721,7 +721,7 @@ struct DeliveredCargoGraphWindow : BaseGraphWindow { this->InitializeWindow(window_number); } - virtual OverflowSafeInt64 GetGraphData(const Company *c, int j) + OverflowSafeInt64 GetGraphData(const Company *c, int j) override { return c->old_economy[j].delivered_cargo.GetSum(); } @@ -770,12 +770,12 @@ struct PerformanceHistoryGraphWindow : BaseGraphWindow { this->InitializeWindow(window_number); } - virtual OverflowSafeInt64 GetGraphData(const Company *c, int j) + OverflowSafeInt64 GetGraphData(const Company *c, int j) override { return c->old_economy[j].performance_history; } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (widget == WID_PHG_DETAILED_PERFORMANCE) ShowPerformanceRatingDetail(); this->BaseGraphWindow::OnClick(pt, widget, click_count); @@ -826,7 +826,7 @@ struct CompanyValueGraphWindow : BaseGraphWindow { this->InitializeWindow(window_number); } - virtual OverflowSafeInt64 GetGraphData(const Company *c, int j) + OverflowSafeInt64 GetGraphData(const Company *c, int j) override { return c->old_economy[j].company_value; } @@ -903,7 +903,7 @@ struct PaymentRatesGraphWindow : BaseGraphWindow { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_CPR_MATRIX) { BaseGraphWindow::UpdateWidgetSize(widget, size, padding, fill, resize); @@ -926,7 +926,7 @@ struct PaymentRatesGraphWindow : BaseGraphWindow { resize->height = this->line_height; } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_CPR_MATRIX) { BaseGraphWindow::DrawWidget(r, widget); @@ -963,7 +963,7 @@ struct PaymentRatesGraphWindow : BaseGraphWindow { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_CPR_ENABLE_CARGOES: @@ -1004,12 +1004,12 @@ struct PaymentRatesGraphWindow : BaseGraphWindow { } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_CPR_MATRIX); } - virtual void OnGameTick() + void OnGameTick() override { /* Override default OnGameTick */ } @@ -1019,13 +1019,13 @@ struct PaymentRatesGraphWindow : BaseGraphWindow { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; this->OnHundredthTick(); } - virtual void OnHundredthTick() + void OnHundredthTick() override { this->UpdateExcludedData(); @@ -1161,7 +1161,7 @@ public: this->companies.NeedResort(); } - virtual void OnPaint() + void OnPaint() override { this->BuildCompanyList(); this->companies.Sort(&PerformanceSorter); @@ -1169,7 +1169,7 @@ public: this->DrawWidgets(); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_CL_BACKGROUND) return; @@ -1197,7 +1197,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_CL_BACKGROUND) return; @@ -1236,7 +1236,7 @@ public: } - virtual void OnGameTick() + void OnGameTick() override { if (this->companies.NeedResort()) { this->SetDirty(); @@ -1248,7 +1248,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (data == 0) { /* This needs to be done in command-scope to enforce rebuilding before resorting invalid data */ @@ -1318,7 +1318,7 @@ struct PerformanceRatingDetailWindow : Window { uint score_detail_left; uint score_detail_right; - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_PRD_SCORE_FIRST: @@ -1376,7 +1376,7 @@ struct PerformanceRatingDetailWindow : Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { /* No need to draw when there's nothing to draw */ if (this->company == INVALID_COMPANY) return; @@ -1455,7 +1455,7 @@ struct PerformanceRatingDetailWindow : Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { /* Check which button is clicked */ if (IsInsideMM(widget, WID_PRD_COMPANY_FIRST, WID_PRD_COMPANY_LAST + 1)) { @@ -1469,7 +1469,7 @@ struct PerformanceRatingDetailWindow : Window { } } - virtual void OnGameTick() + void OnGameTick() override { /* Update the company score every 5 days */ if (--this->timeout == 0) { @@ -1483,7 +1483,7 @@ struct PerformanceRatingDetailWindow : Window { * @param data the company ID of the company that is going to be removed * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; /* Disable the companies who are not active */ diff --git a/src/group_gui.cpp b/src/group_gui.cpp index b5f33ff52a..299bf58ccd 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -359,7 +359,7 @@ public: *this->sorting = this->vehicles.GetListing(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_GL_LIST_GROUP: { @@ -423,7 +423,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (data == 0) { /* This needs to be done in command-scope to enforce rebuilding before resorting invalid data */ @@ -447,7 +447,7 @@ public: this->SetDirty(); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_GL_AVAILABLE_VEHICLES: @@ -474,7 +474,7 @@ public: } } - virtual void OnPaint() + void OnPaint() override { /* If we select the all vehicles, this->list will contain all vehicles of the owner * else this->list will contain all vehicles which belong to the selected group */ @@ -529,7 +529,7 @@ public: this->DrawWidgets(); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_GL_ALL_VEHICLES: @@ -628,7 +628,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_GL_SORT_BY_ORDER: // Flip sorting method ascending/descending @@ -806,7 +806,7 @@ public: } } - virtual void OnDragDrop(Point pt, int widget) + void OnDragDrop(Point pt, int widget) override { if (this->vehicle_sel != INVALID_VEHICLE) OnDragDrop_Vehicle(pt, widget); if (this->group_sel != INVALID_GROUP) OnDragDrop_Group(pt, widget); @@ -814,19 +814,19 @@ public: _cursor.vehchain = false; } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (str != NULL) DoCommandP(0, this->group_rename, 0, CMD_ALTER_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_RENAME), NULL, str); this->group_rename = INVALID_GROUP; } - virtual void OnResize() + void OnResize() override { this->group_sb->SetCapacityFromWidget(this, WID_GL_LIST_GROUP); this->vscroll->SetCapacityFromWidget(this, WID_GL_LIST_VEHICLE); } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { switch (widget) { case WID_GL_SORT_BY_DROPDOWN: @@ -866,14 +866,14 @@ public: this->SetDirty(); } - virtual void OnGameTick() + void OnGameTick() override { if (this->groups.NeedResort() || this->vehicles.NeedResort()) { this->SetDirty(); } } - virtual void OnPlaceObjectAbort() + void OnPlaceObjectAbort() override { /* abort drag & drop */ this->vehicle_sel = INVALID_VEHICLE; @@ -882,7 +882,7 @@ public: this->SetWidgetDirty(WID_GL_LIST_VEHICLE); } - virtual void OnMouseDrag(Point pt, int widget) + void OnMouseDrag(Point pt, int widget) override { if (this->vehicle_sel == INVALID_VEHICLE && this->group_sel == INVALID_GROUP) return; diff --git a/src/highscore_gui.cpp b/src/highscore_gui.cpp index c67aaa170b..d6ea8c0c1c 100644 --- a/src/highscore_gui.cpp +++ b/src/highscore_gui.cpp @@ -63,12 +63,12 @@ struct EndGameHighScoreBaseWindow : Window { return pt; } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { delete this; } - virtual EventState OnKeyPress(WChar key, uint16 keycode) + EventState OnKeyPress(WChar key, uint16 keycode) override { /* All keys are 'handled' by this window but we want to make * sure that 'quit' still works correctly. Not handling the @@ -129,7 +129,7 @@ struct EndGameWindow : EndGameHighScoreBaseWindow { ShowHighscoreTable(this->window_number, this->rank); } - virtual void OnPaint() + void OnPaint() override { this->SetupHighScoreEndWindow(); Point pt = this->GetTopLeft(640, 480); @@ -177,7 +177,7 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow { if (!_networking && !this->game_paused_by_player) DoCommandP(0, PM_PAUSED_NORMAL, 0, CMD_PAUSE); // unpause } - virtual void OnPaint() + void OnPaint() override { const HighScore *hs = _highscore_table[this->window_number]; diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 78bf3f4a01..898786ff7d 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -403,12 +403,12 @@ public: this->SetButtons(); } - virtual void OnInit() + void OnInit() override { this->SetupArrays(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_DPI_MATRIX_WIDGET: { @@ -477,7 +477,7 @@ public: } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_DPI_FUND_WIDGET: @@ -494,7 +494,7 @@ public: } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_DPI_MATRIX_WIDGET: { @@ -581,7 +581,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_DPI_MATRIX_WIDGET: { @@ -635,13 +635,13 @@ public: } } - virtual void OnResize() + void OnResize() override { /* Adjust the number of items in the matrix depending of the resize */ this->vscroll->SetCapacityFromWidget(this, WID_DPI_MATRIX_WIDGET); } - virtual void OnPlaceObject(Point pt, TileIndex tile) + void OnPlaceObject(Point pt, TileIndex tile) override { bool success = true; /* We do not need to protect ourselves against "Random Many Industries" in this mode */ @@ -674,7 +674,7 @@ public: if (success && !_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } - virtual void OnGameTick() + void OnGameTick() override { if (!this->timer_enabled) return; if (--this->callback_timer == 0) { @@ -697,12 +697,12 @@ public: } } - virtual void OnTimeout() + void OnTimeout() override { this->RaiseButtons(); } - virtual void OnPlaceObjectAbort() + void OnPlaceObjectAbort() override { this->RaiseButtons(); } @@ -712,7 +712,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; this->SetupArrays(); @@ -787,7 +787,7 @@ public: this->InvalidateData(); } - virtual void OnPaint() + void OnPaint() override { this->DrawWidgets(); @@ -924,17 +924,17 @@ public: return y + WD_FRAMERECT_BOTTOM; } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_IV_CAPTION) SetDParam(0, this->window_number); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget == WID_IV_INFO) size->height = this->info_height; } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_IV_INFO: { @@ -1039,14 +1039,14 @@ public: } } - virtual void OnTimeout() + void OnTimeout() override { this->clicked_line = IL_NONE; this->clicked_button = 0; this->SetDirty(); } - virtual void OnResize() + void OnResize() override { if (this->viewport != NULL) { NWidgetViewport *nvp = this->GetWidget(WID_IV_VIEWPORT); @@ -1056,7 +1056,7 @@ public: } } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (StrEmpty(str)) return; @@ -1082,7 +1082,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; const Industry *i = Industry::Get(this->window_number); @@ -1094,12 +1094,12 @@ public: } } - virtual bool IsNewGRFInspectable() const + bool IsNewGRFInspectable() const override { return ::IsNewGRFInspectable(GSF_INDUSTRIES, this->window_number); } - virtual void ShowNewGRFInspectWindow() const + void ShowNewGRFInspectWindow() const override { ::ShowNewGRFInspectWindow(GSF_INDUSTRIES, this->window_number); } @@ -1357,12 +1357,12 @@ public: this->last_sorting = this->industries.GetListing(); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_ID_DROPDOWN_CRITERIA) SetDParam(0, IndustryDirectoryWindow::sorter_names[this->industries.SortType()]); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_ID_DROPDOWN_ORDER: @@ -1387,7 +1387,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_ID_DROPDOWN_ORDER: { @@ -1425,7 +1425,7 @@ public: } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_ID_DROPDOWN_ORDER: @@ -1451,7 +1451,7 @@ public: } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { if (this->industries.SortType() != index) { this->industries.SetSortType(index); @@ -1459,18 +1459,18 @@ public: } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_ID_INDUSTRY_LIST); } - virtual void OnPaint() + void OnPaint() override { if (this->industries.NeedRebuild()) this->BuildSortIndustriesList(); this->DrawWidgets(); } - virtual void OnHundredthTick() + void OnHundredthTick() override { this->industries.ForceResort(); this->BuildSortIndustriesList(); @@ -1481,7 +1481,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (data == 0) { /* This needs to be done in command-scope to enforce rebuilding before resorting invalid data */ @@ -2172,7 +2172,7 @@ struct IndustryCargoesWindow : public Window { this->OnInvalidateData(id); } - virtual void OnInit() + void OnInit() override { /* Initialize static CargoesField size variables. */ Dimension d = GetStringBoundingBox(STR_INDUSTRY_CARGOES_PRODUCERS); @@ -2219,7 +2219,7 @@ struct IndustryCargoesWindow : public Window { CargoesField::cargo_field_width = CargoesField::HOR_CARGO_BORDER_SPACE * 2 + CargoesField::HOR_CARGO_WIDTH * CargoesField::max_cargoes + CargoesField::HOR_CARGO_SPACE * (CargoesField::max_cargoes - 1); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_IC_PANEL: @@ -2238,7 +2238,7 @@ struct IndustryCargoesWindow : public Window { CargoesFieldType type; ///< Type of field. - virtual void SetStringParameters (int widget) const + void SetStringParameters (int widget) const override { if (widget != WID_IC_CAPTION) return; @@ -2557,7 +2557,7 @@ struct IndustryCargoesWindow : public Window { * - data = NUM_INDUSTRYTYPES: Stop sending updates to the smallmap window. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; if (data == NUM_INDUSTRYTYPES) { @@ -2572,7 +2572,7 @@ struct IndustryCargoesWindow : public Window { this->ComputeIndustryDisplay(data); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_IC_PANEL) return; @@ -2660,7 +2660,7 @@ struct IndustryCargoesWindow : public Window { return true; } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_IC_PANEL: { @@ -2738,7 +2738,7 @@ struct IndustryCargoesWindow : public Window { } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { if (index < 0) return; @@ -2753,7 +2753,7 @@ struct IndustryCargoesWindow : public Window { } } - bool OnTooltip(Point pt, int widget, TooltipCloseCondition close_cond) + bool OnTooltip(Point pt, int widget, TooltipCloseCondition close_cond) override { if (widget != WID_IC_PANEL) return false; @@ -2795,7 +2795,7 @@ struct IndustryCargoesWindow : public Window { return false; } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_IC_PANEL); } diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index 001afde1d4..307be44050 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -49,7 +49,7 @@ struct SelectGameWindow : public Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; this->SetWidgetLoweredState(WID_SGI_TEMPERATE_LANDSCAPE, _settings_newgame.game_creation.landscape == LT_TEMPERATE); @@ -58,7 +58,7 @@ struct SelectGameWindow : public Window { this->SetWidgetLoweredState(WID_SGI_TOYLAND_LANDSCAPE, _settings_newgame.game_creation.landscape == LT_TOYLAND); } - virtual void OnInit() + void OnInit() override { bool missing_sprites = _missing_extra_graphics > 0 && !IsReleasedVersion(); this->GetWidget(WID_SGI_BASESET_SELECTION)->SetDisplayedPlane(missing_sprites ? 0 : SZSP_NONE); @@ -67,7 +67,7 @@ struct SelectGameWindow : public Window { this->GetWidget(WID_SGI_TRANSLATION_SELECTION)->SetDisplayedPlane(missing_lang ? 0 : SZSP_NONE); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_SGI_BASESET: @@ -82,7 +82,7 @@ struct SelectGameWindow : public Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { StringID str = 0; switch (widget) { @@ -111,7 +111,7 @@ struct SelectGameWindow : public Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { /* Do not create a network server when you (just) have closed one of the game * creation/load windows for the network server. */ diff --git a/src/linkgraph/linkgraph_gui.h b/src/linkgraph/linkgraph_gui.h index 17fcd28b28..b913bb1f4a 100644 --- a/src/linkgraph/linkgraph_gui.h +++ b/src/linkgraph/linkgraph_gui.h @@ -104,11 +104,11 @@ public: LinkGraphLegendWindow(WindowDesc *desc, int window_number); void SetOverlay(LinkGraphOverlay *overlay); - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize); - virtual void DrawWidget(const Rect &r, int widget) const; - virtual bool OnTooltip(Point pt, int widget, TooltipCloseCondition close_cond); - virtual void OnClick(Point pt, int widget, int click_count); - virtual void OnInvalidateData(int data = 0, bool gui_scope = true); + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override; + void DrawWidget(const Rect &r, int widget) const override; + bool OnTooltip(Point pt, int widget, TooltipCloseCondition close_cond) override; + void OnClick(Point pt, int widget, int click_count) override; + void OnInvalidateData(int data = 0, bool gui_scope = true) override; private: LinkGraphOverlay *overlay; diff --git a/src/main_gui.cpp b/src/main_gui.cpp index 7ab9bebb16..808484b0ea 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -250,7 +250,7 @@ struct MainWindow : Window this->refresh.SetInterval(LINKGRAPH_DELAY); } - virtual void OnRealtimeTick(uint delta_ms) + void OnRealtimeTick(uint delta_ms) override { if (!this->refresh.Elapsed(delta_ms)) return; @@ -265,7 +265,7 @@ struct MainWindow : Window this->GetWidget(WID_M_VIEWPORT)->SetDirty(this); } - virtual void OnPaint() + void OnPaint() override { this->DrawWidgets(); if (_game_mode == GM_MENU) { @@ -285,7 +285,7 @@ struct MainWindow : Window } } - virtual EventState OnHotkey(int hotkey) + EventState OnHotkey(int hotkey) override { if (hotkey == GHK_QUIT) { HandleExitGameRequest(); @@ -424,7 +424,7 @@ struct MainWindow : Window return ES_HANDLED; } - virtual void OnScroll(Point delta) + void OnScroll(Point delta) override { this->viewport->scrollpos_x += ScaleByZoom(delta.x, this->viewport->zoom); this->viewport->scrollpos_y += ScaleByZoom(delta.y, this->viewport->zoom); @@ -433,14 +433,14 @@ struct MainWindow : Window this->refresh.SetInterval(LINKGRAPH_DELAY); } - virtual void OnMouseWheel(int wheel) + void OnMouseWheel(int wheel) override { if (_settings_client.gui.scrollwheel_scrolling != 2) { ZoomInOrOutToCursorWindow(wheel < 0, this); } } - virtual void OnResize() + void OnResize() override { if (this->viewport != NULL) { NWidgetViewport *nvp = this->GetWidget(WID_M_VIEWPORT); @@ -454,7 +454,7 @@ struct MainWindow : Window * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; /* Forward the message to the appropriate toolbar (ingame or scenario editor) */ diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 061070a2b5..4aeb81736b 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -72,7 +72,7 @@ public: char landinfo_data[LAND_INFO_LINE_END][LAND_INFO_LINE_BUFF_SIZE]; TileIndex tile; - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_LI_BACKGROUND) return; @@ -91,7 +91,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_LI_BACKGROUND) return; @@ -137,7 +137,7 @@ public: #undef LANDINFOD_LEVEL } - virtual void OnInit() + void OnInit() override { Town *t = ClosestTownFromTile(tile, _settings_game.economy.dist_local_authority); @@ -328,12 +328,12 @@ public: if (!found) this->landinfo_data[LAND_INFO_MULTICENTER_LINE][0] = '\0'; } - virtual bool IsNewGRFInspectable() const + bool IsNewGRFInspectable() const override { return ::IsNewGRFInspectable(GetGrfSpecFeature(this->tile), this->tile); } - virtual void ShowNewGRFInspectWindow() const + void ShowNewGRFInspectWindow() const override { ::ShowNewGRFInspectWindow(GetGrfSpecFeature(this->tile), this->tile); } @@ -343,7 +343,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; switch (data) { @@ -469,12 +469,12 @@ struct AboutWindow : public Window { this->timer.SetInterval(TIMER_INTERVAL); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_A_WEBSITE) SetDParamStr(0, "Website: http://www.openttd.org"); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_A_SCROLLING_TEXT) return; @@ -490,7 +490,7 @@ struct AboutWindow : public Window { *size = maxdim(*size, d); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_A_SCROLLING_TEXT) return; @@ -505,7 +505,7 @@ struct AboutWindow : public Window { } } - virtual void OnRealtimeTick(uint delta_ms) + void OnRealtimeTick(uint delta_ms) override { uint count = this->timer.CountElapsed(delta_ms); if (count > 0) { @@ -667,7 +667,7 @@ struct TooltipsWindow : public Window CLRBITS(this->flags, WF_WHITE_BORDER); } - virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) + Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override { /* Find the free screen space between the main toolbar at the top, and the statusbar at the bottom. * Add a fixed distance 2 so the tooltip floats free from both bars. @@ -687,7 +687,7 @@ struct TooltipsWindow : public Window return pt; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { /* There is only one widget. */ for (uint i = 0; i != this->paramcount; i++) SetDParam(i, this->params[i]); @@ -700,7 +700,7 @@ struct TooltipsWindow : public Window size->height += 2 + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { /* There is only one widget. */ GfxFillRect(r.left, r.top, r.right, r.bottom, PC_BLACK); @@ -712,7 +712,7 @@ struct TooltipsWindow : public Window DrawStringMultiLine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, r.bottom - WD_FRAMERECT_BOTTOM, this->string_id, TC_FROMSTRING, SA_CENTER); } - virtual void OnMouseLoop() + void OnMouseLoop() override { /* Always close tooltips when the cursor is not in our window. */ if (!_cursor.in_window) { @@ -973,7 +973,7 @@ struct QueryStringWindow : public Window this->SetFocusedWidget(WID_QS_TEXT); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget == WID_QS_DEFAULT && (this->flags & QSF_ENABLE_DEFAULT) == 0) { /* We don't want this widget to show! */ @@ -983,7 +983,7 @@ struct QueryStringWindow : public Window } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_QS_CAPTION) SetDParam(0, this->editbox.caption); } @@ -1002,7 +1002,7 @@ struct QueryStringWindow : public Window } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_QS_DEFAULT: @@ -1097,7 +1097,7 @@ struct QueryWindow : public Window { if (this->proc != NULL) this->proc(this->parent, false); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_Q_CAPTION: @@ -1111,7 +1111,7 @@ struct QueryWindow : public Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_Q_TEXT) return; @@ -1121,7 +1121,7 @@ struct QueryWindow : public Window { *size = d; } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_Q_TEXT) return; @@ -1129,7 +1129,7 @@ struct QueryWindow : public Window { this->message, TC_FROMSTRING, SA_CENTER); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_Q_YES: { @@ -1152,7 +1152,7 @@ struct QueryWindow : public Window { } } - virtual EventState OnKeyPress(WChar key, uint16 keycode) + EventState OnKeyPress(WChar key, uint16 keycode) override { /* ESC closes the window, Enter confirms the action */ switch (keycode) { diff --git a/src/music_gui.cpp b/src/music_gui.cpp index 885647427f..da63192e02 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -459,7 +459,7 @@ struct MusicTrackSelectionWindow : public Window { this->LowerWidget(WID_MTS_ALL + _settings_client.music.playlist); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_MTS_PLAYLIST: @@ -476,7 +476,7 @@ struct MusicTrackSelectionWindow : public Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; for (int i = 0; i < 6; i++) { @@ -486,7 +486,7 @@ struct MusicTrackSelectionWindow : public Window { this->SetDirty(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_MTS_PLAYLIST: { @@ -521,7 +521,7 @@ struct MusicTrackSelectionWindow : public Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_MTS_LIST_LEFT: { @@ -554,7 +554,7 @@ struct MusicTrackSelectionWindow : public Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_MTS_LIST_LEFT: { // add to playlist @@ -587,7 +587,7 @@ struct MusicTrackSelectionWindow : public Window { } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { switch (widget) { case WID_MTS_MUSICSET: @@ -672,7 +672,7 @@ struct MusicWindow : public Window { ); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { /* Make sure that WID_M_SHUFFLE and WID_M_PROGRAMME have the same size. @@ -714,7 +714,7 @@ struct MusicWindow : public Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_M_TRACK_NR: { @@ -763,7 +763,7 @@ struct MusicWindow : public Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; for (int i = 0; i < 6; i++) { @@ -775,7 +775,7 @@ struct MusicWindow : public Window { this->SetDirty(); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_M_PREV: // skip to prev diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index 94e2898852..21607e9e8d 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -320,7 +320,7 @@ struct NetworkChatWindow : public Window { InvalidateWindowData(WC_NEWS_WINDOW, 0, 0); } - virtual void FindWindowPlacementAndResize(int def_width, int def_height) + void FindWindowPlacementAndResize(int def_width, int def_height) override { Window::FindWindowPlacementAndResize(_toolbar_width, def_height); } @@ -458,13 +458,13 @@ struct NetworkChatWindow : public Window { free(pre_buf); } - virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) + Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override { Point pt = { 0, _screen.height - sm_height - FindWindowById(WC_STATUS_BAR, 0)->height }; return pt; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_NC_DESTINATION) return; @@ -477,7 +477,7 @@ struct NetworkChatWindow : public Window { *size = maxdim(*size, d); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_NC_DESTINATION) return; @@ -487,7 +487,7 @@ struct NetworkChatWindow : public Window { DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, this->dest_string, TC_BLACK, SA_RIGHT); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_NC_SENDBUTTON: /* Send */ @@ -500,7 +500,7 @@ struct NetworkChatWindow : public Window { } } - virtual EventState OnKeyPress(WChar key, uint16 keycode) + EventState OnKeyPress(WChar key, uint16 keycode) override { EventState state = ES_NOT_HANDLED; if (keycode == WKC_TAB) { @@ -510,7 +510,7 @@ struct NetworkChatWindow : public Window { return state; } - virtual void OnEditboxChanged(int wid) + void OnEditboxChanged(int wid) override { _chat_tab_completion_active = false; } @@ -520,7 +520,7 @@ struct NetworkChatWindow : public Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (data == this->dest) delete this; } diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 321a53bc7d..49ecf2b242 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -257,7 +257,7 @@ public: InvalidateWindowData(WC_NETWORK_WINDOW, WN_NETWORK_WINDOW_CONTENT_LIST, 2); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (widget == WID_NCDS_CANCELOK) { if (this->downloaded_bytes != this->total_bytes) { @@ -271,7 +271,7 @@ public: } } - virtual void OnDownloadProgress(const ContentInfo *ci, int bytes) + void OnDownloadProgress(const ContentInfo *ci, int bytes) override { BaseNetworkContentDownloadStatusWindow::OnDownloadProgress(ci, bytes); this->receivedTypes.Include(ci->type); @@ -562,7 +562,7 @@ public: _network_content_client.RemoveCallback(this); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_NCL_FILTER_CAPT: @@ -590,7 +590,7 @@ public: } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_NCL_FILTER_CAPT: @@ -607,7 +607,7 @@ public: } } - virtual void OnPaint() + void OnPaint() override { const SortButtonState arrow = this->content.IsDescSortOrder() ? SBS_DOWN : SBS_UP; @@ -779,7 +779,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (widget >= WID_NCL_TEXTFILE && widget < WID_NCL_TEXTFILE + TFT_END) { if (this->selected == NULL || this->selected->state != ContentInfo::ALREADY_HERE) return; @@ -865,7 +865,7 @@ public: } } - virtual EventState OnKeyPress(WChar key, uint16 keycode) + EventState OnKeyPress(WChar key, uint16 keycode) override { switch (keycode) { case WKC_UP: @@ -937,7 +937,7 @@ public: return ES_HANDLED; } - virtual void OnEditboxChanged(int wid) + void OnEditboxChanged(int wid) override { if (wid == WID_NCL_FILTER) { this->filter_data.string_filter.SetFilterTerm(this->filter_editbox.text.buf); @@ -947,25 +947,25 @@ public: } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_NCL_MATRIX); } - virtual void OnReceiveContentInfo(const ContentInfo *rci) + void OnReceiveContentInfo(const ContentInfo *rci) override { if (this->auto_select && !rci->IsSelected()) _network_content_client.ToggleSelectedState(rci); this->content.ForceRebuild(); this->InvalidateData(); } - virtual void OnDownloadComplete(ContentID cid) + void OnDownloadComplete(ContentID cid) override { this->content.ForceResort(); this->InvalidateData(); } - virtual void OnConnect(bool success) + void OnConnect(bool success) override { if (!success) { ShowErrorMessage(STR_CONTENT_ERROR_COULD_NOT_CONNECT, INVALID_STRING_ID, WL_ERROR); @@ -981,7 +981,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; if (this->content.NeedRebuild()) this->BuildContentList(); diff --git a/src/network/network_content_gui.h b/src/network/network_content_gui.h index 1397010019..8afd245d7c 100644 --- a/src/network/network_content_gui.h +++ b/src/network/network_content_gui.h @@ -39,8 +39,8 @@ public: */ ~BaseNetworkContentDownloadStatusWindow(); - virtual void DrawWidget(const Rect &r, int widget) const; - virtual void OnDownloadProgress(const ContentInfo *ci, int bytes); + void DrawWidget(const Rect &r, int widget) const override; + void OnDownloadProgress(const ContentInfo *ci, int bytes) override; }; void BuildContentTypeStringList(); diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index f90370312b..b12aaa8239 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -494,7 +494,7 @@ public: this->last_sorting = this->servers.GetListing(); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_NG_CONN_BTN: @@ -503,7 +503,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_NG_CONN_BTN: @@ -558,7 +558,7 @@ public: } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_NG_MATRIX: { @@ -595,7 +595,7 @@ public: } - virtual void OnPaint() + void OnPaint() override { if (this->servers.NeedRebuild()) { this->BuildGUINetworkGameList(); @@ -691,7 +691,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_NG_CANCEL: // Cancel button @@ -788,7 +788,7 @@ public: } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { switch (widget) { case WID_NG_CONN_BTN: @@ -807,13 +807,13 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { this->servers.ForceRebuild(); this->SetDirty(); } - virtual EventState OnKeyPress(WChar key, uint16 keycode) + EventState OnKeyPress(WChar key, uint16 keycode) override { EventState state = ES_NOT_HANDLED; @@ -874,7 +874,7 @@ public: return state; } - virtual void OnEditboxChanged(int wid) + void OnEditboxChanged(int wid) override { switch (wid) { case WID_NG_FILTER: { @@ -896,17 +896,17 @@ public: } } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (!StrEmpty(str)) NetworkAddServer(str); } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_NG_MATRIX); } - virtual void OnRealtimeTick(uint delta_ms) + void OnRealtimeTick(uint delta_ms) override { if (!this->requery_timer.Elapsed(delta_ms)) return; this->requery_timer.SetInterval(MILLISECONDS_PER_TICK); @@ -1067,7 +1067,7 @@ struct NetworkStartServerWindow : public Window { this->SetFocusedWidget(WID_NSS_GAMENAME); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_NSS_CONNTYPE_BTN: @@ -1092,7 +1092,7 @@ struct NetworkStartServerWindow : public Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_NSS_CONNTYPE_BTN: @@ -1103,7 +1103,7 @@ struct NetworkStartServerWindow : public Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_NSS_SETPWD: @@ -1112,7 +1112,7 @@ struct NetworkStartServerWindow : public Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_NSS_CANCEL: // Cancel button @@ -1208,7 +1208,7 @@ struct NetworkStartServerWindow : public Window { } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { switch (widget) { case WID_NSS_CONNTYPE_BTN: @@ -1224,14 +1224,14 @@ struct NetworkStartServerWindow : public Window { this->SetDirty(); } - virtual void OnEditboxChanged(int wid) + void OnEditboxChanged(int wid) override { if (wid == WID_NSS_GAMENAME) { strecpy(_settings_client.network.server_name, this->name_editbox.text.buf, lastof(_settings_client.network.server_name)); } } - virtual void OnTimeout() + void OnTimeout() override { static const int raise_widgets[] = {WID_NSS_CLIENTS_BTND, WID_NSS_CLIENTS_BTNU, WID_NSS_COMPANIES_BTND, WID_NSS_COMPANIES_BTNU, WID_NSS_SPECTATORS_BTND, WID_NSS_SPECTATORS_BTNU, WIDGET_LIST_END}; for (const int *widget = raise_widgets; *widget != WIDGET_LIST_END; widget++) { @@ -1242,7 +1242,7 @@ struct NetworkStartServerWindow : public Window { } } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (str == NULL) return; @@ -1384,7 +1384,7 @@ struct NetworkLobbyWindow : public Window { return COMPANY_FIRST; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_NL_HEADER: @@ -1402,7 +1402,7 @@ struct NetworkLobbyWindow : public Window { } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_NL_TEXT: @@ -1411,7 +1411,7 @@ struct NetworkLobbyWindow : public Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_NL_DETAILS: @@ -1424,7 +1424,7 @@ struct NetworkLobbyWindow : public Window { } } - virtual void OnPaint() + void OnPaint() override { const NetworkGameInfo *gi = &this->server->info; @@ -1546,7 +1546,7 @@ struct NetworkLobbyWindow : public Window { DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_GAME_LOBBY_PLAYERS); // players } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_NL_CANCEL: // Cancel button @@ -1585,7 +1585,7 @@ struct NetworkLobbyWindow : public Window { } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_NL_MATRIX); } @@ -1777,12 +1777,12 @@ struct NetworkClientListPopupWindow : Window { CLRBITS(this->flags, WF_WHITE_BORDER); } - virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) + Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override { return this->desired_location; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { Dimension d = *size; for (const ClientListAction *action = this->actions.Begin(); action != this->actions.End(); action++) { @@ -1795,7 +1795,7 @@ struct NetworkClientListPopupWindow : Window { *size = d; } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { /* Draw the actions */ int sel = this->sel_index; @@ -1813,7 +1813,7 @@ struct NetworkClientListPopupWindow : Window { } } - virtual void OnMouseLoop() + void OnMouseLoop() override { /* We selected an action */ uint index = (_cursor.pos.y - this->top - WD_FRAMERECT_TOP) / FONT_HEIGHT_NORMAL; @@ -1904,7 +1904,7 @@ struct NetworkClientListWindow : Window { return true; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_CL_PANEL) return; @@ -1921,7 +1921,7 @@ struct NetworkClientListWindow : Window { size->width = WD_FRAMERECT_LEFT + this->server_client_width + this->icon_size.width + WD_FRAMERECT_LEFT + width + WD_FRAMERECT_RIGHT; } - virtual void OnPaint() + void OnPaint() override { /* Check if we need to reset the height */ if (!this->CheckClientListHeight()) return; @@ -1929,7 +1929,7 @@ struct NetworkClientListWindow : Window { this->DrawWidgets(); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_CL_PANEL) return; @@ -1975,7 +1975,7 @@ struct NetworkClientListWindow : Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { /* Show the popup with option */ if (this->selected_item != -1) { @@ -1991,7 +1991,7 @@ struct NetworkClientListWindow : Window { } } - virtual void OnMouseOver(Point pt, int widget) + void OnMouseOver(Point pt, int widget) override { /* -1 means we left the current window */ if (pt.y == -1) { @@ -2035,7 +2035,7 @@ struct NetworkJoinStatusWindow : Window { this->InitNested(WN_NETWORK_STATUS_WINDOW_JOIN); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_NJS_BACKGROUND) return; @@ -2069,7 +2069,7 @@ struct NetworkJoinStatusWindow : Window { DrawFrameRect(r.left + 20, r.top + 5, (int)((this->width - 20) * progress / 100), r.top + 15, COLOUR_MAUVE, FR_NONE); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_NJS_BACKGROUND) return; @@ -2095,7 +2095,7 @@ struct NetworkJoinStatusWindow : Window { size->width = width + WD_FRAMERECT_LEFT + WD_FRAMERECT_BOTTOM + 10; } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (widget == WID_NJS_CANCELOK) { // Disconnect button NetworkDisconnect(); @@ -2104,7 +2104,7 @@ struct NetworkJoinStatusWindow : Window { } } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (StrEmpty(str)) { NetworkDisconnect(); @@ -2184,7 +2184,7 @@ struct NetworkCompanyPasswordWindow : public Window { NetworkChangeCompanyPassword(_local_company, this->password_editbox.text.buf); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_NCP_OK: diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index 75b06967f7..e8fc4efccb 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -363,14 +363,14 @@ struct NewGRFInspectWindow : Window { this->OnInvalidateData(0, true); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget != WID_NGRFI_CAPTION) return; GetFeatureHelper(this->window_number)->SetStringParameters(this->GetFeatureIndex()); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_NGRFI_VEH_CHAIN: { @@ -410,7 +410,7 @@ struct NewGRFInspectWindow : Window { ::DrawString(r.left + LEFT_OFFSET, r.right - RIGHT_OFFSET, r.top + TOP_OFFSET + (offset * this->resize.step_height), buf, TC_BLACK); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_NGRFI_VEH_CHAIN: { @@ -550,7 +550,7 @@ struct NewGRFInspectWindow : Window { const_cast(this)->vscroll->SetCount(i); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_NGRFI_PARENT: { @@ -600,7 +600,7 @@ struct NewGRFInspectWindow : Window { } } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (StrEmpty(str)) return; @@ -608,7 +608,7 @@ struct NewGRFInspectWindow : Window { this->SetDirty(); } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_NGRFI_MAINPANEL, TOP_OFFSET + BOTTOM_OFFSET); } @@ -618,7 +618,7 @@ struct NewGRFInspectWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; if (this->HasChainIndex()) { @@ -822,7 +822,7 @@ struct SpriteAlignerWindow : Window { while (GetSpriteType(this->current_sprite) != ST_NORMAL) this->current_sprite++; } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { const Sprite *spr = GetSprite(this->current_sprite, ST_NORMAL); switch (widget) { @@ -856,7 +856,7 @@ struct SpriteAlignerWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_SA_LIST) return; @@ -867,7 +867,7 @@ struct SpriteAlignerWindow : Window { size->height = (1 + 200 / resize->height) * resize->height; } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_SA_SPRITE: { @@ -908,7 +908,7 @@ struct SpriteAlignerWindow : Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_SA_PREVIOUS: @@ -992,7 +992,7 @@ struct SpriteAlignerWindow : Window { } } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (StrEmpty(str)) return; @@ -1009,7 +1009,7 @@ struct SpriteAlignerWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; if (data == 1) { @@ -1019,7 +1019,7 @@ struct SpriteAlignerWindow : Window { } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_SA_LIST); } diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index adf38b1648..37844423aa 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -190,7 +190,7 @@ struct NewGRFParametersWindow : public Window { return &dummy_parameter_info; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_NP_NUMPAR_DEC: @@ -234,7 +234,7 @@ struct NewGRFParametersWindow : public Window { } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_NP_NUMPAR: @@ -243,7 +243,7 @@ struct NewGRFParametersWindow : public Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget == WID_NP_DESCRIPTION) { const GRFParameterInfo *par_info = (this->clicked_row < this->grf_config->param_info.Length()) ? this->grf_config->param_info[this->clicked_row] : NULL; @@ -304,7 +304,7 @@ struct NewGRFParametersWindow : public Window { } } - virtual void OnPaint() + void OnPaint() override { if (this->closing_dropdown) { this->closing_dropdown = false; @@ -313,7 +313,7 @@ struct NewGRFParametersWindow : public Window { this->DrawWidgets(); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_NP_NUMPAR_DEC: @@ -427,7 +427,7 @@ struct NewGRFParametersWindow : public Window { } } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (StrEmpty(str)) return; int32 value = atoi(str); @@ -438,7 +438,7 @@ struct NewGRFParametersWindow : public Window { this->SetDirty(); } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { assert(this->clicked_dropdown); GRFParameterInfo *par_info = ((uint)this->clicked_row < this->grf_config->param_info.Length()) ? this->grf_config->param_info[this->clicked_row] : NULL; @@ -447,7 +447,7 @@ struct NewGRFParametersWindow : public Window { this->SetDirty(); } - virtual void OnDropdownClose(Point pt, int widget, int index, bool instant_close) + void OnDropdownClose(Point pt, int widget, int index, bool instant_close) override { /* We cannot raise the dropdown button just yet. OnClick needs some hint, whether * the same dropdown button was clicked again, and then not open the dropdown again. @@ -458,7 +458,7 @@ struct NewGRFParametersWindow : public Window { this->SetDirty(); } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_NP_BACKGROUND); } @@ -468,7 +468,7 @@ struct NewGRFParametersWindow : public Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; if (!this->action14present) { @@ -483,7 +483,7 @@ struct NewGRFParametersWindow : public Window { } } - virtual void OnRealtimeTick(uint delta_ms) + void OnRealtimeTick(uint delta_ms) override { if (timeout.Elapsed(delta_ms)) { this->clicked_button = UINT_MAX; @@ -718,7 +718,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_NS_FILE_LIST: @@ -769,13 +769,13 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_NS_FILE_LIST); this->vscroll2->SetCapacityFromWidget(this, WID_NS_AVAIL_LIST); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_NS_PRESET_LIST: @@ -824,7 +824,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { return pal; } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_NS_FILE_LIST: { @@ -913,7 +913,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (widget >= WID_NS_NEWGRF_TEXTFILE && widget < WID_NS_NEWGRF_TEXTFILE + TFT_END) { if (this->active_sel == NULL && this->avail_sel == NULL) return; @@ -1139,7 +1139,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { } } - virtual void OnNewGRFsScanned() + void OnNewGRFsScanned() override { if (this->active_sel == NULL) DeleteWindowByClass(WC_TEXTFILE); this->avail_sel = NULL; @@ -1148,7 +1148,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { this->DeleteChildWindows(WC_QUERY_STRING); // Remove the parameter query window } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { if (!this->editable) return; @@ -1167,7 +1167,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { this->InvalidateData(GOID_NEWGRF_PRESET_LOADED); } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (str == NULL) return; @@ -1190,7 +1190,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { * @param data Information about the changed data. @see GameOptionsInvalidationData * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; switch (data) { @@ -1296,7 +1296,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { this->SetWidgetDisabledState(WID_NS_PRESET_SAVE, has_missing); } - virtual EventState OnKeyPress(WChar key, uint16 keycode) + EventState OnKeyPress(WChar key, uint16 keycode) override { if (!this->editable) return ES_NOT_HANDLED; @@ -1348,7 +1348,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { return ES_HANDLED; } - virtual void OnEditboxChanged(int wid) + void OnEditboxChanged(int wid) override { if (!this->editable) return; @@ -1358,7 +1358,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { this->InvalidateData(0); } - virtual void OnDragDrop(Point pt, int widget) + void OnDragDrop(Point pt, int widget) override { if (!this->editable) return; @@ -1406,7 +1406,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { } } - virtual void OnMouseDrag(Point pt, int widget) + void OnMouseDrag(Point pt, int widget) override { if (!this->editable) return; @@ -1605,7 +1605,7 @@ public: this->editable = true; // Temporary setting, 'real' value is set in SetupSmallestSize(). } - virtual void SetupSmallestSize(Window *w, bool init_array) + void SetupSmallestSize(Window *w, bool init_array) override { /* Copy state flag from the window. */ assert(dynamic_cast(w) != NULL); @@ -1648,7 +1648,7 @@ public: this->smallest_y = ComputeMaxSize(min_acs_height, this->smallest_y + this->resize_y - 1, this->resize_y); } - virtual void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) + void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) override { this->StoreSizePosition(sizing, x, y, given_width, given_height); @@ -1767,7 +1767,7 @@ public: } } - virtual NWidgetCore *GetWidgetFromPos(int x, int y) + NWidgetCore *GetWidgetFromPos(int x, int y) override { if (!IsInsideBS(x, this->pos_x, this->current_x) || !IsInsideBS(y, this->pos_y, this->current_y)) return NULL; @@ -1777,7 +1777,7 @@ public: return nw; } - virtual void Draw(const Window *w) + void Draw(const Window *w) override { if (this->editable) this->avs->Draw(w); this->acs->Draw(w); @@ -2074,7 +2074,7 @@ struct SavePresetWindow : public Window { { } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_SVP_PRESET_LIST: { @@ -2091,7 +2091,7 @@ struct SavePresetWindow : public Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_SVP_PRESET_LIST: { @@ -2115,7 +2115,7 @@ struct SavePresetWindow : public Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_SVP_PRESET_LIST: { @@ -2142,7 +2142,7 @@ struct SavePresetWindow : public Window { } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_SVP_PRESET_LIST); } @@ -2197,7 +2197,7 @@ struct ScanProgressWindow : public Window { free(last_name); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_SP_PROGRESS_BAR: { @@ -2220,7 +2220,7 @@ struct ScanProgressWindow : public Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_SP_PROGRESS_BAR: { diff --git a/src/news_gui.cpp b/src/news_gui.cpp index b79418c899..59c75eb514 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -308,13 +308,13 @@ struct NewsWindow : Window { GfxFillRect(r.left, r.bottom, r.right, r.bottom, PC_BLACK); } - virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) + Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override { Point pt = { 0, _screen.height }; return pt; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { StringID str = STR_NULL; switch (widget) { @@ -365,12 +365,12 @@ struct NewsWindow : Window { *size = maxdim(*size, d); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_N_DATE) SetDParam(0, this->ni->date); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_N_CAPTION: @@ -427,7 +427,7 @@ struct NewsWindow : Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_N_CLOSEBOX: @@ -466,7 +466,7 @@ struct NewsWindow : Window { } } - virtual EventState OnKeyPress(WChar key, uint16 keycode) + EventState OnKeyPress(WChar key, uint16 keycode) override { if (keycode == WKC_SPACE) { /* Don't continue. */ @@ -481,7 +481,7 @@ struct NewsWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; /* The chatbar has notified us that is was either created or closed */ @@ -490,7 +490,7 @@ struct NewsWindow : Window { this->SetWindowTop(newtop); } - virtual void OnRealtimeTick(uint delta_ms) + void OnRealtimeTick(uint delta_ms) override { int count = this->timer.CountElapsed(delta_ms); if (count > 0) { @@ -1024,7 +1024,7 @@ struct MessageHistoryWindow : Window { this->OnInvalidateData(0); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget == WID_MH_BACKGROUND) { this->line_height = FONT_HEIGHT_NORMAL + 2; @@ -1040,13 +1040,13 @@ struct MessageHistoryWindow : Window { } } - virtual void OnPaint() + void OnPaint() override { this->OnInvalidateData(0); this->DrawWidgets(); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_MH_BACKGROUND || _total_news == 0) return; @@ -1081,13 +1081,13 @@ struct MessageHistoryWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; this->vscroll->SetCount(_total_news); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (widget == WID_MH_BACKGROUND) { NewsItem *ni = _latest_news; @@ -1102,7 +1102,7 @@ struct MessageHistoryWindow : Window { } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_MH_BACKGROUND); } diff --git a/src/object_gui.cpp b/src/object_gui.cpp index 8aabcfdc46..6684566f15 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -99,7 +99,7 @@ public: this->GetWidget(WID_BO_OBJECT_MATRIX)->SetCount(4); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_BO_OBJECT_NAME: { @@ -120,7 +120,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_BO_CLASS_LIST: { @@ -210,7 +210,7 @@ public: } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (GB(widget, 0, 16)) { case WID_BO_CLASS_LIST: { @@ -382,12 +382,12 @@ public: this->SetDirty(); } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_BO_CLASS_LIST); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (GB(widget, 0, 16)) { case WID_BO_CLASS_LIST: { @@ -415,13 +415,13 @@ public: } } - virtual void OnPlaceObject(Point pt, TileIndex tile) + void OnPlaceObject(Point pt, TileIndex tile) override { DoCommandP(tile, ObjectClass::Get(_selected_object_class)->GetSpec(_selected_object_index)->Index(), _selected_object_view, CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_BUILD_OBJECT), CcTerraform); } - virtual void OnPlaceObjectAbort() + void OnPlaceObjectAbort() override { this->UpdateButtons(_selected_object_class, -1, _selected_object_view); } diff --git a/src/order_gui.cpp b/src/order_gui.cpp index e50247e275..612c1ba81c 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -798,7 +798,7 @@ public: this->OnInvalidateData(VIWD_MODIFY_ORDERS); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_O_ORDER_LIST: @@ -835,7 +835,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { VehicleOrderID from = INVALID_VEH_ORDER_ID; VehicleOrderID to = INVALID_VEH_ORDER_ID; @@ -1070,7 +1070,7 @@ public: this->SetDirty(); } - virtual void OnPaint() + void OnPaint() override { if (this->vehicle->owner != _local_company) { this->selected_order = -1; // Disable selection any selected row at a competitor order window. @@ -1080,7 +1080,7 @@ public: this->DrawWidgets(); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_O_ORDER_LIST) return; @@ -1138,7 +1138,7 @@ public: } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_O_COND_VALUE: { @@ -1159,7 +1159,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_O_ORDER_LIST: { @@ -1324,7 +1324,7 @@ public: } } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (!StrEmpty(str)) { VehicleOrderID sel = this->OrderGetSel(); @@ -1347,7 +1347,7 @@ public: } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { switch (widget) { case WID_O_NON_STOP: @@ -1390,7 +1390,7 @@ public: } } - virtual void OnDragDrop(Point pt, int widget) + void OnDragDrop(Point pt, int widget) override { switch (widget) { case WID_O_ORDER_LIST: { @@ -1423,7 +1423,7 @@ public: } } - virtual EventState OnHotkey(int hotkey) + EventState OnHotkey(int hotkey) override { if (this->vehicle->owner != _local_company) return ES_NOT_HANDLED; @@ -1444,7 +1444,7 @@ public: return ES_HANDLED; } - virtual void OnPlaceObject(Point pt, TileIndex tile) + void OnPlaceObject(Point pt, TileIndex tile) override { if (this->goto_type == OPOS_GOTO) { const Order cmd = GetOrderCmdFromTile(this->vehicle, tile); @@ -1457,7 +1457,7 @@ public: } } - virtual bool OnVehicleSelect(const Vehicle *v) + bool OnVehicleSelect(const Vehicle *v) override { /* v is vehicle getting orders. Only copy/clone orders if vehicle doesn't have any orders yet. * We disallow copying orders of other vehicles if we already have at least one order entry @@ -1475,7 +1475,7 @@ public: return true; } - virtual void OnPlaceObjectAbort() + void OnPlaceObjectAbort() override { this->goto_type = OPOS_NONE; this->SetWidgetDirty(WID_O_GOTO); @@ -1487,7 +1487,7 @@ public: } } - virtual void OnMouseDrag(Point pt, int widget) + void OnMouseDrag(Point pt, int widget) override { if (this->selected_order != -1 && widget == WID_O_ORDER_LIST) { /* An order is dragged.. */ @@ -1507,7 +1507,7 @@ public: } } - virtual void OnResize() + void OnResize() override { /* Update the scroll bar */ this->vscroll->SetCapacityFromWidget(this, WID_O_ORDER_LIST); diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp index dc069d1686..de8be373ec 100644 --- a/src/osk_gui.cpp +++ b/src/osk_gui.cpp @@ -94,12 +94,12 @@ struct OskWindow : public Window { this->SetWidgetLoweredState(WID_OSK_CAPS, HasBit(_keystate, KEYS_CAPS)); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_OSK_CAPTION) SetDParam(0, this->caption); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget < WID_OSK_LETTERS) return; @@ -110,7 +110,7 @@ struct OskWindow : public Window { TC_BLACK); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { /* clicked a letter */ if (widget >= WID_OSK_LETTERS) { @@ -192,21 +192,21 @@ struct OskWindow : public Window { } } - virtual void OnEditboxChanged(int widget) + void OnEditboxChanged(int widget) override { this->SetWidgetDirty(WID_OSK_TEXT); this->parent->OnEditboxChanged(this->text_btn); this->parent->SetWidgetDirty(this->text_btn); } - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; this->SetWidgetDirty(WID_OSK_TEXT); this->parent->SetWidgetDirty(this->text_btn); } - virtual void OnFocusLost() + void OnFocusLost() override { VideoDriver::GetInstance()->EditBoxLostFocus(); delete this; diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index d0789f337c..a26cc99028 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -440,7 +440,7 @@ struct BuildRailToolbarWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; @@ -507,7 +507,7 @@ struct BuildRailToolbarWindow : Window { } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_RAT_CAPTION) { const RailtypeInfo *rti = GetRailTypeInfo(this->railtype); @@ -521,7 +521,7 @@ struct BuildRailToolbarWindow : Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (widget < WID_RAT_BUILD_NS) return; @@ -613,13 +613,13 @@ struct BuildRailToolbarWindow : Window { if (_ctrl_pressed) RailToolbar_CtrlChanged(this); } - virtual EventState OnHotkey(int hotkey) + EventState OnHotkey(int hotkey) override { MarkTileDirtyByTile(TileVirtXY(_thd.pos.x, _thd.pos.y)); // redraw tile selection return Window::OnHotkey(hotkey); } - virtual void OnPlaceObject(Point pt, TileIndex tile) + void OnPlaceObject(Point pt, TileIndex tile) override { switch (this->last_user_action) { case WID_RAT_BUILD_NS: @@ -680,7 +680,7 @@ struct BuildRailToolbarWindow : Window { } } - virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) + void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) override { /* no dragging if you have pressed the convert button */ if (FindWindowById(WC_BUILD_SIGNAL, 0) != NULL && _convert_signal_button && this->IsWidgetLowered(WID_RAT_BUILD_SIGNALS)) return; @@ -688,7 +688,7 @@ struct BuildRailToolbarWindow : Window { VpSelectTilesWithMethod(pt.x, pt.y, select_method); } - virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) + void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) override { if (pt.x != -1) { switch (select_proc) { @@ -741,7 +741,7 @@ struct BuildRailToolbarWindow : Window { } } - virtual void OnPlaceObjectAbort() + void OnPlaceObjectAbort() override { this->RaiseButtons(); this->DisableWidget(WID_RAT_REMOVE); @@ -755,13 +755,13 @@ struct BuildRailToolbarWindow : Window { DeleteWindowByClass(WC_BUILD_BRIDGE); } - virtual void OnPlacePresize(Point pt, TileIndex tile) + void OnPlacePresize(Point pt, TileIndex tile) override { DoCommand(tile, _cur_railtype | (TRANSPORT_RAIL << 8), 0, DC_AUTO, CMD_BUILD_TUNNEL); VpSetPresizeRange(tile, _build_tunnel_endtile == 0 ? tile : _build_tunnel_endtile); } - virtual EventState OnCTRLStateChange() + EventState OnCTRLStateChange() override { /* do not toggle Remove button by Ctrl when placing station */ if (!this->IsWidgetLowered(WID_RAT_BUILD_STATION) && !this->IsWidgetLowered(WID_RAT_BUILD_WAYPOINT) && RailToolbar_CtrlChanged(this)) return ES_HANDLED; @@ -996,7 +996,7 @@ public: DeleteWindowById(WC_SELECT_STATION, 0); } - virtual void OnPaint() + void OnPaint() override { bool newstations = _railstation.newstations; const StationSpec *statspec = newstations ? StationClass::Get(_railstation.station_class)->GetSpec(_railstation.station_type) : NULL; @@ -1047,7 +1047,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_BRAS_NEWST_LIST: { @@ -1104,7 +1104,7 @@ public: } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { DrawPixelInfo tmp_dpi; @@ -1178,14 +1178,14 @@ public: } } - virtual void OnResize() + void OnResize() override { if (this->vscroll != NULL) { // New stations available. this->vscroll->SetCapacityFromWidget(this, WID_BRAS_NEWST_LIST); } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_BRAS_SHOW_NEWST_TYPE) { const StationSpec *statspec = StationClass::Get(_railstation.station_class)->GetSpec(_railstation.station_type); @@ -1193,7 +1193,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (GB(widget, 0, 16)) { case WID_BRAS_PLATFORM_DIR_X: @@ -1369,7 +1369,7 @@ public: } } - virtual void OnRealtimeTick(uint delta_ms) + void OnRealtimeTick(uint delta_ms) override { CheckRedrawStationCoverage(this); } @@ -1523,7 +1523,7 @@ public: _convert_signal_button = false; } - virtual void OnInit() + void OnInit() override { /* Calculate maximum signal sprite size. */ this->sig_sprite_size.width = 0; @@ -1543,7 +1543,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget == WID_BS_DRAG_SIGNALS_DENSITY_LABEL) { /* Two digits for signals density. */ @@ -1554,7 +1554,7 @@ public: } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_BS_DRAG_SIGNALS_DENSITY_LABEL: @@ -1563,7 +1563,7 @@ public: } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (IsInsideMM(widget, WID_BS_SEMAPHORE_NORM, WID_BS_ELECTRIC_PBS_OWAY + 1)) { /* Extract signal from widget number. */ @@ -1575,7 +1575,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_BS_SEMAPHORE_NORM: @@ -1632,7 +1632,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; this->LowerWidget((_cur_signal_variant == SIG_ELECTRIC ? WID_BS_ELECTRIC_NORM : WID_BS_SEMAPHORE_NORM) + _cur_signal_type); @@ -1704,7 +1704,7 @@ struct BuildRailDepotWindow : public PickerWindowBase { this->LowerWidget(_build_depot_direction + WID_BRAD_DEPOT_NE); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (!IsInsideMM(widget, WID_BRAD_DEPOT_NE, WID_BRAD_DEPOT_NW + 1)) return; @@ -1712,14 +1712,14 @@ struct BuildRailDepotWindow : public PickerWindowBase { size->height = ScaleGUITrad(48) + 2; } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (!IsInsideMM(widget, WID_BRAD_DEPOT_NE, WID_BRAD_DEPOT_NW + 1)) return; DrawTrainDepotSprite(r.left + 1 + ScaleGUITrad(31), r.bottom - ScaleGUITrad(31), widget - WID_BRAD_DEPOT_NE + DIAGDIR_NE, _cur_railtype); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_BRAD_DEPOT_NE: @@ -1793,7 +1793,7 @@ struct BuildRailWaypointWindow : PickerWindowBase { matrix->SetClicked(_cur_waypoint_type); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_BRW_WAYPOINT_MATRIX: @@ -1812,7 +1812,7 @@ struct BuildRailWaypointWindow : PickerWindowBase { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (GB(widget, 0, 16)) { case WID_BRW_WAYPOINT: { @@ -1827,7 +1827,7 @@ struct BuildRailWaypointWindow : PickerWindowBase { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (GB(widget, 0, 16)) { case WID_BRW_WAYPOINT: { diff --git a/src/road_gui.cpp b/src/road_gui.cpp index e3091ec8af..40212e8fb9 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -335,7 +335,7 @@ struct BuildRoadToolbarWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; @@ -403,7 +403,7 @@ struct BuildRoadToolbarWindow : Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { _remove_button_clicked = false; _one_way_button_clicked = false; @@ -483,13 +483,13 @@ struct BuildRoadToolbarWindow : Window { if (_ctrl_pressed) RoadToolbar_CtrlChanged(this); } - virtual EventState OnHotkey(int hotkey) + EventState OnHotkey(int hotkey) override { MarkTileDirtyByTile(TileVirtXY(_thd.pos.x, _thd.pos.y)); // redraw tile selection return Window::OnHotkey(hotkey); } - virtual void OnPlaceObject(Point pt, TileIndex tile) + void OnPlaceObject(Point pt, TileIndex tile) override { _remove_button_clicked = this->IsWidgetLowered(WID_ROT_REMOVE); _one_way_button_clicked = this->IsWidgetLowered(WID_ROT_ONE_WAY); @@ -543,7 +543,7 @@ struct BuildRoadToolbarWindow : Window { } } - virtual void OnPlaceObjectAbort() + void OnPlaceObjectAbort() override { this->RaiseButtons(); this->SetWidgetsDisabledState(true, @@ -560,7 +560,7 @@ struct BuildRoadToolbarWindow : Window { DeleteWindowByClass(WC_BUILD_BRIDGE); } - virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) + void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) override { /* Here we update the end tile flags * of the road placement actions. @@ -603,7 +603,7 @@ struct BuildRoadToolbarWindow : Window { VpSelectTilesWithMethod(pt.x, pt.y, select_method); } - virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) + void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) override { if (pt.x != -1) { switch (select_proc) { @@ -659,13 +659,13 @@ struct BuildRoadToolbarWindow : Window { } } - virtual void OnPlacePresize(Point pt, TileIndex tile) + void OnPlacePresize(Point pt, TileIndex tile) override { DoCommand(tile, RoadTypeToRoadTypes(_cur_roadtype) | (TRANSPORT_ROAD << 8), 0, DC_AUTO, CMD_BUILD_TUNNEL); VpSetPresizeRange(tile, _build_tunnel_endtile == 0 ? tile : _build_tunnel_endtile); } - virtual EventState OnCTRLStateChange() + EventState OnCTRLStateChange() override { if (RoadToolbar_CtrlChanged(this)) return ES_HANDLED; return ES_NOT_HANDLED; @@ -874,7 +874,7 @@ struct BuildRoadDepotWindow : public PickerWindowBase { this->FinishInitNested(TRANSPORT_ROAD); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (!IsInsideMM(widget, WID_BROD_DEPOT_NE, WID_BROD_DEPOT_NW + 1)) return; @@ -882,14 +882,14 @@ struct BuildRoadDepotWindow : public PickerWindowBase { size->height = ScaleGUITrad(48) + 2; } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (!IsInsideMM(widget, WID_BROD_DEPOT_NE, WID_BROD_DEPOT_NW + 1)) return; DrawRoadDepotSprite(r.left + 1 + ScaleGUITrad(31), r.bottom - ScaleGUITrad(31), (DiagDirection)(widget - WID_BROD_DEPOT_NE + DIAGDIR_NE), _cur_roadtype); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_BROD_DEPOT_NW: @@ -979,7 +979,7 @@ struct BuildRoadStationWindow : public PickerWindowBase { DeleteWindowById(WC_SELECT_STATION, 0); } - virtual void OnPaint() + void OnPaint() override { this->DrawWidgets(); @@ -1006,7 +1006,7 @@ struct BuildRoadStationWindow : public PickerWindowBase { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (!IsInsideMM(widget, WID_BROS_STATION_NE, WID_BROS_STATION_Y + 1)) return; @@ -1014,7 +1014,7 @@ struct BuildRoadStationWindow : public PickerWindowBase { size->height = ScaleGUITrad(48) + 2; } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (!IsInsideMM(widget, WID_BROS_STATION_NE, WID_BROS_STATION_Y + 1)) return; @@ -1022,7 +1022,7 @@ struct BuildRoadStationWindow : public PickerWindowBase { StationPickerDrawSprite(r.left + 1 + ScaleGUITrad(31), r.bottom - ScaleGUITrad(31), st, INVALID_RAILTYPE, widget < WID_BROS_STATION_X ? ROADTYPE_ROAD : _cur_roadtype, widget - WID_BROS_STATION_NE); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_BROS_STATION_NE: @@ -1053,7 +1053,7 @@ struct BuildRoadStationWindow : public PickerWindowBase { } } - virtual void OnRealtimeTick(uint delta_ms) + void OnRealtimeTick(uint delta_ms) override { CheckRedrawStationCoverage(this); } diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index c92701f0dd..fda7cfa52c 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -339,7 +339,7 @@ struct GameOptionsWindow : Window { return list; } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_GO_CURRENCY_DROPDOWN: SetDParam(0, _currency_specs[this->opt->locale.currency].name); break; @@ -358,7 +358,7 @@ struct GameOptionsWindow : Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_GO_BASE_GRF_DESCRIPTION: @@ -378,7 +378,7 @@ struct GameOptionsWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_GO_BASE_GRF_DESCRIPTION: @@ -445,7 +445,7 @@ struct GameOptionsWindow : Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (widget >= WID_GO_BASE_GRF_TEXTFILE && widget < WID_GO_BASE_GRF_TEXTFILE + TFT_END) { if (BaseGraphics::GetUsedSet() == NULL) return; @@ -508,7 +508,7 @@ struct GameOptionsWindow : Window { } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { switch (widget) { case WID_GO_CURRENCY_DROPDOWN: // Currency @@ -587,7 +587,7 @@ struct GameOptionsWindow : Window { * @param data Information about the changed data. @see GameOptionsInvalidationData * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; this->SetWidgetLoweredState(WID_GO_FULLSCREEN_BUTTON, _fullscreen); @@ -1858,7 +1858,7 @@ struct GameSettingsWindow : Window { this->InvalidateData(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_GS_OPTIONSPANEL: @@ -1893,7 +1893,7 @@ struct GameSettingsWindow : Window { } } - virtual void OnPaint() + void OnPaint() override { if (this->closing_dropdown) { this->closing_dropdown = false; @@ -1934,7 +1934,7 @@ struct GameSettingsWindow : Window { } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_GS_RESTRICT_DROPDOWN: @@ -1979,7 +1979,7 @@ struct GameSettingsWindow : Window { return list; } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_GS_OPTIONSPANEL: { @@ -2029,7 +2029,7 @@ struct GameSettingsWindow : Window { this->last_clicked = pe; } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_GS_EXPAND_ALL: @@ -2212,7 +2212,7 @@ struct GameSettingsWindow : Window { } } - virtual void OnTimeout() + void OnTimeout() override { if (this->clicked_entry != NULL) { // On timeout, release any depressed buttons this->clicked_entry->SetButtons(0); @@ -2221,7 +2221,7 @@ struct GameSettingsWindow : Window { } } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { /* The user pressed cancel */ if (str == NULL) return; @@ -2247,7 +2247,7 @@ struct GameSettingsWindow : Window { this->SetDirty(); } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { switch (widget) { case WID_GS_RESTRICT_DROPDOWN: @@ -2291,7 +2291,7 @@ struct GameSettingsWindow : Window { } } - virtual void OnDropdownClose(Point pt, int widget, int index, bool instant_close) + void OnDropdownClose(Point pt, int widget, int index, bool instant_close) override { if (widget >= 0) { /* Normally the default implementation of OnDropdownClose() takes care of @@ -2310,7 +2310,7 @@ struct GameSettingsWindow : Window { } } - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; @@ -2340,7 +2340,7 @@ struct GameSettingsWindow : Window { this->SetWidgetDisabledState(WID_GS_COLLAPSE_ALL, all_folded); } - virtual void OnEditboxChanged(int wid) + void OnEditboxChanged(int wid) override { if (wid == WID_GS_FILTER) { this->filter.string.SetFilterTerm(this->filter_editbox.text.buf); @@ -2353,7 +2353,7 @@ struct GameSettingsWindow : Window { } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_GS_OPTIONSPANEL, SETTINGTREE_TOP_OFFSET + SETTINGTREE_BOTTOM_OFFSET); } @@ -2497,7 +2497,7 @@ struct CustomCurrencyWindow : Window { this->SetWidgetDisabledState(WID_CC_YEAR_UP, _custom_currency.to_euro == MAX_YEAR); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_CC_RATE: SetDParam(0, 1); SetDParam(1, 1); break; @@ -2515,7 +2515,7 @@ struct CustomCurrencyWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { /* Set the appropriate width for the edit 'buttons' */ @@ -2534,7 +2534,7 @@ struct CustomCurrencyWindow : Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { int line = 0; int len = 0; @@ -2616,7 +2616,7 @@ struct CustomCurrencyWindow : Window { this->SetDirty(); } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (str == NULL) return; @@ -2648,7 +2648,7 @@ struct CustomCurrencyWindow : Window { SetButtonState(); } - virtual void OnTimeout() + void OnTimeout() override { this->SetDirty(); } diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 56af6e6655..5e752da522 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -166,7 +166,7 @@ struct SignListWindow : Window, SignList { this->BuildSortSignList(); } - virtual void OnInit() + void OnInit() override { /* Default sign name, used if Sign::name is NULL. */ GetString(SignList::default_name, STR_DEFAULT_SIGN_NAME, lastof(SignList::default_name)); @@ -190,13 +190,13 @@ struct SignListWindow : Window, SignList { this->InvalidateData(); } - virtual void OnPaint() + void OnPaint() override { if (!this->IsShaded() && this->signs.NeedRebuild()) this->BuildSortSignList(); this->DrawWidgets(); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_SIL_LIST: { @@ -228,12 +228,12 @@ struct SignListWindow : Window, SignList { } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_SIL_CAPTION) SetDParam(0, this->vscroll->GetCount()); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_SIL_LIST: { @@ -260,12 +260,12 @@ struct SignListWindow : Window, SignList { } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_SIL_LIST, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_SIL_LIST: { @@ -286,7 +286,7 @@ struct SignListWindow : Window, SignList { } } - virtual EventState OnHotkey(int hotkey) + EventState OnHotkey(int hotkey) override { switch (hotkey) { case SLHK_FOCUS_FILTER_BOX: @@ -301,7 +301,7 @@ struct SignListWindow : Window, SignList { return ES_HANDLED; } - virtual void OnEditboxChanged(int widget) + void OnEditboxChanged(int widget) override { if (widget == WID_SIL_FILTER_TEXT) this->SetFilterString(this->filter_editbox.text.buf); } @@ -316,7 +316,7 @@ struct SignListWindow : Window, SignList { this->SortSignsList(); } - virtual void OnHundredthTick() + void OnHundredthTick() override { this->BuildSortSignList(); this->SetDirty(); @@ -327,7 +327,7 @@ struct SignListWindow : Window, SignList { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { /* When there is a filter string, we always need to rebuild the list even if * the amount of signs in total is unchanged, as the subset of signs that is @@ -482,7 +482,7 @@ struct SignWindow : Window, SignList { return this->signs[next ? 0 : this->signs.Length() - 1]; } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_QES_CAPTION: @@ -491,7 +491,7 @@ struct SignWindow : Window, SignList { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_QES_PREVIOUS: diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 97d01325a0..41848cdf0e 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1685,7 +1685,7 @@ public: this->smallmap_window = NULL; } - virtual void SetupSmallestSize(Window *w, bool init_array) + void SetupSmallestSize(Window *w, bool init_array) override { NWidgetBase *display = this->head; NWidgetBase *bar = display->next; @@ -1703,7 +1703,7 @@ public: this->resize_y = min(display->resize_y, bar->resize_y); } - virtual void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) + void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) override { this->pos_x = x; this->pos_y = y; @@ -1727,7 +1727,7 @@ public: bar->AssignSizePosition(ST_RESIZE, x, y + display_height, given_width, bar_height, rtl); } - virtual NWidgetCore *GetWidgetFromPos(int x, int y) + NWidgetCore *GetWidgetFromPos(int x, int y) override { if (!IsInsideBS(x, this->pos_x, this->current_x) || !IsInsideBS(y, this->pos_y, this->current_y)) return NULL; for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) { @@ -1737,7 +1737,7 @@ public: return NULL; } - virtual void Draw(const Window *w) + void Draw(const Window *w) override { for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) child_wid->Draw(w); } diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 5c2e06070b..ef434c4ffc 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -337,7 +337,7 @@ public: this->last_sorting = this->stations.GetListing(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_STL_SORTBY: { @@ -393,7 +393,7 @@ public: } } - virtual void OnPaint() + void OnPaint() override { this->BuildStationsList((Owner)this->window_number); this->SortStationsList(); @@ -401,7 +401,7 @@ public: this->DrawWidgets(); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_STL_SORTBY: @@ -485,7 +485,7 @@ public: } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_STL_CAPTION) { SetDParam(0, this->window_number); @@ -493,7 +493,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_STL_LIST: { @@ -609,7 +609,7 @@ public: } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { if (this->stations.SortType() != index) { this->stations.SetSortType(index); @@ -621,7 +621,7 @@ public: } } - virtual void OnGameTick() + void OnGameTick() override { if (this->stations.NeedResort()) { DEBUG(misc, 3, "Periodic rebuild station list company %d", this->window_number); @@ -629,7 +629,7 @@ public: } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_STL_LIST, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM); } @@ -639,7 +639,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (data == 0) { /* This needs to be done in command-scope to enforce rebuilding before resorting invalid data */ @@ -1361,7 +1361,7 @@ struct StationViewWindow : public Window { data->Update(count); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_SV_WAITING: @@ -1385,7 +1385,7 @@ struct StationViewWindow : public Window { } } - virtual void OnPaint() + void OnPaint() override { const Station *st = Station::Get(this->window_number); CargoDataEntry cargo; @@ -1441,7 +1441,7 @@ struct StationViewWindow : public Window { } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { const Station *st = Station::Get(this->window_number); SetDParam(0, st->index); @@ -1876,7 +1876,7 @@ struct StationViewWindow : public Window { this->SetWidgetDirty(WID_SV_WAITING); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_SV_WAITING: @@ -2037,7 +2037,7 @@ struct StationViewWindow : public Window { this->SetDirty(); } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { if (widget == WID_SV_SORT_BY) { this->SelectSortBy(index); @@ -2046,14 +2046,14 @@ struct StationViewWindow : public Window { } } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (str == NULL) return; DoCommandP(0, this->window_number, 0, CMD_RENAME_STATION | CMD_MSG(STR_ERROR_CAN_T_RENAME_STATION), NULL, str); } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_SV_WAITING, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM); } @@ -2063,7 +2063,7 @@ struct StationViewWindow : public Window { * @param data Information about the changed data. If it's a valid cargo ID, invalidate the cargo data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (gui_scope) { if (data >= 0 && data < NUM_CARGO) { @@ -2249,7 +2249,7 @@ struct SelectStationWindow : Window { this->OnInvalidateData(0); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_JS_PANEL) return; @@ -2269,7 +2269,7 @@ struct SelectStationWindow : Window { *size = d; } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_JS_PANEL) return; @@ -2290,7 +2290,7 @@ struct SelectStationWindow : Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (widget != WID_JS_PANEL) return; @@ -2311,7 +2311,7 @@ struct SelectStationWindow : Window { DeleteWindowById(WC_SELECT_STATION, 0); } - virtual void OnRealtimeTick(uint delta_ms) + void OnRealtimeTick(uint delta_ms) override { if (_thd.dirty & 2) { _thd.dirty &= ~2; @@ -2319,7 +2319,7 @@ struct SelectStationWindow : Window { } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_JS_PANEL, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM); } @@ -2329,7 +2329,7 @@ struct SelectStationWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; FindStationsNearby(this->area, true); diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp index 88ba495f34..281b4eb98a 100644 --- a/src/statusbar_gui.cpp +++ b/src/statusbar_gui.cpp @@ -99,18 +99,18 @@ struct StatusBarWindow : Window { PositionStatusbar(this); } - virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) + Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override { Point pt = { 0, _screen.height - sm_height }; return pt; } - virtual void FindWindowPlacementAndResize(int def_width, int def_height) + void FindWindowPlacementAndResize(int def_width, int def_height) override { Window::FindWindowPlacementAndResize(_toolbar_width, def_height); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { Dimension d; switch (widget) { @@ -137,7 +137,7 @@ struct StatusBarWindow : Window { *size = maxdim(d, *size); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_S_LEFT: @@ -195,7 +195,7 @@ struct StatusBarWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; switch (data) { @@ -211,7 +211,7 @@ struct StatusBarWindow : Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_S_MIDDLE: ShowLastNewsMessage(); break; @@ -220,7 +220,7 @@ struct StatusBarWindow : Window { } } - virtual void OnRealtimeTick(uint delta_ms) + void OnRealtimeTick(uint delta_ms) override { if (_pause_mode != PM_UNPAUSED) return; diff --git a/src/story_gui.cpp b/src/story_gui.cpp index 003843310e..8b12207e3f 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -463,7 +463,7 @@ public: } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_SB_SEL_PAGE: { @@ -482,7 +482,7 @@ public: } } - virtual void OnPaint() + void OnPaint() override { /* Detect if content has changed height. This can happen if a * multi-line text contains eg. {COMPANY} and that company is @@ -497,7 +497,7 @@ public: this->DrawWidgets(); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_SB_PAGE_PANEL) return; @@ -563,7 +563,7 @@ public: _cur_dpi = old_dpi; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_SB_SEL_PAGE && widget != WID_SB_PAGE_PANEL) return; @@ -606,13 +606,13 @@ public: } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_SB_PAGE_PANEL, WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM); this->vscroll->SetCount(this->GetContentHeight()); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_SB_SEL_PAGE: { @@ -667,7 +667,7 @@ public: } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { if (widget != WID_SB_SEL_PAGE) return; @@ -682,7 +682,7 @@ public: * >= 0 Id of the page that needs to be refreshed. If it is not the current page, nothing happens. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp index 04e5ae262b..e71b62f94f 100644 --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -38,7 +38,7 @@ struct SubsidyListWindow : Window { this->OnInvalidateData(0); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (widget != WID_SUL_PANEL) return; @@ -129,7 +129,7 @@ struct SubsidyListWindow : Window { return 3 + num_awarded + num_not_awarded; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_SUL_PANEL) return; Dimension d = maxdim(GetStringBoundingBox(STR_SUBSIDIES_OFFERED_TITLE), GetStringBoundingBox(STR_SUBSIDIES_SUBSIDISED_TITLE)); @@ -142,7 +142,7 @@ struct SubsidyListWindow : Window { *size = maxdim(*size, d); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_SUL_PANEL) return; @@ -207,7 +207,7 @@ struct SubsidyListWindow : Window { } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_SUL_PANEL); } @@ -217,7 +217,7 @@ struct SubsidyListWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; this->vscroll->SetCount(this->CountLines()); diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 97749a8dcc..a699170409 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -165,14 +165,14 @@ struct TerraformToolbarWindow : Window { { } - virtual void OnInit() + void OnInit() override { /* Don't show the place object button when there are no objects to place. */ NWidgetStacked *show_object = this->GetWidget(WID_TT_SHOW_PLACE_OBJECT); show_object->SetDisplayedPlane(ObjectClass::GetUIClassCount() != 0 ? 0 : SZSP_NONE); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (widget < WID_TT_BUTTONS_START) return; @@ -219,7 +219,7 @@ struct TerraformToolbarWindow : Window { } } - virtual void OnPlaceObject(Point pt, TileIndex tile) + void OnPlaceObject(Point pt, TileIndex tile) override { switch (this->last_user_action) { case WID_TT_LOWER_LAND: // Lower land button @@ -250,19 +250,19 @@ struct TerraformToolbarWindow : Window { } } - virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) + void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) override { VpSelectTilesWithMethod(pt.x, pt.y, select_method); } - virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) + Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override { Point pt = GetToolbarAlignedWindowPosition(sm_width); pt.y += sm_height; return pt; } - virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) + void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) override { if (pt.x != -1) { switch (select_proc) { @@ -277,7 +277,7 @@ struct TerraformToolbarWindow : Window { } } - virtual void OnPlaceObjectAbort() + void OnPlaceObjectAbort() override { this->RaiseButtons(); } @@ -538,7 +538,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window { this->last_user_action = WIDGET_LIST_END; } - virtual void OnPaint() + void OnPaint() override { this->DrawWidgets(); @@ -547,7 +547,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget != WID_ETT_DOTS) return; @@ -555,7 +555,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window { size->height = max(size->height, ScaleGUITrad(31)); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_ETT_DOTS) return; @@ -572,7 +572,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window { } while (--n); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (widget < WID_ETT_BUTTONS_START) return; @@ -638,7 +638,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window { } } - virtual void OnTimeout() + void OnTimeout() override { for (uint i = WID_ETT_START; i < this->nested_array_size; i++) { if (i == WID_ETT_BUTTONS_START) i = WID_ETT_BUTTONS_END; // skip the buttons @@ -649,7 +649,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window { } } - virtual void OnPlaceObject(Point pt, TileIndex tile) + void OnPlaceObject(Point pt, TileIndex tile) override { switch (this->last_user_action) { case WID_ETT_DEMOLISH: // Demolish aka dynamite button @@ -680,12 +680,12 @@ struct ScenarioEditorLandscapeGenerationWindow : Window { } } - virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) + void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) override { VpSelectTilesWithMethod(pt.x, pt.y, select_method); } - virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) + void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) override { if (pt.x != -1) { switch (select_proc) { @@ -702,7 +702,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window { } } - virtual void OnPlaceObjectAbort() + void OnPlaceObjectAbort() override { this->RaiseButtons(); this->SetDirty(); diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 5dd45561f3..8280c0e892 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -189,7 +189,7 @@ struct TimetableWindow : Window { return (travelling && v->lateness_counter < 0); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_VT_ARRIVAL_DEPARTURE_PANEL: @@ -227,7 +227,7 @@ struct TimetableWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { switch (data) { case VIWD_AUTOREPLACE: @@ -297,7 +297,7 @@ struct TimetableWindow : Window { } - virtual void OnPaint() + void OnPaint() override { const Vehicle *v = this->vehicle; int selected = this->sel_index; @@ -341,7 +341,7 @@ struct TimetableWindow : Window { this->DrawWidgets(); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_VT_CAPTION: SetDParam(0, this->vehicle->index); break; @@ -349,7 +349,7 @@ struct TimetableWindow : Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { const Vehicle *v = this->vehicle; int selected = this->sel_index; @@ -513,7 +513,7 @@ struct TimetableWindow : Window { return v->index | (order_number << 20) | (mtf << 28); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { const Vehicle *v = this->vehicle; @@ -614,7 +614,7 @@ struct TimetableWindow : Window { this->SetDirty(); } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (str == NULL) return; @@ -634,7 +634,7 @@ struct TimetableWindow : Window { DoCommandP(0, p1, p2, CMD_CHANGE_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE)); } - virtual void OnResize() + void OnResize() override { /* Update the scroll bar */ this->vscroll->SetCapacityFromWidget(this, WID_VT_TIMETABLE_PANEL, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM); diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index c3555f107a..7052dc4e2f 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -1997,12 +1997,12 @@ struct MainToolbarWindow : Window { this->timer.SetInterval(MILLISECONDS_PER_TICK); } - virtual void FindWindowPlacementAndResize(int def_width, int def_height) + void FindWindowPlacementAndResize(int def_width, int def_height) override { Window::FindWindowPlacementAndResize(_toolbar_width, def_height); } - virtual void OnPaint() + void OnPaint() override { /* If spectator, disable all construction buttons * ie : Build road, rail, ships, airports and landscaping @@ -2020,18 +2020,18 @@ struct MainToolbarWindow : Window { this->DrawWidgets(); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (_game_mode != GM_MENU && !this->IsWidgetDisabled(widget)) _toolbar_button_procs[widget](this); } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { CallBackFunction cbf = _menu_clicked_procs[widget](index); if (cbf != CBF_NONE) _last_started_action = cbf; } - virtual EventState OnHotkey(int hotkey) + EventState OnHotkey(int hotkey) override { switch (hotkey) { case MTHK_PAUSE: ToolbarPauseClick(this); break; @@ -2077,7 +2077,7 @@ struct MainToolbarWindow : Window { return ES_HANDLED; } - virtual void OnPlaceObject(Point pt, TileIndex tile) + void OnPlaceObject(Point pt, TileIndex tile) override { switch (_last_started_action) { case CBF_PLACE_SIGN: @@ -2092,12 +2092,12 @@ struct MainToolbarWindow : Window { } } - virtual void OnPlaceObjectAbort() + void OnPlaceObjectAbort() override { _last_started_action = CBF_NONE; } - virtual void OnRealtimeTick(uint delta_ms) + void OnRealtimeTick(uint delta_ms) override { if (!this->timer.Elapsed(delta_ms)) return; this->timer.SetInterval(MILLISECONDS_PER_TICK); @@ -2113,7 +2113,7 @@ struct MainToolbarWindow : Window { } } - virtual void OnTimeout() + void OnTimeout() override { /* We do not want to automatically raise the pause, fast forward and * switchbar buttons; they have to stay down when pressed etc. */ @@ -2130,7 +2130,7 @@ struct MainToolbarWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; if (FindWindowById(WC_MAIN_WINDOW, 0) != NULL) HandleZoomMessage(this, FindWindowById(WC_MAIN_WINDOW, 0)->viewport, WID_TN_ZOOM_IN, WID_TN_ZOOM_OUT); @@ -2330,12 +2330,12 @@ struct ScenarioEditorToolbarWindow : Window { this->timer.SetInterval(MILLISECONDS_PER_TICK); } - virtual void FindWindowPlacementAndResize(int def_width, int def_height) + void FindWindowPlacementAndResize(int def_width, int def_height) override { Window::FindWindowPlacementAndResize(_toolbar_width, def_height); } - virtual void OnPaint() + void OnPaint() override { this->SetWidgetDisabledState(WID_TE_DATE_BACKWARD, _settings_game.game_creation.starting_year <= MIN_YEAR); this->SetWidgetDisabledState(WID_TE_DATE_FORWARD, _settings_game.game_creation.starting_year >= MAX_YEAR); @@ -2343,7 +2343,7 @@ struct ScenarioEditorToolbarWindow : Window { this->DrawWidgets(); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_TE_DATE: @@ -2364,7 +2364,7 @@ struct ScenarioEditorToolbarWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_TE_SPACER: @@ -2379,14 +2379,14 @@ struct ScenarioEditorToolbarWindow : Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (_game_mode == GM_MENU) return; CallBackFunction cbf = _scen_toolbar_button_procs[widget](this); if (cbf != CBF_NONE) _last_started_action = cbf; } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { /* The map button is in a different location on the scenario * editor toolbar, so we need to adjust for it. */ @@ -2396,7 +2396,7 @@ struct ScenarioEditorToolbarWindow : Window { if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); } - virtual EventState OnHotkey(int hotkey) + EventState OnHotkey(int hotkey) override { CallBackFunction cbf = CBF_NONE; switch (hotkey) { @@ -2428,7 +2428,7 @@ struct ScenarioEditorToolbarWindow : Window { return ES_HANDLED; } - virtual void OnPlaceObject(Point pt, TileIndex tile) + void OnPlaceObject(Point pt, TileIndex tile) override { switch (_last_started_action) { case CBF_PLACE_SIGN: @@ -2443,19 +2443,19 @@ struct ScenarioEditorToolbarWindow : Window { } } - virtual void OnPlaceObjectAbort() + void OnPlaceObjectAbort() override { _last_started_action = CBF_NONE; } - virtual void OnTimeout() + void OnTimeout() override { this->SetWidgetsLoweredState(false, WID_TE_DATE_BACKWARD, WID_TE_DATE_FORWARD, WIDGET_LIST_END); this->SetWidgetDirty(WID_TE_DATE_BACKWARD); this->SetWidgetDirty(WID_TE_DATE_FORWARD); } - virtual void OnRealtimeTick(uint delta_ms) + void OnRealtimeTick(uint delta_ms) override { if (!this->timer.Elapsed(delta_ms)) return; this->timer.SetInterval(MILLISECONDS_PER_TICK); @@ -2476,13 +2476,13 @@ struct ScenarioEditorToolbarWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; if (FindWindowById(WC_MAIN_WINDOW, 0) != NULL) HandleZoomMessage(this, FindWindowById(WC_MAIN_WINDOW, 0)->viewport, WID_TE_ZOOM_IN, WID_TE_ZOOM_OUT); } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { /* Was 'cancel' pressed? */ if (str == NULL) return; diff --git a/src/town_gui.cpp b/src/town_gui.cpp index bc322b08f2..18b767ebca 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -99,7 +99,7 @@ public: this->vscroll->SetCapacity((this->GetWidget(WID_TA_COMMAND_LIST)->current_y - WD_FRAMERECT_TOP - WD_FRAMERECT_BOTTOM) / FONT_HEIGHT_NORMAL); } - virtual void OnPaint() + void OnPaint() override { int numact; uint buttons = GetMaskOfTownActions(&numact, _local_company, this->town); @@ -180,12 +180,12 @@ public: } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_TA_CAPTION) SetDParam(0, this->window_number); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_TA_ACTION_INFO: @@ -220,7 +220,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_TA_ACTION_INFO: { @@ -254,7 +254,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_TA_COMMAND_LIST: { @@ -277,7 +277,7 @@ public: } } - virtual void OnHundredthTick() + void OnHundredthTick() override { this->SetDirty(); } @@ -321,12 +321,12 @@ public: this->SetWidgetDisabledState(WID_TV_CHANGE_NAME, _networking && !_network_server); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_TV_CAPTION) SetDParam(0, this->town->index); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_TV_INFO) return; @@ -412,7 +412,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_TV_CENTER_VIEW: // scroll to location @@ -451,7 +451,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_TV_INFO: @@ -501,7 +501,7 @@ public: } } - virtual void OnResize() + void OnResize() override { if (this->viewport != NULL) { NWidgetViewport *nvp = this->GetWidget(WID_TV_VIEWPORT); @@ -516,7 +516,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; /* Called when setting station noise or required cargoes have changed, in order to resize the window */ @@ -524,7 +524,7 @@ public: this->ResizeWindowAsNeeded(); } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (str == NULL) return; @@ -733,7 +733,7 @@ public: this->FinishInitNested(0); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_TD_WORLD_POPULATION: @@ -756,7 +756,7 @@ public: return t->larger_town ? STR_TOWN_DIRECTORY_CITY : STR_TOWN_DIRECTORY_TOWN; } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_TD_SORT_ORDER: @@ -804,7 +804,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_TD_SORT_ORDER: { @@ -856,7 +856,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_TD_SORT_ORDER: // Click on sort order button @@ -893,7 +893,7 @@ public: } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { if (widget != WID_TD_SORT_CRITERIA) return; @@ -904,19 +904,19 @@ public: } } - virtual void OnPaint() + void OnPaint() override { if (this->towns.NeedRebuild()) this->BuildSortTownList(); this->DrawWidgets(); } - virtual void OnHundredthTick() + void OnHundredthTick() override { this->BuildSortTownList(); this->SetDirty(); } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_TD_LIST); } @@ -926,7 +926,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (data == 0) { /* This needs to be done in command-scope to enforce rebuilding before resorting invalid data */ @@ -1129,7 +1129,7 @@ public: if (success && !_shift_pressed) this->RandomTownName(); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_TF_NEW_TOWN: @@ -1174,12 +1174,12 @@ public: } } - virtual void OnPlaceObject(Point pt, TileIndex tile) + void OnPlaceObject(Point pt, TileIndex tile) override { this->ExecuteFoundTownCommand(tile, false, STR_ERROR_CAN_T_FOUND_TOWN_HERE, CcFoundTown); } - virtual void OnPlaceObjectAbort() + void OnPlaceObjectAbort() override { this->RaiseButtons(); this->UpdateButtons(false); @@ -1190,7 +1190,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; this->UpdateButtons(true); diff --git a/src/transparency_gui.cpp b/src/transparency_gui.cpp index 4bad2b0561..c396b52f5e 100644 --- a/src/transparency_gui.cpp +++ b/src/transparency_gui.cpp @@ -35,13 +35,13 @@ public: this->InitNested(window_number); } - virtual void OnPaint() + void OnPaint() override { this->OnInvalidateData(0); // Must be sure that the widgets show the transparency variable changes, also when we use shortcuts. this->DrawWidgets(); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_TT_SIGNS: @@ -69,7 +69,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { if (widget >= WID_TT_BEGIN && widget < WID_TT_END) { if (_ctrl_pressed) { @@ -104,7 +104,7 @@ public: } } - virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) + Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override { Point pt = GetToolbarAlignedWindowPosition(sm_width); pt.y += 2 * (sm_height - this->GetWidget(WID_TT_BUTTONS)->current_y); @@ -116,7 +116,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; for (uint i = WID_TT_BEGIN; i < WID_TT_END; i++) { diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp index f21eeaef2e..1b1dce95ac 100644 --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -84,7 +84,7 @@ public: return size; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget >= WID_BT_TYPE_11 && widget <= WID_BT_TYPE_34) { Dimension d = GetMaxTreeSpriteSize(); @@ -102,7 +102,7 @@ public: } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget < WID_BT_TYPE_11 || widget > WID_BT_TYPE_34 || widget - WID_BT_TYPE_11 >= this->count) return; @@ -111,7 +111,7 @@ public: DrawSprite(tree_sprites[i].sprite, tree_sprites[i].pal, (r.left + r.right) / 2 + WD_FRAMERECT_LEFT, r.bottom - 7); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_BT_TYPE_11: case WID_BT_TYPE_12: case WID_BT_TYPE_13: case WID_BT_TYPE_14: @@ -138,17 +138,17 @@ public: } } - virtual void OnPlaceObject(Point pt, TileIndex tile) + void OnPlaceObject(Point pt, TileIndex tile) override { VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_PLANT_TREES); } - virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) + void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) override { VpSelectTilesWithMethod(pt.x, pt.y, select_method); } - virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) + void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) override { if (pt.x != -1 && select_proc == DDSP_PLANT_TREES) { DoCommandP(end_tile, this->tree_to_plant, start_tile, @@ -159,13 +159,13 @@ public: /** * Initialize the window data */ - virtual void OnInit() + void OnInit() override { this->base = _tree_base_by_landscape[_settings_game.game_creation.landscape]; this->count = _tree_count_by_landscape[_settings_game.game_creation.landscape]; } - virtual void OnPlaceObjectAbort() + void OnPlaceObjectAbort() override { this->RaiseButtons(); } diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 777716c646..f4e7665893 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -605,7 +605,7 @@ struct RefitWindow : public Window { this->SetWidgetDisabledState(WID_VR_REFIT, this->sel[0] < 0); } - virtual void OnInit() + void OnInit() override { if (this->cargo != NULL) { /* Store the RefitOption currently in use. */ @@ -635,7 +635,7 @@ struct RefitWindow : public Window { } } - virtual void OnPaint() + void OnPaint() override { /* Determine amount of items for scroller. */ if (this->hscroll != NULL) this->hscroll->SetCount(this->vehicle_width); @@ -656,7 +656,7 @@ struct RefitWindow : public Window { this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_VR_MATRIX: @@ -674,7 +674,7 @@ struct RefitWindow : public Window { } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_VR_CAPTION) SetDParam(0, Vehicle::Get(this->window_number)->index); } @@ -726,7 +726,7 @@ struct RefitWindow : public Window { } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_VR_VEHICLE_PANEL_DISPLAY: { @@ -808,7 +808,7 @@ struct RefitWindow : public Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { switch (data) { case VIWD_AUTOREPLACE: // Autoreplace replaced the vehicle; selected_vehicle became invalid. @@ -916,7 +916,7 @@ struct RefitWindow : public Window { } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_VR_VEHICLE_PANEL_DISPLAY: { // Vehicle image. @@ -958,7 +958,7 @@ struct RefitWindow : public Window { } } - virtual void OnMouseDrag(Point pt, int widget) + void OnMouseDrag(Point pt, int widget) override { switch (widget) { case WID_VR_VEHICLE_PANEL_DISPLAY: { // Vehicle image. @@ -971,7 +971,7 @@ struct RefitWindow : public Window { } } - virtual void OnDragDrop(Point pt, int widget) + void OnDragDrop(Point pt, int widget) override { switch (widget) { case WID_VR_VEHICLE_PANEL_DISPLAY: { // Vehicle image. @@ -984,7 +984,7 @@ struct RefitWindow : public Window { } } - virtual void OnResize() + void OnResize() override { this->vehicle_width = GetVehicleWidth(Vehicle::Get(this->window_number), EIT_IN_DETAILS); this->vscroll->SetCapacityFromWidget(this, WID_VR_MATRIX); @@ -1485,7 +1485,7 @@ public: *this->sorting = this->vehicles.GetListing(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_VL_LIST: @@ -1522,7 +1522,7 @@ public: } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_VL_AVAILABLE_VEHICLES: @@ -1565,7 +1565,7 @@ public: } } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { switch (widget) { case WID_VL_SORT_ORDER: @@ -1579,7 +1579,7 @@ public: } } - virtual void OnPaint() + void OnPaint() override { this->BuildVehicleList(); this->SortVehicleList(); @@ -1611,7 +1611,7 @@ public: this->DrawWidgets(); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_VL_SORT_ORDER: // Flip sorting method ascending/descending @@ -1650,7 +1650,7 @@ public: } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { switch (widget) { case WID_VL_SORT_BY_PULLDOWN: @@ -1676,7 +1676,7 @@ public: this->SetDirty(); } - virtual void OnGameTick() + void OnGameTick() override { if (this->vehicles.NeedResort()) { StationID station = (this->vli.type == VL_STATION_LIST) ? this->vli.index : INVALID_STATION; @@ -1686,7 +1686,7 @@ public: } } - virtual void OnResize() + void OnResize() override { this->vscroll->SetCapacityFromWidget(this, WID_VL_LIST); } @@ -1696,7 +1696,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope && HasBit(data, 31) && this->vli.type == VL_SHARED_ORDERS) { /* Needs to be done in command-scope, so everything stays valid */ @@ -1886,7 +1886,7 @@ struct VehicleDetailsWindow : Window { * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (data == VIWD_AUTOREPLACE) { /* Autoreplace replaced the vehicle. @@ -1926,7 +1926,7 @@ struct VehicleDetailsWindow : Window { return desired_height; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_VD_TOP_DETAILS: { @@ -2030,12 +2030,12 @@ struct VehicleDetailsWindow : Window { } } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_VD_CAPTION) SetDParam(0, Vehicle::Get(this->window_number)->index); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { const Vehicle *v = Vehicle::Get(this->window_number); @@ -2133,7 +2133,7 @@ struct VehicleDetailsWindow : Window { } /** Repaint vehicle details window. */ - virtual void OnPaint() + void OnPaint() override { const Vehicle *v = Vehicle::Get(this->window_number); @@ -2158,7 +2158,7 @@ struct VehicleDetailsWindow : Window { this->DrawWidgets(); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_VD_RENAME_VEHICLE: { // rename @@ -2206,7 +2206,7 @@ struct VehicleDetailsWindow : Window { } } - virtual void OnDropdownSelect(int widget, int index) + void OnDropdownSelect(int widget, int index) override { switch (widget) { case WID_VD_SERVICE_INTERVAL_DROPDOWN: { @@ -2220,14 +2220,14 @@ struct VehicleDetailsWindow : Window { } } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (str == NULL) return; DoCommandP(0, this->window_number, 0, CMD_RENAME_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_RENAME_TRAIN + Vehicle::Get(this->window_number)->type), NULL, str); } - virtual void OnResize() + void OnResize() override { NWidgetCore *nwi = this->GetWidget(WID_VD_MATRIX); if (nwi != NULL) { @@ -2515,7 +2515,7 @@ public: DeleteWindowById(WC_VEHICLE_TIMETABLE, this->window_number, false); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { const Vehicle *v = Vehicle::Get(this->window_number); switch (widget) { @@ -2537,7 +2537,7 @@ public: } } - virtual void OnPaint() + void OnPaint() override { const Vehicle *v = Vehicle::Get(this->window_number); bool is_localcompany = v->owner == _local_company; @@ -2556,7 +2556,7 @@ public: this->DrawWidgets(); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget != WID_VV_CAPTION) return; @@ -2564,7 +2564,7 @@ public: SetDParam(0, v->index); } - virtual void DrawWidget(const Rect &r, int widget) const + void DrawWidget(const Rect &r, int widget) const override { if (widget != WID_VV_START_STOP) return; @@ -2663,7 +2663,7 @@ public: DrawString(text_left + lowered, text_right + lowered, r.top + WD_FRAMERECT_TOP + lowered, str, TC_FROMSTRING, SA_HOR_CENTER); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { const Vehicle *v = Vehicle::Get(this->window_number); @@ -2726,7 +2726,7 @@ public: } } - virtual void OnResize() + void OnResize() override { if (this->viewport != NULL) { NWidgetViewport *nvp = this->GetWidget(WID_VV_VIEWPORT); @@ -2764,7 +2764,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (data == VIWD_AUTOREPLACE) { /* Autoreplace replaced the vehicle. @@ -2775,12 +2775,12 @@ public: this->UpdateButtonStatus(); } - virtual bool IsNewGRFInspectable() const + bool IsNewGRFInspectable() const override { return ::IsNewGRFInspectable(GetGrfSpecFeature(Vehicle::Get(this->window_number)->type), this->window_number); } - virtual void ShowNewGRFInspectWindow() const + void ShowNewGRFInspectWindow() const override { ::ShowNewGRFInspectWindow(GetGrfSpecFeature(Vehicle::Get(this->window_number)->type), this->window_number); } diff --git a/src/viewport_gui.cpp b/src/viewport_gui.cpp index 9c89a85f84..936990ac5b 100644 --- a/src/viewport_gui.cpp +++ b/src/viewport_gui.cpp @@ -80,7 +80,7 @@ public: this->viewport->dest_scrollpos_y = this->viewport->scrollpos_y; } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { switch (widget) { case WID_EV_CAPTION: @@ -90,7 +90,7 @@ public: } } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_EV_ZOOM_IN: DoZoomInOutWindow(ZOOM_IN, this); break; @@ -120,7 +120,7 @@ public: } } - virtual void OnResize() + void OnResize() override { if (this->viewport != NULL) { NWidgetViewport *nvp = this->GetWidget(WID_EV_VIEWPORT); @@ -128,7 +128,7 @@ public: } } - virtual void OnScroll(Point delta) + void OnScroll(Point delta) override { this->viewport->scrollpos_x += ScaleByZoom(delta.x, this->viewport->zoom); this->viewport->scrollpos_y += ScaleByZoom(delta.y, this->viewport->zoom); @@ -136,7 +136,7 @@ public: this->viewport->dest_scrollpos_y = this->viewport->scrollpos_y; } - virtual void OnMouseWheel(int wheel) + void OnMouseWheel(int wheel) override { if (_settings_client.gui.scrollwheel_scrolling != 2) { ZoomInOrOutToCursorWindow(wheel < 0, this); @@ -148,7 +148,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; /* Only handle zoom message if intended for us (msg ZOOM_IN/ZOOM_OUT) */ diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp index fa4deaac68..5dd57c080d 100644 --- a/src/waypoint_gui.cpp +++ b/src/waypoint_gui.cpp @@ -81,12 +81,12 @@ public: DeleteWindowById(GetWindowClassForVehicleType(this->vt), VehicleListIdentifier(VL_STATION_LIST, this->vt, this->owner, this->window_number).Pack(), false); } - virtual void SetStringParameters(int widget) const + void SetStringParameters(int widget) const override { if (widget == WID_W_CAPTION) SetDParam(0, this->wp->index); } - virtual void OnClick(Point pt, int widget, int click_count) + void OnClick(Point pt, int widget, int click_count) override { switch (widget) { case WID_W_CENTER_VIEW: // scroll to location @@ -113,7 +113,7 @@ public: * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) + void OnInvalidateData(int data = 0, bool gui_scope = true) override { if (!gui_scope) return; /* You can only change your own waypoints */ @@ -124,7 +124,7 @@ public: ScrollWindowToTile(this->GetCenterTile(), this, true); } - virtual void OnResize() + void OnResize() override { if (this->viewport != NULL) { NWidgetViewport *nvp = this->GetWidget(WID_W_VIEWPORT); @@ -135,7 +135,7 @@ public: } } - virtual void OnQueryTextFinished(char *str) + void OnQueryTextFinished(char *str) override { if (str == NULL) return; From 76e77aefada54d1a0dbf7e4b7fb12a9c5f3cb838 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 24 Mar 2019 00:12:31 +0000 Subject: [PATCH 31/82] Fix #7400: Water class for tree tiles was not converted for old saves preventing industry creation. As the information is always available from the tree ground type, unconditionally update the map array for tree tiles. --- src/saveload/afterload.cpp | 7 +++++++ src/tree_map.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 6f32c5506f..f940632654 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -3111,6 +3111,13 @@ bool AfterLoadGame() FOR_ALL_INDUSTRIES(ind) if (ind->neutral_station != NULL) ind->neutral_station->industry = ind; } + { + /* Update water class for trees for all current savegame versions. */ + for (TileIndex t = 0; t < map_size; t++) { + if (IsTileType(t, MP_TREES)) SetWaterClass(t, GetTreeGround(t) == TREE_GROUND_SHORE ? WATER_CLASS_SEA : WATER_CLASS_INVALID); + } + } + /* Compute station catchment areas. This is needed here in case UpdateStationAcceptance is called below. */ Station::RecomputeCatchmentForAll(); diff --git a/src/tree_map.h b/src/tree_map.h index df9fd441cc..bd1567b54c 100644 --- a/src/tree_map.h +++ b/src/tree_map.h @@ -277,6 +277,7 @@ static inline void MakeTree(TileIndex t, TreeType type, uint count, uint growth, { SetTileType(t, MP_TREES); SetTileOwner(t, OWNER_NONE); + SetWaterClass(t, ground == TREE_GROUND_SHORE ? WATER_CLASS_SEA : WATER_CLASS_INVALID); _m[t].m2 = ground << 6 | density << 4 | 0; _m[t].m3 = type; _m[t].m4 = 0 << 5 | 0 << 2; From f6264e5212575e63f02cb0741e7188ff0d154fac Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 24 Mar 2019 14:54:13 +0000 Subject: [PATCH 32/82] Change: Bump savegame version for tree tile water class conversion. --- src/saveload/afterload.cpp | 4 ++-- src/saveload/saveload.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index f940632654..6ec4ab67c9 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -3111,8 +3111,8 @@ bool AfterLoadGame() FOR_ALL_INDUSTRIES(ind) if (ind->neutral_station != NULL) ind->neutral_station->industry = ind; } - { - /* Update water class for trees for all current savegame versions. */ + if (IsSavegameVersionBefore(SLV_TREES_WATER_CLASS)) { + /* Update water class for trees. */ for (TileIndex t = 0; t < map_size; t++) { if (IsTileType(t, MP_TREES)) SetWaterClass(t, GetTreeGround(t) == TREE_GROUND_SHORE ? WATER_CLASS_SEA : WATER_CLASS_INVALID); } diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h index 61d5273401..07d45fafdb 100644 --- a/src/saveload/saveload.h +++ b/src/saveload/saveload.h @@ -297,6 +297,7 @@ enum SaveLoadVersion : uint16 { SLV_SERVE_NEUTRAL_INDUSTRIES, ///< 210 PR#7234 Company stations can serve industries with attached neutral stations. SLV_ROADVEH_PATH_CACHE, ///< 211 PR#7261 Add path cache for road vehicles. SLV_REMOVE_OPF, ///< 212 PR#7245 Remove OPF. + SLV_TREES_WATER_CLASS, ///< 213 PR#7405 WaterClass update for tree tiles. SL_MAX_VERSION, ///< Highest possible saveload version }; From d54b6ac09b6fe88c09f7886739fe9c05f16b8222 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Thu, 28 Feb 2019 21:32:08 +0000 Subject: [PATCH 33/82] Feature: When filtering purchase list by cargo type, make buy button perform a refit if required. --- src/autoreplace_cmd.cpp | 2 +- src/build_vehicle_gui.cpp | 36 +++++++++++++--- src/lang/english.txt | 10 +++++ src/script/api/script_vehicle.cpp | 2 +- src/vehicle_cmd.cpp | 71 ++++++++++++++++++++++--------- 5 files changed, 94 insertions(+), 27 deletions(-) diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index 95568e3811..7a8a7fefd8 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -294,7 +294,7 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic if (refit_cargo == CT_INVALID) return CommandCost(); // incompatible cargoes /* Build the new vehicle */ - cost = DoCommand(old_veh->tile, e, 0, DC_EXEC | DC_AUTOREPLACE, GetCmdBuildVeh(old_veh)); + cost = DoCommand(old_veh->tile, e | (CT_INVALID << 24), 0, DC_EXEC | DC_AUTOREPLACE, GetCmdBuildVeh(old_veh)); if (cost.Failed()) return cost; Vehicle *new_veh = Vehicle::Get(_new_vehicle_id); diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 77c175ee7b..94353382b8 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -989,6 +989,22 @@ struct BuildVehicleWindow : Window { int details_height; ///< Minimal needed height of the details panels (found so far). Scrollbar *vscroll; + void SetBuyVehicleText() + { + NWidgetCore *widget = this->GetWidget(WID_BV_BUILD); + + bool refit = this->sel_engine != INVALID_ENGINE && this->cargo_filter[this->cargo_filter_criteria] != CF_ANY && this->cargo_filter[this->cargo_filter_criteria] != CF_NONE; + if (refit) refit = Engine::Get(this->sel_engine)->GetDefaultCargoType() != this->cargo_filter[this->cargo_filter_criteria]; + + if (refit) { + widget->widget_data = STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON + this->vehicle_type; + widget->tool_tip = STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP + this->vehicle_type; + } else { + widget->widget_data = STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_BUTTON + this->vehicle_type; + widget->tool_tip = STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP + this->vehicle_type; + } + } + BuildVehicleWindow(WindowDesc *desc, TileIndex tile, VehicleType type) : Window(desc) { this->vehicle_type = type; @@ -1031,10 +1047,6 @@ struct BuildVehicleWindow : Window { widget = this->GetWidget(WID_BV_SHOW_HIDE); widget->tool_tip = STR_BUY_VEHICLE_TRAIN_HIDE_SHOW_TOGGLE_TOOLTIP + type; - widget = this->GetWidget(WID_BV_BUILD); - widget->widget_data = STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_BUTTON + type; - widget->tool_tip = STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP + type; - widget = this->GetWidget(WID_BV_RENAME); widget->widget_data = STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON + type; widget->tool_tip = STR_BUY_VEHICLE_TRAIN_RENAME_TOOLTIP + type; @@ -1054,6 +1066,7 @@ struct BuildVehicleWindow : Window { this->GenerateBuildList(); // generate the list, since we need it in the next line /* Select the first engine in the list as default when opening the window */ if (this->eng_list.Length() > 0) this->sel_engine = this->eng_list[0]; + this->SetBuyVehicleText(); } /** Populate the filter list and set the cargo filter criteria. */ @@ -1111,8 +1124,10 @@ struct BuildVehicleWindow : Window { this->eng_list.Filter(this->cargo_filter[this->cargo_filter_criteria]); if (0 == this->eng_list.Length()) { // no engine passed through the filter, invalidate the previously selected engine this->sel_engine = INVALID_ENGINE; + this->SetBuyVehicleText(); } else if (!this->eng_list.Contains(this->sel_engine)) { // previously selected engine didn't pass the filter, select the first engine of the list this->sel_engine = this->eng_list[0]; + this->SetBuyVehicleText(); } } @@ -1294,6 +1309,7 @@ struct BuildVehicleWindow : Window { uint i = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_BV_LIST); size_t num_items = this->eng_list.Length(); this->sel_engine = (i < num_items) ? this->eng_list[i] : INVALID_ENGINE; + this->SetBuyVehicleText(); this->SetDirty(); if (_ctrl_pressed) { this->OnClick(pt, WID_BV_SHOW_HIDE, 1); @@ -1323,7 +1339,9 @@ struct BuildVehicleWindow : Window { EngineID sel_eng = this->sel_engine; if (sel_eng != INVALID_ENGINE) { CommandCallback *callback = (this->vehicle_type == VEH_TRAIN && RailVehInfo(sel_eng)->railveh_type == RAILVEH_WAGON) ? CcBuildWagon : CcBuildPrimaryVehicle; - DoCommandP(this->window_number, sel_eng, 0, GetCmdBuildVeh(this->vehicle_type), callback); + bool refit = this->cargo_filter[this->cargo_filter_criteria] != CF_ANY && this->cargo_filter[this->cargo_filter_criteria] != CF_NONE; + CargoID cargo = refit ? this->cargo_filter[this->cargo_filter_criteria] : CT_INVALID; + DoCommandP(this->window_number, sel_eng | (cargo << 24), 0, GetCmdBuildVeh(this->vehicle_type), callback); } break; } @@ -1411,6 +1429,13 @@ struct BuildVehicleWindow : Window { break; } + case WID_BV_BUILD: + *size = GetStringBoundingBox(STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_BUTTON + this->vehicle_type); + *size = maxdim(*size, GetStringBoundingBox(STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON + this->vehicle_type)); + size->width += padding.width; + size->height += padding.height; + break; + case WID_BV_SHOW_HIDE: *size = GetStringBoundingBox(STR_BUY_VEHICLE_TRAIN_HIDE_TOGGLE_BUTTON + this->vehicle_type); *size = maxdim(*size, GetStringBoundingBox(STR_BUY_VEHICLE_TRAIN_SHOW_TOGGLE_BUTTON + this->vehicle_type)); @@ -1485,6 +1510,7 @@ struct BuildVehicleWindow : Window { /* deactivate filter if criteria is 'Show All', activate it otherwise */ this->eng_list.SetFilterState(this->cargo_filter[this->cargo_filter_criteria] != CF_ANY); this->eng_list.ForceRebuild(); + this->SetBuyVehicleText(); } break; } diff --git a/src/lang/english.txt b/src/lang/english.txt index 3661e74c30..86e045d067 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3501,11 +3501,21 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Buy Vehi STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Buy Ship STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Buy Aircraft +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Buy and Refit Vehicle +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Buy and Refit Vehicle +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Buy and Refit Ship +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Buy and Refit Aircraft + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted train vehicle. Shift+Click shows estimated cost without purchase STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted road vehicle. Shift+Click shows estimated cost without purchase STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted ship. Shift+Click shows estimated cost without purchase STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted aircraft. Shift+Click shows estimated cost without purchase +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Buy and refit the highlighted train vehicle. Shift+Click shows estimated cost without purchase +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Buy and refit the highlighted road vehicle. Shift+Click shows estimated cost without purchase +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Buy and refit the highlighted ship. Shift+Click shows estimated cost without purchase +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Buy and refit the highlighted aircraft. Shift+Click shows estimated cost without purchase + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Rename STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Rename STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Rename diff --git a/src/script/api/script_vehicle.cpp b/src/script/api/script_vehicle.cpp index ca841f7557..ca05ec58f1 100644 --- a/src/script/api/script_vehicle.cpp +++ b/src/script/api/script_vehicle.cpp @@ -70,7 +70,7 @@ EnforcePreconditionCustomError(VEHICLE_INVALID, !ScriptGameSettings::IsDisabledVehicleType((ScriptVehicle::VehicleType)type), ScriptVehicle::ERR_VEHICLE_BUILD_DISABLED); - if (!ScriptObject::DoCommand(depot, engine_id, 0, ::GetCmdBuildVeh(type), NULL, &ScriptInstance::DoCommandReturnVehicleID)) return VEHICLE_INVALID; + if (!ScriptObject::DoCommand(depot, engine_id | (CT_INVALID << 24), 0, ::GetCmdBuildVeh(type), NULL, &ScriptInstance::DoCommandReturnVehicleID)) return VEHICLE_INVALID; /* In case of test-mode, we return VehicleID 0 */ return 0; diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 8284511dd4..345874e586 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -71,13 +71,16 @@ CommandCost CmdBuildRoadVehicle(TileIndex tile, DoCommandFlag flags, const Engin CommandCost CmdBuildShip (TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v); CommandCost CmdBuildAircraft (TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v); +CommandCost CmdRefitVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text); + /** * Build a vehicle. * @param tile tile of depot where the vehicle is built * @param flags for command * @param p1 various bitstuffed data * bits 0-15: vehicle type being built. - * bits 16-31: vehicle type specific bits passed on to the vehicle build functions. + * bits 16-23: vehicle type specific bits passed on to the vehicle build functions. + * bits 24-31: refit cargo type. * @param p2 User * @param text unused * @return the cost of this operation or an error @@ -93,11 +96,18 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint EngineID eid = GB(p1, 0, 16); if (!IsEngineBuildable(eid, type, _current_company)) return_cmd_error(STR_ERROR_RAIL_VEHICLE_NOT_AVAILABLE + type); + /* Validate the cargo type. */ + CargoID cargo = GB(p1, 24, 8); + if (cargo >= NUM_CARGO && cargo != CT_INVALID) return CMD_ERROR; + const Engine *e = Engine::Get(eid); CommandCost value(EXPENSES_NEW_VEHICLES, e->GetCost()); /* Engines without valid cargo should not be available */ - if (e->GetDefaultCargoType() == CT_INVALID) return CMD_ERROR; + CargoID default_cargo = e->GetDefaultCargoType(); + if (default_cargo == CT_INVALID) return CMD_ERROR; + + bool refitting = cargo != CT_INVALID && cargo != default_cargo; /* Check whether the number of vehicles we need to build can be built according to pool space. */ uint num_vehicles; @@ -116,32 +126,53 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint UnitID unit_num = (flags & DC_AUTOREPLACE || (type == VEH_TRAIN && e->u.rail.railveh_type == RAILVEH_WAGON)) ? 0 : GetFreeUnitNumber(type); if (unit_num == UINT16_MAX) return_cmd_error(STR_ERROR_TOO_MANY_VEHICLES_IN_GAME); + /* If we are refitting we need to temporarily purchase the vehicle to be able to + * test it. */ + DoCommandFlag subflags = flags; + if (refitting) subflags |= DC_EXEC; + Vehicle *v; switch (type) { - case VEH_TRAIN: value.AddCost(CmdBuildRailVehicle(tile, flags, e, GB(p1, 16, 16), &v)); break; - case VEH_ROAD: value.AddCost(CmdBuildRoadVehicle(tile, flags, e, GB(p1, 16, 16), &v)); break; - case VEH_SHIP: value.AddCost(CmdBuildShip (tile, flags, e, GB(p1, 16, 16), &v)); break; - case VEH_AIRCRAFT: value.AddCost(CmdBuildAircraft (tile, flags, e, GB(p1, 16, 16), &v)); break; + case VEH_TRAIN: value.AddCost(CmdBuildRailVehicle(tile, subflags, e, GB(p1, 24, 8), &v)); break; + case VEH_ROAD: value.AddCost(CmdBuildRoadVehicle(tile, subflags, e, GB(p1, 24, 8), &v)); break; + case VEH_SHIP: value.AddCost(CmdBuildShip (tile, subflags, e, GB(p1, 24, 8), &v)); break; + case VEH_AIRCRAFT: value.AddCost(CmdBuildAircraft (tile, subflags, e, GB(p1, 24, 8), &v)); break; default: NOT_REACHED(); // Safe due to IsDepotTile() } - if (value.Succeeded() && flags & DC_EXEC) { - v->unitnumber = unit_num; - v->value = value.GetCost(); + if (value.Succeeded()) { + if (refitting || (flags & DC_EXEC)) { + v->unitnumber = unit_num; + v->value = value.GetCost(); + } + + if (refitting) { + value.AddCost(CmdRefitVehicle(tile, flags, v->index, cargo, NULL)); + } - InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile); - InvalidateWindowClassesData(GetWindowClassForVehicleType(type), 0); - SetWindowDirty(WC_COMPANY, _current_company); - if (IsLocalCompany()) { - InvalidateAutoreplaceWindow(v->engine_type, v->group_id); // updates the auto replace window (must be called before incrementing num_engines) + if (flags & DC_EXEC) { + InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile); + InvalidateWindowClassesData(GetWindowClassForVehicleType(type), 0); + SetWindowDirty(WC_COMPANY, _current_company); + if (IsLocalCompany()) { + InvalidateAutoreplaceWindow(v->engine_type, v->group_id); // updates the auto replace window (must be called before incrementing num_engines) + } + } + + if (refitting || (flags & DC_EXEC)) { + GroupStatistics::CountEngine(v, 1); + GroupStatistics::UpdateAutoreplace(_current_company); + + if (v->IsPrimaryVehicle()) { + GroupStatistics::CountVehicle(v, 1); + OrderBackup::Restore(v, p2); + } } - GroupStatistics::CountEngine(v, 1); - GroupStatistics::UpdateAutoreplace(_current_company); - if (v->IsPrimaryVehicle()) { - GroupStatistics::CountVehicle(v, 1); - OrderBackup::Restore(v, p2); + /* If we are not in DC_EXEC undo everything */ + if (refitting && (flags & DC_EXEC) == 0) { + DoCommand(0, v->index, 0, DC_EXEC, GetCmdSellVeh(v)); } } @@ -832,7 +863,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint DoCommandFlag build_flags = flags; if ((flags & DC_EXEC) && !v->IsPrimaryVehicle()) build_flags |= DC_AUTOREPLACE; - CommandCost cost = DoCommand(tile, v->engine_type | (1 << 16), 0, build_flags, GetCmdBuildVeh(v)); + CommandCost cost = DoCommand(tile, v->engine_type | (1 << 16) | (CT_INVALID << 24), 0, build_flags, GetCmdBuildVeh(v)); if (cost.Failed()) { /* Can't build a part, then sell the stuff we already made; clear up the mess */ From f8e6cd10ef8161fbaa95a847a794e475d6aeb60e Mon Sep 17 00:00:00 2001 From: glx Date: Fri, 8 Mar 2019 19:52:22 +0100 Subject: [PATCH 34/82] Add: script API functions for build with refit feature --- bin/ai/regression/tst_regression/main.nut | 13 +++++++ bin/ai/regression/tst_regression/result.txt | 14 +++++++- src/script/api/ai/ai_vehicle.hpp.sq | 2 ++ src/script/api/game/game_vehicle.hpp.sq | 2 ++ src/script/api/script_vehicle.cpp | 29 +++++++++++++-- src/script/api/script_vehicle.hpp | 40 +++++++++++++++++++++ 6 files changed, 96 insertions(+), 4 deletions(-) diff --git a/bin/ai/regression/tst_regression/main.nut b/bin/ai/regression/tst_regression/main.nut index 7315f33f82..baece09d08 100644 --- a/bin/ai/regression/tst_regression/main.nut +++ b/bin/ai/regression/tst_regression/main.nut @@ -1704,6 +1704,19 @@ function Regression::Vehicle() print(" GetWagonEngineType(): " + AIVehicle.GetWagonEngineType(17 3)); print(" GetWagonAge(): " + AIVehicle.GetWagonAge(17, 3)); + print(" --Refit--"); + print(" GetBuildWithRefitCapacity(): " + AIVehicle.GetBuildWithRefitCapacity(28479, 211, 255)); + print(" GetBuildWithRefitCapacity(): " + AIVehicle.GetBuildWithRefitCapacity(28479, 211, 0)); + print(" GetBuildWithRefitCapacity(): " + AIVehicle.GetBuildWithRefitCapacity(28479, 211, 9)); + print(" BuildVehicleWithRefit(): " + AIVehicle.BuildVehicleWithRefit(28479, 211, 9)); + print(" GetCapacity(): " + AIVehicle.GetCapacity(20, 9)); + print(" GetCapacity(): " + AIVehicle.GetCapacity(20, 5)); + print(" GetRefitCapacity(): " + AIVehicle.GetRefitCapacity(20, 5)); + print(" RefitVehicle(): " + AIVehicle.RefitVehicle(20, 5)); + print(" GetCapacity(): " + AIVehicle.GetCapacity(20, 9)); + print(" GetCapacity(): " + AIVehicle.GetCapacity(20, 5)); + print(" SellVehicle(): " + AIVehicle.SellVehicle(20)); + print(" --Errors--"); print(" RefitVehicle(): " + AIVehicle.RefitVehicle(12, 0)); print(" GetLastErrorString(): " + AIError.GetLastErrorString()); diff --git a/bin/ai/regression/tst_regression/result.txt b/bin/ai/regression/tst_regression/result.txt index e93b2e2343..cda888d297 100644 --- a/bin/ai/regression/tst_regression/result.txt +++ b/bin/ai/regression/tst_regression/result.txt @@ -9128,6 +9128,18 @@ ERROR: IsEnd() is invalid as Begin() is never called GetWagonAge(): 0 GetWagonEngineType(): 65535 GetWagonAge(): -1 + --Refit-- + GetBuildWithRefitCapacity(): -1 + GetBuildWithRefitCapacity(): 0 + GetBuildWithRefitCapacity(): 160 + BuildVehicleWithRefit(): 20 + GetCapacity(): 160 + GetCapacity(): 0 + GetRefitCapacity(): 160 + RefitVehicle(): true + GetCapacity(): 0 + GetCapacity(): 160 + SellVehicle(): true --Errors-- RefitVehicle(): false GetLastErrorString(): ERR_VEHICLE_NOT_IN_DEPOT @@ -9175,7 +9187,7 @@ ERROR: IsEnd() is invalid as Begin() is never called 13 => 5489 12 => 5489 CurrentSpeed ListDump: - 12 => 21 + 12 => 27 17 => 0 16 => 0 14 => 0 diff --git a/src/script/api/ai/ai_vehicle.hpp.sq b/src/script/api/ai/ai_vehicle.hpp.sq index 0eb21ed672..dbd0096ada 100644 --- a/src/script/api/ai/ai_vehicle.hpp.sq +++ b/src/script/api/ai/ai_vehicle.hpp.sq @@ -122,6 +122,8 @@ void SQAIVehicle_Register(Squirrel *engine) SQAIVehicle.DefSQStaticMethod(engine, &ScriptVehicle::IsInDepot, "IsInDepot", 2, ".i"); SQAIVehicle.DefSQStaticMethod(engine, &ScriptVehicle::IsStoppedInDepot, "IsStoppedInDepot", 2, ".i"); SQAIVehicle.DefSQStaticMethod(engine, &ScriptVehicle::BuildVehicle, "BuildVehicle", 3, ".ii"); + SQAIVehicle.DefSQStaticMethod(engine, &ScriptVehicle::BuildVehicleWithRefit, "BuildVehicleWithRefit", 4, ".iii"); + SQAIVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetBuildWithRefitCapacity, "GetBuildWithRefitCapacity", 4, ".iii"); SQAIVehicle.DefSQStaticMethod(engine, &ScriptVehicle::CloneVehicle, "CloneVehicle", 4, ".iib"); SQAIVehicle.DefSQStaticMethod(engine, &ScriptVehicle::MoveWagon, "MoveWagon", 5, ".iiii"); SQAIVehicle.DefSQStaticMethod(engine, &ScriptVehicle::MoveWagonChain, "MoveWagonChain", 5, ".iiii"); diff --git a/src/script/api/game/game_vehicle.hpp.sq b/src/script/api/game/game_vehicle.hpp.sq index 3dc9fe67ad..15a007046e 100644 --- a/src/script/api/game/game_vehicle.hpp.sq +++ b/src/script/api/game/game_vehicle.hpp.sq @@ -123,6 +123,8 @@ void SQGSVehicle_Register(Squirrel *engine) SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::IsInDepot, "IsInDepot", 2, ".i"); SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::IsStoppedInDepot, "IsStoppedInDepot", 2, ".i"); SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::BuildVehicle, "BuildVehicle", 3, ".ii"); + SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::BuildVehicleWithRefit, "BuildVehicleWithRefit", 4, ".iii"); + SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetBuildWithRefitCapacity, "GetBuildWithRefitCapacity", 4, ".iii"); SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::CloneVehicle, "CloneVehicle", 4, ".iib"); SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::MoveWagon, "MoveWagon", 5, ".iiii"); SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::MoveWagonChain, "MoveWagonChain", 5, ".iiii"); diff --git a/src/script/api/script_vehicle.cpp b/src/script/api/script_vehicle.cpp index ca05ec58f1..46fae0a917 100644 --- a/src/script/api/script_vehicle.cpp +++ b/src/script/api/script_vehicle.cpp @@ -61,21 +61,44 @@ return v->IsGroundVehicle() ? v->GetGroundVehicleCache()->cached_total_length : -1; } -/* static */ VehicleID ScriptVehicle::BuildVehicle(TileIndex depot, EngineID engine_id) +/* static */ VehicleID ScriptVehicle::_BuildVehicleInternal(TileIndex depot, EngineID engine_id, CargoID cargo) { - EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); + EnforcePrecondition(VEHICLE_INVALID, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(VEHICLE_INVALID, ScriptEngine::IsBuildable(engine_id)); + EnforcePrecondition(VEHICLE_INVALID, cargo == CT_INVALID || ScriptCargo::IsValidCargo(cargo)); ::VehicleType type = ::Engine::Get(engine_id)->type; EnforcePreconditionCustomError(VEHICLE_INVALID, !ScriptGameSettings::IsDisabledVehicleType((ScriptVehicle::VehicleType)type), ScriptVehicle::ERR_VEHICLE_BUILD_DISABLED); - if (!ScriptObject::DoCommand(depot, engine_id | (CT_INVALID << 24), 0, ::GetCmdBuildVeh(type), NULL, &ScriptInstance::DoCommandReturnVehicleID)) return VEHICLE_INVALID; + if (!ScriptObject::DoCommand(depot, engine_id | (cargo << 24), 0, ::GetCmdBuildVeh(type), NULL, &ScriptInstance::DoCommandReturnVehicleID)) return VEHICLE_INVALID; /* In case of test-mode, we return VehicleID 0 */ return 0; } +/* static */ VehicleID ScriptVehicle::BuildVehicle(TileIndex depot, EngineID engine_id) +{ + return _BuildVehicleInternal(depot, engine_id, CT_INVALID); +} + +/* static */ VehicleID ScriptVehicle::BuildVehicleWithRefit(TileIndex depot, EngineID engine_id, CargoID cargo) +{ + EnforcePrecondition(VEHICLE_INVALID, ScriptCargo::IsValidCargo(cargo)); + return _BuildVehicleInternal(depot, engine_id, cargo); +} + +/* static */ int ScriptVehicle::GetBuildWithRefitCapacity(TileIndex depot, EngineID engine_id, CargoID cargo) +{ + if (!ScriptEngine::IsBuildable(engine_id)) return -1; + if (!ScriptCargo::IsValidCargo(cargo)) return -1; + + ::VehicleType type = ::Engine::Get(engine_id)->type; + + CommandCost res = ::DoCommand(depot, engine_id | (cargo << 24), 0, DC_QUERY_COST, ::GetCmdBuildVeh(type)); + return res.Succeeded() ? _returned_refit_capacity : -1; +} + /* static */ VehicleID ScriptVehicle::CloneVehicle(TileIndex depot, VehicleID vehicle_id, bool share_orders) { EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); diff --git a/src/script/api/script_vehicle.hpp b/src/script/api/script_vehicle.hpp index f6b22c204d..d027e12435 100644 --- a/src/script/api/script_vehicle.hpp +++ b/src/script/api/script_vehicle.hpp @@ -320,6 +320,41 @@ public: */ static VehicleID BuildVehicle(TileIndex depot, EngineID engine_id); + /** + * Builds a vehicle with the given engine at the given depot and refits it to the given cargo. + * @param depot The depot where the vehicle will be build. + * @param engine_id The engine to use for this vehicle. + * @param cargo The cargo to refit to. + * @pre The tile at depot has a depot that can build the engine and + * is owned by you. + * @pre ScriptEngine::IsBuildable(engine_id). + * @pre ScriptCargo::IsValidCargo(cargo). + * @game @pre Valid ScriptCompanyMode active in scope. + * @exception ScriptVehicle::ERR_VEHICLE_TOO_MANY + * @exception ScriptVehicle::ERR_VEHICLE_BUILD_DISABLED + * @exception ScriptVehicle::ERR_VEHICLE_WRONG_DEPOT + * @return The VehicleID of the new vehicle, or an invalid VehicleID when + * it failed. Check the return value using IsValidVehicle. In test-mode + * 0 is returned if it was successful; any other value indicates failure. + * @note In Test Mode it means you can't assign orders yet to this vehicle, + * as the vehicle isn't really built yet. Build it for real first before + * assigning orders. + */ + static VehicleID BuildVehicleWithRefit(TileIndex depot, EngineID engine_id, CargoID cargo); + + /** + * Gets the capacity of a vehicle built at the given depot with the given engine and refitted to the given cargo. + * @param depot The depot where the vehicle will be build. + * @param engine_id The engine to use for this vehicle. + * @param cargo The cargo to refit to. + * @pre The tile at depot has a depot that can build the engine and + * is owned by you. + * @pre ScriptEngine::IsBuildable(engine_id). + * @pre ScriptCargo::IsValidCargo(cargo). + * @return The capacity the vehicle will have when refited. + */ + static int GetBuildWithRefitCapacity(TileIndex depot, EngineID engine_id, CargoID cargo); + /** * Clones a vehicle at the given depot, copying or cloning its orders. * @param depot The depot where the vehicle will be build. @@ -563,6 +598,11 @@ public: static uint GetMaximumOrderDistance(VehicleID vehicle_id); private: + /** + * Internal function used by BuildVehicle(WithRefit). + */ + static VehicleID _BuildVehicleInternal(TileIndex depot, EngineID engine_id, CargoID cargo); + /** * Internal function used by SellWagon(Chain). */ From e6bb90543e885d20814b4829c94c04909a311b71 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sat, 23 Mar 2019 21:06:46 +0000 Subject: [PATCH 35/82] Change: Show additional cost and refitted capacity in build vehicle window. --- src/articulated_vehicles.cpp | 6 +- src/autoreplace_gui.cpp | 9 +- src/build_vehicle_gui.cpp | 196 ++++++++++++++++++++++++----------- src/engine_func.h | 2 +- src/lang/english.txt | 3 + src/vehicle_cmd.cpp | 3 + src/vehicle_gui.h | 10 +- 7 files changed, 165 insertions(+), 64 deletions(-) diff --git a/src/articulated_vehicles.cpp b/src/articulated_vehicles.cpp index 44ad587895..62ab5b0961 100644 --- a/src/articulated_vehicles.cpp +++ b/src/articulated_vehicles.cpp @@ -168,16 +168,16 @@ CargoArray GetCapacityOfArticulatedParts(EngineID engine) * @param engine Model to investigate. * @param[out] cargoes Total amount of units that can be transported, summed by cargo. * @param[out] refits Whether a (possibly partial) refit for each cargo is possible. + * @param cargo_type Selected refitted cargo type + * @param cargo_capacity Capacity of selected refitted cargo type */ -void GetArticulatedVehicleCargoesAndRefits(EngineID engine, CargoArray *cargoes, CargoTypes *refits) +void GetArticulatedVehicleCargoesAndRefits(EngineID engine, CargoArray *cargoes, CargoTypes *refits, CargoID cargo_type, uint16 cargo_capacity) { cargoes->Clear(); *refits = 0; const Engine *e = Engine::Get(engine); - CargoID cargo_type; - uint16 cargo_capacity = GetVehicleDefaultCapacity(engine, &cargo_type); if (cargo_type < NUM_CARGO && cargo_capacity > 0) { (*cargoes)[cargo_type] += cargo_capacity; if (IsEngineRefittable(engine)) SetBit(*refits, cargo_type); diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 196d076da7..3a8a7543d5 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -423,9 +423,16 @@ public: /* Draw details panels. */ for (int side = 0; side < 2; side++) { if (this->sel_engine[side] != INVALID_ENGINE) { + /* Use default engine details without refitting */ + const Engine *e = Engine::Get(this->sel_engine[side]); + TestedEngineDetails ted; + ted.cost = 0; + ted.cargo = e->GetDefaultCargoType(); + ted.capacity = e->GetDisplayDefaultCapacity(&ted.mail_capacity); + NWidgetBase *nwi = this->GetWidget(side == 0 ? WID_RV_LEFT_DETAILS : WID_RV_RIGHT_DETAILS); int text_end = DrawVehiclePurchaseInfo(nwi->pos_x + WD_FRAMETEXT_LEFT, nwi->pos_x + nwi->current_x - WD_FRAMETEXT_RIGHT, - nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine[side]); + nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine[side], ted); needed_height = max(needed_height, text_end - (int)nwi->pos_y + WD_FRAMERECT_BOTTOM); } } diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 94353382b8..a086feccce 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -532,11 +532,11 @@ static GUIEngineList::FilterFunction * const _filter_funcs[] = { &CargoFilter, }; -static int DrawCargoCapacityInfo(int left, int right, int y, EngineID engine) +static int DrawCargoCapacityInfo(int left, int right, int y, EngineID engine, TestedEngineDetails &te) { CargoArray cap; CargoTypes refits; - GetArticulatedVehicleCargoesAndRefits(engine, &cap, &refits); + GetArticulatedVehicleCargoesAndRefits(engine, &cap, &refits, te.cargo, te.capacity); for (CargoID c = 0; c < NUM_CARGO; c++) { if (cap[c] == 0) continue; @@ -552,19 +552,25 @@ static int DrawCargoCapacityInfo(int left, int right, int y, EngineID engine) } /* Draw rail wagon specific details */ -static int DrawRailWagonPurchaseInfo(int left, int right, int y, EngineID engine_number, const RailVehicleInfo *rvi) +static int DrawRailWagonPurchaseInfo(int left, int right, int y, EngineID engine_number, const RailVehicleInfo *rvi, TestedEngineDetails &te) { const Engine *e = Engine::Get(engine_number); /* Purchase cost */ - SetDParam(0, e->GetCost()); - DrawString(left, right, y, STR_PURCHASE_INFO_COST); + if (te.cost != 0) { + SetDParam(0, e->GetCost() + te.cost); + SetDParam(1, te.cost); + DrawString(left, right, y, STR_PURCHASE_INFO_COST_REFIT); + } else { + SetDParam(0, e->GetCost()); + DrawString(left, right, y, STR_PURCHASE_INFO_COST); + } y += FONT_HEIGHT_NORMAL; /* Wagon weight - (including cargo) */ uint weight = e->GetDisplayWeight(); SetDParam(0, weight); - uint cargo_weight = (e->CanCarryCargo() ? CargoSpec::Get(e->GetDefaultCargoType())->weight * GetTotalCapacityOfArticulatedParts(engine_number) / 16 : 0); + uint cargo_weight = (e->CanCarryCargo() ? CargoSpec::Get(te.cargo)->weight * te.capacity / 16 : 0); SetDParam(1, cargo_weight + weight); DrawString(left, right, y, STR_PURCHASE_INFO_WEIGHT_CWEIGHT); y += FONT_HEIGHT_NORMAL; @@ -590,14 +596,21 @@ static int DrawRailWagonPurchaseInfo(int left, int right, int y, EngineID engine } /* Draw locomotive specific details */ -static int DrawRailEnginePurchaseInfo(int left, int right, int y, EngineID engine_number, const RailVehicleInfo *rvi) +static int DrawRailEnginePurchaseInfo(int left, int right, int y, EngineID engine_number, const RailVehicleInfo *rvi, TestedEngineDetails &te) { const Engine *e = Engine::Get(engine_number); /* Purchase Cost - Engine weight */ - SetDParam(0, e->GetCost()); - SetDParam(1, e->GetDisplayWeight()); - DrawString(left, right, y, STR_PURCHASE_INFO_COST_WEIGHT); + if (te.cost != 0) { + SetDParam(0, e->GetCost() + te.cost); + SetDParam(1, te.cost); + SetDParam(2, e->GetDisplayWeight()); + DrawString(left, right, y, STR_PURCHASE_INFO_COST_REFIT_WEIGHT); + } else { + SetDParam(0, e->GetCost()); + SetDParam(1, e->GetDisplayWeight()); + DrawString(left, right, y, STR_PURCHASE_INFO_COST_WEIGHT); + } y += FONT_HEIGHT_NORMAL; /* Max speed - Engine power */ @@ -632,20 +645,26 @@ static int DrawRailEnginePurchaseInfo(int left, int right, int y, EngineID engin } /* Draw road vehicle specific details */ -static int DrawRoadVehPurchaseInfo(int left, int right, int y, EngineID engine_number) +static int DrawRoadVehPurchaseInfo(int left, int right, int y, EngineID engine_number, TestedEngineDetails &te) { const Engine *e = Engine::Get(engine_number); if (_settings_game.vehicle.roadveh_acceleration_model != AM_ORIGINAL) { /* Purchase Cost */ - SetDParam(0, e->GetCost()); - DrawString(left, right, y, STR_PURCHASE_INFO_COST); + if (te.cost != 0) { + SetDParam(0, e->GetCost() + te.cost); + SetDParam(1, te.cost); + DrawString(left, right, y, STR_PURCHASE_INFO_COST_REFIT); + } else { + SetDParam(0, e->GetCost()); + DrawString(left, right, y, STR_PURCHASE_INFO_COST); + } y += FONT_HEIGHT_NORMAL; /* Road vehicle weight - (including cargo) */ int16 weight = e->GetDisplayWeight(); SetDParam(0, weight); - uint cargo_weight = (e->CanCarryCargo() ? CargoSpec::Get(e->GetDefaultCargoType())->weight * GetTotalCapacityOfArticulatedParts(engine_number) / 16 : 0); + uint cargo_weight = (e->CanCarryCargo() ? CargoSpec::Get(te.cargo)->weight * te.capacity / 16 : 0); SetDParam(1, cargo_weight + weight); DrawString(left, right, y, STR_PURCHASE_INFO_WEIGHT_CWEIGHT); y += FONT_HEIGHT_NORMAL; @@ -662,9 +681,16 @@ static int DrawRoadVehPurchaseInfo(int left, int right, int y, EngineID engine_n y += FONT_HEIGHT_NORMAL; } else { /* Purchase cost - Max speed */ - SetDParam(0, e->GetCost()); - SetDParam(1, e->GetDisplayMaxSpeed()); - DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED); + if (te.cost != 0) { + SetDParam(0, e->GetCost() + te.cost); + SetDParam(1, te.cost); + SetDParam(2, e->GetDisplayMaxSpeed()); + DrawString(left, right, y, STR_PURCHASE_INFO_COST_REFIT_SPEED); + } else { + SetDParam(0, e->GetCost()); + SetDParam(2, e->GetDisplayMaxSpeed()); + DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED); + } y += FONT_HEIGHT_NORMAL; } @@ -677,7 +703,7 @@ static int DrawRoadVehPurchaseInfo(int left, int right, int y, EngineID engine_n } /* Draw ship specific details */ -static int DrawShipPurchaseInfo(int left, int right, int y, EngineID engine_number, bool refittable) +static int DrawShipPurchaseInfo(int left, int right, int y, EngineID engine_number, bool refittable, TestedEngineDetails &te) { const Engine *e = Engine::Get(engine_number); @@ -686,13 +712,27 @@ static int DrawShipPurchaseInfo(int left, int right, int y, EngineID engine_numb uint ocean_speed = e->u.ship.ApplyWaterClassSpeedFrac(raw_speed, true); uint canal_speed = e->u.ship.ApplyWaterClassSpeedFrac(raw_speed, false); - SetDParam(0, e->GetCost()); if (ocean_speed == canal_speed) { - SetDParam(1, ocean_speed); - DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED); + if (te.cost != 0) { + SetDParam(0, e->GetCost() + te.cost); + SetDParam(1, te.cost); + SetDParam(2, ocean_speed); + DrawString(left, right, y, STR_PURCHASE_INFO_COST_REFIT_SPEED); + } else { + SetDParam(0, e->GetCost()); + SetDParam(1, ocean_speed); + DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED); + } y += FONT_HEIGHT_NORMAL; } else { - DrawString(left, right, y, STR_PURCHASE_INFO_COST); + if (te.cost != 0) { + SetDParam(0, e->GetCost() + te.cost); + SetDParam(1, te.cost); + DrawString(left, right, y, STR_PURCHASE_INFO_COST_REFIT); + } else { + SetDParam(0, e->GetCost()); + DrawString(left, right, y, STR_PURCHASE_INFO_COST); + } y += FONT_HEIGHT_NORMAL; SetDParam(0, ocean_speed); @@ -705,8 +745,8 @@ static int DrawShipPurchaseInfo(int left, int right, int y, EngineID engine_numb } /* Cargo type + capacity */ - SetDParam(0, e->GetDefaultCargoType()); - SetDParam(1, e->GetDisplayDefaultCapacity()); + SetDParam(0, te.cargo); + SetDParam(1, te.capacity); SetDParam(2, refittable ? STR_PURCHASE_INFO_REFITTABLE : STR_EMPTY); DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY); y += FONT_HEIGHT_NORMAL; @@ -728,31 +768,35 @@ static int DrawShipPurchaseInfo(int left, int right, int y, EngineID engine_numb * @param refittable If set, the aircraft can be refitted. * @return Bottom of the used area. */ -static int DrawAircraftPurchaseInfo(int left, int right, int y, EngineID engine_number, bool refittable) +static int DrawAircraftPurchaseInfo(int left, int right, int y, EngineID engine_number, bool refittable, TestedEngineDetails &te) { const Engine *e = Engine::Get(engine_number); - CargoID cargo = e->GetDefaultCargoType(); /* Purchase cost - Max speed */ - SetDParam(0, e->GetCost()); - SetDParam(1, e->GetDisplayMaxSpeed()); - DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED); + if (te.cost != 0) { + SetDParam(0, e->GetCost() + te.cost); + SetDParam(1, te.cost); + SetDParam(2, e->GetDisplayMaxSpeed()); + DrawString(left, right, y, STR_PURCHASE_INFO_COST_REFIT_SPEED); + } else { + SetDParam(0, e->GetCost()); + SetDParam(1, e->GetDisplayMaxSpeed()); + DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED); + } y += FONT_HEIGHT_NORMAL; /* Cargo capacity */ - uint16 mail_capacity; - uint capacity = e->GetDisplayDefaultCapacity(&mail_capacity); - if (mail_capacity > 0) { - SetDParam(0, cargo); - SetDParam(1, capacity); + if (te.mail_capacity > 0) { + SetDParam(0, te.cargo); + SetDParam(1, te.capacity); SetDParam(2, CT_MAIL); - SetDParam(3, mail_capacity); + SetDParam(3, te.mail_capacity); DrawString(left, right, y, STR_PURCHASE_INFO_AIRCRAFT_CAPACITY); } else { /* Note, if the default capacity is selected by the refit capacity * callback, then the capacity shown is likely to be incorrect. */ - SetDParam(0, cargo); - SetDParam(1, capacity); + SetDParam(0, te.cargo); + SetDParam(1, te.capacity); SetDParam(2, refittable ? STR_PURCHASE_INFO_REFITTABLE : STR_EMPTY); DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY); } @@ -809,7 +853,7 @@ static uint ShowAdditionalText(int left, int right, int y, EngineID engine) * @param engine_number the engine of which to draw the info of * @return y after drawing all the text */ -int DrawVehiclePurchaseInfo(int left, int right, int y, EngineID engine_number) +int DrawVehiclePurchaseInfo(int left, int right, int y, EngineID engine_number, TestedEngineDetails &te) { const Engine *e = Engine::Get(engine_number); YearMonthDay ymd; @@ -821,30 +865,30 @@ int DrawVehiclePurchaseInfo(int left, int right, int y, EngineID engine_number) default: NOT_REACHED(); case VEH_TRAIN: if (e->u.rail.railveh_type == RAILVEH_WAGON) { - y = DrawRailWagonPurchaseInfo(left, right, y, engine_number, &e->u.rail); + y = DrawRailWagonPurchaseInfo(left, right, y, engine_number, &e->u.rail, te); } else { - y = DrawRailEnginePurchaseInfo(left, right, y, engine_number, &e->u.rail); + y = DrawRailEnginePurchaseInfo(left, right, y, engine_number, &e->u.rail, te); } articulated_cargo = true; break; case VEH_ROAD: - y = DrawRoadVehPurchaseInfo(left, right, y, engine_number); + y = DrawRoadVehPurchaseInfo(left, right, y, engine_number, te); articulated_cargo = true; break; case VEH_SHIP: - y = DrawShipPurchaseInfo(left, right, y, engine_number, refittable); + y = DrawShipPurchaseInfo(left, right, y, engine_number, refittable, te); break; case VEH_AIRCRAFT: - y = DrawAircraftPurchaseInfo(left, right, y, engine_number, refittable); + y = DrawAircraftPurchaseInfo(left, right, y, engine_number, refittable, te); break; } if (articulated_cargo) { /* Cargo type + capacity, or N/A */ - int new_y = DrawCargoCapacityInfo(left, right, y, engine_number); + int new_y = DrawCargoCapacityInfo(left, right, y, engine_number, te); if (new_y == y) { SetDParam(0, CT_INVALID); @@ -988,6 +1032,7 @@ struct BuildVehicleWindow : Window { byte cargo_filter_criteria; ///< Selected cargo filter int details_height; ///< Minimal needed height of the details panels (found so far). Scrollbar *vscroll; + TestedEngineDetails te; ///< Tested cost and capacity after refit. void SetBuyVehicleText() { @@ -1065,8 +1110,11 @@ struct BuildVehicleWindow : Window { this->eng_list.ForceRebuild(); this->GenerateBuildList(); // generate the list, since we need it in the next line /* Select the first engine in the list as default when opening the window */ - if (this->eng_list.Length() > 0) this->sel_engine = this->eng_list[0]; - this->SetBuyVehicleText(); + if (this->eng_list.Length() > 0) { + this->SelectEngine(this->eng_list[0]); + } else { + this->SelectEngine(INVALID_ENGINE); + } } /** Populate the filter list and set the cargo filter criteria. */ @@ -1113,6 +1161,41 @@ struct BuildVehicleWindow : Window { this->eng_list.SetFilterState(this->cargo_filter[this->cargo_filter_criteria] != CF_ANY); } + void SelectEngine(EngineID engine) + { + bool refit = this->cargo_filter[this->cargo_filter_criteria] != CF_ANY && this->cargo_filter[this->cargo_filter_criteria] != CF_NONE; + CargoID cargo = refit ? this->cargo_filter[this->cargo_filter_criteria] : CT_INVALID; + + this->sel_engine = engine; + this->SetBuyVehicleText(); + + if (this->sel_engine == INVALID_ENGINE) return; + + const Engine *e = Engine::Get(this->sel_engine); + if (!e->CanCarryCargo()) { + this->te.cost = 0; + this->te.cargo = CT_INVALID; + return; + } + + if (!this->listview_mode) { + /* Query for cost and refitted capacity */ + CommandCost ret = DoCommand(this->window_number, this->sel_engine | (cargo << 24), 0, DC_QUERY_COST, GetCmdBuildVeh(this->vehicle_type), NULL); + if (ret.Succeeded()) { + this->te.cost = ret.GetCost() - e->GetCost(); + this->te.capacity = _returned_refit_capacity; + this->te.mail_capacity = _returned_mail_refit_capacity; + this->te.cargo = (cargo == CT_INVALID) ? e->GetDefaultCargoType() : cargo; + return; + } + } + + /* Purchase test was not possible or failed, fill in the defaults instead. */ + this->te.cost = 0; + this->te.capacity = e->GetDisplayDefaultCapacity(&this->te.mail_capacity); + this->te.cargo = e->GetDefaultCargoType(); + } + void OnInit() override { this->SetCargoFilterArray(); @@ -1123,11 +1206,9 @@ struct BuildVehicleWindow : Window { { this->eng_list.Filter(this->cargo_filter[this->cargo_filter_criteria]); if (0 == this->eng_list.Length()) { // no engine passed through the filter, invalidate the previously selected engine - this->sel_engine = INVALID_ENGINE; - this->SetBuyVehicleText(); + this->SelectEngine(INVALID_ENGINE); } else if (!this->eng_list.Contains(this->sel_engine)) { // previously selected engine didn't pass the filter, select the first engine of the list - this->sel_engine = this->eng_list[0]; - this->SetBuyVehicleText(); + this->SelectEngine(this->eng_list[0]); } } @@ -1176,7 +1257,7 @@ struct BuildVehicleWindow : Window { if (eid == this->sel_engine) sel_id = eid; } - this->sel_engine = sel_id; + this->SelectEngine(sel_id); /* make engines first, and then wagons, sorted by selected sort_criteria */ _engine_sort_direction = false; @@ -1207,7 +1288,7 @@ struct BuildVehicleWindow : Window { if (eid == this->sel_engine) sel_id = eid; } - this->sel_engine = sel_id; + this->SelectEngine(sel_id); } /* Figure out what ship EngineIDs to put in the list */ @@ -1225,7 +1306,7 @@ struct BuildVehicleWindow : Window { if (eid == this->sel_engine) sel_id = eid; } - this->sel_engine = sel_id; + this->SelectEngine(sel_id); } /* Figure out what aircraft EngineIDs to put in the list */ @@ -1253,7 +1334,7 @@ struct BuildVehicleWindow : Window { if (eid == this->sel_engine) sel_id = eid; } - this->sel_engine = sel_id; + this->SelectEngine(sel_id); } /* Generate the list of vehicles */ @@ -1308,8 +1389,7 @@ struct BuildVehicleWindow : Window { case WID_BV_LIST: { uint i = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_BV_LIST); size_t num_items = this->eng_list.Length(); - this->sel_engine = (i < num_items) ? this->eng_list[i] : INVALID_ENGINE; - this->SetBuyVehicleText(); + this->SelectEngine((i < num_items) ? this->eng_list[i] : INVALID_ENGINE); this->SetDirty(); if (_ctrl_pressed) { this->OnClick(pt, WID_BV_SHOW_HIDE, 1); @@ -1473,7 +1553,7 @@ struct BuildVehicleWindow : Window { if (this->sel_engine != INVALID_ENGINE) { NWidgetBase *nwi = this->GetWidget(WID_BV_PANEL); int text_end = DrawVehiclePurchaseInfo(nwi->pos_x + WD_FRAMETEXT_LEFT, nwi->pos_x + nwi->current_x - WD_FRAMETEXT_RIGHT, - nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine); + nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine, this->te); needed_height = max(needed_height, text_end - (int)nwi->pos_y + WD_FRAMERECT_BOTTOM); } if (needed_height != this->details_height) { // Details window are not high enough, enlarge them. @@ -1510,7 +1590,7 @@ struct BuildVehicleWindow : Window { /* deactivate filter if criteria is 'Show All', activate it otherwise */ this->eng_list.SetFilterState(this->cargo_filter[this->cargo_filter_criteria] != CF_ANY); this->eng_list.ForceRebuild(); - this->SetBuyVehicleText(); + this->SelectEngine(this->sel_engine); } break; } diff --git a/src/engine_func.h b/src/engine_func.h index 37fb005092..79dad18c72 100644 --- a/src/engine_func.h +++ b/src/engine_func.h @@ -26,7 +26,7 @@ extern const uint8 _engine_offsets[4]; bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company); bool IsEngineRefittable(EngineID engine); -void GetArticulatedVehicleCargoesAndRefits(EngineID engine, CargoArray *cargoes, CargoTypes *refits); +void GetArticulatedVehicleCargoesAndRefits(EngineID engine, CargoArray *cargoes, CargoTypes *refits, CargoID cargo_type, uint16 cargo_capacity); void SetYearEngineAgingStops(); void StartupOneEngine(Engine *e, Date aging_date); diff --git a/src/lang/english.txt b/src/lang/english.txt index 86e045d067..2e01e3a2d5 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3469,6 +3469,7 @@ STR_BUY_VEHICLE_SHIP_CAPTION :New Ships STR_BUY_VEHICLE_AIRCRAFT_CAPTION :New Aircraft STR_PURCHASE_INFO_COST_WEIGHT :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} Weight: {GOLD}{WEIGHT_SHORT} +STR_PURCHASE_INFO_COST_REFIT_WEIGHT :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} (Refit Cost: {GOLD}{CURRENCY_LONG}{BLACK}) Weight: {GOLD}{WEIGHT_SHORT} STR_PURCHASE_INFO_SPEED_POWER :{BLACK}Speed: {GOLD}{VELOCITY}{BLACK} Power: {GOLD}{POWER} STR_PURCHASE_INFO_SPEED :{BLACK}Speed: {GOLD}{VELOCITY} STR_PURCHASE_INFO_SPEED_OCEAN :{BLACK}Speed on ocean: {GOLD}{VELOCITY} @@ -3479,8 +3480,10 @@ STR_PURCHASE_INFO_REFITTABLE :(refittable) STR_PURCHASE_INFO_DESIGNED_LIFE :{BLACK}Designed: {GOLD}{NUM}{BLACK} Life: {GOLD}{COMMA} year{P "" s} STR_PURCHASE_INFO_RELIABILITY :{BLACK}Max. Reliability: {GOLD}{COMMA}% STR_PURCHASE_INFO_COST :{BLACK}Cost: {GOLD}{CURRENCY_LONG} +STR_PURCHASE_INFO_COST_REFIT :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} (Refit Cost: {GOLD}{CURRENCY_LONG}{BLACK}) STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Weight: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} Speed: {GOLD}{VELOCITY} +STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} (Refit Cost: {GOLD}{CURRENCY_LONG}{BLACK}) Speed: {GOLD}{VELOCITY} STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Capacity: {GOLD}{CARGO_LONG}, {CARGO_LONG} STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Powered Wagons: {GOLD}+{POWER}{BLACK} Weight: {GOLD}+{WEIGHT_SHORT} STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Refittable to: {GOLD}{STRING2} diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 345874e586..7dd7a790aa 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -148,6 +148,9 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint if (refitting) { value.AddCost(CmdRefitVehicle(tile, flags, v->index, cargo, NULL)); + } else { + /* Fill in non-refitted capacities */ + _returned_refit_capacity = e->GetDisplayDefaultCapacity(&_returned_mail_refit_capacity); } if (flags & DC_EXEC) { diff --git a/src/vehicle_gui.h b/src/vehicle_gui.h index 92975425df..9eb688eee9 100644 --- a/src/vehicle_gui.h +++ b/src/vehicle_gui.h @@ -37,7 +37,15 @@ enum VehicleInvalidateWindowData { VIWD_AUTOREPLACE = -4, ///< Autoreplace replaced the vehicle. }; -int DrawVehiclePurchaseInfo(int left, int right, int y, EngineID engine_number); +/** Extra information about refitted cargo and capacity */ +struct TestedEngineDetails { + Money cost; ///< Refit cost + CargoID cargo; ///< Cargo type + uint16 capacity; ///< Cargo capacity + uint16 mail_capacity; ///< Mail capacity if available +}; + +int DrawVehiclePurchaseInfo(int left, int right, int y, EngineID engine_number, TestedEngineDetails &te); void DrawTrainImage(const Train *v, int left, int right, int y, VehicleID selection, EngineImageType image_type, int skip, VehicleID drag_dest = INVALID_VEHICLE); void DrawRoadVehImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type, int skip = 0); From b1fb3f4fb8c389d36ba670558a169578f7d142e2 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 24 Mar 2019 16:23:46 +0000 Subject: [PATCH 36/82] Codechange: More use of override keyword. --- src/newgrf_commons.h | 6 ++++-- src/textfile_gui.h | 24 ++++++++++++++---------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/newgrf_commons.h b/src/newgrf_commons.h index 5721b7eb20..a5cedf429b 100644 --- a/src/newgrf_commons.h +++ b/src/newgrf_commons.h @@ -228,6 +228,7 @@ class HouseOverrideManager : public OverrideManagerBase { public: HouseOverrideManager(uint16 offset, uint16 maximum, uint16 invalid) : OverrideManagerBase(offset, maximum, invalid) {} + void SetEntitySpec(const HouseSpec *hs); }; @@ -238,8 +239,9 @@ public: IndustryOverrideManager(uint16 offset, uint16 maximum, uint16 invalid) : OverrideManagerBase(offset, maximum, invalid) {} - virtual uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id); - virtual uint16 GetID(uint8 grf_local_id, uint32 grfid) const; + uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id) override; + uint16 GetID(uint8 grf_local_id, uint32 grfid) const override; + void SetEntitySpec(IndustrySpec *inds); }; diff --git a/src/textfile_gui.h b/src/textfile_gui.h index 9495fa3f08..b7bcb2db75 100644 --- a/src/textfile_gui.h +++ b/src/textfile_gui.h @@ -32,17 +32,21 @@ struct TextfileWindow : public Window, MissingGlyphSearcher { static const int BOTTOM_SPACING = WD_FRAMETEXT_BOTTOM; ///< Additional spacing at the bottom of the #WID_TF_BACKGROUND widget. TextfileWindow(TextfileType file_type); - virtual ~TextfileWindow(); - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize); - virtual void OnClick(Point pt, int widget, int click_count); - virtual void DrawWidget(const Rect &r, int widget) const; - virtual void OnResize(); - virtual void Reset(); - virtual FontSize DefaultSize(); - virtual const char *NextString(); - virtual bool Monospace(); - virtual void SetFontNames(FreeTypeSettings *settings, const char *font_name); + ~TextfileWindow(); + + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override; + void OnClick(Point pt, int widget, int click_count) override; + void DrawWidget(const Rect &r, int widget) const override; + void OnResize() override; + + void Reset() override; + FontSize DefaultSize() override; + const char *NextString() override; + bool Monospace() override; + void SetFontNames(FreeTypeSettings *settings, const char *font_name) override; + virtual void LoadTextfile(const char *textfile, Subdirectory dir); + private: uint GetContentHeight(); void SetupScrollbars(); From 07de9d6c3f48b6a3b92e11d553aca145546c62ef Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 24 Mar 2019 16:24:06 +0000 Subject: [PATCH 37/82] Codechange: Use override keyword in networking classes. --- src/network/core/tcp.h | 2 +- src/network/core/tcp_admin.h | 2 +- src/network/core/tcp_content.h | 2 +- src/network/core/tcp_game.h | 2 +- src/network/core/tcp_http.h | 6 ++-- src/network/core/udp.h | 4 +-- src/network/network.cpp | 8 ++--- src/network/network_admin.h | 16 ++++----- src/network/network_client.h | 56 ++++++++++++++--------------- src/network/network_content.cpp | 4 +-- src/network/network_content.h | 20 +++++------ src/network/network_content_gui.cpp | 4 +-- src/network/network_server.h | 36 +++++++++---------- src/network/network_udp.cpp | 18 +++++----- 14 files changed, 90 insertions(+), 90 deletions(-) diff --git a/src/network/core/tcp.h b/src/network/core/tcp.h index 00642c2dd3..243ec042d2 100644 --- a/src/network/core/tcp.h +++ b/src/network/core/tcp.h @@ -40,7 +40,7 @@ public: */ bool IsConnected() const { return this->sock != INVALID_SOCKET; } - virtual NetworkRecvStatus CloseConnection(bool error = true); + NetworkRecvStatus CloseConnection(bool error = true) override; virtual void SendPacket(Packet *packet); SendPacketsState SendPackets(bool closing_down = false); diff --git a/src/network/core/tcp_admin.h b/src/network/core/tcp_admin.h index 497c24b48a..7bcc878403 100644 --- a/src/network/core/tcp_admin.h +++ b/src/network/core/tcp_admin.h @@ -481,7 +481,7 @@ protected: NetworkRecvStatus HandlePacket(Packet *p); public: - NetworkRecvStatus CloseConnection(bool error = true); + NetworkRecvStatus CloseConnection(bool error = true) override; NetworkAdminSocketHandler(SOCKET s); ~NetworkAdminSocketHandler(); diff --git a/src/network/core/tcp_content.h b/src/network/core/tcp_content.h index c359fb6679..689de7a018 100644 --- a/src/network/core/tcp_content.h +++ b/src/network/core/tcp_content.h @@ -98,7 +98,7 @@ struct ContentInfo { class NetworkContentSocketHandler : public NetworkTCPSocketHandler { protected: NetworkAddress client_addr; ///< The address we're connected to. - virtual void Close(); + void Close() override; bool ReceiveInvalidPacket(PacketContentType type); diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h index c41ad4dc16..b392cf7179 100644 --- a/src/network/core/tcp_game.h +++ b/src/network/core/tcp_game.h @@ -522,7 +522,7 @@ public: CommandQueue incoming_queue; ///< The command-queue awaiting handling uint last_packet; ///< Time we received the last frame. - NetworkRecvStatus CloseConnection(bool error = true); + NetworkRecvStatus CloseConnection(bool error = true) override; /** * Close the network connection due to the given status. diff --git a/src/network/core/tcp_http.h b/src/network/core/tcp_http.h index ec969264b1..5a5cdd9f2f 100644 --- a/src/network/core/tcp_http.h +++ b/src/network/core/tcp_http.h @@ -60,7 +60,7 @@ public: return this->sock != INVALID_SOCKET; } - virtual NetworkRecvStatus CloseConnection(bool error = true); + NetworkRecvStatus CloseConnection(bool error = true) override; NetworkHTTPSocketHandler(SOCKET sock, HTTPCallback *callback, const char *host, const char *url, const char *data, int depth); @@ -106,13 +106,13 @@ public: free(this->url); } - virtual void OnFailure() + void OnFailure() override { this->callback->OnFailure(); free(this->data); } - virtual void OnConnect(SOCKET s) + void OnConnect(SOCKET s) override { new NetworkHTTPSocketHandler(s, this->callback, this->address.GetHostname(), this->url, this->data, this->depth); /* We've relinquished control of data now. */ diff --git a/src/network/core/udp.h b/src/network/core/udp.h index 2f77a94df2..fab2324927 100644 --- a/src/network/core/udp.h +++ b/src/network/core/udp.h @@ -52,7 +52,7 @@ protected: /** The opened sockets. */ SocketList sockets; - NetworkRecvStatus CloseConnection(bool error = true); + NetworkRecvStatus CloseConnection(bool error = true) override; void ReceiveInvalidPacket(PacketUDPType, NetworkAddress *client_addr); @@ -235,7 +235,7 @@ public: virtual ~NetworkUDPSocketHandler() { this->Close(); } bool Listen(); - void Close(); + void Close() override; void SendPacket(Packet *p, NetworkAddress *recv, bool all = false, bool broadcast = false); void ReceivePackets(); diff --git a/src/network/network.cpp b/src/network/network.cpp index ea770e5001..e437f4df0a 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -576,12 +576,12 @@ class TCPQueryConnecter : TCPConnecter { public: TCPQueryConnecter(const NetworkAddress &address) : TCPConnecter(address) {} - virtual void OnFailure() + void OnFailure() override { NetworkDisconnect(); } - virtual void OnConnect(SOCKET s) + void OnConnect(SOCKET s) override { _networking = true; new ClientNetworkGameSocketHandler(s); @@ -659,12 +659,12 @@ class TCPClientConnecter : TCPConnecter { public: TCPClientConnecter(const NetworkAddress &address) : TCPConnecter(address) {} - virtual void OnFailure() + void OnFailure() override { NetworkError(STR_NETWORK_ERROR_NOCONNECTION); } - virtual void OnConnect(SOCKET s) + void OnConnect(SOCKET s) override { _networking = true; new ClientNetworkGameSocketHandler(s); diff --git a/src/network/network_admin.h b/src/network/network_admin.h index 6d06d5b9ff..6ea373e8eb 100644 --- a/src/network/network_admin.h +++ b/src/network/network_admin.h @@ -26,14 +26,14 @@ extern NetworkAdminSocketPool _networkadminsocket_pool; /** Class for handling the server side of the game connection. */ class ServerNetworkAdminSocketHandler : public NetworkAdminSocketPool::PoolItem<&_networkadminsocket_pool>, public NetworkAdminSocketHandler, public TCPListenHandler { protected: - virtual NetworkRecvStatus Receive_ADMIN_JOIN(Packet *p); - virtual NetworkRecvStatus Receive_ADMIN_QUIT(Packet *p); - virtual NetworkRecvStatus Receive_ADMIN_UPDATE_FREQUENCY(Packet *p); - virtual NetworkRecvStatus Receive_ADMIN_POLL(Packet *p); - virtual NetworkRecvStatus Receive_ADMIN_CHAT(Packet *p); - virtual NetworkRecvStatus Receive_ADMIN_RCON(Packet *p); - virtual NetworkRecvStatus Receive_ADMIN_GAMESCRIPT(Packet *p); - virtual NetworkRecvStatus Receive_ADMIN_PING(Packet *p); + NetworkRecvStatus Receive_ADMIN_JOIN(Packet *p) override; + NetworkRecvStatus Receive_ADMIN_QUIT(Packet *p) override; + NetworkRecvStatus Receive_ADMIN_UPDATE_FREQUENCY(Packet *p) override; + NetworkRecvStatus Receive_ADMIN_POLL(Packet *p) override; + NetworkRecvStatus Receive_ADMIN_CHAT(Packet *p) override; + NetworkRecvStatus Receive_ADMIN_RCON(Packet *p) override; + NetworkRecvStatus Receive_ADMIN_GAMESCRIPT(Packet *p) override; + NetworkRecvStatus Receive_ADMIN_PING(Packet *p) override; NetworkRecvStatus SendProtocol(); NetworkRecvStatus SendPong(uint32 d1); diff --git a/src/network/network_client.h b/src/network/network_client.h index 5e9988d9aa..d0a9d07b18 100644 --- a/src/network/network_client.h +++ b/src/network/network_client.h @@ -42,33 +42,33 @@ protected: friend void NetworkClose(bool close_admins); static ClientNetworkGameSocketHandler *my_client; ///< This is us! - virtual NetworkRecvStatus Receive_SERVER_FULL(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_BANNED(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_ERROR(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_COMPANY_INFO(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_CLIENT_INFO(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_NEED_GAME_PASSWORD(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_NEED_COMPANY_PASSWORD(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_WELCOME(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_WAIT(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_MAP_BEGIN(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_MAP_SIZE(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_MAP_DATA(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_MAP_DONE(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_JOIN(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_FRAME(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_SYNC(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_COMMAND(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_CHAT(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_QUIT(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_ERROR_QUIT(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_SHUTDOWN(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_NEWGAME(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_RCON(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_CHECK_NEWGRFS(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_MOVE(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_COMPANY_UPDATE(Packet *p); - virtual NetworkRecvStatus Receive_SERVER_CONFIG_UPDATE(Packet *p); + NetworkRecvStatus Receive_SERVER_FULL(Packet *p) override; + NetworkRecvStatus Receive_SERVER_BANNED(Packet *p) override; + NetworkRecvStatus Receive_SERVER_ERROR(Packet *p) override; + NetworkRecvStatus Receive_SERVER_COMPANY_INFO(Packet *p) override; + NetworkRecvStatus Receive_SERVER_CLIENT_INFO(Packet *p) override; + NetworkRecvStatus Receive_SERVER_NEED_GAME_PASSWORD(Packet *p) override; + NetworkRecvStatus Receive_SERVER_NEED_COMPANY_PASSWORD(Packet *p) override; + NetworkRecvStatus Receive_SERVER_WELCOME(Packet *p) override; + NetworkRecvStatus Receive_SERVER_WAIT(Packet *p) override; + NetworkRecvStatus Receive_SERVER_MAP_BEGIN(Packet *p) override; + NetworkRecvStatus Receive_SERVER_MAP_SIZE(Packet *p) override; + NetworkRecvStatus Receive_SERVER_MAP_DATA(Packet *p) override; + NetworkRecvStatus Receive_SERVER_MAP_DONE(Packet *p) override; + NetworkRecvStatus Receive_SERVER_JOIN(Packet *p) override; + NetworkRecvStatus Receive_SERVER_FRAME(Packet *p) override; + NetworkRecvStatus Receive_SERVER_SYNC(Packet *p) override; + NetworkRecvStatus Receive_SERVER_COMMAND(Packet *p) override; + NetworkRecvStatus Receive_SERVER_CHAT(Packet *p) override; + NetworkRecvStatus Receive_SERVER_QUIT(Packet *p) override; + NetworkRecvStatus Receive_SERVER_ERROR_QUIT(Packet *p) override; + NetworkRecvStatus Receive_SERVER_SHUTDOWN(Packet *p) override; + NetworkRecvStatus Receive_SERVER_NEWGAME(Packet *p) override; + NetworkRecvStatus Receive_SERVER_RCON(Packet *p) override; + NetworkRecvStatus Receive_SERVER_CHECK_NEWGRFS(Packet *p) override; + NetworkRecvStatus Receive_SERVER_MOVE(Packet *p) override; + NetworkRecvStatus Receive_SERVER_COMPANY_UPDATE(Packet *p) override; + NetworkRecvStatus Receive_SERVER_CONFIG_UPDATE(Packet *p) override; static NetworkRecvStatus SendNewGRFsOk(); static NetworkRecvStatus SendGetMap(); @@ -78,7 +78,7 @@ public: ClientNetworkGameSocketHandler(SOCKET s); ~ClientNetworkGameSocketHandler(); - NetworkRecvStatus CloseConnection(NetworkRecvStatus status); + NetworkRecvStatus CloseConnection(NetworkRecvStatus status) override; void ClientError(NetworkRecvStatus res); static NetworkRecvStatus SendCompanyInformationQuery(); diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index 1a80c5d99d..786f1c04a6 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -724,13 +724,13 @@ public: */ NetworkContentConnecter(const NetworkAddress &address) : TCPConnecter(address) {} - virtual void OnFailure() + void OnFailure() override { _network_content_client.isConnecting = false; _network_content_client.OnConnect(false); } - virtual void OnConnect(SOCKET s) + void OnConnect(SOCKET s) override { assert(_network_content_client.sock == INVALID_SOCKET); _network_content_client.isConnecting = false; diff --git a/src/network/network_content.h b/src/network/network_content.h index b1e9dd66b6..7a96a73c06 100644 --- a/src/network/network_content.h +++ b/src/network/network_content.h @@ -80,20 +80,20 @@ protected: friend class NetworkContentConnecter; - virtual bool Receive_SERVER_INFO(Packet *p); - virtual bool Receive_SERVER_CONTENT(Packet *p); + bool Receive_SERVER_INFO(Packet *p) override; + bool Receive_SERVER_CONTENT(Packet *p) override; ContentInfo *GetContent(ContentID cid); void DownloadContentInfo(ContentID cid); - void OnConnect(bool success); - void OnDisconnect(); - void OnReceiveContentInfo(const ContentInfo *ci); - void OnDownloadProgress(const ContentInfo *ci, int bytes); - void OnDownloadComplete(ContentID cid); + void OnConnect(bool success) override; + void OnDisconnect() override; + void OnReceiveContentInfo(const ContentInfo *ci) override; + void OnDownloadProgress(const ContentInfo *ci, int bytes) override; + void OnDownloadComplete(ContentID cid) override; - void OnFailure(); - void OnReceiveData(const char *data, size_t length); + void OnFailure() override; + void OnReceiveData(const char *data, size_t length) override; bool BeforeDownload(); void AfterDownload(); @@ -109,7 +109,7 @@ public: void Connect(); void SendReceive(); - void Close(); + void Close() override; void RequestContentList(ContentType type); void RequestContentList(uint count, const ContentID *content_ids); diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 49ecf2b242..406c6aa052 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -115,7 +115,7 @@ BaseNetworkContentDownloadStatusWindow::~BaseNetworkContentDownloadStatusWindow( _network_content_client.RemoveCallback(this); } -/* virtual */ void BaseNetworkContentDownloadStatusWindow::DrawWidget(const Rect &r, int widget) const +void BaseNetworkContentDownloadStatusWindow::DrawWidget(const Rect &r, int widget) const { if (widget != WID_NCDS_BACKGROUND) return; @@ -144,7 +144,7 @@ BaseNetworkContentDownloadStatusWindow::~BaseNetworkContentDownloadStatusWindow( DrawStringMultiLine(r.left + 2, r.right - 2, y, y + FONT_HEIGHT_NORMAL * 2, str, TC_FROMSTRING, SA_CENTER); } -/* virtual */ void BaseNetworkContentDownloadStatusWindow::OnDownloadProgress(const ContentInfo *ci, int bytes) +void BaseNetworkContentDownloadStatusWindow::OnDownloadProgress(const ContentInfo *ci, int bytes) { if (ci->id != this->cur_id) { strecpy(this->name, ci->filename, lastof(this->name)); diff --git a/src/network/network_server.h b/src/network/network_server.h index 1cd8feb677..f35192a116 100644 --- a/src/network/network_server.h +++ b/src/network/network_server.h @@ -26,22 +26,22 @@ extern NetworkClientSocketPool _networkclientsocket_pool; /** Class for handling the server side of the game connection. */ class ServerNetworkGameSocketHandler : public NetworkClientSocketPool::PoolItem<&_networkclientsocket_pool>, public NetworkGameSocketHandler, public TCPListenHandler { protected: - virtual NetworkRecvStatus Receive_CLIENT_JOIN(Packet *p); - virtual NetworkRecvStatus Receive_CLIENT_COMPANY_INFO(Packet *p); - virtual NetworkRecvStatus Receive_CLIENT_GAME_PASSWORD(Packet *p); - virtual NetworkRecvStatus Receive_CLIENT_COMPANY_PASSWORD(Packet *p); - virtual NetworkRecvStatus Receive_CLIENT_GETMAP(Packet *p); - virtual NetworkRecvStatus Receive_CLIENT_MAP_OK(Packet *p); - virtual NetworkRecvStatus Receive_CLIENT_ACK(Packet *p); - virtual NetworkRecvStatus Receive_CLIENT_COMMAND(Packet *p); - virtual NetworkRecvStatus Receive_CLIENT_CHAT(Packet *p); - virtual NetworkRecvStatus Receive_CLIENT_SET_PASSWORD(Packet *p); - virtual NetworkRecvStatus Receive_CLIENT_SET_NAME(Packet *p); - virtual NetworkRecvStatus Receive_CLIENT_QUIT(Packet *p); - virtual NetworkRecvStatus Receive_CLIENT_ERROR(Packet *p); - virtual NetworkRecvStatus Receive_CLIENT_RCON(Packet *p); - virtual NetworkRecvStatus Receive_CLIENT_NEWGRFS_CHECKED(Packet *p); - virtual NetworkRecvStatus Receive_CLIENT_MOVE(Packet *p); + NetworkRecvStatus Receive_CLIENT_JOIN(Packet *p) override; + NetworkRecvStatus Receive_CLIENT_COMPANY_INFO(Packet *p) override; + NetworkRecvStatus Receive_CLIENT_GAME_PASSWORD(Packet *p) override; + NetworkRecvStatus Receive_CLIENT_COMPANY_PASSWORD(Packet *p) override; + NetworkRecvStatus Receive_CLIENT_GETMAP(Packet *p) override; + NetworkRecvStatus Receive_CLIENT_MAP_OK(Packet *p) override; + NetworkRecvStatus Receive_CLIENT_ACK(Packet *p) override; + NetworkRecvStatus Receive_CLIENT_COMMAND(Packet *p) override; + NetworkRecvStatus Receive_CLIENT_CHAT(Packet *p) override; + NetworkRecvStatus Receive_CLIENT_SET_PASSWORD(Packet *p) override; + NetworkRecvStatus Receive_CLIENT_SET_NAME(Packet *p) override; + NetworkRecvStatus Receive_CLIENT_QUIT(Packet *p) override; + NetworkRecvStatus Receive_CLIENT_ERROR(Packet *p) override; + NetworkRecvStatus Receive_CLIENT_RCON(Packet *p) override; + NetworkRecvStatus Receive_CLIENT_NEWGRFS_CHECKED(Packet *p) override; + NetworkRecvStatus Receive_CLIENT_MOVE(Packet *p) override; NetworkRecvStatus SendCompanyInfo(); NetworkRecvStatus SendNewGRFCheck(); @@ -79,8 +79,8 @@ public: ServerNetworkGameSocketHandler(SOCKET s); ~ServerNetworkGameSocketHandler(); - virtual Packet *ReceivePacket(); - NetworkRecvStatus CloseConnection(NetworkRecvStatus status); + virtual Packet *ReceivePacket() override; + NetworkRecvStatus CloseConnection(NetworkRecvStatus status) override; void GetClientName(char *client_name, const char *last) const; NetworkRecvStatus SendMap(); diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp index 289b07520a..cee230c888 100644 --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -117,8 +117,8 @@ void NetworkUDPQueryServer(NetworkAddress address, bool manually) /** Helper class for connecting to the master server. */ class MasterNetworkUDPSocketHandler : public NetworkUDPSocketHandler { protected: - virtual void Receive_MASTER_ACK_REGISTER(Packet *p, NetworkAddress *client_addr); - virtual void Receive_MASTER_SESSION_KEY(Packet *p, NetworkAddress *client_addr); + void Receive_MASTER_ACK_REGISTER(Packet *p, NetworkAddress *client_addr) override; + void Receive_MASTER_SESSION_KEY(Packet *p, NetworkAddress *client_addr) override; public: /** * Create the socket. @@ -148,9 +148,9 @@ void MasterNetworkUDPSocketHandler::Receive_MASTER_SESSION_KEY(Packet *p, Networ /** Helper class for handling all server side communication. */ class ServerNetworkUDPSocketHandler : public NetworkUDPSocketHandler { protected: - virtual void Receive_CLIENT_FIND_SERVER(Packet *p, NetworkAddress *client_addr); - virtual void Receive_CLIENT_DETAIL_INFO(Packet *p, NetworkAddress *client_addr); - virtual void Receive_CLIENT_GET_NEWGRFS(Packet *p, NetworkAddress *client_addr); + void Receive_CLIENT_FIND_SERVER(Packet *p, NetworkAddress *client_addr) override; + void Receive_CLIENT_DETAIL_INFO(Packet *p, NetworkAddress *client_addr) override; + void Receive_CLIENT_GET_NEWGRFS(Packet *p, NetworkAddress *client_addr) override; public: /** * Create the socket. @@ -324,10 +324,10 @@ void ServerNetworkUDPSocketHandler::Receive_CLIENT_GET_NEWGRFS(Packet *p, Networ /** Helper class for handling all client side communication. */ class ClientNetworkUDPSocketHandler : public NetworkUDPSocketHandler { protected: - virtual void Receive_SERVER_RESPONSE(Packet *p, NetworkAddress *client_addr); - virtual void Receive_MASTER_RESPONSE_LIST(Packet *p, NetworkAddress *client_addr); - virtual void Receive_SERVER_NEWGRFS(Packet *p, NetworkAddress *client_addr); - virtual void HandleIncomingNetworkGameInfoGRFConfig(GRFConfig *config); + void Receive_SERVER_RESPONSE(Packet *p, NetworkAddress *client_addr) override; + void Receive_MASTER_RESPONSE_LIST(Packet *p, NetworkAddress *client_addr) override; + void Receive_SERVER_NEWGRFS(Packet *p, NetworkAddress *client_addr) override; + void HandleIncomingNetworkGameInfoGRFConfig(GRFConfig *config) override; public: virtual ~ClientNetworkUDPSocketHandler() {} }; From 3860a2ce2acf3e295af087c4ca3bb409a61632fc Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 24 Mar 2019 16:49:26 +0000 Subject: [PATCH 38/82] Codechange: Use override keyword for smallmap window. --- src/smallmap_gui.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/smallmap_gui.h b/src/smallmap_gui.h index 486f2a6524..a167d81988 100644 --- a/src/smallmap_gui.h +++ b/src/smallmap_gui.h @@ -180,17 +180,17 @@ public: void SmallMapCenterOnCurrentPos(); Point GetStationMiddle(const Station *st) const; - virtual void SetStringParameters(int widget) const; - virtual void OnInit(); - virtual void OnPaint(); - virtual void DrawWidget(const Rect &r, int widget) const; - virtual void OnClick(Point pt, int widget, int click_count); - virtual void OnInvalidateData(int data = 0, bool gui_scope = true); - virtual bool OnRightClick(Point pt, int widget); - virtual void OnMouseWheel(int wheel); - virtual void OnRealtimeTick(uint delta_ms); - virtual void OnScroll(Point delta); - virtual void OnMouseOver(Point pt, int widget); + void SetStringParameters(int widget) const override; + void OnInit() override; + void OnPaint() override; + void DrawWidget(const Rect &r, int widget) const override; + void OnClick(Point pt, int widget, int click_count) override; + void OnInvalidateData(int data = 0, bool gui_scope = true) override; + bool OnRightClick(Point pt, int widget) override; + void OnMouseWheel(int wheel) override; + void OnRealtimeTick(uint delta_ms) override; + void OnScroll(Point delta) override; + void OnMouseOver(Point pt, int widget) override; }; #endif /* SMALLMAP_GUI_H */ From ce10d9be3f3ae1422e4e1f79fc5c867ab38526e7 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Sat, 23 Mar 2019 12:39:13 +0100 Subject: [PATCH 39/82] Fix #7374: Ensure k-d trees are always updated when station sign moves --- src/base_station_base.h | 6 ++++++ src/station.cpp | 2 +- src/station_base.h | 2 ++ src/station_cmd.cpp | 26 ++++++++++++++++++-------- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/base_station_base.h b/src/base_station_base.h index cd512c5177..8af01f8a70 100644 --- a/src/base_station_base.h +++ b/src/base_station_base.h @@ -110,6 +110,12 @@ struct BaseStation : StationPool::PoolItem<&_station_pool> { */ virtual void UpdateVirtCoord() = 0; + virtual void MoveSign(TileIndex new_xy) + { + this->xy = new_xy; + this->UpdateVirtCoord(); + } + /** * Get the tile area for a given station type. * @param ta tile area to fill. diff --git a/src/station.cpp b/src/station.cpp index 3c50ef94f4..6f10806a4b 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -207,7 +207,7 @@ RoadStop *Station::GetPrimaryRoadStop(const RoadVehicle *v) const void Station::AddFacility(StationFacility new_facility_bit, TileIndex facil_xy) { if (this->facilities == FACIL_NONE) { - this->xy = facil_xy; + this->MoveSign(facil_xy); this->random_bits = Random(); } this->facilities |= new_facility_bit; diff --git a/src/station_base.h b/src/station_base.h index 243a2f0cec..794fbdfdfc 100644 --- a/src/station_base.h +++ b/src/station_base.h @@ -492,6 +492,8 @@ public: void UpdateVirtCoord() override; + void MoveSign(TileIndex new_xy) override; + void AfterStationTileSetChange(bool adding, StationType type); uint GetPlatformLength(TileIndex tile, DiagDirection dir) const override; diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 72c70456f7..6121424d57 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -429,6 +429,23 @@ void Station::UpdateVirtCoord() SetWindowDirty(WC_STATION_VIEW, this->index); } +/** + * Move the station main coordinate somewhere else. + * @param new_xy new tile location of the sign + */ +void Station::MoveSign(TileIndex new_xy) +{ + if (this->xy == new_xy) return; + + _viewport_sign_kdtree.Remove(ViewportSignKdtreeItem::MakeStation(this->index)); + _station_kdtree.Remove(this->index); + + this->BaseStation::MoveSign(new_xy); + + _station_kdtree.Insert(this->index); + _viewport_sign_kdtree.Insert(ViewportSignKdtreeItem::MakeStation(this->index)); +} + /** Update the virtual coords needed to draw the station sign for all stations. */ void UpdateAllStationVirtCoords() { @@ -672,14 +689,7 @@ static void UpdateStationSignCoord(BaseStation *st) /* clamp sign coord to be inside the station rect */ TileIndex new_xy = TileXY(ClampU(TileX(st->xy), r->left, r->right), ClampU(TileY(st->xy), r->top, r->bottom)); - if (new_xy != st->xy) { - _viewport_sign_kdtree.Remove(ViewportSignKdtreeItem::MakeStation(st->index)); - _station_kdtree.Remove(st->index); - st->xy = new_xy; - _station_kdtree.Insert(st->index); - _viewport_sign_kdtree.Insert(ViewportSignKdtreeItem::MakeStation(st->index)); - st->UpdateVirtCoord(); - } + st->MoveSign(new_xy); if (!Station::IsExpected(st)) return; Station *full_station = Station::From(st); From 37b9fdc0c1b79d3b91ea858de98893b795cdd479 Mon Sep 17 00:00:00 2001 From: translators Date: Sun, 24 Mar 2019 19:45:44 +0100 Subject: [PATCH 40/82] Update: Translations from eints finnish: 13 changes by hpiirai korean: 1 change by telk5093 --- src/lang/afrikaans.txt | 2 ++ src/lang/arabic_egypt.txt | 2 ++ src/lang/basque.txt | 2 ++ src/lang/belarusian.txt | 2 ++ src/lang/brazilian_portuguese.txt | 2 ++ src/lang/bulgarian.txt | 2 ++ src/lang/catalan.txt | 2 ++ src/lang/croatian.txt | 2 ++ src/lang/czech.txt | 2 ++ src/lang/danish.txt | 2 ++ src/lang/dutch.txt | 2 ++ src/lang/english_AU.txt | 2 ++ src/lang/english_US.txt | 2 ++ src/lang/esperanto.txt | 2 ++ src/lang/estonian.txt | 2 ++ src/lang/faroese.txt | 2 ++ src/lang/finnish.txt | 28 +++++++++++++++------------- src/lang/french.txt | 2 ++ src/lang/gaelic.txt | 2 ++ src/lang/galician.txt | 2 ++ src/lang/german.txt | 2 ++ src/lang/greek.txt | 2 ++ src/lang/hebrew.txt | 2 ++ src/lang/hungarian.txt | 2 ++ src/lang/icelandic.txt | 2 ++ src/lang/indonesian.txt | 2 ++ src/lang/irish.txt | 2 ++ src/lang/italian.txt | 2 ++ src/lang/japanese.txt | 2 ++ src/lang/korean.txt | 4 +++- src/lang/latin.txt | 2 ++ src/lang/latvian.txt | 2 ++ src/lang/lithuanian.txt | 2 ++ src/lang/luxembourgish.txt | 2 ++ src/lang/malay.txt | 2 ++ src/lang/norwegian_bokmal.txt | 2 ++ src/lang/norwegian_nynorsk.txt | 2 ++ src/lang/polish.txt | 2 ++ src/lang/portuguese.txt | 2 ++ src/lang/romanian.txt | 2 ++ src/lang/russian.txt | 2 ++ src/lang/serbian.txt | 2 ++ src/lang/simplified_chinese.txt | 2 ++ src/lang/slovak.txt | 2 ++ src/lang/slovenian.txt | 2 ++ src/lang/spanish.txt | 2 ++ src/lang/spanish_MX.txt | 2 ++ src/lang/swedish.txt | 2 ++ src/lang/tamil.txt | 2 ++ src/lang/thai.txt | 2 ++ src/lang/traditional_chinese.txt | 2 ++ src/lang/turkish.txt | 2 ++ src/lang/ukrainian.txt | 2 ++ src/lang/unfinished/chuvash.txt | 2 ++ src/lang/unfinished/frisian.txt | 2 ++ src/lang/unfinished/ido.txt | 2 ++ src/lang/unfinished/macedonian.txt | 2 ++ src/lang/unfinished/maltese.txt | 2 ++ src/lang/unfinished/marathi.txt | 2 ++ src/lang/unfinished/persian.txt | 2 ++ src/lang/unfinished/urdu.txt | 2 ++ src/lang/vietnamese.txt | 2 ++ src/lang/welsh.txt | 2 ++ 63 files changed, 140 insertions(+), 14 deletions(-) diff --git a/src/lang/afrikaans.txt b/src/lang/afrikaans.txt index d8b05cac75..ae2f77bee2 100644 --- a/src/lang/afrikaans.txt +++ b/src/lang/afrikaans.txt @@ -3388,11 +3388,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Koop Voe STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Bou skip STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Koop vliegtuig + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Koop die gekose lokomotief/wa. Shift+klik vir kwotasie STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Koop die gekose voertuig. Shift+klik vir kwotasie STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Koop die gekose skip. Shift+klik vir kwotasie STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Koop die gekose vliegtuig. Shift+klik vir kwotasie + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Hernoem STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Hernoem STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Hernoem diff --git a/src/lang/arabic_egypt.txt b/src/lang/arabic_egypt.txt index ec0017d675..694f5643a6 100644 --- a/src/lang/arabic_egypt.txt +++ b/src/lang/arabic_egypt.txt @@ -2915,11 +2915,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}شراء STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}شراء سفينة STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}شراء طائرة + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}شراء العربة الموضحة STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}شراء العربة STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}شراء السفينة المختارة STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}اشتر الطائرة المختارة + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}اعادة تسمية STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}أعد التسمية STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}تسمية diff --git a/src/lang/basque.txt b/src/lang/basque.txt index 6cec7bfd29..d390de5bf2 100644 --- a/src/lang/basque.txt +++ b/src/lang/basque.txt @@ -3275,11 +3275,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Ibilgail STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Itsasontia erosi STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Hegazkina erosi + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Aukeratuta dagoen ibilgailua erosi. Shift+Klik gutxi gora beherako kostea erakutsi STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Aukeratuta dagoen ibilgailua erosi. Shift+Klik gutxi gora beherako kostea erakutsi STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Aukeratuta dagoen itsasontzia erosi. Shift+Klik gutxi gora beherako kostea erakutsi STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Aukeratuta dagoen hegazkina erosi. Shift+Klik gutxi gora beherako kostea erakutsi + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Berrizendatu STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Berrizendatu STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Berrizendatu diff --git a/src/lang/belarusian.txt b/src/lang/belarusian.txt index 917374e5d1..887dace4b5 100644 --- a/src/lang/belarusian.txt +++ b/src/lang/belarusian.txt @@ -3745,11 +3745,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Купі STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Купіць STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Купіць + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Набыць абраны лякаматыў/ваґон. Shift+пстрычка — ацэнка кошту набыцьця. STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Набыць абраны аўтамабіль. Shift+пстрычка — ацэнка кошту набыцьця. STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Набыць абраны карабель. Shift+пстрычка — ацэнка кошту набыцьця. STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Набыць абраны авіятранспарт. Shift+пстрычка — ацэнка кошту набыцьця. + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Перайменаваць STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Перайменаваць STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Перайменаваць diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt index b0c8a58167..cf75f47507 100644 --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -3455,11 +3455,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Comprar STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Comprar Embarcação STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Comprar Aeronave + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Compra o veículo ferroviário selecionado. Shift+Clique mostra preço estimado sem a compra STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Compra o veículo selecionado. Shift+Clique mostra preço estimado sem a compra STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Compra a embarcação selecionada. Shift+Clique mostra preço estimado sem a compra STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Compra a aeronave selecionada. Shift+Clique mostra o preço estimado sem a compra + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Renomear STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Renomear STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Renomear diff --git a/src/lang/bulgarian.txt b/src/lang/bulgarian.txt index ff4487443e..661589024b 100644 --- a/src/lang/bulgarian.txt +++ b/src/lang/bulgarian.txt @@ -3320,11 +3320,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Купи STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Купи Кораб STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Купи самолет + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Купи маркираният влак. Shift строеж/цена за построяване STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Купи посоченото МПС. Shift строеж/цена за построяване STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Купи посоченият кораб. Shift строеж/цена за построяване STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Купи посоченият самолет. Shift строеж/цена за построяване + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Преименувай STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Преименувай STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Промяна на име diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index 012a5d3168..8d91307d03 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -3499,11 +3499,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Compra e STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Compra el vaixell STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Compra l'aeronau + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Compra el tren/vagó seleccionat. Amb Maj+Clic, mostra el cost estimat sense comprar-lo. STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Compra el vehicle marcat. Amb Maj+Clic, mostra el cost estimat sense comprar-lo. STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Compra el vaixell seleccionat. Amb Maj+Clic, mostra el cost estimat sense comprar-lo. STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Compra l'aeronau marcada. Amb Maj+Clic, mostra el cost estimat sense comprar-la. + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Canvia el nom STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Canvia el nom STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Canvia el nom diff --git a/src/lang/croatian.txt b/src/lang/croatian.txt index 831b159fd5..e494d10803 100644 --- a/src/lang/croatian.txt +++ b/src/lang/croatian.txt @@ -3597,11 +3597,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Kupi voz STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Kupi brod STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Kupi zrakoplov + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Kupi označeni vlak. Shift+Klik prikazuje trošak bez kupnje. STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Kupi označeno cestovno vozilo. Shift+Klik prikazuje trošak bez kupnje. STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Kupi označeni brod. Shift+Klik prikazuje trošak bez kupnje. STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Kupi označeni zrakoplov. Shift+Klik prikazuje trošak bez kupnje. + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Preimenuj STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Preimenuj STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Preimenuj diff --git a/src/lang/czech.txt b/src/lang/czech.txt index 618527bd9d..6ce6c2f1fe 100644 --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -3515,11 +3515,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Koupit v STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Koupit loď STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Koupit letadlo + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Kup označený vagon/lokomotivu. Stisknutý Shift pro zobrazení odhadu ceny STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Koupit označené vozidlo. Stisknutý Shift pro zobrazení odhadu ceny STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Koupit označenou loď. Stisknutý Shift pro zobrazení odhadu ceny STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Koupit označené letadlo. Stisknutý Shift pro zobrazení odhadu ceny + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Přejmenovat STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Přejmenovat STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Přejmenovat diff --git a/src/lang/danish.txt b/src/lang/danish.txt index c9ed344aa3..5ff50a961c 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -3501,11 +3501,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Køb kø STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Køb skib STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Køb et fly + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Køb det markerede lokomotiv/togvogn. Shift skifter mellem at købe og vise prisoverslag. STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Køb det markerede køretøj. Shift skifter mellem at købe og vise prisoverslag. STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Køb det markerede skib. Shift skifter mellem at købe og vise prisoverslag. STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Køb det markerede fly. Shift skifter mellem at købe og vise prisoverslag. + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Omdøb STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Omdøb STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Omdøb diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index 221caab94c..2886783ea6 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -3501,11 +3501,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Wegvoert STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Schip kopen STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Vliegtuig kopen + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Geselecteerd spoorvoertuig bouwen. Shift+klik geeft de verwachte kosten zonder te kopen. STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Koop het geselecteerde wegvoertuig. Shift+klik geeft de verwachte kosten zonder te kopen. STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Koop het geselecteerde schip. Shift+klik geeft de verwachte kosten zonder te kopen STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Koop het geselecteerde vliegtuig. Shift+klik geeft de verwachte kosten zonder te kopen. + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Hernoemen STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Hernoemen STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Hernoemen diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt index 1f3d9eef5d..d260a6a80e 100644 --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -3354,11 +3354,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Buy Vehi STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Buy Ship STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Buy Aircraft + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted train vehicle. Shift+Click shows estimated cost without purchase STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted road vehicle. Shift+Click shows estimated cost without purchase STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted ship. Shift+Click shows estimated cost without purchase STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted aircraft. Shift+Click shows estimated cost without purchase + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Rename STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Rename STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Rename diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index f02b1a2cd5..0d8b1b7127 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -3498,11 +3498,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Buy Vehi STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Buy Ship STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Buy Aircraft + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted train vehicle. Shift+Click shows estimated cost without purchase STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted road vehicle. Shift+Click shows estimated cost without purchase STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted ship. Shift+Click shows estimated cost without purchase STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted aircraft. Shift+Click shows estimated cost without purchase + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Rename STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Rename STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Rename diff --git a/src/lang/esperanto.txt b/src/lang/esperanto.txt index 12e550a16c..c82efa0e07 100644 --- a/src/lang/esperanto.txt +++ b/src/lang/esperanto.txt @@ -2825,11 +2825,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Aĉeti V STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Aĉeti Ŝipon STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Aĉeti Aviadilon + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Aĉeti la emfazitan trajnveturilon. Montri taksitaj kostoj sen aĉeti per maljuskliga klavo + Klaki STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Aĉeti la emfazitan stratveturilon. Montri taksitaj kostoj sen aĉeti per maljuskliga klavo + Klaki STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Aĉeti la emfazitan ŝipon. Montri taksitaj kostoj sen aĉeti per maljuskliga klavo + Klaki STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Aĉeti la emfazitan aviadilon. Montri taksitaj kostoj sen aĉeti per maljuskliga klavo + Klaki + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Alinomi STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Alinomi STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Alinomi diff --git a/src/lang/estonian.txt b/src/lang/estonian.txt index 39e74edd39..d60c39bd81 100644 --- a/src/lang/estonian.txt +++ b/src/lang/estonian.txt @@ -3466,11 +3466,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Ehita ve STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Ehita laev STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Ehita lennuk + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Osta valitud raudteesõiduk. Shift+klõpsuga kuvatakse eeldatav ostuhind STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Osta valitud mootorsõiduk. Shift+klõpsuga kuvatakse eeldatav ostuhind STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Osta valitud laev. Shift+klõpsuga kuvatakse eeldatav ostuhind STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Osta valitud õhusõiduk. Shift+klõpsuga kuvatakse eeldatav ostuhind + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Nimevahetus STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Nimevahetus STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Nimevahetus diff --git a/src/lang/faroese.txt b/src/lang/faroese.txt index 803c761caf..55849f11be 100644 --- a/src/lang/faroese.txt +++ b/src/lang/faroese.txt @@ -3018,11 +3018,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Keyp akf STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Keyp skip STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Keyp flogfar + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Keyp undirstrikaða tok flutningstóli. Shift+trýst vísur kostnaðar meting uttan at keypa STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Keyp undirstrikaða akfari. Shift+trýst vísur kostnaðar meting uttan at keypa STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Keyp undirstrikaða skipi. Shift+trýst vísur kostnaðar meting uttan at keypa STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Keyp undirstrikaða flogfari. Shift+trýst vísur kostnaðar meting uttan at keypa + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Navngev STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Navngev STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Navngev diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index 4dd1efa4ae..829e9b91bf 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -1075,7 +1075,7 @@ STR_SEA_LEVEL_LOW :Matala STR_SEA_LEVEL_MEDIUM :Keskitaso STR_SEA_LEVEL_HIGH :Korkea STR_SEA_LEVEL_CUSTOM :Oma -STR_SEA_LEVEL_CUSTOM_PERCENTAGE :Oma ({NUM}%) +STR_SEA_LEVEL_CUSTOM_PERCENTAGE :Oma ({NUM}{NBSP}%) STR_RIVERS_NONE :Ei yhtään STR_RIVERS_FEW :Vähän @@ -1199,7 +1199,7 @@ STR_CONFIG_SETTING_ROAD_VEHICLE_ACCELERATION_MODEL :Ajoneuvojen kii STR_CONFIG_SETTING_ROAD_VEHICLE_ACCELERATION_MODEL_HELPTEXT :Valitsee ajoneuvojen käyttämän fysiikkamallin. "Alkuperäinen" malli hidastaa ajoneuvoja mäissä tasapuolisesta. "Realistinen" malli hidastaa ajoneuvoja mäissä niiden ominaisuuksista riippuen STR_CONFIG_SETTING_TRAIN_SLOPE_STEEPNESS :Mäkien jyrkkyys junille: {STRING} STR_CONFIG_SETTING_TRAIN_SLOPE_STEEPNESS_HELPTEXT :Mäkien jyrkkyys junille. Korkeammat arvot tekevät mäkien nousemisesta vaikeampaa -STR_CONFIG_SETTING_PERCENTAGE :{COMMA}% +STR_CONFIG_SETTING_PERCENTAGE :{COMMA}{NBSP}% STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS :Mäkien jyrkkyys ajoneuvoille: {STRING} STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS_HELPTEXT :Mäkien jyrkkyys ajoneuvoille. Korkeammat arvot tekevät mäkien nousemisesta vaikeampaa STR_CONFIG_SETTING_FORBID_90_DEG :90 asteen käännökset kielletty junilta: {STRING} @@ -1652,9 +1652,9 @@ STR_CONFIG_SETTING_LINKGRAPH_ACCURACY_HELPTEXT :Mitä suuremmak STR_CONFIG_SETTING_DEMAND_DISTANCE :Välimatkan vaikutus kysyntään: {STRING} STR_CONFIG_SETTING_DEMAND_DISTANCE_HELPTEXT :Mikäli asetuksen arvo on määritelty suuremmaksi kuin 0, alkuperäisen aseman A ja mahdollisen määränpään B välimatkalla on vaikutus A:sta B:hen lähetetyn rahdin määrään. Mitä kauempana B on A:sta, sitä vähemmän rahtia lähetetään. Mitä suuremmaksi tämä asetus on määritetty, sitä vähemmän rahtia lähetetään kaukana oleville ja enemmän lähellä oleville asemille. STR_CONFIG_SETTING_DEMAND_SIZE :Palautettavan rahdin määrä symmetrisessä tilassa: {STRING} -STR_CONFIG_SETTING_DEMAND_SIZE_HELPTEXT :Mikäli asetuksen arvoksi on määritetty alle 100%, symmetrinen jakauma toimii enemmän epäsymmetrisen jakauman tavoin ja vähemmän rahtia pakotetaan lähetettäväksi takaisin alkuperäiselle asemalle. Jos arvoksi määritetään 0%, symmetrinen jakauma toimii täysin epäsymmetrisen jakauman tavoin. +STR_CONFIG_SETTING_DEMAND_SIZE_HELPTEXT :Mikäli asetuksen arvoksi on määritetty alle 100{NBSP}%, symmetrinen jakauma toimii enemmän epäsymmetrisen jakauman tavoin, ja vähemmän rahtia pakotetaan lähetettäväksi takaisin alkuperäiselle asemalle. Jos arvoksi määritetään 0{NBSP}%, symmetrinen jakauma toimii täysin epäsymmetrisen jakauman tavoin. STR_CONFIG_SETTING_SHORT_PATH_SATURATION :Lyhyiden reittien kuormittuminen ennen vapaampien reittien käyttämistä: {STRING} -STR_CONFIG_SETTING_SHORT_PATH_SATURATION_HELPTEXT :Kahden aseman välillä on usein useita reittejä. Lyhintä reittiä käytetään ensisijaisesti, toisiksi lyhintä ensimmäisen kuormittuessa ja niin edelleen. Kuormitus määritellään arvioidun kapasiteetin ja suunnitellun käytön mukaan. Kaikkien reittien ollessa kuormittuneita reittejä aletaan ylikuormittamaan, suurimman kapasiteetin omaavista reiteista aloittaen. Algoritmi ei kuitenkaan aina arvioi kapasiteettia oikein. Tämä asetus mahdollistaa reitin kuormitustason määrittämisen ennen seuraavan reitin käyttämistä. Määritä arvoksi vähemmän kuin 100% välttääksesi ylikuormittuneita asemia jos kapasiteetti yliarvioidaan. +STR_CONFIG_SETTING_SHORT_PATH_SATURATION_HELPTEXT :Kahden aseman välillä on usein useita reittejä. Lyhintä reittiä käytetään ensisijaisesti, toiseksi lyhintä ensimmäisen kuormittuessa ja niin edelleen. Kuormitus määritellään arvioidun kapasiteetin ja suunnitellun käytön mukaan. Kaikkien reittien ollessa kuormittuneita reittejä aletaan ylikuormittaa, suurimman kapasiteetin omaavista reiteista aloittaen. Algoritmi ei kuitenkaan aina arvioi kapasiteettia oikein. Tämä asetus mahdollistaa reitin kuormitustason määrittämisen ennen seuraavan reitin käyttämistä. Määritä arvoksi vähemmän kuin 100{NBSP}% välttääksesi ylikuormittuneita asemia, jos kapasiteetti yliarvioidaan. STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY :Nopeuden yksikkö: {STRING} STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_HELPTEXT :Kun käyttöliittymässä näytetään nopeus, näytä se valittua yksikköä käyttäen @@ -2859,7 +2859,7 @@ STR_GENERATION_WORLD :{WHITE}Maailmaa STR_GENERATION_ABORT :{BLACK}Peruuta STR_GENERATION_ABORT_CAPTION :{WHITE}Keskeytä maailman luominen STR_GENERATION_ABORT_MESSAGE :{YELLOW}Haluatko varmasti keskeyttää maan luomisen? -STR_GENERATION_PROGRESS :{WHITE}{NUM}% valmiina +STR_GENERATION_PROGRESS :{WHITE}{NUM}{NBSP}% valmiina STR_GENERATION_PROGRESS_NUM :{BLACK}{NUM} / {NUM} STR_GENERATION_WORLD_GENERATION :{BLACK}Maailman luominen STR_GENERATION_RIVER_GENERATION :{BLACK}Jokien luominen @@ -3067,7 +3067,7 @@ STR_TOWN_DIRECTORY_CAPTION :{WHITE}Kunnat STR_TOWN_DIRECTORY_NONE :{ORANGE}- Ei mitään - STR_TOWN_DIRECTORY_TOWN :{ORANGE}{TOWN}{BLACK} ({COMMA}) STR_TOWN_DIRECTORY_CITY :{ORANGE}{TOWN}{YELLOW} (kaupunki){BLACK} ({COMMA}) -STR_TOWN_DIRECTORY_LIST_TOOLTIP :{BLACK}Kaupunkien nimet – keskitä päänäkymä kaupunkiin napsauttamalla nimeä. Ctrl+Klik avaa uuden näkymäikkunan kaupungin sijaintiin +STR_TOWN_DIRECTORY_LIST_TOOLTIP :{BLACK}Kuntien nimet – keskitä päänäkymä kuntaan napsauttamalla nimeä. Ctrl+Klik avaa uuden näkymäikkunan kunnan sijaintiin STR_TOWN_POPULATION :{BLACK}Maailman asukasluku: {COMMA} # Town view window @@ -3213,7 +3213,7 @@ STR_STATION_VIEW_EXCLUSIVE_RIGHTS_COMPANY :{YELLOW}{COMPAN STR_STATION_VIEW_RATINGS_BUTTON :{BLACK}Arviot STR_STATION_VIEW_RATINGS_TOOLTIP :{BLACK}Näytä aseman arviot STR_STATION_VIEW_SUPPLY_RATINGS_TITLE :{BLACK}Kuukausittainen tarjonta ja paikallinen arvio: -STR_STATION_VIEW_CARGO_SUPPLY_RATING :{WHITE}{STRING}: {YELLOW}{COMMA} / {STRING} ({COMMA}%) +STR_STATION_VIEW_CARGO_SUPPLY_RATING :{WHITE}{STRING}: {YELLOW}{COMMA} / {STRING} ({COMMA}{NBSP}%) STR_STATION_VIEW_GROUP :{BLACK}Järjestä STR_STATION_VIEW_WAITING_STATION :Asema: Odottaa @@ -3368,8 +3368,8 @@ STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL :{WHITE}{CURRENC # Industry directory STR_INDUSTRY_DIRECTORY_CAPTION :{WHITE}Teollisuusala STR_INDUSTRY_DIRECTORY_NONE :{ORANGE}- Ei mitään - -STR_INDUSTRY_DIRECTORY_ITEM :{ORANGE}{INDUSTRY}{BLACK} ({CARGO_LONG}{STRING}){YELLOW} ({COMMA}% kuljetettu) -STR_INDUSTRY_DIRECTORY_ITEM_TWO :{ORANGE}{INDUSTRY}{BLACK} ({CARGO_LONG}{STRING}/{CARGO_LONG}{STRING}){YELLOW} ({COMMA}%/{COMMA}% kuljetettu) +STR_INDUSTRY_DIRECTORY_ITEM :{ORANGE}{INDUSTRY}{BLACK} ({CARGO_LONG}{STRING}){YELLOW} ({COMMA}{NBSP}% kuljetettu) +STR_INDUSTRY_DIRECTORY_ITEM_TWO :{ORANGE}{INDUSTRY}{BLACK} ({CARGO_LONG}{STRING}/{CARGO_LONG}{STRING}){YELLOW} ({COMMA}{NBSP}% / {COMMA}{NBSP}% kuljetettu) STR_INDUSTRY_DIRECTORY_ITEM_NOPROD :{ORANGE}{INDUSTRY} STR_INDUSTRY_DIRECTORY_LIST_CAPTION :{BLACK}Teollisuusmuotojen nimet - kohdista päänäkymä teollisuuslaitokseen napsauttamalla nimeä. Ctrl+Klik avaa uuden näkymäikkunan teollisuuslaitoksen sijaintiin @@ -3378,7 +3378,7 @@ STR_INDUSTRY_VIEW_CAPTION :{WHITE}{INDUSTR STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Tuotto viime kuussa: STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}{NBSP}% kuljetettu) STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Keskitä päänäkymä teollisuuden sijaintiin. Ctrl+Klik avaa uuden näkymäikkunan teollisuuden sijaintiin -STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Tuotantotaso: {YELLOW}{COMMA}% +STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Tuotantotaso: {YELLOW}{COMMA}{NBSP}% STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Teollisuuslaitos ilmoittaa pikaisesta sulkeutumisestaan! STR_INDUSTRY_VIEW_REQUIRES_N_CARGO :{BLACK}Tarvitsee: {YELLOW}{STRING}{STRING} @@ -3477,7 +3477,7 @@ STR_PURCHASE_INFO_RUNNINGCOST :{BLACK}Käyttö STR_PURCHASE_INFO_CAPACITY :{BLACK}Kapasiteetti: {GOLD}{CARGO_LONG} {STRING} STR_PURCHASE_INFO_REFITTABLE :(sovitettava) STR_PURCHASE_INFO_DESIGNED_LIFE :{BLACK}Suunniteltu: {GOLD}{NUM}{BLACK} Elinikä: {GOLD}{COMMA} vuo{P si tta} -STR_PURCHASE_INFO_RELIABILITY :{BLACK}Enimmäisluotettavuus: {GOLD}{COMMA}% +STR_PURCHASE_INFO_RELIABILITY :{BLACK}Enimmäisluotettavuus: {GOLD}{COMMA}{NBSP}% STR_PURCHASE_INFO_COST :{BLACK}Hinta: {GOLD}{CURRENCY_LONG} STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Paino: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Hinta: {GOLD}{CURRENCY_LONG}{BLACK} Nopeus: {GOLD}{VELOCITY} @@ -3501,11 +3501,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Osta ajo STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Osta laiva STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Osta lentokone + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Osta valittu yksikkö. Shift+Klik näyttää kustannusarvion ostamatta STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Osta valittu ajoneuvo. Shift+Klik näyttää kustannusarvion ostamatta STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Osta valittu laiva. Shift+Klik näyttää kustannusarvion ostamatta STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Osta korostettu lentokone. Shift+Klik näyttää kustannusarvion ostamatta + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Nimeä STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Nimeä STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Nimeä @@ -3756,7 +3758,7 @@ STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Paino: { STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Paino: {LTBLUE}{WEIGHT_SHORT} {BLACK}Teho: {LTBLUE}{POWER}{BLACK} Maks. nopeus: {LTBLUE}{VELOCITY} {BLACK}Maks. vetovoima: {LTBLUE}{FORCE} STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Tuotto tänä vuonna: {LTBLUE}{CURRENCY_LONG} (viime vuonna: {CURRENCY_LONG}) -STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Luotettavuus: {LTBLUE}{COMMA}% {BLACK}Hajoamiset viime huollon jälkeen: {LTBLUE}{COMMA} +STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Luotettavuus: {LTBLUE}{COMMA}{NBSP}% {BLACK}Hajoamiset viime huollon jälkeen: {LTBLUE}{COMMA} STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Rakennettu: {LTBLUE}{NUM}{BLACK} Arvo: {LTBLUE}{CURRENCY_LONG} STR_VEHICLE_INFO_NO_CAPACITY :{BLACK}Kapasiteetti: {LTBLUE}-{STRING} @@ -3767,7 +3769,7 @@ STR_VEHICLE_INFO_CAPACITY_CAPACITY :{BLACK}Kapasite STR_VEHICLE_INFO_FEEDER_CARGO_VALUE :{BLACK}Siirron arvo: {LTBLUE}{CURRENCY_LONG} STR_VEHICLE_DETAILS_SERVICING_INTERVAL_DAYS :{BLACK}Huoltoväli: {LTBLUE}{COMMA}{NBSP}päivää{BLACK} Viimeisin huolto: {LTBLUE}{DATE_LONG} -STR_VEHICLE_DETAILS_SERVICING_INTERVAL_PERCENT :{BLACK}Huoltoväli: {LTBLUE}{COMMA}%{BLACK} Viime huolto: {LTBLUE}{DATE_LONG} +STR_VEHICLE_DETAILS_SERVICING_INTERVAL_PERCENT :{BLACK}Huoltoväli: {LTBLUE}{COMMA}{NBSP}%{BLACK} Viime huolto: {LTBLUE}{DATE_LONG} STR_VEHICLE_DETAILS_INCREASE_SERVICING_INTERVAL_TOOLTIP :{BLACK}Kasvata huoltoväliä kymmenellä. Ctrl+Klik kasvattaa huoltoväliä viidellä STR_VEHICLE_DETAILS_DECREASE_SERVICING_INTERVAL_TOOLTIP :{BLACK}Pienennä huoltoväliä kymmenellä. Ctrl+Klik vähentää huoltoväliä viidellä diff --git a/src/lang/french.txt b/src/lang/french.txt index e8e14582c3..e1387329ff 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -3495,11 +3495,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Acheter STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Acheter STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Acheter + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Acheter le véhicule sélectionné.{}Shift-clic pour afficher seulement le coût estimé. STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Acheter le véhicule sélectionné.{}Shift-clic pour afficher seulement le coût estimé. STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Acheter le navire sélectionné.{}Shift-clic pour afficher seulement le coût estimé. STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Acheter l'aéronef sélectionné.{}Shift-clic pour afficher seulement le coût estimé. + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Renommer STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Renommer STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Renommer diff --git a/src/lang/gaelic.txt b/src/lang/gaelic.txt index 3ed107d8b8..0fbc2328aa 100644 --- a/src/lang/gaelic.txt +++ b/src/lang/gaelic.txt @@ -3675,11 +3675,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Ceannaic STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Ceannaich long STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Ceannaich carbad-adhair + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Ceannaich an carbad-rèile a thagh thu. Seallaidh Shift+briogadh tuairmse air na cosgaisean gun a bhith a' ceannach dad STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Ceannaich an carbad-rathaid a thagh thu. Seallaidh Shift+briogadh tuairmse air na cosgaisean gun a bhith a' ceannach dad STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Ceannaich an long a thagh thu. Seallaidh Shift+briogadh tuairmse air na cosgaisean gun a bhith a' ceannach dad STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Ceannaich an carbad-adhair a thagh thu. Seallaidh Shift+briogadh tuairmse air na cosgaisean gun a bhith a' ceannach dad + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Thoir ainm ùr air STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Thoir ainm ùr air STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Thoir ainm ùr air diff --git a/src/lang/galician.txt b/src/lang/galician.txt index 3fcc850c4c..7320dc9820 100644 --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -3400,11 +3400,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Mercar v STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Mercar barco STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Mercar aeronave + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Mercar o vehículo ferroviario seleccionado. Shift+click mostra o custo estimado sen mercar STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Mercar o vehículo de estrada seleccionado. Shift+click mostra o custo estimado sen mercar STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Mercar o barco seleccionado. Shift+click mostra o custo estimado sen mercar STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Mercar a aeronave seleccionada. Shift+click mostra o custo estimado sen mercar + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Renomear STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Renomear STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Renomear diff --git a/src/lang/german.txt b/src/lang/german.txt index 713257785e..1092b12da1 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -3480,11 +3480,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Fahrzeug STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Schiff kaufen STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Flugzeug kaufen + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Angewähltes Fahrzeug kaufen. Shift+Klick zeigt einen Kostenvoranschlag STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Ausgewähltes Fahrzeug kaufen. Shift+Klick zeigt einen Kostenvoranschlag STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Ausgewähltes Schiff kaufen. Shift+Klick zeigt einen Kostenvoranschlag STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Augewähltes Flugzeug kaufen. Shift schaltet zwischen Bauen und Kostenvoranschlag um + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Umbenennen STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Umbenennen STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Umbenennen diff --git a/src/lang/greek.txt b/src/lang/greek.txt index 2591066016..5c07295585 100644 --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -3558,11 +3558,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Αγορ STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Αγορά Πλοίου STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Αγορά Αεροσκάφους + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Αγοράστε το επιλεγμένο όχημα τρένου. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Αγοράστε το επιλεγμένο όχημα δρόμου. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Αγοράστε το επιλεγμένο πλοίο. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Αγοράστε το επιλεγμένο αεροσκάφος. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Μετονομασία STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Μετονομασία STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Μετονομασία diff --git a/src/lang/hebrew.txt b/src/lang/hebrew.txt index 18845ea441..726c91ceeb 100644 --- a/src/lang/hebrew.txt +++ b/src/lang/hebrew.txt @@ -3453,11 +3453,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}רכוש STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}רכוש כלי שייט STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}רכוש כלי טייס + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}רכוש את קרון הרכבת שמודגש. Shift+לחיצה מציג הערכת עלות ללא רכישה STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}רכוש את כלי הרכב שמודגש. Shift+לחיצה מציג הערכת עלות ללא רכישה STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}רכוש את כלי השייט שמודגש. Shift+לחיצה מציג הערכת עלות ללא רכישה STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}רכוש את כלי הטייס שמודגש. Shift+לחיצה מציג הערכת עלות ללא רכישה + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}שנה שם STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}שנה שם STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}החלף שם diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index 3f2c2b40eb..8268a8ab95 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -3564,11 +3564,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Megvesz STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Megvesz STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Megvesz + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}A kijelölt vasúti jármű megvétele. Shift+kattintással megmutatja a becsült költséget vásárlás nélkül STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}A kijelölt közúti jármű megvétele. Shift+kattintással megmutatja a becsült költséget vásárlás nélkül STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}A kijelölt hajó megvétele. Shift+kattintással megmutatja a becsült költséget vásárlás nélkül STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}A kijelölt repülőgép megvétele. Shift+kattintással megmutatja a becsült költséget vásárlás nélkül + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Átnevez STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Átnevez STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Átnevez diff --git a/src/lang/icelandic.txt b/src/lang/icelandic.txt index 1fada9f414..3efad55181 100644 --- a/src/lang/icelandic.txt +++ b/src/lang/icelandic.txt @@ -3176,11 +3176,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Kaupa bi STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Kaupa skip STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Kaupa flugvél + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Kaupa valinn lestarvagn. Shift+smella sýnir áætlaðan kostnað án þess að kaupa STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Kaupa valda bifreið. Shift+smella sýnir áætlaðan kostnað án þess að kaupa STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Kaupa valið skip. Shift+smella sýnir áætlaðan kostnað án þess að kaupa STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Kaupa valda flugvél. Shift+smella sýnir áætlaðan kostnað án þess að kaupa + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Endurnefna STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Endurnefna STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Endurnefna diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index ff220fc1d5..b682f23c04 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -3428,11 +3428,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Beli Ken STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Beli Kapal STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Beli Pesawat + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Beli kereta yang dipilih. Shift untuk menampilkan perkiraan biaya STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Beli kendaraan yang dipilih. Shift untuk menampilkan perkiraan biaya STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Beli kapal yang dipilih. Shift untuk menampilkan perkiraan biaya STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Beli pesawat yang dipilih. Shift untuk menampilkan perkiraan biaya + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Ubah Nama STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Ganti Nama STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Ubah Nama diff --git a/src/lang/irish.txt b/src/lang/irish.txt index c845d4c5f5..dcc0a5729b 100644 --- a/src/lang/irish.txt +++ b/src/lang/irish.txt @@ -3387,11 +3387,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Ceannaig STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Ceannaigh Long STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Ceannaigh Aerárthach + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Ceannaigh an fheithicil traenach aibhsithe STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Ceannaigh an fheithicil bóthair aibhsithe STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Ceannaigh an long aibhsithe STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Ceannaigh an t-aerárthach aibhsithe + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Athainmnigh STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Athainmnigh STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Athainmnigh diff --git a/src/lang/italian.txt b/src/lang/italian.txt index 2b629806de..d0232ddc6d 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -3524,11 +3524,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Compra v STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Compra nave STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Compra aeromobile + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Compra il veicolo ferroviario selezionato. MAIUSC+clic mostra il costo stimato senza comprare STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Compra l'automezzo selezionato. MAIUSC+clic mostra il costo stimato senza comprare STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Compra la nave selezionata. MAIUSC+clic mostra il costo stimato senza comprare STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Compra l'aeromobile selezionato. MAIUSC+clic mostra il costo stimato senza comprare + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Rinomina STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Rinomina STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Rinomina diff --git a/src/lang/japanese.txt b/src/lang/japanese.txt index c3c5fe89f9..bfddda4e69 100644 --- a/src/lang/japanese.txt +++ b/src/lang/japanese.txt @@ -3389,11 +3389,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}車両 STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}船舶を購入 STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}航空機を購入 + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}選択した列車を購入します。Shift+クリックで購入費を見積もります STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}選択した車両を購入します。Shift+クリックで購入費を見積もります STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}選択した船舶を購入します。Shift+クリックで購入費を見積もります STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}選択した航空機を購入します。Shift+クリックで購入費を見積もります + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}名称を変更 STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}名称を変更 STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}名称を変更 diff --git a/src/lang/korean.txt b/src/lang/korean.txt index a57e08bda5..7e7780f2b4 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -2140,7 +2140,7 @@ STR_NETWORK_CHAT_ALL :[모두] {STRIN STR_NETWORK_CHAT_OSKTITLE :{BLACK}채팅 메시지를 입력하세요. # Network messages -STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}네트워크 장치를 찾을수 없거나 게임 자체가 네트워크를 사용할 수 없는 버전으로 컴파일되었습니다. +STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}사용할 수 있는 네트워크 장치가 없습니다. STR_NETWORK_ERROR_NOSERVER :{WHITE}네트워크 게임이 존재하지 않습니다. STR_NETWORK_ERROR_NOCONNECTION :{WHITE}서버가 요청을 받지 않습니다. STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}NewGRF이 맞지 않아서 연결할 수 없습니다 @@ -3502,11 +3502,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}차량 STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}선박 구입 STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}항공기 구입 + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}선택된 차량을 구입합니다. SHIFT+클릭으로 예상 구입 가격을 볼 수 있습니다. STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}선택한 차량을 구입합니다. Shift+클릭하면 예상 구입 비용을 볼 수 있습니다. STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}선택한 선박을 구입합니다. SHIFT+클릭으로 예상 구입 비용을 볼 수 있습니다. STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}선택한 항공기를 구입합니다. SHIFT+클릭으로 예상 구입 비용을 볼 수 있습니다. + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}이름 STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}이름 지정 STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}이름 지정 diff --git a/src/lang/latin.txt b/src/lang/latin.txt index 10a0ea29be..bfc7157c90 100644 --- a/src/lang/latin.txt +++ b/src/lang/latin.txt @@ -3613,11 +3613,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Emere Ve STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Emere Navem STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Emere Aeroplanum + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Emere vehiculum ferriviarium electum. Shift+Preme ut pretium monstretur sine emptione STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Emere vehiculum viarium electum. Shift+Preme ut pretium monstretur sine emptione STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Emere navem electam. Shift+Preme ut pretium monstretur sine emptione STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Emere aeroplanum electum. Shift+Preme ut pretium monstretur sine emptione + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Renominare STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Renominare STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Renominare diff --git a/src/lang/latvian.txt b/src/lang/latvian.txt index c457ac0019..4c5dd5e273 100644 --- a/src/lang/latvian.txt +++ b/src/lang/latvian.txt @@ -3331,11 +3331,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Pirkt au STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Pirkt kuģi STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Pirkt lidaparātu + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Pirkt atzīmēto vilciena vagonu. Shift+klikšķis rāda izmaksu novērtējumu, neveicot pirkumu STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Pirkt atzīmēto transportlīdzekli. Shift+klikšķis rāda izmaksu novērtējumu, neveicot pirkumu STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Pirkt atzīmēto kuģi. Shift+klikšķis rāda izmaksu novērtējumu, neveicot pirkumu STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Pirkt izvēlēto lidaparātu. Shift+klikšķis rāda izmaksu novērtējumu, neveicot pirkumu + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Pārdēvēt STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Pārdēvēt STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Pārdēvēt diff --git a/src/lang/lithuanian.txt b/src/lang/lithuanian.txt index cf5290f6d6..e7dfead7b6 100644 --- a/src/lang/lithuanian.txt +++ b/src/lang/lithuanian.txt @@ -3606,11 +3606,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Pirkti STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Pirkti STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Pirkti + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Pirkti pažymėtą lokomotyvą ir/ar vagonus. Spragtelėjus laikant nuspaustą Shift klavišą, bus parodyta pirkinio kaina nieko realiai nenuperkant STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Pirkti pažymėtą automobilį. Spragtelėjus laikant nuspaustą Shift klavišą, bus parodyta pirkinio kaina nieko realiai nenuperkant STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Pirkti pažymėtą laivą. Spragtelėjus laikant nuspaustą Shift klavišą, bus parodyta pirkinio kaina nieko realiai nenuperkant STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Pirkti pažymėtą lėktuvą. Spragtelėjus laikant nuspaustą Shift klavišą, bus parodyta pirkinio kaina nieko realiai nenuperkant + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Pervardinti STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Pervardinti STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Pervardinti diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt index 4f2d85377f..2ef5814f8c 100644 --- a/src/lang/luxembourgish.txt +++ b/src/lang/luxembourgish.txt @@ -3427,11 +3427,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Gefier k STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Schëff kafen STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Fliger kafen + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Keeft den ungewielten Zuch. Shift+Klick weist ongeféier Käschten ouni Kaf STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Keeft dat ugewielte Stroossegefier. Shift+Klick weist ongeféier Käschten ouni Kaf STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Keeft dat ugewielte Schëff. Shift+Klick weist ongeféier Käschten ouni Kaf STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Keeft den ungewielte Fliger. Shift+Klick weist ongeféier Käschten ouni Kaf + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Ëmbenennen STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Ëmbenennen STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Ëmbenennen diff --git a/src/lang/malay.txt b/src/lang/malay.txt index ddaf825a83..faf57b8906 100644 --- a/src/lang/malay.txt +++ b/src/lang/malay.txt @@ -3086,11 +3086,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Beli Ken STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Beli Kapal STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Beli Pesawat + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Beli gerabak keretapi yang terpilih. Shift+Klik menunjukkan anggaran kos tanpa membeli STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Beli kenderaan jalanraya yang terpilih. Shift+Klik menunjukkan anggaran kos tanpa membeli STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Beli kapal yang terpilih. Shift+Klik menunjukkan anggaran kos tanpa membeli STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Beli pesawat yang terpilih. Shift+Klik menunjukkan anggaran kos tanpa membeli + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Namakan semula STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Namakan semula STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Namakan semula diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt index 8c565bec81..54a4766de5 100644 --- a/src/lang/norwegian_bokmal.txt +++ b/src/lang/norwegian_bokmal.txt @@ -3505,11 +3505,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Kjøp kj STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Kjøp skip STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Kjøp luftfartøy + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Kjøp det merkede tog/vogn. Shift+klikk viser estimert kostnad STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Kjøp det merkede kjøretøy. Shift+klikk viser estimert kostnad STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Kjøp det merkede skip. Shift+klikk viser estimert kostnad STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Kjøp det merkede luftfartøy. Shift+klikk viser estimert kostnad + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Endre navn STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Endre navn STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Endre navn diff --git a/src/lang/norwegian_nynorsk.txt b/src/lang/norwegian_nynorsk.txt index 8e6948d9ab..787a42d7f6 100644 --- a/src/lang/norwegian_nynorsk.txt +++ b/src/lang/norwegian_nynorsk.txt @@ -3306,11 +3306,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Kjøp k STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Bygg skip STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Bygg luftfartøy + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Bygg den valde farkosten. Skift-klikk viser prisoverslag utan å kjøpe. STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Bygg det valde køyretøyet. Skift-klikk viser prisoverslag utan å kjøpe. STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Bygg det valde skipet. Skift-klikk viser prisoverslag utan å kjøpe. STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Bygg det valde luftfartøyet. Skift-klikk viser prisoverslag utan å kjøpe. + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Gje nytt namn STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Endre namn STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Endre namn diff --git a/src/lang/polish.txt b/src/lang/polish.txt index f44de0b917..4ec0ada640 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -3839,11 +3839,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Kup poja STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Kup statek STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Kup samolot + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Kup zaznaczony pociąg. Shift+klik pokazuje szacunkowy koszt bez dokonania zakupu STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Kup zaznaczony pojazd drogowy. Shift+klik pokazuje szacunkowy koszt bez dokonania zakupu STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Kup zaznaczony statek. Shift+klik pokazuje szacunkowy koszt bez dokonania zakupu STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Kup zaznaczony samolot. Shift+klik pokazuje szacunkowy koszt bez dokonania zakupu + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Zmień nazwę STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Zmień nazwę STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Zmień nazwę diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index 503dcacf63..e44f53f1ef 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -3495,11 +3495,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Comprar STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Comprar Barco STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Comprar Aeronave + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Comprar o veículo ferroviário seleccionado. Shift+Clique mostra estimativa de custo, sem comprar STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Comprar o veículo rodoviário seleccionado. Shift+Clique mostra estimativa de custo, sem comprar STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Comprar barco seleccionado. Shift+Clique mostra estimativa de custo, sem comprar STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Comprar aeronave seleccionada. Shift+Clique mostra estimativa de custo, sem comprar + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Renomear STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Renomear STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Renomear diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index b1c80d97dc..1aabd80fa4 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -3374,11 +3374,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Cumpăr STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Cumpără navă STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Cumpără aeronavă + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Cumpără vehiculul feroviar selectat. Shift+Click arată costul estimat fără să cumpere vehiculul STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Cumpără autovehiculul selectat. Shift+Click arată costul estimat fără să cumpere autovehiculul STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Cumpără nava selectată. Shift+Click arată costul estimativ fără a efectua achiziţia STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Cumpără aeronava selectată. Shift+Click arată costul estimativ fără a efectua achiziţia + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Nume nou STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Nume nou STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Nume nou diff --git a/src/lang/russian.txt b/src/lang/russian.txt index 5106114e39..fbc70a0399 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -3681,11 +3681,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Купи STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Купить STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Купить + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Купить выбранный локомотив/вагон. Shift+щелчок - оценка стоимости покупки. STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Купить выбранный автомобиль. Shift+щелчок - оценка стоимости покупки. STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Купить выбранный корабль. Shift+щелчок - оценка стоимости покупки. STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Купить выбранный авиатранспорт. Shift+щелчок - оценка стоимости покупки. + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Переименовать STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Переименовать STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Переименовать diff --git a/src/lang/serbian.txt b/src/lang/serbian.txt index b1efd373e3..57c172f64e 100644 --- a/src/lang/serbian.txt +++ b/src/lang/serbian.txt @@ -3606,11 +3606,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Kupi Voz STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Kupi Brod STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Kupi Letelicu + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Kupuje označeno šinsko vozilo. Shift+Klik prikazuje procenu troškova bez kupovine STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Kupuje označeno drumsko vozilo. Shift+Klik prikazuje procenu troškova bez kupovine STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Kupuje označeni brod. Shift+Klik prikazuje procenu troškova bez kupovine STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Kupuje označenu letilicu. Shift+Klik prikazuje procenu troškova bez kupovine + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Preimenuj STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Promena naziva STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Preimenuj diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index 61983f80a3..7235f8e55d 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -3419,11 +3419,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}购买 STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}购买船只 STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}购买飞机 + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}购买选定的列车,按住 Shift 键单击可以显示所需资金 STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}购买选定的汽车,按住 Shift 键单击可以显示所需资金 STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}购买选定的船只,按住 Shift 键单击可以显示所需资金 STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}购买选定的飞机,按住 Shift 键单击可以显示所需资金 + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}重命名 STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}重命名 STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}重命名 diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt index 8cb3a35042..0540846b61 100644 --- a/src/lang/slovak.txt +++ b/src/lang/slovak.txt @@ -3455,11 +3455,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Kúpiť STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Kúpiť loď STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Kúpiť lietadlo + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Kúpiť vybraný vlak. Shift+klik zobrazí predpokladanú cenu bez nákupu. STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Kúpiť vybrané vozidlo. Shift+klik zobrazí predpokladanú cenu bez nákupu STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Kúpiť vybranú loď. Shift+klik zobrazí predpokladanú cenu bez nákupu STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Kúpiť vybrané lietadlo. Shift+klik zobrazí predpokladanú cenu bez nákupu + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Premenovať STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Premenovať STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Premenovať diff --git a/src/lang/slovenian.txt b/src/lang/slovenian.txt index 63bbff4ef7..dc98d79e62 100644 --- a/src/lang/slovenian.txt +++ b/src/lang/slovenian.txt @@ -3541,11 +3541,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Kupi voz STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Kupi ladjo STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Kupi letalo + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Kupi izbrano železniško vozilo. Shift+Klik prikaže predviden strošek brez nakupa STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Kupi izbrano cestno vozilo. Shift+Klik prikaže predviden strošek brez nakupa STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Kupi izbrano ladjo. Shift+Klik prikaže predviden strošek brez nakupa STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Kupi izbrano letalo. Shift+Klik prikaže predviden strošek brez nakupa + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Preimenuj STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Preimenuj STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Preimenuj diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index b2ed3fc171..cb1b91d1b4 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -3446,11 +3446,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Comprar STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Comprar barco STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Comprar aeronave + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Compra el vehículo de ferrocarril resaltado. Shift+Click muestra una estimación del precio sin realizar la compra STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Comprar el vehículo de carretera resaltado. Shift+Click muestra una estimación del precio sin realizar la compra STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Comprar el barco resaltado. Shift+Click muestra una estimación del precio sin realizar la compra STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Comprar la aeronave resaltada. Shift+Click muestra una estimación del precio sin realizar la compra + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Renombrar STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Renombrar STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Renombrar diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt index 946c35f0c3..bc0ec7d5bb 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -3495,11 +3495,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Comprar STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Comprar STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Comprar + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Comprar el tren elegido. Mayús+Clic muestra una estimación del precio sin realizar la compra STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Comprar el vehículo de carretera elegido. Mayús+Clic muestra una estimación del precio sin realizar la compra STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Comprar el barco elegido. Mayús+Clic muestra una estimación del precio sin realizar la compra STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Comprar la aeronave elegida. Mayús+Clic muestra una estimación del precio sin realizar la compra + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Cambiar nombre STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Cambiar nombre STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Cambiar nombre diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index e0351daa7a..5a18425d3f 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -3479,11 +3479,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Köp for STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Köp skepp STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Köp flygplan + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Köp markerad tågvagn. Shift+klick visar kostnad utan att köpa STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Köp markerat vägfordon. Shift+klick visar kostnad utan att köpa STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Köp markerat skepp. Shift+klick visar kostnad utan att köpa STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Köp markerat flygplan. Shift+klick visar kostnad utan att köpa + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Byt namn på STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Byt namn på STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Byt namn på diff --git a/src/lang/tamil.txt b/src/lang/tamil.txt index 34b413eea0..da1a772df0 100644 --- a/src/lang/tamil.txt +++ b/src/lang/tamil.txt @@ -3006,11 +3006,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}வா STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}கப்பலை வாங்கு STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}விமானத்தை வாங்கு + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}காட்டப்படும் இரயில் வாகனத்தை வாங்கவும். Shift+Click செய்தால் வாங்கும்போது ஆகும் மதிப்பிடப்பட்டச் செலவுகளைக் காட்டு STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}காட்டப்படும் சாலை வாகனத்தை வாங்கவும். Shift+Click செய்தால் வாங்கும்போது ஆகும் மதிப்பிடப்பட்டச் செலவுகளைக் காட்டும் STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}காட்டப்படும் கப்பலை வாங்கவும். Shift+Click செய்தால் வாங்கும்போது ஆகும் மதிப்பிடப்பட்டச் செலவுகளைக் காட்டும் STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}காட்டப்படும் விமானத்தை வாங்கவும். Shift+Click செய்தால் வாங்கும்போது ஆகும் மதிப்பிடப்பட்டச் செலவுகளைக் காட்டும் + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}பெயரிடு STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}பெயரிடு STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}பெயரிடு diff --git a/src/lang/thai.txt b/src/lang/thai.txt index a315f95639..78c26c65b0 100644 --- a/src/lang/thai.txt +++ b/src/lang/thai.txt @@ -3317,11 +3317,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}ซื STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}ซื้อเรือ STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}ซื้อเครื่องบิน + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}ซื้อรถไฟที่เลือกไว้ เมื่อกด Shift+คลิกเมาส์ จะแสดงมูลค่าโดยประมาณโดยไม่ทำการซื้อ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}ซื้อรถที่เลือกไว้ เมื่อกด Shift+คลิกเมาส์ จะแสดงมูลค่าโดยประมาณโดยไม่ทำการซื้อ STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}ซื้อเรือที่เลือกไว้ เมื่อกด Shift+คลิกเมาส์ จะแสดงมูลค่าโดยประมาณโดยไม่ทำการซื้อ STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}ซื้อเครื่องบินที่เลือกไว้ เมื่อกด Shift+คลิกเมาส์ จะแสดงมูลค่าโดยประมาณโดยไม่ทำการซื้อ + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}เปลี่ยนชื่อ STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}เปลี่ยนชื่อ STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}เปลี่ยนชื่อ diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt index c9cbddb9ca..b3f1b63f51 100644 --- a/src/lang/traditional_chinese.txt +++ b/src/lang/traditional_chinese.txt @@ -3387,11 +3387,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}購買 STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}購買船舶 STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}購買飛機 + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}購買選定的列車。按住 Shift 點選則只會顯示預估的購買費用 STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}購買選定的車輛。按住 Shift 點選則只會顯示預估的購買費用 STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}購買選定的船舶。按住 Shift 點選則只會顯示預估的購買費用 STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}購買選定的飛機。按住 Shift 點選則只會顯示預估的購買費用 + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}重新命名 STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}重新命名 STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}重新命名 diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index 93a386398c..270a30a91c 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -3488,11 +3488,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Araç Sa STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Gemi Satın Al STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Uçak Satın Al + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Seçili treni satın al. Shift ile tıklama satın almadan tahmini maliyeti gösterir. STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}İşaretli aracı al. Shift ile tıklama satın almadan tahmini maliyeti gösterir STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Seçili gemiyi satın al. Shift ile tıklama satın almadan tahmini maliyeti gösterir STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Seçili uçağı satın al. Shift ile tıklama satın almadan tahmini maliyeti gösterir + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Yeni isim STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}İsim STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}İsim diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt index 4e7b87d229..452c0f9783 100644 --- a/src/lang/ukrainian.txt +++ b/src/lang/ukrainian.txt @@ -3630,11 +3630,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Купи STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Купити STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Купити + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Купити вибраний поїзд. Утримуйте Shift для показу витрат на придбання STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Купити вибране авто. Утримуйте Shift для показу витрат на придбання STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Купити вибраний корабель. Утримуйте Shift для показу витрат на придбання STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Купити вибраний літак. Утримуйте Shift для показу витрат на придбання + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Назва STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Зміна назви STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Зміна назви diff --git a/src/lang/unfinished/chuvash.txt b/src/lang/unfinished/chuvash.txt index e858a0bbc8..e7b0adbda5 100644 --- a/src/lang/unfinished/chuvash.txt +++ b/src/lang/unfinished/chuvash.txt @@ -1147,6 +1147,8 @@ STR_INDUSTRY_DIRECTORY_NONE :{ORANGE}- Ҫу + + # Depot window STR_DEPOT_CAPTION :{WHITE}{DEPOT} diff --git a/src/lang/unfinished/frisian.txt b/src/lang/unfinished/frisian.txt index df1ffd3c04..8b02042810 100644 --- a/src/lang/unfinished/frisian.txt +++ b/src/lang/unfinished/frisian.txt @@ -3115,11 +3115,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Keapje a STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Keapje boat STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Keapje fleantúg + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Keapje ferljochte trein STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Keapje ferljochte auto STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Keapje ferljochte boat STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Keapje ferljochte fleantúg + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Jow in nije namme STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Jow in nije namme STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Jow in nije namme diff --git a/src/lang/unfinished/ido.txt b/src/lang/unfinished/ido.txt index dcc3027782..f850fc769a 100644 --- a/src/lang/unfinished/ido.txt +++ b/src/lang/unfinished/ido.txt @@ -985,6 +985,8 @@ STR_GROUP_DEFAULT_AIRCRAFTS :Negrupigita aer + + # Depot window STR_DEPOT_CAPTION :{WHITE}{DEPOT} diff --git a/src/lang/unfinished/macedonian.txt b/src/lang/unfinished/macedonian.txt index b25ee84b06..b927c74a82 100644 --- a/src/lang/unfinished/macedonian.txt +++ b/src/lang/unfinished/macedonian.txt @@ -1459,8 +1459,10 @@ STR_BUY_VEHICLE_AIRCRAFT_LIST_TOOLTIP :{BLACK}Лист STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Направи авион + STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Направи авион од селектираниот тип + STR_BUY_VEHICLE_AIRCRAFT_RENAME_BUTTON :{BLACK}Преименувај STR_BUY_VEHICLE_AIRCRAFT_RENAME_TOOLTIP :{BLACK}Преименувај го типот на авиони diff --git a/src/lang/unfinished/maltese.txt b/src/lang/unfinished/maltese.txt index f25027744e..f66ee02a6d 100644 --- a/src/lang/unfinished/maltese.txt +++ b/src/lang/unfinished/maltese.txt @@ -857,6 +857,8 @@ STR_FINANCES_POSITIVE_INCOME :{BLACK}+{CURREN + + # Depot window STR_DEPOT_CAPTION :{WHITE}{DEPOT} diff --git a/src/lang/unfinished/marathi.txt b/src/lang/unfinished/marathi.txt index cfc34dcc4b..a79303bcbf 100644 --- a/src/lang/unfinished/marathi.txt +++ b/src/lang/unfinished/marathi.txt @@ -1330,6 +1330,8 @@ STR_PURCHASE_INFO_COST_SPEED :{BLACK}कि + + # Depot window STR_DEPOT_CAPTION :{WHITE}{DEPOT} diff --git a/src/lang/unfinished/persian.txt b/src/lang/unfinished/persian.txt index 763f267c6f..4d54b92cfd 100644 --- a/src/lang/unfinished/persian.txt +++ b/src/lang/unfinished/persian.txt @@ -2960,10 +2960,12 @@ STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_BUTTON :{BLACK}ساخت STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}خرید وسیله نقلیه STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}خرید هواپیما + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}خرید قطار مشخص شده. Shift+Click کنید تا قبل از خرید، مبلغ تقریبی آنرا نمایش دهد STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}خرید کشتی مشخص شده . Shift+Click کنید تا هزینه تقریبی نمایش داده شود STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}خرید هواپیمای مشخص شده. برای مشاهده هزینه تقریبی Shift+Click کنید + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}تغییر نام STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}تغییر نام STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}نام گذاری مجدد diff --git a/src/lang/unfinished/urdu.txt b/src/lang/unfinished/urdu.txt index 73e794ca7c..25bc51f680 100644 --- a/src/lang/unfinished/urdu.txt +++ b/src/lang/unfinished/urdu.txt @@ -2354,6 +2354,8 @@ STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}پہنچ + + STR_BUY_VEHICLE_TRAIN_HIDE_TOGGLE_BUTTON :{BLACK}چهپایں STR_BUY_VEHICLE_ROAD_VEHICLE_HIDE_TOGGLE_BUTTON :{BLACK}چهپایں STR_BUY_VEHICLE_SHIP_HIDE_TOGGLE_BUTTON :{BLACK}چهپایں diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt index 190541c7a1..652ae6ef3e 100644 --- a/src/lang/vietnamese.txt +++ b/src/lang/vietnamese.txt @@ -3458,11 +3458,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Mua P.Ti STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Mua tàu STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Mua Máy Bay + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Mua tàu hỏa đã ấn định. Shift+Click để xem giá mua dự tính STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Mua xe đã ấn định. Shift+Click để xem giá mua dự tính STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Mua tàu đã ấn định. Shift+Click để xem giá mua dự tính STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Mua máy bay đã ấn định. Shift+Click để xem giá mua dự tính + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Thay tên STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Thay tên STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Thay tên diff --git a/src/lang/welsh.txt b/src/lang/welsh.txt index e5e451d8b9..172f11f7a3 100644 --- a/src/lang/welsh.txt +++ b/src/lang/welsh.txt @@ -3399,11 +3399,13 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Prynu Ce STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Prynu Llong STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Prynu Awyren + STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Adeiladu'r cerbyd trên sydd wedi'i amlygu. Mae Shift+Clic yn dangos amcangyfrif o'r gost STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Adeiladu'r cerbyd ffordd sydd wedi'i amlygu. Mae Shift+Clic yn dangos amcangyfrif o'r gost STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Adeiladu'r llong sydd wedi'i hamlygu. Mae Shift+Clic yn dfangos amcangyfrif o'r gost STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Adeiladu'r awyren sydd wedi'i hamlygu. Mae Shift+Clic yn dangos amcangyfrif o'r gost + STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Ailenwi STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Ailenwi STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Ailenwi From 10f0c1e3cdd1f45dd3de5a12170ef870f27c2c32 Mon Sep 17 00:00:00 2001 From: translators Date: Mon, 25 Mar 2019 19:45:45 +0100 Subject: [PATCH 41/82] Update: Translations from eints finnish: 12 changes by hpiirai greek: 40 changes by Jubilee luxembourgish: 2 changes by Phreeze dutch: 12 changes by JanWillem french: 4 changes by romazoon norwegian (bokmal): 12 changes by Leifbk hungarian: 14 changes by Brumi portuguese: 51 changes by JayCity, 11 changes by vesgo --- src/lang/dutch.txt | 13 +++- src/lang/finnish.txt | 13 +++- src/lang/french.txt | 4 ++ src/lang/greek.txt | 44 ++++++++++++-- src/lang/hungarian.txt | 16 ++++- src/lang/luxembourgish.txt | 2 + src/lang/norwegian_bokmal.txt | 13 +++- src/lang/portuguese.txt | 110 +++++++++++++++++++--------------- 8 files changed, 158 insertions(+), 57 deletions(-) diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index 2886783ea6..ffb7e914d3 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -2939,7 +2939,7 @@ STR_SAVE_PRESET_SAVE_TOOLTIP :{BLACK}Sla de h STR_NEWGRF_PARAMETERS_CAPTION :{WHITE}NewGRF-parameters wijzigen STR_NEWGRF_PARAMETERS_CLOSE :{BLACK}Sluiten STR_NEWGRF_PARAMETERS_RESET :{BLACK}Terugstellen -STR_NEWGRF_PARAMETERS_RESET_TOOLTIP :{BLACK}Zet alle parameters naar de standaardwaarde +STR_NEWGRF_PARAMETERS_RESET_TOOLTIP :{BLACK}Stel alle parameters terug naar de standaardwaarde STR_NEWGRF_PARAMETERS_DEFAULT_NAME :Parameter {NUM} STR_NEWGRF_PARAMETERS_SETTING :{STRING}: {ORANGE}{STRING} STR_NEWGRF_PARAMETERS_NUM_PARAM :{LTBLUE}Aantal parameters: {ORANGE}{NUM} @@ -3469,6 +3469,7 @@ STR_BUY_VEHICLE_SHIP_CAPTION :Nieuwe schepen STR_BUY_VEHICLE_AIRCRAFT_CAPTION :Nieuwe vliegtuigen STR_PURCHASE_INFO_COST_WEIGHT :{BLACK}Kosten: {GOLD}{CURRENCY_LONG}{BLACK} Gewicht: {GOLD}{WEIGHT_SHORT} +STR_PURCHASE_INFO_COST_REFIT_WEIGHT :{BLACK}Kosten: {GOLD}{CURRENCY_LONG}{BLACK} (ombouwkosten: {GOLD}{CURRENCY_LONG}{BLACK}) Gewicht: {GOLD}{WEIGHT_SHORT} STR_PURCHASE_INFO_SPEED_POWER :{BLACK}Snelheid: {GOLD}{VELOCITY}{BLACK} Vermogen: {GOLD}{POWER} STR_PURCHASE_INFO_SPEED :{BLACK}Snelheid: {GOLD}{VELOCITY} STR_PURCHASE_INFO_SPEED_OCEAN :{BLACK}Snelheid op oceaan: {GOLD}{VELOCITY} @@ -3479,8 +3480,10 @@ STR_PURCHASE_INFO_REFITTABLE :(ombouwbaar) STR_PURCHASE_INFO_DESIGNED_LIFE :{BLACK}Ontworpen: {GOLD}{NUM}{BLACK} Levensduur: {GOLD}{COMMA} jaar STR_PURCHASE_INFO_RELIABILITY :{BLACK}Max. betrouwbaarheid: {GOLD}{COMMA}% STR_PURCHASE_INFO_COST :{BLACK}Kosten: {GOLD}{CURRENCY_LONG} +STR_PURCHASE_INFO_COST_REFIT :{BLACK}Kosten: {GOLD}{CURRENCY_LONG}{BLACK} (ombouwkosten: {GOLD}{CURRENCY_LONG}{BLACK}) STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Gewicht: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Kosten: {GOLD}{CURRENCY_LONG}{BLACK} Snelheid: {GOLD}{VELOCITY} +STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}Kosten: {GOLD}{CURRENCY_LONG}{BLACK} (ombouwkosten: {GOLD}{CURRENCY_LONG}{BLACK}) Snelheid: {GOLD}{VELOCITY} STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Capaciteit: {GOLD}{CARGO_LONG}, {CARGO_LONG} STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Aangedreven wagons: {GOLD}+{POWER}{BLACK} Gewicht: {GOLD}+{WEIGHT_SHORT} STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Om te bouwen naar: {GOLD}{STRING} @@ -3501,12 +3504,20 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Wegvoert STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Schip kopen STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Vliegtuig kopen +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Voertuig kopen en ombouwen +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Voertuig kopen en ombouwen +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Schip kopen en ombouwen +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Vliegtuig kopen en ombouwen STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Geselecteerd spoorvoertuig bouwen. Shift+klik geeft de verwachte kosten zonder te kopen. STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Koop het geselecteerde wegvoertuig. Shift+klik geeft de verwachte kosten zonder te kopen. STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Koop het geselecteerde schip. Shift+klik geeft de verwachte kosten zonder te kopen STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Koop het geselecteerde vliegtuig. Shift+klik geeft de verwachte kosten zonder te kopen. +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Koop de geselecteerde trein en bouw hem om. Shift+klik geeft de verwachte kosten zonder te kopen. +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Koop het geselecteerde wegvoertuig en bouw het om. Shift+klik geeft de geschatte kosten zonder te kopen. +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Koop het geselecteerde schip en bouw het om. Shift+klik geeft de verwachte kosten zonder te kopen. +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Koop het geselecteerde vliegtuig en bouw het om. Shift+klik geeft de verwachte kosten zonder te kopen. STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Hernoemen STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Hernoemen diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index 829e9b91bf..42e3fdb45b 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -137,7 +137,7 @@ STR_ABBREV_OIL :{TINY_FONT}ÖL STR_ABBREV_LIVESTOCK :{TINY_FONT}KA STR_ABBREV_GOODS :{TINY_FONT}TA STR_ABBREV_GRAIN :{TINY_FONT}VL -STR_ABBREV_WOOD :{TINY_FONT}PT +STR_ABBREV_WOOD :{TINY_FONT}PU STR_ABBREV_IRON_ORE :{TINY_FONT}RM STR_ABBREV_STEEL :{TINY_FONT}TR STR_ABBREV_VALUABLES :{TINY_FONT}AT @@ -3469,6 +3469,7 @@ STR_BUY_VEHICLE_SHIP_CAPTION :Uusia laivoja STR_BUY_VEHICLE_AIRCRAFT_CAPTION :Uusi lentokone STR_PURCHASE_INFO_COST_WEIGHT :{BLACK}Hinta: {GOLD}{CURRENCY_LONG}{BLACK} Paino: {GOLD}{WEIGHT_SHORT} +STR_PURCHASE_INFO_COST_REFIT_WEIGHT :{BLACK}Hinta: {GOLD}{CURRENCY_LONG}{BLACK} (Sovituskustannus: {GOLD}{CURRENCY_LONG}{BLACK}) Paino: {GOLD}{WEIGHT_SHORT} STR_PURCHASE_INFO_SPEED_POWER :{BLACK}Nopeus: {GOLD}{VELOCITY}{BLACK} Teho: {GOLD}{POWER} STR_PURCHASE_INFO_SPEED :{BLACK}Nopeus: {GOLD}{VELOCITY} STR_PURCHASE_INFO_SPEED_OCEAN :{BLACK}Nopeus merellä: {GOLD}{VELOCITY} @@ -3479,8 +3480,10 @@ STR_PURCHASE_INFO_REFITTABLE :(sovitettava) STR_PURCHASE_INFO_DESIGNED_LIFE :{BLACK}Suunniteltu: {GOLD}{NUM}{BLACK} Elinikä: {GOLD}{COMMA} vuo{P si tta} STR_PURCHASE_INFO_RELIABILITY :{BLACK}Enimmäisluotettavuus: {GOLD}{COMMA}{NBSP}% STR_PURCHASE_INFO_COST :{BLACK}Hinta: {GOLD}{CURRENCY_LONG} +STR_PURCHASE_INFO_COST_REFIT :{BLACK}Hinta: {GOLD}{CURRENCY_LONG}{BLACK} (Sovituskustannus: {GOLD}{CURRENCY_LONG}{BLACK}) STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Paino: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Hinta: {GOLD}{CURRENCY_LONG}{BLACK} Nopeus: {GOLD}{VELOCITY} +STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}Hinta: {GOLD}{CURRENCY_LONG}{BLACK} (Sovituskustannus: {GOLD}{CURRENCY_LONG}{BLACK}) Nopeus: {GOLD}{VELOCITY} STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Kapasiteetti: {GOLD}{CARGO_LONG}, {CARGO_LONG} STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Moottoroidut vaunut: {GOLD}+{POWER}{BLACK} Paino: {GOLD}+{WEIGHT_SHORT} STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Sovitettavissa: {GOLD}{STRING} @@ -3501,12 +3504,20 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Osta ajo STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Osta laiva STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Osta lentokone +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Osta ja sovita yksikkö +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Osta ja sovita ajoneuvo +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Osta ja sovita laiva +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Osta ja sovita lentokone STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Osta valittu yksikkö. Shift+Klik näyttää kustannusarvion ostamatta STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Osta valittu ajoneuvo. Shift+Klik näyttää kustannusarvion ostamatta STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Osta valittu laiva. Shift+Klik näyttää kustannusarvion ostamatta STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Osta korostettu lentokone. Shift+Klik näyttää kustannusarvion ostamatta +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Osta ja sovita valittu yksikkö. Shift+Klik näyttää kustannusarvion ostamatta +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Osta ja sovita valittu ajoneuvo. Shift+Klik näyttää kustannusarvion ostamatta +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Osta ja sovita valittu laiva. Shift+Klik näyttää kustannusarvion ostamatta +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Osta ja sovita valittu lentokone. Shift+Klik näyttää kustannusarvion ostamatta STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Nimeä STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Nimeä diff --git a/src/lang/french.txt b/src/lang/french.txt index e1387329ff..aa70db7716 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -1185,6 +1185,7 @@ STR_CONFIG_SETTING_AUTOSLOPE :Terrassement so STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :Autoriser le terrassement sous les bâtiments et les voies sans les retirer STR_CONFIG_SETTING_CATCHMENT :Autoriser des zones de desserte plus réalistes{NBSP}: {STRING} STR_CONFIG_SETTING_CATCHMENT_HELPTEXT :Les zones de desserte ont des tailles différentes selon les types de stations et d'aéroports +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES_HELPTEXT :Si activé, les industries avec une station intégré (comme les plateformes pétrolière) peuvent aussi être servi par les stations des compagnies construites à proximité. Si désactivé, ces industries peuvent uniquement être servi par leur station intégré. Aucune station de compagnie ne pourra servir cette industrie, et la station intégré ne pourra servir que pour cette industrie. STR_CONFIG_SETTING_EXTRADYNAMITE :Permettre le retrait de plus d'éléments possédés par une ville{NBSP}: {STRING} STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT :Simplifier le retrait d'éléments possédés par une ville STR_CONFIG_SETTING_TRAIN_LENGTH :Longueur maximum des trains{NBSP}: {STRING} @@ -3495,12 +3496,15 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Acheter STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Acheter STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Acheter +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON :Achat et réaménagement du véhicule +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :Acheter et réaménager le bateau STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Acheter le véhicule sélectionné.{}Shift-clic pour afficher seulement le coût estimé. STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Acheter le véhicule sélectionné.{}Shift-clic pour afficher seulement le coût estimé. STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Acheter le navire sélectionné.{}Shift-clic pour afficher seulement le coût estimé. STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Acheter l'aéronef sélectionné.{}Shift-clic pour afficher seulement le coût estimé. +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :Acheter et réaménager le véhicule ferroviaire sélectionné. Shift+Click montre une estimation du coût sans acheter le véhicule. STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Renommer STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Renommer diff --git a/src/lang/greek.txt b/src/lang/greek.txt index 5c07295585..17d726877c 100644 --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -923,6 +923,7 @@ STR_NEWS_MERGER_TAKEOVER_TITLE :{BIG_FONT}{BLAC STR_PRESIDENT_NAME_MANAGER :{BLACK}{PRESIDENT_NAME}{}({G 0 Διευθυντής Διευθύντρια ""}) STR_NEWS_NEW_TOWN :{BLACK}{BIG_FONT}Η {STRING} χορήγεισε την κατασκεύη της νέας πόλης {TOWN}! +STR_NEWS_NEW_TOWN_UNSPONSORED :{BLACK}{BIG_FONT}Μια νέα πόλη με όνομα {TOWN} κατασκευάστηκε! STR_NEWS_INDUSTRY_CONSTRUCTION :{BIG_FONT}{BLACK}Νέ{G ος α ο} {STRING} υπό κατασκευή κοντά στην πόλη {TOWN}! STR_NEWS_INDUSTRY_PLANTED :{BIG_FONT}{BLACK}Νέο {STRING} φυτεύεται κοντά στην πόλη {TOWN}! @@ -1099,7 +1100,11 @@ STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Κανονικ STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Διπλό μέγεθος STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Τετραπλό μέγεθος +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Επιλέξτε το μέγεθος της γραμματοσειράς διεπαφής +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Κανονικό +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Διπλό μέγεθος +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Τετραπλό μέγεθος STR_GAME_OPTIONS_BASE_GRF :{BLACK}Βασικό σετ γραφικών STR_GAME_OPTIONS_BASE_GRF_TOOLTIP :{BLACK}Επιλογή του βασικού σετ γραφικών που θα χρησιμοποιηθεί @@ -1368,6 +1373,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Δεν STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Συντήρηση υποδομής: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Όταν είναι ενεργοποιημένη, οι υποδομές προκαλούν έξοδα συντήρησης. Το κόστος μεγαλώνει δυσανάλογα με το μέγεθος του δικτύου, επηρεάζοντας έτσι τις μεγάλες εταιρείες περισσότερο από τις μικρότερες +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR :Αρχικό χρώμα εταιρίας: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Τα αεροδρόμια δεν λήγουν ποτέ: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Ενεργοποιώντας αυτήν τη ρύθμιση κάθε τύπος αεροδρομίου παραμένει διαθέσιμο για πάντα μετά την παρουσίασή του @@ -1680,6 +1686,7 @@ STR_CONFIG_SETTING_TOWN_FOUNDING_HELPTEXT :Ενεργοπ STR_CONFIG_SETTING_TOWN_FOUNDING_FORBIDDEN :Δεν επιτρέπεται STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED :Επιτρέπεται STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED_CUSTOM_LAYOUT :Επιτρέπεται, προσαρμοσμένο σχέδιο πόλης +STR_CONFIG_SETTING_TOWN_CARGOGENMODE :Δημιουργία εμπορευμάτων πόλης: {STRING} STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT :Τοποθέτηση δέντρων εντός παιχνιδιού: {STRING} STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_HELPTEXT :Έλεγχος της τυχαίας εμφάνισης δέντρων κατά τη διάρκεια του παιχνιδιού. Αυτό είναι πιθανό να επηρεάσει βιομηχανίες που εξαρτώνται από την ανάπτυξη των δέντρων, όπως για παράδειγμα οι υλοτομίες @@ -2807,7 +2814,9 @@ STR_ABOUT_COPYRIGHT_OPENTTD :{BLACK}OpenTTD # Framerate display window STR_FRAMERATE_CAPTION_SMALL :{STRING}{WHITE} ({DECIMAL}x) +STR_FRAMERATE_RATE_GAMELOOP :{BLACK}Ρυθμός προσομοίωσης: {STRING} STR_FRAMERATE_RATE_GAMELOOP_TOOLTIP :{BLACK}Αριθμός στιγμών παιχνιδιού που προσομοιώνεται ανά δευτερόλεπτο. +STR_FRAMERATE_RATE_BLITTER :{BLACK}Ρυθμός καρέ γραφικών: {STRING} STR_FRAMERATE_RATE_BLITTER_TOOLTIP :{BLACK}Αριθμος των παραγμενων video frames ανα δευτερολεπτο STR_FRAMERATE_SPEED_FACTOR :{WHITE}Παράγοντας ταχύτητας τρέχοντος παιχνιδιού: {DECIMAL}x STR_FRAMERATE_SPEED_FACTOR_TOOLTIP :{BLACK}Πόσο γρήγορα εκτελείται το παιχνίδι αυτήν τη στιγμή, σε σύγκριση με την αναμενόμενη ταχύτητα στον κανονικό ρυθμό εξομοίωσης. @@ -2818,6 +2827,7 @@ STR_FRAMERATE_MS_GOOD :{LTBLUE}{DECIMA STR_FRAMERATE_MS_BAD :{RED}{DECIMAL} ms STR_FRAMERATE_FPS_GOOD :{LTBLUE}{DECIMAL} frames/δευτ. STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL} frames/δευτ. +STR_FRAMERATE_GRAPH_SECONDS :{TINY_FONT}{COMMA} ς ############ Leave those lines in this order!! STR_FRAMERATE_GL_ECONOMY :{WHITE} Διαχείριση φορτίου: STR_FRAMERATE_GL_TRAINS :Στιγμές τρένων: @@ -2825,10 +2835,15 @@ STR_FRAMERATE_GL_ROADVEHS :{WHITE} Στι STR_FRAMERATE_GL_SHIPS :Στιγμές πλοίων: STR_FRAMERATE_GL_AIRCRAFT :Στιγμές αεροσκαφών: STR_FRAMERATE_GL_LANDSCAPE :Στιγμές κόσμου: +STR_FRAMERATE_DRAWING :{BLACK}Γραφική απόδοση: +STR_FRAMERATE_DRAWING_VIEWPORTS :Παράθυρα προβολής κόσμου: STR_FRAMERATE_VIDEO :{WHITE}Έξοδος βίντεο: STR_FRAMERATE_SOUND :{WHITE}Μίξη ήχου: +STR_FRAMERATE_ALLSCRIPTS :Σύνολο GS/AI: +STR_FRAMERATE_AI :{BLACK} AI {NUM} {STRING} ############ End of leave-in-this-order ############ Leave those lines in this order!! +STR_FRAMETIME_CAPTION_GAMELOOP :Βρόγχος παιχνιδιού STR_FRAMETIME_CAPTION_GL_ECONOMY :Διαχείριση φορτίου STR_FRAMETIME_CAPTION_GL_TRAINS :Στιγμές τρένων STR_FRAMETIME_CAPTION_GL_ROADVEHS :Στιγμές οχημάτων δρόμου @@ -2836,8 +2851,12 @@ STR_FRAMETIME_CAPTION_GL_SHIPS :Στιγμές STR_FRAMETIME_CAPTION_GL_AIRCRAFT :Στιγμές αεροσκαφών STR_FRAMETIME_CAPTION_GL_LANDSCAPE :Στιγμές κόσμου STR_FRAMETIME_CAPTION_GL_LINKGRAPH :Καθυστέρηση γραφήματος συνδέσμου +STR_FRAMETIME_CAPTION_DRAWING :Γραφική απόδοση +STR_FRAMETIME_CAPTION_DRAWING_VIEWPORTS :Παράθυρα προβολής κόσμου STR_FRAMETIME_CAPTION_VIDEO :Έξοδος βίντεο STR_FRAMETIME_CAPTION_SOUND :Μίξη ήχου +STR_FRAMETIME_CAPTION_ALLSCRIPTS :Σύνολο GS/AI δεσμών ενεργειών +STR_FRAMETIME_CAPTION_GAMESCRIPT :Δέσμη Ενεργειών παιχνιδιού ############ End of leave-in-this-order @@ -2863,6 +2882,7 @@ STR_SAVELOAD_DETAIL_CAPTION :{BLACK}Λεπτ STR_SAVELOAD_DETAIL_NOT_AVAILABLE :{BLACK}Δεν υπάρχουν πληροφορίες. STR_SAVELOAD_DETAIL_COMPANY_INDEX :{SILVER}{COMMA}: {WHITE}{STRING} STR_SAVELOAD_DETAIL_GRFSTATUS :{SILVER}NewGRF: {WHITE}{STRING} +STR_SAVELOAD_FILTER_TITLE :Φιλτράρισμα κειμένου: STR_SAVELOAD_OVERWRITE_TITLE :{WHITE}Αντικατάσταση Αρχείου STR_SAVELOAD_OVERWRITE_WARNING :{YELLOW}Είστε σίγουροι οτι θέλετε να αντικαταστήσετε το υπάρχων αρχείο; @@ -2983,6 +3003,8 @@ STR_NEWGRF_SETTINGS_MIN_VERSION :{BLACK}Ελάχ STR_NEWGRF_SETTINGS_MD5SUM :{BLACK}MD5sum: {SILVER}{STRING} STR_NEWGRF_SETTINGS_PALETTE :{BLACK}Παλέτα: {SILVER}{STRING} STR_NEWGRF_SETTINGS_PALETTE_DEFAULT :Προεπιλογή (D) +STR_NEWGRF_SETTINGS_PALETTE_DEFAULT_32BPP :Προεπιλογή (D) / 32 bpp +STR_NEWGRF_SETTINGS_PALETTE_LEGACY :Παλαιού τύπου (W) STR_NEWGRF_SETTINGS_PARAMETER :{BLACK}Παράμετροι: {SILVER}{STRING} STR_NEWGRF_SETTINGS_PARAMETER_NONE :Κανένα @@ -3065,6 +3087,7 @@ STR_NEWGRF_ERROR_READ_BOUNDS :Διάβασε STR_NEWGRF_ERROR_GRM_FAILED :Οι ζητημένοι πόροι GRF δεν είναι διαθέσιμοι (sprite {3:NUM}) STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :Το {1:STRING} απενεργοποιήθηκε από το {2:STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Άκυρη/άγνωστη μορφή σχεδίου sprite (sprite {3:NUM}) +STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Πάρα πολλά αντικέιμενα στη λίστα τιμών ιδιοτήτων (sprite {3:NUM}, ιδιότητα {4:HEX}) # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Προσοχή! @@ -3190,6 +3213,7 @@ STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Δωρ # Goal window STR_GOALS_CAPTION :{WHITE}{COMPANY} Στόχοι: STR_GOALS_SPECTATOR_CAPTION :{WHITE}Καθολικοί στόχοι: +STR_GOALS_SPECTATOR :Καθολικοί στόχοι STR_GOALS_GLOBAL_TITLE :{BLACK}Καθολικοί στόχοι: STR_GOALS_TEXT :{ORANGE}{STRING} STR_GOALS_NONE :{ORANGE}- Κανένας - @@ -3238,6 +3262,7 @@ STR_SUBSIDIES_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Πατή # Story book window STR_STORY_BOOK_CAPTION :{WHITE}{COMPANY} Βιβλίο Ιστορίας STR_STORY_BOOK_SPECTATOR_CAPTION :{WHITE}Παγκόσμιο Βιβλίο Ιστορίας +STR_STORY_BOOK_SPECTATOR :Παγκόσμιο Βιβλίο Ιστορίας STR_STORY_BOOK_TITLE :{YELLOW}{STRING} STR_STORY_BOOK_GENERIC_PAGE_ITEM :Σελίδα {NUM} STR_STORY_BOOK_SEL_PAGE_TOOLTIP :{BLACK}Μεταβείτε σε μια συγκεκριμένη σελίδα επιλέγοντάς την από αυτή τη λίστα. @@ -3442,6 +3467,8 @@ STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Κεντ STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Επίπεδο παραγωγής: {YELLOW}{COMMA}% STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Η βιομηχανία έχει ανακοινώσει άμεσο κλείσιμο! +STR_INDUSTRY_VIEW_REQUIRES_N_CARGO :{BLACK}Απαιτεί: {YELLOW}{STRING}{STRING} +STR_INDUSTRY_VIEW_PRODUCES_N_CARGO :{BLACK}Παράγει: {YELLOW}{STRING}{STRING} STR_INDUSTRY_VIEW_CARGO_LIST_EXTENSION :, {STRING}{STRING} STR_INDUSTRY_VIEW_REQUIRES :{BLACK}Απαιτεί: @@ -3539,6 +3566,7 @@ STR_PURCHASE_INFO_RELIABILITY :{BLACK}Μέγ. STR_PURCHASE_INFO_COST :{BLACK}Κόστος: {GOLD}{CURRENCY_LONG} STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Βάρος: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Κόστος: {GOLD}{CURRENCY_LONG}{BLACK} Ταχύτητα: {GOLD}{VELOCITY} +STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}Κόστος: {GOLD}{CURRENCY_LONG}{BLACK} (Κόστος μετατροπής: {GOLD}{CURRENCY_LONG}{BLACK}) Ταχύτητα: {GOLD}{VELOCITY} STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Χωρητικότητα: {GOLD}{CARGO_LONG}, {CARGO_LONG} STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Ενισχυμένα Βαγόνια: {GOLD}+{POWER}{BLACK} Βάρος: {GOLD}+{WEIGHT_SHORT} STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Μετατρέψιμο σε: {GOLD}{STRING} @@ -3558,12 +3586,19 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Αγορ STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Αγορά Πλοίου STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Αγορά Αεροσκάφους +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Αγορά και μετατροπή οχήματος +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Αγορά και μετατροπή οχήματος +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Αγορά και μετατροπή πλοίου -STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Αγοράστε το επιλεγμένο όχημα τρένου. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά -STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Αγοράστε το επιλεγμένο όχημα δρόμου. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά +STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Αγορά του επιλεγμένου οχήματος τρένου. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Αγορά του επιλεγμένου οχήματος δρόμου. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Αγοράστε το επιλεγμένο πλοίο. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά -STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Αγοράστε το επιλεγμένο αεροσκάφος. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά +STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Αγορά του επιλεγμένου αεροσκάφους. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Αγορά και μετατροπή του επιλεγμένου οχήματος τρένου. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Αγορά και μετατροπή του επιλεγμένου οχήματος δρόμου. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Αγορά και μετατροπή του επιλεγμένου πλοίου. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Αγορά και μετατροπή του επιλεγμένου αεροσκάφους. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Μετονομασία STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Μετονομασία @@ -3645,7 +3680,7 @@ STR_DEPOT_CLONE_AIRCRAFT :{BLACK}Κλων STR_DEPOT_CLONE_TRAIN_DEPOT_INFO :{BLACK}Αυτό θα αγοράσει ένα αντίγραφο του τρένου μαζί με τα όλα τα βαγόνια. Πατήστε αυτό το κουμπί και μετά σε κάποιο τρένο μέσα ή έξω από το αμαξοστάσιο. Με Ctrl+Κλικ θα έχει τις ίδιες εντολές. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς να γίνει η αγορά STR_DEPOT_CLONE_ROAD_VEHICLE_DEPOT_INFO :{BLACK}Αυτό θα αγοράσει ένα αντίγραφο του οχήματος. Πατήστε αυτό το κουμπί και μετά σε κάποιο όχημα μέσα ή έξω από το αμαξοστάσιο. Με Ctrl+Κλικ θα έχει τις ίδιες εντολές. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς να γίνει η αγορά -STR_DEPOT_CLONE_SHIP_DEPOT_INFO :{BLACK}Αυτό θα αγοράσει ένα αντίγραφο του πλοίου. Πατήστε αυτό το κουμπί και μετά σε κάποιο πλοίο μέσα ή έξω από το ναυπηγείο. Με Ctrl+Κλικ θα έχει τις ίδιες εντολές. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς να γίνει η αγορά +STR_DEPOT_CLONE_SHIP_DEPOT_INFO :{BLACK}Αυτό θα αγοράσει ένα αντίγραφο ενός πλοίου. Πατήστε αυτό το κουμπί και μετά σε κάποιο πλοίο μέσα ή έξω από το ναυπηγείο. Με Ctrl+Κλικ θα έχει τις ίδιες εντολές. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς να γίνει η αγορά STR_DEPOT_CLONE_AIRCRAFT_INFO_HANGAR_WINDOW :{BLACK}Αυτό θα αγοράσει ένα αντίγραφο του αεροσκάφους. Πατήστε αυτό το κουμπί και μετά σε κάποιο αεροσκάφος μέσα στο ή έξω από το υπόστεγο. Με Ctrl+Κλικ θα έχει τις ίδιες εντολές. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς να γίνει η αγορά STR_DEPOT_TRAIN_LOCATION_TOOLTIP :{BLACK}Κεντράρισμα της εικόνας στην τοποθεσία του αμαξοστάσιου. Με Ctrl+Κλικ ανοίγει νέο παράθυρο εμφάνισης στην τοποθεσία του αμαξοστασίου @@ -3950,6 +3985,7 @@ STR_ORDER_CONDITIONAL_AGE :{G=f}Ηλικί STR_ORDER_CONDITIONAL_REQUIRES_SERVICE :Απαιτεί επισκευή STR_ORDER_CONDITIONAL_UNCONDITIONALLY :Πάντα STR_ORDER_CONDITIONAL_REMAINING_LIFETIME :Υπόλοιπη διάρκεια ζωής (χρόνια) +STR_ORDER_CONDITIONAL_MAX_RELIABILITY :Μέγιστη αξιοπιστία STR_ORDER_CONDITIONAL_COMPARATOR_TOOLTIP :{BLACK}Πως να συγκρίνετε τα δεδομένα του οχήματος με την δοσμένη τιμή STR_ORDER_CONDITIONAL_COMPARATOR_EQUALS :είναι ίσο με diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index 8268a8ab95..ad4f8f7017 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -2203,7 +2203,7 @@ STR_NETWORK_CHAT_ALL :[Mindenkinek] { STR_NETWORK_CHAT_OSKTITLE :{BLACK}Add meg a hálózati beszélgetéshez a neved # Network messages -STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Nem található a hálózati csatoló, vagy a játékban nincs hálózati támogatás (ENABLE_NETWORK) +STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Nem található a hálózati csatoló STR_NETWORK_ERROR_NOSERVER :{WHITE}Nem található semmilyen hálózati játék STR_NETWORK_ERROR_NOCONNECTION :{WHITE}A szerver nem válaszolt a kérésre STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}NewGRF eltérés miatt nem sikerült kapcsolódni @@ -3096,6 +3096,7 @@ STR_NEWGRF_BUGGY :{WHITE}A(z) '{0 STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}A(z) '{1:ENGINE}' rakomány/átalakítás információja a gyártás után különbözik a vételi listán találhatótól. Ez hibát okozhat az automatikus felújítás/lecserélés során az átalakításban STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' végtelen ciklust okozott a termelés folyamatnál STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}{1:HEX} visszatérő érték ismeretlen/érvénytelen {2:HEX} értékkel tért vissza +STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' érvénytelen rakománytípussal tért vissza a termelési callback-ben: {2:HEX} # 'User removed essential NewGRFs'-placeholders for stuff without specs STR_NEWGRF_INVALID_CARGO :<érvénytelen rakomány> @@ -3532,6 +3533,7 @@ STR_BUY_VEHICLE_SHIP_CAPTION :Új hajók STR_BUY_VEHICLE_AIRCRAFT_CAPTION :Új repülőgépek STR_PURCHASE_INFO_COST_WEIGHT :{BLACK}Ár: {GOLD}{CURRENCY_LONG}{BLACK} Súly: {GOLD}{WEIGHT_SHORT} +STR_PURCHASE_INFO_COST_REFIT_WEIGHT :{BLACK}Ár: {GOLD}{CURRENCY_LONG}{BLACK} (Átalakítás költsége: {GOLD}{CURRENCY_LONG}{BLACK}) Súly: {GOLD}{WEIGHT_SHORT} STR_PURCHASE_INFO_SPEED_POWER :{BLACK}Sebesség: {GOLD}{VELOCITY}{BLACK} Telj.: {GOLD}{POWER} STR_PURCHASE_INFO_SPEED :{BLACK}Sebesség: {GOLD}{VELOCITY} STR_PURCHASE_INFO_SPEED_OCEAN :{BLACK}Sebesség óceánon: {GOLD}{VELOCITY} @@ -3542,12 +3544,14 @@ STR_PURCHASE_INFO_REFITTABLE :(átalakíthat STR_PURCHASE_INFO_DESIGNED_LIFE :{BLACK}Kifejlesztve: {GOLD}{NUM}{BLACK} Élettartam: {GOLD}{COMMA} év STR_PURCHASE_INFO_RELIABILITY :{BLACK}Max. megbízhatóság: {GOLD}{COMMA}% STR_PURCHASE_INFO_COST :{BLACK}Ár: {GOLD}{CURRENCY_LONG} +STR_PURCHASE_INFO_COST_REFIT :{BLACK}Ár: {GOLD}{CURRENCY_LONG}{BLACK} (Átalakítás költsége: {GOLD}{CURRENCY_LONG}{BLACK}) STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Súly: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Ár: {GOLD}{CURRENCY_LONG}{BLACK} Sebesség: {GOLD}{VELOCITY} +STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}Ár: {GOLD}{CURRENCY_LONG}{BLACK} (Átalakítás költsége: {GOLD}{CURRENCY_LONG}{BLACK}) Végsebesség: {GOLD}{VELOCITY} STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Kapacitás: {GOLD}{CARGO_LONG}, {CARGO_LONG} STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Meghajtott vagonok: {GOLD}+{POWER}{BLACK} Súly: {GOLD}+{WEIGHT_SHORT} STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Átalakítható: {GOLD}{STRING} -STR_PURCHASE_INFO_ALL_TYPES :Minden rakomány típusra +STR_PURCHASE_INFO_ALL_TYPES :Minden rakománytípusra STR_PURCHASE_INFO_NONE :Semmi STR_PURCHASE_INFO_ALL_BUT :Mindenre, kivéve {CARGO_LIST} STR_PURCHASE_INFO_MAX_TE :{BLACK}Maximális vonóerő: {GOLD}{FORCE} @@ -3564,12 +3568,20 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Megvesz STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Megvesz STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Megvesz +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Megvesz és átalakít +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Megvesz és átalakít +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Megvesz és átalakít +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Megvesz és átalakít STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}A kijelölt vasúti jármű megvétele. Shift+kattintással megmutatja a becsült költséget vásárlás nélkül STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}A kijelölt közúti jármű megvétele. Shift+kattintással megmutatja a becsült költséget vásárlás nélkül STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}A kijelölt hajó megvétele. Shift+kattintással megmutatja a becsült költséget vásárlás nélkül STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}A kijelölt repülőgép megvétele. Shift+kattintással megmutatja a becsült költséget vásárlás nélkül +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}A kijelölt vasúti jármű megvétele és átalakítása a kijelölt rakománytípusra. Shift+kattintással megmutatja a becsült költséget vásárlás nélkül +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}A kijelölt közúti jármű megvétele és átalakítása a kijelölt rakománytípusra. Shift+kattintással megmutatja a becsült költséget vásárlás nélkül +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}A kijelölt hajó megvétele és átalakítása a kijelölt rakománytípusra. Shift+kattintással megmutatja a becsült költséget vásárlás nélkül +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}A kijelölt repülőgép megvétele és átalakítása a kijelölt rakománytípusra. Shift+kattintással megmutatja a becsült költséget vásárlás nélkül STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Átnevez STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Átnevez diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt index 2ef5814f8c..4c285de396 100644 --- a/src/lang/luxembourgish.txt +++ b/src/lang/luxembourgish.txt @@ -2704,6 +2704,7 @@ STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL} STR_FRAMERATE_GRAPH_SECONDS :{TINY_FONT}{COMMA} s ############ Leave those lines in this order!! STR_FRAMERATE_GL_ROADVEHS :{BLACK} Stroossegefierer Ticken: +STR_FRAMERATE_GL_LINKGRAPH :{BLACK} Linkgrafik-Verzögerung: STR_FRAMERATE_DRAWING :{BLACK}Graphikrendering: STR_FRAMERATE_VIDEO :{BLACK}Video-output: ############ End of leave-in-this-order @@ -3396,6 +3397,7 @@ STR_BUY_VEHICLE_SHIP_CAPTION :Nei Schëffer STR_BUY_VEHICLE_AIRCRAFT_CAPTION :Neie Fliger STR_PURCHASE_INFO_COST_WEIGHT :{BLACK}Käschten: {GOLD}{CURRENCY_LONG}{BLACK} Gewiicht: {GOLD}{WEIGHT_SHORT} +STR_PURCHASE_INFO_COST_REFIT_WEIGHT :{BLACK}Käschten: {GOLD}{CURRENCY_LONG}{BLACK} (Embaukäschten: {GOLD}{CURRENCY_LONG}{BLACK}) Gewiicht: {GOLD}{WEIGHT_SHORT} STR_PURCHASE_INFO_SPEED_POWER :{BLACK}Geschw.: {GOLD}{VELOCITY}{BLACK} Kraaft: {GOLD}{POWER} STR_PURCHASE_INFO_SPEED :{BLACK}Geschw.: {GOLD}{VELOCITY} STR_PURCHASE_INFO_SPEED_OCEAN :{BLACK}Geschwindegkeet um Ozean: {GOLD}{VELOCITY} diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt index 54a4766de5..dd824edef8 100644 --- a/src/lang/norwegian_bokmal.txt +++ b/src/lang/norwegian_bokmal.txt @@ -2143,7 +2143,7 @@ STR_NETWORK_CHAT_ALL :[Alle] {STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Skriv inn tekst for nettverkssamtale # Network messages -STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Ingen nettverksadaptere funnet eller kompilert uten ENABLE_NETWORK +STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Ingen nettverksadapter funnet STR_NETWORK_ERROR_NOSERVER :{WHITE}Kunne ikke finne noen nettverksspill STR_NETWORK_ERROR_NOCONNECTION :{WHITE}Tjeneren svarte ikke på forespørselen STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Kunne ikke koble til pga. ulike versjoner av NewGRF @@ -3473,6 +3473,7 @@ STR_BUY_VEHICLE_SHIP_CAPTION :Nye skip STR_BUY_VEHICLE_AIRCRAFT_CAPTION :Nye luftfartøy STR_PURCHASE_INFO_COST_WEIGHT :{BLACK}Kostnad: {GOLD}{CURRENCY_LONG}{BLACK} Vekt: {GOLD}{WEIGHT_SHORT} +STR_PURCHASE_INFO_COST_REFIT_WEIGHT :{BLACK}Kostnad: {GOLD}{CURRENCY_LONG}{BLACK} (Ombyggingskostnad: {GOLD}{CURRENCY_LONG}{BLACK}) Vekt: {GOLD}{WEIGHT_SHORT} STR_PURCHASE_INFO_SPEED_POWER :{BLACK}Hastighet: {GOLD}{VELOCITY}{BLACK} Kraft: {GOLD}{POWER} STR_PURCHASE_INFO_SPEED :{BLACK}Hastighet: {GOLD}{VELOCITY} STR_PURCHASE_INFO_SPEED_OCEAN :{BLACK}Hastighet på havet: {GOLD}{VELOCITY} @@ -3483,8 +3484,10 @@ STR_PURCHASE_INFO_REFITTABLE :(ombyggbart) STR_PURCHASE_INFO_DESIGNED_LIFE :{BLACK}Designet: {GOLD}{NUM}{BLACK} Levetid: {GOLD}{COMMA} år STR_PURCHASE_INFO_RELIABILITY :{BLACK}Maks pålitelighet: {GOLD}{COMMA}{NBSP}% STR_PURCHASE_INFO_COST :{BLACK}Kostnad: {GOLD}{CURRENCY_LONG} +STR_PURCHASE_INFO_COST_REFIT :{BLACK}Kostnad: {GOLD}{CURRENCY_LONG}{BLACK} (Ombyggingskostnad: {GOLD}{CURRENCY_LONG}{BLACK}) STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Vekt: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Kostnad: {GOLD}{CURRENCY_LONG}{BLACK} Hastighet: {GOLD}{VELOCITY} +STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}Kostnad: {GOLD}{CURRENCY_LONG}{BLACK} (Ombyggingskostnad: {GOLD}{CURRENCY_LONG}{BLACK}) Hastighet: {GOLD}{VELOCITY} STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Kapasitet: {GOLD}{CARGO_LONG}, {CARGO_LONG} STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Lokomotivvogner: {GOLD}+{POWER}{BLACK} Vekt: {GOLD}+{WEIGHT_SHORT} STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Kan bygges om til: {GOLD}{STRING} @@ -3505,12 +3508,20 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Kjøp kj STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Kjøp skip STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Kjøp luftfartøy +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Kjøp og bygg om kjøretøy +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Kjøp og bygg om kjøretøy +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Kjøp og bygg om skip +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Kjøp og bygg om luftfartøy STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Kjøp det merkede tog/vogn. Shift+klikk viser estimert kostnad STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Kjøp det merkede kjøretøy. Shift+klikk viser estimert kostnad STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Kjøp det merkede skip. Shift+klikk viser estimert kostnad STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Kjøp det merkede luftfartøy. Shift+klikk viser estimert kostnad +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Kjøp og bygg om merket tog/vogn. Shift+klikk viser anslått kostnad uten å kjøpe. +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Kjøp og bygg om det merkede kjøretøyet. Shift+klikk viser anslått kostnad uten å kjøpe. +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Kjøp og bygg om det merkede skipet. Shift+klikk viser anslått kostnad uten å kjøpe. +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Kjøp og bygg om det merkede luftfartøyet. Shift+klikk viser anslått kostnad uten å kjøpe. STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Endre navn STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Endre navn diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index e44f53f1ef..2a423497b0 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -1186,7 +1186,7 @@ STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :Permite altera STR_CONFIG_SETTING_CATCHMENT :Dimensionamento mais realista de áreas de abrangência: {STRING} STR_CONFIG_SETTING_CATCHMENT_HELPTEXT :Haver diferentes áreas de cobertura para diferentes tipos de estações e aeroportos STR_CONFIG_SETTING_EXTRADYNAMITE :Permite remover mais estradas, pontes e túneis detidos pela cidade: {STRING} -STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT :Facilitar a remoçar de edifícios e infraestruturas detidas pela cidade +STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT :Facilitar a remoçar de edifícios e infraestruturas detidas pela localidade STR_CONFIG_SETTING_TRAIN_LENGTH :Tamanho máximo de comboios: {STRING} STR_CONFIG_SETTING_TRAIN_LENGTH_HELPTEXT :Assignar o tamanho máximo dos comboios STR_CONFIG_SETTING_TILE_LENGTH :{COMMA} quadrado{P 0 "" s} @@ -1201,7 +1201,7 @@ STR_CONFIG_SETTING_TRAIN_SLOPE_STEEPNESS_HELPTEXT :Ângulo de incl STR_CONFIG_SETTING_PERCENTAGE :{COMMA}% STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS :Ângulo de inclínação para veículos rodoviários: {STRING} STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS_HELPTEXT :Declive de um quadrado inclinado para um veiculo de estrada. Valores mais altos tornam mais difícil de subir. -STR_CONFIG_SETTING_FORBID_90_DEG :Proibir comboios e barcos fazer curvas de 90º: {STRING} +STR_CONFIG_SETTING_FORBID_90_DEG :Proibir comboios fazer curvas de 90º: {STRING} STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT :Curvas de 90 graus ocorrem quando uma pista horizontal é directamente seguida por outra vertical num quadrado adjacente, fazendo com que o combóio vire 90 graus quando atravessa a fronteira dos quadrados, ao invés dos habituais 45 graus para outras combinações de pistas. Também se aplica ao raio de curvatura dos navios STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS :Permitir juntar estações não adjacentes: {STRING} STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS_HELPTEXT :Permite adicionar novas partes a uma estação sem tocar nas partes já existentes. Requer pressionar CTRL+click para adicionar as novas partes @@ -1220,8 +1220,8 @@ STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NORMAL :Como as outras STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_PROSPECTING :Prospecção STR_CONFIG_SETTING_INDUSTRY_PLATFORM :Área plana à volta das industrias: {STRING} STR_CONFIG_SETTING_INDUSTRY_PLATFORM_HELPTEXT :Quantidade de terreno plano á volta de uma industria. Isto garante que terreno vazio esteja disponível para construir linhas, etc -STR_CONFIG_SETTING_MULTIPINDTOWN :Permitir várias indústrias semelhantes por cidade: {STRING} -STR_CONFIG_SETTING_MULTIPINDTOWN_HELPTEXT :Normalmente, uma cidade não aceita mais do que uma indústria de cada tipo. Com esta configuração, será possível ter várias indústrias do mesmo tipo na mesma cidade +STR_CONFIG_SETTING_MULTIPINDTOWN :Permitir várias indústrias semelhantes por localidade: {STRING} +STR_CONFIG_SETTING_MULTIPINDTOWN_HELPTEXT :Normalmente, uma localidade não aceita mais do que uma indústria de cada tipo. Com esta configuração, será possível ter várias indústrias do mesmo tipo na mesma localidade STR_CONFIG_SETTING_SIGNALSIDE :Mostrar sínais: {STRING} STR_CONFIG_SETTING_SIGNALSIDE_HELPTEXT :Escolha em que lado da via colocar sinais STR_CONFIG_SETTING_SIGNALSIDE_LEFT :Na esquerda @@ -1245,7 +1245,7 @@ STR_CONFIG_SETTING_AUTOSCROLL_EVERY_VIEWPORT :Todos os visual STR_CONFIG_SETTING_BRIBE :Permite o suborno da autoridade local: {STRING} STR_CONFIG_SETTING_BRIBE_HELPTEXT :Permite que as companhias tentem subornar a autoridade local. Se o suborno for descoberto por um inspector, a companhia não poderá construir nessa localidade durante seis meses STR_CONFIG_SETTING_ALLOW_EXCLUSIVE :Permite comprar direitos de transporte em exclusividade: {STRING} -STR_CONFIG_SETTING_ALLOW_EXCLUSIVE_HELPTEXT :Se uma empresa compra direitos exclusivos de transporte para uma cidade, as estações dos concorrentes (passageiros e carga) não receberão cargo durante um ano +STR_CONFIG_SETTING_ALLOW_EXCLUSIVE_HELPTEXT :Se uma empresa compra direitos exclusivos de transporte para uma localidade, as estações dos concorrentes (passageiros e carga) não receberão cargo durante um ano STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS :Permite investir em edifícios: {STRING} STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS_HELPTEXT :Permite que empresas doem dinheiro às cidades para financiar novas casas STR_CONFIG_SETTING_ALLOW_FUND_ROAD :Permite financiar a reconstrução de estradas locais:{STRING} @@ -1258,8 +1258,8 @@ STR_CONFIG_SETTING_PLANE_SPEED :Fator de veloci STR_CONFIG_SETTING_PLANE_SPEED_HELPTEXT :Set the relative speed of planes compared to other vehicle types, to reduce the amount of income of transport by aircraft STR_CONFIG_SETTING_PLANE_SPEED_VALUE :1 / {COMMA} STR_CONFIG_SETTING_PLANE_CRASHES :Número de acidentes de aeronaves: {STRING} -STR_CONFIG_SETTING_PLANE_CRASHES_HELPTEXT :Indicar a hipótese da ocorrência de um acidente aéreo -STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Nenhum +STR_CONFIG_SETTING_PLANE_CRASHES_HELPTEXT :Indicar a hipótese da ocorrência de um acidente aéreo.{}* As aeronaves maiores tem um risco acrescido a despenhar quando aterram em aeroportos pequenos +STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Nenhum* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Reduzido STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Permite estações de passagem em estradas das cidades: {STRING} @@ -1302,13 +1302,13 @@ STR_CONFIG_SETTING_HOVER_DELAY :Mostrar textos STR_CONFIG_SETTING_HOVER_DELAY_HELPTEXT :Atraso após o qual os textos de ajuda são mostrados após parar o cursor sobre algum elemento da interface. Alternativamente, os textos de ajuda podem ser mostrados com o botão direito do rato quando este valor está definido como 0 STR_CONFIG_SETTING_HOVER_DELAY_VALUE :Parar o rato por {COMMA} milisegundo{P 0 "" s} STR_CONFIG_SETTING_HOVER_DELAY_DISABLED :Clique com botão direito -STR_CONFIG_SETTING_POPULATION_IN_LABEL :Mostra população da cidade na janela da cidade: {STRING} +STR_CONFIG_SETTING_POPULATION_IN_LABEL :Mostra população da localidade na identificação da mesma: {STRING} STR_CONFIG_SETTING_POPULATION_IN_LABEL_HELPTEXT :Mostrar a população das povoações na sua etiqueta no mapa STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS :Grossura das linhas nos gráficos: {STRING} STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT :Largura da linha nos gráficos. Uma linha mais estreita é de leitura mais precisa, enquanto uma linha mais espessa é mais fácil de ver e as cores distinguem-se melhor. STR_CONFIG_SETTING_LANDSCAPE :Cenário: {STRING} -STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :Os estilos dos cenários definem a jogabilidade base, cada um com cargas e requerimentos diferentes para o desenvolvimento das cidades. NewGRF e Scripts de Jogo permitem um controlo mais refinado +STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :Os estilos dos cenários definem a jogabilidade base, cada um com cargas e requerimentos diferentes para o desenvolvimento das localidades. NewGRF e Scripts de Jogo permitem um controlo mais refinado STR_CONFIG_SETTING_LAND_GENERATOR :Gerador de terreno: {STRING} STR_CONFIG_SETTING_LAND_GENERATOR_HELPTEXT :O gerador original é dependente do conjunto gráfico base, e compõe formas de terreno já afixadas. TerraGenesis é um gerador baseado no algoritmo de ruído de Perlin que permite definições mais refinadas STR_CONFIG_SETTING_LAND_GENERATOR_ORIGINAL :Original @@ -1320,7 +1320,7 @@ STR_CONFIG_SETTING_INDUSTRY_DENSITY_HELPTEXT :Define quantas STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Distância máxima entre o limite do mapa e Refinarias de Petróleo: {STRING} STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Refinarias de petróleo são construídas apenas próximo da borda do mapa, isto é, na costa para mapas de ilha STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Altura da linha de neve: {STRING} -STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Controla a que altura a neve começa em paisagens sub-árticas. A neve também afecta a geração de indústrias e os requisitos de crescimento das cidades +STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Controla a que altura a neve começa em paisagens sub-árticas. A neve também afecta a geração de indústrias e os requisitos de crescimento das localidades STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Rudeza do terreno: {STRING} STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_HELPTEXT :(Apenas TerraGenesis) Escolhe a frequência de montes: paisagens macias têm menos montes e mais espalhados. Paisagens duras têm muitos montes, que podem parecer repetitivos STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH :Muito suave @@ -1450,7 +1450,7 @@ STR_CONFIG_SETTING_SOUND_DISASTER_HELPTEXT :Reproduzir efei STR_CONFIG_SETTING_SOUND_VEHICLE :Veículos: {STRING} STR_CONFIG_SETTING_SOUND_VEHICLE_HELPTEXT :Reproduzir efeitos sonoros dos veículos STR_CONFIG_SETTING_SOUND_AMBIENT :Ambiente: {STRING} -STR_CONFIG_SETTING_SOUND_AMBIENT_HELPTEXT :Reproduzir efeitos sonoros da paisagem, indústrias e cidades +STR_CONFIG_SETTING_SOUND_AMBIENT_HELPTEXT :Reproduzir efeitos sonoros da paisagem, indústrias e localidades STR_CONFIG_SETTING_DISABLE_UNSUITABLE_BUILDING :Desativar construção de infra-estrutura quando não estão disponíveis veículos adequados: {STRING} STR_CONFIG_SETTING_DISABLE_UNSUITABLE_BUILDING_HELPTEXT :Quando activo, as infraestruturas só estão disponíveis se os veículos estiverem também, prevenindo desperdícios de tempo e dinheiro em infraestruturas sem utilidade. @@ -1566,24 +1566,28 @@ STR_CONFIG_SETTING_CYCLE_SIGNAL_NORMAL :Apenas sinais d STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Apenas sinais de rota STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Todos -STR_CONFIG_SETTING_TOWN_LAYOUT :Disposição de estradas para novas cidades: {STRING} -STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Disposição da rede de estradas das cidades +STR_CONFIG_SETTING_TOWN_LAYOUT :Disposição de estradas para novas localidades: {STRING} +STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Disposição da rede de estradas das localidades STR_CONFIG_SETTING_TOWN_LAYOUT_DEFAULT :Original STR_CONFIG_SETTING_TOWN_LAYOUT_BETTER_ROADS :Estradas melhores STR_CONFIG_SETTING_TOWN_LAYOUT_2X2_GRID :grelha 2x2 STR_CONFIG_SETTING_TOWN_LAYOUT_3X3_GRID :grelha 3x3 STR_CONFIG_SETTING_TOWN_LAYOUT_RANDOM :Aleatório -STR_CONFIG_SETTING_ALLOW_TOWN_ROADS :As cidades têm permissão para construir estradas: {STRING} +STR_CONFIG_SETTING_ALLOW_TOWN_ROADS :As localidades têm permissão para construir estradas: {STRING} STR_CONFIG_SETTING_ALLOW_TOWN_ROADS_HELPTEXT :Permite às cidades a construção de estradas para crescimento. Desactivar para não permitir às autoridades a construção de estradas -STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS :Cidades podem construir passagens de nível: {STRING} -STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS_HELPTEXT :Activar esta preferência permite às cidades construir cruzamentos nivelados -STR_CONFIG_SETTING_NOISE_LEVEL :Permitir que a cidade controle o nível de ruído dos aeroportos: {STRING} -STR_CONFIG_SETTING_NOISE_LEVEL_HELPTEXT :Com esta preferência desactivada, podem haver dois aeroportos em cada cidade. Com esta preferência activa, o número de aeroportos numa cidade é limitado pela aceitação do ruído na cidade, que depende da população, do tamanho do aeroporto e da sua distância -STR_CONFIG_SETTING_TOWN_FOUNDING :Fundar cidades no jogo: {STRING} +STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS :Localidades podem construir passagens de nível: {STRING} +STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS_HELPTEXT :Activar esta preferência permite às localidades construir cruzamentos nivelados +STR_CONFIG_SETTING_NOISE_LEVEL :Permitir que a localidade controle o nível de ruído dos aeroportos: {STRING} +STR_CONFIG_SETTING_NOISE_LEVEL_HELPTEXT :Com esta preferência desactivada, podem haver dois aeroportos em cada localidade. Com esta preferência activa, o número de aeroportos numa localidade é limitado pela aceitação do ruído na mesma, que depende da população, do tamanho do aeroporto e da sua distância +STR_CONFIG_SETTING_TOWN_FOUNDING :Fundar localidades no jogo: {STRING} STR_CONFIG_SETTING_TOWN_FOUNDING_HELPTEXT :Activar esta preferência permite aos jogadores fundar novas povoações no jogo STR_CONFIG_SETTING_TOWN_FOUNDING_FORBIDDEN :Proibido STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED :Permitido -STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED_CUSTOM_LAYOUT :Permitido, estrutura personalizada da cidade +STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED_CUSTOM_LAYOUT :Permitido, estrutura personalizada da localidade +STR_CONFIG_SETTING_TOWN_CARGOGENMODE :Geração de carga citadina: {STRING} +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_HELPTEXT :Quantidade de carga produzida por casas em localidades, relativa à população total da mesma.{}Crescimento quadrático: Uma localidade do dobro do tamanho gera 4x mais passageiros.{}Crescimento linear: Uma localidade do dobro do tamanho gera 2x a quantidade de passageiros. +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_ORIGINAL :Quadrático (original) +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_BITCOUNT :Linear STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT :Criação de árvores no decorrer do jogo: {STRING} STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_HELPTEXT :Controlar o aparecimento aleatório de árvores durante o jogo. Isto poderá afectar indústrias que dependem do crescimento de árvores, como as madeireiras @@ -1613,15 +1617,15 @@ STR_CONFIG_SETTING_ZOOM_LVL_NORMAL :Normal STR_CONFIG_SETTING_ZOOM_LVL_OUT_2X :2x STR_CONFIG_SETTING_ZOOM_LVL_OUT_4X :4x STR_CONFIG_SETTING_ZOOM_LVL_OUT_8X :8x -STR_CONFIG_SETTING_TOWN_GROWTH :Ritmo de crescimento de cidades: {STRING} -STR_CONFIG_SETTING_TOWN_GROWTH_HELPTEXT :Velocidade de crescimento das cidades +STR_CONFIG_SETTING_TOWN_GROWTH :Ritmo de crescimento de localidades: {STRING} +STR_CONFIG_SETTING_TOWN_GROWTH_HELPTEXT :Velocidade de crescimento das localidades STR_CONFIG_SETTING_TOWN_GROWTH_NONE :Nenhum STR_CONFIG_SETTING_TOWN_GROWTH_SLOW :Lento STR_CONFIG_SETTING_TOWN_GROWTH_NORMAL :Normal STR_CONFIG_SETTING_TOWN_GROWTH_FAST :Rápido STR_CONFIG_SETTING_TOWN_GROWTH_VERY_FAST :Muito Rápido -STR_CONFIG_SETTING_LARGER_TOWNS :Proporção de cidades que chegarão a metrópoles: {STRING} -STR_CONFIG_SETTING_LARGER_TOWNS_HELPTEXT :Quantidade de povoações que se tornarão cidades, logo cidades que começarão maiores e crescerão mais depressa +STR_CONFIG_SETTING_LARGER_TOWNS :Proporção de localidades que chegarão a cidades: {STRING} +STR_CONFIG_SETTING_LARGER_TOWNS_HELPTEXT :Quantidade de localidades que se tornarão cidades, ou seja uma localidade que começa maior e crescerá mais depressa. STR_CONFIG_SETTING_LARGER_TOWNS_VALUE :1 em {COMMA} STR_CONFIG_SETTING_LARGER_TOWNS_DISABLED :Nenhum STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER :Multiplicador inicial para a dimensão das metrópoles: {STRING} @@ -1705,7 +1709,7 @@ STR_CONFIG_SETTING_ACCIDENTS :{ORANGE}Desastr STR_CONFIG_SETTING_GENWORLD :{ORANGE}Geração do mundo STR_CONFIG_SETTING_ENVIRONMENT :{ORANGE}Meio Ambiente STR_CONFIG_SETTING_ENVIRONMENT_AUTHORITIES :{ORANGE}Autoridades -STR_CONFIG_SETTING_ENVIRONMENT_TOWNS :{ORANGE}Cidades +STR_CONFIG_SETTING_ENVIRONMENT_TOWNS :{ORANGE}Localidades STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Industrias STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distribuição de Carga STR_CONFIG_SETTING_AI :{ORANGE}Oponentes @@ -2529,12 +2533,12 @@ STR_QUERY_RESET_LANDSCAPE_CAPTION :{WHITE}Repor Te STR_RESET_LANDSCAPE_CONFIRMATION_TEXT :{WHITE}Tem a certeza que quer apagar todas as propriedades das empresas? # Town generation window (SE) -STR_FOUND_TOWN_CAPTION :{WHITE}Gerar Cidades +STR_FOUND_TOWN_CAPTION :{WHITE}Gerar Localidades STR_FOUND_TOWN_NEW_TOWN_BUTTON :{BLACK}Nova Cidade STR_FOUND_TOWN_NEW_TOWN_TOOLTIP :{BLACK}Fundar nova cidade. Shift+Clique mostra apenas o custo estimado STR_FOUND_TOWN_RANDOM_TOWN_BUTTON :{BLACK}Cidade Aleatória STR_FOUND_TOWN_RANDOM_TOWN_TOOLTIP :{BLACK}Fundar uma cidade num local aleatório -STR_FOUND_TOWN_MANY_RANDOM_TOWNS :{BLACK}Várias cidades aleatórias +STR_FOUND_TOWN_MANY_RANDOM_TOWNS :{BLACK}Várias localidades aleatórias STR_FOUND_TOWN_RANDOM_TOWNS_TOOLTIP :{BLACK}Cobrir o mapa com cidades colocadas aleatoriamente STR_FOUND_TOWN_NAME_TITLE :{YELLOW}Nome da cidade: @@ -2543,14 +2547,14 @@ STR_FOUND_TOWN_NAME_EDITOR_HELP :{BLACK}Clique p STR_FOUND_TOWN_NAME_RANDOM_BUTTON :{BLACK}Nome aleatório STR_FOUND_TOWN_NAME_RANDOM_TOOLTIP :{BLACK}Gerar novo nome aleatório -STR_FOUND_TOWN_INITIAL_SIZE_TITLE :{YELLOW}Tamanho da cidade: +STR_FOUND_TOWN_INITIAL_SIZE_TITLE :{YELLOW}Tamanho da localidade: STR_FOUND_TOWN_INITIAL_SIZE_SMALL_BUTTON :{BLACK}Pequena STR_FOUND_TOWN_INITIAL_SIZE_MEDIUM_BUTTON :{BLACK}Média STR_FOUND_TOWN_INITIAL_SIZE_LARGE_BUTTON :{BLACK}Grande STR_FOUND_TOWN_SIZE_RANDOM :{BLACK}Aleatório -STR_FOUND_TOWN_INITIAL_SIZE_TOOLTIP :{BLACK}Seleccione o tamanho da cidade +STR_FOUND_TOWN_INITIAL_SIZE_TOOLTIP :{BLACK}Seleccione o tamanho da localidade STR_FOUND_TOWN_CITY :{BLACK}Metrópole -STR_FOUND_TOWN_CITY_TOOLTIP :{BLACK}Metrópoles crescem mais depressa do que as cidades normais{}Dependendo da configuração, são maiores aquando da sua fundação +STR_FOUND_TOWN_CITY_TOOLTIP :{BLACK}Cidades crescem mais depressa do que as localidades normais{}Dependendo da configuração, são maiores aquando da sua fundação STR_FOUND_TOWN_ROAD_LAYOUT :{YELLOW}Disposição de estradas na cidade: STR_FOUND_TOWN_SELECT_TOWN_ROAD_LAYOUT :{BLACK}Seleccione disposição das estradas utilizada para esta cidade @@ -3027,6 +3031,7 @@ STR_NEWGRF_BUGGY :{WHITE}NewGRF ' STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}A informação de carga/adaptação do modelo de veículo '{1:ENGINE}' difere da que consta na lista de veículos depois de adquirido. Isto poderá causar problemas ao adaptar quando automaticamente renovado/substituído. STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' causou um loop infinito no callback de produção. STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}Callback {1:HEX} devolveu resultado desconhecido/inválido {2:HEX} +STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' devolveu tipo de carga inválida no callback de produção em {2:HEX} # 'User removed essential NewGRFs'-placeholders for stuff without specs STR_NEWGRF_INVALID_CARGO : @@ -3473,6 +3478,7 @@ STR_PURCHASE_INFO_REFITTABLE :(adaptável) STR_PURCHASE_INFO_DESIGNED_LIFE :{BLACK}Concebido: {GOLD}{NUM}{BLACK} Vida útil: {GOLD}{COMMA} ano{P "" s} STR_PURCHASE_INFO_RELIABILITY :{BLACK}Fiabilidade máxima: {GOLD}{COMMA}% STR_PURCHASE_INFO_COST :{BLACK}Custo: {GOLD}{CURRENCY_LONG} +STR_PURCHASE_INFO_COST_REFIT :{BLACK}Custo: {GOLD}{CURRENCY_LONG}{BLACK} (Custo da adaptação: {GOLD}{CURRENCY_LONG}{BLACK}) STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Peso: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Custo: {GOLD}{CURRENCY_LONG}{BLACK} Velocidade: {GOLD}{VELOCITY} STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Capacidade: {GOLD}{CARGO_LONG}, {CARGO_LONG} @@ -3495,12 +3501,20 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Comprar STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Comprar Barco STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Comprar Aeronave +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Comprar e Reconverter veiculo +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Comprar e Reconverter Veículo +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Comprar e Converter Barco +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Comprar e Adaptar Carga da Aeronave STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Comprar o veículo ferroviário seleccionado. Shift+Clique mostra estimativa de custo, sem comprar STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Comprar o veículo rodoviário seleccionado. Shift+Clique mostra estimativa de custo, sem comprar STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Comprar barco seleccionado. Shift+Clique mostra estimativa de custo, sem comprar STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Comprar aeronave seleccionada. Shift+Clique mostra estimativa de custo, sem comprar +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Comprar e converter veículo ferroviário seleccionado. Shift+Clique mostra estimativa de custo, sem comprar +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :Comprar e converter veículo rodoviário seleccionado. Shift+Clique mostra estimativa de custo, sem comprar +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Comprar e converter barco seleccionado. Shift+Clique mostra estimativa de custo, sem comprar +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Comprar e converter aeronave seleccionada. Shift+Clique mostra estimativa de custo, sem comprar STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Renomear STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Renomear @@ -4174,8 +4188,8 @@ STR_GAME_SAVELOAD_NOT_AVAILABLE : STR_WARNING_LOADGAME_REMOVED_TRAMS :{WHITE}O jogo foi salvo numa versão sem suporte a eléctricos. Todos os eléctricos foram removidos. # Map generation messages -STR_ERROR_COULD_NOT_CREATE_TOWN :{WHITE}Geração de mapa abortada...{}... não há locais apropriados para cidades -STR_ERROR_NO_TOWN_IN_SCENARIO :{WHITE}... não existe nenhuma cidade neste cenário +STR_ERROR_COULD_NOT_CREATE_TOWN :{WHITE}Geração de mapa abortada...{}... não há locais apropriados para localidades +STR_ERROR_NO_TOWN_IN_SCENARIO :{WHITE}... não existe nenhuma localidade neste cenário STR_ERROR_PNGMAP :{WHITE}Impossível carregar paisagem do PNG... STR_ERROR_PNGMAP_FILE_NOT_FOUND :{WHITE}... ficheiro não encontrado @@ -4226,7 +4240,7 @@ STR_ERROR_NOT_ALLOWED_WHILE_PAUSED :{WHITE}Não per # Local authority errors STR_ERROR_LOCAL_AUTHORITY_REFUSES_TO_ALLOW_THIS :{WHITE}A autoridade local de {TOWN} não autorizou -STR_ERROR_LOCAL_AUTHORITY_REFUSES_AIRPORT :{WHITE}{TOWN} a autoridade local recusa permitir que outro aeroporto seja construído nesta cidade +STR_ERROR_LOCAL_AUTHORITY_REFUSES_AIRPORT :{WHITE}{TOWN} a autoridade local recusa permitir que outro aeroporto seja construído nesta localidade STR_ERROR_LOCAL_AUTHORITY_REFUSES_NOISE :{WHITE}{TOWN} a autoridade local não permite a construção do aeroporto devido à poluição sonora STR_ERROR_BRIBE_FAILED :{WHITE}A sua tentativa de suborno foi descoberta por um investigador regional @@ -4257,18 +4271,18 @@ STR_ERROR_CAN_T_SELL_25_SHARE_IN :{WHITE}Não é STR_ERROR_PROTECTED :{WHITE}Esta empresa ainda não troca acções... # Town related errors -STR_ERROR_CAN_T_GENERATE_TOWN :{WHITE}Não é possível construir cidades -STR_ERROR_CAN_T_RENAME_TOWN :{WHITE}Não é possível renomear cidade... -STR_ERROR_CAN_T_FOUND_TOWN_HERE :{WHITE}Não é possível construir uma cidade aqui... -STR_ERROR_CAN_T_EXPAND_TOWN :{WHITE}Não é possível expandir cidade... +STR_ERROR_CAN_T_GENERATE_TOWN :{WHITE}Não é possível construir localidades +STR_ERROR_CAN_T_RENAME_TOWN :{WHITE}Não é possível renomear localidade... +STR_ERROR_CAN_T_FOUND_TOWN_HERE :{WHITE}Não é possível construir uma localidade aqui... +STR_ERROR_CAN_T_EXPAND_TOWN :{WHITE}Não é possível expandir localidade... STR_ERROR_TOO_CLOSE_TO_EDGE_OF_MAP_SUB :{WHITE}... muito perto do limite do mapa -STR_ERROR_TOO_CLOSE_TO_ANOTHER_TOWN :{WHITE}... muito perto de outra cidade -STR_ERROR_TOO_MANY_TOWNS :{WHITE}... demasiadas cidades +STR_ERROR_TOO_CLOSE_TO_ANOTHER_TOWN :{WHITE}... muito perto de outra localidade +STR_ERROR_TOO_MANY_TOWNS :{WHITE}... demasiadas localidades STR_ERROR_NO_SPACE_FOR_TOWN :{WHITE}... não existe mais espaço no mapa -STR_ERROR_TOWN_EXPAND_WARN_NO_ROADS :{WHITE}A cidade não construirá estradas. Pode-se permitir a construção de estradas por Opções Avançadas->Economia->Cidades +STR_ERROR_TOWN_EXPAND_WARN_NO_ROADS :{WHITE}A localidade não construirá estradas. Pode-se permitir a construção de estradas por Opções Avançadas->Economia->Localidades STR_ERROR_ROAD_WORKS_IN_PROGRESS :{WHITE}Trabalhos na estrada em curso -STR_ERROR_TOWN_CAN_T_DELETE :{WHITE}Não é possível eliminar esta cidade...{}Uma estação ou depósito refere-se à cidade ou não é possível remover terreno pertencente à cidade -STR_ERROR_STATUE_NO_SUITABLE_PLACE :{WHITE}... não há um sítio adequado para uma estátua no centro desta cidade +STR_ERROR_TOWN_CAN_T_DELETE :{WHITE}Não é possível eliminar esta localidade...{}Uma estação ou depósito refere-se à localidade ou não é possível remover terreno pertencente à mesma +STR_ERROR_STATUE_NO_SUITABLE_PLACE :{WHITE}... não há um sítio adequado para uma estátua no centro desta localidade # Industry related errors STR_ERROR_TOO_MANY_INDUSTRIES :{WHITE}... demasiadas indústrias @@ -4276,13 +4290,13 @@ STR_ERROR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Não é STR_ERROR_CAN_T_BUILD_HERE :{WHITE}Não é possível construir {STRING} aqui... STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY :{WHITE}Não é possível construir este tipo de indústria aqui... STR_ERROR_INDUSTRY_TOO_CLOSE :{WHITE}... muito perto de outra indústria -STR_ERROR_MUST_FOUND_TOWN_FIRST :{WHITE}... é necessário construir uma cidade primeiro -STR_ERROR_ONLY_ONE_ALLOWED_PER_TOWN :{WHITE}... só é permitido uma por cidade -STR_ERROR_CAN_ONLY_BE_BUILT_IN_TOWNS_WITH_POPULATION_OF_1200 :{WHITE}... só pode ser construído em cidades com pelo menos 1200 habitantes +STR_ERROR_MUST_FOUND_TOWN_FIRST :{WHITE}... é necessário construir uma localidade primeiro +STR_ERROR_ONLY_ONE_ALLOWED_PER_TOWN :{WHITE}... só é permitido uma por localidade +STR_ERROR_CAN_ONLY_BE_BUILT_IN_TOWNS_WITH_POPULATION_OF_1200 :{WHITE}... só pode ser construído em localidades com pelo menos 1200 habitantes STR_ERROR_CAN_ONLY_BE_BUILT_IN_RAINFOREST :{WHITE}... só se pode construir em zonas florestais STR_ERROR_CAN_ONLY_BE_BUILT_IN_DESERT :{WHITE}... só se pode construir em zonas desérticas -STR_ERROR_CAN_ONLY_BE_BUILT_IN_TOWNS :{WHITE}... só se pode construir em cidades (substituindo casas) -STR_ERROR_CAN_ONLY_BE_BUILT_NEAR_TOWN_CENTER :{WHITE}... só se pode construir no centro de uma cidade +STR_ERROR_CAN_ONLY_BE_BUILT_IN_TOWNS :{WHITE}... só se pode construir em localidades (substituindo casas) +STR_ERROR_CAN_ONLY_BE_BUILT_NEAR_TOWN_CENTER :{WHITE}... só se pode construir no centro de uma localidade STR_ERROR_CAN_ONLY_BE_BUILT_IN_LOW_AREAS :{WHITE}... só se pode construir em planícies STR_ERROR_CAN_ONLY_BE_POSITIONED :{WHITE}... só pode ser colocado perto das bordas do mapa STR_ERROR_FOREST_CAN_ONLY_BE_PLANTED :{WHITE}... a floresta só pode ser plantada acima do nível de neve @@ -4310,7 +4324,7 @@ STR_ERROR_TOO_MANY_TRUCK_STOPS :{WHITE}Demasiad STR_ERROR_TOO_CLOSE_TO_ANOTHER_DOCK :{WHITE}Muito perto de outra doca STR_ERROR_TOO_CLOSE_TO_ANOTHER_AIRPORT :{WHITE}Demasiado perto de outro aeroporto STR_ERROR_CAN_T_RENAME_STATION :{WHITE}Não pode alterar o nome da estação... -STR_ERROR_DRIVE_THROUGH_ON_TOWN_ROAD :{WHITE}... esta estrada é detida pela cidade +STR_ERROR_DRIVE_THROUGH_ON_TOWN_ROAD :{WHITE}... esta estrada é detida pela localidade. STR_ERROR_DRIVE_THROUGH_DIRECTION :{WHITE}... estrada orientada na direcção incorrecta STR_ERROR_DRIVE_THROUGH_CORNER :{WHITE}... estações de passagem não podem ter curvas STR_ERROR_DRIVE_THROUGH_JUNCTION :{WHITE}... estações de passagem não podem ter cruzamentos From a4073895aeb0ceedd965ed691c2888500a542612 Mon Sep 17 00:00:00 2001 From: PeterN Date: Mon, 25 Mar 2019 19:30:23 +0000 Subject: [PATCH 42/82] Fix #7411: Use industry production callback (if used) on initial industry cargo generation. (#7412) --- src/industry_cmd.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index a4863ab126..403e57a96f 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1751,8 +1751,16 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type, } if (_generating_world) { + if (HasBit(indspec->callback_mask, CBM_IND_PRODUCTION_256_TICKS)) { + IndustryProductionCallback(i, 1); + for (size_t ci = 0; ci < lengthof(i->last_month_production); ci++) { + i->last_month_production[ci] = i->produced_cargo_waiting[ci] * 8; + i->produced_cargo_waiting[ci] = 0; + } + } + for (size_t ci = 0; ci < lengthof(i->last_month_production); ci++) { - i->last_month_production[ci] = i->production_rate[ci] * 8; + i->last_month_production[ci] += i->production_rate[ci] * 8; } } From 698241e16e12bdb03cdc90bdf3d5a6ff631ae309 Mon Sep 17 00:00:00 2001 From: PeterN Date: Mon, 25 Mar 2019 20:01:55 +0000 Subject: [PATCH 43/82] Fix #7410: Sign position/width not set on initial creation. (#7413) Sign width was only updated when the text was changed. This seems to work for player-placed signs as there is always a rename operation, however AIs can create a sign with text in one go, in which case the width was never set. --- src/signs_cmd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/signs_cmd.cpp b/src/signs_cmd.cpp index 69fde2559f..e094e9e0ff 100644 --- a/src/signs_cmd.cpp +++ b/src/signs_cmd.cpp @@ -58,6 +58,7 @@ CommandCost CmdPlaceSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 if (!StrEmpty(text)) { si->name = stredup(text); } + si->UpdateVirtCoord(); _viewport_sign_kdtree.Insert(ViewportSignKdtreeItem::MakeSign(si->index)); InvalidateWindowData(WC_SIGN_LIST, 0, 0); _new_sign_id = si->index; From 8acca3a72ba4569607575aa5a74bdbbcdb5669f8 Mon Sep 17 00:00:00 2001 From: stormcone <48624099+stormcone@users.noreply.github.com> Date: Sat, 23 Mar 2019 17:40:01 +0100 Subject: [PATCH 44/82] Change: Do not display a newspaper about old vehicles for which replacement is activated. --- src/vehicle.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vehicle.cpp b/src/vehicle.cpp index f4dc0c4ddb..4f987a4bf4 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1348,8 +1348,11 @@ void AgeVehicle(Vehicle *v) /* Don't warn about non-primary or not ours vehicles or vehicles that are crashed */ if (v->Previous() != NULL || v->owner != _local_company || (v->vehstatus & VS_CRASHED) != 0) return; + const Company *c = Company::Get(v->owner); /* Don't warn if a renew is active */ - if (Company::Get(v->owner)->settings.engine_renew && v->GetEngine()->company_avail != 0) return; + if (c->settings.engine_renew && v->GetEngine()->company_avail != 0) return; + /* Don't warn if a replacement is active */ + if (EngineHasReplacementForCompany(c, v->engine_type, v->group_id)) return; StringID str; if (age == -DAYS_IN_LEAP_YEAR) { From e3ea758c46e94f603d0be71af11eb1e64abcfcab Mon Sep 17 00:00:00 2001 From: PeterN Date: Mon, 25 Mar 2019 23:24:40 +0000 Subject: [PATCH 45/82] Fix #7414: Reinstate marking sign dirty before removal. (#7416) --- src/signs_cmd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/signs_cmd.cpp b/src/signs_cmd.cpp index e094e9e0ff..ea6c680c30 100644 --- a/src/signs_cmd.cpp +++ b/src/signs_cmd.cpp @@ -100,6 +100,7 @@ CommandCost CmdRenameSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 } } else { // Delete sign if (flags & DC_EXEC) { + si->sign.MarkDirty(); _viewport_sign_kdtree.Remove(ViewportSignKdtreeItem::MakeSign(si->index)); delete si; From 7a32cf1401d289f04682aa91fbfb779cbb2378e4 Mon Sep 17 00:00:00 2001 From: translators Date: Tue, 26 Mar 2019 19:45:43 +0100 Subject: [PATCH 46/82] Update: Translations from eints greek: 51 changes by Jubilee russian: 17 changes by Lone_Wolf latin: 19 changes by Supercheese portuguese: 53 changes by JayCity --- src/lang/greek.txt | 76 ++++++++++++++++++++---------- src/lang/latin.txt | 28 +++++++---- src/lang/portuguese.txt | 102 +++++++++++++++++++++------------------- src/lang/russian.txt | 23 ++++++--- 4 files changed, 140 insertions(+), 89 deletions(-) diff --git a/src/lang/greek.txt b/src/lang/greek.txt index 17d726877c..d2fab2ac1e 100644 --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -527,6 +527,7 @@ STR_TOOLBAR_SOUND_MUSIC :Ήχος/Μου ############ range for message menu starts STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :Τελευταίο μήνυμα/αναφορά ειδήσεων STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Ιστορικό μηνυμάτων +STR_NEWS_MENU_DELETE_ALL_MESSAGES :Διαγραφή όλων των μηνυμάτων ############ range ends here ############ range for about menu starts @@ -538,6 +539,7 @@ STR_ABOUT_MENU_SCREENSHOT :Στιγμιό STR_ABOUT_MENU_ZOOMIN_SCREENSHOT :Στιγμιότυπο οθόνης μέγιστης μεγέθυνσης STR_ABOUT_MENU_DEFAULTZOOM_SCREENSHOT :Στιγμιότυπο οθόνης τυπικής μεγέθυνσης STR_ABOUT_MENU_GIANT_SCREENSHOT :Στιγμιότυπο οθόνης για ολό τον χάρτη +STR_ABOUT_MENU_SHOW_FRAMERATE :Εμφάνιση ρυθμού καρέ STR_ABOUT_MENU_ABOUT_OPENTTD :Σχετικά με το 'OpenTTD' STR_ABOUT_MENU_SPRITE_ALIGNER :Ευθυγραμμιστής στοιχεών STR_ABOUT_MENU_TOGGLE_BOUNDING_BOXES :Εναλλαγή πλαισίου οριοθέτησης @@ -1100,6 +1102,7 @@ STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Κανονικ STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Διπλό μέγεθος STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Τετραπλό μέγεθος +STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Μέγεθος γραμματοσειράς STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Επιλέξτε το μέγεθος της γραμματοσειράς διεπαφής STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Κανονικό @@ -1288,6 +1291,8 @@ STR_CONFIG_SETTING_AUTOSLOPE :Να επιτρ STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :Επιτρέπεται η διαμόρφωση του εδάφους κάτω από κτίρια και σιδηροτροχιές χωρίς αυτά να αφαιρούνται STR_CONFIG_SETTING_CATCHMENT :Επιτρέπονται πιο ρεαλιστικά ταξινομημένες περιοχές συλλογής : {STRING} STR_CONFIG_SETTING_CATCHMENT_HELPTEXT :Διαφορετικοί σταθμοί και αεροδρόμια έχουν περιοχές κάλυψης διαφορετικού μεγέθους +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES :Οι σταθμοί της εταιρίας μπορούν να εξυπηρετήσεουν βιομηχανίες με κοντινούς ουδέτερους σταθμούς: {STRING} +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES_HELPTEXT :Όταν είναι ενεργοποιημένο, βιομηχανίες με ενσωματωμένους σταθμούς (όπως Πλατφόρμες Πετρελαίου) μπορούν να εξυπηρετούνται από κοντινούς σταθμούς της εταιρίας. Όταν είναι απενεργοποιημένο, οι βιομηχανίες αυτές μπορούν να εξυπηρετούνται μόνο από τους ενσωματωμένους σταθμούς τους. Κοντινοί σταθμοί της εταιρίας δεν θα μπορούν να τους εξυπηρετούν, ούτε και ο ενσωματωμένος σταθμός θα μπορεί να εξυπηρετήσει οτιδήποτε άλλο εκτός από τη βιομηχανία. STR_CONFIG_SETTING_EXTRADYNAMITE :Επιτρέπεται η αφαίρεση περισσότερων ιδιοκτησιών των πολέων: {STRING} STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT :Είναι ευκολότερη η αφαίρεση υποδομών και κτιρίων που κατέχονται από την πόλη STR_CONFIG_SETTING_TRAIN_LENGTH :Μέγιστο μήκος τρένων: {STRING} @@ -1304,7 +1309,7 @@ STR_CONFIG_SETTING_TRAIN_SLOPE_STEEPNESS_HELPTEXT :Η κλίση STR_CONFIG_SETTING_PERCENTAGE :{COMMA}% STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS :Κλίση εδάφους για τα οδικά οχήματα: {STRING} STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS_HELPTEXT :Η κλίση ενός κεκλιμένου τετραγωνίδιου για τα οδικά οχήματα. Μεγαλύτερες τιμές καθιστούν δυσκολότερο το ανέβασμα λόφων -STR_CONFIG_SETTING_FORBID_90_DEG :Απαγόρευση στα τρένα και πλοία να κάνουν στροφές 90°: {STRING} +STR_CONFIG_SETTING_FORBID_90_DEG :Απαγόρευση στα τρένα να κάνουν στροφές 90°: {STRING} STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT :Στροφές 90 μοιρών προκύπτουν όταν μια οριζόντια σιδηροτροχιά ακολουθείται από μια κάθετη στο επόμενο τετραγωνίδιο, κάνοντας το τρένο να στρίψει κατά 90 μοίρες όταν αλλάζει τετραγωνίδιο, αντί για τις συνηθισμένες 45 μοίρες σε άλλους συνδυασμούς σιδηροτροχιών. Αυτό έχει επίσης εφαρμογή στην ακτίνα στροφής των πλοίων STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS :Να επιτρέπεται η συνένωση μη παρακείμενων σταθμών: {STRING} STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS_HELPTEXT :Επιτρέπεται η προσθήκη τμημάτων σε σταθμό χωρίς αυτά να αγγίζουν τα ήδη υπάρχοντα τμήματα. Χρειάζεται Ctrl+Κλικ κατά την τοποθέτηση των νέων τμημάτων @@ -1361,8 +1366,8 @@ STR_CONFIG_SETTING_PLANE_SPEED :Παράγον STR_CONFIG_SETTING_PLANE_SPEED_HELPTEXT :Ορίζεται η σχετική ταχύτητα των αεροπλάνων συγκριτικά με τους άλλους τύπους οχημάτων, ώστε να μειώνεται το ποσό του εισοδήματος από μεταφορές με αεροσκάφη STR_CONFIG_SETTING_PLANE_SPEED_VALUE :1 / {COMMA} STR_CONFIG_SETTING_PLANE_CRASHES :Αριθμός των αεροπορικών ατυχημάτων: {STRING} -STR_CONFIG_SETTING_PLANE_CRASHES_HELPTEXT :Ορίστε την πιθανότητα συντριβής ενός αεροσκάφους -STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Καθόλου +STR_CONFIG_SETTING_PLANE_CRASHES_HELPTEXT :Ορίστε την πιθανότητα συντριβής ενός τυχαίου αεροσκάφους.{}* Μεγάλα αεροσκάφη πάντα έχουν ένα ρίσκο συντριβής όταν προσγειώνονται σε μικρά αεροδρόμια. +STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Κανένα* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Μειωμένη STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Κανονική STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Επιτρέπονται οι στάσεις σε δρόμους που είναι ιδιοκτησία των πόλεων : {STRING} @@ -1374,6 +1379,7 @@ STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Συντήρη STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Όταν είναι ενεργοποιημένη, οι υποδομές προκαλούν έξοδα συντήρησης. Το κόστος μεγαλώνει δυσανάλογα με το μέγεθος του δικτύου, επηρεάζοντας έτσι τις μεγάλες εταιρείες περισσότερο από τις μικρότερες STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR :Αρχικό χρώμα εταιρίας: {STRING} +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_HELPTEXT :Επιλογή του αρχικού χρώματος της εταιρίας STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Τα αεροδρόμια δεν λήγουν ποτέ: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Ενεργοποιώντας αυτήν τη ρύθμιση κάθε τύπος αεροδρομίου παραμένει διαθέσιμο για πάντα μετά την παρουσίασή του @@ -1687,6 +1693,9 @@ STR_CONFIG_SETTING_TOWN_FOUNDING_FORBIDDEN :Δεν επιτ STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED :Επιτρέπεται STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED_CUSTOM_LAYOUT :Επιτρέπεται, προσαρμοσμένο σχέδιο πόλης STR_CONFIG_SETTING_TOWN_CARGOGENMODE :Δημιουργία εμπορευμάτων πόλης: {STRING} +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_HELPTEXT :Η ποσότητα εμπορευμάτων που παράγεται απο σπίτια σε πόλεις, σε σχέση με τον πληθυσμό της πόλης.{}Τετραγωνική ανάπτυξη: Μια πόλη διπλού μεγέθους παράγει τετραπλάσιο αριθμό επιβατών.{}Γραμμική ανάπτυξη: Μια πόλη διπλού μεγέθους παράγει διπλάσιο αριθμό επιβατών. +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_ORIGINAL :Τετραγωνικός (αρχική έκδοση) +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_BITCOUNT :Γραμμικό STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT :Τοποθέτηση δέντρων εντός παιχνιδιού: {STRING} STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_HELPTEXT :Έλεγχος της τυχαίας εμφάνισης δέντρων κατά τη διάρκεια του παιχνιδιού. Αυτό είναι πιθανό να επηρεάσει βιομηχανίες που εξαρτώνται από την ανάπτυξη των δέντρων, όπως για παράδειγμα οι υλοτομίες @@ -1891,7 +1900,7 @@ STR_INTRO_TRANSLATION :{BLACK}Λείπ # Quit window STR_QUIT_CAPTION :{WHITE}Έξοδος -STR_QUIT_ARE_YOU_SURE_YOU_WANT_TO_EXIT_OPENTTD :{YELLOW}Είστε σίγουροι ότι θέλετε να εγκαταλείψετε το OpenTTD και να επιστρέψετε στο {STRING}; +STR_QUIT_ARE_YOU_SURE_YOU_WANT_TO_EXIT_OPENTTD :{YELLOW}Είστε σίγουροι ότι θέλετε να εγκαταλείψετε το OpenTTD και να επιστρέψετε στο λειτουργικό {STRING}; STR_QUIT_YES :{BLACK}Ναι STR_QUIT_NO :{BLACK}Όχι @@ -2188,6 +2197,7 @@ STR_NETWORK_CONNECTION_DISCONNECT :{BLACK}Αποσ STR_NETWORK_NEED_GAME_PASSWORD_CAPTION :{WHITE}Η πρόσβαση στον διακομιστή προστατεύεται. Εισάγετε τον κωδικό STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Η εταιρεία προστατεύεται από κωδικό. Εισάγετε κωδικό +STR_NETWORK_COMPANY_LIST_CLIENT_LIST_CAPTION :{WHITE}Λίστα συμμετεχόντων # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Λίστα συμμετεχόντων @@ -2236,7 +2246,7 @@ STR_NETWORK_CHAT_ALL :[Όλοι] {STR STR_NETWORK_CHAT_OSKTITLE :{BLACK}Εισάγετε το κείμενο για δικτυακή συζήτηση # Network messages -STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Δεν βρέθηκε συσκευή δικτύου ή έγινε μεταγλώττιση χωρίς την παράμετρο ENABLE_NETWORK +STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Δεν βρέθηκαν συσκευές δικτύου STR_NETWORK_ERROR_NOSERVER :{WHITE}Δεν βρέθηκε κάποιο δικτυακό παιχνίδι STR_NETWORK_ERROR_NOCONNECTION :{WHITE}Ο διακομιστής δεν απάντησε στο αίτημα STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Απέτυχε η σύνδεση λόγο ασυμφωνίας NewGRF @@ -2488,9 +2498,9 @@ STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP :{BLACK}Συνδ STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP :{BLACK}Σηματοδότης Τροχιάς (ηλεκτρικός){}Ένας σηματοδότης τροχιάς επιτρέπει σε περισσότερα από ένα τρένο να είναι σε ένα κομμάτι ελέγχου την ίδια στιγμή, εάν το τρένο μπορεί να δεσμεύσει τροχιά σε ασφαλές σημείο στάσης. Κανονικοί σηματοδότες τροχιάς μπορούν να περαστούν από την πίσω πλευρά STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP :{BLACK}Μονόδρομος Σηματοδότης Τροχιάς (ηλεκτρικός){}Ένας σηματοδότης τροχιάς επιτρέπει σε περισσότερα από ένα τρένο να είναι σε ένα κομμάτι ελέγχου την ίδια στιγμή, εάν το τρένο μπορεί να δεσμεύσει τροχιά σε ασφαλές σημείο στάσης. Μονόδρομοι σηματοδότες τροχιάς δεν μπορούν να περαστούν από την πίσω πλευρά STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Μετατροπέας Σηματοδότη{}Όταν επιλέγεται, πατώντας σε έναν υπάρχωντα σηματοδότη θα τον μετατρέψει στον επιλεγμένο τύπο και παραλλαγή σηματοδότη. Με Ctrl+Κλικ εναλλάσσεται με την υπάρχουσα παραλλαγή. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος μετατροπής -STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}Πυκνότητα σηματοδοτών με σύρσιμο -STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}Μείωση πυκνότητας σηματοδοτών με σύρσιμο -STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}Αύξηση πυκνότητας σηματοδοτών με σύρσιμο +STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}Απόσταση μεταξύ σηματοδοτών με σύρσιμο +STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}Μείωση απόστασης μεταξύ σηματοδοτών με σύρσιμο +STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}Αύξηση απόστασης μεταξύ σηματοδοτών με σύρσιμο # Bridge selection window STR_SELECT_RAIL_BRIDGE_CAPTION :{WHITE}Επιλογή Γέφυρας @@ -2809,37 +2819,44 @@ STR_LAI_OBJECT_DESCRIPTION_COMPANY_OWNED_LAND :Ιδιοκτη # About OpenTTD window STR_ABOUT_OPENTTD :{WHITE}Σχετικά με το OpenTTD STR_ABOUT_ORIGINAL_COPYRIGHT :{BLACK}Αρχικά Πνευματικά Δικαιώματα {COPYRIGHT} 1995 Chris Sawyer, Όλα τα δικαιώματα διατηρούνται -STR_ABOUT_VERSION :{BLACK}Έκδοση OpenTTD{REV} +STR_ABOUT_VERSION :{BLACK}OpenTTD έκδοση {REV} STR_ABOUT_COPYRIGHT_OPENTTD :{BLACK}OpenTTD {COPYRIGHT} 2002-2019 Η ομάδα του OpenTTD # Framerate display window +STR_FRAMERATE_CAPTION :{WHITE}Ρυθμός καρέ γραφικών STR_FRAMERATE_CAPTION_SMALL :{STRING}{WHITE} ({DECIMAL}x) STR_FRAMERATE_RATE_GAMELOOP :{BLACK}Ρυθμός προσομοίωσης: {STRING} STR_FRAMERATE_RATE_GAMELOOP_TOOLTIP :{BLACK}Αριθμός στιγμών παιχνιδιού που προσομοιώνεται ανά δευτερόλεπτο. STR_FRAMERATE_RATE_BLITTER :{BLACK}Ρυθμός καρέ γραφικών: {STRING} -STR_FRAMERATE_RATE_BLITTER_TOOLTIP :{BLACK}Αριθμος των παραγμενων video frames ανα δευτερολεπτο -STR_FRAMERATE_SPEED_FACTOR :{WHITE}Παράγοντας ταχύτητας τρέχοντος παιχνιδιού: {DECIMAL}x +STR_FRAMERATE_RATE_BLITTER_TOOLTIP :{BLACK}Αριθμος των παραγμενων καρέ ανα δευτερολεπτο +STR_FRAMERATE_SPEED_FACTOR :{BLACK}Παράγοντας ταχύτητας τρέχοντος παιχνιδιού: {DECIMAL}x STR_FRAMERATE_SPEED_FACTOR_TOOLTIP :{BLACK}Πόσο γρήγορα εκτελείται το παιχνίδι αυτήν τη στιγμή, σε σύγκριση με την αναμενόμενη ταχύτητα στον κανονικό ρυθμό εξομοίωσης. STR_FRAMERATE_CURRENT :{WHITE}Τρέχον STR_FRAMERATE_AVERAGE :{WHITE}Μέσο -STR_FRAMERATE_DATA_POINTS :{WHITE}Τα δεδομένα βασίζονται σε μετρήσεις {COMMA} -STR_FRAMERATE_MS_GOOD :{LTBLUE}{DECIMAL}{WHITE} ms +STR_FRAMERATE_DATA_POINTS :{BLACK}Τα δεδομένα βασίζονται σε μετρήσεις {COMMA} +STR_FRAMERATE_MS_GOOD :{LTBLUE}{DECIMAL} ms +STR_FRAMERATE_MS_WARN :{YELLOW}{DECIMAL} ms STR_FRAMERATE_MS_BAD :{RED}{DECIMAL} ms -STR_FRAMERATE_FPS_GOOD :{LTBLUE}{DECIMAL} frames/δευτ. -STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL} frames/δευτ. +STR_FRAMERATE_FPS_GOOD :{LTBLUE}{DECIMAL} καρέ/δευτερόλεπτο +STR_FRAMERATE_FPS_WARN :{YELLOW}{DECIMAL} καρέ/δευτερόλεπτο +STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL} καρέ/δευτερόλεπτο +STR_FRAMERATE_GRAPH_MILLISECONDS :{TINY_FONT}{COMMA} ms STR_FRAMERATE_GRAPH_SECONDS :{TINY_FONT}{COMMA} ς ############ Leave those lines in this order!! -STR_FRAMERATE_GL_ECONOMY :{WHITE} Διαχείριση φορτίου: -STR_FRAMERATE_GL_TRAINS :Στιγμές τρένων: -STR_FRAMERATE_GL_ROADVEHS :{WHITE} Στιγμές οχημάτων δρόμου: -STR_FRAMERATE_GL_SHIPS :Στιγμές πλοίων: -STR_FRAMERATE_GL_AIRCRAFT :Στιγμές αεροσκαφών: -STR_FRAMERATE_GL_LANDSCAPE :Στιγμές κόσμου: +STR_FRAMERATE_GAMELOOP :{BLACK}Σύνολο βρόγχου παιχνιδιού: +STR_FRAMERATE_GL_ECONOMY :{BLACK} Διαχείριση φορτίου: +STR_FRAMERATE_GL_TRAINS :{BLACK} Στιγμές τρένων: +STR_FRAMERATE_GL_ROADVEHS :{BLACK} Στιγμές οχημάτων δρόμου: +STR_FRAMERATE_GL_SHIPS :{BLACK} Στιγμές πλοίων: +STR_FRAMERATE_GL_AIRCRAFT :{BLACK} Στιγμές αεροσκαφών: +STR_FRAMERATE_GL_LANDSCAPE :{BLACK} Στιγμές κόσμου: +STR_FRAMERATE_GL_LINKGRAPH :{BLACK} Καθυστέρηση γραφήματος συνδέσμου: STR_FRAMERATE_DRAWING :{BLACK}Γραφική απόδοση: STR_FRAMERATE_DRAWING_VIEWPORTS :Παράθυρα προβολής κόσμου: -STR_FRAMERATE_VIDEO :{WHITE}Έξοδος βίντεο: -STR_FRAMERATE_SOUND :{WHITE}Μίξη ήχου: +STR_FRAMERATE_VIDEO :{BLACK}Έξοδος βίντεο: +STR_FRAMERATE_SOUND :{BLACK}Μίξη ήχου: STR_FRAMERATE_ALLSCRIPTS :Σύνολο GS/AI: +STR_FRAMERATE_GAMESCRIPT :{BLACK} Δέσμη ενεργειών παιχνιδιού: STR_FRAMERATE_AI :{BLACK} AI {NUM} {STRING} ############ End of leave-in-this-order ############ Leave those lines in this order!! @@ -2857,6 +2874,7 @@ STR_FRAMETIME_CAPTION_VIDEO :Έξοδος β STR_FRAMETIME_CAPTION_SOUND :Μίξη ήχου STR_FRAMETIME_CAPTION_ALLSCRIPTS :Σύνολο GS/AI δεσμών ενεργειών STR_FRAMETIME_CAPTION_GAMESCRIPT :Δέσμη Ενεργειών παιχνιδιού +STR_FRAMETIME_CAPTION_AI :AI {NUM} {STRING} ############ End of leave-in-this-order @@ -3005,6 +3023,7 @@ STR_NEWGRF_SETTINGS_PALETTE :{BLACK}Παλέ STR_NEWGRF_SETTINGS_PALETTE_DEFAULT :Προεπιλογή (D) STR_NEWGRF_SETTINGS_PALETTE_DEFAULT_32BPP :Προεπιλογή (D) / 32 bpp STR_NEWGRF_SETTINGS_PALETTE_LEGACY :Παλαιού τύπου (W) +STR_NEWGRF_SETTINGS_PALETTE_LEGACY_32BPP :Παλαιού τύπου (W) / 32 bpp STR_NEWGRF_SETTINGS_PARAMETER :{BLACK}Παράμετροι: {SILVER}{STRING} STR_NEWGRF_SETTINGS_PARAMETER_NONE :Κανένα @@ -3088,6 +3107,7 @@ STR_NEWGRF_ERROR_GRM_FAILED :Οι ζητημ STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :Το {1:STRING} απενεργοποιήθηκε από το {2:STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Άκυρη/άγνωστη μορφή σχεδίου sprite (sprite {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Πάρα πολλά αντικέιμενα στη λίστα τιμών ιδιοτήτων (sprite {3:NUM}, ιδιότητα {4:HEX}) +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Άγνωστη/άκυρη σπιτροφή κήσης από παραγωγή βιομηχανίας (sprite {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Προσοχή! @@ -3113,12 +3133,13 @@ STR_NEWGRF_BROKEN :{WHITE}Η συ STR_NEWGRF_BROKEN_POWERED_WAGON :{WHITE}Άλλαξε την κατάσταση *** για «{1:ENGINE}» όταν δεν είναι μέσα σε αμαξοστάσιο STR_NEWGRF_BROKEN_VEHICLE_LENGTH :{WHITE}Άλλαξε το μήκος του οχήματος «{1:ENGINE}» ενώ δεν βρισκόταν μέσα σε αμαξοστάσιο STR_NEWGRF_BROKEN_CAPACITY :{WHITE}Άλλαξε τη χωριτικότητα όχηματος για τη «{1:ENGINE}» όταν δεν είναι σε αμαξοστάσιο ή διαδικασία μετατροπής -STR_BROKEN_VEHICLE_LENGTH :{WHITE}Το τρένο «{VEHICLE}» που ανήκει στην εταιρία «{COMPANY}» έχει μη έγκυρο μήκος. Πιθανόν να προέρχεται από προβλήματα με NewGRF. Το παιχνίδι μπορεί να αποσυγχρονιστεί ή να κλείσει απρόοπτα. +STR_BROKEN_VEHICLE_LENGTH :{WHITE}Το τρένο «{VEHICLE}» που ανήκει στην εταιρία «{COMPANY}» έχει μη έγκυρο μήκος. Πιθανόν να προκλήθηκε από προβλήματα με κάποια NewGRF. Το παιχνίδι μπορεί να αποσυγχρονιστεί ή να κλείσει απρόοπτα. STR_NEWGRF_BUGGY :{WHITE}Το NewGRF «{0:STRING}» δίνει λάθος πληροφορίες STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Η πληροφορία εμπορεύματος/μετατροπής για το «{1:ENGINE}» διαφέρει από τη λίστα αγοράς μετά την κατασκευή. Αυτό μπορεί να προκαλέσει την αποτυχία της αυτόματης ανανέωσης/αντικατάστασης για σωστή μετατροπή STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK :{WHITE}Το «{1:STRING}» προκάλεσε ένα ατέρμονο βρόχο στην κλήση παραγωγής STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}Η κλήση {1:HEX} επέστρεψε άγνωστο/άκυρο αποτέλεσμα {2:HEX} +STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK :{WHITE}Το '{1:STRING}' επέστρεψε άγνωστο/άκυρο τύπο εμπορεύματος στην κλήση {2:HEX} # 'User removed essential NewGRFs'-placeholders for stuff without specs STR_NEWGRF_INVALID_CARGO :<μη έγκυρο φορτίο> @@ -3527,6 +3548,7 @@ STR_GROUPS_CLICK_ON_GROUP_FOR_TOOLTIP :{BLACK}Ομάδ STR_GROUP_CREATE_TOOLTIP :{BLACK}Πατήστε για δημιουργήσετε ομάδα STR_GROUP_DELETE_TOOLTIP :{BLACK}Διαγραφή της επιλεγμένης ομάδας STR_GROUP_RENAME_TOOLTIP :{BLACK}Μετονομασία της επιλεγμένης ομάδας +STR_GROUP_LIVERY_TOOLTIP :{BLACK}Αλλαγή εμφάνισης της επιλεγμένης ομάδας STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Πατήστε για προστατέψετε αυτήν την ομάδα από την γενική αυτόματη αντικατάσταση STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}Διαγραφή ομάδας @@ -3554,6 +3576,7 @@ STR_BUY_VEHICLE_SHIP_CAPTION :Νέα Πλοί STR_BUY_VEHICLE_AIRCRAFT_CAPTION :Νέα Αεροσκάφη STR_PURCHASE_INFO_COST_WEIGHT :{BLACK}Κόστος: {GOLD}{CURRENCY_LONG}{BLACK} Βάρος: {GOLD}{WEIGHT_SHORT} +STR_PURCHASE_INFO_COST_REFIT_WEIGHT :{BLACK}Κόστος: {GOLD}{CURRENCY_LONG}{BLACK} (Κόστος μετατροπής: {GOLD}{CURRENCY_LONG}{BLACK}) Βάρος: {GOLD}{WEIGHT_SHORT} STR_PURCHASE_INFO_SPEED_POWER :{BLACK}Ταχύτητα: {GOLD}{VELOCITY}{BLACK} Δύναμη κινητήρα: {GOLD}{POWER} STR_PURCHASE_INFO_SPEED :{BLACK}Ταχύτητα: {GOLD}{VELOCITY} STR_PURCHASE_INFO_SPEED_OCEAN :{BLACK}Ταχύτητα στον ωκεανό: {GOLD}{VELOCITY} @@ -3564,6 +3587,7 @@ STR_PURCHASE_INFO_REFITTABLE :(μετατρέ STR_PURCHASE_INFO_DESIGNED_LIFE :{BLACK}Έτος σχεδίασης: {GOLD}{NUM}{BLACK} Χρόνος ζωής: {GOLD}{COMMA} χρόν{P ο ια} STR_PURCHASE_INFO_RELIABILITY :{BLACK}Μέγ. Αξιοπιστία: {GOLD}{COMMA}% STR_PURCHASE_INFO_COST :{BLACK}Κόστος: {GOLD}{CURRENCY_LONG} +STR_PURCHASE_INFO_COST_REFIT :{BLACK}Κόστος: {GOLD}{CURRENCY_LONG}{BLACK} (Κόστος μετατροπής: {GOLD}{CURRENCY_LONG}{BLACK}) STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Βάρος: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Κόστος: {GOLD}{CURRENCY_LONG}{BLACK} Ταχύτητα: {GOLD}{VELOCITY} STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}Κόστος: {GOLD}{CURRENCY_LONG}{BLACK} (Κόστος μετατροπής: {GOLD}{CURRENCY_LONG}{BLACK}) Ταχύτητα: {GOLD}{VELOCITY} @@ -3571,7 +3595,8 @@ STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Χωρη STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Ενισχυμένα Βαγόνια: {GOLD}+{POWER}{BLACK} Βάρος: {GOLD}+{WEIGHT_SHORT} STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Μετατρέψιμο σε: {GOLD}{STRING} STR_PURCHASE_INFO_ALL_TYPES :Όλοι οι τύποι εμπορεύματος -STR_PURCHASE_INFO_ALL_BUT :Όλοι εκτός από {CARGO_LIST} +STR_PURCHASE_INFO_NONE :Κανένα +STR_PURCHASE_INFO_ALL_BUT :Όλα εκτός από {CARGO_LIST} STR_PURCHASE_INFO_MAX_TE :{BLACK}Μέγ. Δύναμη Έλξης: {GOLD}{FORCE} STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Εύρος: {GOLD}{COMMA} τετραγωνίδια STR_PURCHASE_INFO_AIRCRAFT_TYPE :{BLACK}Τύπος αεροσκάφους: {GOLD}{STRING} @@ -3589,6 +3614,7 @@ STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Αγορ STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Αγορά και μετατροπή οχήματος STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Αγορά και μετατροπή οχήματος STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Αγορά και μετατροπή πλοίου +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Αγορά και μετατροπή του αεροσκάφους STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Αγορά του επιλεγμένου οχήματος τρένου. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Αγορά του επιλεγμένου οχήματος δρόμου. Με Shift+Κλικ εμφανίζεται το εκτιμώμενο κόστος χωρίς αγορά diff --git a/src/lang/latin.txt b/src/lang/latin.txt index bfc7157c90..56f05fe299 100644 --- a/src/lang/latin.txt +++ b/src/lang/latin.txt @@ -377,6 +377,8 @@ STR_COLOUR_ORANGE :Fulvus STR_COLOUR_BROWN :Aquilus STR_COLOUR_GREY :Canus STR_COLOUR_WHITE :Albus +STR_COLOUR_RANDOM :Fortuitus +STR_COLOUR_DEFAULT :Solitus # Units used in OpenTTD STR_UNITS_VELOCITY_IMPERIAL :{COMMA}{NBSP}mph @@ -652,6 +654,7 @@ STR_TOOLBAR_SOUND_MUSIC :Sonus musicave ############ range for message menu starts STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :Monstrare nuntium novissimum STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Historia nuntiorum +STR_NEWS_MENU_DELETE_ALL_MESSAGES :Delere omnia nuntia ############ range ends here ############ range for about menu starts @@ -1114,6 +1117,7 @@ STR_GAME_OPTIONS_CURRENCY_ZAR :Randum Africae STR_GAME_OPTIONS_CURRENCY_CUSTOM :Propria... STR_GAME_OPTIONS_CURRENCY_GEL :Lari Georgiana (GEL) STR_GAME_OPTIONS_CURRENCY_IRR :Regalis Iranica (IRR) +STR_GAME_OPTIONS_CURRENCY_RUB :Novus Rubelus Russicus (RUB) ############ end of currency region STR_GAME_OPTIONS_ROAD_VEHICLES_FRAME :{BLACK}Vehicula Viaria @@ -1376,8 +1380,8 @@ STR_CONFIG_SETTING_TRAIN_SLOPE_STEEPNESS_HELPTEXT :Arduitas tegula STR_CONFIG_SETTING_PERCENTAGE :{COMMA}% STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS :Arduitas clivorum vehiculis viariis: {STRING} STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS_HELPTEXT :Arduitas tegulae clivosae vehiculo viario. Arduitate maiore, difficultas ascendendi maior est vehiculis -STR_CONFIG_SETTING_FORBID_90_DEG :Vetare tramina et naves cursum flectere 90°: {STRING} -STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT :Tramina possunt cursum flectere in astariis aut 45° (diagonale deinde horizontale/verticale) aut 90° (horizontale deinde verticale); quoque naves possunt cursum 90° aut 45° cursum flectere. Hac electa, tantum 45° licet +STR_CONFIG_SETTING_FORBID_90_DEG :Vetare traminum cursum flectere 90°: {STRING} +STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT :Tramina possunt cursum flectere in astariis aut 45° (diagonale deinde horizontale/verticale) aut 90° (horizontale deinde verticale). Hac electa, tantum 45° licet. STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS :Sinere stationes iungi quae non contigua sunt: {STRING} STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS_HELPTEXT :Sinere partes stationi addere quae non prorsus contigua sunt. Necesse est Ctrl premere dum novae partes adduntur. STR_CONFIG_SETTING_INFLATION :Inflatio: {STRING} @@ -1433,8 +1437,8 @@ STR_CONFIG_SETTING_PLANE_SPEED :Multiplicator v STR_CONFIG_SETTING_PLANE_SPEED_HELPTEXT :Eligere si aeroplana eant lentius quam alia vehicula, ut reditus aeroplanorum minuatur STR_CONFIG_SETTING_PLANE_SPEED_VALUE :1 / {COMMA} STR_CONFIG_SETTING_PLANE_CRASHES :Calamitates aeroplanicae accidunt: {STRING} -STR_CONFIG_SETTING_PLANE_CRASHES_HELPTEXT :Eligere crebritatem calamitatum aeroplanicarum -STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Numquam +STR_CONFIG_SETTING_PLANE_CRASHES_HELPTEXT :Eligere crebritatem calamitatum aeroplanicarum.{}* Aeroplana magna tamen semper corruere possunt si aeroportui parvo appellant. +STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Numquam* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Raro STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Mediocriter STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Sinere stationes viarias pervias esse in viis oppidorum: {STRING} @@ -1998,6 +2002,7 @@ STR_CHEAT_CHANGE_DATE_QUERY_CAPT :{WHITE}Mutare a STR_CHEAT_SETUP_PROD :{LTBLUE}Sinere mutare productiones industriarum: {ORANGE}{STRING} # Livery window +STR_LIVERY_CAPTION :{WHITE}{COMPANY} Schema Coloris STR_LIVERY_GENERAL_TOOLTIP :{BLACK}Monstrare schemata coloris generalia STR_LIVERY_TRAIN_TOOLTIP :{BLACK}Monstrare schemata coloris traminum @@ -2305,7 +2310,7 @@ STR_NETWORK_CHAT_ALL :[Omnibus] {STRI STR_NETWORK_CHAT_OSKTITLE :{BLACK}Inscribere nuntium ad retis colloquium # Network messages -STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Nullae res retis inventae vel compilata sine ENABLE_NETWORK +STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Nullae res retis inventae STR_NETWORK_ERROR_NOSERVER :{WHITE}Nulli ludi in rete inventi STR_NETWORK_ERROR_NOCONNECTION :{WHITE}Nulla responsa a servatro STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Non potest iungere propter NewGRF imparia @@ -2571,9 +2576,9 @@ STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP :{BLACK}Signale STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP :{BLACK}Signale Itineris (electricum){}Signale itineris sinit plura tramina inire intra signalia eodem tempore, si tramen potest reservare iter ad destinatum tutum. Signalia itineris usitata possunt transiri a tergo STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP :{BLACK}Signale Itineris Unius Cursus (electricum){}Signale itineris sinit plura tramina inire intra signalia eodem tempore, si tramen potest reservare iter ad destinatum tutum. Signalia itineris unius cursus non possunt transiri a tergo STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Mutare Signalia{}Electa, pressio in signale facit ut mutetur in novum typum electum. Ctrl+Preme ut signale mutetur inter semaphoricum et electricum. Shift mutat inter mutationem et aestimationem monstrandam -STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}Densitas signalia trahendi -STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}Minuere densitatem signalia trahendi -STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}Augere densitatem signalia trahendi +STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}Intervallum signalia trahendi +STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}Minuere intervallum signalia trahendi +STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}Augere intervallum signalia trahendi # Bridge selection window STR_SELECT_RAIL_BRIDGE_CAPTION :{WHITE}Eligere Pontem Ferriviarium @@ -2893,7 +2898,7 @@ STR_LAI_OBJECT_DESCRIPTION_COMPANY_OWNED_LAND :Terra societati STR_ABOUT_OPENTTD :{WHITE}De OpenTTD STR_ABOUT_ORIGINAL_COPYRIGHT :{BLACK}Privilegium impressorium originale {COPYRIGHT} MCMXCV Chris Sawyer, Omnia proprietatis iura reservantur STR_ABOUT_VERSION :{BLACK}OpenTTD editio {REV} -STR_ABOUT_COPYRIGHT_OPENTTD :{BLACK}OpenTTD {COPYRIGHT} MMII-MMXVII Manus OpenTTD +STR_ABOUT_COPYRIGHT_OPENTTD :{BLACK}OpenTTD {COPYRIGHT} MMII-MMXIX Manus OpenTTD # Framerate display window ############ Leave those lines in this order!! @@ -3194,6 +3199,7 @@ STR_TOWN_POPULATION :{BLACK}Incolae STR_TOWN_VIEW_TOWN_CAPTION :{WHITE}{TOWN} STR_TOWN_VIEW_CITY_CAPTION :{WHITE}{TOWN} (Urbs) STR_TOWN_VIEW_POPULATION_HOUSES :{BLACK}Incolae: {ORANGE}{COMMA}{BLACK} Aedificia: {ORANGE}{COMMA} +STR_TOWN_VIEW_CARGO_LAST_MONTH_MAX :{BLACK}{CARGO_LIST} mensis prioris: {ORANGE}{COMMA}{BLACK} max: {ORANGE}{COMMA} STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH :{BLACK}Onera mandata ad oppidum crescendum: STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_REQUIRED_GENERAL :{ORANGE}{STRING}{RED} mandatur STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_REQUIRED_WINTER :{ORANGE}{STRING}{BLACK} hieme mandatur @@ -3246,6 +3252,7 @@ STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Largiri # Goal window STR_GOALS_CAPTION :{WHITE}{COMPANY} Proposita STR_GOALS_SPECTATOR_CAPTION :{WHITE}Proposita Universalia +STR_GOALS_SPECTATOR :Proposita universalia STR_GOALS_GLOBAL_TITLE :{BLACK}Proposita universalia: STR_GOALS_TEXT :{ORANGE}{STRING} STR_GOALS_NONE :{ORANGE}- Nullae - @@ -3555,6 +3562,7 @@ STR_GROUPS_CLICK_ON_GROUP_FOR_TOOLTIP :{BLACK}Greges - STR_GROUP_CREATE_TOOLTIP :{BLACK}Preme ut grex creatur STR_GROUP_DELETE_TOOLTIP :{BLACK}Delere gregem electam STR_GROUP_RENAME_TOOLTIP :{BLACK}Renominare gregem electam +STR_GROUP_LIVERY_TOOLTIP :{BLACK}Mutare schema coloris gregis electi STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Preme ut vehicula huius gregis custodiantur contra autocommutationem universalem STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}Gregem Delere @@ -3613,6 +3621,8 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Emere Ve STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Emere Navem STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Emere Aeroplanum +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Emere reficereque vehiculum +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Emere reficereque aeroplanum STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Emere vehiculum ferriviarium electum. Shift+Preme ut pretium monstretur sine emptione STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Emere vehiculum viarium electum. Shift+Preme ut pretium monstretur sine emptione diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index 2a423497b0..d5e5d9b643 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -321,7 +321,7 @@ STR_TOOLBAR_TOOLTIP_FORWARD :{BLACK}Aumentar STR_TOOLBAR_TOOLTIP_OPTIONS :{BLACK}Opções STR_TOOLBAR_TOOLTIP_SAVE_GAME_ABANDON_GAME :{BLACK}Guardar jogo, abandonar jogo, sair STR_TOOLBAR_TOOLTIP_DISPLAY_MAP :{BLACK}Mostrar mapa -STR_TOOLBAR_TOOLTIP_DISPLAY_TOWN_DIRECTORY :{BLACK}Mostrar lista de cidades +STR_TOOLBAR_TOOLTIP_DISPLAY_TOWN_DIRECTORY :{BLACK}Mostrar lista de localidades STR_TOOLBAR_TOOLTIP_DISPLAY_SUBSIDIES :{BLACK}Mostrar subsídios STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_STATIONS :{BLACK}Mostrar lista de estações da empresa STR_TOOLBAR_TOOLTIP_DISPLAY_COMPANY_FINANCES :{BLACK}Mostrar informações financeiras da empresa @@ -354,9 +354,9 @@ STR_SCENEDIT_TOOLBAR_SCENARIO_EDITOR :{YELLOW}Editor STR_SCENEDIT_TOOLBAR_TOOLTIP_MOVE_THE_STARTING_DATE_BACKWARD :{BLACK}Retroceder data de início 1 ano STR_SCENEDIT_TOOLBAR_TOOLTIP_MOVE_THE_STARTING_DATE_FORWARD :{BLACK}Avançar data de início 1 ano STR_SCENEDIT_TOOLBAR_TOOLTIP_SET_DATE :{BLACK}Clique para escolher o ano inicial -STR_SCENEDIT_TOOLBAR_TOOLTIP_DISPLAY_MAP_TOWN_DIRECTORY :{BLACK}Mostrar mapa, lista de cidades +STR_SCENEDIT_TOOLBAR_TOOLTIP_DISPLAY_MAP_TOWN_DIRECTORY :{BLACK}Mostrar mapa, lista de localidades STR_SCENEDIT_TOOLBAR_LANDSCAPE_GENERATION :{BLACK}Gerar terreno -STR_SCENEDIT_TOOLBAR_TOWN_GENERATION :{BLACK}Gerar cidades +STR_SCENEDIT_TOOLBAR_TOWN_GENERATION :{BLACK}Gerar localidades STR_SCENEDIT_TOOLBAR_INDUSTRY_GENERATION :{BLACK}Gerar indústrias STR_SCENEDIT_TOOLBAR_ROAD_CONSTRUCTION :{BLACK}Construir estradas STR_SCENEDIT_TOOLBAR_PLANT_TREES :{BLACK}Plantar árvores. Shift alterna contruir/mostrar custo estimado @@ -379,7 +379,7 @@ STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE :Definições STR_SETTINGS_MENU_SCRIPT_SETTINGS :Definições de IA / Scripts de Jogo STR_SETTINGS_MENU_NEWGRF_SETTINGS :Definições NewGRF STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS :Opções de Transparência -STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :Mostrar nomes de cidades +STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :Mostrar nomes de localidades STR_SETTINGS_MENU_STATION_NAMES_DISPLAYED :Mostrar nomes de estações STR_SETTINGS_MENU_WAYPOINTS_DISPLAYED :Mostrar nomes dos pontos de passagem STR_SETTINGS_MENU_SIGNS_DISPLAYED :Mostrar sinais @@ -405,8 +405,8 @@ STR_MAP_MENU_LINGRAPH_LEGEND :Legenda de flux STR_MAP_MENU_SIGN_LIST :Lista de sinais ############ range for town menu starts -STR_TOWN_MENU_TOWN_DIRECTORY :Lista de cidades -STR_TOWN_MENU_FOUND_TOWN :Fundar cidade +STR_TOWN_MENU_TOWN_DIRECTORY :Lista de localidades +STR_TOWN_MENU_FOUND_TOWN :Fundar localidade ############ range ends here ############ range for subsidies menu starts @@ -748,12 +748,12 @@ STR_SMALLMAP_LEGENDA_TREES :{TINY_FONT}{BLA STR_SMALLMAP_LEGENDA_ROCKS :{TINY_FONT}{BLACK}Rochas STR_SMALLMAP_LEGENDA_WATER :{TINY_FONT}{BLACK}Água STR_SMALLMAP_LEGENDA_NO_OWNER :{TINY_FONT}{BLACK}Sem Proprietário -STR_SMALLMAP_LEGENDA_TOWNS :{TINY_FONT}{BLACK}Cidades +STR_SMALLMAP_LEGENDA_TOWNS :{TINY_FONT}{BLACK}Localidades STR_SMALLMAP_LEGENDA_INDUSTRIES :{TINY_FONT}{BLACK}Indústrias STR_SMALLMAP_LEGENDA_DESERT :{TINY_FONT}{BLACK}Deserto STR_SMALLMAP_LEGENDA_SNOW :{TINY_FONT}{BLACK}Neve -STR_SMALLMAP_TOOLTIP_TOGGLE_TOWN_NAMES_ON_OFF :{BLACK}Mostrar/ocultar nomes das cidades no mapa +STR_SMALLMAP_TOOLTIP_TOGGLE_TOWN_NAMES_ON_OFF :{BLACK}Mostrar/ocultar nomes das localidades no mapa STR_SMALLMAP_CENTER :{BLACK}Centrar o mapa na posição actual STR_SMALLMAP_INDUSTRY :{TINY_FONT}{STRING} ({NUM}) STR_SMALLMAP_LINKSTATS :{TINY_FONT}{STRING} @@ -818,8 +818,8 @@ STR_NEWS_COMPANY_LAUNCH_DESCRIPTION :{BIG_FONT}{BLAC STR_NEWS_MERGER_TAKEOVER_TITLE :{BIG_FONT}{BLACK}{STRING} foi comprada por {STRING}! STR_PRESIDENT_NAME_MANAGER :{BLACK}{PRESIDENT_NAME}{}(Presidente) -STR_NEWS_NEW_TOWN :{BLACK}{BIG_FONT}{STRING} subsidiou a construção da nova cidade de {TOWN}! -STR_NEWS_NEW_TOWN_UNSPONSORED :{BLACK}{BIG_FONT}Uma nova cidade chamada {TOWN} foi construida! +STR_NEWS_NEW_TOWN :{BLACK}{BIG_FONT}{STRING} subsidiou a construção da nova localidade de {TOWN}! +STR_NEWS_NEW_TOWN_UNSPONSORED :{BLACK}{BIG_FONT}Uma nova localidade chamada {TOWN} foi fundada! STR_NEWS_INDUSTRY_CONSTRUCTION :{BIG_FONT}{BLACK}Nov{G 0 o o a os as} {STRING} em construção em {TOWN}! STR_NEWS_INDUSTRY_PLANTED :{BIG_FONT}{BLACK}Nov{G 0 o o a os as} {STRING} est{G 0 á á á ão ão} a ser plantad{G 0 o o a os as} em {TOWN}! @@ -941,8 +941,8 @@ STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_TOOLTIP :{BLACK}Seleccio STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_LEFT :Circular pela esquerda STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_RIGHT :Circular pela direita -STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Nomes das cidades -STR_GAME_OPTIONS_TOWN_NAMES_DROPDOWN_TOOLTIP :{BLACK}Seleccionar o estilo dos nomes das cidades +STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Nomes das localidades +STR_GAME_OPTIONS_TOWN_NAMES_DROPDOWN_TOOLTIP :{BLACK}Seleccionar o estilo dos nomes das localidades ############ start of townname region STR_GAME_OPTIONS_TOWN_NAME_ORIGINAL_ENGLISH :Inglês @@ -1175,7 +1175,7 @@ STR_CONFIG_SETTING_TRAIN_REVERSING :Desabilitar inv STR_CONFIG_SETTING_TRAIN_REVERSING_HELPTEXT :Quando activo, os combóios não podem inverter marcha em estações não-terminais, mesmo se existir um caminho mais curto para o destino seguinte com inversão STR_CONFIG_SETTING_DISASTERS :Desastres: {STRING} STR_CONFIG_SETTING_DISASTERS_HELPTEXT :Activa desastres que podem ocasionalmente bloquear ou destruir veículos ou infraestruturas -STR_CONFIG_SETTING_CITY_APPROVAL :Atitude da do Concelho Municipal em relação a reestruturação de áreas: {STRING} +STR_CONFIG_SETTING_CITY_APPROVAL :Atitude do Concelho Municipal em relação a reestruturação de áreas: {STRING} STR_CONFIG_SETTING_CITY_APPROVAL_HELPTEXT :Escolha quanto ruído e estragos ambientais causados pelas empresas afecta o rating da povoação e futuras acções de construção na área STR_CONFIG_SETTING_MAX_HEIGHTLEVEL :Altura máxima do mapa: {STRING} @@ -1185,6 +1185,8 @@ STR_CONFIG_SETTING_AUTOSLOPE :Permite altera STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :Permite alteração de terra sob edifícios e vias sem os remover STR_CONFIG_SETTING_CATCHMENT :Dimensionamento mais realista de áreas de abrangência: {STRING} STR_CONFIG_SETTING_CATCHMENT_HELPTEXT :Haver diferentes áreas de cobertura para diferentes tipos de estações e aeroportos +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES :Estações da companhia podem servir industrias equipadas com estações neutras: {STRING} +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES_HELPTEXT :Quando activo, industrias com estações incluídas (com as Petrolíferas) podem ser servidas por estações da companhia construídas nas redondezas. Quando inactivo, estas industrias só podem ser servidas pela sua própria estação. Qualquer estação da companhia não poderá servir a industria, nem a estação incluída poder servir outra entidade senão a própria industria STR_CONFIG_SETTING_EXTRADYNAMITE :Permite remover mais estradas, pontes e túneis detidos pela cidade: {STRING} STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT :Facilitar a remoçar de edifícios e infraestruturas detidas pela localidade STR_CONFIG_SETTING_TRAIN_LENGTH :Tamanho máximo de comboios: {STRING} @@ -1202,7 +1204,7 @@ STR_CONFIG_SETTING_PERCENTAGE :{COMMA}% STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS :Ângulo de inclínação para veículos rodoviários: {STRING} STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS_HELPTEXT :Declive de um quadrado inclinado para um veiculo de estrada. Valores mais altos tornam mais difícil de subir. STR_CONFIG_SETTING_FORBID_90_DEG :Proibir comboios fazer curvas de 90º: {STRING} -STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT :Curvas de 90 graus ocorrem quando uma pista horizontal é directamente seguida por outra vertical num quadrado adjacente, fazendo com que o combóio vire 90 graus quando atravessa a fronteira dos quadrados, ao invés dos habituais 45 graus para outras combinações de pistas. Também se aplica ao raio de curvatura dos navios +STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT :Curvas de 90 graus ocorrem quando uma pista horizontal é directamente seguida por outra vertical num quadrado adjacente, fazendo com que o combóio vire 90 graus quando atravessa a fronteira dos quadrados, ao invés dos habituais 45 graus para outras combinações de pistas. STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS :Permitir juntar estações não adjacentes: {STRING} STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS_HELPTEXT :Permite adicionar novas partes a uma estação sem tocar nas partes já existentes. Requer pressionar CTRL+click para adicionar as novas partes STR_CONFIG_SETTING_INFLATION :Inflação: {STRING} @@ -1247,7 +1249,7 @@ STR_CONFIG_SETTING_BRIBE_HELPTEXT :Permite que as STR_CONFIG_SETTING_ALLOW_EXCLUSIVE :Permite comprar direitos de transporte em exclusividade: {STRING} STR_CONFIG_SETTING_ALLOW_EXCLUSIVE_HELPTEXT :Se uma empresa compra direitos exclusivos de transporte para uma localidade, as estações dos concorrentes (passageiros e carga) não receberão cargo durante um ano STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS :Permite investir em edifícios: {STRING} -STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS_HELPTEXT :Permite que empresas doem dinheiro às cidades para financiar novas casas +STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS_HELPTEXT :Permite que empresas doem dinheiro às localidades para financiar novas casas STR_CONFIG_SETTING_ALLOW_FUND_ROAD :Permite financiar a reconstrução de estradas locais:{STRING} STR_CONFIG_SETTING_ALLOW_FUND_ROAD_HELPTEXT :Permite que as companhias financiem reparações de estrada para sabotar serviços rodoviários dos oponentes. STR_CONFIG_SETTING_ALLOW_GIVE_MONEY :Permite enviar dinheiro para outras empresas: {STRING} @@ -1262,7 +1264,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_HELPTEXT :Indicar a hipó STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Nenhum* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Reduzido STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal -STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Permite estações de passagem em estradas das cidades: {STRING} +STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Permite estações de passagem em estradas das localidades: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Permite construção de paragens drive-through em ruas que são prorpiedade das povoações STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Permite estações de passagem em estradas do adversário: {STRING} STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT :Permite construção de paragens drive-through em ruas que são prorpiedade de outras companhias @@ -1574,7 +1576,7 @@ STR_CONFIG_SETTING_TOWN_LAYOUT_2X2_GRID :grelha 2x2 STR_CONFIG_SETTING_TOWN_LAYOUT_3X3_GRID :grelha 3x3 STR_CONFIG_SETTING_TOWN_LAYOUT_RANDOM :Aleatório STR_CONFIG_SETTING_ALLOW_TOWN_ROADS :As localidades têm permissão para construir estradas: {STRING} -STR_CONFIG_SETTING_ALLOW_TOWN_ROADS_HELPTEXT :Permite às cidades a construção de estradas para crescimento. Desactivar para não permitir às autoridades a construção de estradas +STR_CONFIG_SETTING_ALLOW_TOWN_ROADS_HELPTEXT :Permite às localidades a construção de estradas para crescimento. Desactivar para não permitir às autoridades a construção de estradas STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS :Localidades podem construir passagens de nível: {STRING} STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS_HELPTEXT :Activar esta preferência permite às localidades construir cruzamentos nivelados STR_CONFIG_SETTING_NOISE_LEVEL :Permitir que a localidade controle o nível de ruído dos aeroportos: {STRING} @@ -1629,7 +1631,7 @@ STR_CONFIG_SETTING_LARGER_TOWNS_HELPTEXT :Quantidade de l STR_CONFIG_SETTING_LARGER_TOWNS_VALUE :1 em {COMMA} STR_CONFIG_SETTING_LARGER_TOWNS_DISABLED :Nenhum STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER :Multiplicador inicial para a dimensão das metrópoles: {STRING} -STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER_HELPTEXT :Tamanho relativo das metrópoles em relação ao tamanho normal das cidades aquando o início do jogo +STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER_HELPTEXT :Tamanho relativo das cidades em relação ao tamanho normal das localidades aquando o início do jogo STR_CONFIG_SETTING_LINKGRAPH_INTERVAL :Actualizar gráfico de distribuição a cada {STRING} dia{P 0:2 "" s} STR_CONFIG_SETTING_LINKGRAPH_INTERVAL_HELPTEXT :Tempo entre recalculos subsequentes de cada gráfico. Cada recalculo calcula os planos para cada componente do gráfico. Isto significa que um valor X para essa configuração não indica que o gráfico será todo actualizado a cada X dias. Apenas alguns componentes serão. Quanto mais curto o definir, mais tempo será necessário ao CPU para o calcular. Quanto mais longo, mais tempo levará até que a distribuição da carga inicie em novas rotas. @@ -2138,7 +2140,7 @@ STR_NETWORK_CHAT_ALL :[Todos] {STRING STR_NETWORK_CHAT_OSKTITLE :{BLACK}Introduza a mensagem para os outros jogadores # Network messages -STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Não foram encontradas interfaces de rede ou o jogo foi compilado sem ENABLE_NETWORK +STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Não foram encontradas interfaces de rede STR_NETWORK_ERROR_NOSERVER :{WHITE}Não foram encontrados jogos de rede STR_NETWORK_ERROR_NOCONNECTION :{WHITE}O servidor não respondeu ao pedido STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Impossível ligar devido a incompatibilidade de NewGRF @@ -2534,16 +2536,16 @@ STR_RESET_LANDSCAPE_CONFIRMATION_TEXT :{WHITE}Tem a ce # Town generation window (SE) STR_FOUND_TOWN_CAPTION :{WHITE}Gerar Localidades -STR_FOUND_TOWN_NEW_TOWN_BUTTON :{BLACK}Nova Cidade -STR_FOUND_TOWN_NEW_TOWN_TOOLTIP :{BLACK}Fundar nova cidade. Shift+Clique mostra apenas o custo estimado -STR_FOUND_TOWN_RANDOM_TOWN_BUTTON :{BLACK}Cidade Aleatória -STR_FOUND_TOWN_RANDOM_TOWN_TOOLTIP :{BLACK}Fundar uma cidade num local aleatório +STR_FOUND_TOWN_NEW_TOWN_BUTTON :{BLACK}Nova Localidade +STR_FOUND_TOWN_NEW_TOWN_TOOLTIP :{BLACK}Fundar nova localidade. Shift+Clique mostra apenas o custo estimado +STR_FOUND_TOWN_RANDOM_TOWN_BUTTON :{BLACK}Localidade Aleatória +STR_FOUND_TOWN_RANDOM_TOWN_TOOLTIP :{BLACK}Fundar uma localidade num local aleatório STR_FOUND_TOWN_MANY_RANDOM_TOWNS :{BLACK}Várias localidades aleatórias -STR_FOUND_TOWN_RANDOM_TOWNS_TOOLTIP :{BLACK}Cobrir o mapa com cidades colocadas aleatoriamente +STR_FOUND_TOWN_RANDOM_TOWNS_TOOLTIP :{BLACK}Cobrir o mapa com localidades colocadas aleatoriamente -STR_FOUND_TOWN_NAME_TITLE :{YELLOW}Nome da cidade: -STR_FOUND_TOWN_NAME_EDITOR_TITLE :{BLACK}Introduza o nome da cidade -STR_FOUND_TOWN_NAME_EDITOR_HELP :{BLACK}Clique para introduzir o nome da cidade +STR_FOUND_TOWN_NAME_TITLE :{YELLOW}Nome da localidade: +STR_FOUND_TOWN_NAME_EDITOR_TITLE :{BLACK}Introduza o nome da localidade +STR_FOUND_TOWN_NAME_EDITOR_HELP :{BLACK}Clique para introduzir o nome da localidade STR_FOUND_TOWN_NAME_RANDOM_BUTTON :{BLACK}Nome aleatório STR_FOUND_TOWN_NAME_RANDOM_TOOLTIP :{BLACK}Gerar novo nome aleatório @@ -2553,11 +2555,11 @@ STR_FOUND_TOWN_INITIAL_SIZE_MEDIUM_BUTTON :{BLACK}Média STR_FOUND_TOWN_INITIAL_SIZE_LARGE_BUTTON :{BLACK}Grande STR_FOUND_TOWN_SIZE_RANDOM :{BLACK}Aleatório STR_FOUND_TOWN_INITIAL_SIZE_TOOLTIP :{BLACK}Seleccione o tamanho da localidade -STR_FOUND_TOWN_CITY :{BLACK}Metrópole +STR_FOUND_TOWN_CITY :{BLACK}Cidade STR_FOUND_TOWN_CITY_TOOLTIP :{BLACK}Cidades crescem mais depressa do que as localidades normais{}Dependendo da configuração, são maiores aquando da sua fundação -STR_FOUND_TOWN_ROAD_LAYOUT :{YELLOW}Disposição de estradas na cidade: -STR_FOUND_TOWN_SELECT_TOWN_ROAD_LAYOUT :{BLACK}Seleccione disposição das estradas utilizada para esta cidade +STR_FOUND_TOWN_ROAD_LAYOUT :{YELLOW}Disposição de estradas na localidade: +STR_FOUND_TOWN_SELECT_TOWN_ROAD_LAYOUT :{BLACK}Seleccione disposição das estradas utilizada para esta localidade STR_FOUND_TOWN_SELECT_LAYOUT_ORIGINAL :{BLACK}Original STR_FOUND_TOWN_SELECT_LAYOUT_BETTER_ROADS :{BLACK}Estradas melhores STR_FOUND_TOWN_SELECT_LAYOUT_2X2_GRID :{BLACK}grelha 2x2 @@ -2803,7 +2805,7 @@ STR_MAPGEN_WORLD_GENERATION_CAPTION :{WHITE}Gerador STR_MAPGEN_MAPSIZE :{BLACK}Dim. do mapa: STR_MAPGEN_MAPSIZE_TOOLTIP :{BLACK}Seleccionar o tamanho do mapa em mosaicos. O numero de mosaicos disponiveis será ligeiramente menor STR_MAPGEN_BY :{BLACK}* -STR_MAPGEN_NUMBER_OF_TOWNS :{BLACK}Num. de cidades: +STR_MAPGEN_NUMBER_OF_TOWNS :{BLACK}Num. de localidades: STR_MAPGEN_DATE :{BLACK}Data: STR_MAPGEN_NUMBER_OF_INDUSTRIES :{BLACK}Num. de indústrias: STR_MAPGEN_MAX_HEIGHTLEVEL :{BLACK}Altura máxima do mapa: @@ -3062,16 +3064,16 @@ STR_EDIT_SIGN_PREVIOUS_SIGN_TOOLTIP :{BLACK}Ir para STR_EDIT_SIGN_SIGN_OSKTITLE :{BLACK}Introduza um nome para o sinal # Town directory window -STR_TOWN_DIRECTORY_CAPTION :{WHITE}Cidades +STR_TOWN_DIRECTORY_CAPTION :{WHITE}Localidades STR_TOWN_DIRECTORY_NONE :{ORANGE}- Nenhuma - STR_TOWN_DIRECTORY_TOWN :{ORANGE}{TOWN}{BLACK} ({COMMA}) STR_TOWN_DIRECTORY_CITY :{ORANGE}{TOWN}{YELLOW} (Cidade){BLACK} ({COMMA}) -STR_TOWN_DIRECTORY_LIST_TOOLTIP :{BLACK}Nomes das cidades - clique no nome para centrar a visualização na cidade. Ctrl+Clique abre um novo visualizador na localização da cidade +STR_TOWN_DIRECTORY_LIST_TOOLTIP :{BLACK}Nomes das localidades - clique no nome para centrar a visualização na cidade. Ctrl+Clique abre um novo visualizador na localização da localidade STR_TOWN_POPULATION :{BLACK}População Mundial: {COMMA} # Town view window STR_TOWN_VIEW_TOWN_CAPTION :{WHITE}{TOWN} -STR_TOWN_VIEW_CITY_CAPTION :{WHITE}{TOWN} (Metrópole) +STR_TOWN_VIEW_CITY_CAPTION :{WHITE}{TOWN} (Cidade) STR_TOWN_VIEW_POPULATION_HOUSES :{BLACK}População: {ORANGE}{COMMA}{BLACK} Casas: {ORANGE}{COMMA} STR_TOWN_VIEW_CARGO_LAST_MONTH_MAX :{BLACK}{CARGO_LIST} ultimo mês: {ORANGE}{COMMA}{BLACK} max: {ORANGE}{COMMA} STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH :{BLACK}Mercadoria necessária para o seu desenvolvimento: @@ -3080,28 +3082,28 @@ STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_REQUIRED_WINTER :{BLACK}No inver STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_DELIVERED_GENERAL :{ORANGE}{STRING}{GREEN} entregue STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_REQUIRED :{ORANGE}{CARGO_TINY} / {CARGO_LONG}{RED} (ainda necessário) STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_DELIVERED :{ORANGE}{CARGO_TINY} / {CARGO_LONG}{GREEN} (entregue) -STR_TOWN_VIEW_TOWN_GROWS_EVERY :{BLACK}Cidade cresce a cada {ORANGE}{COMMA}{BLACK} dia{P "" s} -STR_TOWN_VIEW_TOWN_GROWS_EVERY_FUNDED :{BLACK}Cidade cresce a cada {ORANGE}{COMMA}{BLACK} dia{P "" s} (financiado) -STR_TOWN_VIEW_TOWN_GROW_STOPPED :{BLACK}Cidade {RED}não{BLACK} está a crescer -STR_TOWN_VIEW_NOISE_IN_TOWN :{BLACK}Limite de ruído na cidade: {ORANGE}{COMMA}{BLACK} máx: {ORANGE}{COMMA} -STR_TOWN_VIEW_CENTER_TOOLTIP :{BLACK}Centrar visualização na cidade. Ctrl+Clique abre um novo visualizador na localização da cidade +STR_TOWN_VIEW_TOWN_GROWS_EVERY :{BLACK}Localidade cresce a cada {ORANGE}{COMMA}{BLACK}{NBSP}dia{P "" s} +STR_TOWN_VIEW_TOWN_GROWS_EVERY_FUNDED :{BLACK}Localidade cresce a cada {ORANGE}{COMMA}{BLACK}{NBSP}dia{P "" s} (financiado) +STR_TOWN_VIEW_TOWN_GROW_STOPPED :{BLACK}Localidade {RED}não{BLACK} está a crescer +STR_TOWN_VIEW_NOISE_IN_TOWN :{BLACK}Limite de ruído na localidade: {ORANGE}{COMMA}{BLACK} máx: {ORANGE}{COMMA} +STR_TOWN_VIEW_CENTER_TOOLTIP :{BLACK}Centrar visualização na localidade. Ctrl+Clique abre um novo visualizador na localização da localidade STR_TOWN_VIEW_LOCAL_AUTHORITY_BUTTON :{BLACK}Autoridade local STR_TOWN_VIEW_LOCAL_AUTHORITY_TOOLTIP :{BLACK}Ver informações sobre a autoridade local -STR_TOWN_VIEW_RENAME_TOOLTIP :{BLACK}Alterar o nome da cidade +STR_TOWN_VIEW_RENAME_TOOLTIP :{BLACK}Alterar o nome da localidade STR_TOWN_VIEW_EXPAND_BUTTON :{BLACK}Expandir STR_TOWN_VIEW_EXPAND_TOOLTIP :{BLACK}Aumentar o tamanho da cidade STR_TOWN_VIEW_DELETE_BUTTON :{BLACK}Apagar -STR_TOWN_VIEW_DELETE_TOOLTIP :{BLACK}Apagar completamente esta cidade +STR_TOWN_VIEW_DELETE_TOOLTIP :{BLACK}Apagar completamente esta localidade -STR_TOWN_VIEW_RENAME_TOWN_BUTTON :Renomear Cidade +STR_TOWN_VIEW_RENAME_TOWN_BUTTON :Renomear Localidade # Town local authority window STR_LOCAL_AUTHORITY_CAPTION :{WHITE}{TOWN} autoridade local STR_LOCAL_AUTHORITY_COMPANY_RATINGS :{BLACK}Avaliações da empresa de transporte: STR_LOCAL_AUTHORITY_COMPANY_RATING :{YELLOW}{COMPANY} {COMPANY_NUM}: {ORANGE}{STRING} STR_LOCAL_AUTHORITY_ACTIONS_TITLE :{BLACK}Acções disponíveis: -STR_LOCAL_AUTHORITY_ACTIONS_TOOLTIP :{BLACK}Lista de acções disponíveis nesta cidade - fazer clique no item para mais detalhes +STR_LOCAL_AUTHORITY_ACTIONS_TOOLTIP :{BLACK}Lista de acções disponíveis nesta localidade - fazer clique no item para mais detalhes STR_LOCAL_AUTHORITY_DO_IT_BUTTON :{BLACK}Aplicar STR_LOCAL_AUTHORITY_DO_IT_TOOLTIP :{BLACK}Realizar a acção destacada na lista acima @@ -3119,8 +3121,8 @@ STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}Iniciar STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}Iniciar uma campanha publicitária grande, para atrair mais passageiros e carga à sua empresa.{}Custo: {CURRENCY_LONG} STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW}Financiar a reconstrução da rede rodoviária urbana. Causa engarrafamentos consideráveis ao tráfego até 6 meses.{}Custo: {CURRENCY_LONG} STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}Construir uma estátua em honra da sua empresa.{}Custo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW}Financiar a construção de edifícios comerciais novos na cidade.{}Custo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}Comprar a exclusividade dos serviços durante 1 ano na cidade. A autoridade da cidade permitirá que os passageiros e a carga usem somente estações da sua empresa.{}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW}Financiar a construção de edifícios comerciais novos na localidade.{}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}Comprar a exclusividade dos serviços durante 1 ano nesta localidade. A autoridade local permitirá que os passageiros e a carga usem somente estações da sua empresa.{}Custo: {CURRENCY_LONG} STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Subornar a autoridade local para aumentar a sua avaliação, correndo o risco de uma penalidade severa se apanhado.{}Custo: {CURRENCY_LONG} # Goal window @@ -3134,7 +3136,7 @@ STR_GOALS_SPECTATOR_NONE :{ORANGE}- Não STR_GOALS_PROGRESS :{ORANGE}{STRING} STR_GOALS_PROGRESS_COMPLETE :{GREEN}{STRING} STR_GOALS_COMPANY_TITLE :{BLACK}Objetivos da empresa: -STR_GOALS_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Clique no objetivo para centrar a vista principal na indústria/cidade/quadrado. Ctrl+clique abre uma nova vista na localização da indústria/cidade/quadrado +STR_GOALS_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Clique no objetivo para centrar a vista principal na indústria/localidade/quadrado. Ctrl+Clique abre uma nova vista na localização da indústria/localidade/quadrado # Goal question window STR_GOAL_QUESTION_CAPTION_QUESTION :Questão @@ -3170,7 +3172,7 @@ STR_SUBSIDIES_OFFERED_FROM_TO :{ORANGE}{STRING STR_SUBSIDIES_NONE :{ORANGE}- Nenhum - STR_SUBSIDIES_SUBSIDISED_TITLE :{BLACK}Serviços já subsidiados: STR_SUBSIDIES_SUBSIDISED_FROM_TO :{ORANGE}{STRING} d{G 1 e o a os as} {STRING} para{G 2 "" " o" " a" " os" " as"} {STRING}{YELLOW} ({COMPANY}{YELLOW}, até {DATE_SHORT}) -STR_SUBSIDIES_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Clique num serviço para centrar a visualização numa indústria/cidade. Ctrl+Clique abre um novo visualizador na localização da indústria/cidade +STR_SUBSIDIES_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Clique num serviço para centrar a visualização numa indústria/localidade. Ctrl+Clique abre um novo visualizador na localização da indústria/localidade # Story book window STR_STORY_BOOK_CAPTION :{WHITE}{COMPANY} Livro de História @@ -3206,8 +3208,8 @@ STR_STATION_VIEW_ACCEPTS_BUTTON :{BLACK}Aceita STR_STATION_VIEW_ACCEPTS_TOOLTIP :{BLACK}Mostrar lista de carga aceite STR_STATION_VIEW_ACCEPTS_CARGO :{BLACK}Aceita: {WHITE}{CARGO_LIST} -STR_STATION_VIEW_EXCLUSIVE_RIGHTS_SELF :{BLACK}Esta estação tem direitos de transporte exclusivos nesta cidade. -STR_STATION_VIEW_EXCLUSIVE_RIGHTS_COMPANY :{YELLOW}{COMPANY}{BLACK} comprou direitos exclusivos de transporte nesta cidade. +STR_STATION_VIEW_EXCLUSIVE_RIGHTS_SELF :{BLACK}Esta estação tem direitos de transporte exclusivos nesta localidade. +STR_STATION_VIEW_EXCLUSIVE_RIGHTS_COMPANY :{YELLOW}{COMPANY}{BLACK} comprou direitos exclusivos de transporte nesta localidade. STR_STATION_VIEW_RATINGS_BUTTON :{BLACK}Avaliações STR_STATION_VIEW_RATINGS_TOOLTIP :{BLACK}Mostrar avaliações da estação @@ -3468,6 +3470,7 @@ STR_BUY_VEHICLE_SHIP_CAPTION :Novos Barcos STR_BUY_VEHICLE_AIRCRAFT_CAPTION :Nova Aeronave STR_PURCHASE_INFO_COST_WEIGHT :{BLACK}Custo: {GOLD}{CURRENCY_LONG}{BLACK} Peso: {GOLD}{WEIGHT_SHORT} +STR_PURCHASE_INFO_COST_REFIT_WEIGHT :{BLACK}Custo: {GOLD}{CURRENCY_LONG}{BLACK} (Custo da conversão: {GOLD}{CURRENCY_LONG}{BLACK}) Peso: {GOLD}{WEIGHT_SHORT} STR_PURCHASE_INFO_SPEED_POWER :{BLACK}Velocidade: {GOLD}{VELOCITY}{BLACK} Potência: {GOLD}{POWER} STR_PURCHASE_INFO_SPEED :{BLACK}Velocidade: {GOLD}{VELOCITY} STR_PURCHASE_INFO_SPEED_OCEAN :{BLACK}Velocidade no oceano: {GOLD}{VELOCITY} @@ -3481,6 +3484,7 @@ STR_PURCHASE_INFO_COST :{BLACK}Custo: { STR_PURCHASE_INFO_COST_REFIT :{BLACK}Custo: {GOLD}{CURRENCY_LONG}{BLACK} (Custo da adaptação: {GOLD}{CURRENCY_LONG}{BLACK}) STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Peso: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Custo: {GOLD}{CURRENCY_LONG}{BLACK} Velocidade: {GOLD}{VELOCITY} +STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}Custo: {GOLD}{CURRENCY_LONG}{BLACK} (Custo de conversão: {GOLD}{CURRENCY_LONG}{BLACK}) Velocidade: {GOLD}{VELOCITY} STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Capacidade: {GOLD}{CARGO_LONG}, {CARGO_LONG} STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Vagões Motorizados: {GOLD}+{POWER}{BLACK} Peso: {GOLD}+{WEIGHT_SHORT} STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Reconvertível para: {GOLD}{STRING} diff --git a/src/lang/russian.txt b/src/lang/russian.txt index fbc70a0399..dae1be714b 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -3649,18 +3649,21 @@ STR_BUY_VEHICLE_SHIP_CAPTION :Новый ко STR_BUY_VEHICLE_AIRCRAFT_CAPTION :Новый авиатранспорт STR_PURCHASE_INFO_COST_WEIGHT :{BLACK}Цена: {GOLD}{CURRENCY_LONG}{BLACK} Вес: {GOLD}{WEIGHT_SHORT} +STR_PURCHASE_INFO_COST_REFIT_WEIGHT :{BLACK}Цена: {GOLD}{CURRENCY_LONG}{BLACK} (Стоимость переоборудования: {GOLD}{CURRENCY_LONG}{BLACK}) Вес: {GOLD}{WEIGHT_SHORT} STR_PURCHASE_INFO_SPEED_POWER :{BLACK}Скорость: {GOLD}{VELOCITY}{BLACK} Мощность: {GOLD}{POWER} STR_PURCHASE_INFO_SPEED :{BLACK}Скорость: {GOLD}{VELOCITY} -STR_PURCHASE_INFO_SPEED_OCEAN :{BLACK}Скорость по океану: {GOLD}{VELOCITY} -STR_PURCHASE_INFO_SPEED_CANAL :{BLACK}Скорость по каналу/реке: {GOLD}{VELOCITY} +STR_PURCHASE_INFO_SPEED_OCEAN :{BLACK}Скорость в море: {GOLD}{VELOCITY} +STR_PURCHASE_INFO_SPEED_CANAL :{BLACK}Скорость в каналах и реках: {GOLD}{VELOCITY} STR_PURCHASE_INFO_RUNNINGCOST :{BLACK}Стоимость обслуживания: {GOLD}{CURRENCY_LONG}/год STR_PURCHASE_INFO_CAPACITY :{BLACK}Ёмкость: {GOLD}{CARGO_LONG} {STRING} STR_PURCHASE_INFO_REFITTABLE :(переоб.) STR_PURCHASE_INFO_DESIGNED_LIFE :{BLACK}Разработан в {GOLD}{NUM} г.{BLACK} Срок службы: {GOLD}{COMMA} {P год года лет} STR_PURCHASE_INFO_RELIABILITY :{BLACK}Макс. надёжность: {GOLD}{COMMA}% STR_PURCHASE_INFO_COST :{BLACK}Цена: {GOLD}{CURRENCY_LONG} +STR_PURCHASE_INFO_COST_REFIT :{BLACK}Цена: {GOLD}{CURRENCY_LONG}{BLACK} (Стоимость переоборудования: {GOLD}{CURRENCY_LONG}{BLACK}) STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Вес: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Цена: {GOLD}{CURRENCY_LONG}{BLACK} Скорость: {GOLD}{VELOCITY} +STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}Цена: {GOLD}{CURRENCY_LONG}{BLACK} (Стоимость переоборудования: {GOLD}{CURRENCY_LONG}{BLACK}) Скорость: {GOLD}{VELOCITY} STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Ёмкость: {GOLD}{CARGO_LONG}, {CARGO_LONG} STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Ведущие вагоны: {GOLD}+{POWER}{BLACK} Вес: {GOLD}+{WEIGHT_SHORT} STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Может перевозить: {GOLD}{STRING} @@ -3681,12 +3684,20 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Купи STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Купить STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Купить +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Купить и переоборудовать +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Купить и переоборудовать +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Купить и переоборудовать +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Купить и переоборудовать -STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Купить выбранный локомотив/вагон. Shift+щелчок - оценка стоимости покупки. -STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Купить выбранный автомобиль. Shift+щелчок - оценка стоимости покупки. -STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Купить выбранный корабль. Shift+щелчок - оценка стоимости покупки. -STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Купить выбранный авиатранспорт. Shift+щелчок - оценка стоимости покупки. +STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Приобрести выбранный локомотив/вагон. Shift+щелчок покажет ориентировочную стоимость покупки. +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Приобрести выбранный автомобиль. Shift+щелчок покажет ориентировочную стоимость покупки. +STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Приобрести выбранное судно. Shift+щелчок покажет ориентировочную стоимость покупки. +STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Приобрести выбранное воздушное судно. Shift+щелчок покажет ориентировочную стоимость покупки. +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Приобрести и переоборудовать выбранный локомотив/вагон. Shift+щелчок покажет ориентировочную стоимость покупки. +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Приобрести и переоборудовать выбранный автомобиль. Shift+щелчок покажет ориентировочную стоимость покупки. +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Приобрести и переоборудовать выбранное судно. Shift+щелчок покажет ориентировочную стоимость покупки. +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Приобрести и переоборудовать выбранное воздушное судно. Shift+щелчок покажет ориентировочную стоимость покупки. STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Переименовать STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_BUTTON :{BLACK}Переименовать From 4b349c0f90c3f7b6a39171cec41cd98dcd0d88b7 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Thu, 20 Sep 2018 22:41:43 +0100 Subject: [PATCH 47/82] Codechange: [core] Implement SmallVector using std::vector The public and protected interface to SmallVector are unchanged SmallVector now requires that items be default constructible This isn't an issue since some contained items were previously created uninitialized. Temporary default constructors are added to the following structs - SmallPair - SmallStackItem - GRFPresence Where vector is required, transition immediately to std::vector to avoid returning proxy object references. --- src/core/smallmap_type.hpp | 51 +++++++++---- src/core/smallstack_type.hpp | 1 + src/core/smallvec_type.hpp | 135 +++++++++++---------------------- src/fios_gui.cpp | 4 +- src/gamelog.cpp | 1 + src/script/squirrel_helper.hpp | 2 +- src/sortlist_type.h | 12 +-- 7 files changed, 90 insertions(+), 116 deletions(-) diff --git a/src/core/smallmap_type.hpp b/src/core/smallmap_type.hpp index dda0fc2a1e..44ace6b45b 100644 --- a/src/core/smallmap_type.hpp +++ b/src/core/smallmap_type.hpp @@ -27,6 +27,7 @@ struct SmallPair { /** Initializes this Pair with data */ inline SmallPair(const T &first, const U &second) : first(first), second(second) { } + SmallPair() = default; }; /** @@ -56,8 +57,8 @@ struct SmallMap : SmallVector, S> { */ inline const Pair *Find(const T &key) const { - for (uint i = 0; i < this->items; i++) { - if (key == this->data[i].first) return &this->data[i]; + for (uint i = 0; i < std::vector::size(); i++) { + if (key == std::vector::operator[](i).first) return &std::vector::operator[](i); } return this->End(); } @@ -69,12 +70,23 @@ struct SmallMap : SmallVector, S> { */ inline Pair *Find(const T &key) { - for (uint i = 0; i < this->items; i++) { - if (key == this->data[i].first) return &this->data[i]; + for (uint i = 0; i < std::vector::size(); i++) { + if (key == std::vector::operator[](i).first) return &std::vector::operator[](i); } return this->End(); } + inline const Pair *End() const + { + return &*std::vector::end(); + } + + inline Pair *End() + { + return &*std::vector::end(); + } + + /** * Tests whether a key is assigned in this map. * @param key key to test @@ -85,6 +97,16 @@ struct SmallMap : SmallVector, S> { return this->Find(key) != this->End(); } + /** + * Tests whether a key is assigned in this map. + * @param key key to test + * @return true iff the item is present + */ + inline bool Contains(const T &key) + { + return this->Find(key) != this->End(); + } + /** * Removes given pair from this map * @param pair pair to remove @@ -93,7 +115,7 @@ struct SmallMap : SmallVector, S> { inline void Erase(Pair *pair) { assert(pair >= this->Begin() && pair < this->End()); - *pair = this->data[--this->items]; + SmallVector::Erase(pair); } /** @@ -104,13 +126,12 @@ struct SmallMap : SmallVector, S> { */ inline bool Erase(const T &key) { - for (uint i = 0; i < this->items; i++) { - if (key == this->data[i].first) { - this->data[i] = this->data[--this->items]; - return true; - } - } - return false; + Pair *pair = this->Find(key); + if (pair == this->End()) + return false; + + SmallVector::Erase(pair); + return true; } /** @@ -136,8 +157,8 @@ struct SmallMap : SmallVector, S> { */ inline U &operator[](const T &key) { - for (uint i = 0; i < this->items; i++) { - if (key == this->data[i].first) return this->data[i].second; + for (uint i = 0; i < std::vector::size(); i++) { + if (key == std::vector::operator[](i).first) return std::vector::operator[](i).second; } Pair *n = this->Append(); n->first = key; @@ -146,7 +167,7 @@ struct SmallMap : SmallVector, S> { inline void SortByKey() { - QSortT(this->Begin(), this->items, KeySorter); + QSortT(this->Begin(), std::vector::size(), KeySorter); } static int CDECL KeySorter(const Pair *a, const Pair *b) diff --git a/src/core/smallstack_type.hpp b/src/core/smallstack_type.hpp index 06b5aaafa6..b053c32a85 100644 --- a/src/core/smallstack_type.hpp +++ b/src/core/smallstack_type.hpp @@ -106,6 +106,7 @@ struct SmallStackItem { */ inline SmallStackItem(const Titem &value, Tindex next) : next(next), value(value) {} + SmallStackItem() = default; }; /** diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 588dd599dc..795435d7ac 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -14,6 +14,8 @@ #include "alloc_func.hpp" #include "mem_func.hpp" +#include +#include /** * Simple vector template class. @@ -26,43 +28,30 @@ * @tparam S The steps of allocation */ template -class SmallVector { -protected: - T *data; ///< The pointer to the first item - uint items; ///< The number of items stored - uint capacity; ///< The available space for storing items - +class SmallVector : public std::vector { public: - SmallVector() : data(NULL), items(0), capacity(0) { } + SmallVector() = default; /** * Copy constructor. * @param other The other vector to copy. */ - SmallVector(const SmallVector &other) : data(NULL), items(0), capacity(0) - { - this->Assign(other); - } + SmallVector(const SmallVector &other) = default; /** * Generic copy constructor. * @param other The other vector to copy. */ template - SmallVector(const SmallVector &other) : data(NULL), items(0), capacity(0) + SmallVector(const SmallVector &other) : std::vector(other) { - this->Assign(other); } /** * Assignment. * @param other The other vector to assign. */ - SmallVector &operator=(const SmallVector &other) - { - this->Assign(other); - return *this; - } + SmallVector &operator=(const SmallVector &other) = default; /** * Generic assignment. @@ -75,10 +64,7 @@ public: return *this; } - ~SmallVector() - { - free(this->data); - } + ~SmallVector() = default; /** * Assign items from other vector. @@ -88,8 +74,7 @@ public: { if ((const void *)&other == (void *)this) return; - this->Clear(); - if (other.Length() > 0) MemCpyT(this->Append(other.Length()), other.Begin(), other.Length()); + std::vector::operator=(other); } /** @@ -97,10 +82,7 @@ public: */ inline void Clear() { - /* In fact we just reset the item counter avoiding the need to - * probably reallocate the same amount of memory the list was - * previously using. */ - this->items = 0; + std::vector::clear(); } /** @@ -108,10 +90,8 @@ public: */ inline void Reset() { - this->items = 0; - this->capacity = 0; - free(data); - data = NULL; + std::vector::clear(); + std::vector::shrink_to_fit(); } /** @@ -119,11 +99,7 @@ public: */ inline void Compact() { - uint capacity = Align(this->items, S); - if (capacity >= this->capacity) return; - - this->capacity = capacity; - this->data = ReallocT(this->data, this->capacity); + std::vector::shrink_to_fit(); } /** @@ -133,15 +109,8 @@ public: */ inline T *Append(uint to_add = 1) { - uint begin = this->items; - this->items += to_add; - - if (this->items > this->capacity) { - this->capacity = Align(this->items, S); - this->data = ReallocT(this->data, this->capacity); - } - - return &this->data[begin]; + std::vector::resize(std::vector::size() + to_add); + return this->End() - to_add; } /** @@ -150,12 +119,7 @@ public: */ inline void Resize(uint num_items) { - this->items = num_items; - - if (this->items > this->capacity) { - this->capacity = Align(this->items, S); - this->data = ReallocT(this->data, this->capacity); - } + std::vector::resize(num_items); } /** @@ -167,11 +131,8 @@ public: { assert(item >= this->Begin() && item <= this->End()); - size_t to_move = this->End() - item; size_t start = item - this->Begin(); - - this->Append(); - if (to_move > 0) MemMoveT(this->Begin() + start + 1, this->Begin() + start, to_move); + std::vector::insert(std::vector::begin() + start); return this->Begin() + start; } @@ -211,14 +172,8 @@ public: */ inline int FindIndex(const T &item) const { - int index = 0; - const T *pos = this->Begin(); - const T *end = this->End(); - while (pos != end && *pos != item) { - pos++; - index++; - } - return pos == end ? -1 : index; + auto const it = this->Find(item); + return it == this->End() ? -1 : it - this->Begin(); } /** @@ -240,7 +195,8 @@ public: inline void Erase(T *item) { assert(item >= this->Begin() && item < this->End()); - *item = this->data[--this->items]; + *item = std::vector::back(); + std::vector::pop_back(); } /** @@ -250,7 +206,8 @@ public: */ void ErasePreservingOrder(uint pos, uint count = 1) { - ErasePreservingOrder(this->data + pos, count); + auto const it = std::vector::begin() + pos; + std::vector::erase(it, it + count); } /** @@ -260,13 +217,7 @@ public: */ inline void ErasePreservingOrder(T *item, uint count = 1) { - if (count == 0) return; - assert(item >= this->Begin()); - assert(item + count <= this->End()); - - this->items -= count; - ptrdiff_t to_move = this->End() - item; - if (to_move > 0) MemMoveT(item, item + count, to_move); + this->ErasePreservingOrder(item - this->Begin(), count); } /** @@ -289,7 +240,7 @@ public: */ inline uint Length() const { - return this->items; + return std::vector::size(); } /** @@ -299,7 +250,7 @@ public: */ inline const T *Begin() const { - return this->data; + return std::vector::data(); } /** @@ -309,7 +260,7 @@ public: */ inline T *Begin() { - return this->data; + return std::vector::data(); } /** @@ -319,7 +270,7 @@ public: */ inline const T *End() const { - return &this->data[this->items]; + return std::vector::data() + std::vector::size(); } /** @@ -329,7 +280,7 @@ public: */ inline T *End() { - return &this->data[this->items]; + return std::vector::data() + std::vector::size(); } /** @@ -341,8 +292,8 @@ public: inline const T *Get(uint index) const { /* Allow access to the 'first invalid' item */ - assert(index <= this->items); - return &this->data[index]; + assert(index <= std::vector::size()); + return this->Begin() + index; } /** @@ -354,8 +305,8 @@ public: inline T *Get(uint index) { /* Allow access to the 'first invalid' item */ - assert(index <= this->items); - return &this->data[index]; + assert(index <= std::vector::size()); + return this->Begin() + index; } /** @@ -366,8 +317,8 @@ public: */ inline const T &operator[](uint index) const { - assert(index < this->items); - return this->data[index]; + assert(index < std::vector::size()); + return std::vector::operator[](index); } /** @@ -378,8 +329,8 @@ public: */ inline T &operator[](uint index) { - assert(index < this->items); - return this->data[index]; + assert(index < std::vector::size()); + return std::vector::operator[](index); } }; @@ -407,11 +358,11 @@ public: */ inline void Clear() { - for (uint i = 0; i < this->items; i++) { - free(this->data[i]); + for (uint i = 0; i < std::vector::size(); i++) { + free(std::vector::operator[](i)); } - this->items = 0; + std::vector::clear(); } }; @@ -438,11 +389,11 @@ public: */ inline void Clear() { - for (uint i = 0; i < this->items; i++) { - delete this->data[i]; + for (uint i = 0; i < std::vector::size(); i++) { + delete std::vector::operator[](i); } - this->items = 0; + std::vector::clear(); } }; diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index f2f96cd283..f4a2f497bd 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -279,7 +279,7 @@ private: StringFilter string_filter; ///< Filter for available games. QueryString filter_editbox; ///< Filter editbox; - SmallVector fios_items_shown; ///< Map of the filtered out fios items + std::vector fios_items_shown; ///< Map of the filtered out fios items static void SaveGameConfirmationCallback(Window *w, bool confirmed) { @@ -824,7 +824,7 @@ public: case SLIWD_FILTER_CHANGES: /* Filter changes */ - this->fios_items_shown.Resize(this->fios_items.Length()); + this->fios_items_shown.resize(this->fios_items.Length()); uint items_shown_count = 0; ///< The number of items shown in the list /* We pass through every fios item */ for (uint i = 0; i < this->fios_items.Length(); i++) { diff --git a/src/gamelog.cpp b/src/gamelog.cpp index 29910d7ad1..1698dadad8 100644 --- a/src/gamelog.cpp +++ b/src/gamelog.cpp @@ -178,6 +178,7 @@ struct GRFPresence{ bool was_missing; ///< Grf was missing during some gameload in the past GRFPresence(const GRFConfig *gc) : gc(gc), was_missing(false) {} + GRFPresence() = default; }; typedef SmallMap GrfIDMapping; diff --git a/src/script/squirrel_helper.hpp b/src/script/squirrel_helper.hpp index 22d738d4f7..002c561069 100644 --- a/src/script/squirrel_helper.hpp +++ b/src/script/squirrel_helper.hpp @@ -32,7 +32,7 @@ namespace SQConvert { struct SQAutoFreePointers : SmallVector { ~SQAutoFreePointers() { - for (uint i = 0; i < this->items; i++) free(this->data[i]); + for (uint i = 0; i < std::vector::size(); i++) free(std::vector::operator[](i)); } }; diff --git a/src/sortlist_type.h b/src/sortlist_type.h index 1a30c3b1a8..74b6f37b35 100644 --- a/src/sortlist_type.h +++ b/src/sortlist_type.h @@ -67,7 +67,7 @@ protected: */ bool IsSortable() const { - return (this->data != NULL && this->items >= 2); + return std::vector::size() >= 2; } /** @@ -240,7 +240,7 @@ public: { this->flags ^= VL_DESC; - if (this->IsSortable()) MemReverseT(this->data, this->items); + if (this->IsSortable()) MemReverseT(std::vector::data(), std::vector::size()); } /** @@ -270,11 +270,11 @@ public: if (this->flags & VL_FIRST_SORT) { CLRBITS(this->flags, VL_FIRST_SORT); - QSortT(this->data, this->items, compare, desc); + QSortT(std::vector::data(), std::vector::size(), compare, desc); return true; } - GSortT(this->data, this->items, compare, desc); + GSortT(std::vector::data(), std::vector::size(), compare, desc); return true; } @@ -337,8 +337,8 @@ public: if (!(this->flags & VL_FILTER)) return false; bool changed = false; - for (uint iter = 0; iter < this->items;) { - T *item = &this->data[iter]; + for (uint iter = 0; iter < std::vector::size();) { + T *item = &std::vector::operator[](iter); if (!decide(item, filter_data)) { this->Erase(item); changed = true; From bfd79e59dc34314a089a0024af56d04d84456ebd Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Thu, 20 Sep 2018 23:44:14 +0100 Subject: [PATCH 48/82] Codechange: Replace SmallVector::Clear() with std::vector::clear() --- src/animated_tile.cpp | 2 +- src/autoreplace_gui.cpp | 4 ++-- src/build_vehicle_gui.cpp | 8 ++++---- src/command.cpp | 8 ++++---- src/company_gui.cpp | 4 ++-- src/core/smallvec_type.hpp | 8 -------- src/economy.cpp | 2 +- src/engine.cpp | 2 +- src/fios.h | 2 +- src/fios_gui.cpp | 2 +- src/gfx_layout.cpp | 4 ++-- src/graph_gui.cpp | 2 +- src/group_gui.cpp | 4 ++-- src/hotkeys.cpp | 2 +- src/industry_gui.cpp | 6 +++--- src/network/core/tcp_listen.h | 2 +- src/network/core/udp.cpp | 2 +- src/network/network_content.cpp | 8 ++++---- src/network/network_content_gui.cpp | 2 +- src/network/network_gui.cpp | 2 +- src/network/network_udp.cpp | 2 +- src/newgrf.cpp | 10 +++++----- src/newgrf_commons.cpp | 2 +- src/newgrf_gui.cpp | 2 +- src/newgrf_sound.cpp | 2 +- src/rail_cmd.cpp | 2 +- src/saveload/afterload.cpp | 2 +- src/saveload/animated_tile_sl.cpp | 2 +- src/saveload/engine_sl.cpp | 2 +- src/saveload/labelmaps_sl.cpp | 4 ++-- src/saveload/waypoint_sl.cpp | 4 ++-- src/settingsgen/settingsgen.cpp | 2 +- src/signs_gui.cpp | 2 +- src/station_gui.cpp | 6 +++--- src/story_gui.cpp | 4 ++-- src/strgen/strgen_base.cpp | 2 +- src/string.cpp | 4 ++-- src/textfile_gui.cpp | 2 +- src/town_cmd.cpp | 2 +- src/town_gui.cpp | 2 +- src/train_gui.cpp | 2 +- src/vehicle.cpp | 2 +- src/vehicle_cmd.cpp | 4 ++-- src/vehicle_gui.cpp | 4 ++-- src/vehiclelist.cpp | 6 +++--- src/viewport.cpp | 10 +++++----- src/window.cpp | 4 ++-- 47 files changed, 80 insertions(+), 88 deletions(-) diff --git a/src/animated_tile.cpp b/src/animated_tile.cpp index 2a4cd89583..5d43848202 100644 --- a/src/animated_tile.cpp +++ b/src/animated_tile.cpp @@ -75,5 +75,5 @@ void AnimateAnimatedTiles() */ void InitializeAnimatedTiles() { - _animated_tiles.Clear(); + _animated_tiles.clear(); } diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 3a8a7543d5..356058e938 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -123,7 +123,7 @@ class ReplaceVehicleWindow : public Window { byte side = draw_left ? 0 : 1; GUIEngineList *list = &this->engines[side]; - list->Clear(); + list->clear(); const Engine *e; FOR_ALL_ENGINES_OF_TYPE(e, type) { @@ -170,7 +170,7 @@ class ReplaceVehicleWindow : public Window { /* Either we got a request to rebuild the right engines list, or the left engines list selected a different engine */ if (this->sel_engine[0] == INVALID_ENGINE) { /* Always empty the right engines list when nothing is selected in the left engines list */ - this->engines[1].Clear(); + this->engines[1].clear(); this->sel_engine[1] = INVALID_ENGINE; } else { if (this->reset_sel_engine && this->sel_engine[0] != INVALID_ENGINE) { diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index a086feccce..e160d6daca 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1228,7 +1228,7 @@ struct BuildVehicleWindow : Window { this->filter.railtype = (this->listview_mode) ? RAILTYPE_END : GetRailType(this->window_number); - this->eng_list.Clear(); + this->eng_list.clear(); /* Make list of all available train engines and wagons. * Also check to see if the previously selected engine is still available, @@ -1276,7 +1276,7 @@ struct BuildVehicleWindow : Window { { EngineID sel_id = INVALID_ENGINE; - this->eng_list.Clear(); + this->eng_list.clear(); const Engine *e; FOR_ALL_ENGINES_OF_TYPE(e, VEH_ROAD) { @@ -1295,7 +1295,7 @@ struct BuildVehicleWindow : Window { void GenerateBuildShipList() { EngineID sel_id = INVALID_ENGINE; - this->eng_list.Clear(); + this->eng_list.clear(); const Engine *e; FOR_ALL_ENGINES_OF_TYPE(e, VEH_SHIP) { @@ -1314,7 +1314,7 @@ struct BuildVehicleWindow : Window { { EngineID sel_id = INVALID_ENGINE; - this->eng_list.Clear(); + this->eng_list.clear(); const Station *st = this->listview_mode ? NULL : Station::GetByTile(this->window_number); diff --git a/src/command.cpp b/src/command.cpp index 7500a170bd..b914563fc4 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -469,7 +469,7 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, DoCommandFlag flags, /* only execute the test call if it's toplevel, or we're not execing. */ if (_docommand_recursive == 1 || !(flags & DC_EXEC) ) { - if (_docommand_recursive == 1) _cleared_object_areas.Clear(); + if (_docommand_recursive == 1) _cleared_object_areas.clear(); SetTownRatingTestMode(true); res = proc(tile, flags & ~DC_EXEC, p1, p2, text); SetTownRatingTestMode(false); @@ -492,7 +492,7 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, DoCommandFlag flags, /* Execute the command here. All cost-relevant functions set the expenses type * themselves to the cost object at some point */ - if (_docommand_recursive == 1) _cleared_object_areas.Clear(); + if (_docommand_recursive == 1) _cleared_object_areas.clear(); res = proc(tile, flags, p1, p2, text); if (res.Failed()) { error: @@ -666,7 +666,7 @@ CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, bool test_and_exec_can_differ = (cmd_flags & CMD_NO_TEST) != 0; /* Test the command. */ - _cleared_object_areas.Clear(); + _cleared_object_areas.clear(); SetTownRatingTestMode(true); BasePersistentStorageArray::SwitchMode(PSM_ENTER_TESTMODE); CommandCost res = proc(tile, flags, p1, p2, text); @@ -710,7 +710,7 @@ CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, /* Actually try and execute the command. If no cost-type is given * use the construction one */ - _cleared_object_areas.Clear(); + _cleared_object_areas.clear(); BasePersistentStorageArray::SwitchMode(PSM_ENTER_COMMAND); CommandCost res2 = proc(tile, flags | DC_EXEC, p1, p2, text); BasePersistentStorageArray::SwitchMode(PSM_LEAVE_COMMAND); diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 58f972364b..ba82b44b8c 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -652,8 +652,8 @@ private: { if (!this->groups.NeedRebuild()) return; - this->groups.Clear(); - this->indents.Clear(); + this->groups.clear(); + this->indents.clear(); if (this->livery_class >= LC_GROUP_RAIL) { GUIGroupList list; diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 795435d7ac..89fdd13697 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -77,14 +77,6 @@ public: std::vector::operator=(other); } - /** - * Remove all items from the list. - */ - inline void Clear() - { - std::vector::clear(); - } - /** * Remove all items from the list and free allocated memory. */ diff --git a/src/economy.cpp b/src/economy.cpp index bf520c3f6f..d306fd0bab 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1949,7 +1949,7 @@ void LoadUnloadStation(Station *st) for (Industry **iid = _cargo_delivery_destinations.Begin(); iid != isend; iid++) { TriggerIndustryProduction(*iid); } - _cargo_delivery_destinations.Clear(); + _cargo_delivery_destinations.clear(); } /** diff --git a/src/engine.cpp b/src/engine.cpp index d539a48520..e0536e7ba8 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -487,7 +487,7 @@ StringID Engine::GetAircraftTypeText() const */ void EngineOverrideManager::ResetToDefaultMapping() { - this->Clear(); + this->clear(); for (VehicleType type = VEH_TRAIN; type <= VEH_AIRCRAFT; type++) { for (uint internal_id = 0; internal_id < _engine_counts[type]; internal_id++) { EngineIDMapping *eid = this->Append(); diff --git a/src/fios.h b/src/fios.h index 24c9f370eb..788ac654f5 100644 --- a/src/fios.h +++ b/src/fios.h @@ -185,7 +185,7 @@ public: /** Remove all items from the list. */ inline void Clear() { - this->files.Clear(); + this->files.clear(); } /** Compact the list down to the smallest block size boundary. */ diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index f4a2f497bd..49c1deac37 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -61,7 +61,7 @@ void LoadCheckData::Clear() for (CompanyPropertiesMap::iterator it = this->companies.Begin(); it != end; it++) { delete it->second; } - companies.Clear(); + companies.clear(); GamelogFree(this->gamelog_action, this->gamelog_actions); this->gamelog_action = NULL; diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index 3bf490da67..f0fb391071 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -600,7 +600,7 @@ static inline void GetLayouter(Layouter::LineCacheItem &line, const char *&str, Font *f = Layouter::GetFont(state.fontsize, state.cur_colour); line.buffer = buff_begin; - fontMapping.Clear(); + fontMapping.clear(); /* * Go through the whole string while adding Font instances to the font map @@ -847,7 +847,7 @@ void Layouter::ResetFontCache(FontSize size) for (FontColourMap::iterator it = fonts[size].Begin(); it != fonts[size].End(); ++it) { delete it->second; } - fonts[size].Clear(); + fonts[size].clear(); /* We must reset the linecache since it references the just freed fonts */ ResetLineCache(); diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index d74f833cee..c459e2a03b 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -1136,7 +1136,7 @@ private: { if (!this->companies.NeedRebuild()) return; - this->companies.Clear(); + this->companies.clear(); const Company *c; FOR_ALL_COMPANIES(c) { diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 299bf58ccd..bd8f37ec56 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -167,8 +167,8 @@ private: { if (!this->groups.NeedRebuild()) return; - this->groups.Clear(); - this->indents.Clear(); + this->groups.clear(); + this->indents.clear(); GUIGroupList list; diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp index 12bd827fa5..c88d4499a3 100644 --- a/src/hotkeys.cpp +++ b/src/hotkeys.cpp @@ -273,7 +273,7 @@ void HotkeyList::Load(IniFile *ini) for (Hotkey *hotkey = this->items; hotkey->name != NULL; ++hotkey) { IniItem *item = group->GetItem(hotkey->name, false); if (item != NULL) { - hotkey->keycodes.Clear(); + hotkey->keycodes.clear(); if (item->value != NULL) ParseHotkeys(hotkey, item->value); } } diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 898786ff7d..4fa3501284 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -1202,7 +1202,7 @@ protected: void BuildSortIndustriesList() { if (this->industries.NeedRebuild()) { - this->industries.Clear(); + this->industries.clear(); const Industry *i; FOR_ALL_INDUSTRIES(i) { @@ -2414,7 +2414,7 @@ struct IndustryCargoesWindow : public Window { _displayed_industries.reset(); _displayed_industries.set(it); - this->fields.Clear(); + this->fields.clear(); CargoesRow *row = this->fields.Append(); row->columns[0].MakeHeader(STR_INDUSTRY_CARGOES_PRODUCERS); row->columns[1].MakeEmpty(CFT_SMALL_EMPTY); @@ -2492,7 +2492,7 @@ struct IndustryCargoesWindow : public Window { this->ind_cargo = cid + NUM_INDUSTRYTYPES; _displayed_industries.reset(); - this->fields.Clear(); + this->fields.clear(); CargoesRow *row = this->fields.Append(); row->columns[0].MakeHeader(STR_INDUSTRY_CARGOES_PRODUCERS); row->columns[1].MakeEmpty(CFT_SMALL_EMPTY); diff --git a/src/network/core/tcp_listen.h b/src/network/core/tcp_listen.h index 21bcaea3c0..b9f987190f 100644 --- a/src/network/core/tcp_listen.h +++ b/src/network/core/tcp_listen.h @@ -164,7 +164,7 @@ public: for (SocketList::iterator s = sockets.Begin(); s != sockets.End(); s++) { closesocket(s->second); } - sockets.Clear(); + sockets.clear(); DEBUG(net, 1, "[%s] closed listeners", Tsocket::GetName()); } }; diff --git a/src/network/core/udp.cpp b/src/network/core/udp.cpp index 4a2f773682..83c14d2b05 100644 --- a/src/network/core/udp.cpp +++ b/src/network/core/udp.cpp @@ -62,7 +62,7 @@ void NetworkUDPSocketHandler::Close() for (SocketList::iterator s = this->sockets.Begin(); s != this->sockets.End(); s++) { closesocket(s->second); } - this->sockets.Clear(); + this->sockets.clear(); } NetworkRecvStatus NetworkUDPSocketHandler::CloseConnection(bool error) diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index 786f1c04a6..0ef0606281 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -981,7 +981,7 @@ void ClientNetworkContentSocketHandler::CheckDependencyState(ContentInfo *ci) if (c->state != ContentInfo::AUTOSELECTED) continue; /* Only unselect when WE are the only parent. */ - parents.Clear(); + parents.clear(); this->ReverseLookupDependency(parents, c); /* First check whether anything depends on us */ @@ -1000,7 +1000,7 @@ void ClientNetworkContentSocketHandler::CheckDependencyState(ContentInfo *ci) if (force_selection) continue; /* "Flood" search to find all items in the dependency graph*/ - parents.Clear(); + parents.clear(); this->ReverseLookupTreeDependency(parents, c); /* Is there anything that is "force" selected?, if so... we're done. */ @@ -1033,8 +1033,8 @@ void ClientNetworkContentSocketHandler::Clear() { for (ContentIterator iter = this->infos.Begin(); iter != this->infos.End(); iter++) delete *iter; - this->infos.Clear(); - this->requested.Clear(); + this->infos.clear(); + this->requested.clear(); } /*** CALLBACK ***/ diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 406c6aa052..2ac7e6b12b 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -385,7 +385,7 @@ class NetworkContentListWindow : public Window, ContentCallback { if (!this->content.NeedRebuild()) return; /* Create temporary array of games to use for listing */ - this->content.Clear(); + this->content.clear(); bool all_available = true; diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index b12aaa8239..1366906b88 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -250,7 +250,7 @@ protected: if (!this->servers.NeedRebuild()) return; /* Create temporary array of games to use for listing */ - this->servers.Clear(); + this->servers.clear(); for (NetworkGameList *ngl = _network_game_list; ngl != NULL; ngl = ngl->next) { *this->servers.Append() = ngl; diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp index cee230c888..b416ee98e3 100644 --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -668,7 +668,7 @@ void NetworkUDPInitialize() GetBindAddresses(&server, _settings_client.network.server_port); _udp_server_socket = new ServerNetworkUDPSocketHandler(&server); - server.Clear(); + server.clear(); GetBindAddresses(&server, 0); _udp_master_socket = new MasterNetworkUDPSocketHandler(&server); diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 2fc546d4eb..e26577353b 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -1906,7 +1906,7 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte if (_cur.skip_sprites < 0) return CIR_DISABLED; static SmallVector tmp_layout; - tmp_layout.Clear(); + tmp_layout.clear(); for (;;) { /* no relative bounding box support */ DrawTileSeqStruct *dtss = tmp_layout.Append(); @@ -2591,7 +2591,7 @@ static ChangeInfoResult LoadTranslationTable(uint gvid, int numinfo, ByteReader return CIR_INVALID_ID; } - translation_table.Clear(); + translation_table.clear(); for (int i = 0; i < numinfo; i++) { uint32 item = buf->ReadDWord(); *translation_table.Append() = BSWAP32(item); @@ -4791,7 +4791,7 @@ static void NewSpriteGroup(ByteReader *buf) } static SmallVector adjusts; - adjusts.Clear(); + adjusts.clear(); /* Loop through the var adjusts. Unfortunately we don't know how many we have * from the outset, so we shall have to keep reallocing. */ @@ -8246,7 +8246,7 @@ static void ResetNewGRF() delete *file; } - _grf_files.Clear(); + _grf_files.clear(); _cur.grffile = NULL; } @@ -9332,7 +9332,7 @@ static void AfterLoadGRFs() for (StringIDMapping *it = _string_to_grf_mapping.Begin(); it != _string_to_grf_mapping.End(); it++) { *it->target = MapGRFStringID(it->grfid, it->source); } - _string_to_grf_mapping.Clear(); + _string_to_grf_mapping.clear(); /* Free the action 6 override sprites. */ for (GRFLineToSpriteOverride::iterator it = _grf_line_to_action6_sprite_override.begin(); it != _grf_line_to_action6_sprite_override.end(); it++) { diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp index 4caf3a5d47..e25f6d0856 100644 --- a/src/newgrf_commons.cpp +++ b/src/newgrf_commons.cpp @@ -661,7 +661,7 @@ void NewGRFSpriteLayout::AllocateRegisters() */ uint32 NewGRFSpriteLayout::PrepareLayout(uint32 orig_offset, uint32 newgrf_ground_offset, uint32 newgrf_offset, uint constr_stage, bool separate_ground) const { - result_seq.Clear(); + result_seq.clear(); uint32 var10_values = 0; /* Create a copy of the spritelayout, so we can modify some values. diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 37844423aa..fcb04be0d6 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -1456,7 +1456,7 @@ private: { if (!this->avails.NeedRebuild()) return; - this->avails.Clear(); + this->avails.clear(); for (const GRFConfig *c = _all_grfs; c != NULL; c = c->next) { bool found = false; diff --git a/src/newgrf_sound.cpp b/src/newgrf_sound.cpp index 0cc113d9df..9d890e9caf 100644 --- a/src/newgrf_sound.cpp +++ b/src/newgrf_sound.cpp @@ -40,7 +40,7 @@ SoundEntry *AllocateSound(uint num) void InitializeSoundPool() { - _sounds.Clear(); + _sounds.clear(); /* Copy original sound data to the pool */ SndCopyToPool(); diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 1c07932cd3..a948ac0f9b 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -167,7 +167,7 @@ RailType AllocateRailType(RailTypeLabel label) /* Set up new rail type */ *rti = _original_railtypes[RAILTYPE_RAIL]; rti->label = label; - rti->alternate_labels.Clear(); + rti->alternate_labels.clear(); /* Make us compatible with ourself. */ rti->powered_railtypes = (RailTypes)(1LL << rt); diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 6ec4ab67c9..851eb6a786 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -2942,7 +2942,7 @@ bool AfterLoadGame() SmallVector skip_frames; FOR_ALL_ROADVEHICLES(v) { if (!v->IsFrontEngine()) continue; - skip_frames.Clear(); + skip_frames.clear(); TileIndex prev_tile = v->tile; uint prev_tile_skip = 0; uint cur_skip = 0; diff --git a/src/saveload/animated_tile_sl.cpp b/src/saveload/animated_tile_sl.cpp index c54c4724ab..6db0561cd3 100644 --- a/src/saveload/animated_tile_sl.cpp +++ b/src/saveload/animated_tile_sl.cpp @@ -48,7 +48,7 @@ static void Load_ANIT() } uint count = (uint)SlGetFieldLength() / sizeof(*_animated_tiles.Begin()); - _animated_tiles.Clear(); + _animated_tiles.clear(); _animated_tiles.Append(count); SlArray(_animated_tiles.Begin(), count, SLE_UINT32); } diff --git a/src/saveload/engine_sl.cpp b/src/saveload/engine_sl.cpp index 5221d1bbdc..87b18336ce 100644 --- a/src/saveload/engine_sl.cpp +++ b/src/saveload/engine_sl.cpp @@ -187,7 +187,7 @@ static void Save_EIDS() static void Load_EIDS() { - _engine_mngr.Clear(); + _engine_mngr.clear(); while (SlIterateArray() != -1) { EngineIDMapping *eid = _engine_mngr.Append(); diff --git a/src/saveload/labelmaps_sl.cpp b/src/saveload/labelmaps_sl.cpp index 3b898a3b87..b57a89f208 100644 --- a/src/saveload/labelmaps_sl.cpp +++ b/src/saveload/labelmaps_sl.cpp @@ -81,7 +81,7 @@ void AfterLoadLabelMaps() } } - _railtype_list.Clear(); + _railtype_list.clear(); } /** Container for a label for SaveLoad system */ @@ -108,7 +108,7 @@ static void Save_RAIL() static void Load_RAIL() { - _railtype_list.Clear(); + _railtype_list.clear(); LabelObject lo; diff --git a/src/saveload/waypoint_sl.cpp b/src/saveload/waypoint_sl.cpp index ae74d812b1..2567c2c93f 100644 --- a/src/saveload/waypoint_sl.cpp +++ b/src/saveload/waypoint_sl.cpp @@ -172,7 +172,7 @@ static const SaveLoad _old_waypoint_desc[] = { static void Load_WAYP() { /* Precaution for when loading failed and it didn't get cleared */ - _old_waypoints.Clear(); + _old_waypoints.clear(); int index; @@ -201,7 +201,7 @@ static void Ptrs_WAYP() * whether we're in the NULL or "normal" Ptrs proc. So just clear the list * of old waypoints we constructed and then this waypoint (and the other * possibly corrupt ones) will not be queried in the NULL Ptrs proc run. */ - _old_waypoints.Clear(); + _old_waypoints.clear(); SlErrorCorrupt("Referencing invalid Town"); } wp->town = Town::Get(wp->town_index); diff --git a/src/settingsgen/settingsgen.cpp b/src/settingsgen/settingsgen.cpp index d8d76a4d64..35c9911d8b 100644 --- a/src/settingsgen/settingsgen.cpp +++ b/src/settingsgen/settingsgen.cpp @@ -103,7 +103,7 @@ public: /** Clear the temporary storage. */ void Clear() { - this->output_buffer.Clear(); + this->output_buffer.clear(); } /** diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 5e752da522..fab2ac912b 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -60,7 +60,7 @@ struct SignList { DEBUG(misc, 3, "Building sign list"); - this->signs.Clear(); + this->signs.clear(); const Sign *si; FOR_ALL_SIGNS(si) *this->signs.Append() = si; diff --git a/src/station_gui.cpp b/src/station_gui.cpp index ef434c4ffc..965240e3ed 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -178,7 +178,7 @@ protected: DEBUG(misc, 3, "Building station list for company %d", owner); - this->stations.Clear(); + this->stations.clear(); const Station *st; FOR_ALL_STATIONS(st) { @@ -2173,8 +2173,8 @@ static const T *FindStationsNearby(TileArea ta, bool distant_join) { TileArea ctx = ta; - _stations_nearby_list.Clear(); - _deleted_stations_nearby.Clear(); + _stations_nearby_list.clear(); + _deleted_stations_nearby.clear(); /* Check the inside, to return, if we sit on another station */ TILE_AREA_LOOP(t, ta) { diff --git a/src/story_gui.cpp b/src/story_gui.cpp index 8b12207e3f..0ccfe2b63d 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -52,7 +52,7 @@ protected: void BuildStoryPageList() { if (this->story_pages.NeedRebuild()) { - this->story_pages.Clear(); + this->story_pages.clear(); const StoryPage *p; FOR_ALL_STORY_PAGES(p) { @@ -78,7 +78,7 @@ protected: void BuildStoryPageElementList() { if (this->story_page_elements.NeedRebuild()) { - this->story_page_elements.Clear(); + this->story_page_elements.clear(); const StoryPage *p = GetSelPage(); if (p != NULL) { diff --git a/src/strgen/strgen_base.cpp b/src/strgen/strgen_base.cpp index 8d46b1b271..8f3f8941fd 100644 --- a/src/strgen/strgen_base.cpp +++ b/src/strgen/strgen_base.cpp @@ -1046,7 +1046,7 @@ void LanguageWriter::WriteLang(const StringData &data) this->WriteLength(buffer.Length()); this->Write(buffer.Begin(), buffer.Length()); - buffer.Clear(); + buffer.clear(); } } } diff --git a/src/string.cpp b/src/string.cpp index 18ed863d0e..cb6c1e8f7e 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -652,8 +652,8 @@ public: * for word break iterators (especially for CJK languages) in combination * with UTF-8 input. As a work around we have to convert the input to * UTF-16 and create a mapping back to UTF-8 character indices. */ - this->utf16_str.Clear(); - this->utf16_to_utf8.Clear(); + this->utf16_str.clear(); + this->utf16_to_utf8.clear(); while (*s != '\0') { size_t idx = s - string_base; diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp index 3480a2aef2..018888d0b9 100644 --- a/src/textfile_gui.cpp +++ b/src/textfile_gui.cpp @@ -319,7 +319,7 @@ static void Xunzip(byte **bufp, size_t *sizep) { if (textfile == NULL) return; - this->lines.Clear(); + this->lines.clear(); /* Get text from file */ size_t filesize; diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 0ae79367cc..35ef97e940 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -3469,7 +3469,7 @@ void SetTownRatingTestMode(bool mode) static int ref_count = 0; // Number of times test-mode is switched on. if (mode) { if (ref_count == 0) { - _town_test_ratings.Clear(); + _town_test_ratings.clear(); } ref_count++; } else { diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 18b767ebca..5cc934f0a8 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -650,7 +650,7 @@ private: void BuildSortTownList() { if (this->towns.NeedRebuild()) { - this->towns.Clear(); + this->towns.clear(); const Town *t; FOR_ALL_TOWNS(t) { diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 51e772b520..5246b59cb1 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -263,7 +263,7 @@ static void TrainDetailsCapacityTab(const CargoSummaryItem *item, int left, int */ static void GetCargoSummaryOfArticulatedVehicle(const Train *v, CargoSummary *summary) { - summary->Clear(); + summary->clear(); do { if (!v->GetEngine()->CanCarryCargo()) continue; diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 4f987a4bf4..d885a04587 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -942,7 +942,7 @@ static void RunVehicleDayProc() void CallVehicleTicks() { - _vehicles_to_autoreplace.Clear(); + _vehicles_to_autoreplace.clear(); RunVehicleDayProc(); diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 7dd7a790aa..27f2262e78 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -347,7 +347,7 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, uint8 num_vehicles, } static SmallVector refit_result; - refit_result.Clear(); + refit_result.clear(); v->InvalidateNewGRFCacheOfChain(); byte actual_subtype = new_subtype; @@ -442,7 +442,7 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, uint8 num_vehicles, } } - refit_result.Clear(); + refit_result.clear(); _returned_refit_capacity = total_capacity; _returned_mail_refit_capacity = total_mail_capacity; return cost; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index f4e7665893..2ae385aa20 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -234,7 +234,7 @@ byte GetBestFittingSubType(Vehicle *v_from, Vehicle *v_for, CargoID dest_cargo_t /* Create a list of subtypes used by the various parts of v_for */ static SmallVector subtypes; - subtypes.Clear(); + subtypes.clear(); for (; v_from != NULL; v_from = v_from->HasArticulatedPart() ? v_from->GetNextArticulatedPart() : NULL) { const Engine *e_from = v_from->GetEngine(); if (!e_from->CanCarryCargo() || !HasBit(e_from->info.callback_mask, CBM_VEHICLE_CARGO_SUFFIX)) continue; @@ -406,7 +406,7 @@ struct RefitWindow : public Window { */ void BuildRefitList() { - for (uint i = 0; i < NUM_CARGO; i++) this->list[i].Clear(); + for (uint i = 0; i < NUM_CARGO; i++) this->list[i].clear(); Vehicle *v = Vehicle::Get(this->window_number); /* Check only the selected vehicles. */ diff --git a/src/vehiclelist.cpp b/src/vehiclelist.cpp index bfe4e5ffd1..4022262685 100644 --- a/src/vehiclelist.cpp +++ b/src/vehiclelist.cpp @@ -70,8 +70,8 @@ bool VehicleListIdentifier::UnpackIfValid(uint32 data) */ void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engines, VehicleList *wagons, bool individual_wagons) { - engines->Clear(); - if (wagons != NULL && wagons != engines) wagons->Clear(); + engines->clear(); + if (wagons != NULL && wagons != engines) wagons->clear(); const Vehicle *v; FOR_ALL_VEHICLES(v) { @@ -115,7 +115,7 @@ void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine */ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli) { - list->Clear(); + list->clear(); const Vehicle *v; diff --git a/src/viewport.cpp b/src/viewport.cpp index 2cb3baa576..bd0570cf1a 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1620,11 +1620,11 @@ void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom _cur_dpi = old_dpi; - _vd.string_sprites_to_draw.Clear(); - _vd.tile_sprites_to_draw.Clear(); - _vd.parent_sprites_to_draw.Clear(); - _vd.parent_sprites_to_sort.Clear(); - _vd.child_screen_sprites_to_draw.Clear(); + _vd.string_sprites_to_draw.clear(); + _vd.tile_sprites_to_draw.clear(); + _vd.parent_sprites_to_draw.clear(); + _vd.parent_sprites_to_sort.clear(); + _vd.child_screen_sprites_to_draw.clear(); } /** diff --git a/src/window.cpp b/src/window.cpp index 243114e206..184b9940ae 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -3024,7 +3024,7 @@ void HandleMouseEvents() Blitter *blitter = BlitterFactory::GetCurrentBlitter(); _newgrf_debug_sprite_picker.clicked_pixel = blitter->MoveTo(_screen.dst_ptr, _cursor.pos.x, _cursor.pos.y); _newgrf_debug_sprite_picker.click_time = _realtime_tick; - _newgrf_debug_sprite_picker.sprites.Clear(); + _newgrf_debug_sprite_picker.sprites.clear(); _newgrf_debug_sprite_picker.mode = SPM_REDRAW; MarkWholeScreenDirty(); } else { @@ -3255,7 +3255,7 @@ void Window::ProcessScheduledInvalidations() for (int *data = this->scheduled_invalidation_data.Begin(); this->window_class != WC_INVALID && data != this->scheduled_invalidation_data.End(); data++) { this->OnInvalidateData(*data, true); } - this->scheduled_invalidation_data.Clear(); + this->scheduled_invalidation_data.clear(); } /** From 9cba6f71936207f11ad0d4ed752d82966087fab9 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Fri, 21 Sep 2018 22:45:44 +0100 Subject: [PATCH 49/82] Codechange: Replaced SmallVector::Compact() with std::vector::shrink_to_fit() --- src/build_vehicle_gui.cpp | 4 ++-- src/company_gui.cpp | 2 +- src/core/smallvec_type.hpp | 8 -------- src/fios.h | 2 +- src/graph_gui.cpp | 2 +- src/group_gui.cpp | 2 +- src/industry_gui.cpp | 2 +- src/network/network_content_gui.cpp | 2 +- src/network/network_gui.cpp | 2 +- src/newgrf_gui.cpp | 2 +- src/signs_gui.cpp | 2 +- src/station_gui.cpp | 2 +- src/story_gui.cpp | 4 ++-- src/town_gui.cpp | 2 +- src/vehiclelist.cpp | 6 +++--- 15 files changed, 18 insertions(+), 26 deletions(-) diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index e160d6daca..f580ba7a92 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1345,7 +1345,7 @@ struct BuildVehicleWindow : Window { default: NOT_REACHED(); case VEH_TRAIN: this->GenerateBuildTrainList(); - this->eng_list.Compact(); + this->eng_list.shrink_to_fit(); this->eng_list.RebuildDone(); return; // trains should not reach the last sorting case VEH_ROAD: @@ -1364,7 +1364,7 @@ struct BuildVehicleWindow : Window { _engine_sort_direction = this->descending_sort_order; EngList_Sort(&this->eng_list, _engine_sort_functions[this->vehicle_type][this->sort_criteria]); - this->eng_list.Compact(); + this->eng_list.shrink_to_fit(); this->eng_list.RebuildDone(); } diff --git a/src/company_gui.cpp b/src/company_gui.cpp index ba82b44b8c..19aea17759 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -672,7 +672,7 @@ private: AddChildren(&list, INVALID_GROUP, 0); } - this->groups.Compact(); + this->groups.shrink_to_fit(); this->groups.RebuildDone(); } diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 89fdd13697..9ce63e3f3e 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -86,14 +86,6 @@ public: std::vector::shrink_to_fit(); } - /** - * Compact the list down to the smallest block size boundary. - */ - inline void Compact() - { - std::vector::shrink_to_fit(); - } - /** * Append an item and return it. * @param to_add the number of items to append diff --git a/src/fios.h b/src/fios.h index 788ac654f5..848fe7c8e1 100644 --- a/src/fios.h +++ b/src/fios.h @@ -191,7 +191,7 @@ public: /** Compact the list down to the smallest block size boundary. */ inline void Compact() { - this->files.Compact(); + this->files.shrink_to_fit(); } void BuildFileList(AbstractFileType abstract_filetype, SaveLoadOperation fop); diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index c459e2a03b..a53bef906b 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -1143,7 +1143,7 @@ private: *this->companies.Append() = c; } - this->companies.Compact(); + this->companies.shrink_to_fit(); this->companies.RebuildDone(); } diff --git a/src/group_gui.cpp b/src/group_gui.cpp index bd8f37ec56..3a5aa0eead 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -184,7 +184,7 @@ private: AddChildren(&list, INVALID_GROUP, 0); - this->groups.Compact(); + this->groups.shrink_to_fit(); this->groups.RebuildDone(); } diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 4fa3501284..eb6018973f 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -1209,7 +1209,7 @@ protected: *this->industries.Append() = i; } - this->industries.Compact(); + this->industries.shrink_to_fit(); this->industries.RebuildDone(); this->vscroll->SetCount(this->industries.Length()); // Update scrollbar as well. } diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 2ac7e6b12b..cb534d7961 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -397,7 +397,7 @@ class NetworkContentListWindow : public Window, ContentCallback { this->SetWidgetDisabledState(WID_NCL_SEARCH_EXTERNAL, this->auto_select && all_available); this->FilterContentList(); - this->content.Compact(); + this->content.shrink_to_fit(); this->content.RebuildDone(); this->SortContentList(); diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 1366906b88..1451e7154e 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -267,7 +267,7 @@ protected: this->servers.SetFilterState(false); } - this->servers.Compact(); + this->servers.shrink_to_fit(); this->servers.RebuildDone(); this->vscroll->SetCount(this->servers.Length()); diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index fcb04be0d6..4235d31336 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -1481,7 +1481,7 @@ private: } this->avails.Filter(this->string_filter); - this->avails.Compact(); + this->avails.shrink_to_fit(); this->avails.RebuildDone(); this->avails.Sort(); diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index fab2ac912b..84b43c69d0 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -67,7 +67,7 @@ struct SignList { this->signs.SetFilterState(true); this->FilterSignList(); - this->signs.Compact(); + this->signs.shrink_to_fit(); this->signs.RebuildDone(); } diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 965240e3ed..32e22b1616 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -202,7 +202,7 @@ protected: } } - this->stations.Compact(); + this->stations.shrink_to_fit(); this->stations.RebuildDone(); this->vscroll->SetCount(this->stations.Length()); // Update the scrollbar diff --git a/src/story_gui.cpp b/src/story_gui.cpp index 0ccfe2b63d..efb3f36e72 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -61,7 +61,7 @@ protected: } } - this->story_pages.Compact(); + this->story_pages.shrink_to_fit(); this->story_pages.RebuildDone(); } @@ -90,7 +90,7 @@ protected: } } - this->story_page_elements.Compact(); + this->story_page_elements.shrink_to_fit(); this->story_page_elements.RebuildDone(); } diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 5cc934f0a8..b9aa938e63 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -657,7 +657,7 @@ private: *this->towns.Append() = t; } - this->towns.Compact(); + this->towns.shrink_to_fit(); this->towns.RebuildDone(); this->vscroll->SetCount(this->towns.Length()); // Update scrollbar as well. } diff --git a/src/vehiclelist.cpp b/src/vehiclelist.cpp index 4022262685..39ec90e8b9 100644 --- a/src/vehiclelist.cpp +++ b/src/vehiclelist.cpp @@ -103,8 +103,8 @@ void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine /* Ensure the lists are not wasting too much space. If the lists are fresh * (i.e. built within a command) then this will actually do nothing. */ - engines->Compact(); - if (wagons != NULL && wagons != engines) wagons->Compact(); + engines->shrink_to_fit(); + if (wagons != NULL && wagons != engines) wagons->shrink_to_fit(); } /** @@ -184,6 +184,6 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli default: return false; } - list->Compact(); + list->shrink_to_fit(); return true; } From 56ae855dc20b27593c9a454d5a09d8f892a6c71f Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Fri, 21 Sep 2018 22:50:12 +0100 Subject: [PATCH 50/82] Codechange: Removed SmallVector::operator[] --- src/core/smallvec_type.hpp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 9ce63e3f3e..be3ec309c6 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -292,30 +292,6 @@ public: assert(index <= std::vector::size()); return this->Begin() + index; } - - /** - * Get item "number" (const) - * - * @param index the position of the item - * @return the item - */ - inline const T &operator[](uint index) const - { - assert(index < std::vector::size()); - return std::vector::operator[](index); - } - - /** - * Get item "number" - * - * @param index the position of the item - * @return the item - */ - inline T &operator[](uint index) - { - assert(index < std::vector::size()); - return std::vector::operator[](index); - } }; From a690936ed75e96627be0e2ecafee2360a71e8d3c Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Sun, 23 Sep 2018 12:23:54 +0100 Subject: [PATCH 51/82] Codechange: Replace SmallVector::Length() with std::vector::size() --- src/autoreplace_gui.cpp | 10 +++--- src/bridge_gui.cpp | 12 +++---- src/build_vehicle_gui.cpp | 12 +++---- src/company_gui.cpp | 8 ++--- src/console_cmds.cpp | 6 ++-- src/core/pool_func.cpp | 2 +- src/core/smallstack_type.hpp | 2 +- src/core/smallvec_type.hpp | 10 ------ src/depot_gui.cpp | 20 ++++++------ src/engine.cpp | 2 +- src/engine_gui.cpp | 6 ++-- src/fios.cpp | 2 +- src/fios.h | 2 +- src/game/game_text.cpp | 4 +-- src/gfx.cpp | 4 +-- src/gfx_layout.cpp | 8 ++--- src/graph_gui.cpp | 2 +- src/group_gui.cpp | 34 ++++++++++---------- src/hotkeys.cpp | 2 +- src/industry_gui.cpp | 18 +++++------ src/linkgraph/linkgraph.h | 2 +- src/music/dmusic.cpp | 4 +-- src/music/midifile.cpp | 6 ++-- src/music/win32_m.cpp | 4 +-- src/network/core/tcp_http.cpp | 2 +- src/network/core/tcp_listen.h | 4 +-- src/network/core/udp.cpp | 4 +-- src/network/network.cpp | 2 +- src/network/network_content.cpp | 18 +++++------ src/network/network_content.h | 2 +- src/network/network_content_gui.cpp | 14 ++++---- src/network/network_gui.cpp | 24 +++++++------- src/newgrf.cpp | 26 +++++++-------- src/newgrf_cargo.cpp | 4 +-- src/newgrf_config.cpp | 12 +++---- src/newgrf_debug_gui.cpp | 6 ++-- src/newgrf_engine.cpp | 2 +- src/newgrf_gui.cpp | 50 ++++++++++++++--------------- src/newgrf_railtype.cpp | 2 +- src/newgrf_sound.cpp | 4 +-- src/os/macosx/string_osx.cpp | 4 +-- src/os/windows/string_uniscribe.cpp | 2 +- src/rail_cmd.cpp | 2 +- src/saveload/animated_tile_sl.cpp | 4 +-- src/saveload/game_sl.cpp | 6 ++-- src/saveload/labelmaps_sl.cpp | 4 +-- src/saveload/linkgraph_sl.cpp | 4 +-- src/saveload/saveload.cpp | 2 +- src/saveload/waypoint_sl.cpp | 2 +- src/script/squirrel_helper.hpp | 6 ++-- src/settings_gui.cpp | 12 +++---- src/settingsgen/settingsgen.cpp | 4 +-- src/signs_gui.cpp | 8 ++--- src/station_cmd.cpp | 2 +- src/station_gui.cpp | 18 +++++------ src/story_gui.cpp | 18 +++++------ src/strgen/strgen_base.cpp | 8 ++--- src/string.cpp | 4 +-- src/stringfilter_type.h | 4 +-- src/strings.cpp | 2 +- src/texteff.cpp | 4 +-- src/textfile_gui.cpp | 10 +++--- src/timetable_cmd.cpp | 4 +-- src/town_gui.cpp | 10 +++--- src/train_cmd.cpp | 2 +- src/train_gui.cpp | 8 ++--- src/vehicle_cmd.cpp | 8 ++--- src/vehicle_gui.cpp | 44 ++++++++++++------------- src/viewport.cpp | 8 ++--- src/widgets/dropdown.cpp | 10 +++--- src/window.cpp | 2 +- 71 files changed, 287 insertions(+), 297 deletions(-) diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 356058e938..1286dc5a78 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -160,8 +160,8 @@ class ReplaceVehicleWindow : public Window { if (this->engines[0].NeedRebuild()) { /* We need to rebuild the left engines list */ this->GenerateReplaceVehList(true); - this->vscroll[0]->SetCount(this->engines[0].Length()); - if (this->reset_sel_engine && this->sel_engine[0] == INVALID_ENGINE && this->engines[0].Length() != 0) { + this->vscroll[0]->SetCount(this->engines[0].size()); + if (this->reset_sel_engine && this->sel_engine[0] == INVALID_ENGINE && this->engines[0].size() != 0) { this->sel_engine[0] = this->engines[0][0]; } } @@ -180,7 +180,7 @@ class ReplaceVehicleWindow : public Window { } /* Regenerate the list on the right. Note: This resets sel_engine[1] to INVALID_ENGINE, if it is no longer available. */ this->GenerateReplaceVehList(false); - this->vscroll[1]->SetCount(this->engines[1].Length()); + this->vscroll[1]->SetCount(this->engines[1].size()); if (this->reset_sel_engine && this->sel_engine[1] != INVALID_ENGINE) { int position = 0; for (EngineID *it = this->engines[1].Begin(); it != this->engines[1].End(); ++it) { @@ -384,7 +384,7 @@ public: case WID_RV_RIGHT_MATRIX: { int side = (widget == WID_RV_LEFT_MATRIX) ? 0 : 1; EngineID start = this->vscroll[side]->GetPosition(); // what is the offset for the start (scrolling) - EngineID end = min(this->vscroll[side]->GetCapacity() + start, this->engines[side].Length()); + EngineID end = min(this->vscroll[side]->GetCapacity() + start, this->engines[side].size()); /* Do the actual drawing */ DrawEngineList((VehicleType)this->window_number, r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, @@ -508,7 +508,7 @@ public: click_side = 1; } uint i = this->vscroll[click_side]->GetScrolledRowFromWidget(pt.y, this, widget); - size_t engine_count = this->engines[click_side].Length(); + size_t engine_count = this->engines[click_side].size(); EngineID e = engine_count > i ? this->engines[click_side][i] : INVALID_ENGINE; if (e == this->sel_engine[click_side]) break; // we clicked the one we already selected diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 29cb5a085f..0b4d0d619e 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -153,7 +153,7 @@ public: this->bridges->NeedResort(); this->SortBridgeList(); - this->vscroll->SetCount(bl->Length()); + this->vscroll->SetCount(bl->size()); } ~BuildBridgeWindow() @@ -186,7 +186,7 @@ public: case WID_BBS_BRIDGE_LIST: { Dimension sprite_dim = {0, 0}; // Biggest bridge sprite dimension Dimension text_dim = {0, 0}; // Biggest text dimension - for (int i = 0; i < (int)this->bridges->Length(); i++) { + for (int i = 0; i < (int)this->bridges->size(); i++) { const BridgeSpec *b = this->bridges->Get(i)->spec; sprite_dim = maxdim(sprite_dim, GetSpriteSize(b->sprite)); @@ -226,7 +226,7 @@ public: case WID_BBS_BRIDGE_LIST: { uint y = r.top; - for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < (int)this->bridges->Length(); i++) { + for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < (int)this->bridges->size(); i++) { const BridgeSpec *b = this->bridges->Get(i)->spec; SetDParam(2, this->bridges->Get(i)->cost); @@ -246,7 +246,7 @@ public: EventState OnKeyPress(WChar key, uint16 keycode) override { const uint8 i = keycode - '1'; - if (i < 9 && i < this->bridges->Length()) { + if (i < 9 && i < this->bridges->size()) { /* Build the requested bridge */ this->BuildBridge(i); delete this; @@ -261,7 +261,7 @@ public: default: break; case WID_BBS_BRIDGE_LIST: { uint i = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_BBS_BRIDGE_LIST); - if (i < this->bridges->Length()) { + if (i < this->bridges->size()) { this->BuildBridge(i); delete this; } @@ -426,7 +426,7 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo } } - if (bl != NULL && bl->Length() != 0) { + if (bl != NULL && bl->size() != 0) { new BuildBridgeWindow(&_build_bridge_desc, start, end, type, bl); } else { delete bl; diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index f580ba7a92..ce3ebeff46 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -940,7 +940,7 @@ void DrawEngineList(VehicleType type, int l, int r, int y, const GUIEngineList * static const int sprite_y_offsets[] = { -1, -1, -2, -2 }; /* Obligatory sanity checks! */ - assert(max <= eng_list->Length()); + assert(max <= eng_list->size()); bool rtl = _current_text_dir == TD_RTL; int step_size = GetEngineListHeight(type); @@ -1110,7 +1110,7 @@ struct BuildVehicleWindow : Window { this->eng_list.ForceRebuild(); this->GenerateBuildList(); // generate the list, since we need it in the next line /* Select the first engine in the list as default when opening the window */ - if (this->eng_list.Length() > 0) { + if (this->eng_list.size() > 0) { this->SelectEngine(this->eng_list[0]); } else { this->SelectEngine(INVALID_ENGINE); @@ -1205,7 +1205,7 @@ struct BuildVehicleWindow : Window { void FilterEngineList() { this->eng_list.Filter(this->cargo_filter[this->cargo_filter_criteria]); - if (0 == this->eng_list.Length()) { // no engine passed through the filter, invalidate the previously selected engine + if (0 == this->eng_list.size()) { // no engine passed through the filter, invalidate the previously selected engine this->SelectEngine(INVALID_ENGINE); } else if (!this->eng_list.Contains(this->sel_engine)) { // previously selected engine didn't pass the filter, select the first engine of the list this->SelectEngine(this->eng_list[0]); @@ -1388,7 +1388,7 @@ struct BuildVehicleWindow : Window { case WID_BV_LIST: { uint i = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_BV_LIST); - size_t num_items = this->eng_list.Length(); + size_t num_items = this->eng_list.size(); this->SelectEngine((i < num_items) ? this->eng_list[i] : INVALID_ENGINE); this->SetDirty(); if (_ctrl_pressed) { @@ -1529,7 +1529,7 @@ struct BuildVehicleWindow : Window { { switch (widget) { case WID_BV_LIST: - DrawEngineList(this->vehicle_type, r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, &this->eng_list, this->vscroll->GetPosition(), min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->eng_list.Length()), this->sel_engine, false, DEFAULT_GROUP); + DrawEngineList(this->vehicle_type, r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, &this->eng_list, this->vscroll->GetPosition(), min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->eng_list.size()), this->sel_engine, false, DEFAULT_GROUP); break; case WID_BV_SORT_ASCENDING_DESCENDING: @@ -1541,7 +1541,7 @@ struct BuildVehicleWindow : Window { void OnPaint() override { this->GenerateBuildList(); - this->vscroll->SetCount(this->eng_list.Length()); + this->vscroll->SetCount(this->eng_list.size()); this->SetWidgetsDisabledState(this->sel_engine == INVALID_ENGINE, WID_BV_SHOW_HIDE, WID_BV_BUILD, WID_BV_RENAME, WIDGET_LIST_END); diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 19aea17759..b34862f694 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -686,7 +686,7 @@ private: } } } else { - this->rows = this->groups.Length(); + this->rows = this->groups.size(); } this->vscroll->SetCount(this->rows); @@ -902,7 +902,7 @@ public: } } } else { - uint max = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->groups.Length()); + uint max = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->groups.size()); for (uint i = this->vscroll->GetPosition(); i < max; ++i) { const Group *g = this->groups[i]; SetDParam(0, g->index); @@ -942,7 +942,7 @@ public: this->groups.ForceRebuild(); this->BuildGroupList((CompanyID)this->window_number); - if (this->groups.Length() > 0) { + if (this->groups.size() > 0) { this->sel = this->groups[0]->index; } } @@ -1029,7 +1029,7 @@ public: if (!Group::IsValidID(this->sel)) { this->sel = INVALID_GROUP; - if (this->groups.Length() > 0) this->sel = this->groups[0]->index; + if (this->groups.size() > 0) this->sel = this->groups[0]->index; } this->SetDirty(); diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 6c8e927c96..a4a6fccd17 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -552,16 +552,16 @@ DEF_CONSOLE_CMD(ConUnBan) /* Try by IP. */ uint index; - for (index = 0; index < _network_ban_list.Length(); index++) { + for (index = 0; index < _network_ban_list.size(); index++) { if (strcmp(_network_ban_list[index], argv[1]) == 0) break; } /* Try by index. */ - if (index >= _network_ban_list.Length()) { + if (index >= _network_ban_list.size()) { index = atoi(argv[1]) - 1U; // let it wrap } - if (index < _network_ban_list.Length()) { + if (index < _network_ban_list.size()) { char msg[64]; seprintf(msg, lastof(msg), "Unbanned %s", _network_ban_list[index]); IConsolePrint(CC_DEFAULT, msg); diff --git a/src/core/pool_func.cpp b/src/core/pool_func.cpp index f8ff93cecc..914cbcfd90 100644 --- a/src/core/pool_func.cpp +++ b/src/core/pool_func.cpp @@ -22,7 +22,7 @@ { PoolVector *pools = PoolBase::GetPools(); pools->Erase(pools->Find(this)); - if (pools->Length() == 0) delete pools; + if (pools->size() == 0) delete pools; } /** diff --git a/src/core/smallstack_type.hpp b/src/core/smallstack_type.hpp index b053c32a85..76d97f9615 100644 --- a/src/core/smallstack_type.hpp +++ b/src/core/smallstack_type.hpp @@ -73,7 +73,7 @@ private: if (!this->data[index].valid) return index; } - if (index >= this->data.Length() && index < Tmax_size) { + if (index >= this->data.size() && index < Tmax_size) { this->data.Resize(index + 1); } return index; diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index be3ec309c6..600b7ea262 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -217,16 +217,6 @@ public: return is_member; } - /** - * Get the number of items in the list. - * - * @return The number of items in the list. - */ - inline uint Length() const - { - return std::vector::size(); - } - /** * Get the pointer to the first item (const) * diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index f2da7330ea..2b5879116f 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -398,7 +398,7 @@ struct DepotWindow : Window { uint16 rows_in_display = wid->current_y / wid->resize_y; uint16 num = this->vscroll->GetPosition() * this->num_columns; - int maxval = min(this->vehicle_list.Length(), num + (rows_in_display * this->num_columns)); + int maxval = min(this->vehicle_list.size(), num + (rows_in_display * this->num_columns)); int y; for (y = r.top + 1; num < maxval; y += this->resize.step_height) { // Draw the rows for (byte i = 0; i < this->num_columns && num < maxval; i++, num++) { @@ -413,11 +413,11 @@ struct DepotWindow : Window { } } - maxval = min(this->vehicle_list.Length() + this->wagon_list.Length(), (this->vscroll->GetPosition() * this->num_columns) + (rows_in_display * this->num_columns)); + maxval = min(this->vehicle_list.size() + this->wagon_list.size(), (this->vscroll->GetPosition() * this->num_columns) + (rows_in_display * this->num_columns)); /* Draw the train wagons without an engine in front. */ for (; num < maxval; num++, y += this->resize.step_height) { - const Vehicle *v = this->wagon_list[num - this->vehicle_list.Length()]; + const Vehicle *v = this->wagon_list[num - this->vehicle_list.size()]; this->DrawVehicleInDepot(v, r.left, r.right, y); } } @@ -465,7 +465,7 @@ struct DepotWindow : Window { uint pos = ((row + this->vscroll->GetPosition()) * this->num_columns) + xt; - if (this->vehicle_list.Length() + this->wagon_list.Length() <= pos) { + if (this->vehicle_list.size() + this->wagon_list.size() <= pos) { /* Clicking on 'line' / 'block' without a vehicle */ if (this->type == VEH_TRAIN) { /* End the dragging */ @@ -478,12 +478,12 @@ struct DepotWindow : Window { } bool wagon = false; - if (this->vehicle_list.Length() > pos) { + if (this->vehicle_list.size() > pos) { *veh = this->vehicle_list[pos]; /* Skip vehicles that are scrolled off the list */ if (this->type == VEH_TRAIN) x += this->hscroll->GetPosition(); } else { - pos -= this->vehicle_list.Length(); + pos -= this->vehicle_list.size(); *veh = this->wagon_list[pos]; /* free wagons don't have an initial loco. */ x -= ScaleGUITrad(VEHICLEINFO_FULL_VEHICLE_WIDTH); @@ -726,7 +726,7 @@ struct DepotWindow : Window { /* determine amount of items for scroller */ if (this->type == VEH_TRAIN) { uint max_width = ScaleGUITrad(VEHICLEINFO_FULL_VEHICLE_WIDTH); - for (uint num = 0; num < this->vehicle_list.Length(); num++) { + for (uint num = 0; num < this->vehicle_list.size(); num++) { uint width = 0; for (const Train *v = Train::From(this->vehicle_list[num]); v != NULL; v = v->Next()) { width += v->GetDisplayImageWidth(); @@ -734,11 +734,11 @@ struct DepotWindow : Window { max_width = max(max_width, width); } /* Always have 1 empty row, so people can change the setting of the train */ - this->vscroll->SetCount(this->vehicle_list.Length() + this->wagon_list.Length() + 1); + this->vscroll->SetCount(this->vehicle_list.size() + this->wagon_list.size() + 1); /* Always make it longer than the longest train, so you can attach vehicles at the end, and also see the next vertical tile separator line */ this->hscroll->SetCount(max_width + ScaleGUITrad(2 * VEHICLEINFO_FULL_VEHICLE_WIDTH + 1)); } else { - this->vscroll->SetCount(CeilDiv(this->vehicle_list.Length(), this->num_columns)); + this->vscroll->SetCount(CeilDiv(this->vehicle_list.size(), this->num_columns)); } /* Setup disabled buttons. */ @@ -811,7 +811,7 @@ struct DepotWindow : Window { case WID_D_SELL_ALL: /* Only open the confirmation window if there are anything to sell */ - if (this->vehicle_list.Length() != 0 || this->wagon_list.Length() != 0) { + if (this->vehicle_list.size() != 0 || this->wagon_list.size() != 0) { TileIndex tile = this->window_number; byte vehtype = this->type; diff --git a/src/engine.cpp b/src/engine.cpp index e0536e7ba8..b7be293afd 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -547,7 +547,7 @@ void SetupEngines() DeleteWindowByClass(WC_ENGINE_PREVIEW); _engine_pool.CleanPool(); - assert(_engine_mngr.Length() >= _engine_mngr.NUM_DEFAULT_ENGINES); + assert(_engine_mngr.size() >= _engine_mngr.NUM_DEFAULT_ENGINES); const EngineIDMapping *end = _engine_mngr.End(); uint index = 0; for (const EngineIDMapping *eid = _engine_mngr.Begin(); eid != end; eid++, index++) { diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 8e7f1a8246..c2a258f180 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -325,7 +325,7 @@ void DrawVehicleEngine(int left, int right, int preferred_x, int y, EngineID eng */ void EngList_Sort(GUIEngineList *el, EngList_SortTypeFunction compare) { - uint size = el->Length(); + uint size = el->size(); /* out-of-bounds access at the next line for size == 0 (even with operator[] at some systems) * generally, do not sort if there are less than 2 items */ if (size < 2) return; @@ -342,8 +342,8 @@ void EngList_Sort(GUIEngineList *el, EngList_SortTypeFunction compare) void EngList_SortPartial(GUIEngineList *el, EngList_SortTypeFunction compare, uint begin, uint num_items) { if (num_items < 2) return; - assert(begin < el->Length()); - assert(begin + num_items <= el->Length()); + assert(begin < el->size()); + assert(begin + num_items <= el->size()); QSortT(el->Get(begin), num_items, compare); } diff --git a/src/fios.cpp b/src/fios.cpp index f849b9a165..a1369e1cd1 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -380,7 +380,7 @@ static void FiosGetFileList(SaveLoadOperation fop, fios_getlist_callback_proc *c { SortingBits order = _savegame_sort_order; _savegame_sort_order = SORT_BY_NAME | SORT_ASCENDING; - QSortT(file_list.files.Begin(), file_list.files.Length(), CompareFiosItems); + QSortT(file_list.files.Begin(), file_list.files.size(), CompareFiosItems); _savegame_sort_order = order; } diff --git a/src/fios.h b/src/fios.h index 848fe7c8e1..71a6cff175 100644 --- a/src/fios.h +++ b/src/fios.h @@ -129,7 +129,7 @@ public: */ inline uint Length() const { - return this->files.Length(); + return this->files.size(); } /** diff --git a/src/game/game_text.cpp b/src/game/game_text.cpp index 4673e732c2..781d0dabab 100644 --- a/src/game/game_text.cpp +++ b/src/game/game_text.cpp @@ -212,7 +212,7 @@ struct StringNameWriter : HeaderWriter { void WriteStringID(const char *name, int stringid) { - if (stringid == (int)this->strings->Length()) *this->strings->Append() = stredup(name); + if (stringid == (int)this->strings->size()) *this->strings->Append() = stredup(name); } void Finalise(const StringData &data) @@ -340,7 +340,7 @@ GameStrings *_current_data = NULL; */ const char *GetGameStringPtr(uint id) { - if (id >= _current_data->cur_language->lines.Length()) return GetStringPtr(STR_UNDEFINED); + if (id >= _current_data->cur_language->lines.size()) return GetStringPtr(STR_UNDEFINED); return _current_data->cur_language->lines[id]; } diff --git a/src/gfx.cpp b/src/gfx.cpp index aedd2c17e3..42bb56400b 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -509,7 +509,7 @@ int DrawString(int left, int right, int top, const char *str, TextColour colour, } Layouter layout(str, INT32_MAX, colour, fontsize); - if (layout.Length() == 0) return 0; + if (layout.size() == 0) return 0; return DrawLayoutLine(*layout.Begin(), top, left, right, align, underline, true); } @@ -574,7 +574,7 @@ int GetStringLineCount(StringID str, int maxw) GetString(buffer, str, lastof(buffer)); Layouter layout(buffer, maxw); - return layout.Length(); + return layout.size(); } /** diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index f0fb391071..7c4407e3a3 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -200,7 +200,7 @@ public: } /* Fill ICU's FontRuns with the right data. */ - icu::FontRuns runs(fontMapping.Length()); + icu::FontRuns runs(fontMapping.size()); for (FontMap::iterator iter = fontMapping.Begin(); iter != fontMapping.End(); iter++) { runs.add(iter->second, iter->first); } @@ -432,7 +432,7 @@ int FallbackParagraphLayout::FallbackLine::GetLeading() const */ int FallbackParagraphLayout::FallbackLine::GetWidth() const { - if (this->Length() == 0) return 0; + if (this->size() == 0) return 0; /* * The last X position of a run contains is the end of that run. @@ -449,7 +449,7 @@ int FallbackParagraphLayout::FallbackLine::GetWidth() const */ int FallbackParagraphLayout::FallbackLine::CountRuns() const { - return this->Length(); + return this->size(); } /** @@ -572,7 +572,7 @@ const ParagraphLayouter::Line *FallbackParagraphLayout::NextLine(int max_width) this->buffer++; } - if (l->Length() == 0 || last_char - begin != 0) { + if (l->size() == 0 || last_char - begin != 0) { int w = l->GetWidth(); *l->Append() = new FallbackVisualRun(iter->second, begin, last_char - begin, w); } diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index a53bef906b..1acf7728cc 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -1183,7 +1183,7 @@ public: uint text_left = rtl ? r.left + WD_FRAMERECT_LEFT : r.right - WD_FRAMERECT_LEFT - this->text_width; uint text_right = rtl ? r.left + WD_FRAMERECT_LEFT + this->text_width : r.right - WD_FRAMERECT_LEFT; - for (uint i = 0; i != this->companies.Length(); i++) { + for (uint i = 0; i != this->companies.size(); i++) { const Company *c = this->companies[i]; DrawString(ordinal_left, ordinal_right, y, i + STR_ORDINAL_NUMBER_1ST, i == 0 ? TC_WHITE : TC_YELLOW); diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 3a5aa0eead..d64f9c51b8 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -460,8 +460,8 @@ public: if (IsDefaultGroupID(this->vli.index) || IsAllGroupID(this->vli.index)) { SetDParam(0, STR_COMPANY_NAME); SetDParam(1, this->vli.company); - SetDParam(2, this->vehicles.Length()); - SetDParam(3, this->vehicles.Length()); + SetDParam(2, this->vehicles.size()); + SetDParam(3, this->vehicles.size()); } else { const Group *g = Group::Get(this->vli.index); @@ -483,17 +483,17 @@ public: this->BuildGroupList(this->owner); - this->group_sb->SetCount(this->groups.Length()); - this->vscroll->SetCount(this->vehicles.Length()); + this->group_sb->SetCount(this->groups.size()); + this->vscroll->SetCount(this->vehicles.size()); /* The drop down menu is out, *but* it may not be used, retract it. */ - if (this->vehicles.Length() == 0 && this->IsWidgetLowered(WID_GL_MANAGE_VEHICLES_DROPDOWN)) { + if (this->vehicles.size() == 0 && this->IsWidgetLowered(WID_GL_MANAGE_VEHICLES_DROPDOWN)) { this->RaiseWidget(WID_GL_MANAGE_VEHICLES_DROPDOWN); HideDropDownMenu(this); } /* Disable all lists management button when the list is empty */ - this->SetWidgetsDisabledState(this->vehicles.Length() == 0 || _local_company != this->vli.company, + this->SetWidgetsDisabledState(this->vehicles.size() == 0 || _local_company != this->vli.company, WID_GL_STOP_ALL, WID_GL_START_ALL, WID_GL_MANAGE_VEHICLES_DROPDOWN, @@ -544,7 +544,7 @@ public: Money this_year = 0; Money last_year = 0; uint32 occupancy = 0; - uint32 vehicle_count = this->vehicles.Length(); + uint32 vehicle_count = this->vehicles.size(); for (uint i = 0; i < vehicle_count; i++) { const Vehicle *v = this->vehicles[i]; @@ -580,7 +580,7 @@ public: case WID_GL_LIST_GROUP: { int y1 = r.top + WD_FRAMERECT_TOP; - int max = min(this->group_sb->GetPosition() + this->group_sb->GetCapacity(), this->groups.Length()); + int max = min(this->group_sb->GetPosition() + this->group_sb->GetCapacity(), this->groups.size()); for (int i = this->group_sb->GetPosition(); i < max; ++i) { const Group *g = this->groups[i]; @@ -590,7 +590,7 @@ public: y1 += this->tiny_step_height; } - if ((uint)this->group_sb->GetPosition() + this->group_sb->GetCapacity() > this->groups.Length()) { + if ((uint)this->group_sb->GetPosition() + this->group_sb->GetCapacity() > this->groups.size()) { DrawGroupInfo(y1, r.left, r.right, NEW_GROUP); } break; @@ -604,7 +604,7 @@ public: if (this->vli.index != ALL_GROUP) { /* Mark vehicles which are in sub-groups */ int y = r.top; - uint max = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->vehicles.Length()); + uint max = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->vehicles.size()); for (uint i = this->vscroll->GetPosition(); i < max; ++i) { const Vehicle *v = this->vehicles[i]; if (v->group_id != this->vli.index) { @@ -658,7 +658,7 @@ public: case WID_GL_LIST_GROUP: { // Matrix Group uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP, 0, this->tiny_step_height); - if (id_g >= this->groups.Length()) return; + if (id_g >= this->groups.size()) return; this->group_sel = this->vli.index = this->groups[id_g]->index; @@ -671,7 +671,7 @@ public: case WID_GL_LIST_VEHICLE: { // Matrix Vehicle uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_VEHICLE); - if (id_v >= this->vehicles.Length()) return; // click out of list bound + if (id_v >= this->vehicles.size()) return; // click out of list bound const Vehicle *v = this->vehicles[id_v]; if (VehicleClicked(v)) break; @@ -749,7 +749,7 @@ public: case WID_GL_LIST_GROUP: { // Matrix group uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP, 0, this->tiny_step_height); - GroupID new_g = id_g >= this->groups.Length() ? INVALID_GROUP : this->groups[id_g]->index; + GroupID new_g = id_g >= this->groups.size() ? INVALID_GROUP : this->groups[id_g]->index; if (this->group_sel != new_g && g->parent != new_g) { DoCommandP(0, this->group_sel | (1 << 16), new_g, CMD_ALTER_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_SET_PARENT)); @@ -782,7 +782,7 @@ public: this->SetDirty(); uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP, 0, this->tiny_step_height); - GroupID new_g = id_g >= this->groups.Length() ? NEW_GROUP : this->groups[id_g]->index; + GroupID new_g = id_g >= this->groups.size() ? NEW_GROUP : this->groups[id_g]->index; DoCommandP(0, new_g, vindex | (_ctrl_pressed ? 1 << 31 : 0), CMD_ADD_VEHICLE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE), new_g == NEW_GROUP ? CcAddVehicleNewGroup : NULL); break; @@ -795,7 +795,7 @@ public: this->SetDirty(); uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_VEHICLE); - if (id_v >= this->vehicles.Length()) return; // click out of list bound + if (id_v >= this->vehicles.size()) return; // click out of list bound const Vehicle *v = this->vehicles[id_v]; if (!VehicleClicked(v) && vindex == v->index) { @@ -834,7 +834,7 @@ public: break; case WID_GL_MANAGE_VEHICLES_DROPDOWN: - assert(this->vehicles.Length() != 0); + assert(this->vehicles.size() != 0); switch (index) { case ADI_REPLACE: // Replace window @@ -895,7 +895,7 @@ public: case WID_GL_LIST_GROUP: { // ... the list of custom groups. uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP, 0, this->tiny_step_height); - new_group_over = id_g >= this->groups.Length() ? NEW_GROUP : this->groups[id_g]->index; + new_group_over = id_g >= this->groups.size() ? NEW_GROUP : this->groups[id_g]->index; break; } } diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp index c88d4499a3..9411887ea7 100644 --- a/src/hotkeys.cpp +++ b/src/hotkeys.cpp @@ -203,7 +203,7 @@ const char *SaveKeycodes(const Hotkey *hotkey) { static char buf[128]; buf[0] = '\0'; - for (uint i = 0; i < hotkey->keycodes.Length(); i++) { + for (uint i = 0; i < hotkey->keycodes.size(); i++) { const char *str = KeycodeToString(hotkey->keycodes[i]); if (i > 0) strecat(buf, ",", lastof(buf)); strecat(buf, str, lastof(buf)); diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index eb6018973f..32c62bfa3d 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -1211,7 +1211,7 @@ protected: this->industries.shrink_to_fit(); this->industries.RebuildDone(); - this->vscroll->SetCount(this->industries.Length()); // Update scrollbar as well. + this->vscroll->SetCount(this->industries.size()); // Update scrollbar as well. } if (!this->industries.Sort()) return; @@ -1372,11 +1372,11 @@ public: case WID_ID_INDUSTRY_LIST: { int n = 0; int y = r.top + WD_FRAMERECT_TOP; - if (this->industries.Length() == 0) { + if (this->industries.size() == 0) { DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_INDUSTRY_DIRECTORY_NONE); break; } - for (uint i = this->vscroll->GetPosition(); i < this->industries.Length(); i++) { + for (uint i = this->vscroll->GetPosition(); i < this->industries.size(); i++) { DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, this->GetIndustryString(this->industries[i])); y += this->resize.step_height; @@ -1411,7 +1411,7 @@ public: case WID_ID_INDUSTRY_LIST: { Dimension d = GetStringBoundingBox(STR_INDUSTRY_DIRECTORY_NONE); - for (uint i = 0; i < this->industries.Length(); i++) { + for (uint i = 0; i < this->industries.size(); i++) { d = maxdim(d, GetStringBoundingBox(this->GetIndustryString(this->industries[i]))); } resize->height = d.height; @@ -1439,7 +1439,7 @@ public: case WID_ID_INDUSTRY_LIST: { uint p = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_ID_INDUSTRY_LIST, WD_FRAMERECT_TOP); - if (p < this->industries.Length()) { + if (p < this->industries.size()) { if (_ctrl_pressed) { ShowExtraViewPortWindow(this->industries[p]->location.tile); } else { @@ -2589,7 +2589,7 @@ struct IndustryCargoesWindow : public Window { const NWidgetBase *nwp = this->GetWidget(WID_IC_PANEL); int vpos = -this->vscroll->GetPosition() * nwp->resize_y; - for (uint i = 0; i < this->fields.Length(); i++) { + for (uint i = 0; i < this->fields.size(); i++) { int row_height = (i == 0) ? CargoesField::small_height : CargoesField::normal_height; if (vpos + row_height >= 0) { int xpos = left_pos; @@ -2631,7 +2631,7 @@ struct IndustryCargoesWindow : public Window { if (pt.y < vpos) return false; int row = (pt.y - vpos) / CargoesField::normal_height; // row is relative to row 1. - if (row + 1 >= (int)this->fields.Length()) return false; + if (row + 1 >= (int)this->fields.size()) return false; vpos = pt.y - vpos - row * CargoesField::normal_height; // Position in the row + 1 field row++; // rebase row to match index of this->fields. @@ -2710,7 +2710,7 @@ struct IndustryCargoesWindow : public Window { FOR_ALL_SORTED_STANDARD_CARGOSPECS(cs) { *lst->Append() = new DropDownListStringItem(cs->name, cs->Index(), false); } - if (lst->Length() == 0) { + if (lst->size() == 0) { delete lst; break; } @@ -2727,7 +2727,7 @@ struct IndustryCargoesWindow : public Window { if (!indsp->enabled) continue; *lst->Append() = new DropDownListStringItem(indsp->name, ind, false); } - if (lst->Length() == 0) { + if (lst->size() == 0) { delete lst; break; } diff --git a/src/linkgraph/linkgraph.h b/src/linkgraph/linkgraph.h index 799f22c780..1900c0b1f5 100644 --- a/src/linkgraph/linkgraph.h +++ b/src/linkgraph/linkgraph.h @@ -496,7 +496,7 @@ public: * Get the current size of the component. * @return Size. */ - inline uint Size() const { return this->nodes.Length(); } + inline uint Size() const { return this->nodes.size(); } /** * Get date of last compression. diff --git a/src/music/dmusic.cpp b/src/music/dmusic.cpp index fece709fda..a03a6ec57e 100644 --- a/src/music/dmusic.cpp +++ b/src/music/dmusic.cpp @@ -686,7 +686,7 @@ static void MidiThreadProc(void *) size_t preload_bytes = 0; for (size_t bl = 0; bl < current_file.blocks.size(); bl++) { MidiFile::DataBlock &block = current_file.blocks[bl]; - preload_bytes += block.data.Length(); + preload_bytes += block.data.size(); if (block.ticktime >= current_segment.start) { if (current_segment.loop) { DEBUG(driver, 2, "DMusic: timer: loop from block %d (ticktime %d, realtime %.3f, bytes %d)", (int)bl, (int)block.ticktime, ((int)block.realtime) / 1000.0, (int)preload_bytes); @@ -752,7 +752,7 @@ static void MidiThreadProc(void *) DEBUG(driver, 9, "DMusic thread: Streaming block " PRINTF_SIZE " (cur=" OTTD_PRINTF64 ", block=" OTTD_PRINTF64 ")", current_block, (long long)(current_time / MS_TO_REFTIME), (long long)(block_time / MS_TO_REFTIME)); byte *data = block.data.Begin(); - size_t remaining = block.data.Length(); + size_t remaining = block.data.size(); byte last_status = 0; while (remaining > 0) { /* MidiFile ought to have converted everything out of running status, diff --git a/src/music/midifile.cpp b/src/music/midifile.cpp index 91f83c529d..fb3c187c05 100644 --- a/src/music/midifile.cpp +++ b/src/music/midifile.cpp @@ -330,14 +330,14 @@ static bool FixupMidiData(MidiFile &target) uint32 last_ticktime = 0; for (size_t i = 0; i < target.blocks.size(); i++) { MidiFile::DataBlock &block = target.blocks[i]; - if (block.data.Length() == 0) { + if (block.data.size() == 0) { continue; } else if (block.ticktime > last_ticktime || merged_blocks.size() == 0) { merged_blocks.push_back(block); last_ticktime = block.ticktime; } else { - byte *datadest = merged_blocks.back().data.Append(block.data.Length()); - memcpy(datadest, block.data.Begin(), block.data.Length()); + byte *datadest = merged_blocks.back().data.Append(block.data.size()); + memcpy(datadest, block.data.Begin(), block.data.size()); } } std::swap(merged_blocks, target.blocks); diff --git a/src/music/win32_m.cpp b/src/music/win32_m.cpp index a32318db12..6d88af4a3c 100644 --- a/src/music/win32_m.cpp +++ b/src/music/win32_m.cpp @@ -187,7 +187,7 @@ void CALLBACK TimerCallback(UINT uTimerID, UINT, DWORD_PTR dwUser, DWORD_PTR, DW uint preload_bytes = 0; for (size_t bl = 0; bl < _midi.current_file.blocks.size(); bl++) { MidiFile::DataBlock &block = _midi.current_file.blocks[bl]; - preload_bytes += block.data.Length(); + preload_bytes += block.data.size(); if (block.ticktime >= _midi.current_segment.start) { if (_midi.current_segment.loop) { DEBUG(driver, 2, "Win32-MIDI: timer: loop from block %d (ticktime %d, realtime %.3f, bytes %d)", (int)bl, (int)block.ticktime, ((int)block.realtime)/1000.0, (int)preload_bytes); @@ -230,7 +230,7 @@ void CALLBACK TimerCallback(UINT uTimerID, UINT, DWORD_PTR dwUser, DWORD_PTR, DW } byte *data = block.data.Begin(); - size_t remaining = block.data.Length(); + size_t remaining = block.data.size(); byte last_status = 0; while (remaining > 0) { /* MidiFile ought to have converted everything out of running status, diff --git a/src/network/core/tcp_http.cpp b/src/network/core/tcp_http.cpp index 3a40e3eec2..d2ab0638c9 100644 --- a/src/network/core/tcp_http.cpp +++ b/src/network/core/tcp_http.cpp @@ -297,7 +297,7 @@ int NetworkHTTPSocketHandler::Receive() /* static */ void NetworkHTTPSocketHandler::HTTPReceive() { /* No connections, just bail out. */ - if (_http_connections.Length() == 0) return; + if (_http_connections.size() == 0) return; fd_set read_fd; struct timeval tv; diff --git a/src/network/core/tcp_listen.h b/src/network/core/tcp_listen.h index b9f987190f..55594070be 100644 --- a/src/network/core/tcp_listen.h +++ b/src/network/core/tcp_listen.h @@ -140,7 +140,7 @@ public: */ static bool Listen(uint16 port) { - assert(sockets.Length() == 0); + assert(sockets.size() == 0); NetworkAddressList addresses; GetBindAddresses(&addresses, port); @@ -149,7 +149,7 @@ public: address->Listen(SOCK_STREAM, &sockets); } - if (sockets.Length() == 0) { + if (sockets.size() == 0) { DEBUG(net, 0, "[server] could not start network: could not create listening socket"); NetworkError(STR_NETWORK_ERROR_SERVER_START); return false; diff --git a/src/network/core/udp.cpp b/src/network/core/udp.cpp index 83c14d2b05..db655c0cfa 100644 --- a/src/network/core/udp.cpp +++ b/src/network/core/udp.cpp @@ -51,7 +51,7 @@ bool NetworkUDPSocketHandler::Listen() addr->Listen(SOCK_DGRAM, &this->sockets); } - return this->sockets.Length() != 0; + return this->sockets.size() != 0; } /** @@ -80,7 +80,7 @@ NetworkRecvStatus NetworkUDPSocketHandler::CloseConnection(bool error) */ void NetworkUDPSocketHandler::SendPacket(Packet *p, NetworkAddress *recv, bool all, bool broadcast) { - if (this->sockets.Length() == 0) this->Listen(); + if (this->sockets.size() == 0) this->Listen(); for (SocketList::iterator s = this->sockets.Begin(); s != this->sockets.End(); s++) { /* Make a local copy because if we resolve it we cannot diff --git a/src/network/network.cpp b/src/network/network.cpp index e437f4df0a..3780258bde 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -637,7 +637,7 @@ void GetBindAddresses(NetworkAddressList *addresses, uint16 port) } /* No address, so bind to everything. */ - if (addresses->Length() == 0) { + if (addresses->size() == 0) { *addresses->Append() = NetworkAddress("", port); } } diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index 0ef0606281..d36aec6baa 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -246,12 +246,12 @@ void ClientNetworkContentSocketHandler::RequestContentList(ContentVector *cv, bo this->Connect(); - assert(cv->Length() < 255); - assert(cv->Length() < (SEND_MTU - sizeof(PacketSize) - sizeof(byte) - sizeof(uint8)) / + assert(cv->size() < 255); + assert(cv->size() < (SEND_MTU - sizeof(PacketSize) - sizeof(byte) - sizeof(uint8)) / (sizeof(uint8) + sizeof(uint32) + (send_md5sum ? /*sizeof(ContentInfo::md5sum)*/16 : 0))); Packet *p = new Packet(send_md5sum ? PACKET_CONTENT_CLIENT_INFO_EXTID_MD5 : PACKET_CONTENT_CLIENT_INFO_EXTID); - p->Send_uint8(cv->Length()); + p->Send_uint8(cv->size()); for (ContentIterator iter = cv->Begin(); iter != cv->End(); iter++) { const ContentInfo *ci = *iter; @@ -304,7 +304,7 @@ void ClientNetworkContentSocketHandler::DownloadSelectedContent(uint &files, uin bytes += ci->filesize; } - files = content.Length(); + files = content.size(); /* If there's nothing to download, do nothing. */ if (files == 0) return; @@ -322,7 +322,7 @@ void ClientNetworkContentSocketHandler::DownloadSelectedContent(uint &files, uin */ void ClientNetworkContentSocketHandler::DownloadSelectedContentHTTP(const ContentIDList &content) { - uint count = content.Length(); + uint count = content.size(); /* Allocate memory for the whole request. * Requests are "id\nid\n..." (as strings), so assume the maximum ID, @@ -350,7 +350,7 @@ void ClientNetworkContentSocketHandler::DownloadSelectedContentHTTP(const Conten */ void ClientNetworkContentSocketHandler::DownloadSelectedContentFallback(const ContentIDList &content) { - uint count = content.Length(); + uint count = content.size(); const ContentID *content_ids = content.Begin(); this->Connect(); @@ -607,7 +607,7 @@ void ClientNetworkContentSocketHandler::OnReceiveData(const char *data, size_t l this->AfterDownload(); } - if ((uint)this->http_response_index >= this->http_response.Length()) { + if ((uint)this->http_response_index >= this->http_response.size()) { /* It's not a real failure, but if there's * nothing more to download it helps with * cleaning up the stuff we allocated. */ @@ -653,7 +653,7 @@ void ClientNetworkContentSocketHandler::OnReceiveData(const char *data, size_t l str = p + 1; /* Is it a fallback URL? If so, just continue with the next one. */ if (strncmp(str, "ottd", 4) == 0) { - if ((uint)this->http_response_index >= this->http_response.Length()) { + if ((uint)this->http_response_index >= this->http_response.size()) { /* Have we gone through all lines? */ this->OnFailure(); return; @@ -925,7 +925,7 @@ void ClientNetworkContentSocketHandler::ReverseLookupTreeDependency(ConstContent * we are including stuff into the vector and as such the vector's data * store can be reallocated (and thus move), which means out iterating * pointer gets invalid. So fall back to the indices. */ - for (uint i = 0; i < tree.Length(); i++) { + for (uint i = 0; i < tree.size(); i++) { ConstContentVector parents; this->ReverseLookupDependency(parents, tree[i]); diff --git a/src/network/network_content.h b/src/network/network_content.h index 7a96a73c06..0d30de857d 100644 --- a/src/network/network_content.h +++ b/src/network/network_content.h @@ -129,7 +129,7 @@ public: void CheckDependencyState(ContentInfo *ci); /** Get the number of content items we know locally. */ - uint Length() const { return this->infos.Length(); } + uint Length() const { return this->infos.size(); } /** Get the begin of the content inf iterator. */ ConstContentIterator Begin() const { return this->infos.Begin(); } /** Get the nth position of the content inf iterator. */ diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index cb534d7961..51215935ca 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -401,7 +401,7 @@ class NetworkContentListWindow : public Window, ContentCallback { this->content.RebuildDone(); this->SortContentList(); - this->vscroll->SetCount(this->content.Length()); // Update the scrollbar + this->vscroll->SetCount(this->content.size()); // Update the scrollbar this->ScrollToSelected(); } @@ -791,7 +791,7 @@ public: switch (widget) { case WID_NCL_MATRIX: { uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_NCL_MATRIX); - if (id_v >= this->content.Length()) return; // click out of bounds + if (id_v >= this->content.size()) return; // click out of bounds this->selected = *this->content.Get(id_v); this->list_pos = id_v; @@ -815,7 +815,7 @@ public: case WID_NCL_NAME: if (this->content.SortType() == widget - WID_NCL_CHECKBOX) { this->content.ToggleSortOrder(); - if (this->content.Length() > 0) this->list_pos = this->content.Length() - this->list_pos - 1; + if (this->content.size() > 0) this->list_pos = this->content.size() - this->list_pos - 1; } else { this->content.SetSortType(widget - WID_NCL_CHECKBOX); this->content.ForceResort(); @@ -874,7 +874,7 @@ public: break; case WKC_DOWN: /* scroll down by one */ - if (this->list_pos < (int)this->content.Length() - 1) this->list_pos++; + if (this->list_pos < (int)this->content.size() - 1) this->list_pos++; break; case WKC_PAGEUP: /* scroll up a page */ @@ -882,7 +882,7 @@ public: break; case WKC_PAGEDOWN: /* scroll down a page */ - this->list_pos = min(this->list_pos + this->vscroll->GetCapacity(), (int)this->content.Length() - 1); + this->list_pos = min(this->list_pos + this->vscroll->GetCapacity(), (int)this->content.size() - 1); break; case WKC_HOME: /* jump to beginning */ @@ -890,7 +890,7 @@ public: break; case WKC_END: /* jump to end */ - this->list_pos = this->content.Length() - 1; + this->list_pos = this->content.size() - 1; break; case WKC_SPACE: @@ -914,7 +914,7 @@ public: return ES_NOT_HANDLED; } - if (this->content.Length() == 0) { + if (this->content.size() == 0) { this->list_pos = 0; // above stuff may result in "-1". if (this->UpdateFilterState()) { this->content.ForceRebuild(); diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 1451e7154e..e3c4555bf5 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -269,7 +269,7 @@ protected: this->servers.shrink_to_fit(); this->servers.RebuildDone(); - this->vscroll->SetCount(this->servers.Length()); + this->vscroll->SetCount(this->servers.size()); /* Sort the list of network games as requested. */ this->servers.Sort(); @@ -354,7 +354,7 @@ protected: void UpdateListPos() { this->list_pos = SLP_INVALID; - for (uint i = 0; i != this->servers.Length(); i++) { + for (uint i = 0; i != this->servers.size(); i++) { if (this->servers[i] == this->server) { this->list_pos = i; break; @@ -564,7 +564,7 @@ public: case WID_NG_MATRIX: { uint16 y = r.top; - const int max = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), (int)this->servers.Length()); + const int max = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), (int)this->servers.size()); for (int i = this->vscroll->GetPosition(); i < max; ++i) { const NetworkGameList *ngl = this->servers[i]; @@ -710,7 +710,7 @@ public: case WID_NG_INFO: // Connectivity (green dot) if (this->servers.SortType() == widget - WID_NG_NAME) { this->servers.ToggleSortOrder(); - if (this->list_pos != SLP_INVALID) this->list_pos = this->servers.Length() - this->list_pos - 1; + if (this->list_pos != SLP_INVALID) this->list_pos = this->servers.size() - this->list_pos - 1; } else { this->servers.SetSortType(widget - WID_NG_NAME); this->servers.ForceResort(); @@ -722,7 +722,7 @@ public: case WID_NG_MATRIX: { // Show available network games uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_NG_MATRIX); - this->server = (id_v < this->servers.Length()) ? this->servers[id_v] : NULL; + this->server = (id_v < this->servers.size()) ? this->servers[id_v] : NULL; this->list_pos = (server == NULL) ? SLP_INVALID : id_v; this->SetDirty(); @@ -819,7 +819,7 @@ public: /* handle up, down, pageup, pagedown, home and end */ if (keycode == WKC_UP || keycode == WKC_DOWN || keycode == WKC_PAGEUP || keycode == WKC_PAGEDOWN || keycode == WKC_HOME || keycode == WKC_END) { - if (this->servers.Length() == 0) return ES_HANDLED; + if (this->servers.size() == 0) return ES_HANDLED; switch (keycode) { case WKC_UP: /* scroll up by one */ @@ -829,7 +829,7 @@ public: case WKC_DOWN: /* scroll down by one */ if (this->list_pos == SLP_INVALID) return ES_HANDLED; - if (this->list_pos < this->servers.Length() - 1) this->list_pos++; + if (this->list_pos < this->servers.size() - 1) this->list_pos++; break; case WKC_PAGEUP: /* scroll up a page */ @@ -839,7 +839,7 @@ public: case WKC_PAGEDOWN: /* scroll down a page */ if (this->list_pos == SLP_INVALID) return ES_HANDLED; - this->list_pos = min(this->list_pos + this->vscroll->GetCapacity(), (int)this->servers.Length() - 1); + this->list_pos = min(this->list_pos + this->vscroll->GetCapacity(), (int)this->servers.size() - 1); break; case WKC_HOME: /* jump to beginning */ @@ -847,7 +847,7 @@ public: break; case WKC_END: /* jump to end */ - this->list_pos = this->servers.Length() - 1; + this->list_pos = this->servers.size() - 1; break; default: NOT_REACHED(); } @@ -1789,7 +1789,7 @@ struct NetworkClientListPopupWindow : Window { d = maxdim(GetStringBoundingBox(action->name), d); } - d.height *= this->actions.Length(); + d.height *= this->actions.size(); d.width += WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT; d.height += WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; *size = d; @@ -1819,12 +1819,12 @@ struct NetworkClientListPopupWindow : Window { uint index = (_cursor.pos.y - this->top - WD_FRAMERECT_TOP) / FONT_HEIGHT_NORMAL; if (_left_button_down) { - if (index == this->sel_index || index >= this->actions.Length()) return; + if (index == this->sel_index || index >= this->actions.size()) return; this->sel_index = index; this->SetDirty(); } else { - if (index < this->actions.Length() && _cursor.pos.y >= this->top) { + if (index < this->actions.size() && _cursor.pos.y >= this->top) { const NetworkClientInfo *ci = NetworkClientInfo::GetByClientID(this->client_id); if (ci != NULL) this->actions[index].proc(ci); } diff --git a/src/newgrf.cpp b/src/newgrf.cpp index e26577353b..f80e79f7db 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -658,7 +658,7 @@ static Engine *GetNewEngine(const GRFFile *file, VehicleType type, uint16 intern e->grf_prop.grffile = file; /* Reserve the engine slot */ - assert(_engine_mngr.Length() == e->index); + assert(_engine_mngr.size() == e->index); EngineIDMapping *eid = _engine_mngr.Append(); eid->type = type; eid->grfid = scope_grfid; // Note: this is INVALID_GRFID if dynamic_engines is disabled, so no reservation @@ -1058,7 +1058,7 @@ static ChangeInfoResult RailVehicleChangeInfo(uint engine, int numinfo, int prop case 0x05: { // Track type uint8 tracktype = buf->ReadByte(); - if (tracktype < _cur.grffile->railtype_list.Length()) { + if (tracktype < _cur.grffile->railtype_list.size()) { _gted[e->index].railtypelabel = _cur.grffile->railtype_list[tracktype]; break; } @@ -1200,7 +1200,7 @@ static ChangeInfoResult RailVehicleChangeInfo(uint engine, int numinfo, int prop break; } - if (_cur.grffile->railtype_list.Length() == 0) { + if (_cur.grffile->railtype_list.size() == 0) { /* Use traction type to select between normal and electrified * rail only when no translation list is in place. */ if (_gted[e->index].railtypelabel == RAILTYPE_RAIL_LABEL && engclass >= EC_ELECTRIC) _gted[e->index].railtypelabel = RAILTYPE_ELECTRIC_LABEL; @@ -4799,7 +4799,7 @@ static void NewSpriteGroup(ByteReader *buf) DeterministicSpriteGroupAdjust *adjust = adjusts.Append(); /* The first var adjust doesn't have an operation specified, so we set it to add. */ - adjust->operation = adjusts.Length() == 1 ? DSGA_OP_ADD : (DeterministicSpriteGroupAdjustOperation)buf->ReadByte(); + adjust->operation = adjusts.size() == 1 ? DSGA_OP_ADD : (DeterministicSpriteGroupAdjustOperation)buf->ReadByte(); adjust->variable = buf->ReadByte(); if (adjust->variable == 0x7E) { /* Link subroutine group */ @@ -4824,7 +4824,7 @@ static void NewSpriteGroup(ByteReader *buf) /* Continue reading var adjusts while bit 5 is set. */ } while (HasBit(varadjust, 5)); - group->num_adjusts = adjusts.Length(); + group->num_adjusts = adjusts.size(); group->adjusts = MallocT(group->num_adjusts); MemCpyT(group->adjusts, adjusts.Begin(), group->num_adjusts); @@ -5085,7 +5085,7 @@ static CargoID TranslateCargo(uint8 feature, uint8 ctype) if (feature == GSF_STATIONS && ctype == 0xFE) return CT_DEFAULT_NA; if (ctype == 0xFF) return CT_PURCHASE; - if (_cur.grffile->cargo_list.Length() == 0) { + if (_cur.grffile->cargo_list.size() == 0) { /* No cargo table, so use bitnum values */ if (ctype >= 32) { grfmsg(1, "TranslateCargo: Cargo bitnum %d out of range (max 31), skipping.", ctype); @@ -5105,8 +5105,8 @@ static CargoID TranslateCargo(uint8 feature, uint8 ctype) } /* Check if the cargo type is out of bounds of the cargo translation table */ - if (ctype >= _cur.grffile->cargo_list.Length()) { - grfmsg(1, "TranslateCargo: Cargo type %d out of range (max %d), skipping.", ctype, _cur.grffile->cargo_list.Length() - 1); + if (ctype >= _cur.grffile->cargo_list.size()) { + grfmsg(1, "TranslateCargo: Cargo type %d out of range (max %d), skipping.", ctype, (unsigned int)_cur.grffile->cargo_list.size() - 1); return CT_INVALID; } @@ -7850,8 +7850,8 @@ static bool HandleParameterInfo(ByteReader *buf) continue; } - if (id >= _cur.grfconfig->param_info.Length()) { - uint num_to_add = id - _cur.grfconfig->param_info.Length() + 1; + if (id >= _cur.grfconfig->param_info.size()) { + uint num_to_add = id - _cur.grfconfig->param_info.size() + 1; GRFParameterInfo **newdata = _cur.grfconfig->param_info.Append(num_to_add); MemSetT(newdata, 0, num_to_add); } @@ -8380,7 +8380,7 @@ static void BuildCargoTranslationMap() const CargoSpec *cs = CargoSpec::Get(c); if (!cs->IsValid()) continue; - if (_cur.grffile->cargo_list.Length() == 0) { + if (_cur.grffile->cargo_list.size() == 0) { /* Default translation table, so just a straight mapping to bitnum */ _cur.grffile->cargo_map[c] = cs->bitnum; } else { @@ -8560,7 +8560,7 @@ static void CalculateRefitMasks() { const GRFFile *file = _gted[engine].defaultcargo_grf; if (file == NULL) file = e->GetGRF(); - if (file != NULL && file->grf_version >= 8 && file->cargo_list.Length() != 0) { + if (file != NULL && file->grf_version >= 8 && file->cargo_list.size() != 0) { cargo_map_for_first_refittable = file->cargo_map; } } @@ -9216,7 +9216,7 @@ static void FinalisePriceBaseMultipliers() static const uint32 override_features = (1 << GSF_TRAINS) | (1 << GSF_ROADVEHICLES) | (1 << GSF_SHIPS) | (1 << GSF_AIRCRAFT); /* Evaluate grf overrides */ - int num_grfs = _grf_files.Length(); + int num_grfs = _grf_files.size(); int *grf_overrides = AllocaM(int, num_grfs); for (int i = 0; i < num_grfs; i++) { grf_overrides[i] = -1; diff --git a/src/newgrf_cargo.cpp b/src/newgrf_cargo.cpp index 97db4855e6..58d4102d33 100644 --- a/src/newgrf_cargo.cpp +++ b/src/newgrf_cargo.cpp @@ -82,10 +82,10 @@ CargoID GetCargoTranslation(uint8 cargo, const GRFFile *grffile, bool usebit) /* Other cases use (possibly translated) cargobits */ - if (grffile->cargo_list.Length() > 0) { + if (grffile->cargo_list.size() > 0) { /* ...and the cargo is in bounds, then get the cargo ID for * the label */ - if (cargo < grffile->cargo_list.Length()) return GetCargoIDByLabel(grffile->cargo_list[cargo]); + if (cargo < grffile->cargo_list.size()) return GetCargoIDByLabel(grffile->cargo_list[cargo]); } else { /* Else the cargo value is a 'climate independent' 'bitnum' */ return GetCargoIDByBitnum(cargo); diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index d21d767cdc..fa84c947a4 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -83,7 +83,7 @@ GRFConfig::GRFConfig(const GRFConfig &config) : this->info->AddRef(); this->url->AddRef(); if (config.error != NULL) this->error = new GRFError(*config.error); - for (uint i = 0; i < config.param_info.Length(); i++) { + for (uint i = 0; i < config.param_info.size(); i++) { if (config.param_info[i] == NULL) { *this->param_info.Append() = NULL; } else { @@ -104,7 +104,7 @@ GRFConfig::~GRFConfig() this->info->Release(); this->url->Release(); - for (uint i = 0; i < this->param_info.Length(); i++) delete this->param_info[i]; + for (uint i = 0; i < this->param_info.size(); i++) delete this->param_info[i]; } /** @@ -155,7 +155,7 @@ void GRFConfig::SetParameterDefaults() if (!this->has_param_defaults) return; - for (uint i = 0; i < this->param_info.Length(); i++) { + for (uint i = 0; i < this->param_info.size(); i++) { if (this->param_info[i] == NULL) continue; this->param_info[i]->SetValue(this, this->param_info[i]->def_value); } @@ -261,7 +261,7 @@ GRFParameterInfo::GRFParameterInfo(GRFParameterInfo &info) : num_bit(info.num_bit), complete_labels(info.complete_labels) { - for (uint i = 0; i < info.value_names.Length(); i++) { + for (uint i = 0; i < info.value_names.size(); i++) { SmallPair *data = info.value_names.Get(i); this->value_names.Insert(data->first, DuplicateGRFText(data->second)); } @@ -272,7 +272,7 @@ GRFParameterInfo::~GRFParameterInfo() { CleanUpGRFText(this->name); CleanUpGRFText(this->desc); - for (uint i = 0; i < this->value_names.Length(); i++) { + for (uint i = 0; i < this->value_names.size(); i++) { SmallPair *data = this->value_names.Get(i); CleanUpGRFText(data->second); } @@ -609,7 +609,7 @@ compatible_grf: c->min_loadable_version = f->min_loadable_version; c->num_valid_params = f->num_valid_params; c->has_param_defaults = f->has_param_defaults; - for (uint i = 0; i < f->param_info.Length(); i++) { + for (uint i = 0; i < f->param_info.size(); i++) { if (f->param_info[i] == NULL) { *c->param_info.Append() = NULL; } else { diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index e8fc4efccb..ec1a91d7ba 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -895,7 +895,7 @@ struct SpriteAlignerWindow : Window { int step_size = nwid->resize_y; SmallVector &list = _newgrf_debug_sprite_picker.sprites; - int max = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), list.Length()); + int max = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), list.size()); int y = r.top + WD_FRAMERECT_TOP; for (int i = this->vscroll->GetPosition(); i < max; i++) { @@ -940,7 +940,7 @@ struct SpriteAlignerWindow : Window { int step_size = nwid->resize_y; uint i = this->vscroll->GetPosition() + (pt.y - nwid->pos_y) / step_size; - if (i < _newgrf_debug_sprite_picker.sprites.Length()) { + if (i < _newgrf_debug_sprite_picker.sprites.size()) { SpriteID spr = _newgrf_debug_sprite_picker.sprites[i]; if (GetSpriteType(spr) == ST_NORMAL) this->current_sprite = spr; } @@ -1015,7 +1015,7 @@ struct SpriteAlignerWindow : Window { if (data == 1) { /* Sprite picker finished */ this->RaiseWidget(WID_SA_PICKER); - this->vscroll->SetCount(_newgrf_debug_sprite_picker.sprites.Length()); + this->vscroll->SetCount(_newgrf_debug_sprite_picker.sprites.size()); } } diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 660b7e476b..60d03fcc3e 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -1233,7 +1233,7 @@ void CommitVehicleListOrderChanges() FOR_ALL_ENGINES(e) { *ordering.Append() = e->index; } - QSortT(ordering.Begin(), ordering.Length(), EnginePreSort); + QSortT(ordering.Begin(), ordering.size(), EnginePreSort); /* Apply Insertion-Sort operations */ const ListOrderChange *end = _list_order_changes.End(); diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 4235d31336..fb712700c2 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -166,7 +166,7 @@ struct NewGRFParametersWindow : public Window { clicked_row(UINT_MAX), editable(editable) { - this->action14present = (c->num_valid_params != lengthof(c->param) || c->param_info.Length() != 0); + this->action14present = (c->num_valid_params != lengthof(c->param) || c->param_info.size() != 0); this->CreateNestedTree(); this->vscroll = this->GetScrollbar(WID_NP_SCROLLBAR); @@ -220,7 +220,7 @@ struct NewGRFParametersWindow : public Window { case WID_NP_DESCRIPTION: /* Minimum size of 4 lines. The 500 is the default size of the window. */ Dimension suggestion = {500 - WD_FRAMERECT_LEFT - WD_FRAMERECT_RIGHT, (uint)FONT_HEIGHT_NORMAL * 4 + WD_TEXTPANEL_TOP + WD_TEXTPANEL_BOTTOM}; - for (uint i = 0; i < this->grf_config->param_info.Length(); i++) { + for (uint i = 0; i < this->grf_config->param_info.size(); i++) { const GRFParameterInfo *par_info = this->grf_config->param_info[i]; if (par_info == NULL) continue; const char *desc = GetGRFStringFromGRFText(par_info->desc); @@ -246,7 +246,7 @@ struct NewGRFParametersWindow : public Window { void DrawWidget(const Rect &r, int widget) const override { if (widget == WID_NP_DESCRIPTION) { - const GRFParameterInfo *par_info = (this->clicked_row < this->grf_config->param_info.Length()) ? this->grf_config->param_info[this->clicked_row] : NULL; + const GRFParameterInfo *par_info = (this->clicked_row < this->grf_config->param_info.size()) ? this->grf_config->param_info[this->clicked_row] : NULL; if (par_info == NULL) return; const char *desc = GetGRFStringFromGRFText(par_info->desc); if (desc == NULL) return; @@ -265,7 +265,7 @@ struct NewGRFParametersWindow : public Window { int button_y_offset = (this->line_height - SETTING_BUTTON_HEIGHT) / 2; int text_y_offset = (this->line_height - FONT_HEIGHT_NORMAL) / 2; for (uint i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < this->vscroll->GetCount(); i++) { - GRFParameterInfo *par_info = (i < this->grf_config->param_info.Length()) ? this->grf_config->param_info[i] : NULL; + GRFParameterInfo *par_info = (i < this->grf_config->param_info.size()) ? this->grf_config->param_info[i] : NULL; if (par_info == NULL) par_info = GetDummyParameterInfo(i); uint32 current_value = par_info->GetValue(this->grf_config); bool selected = (i == this->clicked_row); @@ -350,7 +350,7 @@ struct NewGRFParametersWindow : public Window { if (_current_text_dir == TD_RTL) x = wid->current_x - 1 - x; x -= 4; - GRFParameterInfo *par_info = (num < this->grf_config->param_info.Length()) ? this->grf_config->param_info[num] : NULL; + GRFParameterInfo *par_info = (num < this->grf_config->param_info.size()) ? this->grf_config->param_info[num] : NULL; if (par_info == NULL) par_info = GetDummyParameterInfo(num); /* One of the arrows is clicked */ @@ -431,7 +431,7 @@ struct NewGRFParametersWindow : public Window { { if (StrEmpty(str)) return; int32 value = atoi(str); - GRFParameterInfo *par_info = ((uint)this->clicked_row < this->grf_config->param_info.Length()) ? this->grf_config->param_info[this->clicked_row] : NULL; + GRFParameterInfo *par_info = ((uint)this->clicked_row < this->grf_config->param_info.size()) ? this->grf_config->param_info[this->clicked_row] : NULL; if (par_info == NULL) par_info = GetDummyParameterInfo(this->clicked_row); uint32 val = Clamp(value, par_info->min_value, par_info->max_value); par_info->SetValue(this->grf_config, val); @@ -441,7 +441,7 @@ struct NewGRFParametersWindow : public Window { void OnDropdownSelect(int widget, int index) override { assert(this->clicked_dropdown); - GRFParameterInfo *par_info = ((uint)this->clicked_row < this->grf_config->param_info.Length()) ? this->grf_config->param_info[this->clicked_row] : NULL; + GRFParameterInfo *par_info = ((uint)this->clicked_row < this->grf_config->param_info.size()) ? this->grf_config->param_info[this->clicked_row] : NULL; if (par_info == NULL) par_info = GetDummyParameterInfo(this->clicked_row); par_info->SetValue(this->grf_config, index); this->SetDirty(); @@ -747,7 +747,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { case WID_NS_PRESET_LIST: { Dimension d = GetStringBoundingBox(STR_NUM_CUSTOM); - for (uint i = 0; i < _grf_preset_list.Length(); i++) { + for (uint i = 0; i < _grf_preset_list.size(); i++) { if (_grf_preset_list[i] != NULL) { SetDParamStr(0, _grf_preset_list[i]); d = maxdim(d, GetStringBoundingBox(STR_JUST_RAW_STRING)); @@ -882,7 +882,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { int offset_y = (step_height - FONT_HEIGHT_NORMAL) / 2; uint y = r.top + WD_FRAMERECT_TOP; uint min_index = this->vscroll2->GetPosition(); - uint max_index = min(min_index + this->vscroll2->GetCapacity(), this->avails.Length()); + uint max_index = min(min_index + this->vscroll2->GetCapacity(), this->avails.size()); for (uint i = min_index; i < max_index; i++) { const GRFConfig *c = this->avails[i]; @@ -929,7 +929,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { /* Add 'None' option for clearing list */ *list->Append() = new DropDownListStringItem(STR_NONE, -1, false); - for (uint i = 0; i < _grf_preset_list.Length(); i++) { + for (uint i = 0; i < _grf_preset_list.size(); i++) { if (_grf_preset_list[i] != NULL) { *list->Append() = new DropDownListCharStringItem(_grf_preset_list[i], i, false); } @@ -1069,7 +1069,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { uint i = this->vscroll2->GetScrolledRowFromWidget(pt.y, this, WID_NS_AVAIL_LIST); this->active_sel = NULL; DeleteWindowByClass(WC_GRF_PARAMETERS); - if (i < this->avails.Length()) { + if (i < this->avails.size()) { if (this->avail_sel != this->avails[i]) DeleteWindowByClass(WC_TEXTFILE); this->avail_sel = this->avails[i]; this->avail_pos = i; @@ -1175,7 +1175,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { GetGRFPresetList(&_grf_preset_list); /* Switch to this preset */ - for (uint i = 0; i < _grf_preset_list.Length(); i++) { + for (uint i = 0; i < _grf_preset_list.size(); i++) { if (_grf_preset_list[i] != NULL && strcmp(_grf_preset_list[i], str) == 0) { this->preset = i; break; @@ -1308,7 +1308,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { case WKC_DOWN: /* scroll down by one */ - if (this->avail_pos < (int)this->avails.Length() - 1) this->avail_pos++; + if (this->avail_pos < (int)this->avails.size() - 1) this->avail_pos++; break; case WKC_PAGEUP: @@ -1318,7 +1318,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { case WKC_PAGEDOWN: /* scroll down a page */ - this->avail_pos = min(this->avail_pos + this->vscroll2->GetCapacity(), (int)this->avails.Length() - 1); + this->avail_pos = min(this->avail_pos + this->vscroll2->GetCapacity(), (int)this->avails.size() - 1); break; case WKC_HOME: @@ -1328,14 +1328,14 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { case WKC_END: /* jump to end */ - this->avail_pos = this->avails.Length() - 1; + this->avail_pos = this->avails.size() - 1; break; default: return ES_NOT_HANDLED; } - if (this->avails.Length() == 0) this->avail_pos = -1; + if (this->avails.size() == 0) this->avail_pos = -1; if (this->avail_pos >= 0) { this->active_sel = NULL; DeleteWindowByClass(WC_GRF_PARAMETERS); @@ -1490,7 +1490,7 @@ private: if (this->avail_pos < 0) this->avail_sel = NULL; } - this->vscroll2->SetCount(this->avails.Length()); // Update the scrollbar + this->vscroll2->SetCount(this->avails.size()); // Update the scrollbar } /** @@ -1531,7 +1531,7 @@ private: /* Select next (or previous, if last one) item in the list. */ int new_pos = this->avail_pos + 1; - if (new_pos >= (int)this->avails.Length()) new_pos = this->avail_pos - 1; + if (new_pos >= (int)this->avails.size()) new_pos = this->avail_pos - 1; this->avail_pos = new_pos; if (new_pos >= 0) this->avail_sel = this->avails[new_pos]; @@ -1560,7 +1560,7 @@ void ShowMissingContentWindow(const GRFConfig *list) memcpy(ci->md5sum, HasBit(c->flags, GCF_COMPATIBLE) ? c->original_md5sum : c->ident.md5sum, sizeof(ci->md5sum)); *cv.Append() = ci; } - ShowNetworkContentListWindow(cv.Length() == 0 ? NULL : &cv, CONTENT_TYPE_NEWGRF); + ShowNetworkContentListWindow(cv.size() == 0 ? NULL : &cv, CONTENT_TYPE_NEWGRF); } Listing NewGRFWindow::last_sorting = {false, 0}; @@ -2049,7 +2049,7 @@ struct SavePresetWindow : public Window { GetGRFPresetList(&this->presets); this->selected = -1; if (initial_text != NULL) { - for (uint i = 0; i < this->presets.Length(); i++) { + for (uint i = 0; i < this->presets.size(); i++) { if (!strcmp(initial_text, this->presets[i])) { this->selected = i; break; @@ -2065,7 +2065,7 @@ struct SavePresetWindow : public Window { this->vscroll = this->GetScrollbar(WID_SVP_SCROLLBAR); this->FinishInitNested(0); - this->vscroll->SetCount(this->presets.Length()); + this->vscroll->SetCount(this->presets.size()); this->SetFocusedWidget(WID_SVP_EDITBOX); if (initial_text != NULL) this->presetname_editbox.text.Assign(initial_text); } @@ -2080,12 +2080,12 @@ struct SavePresetWindow : public Window { case WID_SVP_PRESET_LIST: { resize->height = FONT_HEIGHT_NORMAL + 2U; size->height = 0; - for (uint i = 0; i < this->presets.Length(); i++) { + for (uint i = 0; i < this->presets.size(); i++) { Dimension d = GetStringBoundingBox(this->presets[i]); size->width = max(size->width, d.width + WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT); resize->height = max(resize->height, d.height); } - size->height = ClampU(this->presets.Length(), 5, 20) * resize->height + 1; + size->height = ClampU(this->presets.size(), 5, 20) * resize->height + 1; break; } } @@ -2101,7 +2101,7 @@ struct SavePresetWindow : public Window { int offset_y = (step_height - FONT_HEIGHT_NORMAL) / 2; uint y = r.top + WD_FRAMERECT_TOP; uint min_index = this->vscroll->GetPosition(); - uint max_index = min(min_index + this->vscroll->GetCapacity(), this->presets.Length()); + uint max_index = min(min_index + this->vscroll->GetCapacity(), this->presets.size()); for (uint i = min_index; i < max_index; i++) { if ((int)i == this->selected) GfxFillRect(r.left + 1, y, r.right - 1, y + step_height - 2, PC_DARK_BLUE); @@ -2120,7 +2120,7 @@ struct SavePresetWindow : public Window { switch (widget) { case WID_SVP_PRESET_LIST: { uint row = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SVP_PRESET_LIST); - if (row < this->presets.Length()) { + if (row < this->presets.size()) { this->selected = row; this->presetname_editbox.text.Assign(this->presets[row]); this->SetWidgetDirty(WID_SVP_PRESET_LIST); diff --git a/src/newgrf_railtype.cpp b/src/newgrf_railtype.cpp index 8421844717..60ddc19140 100644 --- a/src/newgrf_railtype.cpp +++ b/src/newgrf_railtype.cpp @@ -139,7 +139,7 @@ SpriteID GetCustomSignalSprite(const RailtypeInfo *rti, TileIndex tile, SignalTy uint8 GetReverseRailTypeTranslation(RailType railtype, const GRFFile *grffile) { /* No rail type table present, return rail type as-is */ - if (grffile == NULL || grffile->railtype_list.Length() == 0) return railtype; + if (grffile == NULL || grffile->railtype_list.size() == 0) return railtype; /* Look for a matching rail type label in the table */ RailTypeLabel label = GetRailTypeInfo(railtype)->label; diff --git a/src/newgrf_sound.cpp b/src/newgrf_sound.cpp index 9d890e9caf..dfe7e403ef 100644 --- a/src/newgrf_sound.cpp +++ b/src/newgrf_sound.cpp @@ -49,14 +49,14 @@ void InitializeSoundPool() SoundEntry *GetSound(SoundID index) { - if (index >= _sounds.Length()) return NULL; + if (index >= _sounds.size()) return NULL; return &_sounds[index]; } uint GetNumSounds() { - return _sounds.Length(); + return _sounds.size(); } diff --git a/src/os/macosx/string_osx.cpp b/src/os/macosx/string_osx.cpp index 1c5d558855..4abf0037ca 100644 --- a/src/os/macosx/string_osx.cpp +++ b/src/os/macosx/string_osx.cpp @@ -85,7 +85,7 @@ public: virtual int GetLeading() const; virtual int GetWidth() const; - virtual int CountRuns() const { return this->Length(); } + virtual int CountRuns() const { return this->size(); } virtual const VisualRun *GetVisualRun(int run) const { return *this->Get(run); } int GetInternalCharLength(WChar c) const @@ -256,7 +256,7 @@ int CoreTextParagraphLayout::CoreTextLine::GetLeading() const */ int CoreTextParagraphLayout::CoreTextLine::GetWidth() const { - if (this->Length() == 0) return 0; + if (this->size() == 0) return 0; int total_width = 0; for (const CoreTextVisualRun * const *run = this->Begin(); run != this->End(); run++) { diff --git a/src/os/windows/string_uniscribe.cpp b/src/os/windows/string_uniscribe.cpp index ce61537b2b..8877d36a65 100644 --- a/src/os/windows/string_uniscribe.cpp +++ b/src/os/windows/string_uniscribe.cpp @@ -110,7 +110,7 @@ public: public: virtual int GetLeading() const; virtual int GetWidth() const; - virtual int CountRuns() const { return this->Length(); } + virtual int CountRuns() const { return this->size(); } virtual const VisualRun *GetVisualRun(int run) const { return *this->Get(run); } int GetInternalCharLength(WChar c) const diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index a948ac0f9b..17df27fc5d 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -1747,7 +1747,7 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 break; } - for (uint i = 0; i < vehicles_affected.Length(); ++i) { + for (uint i = 0; i < vehicles_affected.size(); ++i) { TryPathReserve(vehicles_affected[i], true); } } diff --git a/src/saveload/animated_tile_sl.cpp b/src/saveload/animated_tile_sl.cpp index 6db0561cd3..36571c418c 100644 --- a/src/saveload/animated_tile_sl.cpp +++ b/src/saveload/animated_tile_sl.cpp @@ -25,8 +25,8 @@ extern SmallVector _animated_tiles; */ static void Save_ANIT() { - SlSetLength(_animated_tiles.Length() * sizeof(*_animated_tiles.Begin())); - SlArray(_animated_tiles.Begin(), _animated_tiles.Length(), SLE_UINT32); + SlSetLength(_animated_tiles.size() * sizeof(*_animated_tiles.Begin())); + SlArray(_animated_tiles.Begin(), _animated_tiles.size(), SLE_UINT32); } /** diff --git a/src/saveload/game_sl.cpp b/src/saveload/game_sl.cpp index 325ae1c9d4..ff48ab1351 100644 --- a/src/saveload/game_sl.cpp +++ b/src/saveload/game_sl.cpp @@ -132,7 +132,7 @@ static const SaveLoad _game_language_string[] = { static void SaveReal_GSTR(LanguageStrings *ls) { _game_saveload_string = ls->language; - _game_saveload_strings = ls->lines.Length(); + _game_saveload_strings = ls->lines.size(); SlObject(NULL, _game_language_header); for (uint i = 0; i < _game_saveload_strings; i++) { @@ -160,7 +160,7 @@ static void Load_GSTR() } /* If there were no strings in the savegame, set GameStrings to NULL */ - if (_current_data->raw_strings.Length() == 0) { + if (_current_data->raw_strings.size() == 0) { delete _current_data; _current_data = NULL; return; @@ -174,7 +174,7 @@ static void Save_GSTR() { if (_current_data == NULL) return; - for (uint i = 0; i < _current_data->raw_strings.Length(); i++) { + for (uint i = 0; i < _current_data->raw_strings.size(); i++) { SlSetArrayIndex(i); SlAutolength((AutolengthProc *)SaveReal_GSTR, _current_data->raw_strings[i]); } diff --git a/src/saveload/labelmaps_sl.cpp b/src/saveload/labelmaps_sl.cpp index b57a89f208..a25abe722f 100644 --- a/src/saveload/labelmaps_sl.cpp +++ b/src/saveload/labelmaps_sl.cpp @@ -26,7 +26,7 @@ static SmallVector _railtype_list; */ static bool NeedRailTypeConversion() { - for (uint i = 0; i < _railtype_list.Length(); i++) { + for (uint i = 0; i < _railtype_list.size(); i++) { if ((RailType)i < RAILTYPE_END) { const RailtypeInfo *rti = GetRailTypeInfo((RailType)i); if (rti->label != _railtype_list[i]) return true; @@ -44,7 +44,7 @@ void AfterLoadLabelMaps() if (NeedRailTypeConversion()) { SmallVector railtype_conversion_map; - for (uint i = 0; i < _railtype_list.Length(); i++) { + for (uint i = 0; i < _railtype_list.size(); i++) { RailType r = GetRailTypeByLabel(_railtype_list[i]); if (r == INVALID_RAILTYPE) r = RAILTYPE_BEGIN; diff --git a/src/saveload/linkgraph_sl.cpp b/src/saveload/linkgraph_sl.cpp index 76390a0101..1ff2470424 100644 --- a/src/saveload/linkgraph_sl.cpp +++ b/src/saveload/linkgraph_sl.cpp @@ -55,7 +55,7 @@ const SaveLoad *GetLinkGraphJobDesc() static const char *prefix = "linkgraph."; /* Build the SaveLoad array on first call and don't touch it later on */ - if (saveloads.Length() == 0) { + if (saveloads.size() == 0) { size_t offset_gamesettings = cpp_offsetof(GameSettings, linkgraph); size_t offset_component = cpp_offsetof(LinkGraphJob, settings); @@ -83,7 +83,7 @@ const SaveLoad *GetLinkGraphJobDesc() int i = 0; do { *(saveloads.Append()) = job_desc[i++]; - } while (saveloads[saveloads.Length() - 1].cmd != SL_END); + } while (saveloads[saveloads.size() - 1].cmd != SL_END); } return &saveloads[0]; diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index f066d014d3..2aa19af818 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -175,7 +175,7 @@ struct MemoryDumper { */ size_t GetSize() const { - return this->blocks.Length() * MEMORY_CHUNK_SIZE - (this->bufe - this->buf); + return this->blocks.size() * MEMORY_CHUNK_SIZE - (this->bufe - this->buf); } }; diff --git a/src/saveload/waypoint_sl.cpp b/src/saveload/waypoint_sl.cpp index 2567c2c93f..5e3a391f07 100644 --- a/src/saveload/waypoint_sl.cpp +++ b/src/saveload/waypoint_sl.cpp @@ -96,7 +96,7 @@ void MoveWaypointsToBaseStations() } } - if (!Waypoint::CanAllocateItem(_old_waypoints.Length())) SlError(STR_ERROR_TOO_MANY_STATIONS_LOADING); + if (!Waypoint::CanAllocateItem(_old_waypoints.size())) SlError(STR_ERROR_TOO_MANY_STATIONS_LOADING); /* All saveload conversions have been done. Create the new waypoints! */ for (OldWaypoint *wp = _old_waypoints.Begin(); wp != _old_waypoints.End(); wp++) { diff --git a/src/script/squirrel_helper.hpp b/src/script/squirrel_helper.hpp index 002c561069..8d1ee29fc7 100644 --- a/src/script/squirrel_helper.hpp +++ b/src/script/squirrel_helper.hpp @@ -147,9 +147,9 @@ namespace SQConvert { } sq_pop(vm, 2); - Array *arr = (Array*)MallocT(sizeof(Array) + sizeof(int32) * data.Length()); - arr->size = data.Length(); - memcpy(arr->array, data.Begin(), sizeof(int32) * data.Length()); + Array *arr = (Array*)MallocT(sizeof(Array) + sizeof(int32) * data.size()); + arr->size = data.size(); + memcpy(arr->array, data.Begin(), sizeof(int32) * data.size()); *ptr->Append() = arr; return arr; diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index fda7cfa52c..8b20bb9f27 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -215,7 +215,7 @@ struct GameOptionsWindow : Window { if (i == CURRENCY_CUSTOM) continue; *list->Append() = new DropDownListStringItem(*items, i, HasBit(disabled, i)); } - QSortT(list->Begin(), list->Length(), DropDownListStringItem::NatSortFunc); + QSortT(list->Begin(), list->size(), DropDownListStringItem::NatSortFunc); /* Append custom currency at the end */ *list->Append() = new DropDownListItem(-1, false); // separator line @@ -253,9 +253,9 @@ struct GameOptionsWindow : Window { int result = _nb_orig_names + i; *list->Append() = new DropDownListStringItem(_grf_names[i], result, enabled_item != result && enabled_item >= 0); } - QSortT(list->Begin(), list->Length(), DropDownListStringItem::NatSortFunc); + QSortT(list->Begin(), list->size(), DropDownListStringItem::NatSortFunc); - int newgrf_size = list->Length(); + int newgrf_size = list->size(); /* Insert newgrf_names at the top of the list */ if (newgrf_size > 0) { *list->Append() = new DropDownListItem(-1, false); // separator line @@ -266,7 +266,7 @@ struct GameOptionsWindow : Window { for (int i = 0; i < _nb_orig_names; i++) { *list->Append() = new DropDownListStringItem(STR_GAME_OPTIONS_TOWN_NAME_ORIGINAL_ENGLISH + i, i, enabled_item != i && enabled_item >= 0); } - QSortT(list->Begin() + newgrf_size, list->Length() - newgrf_size, DropDownListStringItem::NatSortFunc); + QSortT(list->Begin() + newgrf_size, list->size() - newgrf_size, DropDownListStringItem::NatSortFunc); break; } @@ -282,11 +282,11 @@ struct GameOptionsWindow : Window { case WID_GO_LANG_DROPDOWN: { // Setup interface language dropdown list = new DropDownList(); - for (uint i = 0; i < _languages.Length(); i++) { + for (uint i = 0; i < _languages.size(); i++) { if (&_languages[i] == _current_language) *selected_index = i; *list->Append() = new DropDownListStringItem(SPECSTR_LANGUAGE_START + i, i, false); } - QSortT(list->Begin(), list->Length(), DropDownListStringItem::NatSortFunc); + QSortT(list->Begin(), list->size(), DropDownListStringItem::NatSortFunc); break; } diff --git a/src/settingsgen/settingsgen.cpp b/src/settingsgen/settingsgen.cpp index 35c9911d8b..64901a89f6 100644 --- a/src/settingsgen/settingsgen.cpp +++ b/src/settingsgen/settingsgen.cpp @@ -116,7 +116,7 @@ public: if (length == 0) length = strlen(text); if (length > 0 && this->BufferHasRoom()) { - int stored_size = this->output_buffer[this->output_buffer.Length() - 1].Add(text, length); + int stored_size = this->output_buffer[this->output_buffer.size() - 1].Add(text, length); length -= stored_size; text += stored_size; } @@ -147,7 +147,7 @@ private: */ bool BufferHasRoom() const { - uint num_blocks = this->output_buffer.Length(); + uint num_blocks = this->output_buffer.size(); return num_blocks > 0 && this->output_buffer[num_blocks - 1].HasRoom(); } diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 84b43c69d0..0a1f0dd5d5 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -246,7 +246,7 @@ struct SignListWindow : Window, SignList { } case WID_SIL_FILTER_ENTER_BTN: - if (this->signs.Length() >= 1) { + if (this->signs.size() >= 1) { const Sign *si = this->signs[0]; ScrollMainWindowToTile(TileVirtXY(si->x, si->y)); } @@ -310,7 +310,7 @@ struct SignListWindow : Window, SignList { { if (this->signs.NeedRebuild()) { this->BuildSignsList(); - this->vscroll->SetCount(this->signs.Length()); + this->vscroll->SetCount(this->signs.size()); this->SetWidgetDirty(WID_SIL_CAPTION); } this->SortSignsList(); @@ -471,7 +471,7 @@ struct SignWindow : Window, SignList { /* Search through the list for the current sign, excluding * - the first sign if we want the previous sign or * - the last sign if we want the next sign */ - uint end = this->signs.Length() - (next ? 1 : 0); + uint end = this->signs.size() - (next ? 1 : 0); for (uint i = next ? 0 : 1; i < end; i++) { if (this->cur_sign == this->signs[i]->index) { /* We've found the current sign, so return the sign before/after it */ @@ -479,7 +479,7 @@ struct SignWindow : Window, SignList { } } /* If we haven't found the current sign by now, return the last/first sign */ - return this->signs[next ? 0 : this->signs.Length() - 1]; + return next ? this->signs.front() : this->signs.back(); } void SetStringParameters(int widget) const override diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 6121424d57..f7e2a18249 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1436,7 +1436,7 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32 tile_track += tile_delta ^ TileDiffXY(1, 1); // perpendicular to tile_delta } while (--numtracks); - for (uint i = 0; i < affected_vehicles.Length(); ++i) { + for (uint i = 0; i < affected_vehicles.size(); ++i) { /* Restore reservations of trains. */ RestoreTrainReservation(affected_vehicles[i]); } diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 32e22b1616..fddfe780d5 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -205,7 +205,7 @@ protected: this->stations.shrink_to_fit(); this->stations.RebuildDone(); - this->vscroll->SetCount(this->stations.Length()); // Update the scrollbar + this->vscroll->SetCount(this->stations.size()); // Update the scrollbar } /** Sort stations by their name */ @@ -411,7 +411,7 @@ public: case WID_STL_LIST: { bool rtl = _current_text_dir == TD_RTL; - int max = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->stations.Length()); + int max = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->stations.size()); int y = r.top + WD_FRAMERECT_TOP; for (int i = this->vscroll->GetPosition(); i < max; ++i) { // do until max number of stations of owner const Station *st = this->stations[i]; @@ -498,7 +498,7 @@ public: switch (widget) { case WID_STL_LIST: { uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_STL_LIST, 0, FONT_HEIGHT_NORMAL); - if (id_v >= this->stations.Length()) return; // click out of list bound + if (id_v >= this->stations.size()) return; // click out of list bound const Station *st = this->stations[id_v]; /* do not check HasStationInUse - it is slow and may be invalid */ @@ -2132,7 +2132,7 @@ static bool AddNearbyStation(TileIndex tile, void *user_data) TileArea *ctx = (TileArea *)user_data; /* First check if there were deleted stations here */ - for (uint i = 0; i < _deleted_stations_nearby.Length(); i++) { + for (uint i = 0; i < _deleted_stations_nearby.size(); i++) { TileAndStation *ts = _deleted_stations_nearby.Get(i); if (ts->tile == tile) { *_stations_nearby_list.Append() = _deleted_stations_nearby[i].station; @@ -2255,7 +2255,7 @@ struct SelectStationWindow : Window { /* Determine the widest string */ Dimension d = GetStringBoundingBox(T::EXPECTED_FACIL == FACIL_WAYPOINT ? STR_JOIN_WAYPOINT_CREATE_SPLITTED_WAYPOINT : STR_JOIN_STATION_CREATE_SPLITTED_STATION); - for (uint i = 0; i < _stations_nearby_list.Length(); i++) { + for (uint i = 0; i < _stations_nearby_list.size(); i++) { const T *st = T::Get(_stations_nearby_list[i]); SetDParam(0, st->index); SetDParam(1, st->facilities); @@ -2279,7 +2279,7 @@ struct SelectStationWindow : Window { y += this->resize.step_height; } - for (uint i = max(1, this->vscroll->GetPosition()); i <= _stations_nearby_list.Length(); ++i, y += this->resize.step_height) { + for (uint i = max(1, this->vscroll->GetPosition()); i <= _stations_nearby_list.size(); ++i, y += this->resize.step_height) { /* Don't draw anything if it extends past the end of the window. */ if (i - this->vscroll->GetPosition() >= this->vscroll->GetCapacity()) break; @@ -2298,7 +2298,7 @@ struct SelectStationWindow : Window { bool distant_join = (st_index > 0); if (distant_join) st_index--; - if (distant_join && st_index >= _stations_nearby_list.Length()) return; + if (distant_join && st_index >= _stations_nearby_list.size()) return; /* Insert station to be joined into stored command */ SB(this->select_station_cmd.p2, 16, 16, @@ -2333,7 +2333,7 @@ struct SelectStationWindow : Window { { if (!gui_scope) return; FindStationsNearby(this->area, true); - this->vscroll->SetCount(_stations_nearby_list.Length() + 1); + this->vscroll->SetCount(_stations_nearby_list.size() + 1); this->SetDirty(); } }; @@ -2378,7 +2378,7 @@ static bool StationJoinerNeeded(const CommandContainer &cmd, TileArea ta) * If adjacent-stations is disabled and we are building next to a station, do not show the selection window. * but join the other station immediately. */ const T *st = FindStationsNearby(ta, false); - return st == NULL && (_settings_game.station.adjacent_stations || _stations_nearby_list.Length() == 0); + return st == NULL && (_settings_game.station.adjacent_stations || _stations_nearby_list.size() == 0); } /** diff --git a/src/story_gui.cpp b/src/story_gui.cpp index efb3f36e72..78c8b97930 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -159,7 +159,7 @@ protected: /* Verify that the selected page exist. */ if (!_story_page_pool.IsValidID(this->selected_page_id)) return false; - if (this->story_pages.Length() <= 1) return true; + if (this->story_pages.size() <= 1) return true; const StoryPage *last = *(this->story_pages.End() - 1); return last->index == this->selected_page_id; } @@ -253,7 +253,7 @@ protected: } /* Check if list is empty. */ - if (list->Length() == 0) { + if (list->size() == 0) { delete list; list = NULL; } @@ -444,8 +444,8 @@ public: */ void UpdatePrevNextDisabledState() { - this->SetWidgetDisabledState(WID_SB_PREV_PAGE, story_pages.Length() == 0 || this->IsFirstPageSelected()); - this->SetWidgetDisabledState(WID_SB_NEXT_PAGE, story_pages.Length() == 0 || this->IsLastPageSelected()); + this->SetWidgetDisabledState(WID_SB_PREV_PAGE, story_pages.size() == 0 || this->IsFirstPageSelected()); + this->SetWidgetDisabledState(WID_SB_NEXT_PAGE, story_pages.size() == 0 || this->IsLastPageSelected()); this->SetWidgetDirty(WID_SB_PREV_PAGE); this->SetWidgetDirty(WID_SB_NEXT_PAGE); } @@ -575,7 +575,7 @@ public: case WID_SB_SEL_PAGE: { /* Get max title width. */ - for (uint16 i = 0; i < this->story_pages.Length(); i++) { + for (uint16 i = 0; i < this->story_pages.size(); i++) { const StoryPage *s = this->story_pages[i]; if (s->title != NULL) { @@ -620,7 +620,7 @@ public: if (list != NULL) { /* Get the index of selected page. */ int selected = 0; - for (uint16 i = 0; i < this->story_pages.Length(); i++) { + for (uint16 i = 0; i < this->story_pages.size(); i++) { const StoryPage *p = this->story_pages[i]; if (p->index == this->selected_page_id) break; selected++; @@ -694,7 +694,7 @@ public: this->BuildStoryPageList(); /* Was the last page removed? */ - if (this->story_pages.Length() == 0) { + if (this->story_pages.size() == 0) { this->selected_generic_title[0] = '\0'; } @@ -702,14 +702,14 @@ public: if (!_story_page_pool.IsValidID(this->selected_page_id)) { this->selected_page_id = INVALID_STORY_PAGE; } - if (this->selected_page_id == INVALID_STORY_PAGE && this->story_pages.Length() > 0) { + if (this->selected_page_id == INVALID_STORY_PAGE && this->story_pages.size() > 0) { /* No page is selected, but there exist at least one available. * => Select first page. */ this->SetSelectedPage(this->story_pages[0]->index); } - this->SetWidgetDisabledState(WID_SB_SEL_PAGE, this->story_pages.Length() == 0); + this->SetWidgetDisabledState(WID_SB_SEL_PAGE, this->story_pages.size() == 0); this->SetWidgetDirty(WID_SB_SEL_PAGE); this->UpdatePrevNextDisabledState(); } else if (data >= 0 && this->selected_page_id == data) { diff --git a/src/strgen/strgen_base.cpp b/src/strgen/strgen_base.cpp index 8f3f8941fd..0e75537fb8 100644 --- a/src/strgen/strgen_base.cpp +++ b/src/strgen/strgen_base.cpp @@ -1029,14 +1029,14 @@ void LanguageWriter::WriteLang(const StringData &data) for (c = casep; c != NULL; c = c->next) { buffer.AppendByte(c->caseidx); /* Make some space for the 16-bit length */ - uint pos = buffer.Length(); + uint pos = buffer.size(); buffer.AppendByte(0); buffer.AppendByte(0); /* Write string */ PutCommandString(&buffer, c->string); buffer.AppendByte(0); // terminate with a zero /* Fill in the length */ - uint size = buffer.Length() - (pos + 2); + uint size = buffer.size() - (pos + 2); buffer[pos + 0] = GB(size, 8, 8); buffer[pos + 1] = GB(size, 0, 8); } @@ -1044,8 +1044,8 @@ void LanguageWriter::WriteLang(const StringData &data) if (cmdp != NULL) PutCommandString(&buffer, cmdp); - this->WriteLength(buffer.Length()); - this->Write(buffer.Begin(), buffer.Length()); + this->WriteLength(buffer.size()); + this->Write(buffer.Begin(), buffer.size()); buffer.clear(); } } diff --git a/src/string.cpp b/src/string.cpp index cb6c1e8f7e..5246f78271 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -674,7 +674,7 @@ public: UText text = UTEXT_INITIALIZER; UErrorCode status = U_ZERO_ERROR; - utext_openUChars(&text, this->utf16_str.Begin(), this->utf16_str.Length() - 1, &status); + utext_openUChars(&text, this->utf16_str.Begin(), this->utf16_str.size() - 1, &status); this->char_itr->setText(&text, status); this->word_itr->setText(&text, status); this->char_itr->first(); @@ -685,7 +685,7 @@ public: { /* Convert incoming position to an UTF-16 string index. */ uint utf16_pos = 0; - for (uint i = 0; i < this->utf16_to_utf8.Length(); i++) { + for (uint i = 0; i < this->utf16_to_utf8.size(); i++) { if (this->utf16_to_utf8[i] == pos) { utf16_pos = i; break; diff --git a/src/stringfilter_type.h b/src/stringfilter_type.h index f78b133cb4..4dad55aaaa 100644 --- a/src/stringfilter_type.h +++ b/src/stringfilter_type.h @@ -58,7 +58,7 @@ public: * Check whether any filter words were entered. * @return true if no words were entered. */ - bool IsEmpty() const { return this->word_index.Length() == 0; } + bool IsEmpty() const { return this->word_index.size() == 0; } void ResetState(); void AddLine(const char *str); @@ -68,7 +68,7 @@ public: * Get the matching state of the current item. * @return true if matched. */ - bool GetState() const { return this->word_matches == this->word_index.Length(); } + bool GetState() const { return this->word_matches == this->word_index.size(); } }; #endif /* STRINGFILTER_TYPE_H */ diff --git a/src/strings.cpp b/src/strings.cpp index 57a1757021..61a5098ab6 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -1952,7 +1952,7 @@ void InitializeLanguagePacks() FioAppendDirectory(path, lastof(path), sp, LANG_DIR); GetLanguageList(path); } - if (_languages.Length() == 0) usererror("No available language packs (invalid versions?)"); + if (_languages.size() == 0) usererror("No available language packs (invalid versions?)"); /* Acquire the locale of the current system */ const char *lang = GetCurrentLocale("LC_MESSAGES"); diff --git a/src/texteff.cpp b/src/texteff.cpp index ee5ce592b4..0f9fec247d 100644 --- a/src/texteff.cpp +++ b/src/texteff.cpp @@ -45,10 +45,10 @@ TextEffectID AddTextEffect(StringID msg, int center, int y, uint8 duration, Text if (_game_mode == GM_MENU) return INVALID_TE_ID; TextEffectID i; - for (i = 0; i < _text_effects.Length(); i++) { + for (i = 0; i < _text_effects.size(); i++) { if (_text_effects[i].string_id == INVALID_STRING_ID) break; } - if (i == _text_effects.Length()) _text_effects.Append(); + if (i == _text_effects.size()) _text_effects.Append(); TextEffect *te = _text_effects.Get(i); diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp index 018888d0b9..e9706c7529 100644 --- a/src/textfile_gui.cpp +++ b/src/textfile_gui.cpp @@ -86,7 +86,7 @@ uint TextfileWindow::GetContentHeight() int max_width = this->GetWidget(WID_TF_BACKGROUND)->current_x - WD_FRAMETEXT_LEFT - WD_FRAMERECT_RIGHT; uint height = 0; - for (uint i = 0; i < this->lines.Length(); i++) { + for (uint i = 0; i < this->lines.size(); i++) { height += GetStringHeight(this->lines[i], max_width, FS_MONO); } @@ -113,10 +113,10 @@ void TextfileWindow::SetupScrollbars() this->hscroll->SetCount(0); } else { uint max_length = 0; - for (uint i = 0; i < this->lines.Length(); i++) { + for (uint i = 0; i < this->lines.size(); i++) { max_length = max(max_length, GetStringBoundingBox(this->lines[i], FS_MONO).width); } - this->vscroll->SetCount(this->lines.Length() * FONT_HEIGHT_MONO); + this->vscroll->SetCount(this->lines.size() * FONT_HEIGHT_MONO); this->hscroll->SetCount(max_length + WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT); } @@ -152,7 +152,7 @@ void TextfileWindow::SetupScrollbars() int line_height = FONT_HEIGHT_MONO; int y_offset = -this->vscroll->GetPosition(); - for (uint i = 0; i < this->lines.Length(); i++) { + for (uint i = 0; i < this->lines.size(); i++) { if (IsWidgetLowered(WID_TF_WRAPTEXT)) { y_offset = DrawStringMultiLine(0, right - x, y_offset, bottom - y, this->lines[i], TC_WHITE, SA_TOP | SA_LEFT, false, FS_MONO); } else { @@ -184,7 +184,7 @@ void TextfileWindow::SetupScrollbars() /* virtual */ const char *TextfileWindow::NextString() { - if (this->search_iterator >= this->lines.Length()) return NULL; + if (this->search_iterator >= this->lines.size()) return NULL; return this->lines[this->search_iterator++]; } diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index 29986c353d..dec4f7d442 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -292,10 +292,10 @@ CommandCost CmdSetTimetableStart(TileIndex tile, DoCommandFlag flags, uint32 p1, } int total_duration = v->orders.list->GetTimetableTotalDuration(); - int num_vehs = vehs.Length(); + int num_vehs = vehs.size(); if (num_vehs >= 2) { - QSortT(vehs.Begin(), vehs.Length(), &VehicleTimetableSorter); + QSortT(vehs.Begin(), vehs.size(), &VehicleTimetableSorter); } int base = vehs.FindIndex(v); diff --git a/src/town_gui.cpp b/src/town_gui.cpp index b9aa938e63..bf8fb4b875 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -659,7 +659,7 @@ private: this->towns.shrink_to_fit(); this->towns.RebuildDone(); - this->vscroll->SetCount(this->towns.Length()); // Update scrollbar as well. + this->vscroll->SetCount(this->towns.size()); // Update scrollbar as well. } /* Always sort the towns. */ this->last_town = NULL; @@ -766,7 +766,7 @@ public: case WID_TD_LIST: { int n = 0; int y = r.top + WD_FRAMERECT_TOP; - if (this->towns.Length() == 0) { // No towns available. + if (this->towns.size() == 0) { // No towns available. DrawString(r.left + WD_FRAMERECT_LEFT, r.right, y, STR_TOWN_DIRECTORY_NONE); break; } @@ -778,7 +778,7 @@ public: int text_right = r.right - WD_FRAMERECT_RIGHT - (rtl ? icon_size.width + 2 : 0); int icon_x = rtl ? r.right - WD_FRAMERECT_RIGHT - icon_size.width : r.left + WD_FRAMERECT_LEFT; - for (uint i = this->vscroll->GetPosition(); i < this->towns.Length(); i++) { + for (uint i = this->vscroll->GetPosition(); i < this->towns.size(); i++) { const Town *t = this->towns[i]; assert(t->xy != INVALID_TILE); @@ -826,7 +826,7 @@ public: } case WID_TD_LIST: { Dimension d = GetStringBoundingBox(STR_TOWN_DIRECTORY_NONE); - for (uint i = 0; i < this->towns.Length(); i++) { + for (uint i = 0; i < this->towns.size(); i++) { const Town *t = this->towns[i]; assert(t != NULL); @@ -879,7 +879,7 @@ public: case WID_TD_LIST: { // Click on Town Matrix uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_TD_LIST, WD_FRAMERECT_TOP); - if (id_v >= this->towns.Length()) return; // click out of town bounds + if (id_v >= this->towns.size()) return; // click out of town bounds const Town *t = this->towns[id_v]; assert(t != NULL); diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 9f17bd898c..db3773f964 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -833,7 +833,7 @@ static void MakeTrainBackup(TrainList &list, Train *t) static void RestoreTrainBackup(TrainList &list) { /* No train, nothing to do. */ - if (list.Length() == 0) return; + if (list.size() == 0) return; Train *prev = NULL; /* Iterate over the list and rebuild it. */ diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 5246b59cb1..3c394ef191 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -332,7 +332,7 @@ int GetTrainDetailsWndVScroll(VehicleID veh_id, TrainDetailsWindowTabs det_tab) } else { for (const Train *v = Train::Get(veh_id); v != NULL; v = v->GetNextVehicle()) { GetCargoSummaryOfArticulatedVehicle(v, &_cargo_summary); - num += max(1u, _cargo_summary.Length()); + num += max(1u, (unsigned)_cargo_summary.size()); uint length = GetLengthOfArticulatedVehicle(v); if (length > TRAIN_DETAILS_MAX_INDENT) num++; @@ -400,7 +400,7 @@ void DrawTrainDetails(const Train *v, int left, int right, int y, int vscroll_po dx = 0; } - uint num_lines = max(1u, _cargo_summary.Length()); + uint num_lines = max(1u, (unsigned)_cargo_summary.size()); for (uint i = 0; i < num_lines; i++) { int sprite_width = max(dx, ScaleGUITrad(TRAIN_DETAILS_MIN_INDENT)) + 3; int data_left = left + (rtl ? 0 : sprite_width); @@ -412,7 +412,7 @@ void DrawTrainDetails(const Train *v, int left, int right, int y, int vscroll_po } switch (det_tab) { case TDW_TAB_CARGO: - if (i < _cargo_summary.Length()) { + if (i < _cargo_summary.size()) { TrainDetailsCargoTab(&_cargo_summary[i], data_left, data_right, py); } else { DrawString(data_left, data_right, py, STR_QUANTITY_N_A, TC_LIGHT_BLUE); @@ -424,7 +424,7 @@ void DrawTrainDetails(const Train *v, int left, int right, int y, int vscroll_po break; case TDW_TAB_CAPACITY: - if (i < _cargo_summary.Length()) { + if (i < _cargo_summary.size()) { TrainDetailsCapacityTab(&_cargo_summary[i], data_left, data_right, py); } else { SetDParam(0, STR_EMPTY); diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 27f2262e78..ccc9446a02 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -652,7 +652,7 @@ CommandCost CmdMassStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 BuildDepotVehicleList(vli.vtype, tile, &list, NULL); } - for (uint i = 0; i < list.Length(); i++) { + for (uint i = 0; i < list.size(); i++) { const Vehicle *v = list[i]; if (!!(v->vehstatus & VS_STOPPED) != do_start) continue; @@ -691,7 +691,7 @@ CommandCost CmdDepotSellAllVehicles(TileIndex tile, DoCommandFlag flags, uint32 CommandCost last_error = CMD_ERROR; bool had_success = false; - for (uint i = 0; i < list.Length(); i++) { + for (uint i = 0; i < list.size(); i++) { CommandCost ret = DoCommand(tile, list[i]->index | (1 << 20), 0, flags, sell_command); if (ret.Succeeded()) { cost.AddCost(ret); @@ -725,7 +725,7 @@ CommandCost CmdDepotMassAutoReplace(TileIndex tile, DoCommandFlag flags, uint32 /* Get the list of vehicles in the depot */ BuildDepotVehicleList(vehicle_type, tile, &list, &list, true); - for (uint i = 0; i < list.Length(); i++) { + for (uint i = 0; i < list.size(); i++) { const Vehicle *v = list[i]; /* Ensure that the vehicle completely in the depot */ @@ -1003,7 +1003,7 @@ static CommandCost SendAllVehiclesToDepot(DoCommandFlag flags, bool service, con /* Send all the vehicles to a depot */ bool had_success = false; - for (uint i = 0; i < list.Length(); i++) { + for (uint i = 0; i < list.size(); i++) { const Vehicle *v = list[i]; CommandCost ret = DoCommand(v->tile, v->index | (service ? DEPOT_SERVICE : 0U) | DEPOT_DONT_CANCEL, 0, flags, GetCmdSendToDepot(vli.vtype)); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 2ae385aa20..36f08493e5 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -133,7 +133,7 @@ void BaseVehicleListWindow::BuildVehicleList() this->unitnumber_digits = GetUnitNumberDigits(this->vehicles); this->vehicles.RebuildDone(); - this->vscroll->SetCount(this->vehicles.Length()); + this->vscroll->SetCount(this->vehicles.size()); } /** @@ -193,8 +193,8 @@ void BaseVehicleListWindow::SortVehicleList() void DepotSortList(VehicleList *list) { - if (list->Length() < 2) return; - QSortT(list->Begin(), list->Length(), &VehicleNumberSorter); + if (list->size() < 2) return; + QSortT(list->Begin(), list->size(), &VehicleNumberSorter); } /** draw the vehicle profit button in the vehicle list window. */ @@ -243,7 +243,7 @@ byte GetBestFittingSubType(Vehicle *v_from, Vehicle *v_for, CargoID dest_cargo_t byte ret_refit_cyc = 0; bool success = false; - if (subtypes.Length() > 0) { + if (subtypes.size() > 0) { /* Check whether any articulated part is refittable to 'dest_cargo_type' with a subtype listed in 'subtypes' */ for (Vehicle *v = v_for; v != NULL; v = v->HasArticulatedPart() ? v->GetNextArticulatedPart() : NULL) { const Engine *e = v->GetEngine(); @@ -347,7 +347,7 @@ static void DrawVehicleRefitWindow(const SubtypeList list[NUM_CARGO], const int /* Draw the list of subtypes for each cargo, and find the selected refit option (by its position). */ for (uint i = 0; current < pos + rows && i < NUM_CARGO; i++) { - for (uint j = 0; current < pos + rows && j < list[i].Length(); j++) { + for (uint j = 0; current < pos + rows && j < list[i].size(); j++) { const RefitOption &refit = list[i][j]; /* Hide subtypes if sel[0] does not match */ @@ -359,11 +359,11 @@ static void DrawVehicleRefitWindow(const SubtypeList list[NUM_CARGO], const int continue; } - if (list[i].Length() > 1) { + if (list[i].size() > 1) { if (refit.subtype != 0xFF) { /* Draw tree lines */ int ycenter = y + FONT_HEIGHT_NORMAL / 2; - GfxDrawLine(iconcenter, y - WD_MATRIX_TOP, iconcenter, j == list[i].Length() - 1 ? ycenter : y - WD_MATRIX_TOP + delta - 1, linecolour); + GfxDrawLine(iconcenter, y - WD_MATRIX_TOP, iconcenter, j == list[i].size() - 1 ? ycenter : y - WD_MATRIX_TOP + delta - 1, linecolour); GfxDrawLine(iconcenter, ycenter, iconinner, ycenter, linecolour); } else { /* Draw expand/collapse icon */ @@ -435,7 +435,7 @@ struct RefitWindow : public Window { continue; } - bool first_vehicle = this->list[current_index].Length() == 0; + bool first_vehicle = this->list[current_index].size() == 0; if (first_vehicle) { /* Keeping the current subtype is always an option. It also serves as the option in case of no subtypes */ RefitOption *option = this->list[current_index].Append(); @@ -480,7 +480,7 @@ struct RefitWindow : public Window { /* No more subtypes for this vehicle, delete all subtypes >= refit_cyc */ SubtypeList &l = this->list[current_index]; /* 0xFF item is in front, other subtypes are sorted. So just truncate the list in the right spot */ - for (uint i = 1; i < l.Length(); i++) { + for (uint i = 1; i < l.size(); i++) { if (l[i].subtype >= refit_cyc) { l.Resize(i); break; @@ -491,8 +491,8 @@ struct RefitWindow : public Window { /* Check whether the subtype matches with the subtype of earlier vehicles. */ uint pos = 1; SubtypeList &l = this->list[current_index]; - while (pos < l.Length() && l[pos].subtype != refit_cyc) pos++; - if (pos < l.Length() && l[pos].string != subtype) { + while (pos < l.size() && l[pos].subtype != refit_cyc) pos++; + if (pos < l.size() && l[pos].string != subtype) { /* String mismatch, remove item keeping the order */ l.ErasePreservingOrder(pos); } @@ -522,7 +522,7 @@ struct RefitWindow : public Window { uint row = 0; for (uint i = 0; i < NUM_CARGO; i++) { - for (uint j = 0; j < this->list[i].Length(); j++) { + for (uint j = 0; j < this->list[i].size(); j++) { const RefitOption &refit = this->list[i][j]; /* Hide subtypes if sel[0] does not match */ @@ -547,7 +547,7 @@ struct RefitWindow : public Window { uint row = 0; for (uint i = 0; i < NUM_CARGO; i++) { - for (uint j = 0; j < this->list[i].Length(); j++) { + for (uint j = 0; j < this->list[i].size(); j++) { const RefitOption &refit = this->list[i][j]; /* Hide subtypes if sel[0] does not match */ @@ -576,7 +576,7 @@ struct RefitWindow : public Window { if (this->sel[0] < 0) return NULL; SubtypeList &l = this->list[this->sel[0]]; - if ((uint)this->sel[1] >= l.Length()) return NULL; + if ((uint)this->sel[1] >= l.size()) return NULL; return &l[this->sel[1]]; } @@ -617,7 +617,7 @@ struct RefitWindow : public Window { this->sel[1] = 0; this->cargo = NULL; for (uint i = 0; this->cargo == NULL && i < NUM_CARGO; i++) { - for (uint j = 0; j < list[i].Length(); j++) { + for (uint j = 0; j < list[i].size(); j++) { if (list[i][j] == current_refit_option) { this->sel[0] = i; this->sel[1] = j; @@ -830,7 +830,7 @@ struct RefitWindow : public Window { /* Check the width of all cargo information strings. */ for (uint i = 0; i < NUM_CARGO; i++) { - for (uint j = 0; j < this->list[i].Length(); j++) { + for (uint j = 0; j < this->list[i].size(); j++) { StringID string = this->GetCapacityString(&list[i][j]); if (string != INVALID_STRING_ID) { Dimension dim = GetStringBoundingBox(string); @@ -1388,7 +1388,7 @@ void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int int vehicle_button_x = rtl ? right - GetSpriteSize(SPR_PROFIT_LOT).width : left; int y = r.top; - uint max = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->vehicles.Length()); + uint max = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->vehicles.size()); for (uint i = this->vscroll->GetPosition(); i < max; ++i) { const Vehicle *v = this->vehicles[i]; StringID str; @@ -1532,7 +1532,7 @@ public: case WID_VL_CAPTION: { switch (this->vli.type) { case VL_SHARED_ORDERS: // Shared Orders - if (this->vehicles.Length() == 0) { + if (this->vehicles.size() == 0) { /* We can't open this window without vehicles using this order * and we should close the window when deleting the order. */ NOT_REACHED(); @@ -1584,7 +1584,7 @@ public: this->BuildVehicleList(); this->SortVehicleList(); - if (this->vehicles.Length() == 0 && this->IsWidgetLowered(WID_VL_MANAGE_VEHICLES_DROPDOWN)) { + if (this->vehicles.size() == 0 && this->IsWidgetLowered(WID_VL_MANAGE_VEHICLES_DROPDOWN)) { HideDropDownMenu(this); } @@ -1598,7 +1598,7 @@ public: } if (this->owner == _local_company) { this->SetWidgetDisabledState(WID_VL_AVAILABLE_VEHICLES, this->vli.type != VL_STANDARD); - this->SetWidgetsDisabledState(this->vehicles.Length() == 0, + this->SetWidgetsDisabledState(this->vehicles.size() == 0, WID_VL_MANAGE_VEHICLES_DROPDOWN, WID_VL_STOP_ALL, WID_VL_START_ALL, @@ -1626,7 +1626,7 @@ public: case WID_VL_LIST: { // Matrix to show vehicles uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_VL_LIST); - if (id_v >= this->vehicles.Length()) return; // click out of list bound + if (id_v >= this->vehicles.size()) return; // click out of list bound const Vehicle *v = this->vehicles[id_v]; if (!VehicleClicked(v)) ShowVehicleViewWindow(v); @@ -1657,7 +1657,7 @@ public: this->vehicles.SetSortType(index); break; case WID_VL_MANAGE_VEHICLES_DROPDOWN: - assert(this->vehicles.Length() != 0); + assert(this->vehicles.size() != 0); switch (index) { case ADI_REPLACE: // Replace window diff --git a/src/viewport.cpp b/src/viewport.cpp index bd0570cf1a..de0da81b23 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -598,7 +598,7 @@ void OffsetGroundSprite(int x, int y) } /* _vd.last_child == NULL if foundation sprite was clipped by the viewport bounds */ - if (_vd.last_child != NULL) _vd.foundation[_vd.foundation_part] = _vd.parent_sprites_to_draw.Length() - 1; + if (_vd.last_child != NULL) _vd.foundation[_vd.foundation_part] = _vd.parent_sprites_to_draw.size() - 1; _vd.foundation_offset[_vd.foundation_part].x = x * ZOOM_LVL_BASE; _vd.foundation_offset[_vd.foundation_part].y = y * ZOOM_LVL_BASE; @@ -824,7 +824,7 @@ void AddChildSpriteScreen(SpriteID image, PaletteID pal, int x, int y, bool tran pal = PALETTE_TO_TRANSPARENT; } - *_vd.last_child = _vd.child_screen_sprites_to_draw.Length(); + *_vd.last_child = _vd.child_screen_sprites_to_draw.size(); ChildScreenSpriteToDraw *cs = _vd.child_screen_sprites_to_draw.Append(); cs->image = image; @@ -1584,7 +1584,7 @@ void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom DrawTextEffects(&_vd.dpi); - if (_vd.tile_sprites_to_draw.Length() != 0) ViewportDrawTileSprites(&_vd.tile_sprites_to_draw); + if (_vd.tile_sprites_to_draw.size() != 0) ViewportDrawTileSprites(&_vd.tile_sprites_to_draw); ParentSpriteToDraw *psd_end = _vd.parent_sprites_to_draw.End(); for (ParentSpriteToDraw *it = _vd.parent_sprites_to_draw.Begin(); it != psd_end; it++) { @@ -1611,7 +1611,7 @@ void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom vp->overlay->Draw(&dp); } - if (_vd.string_sprites_to_draw.Length() != 0) { + if (_vd.string_sprites_to_draw.size() != 0) { /* translate to world coordinates */ dp.left = UnScaleByZoom(_vd.dpi.left, zoom); dp.top = UnScaleByZoom(_vd.dpi.top, zoom); diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index f789b47b7c..6acbd79c21 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -151,7 +151,7 @@ struct DropdownWindow : Window { DropdownWindow(Window *parent, const DropDownList *list, int selected, int button, bool instant_close, const Point &position, const Dimension &size, Colours wi_colour, bool scroll) : Window(&_dropdown_desc) { - assert(list->Length() > 0); + assert(list->size() > 0); this->position = position; @@ -180,8 +180,8 @@ struct DropdownWindow : Window { } /* Capacity is the average number of items visible */ - this->vscroll->SetCapacity(size.height * (uint16)list->Length() / list_height); - this->vscroll->SetCount((uint16)list->Length()); + this->vscroll->SetCapacity(size.height * (uint16)list->size() / list_height); + this->vscroll->SetCount((uint16)list->size()); this->parent_wnd_class = parent->window_class; this->parent_wnd_num = parent->window_number; @@ -418,7 +418,7 @@ void ShowDropDownListAt(Window *w, const DropDownList *list, int selected, int b /* If the dropdown doesn't fully fit, we need a dropdown. */ if (height > available_height) { scroll = true; - uint avg_height = height / list->Length(); + uint avg_height = height / list->size(); /* Check at least there is space for one item. */ assert(available_height >= avg_height); @@ -514,7 +514,7 @@ void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int butt } /* No entries in the list? */ - if (list->Length() == 0) { + if (list->size() == 0) { delete list; return; } diff --git a/src/window.cpp b/src/window.cpp index 184b9940ae..c6a9f1653d 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -166,7 +166,7 @@ static int CDECL DescSorter(WindowDesc * const *a, WindowDesc * const *b) void WindowDesc::SaveToConfig() { /* Sort the stuff to get a nice ini file on first write */ - QSortT(_window_descs->Begin(), _window_descs->Length(), DescSorter); + QSortT(_window_descs->Begin(), _window_descs->size(), DescSorter); IniFile *ini = new IniFile(); ini->LoadFromDisk(_windows_file, NO_DIRECTORY); From bad2c2154b97613bd6a045cfe1f05cff876da1e4 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Sun, 23 Sep 2018 16:43:00 +0100 Subject: [PATCH 52/82] Codechange: Replaced SmallVector::Resize() with std::vector::resize() --- src/core/smallstack_type.hpp | 2 +- src/core/smallvec_type.hpp | 9 --------- src/linkgraph/linkgraph.cpp | 2 +- src/linkgraph/linkgraphjob.cpp | 2 +- src/vehicle_gui.cpp | 2 +- 5 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/core/smallstack_type.hpp b/src/core/smallstack_type.hpp index 76d97f9615..5a9d329a9f 100644 --- a/src/core/smallstack_type.hpp +++ b/src/core/smallstack_type.hpp @@ -74,7 +74,7 @@ private: } if (index >= this->data.size() && index < Tmax_size) { - this->data.Resize(index + 1); + this->data.resize(index + 1); } return index; } diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 600b7ea262..e78f98a50b 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -97,15 +97,6 @@ public: return this->End() - to_add; } - /** - * Set the size of the vector, effectively truncating items from the end or appending uninitialised ones. - * @param num_items Target size. - */ - inline void Resize(uint num_items) - { - std::vector::resize(num_items); - } - /** * Insert a new item at a specific position into the vector, moving all following items. * @param item Position at which the new item should be inserted diff --git a/src/linkgraph/linkgraph.cpp b/src/linkgraph/linkgraph.cpp index 34b3a4aa09..eee7ac61fd 100644 --- a/src/linkgraph/linkgraph.cpp +++ b/src/linkgraph/linkgraph.cpp @@ -281,7 +281,7 @@ void LinkGraph::Init(uint size) { assert(this->Size() == 0); this->edges.Resize(size, size); - this->nodes.Resize(size); + this->nodes.resize(size); for (uint i = 0; i < size; ++i) { this->nodes[i].Init(); diff --git a/src/linkgraph/linkgraphjob.cpp b/src/linkgraph/linkgraphjob.cpp index 537303cf35..fcc9dce780 100644 --- a/src/linkgraph/linkgraphjob.cpp +++ b/src/linkgraph/linkgraphjob.cpp @@ -179,7 +179,7 @@ LinkGraphJob::~LinkGraphJob() void LinkGraphJob::Init() { uint size = this->Size(); - this->nodes.Resize(size); + this->nodes.resize(size); this->edges.Resize(size, size); for (uint i = 0; i < size; ++i) { this->nodes[i].Init(this->link_graph[i].Supply()); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 36f08493e5..95f0a28ec7 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -482,7 +482,7 @@ struct RefitWindow : public Window { /* 0xFF item is in front, other subtypes are sorted. So just truncate the list in the right spot */ for (uint i = 1; i < l.size(); i++) { if (l[i].subtype >= refit_cyc) { - l.Resize(i); + l.resize(i); break; } } From f3938fdb838685e76bba78974bb6e90e9afc6e22 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Sun, 23 Sep 2018 17:16:49 +0100 Subject: [PATCH 53/82] Codechange: Replaced SmallVector::Reset() with std::vector::clear() + shrink_to_fit() --- src/core/smallvec_type.hpp | 9 --------- src/network/network_content.cpp | 3 ++- src/newgrf_engine.cpp | 3 ++- src/saveload/waypoint_sl.cpp | 3 ++- src/stringfilter.cpp | 3 ++- src/texteff.cpp | 3 ++- src/vehicle.cpp | 3 ++- 7 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index e78f98a50b..7e0abec767 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -77,15 +77,6 @@ public: std::vector::operator=(other); } - /** - * Remove all items from the list and free allocated memory. - */ - inline void Reset() - { - std::vector::clear(); - std::vector::shrink_to_fit(); - } - /** * Append an item and return it. * @param to_add the number of items to append diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index d36aec6baa..8c038796f0 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -555,7 +555,8 @@ void ClientNetworkContentSocketHandler::OnFailure() uint files, bytes; this->DownloadSelectedContent(files, bytes, true); - this->http_response.Reset(); + this->http_response.clear(); + this->http_response.shrink_to_fit(); this->http_response_index = -2; if (this->curFile != NULL) { diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 60d03fcc3e..ce7cfdf24e 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -1272,7 +1272,8 @@ void CommitVehicleListOrderChanges() } /* Clear out the queue */ - _list_order_changes.Reset(); + _list_order_changes.clear(); + _list_order_changes.shrink_to_fit(); } /** diff --git a/src/saveload/waypoint_sl.cpp b/src/saveload/waypoint_sl.cpp index 5e3a391f07..47d0c5ab36 100644 --- a/src/saveload/waypoint_sl.cpp +++ b/src/saveload/waypoint_sl.cpp @@ -146,7 +146,8 @@ void MoveWaypointsToBaseStations() UpdateWaypointOrder(&v->current_order); } - _old_waypoints.Reset(); + _old_waypoints.clear(); + _old_waypoints.shrink_to_fit(); } static const SaveLoad _old_waypoint_desc[] = { diff --git a/src/stringfilter.cpp b/src/stringfilter.cpp index 6045c19ef4..b12abff7ff 100644 --- a/src/stringfilter.cpp +++ b/src/stringfilter.cpp @@ -28,7 +28,8 @@ static const WChar STATE_QUOTE2 = '"'; */ void StringFilter::SetFilterTerm(const char *str) { - this->word_index.Reset(); + this->word_index.clear(); + this->word_index.shrink_to_fit(); this->word_matches = 0; free(this->filter_buffer); diff --git a/src/texteff.cpp b/src/texteff.cpp index 0f9fec247d..41907e14d4 100644 --- a/src/texteff.cpp +++ b/src/texteff.cpp @@ -108,7 +108,8 @@ void MoveAllTextEffects(uint delta_ms) void InitTextEffects() { - _text_effects.Reset(); + _text_effects.clear(); + _text_effects.shrink_to_fit(); } void DrawTextEffects(DrawPixelInfo *dpi) diff --git a/src/vehicle.cpp b/src/vehicle.cpp index d885a04587..0e05d68f2a 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -693,7 +693,8 @@ static AutoreplaceMap _vehicles_to_autoreplace; void InitializeVehicles() { - _vehicles_to_autoreplace.Reset(); + _vehicles_to_autoreplace.clear(); + _vehicles_to_autoreplace.shrink_to_fit(); ResetVehicleHash(); } From 81315939b909a95277ffbab51709714779089656 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Sun, 23 Sep 2018 17:36:45 +0100 Subject: [PATCH 54/82] Codechange: Replaced SmallVector::Find() non-const with std::find() --- src/animated_tile.cpp | 2 +- src/core/pool_func.cpp | 2 +- src/core/smallvec_type.hpp | 14 -------------- src/hotkeys.cpp | 2 +- src/network/network_content.h | 2 +- src/train_gui.cpp | 8 +++++++- src/window.cpp | 2 +- 7 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/animated_tile.cpp b/src/animated_tile.cpp index 5d43848202..3341f57951 100644 --- a/src/animated_tile.cpp +++ b/src/animated_tile.cpp @@ -27,7 +27,7 @@ SmallVector _animated_tiles; */ void DeleteAnimatedTile(TileIndex tile) { - TileIndex *to_remove = _animated_tiles.Find(tile); + TileIndex *to_remove = &*std::find(_animated_tiles.begin(), _animated_tiles.end(), tile); if (to_remove != _animated_tiles.End()) { /* The order of the remaining elements must stay the same, otherwise the animation loop may miss a tile. */ _animated_tiles.ErasePreservingOrder(to_remove); diff --git a/src/core/pool_func.cpp b/src/core/pool_func.cpp index 914cbcfd90..97f9ad1c78 100644 --- a/src/core/pool_func.cpp +++ b/src/core/pool_func.cpp @@ -21,7 +21,7 @@ /* virtual */ PoolBase::~PoolBase() { PoolVector *pools = PoolBase::GetPools(); - pools->Erase(pools->Find(this)); + pools->erase(std::find(pools->begin(), pools->end(), this)); if (pools->size() == 0) delete pools; } diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 7e0abec767..289cc9e1d6 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -116,20 +116,6 @@ public: return pos; } - /** - * Search for the first occurrence of an item. - * The '!=' operator of T is used for comparison. - * @param item Item to search for - * @return The position of the item, or End() when not present - */ - inline T *Find(const T &item) - { - T *pos = this->Begin(); - const T *end = this->End(); - while (pos != end && *pos != item) pos++; - return pos; - } - /** * Search for the first occurrence of an item. * The '!=' operator of T is used for comparison. diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp index 9411887ea7..9f323bc285 100644 --- a/src/hotkeys.cpp +++ b/src/hotkeys.cpp @@ -260,7 +260,7 @@ HotkeyList::HotkeyList(const char *ini_group, Hotkey *items, GlobalHotkeyHandler HotkeyList::~HotkeyList() { - _hotkey_lists->Erase(_hotkey_lists->Find(this)); + _hotkey_lists->erase(std::find(_hotkey_lists->begin(), _hotkey_lists->end(), this)); } /** diff --git a/src/network/network_content.h b/src/network/network_content.h index 0d30de857d..a81cc6a6d4 100644 --- a/src/network/network_content.h +++ b/src/network/network_content.h @@ -142,7 +142,7 @@ public: /** Add a callback to this class */ void AddCallback(ContentCallback *cb) { this->callbacks.Include(cb); } /** Remove a callback */ - void RemoveCallback(ContentCallback *cb) { this->callbacks.Erase(this->callbacks.Find(cb)); } + void RemoveCallback(ContentCallback *cb) { this->callbacks.erase(std::find(this->callbacks.begin(), this->callbacks.end(), cb)); } }; extern ClientNetworkContentSocketHandler _network_content_client; diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 3c394ef191..eab6a33e3e 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -174,6 +174,12 @@ struct CargoSummaryItem { { return this->cargo != other.cargo || this->subtype != other.subtype; } + + /** Used by std::find() and similar functions */ + inline bool operator == (const CargoSummaryItem &other) const + { + return !(this->cargo != other.cargo); + } }; static const uint TRAIN_DETAILS_MIN_INDENT = 32; ///< Minimum indent level in the train details window @@ -272,7 +278,7 @@ static void GetCargoSummaryOfArticulatedVehicle(const Train *v, CargoSummary *su new_item.subtype = GetCargoSubtypeText(v); if (new_item.cargo == INVALID_CARGO && new_item.subtype == STR_EMPTY) continue; - CargoSummaryItem *item = summary->Find(new_item); + CargoSummaryItem *item = &*std::find(summary->begin(), summary->end(), new_item); if (item == summary->End()) { item = summary->Append(); item->cargo = new_item.cargo; diff --git a/src/window.cpp b/src/window.cpp index c6a9f1653d..471ac08a2e 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -114,7 +114,7 @@ WindowDesc::WindowDesc(WindowPosition def_pos, const char *ini_key, int16 def_wi WindowDesc::~WindowDesc() { - _window_descs->Erase(_window_descs->Find(this)); + _window_descs->erase(std::find(_window_descs->begin(), _window_descs->end(), this)); } /** From 846095224044b39ddd3249b6ea072e486ba1fe38 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Sun, 23 Sep 2018 22:15:35 +0100 Subject: [PATCH 55/82] Codechange: Replaced SmallVector::Find() const with suitable alternatives The use of std::none_of in network/core/host.cpp is driven by the non-const comparison operator use by NetworkAddress. A future commit should address the const_casts in that class to ensure const-correctness. --- src/core/smallvec_type.hpp | 20 +++----------------- src/network/core/host.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 289cc9e1d6..1c713470f6 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -102,20 +102,6 @@ public: return this->Begin() + start; } - /** - * Search for the first occurrence of an item. - * The '!=' operator of T is used for comparison. - * @param item Item to search for - * @return The position of the item, or End() when not present - */ - inline const T *Find(const T &item) const - { - const T *pos = this->Begin(); - const T *end = this->End(); - while (pos != end && *pos != item) pos++; - return pos; - } - /** * Search for the first occurrence of an item. * The '!=' operator of T is used for comparison. @@ -124,8 +110,8 @@ public: */ inline int FindIndex(const T &item) const { - auto const it = this->Find(item); - return it == this->End() ? -1 : it - this->Begin(); + auto const it = std::find(std::vector::begin(), std::vector::end(), item); + return it == std::vector::end() ? -1 : it - std::vector::begin(); } /** @@ -136,7 +122,7 @@ public: */ inline bool Contains(const T &item) const { - return this->Find(item) != this->End(); + return std::find(std::vector::begin(), std::vector::end(), item) != std::vector::end(); } /** diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp index 05ad84153b..c0365742b0 100644 --- a/src/network/core/host.cpp +++ b/src/network/core/host.cpp @@ -76,7 +76,7 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // BE memset(&address, 0, sizeof(address)); ((sockaddr_in*)&address)->sin_addr.s_addr = htonl(ip | ~netmask); NetworkAddress addr(address, sizeof(sockaddr)); - if (!broadcast->Contains(addr)) *broadcast->Append() = addr; + if (std::none_of(broadcast->begin(), broadcast->end(), [&addr](NetworkAddress const& elem) -> bool { return elem == addr; })) *broadcast->Append() = addr; } if (read < 0) { break; @@ -100,7 +100,7 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // GE if (ifa->ifa_broadaddr->sa_family != AF_INET) continue; NetworkAddress addr(ifa->ifa_broadaddr, sizeof(sockaddr)); - if (!broadcast->Contains(addr)) *broadcast->Append() = addr; + if (std::none_of(broadcast->begin(), broadcast->end(), [&addr](NetworkAddress const& elem) -> bool { return elem == addr; })) *broadcast->Append() = addr; } freeifaddrs(ifap); } @@ -136,7 +136,7 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // Wi memcpy(&address, &ifo[j].iiAddress.Address, sizeof(sockaddr)); ((sockaddr_in*)&address)->sin_addr.s_addr = ifo[j].iiAddress.AddressIn.sin_addr.s_addr | ~ifo[j].iiNetmask.AddressIn.sin_addr.s_addr; NetworkAddress addr(address, sizeof(sockaddr)); - if (!broadcast->Contains(addr)) *broadcast->Append() = addr; + if (std::none_of(broadcast->begin(), broadcast->end(), [&addr](NetworkAddress const& elem) -> bool { return elem == addr; })) *broadcast->Append() = addr; } free(ifo); @@ -174,7 +174,7 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // !G (r.ifr_flags & IFF_BROADCAST) && ioctl(sock, SIOCGIFBRDADDR, &r) != -1) { NetworkAddress addr(&r.ifr_broadaddr, sizeof(sockaddr)); - if (!broadcast->Contains(addr)) *broadcast->Append() = addr; + if (std::none_of(broadcast->begin(), broadcast->end(), [&addr](NetworkAddress const& elem) -> bool { return elem == addr; })) *broadcast->Append() = addr; } } From 9b5cc73f3eeefdad439b2d93d872e621891f2b38 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Mon, 24 Sep 2018 20:18:16 +0100 Subject: [PATCH 56/82] Codechange: Replaced SmallVector::ErasePreservingOrder(it, count) with std::vector::erase() --- src/animated_tile.cpp | 6 +++--- src/core/smallvec_type.hpp | 10 ---------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/animated_tile.cpp b/src/animated_tile.cpp index 3341f57951..eb10b9b8d1 100644 --- a/src/animated_tile.cpp +++ b/src/animated_tile.cpp @@ -27,10 +27,10 @@ SmallVector _animated_tiles; */ void DeleteAnimatedTile(TileIndex tile) { - TileIndex *to_remove = &*std::find(_animated_tiles.begin(), _animated_tiles.end(), tile); - if (to_remove != _animated_tiles.End()) { + auto to_remove = std::find(_animated_tiles.begin(), _animated_tiles.end(), tile); + if (to_remove != _animated_tiles.end()) { /* The order of the remaining elements must stay the same, otherwise the animation loop may miss a tile. */ - _animated_tiles.ErasePreservingOrder(to_remove); + _animated_tiles.erase(to_remove); MarkTileDirtyByTile(tile); } } diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 1c713470f6..7d856ca9ba 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -148,16 +148,6 @@ public: std::vector::erase(it, it + count); } - /** - * Remove items from the vector while preserving the order of other items. - * @param item First item to remove. - * @param count Number of consecutive items to remove. - */ - inline void ErasePreservingOrder(T *item, uint count = 1) - { - this->ErasePreservingOrder(item - this->Begin(), count); - } - /** * Tests whether a item is present in the vector, and appends it to the end if not. * The '!=' operator of T is used for comparison. From b1f5119d3af2fb47a2f1c752d61a742f41076451 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Mon, 24 Sep 2018 20:24:40 +0100 Subject: [PATCH 57/82] Codechange: Replaced SmallVector::ErasePreservingOrder(pos, count) with std::vector::erase() --- src/core/smallvec_type.hpp | 11 ----------- src/vehicle_gui.cpp | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 7d856ca9ba..5225d13da4 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -137,17 +137,6 @@ public: std::vector::pop_back(); } - /** - * Remove items from the vector while preserving the order of other items. - * @param pos First item to remove. - * @param count Number of consecutive items to remove. - */ - void ErasePreservingOrder(uint pos, uint count = 1) - { - auto const it = std::vector::begin() + pos; - std::vector::erase(it, it + count); - } - /** * Tests whether a item is present in the vector, and appends it to the end if not. * The '!=' operator of T is used for comparison. diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 95f0a28ec7..6dd4bef336 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -494,7 +494,7 @@ struct RefitWindow : public Window { while (pos < l.size() && l[pos].subtype != refit_cyc) pos++; if (pos < l.size() && l[pos].string != subtype) { /* String mismatch, remove item keeping the order */ - l.ErasePreservingOrder(pos); + l.erase(l.begin() + pos); } } } From 5795f66d2eebccbc8e04b80ebaf163f636479f9e Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Tue, 12 Feb 2019 22:59:12 +0000 Subject: [PATCH 58/82] Codechange: Replaced SmallVector::Contains() with std::find() pattern --- src/build_vehicle_gui.cpp | 2 +- src/core/smallvec_type.hpp | 13 +------------ src/hotkeys.cpp | 4 +++- src/network/network_content.cpp | 5 ++--- src/rail.cpp | 2 +- src/station_gui.cpp | 2 +- src/vehicle_cmd.cpp | 2 +- src/vehicle_gui.cpp | 11 ++++++----- 8 files changed, 16 insertions(+), 25 deletions(-) diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index ce3ebeff46..a118b1c995 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1207,7 +1207,7 @@ struct BuildVehicleWindow : Window { this->eng_list.Filter(this->cargo_filter[this->cargo_filter_criteria]); if (0 == this->eng_list.size()) { // no engine passed through the filter, invalidate the previously selected engine this->SelectEngine(INVALID_ENGINE); - } else if (!this->eng_list.Contains(this->sel_engine)) { // previously selected engine didn't pass the filter, select the first engine of the list + } else if (std::find(this->eng_list.begin(), this->eng_list.end(), this->sel_engine) == this->eng_list.end()) { // previously selected engine didn't pass the filter, select the first engine of the list this->SelectEngine(this->eng_list[0]); } } diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 5225d13da4..9df015ad80 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -114,17 +114,6 @@ public: return it == std::vector::end() ? -1 : it - std::vector::begin(); } - /** - * Tests whether a item is present in the vector. - * The '!=' operator of T is used for comparison. - * @param item Item to test for - * @return true iff the item is present - */ - inline bool Contains(const T &item) const - { - return std::find(std::vector::begin(), std::vector::end(), item) != std::vector::end(); - } - /** * Removes given item from this vector * @param item item to remove @@ -145,7 +134,7 @@ public: */ inline bool Include(const T &item) { - bool is_member = this->Contains(item); + bool is_member = std::find(std::vector::begin(), std::vector::end(), item) != std::vector::end(); if (!is_member) *this->Append() = item; return is_member; } diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp index 9f323bc285..24e6b6c419 100644 --- a/src/hotkeys.cpp +++ b/src/hotkeys.cpp @@ -301,7 +301,9 @@ void HotkeyList::Save(IniFile *ini) const int HotkeyList::CheckMatch(uint16 keycode, bool global_only) const { for (const Hotkey *list = this->items; list->name != NULL; ++list) { - if (list->keycodes.Contains(keycode | WKC_GLOBAL_HOTKEY) || (!global_only && list->keycodes.Contains(keycode))) { + auto begin = list->keycodes.begin(); + auto end = list->keycodes.end(); + if (std::find(begin, end, keycode | WKC_GLOBAL_HOTKEY) != end || (!global_only && std::find(begin, end, keycode) != end)) { return list->num; } } diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index 8c038796f0..54798f4b76 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -794,10 +794,9 @@ void ClientNetworkContentSocketHandler::SendReceive() void ClientNetworkContentSocketHandler::DownloadContentInfo(ContentID cid) { /* When we tried to download it already, don't try again */ - if (this->requested.Contains(cid)) return; + if (std::find(this->requested.begin(), this->requested.end(), cid) != this->requested.end()) return; - *this->requested.Append() = cid; - assert(this->requested.Contains(cid)); + this->requested.push_back(cid); this->RequestContentList(1, &cid); } diff --git a/src/rail.cpp b/src/rail.cpp index 8bd7aa5181..c97dfb53c2 100644 --- a/src/rail.cpp +++ b/src/rail.cpp @@ -304,7 +304,7 @@ RailType GetRailTypeByLabel(RailTypeLabel label, bool allow_alternate_labels) /* Test if any rail type defines the label as an alternate. */ for (RailType r = RAILTYPE_BEGIN; r != RAILTYPE_END; r++) { const RailtypeInfo *rti = GetRailTypeInfo(r); - if (rti->alternate_labels.Contains(label)) return r; + if (std::find(rti->alternate_labels.begin(), rti->alternate_labels.end(), label) != rti->alternate_labels.end()) return r; } } diff --git a/src/station_gui.cpp b/src/station_gui.cpp index fddfe780d5..36a58e62eb 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -2150,7 +2150,7 @@ static bool AddNearbyStation(TileIndex tile, void *user_data) if (!T::IsValidID(sid)) return false; T *st = T::Get(sid); - if (st->owner != _local_company || _stations_nearby_list.Contains(sid)) return false; + if (st->owner != _local_company || std::find(_stations_nearby_list.begin(), _stations_nearby_list.end(), sid) != _stations_nearby_list.end()) return false; if (st->rect.BeforeAddRect(ctx->tile, ctx->w, ctx->h, StationRect::ADD_TEST).Succeeded()) { *_stations_nearby_list.Append() = sid; diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index ccc9446a02..636aadb499 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -355,7 +355,7 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, uint8 num_vehicles, /* Reset actual_subtype for every new vehicle */ if (!v->IsArticulatedPart()) actual_subtype = new_subtype; - if (v->type == VEH_TRAIN && !vehicles_to_refit.Contains(v->index) && !only_this) continue; + if (v->type == VEH_TRAIN && std::find(vehicles_to_refit.begin(), vehicles_to_refit.end(), v->index) == vehicles_to_refit.end() && !only_this) continue; const Engine *e = v->GetEngine(); if (!e->CanCarryCargo()) continue; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 6dd4bef336..4a42d746d8 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -267,7 +267,7 @@ byte GetBestFittingSubType(Vehicle *v_from, Vehicle *v_for, CargoID dest_cargo_t StringID subtype = GetCargoSubtypeText(v); if (subtype == STR_EMPTY) break; - if (!subtypes.Contains(subtype)) continue; + if (std::find(subtypes.begin(), subtypes.end(), subtype) == subtypes.end()) continue; /* We found something matching. */ ret_refit_cyc = refit_cyc; @@ -414,7 +414,7 @@ struct RefitWindow : public Window { GetVehicleSet(vehicles_to_refit, Vehicle::Get(this->selected_vehicle), this->num_vehicles); do { - if (v->type == VEH_TRAIN && !vehicles_to_refit.Contains(v->index)) continue; + if (v->type == VEH_TRAIN && std::find(vehicles_to_refit.begin(), vehicles_to_refit.end(), v->index) == vehicles_to_refit.end()) continue; const Engine *e = v->GetEngine(); CargoTypes cmask = e->info.refit_mask; byte callback_mask = e->info.callback_mask; @@ -747,14 +747,15 @@ struct RefitWindow : public Window { for (Train *u = Train::From(v); u != NULL; u = u->Next()) { /* Start checking. */ - if (vehicles_to_refit.Contains(u->index) && left == INT32_MIN) { + const bool contained = std::find(vehicles_to_refit.begin(), vehicles_to_refit.end(), u->index) != vehicles_to_refit.end(); + if (contained && left == INT32_MIN) { left = x - this->hscroll->GetPosition() + r.left + this->vehicle_margin; width = 0; } /* Draw a selection. */ - if ((!vehicles_to_refit.Contains(u->index) || u->Next() == NULL) && left != INT32_MIN) { - if (u->Next() == NULL && vehicles_to_refit.Contains(u->index)) { + if ((!contained || u->Next() == NULL) && left != INT32_MIN) { + if (u->Next() == NULL && contained) { int current_width = u->GetDisplayImageWidth(); width += current_width; x += current_width; From bc7dcaffca553b227fe895dc185e657d110c5ffe Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Tue, 25 Sep 2018 20:44:39 +0100 Subject: [PATCH 59/82] Codechange: Removed SmallVector::Assign() --- src/core/smallvec_type.hpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 9df015ad80..81b9cf7ee4 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -60,23 +60,12 @@ public: template SmallVector &operator=(const SmallVector &other) { - this->Assign(other); + std::vector::operator=(other); return *this; } ~SmallVector() = default; - /** - * Assign items from other vector. - */ - template - inline void Assign(const SmallVector &other) - { - if ((const void *)&other == (void *)this) return; - - std::vector::operator=(other); - } - /** * Append an item and return it. * @param to_add the number of items to append From aa7ca7fe64af51c2cd2400e3dec477dfbddadae3 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Tue, 25 Sep 2018 21:01:56 +0100 Subject: [PATCH 60/82] Codechange: Replaced SmallVector::Get(n) non-const with std::vector::data() + n --- src/console_cmds.cpp | 2 +- src/core/smallvec_type.hpp | 13 ------------- src/engine_gui.cpp | 2 +- src/fios.h | 2 +- src/linkgraph/linkgraph.cpp | 2 +- src/newgrf.cpp | 2 +- src/newgrf_config.cpp | 4 ++-- src/station_gui.cpp | 2 +- src/texteff.cpp | 4 ++-- 9 files changed, 10 insertions(+), 23 deletions(-) diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index a4a6fccd17..85b2ddbb19 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -566,7 +566,7 @@ DEF_CONSOLE_CMD(ConUnBan) seprintf(msg, lastof(msg), "Unbanned %s", _network_ban_list[index]); IConsolePrint(CC_DEFAULT, msg); free(_network_ban_list[index]); - _network_ban_list.Erase(_network_ban_list.Get(index)); + _network_ban_list.erase(_network_ban_list.begin() + index); } else { IConsolePrint(CC_DEFAULT, "Invalid list index or IP not in ban-list."); IConsolePrint(CC_DEFAULT, "For a list of banned IP's, see the command 'banlist'"); diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 81b9cf7ee4..a682697b38 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -180,19 +180,6 @@ public: assert(index <= std::vector::size()); return this->Begin() + index; } - - /** - * Get the pointer to item "number" - * - * @param index the position of the item - * @return the pointer to the item - */ - inline T *Get(uint index) - { - /* Allow access to the 'first invalid' item */ - assert(index <= std::vector::size()); - return this->Begin() + index; - } }; diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index c2a258f180..caf264e3d1 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -344,6 +344,6 @@ void EngList_SortPartial(GUIEngineList *el, EngList_SortTypeFunction compare, ui if (num_items < 2) return; assert(begin < el->size()); assert(begin + num_items <= el->size()); - QSortT(el->Get(begin), num_items, compare); + QSortT(el->data() + begin, num_items, compare); } diff --git a/src/fios.h b/src/fios.h index 71a6cff175..0fe6fcc062 100644 --- a/src/fios.h +++ b/src/fios.h @@ -165,7 +165,7 @@ public: */ inline FiosItem *Get(uint index) { - return this->files.Get(index); + return this->files.data() + index; } inline const FiosItem &operator[](uint index) const diff --git a/src/linkgraph/linkgraph.cpp b/src/linkgraph/linkgraph.cpp index eee7ac61fd..532792e7c3 100644 --- a/src/linkgraph/linkgraph.cpp +++ b/src/linkgraph/linkgraph.cpp @@ -139,7 +139,7 @@ void LinkGraph::RemoveNode(NodeID id) node_edges[id] = node_edges[last_node]; } Station::Get(this->nodes[last_node].station)->goods[this->cargo].node = id; - this->nodes.Erase(this->nodes.Get(id)); + this->nodes.erase(this->nodes.begin() + id); this->edges.EraseColumn(id); /* Not doing EraseRow here, as having the extra invalid row doesn't hurt * and removing it would trigger a lot of memmove. The data has already diff --git a/src/newgrf.cpp b/src/newgrf.cpp index f80e79f7db..6ff9914413 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -637,7 +637,7 @@ static Engine *GetNewEngine(const GRFFile *file, VehicleType type, uint16 intern /* Reserve the engine slot */ if (!static_access) { - EngineIDMapping *eid = _engine_mngr.Get(engine); + EngineIDMapping *eid = _engine_mngr.data() + engine; eid->grfid = scope_grfid; // Note: this is INVALID_GRFID if dynamic_engines is disabled, so no reservation } diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index fa84c947a4..730207c6b0 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -262,7 +262,7 @@ GRFParameterInfo::GRFParameterInfo(GRFParameterInfo &info) : complete_labels(info.complete_labels) { for (uint i = 0; i < info.value_names.size(); i++) { - SmallPair *data = info.value_names.Get(i); + SmallPair *data = info.value_names.data() + i; this->value_names.Insert(data->first, DuplicateGRFText(data->second)); } } @@ -273,7 +273,7 @@ GRFParameterInfo::~GRFParameterInfo() CleanUpGRFText(this->name); CleanUpGRFText(this->desc); for (uint i = 0; i < this->value_names.size(); i++) { - SmallPair *data = this->value_names.Get(i); + SmallPair *data = this->value_names.data() + i; CleanUpGRFText(data->second); } } diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 36a58e62eb..157d571afe 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -2133,7 +2133,7 @@ static bool AddNearbyStation(TileIndex tile, void *user_data) /* First check if there were deleted stations here */ for (uint i = 0; i < _deleted_stations_nearby.size(); i++) { - TileAndStation *ts = _deleted_stations_nearby.Get(i); + TileAndStation *ts = _deleted_stations_nearby.data() + i; if (ts->tile == tile) { *_stations_nearby_list.Append() = _deleted_stations_nearby[i].station; _deleted_stations_nearby.Erase(ts); diff --git a/src/texteff.cpp b/src/texteff.cpp index 41907e14d4..92c2017047 100644 --- a/src/texteff.cpp +++ b/src/texteff.cpp @@ -50,7 +50,7 @@ TextEffectID AddTextEffect(StringID msg, int center, int y, uint8 duration, Text } if (i == _text_effects.size()) _text_effects.Append(); - TextEffect *te = _text_effects.Get(i); + TextEffect *te = _text_effects.data() + i; /* Start defining this object */ te->string_id = msg; @@ -69,7 +69,7 @@ TextEffectID AddTextEffect(StringID msg, int center, int y, uint8 duration, Text void UpdateTextEffect(TextEffectID te_id, StringID msg) { /* Update details */ - TextEffect *te = _text_effects.Get(te_id); + TextEffect *te = _text_effects.data() + te_id; if (msg == te->string_id && GetDParam(0) == te->params_1) return; te->string_id = msg; te->params_1 = GetDParam(0); From 097328c3d73520834b4ef801945c4f57f9eca0cd Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Tue, 25 Sep 2018 21:20:24 +0100 Subject: [PATCH 61/82] Codechange: Replaced SmallVector::Get() const with std alternatives --- src/bridge_gui.cpp | 14 +++++++------- src/core/smallvec_type.hpp | 13 ------------- src/fios.h | 2 +- src/gfx_layout.cpp | 4 ++-- src/network/network_content.h | 2 +- src/network/network_content_gui.cpp | 6 +++--- src/newgrf_engine.cpp | 12 ++++++------ src/openttd.cpp | 4 ++-- src/os/macosx/string_osx.cpp | 2 +- src/os/windows/string_uniscribe.cpp | 2 +- src/viewport.cpp | 2 +- 11 files changed, 25 insertions(+), 38 deletions(-) diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 0b4d0d619e..bbb54551e9 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -113,11 +113,11 @@ private: void BuildBridge(uint8 i) { switch ((TransportType)(this->type >> 15)) { - case TRANSPORT_RAIL: _last_railbridge_type = this->bridges->Get(i)->index; break; - case TRANSPORT_ROAD: _last_roadbridge_type = this->bridges->Get(i)->index; break; + case TRANSPORT_RAIL: _last_railbridge_type = this->bridges->at(i).index; break; + case TRANSPORT_ROAD: _last_roadbridge_type = this->bridges->at(i).index; break; default: break; } - DoCommandP(this->end_tile, this->start_tile, this->type | this->bridges->Get(i)->index, + DoCommandP(this->end_tile, this->start_tile, this->type | this->bridges->at(i).index, CMD_BUILD_BRIDGE | CMD_MSG(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE), CcBuildBridge); } @@ -187,10 +187,10 @@ public: Dimension sprite_dim = {0, 0}; // Biggest bridge sprite dimension Dimension text_dim = {0, 0}; // Biggest text dimension for (int i = 0; i < (int)this->bridges->size(); i++) { - const BridgeSpec *b = this->bridges->Get(i)->spec; + const BridgeSpec *b = this->bridges->at(i).spec; sprite_dim = maxdim(sprite_dim, GetSpriteSize(b->sprite)); - SetDParam(2, this->bridges->Get(i)->cost); + SetDParam(2, this->bridges->at(i).cost); SetDParam(1, b->speed); SetDParam(0, b->material); text_dim = maxdim(text_dim, GetStringBoundingBox(_game_mode == GM_EDITOR ? STR_SELECT_BRIDGE_SCENEDIT_INFO : STR_SELECT_BRIDGE_INFO)); @@ -227,9 +227,9 @@ public: case WID_BBS_BRIDGE_LIST: { uint y = r.top; for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < (int)this->bridges->size(); i++) { - const BridgeSpec *b = this->bridges->Get(i)->spec; + const BridgeSpec *b = this->bridges->at(i).spec; - SetDParam(2, this->bridges->Get(i)->cost); + SetDParam(2, this->bridges->at(i).cost); SetDParam(1, b->speed); SetDParam(0, b->material); diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index a682697b38..1ec336b730 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -167,19 +167,6 @@ public: { return std::vector::data() + std::vector::size(); } - - /** - * Get the pointer to item "number" (const) - * - * @param index the position of the item - * @return the pointer to the item - */ - inline const T *Get(uint index) const - { - /* Allow access to the 'first invalid' item */ - assert(index <= std::vector::size()); - return this->Begin() + index; - } }; diff --git a/src/fios.h b/src/fios.h index 0fe6fcc062..85b6b0dd60 100644 --- a/src/fios.h +++ b/src/fios.h @@ -156,7 +156,7 @@ public: */ inline const FiosItem *Get(uint index) const { - return this->files.Get(index); + return this->files.data() + index; } /** diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index 7c4407e3a3..786e074080 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -158,7 +158,7 @@ public: int GetLeading() const { return l->getLeading(); } int GetWidth() const { return l->getWidth(); } int CountRuns() const { return l->countRuns(); } - const ParagraphLayouter::VisualRun *GetVisualRun(int run) const { return *this->Get(run); } + const ParagraphLayouter::VisualRun *GetVisualRun(int run) const { return this->at(run); } int GetInternalCharLength(WChar c) const { @@ -458,7 +458,7 @@ int FallbackParagraphLayout::FallbackLine::CountRuns() const */ const ParagraphLayouter::VisualRun *FallbackParagraphLayout::FallbackLine::GetVisualRun(int run) const { - return *this->Get(run); + return this->at(run); } /** diff --git a/src/network/network_content.h b/src/network/network_content.h index a81cc6a6d4..7cce7fc0a0 100644 --- a/src/network/network_content.h +++ b/src/network/network_content.h @@ -133,7 +133,7 @@ public: /** Get the begin of the content inf iterator. */ ConstContentIterator Begin() const { return this->infos.Begin(); } /** Get the nth position of the content inf iterator. */ - ConstContentIterator Get(uint32 index) const { return this->infos.Get(index); } + ConstContentIterator Get(uint32 index) const { return this->infos.data() + index; } /** Get the end of the content inf iterator. */ ConstContentIterator End() const { return this->infos.End(); } diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 51215935ca..109e63c95b 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -641,7 +641,7 @@ public: int text_y_offset = WD_MATRIX_TOP + (line_height - FONT_HEIGHT_NORMAL) / 2; uint y = r.top; int cnt = 0; - for (ConstContentIterator iter = this->content.Get(this->vscroll->GetPosition()); iter != this->content.End() && cnt < this->vscroll->GetCapacity(); iter++, cnt++) { + for (ConstContentIterator iter = this->content.data() + this->vscroll->GetPosition(); iter != this->content.End() && cnt < this->vscroll->GetCapacity(); iter++, cnt++) { const ContentInfo *ci = *iter; if (ci == this->selected) GfxFillRect(r.left + 1, y + 1, r.right - 1, y + this->resize.step_height - 1, PC_GREY); @@ -793,7 +793,7 @@ public: uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_NCL_MATRIX); if (id_v >= this->content.size()) return; // click out of bounds - this->selected = *this->content.Get(id_v); + this->selected = this->content[id_v]; this->list_pos = id_v; const NWidgetBase *checkbox = this->GetWidget(WID_NCL_CHECKBOX); @@ -923,7 +923,7 @@ public: return ES_HANDLED; } - this->selected = *this->content.Get(this->list_pos); + this->selected = this->content[this->list_pos]; if (this->UpdateFilterState()) { this->content.ForceRebuild(); diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index ce7cfdf24e..07e0f8af77 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -1209,17 +1209,17 @@ void AlterVehicleListOrder(EngineID engine, uint target) */ static int CDECL EnginePreSort(const EngineID *a, const EngineID *b) { - const EngineIDMapping *id_a = _engine_mngr.Get(*a); - const EngineIDMapping *id_b = _engine_mngr.Get(*b); + const EngineIDMapping &id_a = _engine_mngr.at(*a); + const EngineIDMapping &id_b = _engine_mngr.at(*b); /* 1. Sort by engine type */ - if (id_a->type != id_b->type) return (int)id_a->type - (int)id_b->type; + if (id_a.type != id_b.type) return (int)id_a.type - (int)id_b.type; /* 2. Sort by scope-GRFID */ - if (id_a->grfid != id_b->grfid) return id_a->grfid < id_b->grfid ? -1 : 1; + if (id_a.grfid != id_b.grfid) return id_a.grfid < id_b.grfid ? -1 : 1; /* 3. Sort by local ID */ - return (int)id_a->internal_id - (int)id_b->internal_id; + return (int)id_a.internal_id - (int)id_b.internal_id; } /** @@ -1241,7 +1241,7 @@ void CommitVehicleListOrderChanges() EngineID source = it->engine; uint local_target = it->target; - const EngineIDMapping *id_source = _engine_mngr.Get(source); + const EngineIDMapping *id_source = _engine_mngr.data() + source; if (id_source->internal_id == local_target) continue; EngineID target = _engine_mngr.GetID(id_source->type, local_target, id_source->grfid); diff --git a/src/openttd.cpp b/src/openttd.cpp index b78084145d..5478ec5a2c 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1186,7 +1186,7 @@ static void CheckCaches() uint i = 0; FOR_ALL_TOWNS(t) { - if (MemCmpT(old_town_caches.Get(i), &t->cache) != 0) { + if (MemCmpT(old_town_caches.data() + i, &t->cache) != 0) { DEBUG(desync, 2, "town cache mismatch: town %i", (int)t->index); } i++; @@ -1202,7 +1202,7 @@ static void CheckCaches() i = 0; FOR_ALL_COMPANIES(c) { - if (MemCmpT(old_infrastructure.Get(i), &c->infrastructure) != 0) { + if (MemCmpT(old_infrastructure.data() + i, &c->infrastructure) != 0) { DEBUG(desync, 2, "infrastructure cache mismatch: company %i", (int)c->index); } i++; diff --git a/src/os/macosx/string_osx.cpp b/src/os/macosx/string_osx.cpp index 4abf0037ca..261885187b 100644 --- a/src/os/macosx/string_osx.cpp +++ b/src/os/macosx/string_osx.cpp @@ -86,7 +86,7 @@ public: virtual int GetLeading() const; virtual int GetWidth() const; virtual int CountRuns() const { return this->size(); } - virtual const VisualRun *GetVisualRun(int run) const { return *this->Get(run); } + virtual const VisualRun *GetVisualRun(int run) const { return this->at(run); } int GetInternalCharLength(WChar c) const { diff --git a/src/os/windows/string_uniscribe.cpp b/src/os/windows/string_uniscribe.cpp index 8877d36a65..f1c62c7d35 100644 --- a/src/os/windows/string_uniscribe.cpp +++ b/src/os/windows/string_uniscribe.cpp @@ -111,7 +111,7 @@ public: virtual int GetLeading() const; virtual int GetWidth() const; virtual int CountRuns() const { return this->size(); } - virtual const VisualRun *GetVisualRun(int run) const { return *this->Get(run); } + virtual const VisualRun *GetVisualRun(int run) const { return this->at(run); } int GetInternalCharLength(WChar c) const { diff --git a/src/viewport.cpp b/src/viewport.cpp index de0da81b23..5d6f58268f 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1468,7 +1468,7 @@ static void ViewportDrawParentSprites(const ParentSpriteToSortVector *psd, const int child_idx = ps->first_child; while (child_idx >= 0) { - const ChildScreenSpriteToDraw *cs = csstdv->Get(child_idx); + const ChildScreenSpriteToDraw *cs = csstdv->data() + child_idx; child_idx = cs->next; DrawSpriteViewport(cs->image, cs->pal, ps->left + cs->x, ps->top + cs->y, cs->sub); } From ca2f33c6d025c0c45fb4bc472493290445312de5 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Tue, 25 Sep 2018 22:01:05 +0100 Subject: [PATCH 62/82] Codechange: Replaced SmallVector::Erase() with std::vector::erase() --- src/core/smallmap_type.hpp | 10 +++++----- src/core/smallvec_type.hpp | 12 ------------ src/network/core/tcp_connect.cpp | 8 ++++---- src/network/core/tcp_http.cpp | 4 ++-- src/newgrf_debug_gui.cpp | 2 +- src/sortlist_type.h | 9 ++++----- src/station_cmd.cpp | 8 ++++---- src/station_gui.cpp | 4 ++-- 8 files changed, 22 insertions(+), 35 deletions(-) diff --git a/src/core/smallmap_type.hpp b/src/core/smallmap_type.hpp index 44ace6b45b..0bd9bd2965 100644 --- a/src/core/smallmap_type.hpp +++ b/src/core/smallmap_type.hpp @@ -115,7 +115,8 @@ struct SmallMap : SmallVector, S> { inline void Erase(Pair *pair) { assert(pair >= this->Begin() && pair < this->End()); - SmallVector::Erase(pair); + auto distance = pair - std::vector::data(); + std::vector::erase(std::vector::begin() + distance); } /** @@ -126,11 +127,10 @@ struct SmallMap : SmallVector, S> { */ inline bool Erase(const T &key) { - Pair *pair = this->Find(key); - if (pair == this->End()) - return false; + auto pair = std::find(this->begin(), this->end(), key); + if (pair == this->end()) return false; - SmallVector::Erase(pair); + std::vector::erase(pair); return true; } diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 1ec336b730..b989d44c5d 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -103,18 +103,6 @@ public: return it == std::vector::end() ? -1 : it - std::vector::begin(); } - /** - * Removes given item from this vector - * @param item item to remove - * @note it has to be pointer to item in this map. It is overwritten by the last item. - */ - inline void Erase(T *item) - { - assert(item >= this->Begin() && item < this->End()); - *item = std::vector::back(); - std::vector::pop_back(); - } - /** * Tests whether a item is present in the vector, and appends it to the end if not. * The '!=' operator of T is used for comparison. diff --git a/src/network/core/tcp_connect.cpp b/src/network/core/tcp_connect.cpp index 95f9662cd6..470d97e682 100644 --- a/src/network/core/tcp_connect.cpp +++ b/src/network/core/tcp_connect.cpp @@ -66,22 +66,22 @@ void TCPConnecter::Connect() */ /* static */ void TCPConnecter::CheckCallbacks() { - for (TCPConnecter **iter = _tcp_connecters.Begin(); iter < _tcp_connecters.End(); /* nothing */) { + for (auto iter = _tcp_connecters.begin(); iter < _tcp_connecters.end(); /* nothing */) { TCPConnecter *cur = *iter; if ((cur->connected || cur->aborted) && cur->killed) { - _tcp_connecters.Erase(iter); + iter = _tcp_connecters.erase(iter); if (cur->sock != INVALID_SOCKET) closesocket(cur->sock); delete cur; continue; } if (cur->connected) { - _tcp_connecters.Erase(iter); + iter = _tcp_connecters.erase(iter); cur->OnConnect(cur->sock); delete cur; continue; } if (cur->aborted) { - _tcp_connecters.Erase(iter); + iter = _tcp_connecters.erase(iter); cur->OnFailure(); delete cur; continue; diff --git a/src/network/core/tcp_http.cpp b/src/network/core/tcp_http.cpp index d2ab0638c9..2d3e89b4e4 100644 --- a/src/network/core/tcp_http.cpp +++ b/src/network/core/tcp_http.cpp @@ -311,7 +311,7 @@ int NetworkHTTPSocketHandler::Receive() int n = select(FD_SETSIZE, &read_fd, NULL, NULL, &tv); if (n == -1) return; - for (NetworkHTTPSocketHandler **iter = _http_connections.Begin(); iter < _http_connections.End(); /* nothing */) { + for (auto iter = _http_connections.begin(); iter < _http_connections.end(); /* nothing */) { NetworkHTTPSocketHandler *cur = *iter; if (FD_ISSET(cur->sock, &read_fd)) { @@ -321,7 +321,7 @@ int NetworkHTTPSocketHandler::Receive() if (ret <= 0) { /* Then... the connection can be closed */ cur->CloseConnection(); - _http_connections.Erase(iter); + iter = _http_connections.erase(iter); delete cur; continue; } diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index ec1a91d7ba..a081243572 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -986,7 +986,7 @@ struct SpriteAlignerWindow : Window { case WID_SA_RESET_REL: /* Reset the starting offsets for the current sprite. */ - this->offs_start_map.Erase(this->current_sprite); + this->offs_start_map.erase(this->offs_start_map.begin() + this->current_sprite); this->SetDirty(); break; } diff --git a/src/sortlist_type.h b/src/sortlist_type.h index 74b6f37b35..23a5580180 100644 --- a/src/sortlist_type.h +++ b/src/sortlist_type.h @@ -337,13 +337,12 @@ public: if (!(this->flags & VL_FILTER)) return false; bool changed = false; - for (uint iter = 0; iter < std::vector::size();) { - T *item = &std::vector::operator[](iter); - if (!decide(item, filter_data)) { - this->Erase(item); + for (auto it = std::vector::begin(); it != std::vector::end(); /* Nothing */) { + if (!decide(&*it, filter_data)) { + it = std::vector::erase(it); changed = true; } else { - iter++; + it++; } } diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index f7e2a18249..2dee09fe80 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -3541,8 +3541,8 @@ void DeleteStaleLinks(Station *from) *(vehicles.Append()) = l->GetFirstSharedVehicle(); } - Vehicle **iter = vehicles.Begin(); - while (iter != vehicles.End()) { + auto iter = vehicles.begin(); + while (iter != vehicles.end()) { Vehicle *v = *iter; LinkRefresher::Run(v, false); // Don't allow merging. Otherwise lg might get deleted. @@ -3556,10 +3556,10 @@ void DeleteStaleLinks(Station *from) *iter = next_shared; ++iter; } else { - vehicles.Erase(iter); + iter = vehicles.erase(iter); } - if (iter == vehicles.End()) iter = vehicles.Begin(); + if (iter == vehicles.end()) iter = vehicles.begin(); } } diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 157d571afe..e1f5daa699 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -2133,10 +2133,10 @@ static bool AddNearbyStation(TileIndex tile, void *user_data) /* First check if there were deleted stations here */ for (uint i = 0; i < _deleted_stations_nearby.size(); i++) { - TileAndStation *ts = _deleted_stations_nearby.data() + i; + auto ts = _deleted_stations_nearby.begin() + i; if (ts->tile == tile) { *_stations_nearby_list.Append() = _deleted_stations_nearby[i].station; - _deleted_stations_nearby.Erase(ts); + _deleted_stations_nearby.erase(ts); i--; } } From a0f36a50e6324f570985f5010eb0543ec0673aeb Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Mon, 18 Feb 2019 22:39:06 +0000 Subject: [PATCH 63/82] Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() --- src/ai/ai_gui.cpp | 2 +- src/airport_gui.cpp | 2 +- src/autoreplace_gui.cpp | 6 +- src/bridge_gui.cpp | 9 +-- src/build_vehicle_gui.cpp | 8 +-- src/company_gui.cpp | 10 ++-- src/core/pool_type.hpp | 2 +- src/core/smallmap_type.hpp | 11 ++-- src/core/smallvec_type.hpp | 30 ++++++---- src/date_gui.cpp | 6 +- src/engine.cpp | 11 ++-- src/fios.h | 3 +- src/game/game_text.cpp | 14 ++--- src/genworld_gui.cpp | 2 +- src/gfx_layout.cpp | 12 ++-- src/graph_gui.cpp | 2 +- src/group_gui.cpp | 6 +- src/hotkeys.cpp | 2 +- src/industry_gui.cpp | 58 ++++++++++--------- src/linkgraph/linkgraph.cpp | 2 +- src/music/midifile.cpp | 23 ++++---- src/network/core/host.cpp | 2 +- src/network/core/tcp_connect.cpp | 2 +- src/network/core/tcp_http.cpp | 2 +- src/network/core/udp.cpp | 6 +- src/network/network.cpp | 6 +- src/network/network_client.cpp | 2 +- src/network/network_content.cpp | 14 ++--- src/network/network_content_gui.cpp | 2 +- src/network/network_gui.cpp | 6 +- src/network/network_server.cpp | 2 +- src/newgrf.cpp | 84 ++++++++++++++------------- src/newgrf_commons.cpp | 9 +-- src/newgrf_config.cpp | 8 +-- src/newgrf_engine.cpp | 6 +- src/newgrf_gui.cpp | 12 ++-- src/newgrf_sound.cpp | 2 +- src/object_cmd.cpp | 4 +- src/openttd.cpp | 6 +- src/order_gui.cpp | 2 +- src/os/macosx/string_osx.cpp | 2 +- src/rail_cmd.cpp | 4 +- src/rail_gui.cpp | 4 +- src/saveload/afterload.cpp | 10 ++-- src/saveload/animated_tile_sl.cpp | 4 +- src/saveload/engine_sl.cpp | 3 +- src/saveload/game_sl.cpp | 4 +- src/saveload/labelmaps_sl.cpp | 4 +- src/saveload/linkgraph_sl.cpp | 4 +- src/saveload/oldloader_sl.cpp | 2 +- src/saveload/saveload.cpp | 2 +- src/saveload/waypoint_sl.cpp | 3 +- src/script/squirrel_helper.hpp | 6 +- src/settings.cpp | 4 +- src/settings_gui.cpp | 38 ++++++------- src/settingsgen/settingsgen.cpp | 7 ++- src/signs_gui.cpp | 2 +- src/station_cmd.cpp | 6 +- src/station_gui.cpp | 12 ++-- src/story_gui.cpp | 6 +- src/strgen/strgen_base.cpp | 22 ++++---- src/string.cpp | 18 +++--- src/stringfilter.cpp | 5 +- src/strings.cpp | 2 +- src/texteff.cpp | 18 +++--- src/textfile_gui.cpp | 4 +- src/timetable_cmd.cpp | 4 +- src/toolbar_gui.cpp | 66 +++++++++++----------- src/town_gui.cpp | 2 +- src/train_cmd.cpp | 2 +- src/train_gui.cpp | 3 +- src/tunnelbridge_cmd.cpp | 5 +- src/vehicle.cpp | 4 +- src/vehicle_cmd.cpp | 6 +- src/vehicle_gui.cpp | 15 ++--- src/vehiclelist.cpp | 14 ++--- src/viewport.cpp | 88 +++++++++++++++-------------- src/widgets/dropdown.cpp | 2 +- src/window.cpp | 4 +- 79 files changed, 404 insertions(+), 405 deletions(-) diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 0609696e12..8b00de988e 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -481,7 +481,7 @@ struct AISettingsWindow : public Window { DropDownList *list = new DropDownList(); for (int i = config_item.min_value; i <= config_item.max_value; i++) { - *list->Append() = new DropDownListCharStringItem(config_item.labels->Find(i)->second, i, false); + list->push_back(new DropDownListCharStringItem(config_item.labels->Find(i)->second, i, false)); } ShowDropDownListAt(this, list, old_val, -1, wi_rect, COLOUR_ORANGE, true); diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 353e080805..7e16717894 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -219,7 +219,7 @@ class BuildAirportWindow : public PickerWindowBase { DropDownList *list = new DropDownList(); for (uint i = 0; i < AirportClass::GetClassCount(); i++) { - *list->Append() = new DropDownListStringItem(AirportClass::Get((AirportClassID)i)->name, i, false); + list->push_back(new DropDownListStringItem(AirportClass::Get((AirportClassID)i)->name, i, false)); } return list; diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 1286dc5a78..5b6976e674 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -140,7 +140,7 @@ class ReplaceVehicleWindow : public Window { if (!CheckAutoreplaceValidity(this->sel_engine[0], eid, _local_company)) continue; } - *list->Append() = eid; + list->push_back(eid); if (eid == this->sel_engine[side]) selected_engine = eid; // The selected engine is still in the list } this->sel_engine[side] = selected_engine; // update which engine we selected (the same or none, if it's not in the list anymore) @@ -468,8 +468,8 @@ public: case WID_RV_TRAIN_ENGINEWAGON_DROPDOWN: { DropDownList *list = new DropDownList(); - *list->Append() = new DropDownListStringItem(STR_REPLACE_ENGINES, 1, false); - *list->Append() = new DropDownListStringItem(STR_REPLACE_WAGONS, 0, false); + list->push_back(new DropDownListStringItem(STR_REPLACE_ENGINES, 1, false)); + list->push_back(new DropDownListStringItem(STR_REPLACE_WAGONS, 0, false)); ShowDropDownList(this, list, this->replace_engines ? 1 : 0, WID_RV_TRAIN_ENGINEWAGON_DROPDOWN); break; } diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index bbb54551e9..94b709c63c 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -416,12 +416,13 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo for (BridgeType brd_type = 0; brd_type != MAX_BRIDGES; brd_type++) { if (CheckBridgeAvailability(brd_type, bridge_len).Succeeded()) { /* bridge is accepted, add to list */ - BuildBridgeData *item = bl->Append(); - item->index = brd_type; - item->spec = GetBridgeSpec(brd_type); + /*C++17: BuildBridgeData &item = */ bl->emplace_back(); + BuildBridgeData &item = bl->back(); + item.index = brd_type; + item.spec = GetBridgeSpec(brd_type); /* Add to terraforming & bulldozing costs the cost of the * bridge itself (not computed with DC_QUERY_COST) */ - item->cost = ret.GetCost() + (((int64)tot_bridgedata_len * _price[PR_BUILD_BRIDGE] * item->spec->price) >> 8) + infra_cost; + item.cost = ret.GetCost() + (((int64)tot_bridgedata_len * _price[PR_BUILD_BRIDGE] * item.spec->price) >> 8) + infra_cost; } } } diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index a118b1c995..c3d8743a2d 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1246,7 +1246,7 @@ struct BuildVehicleWindow : Window { /* Filter now! So num_engines and num_wagons is valid */ if (!FilterSingleEngine(eid)) continue; - *this->eng_list.Append() = eid; + this->eng_list.push_back(eid); if (rvi->railveh_type != RAILVEH_WAGON) { num_engines++; @@ -1284,7 +1284,7 @@ struct BuildVehicleWindow : Window { EngineID eid = e->index; if (!IsEngineBuildable(eid, VEH_ROAD, _local_company)) continue; if (!HasBit(this->filter.roadtypes, HasBit(EngInfo(eid)->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD)) continue; - *this->eng_list.Append() = eid; + this->eng_list.push_back(eid); if (eid == this->sel_engine) sel_id = eid; } @@ -1302,7 +1302,7 @@ struct BuildVehicleWindow : Window { if (!this->show_hidden_engines && e->IsHidden(_local_company)) continue; EngineID eid = e->index; if (!IsEngineBuildable(eid, VEH_SHIP, _local_company)) continue; - *this->eng_list.Append() = eid; + this->eng_list.push_back(eid); if (eid == this->sel_engine) sel_id = eid; } @@ -1330,7 +1330,7 @@ struct BuildVehicleWindow : Window { /* First VEH_END window_numbers are fake to allow a window open for all different types at once */ if (!this->listview_mode && !CanVehicleUseStation(eid, st)) continue; - *this->eng_list.Append() = eid; + this->eng_list.push_back(eid); if (eid == this->sel_engine) sel_id = eid; } diff --git a/src/company_gui.cpp b/src/company_gui.cpp index b34862f694..a705687b0c 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -606,10 +606,10 @@ private: if (default_livery != NULL) { /* Add COLOUR_END to put the colour out of range, but also allow us to show what the default is */ default_col = (primary ? default_livery->colour1 : default_livery->colour2) + COLOUR_END; - *list->Append() = new DropDownListColourItem(default_col, false); + list->push_back(new DropDownListColourItem(default_col, false)); } for (uint i = 0; i < lengthof(_colour_dropdown); i++) { - *list->Append() = new DropDownListColourItem(i, HasBit(used_colours, i)); + list->push_back(new DropDownListColourItem(i, HasBit(used_colours, i))); } byte sel = (default_livery == NULL || HasBit(livery->in_use, primary ? 0 : 1)) ? (primary ? livery->colour1 : livery->colour2) : default_col; @@ -642,8 +642,8 @@ private: { for (const Group **g = source->Begin(); g != source->End(); g++) { if ((*g)->parent != parent) continue; - *this->groups.Append() = *g; - *this->indents.Append() = indent; + this->groups.push_back(*g); + this->indents.push_back(indent); AddChildren(source, (*g)->index, indent + 1); } } @@ -662,7 +662,7 @@ private: const Group *g; FOR_ALL_GROUPS(g) { if (g->owner == owner && g->vehicle_type == vtype) { - *list.Append() = g; + list.push_back(g); } } diff --git a/src/core/pool_type.hpp b/src/core/pool_type.hpp index 4d20ed1abb..a6f7e4fe8b 100644 --- a/src/core/pool_type.hpp +++ b/src/core/pool_type.hpp @@ -50,7 +50,7 @@ struct PoolBase { */ PoolBase(PoolType pt) : type(pt) { - *PoolBase::GetPools()->Append() = this; + PoolBase::GetPools()->push_back(this); } virtual ~PoolBase(); diff --git a/src/core/smallmap_type.hpp b/src/core/smallmap_type.hpp index 0bd9bd2965..0917c5423c 100644 --- a/src/core/smallmap_type.hpp +++ b/src/core/smallmap_type.hpp @@ -143,9 +143,7 @@ struct SmallMap : SmallVector, S> { inline bool Insert(const T &key, const U &data) { if (this->Contains(key)) return false; - Pair *n = this->Append(); - n->first = key; - n->second = data; + std::vector::emplace_back(key, data); return true; } @@ -160,9 +158,10 @@ struct SmallMap : SmallVector, S> { for (uint i = 0; i < std::vector::size(); i++) { if (key == std::vector::operator[](i).first) return std::vector::operator[](i).second; } - Pair *n = this->Append(); - n->first = key; - return n->second; + /*C++17: Pair &n = */ std::vector::emplace_back(); + Pair &n = std::vector::back(); + n.first = key; + return n.second; } inline void SortByKey() diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index b989d44c5d..5961a96988 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -66,17 +66,6 @@ public: ~SmallVector() = default; - /** - * Append an item and return it. - * @param to_add the number of items to append - * @return pointer to newly allocated item - */ - inline T *Append(uint to_add = 1) - { - std::vector::resize(std::vector::size() + to_add); - return this->End() - to_add; - } - /** * Insert a new item at a specific position into the vector, moving all following items. * @param item Position at which the new item should be inserted @@ -112,7 +101,7 @@ public: inline bool Include(const T &item) { bool is_member = std::find(std::vector::begin(), std::vector::end(), item) != std::vector::end(); - if (!is_member) *this->Append() = item; + if (!is_member) std::vector::emplace_back(item); return is_member; } @@ -157,6 +146,23 @@ public: } }; +/** + * Helper function to extend a vector by more than one element + * Consider using std::back_inserter in new code + * + * @param vec A reference to the vector to be extended + * @param num The number of elements to default-construct + * + * @return Pointer to the first new element + */ +template +inline T* grow(std::vector& vec, std::size_t num) +{ + const std::size_t pos = vec.size(); + vec.resize(pos + num); + return vec.data() + pos; +} + /** * Simple vector template class, with automatic free. diff --git a/src/date_gui.cpp b/src/date_gui.cpp index 53e0cf7359..d55e7e2b34 100644 --- a/src/date_gui.cpp +++ b/src/date_gui.cpp @@ -75,14 +75,14 @@ struct SetDateWindow : Window { case WID_SD_DAY: for (uint i = 0; i < 31; i++) { - *list->Append() = new DropDownListStringItem(STR_DAY_NUMBER_1ST + i, i + 1, false); + list->push_back(new DropDownListStringItem(STR_DAY_NUMBER_1ST + i, i + 1, false)); } selected = this->date.day; break; case WID_SD_MONTH: for (uint i = 0; i < 12; i++) { - *list->Append() = new DropDownListStringItem(STR_MONTH_JAN + i, i, false); + list->push_back(new DropDownListStringItem(STR_MONTH_JAN + i, i, false)); } selected = this->date.month; break; @@ -91,7 +91,7 @@ struct SetDateWindow : Window { for (Year i = this->min_year; i <= this->max_year; i++) { DropDownListParamStringItem *item = new DropDownListParamStringItem(STR_JUST_INT, i, false); item->SetParam(0, i); - *list->Append() = item; + list->push_back(item); } selected = this->date.year; break; diff --git a/src/engine.cpp b/src/engine.cpp index b7be293afd..7412ec639c 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -490,11 +490,12 @@ void EngineOverrideManager::ResetToDefaultMapping() this->clear(); for (VehicleType type = VEH_TRAIN; type <= VEH_AIRCRAFT; type++) { for (uint internal_id = 0; internal_id < _engine_counts[type]; internal_id++) { - EngineIDMapping *eid = this->Append(); - eid->type = type; - eid->grfid = INVALID_GRFID; - eid->internal_id = internal_id; - eid->substitute_id = internal_id; + /*C++17: EngineIDMapping &eid = */ this->emplace_back(); + EngineIDMapping &eid = this->back(); + eid.type = type; + eid.grfid = INVALID_GRFID; + eid.internal_id = internal_id; + eid.substitute_id = internal_id; } } } diff --git a/src/fios.h b/src/fios.h index 85b6b0dd60..b1d260f841 100644 --- a/src/fios.h +++ b/src/fios.h @@ -120,7 +120,8 @@ public: */ inline FiosItem *Append() { - return this->files.Append(); + /*C++17: return &*/ this->files.emplace_back(); + return &this->files.back(); } /** diff --git a/src/game/game_text.cpp b/src/game/game_text.cpp index 781d0dabab..4d67b69553 100644 --- a/src/game/game_text.cpp +++ b/src/game/game_text.cpp @@ -115,7 +115,7 @@ LanguageStrings *ReadRawLanguageStrings(const char *file) while (i > 0 && (buffer[i - 1] == '\r' || buffer[i - 1] == '\n' || buffer[i - 1] == ' ')) i--; buffer[i] = '\0'; - *ret->lines.Append() = stredup(buffer, buffer + to_read - 1); + ret->lines.push_back(stredup(buffer, buffer + to_read - 1)); if (len > to_read) { to_read = 0; @@ -194,7 +194,7 @@ struct TranslationWriter : LanguageWriter { char *dest = MallocT(length + 1); memcpy(dest, buffer, length); dest[length] = '\0'; - *this->strings->Append() = dest; + this->strings->push_back(dest); } }; @@ -212,7 +212,7 @@ struct StringNameWriter : HeaderWriter { void WriteStringID(const char *name, int stringid) { - if (stringid == (int)this->strings->size()) *this->strings->Append() = stredup(name); + if (stringid == (int)this->strings->size()) this->strings->push_back(stredup(name)); } void Finalise(const StringData &data) @@ -246,7 +246,7 @@ public: { if (strcmp(filename, exclude) == 0) return true; - *gs->raw_strings.Append() = ReadRawLanguageStrings(filename); + gs->raw_strings.push_back(ReadRawLanguageStrings(filename)); return true; } }; @@ -269,7 +269,7 @@ GameStrings *LoadTranslations() GameStrings *gs = new GameStrings(); try { - *gs->raw_strings.Append() = ReadRawLanguageStrings(filename); + gs->raw_strings.push_back(ReadRawLanguageStrings(filename)); /* Scan for other language files */ LanguageScanner scanner(gs, filename); @@ -324,8 +324,8 @@ void GameStrings::Compile() translation_reader.ParseFile(); if (_errors != 0) throw std::exception(); - LanguageStrings *compiled = *this->compiled_strings.Append() = new LanguageStrings((*p)->language); - TranslationWriter writer(&compiled->lines); + this->compiled_strings.push_back(new LanguageStrings((*p)->language)); + TranslationWriter writer(&this->compiled_strings.back()->lines); writer.WriteLang(data); } } diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index 4631d02ee4..d4aad62211 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -289,7 +289,7 @@ static DropDownList *BuildMapsizeDropDown() for (uint i = MIN_MAP_SIZE_BITS; i <= MAX_MAP_SIZE_BITS; i++) { DropDownListParamStringItem *item = new DropDownListParamStringItem(STR_JUST_INT, i, false); item->SetParam(0, 1LL << i); - *list->Append() = item; + list->push_back(item); } return list; diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index 786e074080..ee0ba15332 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -150,7 +150,7 @@ public: ICULine(icu::ParagraphLayout::Line *l) : l(l) { for (int i = 0; i < l->countRuns(); i++) { - *this->Append() = new ICUVisualRun(l->getVisualRun(i)); + this->push_back(new ICUVisualRun(l->getVisualRun(i))); } } ~ICULine() { delete l; } @@ -498,7 +498,7 @@ const ParagraphLayouter::Line *FallbackParagraphLayout::NextLine(int max_width) if (*this->buffer == '\0') { /* Only a newline. */ this->buffer = NULL; - *l->Append() = new FallbackVisualRun(this->runs.Begin()->second, this->buffer, 0, 0); + l->push_back(new FallbackVisualRun(this->runs.Begin()->second, this->buffer, 0, 0)); return l; } @@ -527,7 +527,7 @@ const ParagraphLayouter::Line *FallbackParagraphLayout::NextLine(int max_width) if (this->buffer == next_run) { int w = l->GetWidth(); - *l->Append() = new FallbackVisualRun(iter->second, begin, this->buffer - begin, w); + l->push_back(new FallbackVisualRun(iter->second, begin, this->buffer - begin, w)); iter++; assert(iter != this->runs.End()); @@ -574,7 +574,7 @@ const ParagraphLayouter::Line *FallbackParagraphLayout::NextLine(int max_width) if (l->size() == 0 || last_char - begin != 0) { int w = l->GetWidth(); - *l->Append() = new FallbackVisualRun(iter->second, begin, last_char - begin, w); + l->push_back(new FallbackVisualRun(iter->second, begin, last_char - begin, w)); } return l; } @@ -720,7 +720,7 @@ Layouter::Layouter(const char *str, int maxw, TextColour colour, FontSize fontsi /* Copy all lines into a local cache so we can reuse them later on more easily. */ const ParagraphLayouter::Line *l; while ((l = line.layout->NextLine(maxw)) != NULL) { - *this->Append() = l; + this->push_back(l); } } while (c != '\0'); @@ -834,7 +834,7 @@ Font *Layouter::GetFont(FontSize size, TextColour colour) if (it != fonts[size].End()) return it->second; Font *f = new Font(size, colour); - *fonts[size].Append() = FontColourMap::Pair(colour, f); + fonts[size].emplace_back(colour, f); return f; } diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 1acf7728cc..69bdb3b1fc 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -1140,7 +1140,7 @@ private: const Company *c; FOR_ALL_COMPANIES(c) { - *this->companies.Append() = c; + this->companies.push_back(c); } this->companies.shrink_to_fit(); diff --git a/src/group_gui.cpp b/src/group_gui.cpp index d64f9c51b8..eb7aac0b71 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -129,8 +129,8 @@ private: { for (const Group **g = source->Begin(); g != source->End(); g++) { if ((*g)->parent != parent) continue; - *this->groups.Append() = *g; - *this->indents.Append() = indent; + this->groups.push_back(*g); + this->indents.push_back(indent); AddChildren(source, (*g)->index, indent + 1); } } @@ -175,7 +175,7 @@ private: const Group *g; FOR_ALL_GROUPS(g) { if (g->owner == owner && g->vehicle_type == this->vli.vtype) { - *list.Append() = g; + list.push_back(g); } } diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp index 24e6b6c419..8bec7e400b 100644 --- a/src/hotkeys.cpp +++ b/src/hotkeys.cpp @@ -255,7 +255,7 @@ HotkeyList::HotkeyList(const char *ini_group, Hotkey *items, GlobalHotkeyHandler global_hotkey_handler(global_hotkey_handler), ini_group(ini_group), items(items) { if (_hotkey_lists == NULL) _hotkey_lists = new SmallVector(); - *_hotkey_lists->Append() = this; + _hotkey_lists->push_back(this); } HotkeyList::~HotkeyList() diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 32c62bfa3d..5bcc03bdb1 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -1206,7 +1206,7 @@ protected: const Industry *i; FOR_ALL_INDUSTRIES(i) { - *this->industries.Append() = i; + this->industries.push_back(i); } this->industries.shrink_to_fit(); @@ -2415,12 +2415,13 @@ struct IndustryCargoesWindow : public Window { _displayed_industries.set(it); this->fields.clear(); - CargoesRow *row = this->fields.Append(); - row->columns[0].MakeHeader(STR_INDUSTRY_CARGOES_PRODUCERS); - row->columns[1].MakeEmpty(CFT_SMALL_EMPTY); - row->columns[2].MakeEmpty(CFT_SMALL_EMPTY); - row->columns[3].MakeEmpty(CFT_SMALL_EMPTY); - row->columns[4].MakeHeader(STR_INDUSTRY_CARGOES_CUSTOMERS); + /*C++17: CargoesRow &row = */ this->fields.emplace_back(); + CargoesRow &row = this->fields.back(); + row.columns[0].MakeHeader(STR_INDUSTRY_CARGOES_PRODUCERS); + row.columns[1].MakeEmpty(CFT_SMALL_EMPTY); + row.columns[2].MakeEmpty(CFT_SMALL_EMPTY); + row.columns[3].MakeEmpty(CFT_SMALL_EMPTY); + row.columns[4].MakeHeader(STR_INDUSTRY_CARGOES_CUSTOMERS); const IndustrySpec *central_sp = GetIndustrySpec(it); bool houses_supply = HousesCanSupply(central_sp->accepts_cargo, lengthof(central_sp->accepts_cargo)); @@ -2430,12 +2431,13 @@ struct IndustryCargoesWindow : public Window { int num_cust = CountMatchingAcceptingIndustries(central_sp->produced_cargo, lengthof(central_sp->produced_cargo)) + houses_accept; int num_indrows = max(3, max(num_supp, num_cust)); // One is needed for the 'it' industry, and 2 for the cargo labels. for (int i = 0; i < num_indrows; i++) { - CargoesRow *row = this->fields.Append(); - row->columns[0].MakeEmpty(CFT_EMPTY); - row->columns[1].MakeCargo(central_sp->accepts_cargo, lengthof(central_sp->accepts_cargo)); - row->columns[2].MakeEmpty(CFT_EMPTY); - row->columns[3].MakeCargo(central_sp->produced_cargo, lengthof(central_sp->produced_cargo)); - row->columns[4].MakeEmpty(CFT_EMPTY); + /*C++17: CargoesRow &row = */ this->fields.emplace_back(); + CargoesRow &row = this->fields.back(); + row.columns[0].MakeEmpty(CFT_EMPTY); + row.columns[1].MakeCargo(central_sp->accepts_cargo, lengthof(central_sp->accepts_cargo)); + row.columns[2].MakeEmpty(CFT_EMPTY); + row.columns[3].MakeCargo(central_sp->produced_cargo, lengthof(central_sp->produced_cargo)); + row.columns[4].MakeEmpty(CFT_EMPTY); } /* Add central industry. */ int central_row = 1 + num_indrows / 2; @@ -2493,12 +2495,13 @@ struct IndustryCargoesWindow : public Window { _displayed_industries.reset(); this->fields.clear(); - CargoesRow *row = this->fields.Append(); - row->columns[0].MakeHeader(STR_INDUSTRY_CARGOES_PRODUCERS); - row->columns[1].MakeEmpty(CFT_SMALL_EMPTY); - row->columns[2].MakeHeader(STR_INDUSTRY_CARGOES_CUSTOMERS); - row->columns[3].MakeEmpty(CFT_SMALL_EMPTY); - row->columns[4].MakeEmpty(CFT_SMALL_EMPTY); + /*C++17: CargoesRow &row = */ this->fields.emplace_back(); + CargoesRow &row = this->fields.back(); + row.columns[0].MakeHeader(STR_INDUSTRY_CARGOES_PRODUCERS); + row.columns[1].MakeEmpty(CFT_SMALL_EMPTY); + row.columns[2].MakeHeader(STR_INDUSTRY_CARGOES_CUSTOMERS); + row.columns[3].MakeEmpty(CFT_SMALL_EMPTY); + row.columns[4].MakeEmpty(CFT_SMALL_EMPTY); bool houses_supply = HousesCanSupply(&cid, 1); bool houses_accept = HousesCanAccept(&cid, 1); @@ -2506,12 +2509,13 @@ struct IndustryCargoesWindow : public Window { int num_cust = CountMatchingAcceptingIndustries(&cid, 1) + houses_accept; int num_indrows = max(num_supp, num_cust); for (int i = 0; i < num_indrows; i++) { - CargoesRow *row = this->fields.Append(); - row->columns[0].MakeEmpty(CFT_EMPTY); - row->columns[1].MakeCargo(&cid, 1); - row->columns[2].MakeEmpty(CFT_EMPTY); - row->columns[3].MakeEmpty(CFT_EMPTY); - row->columns[4].MakeEmpty(CFT_EMPTY); + /*C++17: CargoesRow &row = */ this->fields.emplace_back(); + CargoesRow &row = this->fields.back(); + row.columns[0].MakeEmpty(CFT_EMPTY); + row.columns[1].MakeCargo(&cid, 1); + row.columns[2].MakeEmpty(CFT_EMPTY); + row.columns[3].MakeEmpty(CFT_EMPTY); + row.columns[4].MakeEmpty(CFT_EMPTY); } this->fields[num_indrows].MakeCargoLabel(0, false); // Add cargo labels at the left bottom. @@ -2708,7 +2712,7 @@ struct IndustryCargoesWindow : public Window { DropDownList *lst = new DropDownList; const CargoSpec *cs; FOR_ALL_SORTED_STANDARD_CARGOSPECS(cs) { - *lst->Append() = new DropDownListStringItem(cs->name, cs->Index(), false); + lst->push_back(new DropDownListStringItem(cs->name, cs->Index(), false)); } if (lst->size() == 0) { delete lst; @@ -2725,7 +2729,7 @@ struct IndustryCargoesWindow : public Window { IndustryType ind = _sorted_industry_types[i]; const IndustrySpec *indsp = GetIndustrySpec(ind); if (!indsp->enabled) continue; - *lst->Append() = new DropDownListStringItem(indsp->name, ind, false); + lst->push_back(new DropDownListStringItem(indsp->name, ind, false)); } if (lst->size() == 0) { delete lst; diff --git a/src/linkgraph/linkgraph.cpp b/src/linkgraph/linkgraph.cpp index 532792e7c3..d8cbf9b50a 100644 --- a/src/linkgraph/linkgraph.cpp +++ b/src/linkgraph/linkgraph.cpp @@ -159,7 +159,7 @@ NodeID LinkGraph::AddNode(const Station *st) const GoodsEntry &good = st->goods[this->cargo]; NodeID new_node = this->Size(); - this->nodes.Append(); + this->nodes.emplace_back(); /* Avoid reducing the height of the matrix as that is expensive and we * most likely will increase it again later which is again expensive. */ this->edges.Resize(new_node + 1U, diff --git a/src/music/midifile.cpp b/src/music/midifile.cpp index fb3c187c05..82649679fa 100644 --- a/src/music/midifile.cpp +++ b/src/music/midifile.cpp @@ -21,7 +21,6 @@ #include "../console_func.h" #include "../console_internal.h" - /* SMF reader based on description at: http://www.somascape.org/midi/tech/mfile.html */ @@ -217,7 +216,7 @@ static bool ReadTrackChunk(FILE *file, MidiFile &target) case MIDIST_CONTROLLER: case MIDIST_PITCHBEND: /* 3 byte messages */ - data = block->data.Append(3); + data = grow(block->data, 3); data[0] = status; if (!chunk.ReadBuffer(&data[1], 2)) { return false; @@ -226,7 +225,7 @@ static bool ReadTrackChunk(FILE *file, MidiFile &target) case MIDIST_PROGCHG: case MIDIST_CHANPRESS: /* 2 byte messages */ - data = block->data.Append(2); + data = grow(block->data, 2); data[0] = status; if (!chunk.ReadByte(data[1])) { return false; @@ -267,7 +266,7 @@ static bool ReadTrackChunk(FILE *file, MidiFile &target) if (!chunk.ReadVariableLength(length)) { return false; } - byte *data = block->data.Append(length + 1); + byte *data = grow(block->data, length + 1); data[0] = 0xF0; if (!chunk.ReadBuffer(data + 1, length)) { return false; @@ -275,7 +274,7 @@ static bool ReadTrackChunk(FILE *file, MidiFile &target) if (data[length] != 0xF7) { /* Engage Casio weirdo mode - convert to normal sysex */ running_sysex = true; - *block->data.Append() = 0xF7; + block->data.push_back(0xF7); } else { running_sysex = false; } @@ -285,7 +284,7 @@ static bool ReadTrackChunk(FILE *file, MidiFile &target) if (!chunk.ReadVariableLength(length)) { return false; } - byte *data = block->data.Append(length); + byte *data = grow(block->data, length); if (!chunk.ReadBuffer(data, length)) { return false; } @@ -336,7 +335,7 @@ static bool FixupMidiData(MidiFile &target) merged_blocks.push_back(block); last_ticktime = block.ticktime; } else { - byte *datadest = merged_blocks.back().data.Append(block.data.size()); + byte *datadest = grow(merged_blocks.back().data, block.data.size()); memcpy(datadest, block.data.Begin(), block.data.size()); } } @@ -508,14 +507,14 @@ struct MpsMachine { static void AddMidiData(MidiFile::DataBlock &block, byte b1, byte b2) { - *block.data.Append() = b1; - *block.data.Append() = b2; + block.data.push_back(b1); + block.data.push_back(b2); } static void AddMidiData(MidiFile::DataBlock &block, byte b1, byte b2, byte b3) { - *block.data.Append() = b1; - *block.data.Append() = b2; - *block.data.Append() = b3; + block.data.push_back(b1); + block.data.push_back(b2); + block.data.push_back(b3); } /** diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp index c0365742b0..1ea5389d4f 100644 --- a/src/network/core/host.cpp +++ b/src/network/core/host.cpp @@ -100,7 +100,7 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // GE if (ifa->ifa_broadaddr->sa_family != AF_INET) continue; NetworkAddress addr(ifa->ifa_broadaddr, sizeof(sockaddr)); - if (std::none_of(broadcast->begin(), broadcast->end(), [&addr](NetworkAddress const& elem) -> bool { return elem == addr; })) *broadcast->Append() = addr; + if (std::none_of(broadcast->begin(), broadcast->end(), [&addr](NetworkAddress const& elem) -> bool { return elem == addr; })) broadcast->push_back(addr); } freeifaddrs(ifap); } diff --git a/src/network/core/tcp_connect.cpp b/src/network/core/tcp_connect.cpp index 470d97e682..f3dc2cb9aa 100644 --- a/src/network/core/tcp_connect.cpp +++ b/src/network/core/tcp_connect.cpp @@ -32,7 +32,7 @@ TCPConnecter::TCPConnecter(const NetworkAddress &address) : sock(INVALID_SOCKET), address(address) { - *_tcp_connecters.Append() = this; + _tcp_connecters.push_back(this); if (!ThreadObject::New(TCPConnecter::ThreadEntry, this, &this->thread, "ottd:tcp")) { this->Connect(); } diff --git a/src/network/core/tcp_http.cpp b/src/network/core/tcp_http.cpp index 2d3e89b4e4..abec3fbc87 100644 --- a/src/network/core/tcp_http.cpp +++ b/src/network/core/tcp_http.cpp @@ -63,7 +63,7 @@ NetworkHTTPSocketHandler::NetworkHTTPSocketHandler(SOCKET s, return; } - *_http_connections.Append() = this; + _http_connections.push_back(this); } /** Free whatever needs to be freed. */ diff --git a/src/network/core/udp.cpp b/src/network/core/udp.cpp index db655c0cfa..7babf78d69 100644 --- a/src/network/core/udp.cpp +++ b/src/network/core/udp.cpp @@ -26,14 +26,14 @@ NetworkUDPSocketHandler::NetworkUDPSocketHandler(NetworkAddressList *bind) { if (bind != NULL) { for (NetworkAddress *addr = bind->Begin(); addr != bind->End(); addr++) { - *this->bind.Append() = *addr; + this->bind.push_back(*addr); } } else { /* As hostname NULL and port 0/NULL don't go well when * resolving it we need to add an address for each of * the address families we support. */ - *this->bind.Append() = NetworkAddress(NULL, 0, AF_INET); - *this->bind.Append() = NetworkAddress(NULL, 0, AF_INET6); + this->bind.emplace_back(nullptr, 0, AF_INET); + this->bind.emplace_back(nullptr, 0, AF_INET6); } } diff --git a/src/network/network.cpp b/src/network/network.cpp index 3780258bde..1ddd7478ce 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -633,12 +633,12 @@ void NetworkAddServer(const char *b) void GetBindAddresses(NetworkAddressList *addresses, uint16 port) { for (char **iter = _network_bind_list.Begin(); iter != _network_bind_list.End(); iter++) { - *addresses->Append() = NetworkAddress(*iter, port); + addresses->emplace_back(*iter, port); } /* No address, so bind to everything. */ if (addresses->size() == 0) { - *addresses->Append() = NetworkAddress("", port); + addresses->emplace_back("", port); } } @@ -650,7 +650,7 @@ void NetworkRebuildHostList() _network_host_list.Clear(); for (NetworkGameList *item = _network_game_list; item != NULL; item = item->next) { - if (item->manually) *_network_host_list.Append() = stredup(item->address.GetAddressAsString(false)); + if (item->manually) _network_host_list.push_back(stredup(item->address.GetAddressAsString(false))); } } diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index a99a5069ac..fff4dd328c 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -77,7 +77,7 @@ struct PacketReader : LoadFilter { /* Allocate a new chunk and add the remaining data. */ pbuf += to_write; to_write = in_packet - to_write; - this->buf = *this->blocks.Append() = CallocT(CHUNK); + this->blocks.push_back(this->buf = CallocT(CHUNK)); this->bufe = this->buf + CHUNK; memcpy(this->buf, pbuf, to_write); diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index 54798f4b76..fe7905de89 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -165,7 +165,7 @@ bool ClientNetworkContentSocketHandler::Receive_SERVER_INFO(Packet *p) return true; } - *this->infos.Append() = ci; + this->infos.push_back(ci); /* Incoming data means that we might need to reconsider dependencies */ for (ContentIterator iter = this->infos.Begin(); iter != this->infos.End(); iter++) { @@ -278,7 +278,7 @@ void ClientNetworkContentSocketHandler::RequestContentList(ContentVector *cv, bo } } if (!found) { - *this->infos.Append() = ci; + this->infos.push_back(ci); } else { delete ci; } @@ -300,7 +300,7 @@ void ClientNetworkContentSocketHandler::DownloadSelectedContent(uint &files, uin const ContentInfo *ci = *iter; if (!ci->IsSelected() || ci->state == ContentInfo::ALREADY_HERE) continue; - *content.Append() = ci->id; + content.push_back(ci->id); bytes += ci->filesize; } @@ -579,11 +579,11 @@ void ClientNetworkContentSocketHandler::OnReceiveData(const char *data, size_t l if (this->http_response_index == -1) { if (data != NULL) { /* Append the rest of the response. */ - memcpy(this->http_response.Append((uint)length), data, length); + memcpy(grow(this->http_response, (uint)length), data, length); return; } else { /* Make sure the response is properly terminated. */ - *this->http_response.Append() = '\0'; + this->http_response.push_back('\0'); /* And prepare for receiving the rest of the data. */ this->http_response_index = 0; @@ -905,7 +905,7 @@ void ClientNetworkContentSocketHandler::ReverseLookupDependency(ConstContentVect for (uint i = 0; i < ci->dependency_count; i++) { if (ci->dependencies[i] == child->id) { - *parents.Append() = ci; + parents.push_back(ci); break; } } @@ -919,7 +919,7 @@ void ClientNetworkContentSocketHandler::ReverseLookupDependency(ConstContentVect */ void ClientNetworkContentSocketHandler::ReverseLookupTreeDependency(ConstContentVector &tree, const ContentInfo *child) const { - *tree.Append() = child; + tree.push_back(child); /* First find all direct parents. We can't use the "normal" iterator as * we are including stuff into the vector and as such the vector's data diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 109e63c95b..19c075258e 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -391,7 +391,7 @@ class NetworkContentListWindow : public Window, ContentCallback { for (ConstContentIterator iter = _network_content_client.Begin(); iter != _network_content_client.End(); iter++) { if ((*iter)->state == ContentInfo::DOES_NOT_EXIST) all_available = false; - *this->content.Append() = *iter; + this->content.push_back(*iter); } this->SetWidgetDisabledState(WID_NCL_SEARCH_EXTERNAL, this->auto_select && all_available); diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index e3c4555bf5..7b65f6b0c3 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -253,7 +253,7 @@ protected: this->servers.clear(); for (NetworkGameList *ngl = _network_game_list; ngl != NULL; ngl = ngl->next) { - *this->servers.Append() = ngl; + this->servers.push_back(ngl); } /* Apply the filter condition immediately, if a search string has been provided. */ @@ -1737,9 +1737,7 @@ struct NetworkClientListPopupWindow : Window { */ inline void AddAction(StringID name, ClientList_Action_Proc *proc) { - ClientListAction *action = this->actions.Append(); - action->name = name; - action->proc = proc; + this->actions.push_back({name, proc}); } NetworkClientListPopupWindow(WindowDesc *desc, int x, int y, ClientID client_id) : diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 67f4c6fd91..8a1e75d2f2 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -2101,7 +2101,7 @@ uint NetworkServerKickOrBanIP(const char *ip, bool ban) break; } } - if (!contains) *_network_ban_list.Append() = stredup(ip); + if (!contains) _network_ban_list.push_back(stredup(ip)); } uint n = 0; diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 6ff9914413..63296593dc 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -472,10 +472,7 @@ static StringIDMappingVector _string_to_grf_mapping; static void AddStringForMapping(StringID source, StringID *target) { *target = STR_UNDEFINED; - StringIDMapping *item = _string_to_grf_mapping.Append(); - item->grfid = _cur.grffile->grfid; - item->source = source; - item->target = target; + _string_to_grf_mapping.push_back({_cur.grffile->grfid, source, target}); } /** @@ -659,11 +656,12 @@ static Engine *GetNewEngine(const GRFFile *file, VehicleType type, uint16 intern /* Reserve the engine slot */ assert(_engine_mngr.size() == e->index); - EngineIDMapping *eid = _engine_mngr.Append(); - eid->type = type; - eid->grfid = scope_grfid; // Note: this is INVALID_GRFID if dynamic_engines is disabled, so no reservation - eid->internal_id = internal_id; - eid->substitute_id = min(internal_id, _engine_counts[type]); // substitute_id == _engine_counts[subtype] means "no substitute" + _engine_mngr.push_back({ + scope_grfid, // Note: this is INVALID_GRFID if dynamic_engines is disabled, so no reservation + internal_id, + {static_cast(type)}, + static_cast(min(internal_id, _engine_counts[type])) // substitute_id == _engine_counts[subtype] means "no substitute" + }); if (engine_pool_size != Engine::GetPoolSize()) { /* Resize temporary engine data ... */ @@ -1909,18 +1907,19 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte tmp_layout.clear(); for (;;) { /* no relative bounding box support */ - DrawTileSeqStruct *dtss = tmp_layout.Append(); - MemSetT(dtss, 0); - - dtss->delta_x = buf->ReadByte(); - if (dtss->IsTerminator()) break; - dtss->delta_y = buf->ReadByte(); - dtss->delta_z = buf->ReadByte(); - dtss->size_x = buf->ReadByte(); - dtss->size_y = buf->ReadByte(); - dtss->size_z = buf->ReadByte(); - - ReadSpriteLayoutSprite(buf, false, true, false, GSF_STATIONS, &dtss->image); + /*C++17: DrawTileSeqStruct &dtss = */ tmp_layout.emplace_back(); + DrawTileSeqStruct &dtss = tmp_layout.back(); + MemSetT(&dtss, 0); + + dtss.delta_x = buf->ReadByte(); + if (dtss.IsTerminator()) break; + dtss.delta_y = buf->ReadByte(); + dtss.delta_z = buf->ReadByte(); + dtss.size_x = buf->ReadByte(); + dtss.size_y = buf->ReadByte(); + dtss.size_z = buf->ReadByte(); + + ReadSpriteLayoutSprite(buf, false, true, false, GSF_STATIONS, &dtss.image); /* On error, bail out immediately. Temporary GRF data was already freed */ if (_cur.skip_sprites < 0) return CIR_DISABLED; } @@ -2594,7 +2593,7 @@ static ChangeInfoResult LoadTranslationTable(uint gvid, int numinfo, ByteReader translation_table.clear(); for (int i = 0; i < numinfo; i++) { uint32 item = buf->ReadDWord(); - *translation_table.Append() = BSWAP32(item); + translation_table.push_back(BSWAP32(item)); } return CIR_SUCCESS; @@ -2799,14 +2798,14 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By if (map.openttd_id >= MAX_NUM_GENDERS) { grfmsg(1, "GlobalVarChangeInfo: Gender name %s is not known, ignoring", name); } else { - *_cur.grffile->language_map[curidx].gender_map.Append() = map; + _cur.grffile->language_map[curidx].gender_map.push_back(map); } } else { map.openttd_id = lang->GetCaseIndex(name); if (map.openttd_id >= MAX_NUM_CASES) { grfmsg(1, "GlobalVarChangeInfo: Case name %s is not known, ignoring", name); } else { - *_cur.grffile->language_map[curidx].case_map.Append() = map; + _cur.grffile->language_map[curidx].case_map.push_back(map); } } newgrf_id = buf->ReadByte(); @@ -4335,7 +4334,7 @@ static ChangeInfoResult RailTypeReserveInfo(uint id, int numinfo, int prop, Byte if (_cur.grffile->railtype_map[id + i] != INVALID_RAILTYPE) { int n = buf->ReadByte(); for (int j = 0; j != n; j++) { - *_railtypes[_cur.grffile->railtype_map[id + i]].alternate_labels.Append() = BSWAP32(buf->ReadDWord()); + _railtypes[_cur.grffile->railtype_map[id + i]].alternate_labels.push_back(BSWAP32(buf->ReadDWord())); } break; } @@ -4796,29 +4795,30 @@ static void NewSpriteGroup(ByteReader *buf) /* Loop through the var adjusts. Unfortunately we don't know how many we have * from the outset, so we shall have to keep reallocing. */ do { - DeterministicSpriteGroupAdjust *adjust = adjusts.Append(); + /*C++17: DeterministicSpriteGroupAdjust &adjust = */ adjusts.emplace_back(); + DeterministicSpriteGroupAdjust &adjust = adjusts.back(); /* The first var adjust doesn't have an operation specified, so we set it to add. */ - adjust->operation = adjusts.size() == 1 ? DSGA_OP_ADD : (DeterministicSpriteGroupAdjustOperation)buf->ReadByte(); - adjust->variable = buf->ReadByte(); - if (adjust->variable == 0x7E) { + adjust.operation = adjusts.size() == 1 ? DSGA_OP_ADD : (DeterministicSpriteGroupAdjustOperation)buf->ReadByte(); + adjust.variable = buf->ReadByte(); + if (adjust.variable == 0x7E) { /* Link subroutine group */ - adjust->subroutine = GetGroupFromGroupID(setid, type, buf->ReadByte()); + adjust.subroutine = GetGroupFromGroupID(setid, type, buf->ReadByte()); } else { - adjust->parameter = IsInsideMM(adjust->variable, 0x60, 0x80) ? buf->ReadByte() : 0; + adjust.parameter = IsInsideMM(adjust.variable, 0x60, 0x80) ? buf->ReadByte() : 0; } varadjust = buf->ReadByte(); - adjust->shift_num = GB(varadjust, 0, 5); - adjust->type = (DeterministicSpriteGroupAdjustType)GB(varadjust, 6, 2); - adjust->and_mask = buf->ReadVarSize(varsize); + adjust.shift_num = GB(varadjust, 0, 5); + adjust.type = (DeterministicSpriteGroupAdjustType)GB(varadjust, 6, 2); + adjust.and_mask = buf->ReadVarSize(varsize); - if (adjust->type != DSGA_TYPE_NONE) { - adjust->add_val = buf->ReadVarSize(varsize); - adjust->divmod_val = buf->ReadVarSize(varsize); + if (adjust.type != DSGA_TYPE_NONE) { + adjust.add_val = buf->ReadVarSize(varsize); + adjust.divmod_val = buf->ReadVarSize(varsize); } else { - adjust->add_val = 0; - adjust->divmod_val = 0; + adjust.add_val = 0; + adjust.divmod_val = 0; } /* Continue reading var adjusts while bit 5 is set. */ @@ -7851,9 +7851,7 @@ static bool HandleParameterInfo(ByteReader *buf) } if (id >= _cur.grfconfig->param_info.size()) { - uint num_to_add = id - _cur.grfconfig->param_info.size() + 1; - GRFParameterInfo **newdata = _cur.grfconfig->param_info.Append(num_to_add); - MemSetT(newdata, 0, num_to_add); + _cur.grfconfig->param_info.resize(id + 1); } if (_cur.grfconfig->param_info[id] == NULL) { _cur.grfconfig->param_info[id] = new GRFParameterInfo(id); @@ -8405,7 +8403,7 @@ static void InitNewGRFFile(const GRFConfig *config) } newfile = new GRFFile(config); - *_grf_files.Append() = _cur.grffile = newfile; + _grf_files.push_back(_cur.grffile = newfile); } /** diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp index e25f6d0856..e201ca7364 100644 --- a/src/newgrf_commons.cpp +++ b/src/newgrf_commons.cpp @@ -666,7 +666,8 @@ uint32 NewGRFSpriteLayout::PrepareLayout(uint32 orig_offset, uint32 newgrf_groun /* Create a copy of the spritelayout, so we can modify some values. * Also include the groundsprite into the sequence for easier processing. */ - DrawTileSeqStruct *result = result_seq.Append(); + /*C++17: DrawTileSeqStruct *result = &*/ result_seq.emplace_back(); + DrawTileSeqStruct *result = &result_seq.back(); result->image = ground; result->delta_x = 0; result->delta_y = 0; @@ -674,10 +675,10 @@ uint32 NewGRFSpriteLayout::PrepareLayout(uint32 orig_offset, uint32 newgrf_groun const DrawTileSeqStruct *dtss; foreach_draw_tile_seq(dtss, this->seq) { - *result_seq.Append() = *dtss; + result_seq.push_back(*dtss); } - result_seq.Append()->MakeTerminator(); - + result_seq.emplace_back() /*C++17: .MakeTerminator()*/; + result_seq.back().MakeTerminator(); /* Determine the var10 values the action-1-2-3 chains needs to be resolved for, * and apply the default sprite offsets (unless disabled). */ const TileLayoutRegisters *regs = this->registers; diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index 730207c6b0..698084115d 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -85,9 +85,9 @@ GRFConfig::GRFConfig(const GRFConfig &config) : if (config.error != NULL) this->error = new GRFError(*config.error); for (uint i = 0; i < config.param_info.size(); i++) { if (config.param_info[i] == NULL) { - *this->param_info.Append() = NULL; + this->param_info.push_back(NULL); } else { - *this->param_info.Append() = new GRFParameterInfo(*config.param_info[i]); + this->param_info.push_back(new GRFParameterInfo(*config.param_info[i])); } } } @@ -611,9 +611,9 @@ compatible_grf: c->has_param_defaults = f->has_param_defaults; for (uint i = 0; i < f->param_info.size(); i++) { if (f->param_info[i] == NULL) { - *c->param_info.Append() = NULL; + c->param_info.push_back(NULL); } else { - *c->param_info.Append() = new GRFParameterInfo(*f->param_info[i]); + c->param_info.push_back(new GRFParameterInfo(*f->param_info[i])); } } } diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 07e0f8af77..b2dd4d1a3c 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -1196,9 +1196,7 @@ static SmallVector _list_order_changes; void AlterVehicleListOrder(EngineID engine, uint target) { /* Add the list order change to a queue */ - ListOrderChange *loc = _list_order_changes.Append(); - loc->engine = engine; - loc->target = target; + _list_order_changes.push_back({engine, target}); } /** @@ -1231,7 +1229,7 @@ void CommitVehicleListOrderChanges() SmallVector ordering; Engine *e; FOR_ALL_ENGINES(e) { - *ordering.Append() = e->index; + ordering.push_back(e->index); } QSortT(ordering.Begin(), ordering.size(), EnginePreSort); diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index fb712700c2..0db38e297b 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -378,7 +378,7 @@ struct NewGRFParametersWindow : public Window { DropDownList *list = new DropDownList(); for (uint32 i = par_info->min_value; i <= par_info->max_value; i++) { - *list->Append() = new DropDownListCharStringItem(GetGRFStringFromGRFText(par_info->value_names.Find(i)->second), i, false); + list->push_back(new DropDownListCharStringItem(GetGRFStringFromGRFText(par_info->value_names.Find(i)->second), i, false)); } ShowDropDownListAt(this, list, old_val, -1, wi_rect, COLOUR_ORANGE, true); @@ -927,11 +927,11 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { DropDownList *list = new DropDownList(); /* Add 'None' option for clearing list */ - *list->Append() = new DropDownListStringItem(STR_NONE, -1, false); + list->push_back(new DropDownListStringItem(STR_NONE, -1, false)); for (uint i = 0; i < _grf_preset_list.size(); i++) { if (_grf_preset_list[i] != NULL) { - *list->Append() = new DropDownListCharStringItem(_grf_preset_list[i], i, false); + list->push_back(new DropDownListCharStringItem(_grf_preset_list[i], i, false)); } } @@ -1464,7 +1464,7 @@ private: if (found) continue; if (_settings_client.gui.newgrf_show_old_versions) { - *this->avails.Append() = c; + this->avails.push_back(c); } else { const GRFConfig *best = FindGRFConfig(c->ident.grfid, HasBit(c->flags, GCF_INVALID) ? FGCM_NEWEST : FGCM_NEWEST_VALID); /* @@ -1475,7 +1475,7 @@ private: * show that NewGRF!. */ if (best->version == 0 || best->ident.HasGrfIdentifier(c->ident.grfid, c->ident.md5sum)) { - *this->avails.Append() = c; + this->avails.push_back(c); } } } @@ -1558,7 +1558,7 @@ void ShowMissingContentWindow(const GRFConfig *list) strecpy(ci->name, c->GetName(), lastof(ci->name)); ci->unique_id = BSWAP32(c->ident.grfid); memcpy(ci->md5sum, HasBit(c->flags, GCF_COMPATIBLE) ? c->original_md5sum : c->ident.md5sum, sizeof(ci->md5sum)); - *cv.Append() = ci; + cv.push_back(ci); } ShowNetworkContentListWindow(cv.size() == 0 ? NULL : &cv, CONTENT_TYPE_NEWGRF); } diff --git a/src/newgrf_sound.cpp b/src/newgrf_sound.cpp index dfe7e403ef..e9f1163c69 100644 --- a/src/newgrf_sound.cpp +++ b/src/newgrf_sound.cpp @@ -32,7 +32,7 @@ static SmallVector _sounds; */ SoundEntry *AllocateSound(uint num) { - SoundEntry *sound = _sounds.Append(num); + SoundEntry *sound = grow(_sounds, num); MemSetT(sound, 0, num); return sound; } diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 0b18dd4b14..287a146f3d 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -530,9 +530,7 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags) break; } - ClearedObjectArea *cleared_area = _cleared_object_areas.Append(); - cleared_area->first_tile = tile; - cleared_area->area = ta; + _cleared_object_areas.push_back({tile, ta}); if (flags & DC_EXEC) ReallyClearObjectTile(o); diff --git a/src/openttd.cpp b/src/openttd.cpp index 5478ec5a2c..5c7af2dfcb 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -445,7 +445,7 @@ struct AfterNewGRFScan : NewGRFScanCallback { if (dedicated_host != NULL) { _network_bind_list.Clear(); - *_network_bind_list.Append() = stredup(dedicated_host); + _network_bind_list.push_back(stredup(dedicated_host)); } if (dedicated_port != 0) _settings_client.network.server_port = dedicated_port; @@ -1177,7 +1177,7 @@ static void CheckCaches() SmallVector old_town_caches; Town *t; FOR_ALL_TOWNS(t) { - MemCpyT(old_town_caches.Append(), &t->cache); + old_town_caches.push_back(t->cache); } extern void RebuildTownCaches(); @@ -1195,7 +1195,7 @@ static void CheckCaches() /* Check company infrastructure cache. */ SmallVector old_infrastructure; Company *c; - FOR_ALL_COMPANIES(c) MemCpyT(old_infrastructure.Append(), &c->infrastructure); + FOR_ALL_COMPANIES(c) old_infrastructure.push_back(c->infrastructure); extern void AfterLoadCompanyStats(); AfterLoadCompanyStats(); diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 612c1ba81c..0b1ee2ae66 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -1297,7 +1297,7 @@ public: case WID_O_COND_VARIABLE: { DropDownList *list = new DropDownList(); for (uint i = 0; i < lengthof(_order_conditional_variable); i++) { - *list->Append() = new DropDownListStringItem(STR_ORDER_CONDITIONAL_LOAD_PERCENTAGE + _order_conditional_variable[i], _order_conditional_variable[i], false); + list->push_back(new DropDownListStringItem(STR_ORDER_CONDITIONAL_LOAD_PERCENTAGE + _order_conditional_variable[i], _order_conditional_variable[i], false)); } ShowDropDownList(this, list, this->vehicle->GetOrder(this->OrderGetSel())->GetConditionVariable(), WID_O_COND_VARIABLE); break; diff --git a/src/os/macosx/string_osx.cpp b/src/os/macosx/string_osx.cpp index 261885187b..136542cc18 100644 --- a/src/os/macosx/string_osx.cpp +++ b/src/os/macosx/string_osx.cpp @@ -78,7 +78,7 @@ public: FontMap::const_iterator map = fontMapping.Begin(); while (map < fontMapping.End() - 1 && map->first <= chars.location) map++; - *this->Append() = new CoreTextVisualRun(run, map->second, buff); + this->push_back(new CoreTextVisualRun(run, map->second, buff)); } CFRelease(line); } diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 17df27fc5d..3a24fb65f3 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -1623,7 +1623,7 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 if (v != NULL && !HasPowerOnRail(v->railtype, totype)) { /* No power on new rail type, reroute. */ FreeTrainTrackReservation(v); - *vehicles_affected.Append() = v; + vehicles_affected.push_back(v); } } @@ -1705,7 +1705,7 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 if (v != NULL && !HasPowerOnRail(v->railtype, totype)) { /* No power on new rail type, reroute. */ FreeTrainTrackReservation(v); - *vehicles_affected.Append() = v; + vehicles_affected.push_back(v); } } diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index a26cc99028..827f244562 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -2007,7 +2007,7 @@ DropDownList *GetRailTypeDropDownList(bool for_replacement, bool all_option) if (all_option) { DropDownListStringItem *item = new DropDownListStringItem(STR_REPLACE_ALL_RAILTYPE, INVALID_RAILTYPE, false); - *list->Append() = item; + list->push_back(item); } Dimension d = { 0, 0 }; @@ -2038,7 +2038,7 @@ DropDownList *GetRailTypeDropDownList(bool for_replacement, bool all_option) } item->SetParam(0, rti->strings.menu_text); item->SetParam(1, rti->max_speed); - *list->Append() = item; + list->push_back(item); } return list; } diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 851eb6a786..43a415c208 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -2954,24 +2954,24 @@ bool AfterLoadGame() cur_skip = prev_tile_skip; } - uint *this_skip = skip_frames.Append(); - *this_skip = prev_tile_skip; + /*C++17: uint &this_skip = */ skip_frames.push_back(prev_tile_skip); + uint &this_skip = skip_frames.back(); /* The following 3 curves now take longer than before */ switch (u->state) { case 2: cur_skip++; - if (u->frame <= (roadside ? 9 : 5)) *this_skip = cur_skip; + if (u->frame <= (roadside ? 9 : 5)) this_skip = cur_skip; break; case 4: cur_skip++; - if (u->frame <= (roadside ? 5 : 9)) *this_skip = cur_skip; + if (u->frame <= (roadside ? 5 : 9)) this_skip = cur_skip; break; case 5: cur_skip++; - if (u->frame <= (roadside ? 4 : 2)) *this_skip = cur_skip; + if (u->frame <= (roadside ? 4 : 2)) this_skip = cur_skip; break; default: diff --git a/src/saveload/animated_tile_sl.cpp b/src/saveload/animated_tile_sl.cpp index 36571c418c..5b91852639 100644 --- a/src/saveload/animated_tile_sl.cpp +++ b/src/saveload/animated_tile_sl.cpp @@ -42,14 +42,14 @@ static void Load_ANIT() for (int i = 0; i < 256; i++) { if (anim_list[i] == 0) break; - *_animated_tiles.Append() = anim_list[i]; + _animated_tiles.push_back(anim_list[i]); } return; } uint count = (uint)SlGetFieldLength() / sizeof(*_animated_tiles.Begin()); _animated_tiles.clear(); - _animated_tiles.Append(count); + _animated_tiles.resize(_animated_tiles.size() + count); SlArray(_animated_tiles.Begin(), count, SLE_UINT32); } diff --git a/src/saveload/engine_sl.cpp b/src/saveload/engine_sl.cpp index 87b18336ce..03a086a15d 100644 --- a/src/saveload/engine_sl.cpp +++ b/src/saveload/engine_sl.cpp @@ -190,7 +190,8 @@ static void Load_EIDS() _engine_mngr.clear(); while (SlIterateArray() != -1) { - EngineIDMapping *eid = _engine_mngr.Append(); + /*C++17: EngineIDMapping *eid = &*/ _engine_mngr.emplace_back(); + EngineIDMapping *eid = &_engine_mngr.back(); SlObject(eid, _engine_id_mapping_desc); } } diff --git a/src/saveload/game_sl.cpp b/src/saveload/game_sl.cpp index ff48ab1351..cffff5018d 100644 --- a/src/saveload/game_sl.cpp +++ b/src/saveload/game_sl.cpp @@ -153,10 +153,10 @@ static void Load_GSTR() LanguageStrings *ls = new LanguageStrings(_game_saveload_string != NULL ? _game_saveload_string : ""); for (uint i = 0; i < _game_saveload_strings; i++) { SlObject(NULL, _game_language_string); - *ls->lines.Append() = stredup(_game_saveload_string != NULL ? _game_saveload_string : ""); + ls->lines.push_back(stredup(_game_saveload_string != NULL ? _game_saveload_string : "")); } - *_current_data->raw_strings.Append() = ls; + _current_data->raw_strings.push_back(ls); } /* If there were no strings in the savegame, set GameStrings to NULL */ diff --git a/src/saveload/labelmaps_sl.cpp b/src/saveload/labelmaps_sl.cpp index a25abe722f..3d930e7684 100644 --- a/src/saveload/labelmaps_sl.cpp +++ b/src/saveload/labelmaps_sl.cpp @@ -48,7 +48,7 @@ void AfterLoadLabelMaps() RailType r = GetRailTypeByLabel(_railtype_list[i]); if (r == INVALID_RAILTYPE) r = RAILTYPE_BEGIN; - *railtype_conversion_map.Append() = r; + railtype_conversion_map.push_back(r); } for (TileIndex t = 0; t < MapSize(); t++) { @@ -114,7 +114,7 @@ static void Load_RAIL() while (SlIterateArray() != -1) { SlObject(&lo, _label_object_desc); - *_railtype_list.Append() = (RailTypeLabel)lo.label; + _railtype_list.push_back((RailTypeLabel)lo.label); } } diff --git a/src/saveload/linkgraph_sl.cpp b/src/saveload/linkgraph_sl.cpp index 1ff2470424..842ad6d429 100644 --- a/src/saveload/linkgraph_sl.cpp +++ b/src/saveload/linkgraph_sl.cpp @@ -69,7 +69,7 @@ const SaveLoad *GetLinkGraphJobDesc() char *&address = reinterpret_cast(sl.address); address -= offset_gamesettings; address += offset_component; - *(saveloads.Append()) = sl; + saveloads.push_back(sl); } desc = GetSettingDescription(++setting); } @@ -82,7 +82,7 @@ const SaveLoad *GetLinkGraphJobDesc() int i = 0; do { - *(saveloads.Append()) = job_desc[i++]; + saveloads.push_back(job_desc[i++]); } while (saveloads[saveloads.size() - 1].cmd != SL_END); } diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp index 1974bb31fa..7b445858e8 100644 --- a/src/saveload/oldloader_sl.cpp +++ b/src/saveload/oldloader_sl.cpp @@ -651,7 +651,7 @@ static bool LoadOldAnimTileList(LoadgameState *ls, int num) /* The first zero in the loaded array indicates the end of the list. */ for (int i = 0; i < 256; i++) { if (anim_list[i] == 0) break; - *_animated_tiles.Append() = anim_list[i]; + _animated_tiles.push_back(anim_list[i]); } return true; diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index 2aa19af818..ee4876fd5c 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -143,7 +143,7 @@ struct MemoryDumper { /* Are we at the end of this chunk? */ if (this->buf == this->bufe) { this->buf = CallocT(MEMORY_CHUNK_SIZE); - *this->blocks.Append() = this->buf; + this->blocks.push_back(this->buf); this->bufe = this->buf + MEMORY_CHUNK_SIZE; } diff --git a/src/saveload/waypoint_sl.cpp b/src/saveload/waypoint_sl.cpp index 47d0c5ab36..9e5d163960 100644 --- a/src/saveload/waypoint_sl.cpp +++ b/src/saveload/waypoint_sl.cpp @@ -178,7 +178,8 @@ static void Load_WAYP() int index; while ((index = SlIterateArray()) != -1) { - OldWaypoint *wp = _old_waypoints.Append(); + /*C++17: OldWaypoint *wp = &*/ _old_waypoints.emplace_back(); + OldWaypoint *wp = &_old_waypoints.back(); memset(wp, 0, sizeof(*wp)); wp->index = index; diff --git a/src/script/squirrel_helper.hpp b/src/script/squirrel_helper.hpp index 8d1ee29fc7..c362601eb2 100644 --- a/src/script/squirrel_helper.hpp +++ b/src/script/squirrel_helper.hpp @@ -117,7 +117,7 @@ namespace SQConvert { sq_getstring(vm, -1, &tmp); char *tmp_str = stredup(tmp); sq_poptop(vm); - *ptr->Append() = (void *)tmp_str; + ptr->push_back((void *)tmp_str); str_validate(tmp_str, tmp_str + strlen(tmp_str)); return tmp_str; } @@ -137,7 +137,7 @@ namespace SQConvert { while (SQ_SUCCEEDED(sq_next(vm, -2))) { SQInteger tmp; if (SQ_SUCCEEDED(sq_getinteger(vm, -1, &tmp))) { - *data.Append() = (int32)tmp; + data.push_back((int32)tmp); } else { sq_pop(vm, 4); throw sq_throwerror(vm, "a member of an array used as parameter to a function is not numeric"); @@ -151,7 +151,7 @@ namespace SQConvert { arr->size = data.size(); memcpy(arr->array, data.Begin(), sizeof(int32) * data.size()); - *ptr->Append() = arr; + ptr->push_back(arr); return arr; } diff --git a/src/settings.cpp b/src/settings.cpp index 8f57b6bda7..2c9fc305e2 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -727,7 +727,7 @@ static void IniLoadSettingList(IniFile *ini, const char *grpname, StringList *li list->Clear(); for (const IniItem *item = group->item; item != NULL; item = item->next) { - if (item->name != NULL) *list->Append() = stredup(item->name); + if (item->name != NULL) list->push_back(stredup(item->name)); } } @@ -1777,7 +1777,7 @@ void GetGRFPresetList(GRFPresetList *list) IniGroup *group; for (group = ini->group; group != NULL; group = group->next) { if (strncmp(group->name, "preset-", 7) == 0) { - *list->Append() = stredup(group->name + 7); + list->push_back(stredup(group->name + 7)); } } diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 8b20bb9f27..da4989e858 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -129,7 +129,7 @@ static DropDownList *BuildSetDropDownList(int *selected_index, bool allow_select DropDownList *list = new DropDownList(); for (int i = 0; i < n; i++) { - *list->Append() = new DropDownListCharStringItem(T::GetSet(i)->name, i, !allow_selection && (*selected_index != i)); + list->push_back(new DropDownListCharStringItem(T::GetSet(i)->name, i, !allow_selection && (*selected_index != i))); } return list; @@ -213,13 +213,13 @@ struct GameOptionsWindow : Window { /* Add non-custom currencies; sorted naturally */ for (uint i = 0; i < CURRENCY_END; items++, i++) { if (i == CURRENCY_CUSTOM) continue; - *list->Append() = new DropDownListStringItem(*items, i, HasBit(disabled, i)); + list->push_back(new DropDownListStringItem(*items, i, HasBit(disabled, i))); } QSortT(list->Begin(), list->size(), DropDownListStringItem::NatSortFunc); /* Append custom currency at the end */ - *list->Append() = new DropDownListItem(-1, false); // separator line - *list->Append() = new DropDownListStringItem(STR_GAME_OPTIONS_CURRENCY_CUSTOM, CURRENCY_CUSTOM, HasBit(disabled, CURRENCY_CUSTOM)); + list->push_back(new DropDownListItem(-1, false)); // separator line + list->push_back(new DropDownListStringItem(STR_GAME_OPTIONS_CURRENCY_CUSTOM, CURRENCY_CUSTOM, HasBit(disabled, CURRENCY_CUSTOM))); break; } @@ -237,7 +237,7 @@ struct GameOptionsWindow : Window { } for (uint i = 0; *items != INVALID_STRING_ID; items++, i++) { - *list->Append() = new DropDownListStringItem(*items, i, HasBit(disabled, i)); + list->push_back(new DropDownListStringItem(*items, i, HasBit(disabled, i))); } break; } @@ -251,20 +251,20 @@ struct GameOptionsWindow : Window { /* Add and sort newgrf townnames generators */ for (int i = 0; i < _nb_grf_names; i++) { int result = _nb_orig_names + i; - *list->Append() = new DropDownListStringItem(_grf_names[i], result, enabled_item != result && enabled_item >= 0); + list->push_back(new DropDownListStringItem(_grf_names[i], result, enabled_item != result && enabled_item >= 0)); } QSortT(list->Begin(), list->size(), DropDownListStringItem::NatSortFunc); int newgrf_size = list->size(); /* Insert newgrf_names at the top of the list */ if (newgrf_size > 0) { - *list->Append() = new DropDownListItem(-1, false); // separator line + list->push_back(new DropDownListItem(-1, false)); // separator line newgrf_size++; } /* Add and sort original townnames generators */ for (int i = 0; i < _nb_orig_names; i++) { - *list->Append() = new DropDownListStringItem(STR_GAME_OPTIONS_TOWN_NAME_ORIGINAL_ENGLISH + i, i, enabled_item != i && enabled_item >= 0); + list->push_back(new DropDownListStringItem(STR_GAME_OPTIONS_TOWN_NAME_ORIGINAL_ENGLISH + i, i, enabled_item != i && enabled_item >= 0)); } QSortT(list->Begin() + newgrf_size, list->size() - newgrf_size, DropDownListStringItem::NatSortFunc); break; @@ -275,7 +275,7 @@ struct GameOptionsWindow : Window { *selected_index = _settings_client.gui.autosave; const StringID *items = _autosave_dropdown; for (uint i = 0; *items != INVALID_STRING_ID; items++, i++) { - *list->Append() = new DropDownListStringItem(*items, i, false); + list->push_back(new DropDownListStringItem(*items, i, false)); } break; } @@ -284,7 +284,7 @@ struct GameOptionsWindow : Window { list = new DropDownList(); for (uint i = 0; i < _languages.size(); i++) { if (&_languages[i] == _current_language) *selected_index = i; - *list->Append() = new DropDownListStringItem(SPECSTR_LANGUAGE_START + i, i, false); + list->push_back(new DropDownListStringItem(SPECSTR_LANGUAGE_START + i, i, false)); } QSortT(list->Begin(), list->size(), DropDownListStringItem::NatSortFunc); break; @@ -296,7 +296,7 @@ struct GameOptionsWindow : Window { list = new DropDownList(); *selected_index = GetCurRes(); for (int i = 0; i < _num_resolutions; i++) { - *list->Append() = new DropDownListStringItem(SPECSTR_RESOLUTION_START + i, i, false); + list->push_back(new DropDownListStringItem(SPECSTR_RESOLUTION_START + i, i, false)); } break; @@ -305,7 +305,7 @@ struct GameOptionsWindow : Window { *selected_index = ZOOM_LVL_OUT_4X - _gui_zoom; const StringID *items = _gui_zoom_dropdown; for (int i = 0; *items != INVALID_STRING_ID; items++, i++) { - *list->Append() = new DropDownListStringItem(*items, i, _settings_client.gui.zoom_min > ZOOM_LVL_OUT_4X - i); + list->push_back(new DropDownListStringItem(*items, i, _settings_client.gui.zoom_min > ZOOM_LVL_OUT_4X - i)); } break; } @@ -315,7 +315,7 @@ struct GameOptionsWindow : Window { *selected_index = ZOOM_LVL_OUT_4X - _font_zoom; const StringID *items = _font_zoom_dropdown; for (int i = 0; *items != INVALID_STRING_ID; items++, i++) { - *list->Append() = new DropDownListStringItem(*items, i, false); + list->push_back(new DropDownListStringItem(*items, i, false)); } break; } @@ -1964,16 +1964,16 @@ struct GameSettingsWindow : Window { * we don't want to allow comparing with new game's settings. */ bool disabled = mode == RM_CHANGED_AGAINST_NEW && settings_ptr == &_settings_newgame; - *list->Append() = new DropDownListStringItem(_game_settings_restrict_dropdown[mode], mode, disabled); + list->push_back(new DropDownListStringItem(_game_settings_restrict_dropdown[mode], mode, disabled)); } break; case WID_GS_TYPE_DROPDOWN: list = new DropDownList(); - *list->Append() = new DropDownListStringItem(STR_CONFIG_SETTING_TYPE_DROPDOWN_ALL, ST_ALL, false); - *list->Append() = new DropDownListStringItem(_game_mode == GM_MENU ? STR_CONFIG_SETTING_TYPE_DROPDOWN_GAME_MENU : STR_CONFIG_SETTING_TYPE_DROPDOWN_GAME_INGAME, ST_GAME, false); - *list->Append() = new DropDownListStringItem(_game_mode == GM_MENU ? STR_CONFIG_SETTING_TYPE_DROPDOWN_COMPANY_MENU : STR_CONFIG_SETTING_TYPE_DROPDOWN_COMPANY_INGAME, ST_COMPANY, false); - *list->Append() = new DropDownListStringItem(STR_CONFIG_SETTING_TYPE_DROPDOWN_CLIENT, ST_CLIENT, false); + list->push_back(new DropDownListStringItem(STR_CONFIG_SETTING_TYPE_DROPDOWN_ALL, ST_ALL, false)); + list->push_back(new DropDownListStringItem(_game_mode == GM_MENU ? STR_CONFIG_SETTING_TYPE_DROPDOWN_GAME_MENU : STR_CONFIG_SETTING_TYPE_DROPDOWN_GAME_INGAME, ST_GAME, false)); + list->push_back(new DropDownListStringItem(_game_mode == GM_MENU ? STR_CONFIG_SETTING_TYPE_DROPDOWN_COMPANY_MENU : STR_CONFIG_SETTING_TYPE_DROPDOWN_COMPANY_INGAME, ST_COMPANY, false)); + list->push_back(new DropDownListStringItem(STR_CONFIG_SETTING_TYPE_DROPDOWN_CLIENT, ST_CLIENT, false)); break; } return list; @@ -2130,7 +2130,7 @@ struct GameSettingsWindow : Window { DropDownList *list = new DropDownList(); for (int i = sdb->min; i <= (int)sdb->max; i++) { - *list->Append() = new DropDownListStringItem(sdb->str_val + i - sdb->min, i, false); + list->push_back(new DropDownListStringItem(sdb->str_val + i - sdb->min, i, false)); } ShowDropDownListAt(this, list, value, -1, wi_rect, COLOUR_ORANGE, true); diff --git a/src/settingsgen/settingsgen.cpp b/src/settingsgen/settingsgen.cpp index 64901a89f6..1847bedff3 100644 --- a/src/settingsgen/settingsgen.cpp +++ b/src/settingsgen/settingsgen.cpp @@ -121,9 +121,10 @@ public: text += stored_size; } while (length > 0) { - OutputBuffer *block = this->output_buffer.Append(); - block->Clear(); // Initialize the new block. - int stored_size = block->Add(text, length); + /*C++17: OutputBuffer &block =*/ this->output_buffer.emplace_back(); + OutputBuffer &block = this->output_buffer.back(); + block.Clear(); // Initialize the new block. + int stored_size = block.Add(text, length); length -= stored_size; text += stored_size; } diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 0a1f0dd5d5..cab19c22f8 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -63,7 +63,7 @@ struct SignList { this->signs.clear(); const Sign *si; - FOR_ALL_SIGNS(si) *this->signs.Append() = si; + FOR_ALL_SIGNS(si) this->signs.push_back(si); this->signs.SetFilterState(true); this->FilterSignList(); diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 2dee09fe80..fcbf514bc8 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -942,7 +942,7 @@ static CommandCost CheckFlatLandRailStation(TileArea tile_area, DoCommandFlag fl if (HasBit(GetRailReservationTrackBits(tile_cur), track)) { Train *v = GetTrainForReservation(tile_cur, track); if (v != NULL) { - *affected_vehicles.Append() = v; + affected_vehicles.push_back(v); } } CommandCost ret = DoCommand(tile_cur, 0, track, flags, CMD_REMOVE_SINGLE_RAIL); @@ -1386,7 +1386,7 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32 /* Check for trains having a reservation for this tile. */ Train *v = GetTrainForReservation(tile, AxisToTrack(GetRailStationAxis(tile))); if (v != NULL) { - *affected_vehicles.Append() = v; + affected_vehicles.push_back(v); FreeTrainReservation(v); } } @@ -3538,7 +3538,7 @@ void DeleteStaleLinks(Station *from) } } if (!found_to || !found_from) continue; - *(vehicles.Append()) = l->GetFirstSharedVehicle(); + vehicles.push_back(l->GetFirstSharedVehicle()); } auto iter = vehicles.begin(); diff --git a/src/station_gui.cpp b/src/station_gui.cpp index e1f5daa699..98ac80df4b 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -189,14 +189,14 @@ protected: if (st->goods[j].HasRating()) { num_waiting_cargo++; // count number of waiting cargo if (HasBit(this->cargo_filter, j)) { - *this->stations.Append() = st; + this->stations.push_back(st); break; } } } /* stations without waiting cargo */ if (num_waiting_cargo == 0 && this->include_empty) { - *this->stations.Append() = st; + this->stations.push_back(st); } } } @@ -2135,7 +2135,7 @@ static bool AddNearbyStation(TileIndex tile, void *user_data) for (uint i = 0; i < _deleted_stations_nearby.size(); i++) { auto ts = _deleted_stations_nearby.begin() + i; if (ts->tile == tile) { - *_stations_nearby_list.Append() = _deleted_stations_nearby[i].station; + _stations_nearby_list.push_back(_deleted_stations_nearby[i].station); _deleted_stations_nearby.erase(ts); i--; } @@ -2153,7 +2153,7 @@ static bool AddNearbyStation(TileIndex tile, void *user_data) if (st->owner != _local_company || std::find(_stations_nearby_list.begin(), _stations_nearby_list.end(), sid) != _stations_nearby_list.end()) return false; if (st->rect.BeforeAddRect(ctx->tile, ctx->w, ctx->h, StationRect::ADD_TEST).Succeeded()) { - *_stations_nearby_list.Append() = sid; + _stations_nearby_list.push_back(sid); } return false; // We want to include *all* nearby stations @@ -2187,9 +2187,7 @@ static const T *FindStationsNearby(TileArea ta, bool distant_join) if (T::IsExpected(st) && !st->IsInUse() && st->owner == _local_company) { /* Include only within station spread (yes, it is strictly less than) */ if (max(DistanceMax(ta.tile, st->xy), DistanceMax(TILE_ADDXY(ta.tile, ta.w - 1, ta.h - 1), st->xy)) < _settings_game.station.station_spread) { - TileAndStation *ts = _deleted_stations_nearby.Append(); - ts->tile = st->xy; - ts->station = st->index; + _deleted_stations_nearby.push_back({st->xy, st->index}); /* Add the station when it's within where we're going to build */ if (IsInsideBS(TileX(st->xy), TileX(ctx.tile), ctx.w) && diff --git a/src/story_gui.cpp b/src/story_gui.cpp index 78c8b97930..aed00358d0 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -57,7 +57,7 @@ protected: const StoryPage *p; FOR_ALL_STORY_PAGES(p) { if (this->IsPageAvailable(p)) { - *this->story_pages.Append() = p; + this->story_pages.push_back(p); } } @@ -85,7 +85,7 @@ protected: const StoryPageElement *pe; FOR_ALL_STORY_PAGE_ELEMENTS(pe) { if (pe->page == p->index) { - *this->story_page_elements.Append() = pe; + this->story_page_elements.push_back(pe); } } } @@ -248,7 +248,7 @@ protected: item = str_item; } - *list->Append() = item; + list->push_back(item); page_num++; } diff --git a/src/strgen/strgen_base.cpp b/src/strgen/strgen_base.cpp index 0e75537fb8..12d9938446 100644 --- a/src/strgen/strgen_base.cpp +++ b/src/strgen/strgen_base.cpp @@ -242,7 +242,7 @@ struct Buffer : SmallVector { */ void AppendByte(byte value) { - *this->Append() = value; + this->push_back(value); } /** @@ -252,19 +252,19 @@ struct Buffer : SmallVector { void AppendUtf8(uint32 value) { if (value < 0x80) { - *this->Append() = value; + this->push_back(value); } else if (value < 0x800) { - *this->Append() = 0xC0 + GB(value, 6, 5); - *this->Append() = 0x80 + GB(value, 0, 6); + this->push_back(0xC0 + GB(value, 6, 5)); + this->push_back(0x80 + GB(value, 0, 6)); } else if (value < 0x10000) { - *this->Append() = 0xE0 + GB(value, 12, 4); - *this->Append() = 0x80 + GB(value, 6, 6); - *this->Append() = 0x80 + GB(value, 0, 6); + this->push_back(0xE0 + GB(value, 12, 4)); + this->push_back(0x80 + GB(value, 6, 6)); + this->push_back(0x80 + GB(value, 0, 6)); } else if (value < 0x110000) { - *this->Append() = 0xF0 + GB(value, 18, 3); - *this->Append() = 0x80 + GB(value, 12, 6); - *this->Append() = 0x80 + GB(value, 6, 6); - *this->Append() = 0x80 + GB(value, 0, 6); + this->push_back(0xF0 + GB(value, 18, 3)); + this->push_back(0x80 + GB(value, 12, 6)); + this->push_back(0x80 + GB(value, 6, 6)); + this->push_back(0x80 + GB(value, 0, 6)); } else { strgen_warning("Invalid unicode value U+0x%X", value); } diff --git a/src/string.cpp b/src/string.cpp index 5246f78271..c23202acbb 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -634,8 +634,8 @@ public: this->char_itr = icu::BreakIterator::createCharacterInstance(icu::Locale(_current_language != NULL ? _current_language->isocode : "en"), status); this->word_itr = icu::BreakIterator::createWordInstance(icu::Locale(_current_language != NULL ? _current_language->isocode : "en"), status); - *this->utf16_str.Append() = '\0'; - *this->utf16_to_utf8.Append() = 0; + this->utf16_str.push_back('\0'); + this->utf16_to_utf8.push_back(0); } virtual ~IcuStringIterator() @@ -660,17 +660,17 @@ public: WChar c = Utf8Consume(&s); if (c < 0x10000) { - *this->utf16_str.Append() = (UChar)c; + this->utf16_str.push_back((UChar)c); } else { /* Make a surrogate pair. */ - *this->utf16_str.Append() = (UChar)(0xD800 + ((c - 0x10000) >> 10)); - *this->utf16_str.Append() = (UChar)(0xDC00 + ((c - 0x10000) & 0x3FF)); - *this->utf16_to_utf8.Append() = idx; + this->utf16_str.push_back((UChar)(0xD800 + ((c - 0x10000) >> 10))); + this->utf16_str.push_back((UChar)(0xDC00 + ((c - 0x10000) & 0x3FF))); + this->utf16_to_utf8.push_back(idx); } - *this->utf16_to_utf8.Append() = idx; + this->utf16_to_utf8.push_back(idx); } - *this->utf16_str.Append() = '\0'; - *this->utf16_to_utf8.Append() = s - string_base; + this->utf16_str.push_back('\0'); + this->utf16_to_utf8.push_back(s - string_base); UText text = UTEXT_INITIALIZER; UErrorCode status = U_ZERO_ERROR; diff --git a/src/stringfilter.cpp b/src/stringfilter.cpp index b12abff7ff..e546a4186c 100644 --- a/src/stringfilter.cpp +++ b/src/stringfilter.cpp @@ -76,9 +76,8 @@ void StringFilter::SetFilterTerm(const char *str) /* Add to word */ if (word == NULL) { - word = this->word_index.Append(); - word->start = dest; - word->match = false; + /*C++17: word = &*/ this->word_index.push_back({dest, false}); + word = &this->word_index.back(); } memcpy(dest, pos, len); diff --git a/src/strings.cpp b/src/strings.cpp index 61a5098ab6..c3f3061834 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -1932,7 +1932,7 @@ static void GetLanguageList(const char *path) } else if (GetLanguage(lmd.newgrflangid) != NULL) { DEBUG(misc, 3, "%s's language ID is already known", lmd.file); } else { - *_languages.Append() = lmd; + _languages.push_back(lmd); } } closedir(dir); diff --git a/src/texteff.cpp b/src/texteff.cpp index 92c2017047..c81d9a95d7 100644 --- a/src/texteff.cpp +++ b/src/texteff.cpp @@ -48,20 +48,20 @@ TextEffectID AddTextEffect(StringID msg, int center, int y, uint8 duration, Text for (i = 0; i < _text_effects.size(); i++) { if (_text_effects[i].string_id == INVALID_STRING_ID) break; } - if (i == _text_effects.size()) _text_effects.Append(); + if (i == _text_effects.size()) _text_effects.emplace_back(); - TextEffect *te = _text_effects.data() + i; + TextEffect &te = _text_effects[i]; /* Start defining this object */ - te->string_id = msg; - te->duration = duration; - te->params_1 = GetDParam(0); - te->params_2 = GetDParam(1); - te->mode = mode; + te.string_id = msg; + te.duration = duration; + te.params_1 = GetDParam(0); + te.params_2 = GetDParam(1); + te.mode = mode; /* Make sure we only dirty the new area */ - te->width_normal = 0; - te->UpdatePosition(center, y, msg); + te.width_normal = 0; + te.UpdatePosition(center, y, msg); return i; } diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp index e9706c7529..b4911a9682 100644 --- a/src/textfile_gui.cpp +++ b/src/textfile_gui.cpp @@ -365,11 +365,11 @@ static void Xunzip(byte **bufp, size_t *sizep) str_validate(p, this->text + filesize, SVS_REPLACE_WITH_QUESTION_MARK | SVS_ALLOW_NEWLINE); /* Split the string on newlines. */ - *this->lines.Append() = p; + this->lines.push_back(p); for (; *p != '\0'; p++) { if (*p == '\n') { *p = '\0'; - *this->lines.Append() = p + 1; + this->lines.push_back(p + 1); } } diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index dec4f7d442..8107fc3d2f 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -285,10 +285,10 @@ CommandCost CmdSetTimetableStart(TileIndex tile, DoCommandFlag flags, uint32 p1, if (timetable_all) { for (Vehicle *w = v->orders.list->GetFirstSharedVehicle(); w != NULL; w = w->NextShared()) { - *vehs.Append() = w; + vehs.push_back(w); } } else { - *vehs.Append() = v; + vehs.push_back(v); } int total_duration = v->orders.list->GetTimetableTotalDuration(); diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index 7052dc4e2f..eac99f2494 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -198,7 +198,7 @@ static void PopupMainToolbMenu(Window *w, int widget, StringID string, int count { DropDownList *list = new DropDownList(); for (int i = 0; i < count; i++) { - *list->Append() = new DropDownListStringItem(string + i, i, false); + list->push_back(new DropDownListStringItem(string + i, i, false)); } PopupMainToolbMenu(w, widget, list, 0); } @@ -224,27 +224,27 @@ static void PopupMainCompanyToolbMenu(Window *w, int widget, int grey = 0) if (!_networking) break; /* Add the client list button for the companies menu */ - *list->Append() = new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_CLIENT_LIST, CTMN_CLIENT_LIST, false); + list->push_back(new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_CLIENT_LIST, CTMN_CLIENT_LIST, false)); if (_local_company == COMPANY_SPECTATOR) { - *list->Append() = new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_NEW_COMPANY, CTMN_NEW_COMPANY, NetworkMaxCompaniesReached()); + list->push_back(new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_NEW_COMPANY, CTMN_NEW_COMPANY, NetworkMaxCompaniesReached())); } else { - *list->Append() = new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_SPECTATE, CTMN_SPECTATE, NetworkMaxSpectatorsReached()); + list->push_back(new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_SPECTATE, CTMN_SPECTATE, NetworkMaxSpectatorsReached())); } break; case WID_TN_STORY: - *list->Append() = new DropDownListStringItem(STR_STORY_BOOK_SPECTATOR, CTMN_SPECTATOR, false); + list->push_back(new DropDownListStringItem(STR_STORY_BOOK_SPECTATOR, CTMN_SPECTATOR, false)); break; case WID_TN_GOAL: - *list->Append() = new DropDownListStringItem(STR_GOALS_SPECTATOR, CTMN_SPECTATOR, false); + list->push_back(new DropDownListStringItem(STR_GOALS_SPECTATOR, CTMN_SPECTATOR, false)); break; } for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) { if (!Company::IsValidID(c)) continue; - *list->Append() = new DropDownListCompanyItem(c, false, HasBit(grey, c)); + list->push_back(new DropDownListCompanyItem(c, false, HasBit(grey, c))); } PopupMainToolbMenu(w, widget, list, _local_company == COMPANY_SPECTATOR ? (widget == WID_TN_COMPANIES ? CTMN_CLIENT_LIST : CTMN_SPECTATOR) : (int)_local_company); @@ -318,24 +318,24 @@ enum OptionMenuEntries { static CallBackFunction ToolbarOptionsClick(Window *w) { DropDownList *list = new DropDownList(); - *list->Append() = new DropDownListStringItem(STR_SETTINGS_MENU_GAME_OPTIONS, OME_GAMEOPTIONS, false); - *list->Append() = new DropDownListStringItem(STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE, OME_SETTINGS, false); + list->push_back(new DropDownListStringItem(STR_SETTINGS_MENU_GAME_OPTIONS, OME_GAMEOPTIONS, false)); + list->push_back(new DropDownListStringItem(STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE, OME_SETTINGS, false)); /* Changes to the per-AI settings don't get send from the server to the clients. Clients get * the settings once they join but never update it. As such don't show the window at all * to network clients. */ - if (!_networking || _network_server) *list->Append() = new DropDownListStringItem(STR_SETTINGS_MENU_SCRIPT_SETTINGS, OME_SCRIPT_SETTINGS, false); - *list->Append() = new DropDownListStringItem(STR_SETTINGS_MENU_NEWGRF_SETTINGS, OME_NEWGRFSETTINGS, false); - *list->Append() = new DropDownListStringItem(STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS, OME_TRANSPARENCIES, false); - *list->Append() = new DropDownListItem(-1, false); - *list->Append() = new DropDownListCheckedItem(STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED, OME_SHOW_TOWNNAMES, false, HasBit(_display_opt, DO_SHOW_TOWN_NAMES)); - *list->Append() = new DropDownListCheckedItem(STR_SETTINGS_MENU_STATION_NAMES_DISPLAYED, OME_SHOW_STATIONNAMES, false, HasBit(_display_opt, DO_SHOW_STATION_NAMES)); - *list->Append() = new DropDownListCheckedItem(STR_SETTINGS_MENU_WAYPOINTS_DISPLAYED, OME_SHOW_WAYPOINTNAMES, false, HasBit(_display_opt, DO_SHOW_WAYPOINT_NAMES)); - *list->Append() = new DropDownListCheckedItem(STR_SETTINGS_MENU_SIGNS_DISPLAYED, OME_SHOW_SIGNS, false, HasBit(_display_opt, DO_SHOW_SIGNS)); - *list->Append() = new DropDownListCheckedItem(STR_SETTINGS_MENU_SHOW_COMPETITOR_SIGNS, OME_SHOW_COMPETITOR_SIGNS, false, HasBit(_display_opt, DO_SHOW_COMPETITOR_SIGNS)); - *list->Append() = new DropDownListCheckedItem(STR_SETTINGS_MENU_FULL_ANIMATION, OME_FULL_ANIMATION, false, HasBit(_display_opt, DO_FULL_ANIMATION)); - *list->Append() = new DropDownListCheckedItem(STR_SETTINGS_MENU_FULL_DETAIL, OME_FULL_DETAILS, false, HasBit(_display_opt, DO_FULL_DETAIL)); - *list->Append() = new DropDownListCheckedItem(STR_SETTINGS_MENU_TRANSPARENT_BUILDINGS, OME_TRANSPARENTBUILDINGS, false, IsTransparencySet(TO_HOUSES)); - *list->Append() = new DropDownListCheckedItem(STR_SETTINGS_MENU_TRANSPARENT_SIGNS, OME_SHOW_STATIONSIGNS, false, IsTransparencySet(TO_SIGNS)); + if (!_networking || _network_server) list->push_back(new DropDownListStringItem(STR_SETTINGS_MENU_SCRIPT_SETTINGS, OME_SCRIPT_SETTINGS, false)); + list->push_back(new DropDownListStringItem(STR_SETTINGS_MENU_NEWGRF_SETTINGS, OME_NEWGRFSETTINGS, false)); + list->push_back(new DropDownListStringItem(STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS, OME_TRANSPARENCIES, false)); + list->push_back(new DropDownListItem(-1, false)); + list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED, OME_SHOW_TOWNNAMES, false, HasBit(_display_opt, DO_SHOW_TOWN_NAMES))); + list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_STATION_NAMES_DISPLAYED, OME_SHOW_STATIONNAMES, false, HasBit(_display_opt, DO_SHOW_STATION_NAMES))); + list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_WAYPOINTS_DISPLAYED, OME_SHOW_WAYPOINTNAMES, false, HasBit(_display_opt, DO_SHOW_WAYPOINT_NAMES))); + list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_SIGNS_DISPLAYED, OME_SHOW_SIGNS, false, HasBit(_display_opt, DO_SHOW_SIGNS))); + list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_SHOW_COMPETITOR_SIGNS, OME_SHOW_COMPETITOR_SIGNS, false, HasBit(_display_opt, DO_SHOW_COMPETITOR_SIGNS))); + list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_FULL_ANIMATION, OME_FULL_ANIMATION, false, HasBit(_display_opt, DO_FULL_ANIMATION))); + list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_FULL_DETAIL, OME_FULL_DETAILS, false, HasBit(_display_opt, DO_FULL_DETAIL))); + list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_TRANSPARENT_BUILDINGS, OME_TRANSPARENTBUILDINGS, false, IsTransparencySet(TO_HOUSES))); + list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_TRANSPARENT_SIGNS, OME_SHOW_STATIONSIGNS, false, IsTransparencySet(TO_SIGNS))); ShowDropDownList(w, list, 0, WID_TN_SETTINGS, 140, true, true); if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); @@ -464,10 +464,10 @@ enum MapMenuEntries { static CallBackFunction ToolbarMapClick(Window *w) { DropDownList *list = new DropDownList(); - *list->Append() = new DropDownListStringItem(STR_MAP_MENU_MAP_OF_WORLD, MME_SHOW_SMALLMAP, false); - *list->Append() = new DropDownListStringItem(STR_MAP_MENU_EXTRA_VIEW_PORT, MME_SHOW_EXTRAVIEWPORTS, false); - *list->Append() = new DropDownListStringItem(STR_MAP_MENU_LINGRAPH_LEGEND, MME_SHOW_LINKGRAPH, false); - *list->Append() = new DropDownListStringItem(STR_MAP_MENU_SIGN_LIST, MME_SHOW_SIGNLISTS, false); + list->push_back(new DropDownListStringItem(STR_MAP_MENU_MAP_OF_WORLD, MME_SHOW_SMALLMAP, false)); + list->push_back(new DropDownListStringItem(STR_MAP_MENU_EXTRA_VIEW_PORT, MME_SHOW_EXTRAVIEWPORTS, false)); + list->push_back(new DropDownListStringItem(STR_MAP_MENU_LINGRAPH_LEGEND, MME_SHOW_LINKGRAPH, false)); + list->push_back(new DropDownListStringItem(STR_MAP_MENU_SIGN_LIST, MME_SHOW_SIGNLISTS, false)); PopupMainToolbMenu(w, WID_TN_SMALL_MAP, list, 0); return CBF_NONE; } @@ -475,11 +475,11 @@ static CallBackFunction ToolbarMapClick(Window *w) static CallBackFunction ToolbarScenMapTownDir(Window *w) { DropDownList *list = new DropDownList(); - *list->Append() = new DropDownListStringItem(STR_MAP_MENU_MAP_OF_WORLD, MME_SHOW_SMALLMAP, false); - *list->Append() = new DropDownListStringItem(STR_MAP_MENU_EXTRA_VIEW_PORT, MME_SHOW_EXTRAVIEWPORTS, false); - *list->Append() = new DropDownListStringItem(STR_MAP_MENU_SIGN_LIST, MME_SHOW_SIGNLISTS, false); - *list->Append() = new DropDownListStringItem(STR_TOWN_MENU_TOWN_DIRECTORY, MME_SHOW_TOWNDIRECTORY, false); - *list->Append() = new DropDownListStringItem(STR_INDUSTRY_MENU_INDUSTRY_DIRECTORY, MME_SHOW_INDUSTRYDIRECTORY, false); + list->push_back(new DropDownListStringItem(STR_MAP_MENU_MAP_OF_WORLD, MME_SHOW_SMALLMAP, false)); + list->push_back(new DropDownListStringItem(STR_MAP_MENU_EXTRA_VIEW_PORT, MME_SHOW_EXTRAVIEWPORTS, false)); + list->push_back(new DropDownListStringItem(STR_MAP_MENU_SIGN_LIST, MME_SHOW_SIGNLISTS, false)); + list->push_back(new DropDownListStringItem(STR_TOWN_MENU_TOWN_DIRECTORY, MME_SHOW_TOWNDIRECTORY, false)); + list->push_back(new DropDownListStringItem(STR_INDUSTRY_MENU_INDUSTRY_DIRECTORY, MME_SHOW_INDUSTRYDIRECTORY, false)); PopupMainToolbMenu(w, WID_TE_SMALL_MAP, list, 0); return CBF_NONE; } @@ -897,7 +897,7 @@ static CallBackFunction ToolbarBuildRoadClick(Window *w) DropDownList *list = new DropDownList(); /* Road is always visible and available. */ - *list->Append() = new DropDownListIconItem(SPR_IMG_ROAD_X_DIR, PAL_NONE, STR_ROAD_MENU_ROAD_CONSTRUCTION, ROADTYPE_ROAD, false); + list->push_back(new DropDownListIconItem(SPR_IMG_ROAD_X_DIR, PAL_NONE, STR_ROAD_MENU_ROAD_CONSTRUCTION, ROADTYPE_ROAD, false)); /* Tram is only visible when there will be a tram, and available when that has been introduced. */ Engine *e; @@ -905,7 +905,7 @@ static CallBackFunction ToolbarBuildRoadClick(Window *w) if (!HasBit(e->info.climates, _settings_game.game_creation.landscape)) continue; if (!HasBit(e->info.misc_flags, EF_ROAD_TRAM)) continue; - *list->Append() = new DropDownListIconItem(SPR_IMG_TRAMWAY_X_DIR, PAL_NONE, STR_ROAD_MENU_TRAM_CONSTRUCTION, ROADTYPE_TRAM, !HasBit(c->avail_roadtypes, ROADTYPE_TRAM)); + list->push_back(new DropDownListIconItem(SPR_IMG_TRAMWAY_X_DIR, PAL_NONE, STR_ROAD_MENU_TRAM_CONSTRUCTION, ROADTYPE_TRAM, !HasBit(c->avail_roadtypes, ROADTYPE_TRAM))); break; } ShowDropDownList(w, list, _last_built_roadtype, WID_TN_ROADS, 140, true, true); diff --git a/src/town_gui.cpp b/src/town_gui.cpp index bf8fb4b875..55f65e3207 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -654,7 +654,7 @@ private: const Town *t; FOR_ALL_TOWNS(t) { - *this->towns.Append() = t; + this->towns.push_back(t); } this->towns.shrink_to_fit(); diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index db3773f964..0d4df42f45 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -823,7 +823,7 @@ typedef SmallVector TrainList; */ static void MakeTrainBackup(TrainList &list, Train *t) { - for (; t != NULL; t = t->Next()) *list.Append() = t; + for (; t != NULL; t = t->Next()) list.push_back(t); } /** diff --git a/src/train_gui.cpp b/src/train_gui.cpp index eab6a33e3e..3036096c89 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -280,7 +280,8 @@ static void GetCargoSummaryOfArticulatedVehicle(const Train *v, CargoSummary *su CargoSummaryItem *item = &*std::find(summary->begin(), summary->end(), new_item); if (item == summary->End()) { - item = summary->Append(); + /*C++17: item = &*/ summary->emplace_back(); + item = &summary->back(); item->cargo = new_item.cargo; item->subtype = new_item.subtype; item->capacity = 0; diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index 06dc24e84f..764551d81f 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -681,9 +681,8 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1, * Do this for all tiles (like trees), not only objects. */ ClearedObjectArea *coa = FindClearedObject(end_tile); if (coa == NULL) { - coa = _cleared_object_areas.Append(); - coa->first_tile = end_tile; - coa->area = TileArea(end_tile, 1, 1); + /*C++17: coa = &*/ _cleared_object_areas.push_back({end_tile, TileArea(end_tile, 1, 1)}); + coa = &_cleared_object_areas.back(); } /* Hide the tile from the terraforming command */ diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 0e05d68f2a..f1b7279710 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2283,9 +2283,7 @@ void Vehicle::GetConsistFreeCapacities(SmallMap &capacities) cons if (v->cargo_cap == 0) continue; SmallPair *pair = capacities.Find(v->cargo_type); if (pair == capacities.End()) { - pair = capacities.Append(); - pair->first = v->cargo_type; - pair->second = v->cargo_cap - v->cargo.StoredCount(); + capacities.push_back({v->cargo_type, v->cargo_cap - v->cargo.StoredCount()}); } else { pair->second += v->cargo_cap - v->cargo.StoredCount(); } diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 636aadb499..8e578cd68d 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -417,11 +417,7 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, uint8 num_vehicles, * - We have to call the refit cost callback with the pre-refit configuration of the chain because we want refit and * autorefit to behave the same, and we need its result for auto_refit_allowed. */ - RefitResult *result = refit_result.Append(); - result->v = v; - result->capacity = amount; - result->mail_capacity = mail_capacity; - result->subtype = actual_subtype; + refit_result.push_back({v, amount, mail_capacity, actual_subtype}); } if (flags & DC_EXEC) { diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 4a42d746d8..9fcebd4e66 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -168,13 +168,13 @@ DropDownList *BaseVehicleListWindow::BuildActionDropdownList(bool show_autorepla { DropDownList *list = new DropDownList(); - if (show_autoreplace) *list->Append() = new DropDownListStringItem(STR_VEHICLE_LIST_REPLACE_VEHICLES, ADI_REPLACE, false); - *list->Append() = new DropDownListStringItem(STR_VEHICLE_LIST_SEND_FOR_SERVICING, ADI_SERVICE, false); - *list->Append() = new DropDownListStringItem(this->vehicle_depot_name[this->vli.vtype], ADI_DEPOT, false); + if (show_autoreplace) list->push_back(new DropDownListStringItem(STR_VEHICLE_LIST_REPLACE_VEHICLES, ADI_REPLACE, false)); + list->push_back(new DropDownListStringItem(STR_VEHICLE_LIST_SEND_FOR_SERVICING, ADI_SERVICE, false)); + list->push_back(new DropDownListStringItem(this->vehicle_depot_name[this->vli.vtype], ADI_DEPOT, false)); if (show_group) { - *list->Append() = new DropDownListStringItem(STR_GROUP_ADD_SHARED_VEHICLE, ADI_ADD_SHARED, false); - *list->Append() = new DropDownListStringItem(STR_GROUP_REMOVE_ALL_VEHICLES, ADI_REMOVE_ALL, false); + list->push_back(new DropDownListStringItem(STR_GROUP_ADD_SHARED_VEHICLE, ADI_ADD_SHARED, false)); + list->push_back(new DropDownListStringItem(STR_GROUP_REMOVE_ALL_VEHICLES, ADI_REMOVE_ALL, false)); } return list; @@ -438,10 +438,7 @@ struct RefitWindow : public Window { bool first_vehicle = this->list[current_index].size() == 0; if (first_vehicle) { /* Keeping the current subtype is always an option. It also serves as the option in case of no subtypes */ - RefitOption *option = this->list[current_index].Append(); - option->cargo = cid; - option->subtype = 0xFF; - option->string = STR_EMPTY; + this->list[current_index].push_back({cid, 0xFF, STR_EMPTY}); } /* Check the vehicle's callback mask for cargo suffixes. diff --git a/src/vehiclelist.cpp b/src/vehiclelist.cpp index 39ec90e8b9..c987975732 100644 --- a/src/vehiclelist.cpp +++ b/src/vehiclelist.cpp @@ -85,7 +85,7 @@ void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine if (t->IsArticulatedPart() || t->IsRearDualheaded()) continue; if (t->track != TRACK_BIT_DEPOT) continue; if (wagons != NULL && t->First()->IsFreeWagon()) { - if (individual_wagons || t->IsFreeWagon()) *wagons->Append() = t; + if (individual_wagons || t->IsFreeWagon()) wagons->push_back(t); continue; } break; @@ -98,7 +98,7 @@ void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine if (!v->IsPrimaryVehicle()) continue; - *engines->Append() = v; + engines->push_back(v); } /* Ensure the lists are not wasting too much space. If the lists are fresh @@ -128,7 +128,7 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli FOR_VEHICLE_ORDERS(v, order) { if ((order->IsType(OT_GOTO_STATION) || order->IsType(OT_GOTO_WAYPOINT) || order->IsType(OT_IMPLICIT)) && order->GetDestination() == vli.index) { - *list->Append() = v; + list->push_back(v); break; } } @@ -142,7 +142,7 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli if (v == NULL || v->type != vli.vtype || !v->IsPrimaryVehicle()) return false; for (; v != NULL; v = v->NextShared()) { - *list->Append() = v; + list->push_back(v); } break; @@ -151,7 +151,7 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli FOR_ALL_VEHICLES(v) { if (v->type == vli.vtype && v->IsPrimaryVehicle() && v->owner == vli.company && GroupIsInGroup(v->group_id, vli.index)) { - *list->Append() = v; + list->push_back(v); } } break; @@ -161,7 +161,7 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli case VL_STANDARD: FOR_ALL_VEHICLES(v) { if (v->type == vli.vtype && v->owner == vli.company && v->IsPrimaryVehicle()) { - *list->Append() = v; + list->push_back(v); } } break; @@ -173,7 +173,7 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli FOR_VEHICLE_ORDERS(v, order) { if (order->IsType(OT_GOTO_DEPOT) && !(order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) && order->GetDestination() == vli.index) { - *list->Append() = v; + list->push_back(v); break; } } diff --git a/src/viewport.cpp b/src/viewport.cpp index 5d6f58268f..929616ba52 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -499,13 +499,14 @@ static void AddTileSpriteToDraw(SpriteID image, PaletteID pal, int32 x, int32 y, { assert((image & SPRITE_MASK) < MAX_SPRITES); - TileSpriteToDraw *ts = _vd.tile_sprites_to_draw.Append(); - ts->image = image; - ts->pal = pal; - ts->sub = sub; + /*C++17: TileSpriteToDraw &ts = */ _vd.tile_sprites_to_draw.emplace_back(); + TileSpriteToDraw &ts = _vd.tile_sprites_to_draw.back(); + ts.image = image; + ts.pal = pal; + ts.sub = sub; Point pt = RemapCoords(x, y, z); - ts->x = pt.x + extra_offs_x; - ts->y = pt.y + extra_offs_y; + ts.x = pt.x + extra_offs_x; + ts.y = pt.y + extra_offs_y; } /** @@ -708,29 +709,30 @@ void AddSortableSpriteToDraw(SpriteID image, PaletteID pal, int x, int y, int w, return; } - ParentSpriteToDraw *ps = _vd.parent_sprites_to_draw.Append(); - ps->x = tmp_x; - ps->y = tmp_y; + /*C++17: ParentSpriteToDraw &ps = */ _vd.parent_sprites_to_draw.emplace_back(); + ParentSpriteToDraw &ps = _vd.parent_sprites_to_draw.back(); + ps.x = tmp_x; + ps.y = tmp_y; - ps->left = tmp_left; - ps->top = tmp_top; + ps.left = tmp_left; + ps.top = tmp_top; - ps->image = image; - ps->pal = pal; - ps->sub = sub; - ps->xmin = x + bb_offset_x; - ps->xmax = x + max(bb_offset_x, w) - 1; + ps.image = image; + ps.pal = pal; + ps.sub = sub; + ps.xmin = x + bb_offset_x; + ps.xmax = x + max(bb_offset_x, w) - 1; - ps->ymin = y + bb_offset_y; - ps->ymax = y + max(bb_offset_y, h) - 1; + ps.ymin = y + bb_offset_y; + ps.ymax = y + max(bb_offset_y, h) - 1; - ps->zmin = z + bb_offset_z; - ps->zmax = z + max(bb_offset_z, dz) - 1; + ps.zmin = z + bb_offset_z; + ps.zmax = z + max(bb_offset_z, dz) - 1; - ps->comparison_done = false; - ps->first_child = -1; + ps.comparison_done = false; + ps.first_child = -1; - _vd.last_child = &ps->first_child; + _vd.last_child = &ps.first_child; if (_vd.combine_sprites == SPRITE_COMBINE_PENDING) _vd.combine_sprites = SPRITE_COMBINE_ACTIVE; } @@ -826,33 +828,35 @@ void AddChildSpriteScreen(SpriteID image, PaletteID pal, int x, int y, bool tran *_vd.last_child = _vd.child_screen_sprites_to_draw.size(); - ChildScreenSpriteToDraw *cs = _vd.child_screen_sprites_to_draw.Append(); - cs->image = image; - cs->pal = pal; - cs->sub = sub; - cs->x = scale ? x * ZOOM_LVL_BASE : x; - cs->y = scale ? y * ZOOM_LVL_BASE : y; - cs->next = -1; + /*C++17: ChildScreenSpriteToDraw &cs = */ _vd.child_screen_sprites_to_draw.emplace_back(); + ChildScreenSpriteToDraw &cs = _vd.child_screen_sprites_to_draw.back(); + cs.image = image; + cs.pal = pal; + cs.sub = sub; + cs.x = scale ? x * ZOOM_LVL_BASE : x; + cs.y = scale ? y * ZOOM_LVL_BASE : y; + cs.next = -1; /* Append the sprite to the active ChildSprite list. * If the active ParentSprite is a foundation, update last_foundation_child as well. * Note: ChildSprites of foundations are NOT sequential in the vector, as selection sprites are added at last. */ - if (_vd.last_foundation_child[0] == _vd.last_child) _vd.last_foundation_child[0] = &cs->next; - if (_vd.last_foundation_child[1] == _vd.last_child) _vd.last_foundation_child[1] = &cs->next; - _vd.last_child = &cs->next; + if (_vd.last_foundation_child[0] == _vd.last_child) _vd.last_foundation_child[0] = &cs.next; + if (_vd.last_foundation_child[1] == _vd.last_child) _vd.last_foundation_child[1] = &cs.next; + _vd.last_child = &cs.next; } static void AddStringToDraw(int x, int y, StringID string, uint64 params_1, uint64 params_2, Colours colour, uint16 width) { assert(width != 0); - StringSpriteToDraw *ss = _vd.string_sprites_to_draw.Append(); - ss->string = string; - ss->x = x; - ss->y = y; - ss->params[0] = params_1; - ss->params[1] = params_2; - ss->width = width; - ss->colour = colour; + /*C++17: StringSpriteToDraw &ss = */ _vd.string_sprites_to_draw.emplace_back(); + StringSpriteToDraw &ss = _vd.string_sprites_to_draw.back(); + ss.string = string; + ss.x = x; + ss.y = y; + ss.params[0] = params_1; + ss.params[1] = params_2; + ss.width = width; + ss.colour = colour; } @@ -1588,7 +1592,7 @@ void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom ParentSpriteToDraw *psd_end = _vd.parent_sprites_to_draw.End(); for (ParentSpriteToDraw *it = _vd.parent_sprites_to_draw.Begin(); it != psd_end; it++) { - *_vd.parent_sprites_to_sort.Append() = it; + _vd.parent_sprites_to_sort.push_back(it); } _vp_sprite_sorter(&_vd.parent_sprites_to_sort); diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index 6acbd79c21..33d59effc4 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -509,7 +509,7 @@ void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int butt for (uint i = 0; strings[i] != INVALID_STRING_ID; i++) { if (!HasBit(hidden_mask, i)) { - *list->Append() = new DropDownListStringItem(strings[i], i, HasBit(disabled_mask, i)); + list->push_back(new DropDownListStringItem(strings[i], i, HasBit(disabled_mask, i))); } } diff --git a/src/window.cpp b/src/window.cpp index 471ac08a2e..a8d1ce75e2 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -109,7 +109,7 @@ WindowDesc::WindowDesc(WindowPosition def_pos, const char *ini_key, int16 def_wi default_height_trad(def_height_trad) { if (_window_descs == NULL) _window_descs = new SmallVector(); - *_window_descs->Append() = this; + _window_descs->push_back(this); } WindowDesc::~WindowDesc() @@ -3242,7 +3242,7 @@ void Window::InvalidateData(int data, bool gui_scope) this->SetDirty(); if (!gui_scope) { /* Schedule GUI-scope invalidation for next redraw. */ - *this->scheduled_invalidation_data.Append() = data; + this->scheduled_invalidation_data.push_back(data); } this->OnInvalidateData(data, gui_scope); } From e0c58bf5ee0f3f4d0563a04de315c09b37f74c6e Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Wed, 20 Feb 2019 18:53:57 +0000 Subject: [PATCH 64/82] Codechange: Removed SmallVector::Insert() --- src/core/smallvec_type.hpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 5961a96988..e0596e3385 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -66,20 +66,6 @@ public: ~SmallVector() = default; - /** - * Insert a new item at a specific position into the vector, moving all following items. - * @param item Position at which the new item should be inserted - * @return pointer to the new item - */ - inline T *Insert(T *item) - { - assert(item >= this->Begin() && item <= this->End()); - - size_t start = item - this->Begin(); - std::vector::insert(std::vector::begin() + start); - return this->Begin() + start; - } - /** * Search for the first occurrence of an item. * The '!=' operator of T is used for comparison. From 2bc2de9034d3b75a253b849cf7a703b1a503e200 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Wed, 20 Feb 2019 19:27:10 +0000 Subject: [PATCH 65/82] Codechange: Replaced SmallVector::Find() with std::find() --- src/core/smallvec_type.hpp | 32 +++++++++++++++++------------ src/network/core/host.cpp | 2 +- src/network/network_content_gui.cpp | 17 ++++++--------- src/newgrf.cpp | 6 +++--- src/newgrf_engine.cpp | 4 ++-- src/newgrf_gui.cpp | 6 ++++-- src/newgrf_railtype.cpp | 5 +++-- src/os/windows/string_uniscribe.cpp | 2 +- src/timetable_cmd.cpp | 4 ++-- 9 files changed, 41 insertions(+), 37 deletions(-) diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index e0596e3385..0ab82c4fc9 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -66,18 +66,6 @@ public: ~SmallVector() = default; - /** - * Search for the first occurrence of an item. - * The '!=' operator of T is used for comparison. - * @param item Item to search for - * @return The position of the item, or -1 when not present - */ - inline int FindIndex(const T &item) const - { - auto const it = std::find(std::vector::begin(), std::vector::end(), item); - return it == std::vector::end() ? -1 : it - std::vector::begin(); - } - /** * Tests whether a item is present in the vector, and appends it to the end if not. * The '!=' operator of T is used for comparison. @@ -133,7 +121,25 @@ public: }; /** - * Helper function to extend a vector by more than one element + * Helper function to get the index of an item + * Consider using std::set, std::unordered_set or std::flat_set in new code + * + * @param vec A reference to the vector to be extended + * @param item Reference to the item to be search for + * + * @return Index of element if found, otherwise -1 + */ +template +int find_index(std::vector const& vec, T const& item) +{ + auto const it = std::find(vec.begin(), vec.end(), item); + if (it != vec.end()) return it - vec.begin(); + + return -1; +} + +/** + * Helper function to append N default-constructed elements and get a pointer to the first new element * Consider using std::back_inserter in new code * * @param vec A reference to the vector to be extended diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp index 1ea5389d4f..b1ed71e926 100644 --- a/src/network/core/host.cpp +++ b/src/network/core/host.cpp @@ -136,7 +136,7 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // Wi memcpy(&address, &ifo[j].iiAddress.Address, sizeof(sockaddr)); ((sockaddr_in*)&address)->sin_addr.s_addr = ifo[j].iiAddress.AddressIn.sin_addr.s_addr | ~ifo[j].iiNetmask.AddressIn.sin_addr.s_addr; NetworkAddress addr(address, sizeof(sockaddr)); - if (std::none_of(broadcast->begin(), broadcast->end(), [&addr](NetworkAddress const& elem) -> bool { return elem == addr; })) *broadcast->Append() = addr; + if (std::none_of(broadcast->begin(), broadcast->end(), [&addr](NetworkAddress const& elem) -> bool { return elem == addr; })) broadcast->push_back(addr); } free(ifo); diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 19c075258e..b7237cadd4 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -435,12 +435,8 @@ class NetworkContentListWindow : public Window, ContentCallback { { if (!this->content.Sort()) return; - for (ConstContentIterator iter = this->content.Begin(); iter != this->content.End(); iter++) { - if (*iter == this->selected) { - this->list_pos = iter - this->content.Begin(); - break; - } - } + int idx = find_index(this->content, this->selected); + if (idx >= 0) this->list_pos = idx; } /** Filter content by tags/name */ @@ -478,11 +474,10 @@ class NetworkContentListWindow : public Window, ContentCallback { if (!changed) return; /* update list position */ - for (ConstContentIterator iter = this->content.Begin(); iter != this->content.End(); iter++) { - if (*iter == this->selected) { - this->list_pos = iter - this->content.Begin(); - return; - } + int idx = find_index(this->content, this->selected); + if (idx >= 0) { + this->list_pos = idx; + return; } /* previously selected item not in list anymore */ diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 63296593dc..36a13aaaa3 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -8383,8 +8383,8 @@ static void BuildCargoTranslationMap() _cur.grffile->cargo_map[c] = cs->bitnum; } else { /* Check the translation table for this cargo's label */ - int index = _cur.grffile->cargo_list.FindIndex(cs->label); - if (index >= 0) _cur.grffile->cargo_map[c] = index; + int idx = find_index(_cur.grffile->cargo_list, {cs->label}); + if (idx >= 0) _cur.grffile->cargo_map[c] = idx; } } } @@ -9226,7 +9226,7 @@ static void FinalisePriceBaseMultipliers() GRFFile *dest = GetFileByGRFID(override); if (dest == NULL) continue; - grf_overrides[i] = _grf_files.FindIndex(dest); + grf_overrides[i] = find_index(_grf_files, dest); assert(grf_overrides[i] >= 0); } diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index b2dd4d1a3c..7a0bb04f3b 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -1245,8 +1245,8 @@ void CommitVehicleListOrderChanges() EngineID target = _engine_mngr.GetID(id_source->type, local_target, id_source->grfid); if (target == INVALID_ENGINE) continue; - int source_index = ordering.FindIndex(source); - int target_index = ordering.FindIndex(target); + int source_index = find_index(ordering, source); + int target_index = find_index(ordering, target); assert(source_index >= 0 && target_index >= 0); assert(source_index != target_index); diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 0db38e297b..1473f18779 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -1486,8 +1486,10 @@ private: this->avails.Sort(); if (this->avail_sel != NULL) { - this->avail_pos = this->avails.FindIndex(this->avail_sel); - if (this->avail_pos < 0) this->avail_sel = NULL; + this->avail_pos = find_index(this->avails, this->avail_sel); + if (this->avail_pos == -1) { + this->avail_sel = NULL; + } } this->vscroll2->SetCount(this->avails.size()); // Update the scrollbar diff --git a/src/newgrf_railtype.cpp b/src/newgrf_railtype.cpp index 60ddc19140..c57be5b6cc 100644 --- a/src/newgrf_railtype.cpp +++ b/src/newgrf_railtype.cpp @@ -143,8 +143,9 @@ uint8 GetReverseRailTypeTranslation(RailType railtype, const GRFFile *grffile) /* Look for a matching rail type label in the table */ RailTypeLabel label = GetRailTypeInfo(railtype)->label; - int index = grffile->railtype_list.FindIndex(label); - if (index >= 0) return index; + + int idx = find_index(grffile->railtype_list, label); + if (idx >= 0) return idx; /* If not found, return as invalid */ return 0xFF; diff --git a/src/os/windows/string_uniscribe.cpp b/src/os/windows/string_uniscribe.cpp index f1c62c7d35..ec0e026394 100644 --- a/src/os/windows/string_uniscribe.cpp +++ b/src/os/windows/string_uniscribe.cpp @@ -424,7 +424,7 @@ static std::vector UniscribeItemizeString(UniscribeParagraphLayoutF if (!UniscribeShapeRun(this->text_buffer, run)) return NULL; } - *line->Append() = new UniscribeVisualRun(run, cur_pos); + line->push_back(new UniscribeVisualRun(run, cur_pos)); cur_pos += run.total_advance; } diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index 8107fc3d2f..fcc8493e2b 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -298,10 +298,9 @@ CommandCost CmdSetTimetableStart(TileIndex tile, DoCommandFlag flags, uint32 p1, QSortT(vehs.Begin(), vehs.size(), &VehicleTimetableSorter); } - int base = vehs.FindIndex(v); + int idx = vehs.begin() - std::find(vehs.begin(), vehs.end(), v); for (Vehicle **viter = vehs.Begin(); viter != vehs.End(); viter++) { - int idx = (viter - vehs.Begin()) - base; Vehicle *w = *viter; w->lateness_counter = 0; @@ -309,6 +308,7 @@ CommandCost CmdSetTimetableStart(TileIndex tile, DoCommandFlag flags, uint32 p1, /* Do multiplication, then division to reduce rounding errors. */ w->timetable_start = start_date + idx * total_duration / num_vehs / DAY_TICKS; SetWindowDirty(WC_VEHICLE_TIMETABLE, w->index); + ++idx; } } From 297fd3dda3abe353ebe2fe77c67b011e24d403bc Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Wed, 20 Feb 2019 21:35:41 +0000 Subject: [PATCH 66/82] Codechange: Replaced SmallVector::Include() with include() --- src/animated_tile.cpp | 2 +- src/core/smallvec_type.hpp | 31 +++++++++++++++++------------ src/economy.cpp | 2 +- src/fios.cpp | 2 +- src/gfx.cpp | 2 +- src/hotkeys.cpp | 2 +- src/network/network_content.cpp | 2 +- src/network/network_content.h | 2 +- src/network/network_content_gui.cpp | 2 +- src/rail_cmd.cpp | 2 +- src/station_cmd.cpp | 2 +- src/subsidy.cpp | 2 +- src/vehicle.cpp | 4 ++-- src/vehicle_gui.cpp | 4 ++-- 14 files changed, 33 insertions(+), 28 deletions(-) diff --git a/src/animated_tile.cpp b/src/animated_tile.cpp index eb10b9b8d1..5204547dd3 100644 --- a/src/animated_tile.cpp +++ b/src/animated_tile.cpp @@ -43,7 +43,7 @@ void DeleteAnimatedTile(TileIndex tile) void AddAnimatedTile(TileIndex tile) { MarkTileDirtyByTile(tile); - _animated_tiles.Include(tile); + include(_animated_tiles, tile); } /** diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 0ab82c4fc9..9162c17b99 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -17,6 +17,24 @@ #include #include +/** + * Helper function to append an item to a vector if it is not already contained + * Consider using std::set, std::unordered_set or std::flat_set in new code + * + * @param vec A reference to the vector to be extended + * @param item Reference to the item to be copy-constructed if not found + * + * @return Whether the item was already present + */ +template +inline bool include(std::vector& vec, const T &item) +{ + const bool is_member = std::find(vec.begin(), vec.end(), item) != vec.end(); + if (!is_member) vec.emplace_back(item); + return is_member; +} + + /** * Simple vector template class. * @@ -66,19 +84,6 @@ public: ~SmallVector() = default; - /** - * Tests whether a item is present in the vector, and appends it to the end if not. - * The '!=' operator of T is used for comparison. - * @param item Item to test for - * @return true iff the item is was already present - */ - inline bool Include(const T &item) - { - bool is_member = std::find(std::vector::begin(), std::vector::end(), item) != std::vector::end(); - if (!is_member) std::vector::emplace_back(item); - return is_member; - } - /** * Get the pointer to the first item (const) * diff --git a/src/economy.cpp b/src/economy.cpp index d306fd0bab..1f17612f7d 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1058,7 +1058,7 @@ static uint DeliverGoodsToIndustry(const Station *st, CargoID cargo_type, uint n if (IndustryTemporarilyRefusesCargo(ind, cargo_type)) continue; /* Insert the industry into _cargo_delivery_destinations, if not yet contained */ - _cargo_delivery_destinations.Include(ind); + include(_cargo_delivery_destinations, ind); uint amount = min(num_pieces, 0xFFFFU - ind->incoming_cargo_waiting[cargo_index]); ind->incoming_cargo_waiting[cargo_index] += amount; diff --git a/src/fios.cpp b/src/fios.cpp index a1369e1cd1..6acb2d891e 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -706,7 +706,7 @@ public: FioFCloseFile(f); - this->Include(id); + include(*this, id); return true; } }; diff --git a/src/gfx.cpp b/src/gfx.cpp index 42bb56400b..dad675772a 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -968,7 +968,7 @@ static void GfxBlitter(const Sprite * const sprite, int x, int y, BlitterMode mo if (topleft <= clicked && clicked <= bottomright) { uint offset = (((size_t)clicked - (size_t)topleft) / (blitter->GetScreenDepth() / 8)) % bp.pitch; if (offset < (uint)bp.width) { - _newgrf_debug_sprite_picker.sprites.Include(sprite_id); + include(_newgrf_debug_sprite_picker.sprites, sprite_id); } } } diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp index 8bec7e400b..39cf4c0a1a 100644 --- a/src/hotkeys.cpp +++ b/src/hotkeys.cpp @@ -248,7 +248,7 @@ Hotkey::Hotkey(const uint16 *default_keycodes, const char *name, int num) : */ void Hotkey::AddKeycode(uint16 keycode) { - this->keycodes.Include(keycode); + include(this->keycodes, keycode); } HotkeyList::HotkeyList(const char *ini_group, Hotkey *items, GlobalHotkeyHandlerFunc global_hotkey_handler) : diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index fe7905de89..617a2bc6b6 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -930,7 +930,7 @@ void ClientNetworkContentSocketHandler::ReverseLookupTreeDependency(ConstContent this->ReverseLookupDependency(parents, tree[i]); for (ConstContentIterator piter = parents.Begin(); piter != parents.End(); piter++) { - tree.Include(*piter); + include(tree, *piter); } } } diff --git a/src/network/network_content.h b/src/network/network_content.h index 7cce7fc0a0..08e7755aae 100644 --- a/src/network/network_content.h +++ b/src/network/network_content.h @@ -140,7 +140,7 @@ public: void Clear(); /** Add a callback to this class */ - void AddCallback(ContentCallback *cb) { this->callbacks.Include(cb); } + void AddCallback(ContentCallback *cb) { include(this->callbacks, cb); } /** Remove a callback */ void RemoveCallback(ContentCallback *cb) { this->callbacks.erase(std::find(this->callbacks.begin(), this->callbacks.end(), cb)); } }; diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index b7237cadd4..8e3ec9686a 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -274,7 +274,7 @@ public: void OnDownloadProgress(const ContentInfo *ci, int bytes) override { BaseNetworkContentDownloadStatusWindow::OnDownloadProgress(ci, bytes); - this->receivedTypes.Include(ci->type); + include(this->receivedTypes, ci->type); /* When downloading is finished change cancel in ok */ if (this->downloaded_bytes == this->total_bytes) { diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 3a24fb65f3..c6548eefba 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -1534,7 +1534,7 @@ static Vehicle *UpdateTrainPowerProc(Vehicle *v, void *data) if (v->type != VEH_TRAIN) return NULL; TrainList *affected_trains = static_cast(data); - affected_trains->Include(Train::From(v)->First()); + include(*affected_trains, Train::From(v)->First()); return NULL; } diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index fcbf514bc8..6811290add 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1614,7 +1614,7 @@ CommandCost RemoveFromRailBaseStation(TileArea ta, SmallVector &affected DeallocateSpecFromStation(st, specindex); - affected_stations.Include(st); + include(affected_stations, st); if (v != NULL) RestoreTrainReservation(v); } diff --git a/src/subsidy.cpp b/src/subsidy.cpp index eac81e3624..8f823a1ab4 100644 --- a/src/subsidy.cpp +++ b/src/subsidy.cpp @@ -577,7 +577,7 @@ bool CheckSubsidised(CargoID cargo_type, CompanyID company, SourceType src_type, for (TileIndex tile = it; tile != INVALID_TILE; tile = ++it) { if (!IsTileType(tile, MP_HOUSE)) continue; const Town *t = Town::GetByTile(tile); - if (t->cache.part_of_subsidy & POS_DST) towns_near.Include(t); + if (t->cache.part_of_subsidy & POS_DST) include(towns_near, t); } break; } diff --git a/src/vehicle.cpp b/src/vehicle.cpp index f1b7279710..267c204913 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2899,10 +2899,10 @@ void GetVehicleSet(VehicleSet &set, Vehicle *v, uint8 num_vehicles) for (; u != NULL && num_vehicles > 0; num_vehicles--) { do { /* Include current vehicle in the selection. */ - set.Include(u->index); + include(set, u->index); /* If the vehicle is multiheaded, add the other part too. */ - if (u->IsMultiheaded()) set.Include(u->other_multiheaded_part->index); + if (u->IsMultiheaded()) include(set, u->other_multiheaded_part->index); u = u->Next(); } while (u != NULL && u->IsArticulatedPart()); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 9fcebd4e66..82403a2d1b 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -238,7 +238,7 @@ byte GetBestFittingSubType(Vehicle *v_from, Vehicle *v_for, CargoID dest_cargo_t for (; v_from != NULL; v_from = v_from->HasArticulatedPart() ? v_from->GetNextArticulatedPart() : NULL) { const Engine *e_from = v_from->GetEngine(); if (!e_from->CanCarryCargo() || !HasBit(e_from->info.callback_mask, CBM_VEHICLE_CARGO_SUFFIX)) continue; - subtypes.Include(GetCargoSubtypeText(v_from)); + include(subtypes, GetCargoSubtypeText(v_from)); } byte ret_refit_cyc = 0; @@ -470,7 +470,7 @@ struct RefitWindow : public Window { option.cargo = cid; option.subtype = refit_cyc; option.string = subtype; - this->list[current_index].Include(option); + include(this->list[current_index], option); } else { /* Intersect the subtypes of earlier vehicles with the subtypes of this vehicle */ if (subtype == STR_EMPTY) { From ab711e6942757d775c08c31a6c32d488feba1dba Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Sun, 17 Feb 2019 11:20:52 +0000 Subject: [PATCH 67/82] Codechange: Replaced SmallVector::[Begin|End]() with std alternatives --- src/animated_tile.cpp | 4 +- src/autoreplace_gui.cpp | 4 +- src/base_media_base.h | 16 ++--- src/company_gui.cpp | 8 +-- src/console_cmds.cpp | 4 +- src/core/pool_func.cpp | 5 +- src/core/smallmap_type.hpp | 13 ++-- src/core/smallvec_type.hpp | 40 ------------ src/economy.cpp | 5 +- src/engine.cpp | 12 ++-- src/engine_gui.cpp | 2 +- src/fios.cpp | 10 +-- src/fios.h | 4 +- src/fios_gui.cpp | 12 ++-- src/fontcache.cpp | 6 +- src/game/game_text.cpp | 19 +++--- src/gfx.cpp | 5 +- src/gfx_layout.cpp | 30 ++++----- src/group_gui.cpp | 8 +-- src/hotkeys.cpp | 14 ++--- src/music/dmusic.cpp | 2 +- src/music/midifile.cpp | 6 +- src/music/win32_m.cpp | 2 +- src/network/core/host.cpp | 6 +- src/network/core/tcp_connect.cpp | 2 +- src/network/core/tcp_http.cpp | 4 +- src/network/core/tcp_listen.h | 22 +++---- src/network/core/udp.cpp | 26 ++++---- src/network/network.cpp | 4 +- src/network/network_client.cpp | 2 +- src/network/network_content.cpp | 90 ++++++++++++-------------- src/network/network_content.h | 4 +- src/network/network_content_gui.cpp | 28 +++++---- src/network/network_gui.cpp | 13 ++-- src/network/network_server.cpp | 4 +- src/network/network_udp.cpp | 6 +- src/newgrf.cpp | 97 +++++++++++++---------------- src/newgrf_commons.cpp | 4 +- src/newgrf_commons.h | 2 +- src/newgrf_config.cpp | 6 +- src/newgrf_debug_gui.cpp | 4 +- src/newgrf_engine.cpp | 17 +++-- src/newgrf_text.cpp | 12 ++-- src/object_cmd.cpp | 5 +- src/os/macosx/string_osx.cpp | 38 +++++------ src/os/windows/string_uniscribe.cpp | 20 +++--- src/rail_cmd.cpp | 4 +- src/saveload/afterload.cpp | 11 ++-- src/saveload/animated_tile_sl.cpp | 8 +-- src/saveload/engine_sl.cpp | 6 +- src/saveload/waypoint_sl.cpp | 60 +++++++++--------- src/script/script_info.cpp | 4 +- src/script/squirrel_helper.hpp | 2 +- src/settings.cpp | 4 +- src/settings_gui.cpp | 14 ++--- src/settingsgen/settingsgen.cpp | 4 +- src/station_cmd.cpp | 6 +- src/story_gui.cpp | 26 +++----- src/strgen/strgen_base.cpp | 2 +- src/string.cpp | 2 +- src/stringfilter.cpp | 14 ++--- src/strings.cpp | 18 +++--- src/subsidy.cpp | 6 +- src/texteff.cpp | 28 ++++----- src/timetable_cmd.cpp | 5 +- src/train_cmd.cpp | 3 +- src/train_gui.cpp | 8 +-- src/tunnelbridge_cmd.cpp | 5 +- src/vehicle.cpp | 6 +- src/vehicle_cmd.cpp | 14 ++--- src/vehicle_gui.cpp | 6 +- src/viewport.cpp | 57 ++++++++--------- src/viewport_sprite_sorter_sse4.cpp | 8 +-- src/widgets/dropdown.cpp | 14 ++--- src/window.cpp | 27 ++++---- 75 files changed, 464 insertions(+), 555 deletions(-) diff --git a/src/animated_tile.cpp b/src/animated_tile.cpp index 5204547dd3..e2a5553711 100644 --- a/src/animated_tile.cpp +++ b/src/animated_tile.cpp @@ -53,8 +53,8 @@ void AnimateAnimatedTiles() { PerformanceAccumulator framerate(PFE_GL_LANDSCAPE); - const TileIndex *ti = _animated_tiles.Begin(); - while (ti < _animated_tiles.End()) { + const TileIndex *ti = _animated_tiles.data(); + while (ti < _animated_tiles.data() + _animated_tiles.size()) { const TileIndex curr = *ti; AnimateTile(curr); /* During the AnimateTile call, DeleteAnimatedTile could have been called, diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 5b6976e674..133e9fb382 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -183,8 +183,8 @@ class ReplaceVehicleWindow : public Window { this->vscroll[1]->SetCount(this->engines[1].size()); if (this->reset_sel_engine && this->sel_engine[1] != INVALID_ENGINE) { int position = 0; - for (EngineID *it = this->engines[1].Begin(); it != this->engines[1].End(); ++it) { - if (*it == this->sel_engine[1]) break; + for (EngineID &eid : this->engines[1]) { + if (eid == this->sel_engine[1]) break; ++position; } this->vscroll[1]->ScrollTowards(position); diff --git a/src/base_media_base.h b/src/base_media_base.h index bcffa11a08..5655401558 100644 --- a/src/base_media_base.h +++ b/src/base_media_base.h @@ -76,9 +76,9 @@ struct BaseSet { { free(this->name); - for (TranslatedStrings::iterator iter = this->description.Begin(); iter != this->description.End(); iter++) { - free(iter->first); - free(iter->second); + for (auto &pair : this->description) { + free(pair.first); + free(pair.second); } for (uint i = 0; i < NUM_FILES; i++) { @@ -122,16 +122,16 @@ struct BaseSet { { if (isocode != NULL) { /* First the full ISO code */ - for (TranslatedStrings::const_iterator iter = this->description.Begin(); iter != this->description.End(); iter++) { - if (strcmp(iter->first, isocode) == 0) return iter->second; + for (const auto &pair : this->description) { + if (strcmp(pair.first, isocode) == 0) return pair.second; } /* Then the first two characters */ - for (TranslatedStrings::const_iterator iter = this->description.Begin(); iter != this->description.End(); iter++) { - if (strncmp(iter->first, isocode, 2) == 0) return iter->second; + for (const auto &pair : this->description) { + if (strncmp(pair.first, isocode, 2) == 0) return pair.second; } } /* Then fall back */ - return this->description.Begin()->second; + return this->description.front().second; } /** diff --git a/src/company_gui.cpp b/src/company_gui.cpp index a705687b0c..6b67f373ba 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -640,11 +640,11 @@ private: void AddChildren(GUIGroupList *source, GroupID parent, int indent) { - for (const Group **g = source->Begin(); g != source->End(); g++) { - if ((*g)->parent != parent) continue; - this->groups.push_back(*g); + for (const Group *g : *source) { + if (g->parent != parent) continue; + this->groups.push_back(g); this->indents.push_back(indent); - AddChildren(source, (*g)->index, indent + 1); + AddChildren(source, g->index, indent + 1); } } diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 85b2ddbb19..1d3e9c52c4 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -585,8 +585,8 @@ DEF_CONSOLE_CMD(ConBanList) IConsolePrint(CC_DEFAULT, "Banlist: "); uint i = 1; - for (char **iter = _network_ban_list.Begin(); iter != _network_ban_list.End(); iter++, i++) { - IConsolePrintF(CC_DEFAULT, " %d) %s", i, *iter); + for (char *entry : _network_ban_list) { + IConsolePrintF(CC_DEFAULT, " %d) %s", i, entry); } return true; diff --git a/src/core/pool_func.cpp b/src/core/pool_func.cpp index 97f9ad1c78..7a65bf77a4 100644 --- a/src/core/pool_func.cpp +++ b/src/core/pool_func.cpp @@ -31,10 +31,7 @@ */ /* static */ void PoolBase::Clean(PoolType pt) { - PoolVector *pools = PoolBase::GetPools(); - PoolBase **end = pools->End(); - for (PoolBase **ppool = pools->Begin(); ppool != end; ppool++) { - PoolBase *pool = *ppool; + for (PoolBase *pool : *PoolBase::GetPools()) { if (pool->type & pt) pool->CleanPool(); } } diff --git a/src/core/smallmap_type.hpp b/src/core/smallmap_type.hpp index 0917c5423c..8cc96302f3 100644 --- a/src/core/smallmap_type.hpp +++ b/src/core/smallmap_type.hpp @@ -55,12 +55,13 @@ struct SmallMap : SmallVector, S> { * @param key key to find * @return &Pair(key, data) if found, this->End() if not */ - inline const Pair *Find(const T &key) const + inline typename std::vector::const_iterator Find(const T &key) const { - for (uint i = 0; i < std::vector::size(); i++) { - if (key == std::vector::operator[](i).first) return &std::vector::operator[](i); + typename std::vector::const_iterator it; + for (it = std::vector::begin(); it != std::vector::end(); it++) { + if (key == it->first) return it; } - return this->End(); + return it; } /** @@ -114,7 +115,7 @@ struct SmallMap : SmallVector, S> { */ inline void Erase(Pair *pair) { - assert(pair >= this->Begin() && pair < this->End()); + assert(pair >= std::vector::data() && pair < this->End()); auto distance = pair - std::vector::data(); std::vector::erase(std::vector::begin() + distance); } @@ -166,7 +167,7 @@ struct SmallMap : SmallVector, S> { inline void SortByKey() { - QSortT(this->Begin(), std::vector::size(), KeySorter); + QSortT(std::vector::data(), std::vector::size(), KeySorter); } static int CDECL KeySorter(const Pair *a, const Pair *b) diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 9162c17b99..5ec07f2f01 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -83,46 +83,6 @@ public: } ~SmallVector() = default; - - /** - * Get the pointer to the first item (const) - * - * @return the pointer to the first item - */ - inline const T *Begin() const - { - return std::vector::data(); - } - - /** - * Get the pointer to the first item - * - * @return the pointer to the first item - */ - inline T *Begin() - { - return std::vector::data(); - } - - /** - * Get the pointer behind the last valid item (const) - * - * @return the pointer behind the last valid item - */ - inline const T *End() const - { - return std::vector::data() + std::vector::size(); - } - - /** - * Get the pointer behind the last valid item - * - * @return the pointer behind the last valid item - */ - inline T *End() - { - return std::vector::data() + std::vector::size(); - } }; /** diff --git a/src/economy.cpp b/src/economy.cpp index 1f17612f7d..cab605f9af 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1945,9 +1945,8 @@ void LoadUnloadStation(Station *st) } /* Call the production machinery of industries */ - const Industry * const *isend = _cargo_delivery_destinations.End(); - for (Industry **iid = _cargo_delivery_destinations.Begin(); iid != isend; iid++) { - TriggerIndustryProduction(*iid); + for (Industry *iid : _cargo_delivery_destinations) { + TriggerIndustryProduction(iid); } _cargo_delivery_destinations.clear(); } diff --git a/src/engine.cpp b/src/engine.cpp index 7412ec639c..044faa5713 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -511,12 +511,12 @@ void EngineOverrideManager::ResetToDefaultMapping() */ EngineID EngineOverrideManager::GetID(VehicleType type, uint16 grf_local_id, uint32 grfid) { - const EngineIDMapping *end = this->End(); EngineID index = 0; - for (const EngineIDMapping *eid = this->Begin(); eid != end; eid++, index++) { - if (eid->type == type && eid->grfid == grfid && eid->internal_id == grf_local_id) { + for (const EngineIDMapping &eid : *this) { + if (eid.type == type && eid.grfid == grfid && eid.internal_id == grf_local_id) { return index; } + index++; } return INVALID_ENGINE; } @@ -549,14 +549,14 @@ void SetupEngines() _engine_pool.CleanPool(); assert(_engine_mngr.size() >= _engine_mngr.NUM_DEFAULT_ENGINES); - const EngineIDMapping *end = _engine_mngr.End(); uint index = 0; - for (const EngineIDMapping *eid = _engine_mngr.Begin(); eid != end; eid++, index++) { + for (const EngineIDMapping &eid : _engine_mngr) { /* Assert is safe; there won't be more than 256 original vehicles * in any case, and we just cleaned the pool. */ assert(Engine::CanAllocateItem()); - const Engine *e = new Engine(eid->type, eid->internal_id); + const Engine *e = new Engine(eid.type, eid.internal_id); assert(e->index == index); + index++; } } diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index caf264e3d1..2c2440baf9 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -329,7 +329,7 @@ void EngList_Sort(GUIEngineList *el, EngList_SortTypeFunction compare) /* out-of-bounds access at the next line for size == 0 (even with operator[] at some systems) * generally, do not sort if there are less than 2 items */ if (size < 2) return; - QSortT(el->Begin(), size, compare); + QSortT(el->data(), size, compare); } /** diff --git a/src/fios.cpp b/src/fios.cpp index 6acb2d891e..c27e6d8afd 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -380,7 +380,7 @@ static void FiosGetFileList(SaveLoadOperation fop, fios_getlist_callback_proc *c { SortingBits order = _savegame_sort_order; _savegame_sort_order = SORT_BY_NAME | SORT_ASCENDING; - QSortT(file_list.files.Begin(), file_list.files.size(), CompareFiosItems); + QSortT(file_list.files.data(), file_list.files.size(), CompareFiosItems); _savegame_sort_order = order; } @@ -724,10 +724,10 @@ const char *FindScenario(const ContentInfo *ci, bool md5sum) { _scanner.Scan(false); - for (ScenarioIdentifier *id = _scanner.Begin(); id != _scanner.End(); id++) { - if (md5sum ? (memcmp(id->md5sum, ci->md5sum, sizeof(id->md5sum)) == 0) - : (id->scenid == ci->unique_id)) { - return id->filename; + for (ScenarioIdentifier &id : _scanner) { + if (md5sum ? (memcmp(id.md5sum, ci->md5sum, sizeof(id.md5sum)) == 0) + : (id.scenid == ci->unique_id)) { + return id.filename; } } diff --git a/src/fios.h b/src/fios.h index b1d260f841..cc69178137 100644 --- a/src/fios.h +++ b/src/fios.h @@ -139,7 +139,7 @@ public: */ inline const FiosItem *Begin() const { - return this->files.Begin(); + return this->files.data(); } /** @@ -148,7 +148,7 @@ public: */ inline const FiosItem *End() const { - return this->files.End(); + return this->Begin() + this->Length(); } /** diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index 49c1deac37..b5bcee5e8c 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -57,9 +57,8 @@ void LoadCheckData::Clear() this->current_date = 0; memset(&this->settings, 0, sizeof(this->settings)); - const CompanyPropertiesMap::iterator end = this->companies.End(); - for (CompanyPropertiesMap::iterator it = this->companies.Begin(); it != end; it++) { - delete it->second; + for (auto &pair : this->companies) { + delete pair.second; } companies.clear(); @@ -531,10 +530,9 @@ public: if (y > y_max) break; /* Companies / AIs */ - CompanyPropertiesMap::const_iterator end = _load_check_data.companies.End(); - for (CompanyPropertiesMap::const_iterator it = _load_check_data.companies.Begin(); it != end; it++) { - SetDParam(0, it->first + 1); - const CompanyProperties &c = *it->second; + for (auto &pair : _load_check_data.companies) { + SetDParam(0, pair.first + 1); + const CompanyProperties &c = *pair.second; if (c.name != NULL) { SetDParam(1, STR_JUST_RAW_STRING); SetDParamStr(2, c.name); diff --git a/src/fontcache.cpp b/src/fontcache.cpp index 2811f17989..82a441814f 100644 --- a/src/fontcache.cpp +++ b/src/fontcache.cpp @@ -411,8 +411,8 @@ FreeTypeFontCache::~FreeTypeFontCache() this->face = NULL; this->ClearFontCache(); - for (FontTable::iterator iter = this->font_tables.Begin(); iter != this->font_tables.End(); iter++) { - free(iter->second.second); + for (auto &iter : this->font_tables) { + free(iter.second.second); } } @@ -633,7 +633,7 @@ GlyphID FreeTypeFontCache::MapCharToGlyph(WChar key) const void *FreeTypeFontCache::GetFontTable(uint32 tag, size_t &length) { const FontTable::iterator iter = this->font_tables.Find(tag); - if (iter != this->font_tables.End()) { + if (iter != this->font_tables.data() + this->font_tables.size()) { length = iter->second.first; return iter->second.second; } diff --git a/src/game/game_text.cpp b/src/game/game_text.cpp index 4d67b69553..d57b2bc77f 100644 --- a/src/game/game_text.cpp +++ b/src/game/game_text.cpp @@ -147,7 +147,7 @@ struct StringListReader : StringReader { * @param translation Are we reading a translation? */ StringListReader(StringData &data, const LanguageStrings *strings, bool master, bool translation) : - StringReader(data, strings->language, master, translation), p(strings->lines.Begin()), end(strings->lines.End()) + StringReader(data, strings->language, master, translation), p(strings->lines.data()), end(p + strings->lines.size()) { } @@ -318,13 +318,13 @@ void GameStrings::Compile() StringNameWriter id_writer(&this->string_names); id_writer.WriteHeader(data); - for (LanguageStrings **p = this->raw_strings.Begin(); p != this->raw_strings.End(); p++) { + for (LanguageStrings *p : this->raw_strings) { data.FreeTranslation(); - StringListReader translation_reader(data, *p, false, strcmp((*p)->language, "english") != 0); + StringListReader translation_reader(data, p, false, strcmp(p->language, "english") != 0); translation_reader.ParseFile(); if (_errors != 0) throw std::exception(); - this->compiled_strings.push_back(new LanguageStrings((*p)->language)); + this->compiled_strings.push_back(new LanguageStrings(p->language)); TranslationWriter writer(&this->compiled_strings.back()->lines); writer.WriteLang(data); } @@ -360,10 +360,11 @@ void RegisterGameTranslation(Squirrel *engine) if (SQ_FAILED(sq_get(vm, -2))) return; int idx = 0; - for (const char * const *p = _current_data->string_names.Begin(); p != _current_data->string_names.End(); p++, idx++) { - sq_pushstring(vm, *p, -1); + for (const char * const p : _current_data->string_names) { + sq_pushstring(vm, p, -1); sq_pushinteger(vm, idx); sq_rawset(vm, -3); + idx++; } sq_pop(vm, 2); @@ -391,9 +392,9 @@ void ReconsiderGameScriptLanguage() assert(language != NULL); language++; - for (LanguageStrings **p = _current_data->compiled_strings.Begin(); p != _current_data->compiled_strings.End(); p++) { - if (strcmp((*p)->language, language) == 0) { - _current_data->cur_language = *p; + for (LanguageStrings *p : _current_data->compiled_strings) { + if (strcmp(p->language, language) == 0) { + _current_data->cur_language = p; return; } } diff --git a/src/gfx.cpp b/src/gfx.cpp index dad675772a..df3e5ccb6b 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -511,7 +511,7 @@ int DrawString(int left, int right, int top, const char *str, TextColour colour, Layouter layout(str, INT32_MAX, colour, fontsize); if (layout.size() == 0) return 0; - return DrawLayoutLine(*layout.Begin(), top, left, right, align, underline, true); + return DrawLayoutLine(layout.front(), top, left, right, align, underline, true); } /** @@ -647,8 +647,7 @@ int DrawStringMultiLine(int left, int right, int top, int bottom, const char *st int last_line = top; int first_line = bottom; - for (const ParagraphLayouter::Line **iter = layout.Begin(); iter != layout.End(); iter++) { - const ParagraphLayouter::Line *line = *iter; + for (const ParagraphLayouter::Line *line : layout) { int line_height = line->GetLeading(); if (y >= top && y < bottom) { diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index ee0ba15332..6d4759cfbd 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -196,13 +196,13 @@ public: /* ICU's ParagraphLayout cannot handle empty strings, so fake one. */ buff[0] = ' '; length = 1; - fontMapping.End()[-1].first++; + fontMapping.back().first++; } /* Fill ICU's FontRuns with the right data. */ icu::FontRuns runs(fontMapping.size()); - for (FontMap::iterator iter = fontMapping.Begin(); iter != fontMapping.End(); iter++) { - runs.add(iter->second, iter->first); + for (auto &pair : fontMapping) { + runs.add(pair.second, pair.first); } LEErrorCode status = LE_NO_ERROR; @@ -419,8 +419,8 @@ int FallbackParagraphLayout::FallbackVisualRun::GetLeading() const int FallbackParagraphLayout::FallbackLine::GetLeading() const { int leading = 0; - for (const FallbackVisualRun * const *run = this->Begin(); run != this->End(); run++) { - leading = max(leading, (*run)->GetLeading()); + for (const FallbackVisualRun * const &run : *this) { + leading = max(leading, run->GetLeading()); } return leading; @@ -498,12 +498,12 @@ const ParagraphLayouter::Line *FallbackParagraphLayout::NextLine(int max_width) if (*this->buffer == '\0') { /* Only a newline. */ this->buffer = NULL; - l->push_back(new FallbackVisualRun(this->runs.Begin()->second, this->buffer, 0, 0)); + l->push_back(new FallbackVisualRun(this->runs.front().second, this->buffer, 0, 0)); return l; } int offset = this->buffer - this->buffer_begin; - FontMap::iterator iter = this->runs.Begin(); + FontMap::iterator iter = this->runs.data(); while (iter->first <= offset) { iter++; assert(iter != this->runs.End()); @@ -733,9 +733,9 @@ Layouter::Layouter(const char *str, int maxw, TextColour colour, FontSize fontsi Dimension Layouter::GetBounds() { Dimension d = { 0, 0 }; - for (const ParagraphLayouter::Line **l = this->Begin(); l != this->End(); l++) { - d.width = max(d.width, (*l)->GetWidth()); - d.height += (*l)->GetLeading(); + for (const ParagraphLayouter::Line *l : *this) { + d.width = max(d.width, l->GetWidth()); + d.height += l->GetLeading(); } return d; } @@ -757,12 +757,12 @@ Point Layouter::GetCharPosition(const char *ch) const size_t len = Utf8Decode(&c, str); if (c == '\0' || c == '\n') break; str += len; - index += (*this->Begin())->GetInternalCharLength(c); + index += this->front()->GetInternalCharLength(c); } if (str == ch) { /* Valid character. */ - const ParagraphLayouter::Line *line = *this->Begin(); + const ParagraphLayouter::Line *line = this->front(); /* Pointer to the end-of-string/line marker? Return total line width. */ if (*ch == '\0' || *ch == '\n') { @@ -795,7 +795,7 @@ Point Layouter::GetCharPosition(const char *ch) const */ const char *Layouter::GetCharAtPosition(int x) const { - const ParagraphLayouter::Line *line = *this->Begin(); + const ParagraphLayouter::Line *line = this->front(); for (int run_index = 0; run_index < line->CountRuns(); run_index++) { const ParagraphLayouter::VisualRun *run = line->GetVisualRun(run_index); @@ -844,8 +844,8 @@ Font *Layouter::GetFont(FontSize size, TextColour colour) */ void Layouter::ResetFontCache(FontSize size) { - for (FontColourMap::iterator it = fonts[size].Begin(); it != fonts[size].End(); ++it) { - delete it->second; + for (auto &pair : fonts[size]) { + delete pair.second; } fonts[size].clear(); diff --git a/src/group_gui.cpp b/src/group_gui.cpp index eb7aac0b71..59b5112ff1 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -127,11 +127,11 @@ private: void AddChildren(GUIGroupList *source, GroupID parent, int indent) { - for (const Group **g = source->Begin(); g != source->End(); g++) { - if ((*g)->parent != parent) continue; - this->groups.push_back(*g); + for (const Group *g : *source) { + if (g->parent != parent) continue; + this->groups.push_back(g); this->indents.push_back(indent); - AddChildren(source, (*g)->index, indent + 1); + AddChildren(source, g->index, indent + 1); } } diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp index 39cf4c0a1a..0acc11c473 100644 --- a/src/hotkeys.cpp +++ b/src/hotkeys.cpp @@ -316,11 +316,11 @@ static void SaveLoadHotkeys(bool save) IniFile *ini = new IniFile(); ini->LoadFromDisk(_hotkeys_file, NO_DIRECTORY); - for (HotkeyList **list = _hotkey_lists->Begin(); list != _hotkey_lists->End(); ++list) { + for (HotkeyList *list : *_hotkey_lists) { if (save) { - (*list)->Save(ini); + list->Save(ini); } else { - (*list)->Load(ini); + list->Load(ini); } } @@ -343,11 +343,11 @@ void SaveHotkeysToConfig() void HandleGlobalHotkeys(WChar key, uint16 keycode) { - for (HotkeyList **list = _hotkey_lists->Begin(); list != _hotkey_lists->End(); ++list) { - if ((*list)->global_hotkey_handler == NULL) continue; + for (HotkeyList *list : *_hotkey_lists) { + if (list->global_hotkey_handler == NULL) continue; - int hotkey = (*list)->CheckMatch(keycode, true); - if (hotkey >= 0 && ((*list)->global_hotkey_handler(hotkey) == ES_HANDLED)) return; + int hotkey = list->CheckMatch(keycode, true); + if (hotkey >= 0 && (list->global_hotkey_handler(hotkey) == ES_HANDLED)) return; } } diff --git a/src/music/dmusic.cpp b/src/music/dmusic.cpp index a03a6ec57e..241ab191bf 100644 --- a/src/music/dmusic.cpp +++ b/src/music/dmusic.cpp @@ -751,7 +751,7 @@ static void MidiThreadProc(void *) block_time = playback_start_time + block.realtime * MIDITIME_TO_REFTIME; DEBUG(driver, 9, "DMusic thread: Streaming block " PRINTF_SIZE " (cur=" OTTD_PRINTF64 ", block=" OTTD_PRINTF64 ")", current_block, (long long)(current_time / MS_TO_REFTIME), (long long)(block_time / MS_TO_REFTIME)); - byte *data = block.data.Begin(); + byte *data = block.data.data(); size_t remaining = block.data.size(); byte last_status = 0; while (remaining > 0) { diff --git a/src/music/midifile.cpp b/src/music/midifile.cpp index 82649679fa..97fb2edf80 100644 --- a/src/music/midifile.cpp +++ b/src/music/midifile.cpp @@ -336,7 +336,7 @@ static bool FixupMidiData(MidiFile &target) last_ticktime = block.ticktime; } else { byte *datadest = grow(merged_blocks.back().data, block.data.size()); - memcpy(datadest, block.data.Begin(), block.data.size()); + memcpy(datadest, block.data.data(), block.data.size()); } } std::swap(merged_blocks, target.blocks); @@ -940,8 +940,8 @@ bool MidiFile::WriteSMF(const char *filename) } /* Write each block data command */ - byte *dp = block.data.Begin(); - while (dp < block.data.End()) { + byte *dp = block.data.data(); + while (dp < block.data.data() + block.data.size()) { /* Always zero delta time inside blocks */ if (needtime) { fputc(0, f); diff --git a/src/music/win32_m.cpp b/src/music/win32_m.cpp index 6d88af4a3c..18a3bce3e7 100644 --- a/src/music/win32_m.cpp +++ b/src/music/win32_m.cpp @@ -229,7 +229,7 @@ void CALLBACK TimerCallback(UINT uTimerID, UINT, DWORD_PTR dwUser, DWORD_PTR, DW break; } - byte *data = block.data.Begin(); + byte *data = block.data.data(); size_t remaining = block.data.size(); byte last_status = 0; while (remaining > 0) { diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp index b1ed71e926..35c7ce8ae8 100644 --- a/src/network/core/host.cpp +++ b/src/network/core/host.cpp @@ -200,8 +200,8 @@ void NetworkFindBroadcastIPs(NetworkAddressList *broadcast) /* Now display to the debug all the detected ips */ DEBUG(net, 3, "Detected broadcast addresses:"); int i = 0; - for (NetworkAddress *addr = broadcast->Begin(); addr != broadcast->End(); addr++) { - addr->SetPort(NETWORK_DEFAULT_PORT); - DEBUG(net, 3, "%d) %s", i++, addr->GetHostname()); + for (NetworkAddress &addr : *broadcast) { + addr.SetPort(NETWORK_DEFAULT_PORT); + DEBUG(net, 3, "%d) %s", i++, addr.GetHostname()); } } diff --git a/src/network/core/tcp_connect.cpp b/src/network/core/tcp_connect.cpp index f3dc2cb9aa..d699cf60d0 100644 --- a/src/network/core/tcp_connect.cpp +++ b/src/network/core/tcp_connect.cpp @@ -93,5 +93,5 @@ void TCPConnecter::Connect() /** Kill all connection attempts. */ /* static */ void TCPConnecter::KillAll() { - for (TCPConnecter **iter = _tcp_connecters.Begin(); iter != _tcp_connecters.End(); iter++) (*iter)->killed = true; + for (TCPConnecter *conn : _tcp_connecters) conn->killed = true; } diff --git a/src/network/core/tcp_http.cpp b/src/network/core/tcp_http.cpp index abec3fbc87..cec77fb147 100644 --- a/src/network/core/tcp_http.cpp +++ b/src/network/core/tcp_http.cpp @@ -303,8 +303,8 @@ int NetworkHTTPSocketHandler::Receive() struct timeval tv; FD_ZERO(&read_fd); - for (NetworkHTTPSocketHandler **iter = _http_connections.Begin(); iter < _http_connections.End(); iter++) { - FD_SET((*iter)->sock, &read_fd); + for (NetworkHTTPSocketHandler *handler : _http_connections) { + FD_SET(handler->sock, &read_fd); } tv.tv_sec = tv.tv_usec = 0; // don't block at all. diff --git a/src/network/core/tcp_listen.h b/src/network/core/tcp_listen.h index 55594070be..744f8841fd 100644 --- a/src/network/core/tcp_listen.h +++ b/src/network/core/tcp_listen.h @@ -54,13 +54,13 @@ public: /* Check if the client is banned */ bool banned = false; - for (char **iter = _network_ban_list.Begin(); iter != _network_ban_list.End(); iter++) { - banned = address.IsInNetmask(*iter); + for (char *entry : _network_ban_list) { + banned = address.IsInNetmask(entry); if (banned) { Packet p(Tban_packet); p.PrepareToSend(); - DEBUG(net, 1, "[%s] Banned ip tried to join (%s), refused", Tsocket::GetName(), *iter); + DEBUG(net, 1, "[%s] Banned ip tried to join (%s), refused", Tsocket::GetName(), entry); if (send(s, (const char*)p.buffer, p.size, 0) < 0) { DEBUG(net, 0, "send failed with error %d", GET_LAST_ERROR()); @@ -111,16 +111,16 @@ public: } /* take care of listener port */ - for (SocketList::iterator s = sockets.Begin(); s != sockets.End(); s++) { - FD_SET(s->second, &read_fd); + for (auto &s : sockets) { + FD_SET(s.second, &read_fd); } tv.tv_sec = tv.tv_usec = 0; // don't block at all. if (select(FD_SETSIZE, &read_fd, &write_fd, NULL, &tv) < 0) return false; /* accept clients.. */ - for (SocketList::iterator s = sockets.Begin(); s != sockets.End(); s++) { - if (FD_ISSET(s->second, &read_fd)) AcceptClient(s->second); + for (auto &s : sockets) { + if (FD_ISSET(s.second, &read_fd)) AcceptClient(s.second); } /* read stuff from clients */ @@ -145,8 +145,8 @@ public: NetworkAddressList addresses; GetBindAddresses(&addresses, port); - for (NetworkAddress *address = addresses.Begin(); address != addresses.End(); address++) { - address->Listen(SOCK_STREAM, &sockets); + for (NetworkAddress &address : addresses) { + address.Listen(SOCK_STREAM, &sockets); } if (sockets.size() == 0) { @@ -161,8 +161,8 @@ public: /** Close the sockets we're listening on. */ static void CloseListeners() { - for (SocketList::iterator s = sockets.Begin(); s != sockets.End(); s++) { - closesocket(s->second); + for (auto &s : sockets) { + closesocket(s.second); } sockets.clear(); DEBUG(net, 1, "[%s] closed listeners", Tsocket::GetName()); diff --git a/src/network/core/udp.cpp b/src/network/core/udp.cpp index 7babf78d69..70bb0b9f05 100644 --- a/src/network/core/udp.cpp +++ b/src/network/core/udp.cpp @@ -25,8 +25,8 @@ NetworkUDPSocketHandler::NetworkUDPSocketHandler(NetworkAddressList *bind) { if (bind != NULL) { - for (NetworkAddress *addr = bind->Begin(); addr != bind->End(); addr++) { - this->bind.push_back(*addr); + for (NetworkAddress &addr : *bind) { + this->bind.push_back(addr); } } else { /* As hostname NULL and port 0/NULL don't go well when @@ -47,8 +47,8 @@ bool NetworkUDPSocketHandler::Listen() /* Make sure socket is closed */ this->Close(); - for (NetworkAddress *addr = this->bind.Begin(); addr != this->bind.End(); addr++) { - addr->Listen(SOCK_DGRAM, &this->sockets); + for (NetworkAddress &addr : this->bind) { + addr.Listen(SOCK_DGRAM, &this->sockets); } return this->sockets.size() != 0; @@ -59,8 +59,8 @@ bool NetworkUDPSocketHandler::Listen() */ void NetworkUDPSocketHandler::Close() { - for (SocketList::iterator s = this->sockets.Begin(); s != this->sockets.End(); s++) { - closesocket(s->second); + for (auto &s : this->sockets) { + closesocket(s.second); } this->sockets.clear(); } @@ -82,26 +82,26 @@ void NetworkUDPSocketHandler::SendPacket(Packet *p, NetworkAddress *recv, bool a { if (this->sockets.size() == 0) this->Listen(); - for (SocketList::iterator s = this->sockets.Begin(); s != this->sockets.End(); s++) { + for (auto &s : this->sockets) { /* Make a local copy because if we resolve it we cannot * easily unresolve it so we can resolve it later again. */ NetworkAddress send(*recv); /* Not the same type */ - if (!send.IsFamily(s->first.GetAddress()->ss_family)) continue; + if (!send.IsFamily(s.first.GetAddress()->ss_family)) continue; p->PrepareToSend(); if (broadcast) { /* Enable broadcast */ unsigned long val = 1; - if (setsockopt(s->second, SOL_SOCKET, SO_BROADCAST, (char *) &val, sizeof(val)) < 0) { + if (setsockopt(s.second, SOL_SOCKET, SO_BROADCAST, (char *) &val, sizeof(val)) < 0) { DEBUG(net, 1, "[udp] setting broadcast failed with: %i", GET_LAST_ERROR()); } } /* Send the buffer */ - int res = sendto(s->second, (const char*)p->buffer, p->size, 0, (const struct sockaddr *)send.GetAddress(), send.GetAddressLength()); + int res = sendto(s.second, (const char*)p->buffer, p->size, 0, (const struct sockaddr *)send.GetAddress(), send.GetAddressLength()); DEBUG(net, 7, "[udp] sendto(%s)", send.GetAddressAsString()); /* Check for any errors, but ignore it otherwise */ @@ -116,7 +116,7 @@ void NetworkUDPSocketHandler::SendPacket(Packet *p, NetworkAddress *recv, bool a */ void NetworkUDPSocketHandler::ReceivePackets() { - for (SocketList::iterator s = this->sockets.Begin(); s != this->sockets.End(); s++) { + for (auto &s : this->sockets) { for (int i = 0; i < 1000; i++) { // Do not infinitely loop when DoSing with UDP struct sockaddr_storage client_addr; memset(&client_addr, 0, sizeof(client_addr)); @@ -125,8 +125,8 @@ void NetworkUDPSocketHandler::ReceivePackets() socklen_t client_len = sizeof(client_addr); /* Try to receive anything */ - SetNonBlocking(s->second); // Some OSes seem to lose the non-blocking status of the socket - int nbytes = recvfrom(s->second, (char*)p.buffer, SEND_MTU, 0, (struct sockaddr *)&client_addr, &client_len); + SetNonBlocking(s.second); // Some OSes seem to lose the non-blocking status of the socket + int nbytes = recvfrom(s.second, (char*)p.buffer, SEND_MTU, 0, (struct sockaddr *)&client_addr, &client_len); /* Did we get the bytes for the base header of the packet? */ if (nbytes <= 0) break; // No data, i.e. no packet diff --git a/src/network/network.cpp b/src/network/network.cpp index 1ddd7478ce..be92623e41 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -632,8 +632,8 @@ void NetworkAddServer(const char *b) */ void GetBindAddresses(NetworkAddressList *addresses, uint16 port) { - for (char **iter = _network_bind_list.Begin(); iter != _network_bind_list.End(); iter++) { - addresses->emplace_back(*iter, port); + for (char *iter : _network_bind_list) { + addresses->emplace_back(iter, port); } /* No address, so bind to everything. */ diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index fff4dd328c..12aa3fc0ad 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -110,7 +110,7 @@ struct PacketReader : LoadFilter { { this->read_bytes = 0; - this->block = this->blocks.Begin(); + this->block = this->blocks.data(); this->buf = *this->block++; this->bufe = this->buf + CHUNK; } diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index 617a2bc6b6..003ffdb8ba 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -137,8 +137,7 @@ bool ClientNetworkContentSocketHandler::Receive_SERVER_INFO(Packet *p) if (ci->state == ContentInfo::UNSELECTED && ci->filesize == 0) ci->state = ContentInfo::DOES_NOT_EXIST; /* Do we already have a stub for this? */ - for (ContentIterator iter = this->infos.Begin(); iter != this->infos.End(); iter++) { - ContentInfo *ici = *iter; + for (ContentInfo *ici : this->infos) { if (ici->type == ci->type && ici->unique_id == ci->unique_id && memcmp(ci->md5sum, ici->md5sum, sizeof(ci->md5sum)) == 0) { /* Preserve the name if possible */ @@ -168,8 +167,8 @@ bool ClientNetworkContentSocketHandler::Receive_SERVER_INFO(Packet *p) this->infos.push_back(ci); /* Incoming data means that we might need to reconsider dependencies */ - for (ContentIterator iter = this->infos.Begin(); iter != this->infos.End(); iter++) { - this->CheckDependencyState(*iter); + for (ContentInfo *ici : this->infos) { + this->CheckDependencyState(ici); } this->OnReceiveContentInfo(ci); @@ -253,8 +252,7 @@ void ClientNetworkContentSocketHandler::RequestContentList(ContentVector *cv, bo Packet *p = new Packet(send_md5sum ? PACKET_CONTENT_CLIENT_INFO_EXTID_MD5 : PACKET_CONTENT_CLIENT_INFO_EXTID); p->Send_uint8(cv->size()); - for (ContentIterator iter = cv->Begin(); iter != cv->End(); iter++) { - const ContentInfo *ci = *iter; + for (const ContentInfo *ci : *cv) { p->Send_uint8((byte)ci->type); p->Send_uint32(ci->unique_id); if (!send_md5sum) continue; @@ -266,11 +264,9 @@ void ClientNetworkContentSocketHandler::RequestContentList(ContentVector *cv, bo this->SendPacket(p); - for (ContentIterator iter = cv->Begin(); iter != cv->End(); iter++) { - ContentInfo *ci = *iter; + for (ContentInfo *ci : *cv) { bool found = false; - for (ContentIterator iter2 = this->infos.Begin(); iter2 != this->infos.End(); iter2++) { - ContentInfo *ci2 = *iter2; + for (ContentInfo *ci2 : this->infos) { if (ci->type == ci2->type && ci->unique_id == ci2->unique_id && (!send_md5sum || memcmp(ci->md5sum, ci2->md5sum, sizeof(ci->md5sum)) == 0)) { found = true; @@ -296,8 +292,7 @@ void ClientNetworkContentSocketHandler::DownloadSelectedContent(uint &files, uin bytes = 0; ContentIDList content; - for (ContentIterator iter = this->infos.Begin(); iter != this->infos.End(); iter++) { - const ContentInfo *ci = *iter; + for (const ContentInfo *ci : this->infos) { if (!ci->IsSelected() || ci->state == ContentInfo::ALREADY_HERE) continue; content.push_back(ci->id); @@ -333,8 +328,8 @@ void ClientNetworkContentSocketHandler::DownloadSelectedContentHTTP(const Conten const char *lastof = content_request + bytes - 1; char *p = content_request; - for (const ContentID *id = content.Begin(); id != content.End(); id++) { - p += seprintf(p, lastof, "%d\n", *id); + for (const ContentID &id : content) { + p += seprintf(p, lastof, "%d\n", id); } this->http_response_index = -1; @@ -351,7 +346,7 @@ void ClientNetworkContentSocketHandler::DownloadSelectedContentHTTP(const Conten void ClientNetworkContentSocketHandler::DownloadSelectedContentFallback(const ContentIDList &content) { uint count = content.size(); - const ContentID *content_ids = content.Begin(); + const ContentID *content_ids = content.data(); this->Connect(); while (count > 0) { @@ -626,7 +621,7 @@ void ClientNetworkContentSocketHandler::OnReceiveData(const char *data, size_t l #define check_and_terminate(p) { check_not_null(p); *(p) = '\0'; } for (;;) { - char *str = this->http_response.Begin() + this->http_response_index; + char *str = this->http_response.data() + this->http_response_index; char *p = strchr(str, '\n'); check_and_terminate(p); @@ -713,7 +708,7 @@ ClientNetworkContentSocketHandler::~ClientNetworkContentSocketHandler() delete this->curInfo; if (this->curFile != NULL) fclose(this->curFile); - for (ContentIterator iter = this->infos.Begin(); iter != this->infos.End(); iter++) delete *iter; + for (ContentInfo *ci : this->infos) delete ci; } /** Connect to the content server. */ @@ -807,8 +802,7 @@ void ClientNetworkContentSocketHandler::DownloadContentInfo(ContentID cid) */ ContentInfo *ClientNetworkContentSocketHandler::GetContent(ContentID cid) { - for (ContentIterator iter = this->infos.Begin(); iter != this->infos.End(); iter++) { - ContentInfo *ci = *iter; + for (ContentInfo *ci : this->infos) { if (ci->id == cid) return ci; } return NULL; @@ -844,8 +838,7 @@ void ClientNetworkContentSocketHandler::Unselect(ContentID cid) /** Select everything we can select */ void ClientNetworkContentSocketHandler::SelectAll() { - for (ContentIterator iter = this->infos.Begin(); iter != this->infos.End(); iter++) { - ContentInfo *ci = *iter; + for (ContentInfo *ci : this->infos) { if (ci->state == ContentInfo::UNSELECTED) { ci->state = ContentInfo::SELECTED; this->CheckDependencyState(ci); @@ -856,8 +849,7 @@ void ClientNetworkContentSocketHandler::SelectAll() /** Select everything that's an update for something we've got */ void ClientNetworkContentSocketHandler::SelectUpgrade() { - for (ContentIterator iter = this->infos.Begin(); iter != this->infos.End(); iter++) { - ContentInfo *ci = *iter; + for (ContentInfo *ci : this->infos) { if (ci->state == ContentInfo::UNSELECTED && ci->upgrade) { ci->state = ContentInfo::SELECTED; this->CheckDependencyState(ci); @@ -868,8 +860,7 @@ void ClientNetworkContentSocketHandler::SelectUpgrade() /** Unselect everything that we've not downloaded so far. */ void ClientNetworkContentSocketHandler::UnselectAll() { - for (ContentIterator iter = this->infos.Begin(); iter != this->infos.End(); iter++) { - ContentInfo *ci = *iter; + for (ContentInfo *ci : this->infos) { if (ci->IsSelected() && ci->state != ContentInfo::ALREADY_HERE) ci->state = ContentInfo::UNSELECTED; } } @@ -899,8 +890,7 @@ void ClientNetworkContentSocketHandler::ToggleSelectedState(const ContentInfo *c */ void ClientNetworkContentSocketHandler::ReverseLookupDependency(ConstContentVector &parents, const ContentInfo *child) const { - for (ConstContentIterator iter = this->infos.Begin(); iter != this->infos.End(); iter++) { - const ContentInfo *ci = *iter; + for (const ContentInfo * const &ci : this->infos) { if (ci == child) continue; for (uint i = 0; i < ci->dependency_count; i++) { @@ -929,8 +919,8 @@ void ClientNetworkContentSocketHandler::ReverseLookupTreeDependency(ConstContent ConstContentVector parents; this->ReverseLookupDependency(parents, tree[i]); - for (ConstContentIterator piter = parents.Begin(); piter != parents.End(); piter++) { - include(tree, *piter); + for (const ContentInfo *ci : parents) { + include(tree, ci); } } } @@ -965,8 +955,7 @@ void ClientNetworkContentSocketHandler::CheckDependencyState(ContentInfo *ci) * we automatically selected them. */ ConstContentVector parents; this->ReverseLookupDependency(parents, ci); - for (ConstContentIterator iter = parents.Begin(); iter != parents.End(); iter++) { - const ContentInfo *c = *iter; + for (const ContentInfo *c : parents) { if (!c->IsSelected()) continue; this->Unselect(c->id); @@ -987,9 +976,9 @@ void ClientNetworkContentSocketHandler::CheckDependencyState(ContentInfo *ci) /* First check whether anything depends on us */ int sel_count = 0; bool force_selection = false; - for (ConstContentIterator iter = parents.Begin(); iter != parents.End(); iter++) { - if ((*iter)->IsSelected()) sel_count++; - if ((*iter)->state == ContentInfo::SELECTED) force_selection = true; + for (const ContentInfo *ci : parents) { + if (ci->IsSelected()) sel_count++; + if (ci->state == ContentInfo::SELECTED) force_selection = true; } if (sel_count == 0) { /* Nothing depends on us */ @@ -1004,8 +993,8 @@ void ClientNetworkContentSocketHandler::CheckDependencyState(ContentInfo *ci) this->ReverseLookupTreeDependency(parents, c); /* Is there anything that is "force" selected?, if so... we're done. */ - for (ConstContentIterator iter = parents.Begin(); iter != parents.End(); iter++) { - if ((*iter)->state != ContentInfo::SELECTED) continue; + for (const ContentInfo *ci : parents) { + if (ci->state != ContentInfo::SELECTED) continue; force_selection = true; break; @@ -1018,12 +1007,11 @@ void ClientNetworkContentSocketHandler::CheckDependencyState(ContentInfo *ci) * After that's done run over them once again to test their children * to unselect. Don't do it immediately because it'll do exactly what * we're doing now. */ - for (ConstContentIterator iter = parents.Begin(); iter != parents.End(); iter++) { - const ContentInfo *c = *iter; + for (const ContentInfo *c : parents) { if (c->state == ContentInfo::AUTOSELECTED) this->Unselect(c->id); } - for (ConstContentIterator iter = parents.Begin(); iter != parents.End(); iter++) { - this->CheckDependencyState(this->GetContent((*iter)->id)); + for (const ContentInfo *c : parents) { + this->CheckDependencyState(this->GetContent(c->id)); } } } @@ -1031,7 +1019,7 @@ void ClientNetworkContentSocketHandler::CheckDependencyState(ContentInfo *ci) /** Clear all downloaded content information. */ void ClientNetworkContentSocketHandler::Clear() { - for (ContentIterator iter = this->infos.Begin(); iter != this->infos.End(); iter++) delete *iter; + for (ContentInfo *c : this->infos) delete c; this->infos.clear(); this->requested.clear(); @@ -1041,37 +1029,37 @@ void ClientNetworkContentSocketHandler::Clear() void ClientNetworkContentSocketHandler::OnConnect(bool success) { - for (ContentCallback **iter = this->callbacks.Begin(); iter != this->callbacks.End(); /* nothing */) { + for (auto iter = this->callbacks.begin(); iter != this->callbacks.end(); /* nothing */) { ContentCallback *cb = *iter; cb->OnConnect(success); - if (iter != this->callbacks.End() && *iter == cb) iter++; + if (iter != this->callbacks.end() && *iter == cb) iter++; } } void ClientNetworkContentSocketHandler::OnDisconnect() { - for (ContentCallback **iter = this->callbacks.Begin(); iter != this->callbacks.End(); /* nothing */) { + for (auto iter = this->callbacks.begin(); iter != this->callbacks.end(); /* nothing */) { ContentCallback *cb = *iter; cb->OnDisconnect(); - if (iter != this->callbacks.End() && *iter == cb) iter++; + if (iter != this->callbacks.end() && *iter == cb) iter++; } } void ClientNetworkContentSocketHandler::OnReceiveContentInfo(const ContentInfo *ci) { - for (ContentCallback **iter = this->callbacks.Begin(); iter != this->callbacks.End(); /* nothing */) { + for (auto iter = this->callbacks.begin(); iter != this->callbacks.end(); /* nothing */) { ContentCallback *cb = *iter; cb->OnReceiveContentInfo(ci); - if (iter != this->callbacks.End() && *iter == cb) iter++; + if (iter != this->callbacks.end() && *iter == cb) iter++; } } void ClientNetworkContentSocketHandler::OnDownloadProgress(const ContentInfo *ci, int bytes) { - for (ContentCallback **iter = this->callbacks.Begin(); iter != this->callbacks.End(); /* nothing */) { + for (auto iter = this->callbacks.begin(); iter != this->callbacks.end(); /* nothing */) { ContentCallback *cb = *iter; cb->OnDownloadProgress(ci, bytes); - if (iter != this->callbacks.End() && *iter == cb) iter++; + if (iter != this->callbacks.end() && *iter == cb) iter++; } } @@ -1082,9 +1070,9 @@ void ClientNetworkContentSocketHandler::OnDownloadComplete(ContentID cid) ci->state = ContentInfo::ALREADY_HERE; } - for (ContentCallback **iter = this->callbacks.Begin(); iter != this->callbacks.End(); /* nothing */) { + for (auto iter = this->callbacks.begin(); iter != this->callbacks.end(); /* nothing */) { ContentCallback *cb = *iter; cb->OnDownloadComplete(cid); - if (iter != this->callbacks.End() && *iter == cb) iter++; + if (iter != this->callbacks.end() && *iter == cb) iter++; } } diff --git a/src/network/network_content.h b/src/network/network_content.h index 08e7755aae..26300c4ca2 100644 --- a/src/network/network_content.h +++ b/src/network/network_content.h @@ -131,11 +131,11 @@ public: /** Get the number of content items we know locally. */ uint Length() const { return this->infos.size(); } /** Get the begin of the content inf iterator. */ - ConstContentIterator Begin() const { return this->infos.Begin(); } + ConstContentIterator Begin() const { return this->infos.data(); } /** Get the nth position of the content inf iterator. */ ConstContentIterator Get(uint32 index) const { return this->infos.data() + index; } /** Get the end of the content inf iterator. */ - ConstContentIterator End() const { return this->infos.End(); } + ConstContentIterator End() const { return this->Begin() + this->Length(); } void Clear(); diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 8e3ec9686a..9ea56d7471 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -176,8 +176,8 @@ public: ~NetworkContentDownloadStatusWindow() { TarScanner::Mode mode = TarScanner::NONE; - for (ContentType *iter = this->receivedTypes.Begin(); iter != this->receivedTypes.End(); iter++) { - switch (*iter) { + for (auto ctype : this->receivedTypes) { + switch (ctype) { case CONTENT_TYPE_AI: case CONTENT_TYPE_AI_LIBRARY: /* AI::Rescan calls the scanner. */ @@ -210,8 +210,8 @@ public: TarScanner::DoScan(mode); /* Tell all the backends about what we've downloaded */ - for (ContentType *iter = this->receivedTypes.Begin(); iter != this->receivedTypes.End(); iter++) { - switch (*iter) { + for (auto ctype : this->receivedTypes) { + switch (ctype) { case CONTENT_TYPE_AI: case CONTENT_TYPE_AI_LIBRARY: AI::Rescan(); @@ -333,8 +333,7 @@ class NetworkContentListWindow : public Window, ContentCallback { pos = strecpy(pos, "do=searchgrfid&q=", last); bool first = true; - for (ConstContentIterator iter = this->content.Begin(); iter != this->content.End(); iter++) { - const ContentInfo *ci = *iter; + for (const ContentInfo *ci : this->content) { if (ci->state != ContentInfo::DOES_NOT_EXIST) continue; if (!first) pos = strecpy(pos, ",", last); @@ -635,8 +634,13 @@ public: int sprite_y_offset = WD_MATRIX_TOP + (line_height - this->checkbox_size.height) / 2 - 1; int text_y_offset = WD_MATRIX_TOP + (line_height - FONT_HEIGHT_NORMAL) / 2; uint y = r.top; - int cnt = 0; - for (ConstContentIterator iter = this->content.data() + this->vscroll->GetPosition(); iter != this->content.End() && cnt < this->vscroll->GetCapacity(); iter++, cnt++) { + + auto iter = this->content.begin() + this->vscroll->GetPosition(); + auto end = iter + this->vscroll->GetCapacity(); + if (end > this->content.end()) + end = this->content.end(); + + for (/**/; iter != end; iter++) { const ContentInfo *ci = *iter; if (ci == this->selected) GfxFillRect(r.left + 1, y + 1, r.right - 1, y + this->resize.step_height - 1, PC_GREY); @@ -761,8 +765,7 @@ public: char buf[DRAW_STRING_BUFFER] = ""; char *p = buf; - for (ConstContentIterator iter = tree.Begin(); iter != tree.End(); iter++) { - const ContentInfo *ci = *iter; + for (const ContentInfo *ci : tree) { if (ci == this->selected || ci->state != ContentInfo::SELECTED) continue; p += seprintf(p, lastof(buf), buf == p ? "%s" : ", %s", ci->name); @@ -985,8 +988,7 @@ public: this->filesize_sum = 0; bool show_select_all = false; bool show_select_upgrade = false; - for (ConstContentIterator iter = this->content.Begin(); iter != this->content.End(); iter++) { - const ContentInfo *ci = *iter; + for (const ContentInfo *ci : this->content) { switch (ci->state) { case ContentInfo::SELECTED: case ContentInfo::AUTOSELECTED: @@ -1158,7 +1160,7 @@ void ShowNetworkContentListWindow(ContentVector *cv, ContentType type1, ContentT ShowErrorMessage(STR_CONTENT_NO_ZLIB, STR_CONTENT_NO_ZLIB_SUB, WL_ERROR); /* Connection failed... clean up the mess */ if (cv != NULL) { - for (ContentIterator iter = cv->Begin(); iter != cv->End(); iter++) delete *iter; + for (ContentInfo *ci : *cv) delete ci; } #endif /* WITH_ZLIB */ } diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 7b65f6b0c3..a8dd2aa526 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1045,8 +1045,8 @@ void ShowNetworkGameWindow() if (first) { first = false; /* Add all servers from the config file to our list. */ - for (char **iter = _network_host_list.Begin(); iter != _network_host_list.End(); iter++) { - NetworkAddServer(*iter); + for (char *iter : _network_host_list) { + NetworkAddServer(iter); } } @@ -1783,8 +1783,8 @@ struct NetworkClientListPopupWindow : Window { void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { Dimension d = *size; - for (const ClientListAction *action = this->actions.Begin(); action != this->actions.End(); action++) { - d = maxdim(GetStringBoundingBox(action->name), d); + for (const ClientListAction &action : this->actions) { + d = maxdim(GetStringBoundingBox(action.name), d); } d.height *= this->actions.size(); @@ -1798,7 +1798,7 @@ struct NetworkClientListPopupWindow : Window { /* Draw the actions */ int sel = this->sel_index; int y = r.top + WD_FRAMERECT_TOP; - for (const ClientListAction *action = this->actions.Begin(); action != this->actions.End(); action++, y += FONT_HEIGHT_NORMAL) { + for (const ClientListAction &action : this->actions) { TextColour colour; if (sel-- == 0) { // Selected item, highlight it GfxFillRect(r.left + 1, y, r.right - 1, y + FONT_HEIGHT_NORMAL - 1, PC_BLACK); @@ -1807,7 +1807,8 @@ struct NetworkClientListPopupWindow : Window { colour = TC_BLACK; } - DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, action->name, colour); + DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, action.name, colour); + y += FONT_HEIGHT_NORMAL; } } diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 8a1e75d2f2..36dde0f2cf 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -2095,8 +2095,8 @@ uint NetworkServerKickOrBanIP(const char *ip, bool ban) /* Add address to ban-list */ if (ban) { bool contains = false; - for (char **iter = _network_ban_list.Begin(); iter != _network_ban_list.End(); iter++) { - if (strcmp(*iter, ip) == 0) { + for (char *iter : _network_ban_list) { + if (strcmp(iter, ip) == 0) { contains = true; break; } diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp index b416ee98e3..2d7ee2d3cf 100644 --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -495,12 +495,12 @@ void ClientNetworkUDPSocketHandler::HandleIncomingNetworkGameInfoGRFConfig(GRFCo /** Broadcast to all ips */ static void NetworkUDPBroadCast(NetworkUDPSocketHandler *socket) { - for (NetworkAddress *addr = _broadcast_list.Begin(); addr != _broadcast_list.End(); addr++) { + for (NetworkAddress &addr : _broadcast_list) { Packet p(PACKET_UDP_CLIENT_FIND_SERVER); - DEBUG(net, 4, "[udp] broadcasting to %s", addr->GetHostname()); + DEBUG(net, 4, "[udp] broadcasting to %s", addr.GetHostname()); - socket->SendPacket(&p, addr, true, true); + socket->SendPacket(&p, &addr, true, true); } } diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 36a13aaaa3..8507d9d611 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -391,9 +391,8 @@ void CDECL grfmsg(int severity, const char *str, ...) */ static GRFFile *GetFileByGRFID(uint32 grfid) { - const GRFFile * const *end = _grf_files.End(); - for (GRFFile * const *file = _grf_files.Begin(); file != end; file++) { - if ((*file)->grfid == grfid) return *file; + for (GRFFile * const file : _grf_files) { + if (file->grfid == grfid) return file; } return NULL; } @@ -405,9 +404,8 @@ static GRFFile *GetFileByGRFID(uint32 grfid) */ static GRFFile *GetFileByFilename(const char *filename) { - const GRFFile * const *end = _grf_files.End(); - for (GRFFile * const *file = _grf_files.Begin(); file != end; file++) { - if (strcmp((*file)->filename, filename) == 0) return *file; + for (GRFFile * const file : _grf_files) { + if (strcmp(file->filename, filename) == 0) return file; } return NULL; } @@ -1923,7 +1921,7 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte /* On error, bail out immediately. Temporary GRF data was already freed */ if (_cur.skip_sprites < 0) return CIR_DISABLED; } - dts->Clone(tmp_layout.Begin()); + dts->Clone(tmp_layout.data()); } break; @@ -4826,7 +4824,7 @@ static void NewSpriteGroup(ByteReader *buf) group->num_adjusts = adjusts.size(); group->adjusts = MallocT(group->num_adjusts); - MemCpyT(group->adjusts, adjusts.Begin(), group->num_adjusts); + MemCpyT(group->adjusts, adjusts.data(), group->num_adjusts); std::vector ranges; ranges.resize(buf->ReadByte()); @@ -8094,9 +8092,8 @@ static void InitializeGRFSpecial() /** Reset and clear all NewGRF stations */ static void ResetCustomStations() { - const GRFFile * const *end = _grf_files.End(); - for (GRFFile **file = _grf_files.Begin(); file != end; file++) { - StationSpec **&stations = (*file)->stations; + for (GRFFile * const file : _grf_files) { + StationSpec **&stations = file->stations; if (stations == NULL) continue; for (uint i = 0; i < NUM_STATIONS_PER_GRF; i++) { if (stations[i] == NULL) continue; @@ -8129,9 +8126,8 @@ static void ResetCustomStations() /** Reset and clear all NewGRF houses */ static void ResetCustomHouses() { - const GRFFile * const *end = _grf_files.End(); - for (GRFFile **file = _grf_files.Begin(); file != end; file++) { - HouseSpec **&housespec = (*file)->housespec; + for (GRFFile * const file : _grf_files) { + HouseSpec **&housespec = file->housespec; if (housespec == NULL) continue; for (uint i = 0; i < NUM_HOUSES_PER_GRF; i++) { free(housespec[i]); @@ -8145,9 +8141,8 @@ static void ResetCustomHouses() /** Reset and clear all NewGRF airports */ static void ResetCustomAirports() { - const GRFFile * const *end = _grf_files.End(); - for (GRFFile **file = _grf_files.Begin(); file != end; file++) { - AirportSpec **aslist = (*file)->airportspec; + for (GRFFile * const file : _grf_files) { + AirportSpec **aslist = file->airportspec; if (aslist != NULL) { for (uint i = 0; i < NUM_AIRPORTS_PER_GRF; i++) { AirportSpec *as = aslist[i]; @@ -8166,10 +8161,10 @@ static void ResetCustomAirports() } } free(aslist); - (*file)->airportspec = NULL; + file->airportspec = NULL; } - AirportTileSpec **&airporttilespec = (*file)->airtspec; + AirportTileSpec **&airporttilespec = file->airtspec; if (airporttilespec != NULL) { for (uint i = 0; i < NUM_AIRPORTTILES_PER_GRF; i++) { free(airporttilespec[i]); @@ -8183,10 +8178,9 @@ static void ResetCustomAirports() /** Reset and clear all NewGRF industries */ static void ResetCustomIndustries() { - const GRFFile * const *end = _grf_files.End(); - for (GRFFile **file = _grf_files.Begin(); file != end; file++) { - IndustrySpec **&industryspec = (*file)->industryspec; - IndustryTileSpec **&indtspec = (*file)->indtspec; + for (GRFFile * const file : _grf_files) { + IndustrySpec **&industryspec = file->industryspec; + IndustryTileSpec **&indtspec = file->indtspec; /* We are verifiying both tiles and industries specs loaded from the grf file * First, let's deal with industryspec */ @@ -8223,9 +8217,8 @@ static void ResetCustomIndustries() /** Reset and clear all NewObjects */ static void ResetCustomObjects() { - const GRFFile * const *end = _grf_files.End(); - for (GRFFile **file = _grf_files.Begin(); file != end; file++) { - ObjectSpec **&objectspec = (*file)->objectspec; + for (GRFFile * const file : _grf_files) { + ObjectSpec **&objectspec = file->objectspec; if (objectspec == NULL) continue; for (uint i = 0; i < NUM_OBJECTS_PER_GRF; i++) { free(objectspec[i]); @@ -8239,9 +8232,8 @@ static void ResetCustomObjects() /** Reset and clear all NewGRFs */ static void ResetNewGRF() { - const GRFFile * const *end = _grf_files.End(); - for (GRFFile **file = _grf_files.Begin(); file != end; file++) { - delete *file; + for (GRFFile * const file : _grf_files) { + delete file; } _grf_files.clear(); @@ -8760,9 +8752,8 @@ static void FinaliseHouseArray() * On the other hand, why 1930? Just 'fix' the houses with the lowest * minimum introduction date to 0. */ - const GRFFile * const *end = _grf_files.End(); - for (GRFFile **file = _grf_files.Begin(); file != end; file++) { - HouseSpec **&housespec = (*file)->housespec; + for (GRFFile * const file : _grf_files) { + HouseSpec **&housespec = file->housespec; if (housespec == NULL) continue; for (int i = 0; i < NUM_HOUSES_PER_GRF; i++) { @@ -8774,7 +8765,7 @@ static void FinaliseHouseArray() const HouseSpec *next2 = (i + 2 < NUM_HOUSES_PER_GRF ? housespec[i + 2] : NULL); const HouseSpec *next3 = (i + 3 < NUM_HOUSES_PER_GRF ? housespec[i + 3] : NULL); - if (!IsHouseSpecValid(hs, next1, next2, next3, (*file)->filename)) continue; + if (!IsHouseSpecValid(hs, next1, next2, next3, file->filename)) continue; _house_mngr.SetEntitySpec(hs); } @@ -8823,10 +8814,9 @@ static void FinaliseHouseArray() */ static void FinaliseIndustriesArray() { - const GRFFile * const *end = _grf_files.End(); - for (GRFFile **file = _grf_files.Begin(); file != end; file++) { - IndustrySpec **&industryspec = (*file)->industryspec; - IndustryTileSpec **&indtspec = (*file)->indtspec; + for (GRFFile * const file : _grf_files) { + IndustrySpec **&industryspec = file->industryspec; + IndustryTileSpec **&indtspec = file->indtspec; if (industryspec != NULL) { for (int i = 0; i < NUM_INDUSTRYTYPES_PER_GRF; i++) { IndustrySpec *indsp = industryspec[i]; @@ -8894,9 +8884,8 @@ static void FinaliseIndustriesArray() */ static void FinaliseObjectsArray() { - const GRFFile * const *end = _grf_files.End(); - for (GRFFile **file = _grf_files.Begin(); file != end; file++) { - ObjectSpec **&objectspec = (*file)->objectspec; + for (GRFFile * const file : _grf_files) { + ObjectSpec **&objectspec = file->objectspec; if (objectspec != NULL) { for (int i = 0; i < NUM_OBJECTS_PER_GRF; i++) { if (objectspec[i] != NULL && objectspec[i]->grf_prop.grffile != NULL && objectspec[i]->enabled) { @@ -8914,9 +8903,8 @@ static void FinaliseObjectsArray() */ static void FinaliseAirportsArray() { - const GRFFile * const *end = _grf_files.End(); - for (GRFFile **file = _grf_files.Begin(); file != end; file++) { - AirportSpec **&airportspec = (*file)->airportspec; + for (GRFFile * const file : _grf_files) { + AirportSpec **&airportspec = file->airportspec; if (airportspec != NULL) { for (int i = 0; i < NUM_AIRPORTS_PER_GRF; i++) { if (airportspec[i] != NULL && airportspec[i]->enabled) { @@ -8925,7 +8913,7 @@ static void FinaliseAirportsArray() } } - AirportTileSpec **&airporttilespec = (*file)->airtspec; + AirportTileSpec **&airporttilespec = file->airtspec; if (airporttilespec != NULL) { for (uint i = 0; i < NUM_AIRPORTTILES_PER_GRF; i++) { if (airporttilespec[i] != NULL && airporttilespec[i]->enabled) { @@ -9286,10 +9274,9 @@ static void FinalisePriceBaseMultipliers() } /* Apply fallback prices for grf version < 8 */ - const GRFFile * const *end = _grf_files.End(); - for (GRFFile **file = _grf_files.Begin(); file != end; file++) { - if ((*file)->grf_version >= 8) continue; - PriceMultipliers &price_base_multipliers = (*file)->price_base_multipliers; + for (GRFFile * const file : _grf_files) { + if (file->grf_version >= 8) continue; + PriceMultipliers &price_base_multipliers = file->price_base_multipliers; for (Price p = PR_BEGIN; p < PR_END; p++) { Price fallback_price = _price_base_specs[p].fallback_price; if (fallback_price != INVALID_PRICE && price_base_multipliers[p] == INVALID_PRICE_MODIFIER) { @@ -9301,21 +9288,21 @@ static void FinalisePriceBaseMultipliers() } /* Decide local/global scope of price base multipliers */ - for (GRFFile **file = _grf_files.Begin(); file != end; file++) { - PriceMultipliers &price_base_multipliers = (*file)->price_base_multipliers; + for (GRFFile * const file : _grf_files) { + PriceMultipliers &price_base_multipliers = file->price_base_multipliers; for (Price p = PR_BEGIN; p < PR_END; p++) { if (price_base_multipliers[p] == INVALID_PRICE_MODIFIER) { /* No multiplier was set; set it to a neutral value */ price_base_multipliers[p] = 0; } else { - if (!HasBit((*file)->grf_features, _price_base_specs[p].grf_feature)) { + if (!HasBit(file->grf_features, _price_base_specs[p].grf_feature)) { /* The grf does not define any objects of the feature, * so it must be a difficulty setting. Apply it globally */ - DEBUG(grf, 3, "'%s' sets global price base multiplier %d", (*file)->filename, p); + DEBUG(grf, 3, "'%s' sets global price base multiplier %d", file->filename, p); SetPriceBaseMultiplier(p, price_base_multipliers[p]); price_base_multipliers[p] = 0; } else { - DEBUG(grf, 3, "'%s' sets local price base multiplier %d", (*file)->filename, p); + DEBUG(grf, 3, "'%s' sets local price base multiplier %d", file->filename, p); } } } @@ -9327,8 +9314,8 @@ extern void InitGRFTownGeneratorNames(); /** Finish loading NewGRFs and execute needed post-processing */ static void AfterLoadGRFs() { - for (StringIDMapping *it = _string_to_grf_mapping.Begin(); it != _string_to_grf_mapping.End(); it++) { - *it->target = MapGRFStringID(it->grfid, it->source); + for (StringIDMapping &it : _string_to_grf_mapping) { + *it.target = MapGRFStringID(it.grfid, it.source); } _string_to_grf_mapping.clear(); diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp index e201ca7364..5626c6543e 100644 --- a/src/newgrf_commons.cpp +++ b/src/newgrf_commons.cpp @@ -683,7 +683,7 @@ uint32 NewGRFSpriteLayout::PrepareLayout(uint32 orig_offset, uint32 newgrf_groun * and apply the default sprite offsets (unless disabled). */ const TileLayoutRegisters *regs = this->registers; bool ground = true; - foreach_draw_tile_seq(result, result_seq.Begin()) { + foreach_draw_tile_seq(result, result_seq.data()) { TileLayoutFlags flags = TLF_NOTHING; if (regs != NULL) flags = regs->flags; @@ -737,7 +737,7 @@ void NewGRFSpriteLayout::ProcessRegisters(uint8 resolved_var10, uint32 resolved_ DrawTileSeqStruct *result; const TileLayoutRegisters *regs = this->registers; bool ground = true; - foreach_draw_tile_seq(result, result_seq.Begin()) { + foreach_draw_tile_seq(result, result_seq.data()) { TileLayoutFlags flags = TLF_NOTHING; if (regs != NULL) flags = regs->flags; diff --git a/src/newgrf_commons.h b/src/newgrf_commons.h index a5cedf429b..c7ca609fa9 100644 --- a/src/newgrf_commons.h +++ b/src/newgrf_commons.h @@ -164,7 +164,7 @@ struct NewGRFSpriteLayout : ZeroedMemoryAllocator, DrawTileSprites { */ const DrawTileSeqStruct *GetLayout(PalSpriteID *ground) const { - DrawTileSeqStruct *front = result_seq.Begin(); + DrawTileSeqStruct *front = result_seq.data(); *ground = front->image; return front + 1; } diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index 698084115d..e346a4a823 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -182,9 +182,9 @@ void GRFConfig::SetSuitablePalette() */ void GRFConfig::FinalizeParameterInfo() { - for (GRFParameterInfo **info = this->param_info.Begin(); info != this->param_info.End(); ++info) { - if (*info == NULL) continue; - (*info)->Finalize(); + for (GRFParameterInfo *info : this->param_info) { + if (info == NULL) continue; + info->Finalize(); } } diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index a081243572..f8745440c1 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -840,8 +840,8 @@ struct SpriteAlignerWindow : Window { /* Relative offset is new absolute offset - starting absolute offset. * Show 0, 0 as the relative offsets if entry is not in the map (meaning they have not been changed yet). */ - const SmallPair *key_offs_pair = this->offs_start_map.Find(this->current_sprite); - if (key_offs_pair != this->offs_start_map.End()) { + const auto key_offs_pair = this->offs_start_map.Find(this->current_sprite); + if (key_offs_pair != this->offs_start_map.end()) { SetDParam(0, spr->x_offs - key_offs_pair->second.first); SetDParam(1, spr->y_offs - key_offs_pair->second.second); } else { diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 7a0bb04f3b..0c7e4314b8 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -1231,13 +1231,12 @@ void CommitVehicleListOrderChanges() FOR_ALL_ENGINES(e) { ordering.push_back(e->index); } - QSortT(ordering.Begin(), ordering.size(), EnginePreSort); + QSortT(ordering.data(), ordering.size(), EnginePreSort); /* Apply Insertion-Sort operations */ - const ListOrderChange *end = _list_order_changes.End(); - for (const ListOrderChange *it = _list_order_changes.Begin(); it != end; ++it) { - EngineID source = it->engine; - uint local_target = it->target; + for (const ListOrderChange &it : _list_order_changes) { + EngineID source = it.engine; + uint local_target = it.target; const EngineIDMapping *id_source = _engine_mngr.data() + source; if (id_source->internal_id == local_target) continue; @@ -1251,7 +1250,7 @@ void CommitVehicleListOrderChanges() assert(source_index >= 0 && target_index >= 0); assert(source_index != target_index); - EngineID *list = ordering.Begin(); + EngineID *list = ordering.data(); if (source_index < target_index) { --target_index; for (int i = source_index; i < target_index; ++i) list[i] = list[i + 1]; @@ -1263,10 +1262,10 @@ void CommitVehicleListOrderChanges() } /* Store final sort-order */ - const EngineID *idend = ordering.End(); uint index = 0; - for (const EngineID *it = ordering.Begin(); it != idend; ++it, ++index) { - Engine::Get(*it)->list_position = index; + for (const EngineID &eid : ordering) { + Engine::Get(eid)->list_position = index; + ++index; } /* Clear out the queue */ diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp index b92b84355a..57f2ce5e4c 100644 --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -168,8 +168,8 @@ static byte _currentLangID = GRFLX_ENGLISH; ///< by default, english is used. int LanguageMap::GetMapping(int newgrf_id, bool gender) const { const SmallVector &map = gender ? this->gender_map : this->case_map; - for (const Mapping *m = map.Begin(); m != map.End(); m++) { - if (m->newgrf_id == newgrf_id) return m->openttd_id; + for (const Mapping &m : map) { + if (m.newgrf_id == newgrf_id) return m.openttd_id; } return -1; } @@ -183,8 +183,8 @@ int LanguageMap::GetMapping(int newgrf_id, bool gender) const int LanguageMap::GetReverseMapping(int openttd_id, bool gender) const { const SmallVector &map = gender ? this->gender_map : this->case_map; - for (const Mapping *m = map.Begin(); m != map.End(); m++) { - if (m->openttd_id == openttd_id) return m->newgrf_id; + for (const Mapping &m : map) { + if (m.openttd_id == openttd_id) return m.newgrf_id; } return -1; } @@ -194,8 +194,8 @@ struct UnmappedChoiceList : ZeroedMemoryAllocator { /** Clean everything up. */ ~UnmappedChoiceList() { - for (SmallPair *p = this->strings.Begin(); p < this->strings.End(); p++) { - free(p->second); + for (SmallPair p : this->strings) { + free(p.second); } } diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 287a146f3d..26f0fc4e80 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -453,9 +453,8 @@ ClearedObjectArea *FindClearedObject(TileIndex tile) { TileArea ta = TileArea(tile, 1, 1); - const ClearedObjectArea *end = _cleared_object_areas.End(); - for (ClearedObjectArea *coa = _cleared_object_areas.Begin(); coa != end; coa++) { - if (coa->area.Intersects(ta)) return coa; + for (ClearedObjectArea &coa : _cleared_object_areas) { + if (coa.area.Intersects(ta)) return &coa; } return NULL; diff --git a/src/os/macosx/string_osx.cpp b/src/os/macosx/string_osx.cpp index 136542cc18..51cf50ea07 100644 --- a/src/os/macosx/string_osx.cpp +++ b/src/os/macosx/string_osx.cpp @@ -75,8 +75,8 @@ public: /* Extract font information for this run. */ CFRange chars = CTRunGetStringRange(run); - FontMap::const_iterator map = fontMapping.Begin(); - while (map < fontMapping.End() - 1 && map->first <= chars.location) map++; + auto map = fontMapping.begin(); + while (map < fontMapping.end() - 1 && map->first <= chars.location) map++; this->push_back(new CoreTextVisualRun(run, map->second, buff)); } @@ -137,8 +137,8 @@ static CTRunDelegateCallbacks _sprite_font_callback = { if (length == 0) return NULL; /* Can't layout our in-built sprite fonts. */ - for (FontMap::const_iterator i = fontMapping.Begin(); i != fontMapping.End(); i++) { - if (i->second->fc->IsBuiltInFont()) return NULL; + for (const auto &i : fontMapping) { + if (i.second->fc->IsBuiltInFont()) return NULL; } /* Make attributed string with embedded font information. */ @@ -152,31 +152,31 @@ static CTRunDelegateCallbacks _sprite_font_callback = { /* Apply font and colour ranges to our string. This is important to make sure * that we get proper glyph boundaries on style changes. */ int last = 0; - for (FontMap::const_iterator i = fontMapping.Begin(); i != fontMapping.End(); i++) { - if (i->first - last == 0) continue; + for (const auto &i : fontMapping) { + if (i.first - last == 0) continue; - if (_font_cache[i->second->fc->GetSize()] == NULL) { + if (_font_cache[i.second->fc->GetSize()] == NULL) { /* Cache font information. */ - CFStringRef font_name = CFStringCreateWithCString(kCFAllocatorDefault, i->second->fc->GetFontName(), kCFStringEncodingUTF8); - _font_cache[i->second->fc->GetSize()] = CTFontCreateWithName(font_name, i->second->fc->GetFontSize(), NULL); + CFStringRef font_name = CFStringCreateWithCString(kCFAllocatorDefault, i.second->fc->GetFontName(), kCFStringEncodingUTF8); + _font_cache[i.second->fc->GetSize()] = CTFontCreateWithName(font_name, i.second->fc->GetFontSize(), NULL); CFRelease(font_name); } - CFAttributedStringSetAttribute(str, CFRangeMake(last, i->first - last), kCTFontAttributeName, _font_cache[i->second->fc->GetSize()]); + CFAttributedStringSetAttribute(str, CFRangeMake(last, i.first - last), kCTFontAttributeName, _font_cache[i.second->fc->GetSize()]); - CGColorRef color = CGColorCreateGenericGray((uint8)i->second->colour / 255.0f, 1.0f); // We don't care about the real colours, just that they are different. - CFAttributedStringSetAttribute(str, CFRangeMake(last, i->first - last), kCTForegroundColorAttributeName, color); + CGColorRef color = CGColorCreateGenericGray((uint8)i.second->colour / 255.0f, 1.0f); // We don't care about the real colours, just that they are different. + CFAttributedStringSetAttribute(str, CFRangeMake(last, i.first - last), kCTForegroundColorAttributeName, color); CGColorRelease(color); /* Install a size callback for our special sprite glyphs. */ - for (ssize_t c = last; c < i->first; c++) { + for (ssize_t c = last; c < i.first; c++) { if (buff[c] >= SCC_SPRITE_START && buff[c] <= SCC_SPRITE_END) { - CTRunDelegateRef del = CTRunDelegateCreate(&_sprite_font_callback, (void *)(size_t)(buff[c] | (i->second->fc->GetSize() << 24))); + CTRunDelegateRef del = CTRunDelegateCreate(&_sprite_font_callback, (void *)(size_t)(buff[c] | (i.second->fc->GetSize() << 24))); CFAttributedStringSetAttribute(str, CFRangeMake(c, 1), kCTRunDelegateAttributeName, del); CFRelease(del); } } - last = i->first; + last = i.first; } CFAttributedStringEndEditing(str); @@ -243,8 +243,8 @@ CoreTextParagraphLayout::CoreTextVisualRun::CoreTextVisualRun(CTRunRef run, Font int CoreTextParagraphLayout::CoreTextLine::GetLeading() const { int leading = 0; - for (const CoreTextVisualRun * const *run = this->Begin(); run != this->End(); run++) { - leading = max(leading, (*run)->GetLeading()); + for (const CoreTextVisualRun * const &run : *this) { + leading = max(leading, run->GetLeading()); } return leading; @@ -259,8 +259,8 @@ int CoreTextParagraphLayout::CoreTextLine::GetWidth() const if (this->size() == 0) return 0; int total_width = 0; - for (const CoreTextVisualRun * const *run = this->Begin(); run != this->End(); run++) { - total_width += (*run)->GetAdvance(); + for (const CoreTextVisualRun * const &run : *this) { + total_width += run->GetAdvance(); } return total_width; diff --git a/src/os/windows/string_uniscribe.cpp b/src/os/windows/string_uniscribe.cpp index ec0e026394..a3fd35d0ad 100644 --- a/src/os/windows/string_uniscribe.cpp +++ b/src/os/windows/string_uniscribe.cpp @@ -282,8 +282,8 @@ static std::vector UniscribeItemizeString(UniscribeParagraphLayoutF if (length == 0) return NULL; /* Can't layout our in-built sprite fonts. */ - for (FontMap::const_iterator i = fontMapping.Begin(); i != fontMapping.End(); i++) { - if (i->second->fc->IsBuiltInFont()) return NULL; + for (auto const &pair : fontMapping) { + if (pair.second->fc->IsBuiltInFont()) return NULL; } /* Itemize text. */ @@ -296,12 +296,12 @@ static std::vector UniscribeItemizeString(UniscribeParagraphLayoutF int cur_pos = 0; std::vector::iterator cur_item = items.begin(); - for (FontMap::const_iterator i = fontMapping.Begin(); i != fontMapping.End(); i++) { - while (cur_pos < i->first && cur_item != items.end() - 1) { + for (auto const &i : fontMapping) { + while (cur_pos < i.first && cur_item != items.end() - 1) { /* Add a range that spans the intersection of the remaining item and font run. */ - int stop_pos = min(i->first, (cur_item + 1)->iCharPos); + int stop_pos = min(i.first, (cur_item + 1)->iCharPos); assert(stop_pos - cur_pos > 0); - ranges.push_back(UniscribeRun(cur_pos, stop_pos - cur_pos, i->second, cur_item->a)); + ranges.push_back(UniscribeRun(cur_pos, stop_pos - cur_pos, i.second, cur_item->a)); /* Shape the range. */ if (!UniscribeShapeRun(buff, ranges.back())) { @@ -448,8 +448,8 @@ static std::vector UniscribeItemizeString(UniscribeParagraphLayoutF int UniscribeParagraphLayout::UniscribeLine::GetLeading() const { int leading = 0; - for (const UniscribeVisualRun * const *run = this->Begin(); run != this->End(); run++) { - leading = max(leading, (*run)->GetLeading()); + for (const UniscribeVisualRun *run : *this) { + leading = max(leading, run->GetLeading()); } return leading; @@ -462,8 +462,8 @@ int UniscribeParagraphLayout::UniscribeLine::GetLeading() const int UniscribeParagraphLayout::UniscribeLine::GetWidth() const { int length = 0; - for (const UniscribeVisualRun * const *run = this->Begin(); run != this->End(); run++) { - length += (*run)->GetAdvance(); + for (const UniscribeVisualRun *run : *this) { + length += run->GetAdvance(); } return length; diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index c6548eefba..8e996bbe3c 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -1754,8 +1754,8 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 if (flags & DC_EXEC) { /* Railtype changed, update trains as when entering different track */ - for (Train **v = affected_trains.Begin(); v != affected_trains.End(); v++) { - (*v)->ConsistChanged(CCF_TRACK); + for (Train *v : affected_trains) { + v->ConsistChanged(CCF_TRACK); } } diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 43a415c208..3efed69e45 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -2197,12 +2197,12 @@ bool AfterLoadGame() extern SmallVector _animated_tiles; - for (TileIndex *tile = _animated_tiles.Begin(); tile < _animated_tiles.End(); /* Nothing */) { + for (auto tile = _animated_tiles.begin(); tile < _animated_tiles.end(); /* Nothing */) { /* Remove if tile is not animated */ bool remove = _tile_type_procs[GetTileType(*tile)]->animate_tile_proc == NULL; /* and remove if duplicate */ - for (TileIndex *j = _animated_tiles.Begin(); !remove && j < tile; j++) { + for (auto j = _animated_tiles.begin(); !remove && j < tile; j++) { remove = *tile == *j; } @@ -2981,9 +2981,12 @@ bool AfterLoadGame() while (cur_skip > skip_frames[0]) { RoadVehicle *u = v; RoadVehicle *prev = NULL; - for (uint *it = skip_frames.Begin(); it != skip_frames.End(); ++it, prev = u, u = u->Next()) { + for (uint sf : skip_frames) { extern bool IndividualRoadVehicleController(RoadVehicle *v, const RoadVehicle *prev); - if (*it >= cur_skip) IndividualRoadVehicleController(u, prev); + if (sf >= cur_skip) IndividualRoadVehicleController(u, prev); + + prev = u; + u = u->Next(); } cur_skip--; } diff --git a/src/saveload/animated_tile_sl.cpp b/src/saveload/animated_tile_sl.cpp index 5b91852639..4d4ed69a96 100644 --- a/src/saveload/animated_tile_sl.cpp +++ b/src/saveload/animated_tile_sl.cpp @@ -25,8 +25,8 @@ extern SmallVector _animated_tiles; */ static void Save_ANIT() { - SlSetLength(_animated_tiles.size() * sizeof(*_animated_tiles.Begin())); - SlArray(_animated_tiles.Begin(), _animated_tiles.size(), SLE_UINT32); + SlSetLength(_animated_tiles.size() * sizeof(_animated_tiles.front())); + SlArray(_animated_tiles.data(), _animated_tiles.size(), SLE_UINT32); } /** @@ -47,10 +47,10 @@ static void Load_ANIT() return; } - uint count = (uint)SlGetFieldLength() / sizeof(*_animated_tiles.Begin()); + uint count = (uint)SlGetFieldLength() / sizeof(_animated_tiles.front()); _animated_tiles.clear(); _animated_tiles.resize(_animated_tiles.size() + count); - SlArray(_animated_tiles.Begin(), count, SLE_UINT32); + SlArray(_animated_tiles.data(), count, SLE_UINT32); } /** diff --git a/src/saveload/engine_sl.cpp b/src/saveload/engine_sl.cpp index 03a086a15d..891e307834 100644 --- a/src/saveload/engine_sl.cpp +++ b/src/saveload/engine_sl.cpp @@ -177,11 +177,11 @@ static const SaveLoad _engine_id_mapping_desc[] = { static void Save_EIDS() { - const EngineIDMapping *end = _engine_mngr.End(); uint index = 0; - for (EngineIDMapping *eid = _engine_mngr.Begin(); eid != end; eid++, index++) { + for (EngineIDMapping &eid : _engine_mngr) { SlSetArrayIndex(index); - SlObject(eid, _engine_id_mapping_desc); + SlObject(&eid, _engine_id_mapping_desc); + index++; } } diff --git a/src/saveload/waypoint_sl.cpp b/src/saveload/waypoint_sl.cpp index 9e5d163960..d7701c8af8 100644 --- a/src/saveload/waypoint_sl.cpp +++ b/src/saveload/waypoint_sl.cpp @@ -52,10 +52,10 @@ static void UpdateWaypointOrder(Order *o) { if (!o->IsType(OT_GOTO_WAYPOINT)) return; - for (OldWaypoint *wp = _old_waypoints.Begin(); wp != _old_waypoints.End(); wp++) { - if (wp->index != o->GetDestination()) continue; + for (OldWaypoint &wp : _old_waypoints) { + if (wp.index != o->GetDestination()) continue; - o->SetDestination((DestinationID)wp->new_index); + o->SetDestination((DestinationID)wp.new_index); return; } } @@ -71,25 +71,25 @@ void MoveWaypointsToBaseStations() * id which was stored in m4 is now saved as a grf/id reference in the * waypoint struct. */ if (IsSavegameVersionBefore(SLV_17)) { - for (OldWaypoint *wp = _old_waypoints.Begin(); wp != _old_waypoints.End(); wp++) { - if (wp->delete_ctr != 0) continue; // The waypoint was deleted + for (OldWaypoint &wp : _old_waypoints) { + if (wp.delete_ctr != 0) continue; // The waypoint was deleted /* Waypoint indices were not added to the map prior to this. */ - _m[wp->xy].m2 = (StationID)wp->index; + _m[wp.xy].m2 = (StationID)wp.index; - if (HasBit(_m[wp->xy].m3, 4)) { - wp->spec = StationClass::Get(STAT_CLASS_WAYP)->GetSpec(_m[wp->xy].m4 + 1); + if (HasBit(_m[wp.xy].m3, 4)) { + wp.spec = StationClass::Get(STAT_CLASS_WAYP)->GetSpec(_m[wp.xy].m4 + 1); } } } else { /* As of version 17, we recalculate the custom graphic ID of waypoints * from the GRF ID / station index. */ - for (OldWaypoint *wp = _old_waypoints.Begin(); wp != _old_waypoints.End(); wp++) { + for (OldWaypoint &wp : _old_waypoints) { StationClass* stclass = StationClass::Get(STAT_CLASS_WAYP); for (uint i = 0; i < stclass->GetSpecCount(); i++) { const StationSpec *statspec = stclass->GetSpec(i); - if (statspec != NULL && statspec->grf_prop.grffile->grfid == wp->grfid && statspec->grf_prop.local_id == wp->localidx) { - wp->spec = statspec; + if (statspec != NULL && statspec->grf_prop.grffile->grfid == wp.grfid && statspec->grf_prop.local_id == wp.localidx) { + wp.spec = statspec; break; } } @@ -99,19 +99,19 @@ void MoveWaypointsToBaseStations() if (!Waypoint::CanAllocateItem(_old_waypoints.size())) SlError(STR_ERROR_TOO_MANY_STATIONS_LOADING); /* All saveload conversions have been done. Create the new waypoints! */ - for (OldWaypoint *wp = _old_waypoints.Begin(); wp != _old_waypoints.End(); wp++) { - Waypoint *new_wp = new Waypoint(wp->xy); - new_wp->town = wp->town; - new_wp->town_cn = wp->town_cn; - new_wp->name = wp->name; + for (OldWaypoint &wp : _old_waypoints) { + Waypoint *new_wp = new Waypoint(wp.xy); + new_wp->town = wp.town; + new_wp->town_cn = wp.town_cn; + new_wp->name = wp.name; new_wp->delete_ctr = 0; // Just reset delete counter for once. - new_wp->build_date = wp->build_date; - new_wp->owner = wp->owner; + new_wp->build_date = wp.build_date; + new_wp->owner = wp.owner; new_wp->string_id = STR_SV_STNAME_WAYPOINT; - TileIndex t = wp->xy; - if (IsTileType(t, MP_RAILWAY) && GetRailTileType(t) == 2 /* RAIL_TILE_WAYPOINT */ && _m[t].m2 == wp->index) { + TileIndex t = wp.xy; + if (IsTileType(t, MP_RAILWAY) && GetRailTileType(t) == 2 /* RAIL_TILE_WAYPOINT */ && _m[t].m2 == wp.index) { /* The tile might've been reserved! */ bool reserved = !IsSavegameVersionBefore(SLV_100) && HasBit(_m[t].m5, 4); @@ -122,13 +122,13 @@ void MoveWaypointsToBaseStations() SetRailStationReservation(t, reserved); - if (wp->spec != NULL) { - SetCustomStationSpecIndex(t, AllocateSpecToStation(wp->spec, new_wp, true)); + if (wp.spec != NULL) { + SetCustomStationSpecIndex(t, AllocateSpecToStation(wp.spec, new_wp, true)); } new_wp->rect.BeforeAddTile(t, StationRect::ADD_FORCE); } - wp->new_index = new_wp->index; + wp.new_index = new_wp->index; } /* Update the orders of vehicles */ @@ -189,15 +189,15 @@ static void Load_WAYP() static void Ptrs_WAYP() { - for (OldWaypoint *wp = _old_waypoints.Begin(); wp != _old_waypoints.End(); wp++) { - SlObject(wp, _old_waypoint_desc); + for (OldWaypoint &wp : _old_waypoints) { + SlObject(&wp, _old_waypoint_desc); if (IsSavegameVersionBefore(SLV_12)) { - wp->town_cn = (wp->string_id & 0xC000) == 0xC000 ? (wp->string_id >> 8) & 0x3F : 0; - wp->town = ClosestTownFromTile(wp->xy, UINT_MAX); + wp.town_cn = (wp.string_id & 0xC000) == 0xC000 ? (wp.string_id >> 8) & 0x3F : 0; + wp.town = ClosestTownFromTile(wp.xy, UINT_MAX); } else if (IsSavegameVersionBefore(SLV_122)) { /* Only for versions 12 .. 122 */ - if (!Town::IsValidID(wp->town_index)) { + if (!Town::IsValidID(wp.town_index)) { /* Upon a corrupted waypoint we'll likely get here. The next step will be to * loop over all Ptrs procs to NULL the pointers. However, we don't know * whether we're in the NULL or "normal" Ptrs proc. So just clear the list @@ -206,10 +206,10 @@ static void Ptrs_WAYP() _old_waypoints.clear(); SlErrorCorrupt("Referencing invalid Town"); } - wp->town = Town::Get(wp->town_index); + wp.town = Town::Get(wp.town_index); } if (IsSavegameVersionBefore(SLV_84)) { - wp->name = CopyFromOldName(wp->string_id); + wp.name = CopyFromOldName(wp.string_id); } } } diff --git a/src/script/script_info.cpp b/src/script/script_info.cpp index b95c6e366d..47ff2ee5f9 100644 --- a/src/script/script_info.cpp +++ b/src/script/script_info.cpp @@ -26,8 +26,8 @@ ScriptInfo::~ScriptInfo() free((*it).name); free((*it).description); if (it->labels != NULL) { - for (LabelMapping::iterator it2 = (*it).labels->Begin(); it2 != (*it).labels->End(); it2++) { - free(it2->second); + for (auto &lbl_map : *(*it).labels) { + free(lbl_map.second); } delete it->labels; } diff --git a/src/script/squirrel_helper.hpp b/src/script/squirrel_helper.hpp index c362601eb2..775fe142ee 100644 --- a/src/script/squirrel_helper.hpp +++ b/src/script/squirrel_helper.hpp @@ -149,7 +149,7 @@ namespace SQConvert { Array *arr = (Array*)MallocT(sizeof(Array) + sizeof(int32) * data.size()); arr->size = data.size(); - memcpy(arr->array, data.Begin(), sizeof(int32) * data.size()); + memcpy(arr->array, data.data(), sizeof(int32) * data.size()); ptr->push_back(arr); return arr; diff --git a/src/settings.cpp b/src/settings.cpp index 2c9fc305e2..546b137a14 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -747,8 +747,8 @@ static void IniSaveSettingList(IniFile *ini, const char *grpname, StringList *li if (group == NULL || list == NULL) return; group->Clear(); - for (char **iter = list->Begin(); iter != list->End(); iter++) { - group->GetItem(*iter, true)->SetValue(""); + for (char *iter : *list) { + group->GetItem(iter, true)->SetValue(""); } } diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index da4989e858..cfed29d4d0 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -215,7 +215,7 @@ struct GameOptionsWindow : Window { if (i == CURRENCY_CUSTOM) continue; list->push_back(new DropDownListStringItem(*items, i, HasBit(disabled, i))); } - QSortT(list->Begin(), list->size(), DropDownListStringItem::NatSortFunc); + QSortT(list->data(), list->size(), DropDownListStringItem::NatSortFunc); /* Append custom currency at the end */ list->push_back(new DropDownListItem(-1, false)); // separator line @@ -253,7 +253,7 @@ struct GameOptionsWindow : Window { int result = _nb_orig_names + i; list->push_back(new DropDownListStringItem(_grf_names[i], result, enabled_item != result && enabled_item >= 0)); } - QSortT(list->Begin(), list->size(), DropDownListStringItem::NatSortFunc); + QSortT(list->data(), list->size(), DropDownListStringItem::NatSortFunc); int newgrf_size = list->size(); /* Insert newgrf_names at the top of the list */ @@ -266,7 +266,7 @@ struct GameOptionsWindow : Window { for (int i = 0; i < _nb_orig_names; i++) { list->push_back(new DropDownListStringItem(STR_GAME_OPTIONS_TOWN_NAME_ORIGINAL_ENGLISH + i, i, enabled_item != i && enabled_item >= 0)); } - QSortT(list->Begin() + newgrf_size, list->size() - newgrf_size, DropDownListStringItem::NatSortFunc); + QSortT(list->data() + newgrf_size, list->size() - newgrf_size, DropDownListStringItem::NatSortFunc); break; } @@ -286,7 +286,7 @@ struct GameOptionsWindow : Window { if (&_languages[i] == _current_language) *selected_index = i; list->push_back(new DropDownListStringItem(SPECSTR_LANGUAGE_START + i, i, false)); } - QSortT(list->Begin(), list->size(), DropDownListStringItem::NatSortFunc); + QSortT(list->data(), list->size(), DropDownListStringItem::NatSortFunc); break; } @@ -432,11 +432,11 @@ struct GameOptionsWindow : Window { DropDownList *list = this->BuildDropDownList(widget, &selected); if (list != NULL) { /* Find the biggest item for the default size. */ - for (const DropDownListItem * const *it = list->Begin(); it != list->End(); it++) { + for (const DropDownListItem * const ddli : *list) { Dimension string_dim; - int width = (*it)->Width(); + int width = ddli->Width(); string_dim.width = width + padding.width; - string_dim.height = (*it)->Height(width) + padding.height; + string_dim.height = ddli->Height(width) + padding.height; *size = maxdim(*size, string_dim); } delete list; diff --git a/src/settingsgen/settingsgen.cpp b/src/settingsgen/settingsgen.cpp index 1847bedff3..f52fe54268 100644 --- a/src/settingsgen/settingsgen.cpp +++ b/src/settingsgen/settingsgen.cpp @@ -136,8 +136,8 @@ public: */ void Write(FILE *out_fp) const { - for (const OutputBuffer *out_data = this->output_buffer.Begin(); out_data != this->output_buffer.End(); out_data++) { - out_data->Write(out_fp); + for (const OutputBuffer &out_data : output_buffer) { + out_data.Write(out_fp); } } diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 6811290add..63e3384b04 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1622,8 +1622,7 @@ CommandCost RemoveFromRailBaseStation(TileArea ta, SmallVector &affected if (quantity == 0) return error.Failed() ? error : CommandCost(STR_ERROR_THERE_IS_NO_STATION); - for (T **stp = affected_stations.Begin(); stp != affected_stations.End(); stp++) { - T *st = *stp; + for (T *st : affected_stations) { /* now we need to make the "spanned" area of the railway station smaller * if we deleted something at the edges. @@ -1667,8 +1666,7 @@ CommandCost CmdRemoveFromRailStation(TileIndex start, DoCommandFlag flags, uint3 if (ret.Failed()) return ret; /* Do all station specific functions here. */ - for (Station **stp = affected_stations.Begin(); stp != affected_stations.End(); stp++) { - Station *st = *stp; + for (Station *st : affected_stations) { if (st->train_station.tile == INVALID_TILE) SetWindowWidgetDirty(WC_STATION_VIEW, st->index, WID_SV_TRAINS); st->MarkTilesDirty(false); diff --git a/src/story_gui.cpp b/src/story_gui.cpp index aed00358d0..5679bbdc6b 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -130,8 +130,7 @@ protected: int GetSelPageNum() const { int page_number = 0; - for (const StoryPage *const*iter = this->story_pages.Begin(); iter != this->story_pages.End(); iter++) { - const StoryPage *p = *iter; + for (const StoryPage *p : this->story_pages) { if (p->index == this->selected_page_id) { return page_number; } @@ -148,7 +147,7 @@ protected: /* Verify that the selected page exist. */ if (!_story_page_pool.IsValidID(this->selected_page_id)) return false; - return (*this->story_pages.Begin())->index == this->selected_page_id; + return this->story_pages.front()->index == this->selected_page_id; } /** @@ -160,7 +159,7 @@ protected: if (!_story_page_pool.IsValidID(this->selected_page_id)) return false; if (this->story_pages.size() <= 1) return true; - const StoryPage *last = *(this->story_pages.End() - 1); + const StoryPage *last = this->story_pages.back(); return last->index == this->selected_page_id; } @@ -195,8 +194,7 @@ protected: /* Find the last available page which is previous to the current selected page. */ const StoryPage *last_available; last_available = NULL; - for (const StoryPage *const*iter = this->story_pages.Begin(); iter != this->story_pages.End(); iter++) { - const StoryPage *p = *iter; + for (const StoryPage *p : this->story_pages) { if (p->index == this->selected_page_id) { if (last_available == NULL) return; // No previous page available. this->SetSelectedPage(last_available->index); @@ -214,12 +212,12 @@ protected: if (!_story_page_pool.IsValidID(this->selected_page_id)) return; /* Find selected page. */ - for (const StoryPage *const*iter = this->story_pages.Begin(); iter != this->story_pages.End(); iter++) { + for (auto iter = this->story_pages.begin(); iter != this->story_pages.end(); iter++) { const StoryPage *p = *iter; if (p->index == this->selected_page_id) { /* Select the page after selected page. */ iter++; - if (iter != this->story_pages.End()) { + if (iter != this->story_pages.end()) { this->SetSelectedPage((*iter)->index); } return; @@ -234,8 +232,7 @@ protected: { DropDownList *list = new DropDownList(); uint16 page_num = 1; - for (const StoryPage *const*iter = this->story_pages.Begin(); iter != this->story_pages.End(); iter++) { - const StoryPage *p = *iter; + for (const StoryPage *p : this->story_pages) { bool current_page = p->index == this->selected_page_id; DropDownListStringItem *item = NULL; if (p->title != NULL) { @@ -353,8 +350,7 @@ protected: uint height = GetHeadHeight(max_width); /* Body */ - for (const StoryPageElement **iter = this->story_page_elements.Begin(); iter != this->story_page_elements.End(); iter++) { - const StoryPageElement *pe = *iter; + for (const StoryPageElement *pe : this->story_page_elements) { height += element_vertical_dist; height += GetPageElementHeight(*pe, max_width); } @@ -532,8 +528,7 @@ public: y_offset = DrawStringMultiLine(0, right - x, y_offset, bottom - y, STR_STORY_BOOK_TITLE, TC_BLACK, SA_TOP | SA_HOR_CENTER); /* Page elements */ - for (const StoryPageElement *const*iter = this->story_page_elements.Begin(); iter != this->story_page_elements.End(); iter++) { - const StoryPageElement *const pe = *iter; + for (const StoryPageElement *const pe : this->story_page_elements) { y_offset += line_height; // margin to previous element switch (pe->type) { @@ -650,8 +645,7 @@ public: /* Detect if a page element was clicked. */ uint y = head_height; uint element_vertical_dist = FONT_HEIGHT_NORMAL; - for (const StoryPageElement *const*iter = this->story_page_elements.Begin(); iter != this->story_page_elements.End(); iter++) { - const StoryPageElement *const pe = *iter; + for (const StoryPageElement *const pe : this->story_page_elements) { y += element_vertical_dist; // margin row diff --git a/src/strgen/strgen_base.cpp b/src/strgen/strgen_base.cpp index 12d9938446..6c835782c8 100644 --- a/src/strgen/strgen_base.cpp +++ b/src/strgen/strgen_base.cpp @@ -1045,7 +1045,7 @@ void LanguageWriter::WriteLang(const StringData &data) if (cmdp != NULL) PutCommandString(&buffer, cmdp); this->WriteLength(buffer.size()); - this->Write(buffer.Begin(), buffer.size()); + this->Write(buffer.data(), buffer.size()); buffer.clear(); } } diff --git a/src/string.cpp b/src/string.cpp index c23202acbb..72254a877b 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -674,7 +674,7 @@ public: UText text = UTEXT_INITIALIZER; UErrorCode status = U_ZERO_ERROR; - utext_openUChars(&text, this->utf16_str.Begin(), this->utf16_str.size() - 1, &status); + utext_openUChars(&text, this->utf16_str.data(), this->utf16_str.size() - 1, &status); this->char_itr->setText(&text, status); this->word_itr->setText(&text, status); this->char_itr->first(); diff --git a/src/stringfilter.cpp b/src/stringfilter.cpp index e546a4186c..88eb5f28ad 100644 --- a/src/stringfilter.cpp +++ b/src/stringfilter.cpp @@ -91,9 +91,8 @@ void StringFilter::SetFilterTerm(const char *str) void StringFilter::ResetState() { this->word_matches = 0; - const WordState *end = this->word_index.End(); - for (WordState *it = this->word_index.Begin(); it != end; ++it) { - it->match = false; + for (WordState &ws : this->word_index) { + ws.match = false; } } @@ -110,11 +109,10 @@ void StringFilter::AddLine(const char *str) if (str == NULL) return; bool match_case = this->case_sensitive != NULL && *this->case_sensitive; - const WordState *end = this->word_index.End(); - for (WordState *it = this->word_index.Begin(); it != end; ++it) { - if (!it->match) { - if ((match_case ? strstr(str, it->start) : strcasestr(str, it->start)) != NULL) { - it->match = true; + for (WordState &ws : this->word_index) { + if (!ws.match) { + if ((match_case ? strstr(str, ws.start) : strcasestr(str, ws.start)) != NULL) { + ws.match = true; this->word_matches++; } } diff --git a/src/strings.cpp b/src/strings.cpp index c3f3061834..204c68c204 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -1876,8 +1876,8 @@ int CDECL StringIDSorter(const StringID *a, const StringID *b) */ const LanguageMetadata *GetLanguage(byte newgrflangid) { - for (const LanguageMetadata *lang = _languages.Begin(); lang != _languages.End(); lang++) { - if (newgrflangid == lang->newgrflangid) return lang; + for (const LanguageMetadata &lang : _languages) { + if (newgrflangid == lang.newgrflangid) return ⟨ } return NULL; @@ -1960,22 +1960,22 @@ void InitializeLanguagePacks() const LanguageMetadata *chosen_language = NULL; ///< Matching the language in the configuration file or the current locale const LanguageMetadata *language_fallback = NULL; ///< Using pt_PT for pt_BR locale when pt_BR is not available - const LanguageMetadata *en_GB_fallback = _languages.Begin(); ///< Fallback when no locale-matching language has been found + const LanguageMetadata *en_GB_fallback = _languages.data(); ///< Fallback when no locale-matching language has been found /* Find a proper language. */ - for (const LanguageMetadata *lng = _languages.Begin(); lng != _languages.End(); lng++) { + for (const LanguageMetadata &lng : _languages) { /* We are trying to find a default language. The priority is by * configuration file, local environment and last, if nothing found, * English. */ - const char *lang_file = strrchr(lng->file, PATHSEPCHAR) + 1; + const char *lang_file = strrchr(lng.file, PATHSEPCHAR) + 1; if (strcmp(lang_file, _config_language_file) == 0) { - chosen_language = lng; + chosen_language = &lng; break; } - if (strcmp (lng->isocode, "en_GB") == 0) en_GB_fallback = lng; - if (strncmp(lng->isocode, lang, 5) == 0) chosen_language = lng; - if (strncmp(lng->isocode, lang, 2) == 0) language_fallback = lng; + if (strcmp (lng.isocode, "en_GB") == 0) en_GB_fallback = &lng; + if (strncmp(lng.isocode, lang, 5) == 0) chosen_language = &lng; + if (strncmp(lng.isocode, lang, 2) == 0) language_fallback = &lng; } /* We haven't found the language in the config nor the one in the locale. diff --git a/src/subsidy.cpp b/src/subsidy.cpp index 8f823a1ab4..a61d6f1ce9 100644 --- a/src/subsidy.cpp +++ b/src/subsidy.cpp @@ -601,9 +601,9 @@ bool CheckSubsidised(CargoID cargo_type, CompanyID company, SourceType src_type, } break; case ST_TOWN: - for (const Town * const *tp = towns_near.Begin(); tp != towns_near.End(); tp++) { - if (s->dst == (*tp)->index) { - assert((*tp)->cache.part_of_subsidy & POS_DST); + for (const Town *tp : towns_near) { + if (s->dst == tp->index) { + assert(tp->cache.part_of_subsidy & POS_DST); subsidised = true; if (!s->IsAwarded()) s->AwardTo(company); } diff --git a/src/texteff.cpp b/src/texteff.cpp index c81d9a95d7..6827d980f0 100644 --- a/src/texteff.cpp +++ b/src/texteff.cpp @@ -89,20 +89,19 @@ void MoveAllTextEffects(uint delta_ms) uint count = texteffecttimer.CountElapsed(delta_ms); if (count == 0) return; - const TextEffect *end = _text_effects.End(); - for (TextEffect *te = _text_effects.Begin(); te != end; te++) { - if (te->string_id == INVALID_STRING_ID) continue; - if (te->mode != TE_RISING) continue; + for (TextEffect &te : _text_effects) { + if (te.string_id == INVALID_STRING_ID) continue; + if (te.mode != TE_RISING) continue; - if (te->duration < count) { - te->Reset(); + if (te.duration < count) { + te.Reset(); continue; } - te->MarkDirty(ZOOM_LVL_OUT_8X); - te->duration -= count; - te->top -= count * ZOOM_LVL_BASE; - te->MarkDirty(ZOOM_LVL_OUT_8X); + te.MarkDirty(ZOOM_LVL_OUT_8X); + te.duration -= count; + te.top -= count * ZOOM_LVL_BASE; + te.MarkDirty(ZOOM_LVL_OUT_8X); } } @@ -117,11 +116,10 @@ void DrawTextEffects(DrawPixelInfo *dpi) /* Don't draw the text effects when zoomed out a lot */ if (dpi->zoom > ZOOM_LVL_OUT_8X) return; - const TextEffect *end = _text_effects.End(); - for (TextEffect *te = _text_effects.Begin(); te != end; te++) { - if (te->string_id == INVALID_STRING_ID) continue; - if (te->mode == TE_RISING || (_settings_client.gui.loading_indicators && !IsTransparencySet(TO_LOADING))) { - ViewportAddString(dpi, ZOOM_LVL_OUT_8X, te, te->string_id, te->string_id - 1, STR_NULL, te->params_1, te->params_2); + for (TextEffect &te : _text_effects) { + if (te.string_id == INVALID_STRING_ID) continue; + if (te.mode == TE_RISING || (_settings_client.gui.loading_indicators && !IsTransparencySet(TO_LOADING))) { + ViewportAddString(dpi, ZOOM_LVL_OUT_8X, &te, te.string_id, te.string_id - 1, STR_NULL, te.params_1, te.params_2); } } } diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index fcc8493e2b..7e718c717d 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -295,13 +295,12 @@ CommandCost CmdSetTimetableStart(TileIndex tile, DoCommandFlag flags, uint32 p1, int num_vehs = vehs.size(); if (num_vehs >= 2) { - QSortT(vehs.Begin(), vehs.size(), &VehicleTimetableSorter); + QSortT(vehs.data(), vehs.size(), &VehicleTimetableSorter); } int idx = vehs.begin() - std::find(vehs.begin(), vehs.end(), v); - for (Vehicle **viter = vehs.Begin(); viter != vehs.End(); viter++) { - Vehicle *w = *viter; + for (Vehicle *w : vehs) { w->lateness_counter = 0; ClrBit(w->vehicle_flags, VF_TIMETABLE_STARTED); diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 0d4df42f45..6ce1131844 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -837,8 +837,7 @@ static void RestoreTrainBackup(TrainList &list) Train *prev = NULL; /* Iterate over the list and rebuild it. */ - for (Train **iter = list.Begin(); iter != list.End(); iter++) { - Train *t = *iter; + for (Train *t : list) { if (prev != NULL) { prev->SetNext(t); } else if (t->Previous() != NULL) { diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 3036096c89..427d45dea4 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -278,10 +278,10 @@ static void GetCargoSummaryOfArticulatedVehicle(const Train *v, CargoSummary *su new_item.subtype = GetCargoSubtypeText(v); if (new_item.cargo == INVALID_CARGO && new_item.subtype == STR_EMPTY) continue; - CargoSummaryItem *item = &*std::find(summary->begin(), summary->end(), new_item); - if (item == summary->End()) { - /*C++17: item = &*/ summary->emplace_back(); - item = &summary->back(); + auto item = std::find(summary->begin(), summary->end(), new_item); + if (item == summary->end()) { + summary->emplace_back(); + item = summary->end() - 1; item->cargo = new_item.cargo; item->subtype = new_item.subtype; item->capacity = 0; diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index 764551d81f..79011a3bd5 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -698,8 +698,9 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1, * Deliberately clear the coa pointer to avoid leaving dangling pointers which could * inadvertently be dereferenced. */ - assert(coa >= _cleared_object_areas.Begin() && coa < _cleared_object_areas.End()); - size_t coa_index = coa - _cleared_object_areas.Begin(); + ClearedObjectArea *begin = _cleared_object_areas.data(); + assert(coa >= begin && coa < begin + _cleared_object_areas.size()); + size_t coa_index = coa - begin; assert(coa_index < UINT_MAX); // more than 2**32 cleared areas would be a bug in itself coa = NULL; diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 267c204913..9f15d9be05 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1028,15 +1028,15 @@ void CallVehicleTicks() } Backup cur_company(_current_company, FILE_LINE); - for (AutoreplaceMap::iterator it = _vehicles_to_autoreplace.Begin(); it != _vehicles_to_autoreplace.End(); it++) { - v = it->first; + for (auto &it : _vehicles_to_autoreplace) { + v = it.first; /* Autoreplace needs the current company set as the vehicle owner */ cur_company.Change(v->owner); /* Start vehicle if we stopped them in VehicleEnteredDepotThisTick() * We need to stop them between VehicleEnteredDepotThisTick() and here or we risk that * they are already leaving the depot again before being replaced. */ - if (it->second) v->vehstatus &= ~VS_STOPPED; + if (it.second) v->vehstatus &= ~VS_STOPPED; /* Store the position of the effect as the vehicle pointer will become invalid later */ int x = v->x_pos; diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 8e578cd68d..872c9458ca 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -422,17 +422,17 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, uint8 num_vehicles, if (flags & DC_EXEC) { /* Store the result */ - for (RefitResult *result = refit_result.Begin(); result != refit_result.End(); result++) { - Vehicle *u = result->v; - u->refit_cap = (u->cargo_type == new_cid) ? min(result->capacity, u->refit_cap) : 0; + for (RefitResult &result : refit_result) { + Vehicle *u = result.v; + u->refit_cap = (u->cargo_type == new_cid) ? min(result.capacity, u->refit_cap) : 0; if (u->cargo.TotalCount() > u->refit_cap) u->cargo.Truncate(u->cargo.TotalCount() - u->refit_cap); u->cargo_type = new_cid; - u->cargo_cap = result->capacity; - u->cargo_subtype = result->subtype; + u->cargo_cap = result.capacity; + u->cargo_subtype = result.subtype; if (u->type == VEH_AIRCRAFT) { Vehicle *w = u->Next(); - w->refit_cap = min(w->refit_cap, result->mail_capacity); - w->cargo_cap = result->mail_capacity; + w->refit_cap = min(w->refit_cap, result.mail_capacity); + w->cargo_cap = result.mail_capacity; if (w->cargo.TotalCount() > w->refit_cap) w->cargo.Truncate(w->cargo.TotalCount() - w->refit_cap); } } diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 82403a2d1b..9b6c68a36e 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -106,8 +106,8 @@ const StringID BaseVehicleListWindow::vehicle_depot_name[] = { uint GetUnitNumberDigits(VehicleList &vehicles) { uint unitnumber = 0; - for (const Vehicle **v = vehicles.Begin(); v != vehicles.End(); v++) { - unitnumber = max(unitnumber, (*v)->unitnumber); + for (const Vehicle *v : vehicles) { + unitnumber = max(unitnumber, v->unitnumber); } if (unitnumber >= 10000) return 5; @@ -194,7 +194,7 @@ void BaseVehicleListWindow::SortVehicleList() void DepotSortList(VehicleList *list) { if (list->size() < 2) return; - QSortT(list->Begin(), list->size(), &VehicleNumberSorter); + QSortT(list->data(), list->size(), &VehicleNumberSorter); } /** draw the vehicle profit button in the vehicle list window. */ diff --git a/src/viewport.cpp b/src/viewport.cpp index 929616ba52..892e94d603 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -628,8 +628,8 @@ static void AddCombinedSprite(SpriteID image, PaletteID pal, int x, int y, int z pt.y + spr->y_offs + spr->height <= _vd.dpi.top) return; - const ParentSpriteToDraw *pstd = _vd.parent_sprites_to_draw.End() - 1; - AddChildSpriteScreen(image, pal, pt.x - pstd->left, pt.y - pstd->top, false, sub, false); + const ParentSpriteToDraw &pstd = _vd.parent_sprites_to_draw.back(); + AddChildSpriteScreen(image, pal, pt.x - pstd.left, pt.y - pstd.top, false, sub, false); } /** @@ -1393,9 +1393,8 @@ void ViewportSign::MarkDirty(ZoomLevel maxzoom) const static void ViewportDrawTileSprites(const TileSpriteToDrawVector *tstdv) { - const TileSpriteToDraw *tsend = tstdv->End(); - for (const TileSpriteToDraw *ts = tstdv->Begin(); ts != tsend; ++ts) { - DrawSpriteViewport(ts->image, ts->pal, ts->x, ts->y, ts->sub); + for (const TileSpriteToDraw &ts : *tstdv) { + DrawSpriteViewport(ts.image, ts.pal, ts.x, ts.y, ts.sub); } } @@ -1408,8 +1407,8 @@ static bool ViewportSortParentSpritesChecker() /** Sort parent sprites pointer array */ static void ViewportSortParentSprites(ParentSpriteToSortVector *psdv) { - ParentSpriteToDraw **psdvend = psdv->End(); - ParentSpriteToDraw **psd = psdv->Begin(); + auto psdvend = psdv->end(); + auto psd = psdv->begin(); while (psd != psdvend) { ParentSpriteToDraw *ps = *psd; @@ -1420,7 +1419,7 @@ static void ViewportSortParentSprites(ParentSpriteToSortVector *psdv) ps->comparison_done = true; - for (ParentSpriteToDraw **psd2 = psd + 1; psd2 != psdvend; psd2++) { + for (auto psd2 = psd + 1; psd2 != psdvend; psd2++) { ParentSpriteToDraw *ps2 = *psd2; if (ps2->comparison_done) continue; @@ -1455,7 +1454,7 @@ static void ViewportSortParentSprites(ParentSpriteToSortVector *psdv) /* Move ps2 in front of ps */ ParentSpriteToDraw *temp = ps2; - for (ParentSpriteToDraw **psd3 = psd2; psd3 > psd; psd3--) { + for (auto psd3 = psd2; psd3 > psd; psd3--) { *psd3 = *(psd3 - 1); } *psd = temp; @@ -1465,9 +1464,7 @@ static void ViewportSortParentSprites(ParentSpriteToSortVector *psdv) static void ViewportDrawParentSprites(const ParentSpriteToSortVector *psd, const ChildScreenSpriteToDrawVector *csstdv) { - const ParentSpriteToDraw * const *psd_end = psd->End(); - for (const ParentSpriteToDraw * const *it = psd->Begin(); it != psd_end; it++) { - const ParentSpriteToDraw *ps = *it; + for (const ParentSpriteToDraw *ps : *psd) { if (ps->image != SPR_EMPTY_BOUNDING_BOX) DrawSpriteViewport(ps->image, ps->pal, ps->x, ps->y, ps->sub); int child_idx = ps->first_child; @@ -1485,9 +1482,7 @@ static void ViewportDrawParentSprites(const ParentSpriteToSortVector *psd, const */ static void ViewportDrawBoundingBoxes(const ParentSpriteToSortVector *psd) { - const ParentSpriteToDraw * const *psd_end = psd->End(); - for (const ParentSpriteToDraw * const *it = psd->Begin(); it != psd_end; it++) { - const ParentSpriteToDraw *ps = *it; + for (const ParentSpriteToDraw *ps : *psd) { Point pt1 = RemapCoords(ps->xmax + 1, ps->ymax + 1, ps->zmax + 1); // top front corner Point pt2 = RemapCoords(ps->xmin , ps->ymax + 1, ps->zmax + 1); // top left corner Point pt3 = RemapCoords(ps->xmax + 1, ps->ymin , ps->zmax + 1); // top right corner @@ -1524,38 +1519,37 @@ static void ViewportDrawDirtyBlocks() static void ViewportDrawStrings(ZoomLevel zoom, const StringSpriteToDrawVector *sstdv) { - const StringSpriteToDraw *ssend = sstdv->End(); - for (const StringSpriteToDraw *ss = sstdv->Begin(); ss != ssend; ++ss) { + for (const StringSpriteToDraw &ss : *sstdv) { TextColour colour = TC_BLACK; - bool small = HasBit(ss->width, 15); - int w = GB(ss->width, 0, 15); - int x = UnScaleByZoom(ss->x, zoom); - int y = UnScaleByZoom(ss->y, zoom); + bool small = HasBit(ss.width, 15); + int w = GB(ss.width, 0, 15); + int x = UnScaleByZoom(ss.x, zoom); + int y = UnScaleByZoom(ss.y, zoom); int h = VPSM_TOP + (small ? FONT_HEIGHT_SMALL : FONT_HEIGHT_NORMAL) + VPSM_BOTTOM; - SetDParam(0, ss->params[0]); - SetDParam(1, ss->params[1]); + SetDParam(0, ss.params[0]); + SetDParam(1, ss.params[1]); - if (ss->colour != INVALID_COLOUR) { + if (ss.colour != INVALID_COLOUR) { /* Do not draw signs nor station names if they are set invisible */ - if (IsInvisibilitySet(TO_SIGNS) && ss->string != STR_WHITE_SIGN) continue; + if (IsInvisibilitySet(TO_SIGNS) && ss.string != STR_WHITE_SIGN) continue; - if (IsTransparencySet(TO_SIGNS) && ss->string != STR_WHITE_SIGN) { + if (IsTransparencySet(TO_SIGNS) && ss.string != STR_WHITE_SIGN) { /* Don't draw the rectangle. * Real colours need the TC_IS_PALETTE_COLOUR flag. * Otherwise colours from _string_colourmap are assumed. */ - colour = (TextColour)_colour_gradient[ss->colour][6] | TC_IS_PALETTE_COLOUR; + colour = (TextColour)_colour_gradient[ss.colour][6] | TC_IS_PALETTE_COLOUR; } else { /* Draw the rectangle if 'transparent station signs' is off, * or if we are drawing a general text sign (STR_WHITE_SIGN). */ DrawFrameRect( - x, y, x + w, y + h, ss->colour, + x, y, x + w, y + h, ss.colour, IsTransparencySet(TO_SIGNS) ? FR_TRANSPARENT : FR_NONE ); } } - DrawString(x + VPSM_LEFT, x + w - 1 - VPSM_RIGHT, y + VPSM_TOP, ss->string, colour, SA_HOR_CENTER); + DrawString(x + VPSM_LEFT, x + w - 1 - VPSM_RIGHT, y + VPSM_TOP, ss.string, colour, SA_HOR_CENTER); } } @@ -1590,9 +1584,8 @@ void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom if (_vd.tile_sprites_to_draw.size() != 0) ViewportDrawTileSprites(&_vd.tile_sprites_to_draw); - ParentSpriteToDraw *psd_end = _vd.parent_sprites_to_draw.End(); - for (ParentSpriteToDraw *it = _vd.parent_sprites_to_draw.Begin(); it != psd_end; it++) { - _vd.parent_sprites_to_sort.push_back(it); + for (auto &psd : _vd.parent_sprites_to_draw) { + _vd.parent_sprites_to_sort.push_back(&psd); } _vp_sprite_sorter(&_vd.parent_sprites_to_sort); diff --git a/src/viewport_sprite_sorter_sse4.cpp b/src/viewport_sprite_sorter_sse4.cpp index fb78c51c86..212ff12e68 100644 --- a/src/viewport_sprite_sorter_sse4.cpp +++ b/src/viewport_sprite_sorter_sse4.cpp @@ -29,8 +29,8 @@ void ViewportSortParentSpritesSSE41(ParentSpriteToSortVector *psdv) { const __m128i mask_ptest = _mm_setr_epi8(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0); - ParentSpriteToDraw ** const psdvend = psdv->End(); - ParentSpriteToDraw **psd = psdv->Begin(); + auto const psdvend = psdv->end(); + auto psd = psdv->begin(); while (psd != psdvend) { ParentSpriteToDraw * const ps = *psd; @@ -41,7 +41,7 @@ void ViewportSortParentSpritesSSE41(ParentSpriteToSortVector *psdv) ps->comparison_done = true; - for (ParentSpriteToDraw **psd2 = psd + 1; psd2 != psdvend; psd2++) { + for (auto psd2 = psd + 1; psd2 != psdvend; psd2++) { ParentSpriteToDraw * const ps2 = *psd2; if (ps2->comparison_done) continue; @@ -85,7 +85,7 @@ void ViewportSortParentSpritesSSE41(ParentSpriteToSortVector *psdv) /* Move ps2 in front of ps */ ParentSpriteToDraw * const temp = ps2; - for (ParentSpriteToDraw **psd3 = psd2; psd3 > psd; psd3--) { + for (auto psd3 = psd2; psd3 > psd; psd3--) { *psd3 = *(psd3 - 1); } *psd = temp; diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index 33d59effc4..7c59cca7a5 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -174,8 +174,7 @@ struct DropdownWindow : Window { /* Total length of list */ int list_height = 0; - for (const DropDownListItem * const *it = list->Begin(); it != list->End(); ++it) { - const DropDownListItem *item = *it; + for (const DropDownListItem *item : *list) { list_height += item->Height(items_width); } @@ -230,13 +229,10 @@ struct DropdownWindow : Window { int width = nwi->current_x - 4; int pos = this->vscroll->GetPosition(); - const DropDownList *list = this->list; - - for (const DropDownListItem * const *it = list->Begin(); it != list->End(); ++it) { + for (const DropDownListItem *item : *this->list) { /* Skip items that are scrolled up */ if (--pos >= 0) continue; - const DropDownListItem *item = *it; int item_height = item->Height(width); if (y < item_height) { @@ -259,8 +255,7 @@ struct DropdownWindow : Window { int y = r.top + 2; int pos = this->vscroll->GetPosition(); - for (const DropDownListItem * const *it = this->list->Begin(); it != this->list->End(); ++it) { - const DropDownListItem *item = *it; + for (const DropDownListItem *item : *this->list) { int item_height = item->Height(r.right - r.left + 1); /* Skip items that are scrolled up */ @@ -389,8 +384,7 @@ void ShowDropDownListAt(Window *w, const DropDownList *list, int selected, int b /* Total height of list */ uint height = 0; - for (const DropDownListItem * const *it = list->Begin(); it != list->End(); ++it) { - const DropDownListItem *item = *it; + for (const DropDownListItem *item : *list) { height += item->Height(width); if (auto_width) max_item_width = max(max_item_width, item->Width() + 5); } diff --git a/src/window.cpp b/src/window.cpp index a8d1ce75e2..9366b92eb8 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -144,9 +144,9 @@ void WindowDesc::LoadFromConfig() { IniFile *ini = new IniFile(); ini->LoadFromDisk(_windows_file, NO_DIRECTORY); - for (WindowDesc **it = _window_descs->Begin(); it != _window_descs->End(); ++it) { - if ((*it)->ini_key == NULL) continue; - IniLoadWindowSettings(ini, (*it)->ini_key, *it); + for (WindowDesc *wd : *_window_descs) { + if (wd->ini_key == NULL) continue; + IniLoadWindowSettings(ini, wd->ini_key, wd); } delete ini; } @@ -166,13 +166,13 @@ static int CDECL DescSorter(WindowDesc * const *a, WindowDesc * const *b) void WindowDesc::SaveToConfig() { /* Sort the stuff to get a nice ini file on first write */ - QSortT(_window_descs->Begin(), _window_descs->size(), DescSorter); + QSortT(_window_descs->data(), _window_descs->size(), DescSorter); IniFile *ini = new IniFile(); ini->LoadFromDisk(_windows_file, NO_DIRECTORY); - for (WindowDesc **it = _window_descs->Begin(); it != _window_descs->End(); ++it) { - if ((*it)->ini_key == NULL) continue; - IniSaveWindowSettings(ini, (*it)->ini_key, *it); + for (WindowDesc *wd : *_window_descs) { + if (wd->ini_key == NULL) continue; + IniSaveWindowSettings(ini, wd->ini_key, wd); } ini->SaveToDisk(_windows_file); delete ini; @@ -330,8 +330,8 @@ Scrollbar *Window::GetScrollbar(uint widnum) */ const QueryString *Window::GetQueryString(uint widnum) const { - const SmallMap::Pair *query = this->querystrings.Find(widnum); - return query != this->querystrings.End() ? query->second : NULL; + auto query = this->querystrings.Find(widnum); + return query != this->querystrings.end() ? query->second : NULL; } /** @@ -1944,8 +1944,8 @@ static void DecreaseWindowCounters() } /* Handle editboxes */ - for (SmallMap::Pair *it = w->querystrings.Begin(); it != w->querystrings.End(); ++it) { - it->second->HandleEditBox(w, it->first); + for (SmallMap::Pair &pair : w->querystrings) { + pair.second->HandleEditBox(w, pair.first); } w->OnMouseLoop(); @@ -3252,8 +3252,9 @@ void Window::InvalidateData(int data, bool gui_scope) */ void Window::ProcessScheduledInvalidations() { - for (int *data = this->scheduled_invalidation_data.Begin(); this->window_class != WC_INVALID && data != this->scheduled_invalidation_data.End(); data++) { - this->OnInvalidateData(*data, true); + for (int data : this->scheduled_invalidation_data) { + if (this->window_class == WC_INVALID) break; + this->OnInvalidateData(data, true); } this->scheduled_invalidation_data.clear(); } From 6570f7989f5c1fc5a1276505a8e6efce7838efd9 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Sun, 3 Mar 2019 15:20:29 +0000 Subject: [PATCH 68/82] Codechange: Declare SmallVector as an alias for std::vector --- src/core/smallvec_type.hpp | 39 ++------------------------------------ 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 5ec07f2f01..6f86e11cc0 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -45,45 +45,10 @@ inline bool include(std::vector& vec, const T &item) * @tparam T The type of the items stored * @tparam S The steps of allocation */ -template -class SmallVector : public std::vector { -public: - SmallVector() = default; - - /** - * Copy constructor. - * @param other The other vector to copy. - */ - SmallVector(const SmallVector &other) = default; - /** - * Generic copy constructor. - * @param other The other vector to copy. - */ - template - SmallVector(const SmallVector &other) : std::vector(other) - { - } - /** - * Assignment. - * @param other The other vector to assign. - */ - SmallVector &operator=(const SmallVector &other) = default; - - /** - * Generic assignment. - * @param other The other vector to assign. - */ - template - SmallVector &operator=(const SmallVector &other) - { - std::vector::operator=(other); - return *this; - } - - ~SmallVector() = default; -}; +template +using SmallVector = std::vector; /** * Helper function to get the index of an item From c01a2e2a81d8e7bcd47d46292ed0b7d452081c31 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Sun, 3 Mar 2019 17:30:09 +0000 Subject: [PATCH 69/82] Codechange: Removed SmallVector completely --- src/animated_tile.cpp | 2 +- src/company_gui.cpp | 2 +- src/core/pool_type.hpp | 2 +- src/core/smallmap_type.hpp | 2 +- src/core/smallstack_type.hpp | 2 +- src/core/smallvec_type.hpp | 27 +++++---------------------- src/economy.cpp | 2 +- src/engine_base.h | 2 +- src/fios.cpp | 2 +- src/fios.h | 2 +- src/group_gui.cpp | 2 +- src/hotkeys.cpp | 4 ++-- src/hotkeys.h | 2 +- src/industry_cmd.cpp | 2 +- src/industry_gui.cpp | 2 +- src/language.h | 2 +- src/linkgraph/linkgraph.h | 2 +- src/linkgraph/linkgraphjob.h | 2 +- src/music/midifile.hpp | 2 +- src/network/core/address.h | 2 +- src/network/core/tcp_connect.cpp | 2 +- src/network/core/tcp_http.cpp | 2 +- src/network/network_content.h | 10 +++++----- src/network/network_content_gui.cpp | 2 +- src/network/network_gui.cpp | 2 +- src/newgrf.cpp | 8 ++++---- src/newgrf.h | 4 ++-- src/newgrf_commons.cpp | 2 +- src/newgrf_commons.h | 2 +- src/newgrf_config.h | 2 +- src/newgrf_debug.h | 2 +- src/newgrf_debug_gui.cpp | 4 ++-- src/newgrf_engine.cpp | 4 ++-- src/newgrf_sound.cpp | 2 +- src/newgrf_text.cpp | 4 ++-- src/newgrf_text.h | 4 ++-- src/object_base.h | 2 +- src/object_cmd.cpp | 2 +- src/openttd.cpp | 4 ++-- src/rail.h | 2 +- src/rail_cmd.cpp | 4 ++-- src/saveload/afterload.cpp | 4 ++-- src/saveload/animated_tile_sl.cpp | 2 +- src/saveload/labelmaps_sl.cpp | 4 ++-- src/saveload/linkgraph_sl.cpp | 2 +- src/saveload/oldloader_sl.cpp | 2 +- src/saveload/waypoint_sl.cpp | 2 +- src/script/squirrel_helper.hpp | 4 ++-- src/settingsgen/settingsgen.cpp | 2 +- src/sortlist_type.h | 2 +- src/station_cmd.cpp | 14 +++++++------- src/station_gui.cpp | 4 ++-- src/strgen/strgen_base.cpp | 2 +- src/string.cpp | 4 ++-- src/stringfilter_type.h | 2 +- src/subsidy.cpp | 2 +- src/texteff.cpp | 2 +- src/textfile_gui.h | 12 ++++++------ src/timetable_cmd.cpp | 2 +- src/train_cmd.cpp | 2 +- src/train_gui.cpp | 2 +- src/vehicle_cmd.cpp | 3 +-- src/vehicle_func.h | 2 +- src/vehicle_gui.cpp | 4 ++-- src/vehiclelist.h | 2 +- src/viewport.cpp | 8 ++++---- src/viewport_sprite_sorter.h | 2 +- src/window.cpp | 4 ++-- src/window_gui.h | 2 +- 69 files changed, 109 insertions(+), 127 deletions(-) diff --git a/src/animated_tile.cpp b/src/animated_tile.cpp index e2a5553711..24543529df 100644 --- a/src/animated_tile.cpp +++ b/src/animated_tile.cpp @@ -19,7 +19,7 @@ #include "safeguards.h" /** The table/list with animated tiles. */ -SmallVector _animated_tiles; +std::vector _animated_tiles; /** * Removes the given tile from the animated tile table. diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 6b67f373ba..e5dbc86a42 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -562,7 +562,7 @@ private: uint rows; uint line_height; GUIGroupList groups; - SmallVector indents; + std::vector indents; Scrollbar *vscroll; void ShowColourDropDownMenu(uint32 widget) diff --git a/src/core/pool_type.hpp b/src/core/pool_type.hpp index a6f7e4fe8b..38f314ebbf 100644 --- a/src/core/pool_type.hpp +++ b/src/core/pool_type.hpp @@ -26,7 +26,7 @@ enum PoolType { }; DECLARE_ENUM_AS_BIT_SET(PoolType) -typedef SmallVector PoolVector; ///< Vector of pointers to PoolBase +typedef std::vector PoolVector; ///< Vector of pointers to PoolBase /** Base class for base of all pools. */ struct PoolBase { diff --git a/src/core/smallmap_type.hpp b/src/core/smallmap_type.hpp index 8cc96302f3..debd4165e6 100644 --- a/src/core/smallmap_type.hpp +++ b/src/core/smallmap_type.hpp @@ -40,7 +40,7 @@ struct SmallPair { * @see SmallVector */ template -struct SmallMap : SmallVector, S> { +struct SmallMap : std::vector > { typedef ::SmallPair Pair; typedef Pair *iterator; typedef const Pair *const_iterator; diff --git a/src/core/smallstack_type.hpp b/src/core/smallstack_type.hpp index 5a9d329a9f..c273fdec46 100644 --- a/src/core/smallstack_type.hpp +++ b/src/core/smallstack_type.hpp @@ -87,7 +87,7 @@ private: Tindex first_free; ThreadMutex *mutex; - SmallVector data; + std::vector data; }; /** diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 6f86e11cc0..19dab22286 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -34,22 +34,6 @@ inline bool include(std::vector& vec, const T &item) return is_member; } - -/** - * Simple vector template class. - * - * @note There are no asserts in the class so you have - * to care about that you grab an item which is - * inside the list. - * - * @tparam T The type of the items stored - * @tparam S The steps of allocation - */ - - -template -using SmallVector = std::vector; - /** * Helper function to get the index of an item * Consider using std::set, std::unordered_set or std::flat_set in new code @@ -73,19 +57,18 @@ int find_index(std::vector const& vec, T const& item) * Consider using std::back_inserter in new code * * @param vec A reference to the vector to be extended - * @param num The number of elements to default-construct + * @param num Number of elements to be default-constructed * * @return Pointer to the first new element */ template -inline T* grow(std::vector& vec, std::size_t num) +T* grow(std::vector& vec, std::size_t num) { - const std::size_t pos = vec.size(); + std::size_t const pos = vec.size(); vec.resize(pos + num); return vec.data() + pos; } - /** * Simple vector template class, with automatic free. * @@ -97,7 +80,7 @@ inline T* grow(std::vector& vec, std::size_t num) * @param S The steps of allocation */ template -class AutoFreeSmallVector : public SmallVector { +class AutoFreeSmallVector : public std::vector { public: ~AutoFreeSmallVector() { @@ -128,7 +111,7 @@ public: * @param S The steps of allocation */ template -class AutoDeleteSmallVector : public SmallVector { +class AutoDeleteSmallVector : public std::vector { public: ~AutoDeleteSmallVector() { diff --git a/src/economy.cpp b/src/economy.cpp index cab605f9af..d1ebd8a042 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -77,7 +77,7 @@ static inline int32 BigMulS(const int32 a, const int32 b, const uint8 shift) return (int32)((int64)a * (int64)b >> shift); } -typedef SmallVector SmallIndustryList; +typedef std::vector SmallIndustryList; /** * Score info, values used for computing the detailed performance rating. diff --git a/src/engine_base.h b/src/engine_base.h index 25c6bfbeb9..aaf88d9453 100644 --- a/src/engine_base.h +++ b/src/engine_base.h @@ -156,7 +156,7 @@ struct EngineIDMapping { * Stores the mapping of EngineID to the internal id of newgrfs. * Note: This is not part of Engine, as the data in the EngineOverrideManager and the engine pool get resetted in different cases. */ -struct EngineOverrideManager : SmallVector { +struct EngineOverrideManager : std::vector { static const uint NUM_DEFAULT_ENGINES; ///< Number of default entries void ResetToDefaultMapping(); diff --git a/src/fios.cpp b/src/fios.cpp index c27e6d8afd..cb157492e9 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -655,7 +655,7 @@ struct ScenarioIdentifier { /** * Scanner to find the unique IDs of scenarios */ -class ScenarioScanner : protected FileScanner, public SmallVector { +class ScenarioScanner : protected FileScanner, public std::vector { bool scanned; ///< Whether we've already scanned public: /** Initialise */ diff --git a/src/fios.h b/src/fios.h index cc69178137..52d85ad9b5 100644 --- a/src/fios.h +++ b/src/fios.h @@ -198,7 +198,7 @@ public: void BuildFileList(AbstractFileType abstract_filetype, SaveLoadOperation fop); const FiosItem *FindItem(const char *file); - SmallVector files; ///< The list of files. + std::vector files; ///< The list of files. }; enum SortingBits { diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 59b5112ff1..ca0b194f38 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -121,7 +121,7 @@ private: uint tiny_step_height; ///< Step height for the group list Scrollbar *group_sb; - SmallVector indents; ///< Indentation levels + std::vector indents; ///< Indentation levels Dimension column_size[VGC_END]; ///< Size of the columns in the group list. diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp index 0acc11c473..3093a8229a 100644 --- a/src/hotkeys.cpp +++ b/src/hotkeys.cpp @@ -24,7 +24,7 @@ char *_hotkeys_file; * List of all HotkeyLists. * This is a pointer to ensure initialisation order with the various static HotkeyList instances. */ -static SmallVector *_hotkey_lists = NULL; +static std::vector *_hotkey_lists = NULL; /** String representation of a keycode */ struct KeycodeNames { @@ -254,7 +254,7 @@ void Hotkey::AddKeycode(uint16 keycode) HotkeyList::HotkeyList(const char *ini_group, Hotkey *items, GlobalHotkeyHandlerFunc global_hotkey_handler) : global_hotkey_handler(global_hotkey_handler), ini_group(ini_group), items(items) { - if (_hotkey_lists == NULL) _hotkey_lists = new SmallVector(); + if (_hotkey_lists == NULL) _hotkey_lists = new std::vector(); _hotkey_lists->push_back(this); } diff --git a/src/hotkeys.h b/src/hotkeys.h index 25a489b3f3..fd729a47a9 100644 --- a/src/hotkeys.h +++ b/src/hotkeys.h @@ -29,7 +29,7 @@ struct Hotkey { const char *name; int num; - SmallVector keycodes; + std::vector keycodes; }; #define HOTKEY_LIST_END Hotkey((uint16)0, NULL, -1) diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 403e57a96f..c20b0a05bb 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1884,7 +1884,7 @@ static CommandCost CreateNewIndustryHelper(TileIndex tile, IndustryType type, Do *ip = NULL; - SmallVector object_areas(_cleared_object_areas); + std::vector object_areas(_cleared_object_areas); CommandCost ret = CheckIfIndustryTilesAreFree(tile, it, itspec_index, type, random_initial_bits, founder, creation_type, &custom_shape_check); _cleared_object_areas = object_areas; if (ret.Failed()) return ret; diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 5bcc03bdb1..ce8ac7fa30 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -2155,7 +2155,7 @@ next_cargo: ; struct IndustryCargoesWindow : public Window { static const int HOR_TEXT_PADDING, VERT_TEXT_PADDING; - typedef SmallVector Fields; + typedef std::vector Fields; Fields fields; ///< Fields to display in the #WID_IC_PANEL. uint ind_cargo; ///< If less than #NUM_INDUSTRYTYPES, an industry type, else a cargo id + NUM_INDUSTRYTYPES. diff --git a/src/language.h b/src/language.h index 8df59f74ff..be2d37084b 100644 --- a/src/language.h +++ b/src/language.h @@ -96,7 +96,7 @@ struct LanguageMetadata : public LanguagePackHeader { }; /** Type for the list of language meta data. */ -typedef SmallVector LanguageList; +typedef std::vector LanguageList; /** The actual list of language meta data. */ extern LanguageList _languages; diff --git a/src/linkgraph/linkgraph.h b/src/linkgraph/linkgraph.h index 1900c0b1f5..3283eb9bf2 100644 --- a/src/linkgraph/linkgraph.h +++ b/src/linkgraph/linkgraph.h @@ -435,7 +435,7 @@ public: void RemoveEdge(NodeID to); }; - typedef SmallVector NodeVector; + typedef std::vector NodeVector; typedef SmallMatrix EdgeMatrix; /** Minimum effective distance for timeout calculation. */ diff --git a/src/linkgraph/linkgraphjob.h b/src/linkgraph/linkgraphjob.h index b4587a7842..b47dd70b9b 100644 --- a/src/linkgraph/linkgraphjob.h +++ b/src/linkgraph/linkgraphjob.h @@ -50,7 +50,7 @@ private: void Init(uint supply); }; - typedef SmallVector NodeAnnotationVector; + typedef std::vector NodeAnnotationVector; typedef SmallMatrix EdgeAnnotationMatrix; friend const SaveLoad *GetLinkGraphJobDesc(); diff --git a/src/music/midifile.hpp b/src/music/midifile.hpp index 0016be86ca..e0e5170b7f 100644 --- a/src/music/midifile.hpp +++ b/src/music/midifile.hpp @@ -24,7 +24,7 @@ struct MidiFile { struct DataBlock { uint32 ticktime; ///< tick number since start of file this block should be triggered at uint32 realtime; ///< real-time (microseconds) since start of file this block should be triggered at - SmallVector data; ///< raw midi data contained in block + std::vector data; ///< raw midi data contained in block DataBlock(uint32 _ticktime = 0) : ticktime(_ticktime) { } }; struct TempoChange { diff --git a/src/network/core/address.h b/src/network/core/address.h index b5c78c79b7..f6d7870bf6 100644 --- a/src/network/core/address.h +++ b/src/network/core/address.h @@ -18,7 +18,7 @@ #include "../../core/smallmap_type.hpp" class NetworkAddress; -typedef SmallVector NetworkAddressList; ///< Type for a list of addresses. +typedef std::vector NetworkAddressList; ///< Type for a list of addresses. typedef SmallMap SocketList; ///< Type for a mapping between address and socket. /** diff --git a/src/network/core/tcp_connect.cpp b/src/network/core/tcp_connect.cpp index d699cf60d0..d76042821a 100644 --- a/src/network/core/tcp_connect.cpp +++ b/src/network/core/tcp_connect.cpp @@ -19,7 +19,7 @@ #include "../../safeguards.h" /** List of connections that are currently being created */ -static SmallVector _tcp_connecters; +static std::vector _tcp_connecters; /** * Create a new connecter for the given address diff --git a/src/network/core/tcp_http.cpp b/src/network/core/tcp_http.cpp index cec77fb147..3e9cc81415 100644 --- a/src/network/core/tcp_http.cpp +++ b/src/network/core/tcp_http.cpp @@ -21,7 +21,7 @@ #include "../../safeguards.h" /** List of open HTTP connections. */ -static SmallVector _http_connections; +static std::vector _http_connections; /** * Start the querying diff --git a/src/network/network_content.h b/src/network/network_content.h index 26300c4ca2..e62c921e6a 100644 --- a/src/network/network_content.h +++ b/src/network/network_content.h @@ -16,9 +16,9 @@ #include "core/tcp_http.h" /** Vector with content info */ -typedef SmallVector ContentVector; +typedef std::vector ContentVector; /** Vector with constant content info */ -typedef SmallVector ConstContentVector; +typedef std::vector ConstContentVector; /** Iterator for the content vector */ typedef ContentInfo **ContentIterator; @@ -66,11 +66,11 @@ struct ContentCallback { */ class ClientNetworkContentSocketHandler : public NetworkContentSocketHandler, ContentCallback, HTTPCallback { protected: - typedef SmallVector ContentIDList; ///< List of content IDs to (possibly) select. - SmallVector callbacks; ///< Callbacks to notify "the world" + typedef std::vector ContentIDList; ///< List of content IDs to (possibly) select. + std::vector callbacks; ///< Callbacks to notify "the world" ContentIDList requested; ///< ContentIDs we already requested (so we don't do it again) ContentVector infos; ///< All content info we received - SmallVector http_response; ///< The HTTP response to the requests we've been doing + std::vector http_response; ///< The HTTP response to the requests we've been doing int http_response_index; ///< Where we are, in the response, with handling it FILE *curFile; ///< Currently downloaded file diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 9ea56d7471..09168185ac 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -160,7 +160,7 @@ void BaseNetworkContentDownloadStatusWindow::OnDownloadProgress(const ContentInf /** Window for showing the download status of content */ struct NetworkContentDownloadStatusWindow : public BaseNetworkContentDownloadStatusWindow { private: - SmallVector receivedTypes; ///< Types we received so we can update their cache + std::vector receivedTypes; ///< Types we received so we can update their cache public: /** diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index a8dd2aa526..b35e915286 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1728,7 +1728,7 @@ struct NetworkClientListPopupWindow : Window { uint sel_index; ClientID client_id; Point desired_location; - SmallVector actions; ///< Actions to execute + std::vector actions; ///< Actions to execute /** * Add an action to the list of actions to execute. diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 8507d9d611..e45f34b76e 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -65,7 +65,7 @@ * served as subject to the initial testing of this codec. */ /** List of all loaded GRF files */ -static SmallVector _grf_files; +static std::vector _grf_files; /** Miscellaneous GRF features, set by Action 0x0D, parameter 0x9E */ byte _misc_grf_features = 0; @@ -459,7 +459,7 @@ struct StringIDMapping { StringID source; ///< Source StringID (GRF local). StringID *target; ///< Destination for mapping result. }; -typedef SmallVector StringIDMappingVector; +typedef std::vector StringIDMappingVector; static StringIDMappingVector _string_to_grf_mapping; /** @@ -1901,7 +1901,7 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte /* On error, bail out immediately. Temporary GRF data was already freed */ if (_cur.skip_sprites < 0) return CIR_DISABLED; - static SmallVector tmp_layout; + static std::vector tmp_layout; tmp_layout.clear(); for (;;) { /* no relative bounding box support */ @@ -4787,7 +4787,7 @@ static void NewSpriteGroup(ByteReader *buf) case 2: group->size = DSG_SIZE_DWORD; varsize = 4; break; } - static SmallVector adjusts; + static std::vector adjusts; adjusts.clear(); /* Loop through the var adjusts. Unfortunately we don't know how many we have diff --git a/src/newgrf.h b/src/newgrf.h index 1ab55dd044..d58fe870fe 100644 --- a/src/newgrf.h +++ b/src/newgrf.h @@ -122,10 +122,10 @@ struct GRFFile : ZeroedMemoryAllocator { GRFLabel *label; ///< Pointer to the first label. This is a linked list, not an array. - SmallVector cargo_list; ///< Cargo translation table (local ID -> label) + std::vector cargo_list; ///< Cargo translation table (local ID -> label) uint8 cargo_map[NUM_CARGO]; ///< Inverse cargo translation table (CargoID -> local ID) - SmallVector railtype_list; ///< Railtype translation table + std::vector railtype_list; ///< Railtype translation table RailTypeByte railtype_map[RAILTYPE_END]; CanalProperties canal_local_properties[CF_END]; ///< Canal properties as set by this NewGRF diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp index 5626c6543e..e05217fee9 100644 --- a/src/newgrf_commons.cpp +++ b/src/newgrf_commons.cpp @@ -579,7 +579,7 @@ bool Convert8bitBooleanCallback(const GRFFile *grffile, uint16 cbid, uint16 cb_r } -/* static */ SmallVector NewGRFSpriteLayout::result_seq; +/* static */ std::vector NewGRFSpriteLayout::result_seq; /** * Clone the building sprites of a spritelayout. diff --git a/src/newgrf_commons.h b/src/newgrf_commons.h index c7ca609fa9..819e84451c 100644 --- a/src/newgrf_commons.h +++ b/src/newgrf_commons.h @@ -170,7 +170,7 @@ struct NewGRFSpriteLayout : ZeroedMemoryAllocator, DrawTileSprites { } private: - static SmallVector result_seq; ///< Temporary storage when preprocessing spritelayouts. + static std::vector result_seq; ///< Temporary storage when preprocessing spritelayouts. }; /** diff --git a/src/newgrf_config.h b/src/newgrf_config.h index 4266dd1fdf..6396fa368c 100644 --- a/src/newgrf_config.h +++ b/src/newgrf_config.h @@ -172,7 +172,7 @@ struct GRFConfig : ZeroedMemoryAllocator { uint8 num_params; ///< Number of used parameters uint8 num_valid_params; ///< NOSAVE: Number of valid parameters (action 0x14) uint8 palette; ///< GRFPalette, bitset - SmallVector param_info; ///< NOSAVE: extra information about the parameters + std::vector param_info; ///< NOSAVE: extra information about the parameters bool has_param_defaults; ///< NOSAVE: did this newgrf specify any defaults for it's parameters struct GRFConfig *next; ///< NOSAVE: Next item in the linked list diff --git a/src/newgrf_debug.h b/src/newgrf_debug.h index 6e514c4ce1..b73c93266f 100644 --- a/src/newgrf_debug.h +++ b/src/newgrf_debug.h @@ -29,7 +29,7 @@ struct NewGrfDebugSpritePicker { NewGrfDebugSpritePickerMode mode; ///< Current state void *clicked_pixel; ///< Clicked pixel (pointer to blitter buffer) uint32 click_time; ///< Realtime tick when clicked to detect next frame - SmallVector sprites; ///< Sprites found + std::vector sprites; ///< Sprites found }; extern NewGrfDebugSpritePicker _newgrf_debug_sprite_picker; diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index f8745440c1..2ea9a6d88d 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -47,7 +47,7 @@ #include "safeguards.h" /** The sprite picker. */ -NewGrfDebugSpritePicker _newgrf_debug_sprite_picker = { SPM_NONE, NULL, 0, SmallVector() }; +NewGrfDebugSpritePicker _newgrf_debug_sprite_picker = { SPM_NONE, NULL, 0, std::vector() }; /** * Get the feature index related to the window number. @@ -894,7 +894,7 @@ struct SpriteAlignerWindow : Window { const NWidgetBase *nwid = this->GetWidget(widget); int step_size = nwid->resize_y; - SmallVector &list = _newgrf_debug_sprite_picker.sprites; + std::vector &list = _newgrf_debug_sprite_picker.sprites; int max = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), list.size()); int y = r.top + WD_FRAMERECT_TOP; diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 0c7e4314b8..a9929540a9 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -1185,7 +1185,7 @@ struct ListOrderChange { uint target; ///< local ID }; -static SmallVector _list_order_changes; +static std::vector _list_order_changes; /** * Record a vehicle ListOrderChange. @@ -1226,7 +1226,7 @@ static int CDECL EnginePreSort(const EngineID *a, const EngineID *b) void CommitVehicleListOrderChanges() { /* Pre-sort engines by scope-grfid and local index */ - SmallVector ordering; + std::vector ordering; Engine *e; FOR_ALL_ENGINES(e) { ordering.push_back(e->index); diff --git a/src/newgrf_sound.cpp b/src/newgrf_sound.cpp index e9f1163c69..c37d6b4ed4 100644 --- a/src/newgrf_sound.cpp +++ b/src/newgrf_sound.cpp @@ -22,7 +22,7 @@ #include "safeguards.h" -static SmallVector _sounds; +static std::vector _sounds; /** diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp index 57f2ce5e4c..e1f73a5c3c 100644 --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -167,7 +167,7 @@ static byte _currentLangID = GRFLX_ENGLISH; ///< by default, english is used. */ int LanguageMap::GetMapping(int newgrf_id, bool gender) const { - const SmallVector &map = gender ? this->gender_map : this->case_map; + const std::vector &map = gender ? this->gender_map : this->case_map; for (const Mapping &m : map) { if (m.newgrf_id == newgrf_id) return m.openttd_id; } @@ -182,7 +182,7 @@ int LanguageMap::GetMapping(int newgrf_id, bool gender) const */ int LanguageMap::GetReverseMapping(int openttd_id, bool gender) const { - const SmallVector &map = gender ? this->gender_map : this->case_map; + const std::vector &map = gender ? this->gender_map : this->case_map; for (const Mapping &m : map) { if (m.openttd_id == openttd_id) return m.newgrf_id; } diff --git a/src/newgrf_text.h b/src/newgrf_text.h index 033967d307..601535d991 100644 --- a/src/newgrf_text.h +++ b/src/newgrf_text.h @@ -57,8 +57,8 @@ struct LanguageMap { * the genders/cases/plural OpenTTD IDs to the NewGRF's internal IDs. In this * case a NewGRF developer/translator might want a different translation for * both cases. Thus we are basically implementing a multi-map. */ - SmallVector gender_map; ///< Mapping of NewGRF and OpenTTD IDs for genders. - SmallVector case_map; ///< Mapping of NewGRF and OpenTTD IDs for cases. + std::vector gender_map; ///< Mapping of NewGRF and OpenTTD IDs for genders. + std::vector case_map; ///< Mapping of NewGRF and OpenTTD IDs for cases. int plural_form; ///< The plural form used for this language. int GetMapping(int newgrf_id, bool gender) const; diff --git a/src/object_base.h b/src/object_base.h index 47e5a7f94c..228eeaa2dc 100644 --- a/src/object_base.h +++ b/src/object_base.h @@ -92,6 +92,6 @@ struct ClearedObjectArea { }; ClearedObjectArea *FindClearedObject(TileIndex tile); -extern SmallVector _cleared_object_areas; +extern std::vector _cleared_object_areas; #endif /* OBJECT_BASE_H */ diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 26f0fc4e80..92e6d6ab2a 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -442,7 +442,7 @@ static void ReallyClearObjectTile(Object *o) delete o; } -SmallVector _cleared_object_areas; +std::vector _cleared_object_areas; /** * Find the entry in _cleared_object_areas which occupies a certain tile. diff --git a/src/openttd.cpp b/src/openttd.cpp index 5c7af2dfcb..29319236af 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1174,7 +1174,7 @@ static void CheckCaches() if (_debug_desync_level <= 1) return; /* Check the town caches. */ - SmallVector old_town_caches; + std::vector old_town_caches; Town *t; FOR_ALL_TOWNS(t) { old_town_caches.push_back(t->cache); @@ -1193,7 +1193,7 @@ static void CheckCaches() } /* Check company infrastructure cache. */ - SmallVector old_infrastructure; + std::vector old_infrastructure; Company *c; FOR_ALL_COMPANIES(c) old_infrastructure.push_back(c->infrastructure); diff --git a/src/rail.h b/src/rail.h index ac5805d098..b08f0650a0 100644 --- a/src/rail.h +++ b/src/rail.h @@ -118,7 +118,7 @@ enum RailFenceOffset { }; /** List of rail type labels. */ -typedef SmallVector RailTypeLabelList; +typedef std::vector RailTypeLabelList; /** * This struct contains all the info that is needed to draw and construct tracks. diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 8e996bbe3c..4257b5258f 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -41,7 +41,7 @@ #include "safeguards.h" /** Helper type for lists/vectors of trains */ -typedef SmallVector TrainList; +typedef std::vector TrainList; RailtypeInfo _railtypes[RAILTYPE_END]; RailType _sorted_railtypes[RAILTYPE_END]; @@ -1603,7 +1603,7 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 continue; } - SmallVector vehicles_affected; + std::vector vehicles_affected; /* Vehicle on the tile when not converting Rail <-> ElRail * Tunnels and bridges have special check later */ diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 3efed69e45..b4e3ce9865 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -2195,7 +2195,7 @@ bool AfterLoadGame() /* Animated tiles would sometimes not be actually animated or * in case of old savegames duplicate. */ - extern SmallVector _animated_tiles; + extern std::vector _animated_tiles; for (auto tile = _animated_tiles.begin(); tile < _animated_tiles.end(); /* Nothing */) { /* Remove if tile is not animated */ @@ -2939,7 +2939,7 @@ bool AfterLoadGame() * So, make articulated parts catch up. */ RoadVehicle *v; bool roadside = _settings_game.vehicle.road_side == 1; - SmallVector skip_frames; + std::vector skip_frames; FOR_ALL_ROADVEHICLES(v) { if (!v->IsFrontEngine()) continue; skip_frames.clear(); diff --git a/src/saveload/animated_tile_sl.cpp b/src/saveload/animated_tile_sl.cpp index 4d4ed69a96..f82950c50f 100644 --- a/src/saveload/animated_tile_sl.cpp +++ b/src/saveload/animated_tile_sl.cpp @@ -18,7 +18,7 @@ #include "../safeguards.h" -extern SmallVector _animated_tiles; +extern std::vector _animated_tiles; /** * Save the ANIT chunk. diff --git a/src/saveload/labelmaps_sl.cpp b/src/saveload/labelmaps_sl.cpp index 3d930e7684..dd71f1c3e7 100644 --- a/src/saveload/labelmaps_sl.cpp +++ b/src/saveload/labelmaps_sl.cpp @@ -17,7 +17,7 @@ #include "../safeguards.h" -static SmallVector _railtype_list; +static std::vector _railtype_list; /** * Test if any saved rail type labels are different to the currently loaded @@ -42,7 +42,7 @@ static bool NeedRailTypeConversion() void AfterLoadLabelMaps() { if (NeedRailTypeConversion()) { - SmallVector railtype_conversion_map; + std::vector railtype_conversion_map; for (uint i = 0; i < _railtype_list.size(); i++) { RailType r = GetRailTypeByLabel(_railtype_list[i]); diff --git a/src/saveload/linkgraph_sl.cpp b/src/saveload/linkgraph_sl.cpp index 842ad6d429..90c056ebaa 100644 --- a/src/saveload/linkgraph_sl.cpp +++ b/src/saveload/linkgraph_sl.cpp @@ -51,7 +51,7 @@ const SaveLoad *GetLinkGraphDesc() */ const SaveLoad *GetLinkGraphJobDesc() { - static SmallVector saveloads; + static std::vector saveloads; static const char *prefix = "linkgraph."; /* Build the SaveLoad array on first call and don't touch it later on */ diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp index 7b445858e8..a93006f1fa 100644 --- a/src/saveload/oldloader_sl.cpp +++ b/src/saveload/oldloader_sl.cpp @@ -491,7 +491,7 @@ static inline uint RemapOrderIndex(uint x) return _savegame_type == SGT_TTO ? (x - 0x1AC4) / 2 : (x - 0x1C18) / 2; } -extern SmallVector _animated_tiles; +extern std::vector _animated_tiles; extern char *_old_name_array; static uint32 _old_town_index; diff --git a/src/saveload/waypoint_sl.cpp b/src/saveload/waypoint_sl.cpp index d7701c8af8..1670864676 100644 --- a/src/saveload/waypoint_sl.cpp +++ b/src/saveload/waypoint_sl.cpp @@ -42,7 +42,7 @@ struct OldWaypoint { }; /** Temporary array with old waypoints. */ -static SmallVector _old_waypoints; +static std::vector _old_waypoints; /** * Update the waypoint orders to get the new waypoint ID. diff --git a/src/script/squirrel_helper.hpp b/src/script/squirrel_helper.hpp index 775fe142ee..add6b49c1b 100644 --- a/src/script/squirrel_helper.hpp +++ b/src/script/squirrel_helper.hpp @@ -29,7 +29,7 @@ namespace SQConvert { * comes out of scope. Useful to make sure you can use stredup(), * without leaking memory. */ - struct SQAutoFreePointers : SmallVector { + struct SQAutoFreePointers : std::vector { ~SQAutoFreePointers() { for (uint i = 0; i < std::vector::size(); i++) free(std::vector::operator[](i)); @@ -132,7 +132,7 @@ namespace SQConvert { sq_pushobject(vm, obj); sq_pushnull(vm); - SmallVector data; + std::vector data; while (SQ_SUCCEEDED(sq_next(vm, -2))) { SQInteger tmp; diff --git a/src/settingsgen/settingsgen.cpp b/src/settingsgen/settingsgen.cpp index f52fe54268..bf41161b41 100644 --- a/src/settingsgen/settingsgen.cpp +++ b/src/settingsgen/settingsgen.cpp @@ -152,7 +152,7 @@ private: return num_blocks > 0 && this->output_buffer[num_blocks - 1].HasRoom(); } - typedef SmallVector OutputBufferVector; ///< Vector type for output buffers. + typedef std::vector OutputBufferVector; ///< Vector type for output buffers. OutputBufferVector output_buffer; ///< Vector of blocks containing the stored output. }; diff --git a/src/sortlist_type.h b/src/sortlist_type.h index 23a5580180..f5036903be 100644 --- a/src/sortlist_type.h +++ b/src/sortlist_type.h @@ -47,7 +47,7 @@ struct Filtering { * @tparam F Type of data fed as additional value to the filter function. @see FilterFunction */ template -class GUIList : public SmallVector { +class GUIList : public std::vector { public: typedef int CDECL SortFunction(const T*, const T*); ///< Signature of sort function. typedef bool CDECL FilterFunction(const T*, F); ///< Signature of filter function. diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 63e3384b04..5dfba2d196 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -887,7 +887,7 @@ static CommandCost CheckFlatLandAirport(AirportTileTableIterator tile_iter, DoCo * @param numtracks Number of platforms. * @return The cost in case of success, or an error code if it failed. */ -static CommandCost CheckFlatLandRailStation(TileArea tile_area, DoCommandFlag flags, Axis axis, StationID *station, RailType rt, SmallVector &affected_vehicles, StationClassID spec_class, byte spec_index, byte plat_len, byte numtracks) +static CommandCost CheckFlatLandRailStation(TileArea tile_area, DoCommandFlag flags, Axis axis, StationID *station, RailType rt, std::vector &affected_vehicles, StationClassID spec_class, byte spec_index, byte plat_len, byte numtracks) { CommandCost cost(EXPENSES_CONSTRUCTION); int allowed_z = -1; @@ -1310,7 +1310,7 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32 /* Make sure the area below consists of clear tiles. (OR tiles belonging to a certain rail station) */ StationID est = INVALID_STATION; - SmallVector affected_vehicles; + std::vector affected_vehicles; /* Clear the land below the station. */ CommandCost cost = CheckFlatLandRailStation(new_location, flags, axis, &est, rt, affected_vehicles, spec_class, spec_index, plat_len, numtracks); if (cost.Failed()) return cost; @@ -1547,7 +1547,7 @@ restart: * @return the number of cleared tiles or an error. */ template -CommandCost RemoveFromRailBaseStation(TileArea ta, SmallVector &affected_stations, DoCommandFlag flags, Money removal_cost, bool keep_rail) +CommandCost RemoveFromRailBaseStation(TileArea ta, std::vector &affected_stations, DoCommandFlag flags, Money removal_cost, bool keep_rail) { /* Count of the number of tiles removed */ int quantity = 0; @@ -1660,7 +1660,7 @@ CommandCost CmdRemoveFromRailStation(TileIndex start, DoCommandFlag flags, uint3 if (start >= MapSize() || end >= MapSize()) return CMD_ERROR; TileArea ta(start, end); - SmallVector affected_stations; + std::vector affected_stations; CommandCost ret = RemoveFromRailBaseStation(ta, affected_stations, flags, _price[PR_CLEAR_STATION_RAIL], HasBit(p2, 0)); if (ret.Failed()) return ret; @@ -1694,7 +1694,7 @@ CommandCost CmdRemoveFromRailWaypoint(TileIndex start, DoCommandFlag flags, uint if (start >= MapSize() || end >= MapSize()) return CMD_ERROR; TileArea ta(start, end); - SmallVector affected_stations; + std::vector affected_stations; return RemoveFromRailBaseStation(ta, affected_stations, flags, _price[PR_CLEAR_WAYPOINT_RAIL], HasBit(p2, 0)); } @@ -1727,7 +1727,7 @@ CommandCost RemoveRailStation(T *st, DoCommandFlag flags, Money removal_cost) TILE_AREA_LOOP(tile, ta) { /* only remove tiles that are actually train station tiles */ if (st->TileBelongsToRailStation(tile)) { - SmallVector affected_stations; // dummy + std::vector affected_stations; // dummy CommandCost ret = RemoveFromRailBaseStation(TileArea(tile, 1, 1), affected_stations, flags, removal_cost, false); if (ret.Failed()) return ret; cost.AddCost(ret); @@ -3521,7 +3521,7 @@ void DeleteStaleLinks(Station *from) /* Have all vehicles refresh their next hops before deciding to * remove the node. */ OrderList *l; - SmallVector vehicles; + std::vector vehicles; FOR_ALL_ORDER_LISTS(l) { bool found_from = false; bool found_to = false; diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 98ac80df4b..92c186a2ec 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -2116,8 +2116,8 @@ struct TileAndStation { StationID station; ///< StationID }; -static SmallVector _deleted_stations_nearby; -static SmallVector _stations_nearby_list; +static std::vector _deleted_stations_nearby; +static std::vector _stations_nearby_list; /** * Add station on this tile to _stations_nearby_list if it's fully within the diff --git a/src/strgen/strgen_base.cpp b/src/strgen/strgen_base.cpp index 6c835782c8..f0dc03aa0b 100644 --- a/src/strgen/strgen_base.cpp +++ b/src/strgen/strgen_base.cpp @@ -235,7 +235,7 @@ static ParsedCommandStruct _cur_pcs; static int _cur_argidx; /** The buffer for writing a single string. */ -struct Buffer : SmallVector { +struct Buffer : std::vector { /** * Convenience method for adding a byte. * @param value The value to add. diff --git a/src/string.cpp b/src/string.cpp index 72254a877b..7c16489bf5 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -624,8 +624,8 @@ class IcuStringIterator : public StringIterator icu::BreakIterator *char_itr; ///< ICU iterator for characters. icu::BreakIterator *word_itr; ///< ICU iterator for words. - SmallVector utf16_str; ///< UTF-16 copy of the string. - SmallVector utf16_to_utf8; ///< Mapping from UTF-16 code point position to index in the UTF-8 source string. + std::vector utf16_str; ///< UTF-16 copy of the string. + std::vector utf16_to_utf8; ///< Mapping from UTF-16 code point position to index in the UTF-8 source string. public: IcuStringIterator() : char_itr(NULL), word_itr(NULL) diff --git a/src/stringfilter_type.h b/src/stringfilter_type.h index 4dad55aaaa..0a4a464c7f 100644 --- a/src/stringfilter_type.h +++ b/src/stringfilter_type.h @@ -39,7 +39,7 @@ private: }; const char *filter_buffer; ///< Parsed filter string. Words separated by 0. - SmallVector word_index; ///< Word index and filter state. + std::vector word_index; ///< Word index and filter state. uint word_matches; ///< Summary of filter state: Number of words matched. const bool *case_sensitive; ///< Match case-sensitively (usually a static variable). diff --git a/src/subsidy.cpp b/src/subsidy.cpp index a61d6f1ce9..2b851048b4 100644 --- a/src/subsidy.cpp +++ b/src/subsidy.cpp @@ -564,7 +564,7 @@ bool CheckSubsidised(CargoID cargo_type, CompanyID company, SourceType src_type, /* Remember all towns near this station (at least one house in its catchment radius) * which are destination of subsidised path. Do that only if needed */ - SmallVector towns_near; + std::vector towns_near; if (!st->rect.IsEmpty()) { Subsidy *s; FOR_ALL_SUBSIDIES(s) { diff --git a/src/texteff.cpp b/src/texteff.cpp index 6827d980f0..5e8c749858 100644 --- a/src/texteff.cpp +++ b/src/texteff.cpp @@ -37,7 +37,7 @@ struct TextEffect : public ViewportSign { } }; -static SmallVector _text_effects; ///< Text effects are stored there +static std::vector _text_effects; ///< Text effects are stored there /* Text Effects */ TextEffectID AddTextEffect(StringID msg, int center, int y, uint8 duration, TextEffectMode mode) diff --git a/src/textfile_gui.h b/src/textfile_gui.h index b7bcb2db75..b572fe09ca 100644 --- a/src/textfile_gui.h +++ b/src/textfile_gui.h @@ -21,12 +21,12 @@ const char *GetTextfile(TextfileType type, Subdirectory dir, const char *filenam /** Window for displaying a textfile */ struct TextfileWindow : public Window, MissingGlyphSearcher { - TextfileType file_type; ///< Type of textfile to view. - Scrollbar *vscroll; ///< Vertical scrollbar. - Scrollbar *hscroll; ///< Horizontal scrollbar. - char *text; ///< Lines of text from the NewGRF's textfile. - SmallVector lines; ///< #text, split into lines in a table with lines. - uint search_iterator; ///< Iterator for the font check search. + TextfileType file_type; ///< Type of textfile to view. + Scrollbar *vscroll; ///< Vertical scrollbar. + Scrollbar *hscroll; ///< Horizontal scrollbar. + char *text; ///< Lines of text from the NewGRF's textfile. + std::vector lines; ///< #text, split into lines in a table with lines. + uint search_iterator; ///< Iterator for the font check search. static const int TOP_SPACING = WD_FRAMETEXT_TOP; ///< Additional spacing at the top of the #WID_TF_BACKGROUND widget. static const int BOTTOM_SPACING = WD_FRAMETEXT_BOTTOM; ///< Additional spacing at the bottom of the #WID_TF_BACKGROUND widget. diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index 7e718c717d..6524260ff0 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -281,7 +281,7 @@ CommandCost CmdSetTimetableStart(TileIndex tile, DoCommandFlag flags, uint32 p1, if (timetable_all && !v->orders.list->IsCompleteTimetable()) return CMD_ERROR; if (flags & DC_EXEC) { - SmallVector vehs; + std::vector vehs; if (timetable_all) { for (Vehicle *w = v->orders.list->GetFirstSharedVehicle(); w != NULL; w = w->NextShared()) { diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 6ce1131844..008d515576 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -814,7 +814,7 @@ static Train *FindGoodVehiclePos(const Train *src) } /** Helper type for lists/vectors of trains */ -typedef SmallVector TrainList; +typedef std::vector TrainList; /** * Make a backup of a train into a train list. diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 427d45dea4..31b7a2ec0f 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -186,7 +186,7 @@ static const uint TRAIN_DETAILS_MIN_INDENT = 32; ///< Minimum indent level in th static const uint TRAIN_DETAILS_MAX_INDENT = 72; ///< Maximum indent level in the train details window; wider than this and we start on a new line /** Container for the cargo summary information. */ -typedef SmallVector CargoSummary; +typedef std::vector CargoSummary; /** Reused container of cargo details */ static CargoSummary _cargo_summary; diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 872c9458ca..919173ac17 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -346,8 +346,7 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, uint8 num_vehicles, v = v->First(); } - static SmallVector refit_result; - refit_result.clear(); + std::vector refit_result; v->InvalidateNewGRFCacheOfChain(); byte actual_subtype = new_subtype; diff --git a/src/vehicle_func.h b/src/vehicle_func.h index 17ec9e28da..b4e1c0074e 100644 --- a/src/vehicle_func.h +++ b/src/vehicle_func.h @@ -175,7 +175,7 @@ bool CanVehicleUseStation(const Vehicle *v, const struct Station *st); void ReleaseDisastersTargetingVehicle(VehicleID vehicle); -typedef SmallVector VehicleSet; +typedef std::vector VehicleSet; void GetVehicleSet(VehicleSet &set, Vehicle *v, uint8 num_vehicles); void CheckCargoCapacity(Vehicle *v); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 9b6c68a36e..34fcdc159f 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -233,7 +233,7 @@ byte GetBestFittingSubType(Vehicle *v_from, Vehicle *v_for, CargoID dest_cargo_t v_for = v_for->GetFirstEnginePart(); /* Create a list of subtypes used by the various parts of v_for */ - static SmallVector subtypes; + static std::vector subtypes; subtypes.clear(); for (; v_from != NULL; v_from = v_from->HasArticulatedPart() ? v_from->GetNextArticulatedPart() : NULL) { const Engine *e_from = v_from->GetEngine(); @@ -317,7 +317,7 @@ struct RefitOption { } }; -typedef SmallVector SubtypeList; ///< List of refit subtypes associated to a cargo. +typedef std::vector SubtypeList; ///< List of refit subtypes associated to a cargo. /** * Draw the list of available refit options for a consist and highlight the selected refit option (if any). diff --git a/src/vehiclelist.h b/src/vehiclelist.h index 996c8c007f..ed817b71c7 100644 --- a/src/vehiclelist.h +++ b/src/vehiclelist.h @@ -52,7 +52,7 @@ struct VehicleListIdentifier { }; /** A list of vehicles. */ -typedef SmallVector VehicleList; +typedef std::vector VehicleList; bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &identifier); void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine_list, VehicleList *wagon_list, bool individual_wagons = false); diff --git a/src/viewport.cpp b/src/viewport.cpp index 892e94d603..4c9507bcac 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -153,10 +153,10 @@ enum SpriteCombineMode { SPRITE_COMBINE_ACTIVE, ///< %Sprite combining is active. #AddSortableSpriteToDraw outputs child sprites. }; -typedef SmallVector TileSpriteToDrawVector; -typedef SmallVector StringSpriteToDrawVector; -typedef SmallVector ParentSpriteToDrawVector; -typedef SmallVector ChildScreenSpriteToDrawVector; +typedef std::vector TileSpriteToDrawVector; +typedef std::vector StringSpriteToDrawVector; +typedef std::vector ParentSpriteToDrawVector; +typedef std::vector ChildScreenSpriteToDrawVector; /** Data structure storing rendering information */ struct ViewportDrawer { diff --git a/src/viewport_sprite_sorter.h b/src/viewport_sprite_sorter.h index 324ece3020..24241565e7 100644 --- a/src/viewport_sprite_sorter.h +++ b/src/viewport_sprite_sorter.h @@ -41,7 +41,7 @@ struct ParentSpriteToDraw { bool comparison_done; ///< Used during sprite sorting: true if sprite has been compared with all other sprites }; -typedef SmallVector ParentSpriteToSortVector; +typedef std::vector ParentSpriteToSortVector; /** Type for method for checking whether a viewport sprite sorter exists. */ typedef bool (*VpSorterChecker)(); diff --git a/src/window.cpp b/src/window.cpp index 9366b92eb8..891eafb5e3 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -85,7 +85,7 @@ SpecialMouseMode _special_mouse_mode; ///< Mode of the mouse. * List of all WindowDescs. * This is a pointer to ensure initialisation order with the various static WindowDesc instances. */ -static SmallVector *_window_descs = NULL; +static std::vector *_window_descs = NULL; /** Config file to store WindowDesc */ char *_windows_file; @@ -108,7 +108,7 @@ WindowDesc::WindowDesc(WindowPosition def_pos, const char *ini_key, int16 def_wi default_width_trad(def_width_trad), default_height_trad(def_height_trad) { - if (_window_descs == NULL) _window_descs = new SmallVector(); + if (_window_descs == NULL) _window_descs = new std::vector(); _window_descs->push_back(this); } diff --git a/src/window_gui.h b/src/window_gui.h index b2bba675b2..63793b0ef4 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -281,7 +281,7 @@ protected: void InitializePositionSize(int x, int y, int min_width, int min_height); virtual void FindWindowPlacementAndResize(int def_width, int def_height); - SmallVector scheduled_invalidation_data; ///< Data of scheduled OnInvalidateData() calls. + std::vector scheduled_invalidation_data; ///< Data of scheduled OnInvalidateData() calls. public: Window(WindowDesc *desc); From cc62f4163f230ed82ef3b04187987d3e380cd570 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Mon, 4 Mar 2019 20:49:33 +0000 Subject: [PATCH 70/82] Cleanup: Remove unused size template parameters from SmallMap and Auto[Free|Delete]SmallVector --- src/core/smallmap_type.hpp | 2 +- src/core/smallvec_type.hpp | 8 +++--- src/game/game_text.hpp | 6 ++--- src/gfx_layout.cpp | 6 ++--- src/gfx_layout.h | 2 +- src/music/midifile.hpp | 4 +-- src/network/core/address.h | 2 +- src/network/network_client.cpp | 2 +- src/network/network_content.h | 10 ++++---- src/newgrf.h | 4 +-- src/newgrf_config.h | 40 ++++++++++++++--------------- src/newgrf_debug.h | 2 +- src/newgrf_text.h | 2 +- src/os/macosx/string_osx.cpp | 2 +- src/os/windows/string_uniscribe.cpp | 2 +- src/saveload/saveload.cpp | 6 ++--- src/settings_func.h | 2 +- src/stringfilter_type.h | 2 +- src/town_cmd.cpp | 2 +- src/vehicle.cpp | 2 +- src/widgets/dropdown_type.h | 2 +- 21 files changed, 54 insertions(+), 56 deletions(-) diff --git a/src/core/smallmap_type.hpp b/src/core/smallmap_type.hpp index debd4165e6..d7a9a38322 100644 --- a/src/core/smallmap_type.hpp +++ b/src/core/smallmap_type.hpp @@ -39,7 +39,7 @@ struct SmallPair { * * @see SmallVector */ -template +template struct SmallMap : std::vector > { typedef ::SmallPair Pair; typedef Pair *iterator; diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 19dab22286..e71edf89ff 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -77,9 +77,8 @@ T* grow(std::vector& vec, std::size_t num) * inside the list. * * @param T The type of the items stored, must be a pointer - * @param S The steps of allocation */ -template +template class AutoFreeSmallVector : public std::vector { public: ~AutoFreeSmallVector() @@ -108,9 +107,8 @@ public: * inside the list. * * @param T The type of the items stored, must be a pointer - * @param S The steps of allocation */ -template +template class AutoDeleteSmallVector : public std::vector { public: ~AutoDeleteSmallVector() @@ -131,6 +129,6 @@ public: } }; -typedef AutoFreeSmallVector StringList; ///< Type for a list of strings. +typedef AutoFreeSmallVector StringList; ///< Type for a list of strings. #endif /* SMALLVEC_TYPE_HPP */ diff --git a/src/game/game_text.hpp b/src/game/game_text.hpp index 14da7d9b2e..11c63b5abb 100644 --- a/src/game/game_text.hpp +++ b/src/game/game_text.hpp @@ -32,9 +32,9 @@ struct GameStrings { uint version; ///< The version of the language strings. LanguageStrings *cur_language; ///< The current (compiled) language. - AutoDeleteSmallVector raw_strings; ///< The raw strings per language, first must be English/the master language!. - AutoDeleteSmallVector compiled_strings; ///< The compiled strings per language, first must be English/the master language!. - StringList string_names; ///< The names of the compiled strings. + AutoDeleteSmallVector raw_strings; ///< The raw strings per language, first must be English/the master language!. + AutoDeleteSmallVector compiled_strings; ///< The compiled strings per language, first must be English/the master language!. + StringList string_names; ///< The names of the compiled strings. void Compile(); }; diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index 6d4759cfbd..f09b87efa9 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -124,7 +124,7 @@ le_bool Font::getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &poin /** * Wrapper for doing layouts with ICU. */ -class ICUParagraphLayout : public AutoDeleteSmallVector, public ParagraphLayouter { +class ICUParagraphLayout : public AutoDeleteSmallVector, public ParagraphLayouter { icu::ParagraphLayout *p; ///< The actual ICU paragraph layout. public: /** Visual run contains data about the bit of text with the same font. */ @@ -143,7 +143,7 @@ public: }; /** A single line worth of VisualRuns. */ - class ICULine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { + class ICULine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { icu::ParagraphLayout::Line *l; ///< The actual ICU line. public: @@ -269,7 +269,7 @@ public: }; /** A single line worth of VisualRuns. */ - class FallbackLine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { + class FallbackLine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { public: int GetLeading() const; int GetWidth() const; diff --git a/src/gfx_layout.h b/src/gfx_layout.h index 6f611d6e66..93cc6fb2da 100644 --- a/src/gfx_layout.h +++ b/src/gfx_layout.h @@ -150,7 +150,7 @@ public: * * It also accounts for the memory allocations and frees. */ -class Layouter : public AutoDeleteSmallVector { +class Layouter : public AutoDeleteSmallVector { const char *string; ///< Pointer to the original string. /** Key into the linecache */ diff --git a/src/music/midifile.hpp b/src/music/midifile.hpp index e0e5170b7f..4d362a1be2 100644 --- a/src/music/midifile.hpp +++ b/src/music/midifile.hpp @@ -22,8 +22,8 @@ struct MusicSongInfo; struct MidiFile { struct DataBlock { - uint32 ticktime; ///< tick number since start of file this block should be triggered at - uint32 realtime; ///< real-time (microseconds) since start of file this block should be triggered at + uint32 ticktime; ///< tick number since start of file this block should be triggered at + uint32 realtime; ///< real-time (microseconds) since start of file this block should be triggered at std::vector data; ///< raw midi data contained in block DataBlock(uint32 _ticktime = 0) : ticktime(_ticktime) { } }; diff --git a/src/network/core/address.h b/src/network/core/address.h index f6d7870bf6..2f26a3d00f 100644 --- a/src/network/core/address.h +++ b/src/network/core/address.h @@ -19,7 +19,7 @@ class NetworkAddress; typedef std::vector NetworkAddressList; ///< Type for a list of addresses. -typedef SmallMap SocketList; ///< Type for a mapping between address and socket. +typedef SmallMap SocketList; ///< Type for a mapping between address and socket. /** * Wrapper for (un)resolved network addresses; there's no reason to transform diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index 12aa3fc0ad..7b658e8b5a 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -41,7 +41,7 @@ struct PacketReader : LoadFilter { static const size_t CHUNK = 32 * 1024; ///< 32 KiB chunks of memory. - AutoFreeSmallVector blocks; ///< Buffer with blocks of allocated memory. + AutoFreeSmallVector blocks; ///< Buffer with blocks of allocated memory. byte *buf; ///< Buffer we're going to write to/read from. byte *bufe; ///< End of the buffer we write to/read from. byte **block; ///< The block we're reading from/writing to. diff --git a/src/network/network_content.h b/src/network/network_content.h index e62c921e6a..29a25f2597 100644 --- a/src/network/network_content.h +++ b/src/network/network_content.h @@ -67,11 +67,11 @@ struct ContentCallback { class ClientNetworkContentSocketHandler : public NetworkContentSocketHandler, ContentCallback, HTTPCallback { protected: typedef std::vector ContentIDList; ///< List of content IDs to (possibly) select. - std::vector callbacks; ///< Callbacks to notify "the world" - ContentIDList requested; ///< ContentIDs we already requested (so we don't do it again) - ContentVector infos; ///< All content info we received - std::vector http_response; ///< The HTTP response to the requests we've been doing - int http_response_index; ///< Where we are, in the response, with handling it + std::vector callbacks; ///< Callbacks to notify "the world" + ContentIDList requested; ///< ContentIDs we already requested (so we don't do it again) + ContentVector infos; ///< All content info we received + std::vector http_response; ///< The HTTP response to the requests we've been doing + int http_response_index; ///< Where we are, in the response, with handling it FILE *curFile; ///< Currently downloaded file ContentInfo *curInfo; ///< Information about the currently downloaded file diff --git a/src/newgrf.h b/src/newgrf.h index d58fe870fe..e99b733476 100644 --- a/src/newgrf.h +++ b/src/newgrf.h @@ -122,10 +122,10 @@ struct GRFFile : ZeroedMemoryAllocator { GRFLabel *label; ///< Pointer to the first label. This is a linked list, not an array. - std::vector cargo_list; ///< Cargo translation table (local ID -> label) + std::vector cargo_list; ///< Cargo translation table (local ID -> label) uint8 cargo_map[NUM_CARGO]; ///< Inverse cargo translation table (CargoID -> local ID) - std::vector railtype_list; ///< Railtype translation table + std::vector railtype_list; ///< Railtype translation table RailTypeByte railtype_map[RAILTYPE_END]; CanalProperties canal_local_properties[CF_END]; ///< Canal properties as set by this NewGRF diff --git a/src/newgrf_config.h b/src/newgrf_config.h index 6396fa368c..88110f0ed5 100644 --- a/src/newgrf_config.h +++ b/src/newgrf_config.h @@ -133,7 +133,7 @@ struct GRFParameterInfo { byte param_nr; ///< GRF parameter to store content in byte first_bit; ///< First bit to use in the GRF parameter byte num_bit; ///< Number of bits to use for this parameter - SmallMap value_names; ///< Names for each value. + SmallMap value_names; ///< Names for each value. bool complete_labels; ///< True if all values have a label. uint32 GetValue(struct GRFConfig *config) const; @@ -155,27 +155,27 @@ struct GRFConfig : ZeroedMemoryAllocator { GRFConfig(const GRFConfig &config); ~GRFConfig(); - GRFIdentifier ident; ///< grfid and md5sum to uniquely identify newgrfs - uint8 original_md5sum[16]; ///< MD5 checksum of original file if only a 'compatible' file was loaded - char *filename; ///< Filename - either with or without full path - GRFTextWrapper *name; ///< NOSAVE: GRF name (Action 0x08) - GRFTextWrapper *info; ///< NOSAVE: GRF info (author, copyright, ...) (Action 0x08) - GRFTextWrapper *url; ///< NOSAVE: URL belonging to this GRF. - GRFError *error; ///< NOSAVE: Error/Warning during GRF loading (Action 0x0B) - - uint32 version; ///< NOSAVE: Version a NewGRF can set so only the newest NewGRF is shown - uint32 min_loadable_version; ///< NOSAVE: Minimum compatible version a NewGRF can define - uint8 flags; ///< NOSAVE: GCF_Flags, bitset - GRFStatus status; ///< NOSAVE: GRFStatus, enum - uint32 grf_bugs; ///< NOSAVE: bugs in this GRF in this run, @see enum GRFBugs - uint32 param[0x80]; ///< GRF parameters - uint8 num_params; ///< Number of used parameters - uint8 num_valid_params; ///< NOSAVE: Number of valid parameters (action 0x14) - uint8 palette; ///< GRFPalette, bitset + GRFIdentifier ident; ///< grfid and md5sum to uniquely identify newgrfs + uint8 original_md5sum[16]; ///< MD5 checksum of original file if only a 'compatible' file was loaded + char *filename; ///< Filename - either with or without full path + GRFTextWrapper *name; ///< NOSAVE: GRF name (Action 0x08) + GRFTextWrapper *info; ///< NOSAVE: GRF info (author, copyright, ...) (Action 0x08) + GRFTextWrapper *url; ///< NOSAVE: URL belonging to this GRF. + GRFError *error; ///< NOSAVE: Error/Warning during GRF loading (Action 0x0B) + + uint32 version; ///< NOSAVE: Version a NewGRF can set so only the newest NewGRF is shown + uint32 min_loadable_version; ///< NOSAVE: Minimum compatible version a NewGRF can define + uint8 flags; ///< NOSAVE: GCF_Flags, bitset + GRFStatus status; ///< NOSAVE: GRFStatus, enum + uint32 grf_bugs; ///< NOSAVE: bugs in this GRF in this run, @see enum GRFBugs + uint32 param[0x80]; ///< GRF parameters + uint8 num_params; ///< Number of used parameters + uint8 num_valid_params; ///< NOSAVE: Number of valid parameters (action 0x14) + uint8 palette; ///< GRFPalette, bitset std::vector param_info; ///< NOSAVE: extra information about the parameters - bool has_param_defaults; ///< NOSAVE: did this newgrf specify any defaults for it's parameters + bool has_param_defaults; ///< NOSAVE: did this newgrf specify any defaults for it's parameters - struct GRFConfig *next; ///< NOSAVE: Next item in the linked list + struct GRFConfig *next; ///< NOSAVE: Next item in the linked list void CopyParams(const GRFConfig &src); diff --git a/src/newgrf_debug.h b/src/newgrf_debug.h index b73c93266f..dac97726da 100644 --- a/src/newgrf_debug.h +++ b/src/newgrf_debug.h @@ -29,7 +29,7 @@ struct NewGrfDebugSpritePicker { NewGrfDebugSpritePickerMode mode; ///< Current state void *clicked_pixel; ///< Clicked pixel (pointer to blitter buffer) uint32 click_time; ///< Realtime tick when clicked to detect next frame - std::vector sprites; ///< Sprites found + std::vector sprites; ///< Sprites found }; extern NewGrfDebugSpritePicker _newgrf_debug_sprite_picker; diff --git a/src/newgrf_text.h b/src/newgrf_text.h index 601535d991..141e1536f1 100644 --- a/src/newgrf_text.h +++ b/src/newgrf_text.h @@ -59,7 +59,7 @@ struct LanguageMap { * both cases. Thus we are basically implementing a multi-map. */ std::vector gender_map; ///< Mapping of NewGRF and OpenTTD IDs for genders. std::vector case_map; ///< Mapping of NewGRF and OpenTTD IDs for cases. - int plural_form; ///< The plural form used for this language. + int plural_form; ///< The plural form used for this language. int GetMapping(int newgrf_id, bool gender) const; int GetReverseMapping(int openttd_id, bool gender) const; diff --git a/src/os/macosx/string_osx.cpp b/src/os/macosx/string_osx.cpp index 51cf50ea07..e14ca4183b 100644 --- a/src/os/macosx/string_osx.cpp +++ b/src/os/macosx/string_osx.cpp @@ -65,7 +65,7 @@ public: }; /** A single line worth of VisualRuns. */ - class CoreTextLine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { + class CoreTextLine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { public: CoreTextLine(CTLineRef line, const FontMap &fontMapping, const CoreTextParagraphLayoutFactory::CharType *buff) { diff --git a/src/os/windows/string_uniscribe.cpp b/src/os/windows/string_uniscribe.cpp index a3fd35d0ad..5cba9a3d8b 100644 --- a/src/os/windows/string_uniscribe.cpp +++ b/src/os/windows/string_uniscribe.cpp @@ -106,7 +106,7 @@ public: }; /** A single line worth of VisualRuns. */ - class UniscribeLine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { + class UniscribeLine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { public: virtual int GetLeading() const; virtual int GetWidth() const; diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index ee4876fd5c..c97087224b 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -125,9 +125,9 @@ struct ReadBuffer { /** Container for dumping the savegame (quickly) to memory. */ struct MemoryDumper { - AutoFreeSmallVector blocks; ///< Buffer with blocks of allocated memory. - byte *buf; ///< Buffer we're going to write to. - byte *bufe; ///< End of the buffer we write to. + AutoFreeSmallVector blocks; ///< Buffer with blocks of allocated memory. + byte *buf; ///< Buffer we're going to write to. + byte *bufe; ///< End of the buffer we write to. /** Initialise our variables. */ MemoryDumper() : buf(NULL), bufe(NULL) diff --git a/src/settings_func.h b/src/settings_func.h index ee63e2bf4c..a16c31c207 100644 --- a/src/settings_func.h +++ b/src/settings_func.h @@ -30,7 +30,7 @@ void IniSaveWindowSettings(IniFile *ini, const char *grpname, void *desc); /* Functions to load and save NewGRF settings to a separate * configuration file, used for presets. */ -typedef AutoFreeSmallVector GRFPresetList; +typedef AutoFreeSmallVector GRFPresetList; void GetGRFPresetList(GRFPresetList *list); struct GRFConfig *LoadGRFPresetFromConfig(const char *config_name); diff --git a/src/stringfilter_type.h b/src/stringfilter_type.h index 0a4a464c7f..5ba8e876b6 100644 --- a/src/stringfilter_type.h +++ b/src/stringfilter_type.h @@ -39,7 +39,7 @@ private: }; const char *filter_buffer; ///< Parsed filter string. Words separated by 0. - std::vector word_index; ///< Word index and filter state. + std::vector word_index; ///< Word index and filter state. uint word_matches; ///< Summary of filter state: Number of words matched. const bool *case_sensitive; ///< Match case-sensitively (usually a static variable). diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 35ef97e940..be5af4acff 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -3457,7 +3457,7 @@ Town *ClosestTownFromTile(TileIndex tile, uint threshold) } static bool _town_rating_test = false; ///< If \c true, town rating is in test-mode. -static SmallMap _town_test_ratings; ///< Map of towns to modified ratings, while in town rating test-mode. +static SmallMap _town_test_ratings; ///< Map of towns to modified ratings, while in town rating test-mode. /** * Switch the town rating to test-mode, to allow commands to be tested without affecting current ratings. diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 9f15d9be05..856fc6737c 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -688,7 +688,7 @@ void ResetVehicleColourMap() * List of vehicles that should check for autoreplace this tick. * Mapping of vehicle -> leave depot immediately after autoreplace. */ -typedef SmallMap AutoreplaceMap; +typedef SmallMap AutoreplaceMap; static AutoreplaceMap _vehicles_to_autoreplace; void InitializeVehicles() diff --git a/src/widgets/dropdown_type.h b/src/widgets/dropdown_type.h index 56510b0abe..d8e9b90288 100644 --- a/src/widgets/dropdown_type.h +++ b/src/widgets/dropdown_type.h @@ -98,7 +98,7 @@ public: /** * A drop down list is a collection of drop down list items. */ -typedef AutoDeleteSmallVector DropDownList; +typedef AutoDeleteSmallVector DropDownList; void ShowDropDownListAt(Window *w, const DropDownList *list, int selected, int button, Rect wi_rect, Colours wi_colour, bool auto_width = false, bool instant_close = false); From 03ca3190c9b73de3e43fe1e7e2293b8c1e3aa3d5 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Wed, 13 Mar 2019 20:55:31 +0000 Subject: [PATCH 71/82] Codechange: Use range-based for-loop in Auto[Free|Delete]SmallVector --- src/core/smallvec_type.hpp | 8 ++++---- src/script/squirrel_helper.hpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index e71edf89ff..f43265ebe8 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -91,8 +91,8 @@ public: */ inline void Clear() { - for (uint i = 0; i < std::vector::size(); i++) { - free(std::vector::operator[](i)); + for (T p : *this) { + free(p); } std::vector::clear(); @@ -121,8 +121,8 @@ public: */ inline void Clear() { - for (uint i = 0; i < std::vector::size(); i++) { - delete std::vector::operator[](i); + for (T p : *this) { + delete p; } std::vector::clear(); diff --git a/src/script/squirrel_helper.hpp b/src/script/squirrel_helper.hpp index add6b49c1b..10f04f945a 100644 --- a/src/script/squirrel_helper.hpp +++ b/src/script/squirrel_helper.hpp @@ -32,7 +32,7 @@ namespace SQConvert { struct SQAutoFreePointers : std::vector { ~SQAutoFreePointers() { - for (uint i = 0; i < std::vector::size(); i++) free(std::vector::operator[](i)); + for (void * p : *this) free(p); } }; From e453572b6ab9feeacd4fcbd660d954aec44c4777 Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Mon, 25 Mar 2019 22:45:32 +0000 Subject: [PATCH 72/82] Codechange: Initialise a few variables that -flto seems to think could possibly be uninitialised --- src/order_base.h | 2 +- src/strings.cpp | 3 ++- src/vehicle_cmd.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/order_base.h b/src/order_base.h index 0def7b0bcd..b11c20d8e6 100644 --- a/src/order_base.h +++ b/src/order_base.h @@ -50,7 +50,7 @@ private: public: Order *next; ///< Pointer to next order. If NULL, end of list - Order() : refit_cargo(CT_NO_REFIT), max_speed(UINT16_MAX) {} + Order() : flags(0), refit_cargo(CT_NO_REFIT), max_speed(UINT16_MAX) {} ~Order(); Order(uint32 packed); diff --git a/src/strings.cpp b/src/strings.cpp index 204c68c204..c3669e5dc5 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -118,7 +118,8 @@ void SetDParamMaxValue(uint n, uint64 max_value, uint min_count, FontSize size) */ void SetDParamMaxDigits(uint n, uint count, FontSize size) { - uint front, next; + uint front = 0; + uint next = 0; GetBroadestDigit(&front, &next, size); uint64 val = count > 1 ? front : next; for (; count > 1; count--) { diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 919173ac17..059f608379 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -131,7 +131,7 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint DoCommandFlag subflags = flags; if (refitting) subflags |= DC_EXEC; - Vehicle *v; + Vehicle *v = NULL; switch (type) { case VEH_TRAIN: value.AddCost(CmdBuildRailVehicle(tile, subflags, e, GB(p1, 24, 8), &v)); break; case VEH_ROAD: value.AddCost(CmdBuildRoadVehicle(tile, subflags, e, GB(p1, 24, 8), &v)); break; From 7c81f8e0764db47d09581a232a501a95825a138f Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Mon, 25 Mar 2019 22:47:12 +0000 Subject: [PATCH 73/82] Codechange: Simplify refit cargo filter condition and stop mixing enum types --- src/build_vehicle_gui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index c3d8743a2d..33cabe98ae 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1163,8 +1163,8 @@ struct BuildVehicleWindow : Window { void SelectEngine(EngineID engine) { - bool refit = this->cargo_filter[this->cargo_filter_criteria] != CF_ANY && this->cargo_filter[this->cargo_filter_criteria] != CF_NONE; - CargoID cargo = refit ? this->cargo_filter[this->cargo_filter_criteria] : CT_INVALID; + CargoID cargo = this->cargo_filter[this->cargo_filter_criteria]; + if (cargo == CF_ANY) cargo = CF_NONE; this->sel_engine = engine; this->SetBuyVehicleText(); @@ -1419,8 +1419,8 @@ struct BuildVehicleWindow : Window { EngineID sel_eng = this->sel_engine; if (sel_eng != INVALID_ENGINE) { CommandCallback *callback = (this->vehicle_type == VEH_TRAIN && RailVehInfo(sel_eng)->railveh_type == RAILVEH_WAGON) ? CcBuildWagon : CcBuildPrimaryVehicle; - bool refit = this->cargo_filter[this->cargo_filter_criteria] != CF_ANY && this->cargo_filter[this->cargo_filter_criteria] != CF_NONE; - CargoID cargo = refit ? this->cargo_filter[this->cargo_filter_criteria] : CT_INVALID; + CargoID cargo = this->cargo_filter[this->cargo_filter_criteria]; + if (cargo == CF_ANY) cargo = CF_NONE; DoCommandP(this->window_number, sel_eng | (cargo << 24), 0, GetCmdBuildVeh(this->vehicle_type), callback); } break; From a065d4623e0f3dc507125aea688b120b02ed4e1b Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Mon, 25 Mar 2019 22:47:50 +0000 Subject: [PATCH 74/82] Codechange: Move 2 constants into the ifdef where they're used --- src/os/windows/crashlog_win.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/os/windows/crashlog_win.cpp b/src/os/windows/crashlog_win.cpp index 6bcaed837e..458a761631 100644 --- a/src/os/windows/crashlog_win.cpp +++ b/src/os/windows/crashlog_win.cpp @@ -26,9 +26,6 @@ #include "../../safeguards.h" -static const uint MAX_SYMBOL_LEN = 512; -static const uint MAX_FRAMES = 64; - /* printf format specification for 32/64-bit addresses. */ #ifdef _M_AMD64 #define PRINTF_PTR "0x%016IX" @@ -322,6 +319,9 @@ static char *PrintModuleInfo(char *output, const char *last, HMODULE mod) } #if defined(_MSC_VER) +static const uint MAX_SYMBOL_LEN = 512; +static const uint MAX_FRAMES = 64; + #pragma warning(disable:4091) #include #pragma warning(default:4091) From 427d9d483fcd7e3c8dae8e9c84832c9e6bb34b50 Mon Sep 17 00:00:00 2001 From: glx22 Date: Tue, 26 Mar 2019 22:50:56 +0100 Subject: [PATCH 75/82] Fix #6564: enforce types of arguments for station name strings (#7419) --- src/strings.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/strings.cpp b/src/strings.cpp index c3669e5dc5..be45a098b3 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -76,7 +76,10 @@ int64 StringParameters::GetInt64(WChar type) return 0; } if (this->type != NULL) { - assert(this->type[this->offset] == 0 || this->type[this->offset] == type); + if (this->type[this->offset] != 0 && this->type[this->offset] != type) { + DEBUG(misc, 0, "Trying to read string parameter with wrong type"); + return 0; + } this->type[this->offset] = type; } return this->data[this->offset++]; @@ -1415,8 +1418,9 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg } } - int64 args_array[] = {STR_TOWN_NAME, st->town->index, st->index}; - StringParameters tmp_params(args_array); + uint64 args_array[] = {STR_TOWN_NAME, st->town->index, st->index}; + WChar types_array[] = {0, SCC_TOWN_NAME, SCC_NUM}; + StringParameters tmp_params(args_array, 3, types_array); buff = GetStringWithArgs(buff, str, &tmp_params, last); } break; From b913c92aa77fb5f435d3f8795d0f6eae3e4ae132 Mon Sep 17 00:00:00 2001 From: stormcone <48624099+stormcone@users.noreply.github.com> Date: Tue, 26 Mar 2019 22:59:43 +0100 Subject: [PATCH 76/82] Fix #7165: Missed 'Append() --> push_back()' replacement --- src/network/core/host.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp index 35c7ce8ae8..2bf862a4f5 100644 --- a/src/network/core/host.cpp +++ b/src/network/core/host.cpp @@ -76,7 +76,7 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // BE memset(&address, 0, sizeof(address)); ((sockaddr_in*)&address)->sin_addr.s_addr = htonl(ip | ~netmask); NetworkAddress addr(address, sizeof(sockaddr)); - if (std::none_of(broadcast->begin(), broadcast->end(), [&addr](NetworkAddress const& elem) -> bool { return elem == addr; })) *broadcast->Append() = addr; + if (std::none_of(broadcast->begin(), broadcast->end(), [&addr](NetworkAddress const& elem) -> bool { return elem == addr; })) broadcast->push_back(addr); } if (read < 0) { break; From ed9005690a77a9bdfe334f79f6df0c421975161d Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Tue, 26 Mar 2019 23:57:54 +0000 Subject: [PATCH 77/82] Fix #7421: Don't (directly) dereference std::vector::end() in SmallMap --- src/core/smallmap_type.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/smallmap_type.hpp b/src/core/smallmap_type.hpp index d7a9a38322..5eb94e23a2 100644 --- a/src/core/smallmap_type.hpp +++ b/src/core/smallmap_type.hpp @@ -79,12 +79,12 @@ struct SmallMap : std::vector > { inline const Pair *End() const { - return &*std::vector::end(); + return std::vector::data() + std::vector::size(); } inline Pair *End() { - return &*std::vector::end(); + return std::vector::data() + std::vector::size(); } From a393c9469545f4bd1e6e2fd1a593d35bb98f16ca Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Tue, 26 Mar 2019 00:17:33 +0000 Subject: [PATCH 78/82] Change #5977: Use specific error message when attempting to create a circular group hierarchy (3298) --- src/group_cmd.cpp | 2 +- src/lang/english.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp index bd99aa1272..3c9b3850a3 100644 --- a/src/group_cmd.cpp +++ b/src/group_cmd.cpp @@ -449,7 +449,7 @@ CommandCost CmdAlterGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 /* Ensure request parent isn't child of group. * This is the only place that infinite loops are prevented. */ - if (GroupIsInGroup(pg->index, g->index)) return CMD_ERROR; + if (GroupIsInGroup(pg->index, g->index)) return_cmd_error(STR_ERROR_GROUP_CAN_T_SET_PARENT_RECURSION); } if (flags & DC_EXEC) { diff --git a/src/lang/english.txt b/src/lang/english.txt index 2e01e3a2d5..032801ae5b 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -4473,6 +4473,7 @@ STR_ERROR_GROUP_CAN_T_CREATE :{WHITE}Can't cr STR_ERROR_GROUP_CAN_T_DELETE :{WHITE}Can't delete this group... STR_ERROR_GROUP_CAN_T_RENAME :{WHITE}Can't rename group... STR_ERROR_GROUP_CAN_T_SET_PARENT :{WHITE}Can't set parent group... +STR_ERROR_GROUP_CAN_T_SET_PARENT_RECURSION :{WHITE}... loops in the group hierarchy are not allowed STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES :{WHITE}Can't remove all vehicles from this group... STR_ERROR_GROUP_CAN_T_ADD_VEHICLE :{WHITE}Can't add the vehicle to this group... STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE :{WHITE}Can't add shared vehicles to group... From 8890436af1e9dbff7279dd3cf4c3659a3ad973d6 Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Tue, 26 Mar 2019 00:07:20 +0000 Subject: [PATCH 79/82] Add #6189: Groups now count the total number of vehicles in subgroups (3298) --- src/group.h | 3 +++ src/group_cmd.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++++ src/group_gui.cpp | 34 +++++++++++++++++++--------- src/lang/english.txt | 2 ++ 4 files changed, 82 insertions(+), 11 deletions(-) diff --git a/src/group.h b/src/group.h index ea4f7e130e..8bb8d794fb 100644 --- a/src/group.h +++ b/src/group.h @@ -100,6 +100,9 @@ static inline bool IsAllGroupID(GroupID id_g) uint GetGroupNumEngines(CompanyID company, GroupID id_g, EngineID id_e); +uint GetGroupNumVehicle(CompanyID company, GroupID id_g, VehicleType type); +uint GetGroupNumProfitVehicle(CompanyID company, GroupID id_g, VehicleType type); +Money GetGroupProfitLastYear(CompanyID company, GroupID id_g, VehicleType type); void SetTrainGroupID(Train *v, GroupID grp); void UpdateTrainGroupID(Train *v); diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp index 3c9b3850a3..bb86c6b344 100644 --- a/src/group_cmd.cpp +++ b/src/group_cmd.cpp @@ -808,6 +808,60 @@ uint GetGroupNumEngines(CompanyID company, GroupID id_g, EngineID id_e) return count + GroupStatistics::Get(company, id_g, e->type).num_engines[id_e]; } +/** + * Get the number of vehicles in the group with GroupID + * id_g and its sub-groups. + * @param company The company the group belongs to + * @param id_g The GroupID of the group used + * @param type The vehicle type of the group + * @return The number of vehicles in the group + */ +uint GetGroupNumVehicle(CompanyID company, GroupID id_g, VehicleType type) +{ + uint count = 0; + const Group *g; + FOR_ALL_GROUPS(g) { + if (g->parent == id_g) count += GetGroupNumVehicle(company, g->index, type); + } + return count + GroupStatistics::Get(company, id_g, type).num_vehicle; +} + +/** + * Get the number of vehicles above profit minimum age in the group with GroupID + * id_g and its sub-groups. + * @param company The company the group belongs to + * @param id_g The GroupID of the group used + * @param type The vehicle type of the group + * @return The number of vehicles above profit minimum age in the group + */ +uint GetGroupNumProfitVehicle(CompanyID company, GroupID id_g, VehicleType type) +{ + uint count = 0; + const Group *g; + FOR_ALL_GROUPS(g) { + if (g->parent == id_g) count += GetGroupNumProfitVehicle(company, g->index, type); + } + return count + GroupStatistics::Get(company, id_g, type).num_profit_vehicle; +} + +/** + * Get last year's profit for the group with GroupID + * id_g and its sub-groups. + * @param company The company the group belongs to + * @param id_g The GroupID of the group used + * @param type The vehicle type of the group + * @return Last year's profit for the group + */ +Money GetGroupProfitLastYear(CompanyID company, GroupID id_g, VehicleType type) +{ + Money sum = 0; + const Group *g; + FOR_ALL_GROUPS(g) { + if (g->parent == id_g) sum += GetGroupProfitLastYear(company, g->index, type); + } + return sum + GroupStatistics::Get(company, id_g, type).profit_last_year; +} + void RemoveAllGroupsForCompany(const CompanyID company) { Group *g; diff --git a/src/group_gui.cpp b/src/group_gui.cpp index ca0b194f38..97c310e6f6 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -213,8 +213,10 @@ private: } this->tiny_step_height = max(this->tiny_step_height, this->column_size[VGC_PROFIT].height); - SetDParamMaxValue(0, GroupStatistics::Get(this->vli.company, ALL_GROUP, this->vli.vtype).num_vehicle, 3, FS_SMALL); - this->column_size[VGC_NUMBER] = GetStringBoundingBox(STR_TINY_COMMA); + int num_vehicle = GetGroupNumVehicle(this->vli.company, ALL_GROUP, this->vli.vtype); + SetDParamMaxValue(0, num_vehicle, 3, FS_SMALL); + SetDParamMaxValue(1, num_vehicle, 3, FS_SMALL); + this->column_size[VGC_NUMBER] = GetStringBoundingBox(STR_GROUP_COUNT_WITH_SUBGROUP); this->tiny_step_height = max(this->tiny_step_height, this->column_size[VGC_NUMBER].height); this->tiny_step_height += WD_MATRIX_TOP; @@ -275,11 +277,13 @@ private: /* draw the profit icon */ x = rtl ? x - 2 - this->column_size[VGC_PROFIT].width : x + 2 + this->column_size[VGC_AUTOREPLACE].width; SpriteID spr; - if (stats.num_profit_vehicle == 0) { + uint num_profit_vehicle = GetGroupNumProfitVehicle(this->vli.company, g_id, this->vli.vtype); + Money profit_last_year = GetGroupProfitLastYear(this->vli.company, g_id, this->vli.vtype); + if (num_profit_vehicle == 0) { spr = SPR_PROFIT_NA; - } else if (stats.profit_last_year < 0) { + } else if (profit_last_year < 0) { spr = SPR_PROFIT_NEGATIVE; - } else if (stats.profit_last_year < 10000 * stats.num_profit_vehicle) { // TODO magic number + } else if (profit_last_year < (Money) 10000 * num_profit_vehicle) { // TODO magic number spr = SPR_PROFIT_SOME; } else { spr = SPR_PROFIT_LOT; @@ -288,8 +292,16 @@ private: /* draw the number of vehicles of the group */ x = rtl ? x - 2 - this->column_size[VGC_NUMBER].width : x + 2 + this->column_size[VGC_PROFIT].width; - SetDParam(0, stats.num_vehicle); - DrawString(x, x + this->column_size[VGC_NUMBER].width - 1, y + (this->tiny_step_height - this->column_size[VGC_NUMBER].height) / 2, STR_TINY_COMMA, colour, SA_RIGHT | SA_FORCE); + int num_vehicle_with_subgroups = GetGroupNumVehicle(this->vli.company, g_id, this->vli.vtype); + int num_vehicle = GroupStatistics::Get(this->vli.company, g_id, this->vli.vtype).num_vehicle; + if (IsAllGroupID(g_id) || IsDefaultGroupID(g_id) || num_vehicle_with_subgroups == num_vehicle) { + SetDParam(0, num_vehicle); + DrawString(x, x + this->column_size[VGC_NUMBER].width - 1, y + (this->tiny_step_height - this->column_size[VGC_NUMBER].height) / 2, STR_TINY_COMMA, colour, SA_RIGHT | SA_FORCE); + } else { + SetDParam(0, num_vehicle); + SetDParam(1, num_vehicle_with_subgroups - num_vehicle); + DrawString(x, x + this->column_size[VGC_NUMBER].width - 1, y + (this->tiny_step_height - this->column_size[VGC_NUMBER].height) / 2, STR_GROUP_COUNT_WITH_SUBGROUP, colour, SA_RIGHT | SA_FORCE); + } } /** @@ -463,12 +475,12 @@ public: SetDParam(2, this->vehicles.size()); SetDParam(3, this->vehicles.size()); } else { - const Group *g = Group::Get(this->vli.index); + uint num_vehicle = GetGroupNumVehicle(this->vli.company, this->vli.index, this->vli.vtype); SetDParam(0, STR_GROUP_NAME); - SetDParam(1, g->index); - SetDParam(2, g->statistics.num_vehicle); - SetDParam(3, g->statistics.num_vehicle); + SetDParam(1, this->vli.index); + SetDParam(2, num_vehicle); + SetDParam(3, num_vehicle); } break; } diff --git a/src/lang/english.txt b/src/lang/english.txt index 032801ae5b..61fa2a91ba 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3437,6 +3437,8 @@ STR_GROUP_DEFAULT_ROAD_VEHICLES :Ungrouped road STR_GROUP_DEFAULT_SHIPS :Ungrouped ships STR_GROUP_DEFAULT_AIRCRAFTS :Ungrouped aircraft +STR_GROUP_COUNT_WITH_SUBGROUP :{TINY_FONT}{COMMA} (+{COMMA}) + STR_GROUPS_CLICK_ON_GROUP_FOR_TOOLTIP :{BLACK}Groups - click on a group to list all vehicles of this group. Drag and drop groups to arrange hierarchy. STR_GROUP_CREATE_TOOLTIP :{BLACK}Click to create a group STR_GROUP_DELETE_TOOLTIP :{BLACK}Delete the selected group From 49f7332b758f0fdcc70c2798a91fc1f0a4010971 Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Tue, 26 Mar 2019 00:35:01 +0000 Subject: [PATCH 80/82] Feature #6053: Collapsible vehicle groups (3298) --- src/group.h | 2 ++ src/group_cmd.cpp | 1 + src/group_gui.cpp | 58 ++++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 55 insertions(+), 6 deletions(-) diff --git a/src/group.h b/src/group.h index 8bb8d794fb..4c51e6ebd3 100644 --- a/src/group.h +++ b/src/group.h @@ -73,6 +73,8 @@ struct Group : GroupPool::PoolItem<&_group_pool> { Livery livery; ///< Custom colour scheme for vehicles in this group GroupStatistics statistics; ///< NOSAVE: Statistics and caches on the vehicles in the group. + bool folded; ///< NOSAVE: Is this group folded in the group view? + GroupID parent; ///< Parent group Group(CompanyID owner = INVALID_COMPANY); diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp index bb86c6b344..6939af88bf 100644 --- a/src/group_cmd.cpp +++ b/src/group_cmd.cpp @@ -298,6 +298,7 @@ void PropagateChildLivery(const Group *g) Group::Group(Owner owner) { this->owner = owner; + this->folded = false; } Group::~Group() diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 97c310e6f6..cc545ad8ff 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -103,6 +103,7 @@ class VehicleGroupWindow : public BaseVehicleListWindow { private: /* Columns in the group list */ enum ListColumns { + VGC_FOLD, ///< Fold / Unfold button. VGC_NAME, ///< Group name. VGC_PROTECT, ///< Autoreplace protect icon. VGC_AUTOREPLACE, ///< Autoreplace active icon. @@ -131,7 +132,14 @@ private: if (g->parent != parent) continue; this->groups.push_back(g); this->indents.push_back(indent); - AddChildren(source, g->index, indent + 1); + if (g->folded) { + /* Test if this group has children at all. If not, the folded flag should be cleared to avoid lingering unfold buttons in the list. */ + auto child = std::find_if(source->begin(), source->end(), [g](const Group *child){ return child->parent == g->index; }); + bool has_children = child != source->end(); + Group::Get(g->index)->folded = has_children; + } else { + AddChildren(source, g->index, indent + 1); + } } } @@ -194,9 +202,12 @@ private: */ uint ComputeGroupInfoSize() { + this->column_size[VGC_FOLD] = maxdim(GetSpriteSize(SPR_CIRCLE_FOLDED), GetSpriteSize(SPR_CIRCLE_UNFOLDED)); + this->tiny_step_height = this->column_size[VGC_FOLD].height; + this->column_size[VGC_NAME] = maxdim(GetStringBoundingBox(STR_GROUP_DEFAULT_TRAINS + this->vli.vtype), GetStringBoundingBox(STR_GROUP_ALL_TRAINS + this->vli.vtype)); this->column_size[VGC_NAME].width = max(170u, this->column_size[VGC_NAME].width); - this->tiny_step_height = this->column_size[VGC_NAME].height; + this->tiny_step_height = max(this->tiny_step_height, this->column_size[VGC_NAME].height); this->column_size[VGC_PROTECT] = GetSpriteSize(SPR_GROUP_REPLACE_PROTECT); this->tiny_step_height = max(this->tiny_step_height, this->column_size[VGC_PROTECT].height); @@ -222,6 +233,7 @@ private: this->tiny_step_height += WD_MATRIX_TOP; return WD_FRAMERECT_LEFT + 8 + + this->column_size[VGC_FOLD].width + 2 + this->column_size[VGC_NAME].width + 8 + this->column_size[VGC_PROTECT].width + 2 + this->column_size[VGC_AUTOREPLACE].width + 2 + @@ -238,8 +250,9 @@ private: * @param g_id Group to list. * @param indent Indentation level. * @param protection Whether autoreplace protection is set. + * @param has_children Whether the group has children and should have a fold / unfold button. */ - void DrawGroupInfo(int y, int left, int right, GroupID g_id, int indent = 0, bool protection = false) const + void DrawGroupInfo(int y, int left, int right, GroupID g_id, int indent = 0, bool protection = false, bool has_children = false) const { /* Highlight the group if a vehicle is dragged over it */ if (g_id == this->group_over) { @@ -253,6 +266,12 @@ private: const GroupStatistics &stats = GroupStatistics::Get(this->vli.company, g_id, this->vli.vtype); bool rtl = _current_text_dir == TD_RTL; + /* draw fold / unfold button */ + int x = rtl ? right - WD_FRAMERECT_RIGHT - 8 - this->column_size[VGC_FOLD].width + 1 : left + WD_FRAMERECT_LEFT + 8; + if (has_children) { + DrawSprite(Group::Get(g_id)->folded ? SPR_CIRCLE_FOLDED : SPR_CIRCLE_UNFOLDED, PAL_NONE, rtl ? x - indent : x + indent, y + (this->tiny_step_height - this->column_size[VGC_FOLD].height) / 2); + } + /* draw group name */ StringID str; if (IsAllGroupID(g_id)) { @@ -263,7 +282,7 @@ private: SetDParam(0, g_id); str = STR_GROUP_NAME; } - int x = rtl ? right - WD_FRAMERECT_RIGHT - 8 - this->column_size[VGC_NAME].width + 1 : left + WD_FRAMERECT_LEFT + 8; + x = rtl ? x - 2 - this->column_size[VGC_NAME].width : x + 2 + this->column_size[VGC_FOLD].width; DrawString(x + (rtl ? 0 : indent), x + this->column_size[VGC_NAME].width - 1 - (rtl ? indent : 0), y + (this->tiny_step_height - this->column_size[VGC_NAME].height) / 2, str, colour); /* draw autoreplace protection */ @@ -283,7 +302,7 @@ private: spr = SPR_PROFIT_NA; } else if (profit_last_year < 0) { spr = SPR_PROFIT_NEGATIVE; - } else if (profit_last_year < (Money) 10000 * num_profit_vehicle) { // TODO magic number + } else if (profit_last_year < (Money)10000 * num_profit_vehicle) { // TODO magic number spr = SPR_PROFIT_SOME; } else { spr = SPR_PROFIT_LOT; @@ -598,7 +617,7 @@ public: assert(g->owner == this->owner); - DrawGroupInfo(y1, r.left, r.right, g->index, this->indents[i] * LEVEL_WIDTH, g->replace_protection); + DrawGroupInfo(y1, r.left, r.right, g->index, this->indents[i] * LEVEL_WIDTH, g->replace_protection, g->folded || (i + 1 < (int)this->groups.size() && indents[i + 1] > this->indents[i])); y1 += this->tiny_step_height; } @@ -672,6 +691,33 @@ public: uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP, 0, this->tiny_step_height); if (id_g >= this->groups.size()) return; + if (groups[id_g]->folded || (id_g + 1 < this->groups.size() && this->indents[id_g + 1] > this->indents[id_g])) { + /* The group has children, check if the user clicked the fold / unfold button. */ + NWidgetCore *group_display = this->GetWidget(widget); + int x = _current_text_dir == TD_RTL ? + group_display->pos_x + group_display->current_x - WD_FRAMERECT_RIGHT - 8 - this->indents[id_g] * LEVEL_WIDTH - this->column_size[VGC_FOLD].width : + group_display->pos_x + WD_FRAMERECT_LEFT + 8 + this->indents[id_g] * LEVEL_WIDTH; + if (click_count > 1 || (pt.x >= x && pt.x < (int)(x + this->column_size[VGC_FOLD].width))) { + + GroupID g = this->vli.index; + if (!IsAllGroupID(g) && !IsDefaultGroupID(g)) { + do { + g = Group::Get(g)->parent; + if (g == groups[id_g]->index) { + this->vli.index = g; + break; + } + } while (g != INVALID_GROUP); + } + + Group::Get(groups[id_g]->index)->folded = !groups[id_g]->folded; + this->groups.ForceRebuild(); + + this->SetDirty(); + break; + } + } + this->group_sel = this->vli.index = this->groups[id_g]->index; SetObjectToPlaceWnd(SPR_CURSOR_MOUSE, PAL_NONE, HT_DRAG, this); From 1a4c7a4e545e275a60be1617e55d7ea4f65264f9 Mon Sep 17 00:00:00 2001 From: "Johannes E. Krause" Date: Sun, 24 Mar 2019 18:03:18 +0100 Subject: [PATCH 81/82] Cleanup: use switch for industry cargo vars --- src/newgrf_industries.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp index 980059cabb..19664fa6d2 100644 --- a/src/newgrf_industries.cpp +++ b/src/newgrf_industries.cpp @@ -312,12 +312,14 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte param_setID, byte layout CargoID cargo = GetCargoTranslation(parameter, this->ro.grffile); int index = this->industry->GetCargoProducedIndex(cargo); if (index < 0) return 0; // invalid cargo - if (variable == 0x69) return this->industry->produced_cargo_waiting[index]; - if (variable == 0x6A) return this->industry->this_month_production[index]; - if (variable == 0x6B) return this->industry->this_month_transported[index]; - if (variable == 0x6C) return this->industry->last_month_production[index]; - if (variable == 0x6D) return this->industry->last_month_transported[index]; - NOT_REACHED(); + switch (variable) { + case 0x69: return this->industry->produced_cargo_waiting[index]; + case 0x6A: return this->industry->this_month_production[index]; + case 0x6B: return this->industry->this_month_transported[index]; + case 0x6C: return this->industry->last_month_production[index]; + case 0x6D: return this->industry->last_month_transported[index]; + default: NOT_REACHED(); + } } From fdaf67d9246342f55a40d3d4ce8740e3dc53e265 Mon Sep 17 00:00:00 2001 From: "Johannes E. Krause" Date: Sun, 24 Mar 2019 18:32:39 +0100 Subject: [PATCH 82/82] Add: [Newgrf] Some 60+ Vars for industries that were missed in #6867 --- src/newgrf_industries.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp index 19664fa6d2..457b06f675 100644 --- a/src/newgrf_industries.cpp +++ b/src/newgrf_industries.cpp @@ -308,7 +308,9 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte param_setID, byte layout case 0x6A: case 0x6B: case 0x6C: - case 0x6D: { + case 0x6D: + case 0x70: + case 0x71: { CargoID cargo = GetCargoTranslation(parameter, this->ro.grffile); int index = this->industry->GetCargoProducedIndex(cargo); if (index < 0) return 0; // invalid cargo @@ -318,6 +320,8 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte param_setID, byte layout case 0x6B: return this->industry->this_month_transported[index]; case 0x6C: return this->industry->last_month_production[index]; case 0x6D: return this->industry->last_month_transported[index]; + case 0x70: return this->industry->production_rate[index]; + case 0x71: return this->industry->last_month_pct_transported[index]; default: NOT_REACHED(); } }