Commit Graph

432 Commits

Author SHA1 Message Date
Michael Steenbeek 9a3e85f4f9 Fix Xcode 2018-01-11 16:29:52 +01:00
Michał Janiszewski f817bf8483 Rename hook.c to Hook.cpp 2018-01-11 16:29:52 +01:00
Michał Janiszewski a2aa8a0fb0 Rename compat.c to Compat.cpp 2018-01-11 16:29:52 +01:00
Michał Janiszewski 13ab77fe30 Rename addresses.c to Addresses.cpp 2018-01-11 16:29:52 +01:00
Michał Janiszewski 6951bf11f2 Rename data.c to Data.cpp 2018-01-11 16:29:52 +01:00
Michael Steenbeek cd5a1ba888 Compile files in world folder as C++ 2018-01-11 13:25:09 +01:00
Michał Janiszewski 5e72d7423a Update testpaint 2018-01-11 09:30:09 +01:00
Michał Janiszewski eba2119a81 Update testpaint 2018-01-11 09:30:09 +01:00
Michał Janiszewski 70505f4fa0 Refactor track_paint to C++ 2018-01-11 09:30:09 +01:00
Michał Janiszewski 82dfde4419 Refactor ride_data to C++ 2018-01-11 09:30:09 +01:00
Michael Steenbeek 6a88d6e04d Move and rename RCT{1,2,12}.h 2018-01-09 13:36:41 +01:00
Ted John f18595a1c1 Refactor viewport.c to C++ 2018-01-07 12:39:58 +01:00
Ted John 630a5065db Refactor colour.c to C++ 2018-01-07 12:39:58 +01:00
Michael Steenbeek 755add6c9a
Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
Ted John 3dcbebcf68 Refactor drawing.c to C++ 2018-01-05 22:57:57 +01:00
Michał Janiszewski c7417e11a4 Use `bool` type for boolean logic 2018-01-04 15:40:52 +01:00
Michael Steenbeek 91589f57c6 Compile map.c as C++ 2018-01-03 20:40:51 +01:00
Hielke Morsink eb4a8924d1 Refactor and clean up footpath-related code
This commit corrects some misused defines, and gave them clearer names.
For example, the slope mask was only useful for surface elements, so now
"SURFACE" is in its name. I also replaced any hard coded values that I
could find and knew their purpose off.
2018-01-03 10:57:37 +01:00
Michael Steenbeek 347ff702d0 Refactor objects 2018-01-03 10:16:51 +01:00
Gymnasiast 23d70a4ac9 Compile ride.c as C++ 2017-12-31 20:43:17 +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 c4f44e5e7a Compile files in paint folder as C++ 2017-12-17 17:24:36 +01:00
Aaron van Geffen 02abdb3709 Change failing test to expect nullptr rather than "". (#6832) 2017-12-16 12:06:22 +00:00
Michael Steenbeek 1a9975d683 Compile util and cheats as C++ 2017-12-14 10:03:21 +01:00
Michael Steenbeek 6dc49d643a Compile files in base dir as C++ 2017-12-13 08:03:48 +01:00
Michael Steenbeek 171271215e Change some ride type names for clarity, fix Americanism 2017-12-08 07:59:44 +01:00
Michael Steenbeek 0ffa2b541a Use more consistent terminology and remove some Americanisms 2017-12-05 10:23:36 +01:00
Michael Steenbeek 60d8865efb Compile game.c and game.h as C++ 2017-12-05 09:10:27 +01:00
Ted John e879df31e8 Fix testpaint code issues 2017-12-04 19:49:12 +00:00
Ted John c30739daff Use rct2_ride 2017-12-04 19:04:07 +00:00
Ted John ec6099f9f4 Name / define RCT2 addresses 2017-12-04 19:04:07 +00:00
Ted John ebf43c2529 Fix testpaint 2017-12-04 19:04:07 +00:00
Michael Steenbeek bf69b2e682 Make terminology use more consistent 2017-11-20 11:20:04 +01:00
Michael Steenbeek 268851aa87 Fix testpaint 2017-11-17 12:54:47 +01:00
Michael Steenbeek 99830ed069 Add track_cable_lift functions to compat.c 2017-11-17 12:54:47 +01:00
Michael Steenbeek a5dee3a0ae Add track_element_[sg]et_type to compat.c 2017-11-17 12:54:47 +01:00
Michael Steenbeek 60d5d5ca1e Cleanup 2017-11-17 12:54:47 +01:00
Michael Steenbeek f448d16707 Add methods for getting and setting track element type 2017-11-17 12:54:47 +01:00
Michael Steenbeek 5a7ace134f Apply changes to Testpaint 2017-11-17 12:54:47 +01:00
Christian F. Coors 06afeeda9a Apply some refactoring 2017-11-02 12:22:28 +01:00
Michael Steenbeek af845beb61 Replace mapElement with tileElement 2017-10-31 19:59:06 +01:00
Michael Steenbeek ce8d9cc71b Rename map_element to tile_element 2017-10-31 19:59:06 +01:00
Michał Janiszewski a70a1bc523 Compile track_data_old as C++ 2017-10-25 23:53:47 +02:00
Michał Janiszewski 90a14205c8 Compile track_data.c as C++ 2017-10-25 23:53:47 +02:00
Ted John a737848e8e Remove old C decoding functions and fix tests 2017-10-22 16:21:13 +02:00
Michał Janiszewski 69914b3078 Mark templates as static 2017-10-19 23:57:30 +02:00
Michael Steenbeek bb01699b7d Compile track.c as C++ 2017-10-17 13:51:47 +02:00
Tomas Dittmann e393ff1f22 Stop using (void*)-1 for invalid pointers 2017-10-15 15:53:16 +02:00
Michael Steenbeek 7f9c25a7a9 Use constant for LOCATION_NULL, split off location stuff to Location.h 2017-10-13 22:23:07 +02:00
Michael Steenbeek 3a9dc3f491 Ensure that get_ride_entry returns NULL on invalid ride entries 2017-10-12 21:07:35 +02:00
Michał Janiszewski e01cd0fd40 Use googletest with google/googletest#1045 2017-10-10 22:26:35 +02:00
Michał Janiszewski 0c92619350 Fix testpaint CMakeLists.txt 2017-10-09 15:24:22 +02:00
Michael Steenbeek 055ecccf36 Clean up more track flags 2017-10-04 17:14:53 +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 3a9cafd2f0 Remove gTrackColours macro (#6266) 2017-09-12 19:48:18 +01:00
Gymnasiast 3891b9874d Fix testpaint 2017-09-12 11:29:43 +02:00
Gymnasiast a28509e24c Split Ride and rct2_ride 2017-09-12 11:16:57 +02:00
Ted John ef84f6283d Fix testpaint 2017-09-03 02:59:14 +01:00
Ted John 43c6f7fda0 Pass paint session to ps functions 2017-09-03 02:27:07 +01:00
Ted John f2b8cf181e Pass paint session to remaining support functions 2017-09-03 01:56:56 +01:00
Ted John 1cc82d1cb5 Pass paint session to tunnel functions 2017-09-03 01:51:59 +01:00
Ted John 2980be0667 Pass paint session to more ps functions 2017-09-02 23:22:19 +01:00
Ted John 6b3f3ddb70 Pass paint session to scenery_paint 2017-09-02 22:44:39 +01:00
Ted John 8456639b47 Pass paint session to entrance_paint 2017-09-02 22:43:45 +01:00
Ted John 1f6f83163a Pass paint session to fence_paint 2017-09-02 22:41:36 +01:00
Ted John 00cde34b39 Pass paint session to scenery_multiple_paint 2017-09-02 22:40:19 +01:00
Ted John 5c8700d054 Pass paint session to banner_paint 2017-09-02 22:38:26 +01:00
Ted John 4c78827c45 Pass paint session to path_paint 2017-09-02 22:31:39 +01:00
Ted John 47521335fa Pass paint session to surface_paint 2017-09-02 22:25:45 +01:00
Ted John 4ea9ac2d07 Fix testpaint 2017-09-02 19:00:54 +01:00
Michał Janiszewski ef5ad36cf5 Build RCT2 tests even when not running them 2017-08-31 11:02:25 +02:00
Richard Jenkins 71e580a58f Refactor game load functions, resolves #6011 2017-08-23 08:04:36 +02:00
Ted John 6b48f4344e Fix #6100: Paths don't connect to exit
Regression from db438a27b7, % does not work on negative numbers.
2017-08-06 00:18:32 +01:00
Michał Janiszewski ede8054726 Make multilaunch retest ride count after some updates 2017-08-02 23:50:49 +02:00
Michał Janiszewski b3b2a1ece2 Improve multilaunch test to delete the load result 2017-08-02 23:50:38 +02:00
Michał Janiszewski 01271f68d8 Call game_load_init() in multilaunch test 2017-08-02 19:39:52 +02:00
Michał Janiszewski c3dd3f193f Extend multilaunch test to perform game_logic_updates 2017-08-02 19:39:52 +02:00
Michael Steenbeek 2f3a30f22b Fix cast to bool in map element functions 2017-08-01 13:42:50 +02:00
Gymnasiast db438a27b7 Use map_element_get_direction in more places, create map_element_get_direction_with_offset() 2017-07-27 21:23:26 +02:00
Michael Steenbeek 46de90df86 Create map_get_water_height() 2017-07-27 17:15:56 +02:00
Michael Steenbeek 41b5e8bbca Remove direct usage of map element track sequence field 2017-07-27 16:19:01 +02:00
Gymnasiast d936b23072 Get and set map element station index via helper functions 2017-07-27 14:13:16 +02:00
Hendrik v. Raven 75275d64b7 add a warning when using system gtest
gtest upstream advices against using a globally installed gtest. Make
sure the user is aware of this.
2017-07-26 11:44:06 +02:00
Hendrik v. Raven 5b3f0454dd reformatting to match if clause
reformat the existing code to match the newly introduced indention level
2017-07-26 11:44:06 +02:00
Hendrik v. Raven 0f111de224 add SYSTEM_GTEST option to use gtest of the system
This adds a new configure option forcing the system to use googletest
installed on the system instead of downloading a version. The default
is still to download googletest.
2017-07-26 11:44:06 +02:00
Hendrik v. Raven cfa20d2117 rename GTEST_INCLUDE_DIR to GTEST_INCLUDE_DIRS
GTEST_INCLUDE_DIRS is the name used by the CMake GTest package. This
is a preparation for the optional usage of a system installed gtest.
2017-07-26 11:44:06 +02:00
Michael Steenbeek 367efa2020 Use remap flags, SPRITE_ID_PALETTE_COLOUR_1 and _2 in many more places 2017-07-20 20:56:29 +02:00
Brian Callahan e7da549920 No -ldl on the BSDs, so make sure only Linux gets it 2017-06-25 23:28:04 +02:00
Ted John f275e5ba9b Remove all platform.h includes from header files
System headers, particularly windows.h polute the namespace too much with macros and unwanted definitions. Do not use them in header files.
2017-06-25 18:59:56 +01:00
Michał Janiszewski 21e65934d6 Change number of launches in multilaunch test to 3
[ci skip]
2017-06-24 09:56:51 +02:00
Michał Janiszewski 6aa4722c22 Add MultiLaunch test 2017-06-24 09:56:51 +02:00
Gymnasiast 4059d9e8a7 Clean up boosters, ride_type_null, max rides per entry, formatting 2017-06-14 16:06:43 +02:00
Ted John 906b71796c Remove testpaint for VS 2017-06-13 12:23:26 +01:00
Ted John 29f0372da8 Reduce SDL2 in headers 2017-06-12 19:56:32 +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
Michał Janiszewski 105f353092 Fix symlink created for ride ratings test 2017-06-05 23:09:43 +02:00
Michał Janiszewski eafd2ac7a7 Add option to force-disable RCT2 tests 2017-06-05 23:08:45 +02:00
Michał Janiszewski c64076e17d Disable ride ratings test on CI 2017-06-05 22:51:57 +02:00
Michał Janiszewski 46e9978262 Create symlink for rides test 2017-06-05 22:46:49 +02:00
Ted John 9a619b3e0a Clean up branch 2017-06-05 17:38:14 +01:00
Ted John 38fb37c84c Enable ride ratings test for cmake 2017-06-04 00:48:45 +01:00
Ted John 0662f1630a Fix ride ratings test to work with new Context flow 2017-06-04 00:48:45 +01:00
Ted John f2524c07b3 Add rating test data 2017-06-04 00:47:34 +01:00
Ted John e9898ba82f Use new rating test data 2017-06-04 00:47:33 +01:00
Ted John 7ca1173bcb Fix warning 2017-06-04 00:47:33 +01:00
Ted John b28fde6ae7 Create test data helpers 2017-06-04 00:47:33 +01:00
Ted John cf7f1b7335 Change location of test data 2017-06-04 00:47:33 +01:00
Ted John d65d31f632 Fix test expectations and describe ride types 2017-06-04 00:47:33 +01:00
Ted John 443e17c8fc Force rating update on each ride before testing 2017-06-04 00:47:33 +01:00
Ted John c5306d72f7 Add ride ratings test 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 00199051c1 Add SDL2 include to test cmake 2017-05-29 22:38:45 +02:00
Ted John 82288f92e6 Add cmake for testpaint 2017-05-29 22:38:44 +02:00
Ted John 1f8f354e49 Update root cmake and enable tests 2017-05-29 22:38:44 +02:00
Ted John 23a314d4ba Convert tabs to spaces for test cmakelists 2017-05-29 22:38:44 +02:00
Gymnasiast d4bb9c38c9 Delete unused file 2017-05-17 22:57:23 +02:00
Gymnasiast 09f0425c2f Unify River Rafts and Splash Boats drawing code 2017-05-17 20:49:07 +02:00
Michael Steenbeek a53b01d5b9 Remove magic numbers and Americanisms 2017-05-08 23:54:38 +02:00
CraigCraig e0b875398b Tons of spelling fixes (#5413)
[ci skip]
2017-04-30 06:39:24 +02:00
Gymnasiast cc92300e3a Load CSG1 booster sprites for the Looping and Corkscrew RC 2017-04-11 22:38:09 +02:00
Ted John 0ec43e3611 Improve String::Split and add tests 2017-03-08 19:06:42 +00:00
Michał Janiszewski 6181d968e8 Add case insensitive test to INI tests 2017-03-06 22:28:33 +01:00
Michał Janiszewski d610ef5447 Remove unnecessary libs from linking to tests
[ci skip]
2017-02-25 00:10:27 +01:00
Michał Janiszewski e39444b592 Add more test cases to StringTest 2017-02-25 00:07:45 +01:00
Michał Janiszewski 62ab0e0e03 Add missing include to IniReaderTest 2017-02-25 00:07:45 +01:00
Ted John f851198645 Fix and format test data 2017-02-24 23:01:06 +00:00
Ted John fe2cb79d18 Use strings for test data in IniReaderTest 2017-02-24 22:57:32 +00:00
Michał Janiszewski 7d0cc83908 Add tests for untrimmed INI 2017-02-24 23:39:01 +01:00
Michał Janiszewski 5f43c37ca0 Add String test to CMake 2017-02-24 23:04:36 +01:00
Michał Janiszewski d41293fa6b Extract common test sources into library 2017-02-24 23:04:20 +01:00
Ted John 3b341de835 Fix String::Trim and add test 2017-02-24 21:48:06 +00:00
Michał Janiszewski 84d69b797b Change type of variable used in test 2017-02-24 20:58:01 +01:00
Michał Janiszewski 58da1cde84 Make IniReader not throw while parsing invalid values 2017-02-24 20:26:49 +01:00
Michał Janiszewski 21827c91ab Extend duplicate INI tests with values 2017-02-24 20:18:30 +01:00
Michał Janiszewski 94f0b39f0f Add tests for duplicate sections 2017-02-24 20:15:15 +01:00
Michał Janiszewski 0a77374899 Move MemoryStreams in INI tests to stack 2017-02-24 19:53:23 +01:00
Michał Janiszewski d23edb0f91 Fix INI tests for Windows' 2-byte newlines 2017-02-24 00:10:04 +01:00
Michał Janiszewski e5d569ac6c Add INI tests to MSVC 2017-02-23 23:38:25 +01:00
Michał Janiszewski 8143be0707 Add IniReader, IniWriter tests 2017-02-23 23:37:22 +01:00
Michał Janiszewski 4f852d1ea5 Fix testpaint target for new config 2017-02-21 07:29:06 +01:00
Ted John 8ba5db0697 Fix build for some configurations 2017-02-20 20:05:59 +00:00
Ted John e649e7ad4a Move creation of version string to Version.cpp 2017-02-09 17:58:19 +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
zaxcav 25e57ca50d Updated code as requested by reviewer.
Removed display of raw cut height value.

Changed display of cut height in METRIC/SI from 1DP to 2DP to display odd raw heights with accurate value.

Changed display of cut height in IMPERIAL to 1DP to display odd raw heights with accurate value.
2017-01-22 21:02:19 +01:00
zaxcav e952c607cc Add definition of gClipHeight to compat.c 2017-01-22 20:41:34 +01:00
Marijn van der Werf 2ffbbe0678 Test vertical tunnels properly 2017-01-17 23:57:53 +01:00
Michał Janiszewski 77a0c141a7 Merge pull request #5044 from janisozaur/ninja
Add BUILD_BYPRODUCTS entries to CMakeLists for googletest
2017-01-16 09:38:58 +01:00