Commit graph

223 commits

Author SHA1 Message Date
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
Fusxfaranto
a91dd6a356 Implement ICU support for uppercasing, with tests. 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
080330070b Write file index even if there are no files 2018-05-20 18:40:06 +01:00
Hielke Morsink
6c65c3d64d
Merge pull request #6774 from janisozaur/fixes
Various code improvements
2018-05-15 14:38:43 +02:00
Aaron van Geffen
8c3766288b Address clang 6.0 compilation errors. 2018-05-13 23:22:40 +02:00
Ted John
4e86d18dad Support loading images from zip 2018-05-13 12:04:45 +01:00
Aaron van Geffen
15c13137df Add missing include. 2018-05-13 01:11:56 +01:00
Ted John
f212894eb0 Fix clang builds 2018-05-13 01:11:56 +01:00
Ted John
bffbf5857d Refactor image importer out into new class 2018-05-13 01:11:56 +01:00
Ted John
229c50dff9 Add bitmap reading support 2018-05-13 01:11:56 +01:00
Ted John
ac3233b819 Change consumers to use new imaging API 2018-05-13 01:11:56 +01:00
Ted John
766997f15c Develop new imaging code 2018-05-13 01:11:56 +01:00
Ted John
4552f6a405 Move Imaging to core 2018-05-13 01:11:56 +01:00
Hielke Morsink
f9dd981234 Further fixes
- Use `= 0` for initializing types
- Add default values to some structs, instead of zero-initializing their instances with `{}`
- Use `std::make_unique` in Network.cpp
- Remove trivial constructors and destructors
- Improve readability of expression in Vehicle.cpp
2018-05-12 16:58:08 +02:00
Ted John
7075f6ca25 Use correct language for scan-objects 2018-05-11 20:39:00 +01:00
Ted John
35df72e61f Remove use of gCurrentLanguage 2018-05-11 20:39:00 +01:00
Ted John
7dc170ef85 Use shared_ptr for long-life objects
Use unique_ptr and shared_ptr for IContext, IPlatformEnvironment, IUiContext, and IAudioContext.
2018-05-11 20:37:48 +01:00
Michał Janiszewski
0a92e74ced Minor fixes 2018-05-11 15:38:30 +02:00
Michał Janiszewski
d965553cae Fix Android Zip changes 2018-05-09 15:59:05 +02:00
Ted John
2ea857a10e Improve IZipArchive so that it is more C++ 2018-05-06 17:46:45 +01:00
Hielke Morsink
8d10bfb5a1 Add namespace closing comments 2018-05-04 22:54:43 +02:00
ZehMatt
76e54dd5ec Fix dead lock due to uninitialized variables. 2018-04-28 02:38:06 +02:00
ZehMatt
ee53855c62 Use emplace_back with reference as return type. 2018-04-26 21:26:30 +02:00
Ted John
dd58a710ee Make Console::Write functions atomic 2018-04-26 21:26:30 +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
20be1cc0a8 Small refactor and code format 2018-04-26 21:26:30 +02:00
ZehMatt
b9d939b294 Show progress of processed elements instead of pending tasks. 2018-04-26 21:26:30 +02:00
ZehMatt
d77f06c1ee Coding style changes. 2018-04-26 21:26:30 +02:00
ZehMatt
7be1cd3e37 Use std::list and fixed step size. 2018-04-26 21:26:30 +02:00
ZehMatt
b9e0eede44 Code cleanup 2018-04-26 21:26:30 +02:00
ZehMatt
64d9109226 Add progress report back. 2018-04-26 21:26:30 +02:00
ZehMatt
bee0fc25b1 Move all code into JobPool.hpp 2018-04-26 21:26:30 +02:00
ZehMatt
ac6b3fb225 Change order of members. 2018-04-26 21:26:30 +02:00
ZehMatt
8c2ac904b4 Add missing vector include. 2018-04-26 21:26:30 +02:00
ZehMatt
6b649e6b29 Remove unused includes. 2018-04-26 21:26:30 +02:00
ZehMatt
dfcec4d9da Refactor file indexing to use the job pool instead of threads. 2018-04-26 21:26:30 +02:00
ZehMatt
254aedefd4 Add generic job pool implementation. 2018-04-26 21:26:30 +02:00
ZehMatt
e841c5b20b Use multiple threads to generate object index cache. 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
Duncan
0ab3d0955c
Merge pull request #7310 from OpenRCT2/json-objects
Add support for new JSON object format
2018-04-08 10:45:55 +01:00
Michał Janiszewski
b26d484726 Fix remaining headers 2018-03-31 23:48:15 +02:00
Hielke Morsink
a51462b0fd Include necessary files for compiling headers
This commits works towards #7289. It includes files that it depends on, or forward declares types when possible. It may seem like this only increases compilation time, but before this commit they depended on the other includes of the source files that use them.
2018-03-31 23:07:14 +02:00
Ted John
63e9275b60 Protect against unknown ride types 2018-03-30 16:58:12 +01:00
Hielke Morsink
44e893ab53 Fix issue in 'GetExtension' (#7337)
`Path::GetExtension` would iterate over the full path instead of just the filename, meaning a path like `C:\My.docs\file` (note the missing extension in the filename) would return `.docs\file` as the extension.
2018-03-23 07:48:13 +00:00
Michał Janiszewski
67f74119cf Fix missing headers 2018-03-20 00:27:58 +01:00
Michał Janiszewski
3303246b09 Reduce header inclusions 2018-03-20 00:27:58 +01:00
Michał Janiszewski
5c6e28284b Move cstddef out of common.h 2018-03-18 23:29:13 +01:00
Michał Janiszewski
54cc1ebcdf Reduce includes in common.h 2018-03-18 23:29:13 +01:00
Michał Janiszewski
9e1dfffee8 Remove unnecessary checks for __cplusplus 2018-03-14 22:11:30 +01:00
Michał Janiszewski
764520076f
Reduce header inclusion
* Update includes in PlatformEnvironment.cpp

* Update includes in ParkImporter.h

* Update includes of OpenRCT2.h

* Update includes in Intro.h

* Remove unused include from Input.cpp

* Update includes of Imaging.h

* Update includes in Game.h

* Update includes in Editor.h

* Update includes of Context.cpp

* Update includes in Cheats.cpp, CmdlineSprite.cpp

* Update includes of some source files

* Update includes in some cpp files

* Update includes in some cpp files

* Update includes in TextureCache.h

* Fix tests

* Update includes in Font.cpp

* Update includes in LightFX files

* Update some includes

* Fix GCC builds

* Update some includes

* Update some includes

* Update includes in FontsFamilies.*

* Update includes of Console.h

* Improve includes in Window.h

* Improve headers in Viewport.h/Window.h

* Fix MSVC build

* Fix network-less builds

* Reduce inclusion of Map.h
2018-03-13 13:14:02 +01:00
Michał Janiszewski
c4f3643be1 Fix #7246: Android build fails with java.lang.UnsatisfiedLinkError
JNI DETECTED ERROR IN APPLICATION: JNI GetObjectClass called with
pending exception java.lang.UnsatisfiedLinkError: No implementation
found for long website.openrct2.ZipArchive.allocBytes(byte[], int)
(tried Java_website_openrct2_ZipArchive_allocBytes and
Java_website_openrct2_ZipArchive_allocBytes___3BI)
2018-03-11 23:57:50 +01:00
ZehMatt
49d8d37748 Add serialization traits for bool. 2018-03-05 00:17:34 +01:00
Ted John
0f00659c8e Do not show file index error if it doesn't exist 2018-02-11 10:39:15 +00:00
Ted John
142facb8a3
Remove Memory::Duplicate and Memory::DuplicateArray (#7142) 2018-02-07 19:56:46 +00:00
Ted John
fbf0243aa3 Fix #7136: Wrong categorisation of objects
Regression introduced in DuplicateArray when converting CopyArray to memcpy
2018-02-06 18:19:23 +00:00
Ted John
0fc0d16e85 Remove unused String::Substring 2018-02-06 18:19:23 +00:00
Gymnasiast
34a6b5ef92 Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
Gymnasiast
778ba466c5 Remove almost every extern C block 2018-02-05 16:20:15 +01:00
Ted John
0c71855769 Replace Memory::Copy with std::copy 2018-02-04 12:40:24 +00:00
Ted John
bb8b6a3f68 Replace Memory::Move with std::copy 2018-02-04 12:40:24 +00:00
Ted John
7851446a6f Replace Memory::Set with std::fill or similar 2018-02-04 12:35:02 +00:00
Ted John
87cd9f88b3 Rewrite Platform::GetInstallPath 2018-02-02 12:41:26 +00:00
Gymnasiast
6c49d45266 Remove unused textinputbuffer.{c,h} 2018-02-01 12:13:11 +01:00
Ted John
cb720025fa Replace platform_enumerate_directories_begin with FileScanner code
This is isn't a particularly pretty implementation but it is only temporary until we can use std::filesystem.
2018-01-18 11:38:52 +01:00
Ted John
d8b3fb01a7 Fix FileScanner not taking notice of recurse flag 2018-01-18 11:38:52 +01:00
Michał Janiszewski
6a65f791b6 Add const to arguments 2018-01-10 23:58:57 +01:00
Michael Steenbeek
755add6c9a
Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
Michael Steenbeek
6450cce829 Fix compilation on Xcode 2018-01-05 19:58:05 +01:00
Ted John
02c58a6c5a Remove custom base Exception class 2018-01-05 18:11:47 +00:00
Michał Janiszewski
33a94fe1bb Use C++ headers in C++ code 2018-01-04 07:36:54 +01:00
Aaron van Geffen
d768a467b7 Implement std::string variant of TrimStart; add tests.
This also makes String::TrimStart handle all-whitespace strings.
2017-12-25 00:30:21 +01:00
Aaron van Geffen
4bc2ad18c4 Trim ideographic spaces as well. 2017-12-25 00:30:21 +01:00
Aaron van Geffen
6c26009f19 Fix #6097: String::Trim wasn't taking multibyte chars into account.
Extends StringTest with multibyte tests.
NB: ストリング is a katakana transcription of 'string'.
2017-12-25 00:30:21 +01:00
Michael Steenbeek
863a71c984 Fix #6803: Symlinks to directories are not descended by FileScanner 2017-12-19 20:51:35 +01:00
Michael Steenbeek
1a9975d683 Compile util and cheats as C++ 2017-12-14 10:03:21 +01:00
Ted John
dcb92a466d Add new base path for user data and config
Refactor more path resolution to Platform2.cpp
2017-12-01 21:09:45 +00:00
Michał Janiszewski
0a9ee59152 Change format to use 5-wide index 2017-11-25 16:42:12 +01:00
Michał Janiszewski
39bb4bcc41 Report indexing progress 2017-11-25 16:42:12 +01:00
Michael Steenbeek
c95a9e4c9b Fix typo in 'separator' 2017-11-13 16:25:31 +01:00
Christian F. Coors
06afeeda9a Apply some refactoring 2017-11-02 12:22:28 +01:00
Michał Janiszewski
8fd2266bda Refactor includes (#6512)
* Refactor Intent.h inclusion

* Use forward declaration of ITcpSocket

* Remove unused include

* Forward declare rct_ride_entry

* Remove unused headers

* Forward-declare rct_drawpixelinfo

* Remove unused headers

* Lower header include from header to source file

* Reduce included headers

* Reduce includes
2017-10-19 10:01:05 +02:00
Mark van Renswoude
ce73d3a8a5 Fix #6390: Crash when renaming rides in multiplayer 2017-10-14 14:21:06 +02:00
Michał Janiszewski
7dad101f70 Include stdbool.h in Guard.hpp
C only has `bool` type when `stdbool.h` is included.
2017-10-13 08:00:32 +02:00
Michał Janiszewski
b05bdf28fc Fix compilation with older clang
Older clang would expand the macros and spot that clamping unsigned
values to [0, MAX] is a tautological operation and produce an error.

As these are tautological operations, no network version change should
be needed.
2017-10-09 17:34:37 +02:00
vector-of-bool
57a8bbac23 Respect POSIX path separators on Windows (#6356) 2017-10-08 21:28:38 +02:00
Michał Janiszewski
9ff0e22aee Whitespace fixes 2017-10-05 10:42:44 +02:00
ZehMatt
995c0d0a6b Refactor SetParkEntranceFeeAction to use constructor for parameters.
Add RideSetNameAction.
Support of string serialisation.
2017-10-05 10:42:44 +02:00
Michał Janiszewski
6ddac382be Fix copyright dates 2017-10-05 10:42:44 +02:00
ZehMatt
5283804b37 Remove unnecessary type conversation.
Add override attributes.
Changed GameActionResult data storage to union, happy compilers.
2017-10-05 10:42:43 +02:00
ZehMatt
c73665a003 Add deprecation warnings in old game_command functions.
Removed line that didn't belong there.
2017-10-05 10:42:43 +02:00
ZehM4tt
1b2a61c6ba Separated out byte swapping into its own header.
Simplified data serialisation of game actions.
Moved the flags away from parameters.
GameAction base now serialises mandatory data such as flags and player.
Split some functions from network in order to move command processing to the end of tick.
2017-10-05 10:42:43 +02:00
duncanspumpkin
ae24ded8bf Make client work 2017-10-05 10:42:38 +02:00