Commit Graph

415 Commits

Author SHA1 Message Date
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
Michał Janiszewski 5ab9f938a7 Update files missed in the great extern "C" cleanup of 2017 2017-09-28 23:29:16 +02:00
Michał Janiszewski 00fd18809c Move extern "C" {} blocks to headers (#6282) 2017-09-18 17:05:28 +02:00
Ted John 0df10cc41d Log exception messages 2017-08-31 18:02:39 +01:00
Ted John dcb78b18d9 Add HeaderSize to FileIndexHeader to increase rebuild chance when alignment changes 2017-08-31 18:02:39 +01:00
Ted John f2cd0b2f3b Refactor ObjectRepository to use FileIndex 2017-08-30 21:58:43 +01:00
Ted John 8808444562 Refactor TrackDesignRepository to use FileIndex 2017-08-30 21:01:07 +01:00
Ted John a118b09e79 Rebuild index if language has changed 2017-08-30 19:32:28 +01:00
Ted John ed8483f5c3 Time index building and handle bad files 2017-08-30 19:27:25 +01:00
Ted John c5760a22bd Add more logging and comments 2017-08-30 18:57:11 +01:00
Ted John e417d2f8b0 Fix all errors 2017-08-30 18:40:42 +01:00
Ted John 4f3669f279 Start work on new FileIndex base class
[ci skip]
2017-08-29 19:18:13 +01:00
Michał Janiszewski d698ad1100 Convert NULL -> nullptr in C++ 2017-08-15 11:51:56 +02:00
ζeh Matt 7a5f9e8300 Refactored openrct2_assert to not rely on inlining. (#6061) 2017-07-29 20:31:54 +01:00
Oliver Freyermuth 0ec78052d6 Guard: Mark openrct2_assert as static explicitly.
Fixes compilation errors with gcc 4.9.4,
which otherwise requires an explicit declaration before
the definition.
2017-07-28 09:56:49 +02:00
ZehMatt f7b7b18b4a Refactored asserts always calling the function regardless of expression. 2017-07-27 05:12:50 +02:00
Ted John e9519d2d8b Fix #5507: RCT1 path check is case-sensitive on Linux
If the csg path does not exist, find the first file in the directory that matches (case insensitive).
2017-06-30 21:11:35 +01:00
David CARLIER 04ed2d78d2 Fix building on FreeBSD 2017-06-27 08:56:03 +02:00
Brian Callahan e5d305f9e7 Use cstdarg instead of stdarg.h 2017-06-25 23:25:46 +02:00
Brian Callahan fe8f949b3f Add OpenBSD support. 2017-06-25 23:25:46 +02:00
Michael Steenbeek 1f00469b26 Replace free+null with SafeFree, allow freeing NULL
free(NULL) is perfectly fine, no need to check
2017-06-22 12:49:33 +02:00
Michael Steenbeek 9c3a16b6e0 Merge pull request #5611 from OpenRCT2/android
Android
2017-06-19 10:25:18 +02:00
Michał Janiszewski 5077f2d78a Mark Path::Combine template as static 2017-06-15 22:55:33 +02:00
Marijn van der Werf 8766ec37a1 Add Android project 2017-06-15 14:22:15 +02:00
Ted John 7e9f7df7d1 Use standard platform defines 2017-06-12 18:01:51 +01:00
Michał Janiszewski 61d38511bc Expand tabs to spaces
This commit expands tabs to spaces (ts=4) in all the files under src/
and test/.

Until now we had two wildly different code styles with C using tabs and
new C++ using spaces. It is painful to maintain as none of the commonly
used tools support this kind of setup and in reality is needless, as we
can simply convert all the sources to spaces and have opened PRs do the
same, where needed.

Additionally, trailing whitespace has been removed.
2017-06-06 23:46:14 +02:00
Ted John 2d00b1e8aa Use varg template for Path::Combine 2017-06-05 17:46:17 +01:00
Ted John f5a23d77bd Add File::ReadAllLines helper 2017-06-04 00:47:33 +01:00
Ted John cf7f1b7335 Change location of test data 2017-06-04 00:47:33 +01:00
Michał Janiszewski 79d76759bb Fix #5516: Update copyrights for 2017
Not all files were necessarily _changed_, but all were touched, see
https://github.com/OpenRCT2/OpenRCT2/pull/4932
2017-06-01 21:55:10 +02:00
Ted John 3fcd42fe2b Move more window code to UiContext 2017-05-29 22:38:43 +02:00
Ted John 006a76c099 Refactor registration of drawing engines 2017-05-29 22:38:42 +02:00
ceeac f58d711981 Fix memory leak in Path::getDirectory. 2017-05-26 18:21:50 +02:00
Ted John ac2eb8b5da Fix FileStream for macOS 2017-05-04 17:29:05 +01:00
Ted John 0ad94f92e3 Replace Stopwatch with chrono 2017-05-04 17:28:37 +01:00
Ted John 459d79d2f3 Use FILE instead of SDL for FileStream 2017-05-04 17:27:51 +01:00
Ted John 73fb132e41 Replace some SDL functions with our own 2017-05-04 17:27:51 +01:00
camthesaxman 2ac8c9bad3 build the version string at compile time 2017-04-30 06:42:23 +02:00
CraigCraig e0b875398b Tons of spelling fixes (#5413)
[ci skip]
2017-04-30 06:39:24 +02:00
Ted John 0ec43e3611 Improve String::Split and add tests 2017-03-08 19:06:42 +00:00
Ted John 7ccce750a6 Use std::string instead of char * for UriHandler 2017-03-08 19:06:42 +00:00
Ted John 5a850cd155 Add some useful string functions 2017-03-08 19:06:42 +00:00
Ted John 3b341de835 Fix String::Trim and add test 2017-02-24 21:48:06 +00:00
Ted John 8d3bf515ed Fix trim function 2017-02-19 21:33:14 +00:00
Ted John d5ee210797 Begin writing IniReader 2017-02-18 10:17:26 +00:00
Ted John 4ea74ad526 Remove RWops from check_file_paths 2017-02-12 10:40:27 +00:00
Ted John fbe0e2504a Do not use RWops for saving track designs 2017-02-11 12:40:38 +00:00
Ted John 4d16e3e1bd Remove use of RWops from track design 2017-02-11 12:03:03 +00:00
Ted John e649e7ad4a Move creation of version string to Version.cpp 2017-02-09 17:58:19 +00:00
Ted John f59afb8c44 Use constant for assertion message 2017-02-09 17:57:39 +00:00
Ted John 3a4bc87198 Allow control of assertion behaviour
This allows tests to change the behaviour at runtime so that OpenRCT2 aborts instead of showing a message box.
2017-02-09 17:57:39 +00:00
Ted John c379347d59 Use stream for chat log 2017-02-08 22:00:04 +00:00
Ted John ad1634631f Fix MemoryStream::EnsureCapacity 2017-02-08 21:53:37 +00:00
Ted John d124f4fad0 Use streams for network load and save 2017-02-08 18:16:33 +00:00
Ted John 2a11bc97fd Merge pull request #5179 from IntelOrca/refactor/sc-chunk-writer
Use streams for SV6 export
2017-02-08 12:01:38 +00:00
Ted John 629ccec466 Use write extended mode to fix checksum calculation
[ci skip]
2017-02-07 20:14:31 +00:00
Michał Janiszewski 7cb9d10d72 Fix wrong #define checks for DEBUG macro 2017-02-07 21:01:07 +01:00
Ted John 2518362112 Use streams for SV6 export 2017-02-05 15:45:23 +00:00
Ted John 652cad15c4 Refactor memory stream
Clean up a few things.
2017-02-05 02:40:16 +00:00
Ted John fed4c248e3 Remove use of SDL RWOps from title sequence player 2017-02-02 22:00:01 +00:00
Ted John 5d7a712672 Use new S6 importer for title screen and fix issues 2017-02-02 22:00:01 +00:00
Ted John 8998b2ae18 Refactor S6 importer to use IParkImporter interface 2017-02-02 22:00:01 +00:00
Michał Janiszewski 6bd9e3eca8 Make sure various fields are initialised properly 2017-01-27 07:35:48 +01:00
Ted John 0d51bdde3f Fix broken code alignment 2017-01-14 23:40:46 +00:00
Broxzier 60603ae10a Use types from common.h 2017-01-14 12:37:31 +01:00
Michał Janiszewski 0a36af19e4 Mark classes as final to help devirtualisation 2017-01-13 12:12:50 +01:00
Michał Janiszewski 33dcb1a506 Rename types to avoid shadowing 2017-01-13 10:57:00 +01:00
Michał Janiszewski cf670deb10 Add -Wshadow to CMakeLists and fix offenders 2017-01-13 10:02:17 +01:00
Ted John ca9c3cc5ee Fix more warnings, disable others 2017-01-12 13:00:12 +00:00
Michał Janiszewski 171d973e55 Initialise fields of MemoryStream in header
This makes all the constructors use these defaulted values
2017-01-12 09:58:57 +01:00
Ted John e1ace9528d Use std::string for File and FileScanner 2017-01-05 18:19:01 +00:00
Ted John 11477c5869 Refactor more of TrackDesignRepository to std::string 2017-01-05 17:51:31 +00:00
Ted John be035dcdb2 Refactor various methods to use std::string 2017-01-05 13:13:22 +00:00
Ted John 25bc798ff8 Move contents of src into project sub directory 2017-01-04 17:44:12 +00:00