1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-14 10:09:11 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
rubidium
1e365418e6 (svn r25249) -Release: 1.3.1-RC1 2013-05-17 19:09:39 +00:00
282 changed files with 8751 additions and 15025 deletions

View File

@@ -1,7 +1,3 @@
This is the license which applies to OpenTTD with the exception of some
3rd party modules. See readme.txt for details
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991

View File

@@ -90,9 +90,9 @@ endif
ifeq ($(TTD), openttd.exe)
$(Q)unix2dos "$(BUNDLE_DIR)/docs/"* "$(BUNDLE_DIR)/readme.txt" "$(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/"
$(Q)cp "$(ROOT_DIR)/os/dos/cwsdpmi.txt" "$(BUNDLE_DIR)/docs/"
ifndef STRIP
$(Q)cp "$(ROOT_DIR)/os/dos/cwsdpmi/cwsdpmi.exe" "$(TTD_DIR)/"
$(Q)cp "$(ROOT_DIR)/os/dos/cwsdpmi.exe" "$(TTD_DIR)/"
endif
endif
endif

View File

@@ -588,7 +588,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
SetName(): false
GetLastErrorString(): ERR_NAME_IS_NOT_UNIQUE
GetName(): Regression
GetPresidentName(): E. McAlpine
GetPresidentName(): P. Sharkey
SetPresidentName(): true
GetPresidentName(): Regression AI
GetBankBalance(): 100000

View File

@@ -21,25 +21,20 @@ description.el_GR = Ένα πάκετο μουσικής χωρίς πραγμα
description.en_AU = A music pack without actual music.
description.en_US = A music pack without actual music.
description.es_ES = Un conjunto de música vacío.
description.et_EE = Muusikakogu ilma muusikata.
description.et_EE = Muusikakomplekt ilma igasuguse muusikata.
description.fi_FI = Musiikkipaketti, jossa ei ole musiikkia.
description.fr_FR = Un pack de musiques sans musiques.
description.gd_GB = Pacaid ciùil anns nach eil fonn sam bith.
description.gl_ES = Un conxunto de músicas sen ningunha música.
description.hr_HR = Muzički paket bez ikakve muzike.
description.hu_HU = Zenei alapcsomag zene nélkül.
description.id_ID = Paket musik tanpa musik sungguhan.
description.id_ID = Paket musik tanpa berisi musik.
description.is_IS = Tónlistarpakki sem er í raun án tónlistar.
description.it_IT = Un pacchetto musicale non contenente alcuna musica.
description.ja_JP = 空の音楽パック
description.ko_KR = 실제 음악이 없는 음악 목록입니다.
description.lb_LU = E Musikpack ouni aktuell Musik.
description.lt_LT = Muzikos pakas be muzikos.
description.nb_NO = En musikkpakke uten noe musikk.
description.nl_NL = Een muziekset zonder muziek.
description.nn_NO = Ei musikkpakke utan noko musikk.
description.pl_PL = Zestaw utworów muzycznych nie zawierający żadnej muzyki.
description.pt_BR = Um pacote de músicas sem músicas.
description.pt_PT = Um conjunto de música vazio.
description.ro_RO = Un set de muzică fără muzică inclusă.
description.ru_RU = "Пустой" набор музыкального оформления, не содержащий никакой музыки.
@@ -47,12 +42,8 @@ description.sk_SK = Sada hudby neobsahujúca hudbu.
description.sl_SI = Glasbeni paket z vključeno glasbo.
description.sr_RS = Prazan skup muzičkih numera.
description.sv_SE = Ett musikpaket utan någon musik.
description.ta_IN = இசை இல்லாத இசைத்தொகுப்பு.
description.th_TH = ชุดเพลงประกอบแบบไม่มีเสียงเพลง
description.tr_TR = Müzik içermeyen boş bir müzik paketi.
description.uk_UA = Порожній набір музики.
description.vi_VN = Gói âm nhạc này không có nhạc nào.
description.zh_CN = 一个没有实际内容的音乐包.
description.zh_TW = 不含任何音樂的音樂集。
[files]

View File

@@ -21,25 +21,20 @@ description.el_GR = Ένα πάκετο ήχων χώρις ήχους.
description.en_AU = A sound pack without any sounds.
description.en_US = A sound pack without any sounds.
description.es_ES = Un conjunto de sonidos vacío.
description.et_EE = Helikogu ilma helideta.
description.et_EE = Ilma häälteta helipakk.
description.fi_FI = Äänipaketti, jossa ei ole ääniä.
description.fr_FR = Un pack de sons sans sons.
description.gd_GB = Pacaid fhuaimean anns nach eil fuaim sam bith.
description.gl_ES = Un conxunto de sons sen ningún son
description.hr_HR = Zvučni paket bez ikakvih zvukova.
description.hu_HU = Hang alapcsomag hangok nélkül.
description.id_ID = Paket efek suara tanpa suara apapun.
description.id_ID = Paket efek suara tanpa berisi suara.
description.is_IS = Hljóðpakki án hljóðs.
description.it_IT = Un pacchetto sonoro non contenente alcun suono.
description.ja_JP = 空の効果音パック
description.ko_KR = 아무런 효과음도 없는 효과음 팩입니다.
description.lb_LU = En Soundpack mat all den Sounds.
description.lt_LT = Garsų pakas be jokių garsų.
description.nb_NO = En lydpakke uten noen lyder.
description.nl_NL = Een geluidset zonder geluid.
description.nn_NO = Ei lydpakke utan nokon lydar.
description.pl_PL = Zestaw dźwięków nie zawierający żadnych dźwięków.
description.pt_BR = Um pacote de sons sem sons.
description.pt_PT = Um conjunto de sons vazio.
description.ro_RO = Un set de sunete fără nici un sunet inclus.
description.ru_RU = "Пустой" набор звукового оформления, не содержащий никаких звуков.
@@ -47,12 +42,8 @@ description.sk_SK = Zvuková sada neobsahujúca zvuky.
description.sl_SI = Zvočni paket brez zvoka.
description.sr_RS = Prazan skup zvukova.
description.sv_SE = Ett ljudpaket utan några ljud.
description.ta_IN = ஒலிகள் இல்லாத ஒலி தொகுப்பு.
description.th_TH = ชุดเสียงแบบไร้เสียง
description.tr_TR = Ses içermeyen boş bir ses kümesi.
description.uk_UA = Порожній набір звуків.
description.vi_VN = Gói âm thanh này không có âm thanh nào.
description.zh_CN = 一个空的音效包.
description.zh_TW = 不含任何音效的音效集。
[files]

View File

@@ -32,15 +32,11 @@ description.hu_HU = Az eredeti Transport Tycoon Deluxe DOS verziójának grafik
description.id_ID = Grafik orisinil Transport Tycoon Deluxe versi DOS.
description.is_IS = Upprunalega grafíkin úr Transport Tycoon Deluxe DOS útgáfunni.
description.it_IT = Grafica originale di Transport Tycoon Deluxe, edizione DOS.
description.ja_JP = Transport Tycoon Deluxe オリジナル版 グラフィック (DOS)
description.ko_KR = 오리지널 트랜스포트 타이쿤 디럭스 도스 에디션의 그래픽입니다.
description.lb_LU = Original Transport Tycoon Deluxe DOS Editioun Grafik.
description.lt_LT = Originali Transport Tycoon Deluxe DOS leidimo grafika.
description.nb_NO = Original grafikk fra Transport Tycoon Deluxe for DOS.
description.nl_NL = Originele graphics van de Transport Tycoon Deluxe DOS-versie.
description.nn_NO = Original grafikk frå Transport Tycoon Deluxe for DOS.
description.pl_PL = Oryginalna edycja grafik dla Transport Tycoon Deluxe DOS.
description.pt_BR = Gráficos Originais do Transport Tycoon Deluxe, Edição DOS.
description.pt_PT = Gráficos originais da edição DOS de Transport Tycoon Deluxe.
description.ro_RO = Setul grafic original al Transport Tycoon Deluxe pentru DOS.
description.ru_RU = Оригинальная графика из Transport Tycoon Deluxe для DOS.
@@ -48,12 +44,8 @@ description.sk_SK = Pôvodná grafika Transport Tycoon Deluxe (DOS).
description.sl_SI = Originalna grafika Transport Tycoon Deluxe za različico DOS.
description.sr_RS = Originalni skup grafika Transport Tycoon Deluxe DOS izdanja.
description.sv_SE = Originalgrafiken från Transport Tycoon Deluxe, DOS-utgåvan.
description.ta_IN = அசல் டிரான்ஸ்ஃபோர்ட் டைகூன் டீலக்ஸ் DOS பதிப்பு அசைவூட்டங்கள்.
description.th_TH = กราฟฟิกต้นตำหรับของ Transport Tycoon Deluxe DOS edition
description.tr_TR = Orijinal Transport Tycoon Deluxe DOS sürümü grafikleri.
description.uk_UA = Оригінальна графіка з Transport Tycoon Deluxe DOS edition.
description.vi_VN = Đồ họa gốc từ phiên bản Transport Tycoon Deluxe trên DOS
description.zh_CN = 运输大亨DOS豪华版原版图形包.
description.zh_TW = 原版 Transport Tycoon Deluxe DOS 版的圖形。
[files]

View File

@@ -25,21 +25,16 @@ description.et_EE = Algse Transport Tycoon Deluxe DOSi versiooni helid.
description.fi_FI = Alkuperäiset Transport Tycoon Deluxen DOS-version äänet.
description.fr_FR = Sons originaux de Transport Tycoon Deluxe (version DOS).
description.gd_GB = Fuaimean aig an deasachadh DOS tùsail aig Transport Tycoon Deluxe.
description.gl_ES = Sons da edición orixinal de Transport Tycoon Deluxe para DOS.
description.hr_HR = Originalni zvukovi za Transport Tycoon Deluxe DOS izdanje.
description.hu_HU = Az eredeti Transport Tycoon Deluxe DOS verziójának hangjai.
description.id_ID = Efek suara orisinil Transport Tycoon Deluxe versi DOS.
description.is_IS = Upprunalega hljóðið úr Transport Tycoon Deluxe DOS útgáfunni.
description.it_IT = Suoni originali di Transport Tycoon Deluxe, edizione DOS.
description.ja_JP = Transport Tycoon Deluxe オリジナル版 効果音 (DOS)
description.ko_KR = 오리지널 트랜스포트 타이쿤 도스 에디션의 효과음입니다.
description.lb_LU = Original Transport Tycoon Deluxe DOS Editioun Sound.
description.lt_LT = Originalūs Transport Tycoon Deluxe DOS leidimo garsai.
description.nb_NO = Originale lyder fra Transport Tycoon Deluxe for DOS.
description.nl_NL = Originele geluiden van de Transport Tycoon Deluxe DOS-versie.
description.nn_NO = Originale lydar frå Transport Tycoon Deluxe for DOS.
description.pl_PL = Oryginalna edycja dźwięków dla Transport Tycoon Deluxe DOS.
description.pt_BR = Sons Originais do Transport Tycoon Deluxe, Edição DOS.
description.pt_PT = Sons originais da edição DOS de Transport Tycoon Deluxe.
description.ro_RO = Setul de sunete original al Transport Tycoon Deluxe pentru DOS.
description.ru_RU = Оригинальный набор звукового оформления из игры Transport Tycoon Deluxe для DOS.
@@ -47,12 +42,8 @@ description.sk_SK = Pôvodné zvuky Transport Tycoon Deluxe (DOS).
description.sl_SI = Originalni zvoki Transport Tycoon Deluxe različice DOS.
description.sr_RS = Originalni skup zvukova Transport Tycoon Deluxe DOS izdanja.
description.sv_SE = Originalljuden från Transport Tycoon Deluxe, DOS-utgåvan.
description.ta_IN = அசல் டிரான்ஸ்ஃபோர்ட் டைகூன் டீலக்ஸ் DOS பதிப்பு ஒலிகள்.
description.th_TH = เสียงต้นตำหรับของ Transport Tycoon Deluxe DOS edition
description.tr_TR = Orijinal Transport Tycoon Deluxe DOS sürümü sesleri.
description.uk_UA = Оригінальний набір звуків з Transport Tycoon Deluxe DOS edition.
description.vi_VN = Âm thanh gốc từ phiên bản Transport Tycoon Deluxe trên DOS
description.zh_CN = 运输大亨DOS豪华版原版音效包.
description.zh_TW = 原版 Transport Tycoon Deluxe DOS 版的音效。
[files]

View File

