Commit Graph

10102 Commits

Author SHA1 Message Date
Michał Janiszewski 06b659db40 Replace malloc(0) with explicit NULL
From documentation on `void* malloc( size_t size );`:
> If size is zero, the behavior is implementation defined (null pointer
may be returned, or some non-null pointer may be returned that may not
be used to access storage).

Both `free()` and `realloc()` understand `NULL`, so use that to avoid
implementation-defined behaviour
2016-11-06 21:00:47 +01:00
Michał Janiszewski fe3b15c2f1 Mask translucent bit out from colour
Fixes #4765
2016-11-06 20:51:38 +01:00
Matte A c029515d76 Changing some default configs to true (#4540) 2016-11-06 19:12:42 +01:00
Michael Steenbeek fc9884092a Merge pull request #4764 from janisozaur/check-ride-type
Prevent checking of flags of invalid ride type
2016-11-06 18:40:56 +01:00
Michał Janiszewski 512c7bcf51 Prevent crash when opening a window on invalid ride 2016-11-06 18:26:45 +01:00
Michał Janiszewski 7e326972a9 Prevent checking of flags of invalid ride type
Such case can happen with following function call chain in stack trace:
* `game_command_create_ride` ride.c:6234
* `ride_create` ride.c:6070
* `rideTypeShouldLoseSeparateFlag` rct1.c:88
2016-11-06 18:03:26 +01:00
Michael Steenbeek 71dc1314c2 Merge pull request #4672 from wolfreak99/cheats_in_console
disable_clearance_checks and disable_support_limits in console
2016-11-06 17:40:14 +01:00
Michael Steenbeek 5e85b2e807 Merge pull request #4763 from zaxcav/develop
Update contributors.md for pathfinding improvements.
2016-11-06 17:36:04 +01:00
Michael Steenbeek d9c19479d1 Merge pull request #4688 from zaxcav/pathFindLoopDetection
Add pathfinding loop detection based on peep->pathfind_history
2016-11-06 17:34:31 +01:00
zaxcav a3844e229d Update contributors.md for pathfinding improvements. 2016-11-06 17:34:03 +01:00
Ted John c268b51521 Merge pull request #4757 from janisozaur/memory
Ensure all memory allocated with Memory is valid
2016-11-06 11:28:30 +00:00
Michał Janiszewski 2c6c99dfe0 Add user-friendly information about failed allocation 2016-11-06 11:59:30 +01:00
OpenRCT2 git bot c94a009860 Merge Localisation/master into OpenRCT2/develop. 2016-11-06 04:00:18 +00:00
Michał Janiszewski c9a1ce593c Fix wrong return value in Stopwatch::GetElapsedTicks 2016-11-05 22:40:28 +00:00
Michał Janiszewski e4e6f2f68a Ensure all memory allocated with Memory is valid 2016-11-05 23:12:35 +01:00
Duncan a4f9d41f57 Merge pull request #4746 from marijnvdwerf/fix/supports
Fix scenery segments
2016-11-05 10:38:45 +00:00
wolfreak99 410ce9fd66 prefix console commands with "cheat_" 2016-11-05 05:14:17 -04:00
wolfreak99 28773b4c40 Change sandbox mode, clearance check, and support limit cheats to take parameter as value 2016-11-05 05:14:12 -04:00
wolfreak99 102af2f8ca rewrite to use value returned from game_do_command 2016-11-05 04:34:19 -04:00
OpenRCT2 git bot 98981b691d Merge Localisation/master into OpenRCT2/develop. 2016-11-05 04:00:21 +00:00
Michael Steenbeek ea66b4ca84 Merge pull request #4749 from Overv/develop
Fix #4747: Fix available land rights not being recounted when using sandbox tools
2016-11-04 22:56:12 +01:00
Alexander Overvoorde 9be47d11ed Fix #4747: Fix available land rights not being recounted when using sandbox tools
This commit fixes the game command set_land_ownership missing a land
rights recount call. This would cause problems when the user changes
land ownership with the sandbox mode tools.
2016-11-04 22:51:35 +01:00
Michał Janiszewski b6525c298e Verify access to terrainEdgeTypeStringIds 2016-11-04 22:21:37 +01:00
wolfreak99 369b85fc51 Sync cheats in console across multiplayer, add "sandbox_mode" 2016-11-04 13:58:47 -04:00
wolfreak99 4368d67f6e disable_clearance_checks and disable_support_limits in console 2016-11-04 13:58:44 -04:00
Michał Janiszewski 3653baf720 Remove needless const for returned values 2016-11-04 09:44:13 +01:00
Marijn van der Werf 0a431cf918 Fix #4698: Scenery blocks wrong segments 2016-11-03 21:58:50 +01:00
Michael Steenbeek b5630a5a5e Merge pull request #4701 from Overv/implement-disabled-land-rights
Resolves #4559: Changes land rights buttons to be disabled if no tiles for sale remain
2016-11-03 19:42:08 +01:00
duncanspumpkin cc0803d466 Prevent crash #4694. Crash in ride_get_entrance with no station
Issue is being caused by deleting the station track without removing the station track entry in the ride struct. This will prevent the crash but this should not happen in practice.
2016-11-03 18:23:42 +00:00
OpenRCT2 git bot e3f76a1140 Merge Localisation/master into OpenRCT2/develop. 2016-11-03 04:00:20 +00:00
Marijn van der Werf 5d2b5f4d5c Make `NO_RCT2` builds possible again 2016-11-02 22:39:58 +01:00
duncanspumpkin 8466de7cbf Fix #4689. Object selction tabs sometimes flicker.
Issue caused by switching between tabs when half way through tab animation. The frame number would not be reset until the next frame and this would cause a split second glitch when moving from a long animation tab to a short animation tab. Issue fixed by reseting the frame number when switching tabs.
2016-11-02 19:08:12 +00:00
Duncan cc0c552fa1 Merge pull request #4743 from duncanspumpkin/fix_bins
Fix #4725: Filled bins incorrectly displayed
2016-11-02 18:30:38 +00:00
Michał Janiszewski 1f0adb95da Check value of DEBUG_LEVEL_X macro, not just definition
DEBUG_LEVEL_X macros are always defined to 0 or 1, this could prevent
some optimisations from compilers, especially inlining
`get_current_rotation()`.
2016-11-02 08:19:25 +00:00
OpenRCT2 git bot 1fa99885d1 Merge Localisation/master into OpenRCT2/develop. 2016-11-02 04:00:24 +00:00
Michał Janiszewski a7cd10a7f7 Cache rotation value in scenery_paint 2016-11-01 22:23:40 +01:00
duncanspumpkin 6caa6d9a3f Fix #4725: Filled bins incorrectly displayed
The bins were incorrectly displaying their filled status on some
rotations. This was caused by two mistakes. The first mistake was only
rotating the status by 1 place when it was 2 bit the second was due to
rotating it the wrong direction. This was likely caused by the implementor
not realising that there were two 'rol' commands but due to the inverted
nature of this it would end up being two 'ror's.
2016-11-01 19:23:00 +00:00
Ted John b568f002d4 Merge pull request #4729 from xavery/bitcount-use-cpu
Use POPCNT, if available, to count the number of set bits
2016-11-01 13:26:39 +00:00
Daniel Kamil Kozar 55f1d3aac6 Fixes to the new bitcount implementation
Use Intel-standardized _mm_popcnt_u32 instead of Microsoft-specific
__popcnt, replace assert with openrct2_assert, replace bitcount's argument
with uint32.
2016-11-01 11:45:17 +01:00
Hielke Morsink ab1708a970 Fix quarter-scenery cluster selection 2016-11-01 09:46:30 +00:00
Yaroslav Tretyakov 9540e804b3 Fix #4728: Crash when trying to remove invalid provisional track piece 2016-11-01 08:14:46 +00:00
Ted John a9a1f54f8a Fix centreing of title menu buttons 2016-10-31 22:24:02 +00:00
Alexander Overvoorde bb059a2741 Resolves #4559: Changes land rights buttons to be disabled if no tiles for sale remain
This commit changes the land rights button in the park window to be
disabled if there are no more land rights and construction rights for
sale. It also disables the individual land rights and construction
rights buttons in the land rights window itself if that specific type of
tile is no longer for sale.

This is implemented by introducing two new global variables called
gLandRemainingOwnershipSales and gLandRemainingConstructionSales. These
are updated by map_count_remaining_land_rights() to contain the number
of land rights and construction rights that remain for sale. This
function is called when a scenario is loaded and whenever the game
command to buy land rights or construction rights is invoked.

It also introduces three new tooltip strings that explain why the
buttons are disabled.
2016-10-31 20:21:10 +01:00
Ted John 50dd0ddaa6 Remove curl-ca-bundle.crt from openrct2.vcxproj
[ci skip]
2016-10-31 12:50:02 +00:00
Ted John bca55e1e32 Only use CI compile options if BUILD_SERVER is set
This now means that building openrct2.sln after openrct2.proj does not trigger a rebuild as the compile options will be the same. They are now only different if the BUILD_SERVER environment variable / msbuild property is set.
2016-10-31 12:41:48 +00:00
Yaroslav Tretyakov 12bd31bc52 Fix #4726: Checking wrong x value 2016-10-31 08:20:52 +00:00
OpenRCT2 git bot 0f8cec0df8 Merge Localisation/master into OpenRCT2/develop. 2016-10-31 04:00:34 +00:00
Daniel Kamil Kozar b68b6f731b Use bool instead of int for bitcount_popcnt_available's return value 2016-10-31 01:06:18 +01:00
Daniel Kamil Kozar d7606c8fa3 Remove void from argument lists in new bitcount_ functions
Keep it in line with the rest of the C code.
2016-10-31 00:58:22 +01:00
Daniel Kamil Kozar 46b6ff35a0 Initialise the pointer to bitcount_fn in a new early initialisation function
In order to avoid the overhead of checking whether the function pointer
to bitcount's actual implementation has been initialised every time
bitcount is called, initialise it at application startup.
2016-10-31 00:45:30 +01:00