Commit Graph

15874 Commits

Author SHA1 Message Date
Ted John 8701286772
Use new ride_id_t typedef (#8561) 2019-01-12 10:11:55 +00:00
OpenRCT2 git bot 746feaaa45 Merge Localisation/master into OpenRCT2/develop. 2019-01-10 04:00:24 +00:00
OpenRCT2 git bot cc9af4ead0 Merge Localisation/master into OpenRCT2/develop. 2019-01-09 04:00:25 +00:00
Michael Steenbeek fdba61002f
Add station index to Tile Inspector 2019-01-08 11:25:12 +01:00
Michał Janiszewski 39b59b1185
Merge pull request #8549 from janisozaur/sdl2-prefix
Drop SDL2/ prefix on includes
2019-01-07 22:32:26 +01:00
Aaron van Geffen 85bc21ce25 Adjust IncludePath for the MSVC project. 2019-01-07 22:08:06 +01:00
ζeh Matt eb4ddebe3e
Merge pull request #8525 from ZehMatt/ga-scenery-remove
Implement scenery remove game actions.
2019-01-07 19:50:40 +01:00
Aaron van Geffen 2427b67374
Fix #8555: Multiplayer window text limits are not computed properly. 2019-01-07 12:17:37 +01:00
Michał Janiszewski 0d2fd33fd8 Bump network version
Co-Authored-By: ZehMatt <m.moninger.h@gmail.com>
2019-01-07 09:04:51 +01:00
Matt 9f613833ce Rename actions. 2019-01-07 09:04:51 +01:00
Matt b01c93ba4c Normalise replays. 2019-01-07 09:04:51 +01:00
IntelOrca b9fd90ffd3 Implement ClearAction. 2019-01-07 09:04:51 +01:00
Matt d7096f71cb Implement SceneryRemoveLargeAction. 2019-01-07 09:04:51 +01:00
Matt b34b09c6bb Implement SceneryRemoveSmallAction. 2019-01-07 09:04:51 +01:00
dchokola d4a3feca29 Introduce DISABLE_GUI for headless build (Fixes OpenRCT2#8542) (#8566) 2019-01-07 06:08:31 +01:00
Michał Janiszewski ecfbf60cc4 Drop SDL2/ prefix on includes
pkg-config, cmake, all demos and tests define the path with SDL2/
already included.
2019-01-06 17:29:29 +01:00
Ted John 0328355f9e Include stdexcept instead of exception (#8559) 2019-01-05 22:12:47 +01:00
Michał Janiszewski 322be796e3
Add -Wextra (#8556)
Oops, no idea how it was missing all this time.

Additionally adds:
* `-Wno-clobbered` (conditionally)
* `-Wno-unused-parameter`
2019-01-05 00:15:06 +01:00
Hielke Morsink 53ae48ffca
Merge pull request #8550 from janisozaur/fallthroughs
Fix implicit fallthroughs
2019-01-04 23:27:02 +01:00
Hielke Morsink 5ef5e4153d Fix some more implicit and conditional fallthroughs 2019-01-04 22:26:56 +01:00
Michał Janiszewski 8a70b29f64
Fix GCC's warning regarding enum vs non-enum values being compared (#8551) 2019-01-04 21:29:44 +01:00
Michał Janiszewski 7e769ed662 Fix #7536: Android build fails to start (#8554)
This was a regression from #7435 which introduced threads and caused JNI
to misbehave and fail to load our expected classes. Provide a workaround
based on the description in https://stackoverflow.com/a/16302771 which
stores a main thread's class loader and uses that in neighbouring
threads.
2019-01-04 19:48:26 +01:00
ζeh Matt 20496b0390
Merge pull request #8545 from richard-fine/use-enum-types
Use of enum types in Peep code
2019-01-04 10:57:56 +01:00
ζeh Matt 069052c685 Fix replays not working in some cases. (#8552) 2019-01-04 10:45:21 +01:00
Richard Fine a30e154388 Handle all enum values in switches
Add 'default' cases to a few enums that were not otherwise handling all possible enum values. This wasn't a problem before because the variables we were switching on were not actually enum types, but now that they are, Clang is warning us about the non-covered cases.
2019-01-03 12:06:47 +00:00
Michael Steenbeek 31298bd772
Merge pull request #8543 from IntelOrca/refactor-ride
Refactor ride structure
2019-01-02 22:38:20 +01:00
Michał Janiszewski c5e1abcfb1 Fix implicit fallthroughs 2019-01-02 22:30:57 +01:00
Michał Janiszewski b7d1d49956
Merge pull request #8548 from janisozaur/memleak-20190102
Plug memory leaks
2019-01-02 21:23:09 +01:00
Ted John d979511628 Do code review suggestions 2019-01-02 19:46:13 +00:00
Michał Janiszewski 37535f4642 Release ImageImporter'd buffer after the test is done 2019-01-02 20:14:28 +01:00
Gymnasiast 7c8144b57d Fix codepoint of interpunct 2019-01-02 20:04:42 +01:00
Michał Janiszewski ca3d9cea91 Add missing free() call in config_release() 2019-01-02 20:02:14 +01:00
Michał Janiszewski 635e46af83 Plug memory leak in ObjectFactory::CreateObjectFromZipFile 2019-01-02 19:57:41 +01:00
Michael Steenbeek b5317ee9e9
Split drawing of path and railing 2019-01-02 19:52:53 +01:00
Michał Janiszewski 0ee1811faa
Merge pull request #8539 from richard-fine/tests/pathfinding
Tests for peep pathfinding
2019-01-02 15:55:20 +01:00
Richard Fine 3089781883 Reformat 2019-01-02 14:40:17 +00:00
Richard Fine cec457fbf1 Reformat 2019-01-02 14:12:51 +00:00
Richard Fine 315ea057fe Verify that peeps stay on paths
As per PR recommendation, confirm that a peep is still on the footpath for every step of the pathfinding tests.
2019-01-02 14:12:51 +00:00
Richard Fine bb4e79ddda Rework tests to use ride entrances as path targets
It turns out that trying to just give a peep a pathfinding goal and then let them loose doesn't work, because every time they reach a junction, the pathfinder has them walk 'aimlessly' instead of pursuing their target. That's why we were seeing some very large step counts in previous tests - they were (eventually) walking onto the target square, but only after lots of wandering around in circles.

This commit reworks the test data to contain an actual ride for each test scenario, where the peep will path to the tile in front of the ride entrance. A nice side benefit of this is that the ride names must match the test names, so you can now tell from looking at the rides in the test data which one is used for which test instance.

The 'yellow marker' tiles for goal positions are also removed here, as we're deriving goal positions from the ride entrances instead.
2019-01-02 14:12:51 +00:00
Richard Fine c8c1abd10a Reformat 2019-01-02 14:12:51 +00:00
Richard Fine a20c8d61be Call core_init instead of bitcount_init 2019-01-02 14:12:51 +00:00
Richard Fine 280a0c61e4 Rename maxSteps to expectedSteps
To make it a little clearer what the parameter is for, rename FindPath::maxSteps to FindPath::expectedSteps, and extend the comment to describe what happens in negative test scenarios.
2019-01-02 14:12:51 +00:00
Richard Fine 357ee293f3 Remove default value for SimplePathfindingScenario steps
Remove the default value as it's more consistent to just always have the test case specify it explicitly.
2019-01-02 14:12:51 +00:00
Richard Fine 49e46f8940 Replace GetSurfaceStyleAtLocation with map_get_surface_element_at
There exists a helper function map_get_surface_element_at which already searches a tile's element list for the surface element, so we can just use that.
2019-01-02 14:12:51 +00:00
Michał Janiszewski f4685f7b94 Add Pathfinding test to CMake 2019-01-02 14:12:51 +00:00
Richard Fine 8fb81a2d89 Initial data-driven tests for pathfinder behaviour
Introduce some basic scenario-style tests for the pathfinding AI. There
are two tests:

* Test that a peep can get from a given start position to a given end
  position, and that it takes them an expected number of ticks to do so.
  Also test that they did not walk on any 'forbidden' tiles in the process,
  e.g. tiles that are completely the wrong direction from the goal etc.

* Test that a peep can *not* get from a given start position to a given
  end position after a given number of ticks.

Each test is parametric, and instantiated for multiple different
start/end positions within the provided test park. If we find a new
situation that needs a test, it should just be a matter of building
that situation in the saved game and then adding a line to the code to
set it up.

Indicating 'forbidden' tiles is done using terrain surface type IDs:
tiles that the pathfinder should never send the peep into should be
painted with the red neon surface type (index 8). This means we have
no way to forbid some path elements on a tile while allowing others,
but we don't need that right now.

Similarly, to help ensure that the test data and code are kept in
sync, the tests also require that peep start tiles are painted with
the green neon surface type (index 11) and that goal tiles are
painted with the yellow neon surface type (index 9).
2019-01-02 14:12:08 +00:00
Richard Fine b845304656 Equality operators for TileCoordsXYZ
Introduce operator == and operator != for TileCoordsXYZ, so that we can more easily operate on them in tests.
2019-01-02 14:11:28 +00:00
Richard Fine 60396c6658 Rename enums to modern style
Change various PEEP_ENUM_TYPE names to PeepEnumType names, to match the more modern coding standard.
2019-01-02 14:10:05 +00:00
ζeh Matt a065806b20
Merge pull request #8374 from ZehMatt/replay-feature
Add support to record and replay game commands/actions.
2019-01-02 09:15:10 +01:00
Matt 045e72e863 Add more replays to test. 2019-01-02 08:30:33 +01:00