1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 17:24:47 +01:00
Commit Graph

662 Commits

Author SHA1 Message Date
zaxcav
60acab8676 Remove if statements originally used to overlay grid of non-wide paths. 2016-08-21 22:24:19 +02:00
zaxcav
86be86331e Remove exlusions from path tiles being flagged wide based on tile coordinates. 2016-08-21 22:23:38 +02:00
zaxcav
a768be5e88 Fix the peep path finding
In the heuristic search, tiles in wide path were always being handled as junctions.  Changed to handle junctions according to the path thinning.

There was no search loop detection.  Added loop detection for returning to the starting location and any of the junctions visited in the current search path.

Various other optimisations added.
2016-08-21 22:23:38 +02:00
Ted John
0e04e9e47f Merge pull request #4259 from marijnvdwerf/clean/constants-1
[Clean] Use more constants
2016-08-09 23:55:18 +01:00
Marijn van der Werf
bdf174d4a2 Use sprite constants for weather 2016-08-09 23:43:47 +02:00
Marijn van der Werf
a81b7c4892 Use WALL_SCENERY flags 2016-08-07 12:57:22 +02:00
Michał Janiszewski
fa68d31dbf Remove RCT2_GLOBAL macro from stack buffer 2016-08-07 11:44:49 +02:00
Michał Janiszewski
0ece63a7f6 Wrap RCT2's addresses in RCT2_ADDRESS macro 2016-08-06 21:38:46 +01:00
Yaroslav Tretyakov
802fcedb6f Fix #4222: Artifacts with uncap fps on 2016-08-06 17:21:08 +01:00
Marijn van der Werf
3d8b71ffbc Rename gTrackDefinitions to TrackDefinitions 2016-08-04 01:15:23 +02:00
Ted John
bf4e3febeb Fix #4207: Scenario Editor freezes the game
Recent commits have caused the sprite spatial index to be uninitialised for the editor modes. Call 
eset_sprite_spatial_index within 
eset_sprite_list as the two come hand in hand.
2016-08-03 21:19:53 +01:00
Michał Janiszewski
76d0adb5ed Remove unused variable
0x00F43896 usage has been refactored out in 9c3055224
2016-08-03 19:26:34 +02:00
zsilencer
5d04e5e03e Multiplayer desync stuff 2016-08-01 20:47:21 +02:00
Michael Steenbeek
ff7e119b46 Name some track design flags 2016-07-31 12:02:38 +01:00
Michał Janiszewski
702ae49474 Fix gMapElements size 2016-07-28 00:33:57 +02:00
Michał Janiszewski
193ca02014 Fix constness in no-network builds 2016-07-27 15:12:27 +02:00
Michał Janiszewski
1fe5fc56c0 Checksum sprites occasionally in multiplayer
This creates a checksum (SHA1) every so often on server and sends this
value together with PRNG seed for client to check it has still not
desynced.

It's useful to detect a desync early on, as PRNG seeds may remain
unchanged for some more time, while damage may have already been caused.
2016-07-27 15:54:02 +02:00
Michał Janiszewski
0421c59eff Refactor sprite_set_coordinates 2016-07-26 22:29:54 +02:00
Yaroslav Tretyakov
dd4e4caeaa Reset sprite quadrant placements as part of sprite reset command
This addresses some sources of desyncs in multiplayer.
2016-07-26 22:29:54 +02:00
Michał Janiszewski
e19cf781b1 Verify inputs to various functions 2016-07-24 13:18:50 +02:00
Michał Janiszewski
306cf2383c Zero the memory when creating new sprite
Some fields were left uninitialised explicitly (like rct_peep::var_73) but
used when doing logic. If they contained garbage from before the new
sprites were created, it could eventually lead to a desync later on.