@@ -32,15 +32,11 @@ description.hu_HU = Az eredeti Transport Tycoon Deluxe DOS (német) verziójána
description.id_ID = Grafik orisinil Transport Tycoon Deluxe versi DOS (Jerman).
description.is_IS = Upprunalega grafíkin úr Transport Tycoon Deluxe DOS (þýsku) útgáfunni.
description.it_IT = Grafica originale di Transport Tycoon Deluxe (tedesco), edizione DOS.
description.ja_JP = Transport Tycoon Deluxe オリジナル版 グラフィック (DOS・ドイツ版)
description.ko_KR = 오리지널 트랜스포트 타이쿤 디럭스 도스 에디션(독일)의 그래픽입니다.
description.lb_LU = Original Transport Tycoon Deluxe DOS (Däitsch) Editioun Grafik.
description.lt_LT = Originali Transport Tycoon Deluxe DOS (Vokiečių) leidimo grafika.
description.nb_NO = Original grafikk fra Transport Tycoon Deluxe for DOS (tysk).
description.nl_NL = Originele graphics van de Duitse Transport Tycoon Deluxe DOS-versie.
description.nn_NO = Original grafikk frå Transport Tycoon Deluxe for DOS (tysk).
description.pl_PL = Oryginalna edycja grafik dla Transport Tycoon Deluxe DOS (German).
description.pt_BR = Gráficos Originais do Transport Tycoon Deluxe, Edição DOS alemã.
description.pt_PT = Gráficos originais da edição DOS (Alemã) de Transport Tycoon Deluxe.
description.ro_RO = Setul grafic original al Transport Tycoon Deluxe pentru DOS (ediţia germană).
description.ru_RU = Оригинальная графика из немецкой версии Transport Tycoon Deluxe для DOS.
@@ -48,12 +44,8 @@ description.sk_SK = Pôvodná grafika Transport Tycoon Deluxe (DOS) (v jazyku ne
description.sl_SI = Originalna grafika Transport Tycoon Deluxe za nemško različico DOS.
description.sr_RS = Originalni skup grafika nemačkog Transport Tycoon Deluxe DOS izdanja.
description.sv_SE = Originalgrafiken från Transport Tycoon Deluxe, DOS-utgåvan (tyska).
description.ta_IN = அசல் டிரான்ஸ்ஃபோர்ட் டைகூன் டீலக்ஸ் DOS (செருமன்) பதிப்பு அசைவூட்டங்கள்.
description.th_TH = กราฟฟิกต้นตำหรับของ Transport Tycoon Deluxe DOS (German) edition
description.tr_TR = Orijinal Transport Tycoon Deluxe DOS (Almanca) sürümü grafikleri.
description.uk_UA = Оригінальна графіка з Transport Tycoon Deluxe DOS edition (німецького).
description.vi_VN = Đồ họa gốc từ phiên bản Transport Tycoon Deluxe trên DOS (tiếng Đức)
description.zh_CN = 运输大亨DOS豪华德语版原版图形包.
description.zh_TW = 原版 Transport Tycoon Deluxe DOS 版 (德國版) 的圖形。
[files]

View File

@@ -32,15 +32,11 @@ description.hu_HU = Az eredeti Transport Tycoon Deluxe Windows verziójának gra
description.id_ID = Grafik orisinil Transport Tycoon Deluxe versi Windows.
description.is_IS = Upprunalega grafíkin úr Transport Tycoon Deluxe Windows útgáfunni.
description.it_IT = Grafica originale di Transport Tycoon Deluxe, edizione Windows.
description.ja_JP = Transport Tycoon Deluxe オリジナル版 グラフィック (Windows)
description.ko_KR = 오리지널 트랜스포트 타이쿤 디럭스 윈도우 에디션의 그래픽입니다.
description.lb_LU = Original Transport Tycoon Deluxe Windows Editioun Grafik.
description.lt_LT = Originali Transport Tycoon Deluxe Windows leidimo grafika.
description.nb_NO = Original grafikk fra Transport Tycoon Deluxe for Windows.
description.nl_NL = Originele graphics van de Transport Tycoon Deluxe Windows-versie.
description.nn_NO = Original grafikk frå Transport Tycoon Deluxe for Windows.
description.pl_PL = Oryginalna edycja grafik dla Transport Tycoon Deluxe Windows.
description.pt_BR = Gráficos Originais do Transport Tycoon, Edição Windows.
description.pt_PT = Gráficos originais da edição Windows de Transport Tycoon Deluxe.
description.ro_RO = Setul grafic original al Transport Tycoon Deluxe pentru Windows.
description.ru_RU = Оригинальная графика из Transport Tycoon Deluxe для Windows.
@@ -48,12 +44,8 @@ description.sk_SK = Pôvodná grafika Transport Tycoon Deluxe (Windows).
description.sl_SI = Originalna grafika Transport Tycoon Deluxe za različico oken(windows).
description.sr_RS = Originalni skup grafika Transport Tycoon Deluxe Windows izdanja.
description.sv_SE = Originalgrafiken från Transport Tycoon Deluxe, Windows-utgåvan.
description.ta_IN = அசல் டிரான்ஸ்ஃபோர்ட் டைகூன் டீலக்ஸ் விண்டோஸ் பதிப்பு அசைவூட்டங்கள்.
description.th_TH = กราฟฟิกต้ำตำหรับของ Transport Tycoon Deluxe Windows edition
description.tr_TR = Orijinal Transport Tycoon Deluxe Windows sürümü grafikleri.
description.uk_UA = Оригінальна графіка з Transport Tycoon Deluxe Windows edition.
description.vi_VN = Đồ họa gốc từ phiên bản Transport Tycoon Deluxe trên Windows
description.zh_CN = 运输大亨Windows豪华版原版图形包.
description.zh_TW = 原版 Transport Tycoon Deluxe Windows 版的圖形。
[files]

View File

@@ -25,21 +25,16 @@ description.et_EE = Algse Transport Tycoon Deluxe Windowsi versiooni muusika.
description.fi_FI = Alkuperäinen Transport Tycoon Deluxen Windows-version musiikki.
description.fr_FR = Musiques originales de Transport Tycoon Deluxe (version Windows).
description.gd_GB = Ceòl aig an deasachadh Windows tùsail aig Transport Tycoon Deluxe.
description.gl_ES = Música da edición orixinal de Transport Tycoon Deluxe para Windows.
description.hr_HR = Originalna muzika za Transport Tycoon Deluxe Windows izdanje.
description.hu_HU = Az eredeti Transport Tycoon Deluxe Windows verziójának zenéje.
description.id_ID = Musik pengiring orisinil Transport Tycoon Deluxe versi Windows.
description.is_IS = Upprunalega tónlistin úr Transport Tycoon Deluxe Windows útgáfunni.
description.it_IT = Musica originale di Transport Tycoon Deluxe, edizione Windows.
description.ja_JP = Transport Tycoon Deluxe オリジナル版 音楽 (Windows)
description.ko_KR = 오리지널 트랜스포트 타이쿤 디럭스 윈도우 에디션의 음악입니다.
description.lb_LU = Original Transport Tycoon Deluxe Windows Editioun Music.
description.lt_LT = Originali Transport Tycoon Deluxe Windows leidimo muzika.
description.nb_NO = Original musikk fra Transport Tycoon Deluxe for Windows.
description.nl_NL = Originele muziek van de Transport Tycoon Deluxe Windows-versie.
description.nn_NO = Original musikk frå Transport Tycoon Deluxe for Windows.
description.pl_PL = Oryginalna edycja utworów muzycznych w Transport Tycoon Deluxe Windows.
description.pt_BR = Música Original do Transport Tycoon Deluxe, Edição Windows
description.pt_PT = Música original da edição Windows de Transport Tycoon Deluxe.
description.ro_RO = Setul de muzică original al Transport Tycoon Deluxe pentru Windows.
description.ru_RU = Оригинальный набор музыкального оформления из игры Transport Tycoon Deluxe для Windows.
@@ -47,12 +42,8 @@ description.sk_SK = Pôvodná hudba z Transport Tycoon Deluxe (Windows).
description.sl_SI = Originalna glasba Transport Tycoon Deluxe različice oken(windows).
description.sr_RS = Originalni skup muzičkih numera Transport Tycoon Deluxe Windows izdanja.
description.sv_SE = Originalmusiken från Transport Tycoon Deluxe, Windows-utgåvan.
description.ta_IN = அசல் டிரான்ஸ்ஃபோர்ட் டைகூன் டீலக்ஸ் விண்டோஸ் பதிப்பு இசை.
description.th_TH = เพลงต้นตำหรับชอง Transport Tycoon Deluxe Windows edition
description.tr_TR = Orijinal Transport Tycoon Deluxe Windows sürümü müzikleri.
description.uk_UA = Оригінальна музика з Transport Tycoon Deluxe Windows edition.
description.vi_VN = Nhạc gốc từ phiên bản Transport Tycoon Deluxe trên Windows
description.zh_CN = Transport Tycoon Deluxe运输大亨Windows豪华版的原版音乐包
description.zh_TW = 原版 Transport Tycoon Deluxe Windows 版的音樂。
[files]

View File

@@ -25,21 +25,16 @@ description.et_EE = Algse Transport Tycoon Deluxe Windowsi versiooni helid.
description.fi_FI = Alkuperäiset Transport Tycoon Deluxen Windows-version äänet.
description.fr_FR = Sons originaux de Transport Tycoon Deluxe (version Windows).
description.gd_GB = Fuaimean aig an deasachadh Windows tùsail aig Transport Tycoon Deluxe.
description.gl_ES = Sons da edición orixinal de Transport Tycoon Deluxe para Windows.
description.hr_HR = Originalni zvukovi za Transport Tycoon Deluxe Windows izdanje.
description.hu_HU = Az eredeti Transport Tycoon Deluxe Windows verziójának hangjai.
description.id_ID = Efek suara orisinil Transport Tycoon Deluxe versi Windows.
description.is_IS = Upprunalega hljóðið úr Transport Tycoon Deluxe Windows útgáfunni.
description.it_IT = Suoni originali di Transport Tycoon Deluxe, edizione Windows.
description.ja_JP = Transport Tycoon Deluxe オリジナル版 効果音 (Windows)
description.ko_KR = 오리지널 트랜스포트 타이쿤 디럭스 윈도우 에디션의 효과음입니다.
description.lb_LU = Original Transport Tycoon Deluxe Windows Editioun Sound.
description.lt_LT = Originalūs Transport Tycoon Deluxe Windows leidimo garsai.
description.nb_NO = Originale lyder fra Transport Tycoon Deluxe for Windows.
description.nl_NL = Originele geluiden van de Transport Tycoon Deluxe Windows-versie.
description.nn_NO = Originale lydar frå Transport Tycoon Deluxe for Windows.
description.pl_PL = Oryginalna edycja dźwięków dla Transport Tycoon Deluxe Windows.
description.pt_BR = Sons Originais do Transport Tycoon Deluxe, Edição Windows.
description.pt_PT = Sons originais da edição Windows de Transport Tycoon Deluxe.
description.ro_RO = Setul de sunete original al Transport Tycoon Deluxe pentru Windows.
description.ru_RU = Оригинальный набор звукового оформления из игры Transport Tycoon Deluxe для Windows.
@@ -47,12 +42,8 @@ description.sk_SK = Pôvodné zvuky Transport Tycoon Deluxe (Windows).
description.sl_SI = Originalni zvoki Transport Tycoon Deluxe različice oken(windows).
description.sr_RS = Originalni skup zvukova Transport Tycoon Deluxe Windows izdanja.
description.sv_SE = Originalljuden från Transport Tycoon Deluxe, Windows-utgåvan.
description.ta_IN = அசல் டிரான்ஸ்ஃபோர்ட் டைகூன் டீலக்ஸ் விண்டோஸ் பதிப்பு ஒலிகள்.
description.th_TH = เสียงต้นตำหรับของ Transport Tycoon Deluxe Windows edition
description.tr_TR = Orijinal Transport Tycoon Deluxe Windows sürümü sesleri.
description.uk_UA = Оригінальний набір звуків з Transport Tycoon Deluxe Windows edition.
description.vi_VN = Âm thanh gốc từ phiên bản Transport Tycoon Deluxe trên Windows
description.zh_CN = Transport Tycoon Deluxe Windows (运输大亨Windows豪华版)的原版音效包.
description.zh_TW = 原版 Transport Tycoon Deluxe Windows 版的音效。
[files]

View File

@@ -1,150 +1,3 @@
1.3.3 (2013-11-29)
------------------------------------------------------------------------
- Fix: Aircraft crashing near the map's border due to a lack of airports could trigger a crash [CVE-2013-6411] [FS#5820] (r26134)
1.3.3-RC2 (2013-11-24)
------------------------------------------------------------------------
- Fix: [Script] Prevent scripts from crashing OpenTTD when they send text with command codes to user editable texts such as sign and station names [FS#5818] (r26093, r26092)
- Fix: Occasional hanging when client joins [FS#5811] (r26043)
- Fix: Multi line text was handled incorrectly causing glitches [FS#5809] (r26037, r26036)
1.3.3-RC1 (2013-11-17)
------------------------------------------------------------------------
- Fix: Crash when the ICU layouter thinks a font is corrupted [FS#5711] (r26029, r26018, r26017, r26016, r26015)
- Fix: Make the installer warning about Windows XP SP3 not trigger on the 64 bit Windows XP which is not really Windows XP to start with [FS#5773] (r26028)
- Fix: Only forward key presses to the IME system if an edit box has the input focus (r26023, r25693, r25691, r25689, r25686, r25684, r25682, r25681, r25667)
- Fix: Having trains miss a platform that is just being modified is less of a problem than having trains stop twice without moving [FS#5684] (r26013)
- Fix: --help text of ./configure for packages that require pkg-config (r26011)
- Fix: The AI/GS library name to use in Import, is not the name given by GetName but GetInstanceName [FS#5662] (r26010)
- Fix: [Windows] Conditional expression with enumeral with non-enumeral type (r26009)
- Fix: Game script showing vehicle on e.g. a goal, then the vehicle being removed and eventually being replaced by a non-user vehicle (most likely smoke) causing an assertion to trigger [FS#5804] (r26007, r26006)
- Fix: Crash when transferring savegame from server to client [FS#5478] (r26005)
- Fix: [OSX] Text input into an edit box would trigger hotkeys [FS#5705] (r26003, r25743, r25671)
- Fix: Comma key collided with F12 key for hotkeys; also remove '+' as that is generally not a key (the '+' on the numpad is a separate one) [FS#5679] (r25973)
- Fix: Rail laying sounds of others could be heard in multiplayer [FS#5665] (r25972)
- Fix: [SDL] Recursive mutex locking when changing blitter [FS#5787] (r25970)
- Fix: The wrong vehicle would be taken in a shared order vehicle list window when the ID >= 65536, causing assertions triggering later on [FS#5800] (r25965)
- Fix: [OSX] Compilation under OSX 10.9 [FS#5797] (r25962, r25951, r25950, r25913)
- Fix: [NewGRF] A powered rail type implies it is compatible as well, but some NewGRF did not state that causing the path reservation code to bail out in some cases because there was no compatible path [FS#5779] (r25961)
- Fix: Temporary persistent storage modifications, e.g. command tests or those from GUI, were not properly reset, creating the possibility of desyncs [FS#5772] (r25956)
- Fix: Train's 'force proceed' status gets reset when the track on the other side of the tile has a signal [FS#5723] (r25955)
- Fix: Wrong signal conversions for savegames from before 0.4.5 [FS#5731, FS#5732] (r25954, r25953)
- Fix: Do not skip numbers when skipping spaces and other sorting 'improving' characters [FS#5719] (r25952)
- Fix: Text direction forcing characters were not filtered out, but shown as ? when ICU was not used for layouting. These are included in chat and console messages to force them to be displayed right [FS#5683] (r25949)
- Fix: NewGRF inspect window in RTL mode (r25943)
- Fix: [NoGo] Preserve the relative town growth progress when changing the town growth rate [FS#5786] (r25931)
- Fix: Several drawing overflows in the signal GUI [FS#5733] (r25929, r25928, r25927)
- Fix: Center the edit sign window like all query windows (r25918)
- Fix: Initialization of default objects swapped cost and dates (r25868)
- Fix: Use the actual sprite dimensions for sizing the dropdown arrow of dropdown widgets (r25864)
- Fix: If the child widgets of a NWidgetHorizontal container do not fill the complete container, align them according to text direction [FS#5686] (r25862, r25729)
- Fix: When clearing font cache, also clear layout cache [FS#5737] (r25860)
- Fix: Goto button in order window was not always lowered when it should [FS#5783] (r25858, 25857)
- Fix: Searching for a suitable font failed, if one of the fonts had no '?' glyph, and no baseset is installed [FS#5704] (r25822, r25820)
- Fix: Sprite 0 was considered available, even if no baseset was loaded (r25821)
- Fix: [GS] Language file scanner considered filenames starting with '.' as valid translations, resulting in languages with empty name, which causes trouble [FS#5750] (r25818)
- Fix: [GS] Handle savegames which contain GS translations for languages with empty name more gently [FS#5750] (r25817)
- Fix: [Script] ScriptTile::IsBuildableRectangle could report true for tiles outside of the map, if they happened to wrap around into a valid area [FS#5754] (r25815)
- Fix: [Script] Decoding JSON data with an empty array from Admin port failed (r25809)
- Fix: Ensure the vehicle bar is high enough for the start/stop vehicle graphics [FS#5740] (r25805)
- Fix: Lower sprite and text at the vehicle bar if it is pressed [FS#5739] (r25804)
- Fix: Draw start/stop graphics of the vehicle bar at the right place in RTL mode [FS#5738] (r25803)
- Fix: [NewGRF] Do not allow changing palette when it is set by the NewGRF (r25794, r25793, r25972)
- Fix: Some spelling corrections to Catalan and Latin American town names [FS#5746] (r25775, r25774)
- Fix: If old savegames contain bridges over owned land, keep on drawing the bridges nevertheless [FS#5725] (r25753)
- Fix: Several RTL alignment issues [FS#5692] (r25733, r25732, r25731)
- Fix: NWidgetMatrix used pip_pre and pip_post inconsistently and incorrectly, causing misalignment for RTL [FS#5686] (r25727)
- Fix: Right side of object class string was misaligned (r25726)
- Fix: [OSX] Do not pass -mmacosx-version-min to compilers that do not support it (r25706)
- Fix: Autoreplace/renew also refits free wagons [FS#5700] (r25698)
- Fix: Textbuf caret rendering for complex scripts (e.g. Tamil) (r25696, r25694, r25652, r25651, r25092, r25091)
- Fix: Vehicle::MarkDirty must be called for the front engine [FS#5700] (r25695)
- Fix: [Win32] Several issues regarding conversion of characters (r25677, r25676, r25675, r25674, r25673)
- Fix: [Win32] Handle Unicode characters from outside the BMP correctly (r25672, r25670, r25669, r25668)
- Fix: [OSX] Crash when unhiding the main window [FS#4689] (r25665)
- Fix: [OSX] Bootstrap downloading of a baseset did not work [FS#4847] (r25664)
- Fix: [OSX] Monospace font detection [FS#4857] (r25663, r25662)
- Fix: [OSX] Rework font detection to work even if no default font sprites are present [FS#4847] (r25661)
- Fix: [OSX] The name is OpenTTD, not OTTD (r25660)
- Fix: [OSX] System mouse cursor could become visible during dragging [FS#4420] (r25659)
- Fix: [OSX] The mouse cursor would sometimes jump near the window borders [FS#4392] (r25658)
- Fix: [OSX] The new 10.7 fullscreen code can now also be compiled with older SDK versions [FS#4744] (r25656)
- Fix: [OSX] Mouse cursor was not displayed properly after switching to fullscreen on 10.7+ (r25655)
- Fix: Improve character and word deletion for CJK languages and complex scripts (r25654, r25653)
- Fix: [OSX] Define version constants before they are used (r25643)
- Fix: Some icu_config scripts are too stupid to separate two ldflags by spaces, thus only call it with one (r25642, r25638)
- Fix: Do not suggest a start date for the game when there will be no vehicles available at all (r25640, r25639)
- Fix: City list sort of population and rating are reversed compared to the icon [FS#5666] (r25630)
- Fix: [Script] Give a slightly less generic error when removing inexisting rail [FS#5651] (r25614)
- Fix: [Script] Do not return ERR_UNKNOWN when trying to move an order to its current location [FS#5648] (r25612)
- Fix: Various misreferences in AI and GS changelog [FS#5649] (r25607)
- Fix: [Script] If a NewGRF returned station type that could not be built by an AI via callback 18, an unknown error would be thrown instead of falling back to the default station [FS#5641] (r25605)
- Fix: Only the front engine's date of last service was updated [FS#5550] (r25604)
1.3.2 (2013-07-27)
------------------------------------------------------------------------
(None)
1.3.2-RC2 (2013-07-13)
------------------------------------------------------------------------
- Fix: [Admin] End-of-rcon data could not be determined reliably for any rcon command [FS#5643] (r25598, r25588, r25587)
- Fix: [Content] When the server closed the connection, the client would for eternity try to read a packet and never timeout making it impossible to reconnect [FS#5635] (r25597)
- Fix: [Script] Changing the script difficulty level in-game would also change the settings using the default even though they were not allowed to change in-game [FS#5644] (r25592)
- Fix: [Admin] Ensure that sent and received length of json strings are the same [FS#5646] (r25590, r25589)
- Fix: [Squirrel] Stack overflow did not show an error, due to the stack to throw the error already being full [FS#5320] (r25585)
- Fix: [Script] Documentation implied that XXList::AddItem has a default for value if it isn't filled in [FS#5638] (r25579, r25577)
- Fix: Layouter caused significant slowdown with text heavy windows, cache it to make it manageable (r25574, r25570, r25569, r25567, r25564)
- Fix: Make content list appear faster (r25573)
- Fix: Non-ICU layouter started new lines with the space which triggered the linebreak (r25568)
- Fix: If the next order cannot be resolved, reset the current order property instead of leaving it in an intermediate state [FS#5633] (r25562)
- Fix: [Squirrel] Infinite recursion loop in freeing data via a looping set of references [FS#5568] (r25558)
- Fix: One could build bridges over owned land of another company [FS#5524] (r25557)
- Fix: [Script] Texts from scripts were not validated before they were shown, causing an assertion to trigger [FS#5632] (r25555)
- Fix: Provide a warning when no vehicles are available, and tell what to do in that case [FS#5530] (r25553)
- Fix: Possible reading of uninitialised memory due to undefined execution order (r25551)
- Fix: [Windows] Race condition between two drawing threads could crash OpenTTD [FS#5571] (r25550)
- Fix: ICU returns the width of the visual run as if the trailing space was added (in case a newline was added). This caused the width to be more than the requested width, but it would still be drawn correctly [FS#5626] (r25547)
- Fix: Small memory leaks (r25546)
- Fix: [GS] The checks and validations for setting the extra text in the town window became too stringent [FS#5625] (r25544)
1.3.2-RC1 (2013-06-30)
------------------------------------------------------------------------
- Remove: SETX(Y) does not work at all with other than default fonts, so get rid of it (r25454)
- Fix: strndup should not examine strings beyond its upper limit [FS#5621] (r25527)
- Fix: Proper support for Brahmic scripts (e.g. Tamil and Thai) [FS#5481] (r25526, r25525, r25524, r25514, r25513, r25512, r25511, r25501, r25493, r25485, r25483, r25482, r25481, r25478, r25477, r25476, r25474, r25473, r25472, r25471, r25470, r25469, r25468, r25467, r25466, r25465, r25463, r25462, r25455, r25452, r25451, r25450, r25447, r25446, r25445, r25444, r25443, r25442, r25441, r25440, r25439, r25438, r25437, r25436, r25343, r25157)
- Fix: SDL does not give an event when an application gets mouse focus while going to full screen, so manually force the mouse-is-in-window state [FS#5587] (r25523)
- Fix: [NewGRF] When cargo NewGRF define a multiplier to modify vehicle capacities, use the same multiplier to modify loading speed (r25497, r25479)
- Fix: When addings bits to a (train) station, the train trying to stop there could overshoot the (new) stop location and not stop at all [FS#5553] (r25495)
- Fix: The face of the manager differed on clients when the company was started after the clients joined [FS#5610] (r25491, r25490)
- Fix: Do not send encoded texts to names, but decode them into a plain C string and then pass them on [FS#5613] (r25489, r25488)
- Fix: Do not allow control codes in names of things (signs, vehicles, towns, stations, etc), so they have a known maximum fixed size and are, by definition, the same for everyone (r25487)
- Fix: Missing length validation for town and president names in script APIs (r25486)
- Fix: [OSX] OS X SDK versions >= 10.5 always have a non-const iconv declaration (r25480)
- Fix: Disable the depot-refit button in the order GUI, if the consist is not refittable unless it already has a refit order (r25459, r25458, r25457)
- Fix: When town creation failed, removing remnants of the construction failed on protected houses [FS#5603] (r25429)
- Fix: There were two hotkeys to toggle between 'unload' and 'unload if possible' (r25406)
- Fix: The size of station construction windows could oscillate when resizing the window moved the mouse into the window [FS#5596] (r25395)
- Fix: Restrict renaming engines to the server, just like renaming towns (r25394)
- Fix: Loading only 8 bits into a 16 bit variable could cause endianness problems (r25337)
- Fix: Check for zero width space in translations and fail upon finding them [FS#5589] (r25326)
- Fix: [SDL] Keyboard input stopped working after fullscreen toggle [FS#5580] (r25318)
- Fix: Proper size-estimation for numbers with n digits, i.e. not assume a particular number is the widest [FS#5562] (r25314, r25313)
- Fix: Do not focus the editbox in the NewGRF window, if there is no editbox visible (r25307)
- Fix: Game Script APIs that execute a DoCommand were returning the same result as in TestMode during world generation [FS#5561] (r25305)
- Fix: Build railway fences next to objects, even if they are owned by the same company [FS#5565] (r25302)
- Fix: gcc4.6 removed -mno-cygwin option (r25266)
1.3.1 (2013-06-01)
------------------------------------------------------------------------
- Fix: When overbuilding a reserved track with a non-track station tile, that tile would remain reserved and eventually trigger a crash upon removal [FS#5540] (r25251)
1.3.1-RC1 (2013-05-17)
------------------------------------------------------------------------
- Feature: Translations of baseset descriptions via language files (r25209, r25205)

View File

@@ -57,8 +57,8 @@ set_default() {
enable_translator="0"
enable_unicode="1"
enable_console="1";
enable_assert="0"
enable_strip="1"
enable_assert="1"
enable_strip="0"
enable_universal="0"
enable_osx_g5="0"
enable_cocoa_quartz="1"
@@ -1487,18 +1487,15 @@ make_cflags_and_ldflags() {
LDFLAGS="$LDFLAGS -mwin32"
fi
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
if [ $cc_version -lt 46 ]; then
flags="$flags -mno-cygwin"
LDFLAGS="$LDFLAGS -mno-cygwin"
fi
flags="$flags -mno-cygwin"
if [ "$enable_console" != "0" ]; then
LDFLAGS="$LDFLAGS -Wl,--subsystem,console"
LDFLAGS="$LDFLAGS -mno-cygwin -Wl,--subsystem,console"
else
LDFLAGS="$LDFLAGS -Wl,--subsystem,windows"
LDFLAGS="$LDFLAGS -mno-cygwin -Wl,--subsystem,windows"
fi
LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32 -limm32"
LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
if [ $cc_version -ge 44 ]; then
LDFLAGS_BUILD="$LDFLAGS_BUILD -static-libgcc -static-libstdc++"
@@ -1558,7 +1555,7 @@ make_cflags_and_ldflags() {
LDFLAGS="$OSX_LD_SYSROOT $LDFLAGS"
fi
if [ "$enable_universal" = "0" ] && [ $cc_version -gt 40 ]; then
if [ "$enable_universal" = "0" ] && [ $cc_version -ge 40 ]; then
# Only set the min version when not doing an universal build.
# Universal builds set the version elsewhere.
if [ "$cpu_type" = "64" ]; then
@@ -1718,9 +1715,9 @@ make_cflags_and_ldflags() {
# Some icu-configs have the 'feature' of not adding a space where others do add the space
if [ "$static_icu" != "0" ]; then
LIBS="$LIBS `$icu_config --ldflags-searchpath` `($icu_config --ldflags-libsonly; $icu_config --ldflags-layout) | tr '\n\r' ' ' | sed s/licu/lsicu/g`"
LIBS="$LIBS `$icu_config --ldflags-searchpath` `$icu_config --ldflags-libsonly | tr '\n\r' ' ' | sed s/licu/lsicu/g`"
else
LIBS="$LIBS `$icu_config --ldflags-searchpath` `($icu_config --ldflags-libsonly; $icu_config --ldflags-layout) | tr '\n\r' ' '`"
LIBS="$LIBS `$icu_config --ldflags-searchpath` `$icu_config --ldflags-libsonly | tr '\n\r' ' '`"
fi
fi
@@ -1754,7 +1751,7 @@ make_cflags_and_ldflags() {
fi
fi
if [ "$os" != "OSX" ] && [ "$have_non_const_iconv" != "no" ]; then
if [ "$have_non_const_iconv" != "no" ]; then
CFLAGS="$CFLAGS -DHAVE_NON_CONST_ICONV"
fi
fi
@@ -3488,7 +3485,7 @@ generate_src_osx() {
CFLAGS="-isysroot $osx_sdk_path $CFLAGS_orig"
LDFLAGS="-Wl,-syslibroot,$osx_sdk_path $LDFLAGS_orig"
fi
CFLAGS="$CFLAGS -D_SQ64 -DNO_QUICKTIME -UENABLE_COCOA_QUICKDRAW"
CFLAGS="$CFLAGS -D_SQ64 -DHAVE_NON_CONST_ICONV -DNO_QUICKTIME -UENABLE_COCOA_QUICKDRAW"
LIBS="`echo $LIBS | sed 's/-framework QuickTime//'`"
fi
@@ -3631,13 +3628,12 @@ showhelp() {
echo " --with-cocoa enables COCOA video driver (OSX ONLY)"
echo " --with-sdl[=sdl-config] enables SDL video driver support"
echo " --with-zlib[=zlib.a] enables zlib support"
echo " --with-liblzma[=\"pkg-config liblzma\"]"
echo " enables liblzma support"
echo " --with-liblzma[=liblzma.a] enables liblzma support"
echo " --with-liblzo2[=liblzo2.a] enables liblzo2 support"
echo " --with-png[=libpng-config] enables libpng support"
echo " --with-freetype[=freetype-config]"
echo " enables libfreetype support"
echo " --with-fontconfig[=\"pkg-config fontconfig\"]"
echo " --with-fontconfig[=pkg-config fontconfig]"
echo " enables fontconfig support"
echo " --with-icu[=icu-config] enables icu (used for right-to-left support)"
echo " --static-icu try to link statically (libsicu instead of"

View File

@@ -150,8 +150,7 @@ Table of contents
Note: No additional authentication is required for rcon commands.
The server will reply with one or more ADMIN_PACKET_SERVER_RCON packets.
Finally an ADMIN_PACKET_ADMIN_RCON_END packet will be sent. Applications
The server will reply with a ADMIN_PACKET_SERVER_RCON packet. Applications
will not receive the answer twice if they have asked for the AdminUpdateType
ADMIN_UPDATE_CONSOLE, as the result is not printed on the servers console
(just like clients rcon commands).
@@ -161,13 +160,6 @@ Table of contents
Chat from the server itself will only be sent to the admin network when it
was not sent from the admin network.
Note that when content is queried or updated via rcon, the processing
happens asynchronously. But the ADMIN_PACKET_ADMIN_RCON_END packet is sent
already right after the content is requested as there's no immediate output.
Thus other packages and the output of content rcon command may be sent at
an arbitrary later time, mixing into the output of other console activity,
e.g. also of possible subsequent other rcon commands sent.
5.0) Sending chat
---- ------------

View File

@@ -1,6 +1,6 @@
OpenTTD's known bugs
Last updated: 2013-11-29
Release version: 1.3.3
Last updated: 2013-04-01
Release version: 1.3.0
------------------------------------------------------------------------
@@ -403,44 +403,3 @@ Mouse cursor going missing with SDL [FS#4997]:
We cannot fix this problem as SDL simply does not provide the
required information in these corner cases. This is a bug in SDL
and as such there is little that we can do about it.
Inconsistent catchment areas [FS#5661]:
Due to performance decisions the catchment area for cargo accepted
by a station for delivery to houses or industries differs from the
catchment area for cargo that is delivered to stations from houses
or industries.
Conceptually they work the same, but the effect in game differs.
They work by finding the closest destination "around" the source
which is within a certain distance. This distance depends on the
type of station, e.g. road stops have a smaller catchment area than
large airports. In both cases the bounding box, the smallest
rectangle that contains all tiles of something, is searched for the
target of the cargo, and then spiraling outwards finding the closest
tile of the target.
In the case of a station with two tiles spread far apart with a house
that is within the station's bounding box, it would be possible that
the spiraling search from the house does not reach one of the station
tiles before the search ends, i.e. all tiles within that distance
are searched. So the house does not deliver cargo to the station. On
the other hand, the station will deliver cargo because the house
falls within the bounding box, and thus search area.
It is possible to make these consistent, but then cargo from a house
to a station needs to search up to 32 tiles around itself, i.e. 64
by 64 tiles, to find all possible stations it could deliver to
instead of 10 by 10 tiles (40 times more tiles). Alternatively the
search from a station could be changed to use the actual tiles, but
that would require considering checking 10 by 10 tiles for each of
the tiles of a station, instead of just once.
Trains might not stop at platforms that are currently being changed [FS#5553]:
If you add tiles to or remove tiles from a platform while a train is
approaching to stop at the same platform, that train can miss the place
where it's supposed to stop and pass the station without stopping. This
is caused by the fact that the train is considered to already have stopped
if it's beyond its assigned stopping location. We can't let the train stop
just anywhere in the station because then it would never leave the station
if you have the same station in the order list multiple times in a row or
if there is only one station in the order list (see FS#5684).

View File

@@ -9,4 +9,3 @@ Exec=!!TTD!!
Terminal=false
Categories=!!MENU_GROUP!!
Comment=A clone of Transport Tycoon Deluxe
Keywords=game;simulation;transport;tycoon;deluxe;economics;multiplayer;money;train;ship;bus;truck;aircraft;cargo

View File

@@ -1,45 +1,3 @@
openttd (1.3.3-0) unstable; urgency=low
* New upstream release 1.3.3
-- OpenTTD <info@openttd.org> Fri, 29 Nov 2013 19:00:00 +0100
openttd (1.3.3~RC2-0) unstable; urgency=low
* New upstream release 1.3.3-RC2
-- OpenTTD <info@openttd.org> Sun, 24 Nov 2013 19:00:00 +0100
openttd (1.3.3~RC1-0) unstable; urgency=low
* New upstream release 1.3.3-RC1
-- OpenTTD <info@openttd.org> Sun, 17 Nov 2013 19:00:00 +0100
openttd (1.3.2-0) unstable; urgency=low
* New upstream release 1.3.2
-- OpenTTD <info@openttd.org> Sat, 27 Jul 2013 18:00:00 +0200
openttd (1.3.2~RC2-0) unstable; urgency=low
* New upstream release 1.3.2-RC2
-- OpenTTD <info@openttd.org> Sat, 13 Jul 2013 12:00:00 +0200
openttd (1.3.2~RC1-0) unstable; urgency=low
* New upstream release 1.3.2-RC1
-- OpenTTD <info@openttd.org> Sun, 30 Jun 2013 12:00:00 +0200
openttd (1.3.1-0) unstable; urgency=low
* New upstream release 1.3.1
-- OpenTTD <info@openttd.org> Sat, 01 Jun 2013 00:00:00 +0300
openttd (1.3.1~RC1-0) unstable; urgency=low
* New upstream release 1.3.1-RC1

View File

@@ -3,10 +3,11 @@ Section: games
Priority: optional
Maintainer: Matthijs Kooijman <matthijs@stdin.nl>
Uploaders: Jordi Mallach <jordi@debian.org>
DM-Upload-Allowed: yes
Build-Depends: debhelper (>= 7.0.50), libsdl-dev, zlib1g-dev, libpng-dev, libfreetype6-dev, libfontconfig-dev, libicu-dev, liblzma-dev, liblzo2-dev
Standards-Version: 3.8.4
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/openttd.git
Vcs-Git: git://anonscm.debian.org/collab-maint/openttd.git
Vcs-Browser: http://git.debian.org/?p=collab-maint/openttd.git
Vcs-Git: git://git.debian.org/collab-maint/openttd.git
Homepage: http://www.openttd.org/
Package: openttd

View File

@@ -1,106 +1,77 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: OpenTTD
Upstream-Contact: info@openttd.org, #openttd on irc.oftc.net
Source: http://www.openttd.org
This package was debianized by Matthijs Kooijman <matthijs@stdin.nl>
on Wed, 15 Sep 2004 00:24:01 +0200.
Upstream author: Ludvig Strigeus (ludde) and many others.
Upstream homepage: http://www.openttd.org
Files: *
Copyright: © 2004-2012 Ludvig Strigeous and others.
License: GPL-2.0
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2.0 as
published by the Free Software Foundation;
.
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 package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
.
On Debian systems, the complete text of the GNU General Public License
version 2 can be found in `/usr/share/common-licenses/GPL-2'.
Copyright © 2004-2009 Ludvig Strigeous and others.
Files: src/3rdparty/squirrel/*
Copyright: © 2003-2009 Alberto Demichelis
License: Zlib
OpenTTD License:
Files: src/3rdparty/md5/*
Copyright: © 1999, 2000, 2002 Aladdin Enterprises. All rights reserved.
License: Zlib
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2.0 as
published by the Free Software Foundation;
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.
License: Zlib
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
.
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software in
a product, an acknowledgment in the product documentation would be
appreciated but is not required.
.
2. Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
.
3. This notice may not be removed or altered from any source
distribution.
You should have received a copy of the GNU General Public License
along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Files: os/dos/exe2coff/*
Copyright: © 1998 DJ Delorie
License: GPL-2.0 with additional restrictions
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.
.
On Debian systems, the complete text of the GNU General Public License
version 2 can be found in `/usr/share/common-licenses/GPL-2'.
Comment:
Given only the exe2coff.c file is distributed in the source distribution (and
nothing in Debian binary distribution), it seems only the 2nd condition
applies.
On Debian systems, the complete text of the GNU General Public License
version 2 can be found in `/usr/share/common-licenses/GPL-2'.
Files: os/dos/cwsdpmi/*
Source: http://homer.rice.edu/~sandmann/cwsdpmi/index.html
Copyright: © 1995-2000 Charles W Sandmann (sandmann@clio.rice.edu)
License: Custom binary-only license
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.
Comment:
Files are distributed as binary only, so the second option in the license
("without source code provided: ...") is applicable.
This package contains an embedded version of the "Squirrel" programming
language, which is shipped under the following license:
Copyright (c) 2003-2009 Alberto Demichelis
This software is provided 'as-is', without any
express or implied warranty. In no event will the
authors be held liable for any damages arising from
the use of this software.
Permission is granted to anyone to use this software
for any purpose, including commercial applications,
and to alter it and redistribute it freely, subject
to the following restrictions:
1. The origin of this software must not be
misrepresented; you must not claim that
you wrote the original software. If you
use this software in a product, an
acknowledgment in the product
documentation would be appreciated but is
not required.
2. Altered source versions must be plainly
marked as such, and must not be
misrepresented as being the original
software.
3. This notice may not be removed or
altered from any source distribution.
This package contains an implementation of the md5 hash algorithm, which
is shipped under the following license:
Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

View File

@@ -1,2 +1,2 @@
?package(openttd):needs="X11" section="Games/Simulation" title="OpenTTD"\
command="/usr/games/openttd" icon="/usr/share/pixmaps/openttd.32.xpm"
command="/usr/share/games/openttd/openttd-wrapper" icon="/usr/share/pixmaps/openttd.32.xpm"

View File

@@ -4,7 +4,7 @@
# Use debhelper default for all targets (but some are overridden below).
%:
dh --parallel $@
dh $@
DEB_HOST_GNU_TYPE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
@@ -12,29 +12,21 @@ ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif
# This prevents linking uselessly to libicudata and silences a warning
# in the build process.
DEB_LDFLAGS_MAINT_APPEND="-Wl,-as-needed"
# Enable all hardening options (since openttd offers a network-listening
# service that handles untrusted data).
DEB_BUILD_MAINT_OPTIONS=hardening=+all
# Load buildflags (this uses dpkg-buildflags). Note that we don't export
# them, but instead pass them to ./configure explicitly.
include /usr/share/dpkg/buildflags.mk
# Pass custom options to configure. Since it's not autoconf but a custom
# script, some of the option names are slightly different. We also need
# to be explicit about the dependencies, in case we're not running in a
# clean build root.
override_dh_auto_configure:
./configure $(CROSS) --prefix-dir=/usr --install-dir=debian/openttd --without-allegro --with-zlib --with-sdl --with-png --with-freetype --with-fontconfig --with-icu --with-liblzo2 --with-lzma --without-iconv --disable-strip CFLAGS="$(CFLAGS) $(CPPFLAGS)" CXXFLAGS="$(CXXFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" CFLAGS_BUILD="$(CFLAGS) $(CPPFLAGS)" CXXFLAGS_BUILD="$(CXXFLAGS) $(CPPFLAGS)" LDFLAGS_BUILD="$(LDFLAGS)"
./configure $(CROSS) --prefix-dir=/usr --install-dir=debian/openttd --without-allegro --with-zlib --with-sdl --with-png --with-freetype --with-fontconfig --with-icu --with-liblzo2 --with-lzma --without-iconv --disable-strip CFLAGS="$(CFLAGS) -g" LDFLAGS="$(LDFLAGS) -Wl,-as-needed"
# Do some extra installation
override_dh_auto_install:
$(MAKE) install DO_NOT_INSTALL_CHANGELOG=1 DO_NOT_INSTALL_LICENSE=1
# Install the wrapper and make it executable
install -d debian/openttd/usr/share/games/openttd/
install -m755 debian/openttd-wrapper debian/openttd/usr/share/games/openttd/
# Don't do testing. Because the OpenTTD Makefile always does dependency
# generation (even on invalid targets), dh_auto_test thinks there is a
# "test" target, while there isn't.

View File

@@ -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.

View File

@@ -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.

View File

@@ -3,9 +3,9 @@
# $Id$
cd `dirname $0`
cc -o exe2coff/exe2coff exe2coff/exe2coff.c || exit
cc -o exe2coff exe2coff.c || exit
cp $1 binary.exe || exit
./exe2coff/exe2coff binary.exe || exit
cat cwsdpmi/cwsdstub.exe binary > binary.exe || exit
./exe2coff binary.exe || exit
cat cwsdstub.exe binary > binary.exe || exit
mv binary.exe $1
rm binary exe2coff/exe2coff
rm binary exe2coff

View File

@@ -1,6 +1,6 @@
@echo off
set OPENTTD_VERSION=1.3.3
set OPENTTD_VERSION=1.3.1-RC1
set OPENSFX_VERSION=0.8.0
set NOSOUND_VERSION=0.8.0
set OPENGFX_VERSION=1.2.0

View File

@@ -1,9 +1,9 @@
# Version numbers to update
!define APPV_MAJOR 1
!define APPV_MINOR 3
!define APPV_MAINT 3
!define APPV_BUILD 2
!define APPV_EXTRA ""
!define APPV_MAINT 1
!define APPV_BUILD 0
!define APPV_EXTRA "-RC1"
!define APPNAME "OpenTTD" ; Define application name
!define APPVERSION "${APPV_MAJOR}.${APPV_MINOR}.${APPV_MAINT}${APPV_EXTRA}" ; Define application version
@@ -545,22 +545,15 @@ FunctionEnd
;-------------------------------------------------------------------------------
; Determine windows version, returns "win9x" if Win9x/Me/2000/XP SP2- or "winnt" for the rest on the stack
Function GetWindowsVersion
GetVersion::WindowsPlatformArchitecture
Pop $R0
IntCmp $R0 64 WinNT 0
ClearErrors
StrCpy $R0 "win9x"
${If} ${IsNT}
${If} ${IsWinXP}
${AndIf} ${AtLeastServicePack} 3
${OrIf} ${AtLeastWin2003}
GoTo WinNT
StrCpy $R0 "winnt"
${EndIf}
${EndIf}
GoTo Done
WinNT:
StrCpy $R0 "winnt"
Done:
Push $R0
FunctionEnd

View File

@@ -137,12 +137,6 @@
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\src\lang\english.txt;..\objs\strgen\strgen.exe;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\lang\estonian.lng;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\src\lang\faroese.txt">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating faroese language file</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "%(FullPath)"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\src\lang\english.txt;..\objs\strgen\strgen.exe;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\lang\faroese.lng;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\src\lang\finnish.txt">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating finnish language file</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "%(FullPath)"</Command>
@@ -155,12 +149,6 @@
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\src\lang\english.txt;..\objs\strgen\strgen.exe;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\lang\french.lng;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\src\lang\gaelic.txt">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating gaelic language file</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "%(FullPath)"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\src\lang\english.txt;..\objs\strgen\strgen.exe;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\lang\gaelic.lng;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\src\lang\galician.txt">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating galician language file</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "%(FullPath)"</Command>
@@ -323,18 +311,6 @@
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\src\lang\english.txt;..\objs\strgen\strgen.exe;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\lang\swedish.lng;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\src\lang\tamil.txt">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating tamil language file</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "%(FullPath)"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\src\lang\english.txt;..\objs\strgen\strgen.exe;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\lang\tamil.lng;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\src\lang\thai.txt">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating thai language file</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "%(FullPath)"</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\src\lang\english.txt;..\objs\strgen\strgen.exe;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\lang\thai.lng;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\src\lang\traditional_chinese.txt">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating traditional_chinese language file</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang "%(FullPath)"</Command>

View File

@@ -52,18 +52,12 @@
<CustomBuild Include="..\src\lang\estonian.txt">
<Filter>Translations</Filter>
</CustomBuild>
<CustomBuild Include="..\src\lang\faroese.txt">
<Filter>Translations</Filter>
</CustomBuild>
<CustomBuild Include="..\src\lang\finnish.txt">
<Filter>Translations</Filter>
</CustomBuild>
<CustomBuild Include="..\src\lang\french.txt">
<Filter>Translations</Filter>
</CustomBuild>
<CustomBuild Include="..\src\lang\gaelic.txt">
<Filter>Translations</Filter>
</CustomBuild>
<CustomBuild Include="..\src\lang\galician.txt">
<Filter>Translations</Filter>
</CustomBuild>
@@ -145,12 +139,6 @@
<CustomBuild Include="..\src\lang\swedish.txt">
<Filter>Translations</Filter>
</CustomBuild>
<CustomBuild Include="..\src\lang\tamil.txt">
<Filter>Translations</Filter>
</CustomBuild>
<CustomBuild Include="..\src\lang\thai.txt">
<Filter>Translations</Filter>
</CustomBuild>
<CustomBuild Include="..\src\lang\traditional_chinese.txt">
<Filter>Translations</Filter>
</CustomBuild>

View File

@@ -288,21 +288,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\faroese.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating faroese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;exit 0&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt;..\objs\strgen\strgen.exe"
Outputs="..\bin\lang\faroese.lng"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\finnish.txt"
>
@@ -333,21 +318,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\gaelic.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating gaelic language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;exit 0&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt;..\objs\strgen\strgen.exe"
Outputs="..\bin\lang\gaelic.lng"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\galician.txt"
>
@@ -753,36 +723,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\tamil.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating tamil language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;exit 0&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt;..\objs\strgen\strgen.exe"
Outputs="..\bin\lang\tamil.lng"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\thai.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating thai language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;exit 0&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt;..\objs\strgen\strgen.exe"
Outputs="..\bin\lang\thai.lng"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\traditional_chinese.txt"
>

View File

@@ -289,21 +289,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\faroese.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating faroese language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;exit 0&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt;..\objs\strgen\strgen.exe"
Outputs="..\bin\lang\faroese.lng"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\finnish.txt"
>
@@ -334,21 +319,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\gaelic.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating gaelic language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;exit 0&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt;..\objs\strgen\strgen.exe"
Outputs="..\bin\lang\gaelic.lng"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\galician.txt"
>
@@ -754,36 +724,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\tamil.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating tamil language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;exit 0&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt;..\objs\strgen\strgen.exe"
Outputs="..\bin\lang\tamil.lng"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\thai.txt"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating thai language file"
CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;exit 0&#x0D;&#x0A;"
AdditionalDependencies="..\src\lang\english.txt;..\objs\strgen\strgen.exe"
Outputs="..\bin\lang\thai.lng"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\lang\traditional_chinese.txt"
>

View File

@@ -102,7 +102,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@@ -131,7 +131,7 @@
<Culture>0x0809</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>winmm.lib;ws2_32.lib;imm32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -176,7 +176,7 @@
<Culture>0x0809</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>winmm.lib;ws2_32.lib;imm32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<IgnoreSpecificDefaultLibraries>LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -204,7 +204,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@@ -233,7 +233,7 @@
<Culture>0x0809</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>winmm.lib;ws2_32.lib;imm32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -280,7 +280,7 @@
<Culture>0x0809</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>winmm.lib;ws2_32.lib;imm32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<IgnoreSpecificDefaultLibraries>LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -317,13 +317,11 @@
<ClCompile Include="..\src\fileio.cpp" />
<ClCompile Include="..\src\fios.cpp" />
<ClCompile Include="..\src\fontcache.cpp" />
<ClCompile Include="..\src\fontdetection.cpp" />
<ClCompile Include="..\src\base_consist.cpp" />
<ClCompile Include="..\src\gamelog.cpp" />
<ClCompile Include="..\src\genworld.cpp" />
<ClCompile Include="..\src\gfx.cpp" />
<ClCompile Include="..\src\gfxinit.cpp" />
<ClCompile Include="..\src\gfx_layout.cpp" />
<ClCompile Include="..\src\goal.cpp" />
<ClCompile Include="..\src\ground_vehicle.cpp" />
<ClCompile Include="..\src\heightmap.cpp" />
@@ -442,13 +440,11 @@
<ClInclude Include="..\src\fileio_type.h" />
<ClInclude Include="..\src\fios.h" />
<ClInclude Include="..\src\fontcache.h" />
<ClInclude Include="..\src\fontdetection.h" />
<ClInclude Include="..\src\base_consist.h" />
<ClInclude Include="..\src\gamelog.h" />
<ClInclude Include="..\src\gamelog_internal.h" />
<ClInclude Include="..\src\genworld.h" />
<ClInclude Include="..\src\gfx_func.h" />
<ClInclude Include="..\src\gfx_layout.h" />
<ClInclude Include="..\src\gfx_type.h" />
<ClInclude Include="..\src\gfxinit.h" />
<ClInclude Include="..\src\goal_base.h" />
@@ -573,7 +569,6 @@
<ClInclude Include="..\src\statusbar_gui.h" />
<ClInclude Include="..\src\stdafx.h" />
<ClInclude Include="..\src\strgen\strgen.h" />
<ClInclude Include="..\src\string_base.h" />
<ClInclude Include="..\src\string_func.h" />
<ClInclude Include="..\src\string_type.h" />
<ClInclude Include="..\src\stringfilter_type.h" />

View File

@@ -180,9 +180,6 @@
<ClCompile Include="..\src\fontcache.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\fontdetection.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\base_consist.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -198,9 +195,6 @@
<ClCompile Include="..\src\gfxinit.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\gfx_layout.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\goal.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -555,9 +549,6 @@
<ClInclude Include="..\src\fontcache.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\fontdetection.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\base_consist.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -573,9 +564,6 @@
<ClInclude Include="..\src\gfx_func.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\gfx_layout.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\gfx_type.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -948,9 +936,6 @@
<ClInclude Include="..\src\strgen\strgen.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\string_base.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\string_func.h">
<Filter>Header Files</Filter>
</ClInclude>

View File

@@ -102,7 +102,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@@ -131,7 +131,7 @@
<Culture>0x0809</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>winmm.lib;ws2_32.lib;imm32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -176,7 +176,7 @@
<Culture>0x0809</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>winmm.lib;ws2_32.lib;imm32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<IgnoreSpecificDefaultLibraries>LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -204,7 +204,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@@ -233,7 +233,7 @@
<Culture>0x0809</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>winmm.lib;ws2_32.lib;imm32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -280,7 +280,7 @@
<Culture>0x0809</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>winmm.lib;ws2_32.lib;imm32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<IgnoreSpecificDefaultLibraries>LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>

View File

@@ -52,7 +52,7 @@
FavorSizeOrSpeed="2"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;WITH_ASSERT"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
@@ -87,7 +87,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib imm32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames=""
@@ -184,7 +184,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib imm32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
LinkIncremental="0"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames="LIBCMT.lib"
@@ -257,7 +257,7 @@
FavorSizeOrSpeed="2"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;_SQ64"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;_SQ64;WITH_ASSERT"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
@@ -292,7 +292,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib imm32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames=""
@@ -392,7 +392,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib imm32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
LinkIncremental="0"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames="LIBCMT.lib"
@@ -538,10 +538,6 @@
RelativePath=".\..\src\fontcache.cpp"
>
</File>
<File
RelativePath=".\..\src\fontdetection.cpp"
>
</File>
<File
RelativePath=".\..\src\base_consist.cpp"
>
@@ -562,10 +558,6 @@
RelativePath=".\..\src\gfxinit.cpp"
>
</File>
<File
RelativePath=".\..\src\gfx_layout.cpp"
>
</File>
<File
RelativePath=".\..\src\goal.cpp"
>
@@ -1042,10 +1034,6 @@
RelativePath=".\..\src\fontcache.h"
>
</File>
<File
RelativePath=".\..\src\fontdetection.h"
>
</File>
<File
RelativePath=".\..\src\base_consist.h"
>
@@ -1066,10 +1054,6 @@
RelativePath=".\..\src\gfx_func.h"
>
</File>
<File
RelativePath=".\..\src\gfx_layout.h"
>
</File>
<File
RelativePath=".\..\src\gfx_type.h"
>
@@ -1566,10 +1550,6 @@
RelativePath=".\..\src\strgen\strgen.h"
>
</File>
<File
RelativePath=".\..\src\string_base.h"
>
</File>
<File
RelativePath=".\..\src\string_func.h"
>

View File

@@ -52,7 +52,7 @@
FavorSizeOrSpeed="2"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;WITH_ASSERT"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
@@ -87,7 +87,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib imm32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames=""
@@ -184,7 +184,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib imm32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
LinkIncremental="0"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames="LIBCMT.lib"
@@ -257,7 +257,7 @@
FavorSizeOrSpeed="2"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;_SQ64"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;_SQ64;WITH_ASSERT"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
@@ -292,7 +292,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib imm32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames=""
@@ -392,7 +392,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib imm32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
LinkIncremental="0"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames="LIBCMT.lib"

View File

@@ -53,7 +53,7 @@
FavorSizeOrSpeed="2"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;WITH_ASSERT"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
@@ -88,7 +88,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib imm32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames=""
@@ -183,7 +183,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib imm32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
LinkIncremental="0"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames="LIBCMT.lib"
@@ -255,7 +255,7 @@
FavorSizeOrSpeed="2"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;_SQ64"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;_SQ64;WITH_ASSERT"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
@@ -290,7 +290,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib imm32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames=""
@@ -389,7 +389,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib imm32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
LinkIncremental="0"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames="LIBCMT.lib"
@@ -535,10 +535,6 @@
RelativePath=".\..\src\fontcache.cpp"
>
</File>
<File
RelativePath=".\..\src\fontdetection.cpp"
>
</File>
<File
RelativePath=".\..\src\base_consist.cpp"
>
@@ -559,10 +555,6 @@
RelativePath=".\..\src\gfxinit.cpp"
>
</File>
<File
RelativePath=".\..\src\gfx_layout.cpp"
>
</File>
<File
RelativePath=".\..\src\goal.cpp"
>
@@ -1039,10 +1031,6 @@
RelativePath=".\..\src\fontcache.h"
>
</File>
<File
RelativePath=".\..\src\fontdetection.h"
>
</File>
<File
RelativePath=".\..\src\base_consist.h"
>
@@ -1063,10 +1051,6 @@
RelativePath=".\..\src\gfx_func.h"
>
</File>
<File
RelativePath=".\..\src\gfx_layout.h"
>
</File>
<File
RelativePath=".\..\src\gfx_type.h"
>
@@ -1563,10 +1547,6 @@
RelativePath=".\..\src\strgen\strgen.h"
>
</File>
<File
RelativePath=".\..\src\string_base.h"
>
</File>
<File
RelativePath=".\..\src\string_func.h"
>

View File

@@ -53,7 +53,7 @@
FavorSizeOrSpeed="2"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;WITH_ASSERT"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
@@ -88,7 +88,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib imm32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames=""
@@ -183,7 +183,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib imm32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
LinkIncremental="0"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames="LIBCMT.lib"
@@ -255,7 +255,7 @@
FavorSizeOrSpeed="2"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;_SQ64"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\&quot;OpenTTD\&quot;;_SQ64;WITH_ASSERT"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
@@ -290,7 +290,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib imm32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames=""
@@ -389,7 +389,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib imm32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
LinkIncremental="0"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames="LIBCMT.lib"

View File

@@ -1,5 +1,6 @@
Last updated: 2013-11-29
Release version: 1.3.3
OpenTTD readme
Last updated: 2013-05-18
Release version: 1.3.1-RC1
------------------------------------------------------------------------
@@ -26,7 +27,6 @@ Table of contents
* 8.1) Translation
* 8.2) Previewing
9.0) Troubleshooting
10.0) Licensing
X.X) Credits
@@ -36,9 +36,9 @@ OpenTTD is a transport simulation game based upon the popular game Transport
Tycoon Deluxe, written by Chris Sawyer. It attempts to mimic the original
game as closely as possible while extending it with new features.
OpenTTD is licensed under the GNU General Public License version 2.0,
but includes some 3rd party software under different licenses. See the
section "Licensing" below for details.
OpenTTD is licensed under the GNU General Public License version 2.0. For
more information, see the file 'COPYING'.
2.0) Contacting
---- ----------
@@ -219,9 +219,9 @@ The Windows installer can optionally download and install these packages.
4.1.2) Original Transport Tycoon Deluxe graphics and sound files
------ ---------------------------------------------------------
If you want to play with the original Transport Tycoon Deluxe data files you
have to copy the data files from the CD-ROM into the baseset/ directory. It
does not matter whether you copy them from the DOS or Windows version of
Transport Tycoon Deluxe. The Windows install can optionally copy these files.
have to copy the data files from the CD-ROM into the data/ directory. It does
not matter whether you copy them from the DOS or Windows version of Transport
Tycoon Deluxe. The Windows install can optionally copy these files.
You need to copy the following files:
- sample.cat
- trg1r.grf or TRG1.GRF
@@ -410,6 +410,7 @@ Information logged:
original Transport Tycoon version
* Running a modified OpenTTD build
* Changing settings affecting NewGRF behaviour (non-network-safe settings)
* Changing landscape (by cheat)
* Triggering NewGRF bugs
No personal information is stored.
@@ -477,9 +478,9 @@ DOS:
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.
the os/dos 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
---- ---------------------------
@@ -506,10 +507,10 @@ no graphical user interface; you would be building a dedicated server.
The following compilers are known to compile OpenTTD:
- Microsoft Visual C++ (MSVC) 2005, 2008 and 2010.
Version 2005 gives bogus warnings about scoping issues.
- GNU Compiler Collection (GCC) 3.3 - 4.4, 4.6 - 4.8.
- GNU Compiler Collection (GCC) 3.3 - 4.7.
Versions 4.1 and earlier give bogus warnings about uninitialised variables.
Versions 4.4, 4.6 give bogus warnings about freeing non-heap objects.
Versions 4.6 and later give invalid warnings when lto is enabled.
Versions 4.4 - 4.6 give bogus warnings about freeing non-heap objects.
Versions 4.5 and later give invalid warnings when lto is enabled.
- Intel C++ Compiler (ICC) 12.0.
- Clang/LLVM 2.9 - 3.0
Version 2.9 gives bogus warnings about code nonconformity.
@@ -518,8 +519,6 @@ The following compilers are known not to compile OpenTTD:
- Microsoft Visual C++ (MSVC) 2003 and earlier.
- GNU Compiler Collection (GCC) 3.2 and earlier.
These old versions fail due to OpenTTD's template usage.
- GNU Compiler Collection (GCC) 4.5. It optimizes enums too aggressively.
See http://bugs.openttd.org/task/5513 and references therein.
- Intel C++ Compiler (ICC) 11.1 and earlier.
Version 10.0 and earlier fail a configure check and fail with recent system
headers.
@@ -583,9 +582,10 @@ Note: Do not alter the following parts of the file:
8.2) Previewing
---- ----------
In order to view the translation in the game, you need to compile your language
file with the strgen utility. As this utility is tailored to a specific OpenTTD
version, you need to compile it yourself. Just take the normal OpenTTD sources
and build that. During the build process the strgen utility will be made.
file with the strgen utility. You can download the precompiled strgen from:
http://www.openttd.org/download-strgen
To compile it yourself just take the normal OpenTTD sources and build that.
During the build process the strgen utility will be made.
strgen is a command-line utility. It takes the language filename as parameter.
Example:
@@ -643,29 +643,6 @@ development section (http://www.tt-forums.net/viewforum.php?f=66) or GrfCrawler
(see section 4.2 'OpenTTD directories') and rescan the list of available NewGRFs.
Once you have all missing files, you are set to go.
10.0) Licensing
----- ---------
OpenTTD is licensed under the GNU General Public License version 2.0. For
the complete license text, see the file 'COPYING'. This license applies
to all files in this distribution, except as noted below.
The squirrel implementation in src/3rdparty/squirrel is licensed under
the Zlib license. See src/3rdparty/squirrel/COPYRIGHT for the complete
license text.
The md5 implementation in src/3rdparty/md5 is licensed under the Zlib
license. See the comments in the source files in src/3rdparty/md5 for
the complete license text.
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
X.X) Credits
---- -------
@@ -673,7 +650,6 @@ The OpenTTD team (in alphabetical order):
Albert Hofkamp (Alberth) - GUI expert
Jean-François Claeys (Belugas) - GUI, newindustries and more
Matthijs Kooijman (blathijs) - Pathfinder-guru, pool rework
Ulf Hermann (fonsinchen) - Cargo Distribution
Christoph Elsenhans (frosch) - General coding
Loïc Guilloux (glx) - Windows Expert
Michael Lutz (michi_cc) - Path based signals

View File

@@ -25,13 +25,11 @@ engine.cpp
fileio.cpp
fios.cpp
fontcache.cpp
fontdetection.cpp
base_consist.cpp
gamelog.cpp
genworld.cpp
gfx.cpp
gfxinit.cpp
gfx_layout.cpp
goal.cpp
ground_vehicle.cpp
heightmap.cpp
@@ -175,13 +173,11 @@ fileio_func.h
fileio_type.h
fios.h
fontcache.h
fontdetection.h
base_consist.h
gamelog.h
gamelog_internal.h
genworld.h
gfx_func.h
gfx_layout.h
gfx_type.h
gfxinit.h
goal_base.h
@@ -306,7 +302,6 @@ station_type.h
statusbar_gui.h
stdafx.h
strgen/strgen.h
string_base.h
string_func.h
string_type.h
stringfilter_type.h

View File

@@ -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.

View File

@@ -37,13 +37,9 @@ public:
~sqvector()
{
if(_allocated) {
/* Break freeing loops, if this vector (indirectly) links to itself. */
size_t allocated_size = _allocated * sizeof(T);
_allocated = 0;
for(SQUnsignedInteger i = 0; i < _size; i++)
_vals[i].~T();
SQ_FREE(_vals, allocated_size);
SQ_FREE(_vals, (_allocated * sizeof(T)));
}
}
void reserve(SQUnsignedInteger newsize) { _realloc(newsize); }

View File

@@ -107,7 +107,6 @@ SQVM::SQVM(SQSharedState *ss)
_errorhandler = _null_;
_debughook = _null_;
_can_suspend = false;
_in_stackoverflow = false;
_ops_till_suspend = 0;
ci = NULL;
INIT_CHAIN();ADD_TO_CHAIN(&_ss(this)->_gc_chain,this);

View File

@@ -170,7 +170,6 @@ public:
SQBool _can_suspend;
SQInteger _ops_till_suspend;
SQBool _in_stackoverflow;
bool ShouldSuspend()
{
@@ -201,10 +200,8 @@ inline SQObjectPtr &stack_get(HSQUIRRELVM v,SQInteger idx){return ((idx>=0)?(v->
#define PUSH_CALLINFO(v,nci){ \
if(v->_callsstacksize == v->_alloccallsstacksize) { \
if (v->_callsstacksize > 65535 && !v->_in_stackoverflow) {\
v->_in_stackoverflow = true; \
if (v->_callsstacksize > 65535) {\
v->Raise_Error(_SC("stack overflow"));\
v->CallErrorHandler(v->_lasterror);\
return false;\
}\
v->GrowCallStack(); \

View File

@@ -47,7 +47,6 @@
/* Load default data and store the name in the settings */
config->Change(info->GetName(), -1, false, true);
}
config->AnchorUnchangeableSettings();
Backup<CompanyByte> cur_company(_current_company, company, FILE_LINE);
Company *c = Company::Get(company);

View File

@@ -1303,7 +1303,7 @@ struct AIDebugWindow : public Window {
}
}
virtual EventState OnKeyPress(WChar key, uint16 keycode)
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
EventState state = ES_NOT_HANDLED;
int num = CheckHotkeyMatch(aidebug_hotkeys, keycode, this);
@@ -1514,7 +1514,7 @@ Window *ShowAIDebugWindow(CompanyID show_company)
/**
* Handler for global AI debug window hotkeys.
*/
EventState AIDebugGlobalHotkeys(WChar key, uint16 keycode)
EventState AIDebugGlobalHotkeys(uint16 key, uint16 keycode)
{
int num = CheckHotkeyMatch<AIDebugWindow>(_aidebug_hotkeys, keycode, NULL, true);
if (num == -1) return ES_NOT_HANDLED;

View File

@@ -1021,7 +1021,7 @@ static bool HandleCrashedAircraft(Aircraft *v)
/* make aircraft crash down to the ground */
if (v->crashed_counter < 500 && st == NULL && ((v->crashed_counter % 3) == 0) ) {
int z = GetSlopePixelZ(Clamp(v->x_pos, 0, MapMaxX() * TILE_SIZE), Clamp(v->y_pos, 0, MapMaxY() * TILE_SIZE));
int z = GetSlopePixelZ(v->x_pos, v->y_pos);
v->z_pos -= 1;
if (v->z_pos == z) {
v->crashed_counter = 500;

View File

@@ -39,7 +39,7 @@ void DrawAircraftDetails(const Aircraft *v, int left, int right, int y)
SetDParam(0, u->engine_type);
SetDParam(1, u->build_year);
SetDParam(2, u->value);
DrawString(left, right, y, STR_VEHICLE_INFO_BUILT_VALUE);
DrawString(left, right, y, STR_VEHICLE_INFO_BUILT_VALUE, TC_FROMSTRING, SA_LEFT | SA_STRIP);
SetDParam(0, u->cargo_type);
SetDParam(1, u->cargo_cap);

View File

@@ -99,7 +99,7 @@ struct BuildAirToolbarWindow : Window {
}
virtual EventState OnKeyPress(WChar key, uint16 keycode)
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
int num = CheckHotkeyMatch(airtoolbar_hotkeys, keycode, this);
if (num == -1) return ES_NOT_HANDLED;
@@ -187,7 +187,7 @@ Window *ShowBuildAirToolbar()
return AllocateWindowDescFront<BuildAirToolbarWindow>(&_air_toolbar_desc, TRANSPORT_AIR);
}
EventState AirportToolbarGlobalHotkeys(WChar key, uint16 keycode)
EventState AirportToolbarGlobalHotkeys(uint16 key, uint16 keycode)
{
if (!CanBuildVehicleInfrastructure(VEH_AIRCRAFT)) return ES_NOT_HANDLED;
int num = CheckHotkeyMatch<BuildAirToolbarWindow>(_airtoolbar_hotkeys, keycode, NULL, true);
@@ -338,7 +338,7 @@ public:
if (!as->IsAvailable()) {
GfxFillRect(r.left + 1, y + 1, r.right - 1, y + this->line_height - 2, PC_BLACK, FILLRECT_CHECKER);
}
DrawString(r.left + WD_MATRIX_LEFT, r.right - WD_MATRIX_RIGHT, y + WD_MATRIX_TOP, as->name, ((int)i == _selected_airport_index) ? TC_WHITE : TC_BLACK);
DrawString(r.left + WD_MATRIX_LEFT, r.right + WD_MATRIX_RIGHT, y + WD_MATRIX_TOP, as->name, ((int)i == _selected_airport_index) ? TC_WHITE : TC_BLACK);
y += this->line_height;
}
break;
@@ -391,10 +391,8 @@ public:
top = DrawStationCoverageAreaText(panel_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, SCT_ALL, rad, true) + WD_PAR_VSEP_NORMAL;
}
/* Resize background if the window is too small.
* Never make the window smaller to avoid oscillating if the size change affects the acceptance.
* (This is the case, if making the window bigger moves the mouse into the window.) */
if (top > bottom) {
/* Resize background if the text is not equally long as the window. */
if (top > bottom || (top < bottom && panel_nwi->current_y > panel_nwi->smallest_y)) {
ResizeWindow(this, 0, top - bottom);
}
}

View File

@@ -207,7 +207,7 @@ void Blitter_32bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode,
}
}
Sprite *Blitter_32bppOptimized::Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
Sprite *Blitter_32bppOptimized::Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
{
/* streams of pixels (a, r, g, b channels)
*

View File

@@ -24,7 +24,7 @@ public:
};
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
/* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
/* virtual */ const char *GetName() { return "32bpp-optimized"; }

View File

@@ -92,7 +92,7 @@ void Blitter_32bppSimple::DrawColourMappingRect(void *dst, int width, int height
DEBUG(misc, 0, "32bpp blitter doesn't know how to draw this colour table ('%d')", pal);
}
Sprite *Blitter_32bppSimple::Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
Sprite *Blitter_32bppSimple::Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
{
Blitter_32bppSimple::Pixel *dst;
Sprite *dest_sprite = (Sprite *)allocator(sizeof(*dest_sprite) + sprite->height * sprite->width * sizeof(*dst));

View File

@@ -28,7 +28,7 @@ class Blitter_32bppSimple : public Blitter_32bppBase {
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);
/* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
/* virtual */ const char *GetName() { return "32bpp-simple"; }
};

View File

@@ -112,7 +112,7 @@ void Blitter_8bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Z
}
}
Sprite *Blitter_8bppOptimized::Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
Sprite *Blitter_8bppOptimized::Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
{
/* Make memory for all zoom-levels */
uint memory = sizeof(SpriteData);

View File

@@ -25,7 +25,7 @@ public:
};
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
/* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
/* virtual */ const char *GetName() { return "8bpp-optimized"; }
};

View File

@@ -55,7 +55,7 @@ void Blitter_8bppSimple::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Zoom
}
}
Sprite *Blitter_8bppSimple::Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
Sprite *Blitter_8bppSimple::Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
{
Sprite *dest_sprite;
dest_sprite = (Sprite *)allocator(sizeof(*dest_sprite) + sprite->height * sprite->width);

View File

@@ -19,7 +19,7 @@
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);
/* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
/* virtual */ const char *GetName() { return "8bpp-simple"; }
};

View File

@@ -77,7 +77,7 @@ public:
/**
* Convert a sprite from the loader to our own format.
*/
virtual Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) = 0;
virtual Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator) = 0;
/**
* Move the destination pointer the requested amount x and y, keeping in mind

View File

@@ -15,7 +15,7 @@
/** Instantiation of the null blitter factory. */
static FBlitter_Null iFBlitter_Null;
Sprite *Blitter_Null::Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
Sprite *Blitter_Null::Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
{
Sprite *dest_sprite;
dest_sprite = (Sprite *)allocator(sizeof(*dest_sprite));

View File

@@ -20,7 +20,7 @@ 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 */ Sprite *Encode(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) {};

View File

@@ -218,7 +218,7 @@ bool HandleBootstrap()
if (BlitterFactoryBase::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(ENABLE_NETWORK) && defined(WITH_FREETYPE) && !defined(__APPLE__) && (defined(WITH_FONTCONFIG) || defined(WIN32))
if (!_network_available) goto failure;
/* First tell the game we're bootstrapping. */

View File

@@ -249,7 +249,7 @@ public:
}
}
virtual EventState OnKeyPress(WChar key, uint16 keycode)
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
const uint8 i = keycode - '1';
if (i < 9 && i < this->bridges->Length()) {

View File

@@ -13,7 +13,6 @@
#include "engine_base.h"
#include "engine_func.h"
#include "station_base.h"
#include "network/network.h"
#include "articulated_vehicles.h"
#include "textbuf_gui.h"
#include "command_func.h"
@@ -890,7 +889,7 @@ void DrawEngineList(VehicleType type, int l, int r, int y, const GUIEngineList *
int count_width = 0;
if (show_count) {
replace_icon = GetSpriteSize(SPR_GROUP_REPLACE_ACTIVE);
SetDParamMaxDigits(0, 3, FS_SMALL);
SetDParamMaxDigits(0, 3);
count_width = GetStringBoundingBox(STR_TINY_BLACK_COMA).width;
}
@@ -910,7 +909,7 @@ void DrawEngineList(VehicleType type, int l, int r, int y, const GUIEngineList *
const uint num_engines = GetGroupNumEngines(_local_company, selected_group, engine);
SetDParam(0, engine);
DrawString(text_left, text_right, y + normal_text_y_offset, STR_ENGINE_NAME, engine == selected_id ? TC_WHITE : TC_BLACK);
DrawString(text_left, text_right, y + normal_text_y_offset, STR_ENGINE_NAME, engine == selected_id ? TC_WHITE : TC_BLACK, SA_STRIP | (rtl ? SA_RIGHT : SA_LEFT));
DrawVehicleEngine(l, r, sprite_x, y + sprite_y_offset, engine, (show_count && num_engines == 0) ? PALETTE_CRASH : GetEnginePalette(engine, _local_company), EIT_PURCHASE);
if (show_count) {
SetDParam(0, num_engines);
@@ -971,9 +970,6 @@ struct BuildVehicleWindow : Window {
* So we just hide it, and enlarge the Rename button by the now vacant place. */
if (this->listview_mode) this->GetWidget<NWidgetStacked>(WID_BV_BUILD_SEL)->SetDisplayedPlane(SZSP_NONE);
/* disable renaming engines in network games if you are not the server */
this->SetWidgetDisabledState(WID_BV_RENAME, _networking && !_network_server);
NWidgetCore *widget = this->GetWidget<NWidgetCore>(WID_BV_LIST);
widget->tool_tip = STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP + type;

View File

@@ -209,7 +209,7 @@ static const Command _command_proc_table[] = {
DEF_CMD(CmdRemoveFromRailStation, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_REMOVE_FROM_RAIL_STATION
DEF_CMD(CmdConvertRail, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_CONVERT_RAILD
DEF_CMD(CmdBuildRailWaypoint, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_RAIL_WAYPOINT
DEF_CMD(CmdRenameWaypoint, 0, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_WAYPOINT
DEF_CMD(CmdRenameWaypoint, CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_WAYPOINT
DEF_CMD(CmdRemoveFromRailWaypoint, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_REMOVE_FROM_RAIL_WAYPOINT
DEF_CMD(CmdBuildRoadStop, CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_ROAD_STOP
@@ -251,17 +251,17 @@ static const Command _command_proc_table[] = {
DEF_CMD(CmdWantEnginePreview, 0, CMDT_VEHICLE_MANAGEMENT ), // CMD_WANT_ENGINE_PREVIEW
DEF_CMD(CmdRenameVehicle, 0, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_VEHICLE
DEF_CMD(CmdRenameEngine, CMD_SERVER, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_ENGINE
DEF_CMD(CmdRenameVehicle, CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_VEHICLE
DEF_CMD(CmdRenameEngine, CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_ENGINE
DEF_CMD(CmdRenameCompany, 0, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_COMPANY
DEF_CMD(CmdRenamePresident, 0, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_PRESIDENT
DEF_CMD(CmdRenameCompany, CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_COMPANY
DEF_CMD(CmdRenamePresident, CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_PRESIDENT
DEF_CMD(CmdRenameStation, 0, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_STATION
DEF_CMD(CmdRenameDepot, 0, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_DEPOT
DEF_CMD(CmdRenameStation, CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_STATION
DEF_CMD(CmdRenameDepot, CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_DEPOT
DEF_CMD(CmdPlaceSign, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_PLACE_SIGN
DEF_CMD(CmdRenameSign, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_SIGN
DEF_CMD(CmdPlaceSign, CMD_STR_CTRL | CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_PLACE_SIGN
DEF_CMD(CmdRenameSign, CMD_STR_CTRL | CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_SIGN
DEF_CMD(CmdTurnRoadVeh, 0, CMDT_VEHICLE_MANAGEMENT ), // CMD_TURN_ROADVEH
@@ -272,7 +272,7 @@ static const Command _command_proc_table[] = {
DEF_CMD(CmdBuyCompany, 0, CMDT_MONEY_MANAGEMENT ), // CMD_BUY_COMANY
DEF_CMD(CmdFoundTown, CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_FOUND_TOWN; founding random town can fail only in exec run
DEF_CMD(CmdRenameTown, CMD_SERVER, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_TOWN
DEF_CMD(CmdRenameTown, CMD_STR_CTRL | CMD_SERVER, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_TOWN
DEF_CMD(CmdDoTownAction, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_DO_TOWN_ACTION
DEF_CMD(CmdTownCargoGoal, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_TOWN_CARGO_GOAL
DEF_CMD(CmdTownGrowthRate, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_TOWN_GROWTH_RATE
@@ -314,7 +314,7 @@ static const Command _command_proc_table[] = {
DEF_CMD(CmdDepotMassAutoReplace, 0, CMDT_VEHICLE_CONSTRUCTION ), // CMD_DEPOT_MASS_AUTOREPLACE
DEF_CMD(CmdCreateGroup, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_CREATE_GROUP
DEF_CMD(CmdDeleteGroup, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_DELETE_GROUP
DEF_CMD(CmdRenameGroup, 0, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_GROUP
DEF_CMD(CmdRenameGroup, CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_GROUP
DEF_CMD(CmdAddVehicleGroup, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_ADD_VEHICLE_GROUP
DEF_CMD(CmdAddSharedVehicleGroup, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_ADD_SHARE_VEHICLE_GROUP
DEF_CMD(CmdRemoveAllVehiclesGroup, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_REMOVE_ALL_VEHICLES_GROUP

View File

@@ -550,7 +550,7 @@ Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY)
c->avail_railtypes = GetCompanyRailtypes(c->index);
c->avail_roadtypes = GetCompanyRoadtypes(c->index);
c->inaugurated_year = _cur_year;
RandomCompanyManagerFaceBits(c->face, (GenderEthnicity)Random(), false, false); // create a random company manager face
RandomCompanyManagerFaceBits(c->face, (GenderEthnicity)Random(), false); // create a random company manager face
SetDefaultCompanySettings(c->index);

View File

@@ -526,7 +526,7 @@ public:
uint Height(uint width) const
{
return max(FONT_HEIGHT_NORMAL, 14);
return max(FONT_HEIGHT_NORMAL, (byte)14);
}
bool Selectable() const

View File

@@ -201,15 +201,12 @@ static inline void ScaleAllCompanyManagerFaceBits(CompanyManagerFace &cmf)
* @param cmf the company manager's face to write the bits to
* @param ge the gender and ethnicity of the old company manager's face
* @param adv if it for the advanced company manager's face window
* @param interactive is the call from within the user interface?
*
* @pre scale 'ge' to a valid gender/ethnicity combination
*/
static inline void RandomCompanyManagerFaceBits(CompanyManagerFace &cmf, GenderEthnicity ge, bool adv, bool interactive = true)
static inline void RandomCompanyManagerFaceBits(CompanyManagerFace &cmf, GenderEthnicity ge, bool adv)
{
/* This method is called from a command when not interactive and
* then we must use Random to get the same result on all clients. */
cmf = interactive ? InteractiveRandom() : Random(); // random all company manager's face bits
cmf = InteractiveRandom(); // random all company manager's face bits
/* scale ge: 0 == GE_WM, 1 == GE_WF, 2 == GE_BM, 3 == GE_BF (and maybe in future: ...) */
ge = (GenderEthnicity)((uint)ge % GE_END);

View File

@@ -21,7 +21,6 @@
#include "settings_type.h"
#include "console_func.h"
#include "rev.h"
#include "video/video_driver.hpp"
#include "widgets/console_widget.h"
@@ -185,7 +184,6 @@ struct IConsoleWindow : Window
~IConsoleWindow()
{
_iconsole_mode = ICONSOLE_CLOSED;
_video_driver->EditBoxLostFocus();
}
/**
@@ -217,9 +215,6 @@ struct IConsoleWindow : Window
delta = 0;
}
/* If we have a marked area, draw a background highlight. */
if (_iconsole_cmdline.marklength != 0) GfxFillRect(this->line_offset + delta + _iconsole_cmdline.markxoffs, this->height - this->line_height, this->line_offset + delta + _iconsole_cmdline.markxoffs + _iconsole_cmdline.marklength, this->height - 1, PC_DARK_RED);
DrawString(this->line_offset + delta, right, this->height - this->line_height, _iconsole_cmdline.buf, (TextColour)CC_COMMAND, SA_LEFT | SA_FORCE);
if (_focused_window == this && _iconsole_cmdline.caret) {
@@ -241,7 +236,7 @@ struct IConsoleWindow : Window
if (_iconsole_cmdline.HandleCaret()) this->SetDirty();
}
virtual EventState OnKeyPress(WChar key, uint16 keycode)
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
if (_focused_window != this) return ES_NOT_HANDLED;
@@ -295,13 +290,46 @@ struct IConsoleWindow : Window
MarkWholeScreenDirty();
break;
#ifdef WITH_COCOA
case (WKC_META | 'V'):
#endif
case (WKC_CTRL | 'V'):
if (_iconsole_cmdline.InsertClipboard()) {
IConsoleResetHistoryPos();
this->SetDirty();
}
break;
case (WKC_CTRL | 'L'):
IConsoleCmdExec("clear");
break;
#ifdef WITH_COCOA
case (WKC_META | 'U'):
#endif
case (WKC_CTRL | 'U'):
_iconsole_cmdline.DeleteAll();
this->SetDirty();
break;
case WKC_BACKSPACE: case WKC_DELETE:
if (_iconsole_cmdline.DeleteChar(keycode)) {
IConsoleResetHistoryPos();
this->SetDirty();
}
break;
case WKC_LEFT: case WKC_RIGHT: case WKC_END: case WKC_HOME:
if (_iconsole_cmdline.MovePos(keycode)) {
IConsoleResetHistoryPos();
this->SetDirty();
}
break;
default:
if (_iconsole_cmdline.HandleKeyPress(key, keycode) != HKPR_NOT_HANDLED) {
if (IsValidChar(key, CS_ALPHANUMERAL)) {
IConsoleWindow::scroll = 0;
_iconsole_cmdline.InsertChar(key);
IConsoleResetHistoryPos();
this->SetDirty();
} else {
@@ -312,70 +340,10 @@ 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)
{
if (_iconsole_cmdline.InsertString(str, marked, caret, insert_location, replacement_end)) {
IConsoleWindow::scroll = 0;
IConsoleResetHistoryPos();
this->SetDirty();
}
}
virtual const char *GetFocusedText() const
{
return _iconsole_cmdline.buf;
}
virtual const char *GetCaret() const
{
return _iconsole_cmdline.buf + _iconsole_cmdline.caretpos;
}
virtual const char *GetMarkedText(size_t *length) const
{
if (_iconsole_cmdline.markend == 0) return NULL;
*length = _iconsole_cmdline.markend - _iconsole_cmdline.markpos;
return _iconsole_cmdline.buf + _iconsole_cmdline.markpos;
}
virtual Point GetCaretPosition() const
{
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};
return pt;
}
virtual Rect GetTextBoundingRect(const char *from, const char *to) const
{
int delta = min(this->width - this->line_offset - _iconsole_cmdline.pixels - ICON_RIGHT_BORDERWIDTH, 0);
Point p1 = GetCharPosInString(_iconsole_cmdline.buf, from, FS_NORMAL);
Point p2 = from != to ? GetCharPosInString(_iconsole_cmdline.buf, from) : p1;
Rect r = {this->line_offset + delta + p1.x, this->height - this->line_height, this->line_offset + delta + p2.x, this->height};
return r;
}
virtual const char *GetTextCharacterAtPosition(const Point &pt) const
{
int delta = min(this->width - this->line_offset - _iconsole_cmdline.pixels - ICON_RIGHT_BORDERWIDTH, 0);
if (!IsInsideMM(pt.y, this->height - this->line_height, this->height)) return NULL;
return GetCharAtPosition(_iconsole_cmdline.buf, pt.x - delta);
}
virtual void OnMouseWheel(int wheel)
{
this->Scroll(-wheel);
}
virtual void OnFocusLost()
{
_video_driver->EditBoxLostFocus();
}
};
int IConsoleWindow::scroll = 0;

View File

@@ -365,8 +365,8 @@ static inline T ROR(const T x, const uint8 n)
* (since it will use hardware swapping if available).
* Even though they should return uint16 and uint32, we get
* warnings if we don't cast those (why?) */
#define BSWAP32(x) ((uint32)CFSwapInt32(x))
#define BSWAP16(x) ((uint16)CFSwapInt16(x))
#define BSWAP32(x) ((uint32)Endian32_Swap(x))
#define BSWAP16(x) ((uint16)Endian16_Swap(x))
#elif defined(_MSC_VER)
/* MSVC has intrinsics for swapping, resulting in faster code */
#define BSWAP32(x) (_byteswap_ulong(x))

View File

@@ -131,14 +131,13 @@ static void debug_print(const char *dbg, const char *buf)
fflush(f);
#endif
} else {
char buffer[512];
seprintf(buffer, lastof(buffer), "%sdbg: [%s] %s\n", GetLogPrefix(), dbg, buf);
#if defined(WINCE)
NKDbgPrintfW(OTTD2FS(buffer));
#elif defined(WIN32) || defined(WIN64)
_fputts(OTTD2FS(buffer, true), stderr);
/* We need to do OTTD2FS twice, but as it uses a static buffer, we need to store one temporary */
TCHAR tbuf[512];
_sntprintf(tbuf, sizeof(tbuf), _T("%s"), OTTD2FS(dbg));
NKDbgPrintfW(_T("dbg: [%s] %s\n"), tbuf, OTTD2FS(buf));
#else
fputs(buffer, stderr);
fprintf(stderr, "%sdbg: [%s] %s\n", GetLogPrefix(), dbg, buf);
#endif
#ifdef ENABLE_NETWORK
NetworkAdminConsole(dbg, buf);

View File

@@ -600,7 +600,7 @@ struct DepotWindow : Window {
uint min_height = 0;
if (this->type == VEH_TRAIN) {
SetDParamMaxValue(0, 1000, 0, FS_SMALL);
SetDParamMaxValue(0, 1000);
SetDParam(1, 1);
this->count_width = GetStringBoundingBox(STR_TINY_BLACK_DECIMAL).width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
} else {

View File

@@ -163,7 +163,7 @@ struct BuildDocksToolbarWindow : Window {
this->last_clicked_widget = (DockToolbarWidgets)widget;
}
virtual EventState OnKeyPress(WChar key, uint16 keycode)
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
int num = CheckHotkeyMatch(dockstoolbar_hotkeys, keycode, this);
if (num == -1) return ES_NOT_HANDLED;
@@ -335,7 +335,7 @@ Window *ShowBuildDocksToolbar()
return AllocateWindowDescFront<BuildDocksToolbarWindow>(&_build_docks_toolbar_desc, TRANSPORT_WATER);
}
EventState DockToolbarGlobalHotkeys(WChar key, uint16 keycode)
EventState DockToolbarGlobalHotkeys(uint16 key, uint16 keycode)
{
int num = CheckHotkeyMatch<BuildDocksToolbarWindow>(_dockstoolbar_hotkeys, keycode, NULL, true);
if (num == -1) return ES_NOT_HANDLED;
@@ -422,10 +422,8 @@ public:
int bottom = back_nwi->pos_y + back_nwi->current_y;
top = DrawStationCoverageAreaText(back_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, SCT_ALL, rad, false) + WD_PAR_VSEP_NORMAL;
top = DrawStationCoverageAreaText(back_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, SCT_ALL, rad, true) + WD_PAR_VSEP_NORMAL;
/* Resize background if the window is too small.
* Never make the window smaller to avoid oscillating if the size change affects the acceptance.
* (This is the case, if making the window bigger moves the mouse into the window.) */
if (top > bottom) {
/* Resize background if the text is not equally long as the window. */
if (top > bottom || (top < bottom && back_nwi->current_y > back_nwi->smallest_y)) {
ResizeWindow(this, 0, top - bottom);
}
}

View File

@@ -1313,11 +1313,10 @@ static void LoadUnloadVehicle(Vehicle *front, int *cargo_left)
artic_part++;
const Engine *e = v->GetEngine();
uint load_amount = e->info.load_amount;
byte load_amount = e->info.load_amount;
/* The default loadamount for mail is 1/4 of the load amount for passengers */
bool air_mail = v->type == VEH_AIRCRAFT && !Aircraft::From(v)->IsNormalAircraft();
if (air_mail) load_amount = CeilDiv(load_amount, 4);
if (v->type == VEH_AIRCRAFT && !Aircraft::From(v)->IsNormalAircraft()) load_amount = CeilDiv(load_amount, 4);
if (_settings_game.order.gradual_loading) {
uint16 cb_load_amount = CALLBACK_FAILED;
@@ -1338,9 +1337,6 @@ static void LoadUnloadVehicle(Vehicle *front, int *cargo_left)
}
}
/* Scale load amount the same as capacity */
if (HasBit(e->info.misc_flags, EF_NO_DEFAULT_CARGO_MULTIPLIER) && !air_mail) load_amount = CeilDiv(load_amount * CargoSpec::Get(v->cargo_type)->multiplier, 0x100);
GoodsEntry *ge = &st->goods[v->cargo_type];
if (HasBit(v->vehicle_flags, VF_CARGO_UNLOADING) && (front->current_order.GetUnloadType() & OUFB_NO_UNLOAD) == 0) {

View File

@@ -30,7 +30,6 @@
#include "company_base.h"
#include "vehicle_func.h"
#include "articulated_vehicles.h"
#include "error.h"
#include "table/strings.h"
#include "table/engines.h"
@@ -1099,29 +1098,3 @@ bool IsEngineRefittable(EngineID engine)
CargoID default_cargo = e->GetDefaultCargoType();
return default_cargo != CT_INVALID && ei->refit_mask != 1U << default_cargo;
}
/**
* Check for engines that have an appropriate availability.
*/
void CheckEngines()
{
const Engine *e;
Date min_date = INT32_MAX;
FOR_ALL_ENGINES(e) {
if (!e->IsEnabled()) continue;
/* We have an available engine... yay! */
if ((e->flags & ENGINE_AVAILABLE) != 0 && e->company_avail != 0) return;
/* Okay, try to find the earliest date. */
min_date = min(min_date, e->info.base_intro);
}
if (min_date < INT32_MAX) {
SetDParam(0, min_date);
ShowErrorMessage(STR_ERROR_NO_VEHICLES_AVAILABLE_YET, STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION, WL_WARNING);
} else {
ShowErrorMessage(STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL, STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION, WL_WARNING);
}
}

View File

@@ -18,7 +18,6 @@
void SetupEngines();
void StartupEngines();
void CheckEngines();
/* Original engine data counts and offsets */
extern const uint8 _engine_counts[4];

View File

@@ -300,7 +300,7 @@ public:
if (_window_system_initialized) ShowFirstError();
}
virtual EventState OnKeyPress(WChar key, uint16 keycode)
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
if (keycode != WKC_SPACE) return ES_NOT_HANDLED;
delete this;

View File

@@ -615,7 +615,7 @@ public:
}
}
virtual EventState OnKeyPress(WChar key, uint16 keycode)
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
if (keycode == WKC_ESC) {
delete this;

File diff suppressed because it is too large Load Diff

View File

@@ -12,201 +12,84 @@
#ifndef FONTCACHE_H
#define FONTCACHE_H
#include "string_type.h"
#include "spritecache.h"
/** Glyphs are characters from a font. */
typedef uint32 GlyphID;
static const GlyphID SPRITE_GLYPH = 1U << 30;
/** Font cache for basic fonts. */
class FontCache {
private:
static FontCache *caches[FS_END]; ///< All the font caches.
protected:
FontCache *parent; ///< The parent of this font cache.
const FontSize fs; ///< The size of the font.
int height; ///< The height of the font.
int ascender; ///< The ascender value of the font.
int descender; ///< The descender value of the font.
int units_per_em; ///< The units per EM value of the font.
public:
FontCache(FontSize fs);
virtual ~FontCache();
/**
* Get the FontSize of the font.
* @return The FontSize.
*/
inline FontSize GetSize() const { return this->fs; }
/**
* Get the height of the font.
* @return The height of the font.
*/
inline int GetHeight() const { return this->height; }
/**
* Get the ascender value of the font.
* @return The ascender value of the font.
*/
inline int GetAscender() const { return this->ascender; }
/**
* Get the descender value of the font.
* @return The descender value of the font.
*/
inline int GetDescender() const{ return this->descender; }
/**
* Get the units per EM value of the font.
* @return The units per EM value of the font.
*/
inline int GetUnitsPerEM() const { return this->units_per_em; }
/**
* Get the SpriteID mapped to the given key
* @param key The key to get the sprite for.
* @return The sprite.
*/
virtual SpriteID GetUnicodeGlyph(WChar key) = 0;
/**
* Map a SpriteID to the key
* @param key The key to map to.
* @param sprite The sprite that is being mapped.
*/
virtual void SetUnicodeGlyph(WChar key, SpriteID sprite) = 0;
/** Initialize the glyph map */
virtual void InitializeUnicodeGlyphMap() = 0;
/** Clear the font cache. */
virtual void ClearFontCache() = 0;
/**
* Get the glyph (sprite) of the given key.
* @param key The key to look up.
* @return The sprite.
*/
virtual const Sprite *GetGlyph(GlyphID key) = 0;
/**
* Get the width of the glyph with the given key.
* @param key The key to look up.
* @return The width.
*/
virtual uint GetGlyphWidth(GlyphID key) = 0;
/**
* Do we need to draw a glyph shadow?
* @return True if it has to be done, otherwise false.
*/
virtual bool GetDrawGlyphShadow() = 0;
/**
* Map a character into a glyph.
* @param key The character.
* @return The glyph ID used to draw the character.
*/
virtual GlyphID MapCharToGlyph(WChar key) = 0;
/**
* Read a font table from the font.
* @param tag The of the table to load.
* @param length The length of the read data.
* @return The loaded table data.
*/
virtual const void *GetFontTable(uint32 tag, size_t &length) = 0;
/**
* Get the font cache of a given font size.
* @param fs The font size to look up.
* @return The font cache.
*/
static inline FontCache *Get(FontSize fs)
{
assert(fs < FS_END);
return FontCache::caches[fs];
}
/**
* Check whether the font cache has a parent.
*/
inline bool HasParent()
{
return this->parent != NULL;
}
};
/** Get the SpriteID mapped to the given font size and key */
static inline SpriteID GetUnicodeGlyph(FontSize size, WChar key)
{
return FontCache::Get(size)->GetUnicodeGlyph(key);
}
SpriteID GetUnicodeGlyph(FontSize size, uint32 key);
/** Map a SpriteID to the font size and key */
static inline void SetUnicodeGlyph(FontSize size, WChar key, SpriteID sprite)
{
FontCache::Get(size)->SetUnicodeGlyph(key, sprite);
}
void SetUnicodeGlyph(FontSize size, uint32 key, SpriteID sprite);
/** Initialize the glyph map */
static inline void InitializeUnicodeGlyphMap()
{
for (FontSize fs = FS_BEGIN; fs < FS_END; fs++) {
FontCache::Get(fs)->InitializeUnicodeGlyphMap();
}
}
static inline void ClearFontCache()
{
for (FontSize fs = FS_BEGIN; fs < FS_END; fs++) {
FontCache::Get(fs)->ClearFontCache();
}
}
/** Get the Sprite for a glyph */
static inline const Sprite *GetGlyph(FontSize size, WChar key)
{
FontCache *fc = FontCache::Get(size);
return fc->GetGlyph(fc->MapCharToGlyph(key));
}
/** Get the width of a glyph */
static inline uint GetGlyphWidth(FontSize size, WChar key)
{
FontCache *fc = FontCache::Get(size);
return fc->GetGlyphWidth(fc->MapCharToGlyph(key));
}
static inline bool GetDrawGlyphShadow(FontSize size)
{
return FontCache::Get(size)->GetDrawGlyphShadow();
}
void InitializeUnicodeGlyphMap();
#ifdef WITH_FREETYPE
/** Settings for a single freetype font. */
struct FreeTypeSubSetting {
char font[MAX_PATH]; ///< The name of the font, or path to the font.
uint size; ///< The (requested) size of the font.
bool aa; ///< Whether to do anti aliasing or not.
};
/** Settings for the freetype fonts. */
struct FreeTypeSettings {
FreeTypeSubSetting small; ///< The smallest font; mostly used for zoomed out view.
FreeTypeSubSetting medium; ///< The normal font size.
FreeTypeSubSetting large; ///< The largest font; mostly used for newspapers.
FreeTypeSubSetting mono; ///< The mono space font used for license/readme viewers.
char small_font[MAX_PATH];
char medium_font[MAX_PATH];
char large_font[MAX_PATH];
char mono_font[MAX_PATH];
uint small_size;
uint medium_size;
uint large_size;
uint mono_size;
bool small_aa;
bool medium_aa;
bool large_aa;
bool mono_aa;
};
extern FreeTypeSettings _freetype;
#endif /* WITH_FREETYPE */
void InitFreeType(bool monospace);
void UninitFreeType();
void ClearFontCache();
const Sprite *GetGlyph(FontSize size, uint32 key);
uint GetGlyphWidth(FontSize size, uint32 key);
bool GetDrawGlyphShadow();
/**
* We would like to have a fallback font as the current one
* doesn't contain all characters we need.
* This function must set all fonts of settings.
* @param settings the settings to overwrite the fontname of.
* @param language_isocode the language, e.g. en_GB.
* @param winlangid the language ID windows style.
* @param callback The function to call to check for missing glyphs.
* @return true if a font has been set, false otherwise.
*/
bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid, class MissingGlyphSearcher *callback);
#else
/* Stub for initializiation */
static inline void InitFreeType(bool monospace) { extern void ResetFontSizes(bool monospace); ResetFontSizes(monospace); }
static inline void UninitFreeType() {}
static inline void ClearFontCache() {}
/** Get the Sprite for a glyph */
static inline const Sprite *GetGlyph(FontSize size, uint32 key)
{
SpriteID sprite = GetUnicodeGlyph(size, key);
if (sprite == 0) sprite = GetUnicodeGlyph(size, '?');
return GetSprite(sprite, ST_FONT);
}
/** Get the width of a glyph */
static inline uint GetGlyphWidth(FontSize size, uint32 key)
{
SpriteID sprite = GetUnicodeGlyph(size, key);
if (sprite == 0) sprite = GetUnicodeGlyph(size, '?');
return SpriteExists(sprite) ? GetSprite(sprite, ST_FONT)->width + (size != FS_NORMAL) : 0;
}
static inline bool GetDrawGlyphShadow()
{
return false;
}
#endif /* WITH_FREETYPE */
#endif /* FONTCACHE_H */

View File

@@ -1,695 +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 <http://www.gnu.org/licenses/>.
*/
/** @file fontdetection.cpp Detection of the right font. */
#ifdef WITH_FREETYPE
#include "stdafx.h"
#include "debug.h"
#include "fontdetection.h"
#include "string_func.h"
#include "strings_func.h"
extern FT_Library _library;
/**
* Get the font loaded into a Freetype face by using a font-name.
* If no appropriate font is found, the function returns an error
*/
/* ========================================================================================
* Windows support
* ======================================================================================== */
#ifdef WIN32
#include "core/alloc_func.hpp"
#include "core/math_func.hpp"
#include <windows.h>
#include <shlobj.h> /* SHGetFolderPath */
#include "os/windows/win32.h"
/**
* Get the short DOS 8.3 format for paths.
* FreeType doesn't support Unicode filenames and Windows' fopen (as used
* by FreeType) doesn't support UTF-8 filenames. So we have to convert the
* filename into something that isn't UTF-8 but represents the Unicode file
* name. This is the short DOS 8.3 format. This does not contain any
* characters that fopen doesn't support.
* @param long_path the path in system encoding.
* @return the short path in ANSI (ASCII).
*/
const char *GetShortPath(const TCHAR *long_path)
{
static char short_path[MAX_PATH];
#ifdef UNICODE
WCHAR short_path_w[MAX_PATH];
GetShortPathName(long_path, short_path_w, lengthof(short_path_w));
WideCharToMultiByte(CP_ACP, 0, short_path_w, -1, short_path, lengthof(short_path), NULL, NULL);
#else
/* Technically not needed, but do it for consistency. */
GetShortPathName(long_path, short_path, lengthof(short_path));
#endif
return short_path;
}
/* Get the font file to be loaded into Freetype by looping the registry
* location where windows lists all installed fonts. Not very nice, will
* surely break if the registry path changes, but it works. Much better
* solution would be to use CreateFont, and extract the font data from it
* by GetFontData. The problem with this is that the font file needs to be
* kept in memory then until the font is no longer needed. This could mean
* an additional memory usage of 30MB (just for fonts!) when using an eastern
* font for all font sizes */
#define FONT_DIR_NT "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"
#define FONT_DIR_9X "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Fonts"
FT_Error GetFontByFaceName(const char *font_name, FT_Face *face)
{
FT_Error err = FT_Err_Cannot_Open_Resource;
HKEY hKey;
LONG ret;
TCHAR vbuffer[MAX_PATH], dbuffer[256];
TCHAR *pathbuf;
const char *font_path;
uint index;
size_t path_len;
/* On windows NT (2000, NT3.5, XP, etc.) the fonts are stored in the
* "Windows NT" key, on Windows 9x in the Windows key. To save us having
* to retrieve the windows version, we'll just query both */
ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T(FONT_DIR_NT), 0, KEY_READ, &hKey);
if (ret != ERROR_SUCCESS) ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T(FONT_DIR_9X), 0, KEY_READ, &hKey);
if (ret != ERROR_SUCCESS) {
DEBUG(freetype, 0, "Cannot open registry key HKLM\\SOFTWARE\\Microsoft\\Windows (NT)\\CurrentVersion\\Fonts");
return err;
}
/* Convert font name to file system encoding. */
TCHAR *font_namep = _tcsdup(OTTD2FS(font_name));
for (index = 0;; index++) {
TCHAR *s;
DWORD vbuflen = lengthof(vbuffer);
DWORD dbuflen = lengthof(dbuffer);
ret = RegEnumValue(hKey, index, vbuffer, &vbuflen, NULL, NULL, (byte*)dbuffer, &dbuflen);
if (ret != ERROR_SUCCESS) goto registry_no_font_found;
/* The font names in the registry are of the following 3 forms:
* - ADMUI3.fon
* - Book Antiqua Bold (TrueType)
* - Batang & BatangChe & Gungsuh & GungsuhChe (TrueType)
* We will strip the font-type '()' if any and work with the font name
* itself, which must match exactly; if...
* TTC files, font files which contain more than one font are separated
* by '&'. Our best bet will be to do substr match for the fontname
* and then let FreeType figure out which index to load */
s = _tcschr(vbuffer, _T('('));
if (s != NULL) s[-1] = '\0';
if (_tcschr(vbuffer, _T('&')) == NULL) {
if (_tcsicmp(vbuffer, font_namep) == 0) break;
} else {
if (_tcsstr(vbuffer, font_namep) != NULL) break;
}
}
if (!SUCCEEDED(OTTDSHGetFolderPath(NULL, CSIDL_FONTS, NULL, SHGFP_TYPE_CURRENT, vbuffer))) {
DEBUG(freetype, 0, "SHGetFolderPath cannot return fonts directory");
goto folder_error;
}
/* Some fonts are contained in .ttc files, TrueType Collection fonts. These
* contain multiple fonts inside this single file. GetFontData however
* returns the whole file, so we need to check each font inside to get the
* proper font. */
path_len = _tcslen(vbuffer) + _tcslen(dbuffer) + 2; // '\' and terminating nul.
pathbuf = AllocaM(TCHAR, path_len);
_sntprintf(pathbuf, path_len, _T("%s\\%s"), vbuffer, dbuffer);
/* Convert the path into something that FreeType understands. */
font_path = GetShortPath(pathbuf);
index = 0;
do {
err = FT_New_Face(_library, font_path, index, face);
if (err != FT_Err_Ok) break;
if (strncasecmp(font_name, (*face)->family_name, strlen((*face)->family_name)) == 0) break;
/* Try english name if font name failed */
if (strncasecmp(font_name + strlen(font_name) + 1, (*face)->family_name, strlen((*face)->family_name)) == 0) break;
err = FT_Err_Cannot_Open_Resource;
} while ((FT_Long)++index != (*face)->num_faces);
folder_error:
registry_no_font_found:
free(font_namep);
RegCloseKey(hKey);
return err;
}
/**
* Fonts can have localised names and when the system locale is the same as
* one of those localised names Windows will always return that localised name
* instead of allowing to get the non-localised (English US) name of the font.
* This will later on give problems as freetype uses the non-localised name of
* the font and we need to compare based on that name.
* Windows furthermore DOES NOT have an API to get the non-localised name nor
* can we override the system locale. This means that we have to actually read
* the font itself to gather the font name we want.
* Based on: http://blogs.msdn.com/michkap/archive/2006/02/13/530814.aspx
* @param logfont the font information to get the english name of.
* @return the English name (if it could be found).
*/
static const char *GetEnglishFontName(const ENUMLOGFONTEX *logfont)
{
static char font_name[MAX_PATH];
const char *ret_font_name = NULL;
uint pos = 0;
HDC dc;
HGDIOBJ oldfont;
byte *buf;
DWORD dw;
uint16 format, count, stringOffset, platformId, encodingId, languageId, nameId, length, offset;
HFONT font = CreateFontIndirect(&logfont->elfLogFont);
if (font == NULL) goto err1;
dc = GetDC(NULL);
oldfont = SelectObject(dc, font);
dw = GetFontData(dc, 'eman', 0, NULL, 0);
if (dw == GDI_ERROR) goto err2;
buf = MallocT<byte>(dw);
dw = GetFontData(dc, 'eman', 0, buf, dw);
if (dw == GDI_ERROR) goto err3;
format = buf[pos++] << 8;
format += buf[pos++];
assert(format == 0);
count = buf[pos++] << 8;
count += buf[pos++];
stringOffset = buf[pos++] << 8;
stringOffset += buf[pos++];
for (uint i = 0; i < count; i++) {
platformId = buf[pos++] << 8;
platformId += buf[pos++];
encodingId = buf[pos++] << 8;
encodingId += buf[pos++];
languageId = buf[pos++] << 8;
languageId += buf[pos++];
nameId = buf[pos++] << 8;
nameId += buf[pos++];
if (nameId != 1) {
pos += 4; // skip length and offset
continue;
}
length = buf[pos++] << 8;
length += buf[pos++];
offset = buf[pos++] << 8;
offset += buf[pos++];
/* Don't buffer overflow */
length = min(length, MAX_PATH - 1);
for (uint j = 0; j < length; j++) font_name[j] = buf[stringOffset + offset + j];
font_name[length] = '\0';
if ((platformId == 1 && languageId == 0) || // Macintosh English
(platformId == 3 && languageId == 0x0409)) { // Microsoft English (US)
ret_font_name = font_name;
break;
}
}
err3:
free(buf);
err2:
SelectObject(dc, oldfont);
ReleaseDC(NULL, dc);
DeleteObject(font);
err1:
return ret_font_name == NULL ? WIDE_TO_MB((const TCHAR*)logfont->elfFullName) : ret_font_name;
}
class FontList {
protected:
TCHAR **fonts;
uint items;
uint capacity;
public:
FontList() : fonts(NULL), items(0), capacity(0) { };
~FontList() {
if (this->fonts == NULL) return;
for (uint i = 0; i < this->items; i++) {
free(this->fonts[i]);
}
free(this->fonts);
}
bool Add(const TCHAR *font) {
for (uint i = 0; i < this->items; i++) {
if (_tcscmp(this->fonts[i], font) == 0) return false;
}
if (this->items == this->capacity) {
this->capacity += 10;
this->fonts = ReallocT(this->fonts, this->capacity);
}
this->fonts[this->items++] = _tcsdup(font);
return true;
}
};
struct EFCParam {
FreeTypeSettings *settings;
LOCALESIGNATURE locale;
MissingGlyphSearcher *callback;
FontList fonts;
};
static int CALLBACK EnumFontCallback(const ENUMLOGFONTEX *logfont, const NEWTEXTMETRICEX *metric, DWORD type, LPARAM lParam)
{
EFCParam *info = (EFCParam *)lParam;
/* Skip duplicates */
if (!info->fonts.Add((const TCHAR*)logfont->elfFullName)) return 1;
/* Only use TrueType fonts */
if (!(type & TRUETYPE_FONTTYPE)) return 1;
/* Don't use SYMBOL fonts */
if (logfont->elfLogFont.lfCharSet == SYMBOL_CHARSET) return 1;
/* Use monospaced fonts when asked for it. */
if (info->callback->Monospace() && (logfont->elfLogFont.lfPitchAndFamily & (FF_MODERN | FIXED_PITCH)) != (FF_MODERN | FIXED_PITCH)) return 1;
/* The font has to have at least one of the supported locales to be usable. */
if ((metric->ntmFontSig.fsCsb[0] & info->locale.lsCsbSupported[0]) == 0 && (metric->ntmFontSig.fsCsb[1] & info->locale.lsCsbSupported[1]) == 0) {
/* On win9x metric->ntmFontSig seems to contain garbage. */
FONTSIGNATURE fs;
memset(&fs, 0, sizeof(fs));
HFONT font = CreateFontIndirect(&logfont->elfLogFont);
if (font != NULL) {
HDC dc = GetDC(NULL);
HGDIOBJ oldfont = SelectObject(dc, font);
GetTextCharsetInfo(dc, &fs, 0);
SelectObject(dc, oldfont);
ReleaseDC(NULL, dc);
DeleteObject(font);
}
if ((fs.fsCsb[0] & info->locale.lsCsbSupported[0]) == 0 && (fs.fsCsb[1] & info->locale.lsCsbSupported[1]) == 0) return 1;
}
char font_name[MAX_PATH];
convert_from_fs((const TCHAR *)logfont->elfFullName, font_name, lengthof(font_name));
/* Add english name after font name */
const char *english_name = GetEnglishFontName(logfont);
strecpy(font_name + strlen(font_name) + 1, english_name, lastof(font_name));
/* Check whether we can actually load the font. */
bool ft_init = _library != NULL;
bool found = false;
FT_Face face;
/* Init FreeType if needed. */
if ((ft_init || FT_Init_FreeType(&_library) == FT_Err_Ok) && GetFontByFaceName(font_name, &face) == FT_Err_Ok) {
FT_Done_Face(face);
found = true;
}
if (!ft_init) {
/* Uninit FreeType if we did the init. */
FT_Done_FreeType(_library);
_library = NULL;
}
if (!found) return 1;
info->callback->SetFontNames(info->settings, font_name);
if (info->callback->FindMissingGlyphs(NULL)) return 1;
DEBUG(freetype, 1, "Fallback font: %s (%s)", font_name, english_name);
return 0; // stop enumerating
}
bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid, MissingGlyphSearcher *callback)
{
DEBUG(freetype, 1, "Trying fallback fonts");
EFCParam langInfo;
if (GetLocaleInfo(MAKELCID(winlangid, SORT_DEFAULT), LOCALE_FONTSIGNATURE, (LPTSTR)&langInfo.locale, sizeof(langInfo.locale) / sizeof(TCHAR)) == 0) {
/* Invalid langid or some other mysterious error, can't determine fallback font. */
DEBUG(freetype, 1, "Can't get locale info for fallback font (langid=0x%x)", winlangid);
return false;
}
langInfo.settings = settings;
langInfo.callback = callback;
LOGFONT font;
/* Enumerate all fonts. */
font.lfCharSet = DEFAULT_CHARSET;
font.lfFaceName[0] = '\0';
font.lfPitchAndFamily = 0;
HDC dc = GetDC(NULL);
int ret = EnumFontFamiliesEx(dc, &font, (FONTENUMPROC)&EnumFontCallback, (LPARAM)&langInfo, 0);
ReleaseDC(NULL, dc);
return ret == 0;
}
#elif defined(__APPLE__) /* end ifdef Win32 */
/* ========================================================================================
* OSX support
* ======================================================================================== */
#include "os/macosx/macos.h"
FT_Error GetFontByFaceName(const char *font_name, FT_Face *face)
{
FT_Error err = FT_Err_Cannot_Open_Resource;
/* Get font reference from name. */
CFStringRef name = CFStringCreateWithCString(kCFAllocatorDefault, font_name, kCFStringEncodingUTF8);
ATSFontRef font = ATSFontFindFromName(name, kATSOptionFlagsDefault);
CFRelease(name);
if (font == kInvalidFont) return err;
/* Get a file system reference for the font. */
FSRef ref;
OSStatus os_err = -1;
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
if (MacOSVersionIsAtLeast(10, 5, 0)) {
os_err = ATSFontGetFileReference(font, &ref);
} else
#endif
{
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) && !__LP64__
/* This type was introduced with the 10.5 SDK. */
#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5)
#define ATSFSSpec FSSpec
#endif
FSSpec spec;
os_err = ATSFontGetFileSpecification(font, (ATSFSSpec *)&spec);
if (os_err == noErr) os_err = FSpMakeFSRef(&spec, &ref);
#endif
}
if (os_err == noErr) {
/* Get unix path for file. */
UInt8 file_path[PATH_MAX];
if (FSRefMakePath(&ref, file_path, sizeof(file_path)) == noErr) {
DEBUG(freetype, 3, "Font path for %s: %s", font_name, file_path);
err = FT_New_Face(_library, (const char *)file_path, 0, face);
}
}
return err;
}
bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid, MissingGlyphSearcher *callback)
{
bool result = false;
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
if (MacOSVersionIsAtLeast(10, 5, 0)) {
/* Determine fallback font using CoreText. This uses the language isocode
* to find a suitable font. CoreText is available from 10.5 onwards. */
char lang[16];
if (strcmp(language_isocode, "zh_TW") == 0) {
/* Traditional Chinese */
strecpy(lang, "zh-Hant", lastof(lang));
} else if (strcmp(language_isocode, "zh_CN") == 0) {
/* Simplified Chinese */
strecpy(lang, "zh-Hans", lastof(lang));
} else {
/* Just copy the first part of the isocode. */
strecpy(lang, language_isocode, lastof(lang));
char *sep = strchr(lang, '_');
if (sep != NULL) *sep = '\0';
}
/* Create a font descriptor matching the wanted language and latin (english) glyphs. */
CFStringRef lang_codes[2];
lang_codes[0] = CFStringCreateWithCString(kCFAllocatorDefault, lang, kCFStringEncodingUTF8);
lang_codes[1] = CFSTR("en");
CFArrayRef lang_arr = CFArrayCreate(kCFAllocatorDefault, (const void **)lang_codes, lengthof(lang_codes), &kCFTypeArrayCallBacks);
CFDictionaryRef lang_attribs = CFDictionaryCreate(kCFAllocatorDefault, (const void**)&kCTFontLanguagesAttribute, (const void **)&lang_arr, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
CTFontDescriptorRef lang_desc = CTFontDescriptorCreateWithAttributes(lang_attribs);
CFRelease(lang_arr);
CFRelease(lang_attribs);
CFRelease(lang_codes[0]);
/* Get array of all font descriptors for the wanted language. */
CFSetRef mandatory_attribs = CFSetCreate(kCFAllocatorDefault, (const void **)&kCTFontLanguagesAttribute, 1, &kCFTypeSetCallBacks);
CFArrayRef descs = CTFontDescriptorCreateMatchingFontDescriptors(lang_desc, mandatory_attribs);
CFRelease(mandatory_attribs);
CFRelease(lang_desc);
for (CFIndex i = 0; descs != NULL && i < CFArrayGetCount(descs); i++) {
CTFontDescriptorRef font = (CTFontDescriptorRef)CFArrayGetValueAtIndex(descs, i);
/* Get font traits. */
CFDictionaryRef traits = (CFDictionaryRef)CTFontDescriptorCopyAttribute(font, kCTFontTraitsAttribute);
CTFontSymbolicTraits symbolic_traits;
CFNumberGetValue((CFNumberRef)CFDictionaryGetValue(traits, kCTFontSymbolicTrait), kCFNumberIntType, &symbolic_traits);
CFRelease(traits);
/* Skip symbol fonts and vertical fonts. */
if ((symbolic_traits & kCTFontClassMaskTrait) == (CTFontStylisticClass)kCTFontSymbolicClass || (symbolic_traits & kCTFontVerticalTrait)) continue;
/* Skip bold fonts (especially Arial Bold, which looks worse than regular Arial). */
if (symbolic_traits & kCTFontBoldTrait) continue;
/* Select monospaced fonts if asked for. */
if (((symbolic_traits & kCTFontMonoSpaceTrait) == kCTFontMonoSpaceTrait) != callback->Monospace()) continue;
/* Get font name. */
char name[128];
CFStringRef font_name = (CFStringRef)CTFontDescriptorCopyAttribute(font, kCTFontDisplayNameAttribute);
CFStringGetCString(font_name, name, lengthof(name), kCFStringEncodingUTF8);
CFRelease(font_name);
/* There are some special fonts starting with an '.' and the last
* resort font that aren't usable. Skip them. */
if (name[0] == '.' || strncmp(name, "LastResort", 10) == 0) continue;
/* Save result. */
callback->SetFontNames(settings, name);
if (!callback->FindMissingGlyphs(NULL)) {
DEBUG(freetype, 2, "CT-Font for %s: %s", language_isocode, name);
result = true;
break;
}
}
if (descs != NULL) CFRelease(descs);
} else
#endif
{
/* Create a font iterator and iterate over all fonts that
* are available to the application. */
ATSFontIterator itr;
ATSFontRef font;
ATSFontIteratorCreate(kATSFontContextLocal, NULL, NULL, kATSOptionFlagsDefaultScope, &itr);
while (!result && ATSFontIteratorNext(itr, &font) == noErr) {
/* Get font name. */
char name[128];
CFStringRef font_name;
ATSFontGetName(font, kATSOptionFlagsDefault, &font_name);
CFStringGetCString(font_name, name, lengthof(name), kCFStringEncodingUTF8);
bool monospace = IsMonospaceFont(font_name);
CFRelease(font_name);
/* Select monospaced fonts if asked for. */
if (monospace != callback->Monospace()) continue;
/* We only want the base font and not bold or italic variants. */
if (strstr(name, "Italic") != NULL || strstr(name, "Bold")) continue;
/* Skip some inappropriate or ugly looking fonts that have better alternatives. */
if (name[0] == '.' || strncmp(name, "Apple Symbols", 13) == 0 || strncmp(name, "LastResort", 10) == 0) continue;
/* Save result. */
callback->SetFontNames(settings, name);
if (!callback->FindMissingGlyphs(NULL)) {
DEBUG(freetype, 2, "ATS-Font for %s: %s", language_isocode, name);
result = true;
break;
}
}
ATSFontIteratorRelease(&itr);
}
if (!result) {
/* For some OS versions, the font 'Arial Unicode MS' does not report all languages it
* supports. If we didn't find any other font, just try it, maybe we get lucky. */
callback->SetFontNames(settings, "Arial Unicode MS");
result = !callback->FindMissingGlyphs(NULL);
}
callback->FindMissingGlyphs(NULL);
return result;
}
#elif defined(WITH_FONTCONFIG) /* end ifdef __APPLE__ */
#include <fontconfig/fontconfig.h>
/* ========================================================================================
* FontConfig (unix) support
* ======================================================================================== */
FT_Error GetFontByFaceName(const char *font_name, FT_Face *face)
{
FT_Error err = FT_Err_Cannot_Open_Resource;
if (!FcInit()) {
ShowInfoF("Unable to load font configuration");
} else {
FcPattern *match;
FcPattern *pat;
FcFontSet *fs;
FcResult result;
char *font_style;
char *font_family;
/* Split & strip the font's style */
font_family = strdup(font_name);
font_style = strchr(font_family, ',');
if (font_style != NULL) {
font_style[0] = '\0';
font_style++;
while (*font_style == ' ' || *font_style == '\t') font_style++;
}
/* Resolve the name and populate the information structure */
pat = FcNameParse((FcChar8*)font_family);
if (font_style != NULL) FcPatternAddString(pat, FC_STYLE, (FcChar8*)font_style);
FcConfigSubstitute(0, pat, FcMatchPattern);
FcDefaultSubstitute(pat);
fs = FcFontSetCreate();
match = FcFontMatch(0, pat, &result);
if (fs != NULL && match != NULL) {
int i;
FcChar8 *family;
FcChar8 *style;
FcChar8 *file;
FcFontSetAdd(fs, match);
for (i = 0; err != FT_Err_Ok && i < fs->nfont; i++) {
/* Try the new filename */
if (FcPatternGetString(fs->fonts[i], FC_FILE, 0, &file) == FcResultMatch &&
FcPatternGetString(fs->fonts[i], FC_FAMILY, 0, &family) == FcResultMatch &&
FcPatternGetString(fs->fonts[i], FC_STYLE, 0, &style) == FcResultMatch) {
/* The correct style? */
if (font_style != NULL && strcasecmp(font_style, (char*)style) != 0) continue;
/* Font config takes the best shot, which, if the family name is spelled
* wrongly a 'random' font, so check whether the family name is the
* same as the supplied name */
if (strcasecmp(font_family, (char*)family) == 0) {
err = FT_New_Face(_library, (char *)file, 0, face);
}
}
}
}
free(font_family);
FcPatternDestroy(pat);
FcFontSetDestroy(fs);
FcFini();
}
return err;
}
bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid, MissingGlyphSearcher *callback)
{
if (!FcInit()) return false;
bool ret = false;
/* Fontconfig doesn't handle full language isocodes, only the part
* before the _ of e.g. en_GB is used, so "remove" everything after
* the _. */
char lang[16];
seprintf(lang, lastof(lang), ":lang=%s", language_isocode);
char *split = strchr(lang, '_');
if (split != NULL) *split = '\0';
/* First create a pattern to match the wanted language. */
FcPattern *pat = FcNameParse((FcChar8*)lang);
/* We only want to know the filename. */
FcObjectSet *os = FcObjectSetBuild(FC_FILE, FC_SPACING, FC_SLANT, FC_WEIGHT, NULL);
/* Get the list of filenames matching the wanted language. */
FcFontSet *fs = FcFontList(NULL, pat, os);
/* We don't need these anymore. */
FcObjectSetDestroy(os);
FcPatternDestroy(pat);
if (fs != NULL) {
int best_weight = -1;
const char *best_font = NULL;
for (int i = 0; i < fs->nfont; i++) {
FcPattern *font = fs->fonts[i];
FcChar8 *file = NULL;
FcResult res = FcPatternGetString(font, FC_FILE, 0, &file);
if (res != FcResultMatch || file == NULL) {
continue;
}
/* Get a font with the right spacing .*/
int value = 0;
FcPatternGetInteger(font, FC_SPACING, 0, &value);
if (callback->Monospace() != (value == FC_MONO) && value != FC_DUAL) continue;
/* Do not use those that explicitly say they're slanted. */
FcPatternGetInteger(font, FC_SLANT, 0, &value);
if (value != 0) continue;
/* We want the fatter font as they look better at small sizes. */
FcPatternGetInteger(font, FC_WEIGHT, 0, &value);
if (value <= best_weight) continue;
callback->SetFontNames(settings, (const char*)file);
bool missing = callback->FindMissingGlyphs(NULL);
DEBUG(freetype, 1, "Font \"%s\" misses%s glyphs", file, missing ? "" : " no");
if (!missing) {
best_weight = value;
best_font = (const char *)file;
}
}
if (best_font != NULL) {
ret = true;
callback->SetFontNames(settings, best_font);
InitFreeType(callback->Monospace());
}
/* Clean up the list of filenames. */
FcFontSetDestroy(fs);
}
FcFini();
return ret;
}
#else /* without WITH_FONTCONFIG */
FT_Error GetFontByFaceName(const char *font_name, FT_Face *face) {return FT_Err_Cannot_Open_Resource;}
bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid, MissingGlyphSearcher *callback) { return false; }
#endif /* WITH_FONTCONFIG */
#endif /* WITH_FREETYPE */

View File

@@ -1,44 +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 <http://www.gnu.org/licenses/>.
*/
/** @file fontdetection.h Functions related to detecting/finding the right font. */
#ifndef FONTDETECTION_H
#define FONTDETECTION_H
#include "fontcache.h"
#ifdef WITH_FREETYPE
#include <ft2build.h>
#include FT_FREETYPE_H
/**
* Load a freetype font face with the given font name.
* @param font_name The name of the font to load.
* @param face The face that has been found.
* @return The error we encountered.
*/
FT_Error GetFontByFaceName(const char *font_name, FT_Face *face);
/**
* We would like to have a fallback font as the current one
* doesn't contain all characters we need.
* This function must set all fonts of settings.
* @param settings the settings to overwrite the fontname of.
* @param language_isocode the language, e.g. en_GB.
* @param winlangid the language ID windows style.
* @param callback The function to call to check for missing glyphs.
* @return true if a font has been set, false otherwise.
*/
bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid, class MissingGlyphSearcher *callback);
#endif /* WITH_FREETYPE */
#endif

View File

@@ -71,8 +71,6 @@
GameInfo *info = config->GetInfo();
if (info == NULL) return;
config->AnchorUnchangeableSettings();
Backup<CompanyByte> cur_company(_current_company, FILE_LINE);
cur_company.Change(OWNER_DEITY);

View File

@@ -60,11 +60,18 @@ void NORETURN CDECL strgen_fatal(const char *s, ...)
/**
* Create a new container for language strings.
* @param language The language name.
* @param end If not NULL, terminate \a language at this position.
*/
LanguageStrings::LanguageStrings(const char *language, const char *end)
LanguageStrings::LanguageStrings(const char *language)
{
this->language = end == NULL ? strdup(language) : strndup(language, end - language);
const char *p = strrchr(language, PATHSEPCHAR);
if (p == NULL) {
p = language;
} else {
p++;
}
const char *e = strchr(p, '.');
this->language = e == NULL ? strdup(p) : strndup(p, e - p);
}
/** Free everything. */
@@ -88,17 +95,7 @@ LanguageStrings *ReadRawLanguageStrings(const char *file)
return NULL;
}
const char *langname = strrchr(file, PATHSEPCHAR);
if (langname == NULL) {
langname = file;
} else {
langname++;
}
/* Check for invalid empty filename */
if (*langname == '.' || *langname == 0) return NULL;
ret = new LanguageStrings(langname, strchr(langname, '.'));
ret = new LanguageStrings(file);
char buffer[2048];
while (to_read != 0 && fgets(buffer, sizeof(buffer), fh) != NULL) {

View File

@@ -26,7 +26,7 @@ struct LanguageStrings {
const char *language; ///< Name of the language (base filename).
StringList lines; ///< The lines of the file to pass into the parser/encoder.
LanguageStrings(const char *language, const char *end = NULL);
LanguageStrings(const char *language);
~LanguageStrings();
};

File diff suppressed because it is too large Load Diff

View File

@@ -44,7 +44,6 @@
#include "gfx_type.h"
#include "strings_type.h"
#include "string_type.h"
void GameLoop();
@@ -70,8 +69,7 @@ extern Dimension _resolutions[32];
extern Dimension _cur_resolution;
extern Palette _cur_palette; ///< Current palette
void HandleKeypress(uint keycode, WChar key);
void HandleTextInput(const char *str, bool marked = false, const char *caret = NULL, const char *insert_location = NULL, const char *replacement_end = NULL);
void HandleKeypress(uint32 key);
void HandleCtrlChanged();
void HandleMouseEvents();
void CSleep(int milliseconds);
@@ -107,6 +105,7 @@ enum StringAlignment {
SA_CENTER = SA_HOR_CENTER | SA_VERT_CENTER, ///< Center both horizontally and vertically.
SA_FORCE = 1 << 4, ///< Force the alignment, i.e. don't swap for RTL languages.
SA_STRIP = 1 << 5, ///< Strip the SETX/SETXY commands from the string
};
DECLARE_ENUM_AS_BIT_SET(StringAlignment)
@@ -123,13 +122,11 @@ void DrawBox(int x, int y, int dx1, int dy1, int dx2, int dy2, int dx3, int dy3)
Dimension GetStringBoundingBox(const char *str, FontSize start_fontsize = FS_NORMAL);
Dimension GetStringBoundingBox(StringID strid);
uint32 FormatStringLinebreaks(char *str, const char *last, int maxw, FontSize start_fontsize = FS_NORMAL);
int GetStringHeight(StringID str, int maxw);
int GetStringLineCount(StringID str, int maxw);
Dimension GetStringMultiLineBoundingBox(StringID str, const Dimension &suggestion);
Dimension GetStringMultiLineBoundingBox(const char *str, const Dimension &suggestion);
void LoadStringWidthTable(bool monospace = false);
Point GetCharPosInString(const char *str, const char *ch, FontSize start_fontsize = FS_NORMAL);
const char *GetCharAtPosition(const char *str, int x, FontSize start_fontsize = FS_NORMAL);
void DrawDirtyBlocks();
void SetDirtyBlocks(int left, int top, int right, int bottom);
@@ -153,9 +150,18 @@ bool ToggleFullScreen(bool fs);
/* gfx.cpp */
byte GetCharacterWidth(FontSize size, uint32 key);
byte GetDigitWidth(FontSize size = FS_NORMAL);
void GetBroadestDigit(uint *front, uint *next, FontSize size = FS_NORMAL);
int GetCharacterHeight(FontSize size);
/**
* Get height of a character for a given font size.
* @param size Font size to get height of
* @return Height of characters in the given font (pixels)
*/
static inline byte GetCharacterHeight(FontSize size)
{
assert(size < FS_END);
extern int _font_height[FS_END];
return _font_height[size];
}
/** Height of characters in the small (#FS_SMALL) font. */
#define FONT_HEIGHT_SMALL (GetCharacterHeight(FS_SMALL))

View File

@@ -1,850 +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 <http://www.gnu.org/licenses/>.
*/
/** @file gfx_layout.cpp Handling of laying out text. */
#include "stdafx.h"
#include "gfx_layout.h"
#include "string_func.h"
#include "strings_func.h"
#include "debug.h"
#include "table/control_codes.h"
#ifdef WITH_ICU
#include <unicode/ustring.h>
#endif /* WITH_ICU */
/** Cache of ParagraphLayout lines. */
Layouter::LineCache *Layouter::linecache;
/** Cache of Font instances. */
Layouter::FontColourMap Layouter::fonts[FS_END];
/**
* Construct a new font.
* @param size The font size to use for this font.
* @param colour The colour to draw this font in.
*/
Font::Font(FontSize size, TextColour colour) :
fc(FontCache::Get(size)), colour(colour)
{
assert(size < FS_END);
}
#ifdef WITH_ICU
/* Implementation details of LEFontInstance */
le_int32 Font::getUnitsPerEM() const
{
return this->fc->GetUnitsPerEM();
}
le_int32 Font::getAscent() const
{
return this->fc->GetAscender();
}
le_int32 Font::getDescent() const
{
return -this->fc->GetDescender();
}
le_int32 Font::getLeading() const
{
return this->fc->GetHeight();
}
float Font::getXPixelsPerEm() const
{
return (float)this->fc->GetHeight();
}
float Font::getYPixelsPerEm() const
{
return (float)this->fc->GetHeight();
}
float Font::getScaleFactorX() const
{
return 1.0f;
}
float Font::getScaleFactorY() const
{
return 1.0f;
}
const void *Font::getFontTable(LETag tableTag) const
{
size_t length;
return this->getFontTable(tableTag, length);
}
const void *Font::getFontTable(LETag tableTag, size_t &length) const
{
return this->fc->GetFontTable(tableTag, length);
}
LEGlyphID Font::mapCharToGlyph(LEUnicode32 ch) const
{
if (IsTextDirectionChar(ch)) return 0;
return this->fc->MapCharToGlyph(ch);
}
void Font::getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const
{
advance.fX = glyph == 0xFFFF ? 0 : this->fc->GetGlyphWidth(glyph);
advance.fY = 0;
}
le_bool Font::getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const
{
return FALSE;
}
static size_t AppendToBuffer(UChar *buff, const UChar *buffer_last, WChar c)
{
/* Transform from UTF-32 to internal ICU format of UTF-16. */
int32 length = 0;
UErrorCode err = U_ZERO_ERROR;
u_strFromUTF32(buff, buffer_last - buff, &length, (UChar32*)&c, 1, &err);
return length;
}
/**
* Wrapper for doing layouts with ICU.
*/
class ICUParagraphLayout : public AutoDeleteSmallVector<ParagraphLayouter::Line *, 4>, public ParagraphLayouter {
ParagraphLayout *p; ///< The actual ICU paragraph layout.
public:
/** Helper for GetLayouter, to get the right type. */
typedef UChar CharType;
/** Helper for GetLayouter, to get whether the layouter supports RTL. */
static const bool SUPPORTS_RTL = true;
/** Visual run contains data about the bit of text with the same font. */
class ICUVisualRun : public ParagraphLayouter::VisualRun {
const ParagraphLayout::VisualRun *vr; ///< The actual ICU vr.
public:
ICUVisualRun(const ParagraphLayout::VisualRun *vr) : vr(vr) { }
const Font *GetFont() const { return (const Font*)vr->getFont(); }
int GetGlyphCount() const { return vr->getGlyphCount(); }
const GlyphID *GetGlyphs() const { return vr->getGlyphs(); }
const float *GetPositions() const { return vr->getPositions(); }
int GetLeading() const { return vr->getLeading(); }
const int *GetGlyphToCharMap() const { return vr->getGlyphToCharMap(); }
};
/** A single line worth of VisualRuns. */
class ICULine : public AutoDeleteSmallVector<ICUVisualRun *, 4>, public ParagraphLayouter::Line {
ParagraphLayout::Line *l; ///< The actual ICU line.
public:
ICULine(ParagraphLayout::Line *l) : l(l)
{
for (int i = 0; i < l->countRuns(); i++) {
*this->Append() = new ICUVisualRun(l->getVisualRun(i));
}
}
~ICULine() { delete l; }
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); }
int GetInternalCharLength(WChar c) const
{
/* ICU uses UTF-16 internally which means we need to account for surrogate pairs. */
return Utf8CharLen(c) < 4 ? 1 : 2;
}
};
ICUParagraphLayout(ParagraphLayout *p) : p(p) { }
~ICUParagraphLayout() { delete p; }
void Reflow() { p->reflow(); }
ParagraphLayouter::Line *NextLine(int max_width)
{
ParagraphLayout::Line *l = p->nextLine(max_width);
return l == NULL ? NULL : new ICULine(l);
}
};
static ParagraphLayouter *GetParagraphLayout(UChar *buff, UChar *buff_end, FontMap &fontMapping)
{
int32 length = buff_end - buff;
if (length == 0) {
/* ICU's ParagraphLayout cannot handle empty strings, so fake one. */
buff[0] = ' ';
length = 1;
fontMapping.End()[-1].first++;
}
/* Fill ICU's FontRuns with the right data. */
FontRuns runs(fontMapping.Length());
for (FontMap::iterator iter = fontMapping.Begin(); iter != fontMapping.End(); iter++) {
runs.add(iter->second, iter->first);
}
LEErrorCode status = LE_NO_ERROR;
/* ParagraphLayout does not copy "buff", so it must stay valid.
* "runs" is copied according to the ICU source, but the documentation does not specify anything, so this might break somewhen. */
ParagraphLayout *p = new ParagraphLayout(buff, length, &runs, NULL, NULL, NULL, _current_text_dir == TD_RTL ? UBIDI_DEFAULT_RTL : UBIDI_DEFAULT_LTR, false, status);
if (status != LE_NO_ERROR) {
delete p;
return NULL;
}
return new ICUParagraphLayout(p);
}
#endif /* WITH_ICU */
/*** Paragraph layout ***/
/**
* Class handling the splitting of a paragraph of text into lines and
* visual runs.
*
* One constructs this class with the text that needs to be split into
* lines. Then nextLine is called with the maximum width until NULL is
* returned. Each nextLine call creates VisualRuns which contain the
* length of text that are to be drawn with the same font. In other
* words, the result of this class is a list of sub strings with their
* font. The sub strings are then already fully laid out, and only
* need actual drawing.
*
* The positions in a visual run are sequential pairs of X,Y of the
* begin of each of the glyphs plus an extra pair to mark the end.
*
* @note This variant does not handle left-to-right properly. This
* is supported in the one ParagraphLayout coming from ICU.
*/
class FallbackParagraphLayout : public ParagraphLayouter {
public:
/** Helper for GetLayouter, to get the right type. */
typedef WChar CharType;
/** Helper for GetLayouter, to get whether the layouter supports RTL. */
static const bool SUPPORTS_RTL = false;
/** Visual run contains data about the bit of text with the same font. */
class FallbackVisualRun : public ParagraphLayouter::VisualRun {
Font *font; ///< The font used to layout these.
GlyphID *glyphs; ///< The glyphs we're drawing.
float *positions; ///< The positions of the glyphs.
int *glyph_to_char; ///< The char index of the glyphs.
int glyph_count; ///< The number of glyphs.
public:
FallbackVisualRun(Font *font, const WChar *chars, int glyph_count, int x);
~FallbackVisualRun();
const Font *GetFont() const;
int GetGlyphCount() const;
const GlyphID *GetGlyphs() const;
const float *GetPositions() const;
int GetLeading() const;
const int *GetGlyphToCharMap() const;
};
/** A single line worth of VisualRuns. */
class FallbackLine : public AutoDeleteSmallVector<FallbackVisualRun *, 4>, public ParagraphLayouter::Line {
public:
int GetLeading() const;
int GetWidth() const;
int CountRuns() const;
const ParagraphLayouter::VisualRun *GetVisualRun(int run) const;
int GetInternalCharLength(WChar c) const { return 1; }
};
const WChar *buffer_begin; ///< Begin of the buffer.
const WChar *buffer; ///< The current location in the buffer.
FontMap &runs; ///< The fonts we have to use for this paragraph.
FallbackParagraphLayout(WChar *buffer, int length, FontMap &runs);
void Reflow();
const ParagraphLayouter::Line *NextLine(int max_width);
};
/**
* Create the visual run.
* @param font The font to use for this run.
* @param chars The characters to use for this run.
* @param char_count The number of characters in this run.
* @param x The initial x position for this run.
*/
FallbackParagraphLayout::FallbackVisualRun::FallbackVisualRun(Font *font, const WChar *chars, int char_count, int x) :
font(font), glyph_count(char_count)
{
this->glyphs = MallocT<GlyphID>(this->glyph_count);
this->glyph_to_char = MallocT<int>(this->glyph_count);
/* Positions contains the location of the begin of each of the glyphs, and the end of the last one. */
this->positions = MallocT<float>(this->glyph_count * 2 + 2);
this->positions[0] = x;
this->positions[1] = 0;
for (int i = 0; i < this->glyph_count; i++) {
this->glyphs[i] = font->fc->MapCharToGlyph(chars[i]);
this->positions[2 * i + 2] = this->positions[2 * i] + font->fc->GetGlyphWidth(this->glyphs[i]);
this->positions[2 * i + 3] = 0;
this->glyph_to_char[i] = i;
}
}
/** Free all data. */
FallbackParagraphLayout::FallbackVisualRun::~FallbackVisualRun()
{
free(this->positions);
free(this->glyph_to_char);
free(this->glyphs);
}
/**
* Get the font associated with this run.
* @return The font.
*/
const Font *FallbackParagraphLayout::FallbackVisualRun::GetFont() const
{
return this->font;
}
/**
* Get the number of glyhps in this run.
* @return The number of glyphs.
*/
int FallbackParagraphLayout::FallbackVisualRun::GetGlyphCount() const
{
return this->glyph_count;
}
/**
* Get the glyhps of this run.
* @return The glyphs.
*/
const GlyphID *FallbackParagraphLayout::FallbackVisualRun::GetGlyphs() const
{
return this->glyphs;
}
/**
* Get the positions of this run.
* @return The positions.
*/
const float *FallbackParagraphLayout::FallbackVisualRun::GetPositions() const
{
return this->positions;
}
/**
* Get the glyph-to-character map for this visual run.
* @return The glyph-to-character map.
*/
const int *FallbackParagraphLayout::FallbackVisualRun::GetGlyphToCharMap() const
{
return this->glyph_to_char;
}
/**
* Get the height of this font.
* @return The height of the font.
*/
int FallbackParagraphLayout::FallbackVisualRun::GetLeading() const
{
return this->GetFont()->fc->GetHeight();
}
/**
* Get the height of the line.
* @return The maximum height of the line.
*/
int FallbackParagraphLayout::FallbackLine::GetLeading() const
{
int leading = 0;
for (const FallbackVisualRun * const *run = this->Begin(); run != this->End(); run++) {
leading = max(leading, (*run)->GetLeading());
}
return leading;
}
/**
* Get the width of this line.
* @return The width of the line.
*/
int FallbackParagraphLayout::FallbackLine::GetWidth() const
{
if (this->Length() == 0) return 0;
/*
* The last X position of a run contains is the end of that run.
* Since there is no left-to-right support, taking this value of
* the last run gives us the end of the line and thus the width.
*/
const ParagraphLayouter::VisualRun *run = this->GetVisualRun(this->CountRuns() - 1);
return (int)run->GetPositions()[run->GetGlyphCount() * 2];
}
/**
* Get the number of runs in this line.
* @return The number of runs.
*/
int FallbackParagraphLayout::FallbackLine::CountRuns() const
{
return this->Length();
}
/**
* Get a specific visual run.
* @return The visual run.
*/
const ParagraphLayouter::VisualRun *FallbackParagraphLayout::FallbackLine::GetVisualRun(int run) const
{
return *this->Get(run);
}
/**
* Create a new paragraph layouter.
* @param buffer The characters of the paragraph.
* @param length The length of the paragraph.
* @param runs The font mapping of this paragraph.
*/
FallbackParagraphLayout::FallbackParagraphLayout(WChar *buffer, int length, FontMap &runs) : buffer_begin(buffer), buffer(buffer), runs(runs)
{
assert(runs.End()[-1].first == length);
}
/**
* Reset the position to the start of the paragraph.
*/
void FallbackParagraphLayout::Reflow()
{
this->buffer = this->buffer_begin;
}
/**
* Construct a new line with a maximum width.
* @param max_width The maximum width of the string.
* @return A Line, or NULL when at the end of the paragraph.
*/
const ParagraphLayouter::Line *FallbackParagraphLayout::NextLine(int max_width)
{
/* Simple idea:
* - split a line at a newline character, or at a space where we can break a line.
* - split for a visual run whenever a new line happens, or the font changes.
*/
if (this->buffer == NULL) return NULL;
FallbackLine *l = new FallbackLine();
if (*this->buffer == '\0') {
/* Only a newline. */
this->buffer = NULL;
*l->Append() = new FallbackVisualRun(this->runs.Begin()->second, this->buffer, 0, 0);
return l;
}
const WChar *begin = this->buffer;
const WChar *last_space = NULL;
const WChar *last_char = begin;
int width = 0;
int offset = this->buffer - this->buffer_begin;
FontMap::iterator iter = this->runs.Begin();
while (iter->first <= offset) {
iter++;
assert(iter != this->runs.End());
}
const FontCache *fc = iter->second->fc;
const WChar *next_run = this->buffer_begin + iter->first;
for (;;) {
WChar c = *this->buffer;
last_char = this->buffer;
if (c == '\0') {
this->buffer = NULL;
break;
}
if (this->buffer == next_run) {
int w = l->GetWidth();
*l->Append() = new FallbackVisualRun(iter->second, begin, this->buffer - begin, w);
iter++;
assert(iter != this->runs.End());
next_run = this->buffer_begin + iter->first;
begin = this->buffer;
last_space = NULL;
}
if (IsWhitespace(c)) last_space = this->buffer;
if (IsPrintable(c) && !IsTextDirectionChar(c)) {
int char_width = GetCharacterWidth(fc->GetSize(), c);
width += char_width;
if (width > max_width) {
/* The string is longer than maximum width so we need to decide
* what to do with it. */
if (width == char_width) {
/* The character is wider than allowed width; don't know
* what to do with this case... bail out! */
this->buffer = NULL;
return l;
}
if (last_space == NULL) {
/* No space has been found. Just terminate at our current
* location. This usually happens for languages that do not
* require spaces in strings, like Chinese, Japanese and
* Korean. For other languages terminating mid-word might
* not be the best, but terminating the whole string instead
* of continuing the word at the next line is worse. */
last_char = this->buffer;
} else {
/* A space is found; perfect place to terminate */
this->buffer = last_space + 1;
last_char = last_space;
}
break;
}
}
this->buffer++;
}
if (l->Length() == 0 || last_char - begin != 0) {
int w = l->GetWidth();
*l->Append() = new FallbackVisualRun(iter->second, begin, last_char - begin, w);
}
return l;
}
/**
* Appand a wide character to the internal buffer.
* @param buff The buffer to append to.
* @param buffer_last The end of the buffer.
* @param c The character to add.
* @return The number of buffer spaces that were used.
*/
static size_t AppendToBuffer(WChar *buff, const WChar *buffer_last, WChar c)
{
*buff = c;
return 1;
}
/**
* Get the actual ParagraphLayout for the given buffer.
* @param buff The begin of the buffer.
* @param buff_end The location after the last element in the buffer.
* @param fontMapping THe mapping of the fonts.
* @return The ParagraphLayout instance.
*/
static FallbackParagraphLayout *GetParagraphLayout(WChar *buff, WChar *buff_end, FontMap &fontMapping)
{
return new FallbackParagraphLayout(buff, buff_end - buff, fontMapping);
}
/**
* Helper for getting a ParagraphLayouter of the given type.
*
* @note In case no ParagraphLayouter could be constructed, line.layout will be NULL.
* @param line The cache item to store our layouter in.
* @param str The string to create a layouter for.
* @param state The state of the font and color.
* @tparam T The type of layouter we want.
*/
template <typename T>
static inline void GetLayouter(Layouter::LineCacheItem &line, const char *&str, FontState &state)
{
if (line.buffer != NULL) free(line.buffer);
typename T::CharType *buff_begin = MallocT<typename T::CharType>(DRAW_STRING_BUFFER);
const typename T::CharType *buffer_last = buff_begin + DRAW_STRING_BUFFER;
typename T::CharType *buff = buff_begin;
FontMap &fontMapping = line.runs;
Font *f = Layouter::GetFont(state.fontsize, state.cur_colour);
line.buffer = buff_begin;
/*
* Go through the whole string while adding Font instances to the font map
* whenever the font changes, and convert the wide characters into a format
* usable by ParagraphLayout.
*/
for (; buff < buffer_last;) {
WChar c = Utf8Consume(const_cast<const char **>(&str));
if (c == '\0' || c == '\n') {
break;
} else if (c >= SCC_BLUE && c <= SCC_BLACK) {
state.SetColour((TextColour)(c - SCC_BLUE));
} else if (c == SCC_PREVIOUS_COLOUR) { // Revert to the previous colour.
state.SetPreviousColour();
} else if (c == SCC_TINYFONT) {
state.SetFontSize(FS_SMALL);
} else if (c == SCC_BIGFONT) {
state.SetFontSize(FS_LARGE);
} else {
/* Filter out text direction characters that shouldn't be drawn, and
* will not be handled in the fallback non ICU case because they are
* mostly needed for RTL languages which need more ICU support. */
if (!T::SUPPORTS_RTL && IsTextDirectionChar(c)) continue;
buff += AppendToBuffer(buff, buffer_last, c);
continue;
}
if (!fontMapping.Contains(buff - buff_begin)) {
fontMapping.Insert(buff - buff_begin, f);
}
f = Layouter::GetFont(state.fontsize, state.cur_colour);
}
/* Better safe than sorry. */
*buff = '\0';
if (!fontMapping.Contains(buff - buff_begin)) {
fontMapping.Insert(buff - buff_begin, f);
}
line.layout = GetParagraphLayout(buff_begin, buff, fontMapping);
line.state_after = state;
}
/**
* Create a new layouter.
* @param str The string to create the layout for.
* @param maxw The maximum width.
* @param colour The colour of the font.
* @param fontsize The size of font to use.
*/
Layouter::Layouter(const char *str, int maxw, TextColour colour, FontSize fontsize) : string(str)
{
FontState state(colour, fontsize);
WChar c = 0;
do {
/* Scan string for end of line */
const char *lineend = str;
for (;;) {
size_t len = Utf8Decode(&c, lineend);
if (c == '\0' || c == '\n') break;
lineend += len;
}
LineCacheItem& line = GetCachedParagraphLayout(str, lineend - str, state);
if (line.layout != NULL) {
/* Line is in cache */
str = lineend + 1;
state = line.state_after;
line.layout->Reflow();
} else {
/* Line is new, layout it */
#ifdef WITH_ICU
FontState old_state = state;
const char *old_str = str;
GetLayouter<ICUParagraphLayout>(line, str, state);
if (line.layout == NULL) {
static bool warned = false;
if (!warned) {
DEBUG(misc, 0, "ICU layouter bailed on the font. Falling back to the fallback layouter");
warned = true;
}
state = old_state;
str = old_str;
GetLayouter<FallbackParagraphLayout>(line, str, state);
}
#else
GetLayouter<FallbackParagraphLayout>(line, str, state);
#endif
}
/* 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;
}
} while (c != '\0');
}
/**
* Get the boundaries of this paragraph.
* @return The boundaries.
*/
Dimension Layouter::GetBounds()
{
Dimension d = { 0, 0 };
for (const ParagraphLayouter::Line **l = this->Begin(); l != this->End(); l++) {
d.width = max<uint>(d.width, (*l)->GetWidth());
d.height += (*l)->GetLeading();
}
return d;
}
/**
* Get the position of a character in the layout.
* @param ch Character to get the position of.
* @return Upper left corner of the character relative to the start of the string.
* @note Will only work right for single-line strings.
*/
Point Layouter::GetCharPosition(const char *ch) const
{
/* Find the code point index which corresponds to the char
* pointer into our UTF-8 source string. */
size_t index = 0;
const char *str = this->string;
while (str < ch) {
WChar c;
size_t len = Utf8Decode(&c, str);
if (c == '\0' || c == '\n') break;
str += len;
index += (*this->Begin())->GetInternalCharLength(c);
}
if (str == ch) {
/* Valid character. */
const ParagraphLayouter::Line *line = *this->Begin();
/* Pointer to the end-of-string/line marker? Return total line width. */
if (*ch == '\0' || *ch == '\n') {
Point p = { line->GetWidth(), 0 };
return p;
}
/* Scan all runs until we've found our code point index. */
for (int run_index = 0; run_index < line->CountRuns(); run_index++) {
const ParagraphLayouter::VisualRun *run = line->GetVisualRun(run_index);
for (int i = 0; i < run->GetGlyphCount(); i++) {
/* Matching glyph? Return position. */
if ((size_t)run->GetGlyphToCharMap()[i] == index) {
Point p = { (int)run->GetPositions()[i * 2], (int)run->GetPositions()[i * 2 + 1] };
return p;
}
}
}
}
Point p = { 0, 0 };
return p;
}
/**
* Get the character that is at a position.
* @param x Position in the string.
* @return Pointer to the character at the position or NULL if no character is at the position.
*/
const char *Layouter::GetCharAtPosition(int x) const
{
const ParagraphLayouter::Line *line = *this->Begin();;
for (int run_index = 0; run_index < line->CountRuns(); run_index++) {
const ParagraphLayouter::VisualRun *run = line->GetVisualRun(run_index);
for (int i = 0; i < run->GetGlyphCount(); i++) {
/* Not a valid glyph (empty). */
if (run->GetGlyphs()[i] == 0xFFFF) continue;
int begin_x = (int)run->GetPositions()[i * 2];
int end_x = (int)run->GetPositions()[i * 2 + 2];
if (IsInsideMM(x, begin_x, end_x)) {
/* Found our glyph, now convert to UTF-8 string index. */
size_t index = run->GetGlyphToCharMap()[i];
size_t cur_idx = 0;
for (const char *str = this->string; *str != '\0'; ) {
if (cur_idx == index) return str;
WChar c = Utf8Consume(&str);
cur_idx += line->GetInternalCharLength(c);
}
}
}
}
return NULL;
}
/**
* Get a static font instance.
*/
Font *Layouter::GetFont(FontSize size, TextColour colour)
{
FontColourMap::iterator it = fonts[size].Find(colour);
if (it != fonts[size].End()) return it->second;
Font *f = new Font(size, colour);
*fonts[size].Append() = FontColourMap::Pair(colour, f);
return f;
}
/**
* Reset cached font information.
* @param size Font size to reset.
*/
void Layouter::ResetFontCache(FontSize size)
{
for (FontColourMap::iterator it = fonts[size].Begin(); it != fonts[size].End(); ++it) {
delete it->second;
}
fonts[size].Clear();
/* We must reset the linecache since it references the just freed fonts */
ResetLineCache();
}
/**
* Get reference to cache item.
* If the item does not exist yet, it is default constructed.
* @param str Source string of the line (including colour and font size codes).
* @param len Length of \a str in bytes (no termination).
* @param state State of the font at the beginning of the line.
* @return Reference to cache item.
*/
Layouter::LineCacheItem &Layouter::GetCachedParagraphLayout(const char *str, size_t len, const FontState &state)
{
if (linecache == NULL) {
/* Create linecache on first access to avoid trouble with initialisation order of static variables. */
linecache = new LineCache();
}
LineCacheKey key;
key.state_before = state;
key.str.assign(str, len);
return (*linecache)[key];
}
/**
* Clear line cache.
*/
void Layouter::ResetLineCache()
{
if (linecache != NULL) linecache->clear();
}
/**
* Reduce the size of linecache if necessary to prevent infinite growth.
*/
void Layouter::ReduceLineCache()
{
if (linecache != NULL) {
/* TODO LRU cache would be fancy, but not exactly necessary */
if (linecache->size() > 4096) ResetLineCache();
}
}

View File

@@ -1,190 +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 <http://www.gnu.org/licenses/>.
*/
/** @file gfx_layout.h Functions related to laying out the texts. */
#ifndef GFX_LAYOUT_H
#define GFX_LAYOUT_H
#include "fontcache.h"
#include "gfx_func.h"
#include "core/smallmap_type.hpp"
#include <map>
#include <string>
#ifdef WITH_ICU
#include "layout/ParagraphLayout.h"
#define ICU_FONTINSTANCE : public LEFontInstance
#else /* WITH_ICU */
#define ICU_FONTINSTANCE
#endif /* WITH_ICU */
/**
* Text drawing parameters, which can change while drawing a line, but are kept between multiple parts
* of the same text, e.g. on line breaks.
*/
struct FontState {
FontSize fontsize; ///< Current font size.
TextColour cur_colour; ///< Current text colour.
TextColour prev_colour; ///< Text colour from before the last colour switch.
FontState() : fontsize(FS_END), cur_colour(TC_INVALID), prev_colour(TC_INVALID) {}
FontState(TextColour colour, FontSize fontsize) : fontsize(fontsize), cur_colour(colour), prev_colour(colour) {}
/**
* Switch to new colour \a c.
* @param c New colour to use.
*/
inline void SetColour(TextColour c)
{
assert(c >= TC_BLUE && c <= TC_BLACK);
this->prev_colour = this->cur_colour;
this->cur_colour = c;
}
/** Switch to previous colour. */
inline void SetPreviousColour()
{
Swap(this->cur_colour, this->prev_colour);
}
/**
* Switch to using a new font \a f.
* @param f New font to use.
*/
inline void SetFontSize(FontSize f)
{
this->fontsize = f;
}
};
/**
* Container with information about a font.
*/
class Font ICU_FONTINSTANCE {
public:
FontCache *fc; ///< The font we are using.
TextColour colour; ///< The colour this font has to be.
Font(FontSize size, TextColour colour);
#ifdef WITH_ICU
/* Implementation details of LEFontInstance */
le_int32 getUnitsPerEM() const;
le_int32 getAscent() const;
le_int32 getDescent() const;
le_int32 getLeading() const;
float getXPixelsPerEm() const;
float getYPixelsPerEm() const;
float getScaleFactorX() const;
float getScaleFactorY() const;
const void *getFontTable(LETag tableTag) const;
const void *getFontTable(LETag tableTag, size_t &length) const;
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 */
};
/** Mapping from index to font. */
typedef SmallMap<int, Font *> FontMap;
/**
* Interface to glue fallback and normal layouter into one.
*/
class ParagraphLayouter {
public:
virtual ~ParagraphLayouter() {}
/** Visual run contains data about the bit of text with the same font. */
class VisualRun {
public:
virtual ~VisualRun() {}
virtual const Font *GetFont() const = 0;
virtual int GetGlyphCount() const = 0;
virtual const GlyphID *GetGlyphs() const = 0;
virtual const float *GetPositions() const = 0;
virtual int GetLeading() const = 0;
virtual const int *GetGlyphToCharMap() const = 0;
};
/** A single line worth of VisualRuns. */
class Line {
public:
virtual ~Line() {}
virtual int GetLeading() const = 0;
virtual int GetWidth() const = 0;
virtual int CountRuns() const = 0;
virtual const VisualRun *GetVisualRun(int run) const = 0;
virtual int GetInternalCharLength(WChar c) const = 0;
};
virtual void Reflow() = 0;
virtual const Line *NextLine(int max_width) = 0;
};
/**
* The layouter performs all the layout work.
*
* It also accounts for the memory allocations and frees.
*/
class Layouter : public AutoDeleteSmallVector<const ParagraphLayouter::Line *, 4> {
const char *string; ///< Pointer to the original string.
/** Key into the linecache */
struct LineCacheKey {
FontState state_before; ///< Font state at the beginning of the line.
std::string str; ///< Source string of the line (including colour and font size codes).
/** Comparison operator for std::map */
bool operator<(const LineCacheKey &other) const
{
if (this->state_before.fontsize != other.state_before.fontsize) return this->state_before.fontsize < other.state_before.fontsize;
if (this->state_before.cur_colour != other.state_before.cur_colour) return this->state_before.cur_colour < other.state_before.cur_colour;
if (this->state_before.prev_colour != other.state_before.prev_colour) return this->state_before.prev_colour < other.state_before.prev_colour;
return this->str < other.str;
}
};
public:
/** Item in the linecache */
struct LineCacheItem {
/* Stuff that cannot be freed until the ParagraphLayout is freed */
void *buffer; ///< Accessed by both ICU's and our ParagraphLayout::nextLine.
FontMap runs; ///< Accessed by our ParagraphLayout::nextLine.
FontState state_after; ///< Font state after the line.
ParagraphLayouter *layout; ///< Layout of the line.
LineCacheItem() : buffer(NULL), layout(NULL) {}
~LineCacheItem() { delete layout; free(buffer); }
};
private:
typedef std::map<LineCacheKey, LineCacheItem> LineCache;
static LineCache *linecache;
static LineCacheItem &GetCachedParagraphLayout(const char *str, size_t len, const FontState &state);
typedef SmallMap<TextColour, Font *> FontColourMap;
static FontColourMap fonts[FS_END];
public:
static Font *GetFont(FontSize size, TextColour colour);
Layouter(const char *str, int maxw = INT32_MAX, TextColour colour = TC_FROMSTRING, FontSize fontsize = FS_NORMAL);
Dimension GetBounds();
Point GetCharPosition(const char *ch) const;
const char *GetCharAtPosition(int x) const;
static void ResetFontCache(FontSize size);
static void ResetLineCache();
static void ReduceLineCache();
};
#endif /* GFX_LAYOUT_H */

View File

@@ -504,7 +504,7 @@ public:
}
} else {
/* Draw the label under the data point rather than on the grid line. */
SetDParamMaxValue(0, this->x_values_start + this->num_on_x_axis * this->x_values_increment, 0, FS_SMALL);
SetDParamMaxValue(0, this->x_values_start + this->num_on_x_axis * this->x_values_increment);
x_label_width = GetStringBoundingBox(STR_GRAPH_Y_LABEL_NUMBER).width;
}

View File

@@ -182,7 +182,7 @@ 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);
SetDParamMaxValue(0, GroupStatistics::Get(this->vli.company, ALL_GROUP, this->vli.vtype).num_vehicle, 3);
this->column_size[VGC_NUMBER] = GetStringBoundingBox(STR_TINY_COMMA);
this->tiny_step_height = max(this->tiny_step_height, this->column_size[VGC_NUMBER].height);

View File

@@ -172,7 +172,7 @@ void LoadFromHighScore()
i = SP_SAVED_HIGHSCORE_END;
break;
}
str_validate(hs->company, lastof(hs->company), SVS_NONE);
*lastof(hs->company) = '\0';
hs->title = EndGameGetPerformanceTitleFromValue(hs->score);
}
}

View File

@@ -17,14 +17,9 @@
#include "settings_type.h"
struct HighScore {
/**
* The name of the company and president.
* The + 5 is for the comma and space or possibly other characters
* that join the two names in this single string and the '\0'.
*/
char company[(MAX_LENGTH_COMPANY_NAME_CHARS + MAX_LENGTH_PRESIDENT_NAME_CHARS + 5) * MAX_CHAR_LENGTH];
char company[100];
StringID title; ///< NOSAVE, has troubles with changing string-numbers.
uint16 score; ///< The score for this high score. Do NOT change type, will break hs.dat
uint16 score; ///< do NOT change type, will break hs.dat
};
extern HighScore _highscore_table[SP_HIGHSCORE_END][5];

View File

@@ -63,7 +63,7 @@ struct EndGameHighScoreBaseWindow : Window {
delete this;
}
virtual EventState OnKeyPress(WChar key, uint16 keycode)
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
/* All keys are 'handled' by this window but we want to make
* sure that 'quit' still works correctly. Not handling the
@@ -190,8 +190,7 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow {
if (hs[i].company[0] != '\0') {
TextColour colour = (this->rank == i) ? TC_RED : TC_BLACK; // draw new highscore in red
SetDParamStr(0, hs[i].company);
DrawString(pt.x + 71, pt.x + 569, pt.y + 140 + (i * 55), STR_JUST_BIG_RAW_STRING, colour);
DrawString(pt.x + 71, pt.x + 569, pt.y + 140 + (i * 55), hs[i].company, colour);
SetDParam(0, hs[i].title);
SetDParam(1, hs[i].score);
DrawString(pt.x + 71, pt.x + 569, pt.y + 140 + FONT_HEIGHT_LARGE + (i * 55), STR_HIGHSCORE_STATS, colour);

View File

@@ -48,7 +48,8 @@ static const KeycodeNames _keycode_to_name[] = {
{"F11", WKC_F11},
{"F12", WKC_F12},
{"PAUSE", WKC_PAUSE},
{"COMMA", WKC_COMMA},
{"PLUS", (WindowKeyCodes)'+'},
{"COMMA", (WindowKeyCodes)','},
{"NUM_PLUS", WKC_NUM_PLUS},
{"NUM_MINUS", WKC_NUM_MINUS},
{"=", WKC_EQUALS},
@@ -294,7 +295,7 @@ void SaveHotkeysToConfig()
SaveLoadHotkeys(true);
}
typedef EventState GlobalHotkeyHandler(WChar, uint16);
typedef EventState GlobalHotkeyHandler(uint16, uint16);
GlobalHotkeyHandler RailToolbarGlobalHotkeys;
GlobalHotkeyHandler DockToolbarGlobalHotkeys;
@@ -323,7 +324,7 @@ GlobalHotkeyHandler *_global_hotkey_handlers_editor[] = {
};
void HandleGlobalHotkeys(WChar key, uint16 keycode)
void HandleGlobalHotkeys(uint16 key, uint16 keycode)
{
if (_game_mode == GM_NORMAL) {
for (uint i = 0; i < lengthof(_global_hotkey_handlers); i++) {

Some files were not shown because too many files have changed in this diff Show More