1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00
Commit Graph

78 Commits

Author SHA1 Message Date
Ted John
2b197d0fb2 Fix parsing of shortcuts 2021-02-21 03:14:18 +00:00
Ted John
e5f263a0fc Get new manager showing in window 2021-02-21 03:13:27 +00:00
skdltmxn
c093a50f3f Refactor to use string_view more properly 2021-01-07 01:52:10 +09:00
Ted John
17edaae02b Improve banner formatting fix 2020-11-29 01:19:51 +00:00
Ted John
699103fe86 Fix banner text formatting, import / export 2020-11-28 16:52:19 +00:00
Ted John
dfcd8a4bbc Apply code review comments 2020-11-27 18:54:57 +00:00
Ted John
b6a688e540 Refactor format tokens 2020-11-27 18:54:57 +00:00
Ted John
c6152efa4e Fix scrolling text 2020-11-27 18:54:56 +00:00
Ted John
14377be487 Create new templated format string 2020-11-27 18:54:55 +00:00
Michael Steenbeek
8b27f7cdf8 Implement ToUpper for WinNT 5.1 (#13422) 2020-11-16 08:12:28 -03:00
Hielke Morsink
f0c1ea1d37 Split declarations and definitions to improve compile times when editing (#13332)
* Split FileStream declarations and definitions

* Split JobPool declarations and definitions

* Split StringBuilder declarations and definitions

* Split StringReader declarations and definitions

* Split ZoomLevel declarations and definitions

* Fix missing include in FileClassifier.cpp

* Remove pragma once from source files

* Fix missing include in StringBuilder.h

* Update Xcode project

* Fix compilation of tests

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-11-07 12:42:04 +00:00
Tulio Leao
9d2a9d76d3 Cleanup c-style casts from String.cpp 2020-09-10 21:36:21 +02:00
Matt
30376085cf Include missing headers 2020-08-05 16:29:29 +02:00
Aaron van Geffen
7b5087f057 Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Michael Steenbeek
9ef8d6da42 Convert most remaining C-style casts to C++-style ones (#11867) 2020-06-07 23:18:11 +02:00
Michael Steenbeek
f0bd05cf6d Part of #11158: Remove more C-style casts (#11743) 2020-05-13 21:22:50 -03:00
Michał Janiszewski
2323cc1596 Use named casts instead of old-style casts
Change prepared with clang-tidy and google-readability-casting check
2020-04-22 17:09:29 +02:00
Michał Janiszewski
92e5958ab6 Improve WinNT 5.1/MinGW support (#10869) 2020-03-05 19:35:23 +01:00
Michał Janiszewski
afc92ee15a ifdef-out WinNT 6.0+ APIs (#10198)
Occasionally I need to build a binary compatible with WinNT 5.1, e.g.
when testing out Wine or ReactOS. There are just a few minor changes
required to have a working build, but as they are not part of the
repository, I always end up doing them from scratch. I would like to
upstream them instead so I don't have to recreate them each time, even
if this is not the most common use case.
2019-11-08 23:16:15 +01:00
Ted John
a1d9e52046 Rename ToUtf16 to ToWideChar
This is more correct as wchar_t size can differ, for example Linux typically uses 32 bits for wchar_t where as Windows uses 16 bits.
2019-07-22 23:44:03 +01:00
hokasha2016
6022521118 Fix #7871: String::StartsWith() returns true if source is shorter than match 2019-04-20 18:55:27 +02:00
Aaron van Geffen
2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
ζeh Matt
7d19a5bc77 Refactor memcpy to std::memcpy and memset to std::memset (#8408) 2018-12-15 22:23:31 +01:00
Michael Steenbeek
13c326eb50 Fix part of #7415: Korean scenario descriptions are mangled
OpenRCT2 used to incorrectly write UTF-8 to SV6 names and descriptions. This fixes reading such scenarios. It should also fix the game crashing when attempting to load such a scenario.

What this doesn't do is add support for the encoding that vanilla used for CJK, or add support for creating scenarios with Korean descriptions. That will only be feasible when switching to our own format.
2018-08-13 15:53:44 +02:00
Linus Unnebäck
fd07be587a Remove Math::Clamp in favour of std::clamp 2018-08-12 16:47:12 +01:00
clang-format
d787872cbe Indent preprocessor directives 2018-07-23 16:00:23 +02:00
clang-format
b02dfdbc93 Binpack function arguments together
Previously when the arguments of a function wouldn't fit on a single line, clang-format would put each argument on its own line instead. By enabling the binpack parameter setting, it tried to fit as many on one line as possible instead.

Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:22 +02:00
clang-format
3a4a11f738 clang-format core 2018-07-23 16:00:03 +02:00
Ted John
f728a5074a Fix #7765: Crash when opening ride list window on Windows Vista (#7781)
It has been reported that Windows Vista crashes in LCMapStringEx when
using LOCALE_NAME_INVARIANT even though it is documented as supported.

As a counter measure, use LOCALE_NAME_USER_DEFAULT for the time being.
2018-07-14 08:52:12 +01:00
Michael Steenbeek
1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Michael Steenbeek
ec3a1e575e Replace Math::Min and Max with std variants 2018-06-20 17:11:35 +02:00
Hielke Morsink
0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00
Aaron van Geffen
b836ad050d Rewrite CodePageFromUTF8 as CodePageFromUnicode. 2018-05-22 19:51:34 +02:00
Aaron van Geffen
3fd75906b6 Fix String::ToUtf8 and String::ToUtf16 on Linux.
wchar_t typically uses UTF-32 codepoints on Linux, unlike Windows, which uses UTF-16.
2018-05-22 19:51:34 +02:00
Aaron van Geffen
bab66d1eaf Fix MinGW compilation. 2018-05-22 17:37:07 +02:00
Ted John
71a2cb46d2 Fix ToUpper tests on Windows
LCMapStringEx does not unfold ligatures if there is no uppercase equivalent.
2018-05-22 17:37:07 +02:00
Aaron van Geffen
13e35285f1 Replace non-Windows versions of ToUtf8 and ToUtf16 with ICU calls. 2018-05-22 17:37:07 +02:00
Ted John
6109a9bf17 Improve Windows implementation of ToUpper 2018-05-22 17:37:07 +02:00
Ted John
085d85585a Use Windows API for utf8-utf16 conversions 2018-05-22 17:37:07 +02:00
Aaron van Geffen
8e919d2f84 Change ICU variant of String::ToUpper for string_view argument. 2018-05-22 17:37:07 +02:00
Ted John
386ab1b0fa Add windows implementation for ToUpper 2018-05-22 17:37:07 +02:00
Aaron van Geffen
f29b42cc26 Allow converting strings between code pages in both directions.
Co-authored-by: Fusxfaranto <fusxfaranto@gmail.com>
2018-05-22 17:37:07 +02:00
Aaron van Geffen
ea80f0ea56 Split off GetIcuCodePage to its own function. 2018-05-22 17:37:07 +02:00
Aaron van Geffen
ee8bf9bd4a Use ICU for converting strings to UTF-8 instead of our own tables.
Co-authored-by: Fusxfaranto <fusxfaranto@gmail.com>
2018-05-22 17:37:07 +02:00
Ted John
766997f15c Develop new imaging code 2018-05-13 01:11:56 +01:00
Hielke Morsink
8d10bfb5a1 Add namespace closing comments 2018-05-04 22:54:43 +02:00
Ted John
7da60f4950 Make log functions atomic
Use only one print call to stdout in log functions so that messages are not malformed.
2018-04-26 21:26:30 +02:00
Ted John
947a0625c8 Fix mingw builds 2018-04-18 13:16:20 +02:00
Ted John
deaa60f8f1 Refactor string conversion between RCT2 and UTF8
Use Win32 API for conversion on Windows for non-1252 code pages instead of built-in tables.
2018-04-18 13:16:20 +02:00
Ted John
63e9275b60 Protect against unknown ride types 2018-03-30 16:58:12 +01:00