This commit adds a new function: `sprite_reset`, which zeroes memory for
a new sprite and is called whenever a sprite is created. Some fields
have to be retained for the sprite to link properly in linked lists,
this function takes care of it.
2016-07-23 12:32:58 +01:00
duncanspumpkin
9652f68024 Implemented junior rollercoaster paint 2016-07-22 19:16:03 +01:00
duncanspumpkin
551afeef86 Fix #4096. Max map elements incorrectly sized
Due to a mistake from 2014 the number of map elements that could be used in a park was mistakenly assumed to be the same size as the s6 data for map elements. It turns out there are 256*256 spare elements for whatever reason. When the map element reorginisation code was refactored to remove magic numbers this incorrect value was used instead. This would cause the map element inserter to allocate a map element that shared the same mememory as a sprite. This would cause issues when the sprite tried to update or the map element tried to draw.
2016-07-18 17:49:51 +01:00
Michał Janiszewski
bc769ea248 Use openrct2_assert in get_sprite 2016-07-17 23:54:31 +02:00
Michał Janiszewski
381545aa2b Refactor loop in vehicle update not to access invalid memory 2016-07-17 23:14:27 +02:00
Michał Janiszewski
9f57c82653 Refactor access to g_sprite_list
Hide g_sprite_list behind accessor function with a check. `assert` is
temporarily disabled, as it breaks nearly every park.
2016-07-17 22:19:34 +02:00
Ted John
3a8b0c662f import peep sprite data 2016-07-15 23:56:51 +01:00
Michał Janiszewski
a6d0e6916e Fix function definitions to match their declarations
This makes sure every function is properly declared, which includes
proper `extern` wrappers.
2016-07-14 14:11:49 +02:00
Marijn van der Werf
5204fb0ce9 Clean up string and sprite ID's (#3977) 2016-07-14 14:07:49 +02:00
Ted John
04340021f6 Fix #4071: Guests paid when free entry park flag
Make most usages of park entrance fee use a common function which does the necessary checks.
2016-07-13 19:48:42 +01:00
Ted John
dca816cfd3 Merge pull request #4024 from IntelOrca/refactor/object-list
Refactor and improve the object system:
- Objects are now exported to user directory under 'object'.
- Object directories are scanned recursively.
- Improves reliability of object loading and handling of bad objects.
- Improve performance of object scanning.
- Only load new objects when loading a new game.
- Improve changing language experience.
2016-07-11 23:45:45 +01:00
Daniel Trujillo Viedma
1e3504cd36 Fix #1432: Sandbox mode reducing map size causes game to freeze
Shift correctly direction bits when calling game_do_command.

game_command_remove_large_scenery() expects the direction bits
to be shifted 8 times to the left, so the call to game_do_command
has been modified to match this requirement.
2016-07-10 23:11:04 +01:00
Ted John
82d90fe350 use pointer for smallscenery/var10 2016-07-08 22:58:38 +01:00
Ted John
52c11267bc add small scenery preview 2016-07-08 22:58:38 +01:00
Michał Janiszewski
dfa482b1b5 Revert "Merge pull request #3897 from janisozaur/rebase-no-rct2"
This reverts commit 22c0cc92e6, reversing
changes made to 7b421c8052.
2016-06-24 22:40:37 +02:00
Michał Janiszewski
0b50ce44f1 Revert "Merge pull request #3937 from janisozaur/fix-3897"
This reverts commit d892f6b683, reversing
changes made to c487e1278b.
2016-06-24 22:40:37 +02:00
Michał Janiszewski
6e35eac6f8 Update fields in rct_small_scenery_entry_32bit 2016-06-22 21:37:44 +02:00
Michał Janiszewski
58b4361e8d Pack structs for when loading from files 2016-06-19 18:12:14 +02:00
Hugo Wallenburg
fc9595d013 Freeze climate only freezes climate updates, allowing lightning to strike (#3904) 2016-06-18 17:48:17 +01:00
Michał Janiszewski
78e2aec5fe Make map element arrays static 2016-06-16 22:51:28 +02:00
Michał Janiszewski
c2bf4b75e7 Integrate tile map element pointers usage (#3442) 2016-06-16 19:05:15 +02:00
Ted John
d07b9535c2 integrate variables: object entry lists 2016-06-16 11:36:15 +02:00
Marijn van der Werf
b13f499d5b Fix typo in enum value 2016-06-12 19:01:16 +02:00
duncanspumpkin
a36a6c3ef9 Small refactor 2016-06-11 11:24:45 +02:00
duncanspumpkin
a37d5e7382 Finish var_0A paths 2016-06-11 11:06:53 +02:00
Marijn van der Werf
9de7492121 Start decompilation of 0x6A3590 2016-06-11 11:06:53 +02:00
Ted John
428724d86c refactor reset_sprite_spatial_index, integrate gSpriteSpatialIndex 2016-06-03 18:13:00 +01:00
Ted John
82dd7601eb Merge pull request #3782 from janisozaur/desyncs
synchronise reset_0x69EBE4 over network
2016-06-03 10:47:01 +01:00
Michał Janiszewski
1508e49a28 Change macro to assert_struct_size 2016-06-03 11:29:50 +02:00
Michał Janiszewski
934ce5e84e Fix 64 bit by skipping static_asserts for structs with pointers 2016-06-03 10:55:21 +02:00