Commit Graph

3883 Commits

Author SHA1 Message Date
duncanspumpkin 752df2607a Increment network version 2019-02-05 20:39:53 +00:00
duncanspumpkin 8a69b89df6 Move Staff Set Orders into game action framework.
Split up costume and order game commands
2019-02-05 20:38:18 +00:00
Duncan c436a656ad
Merge pull request #8666 from cgdolan/develop
Implement game action for sign set style
2019-02-05 20:35:11 +00:00
duncanspumpkin 50b241d20d Add missing include and rework to use Coords 2019-02-05 19:27:30 +00:00
Xkeeper 2828cbb2fc
Fix crash in FerrisWheel paint
[OpenRCT2/OpenRCT2#8662]
2019-02-05 11:14:17 -08:00
Xkeeper a22260b56a
Fix crash in MapAnimation re: small scenery
[OpenRCT2/OpenRCT2#8662]
2019-02-05 11:02:22 -08:00
Xkeeper 2bb8813c41
Fix crash in paint_haunted_house_structure
[OpenRCT2/OpenRCT2#8662]
2019-02-05 11:01:23 -08:00
Michał Janiszewski 4192ffe57e
Improve cmake for MSVC (#8581)
* Improve cmake for MSVC

* Fix mingw builds
2019-02-05 16:12:58 +01:00
Christopher G. Dolan 19a58fa5fe Fix format, move validation logic to query, update network version 2019-02-04 17:30:45 -08:00
Michał Janiszewski 8a395e3706
Fix misaligned access (#8665)
Platforms like ARM are very sensitive to unaligned access. This change
makes sure the addresses obey the C++ standard and are properly aligned.
2019-02-04 23:15:14 +01:00
Christopher G. Dolan a8864092c0 fix format and serialize all ivars 2019-02-03 23:02:00 -08:00
Christopher G. Dolan 075983da0f Implement game action for sign set style 2019-02-03 22:20:01 -08:00
Michał Janiszewski 6bdbe248fd
Merge pull request #8641 from tomlankhorst/use-lto
Detect availability of LTO, apply when available
2019-02-04 00:06:37 +01:00
Tom Lankhorst ce6e08c633
Introduce SET_CHECK_CXX_FLAGS 2019-02-03 23:32:51 +01:00
Tom Lankhorst 521948139c Chat toggle button (#8648)
* Add chat_available()

* Add appropriate strings

* Add new Chat icon

* Implement Chat button

* CS

* Fix chat icon

* Make chat icon a bit smaller and less bright

* Update chat icon

* Update changelog
2019-02-03 23:30:34 +01:00
Michał Janiszewski 604da7ce01
Merge pull request #8661 from tomlankhorst/refactor-random
Refactor random engine
2019-02-03 23:29:10 +01:00
Tom Lankhorst 045692993a
Make template params adhere to code style 2019-02-03 21:16:09 +01:00
Tom Lankhorst 422d5f2ef1
Replace '_N' by '_num' 2019-02-01 21:54:00 +01:00
Tom Lankhorst d660c9d45f
Merge branch 'refactor-random' of github.com:tomlankhorst/OpenRCT2 into refactor-random 2019-02-01 21:51:28 +01:00
Tom Lankhorst 1e65db371b
Use single underscore prefix for template parameters 2019-02-01 21:51:01 +01:00
Tom Lankhorst ec8caa5636
Drop <sstream> 2019-02-01 21:47:47 +01:00
Tom Lankhorst dfe7f0614c
Consistency 2019-02-01 21:00:19 +01:00
Tom Lankhorst 16691b22ba
Use state struct 2019-02-01 19:29:43 +01:00
Tom Lankhorst 2ea347f15f
MSVC SFINAE compatibility 2019-02-01 15:50:09 +01:00
Tom Lankhorst 1a81d60609
Expose gScenarioRand, add <algorithm> 2019-02-01 14:48:45 +01:00
Tom Lankhorst 6a42a95495
Refactor random engine
Introduce RotateEngine and Rct2Engine, FixedSeedSequence and Rct2Seed.
Adhere respectively to requirements `RandomNumberEngine` and `SeedSequence`.
Can be used with C++11 adaptors and distributions in <random>.
2019-02-01 14:32:04 +01:00
Michał Janiszewski 57897d4cb5 Attach screenshot to backtrace.io report 2019-01-31 23:36:41 +01:00
Michał Janiszewski 7655ba7746 Make screenshot return path to file 2019-01-31 23:36:41 +01:00
Matt 0237eaf498 Refactor number values to SPRITE_INDEX_NULL 2019-01-30 15:02:52 +01:00
Matt 7ad59bbb37 Refactor number values to RIDE_VALUE_UNDEFINED 2019-01-30 14:59:06 +01:00
ζeh Matt 6668a1fa86 Refactor remaining number values to RideStation::NO_TRAIN (#8655) 2019-01-30 13:49:46 +00:00
Matt 4026ead774 Fix #8653: crash when peeps attempt to enter a ride with no vehicles. 2019-01-30 13:16:45 +01:00
ζeh Matt 3aad9a4b2e Refactor footpath_update_path_wide_flags 2019-01-29 19:07:00 +01:00
Tom Lankhorst 3ab73018ec Quiet CMake find package 'benchmark' (#8628)
`benchmark` is an optional package. CMake can be quiet about not finding it.
2019-01-28 21:44:50 +01:00
Tom Lankhorst 0233795add Fix #8642: Likely mistake in entrance fee check 2019-01-28 11:15:49 +01:00
Tom Lankhorst 4c015edaf6 Templatise `rorN` and `rolN` with `N` in {8, 16, 32, 64} 2019-01-28 10:55:24 +01:00
Tom Lankhorst 06600440fe
Enable LTO/IPO on Clang and GCC 2019-01-27 12:58:19 +01:00
Michael Steenbeek 3d9702dfd4
Fix #8141: Attempting to build entrance/exit on station 2 does not work 2019-01-27 10:38:47 +01:00
Michael Steenbeek 3b176cd6eb
Fix #8585: Part of track missing on air powered vertical coaster (#8635) 2019-01-25 22:09:12 +01:00
Gymnasiast 66c571370e Fix #8572: Steel Twister track pieces ID 64 and 65 drawn incorrectly 2019-01-24 20:25:01 +01:00
Tom Lankhorst 01a52d236c Use vector<string> in InteractiveConsole
Issue #8597 shows Valgrind result indicating a memory leak in
InteractiveConsole. This is fixed in #8619 by ensuring that free() is
called appropriately.
This commit takes that a step further by removing all manual memory
management in favour of using vector<string>.

- argc is now gone in favour of argv.empty()/argv.size()
- argv_t is a vector of strings of utf8's
- console_command_func's signature is changed accordingly
2019-01-24 16:12:49 +01:00
Michael Steenbeek 247e89eb53
Revert duck fix 2019-01-24 10:40:04 +01:00
Michał Janiszewski cba2dd96ec Allow specyfing more than one input file for sprite sort benchmark 2019-01-22 19:54:12 +01:00
Michał Janiszewski b38e600b15 Update sprite sort benchmark to accept filename 2019-01-22 19:45:56 +01:00
Michał Janiszewski 304840069d Add sprite sorting benchmark 2019-01-22 19:45:56 +01:00
Michał Janiszewski f2233d3cc3 Update MSVC project to use Google benchmark 2019-01-22 19:45:56 +01:00
Tom Lankhorst 55af6ad0e1 Free allocated memory when 'argc' == 0 (#8619)
Fixes leak in #8597, InteractiveConsole allocates memory for arguments,
but frees it only if the argument count is greater than zero.
2019-01-21 23:03:12 +00:00
Michael Steenbeek 4e9d2ce764
Split footpath object into two internally 2019-01-20 21:38:38 +01:00
Gymnasiast cd8227c756 Clean up magic numbers in footpath corner drawing 2019-01-20 17:54:30 +01:00
Gymnasiast d000457fb5 Rename more occurrences to railingEntry 2019-01-20 17:23:27 +01:00
Gymnasiast ad2698df0d Move 'should draw path over supports' to tile element 2019-01-20 17:23:27 +01:00
Gymnasiast 1f6d4caf7c Rename some variables 2019-01-20 17:23:27 +01:00
Gymnasiast 2f0b6a9652 Rename FOOTPATH_ENTRY_FLAG_HAS_PATH_BASE_SPRITE 2019-01-20 17:23:27 +01:00
Gymnasiast 73e25399d3 Rename footpathEntry to railingEntry where appropriate 2019-01-20 17:23:27 +01:00
Gymnasiast 9da5b5d513 Rename path_paint_{box,pole}_support parameter 2019-01-20 17:23:27 +01:00
deurklink 5e39147b76 Fix #8584: Ducks spawning function doesnt check tiles 0..63 (original bug) (#8614) 2019-01-20 13:20:01 +01:00
Lars Toenning 7de115263e Fix #8377: Change number of autosaves that are stored (#8440) 2019-01-19 14:31:12 +01:00
Michael Steenbeek 6ef01b3cd3
Name some path drawing variables 2019-01-18 20:35:43 +01:00
Michael Steenbeek b4bef2fe7d
Merge pull request #8560 from richard-fine/directions
Begin cleanup of direction handling
2019-01-18 19:09:39 +01:00
Ted John 92412d4bab Store ride index inside ride struct 2019-01-18 11:46:18 +01:00
ζeh Matt a34422dc26 Fix #8591: Game loop does not run at a consistent tick rate of 40 Hz (#8594)
* Fix #8591: Run game loop at consistent tick rate of 40hz.

* Update distribution/changelog.txt

Co-Authored-By: ZehMatt <m.moninger.h@gmail.com>
2019-01-17 23:22:27 +01:00
deurklink 51fc2fe84a Feature #8583: Add booster pieces for water coaster
Co-Authored-By: deurklink
2019-01-14 22:17:52 +01:00
Michał Janiszewski b27428835c Change http://backtrace.io token
Someone seems to be trying to use up all our backtrace.io quota by
submitting the same bug over and over again which was fixed in
https://github.com/OpenRCT2/OpenRCT2/pull/8533, 17 days ago now.

To prevent such behaviour, I've disabled the old token and replaced it
with a new one, causing dumps from old builds to be rejected now and not
counting towards our quota.
2019-01-14 21:18:33 +01:00
Gymnasiast 87f894079b Replace hardcoded occurrences of RIDE_ENTRY_INDEX_NULL 2019-01-12 12:48:35 +01:00
Gymnasiast 74a3674e86 Replace more hardcoded instances of RIDE_ID_NULL 2019-01-12 12:38:23 +01:00
Ted John 8701286772
Use new ride_id_t typedef (#8561) 2019-01-12 10:11:55 +00:00
Michael Steenbeek fdba61002f
Add station index to Tile Inspector 2019-01-08 11:25:12 +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
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
Richard Fine 3b9dd87caf Make direction_reverse constexpr and pass arg by value
To make totally sure that the compiler understands it can fully compute the value at compile time when dealing with constant inputs, and to make totally sure there are no aliasing problems.
2019-01-06 11:58:28 +00:00
Ted John 0328355f9e Include stdexcept instead of exception (#8559) 2019-01-05 22:12:47 +01:00
Richard Fine b77f1285a4 Reformat 2019-01-05 19:48:12 +00:00
Richard Fine e90e9dd73f Introduce many uses of direction_reverse
Change many of the places doing the ^2 trick to use direction_reverse instead, for improved readability.
2019-01-05 15:41:46 +00:00
Richard Fine fd60654238 Add comments and direction_reverse function
Add a bit of Javadocs, and introduce helper function for reversing directions because the ^2 trick used elsewhere in the codebase is not immediately obvious exactly what it does.
2019-01-05 14:28:24 +00:00
Richard Fine 613c7e9bf3 Introduce 'Direction' typedef
Directions are used quite widely across the codebase, but right now we just use uint8_t for them. Defining a proper type makes the intention clearer.
2019-01-05 13:58:32 +00: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
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
Richard Fine 3089781883 Reformat 2019-01-02 14:40:17 +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 7955dba9ba Add warning for mismatching network version. 2019-01-02 06:58:36 +01:00
Matt fc4e45562d Use stringstream to log integral values. 2019-01-02 06:39:59 +01:00
Matt 74668c6188 Use correct file path on replay info output. 2019-01-02 05:39:32 +01:00