1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 05:53:02 +01:00
Commit Graph

64 Commits

Author SHA1 Message Date
Daniel Kamil Kozar
1a521c53fb Fix out-of-bounds access in convert_multibyte_charset
convert_multibyte_charset unconditionally assumes that a 0xFF is always
followed by two more bytes. This is not the case with BATFL.DAT, whose
string at offset 0x2D6 (languageId = 0xA) ends with bytes 0xFF, 0xC2,
0x00. Therefore, it seems like 0x00 is used as both the string terminator
and the second byte of a multicharacter sequence in this case.

This commit does not change the original behaviour at all, and prevents
the code from looking for a 0x00 after the string actually ends.
2016-12-28 17:50:03 +00:00
Michał Janiszewski
3aa0eb9bcd Prevent invalid access in malformed objects 2016-12-26 22:42:19 +00:00
Michał Janiszewski
1ae2ca54f7 Sort includes 2016-12-01 16:03:16 +01:00
Michał Janiszewski
afdc1457d5 Move font-related code out from language.cpp 2016-12-01 16:03:16 +01:00
Michał Janiszewski
3f7fd56328 Remove trailing whitespace in sources 2016-11-13 20:32:55 +01:00
Michał Janiszewski
233ef1f735 Merge RCT2_LANGUAGE_* definitions into one 2016-11-13 19:36:03 +01:00
Ted John
7b5858cb92 Fix UTF-8 string literals, add BOM to language.cpp
MSVC requires source files to be in UTF-8 with BOM in order to compile them correctly as UTF-8.
2016-11-08 17:29:46 +00:00
Ted John
941d92dc2a Fix convert_multibyte_charset 2016-11-08 17:02:37 +00:00
Ted John
c506f2730d Reformat language table 2016-11-08 17:02:37 +00:00
Ted John
894899630b Use UTF-8 literal strings 2016-11-08 17:02:37 +00:00
Ted John
3d1e4c10c1 Fix size argument in GetLanguagePath 2016-11-08 17:02:37 +00:00
Ted John
3af07f6e00 Remove unused constant 2016-11-08 17:02:37 +00:00
Ted John
91ef540c25 Fix gcc errors 2016-11-08 17:02:37 +00:00
Ted John
b4e65ace52 Refactor font loading 2016-11-08 17:02:37 +00:00
Ted John
6461b21e09 Use more C++ functions 2016-11-08 17:02:37 +00:00
Ted John
6523081b84 Conform to C++ style 2016-11-08 16:59:46 +00:00
Ted John
216dc64342 Convert tabs to spaces in language.cpp 2016-11-08 16:59:46 +00:00
Michał Janiszewski
b164c2be61 Extract openrct2_assert to guard.h (#4753)
* Extract openrct2_assert to Guard.hpp

`openrct2_assert` is not defined in util.c and including all of
openrct2.h is unnecessary.
2016-11-06 21:02:25 +01:00
LRFLEW
e5ff7412e4 Refactor/Improve String and Path Handling 2016-10-09 15:29:58 -05:00
Ted John
f31bf03ee9 Refactor LanguagePack to interface / implementation
This reduces the required amount of includes and definitions necessary in LanguagePack.h and having to declare private signatures twice.
2016-09-20 12:29:38 +01:00
Ted John
bb348acf57 Remove original string support 2016-09-13 23:27:29 +01:00
Ted John
8cf7e87b5c Fix many warnings for x64 2016-08-27 23:32:15 +01:00
Michał Janiszewski
d9dcf86bd7 Apply RCT2_ADDRESS macro to strings as well 2016-08-07 09:06:55 +02:00
Michał Janiszewski
f8e0d4b25b Add explicit empty string
Needed to properly handle toolbars in 64 bit builds
2016-08-03 20:51:53 +02:00
Michał Janiszewski
a6d0e6916e Fix function definitions to match their declarations
This makes sure every function is properly declared, which includes
proper `extern` wrappers.
2016-07-14 14:11:49 +02:00
Michał Janiszewski
b10b57e9dc add language 8 as a multibyte language 2016-07-09 21:15:02 +01:00
Ted John
78c6b6a251 remove all unnecessary object resets 2016-07-08 22:58:38 +01:00
Ted John
793e83779f handle RCT2 language encoding properly 2016-07-08 22:58:38 +01:00
Ted John
2824224710 use overridden object strings 2016-07-08 22:58:38 +01:00
Ted John
52928e1e08 protect objects against invalid allocation ids 2016-07-08 22:58:38 +01:00
Ted John
7124143b89 do more cleanup of old object code 2016-07-08 22:58:38 +01:00
Ted John
50b7e4222f remove a lot of old object code 2016-07-08 22:58:38 +01:00
Ted John
78e15b1d56 start getting object loading working 2016-07-08 22:58:38 +01:00
Goddesen
b27aa56cff Removed Norwegian ID enum member, replaced spaces with tabs 2016-06-02 00:56:16 +02:00
Goddesen
9aa5958484 Added support for Norwegian (nb-NO) 2016-06-02 00:55:49 +02:00
YJSoft
f5b208d629 Fix font config loaded without proper configuration (#3602) 2016-05-15 10:29:26 +01:00
YJSoft
f330ae478b Add more font config to config.ini (#3582) 2016-05-13 18:23:11 +01:00
Michael Steenbeek
9fac7f38a5 Return failure when encountering unknown lang code, fixes #3524 (#3579) 2016-05-12 20:48:40 +01:00
YJSoft
2f36dbf7e3 Add font config at config.ini (#3569) 2016-05-12 12:47:30 +01:00
janisozaur
68bad6505c Add and correct licence headers to all sources (#3108) 2016-05-04 18:24:41 +01:00
Ted John
1729061df8 use ISO 639-1 for language filenames, closes #2420 (#3431) 2016-04-26 19:52:42 +01:00
Harry Lam
0a65c13e7e Change Japanese Font from msgothic_02.ttf to ms...
gothic.ttc, Fix #3118

In Chinese, there is also a newer MingLiu called "PMingLiu", but it was embedded as a large text pack as ttc. (ttc is a collection file for TrueType Font) And, Windows has **bad** support on TTC, so changing into "msgothic.ttc" should fix the issue.
2016-04-15 21:25:11 +01:00
zsilencer
66e406ab75 Fix #3048: Remove format codes in player names and chat 2016-02-29 21:33:46 -07:00
Alexander Overvoorde
bb71d087b5 Fix objects and their localized string ids not being reloaded after changing language (fixes #2751) 2016-02-11 15:05:23 +01:00
Michał Janiszewski
6d8e048d96 Fall-back to default language in case none is set
From thread https://openrct2.org/forums/topic/720-openrct2-doesnt-work/,
the object http://www.nedesigns.com/rct2-object/5130/scgletrs/ does not
set `pString` properly, so use a default fallback in such case.
2016-01-16 18:39:57 +01:00
IntelOrca
43a5cc92cc define STR_NONE as a rct_string_id 2016-01-07 22:14:53 +00:00
Aaron van Geffen
89a2e32f28 Add Japanese to the list of available languages. 2016-01-02 13:45:21 +09:00
Aaron van Geffen
995799b843 Try Arial as a fallback font if a language's preferred font cannot be loaded. 2015-12-25 03:22:46 +09:00
Aaron van Geffen
a0de23758e Specify font name on all TTF descriptors. 2015-12-25 01:53:52 +09:00
Michał Janiszewski
ea6fa2c82a Let user specify the data dir as cmdline option.
This adds --openrct-data-dir=<str> option to command line letting user
select where he wants OpenRCT2-specific data to be. By default the
search locations are:
* <exePath>/data (on all platforms)
* /var/lib/openrct2 (on Linux)
* /usr/share/openrct2 (on Linux)
2015-12-19 00:06:41 +01:00