Merge branch 'git_findversion_fix' into save_ext
This commit is contained in:
@@ -45,7 +45,7 @@ struct CompanyInfrastructure {
|
||||
}
|
||||
};
|
||||
|
||||
typedef Pool<Company, CompanyByte, 1, MAX_COMPANIES> CompanyPool;
|
||||
typedef Pool<Company, CompanyID, 1, MAX_COMPANIES> CompanyPool;
|
||||
extern CompanyPool _company_pool;
|
||||
|
||||
|
||||
|
@@ -121,7 +121,7 @@ DEFINE_POOL_METHOD(inline void *)::AllocateItem(size_t size, size_t index)
|
||||
item = (Titem *)MallocT<byte>(size);
|
||||
}
|
||||
this->data[index] = item;
|
||||
item->index = (uint)index;
|
||||
item->index = (Tindex)(uint)index;
|
||||
return item;
|
||||
}
|
||||
|
||||
|
@@ -196,9 +196,9 @@ char *CrashLog::LogConfiguration(char *buffer, const char *last) const
|
||||
# include <ft2build.h>
|
||||
# include FT_FREETYPE_H
|
||||
#endif /* WITH_FREETYPE */
|
||||
#ifdef WITH_ICU
|
||||
#if defined(WITH_ICU_LAYOUT) || defined(WITH_ICU_SORT)
|
||||
# include <unicode/uversion.h>
|
||||
#endif /* WITH_ICU */
|
||||
#endif /* WITH_ICU_SORT || WITH_ICU_LAYOUT */
|
||||
#ifdef WITH_LZMA
|
||||
# include <lzma.h>
|
||||
#endif
|
||||
@@ -241,14 +241,19 @@ char *CrashLog::LogLibraries(char *buffer, const char *last) const
|
||||
buffer += seprintf(buffer, last, " FreeType: %d.%d.%d\n", major, minor, patch);
|
||||
#endif /* WITH_FREETYPE */
|
||||
|
||||
#ifdef WITH_ICU
|
||||
#if defined(WITH_ICU_LAYOUT) || defined(WITH_ICU_SORT)
|
||||
/* 4 times 0-255, separated by dots (.) and a trailing '\0' */
|
||||
char buf[4 * 3 + 3 + 1];
|
||||
UVersionInfo ver;
|
||||
u_getVersion(ver);
|
||||
u_versionToString(ver, buf);
|
||||
buffer += seprintf(buffer, last, " ICU: %s\n", buf);
|
||||
#endif /* WITH_ICU */
|
||||
#ifdef WITH_ICU_SORT
|
||||
buffer += seprintf(buffer, last, " ICU i18n: %s\n", buf);
|
||||
#endif
|
||||
#ifdef WITH_ICU_LAYOUT
|
||||
buffer += seprintf(buffer, last, " ICU lx: %s\n", buf);
|
||||
#endif
|
||||
#endif /* WITH_ICU_SORT || WITH_ICU_LAYOUT */
|
||||
|
||||
#ifdef WITH_LZMA
|
||||
buffer += seprintf(buffer, last, " LZMA: %s\n", lzma_version_string());
|
||||
|
@@ -186,7 +186,7 @@ static inline void GfxDoDrawLine(void *video, int x, int y, int x2, int y2, int
|
||||
int grade_x = x2 - x;
|
||||
|
||||
/* Clipping rectangle. Slightly extended so we can ignore the width of the line. */
|
||||
uint extra = CeilDiv(3 * width, 4); // not less then "width * sqrt(2) / 2"
|
||||
int extra = (int)CeilDiv(3 * width, 4); // not less then "width * sqrt(2) / 2"
|
||||
Rect clip = { -extra, -extra, screen_width - 1 + extra, screen_height - 1 + extra };
|
||||
|
||||
/* prevent integer overflows. */
|
||||
@@ -586,7 +586,7 @@ int GetStringLineCount(StringID str, int maxw)
|
||||
*/
|
||||
Dimension GetStringMultiLineBoundingBox(StringID str, const Dimension &suggestion)
|
||||
{
|
||||
Dimension box = {suggestion.width, GetStringHeight(str, suggestion.width)};
|
||||
Dimension box = {suggestion.width, (uint)GetStringHeight(str, suggestion.width)};
|
||||
return box;
|
||||
}
|
||||
|
||||
@@ -598,7 +598,7 @@ Dimension GetStringMultiLineBoundingBox(StringID str, const Dimension &suggestio
|
||||
*/
|
||||
Dimension GetStringMultiLineBoundingBox(const char *str, const Dimension &suggestion)
|
||||
{
|
||||
Dimension box = {suggestion.width, GetStringHeight(str, suggestion.width)};
|
||||
Dimension box = {suggestion.width, (uint)GetStringHeight(str, suggestion.width)};
|
||||
return box;
|
||||
}
|
||||
|
||||
|
@@ -17,9 +17,9 @@
|
||||
|
||||
#include "table/control_codes.h"
|
||||
|
||||
#ifdef WITH_ICU
|
||||
#ifdef WITH_ICU_LAYOUT
|
||||
#include <unicode/ustring.h>
|
||||
#endif /* WITH_ICU */
|
||||
#endif /* WITH_ICU_LAYOUT */
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
@@ -42,7 +42,7 @@ Font::Font(FontSize size, TextColour colour) :
|
||||
assert(size < FS_END);
|
||||
}
|
||||
|
||||
#ifdef WITH_ICU
|
||||
#ifdef WITH_ICU_LAYOUT
|
||||
/* Implementation details of LEFontInstance */
|
||||
|
||||
le_int32 Font::getUnitsPerEM() const
|
||||
@@ -213,7 +213,7 @@ static ParagraphLayouter *GetParagraphLayout(UChar *buff, UChar *buff_end, FontM
|
||||
return new ICUParagraphLayout(p);
|
||||
}
|
||||
|
||||
#endif /* WITH_ICU */
|
||||
#endif /* WITH_ICU_LAYOUT */
|
||||
|
||||
/*** Paragraph layout ***/
|
||||
/**
|
||||
@@ -654,7 +654,7 @@ Layouter::Layouter(const char *str, int maxw, TextColour colour, FontSize fontsi
|
||||
line.layout->Reflow();
|
||||
} else {
|
||||
/* Line is new, layout it */
|
||||
#ifdef WITH_ICU
|
||||
#ifdef WITH_ICU_LAYOUT
|
||||
FontState old_state = state;
|
||||
const char *old_str = str;
|
||||
|
||||
|
@@ -19,12 +19,12 @@
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#ifdef WITH_ICU
|
||||
#ifdef WITH_ICU_LAYOUT
|
||||
#include "layout/ParagraphLayout.h"
|
||||
#define ICU_FONTINSTANCE : public LEFontInstance
|
||||
#else /* WITH_ICU */
|
||||
#else /* WITH_ICU_LAYOUT */
|
||||
#define ICU_FONTINSTANCE
|
||||
#endif /* WITH_ICU */
|
||||
#endif /* WITH_ICU_LAYOUT */
|
||||
|
||||
/**
|
||||
* Text drawing parameters, which can change while drawing a line, but are kept between multiple parts
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
|
||||
Font(FontSize size, TextColour colour);
|
||||
|
||||
#ifdef WITH_ICU
|
||||
#ifdef WITH_ICU_LAYOUT
|
||||
/* Implementation details of LEFontInstance */
|
||||
|
||||
le_int32 getUnitsPerEM() const;
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
LEGlyphID mapCharToGlyph(LEUnicode32 ch) const;
|
||||
void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const;
|
||||
le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const;
|
||||
#endif /* WITH_ICU */
|
||||
#endif /* WITH_ICU_LAYOUT */
|
||||
};
|
||||
|
||||
/** Mapping from index to font. */
|
||||
|
@@ -1181,64 +1181,64 @@ STR_CONFIG_SETTING_TRAIN_ACCELERATION_MODEL :Model d'acceler
|
||||
STR_CONFIG_SETTING_TRAIN_ACCELERATION_MODEL_HELPTEXT :Seleccioneu el model físic per l'acceleració de trens. El model «original» penalitza les pujades per igual a tots els vehicles. El model «realista» penalitza les pujades i les corbes en funció de diverses propietats del tren, com ara la longitud i la força de tracció
|
||||
STR_CONFIG_SETTING_ROAD_VEHICLE_ACCELERATION_MODEL :Model d'acceleració per als vehicles: {STRING}
|
||||
STR_CONFIG_SETTING_ROAD_VEHICLE_ACCELERATION_MODEL_HELPTEXT :Seleccioneu el model físic per l'acceleració d'automòbils. El model «original» penalitza les pujades per igual a tots els vehicles. El model «realista» penalitza els pendents en funció de les diferents propietats de la màquina, com per exemple l'esforç de tracció.
|
||||
STR_CONFIG_SETTING_TRAIN_SLOPE_STEEPNESS :Pendent d'inclinació per als trens: {STRING}
|
||||
STR_CONFIG_SETTING_TRAIN_SLOPE_STEEPNESS_HELPTEXT :La inclinació d'una cel·la en pendent per a un tren. Els valors més alts fan que sigui més difícil escalar un turó
|
||||
STR_CONFIG_SETTING_TRAIN_SLOPE_STEEPNESS :Pendent de les costes per als trens: {STRING}
|
||||
STR_CONFIG_SETTING_TRAIN_SLOPE_STEEPNESS_HELPTEXT :El pendent de les caselles amb costes per als trens. Els valors alts fan que sigui més difícil pujar els turons.
|
||||
STR_CONFIG_SETTING_PERCENTAGE :{COMMA}%
|
||||
STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS :Pendent d'inclinació per als automòbils: {STRING}
|
||||
STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS_HELPTEXT :La inclinació d'una cel·la amb pendent per a automòbils. Els valors més alts fan que sigui més difícil escalar un turó
|
||||
STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS :Pendent de les costes per als vehicles de carretera: {STRING}
|
||||
STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS_HELPTEXT :El pendent de les caselles amb costes per a vehicles de carretera. Els valors alts fan que sigui més difícil pujar els turons.
|
||||
STR_CONFIG_SETTING_FORBID_90_DEG :Prohibeix fer girs de 90 graus als trens i vaixells: {STRING}
|
||||
STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT :Els girs de 90 graus succeeixen quan una via horitzontal està seguida d'una vertical a la cel·la annexa, provocant que el tren giri 90 graus quan travessi la vora de la cel·la en lloc dels 45 graus usuals en les altres combinacions. Això també s'aplica al radi de gir dels vaixells
|
||||
STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT :Els girs de 90 graus succeeixen quan hi ha una via horitzontal seguida d'una de vertical a la cel·la annexa, provocant que el tren giri 90 graus quan travessi la vora de la cel·la en lloc dels 45 graus usuals en les altres combinacions. Això també s'aplica al gir dels vaixells.
|
||||
STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS :Permet ajuntar estacions no annexes: {STRING}
|
||||
STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS_HELPTEXT :Permetre afegir parts a una estació sense contacte directe amb les parts existents. Fa falta Ctrl + Clic, mentre és col·loquen les peces noves
|
||||
STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS_HELPTEXT :Aquesta opció permet afegir parts noves a una estació existent sense estar les parts noves en contacte directe amb les existents. Cal clicar Ctrl+Clic mentre es col·loquen les parts noves.
|
||||
STR_CONFIG_SETTING_INFLATION :Inflació: {STRING}
|
||||
STR_CONFIG_SETTING_INFLATION_HELPTEXT :Habilita la inflació a l'economia, on l'augment dels costos són una mica més ràpids que els dels pagaments
|
||||
STR_CONFIG_SETTING_MAX_BRIDGE_LENGTH :Màxima longitud dels ponts: {STRING}
|
||||
STR_CONFIG_SETTING_INFLATION_HELPTEXT :Habilita la inflació a l'economia, on l'augment dels costos són una mica més ràpids que els dels pagaments.
|
||||
STR_CONFIG_SETTING_MAX_BRIDGE_LENGTH :Longitud màxima dels ponts: {STRING}
|
||||
STR_CONFIG_SETTING_MAX_BRIDGE_LENGTH_HELPTEXT :Longitud màxima per a la construcció de ponts
|
||||
STR_CONFIG_SETTING_MAX_BRIDGE_HEIGHT :Alçada màxima dels ponts: {STRING}
|
||||
STR_CONFIG_SETTING_MAX_BRIDGE_HEIGHT_HELPTEXT :Alçada màxima de construcció dels ponts
|
||||
STR_CONFIG_SETTING_MAX_TUNNEL_LENGTH :Màxima longitud dels túnels: {STRING}
|
||||
STR_CONFIG_SETTING_MAX_TUNNEL_LENGTH_HELPTEXT :Longitud màxima per a la construcció de túnels
|
||||
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD :Mètode de construcció de la indústria primària manual: {STRING}
|
||||
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_HELPTEXT :Mètode de finançament d'indústria primària. 'cap' significa que no serà possible fundar-ne cap, 'prospecció' significa que serà possible fundar-ne, però la construcció succeirà en un lloc aleatori del mapa i també podria passar que fracassi, 'com les altre indústries' significa que les indústries de matèries primeres poden ser construides a qualsevol lloc per les companyies igual que les indústries manufactureres
|
||||
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NONE :Cap
|
||||
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD :Fundació de noves indústries primàries: {STRING}
|
||||
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_HELPTEXT :Mètode de fundació de noves indústries primàries. «Fundació desactivada» significa que no serà possible fundar-ne cap, «Amb prospeccions» significa que serà possible fundar-ne, però la construcció succeirà en un lloc aleatori del mapa i podria fracassar. «Com les altres indústries» significa que les indústries de matèries primeres poden ser construïdes en qualsevol lloc per les companyies igual que les indústries manufactureres.
|
||||
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NONE :Fundació desactivada
|
||||
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NORMAL :Com les altres indústries
|
||||
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_PROSPECTING :Prospeccionant
|
||||
STR_CONFIG_SETTING_INDUSTRY_PLATFORM :Àrea plana al voltant de les indústries: {STRING}
|
||||
STR_CONFIG_SETTING_INDUSTRY_PLATFORM_HELPTEXT :Quantitat d'espai pla al voltant d'una indústira. Això assegura que quedarà espai buit al voltant de la indústria per a construir vies, etc.
|
||||
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_PROSPECTING :Amb prospeccions
|
||||
STR_CONFIG_SETTING_INDUSTRY_PLATFORM :Àrea anivellada al voltant de les indústries: {STRING}
|
||||
STR_CONFIG_SETTING_INDUSTRY_PLATFORM_HELPTEXT :Quantitat d'espai pla al voltant d'una indústria. Això assegura que quedarà espai buit al voltant de la indústria per construir vies o altres infraestructures.
|
||||
STR_CONFIG_SETTING_MULTIPINDTOWN :Permet vàries indústries similars a cada població: {STRING}
|
||||
STR_CONFIG_SETTING_MULTIPINDTOWN_HELPTEXT :Normalment, una població no vol més d'un tipus d'indústria de cada tipus. Amb aquest paràmetre es permetrà diverses indústries del mateix tipus a la mateixa població
|
||||
STR_CONFIG_SETTING_MULTIPINDTOWN_HELPTEXT :Normalment, una població no vol tenir més d'una indústria de cada tipus. Amb aquest paràmetre es permet la construcció de diverses indústries del mateix tipus a la mateixa població.
|
||||
STR_CONFIG_SETTING_SIGNALSIDE :Mostra els senyals: {STRING}
|
||||
STR_CONFIG_SETTING_SIGNALSIDE_HELPTEXT :Selecciona a quin costat de la via s'han de posar els senyals
|
||||
STR_CONFIG_SETTING_SIGNALSIDE_HELPTEXT :Seleccioneu a quin costat de la via s'han de posar els senyals
|
||||
STR_CONFIG_SETTING_SIGNALSIDE_LEFT :A l'esquerra
|
||||
STR_CONFIG_SETTING_SIGNALSIDE_DRIVING_SIDE :Al costat de conducció
|
||||
STR_CONFIG_SETTING_SIGNALSIDE_RIGHT :A la dreta
|
||||
STR_CONFIG_SETTING_SHOWFINANCES :Mostra la finestra de balanç al finalitzar cada any: {STRING}
|
||||
STR_CONFIG_SETTING_SHOWFINANCES_HELPTEXT :Si està activat, la finestra de finances apareix al final de cada any per permetre una inspecció fàcil de l'estat financer de la companyia
|
||||
STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT :Les noves ordres predeterminades són 'sense parada': {STRING}
|
||||
STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT_HELPTEXT :Normalment, un vehicle pararà a cada estació que passi. Activant aquest paràmetre no pararà a cap estació fins arribar a la seu destí. Nota, aquest paràmetre només defineix el valor predeterminat per les noves ordres. De totes maneres les ordres individuals poden establir explícitament qualsevol dels comportaments
|
||||
STR_CONFIG_SETTING_STOP_LOCATION :Noves ordres del tren: parar per defecte {STRING} de la plataforma
|
||||
STR_CONFIG_SETTING_STOP_LOCATION_HELPTEXT :Situa en quin lloc de la plataforma el tren pararà per defecte. 'Extrem més proper' significa a prop del punt d'entrada, 'al mig' significa al mig de la plataforma, i 'extrem més llunyà' significa lluny del punt d'entrada. Nota, aquest paràmetre només defineix el valor predeterminat per les noves ordres. De totes maneres les ordres individuals poden establir explícitament qualsevol dels comportaments
|
||||
STR_CONFIG_SETTING_STOP_LOCATION_NEAR_END :a l'extrem més proper
|
||||
STR_CONFIG_SETTING_STOP_LOCATION_MIDDLE :a la meitat
|
||||
STR_CONFIG_SETTING_STOP_LOCATION_FAR_END :a l'extrem més llunyà
|
||||
STR_CONFIG_SETTING_AUTOSCROLL :Finestra d'avís quan el ratolí és al marc del programa: {STRING}
|
||||
STR_CONFIG_SETTING_AUTOSCROLL_HELPTEXT :Quan està activat, les vistes començaran a desplaçar-se quan el ratolí sigui a prop la vora de la finestra
|
||||
STR_CONFIG_SETTING_SHOWFINANCES_HELPTEXT :Si el paràmetre està activat, la finestra de finances apareix al final de cada any per permetre una inspecció fàcil de l'estat financer de la companyia.
|
||||
STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT :«Sense parada» per defecte a les noves ordres : {STRING}
|
||||
STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT_HELPTEXT :Normalment, un vehicle para a cada estació per la que passa. Activant aquest paràmetre, no pararà a cap estació fins arribar al seu destí. Nota: aquest paràmetre només defineix el valor predeterminat per a les noves ordres. Un cop creada una ordre, aquesta es pot establir manualment al comportament desitjat.
|
||||
STR_CONFIG_SETTING_STOP_LOCATION :Noves ordres de trens: parar per defecte {STRING} de la plataforma
|
||||
STR_CONFIG_SETTING_STOP_LOCATION_HELPTEXT :Estableix en quin lloc de la plataforma els trens pararan per defecte. «Extrem més proper» significa a prop del punt d'entrada, «Al mig» significa al mig de la plataforma, i «Extrem més llunyà» significa lluny del punt d'entrada. Nota: aquest paràmetre només defineix el valor predeterminat per les noves ordres. Un cop creada una ordre, es pot modificar el comportament de forma manual.
|
||||
STR_CONFIG_SETTING_STOP_LOCATION_NEAR_END :A l'extrem més proper
|
||||
STR_CONFIG_SETTING_STOP_LOCATION_MIDDLE :Al mig
|
||||
STR_CONFIG_SETTING_STOP_LOCATION_FAR_END :A l'extrem més llunyà
|
||||
STR_CONFIG_SETTING_AUTOSCROLL :Desplaça la finestra quan el ratolí sigui prop de la vora: {STRING}
|
||||
STR_CONFIG_SETTING_AUTOSCROLL_HELPTEXT :Quan està activat, l'àrea de visualització començarà a desplaçar-se quan el ratolí sigui prop de la vora de la finestra.
|
||||
STR_CONFIG_SETTING_AUTOSCROLL_DISABLED :Desactivat
|
||||
STR_CONFIG_SETTING_AUTOSCROLL_MAIN_VIEWPORT_FULLSCREEN :Vista principal, només pantalla completa
|
||||
STR_CONFIG_SETTING_AUTOSCROLL_MAIN_VIEWPORT_FULLSCREEN :Vista principal (només pantalla completa)
|
||||
STR_CONFIG_SETTING_AUTOSCROLL_MAIN_VIEWPORT :Vista principal
|
||||
STR_CONFIG_SETTING_AUTOSCROLL_EVERY_VIEWPORT :Cada vista
|
||||
STR_CONFIG_SETTING_BRIBE :Permet subornar a les autoritats locals: {STRING}
|
||||
STR_CONFIG_SETTING_BRIBE_HELPTEXT :Permet a les companyies intentar subornar a l'autoritat local. Si el suborn és detectat per un inspector, la companyia no podrà actuar a la població durant sis mesos
|
||||
STR_CONFIG_SETTING_AUTOSCROLL_EVERY_VIEWPORT :Qualsevol vista
|
||||
STR_CONFIG_SETTING_BRIBE :Permet subornar les autoritats locals: {STRING}
|
||||
STR_CONFIG_SETTING_BRIBE_HELPTEXT :Permet a les companyies intentar subornar l'autoritat local. Si el suborn és detectat per un inspector, la companyia no podrà actuar a la població durant sis mesos.
|
||||
STR_CONFIG_SETTING_ALLOW_EXCLUSIVE :Permet comprar els drets del transport en exclusiva: {STRING}
|
||||
STR_CONFIG_SETTING_ALLOW_EXCLUSIVE_HELPTEXT :Si una companyia compra els drets de transport en exclusiva en una població, les estacions dels oponents (passatgers i càrrega) no rebran cap càrrega durant tot l'any
|
||||
STR_CONFIG_SETTING_ALLOW_EXCLUSIVE_HELPTEXT :Si una companyia compra els drets de transport en exclusiva d'una població, les estacions dels oponents (passatgers i càrrega) no rebran cap càrrega durant un any sencer.
|
||||
STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS :Permet finançar edificis: {STRING}
|
||||
STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS_HELPTEXT :Permet a les companyies donar diners a les poblacions per a finançar nous edificis
|
||||
STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS_HELPTEXT :Permet a les companyies donar diners a les poblacions per finançar nous edificis
|
||||
STR_CONFIG_SETTING_ALLOW_FUND_ROAD :Permet finançar la reconstrucció dels carrers locals: {STRING}
|
||||
STR_CONFIG_SETTING_ALLOW_FUND_ROAD_HELPTEXT :Permet a les companyies donar diners a les poblacions per a la reconstrucció de carrers i sabotejar-hi la circulació de vehicles
|
||||
STR_CONFIG_SETTING_ALLOW_FUND_ROAD_HELPTEXT :Permet a les companyies donar diners a les poblacions per la reconstrucció de carrers i sabotejar la circulació de vehicles.
|
||||
STR_CONFIG_SETTING_ALLOW_GIVE_MONEY :Permet enviar diners a altres companyies: {STRING}
|
||||
STR_CONFIG_SETTING_ALLOW_GIVE_MONEY_HELPTEXT :Permet transferir diners entre companyies en el mode multijugador
|
||||
STR_CONFIG_SETTING_FREIGHT_TRAINS :Multiplicador de pes per contenidor per simular trens pesats: {STRING}
|
||||
STR_CONFIG_SETTING_FREIGHT_TRAINS_HELPTEXT :Estableix l'impacte de transportar contenidors en trens. Un valor més alt fa que transportar contenidors sigui més exigent amb els trens, especialment als turons
|
||||
STR_CONFIG_SETTING_FREIGHT_TRAINS :Multiplicador de pes per simular trens pesats: {STRING}
|
||||
STR_CONFIG_SETTING_FREIGHT_TRAINS_HELPTEXT :Estableix l'impacte de transportar contenidors en trens. Els valors alts fan que transportar contenidors sigui més exigent amb els trens, especialment als turons.
|
||||
STR_CONFIG_SETTING_PLANE_SPEED :Factor de velocitat dels avions: {STRING}
|
||||
STR_CONFIG_SETTING_PLANE_SPEED_HELPTEXT :Estableix la velocitat relativa dels avions en comparació amb els altres tipus de vehicles, per reduir la quantitat de guanys de transport dels avions
|
||||
STR_CONFIG_SETTING_PLANE_SPEED_VALUE :1 / {COMMA}
|
||||
|
@@ -3185,7 +3185,7 @@ STR_FINANCES_YEAR :{WHITE}{NUM}
|
||||
STR_FINANCES_SECTION_CONSTRUCTION :{GOLD}Bouwkosten
|
||||
STR_FINANCES_SECTION_NEW_VEHICLES :{GOLD}Nieuwe voertuigen
|
||||
STR_FINANCES_SECTION_TRAIN_RUNNING_COSTS :{GOLD}Treinonderhoudskosten
|
||||
STR_FINANCES_SECTION_ROAD_VEHICLE_RUNNING_COSTS :{GOLD}Wegvoertuigbrandstofkosten
|
||||
STR_FINANCES_SECTION_ROAD_VEHICLE_RUNNING_COSTS :{GOLD}Wegvoertuigonderhoudskosten
|
||||
STR_FINANCES_SECTION_AIRCRAFT_RUNNING_COSTS :{GOLD}Vliegtuigonderhoudskosten
|
||||
STR_FINANCES_SECTION_SHIP_RUNNING_COSTS :{GOLD}Schiponderhoudskosten
|
||||
STR_FINANCES_SECTION_PROPERTY_MAINTENANCE :{GOLD}Eigendomsonderhoud
|
||||
@@ -3268,7 +3268,7 @@ STR_COMPANY_INFRASTRUCTURE_VIEW_TRAMWAY :{WHITE}Tramrail
|
||||
STR_COMPANY_INFRASTRUCTURE_VIEW_WATER_SECT :{GOLD}Water tegels:
|
||||
STR_COMPANY_INFRASTRUCTURE_VIEW_CANALS :{WHITE}Kanalen
|
||||
STR_COMPANY_INFRASTRUCTURE_VIEW_STATION_SECT :{GOLD}Stations:
|
||||
STR_COMPANY_INFRASTRUCTURE_VIEW_STATIONS :{WHITE}Station tegels
|
||||
STR_COMPANY_INFRASTRUCTURE_VIEW_STATIONS :{WHITE}Stationtegels
|
||||
STR_COMPANY_INFRASTRUCTURE_VIEW_AIRPORTS :{WHITE}Vliegvelden
|
||||
STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL :{WHITE}{CURRENCY_LONG}/jr
|
||||
|
||||
@@ -3350,7 +3350,7 @@ STR_GROUP_DEFAULT_SHIPS :Niet gegroepeer
|
||||
STR_GROUP_DEFAULT_AIRCRAFTS :Niet gegroepeerde vliegtuigen
|
||||
|
||||
STR_GROUPS_CLICK_ON_GROUP_FOR_TOOLTIP :{BLACK}Groepen - Klik op een groep voor een lijst van alle voertuigen in deze groep. Klik en sleep om hiërarchie te beheren
|
||||
STR_GROUP_CREATE_TOOLTIP :{BLACK}Klik om een groep te maken
|
||||
STR_GROUP_CREATE_TOOLTIP :{BLACK}Klik om een groep te creëren
|
||||
STR_GROUP_DELETE_TOOLTIP :{BLACK}Verwijder de geselecteerde groep
|
||||
STR_GROUP_RENAME_TOOLTIP :{BLACK}Hernoem de geselecteerde groep
|
||||
STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Klik om deze groep te beschermen tegen globaal automatisch vervangen
|
||||
|
@@ -13,9 +13,9 @@
|
||||
#define LANGUAGE_H
|
||||
|
||||
#include "core/smallvec_type.hpp"
|
||||
#ifdef WITH_ICU
|
||||
#ifdef WITH_ICU_SORT
|
||||
#include <unicode/coll.h>
|
||||
#endif /* WITH_ICU */
|
||||
#endif /* WITH_ICU_SORT */
|
||||
|
||||
static const uint8 CASE_GENDER_LEN = 16; ///< The (maximum) length of a case/gender string.
|
||||
static const uint8 MAX_NUM_GENDERS = 8; ///< Maximum number of supported genders.
|
||||
@@ -110,9 +110,9 @@ extern LanguageList _languages;
|
||||
/** The currently loaded language. */
|
||||
extern const LanguageMetadata *_current_language;
|
||||
|
||||
#ifdef WITH_ICU
|
||||
#ifdef WITH_ICU_SORT
|
||||
extern Collator *_current_collator;
|
||||
#endif /* WITH_ICU */
|
||||
#endif /* WITH_ICU_SORT */
|
||||
|
||||
bool ReadLanguagePack(const LanguageMetadata *lang);
|
||||
const LanguageMetadata *GetLanguage(byte newgrflangid);
|
||||
|
@@ -25,7 +25,12 @@ int32 SimpleCountedObject::Release()
|
||||
int32 res = --m_ref_cnt;
|
||||
assert(res >= 0);
|
||||
if (res == 0) {
|
||||
FinalRelease();
|
||||
try {
|
||||
FinalRelease(); // may throw, for example ScriptTest/ExecMode
|
||||
} catch (...) {
|
||||
delete this;
|
||||
throw;
|
||||
}
|
||||
delete this;
|
||||
}
|
||||
return res;
|
||||
|
@@ -825,7 +825,7 @@ Point QueryString::GetCaretPosition(const Window *w, int wid) const
|
||||
int delta = min(0, (right - left) - tb->pixels - 10);
|
||||
if (tb->caretxoffs + delta < 0) delta = -tb->caretxoffs;
|
||||
|
||||
Point pt = {left + WD_FRAMERECT_LEFT + tb->caretxoffs + delta, wi->pos_y + WD_FRAMERECT_TOP};
|
||||
Point pt = {left + WD_FRAMERECT_LEFT + tb->caretxoffs + delta, (int)wi->pos_y + WD_FRAMERECT_TOP};
|
||||
return pt;
|
||||
}
|
||||
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include "dmusic.h"
|
||||
|
||||
#include <windows.h>
|
||||
#undef FACILITY_DIRECTMUSIC // Needed for newer Windows SDK version.
|
||||
#include <dmksctrl.h>
|
||||
#include <dmusici.h>
|
||||
#include <dmusicc.h>
|
||||
|
@@ -223,7 +223,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, FONT_HEIGHT_NORMAL * 4 + WD_TEXTPANEL_TOP + WD_TEXTPANEL_BOTTOM};
|
||||
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++) {
|
||||
const GRFParameterInfo *par_info = this->grf_config->param_info[i];
|
||||
if (par_info == NULL) continue;
|
||||
|
@@ -322,7 +322,9 @@ static char *PrintModuleInfo(char *output, const char *last, HMODULE mod)
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(disable:4091)
|
||||
#include <dbghelp.h>
|
||||
#pragma warning(default:4091)
|
||||
|
||||
char *CrashLogWindows::AppendDecodedStacktrace(char *buffer, const char *last) const
|
||||
{
|
||||
|
@@ -14,13 +14,13 @@
|
||||
#include "../../gfx_func.h"
|
||||
#include "../../textbuf_gui.h"
|
||||
#include "../../fileio_func.h"
|
||||
#include "../../fios.h"
|
||||
#include <windows.h>
|
||||
#include <fcntl.h>
|
||||
#include <regstr.h>
|
||||
#include <shlobj.h> /* SHGetFolderPath */
|
||||
#include <shellapi.h>
|
||||
#include "win32.h"
|
||||
#include "../../fios.h"
|
||||
#include "../../core/alloc_func.hpp"
|
||||
#include "../../openttd.h"
|
||||
#include "../../core/random_func.hpp"
|
||||
|
@@ -233,7 +233,7 @@ static void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, uint32 p2, u
|
||||
p2 |= ddir << 6; // Set the DiagDirecion into p2 bits 6 and 7.
|
||||
|
||||
TileArea ta(start_tile, end_tile);
|
||||
CommandContainer cmdcont = { ta.tile, ta.w | ta.h << 8, p2, cmd, CcRoadStop, "" };
|
||||
CommandContainer cmdcont = { ta.tile, (uint32)(ta.w | ta.h << 8), p2, cmd, CcRoadStop, "" };
|
||||
ShowSelectStationIfNeeded(cmdcont, ta);
|
||||
}
|
||||
|
||||
|
@@ -30,7 +30,7 @@ ScriptExecMode::ScriptExecMode()
|
||||
this->SetDoCommandMode(&ScriptExecMode::ModeProc, this);
|
||||
}
|
||||
|
||||
ScriptExecMode::~ScriptExecMode()
|
||||
void ScriptExecMode::FinalRelease()
|
||||
{
|
||||
if (this->GetDoCommandModeInstance() != this) {
|
||||
/* Ignore this error if the script already died. */
|
||||
@@ -38,5 +38,9 @@ ScriptExecMode::~ScriptExecMode()
|
||||
throw Script_FatalError("ScriptExecMode object was removed while it was not the latest *Mode object created.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ScriptExecMode::~ScriptExecMode()
|
||||
{
|
||||
this->SetDoCommandMode(this->last_mode, this->last_instance);
|
||||
}
|
||||
|
@@ -46,6 +46,8 @@ public:
|
||||
* in when the instance was created.
|
||||
*/
|
||||
~ScriptExecMode();
|
||||
|
||||
virtual void FinalRelease();
|
||||
};
|
||||
|
||||
#endif /* SCRIPT_EXECMODE_HPP */
|
||||
|
@@ -371,8 +371,8 @@ static bool NormaliseTileOffset(int32 *tile)
|
||||
if (!::IsValidTile(tile) || !::IsValidTile(start) || !::IsValidTile(end)) return -1;
|
||||
if (::DistanceManhattan(tile, start) != 1 || ::DistanceManhattan(tile, end) != 1) return -1;
|
||||
|
||||
/* ROAD_NW ROAD_SW ROAD_SE ROAD_NE */
|
||||
static const TileIndex neighbours[] = {::TileDiffXY(0, -1), ::TileDiffXY(1, 0), ::TileDiffXY(0, 1), ::TileDiffXY(-1, 0)};
|
||||
/* ROAD_NW ROAD_SW ROAD_SE ROAD_NE */
|
||||
static const TileIndexDiff neighbours[] = {::TileDiffXY(0, -1), ::TileDiffXY(1, 0), ::TileDiffXY(0, 1), ::TileDiffXY(-1, 0)};
|
||||
Array *existing = (Array*)alloca(sizeof(Array) + lengthof(neighbours) * sizeof(int32));
|
||||
existing->size = 0;
|
||||
|
||||
|
@@ -30,7 +30,7 @@ ScriptTestMode::ScriptTestMode()
|
||||
this->SetDoCommandMode(&ScriptTestMode::ModeProc, this);
|
||||
}
|
||||
|
||||
ScriptTestMode::~ScriptTestMode()
|
||||
void ScriptTestMode::FinalRelease()
|
||||
{
|
||||
if (this->GetDoCommandModeInstance() != this) {
|
||||
/* Ignore this error if the script already died. */
|
||||
@@ -38,5 +38,9 @@ ScriptTestMode::~ScriptTestMode()
|
||||
throw Script_FatalError("Testmode object was removed while it was not the latest *Mode object created.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ScriptTestMode::~ScriptTestMode()
|
||||
{
|
||||
this->SetDoCommandMode(this->last_mode, this->last_instance);
|
||||
}
|
||||
|
@@ -48,6 +48,8 @@ public:
|
||||
* in when the instance was created.
|
||||
*/
|
||||
~ScriptTestMode();
|
||||
|
||||
virtual void FinalRelease();
|
||||
};
|
||||
|
||||
#endif /* SCRIPT_TESTMODE_HPP */
|
||||
|
@@ -1883,13 +1883,13 @@ struct GameSettingsWindow : Window {
|
||||
if (this->warn_missing != WHR_NONE) {
|
||||
const int left = panel->pos_x;
|
||||
const int right = left + panel->current_x - 1;
|
||||
const int top = panel->pos_y;
|
||||
const int top = panel->pos_y + WD_FRAMETEXT_TOP + (SETTING_HEIGHT - FONT_HEIGHT_NORMAL) * this->warn_lines / 2;
|
||||
SetDParam(0, _game_settings_restrict_dropdown[this->filter.min_cat]);
|
||||
if (this->warn_lines == 1) {
|
||||
/* If the warning fits at one line, center it. */
|
||||
DrawString(left + WD_FRAMETEXT_LEFT, right - WD_FRAMETEXT_RIGHT, top + WD_FRAMETEXT_TOP, warn_str, TC_FROMSTRING, SA_HOR_CENTER);
|
||||
DrawString(left + WD_FRAMETEXT_LEFT, right - WD_FRAMETEXT_RIGHT, top, warn_str, TC_FROMSTRING, SA_HOR_CENTER);
|
||||
} else {
|
||||
DrawStringMultiLine(left + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top + WD_FRAMERECT_TOP, INT32_MAX, warn_str);
|
||||
DrawStringMultiLine(left + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, INT32_MAX, warn_str, TC_FROMSTRING, SA_HOR_CENTER);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1943,7 +1943,7 @@ struct GameSettingsWindow : Window {
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_GS_OPTIONSPANEL: {
|
||||
int top_pos = r.top + SETTINGTREE_TOP_OFFSET + 1 + this->warn_lines * FONT_HEIGHT_NORMAL;
|
||||
int top_pos = r.top + SETTINGTREE_TOP_OFFSET + 1 + this->warn_lines * SETTING_HEIGHT;
|
||||
uint last_row = this->vscroll->GetPosition() + this->vscroll->GetCapacity() - this->warn_lines;
|
||||
int next_row = GetSettingsTree().Draw(settings_ptr, r.left + SETTINGTREE_LEFT_OFFSET, r.right - SETTINGTREE_RIGHT_OFFSET, top_pos,
|
||||
this->vscroll->GetPosition(), last_row, this->last_clicked);
|
||||
|
@@ -268,7 +268,7 @@ struct SignListWindow : Window, SignList {
|
||||
Dimension spr_dim = GetSpriteSize(SPR_COMPANY_ICON);
|
||||
this->text_offset = WD_FRAMETEXT_LEFT + spr_dim.width + 2; // 2 pixels space between icon and the sign text.
|
||||
resize->height = max<uint>(FONT_HEIGHT_NORMAL, spr_dim.height);
|
||||
Dimension d = {this->text_offset + WD_FRAMETEXT_RIGHT, WD_FRAMERECT_TOP + 5 * resize->height + WD_FRAMERECT_BOTTOM};
|
||||
Dimension d = {(uint)(this->text_offset + WD_FRAMETEXT_RIGHT), WD_FRAMERECT_TOP + 5 * resize->height + WD_FRAMERECT_BOTTOM};
|
||||
*size = maxdim(*size, d);
|
||||
break;
|
||||
}
|
||||
|
@@ -1076,7 +1076,7 @@ void SmallMapWindow::RebuildColourIndexIfNecessary()
|
||||
_heightmap_schemes[n].height_colours = ReallocT<uint32>(_heightmap_schemes[n].height_colours, heights);
|
||||
|
||||
for (int z = 0; z < heights; z++) {
|
||||
uint access_index = (_heightmap_schemes[n].colour_count * z) / heights;
|
||||
size_t access_index = (_heightmap_schemes[n].colour_count * z) / heights;
|
||||
|
||||
/* Choose colour by mapping the range (0..max heightlevel) on the complete colour table. */
|
||||
_heightmap_schemes[n].height_colours[z] = _heightmap_schemes[n].height_colours_base[access_index];
|
||||
@@ -1401,7 +1401,7 @@ int SmallMapWindow::GetPositionOnLegend(Point pt)
|
||||
case WID_SM_ZOOM_IN:
|
||||
case WID_SM_ZOOM_OUT: {
|
||||
const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_SM_MAP);
|
||||
Point pt = {wid->current_x / 2, wid->current_y / 2};
|
||||
Point pt = { (int)wid->current_x / 2, (int)wid->current_y / 2};
|
||||
this->SetZoomLevel((widget == WID_SM_ZOOM_IN) ? ZLC_ZOOM_IN : ZLC_ZOOM_OUT, &pt);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
break;
|
||||
|
@@ -81,7 +81,7 @@ const char *SoundDriver_Win32::Start(const char * const *parm)
|
||||
PrepareHeader(&_wave_hdr[1]);
|
||||
|
||||
if (NULL == (_thread = CreateThread(NULL, 8192, SoundThread, 0, 0, &_threadId))) throw "Failed to create thread";
|
||||
} catch (char *error) {
|
||||
} catch (const char *error) {
|
||||
this->Stop();
|
||||
return error;
|
||||
}
|
||||
|
@@ -1409,7 +1409,7 @@ struct StationViewWindow : public Window {
|
||||
if (!this->IsShaded()) {
|
||||
/* Draw 'accepted cargo' or 'cargo ratings'. */
|
||||
const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_SV_ACCEPT_RATING_LIST);
|
||||
const Rect r = {wid->pos_x, wid->pos_y, wid->pos_x + wid->current_x - 1, wid->pos_y + wid->current_y - 1};
|
||||
const Rect r = {(int)wid->pos_x, (int)wid->pos_y, (int)(wid->pos_x + wid->current_x - 1), (int)(wid->pos_y + wid->current_y - 1)};
|
||||
if (this->GetWidget<NWidgetCore>(WID_SV_ACCEPTS_RATINGS)->widget_data == STR_STATION_VIEW_RATINGS_BUTTON) {
|
||||
int lines = this->DrawAcceptedCargo(r);
|
||||
if (lines > this->accepts_lines) { // Resize the widget, and perform re-initialization of the window.
|
||||
@@ -1437,7 +1437,7 @@ struct StationViewWindow : public Window {
|
||||
|
||||
/* Draw waiting cargo. */
|
||||
NWidgetBase *nwi = this->GetWidget<NWidgetBase>(WID_SV_WAITING);
|
||||
Rect waiting_rect = {nwi->pos_x, nwi->pos_y, nwi->pos_x + nwi->current_x - 1, nwi->pos_y + nwi->current_y - 1};
|
||||
Rect waiting_rect = { (int)nwi->pos_x, (int)nwi->pos_y, (int)(nwi->pos_x + nwi->current_x - 1), (int)(nwi->pos_y + nwi->current_y - 1)};
|
||||
this->DrawEntries(&cargo, waiting_rect, pos, maxrows, 0);
|
||||
scroll_to_row = INT_MAX;
|
||||
}
|
||||
|
@@ -223,7 +223,9 @@
|
||||
|
||||
#include <malloc.h> // alloca()
|
||||
#define NORETURN __declspec(noreturn)
|
||||
#define inline __forceinline
|
||||
#if (_MSC_VER < 1900)
|
||||
#define inline __forceinline
|
||||
#endif
|
||||
|
||||
#if !defined(WINCE)
|
||||
#define CDECL _cdecl
|
||||
|
@@ -378,7 +378,7 @@ static int TranslateArgumentIdx(int arg, int offset = 0);
|
||||
static void EmitWordList(Buffer *buffer, const char * const *words, uint nw)
|
||||
{
|
||||
buffer->AppendByte(nw);
|
||||
for (uint i = 0; i < nw; i++) buffer->AppendByte((uint)strlen(words[i]) + 1);
|
||||
for (uint i = 0; i < nw; i++) buffer->AppendByte((byte)strlen(words[i]) + 1);
|
||||
for (uint i = 0; i < nw; i++) {
|
||||
for (uint j = 0; words[i][j] != '\0'; j++) buffer->AppendByte(words[i][j]);
|
||||
buffer->AppendByte(0);
|
||||
|
@@ -25,12 +25,12 @@
|
||||
#include <errno.h> // required by vsnprintf implementation for MSVC
|
||||
#endif
|
||||
|
||||
#ifdef WITH_ICU
|
||||
#ifdef WITH_ICU_SORT
|
||||
/* Required by strnatcmp. */
|
||||
#include <unicode/ustring.h>
|
||||
#include "language.h"
|
||||
#include "gfx_func.h"
|
||||
#endif /* WITH_ICU */
|
||||
#endif /* WITH_ICU_SORT */
|
||||
|
||||
/* The function vsnprintf is used internally to perform the required formatting
|
||||
* tasks. As such this one must be allowed, and makes sure it's terminated. */
|
||||
@@ -355,7 +355,7 @@ bool IsValidChar(WChar key, CharSetFilter afilter)
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
/**
|
||||
* Almost POSIX compliant implementation of \c vsnprintf for VC compiler.
|
||||
* The difference is in the value returned on output truncation. This
|
||||
@@ -578,33 +578,20 @@ int strnatcmp(const char *s1, const char *s2, bool ignore_garbage_at_front)
|
||||
s1 = SkipGarbage(s1);
|
||||
s2 = SkipGarbage(s2);
|
||||
}
|
||||
#ifdef WITH_ICU
|
||||
#ifdef WITH_ICU_SORT
|
||||
if (_current_collator != NULL) {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
int result;
|
||||
|
||||
/* We want to use the new faster method for ICU 4.2 and higher. */
|
||||
#if U_ICU_VERSION_MAJOR_NUM > 4 || (U_ICU_VERSION_MAJOR_NUM == 4 && U_ICU_VERSION_MINOR_NUM >= 2)
|
||||
/* The StringPiece parameter gets implicitly constructed from the char *. */
|
||||
result = _current_collator->compareUTF8(s1, s2, status);
|
||||
#else /* The following for 4.0 and lower. */
|
||||
UChar buffer1[DRAW_STRING_BUFFER];
|
||||
u_strFromUTF8Lenient(buffer1, lengthof(buffer1), NULL, s1, -1, &status);
|
||||
UChar buffer2[DRAW_STRING_BUFFER];
|
||||
u_strFromUTF8Lenient(buffer2, lengthof(buffer2), NULL, s2, -1, &status);
|
||||
|
||||
result = _current_collator->compare(buffer1, buffer2, status);
|
||||
#endif /* ICU version check. */
|
||||
int result = _current_collator->compareUTF8(s1, s2, status);
|
||||
if (U_SUCCESS(status)) return result;
|
||||
}
|
||||
|
||||
#endif /* WITH_ICU */
|
||||
#endif /* WITH_ICU_SORT */
|
||||
|
||||
/* Do a normal comparison if ICU is missing or if we cannot create a collator. */
|
||||
return strcasecmp(s1, s2);
|
||||
}
|
||||
|
||||
#ifdef WITH_ICU
|
||||
#ifdef WITH_ICU_SORT
|
||||
|
||||
#include <unicode/utext.h>
|
||||
#include <unicode/brkiter.h>
|
||||
|
@@ -49,9 +49,9 @@ const LanguageMetadata *_current_language = NULL; ///< The currently loaded lang
|
||||
|
||||
TextDirection _current_text_dir; ///< Text direction of the currently selected language.
|
||||
|
||||
#ifdef WITH_ICU
|
||||
#ifdef WITH_ICU_SORT
|
||||
Collator *_current_collator = NULL; ///< Collator for the language currently in use.
|
||||
#endif /* WITH_ICU */
|
||||
#endif /* WITH_ICU_SORT */
|
||||
|
||||
static uint64 _global_string_params_data[20]; ///< Global array of string parameters. To access, use #SetDParam.
|
||||
static WChar _global_string_params_type[20]; ///< Type of parameters stored in #_decode_parameters
|
||||
@@ -1275,7 +1275,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
if (c == NULL) break;
|
||||
|
||||
if (c->name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)c->name};
|
||||
int64 args_array[] = {(int64)(size_t)c->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1301,7 +1301,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
case SCC_DEPOT_NAME: { // {DEPOT}
|
||||
VehicleType vt = (VehicleType)args->GetInt32(SCC_DEPOT_NAME);
|
||||
if (vt == VEH_AIRCRAFT) {
|
||||
uint64 args_array[] = {args->GetInt32()};
|
||||
uint64 args_array[] = {(uint64)args->GetInt32()};
|
||||
WChar types_array[] = {SCC_STATION_NAME};
|
||||
StringParameters tmp_params(args_array, 1, types_array);
|
||||
buff = GetStringWithArgs(buff, STR_FORMAT_DEPOT_NAME_AIRCRAFT, &tmp_params, last);
|
||||
@@ -1310,7 +1310,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
|
||||
const Depot *d = Depot::Get(args->GetInt32());
|
||||
if (d->name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)d->name};
|
||||
int64 args_array[] = {(int64)(size_t)d->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1326,7 +1326,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
if (e == NULL) break;
|
||||
|
||||
if (e->name != NULL && e->IsEnabled()) {
|
||||
int64 args_array[] = {(uint64)(size_t)e->name};
|
||||
int64 args_array[] = {(int64)(size_t)e->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1341,7 +1341,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
if (g == NULL) break;
|
||||
|
||||
if (g->name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)g->name};
|
||||
int64 args_array[] = {(int64)(size_t)g->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1378,7 +1378,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
if (c == NULL) break;
|
||||
|
||||
if (c->president_name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)c->president_name};
|
||||
int64 args_array[] = {(int64)(size_t)c->president_name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1403,7 +1403,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
}
|
||||
|
||||
if (st->name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)st->name};
|
||||
int64 args_array[] = {(int64)(size_t)st->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1432,7 +1432,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
if (t == NULL) break;
|
||||
|
||||
if (t->name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)t->name};
|
||||
int64 args_array[] = {(int64)(size_t)t->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1446,7 +1446,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
if (wp == NULL) break;
|
||||
|
||||
if (wp->name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)wp->name};
|
||||
int64 args_array[] = {(int64)(size_t)wp->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1464,7 +1464,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
if (v == NULL) break;
|
||||
|
||||
if (v->name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)v->name};
|
||||
int64 args_array[] = {(int64)(size_t)v->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1490,7 +1490,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
if (si == NULL) break;
|
||||
|
||||
if (si->name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)si->name};
|
||||
int64 args_array[] = {(int64)(size_t)si->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1790,7 +1790,7 @@ bool ReadLanguagePack(const LanguageMetadata *lang)
|
||||
strecpy(_config_language_file, c_file, lastof(_config_language_file));
|
||||
SetCurrentGrfLangID(_current_language->newgrflangid);
|
||||
|
||||
#ifdef WITH_ICU
|
||||
#ifdef WITH_ICU_SORT
|
||||
/* Delete previous collator. */
|
||||
if (_current_collator != NULL) {
|
||||
delete _current_collator;
|
||||
@@ -1807,7 +1807,7 @@ bool ReadLanguagePack(const LanguageMetadata *lang)
|
||||
delete _current_collator;
|
||||
_current_collator = NULL;
|
||||
}
|
||||
#endif /* WITH_ICU */
|
||||
#endif /* WITH_ICU_SORT */
|
||||
|
||||
/* Some lists need to be sorted again after a language change. */
|
||||
ReconsiderGameScriptLanguage();
|
||||
@@ -2132,7 +2132,7 @@ void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
|
||||
/* Update the font with cache */
|
||||
LoadStringWidthTable(searcher->Monospace());
|
||||
|
||||
#if !defined(WITH_ICU)
|
||||
#if !defined(WITH_ICU_LAYOUT)
|
||||
/*
|
||||
* For right-to-left languages we need the ICU library. If
|
||||
* we do not have support for that library we warn the user
|
||||
@@ -2152,5 +2152,5 @@ void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
|
||||
SetDParamStr(0, err_str);
|
||||
ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, WL_ERROR);
|
||||
}
|
||||
#endif
|
||||
#endif /* !WITH_ICU_LAYOUT */
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@
|
||||
#include "../newgrf_engine.h"
|
||||
|
||||
/* Helper for filling property tables */
|
||||
#define NIP(prop, base, variable, type, name) { name, cpp_offsetof(base, variable), cpp_sizeof(base, variable), prop, type }
|
||||
#define NIP(prop, base, variable, type, name) { name, (ptrdiff_t)cpp_offsetof(base, variable), cpp_sizeof(base, variable), prop, type }
|
||||
#define NIP_END() { NULL, 0, 0, 0, 0 }
|
||||
|
||||
/* Helper for filling callback tables */
|
||||
|
@@ -9,23 +9,23 @@
|
||||
|
||||
/** @file string_colours.h The colour translation of GRF's strings. */
|
||||
|
||||
/** Colour mapping for the TextColours. */
|
||||
/** Colour mapping for #TextColour. */
|
||||
static const byte _string_colourmap[17] = {
|
||||
150, // TC_BLUE
|
||||
12, // TC_SILVER
|
||||
189, // TC_GOLD
|
||||
184, // TC_RED
|
||||
174, // TC_PURPLE
|
||||
30, // TC_LIGHT_BROWN
|
||||
195, // TC_ORANGE
|
||||
209, // TC_GREEN
|
||||
68, // TC_YELLOW
|
||||
95, // TC_DARK_GREEN
|
||||
79, // TC_CREAM
|
||||
116, // TC_BROWN
|
||||
15, // TC_WHITE
|
||||
152, // TC_LIGHT_BLUE
|
||||
6, // TC_GREY
|
||||
133, // TC_DARK_BLUE
|
||||
1, // TC_BLACK
|
||||
150, // TC_BLUE
|
||||
12, // TC_SILVER
|
||||
189, // TC_GOLD
|
||||
184, // TC_RED
|
||||
174, // TC_PURPLE
|
||||
30, // TC_LIGHT_BROWN
|
||||
195, // TC_ORANGE
|
||||
209, // TC_GREEN
|
||||
68, // TC_YELLOW
|
||||
95, // TC_DARK_GREEN
|
||||
79, // TC_CREAM
|
||||
116, // TC_BROWN
|
||||
15, // TC_WHITE
|
||||
152, // TC_LIGHT_BLUE
|
||||
6, // TC_GREY
|
||||
133, // TC_DARK_BLUE
|
||||
1, // TC_BLACK
|
||||
};
|
||||
|
@@ -403,7 +403,7 @@ CommandCost CmdTerraformLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
||||
}
|
||||
}
|
||||
|
||||
if (c != NULL) c->terraform_limit -= ts.tile_to_new_height.size() << 16;
|
||||
if (c != NULL) c->terraform_limit -= (uint32)ts.tile_to_new_height.size() << 16;
|
||||
}
|
||||
return total_cost;
|
||||
}
|
||||
|
@@ -227,7 +227,7 @@ static void Gunzip(byte **bufp, size_t *sizep)
|
||||
|
||||
memset(&z, 0, sizeof(z));
|
||||
z.next_in = *bufp;
|
||||
z.avail_in = *sizep;
|
||||
z.avail_in = (uInt)*sizep;
|
||||
|
||||
/* window size = 15, add 32 to enable gzip or zlib header processing */
|
||||
res = inflateInit2(&z, 15 + 32);
|
||||
|
@@ -1545,7 +1545,7 @@ void NWidgetMatrix::SetupSmallestSize(Window *w, bool init_array)
|
||||
SB(nw->index, 16, 16, 0);
|
||||
this->head->SetupSmallestSize(w, init_array);
|
||||
|
||||
Dimension padding = {this->pip_pre + this->pip_post, this->pip_pre + this->pip_post};
|
||||
Dimension padding = { (uint)this->pip_pre + this->pip_post, (uint)this->pip_pre + this->pip_post};
|
||||
Dimension size = {this->head->smallest_x + padding.width, this->head->smallest_y + padding.height};
|
||||
Dimension fill = {0, 0};
|
||||
Dimension resize = {this->pip_inter + this->head->smallest_x, this->pip_inter + this->head->smallest_y};
|
||||
|
@@ -380,8 +380,8 @@ void ShowDropDownListAt(Window *w, const DropDownList *list, int selected, int b
|
||||
|
||||
if (auto_width) width = max(width, max_item_width);
|
||||
|
||||
Point dw_pos = { w->left + (_current_text_dir == TD_RTL ? wi_rect.right + 1 - width : wi_rect.left), top};
|
||||
Dimension dw_size = {width, height};
|
||||
Point dw_pos = { w->left + (_current_text_dir == TD_RTL ? wi_rect.right + 1 - (int)width : wi_rect.left), top};
|
||||
Dimension dw_size = {width, (uint)height};
|
||||
new DropdownWindow(w, list, selected, button, instant_close, dw_pos, dw_size, wi_colour, scroll);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user