Commit Graph

1000 Commits

Author SHA1 Message Date
Matt 4dce91e027 Move defines into Colour.h 2018-12-20 22:29:16 +01:00
Matt c4c4f46b78 Use different colours for entrance/exit on track design previews. 2018-12-20 22:27:01 +01:00
ζeh Matt c457de1ece Fix #8402: prevent dereferencing invalid iterator (#8504) 2018-12-20 22:25:10 +01:00
Ted John abbdab9b6d
Merge pull request #8452 from IntelOrca/change-structures
Change a few structures from fixed to C++
2018-12-16 19:01:36 +00:00
Ted John 08b02943d3 Use std::string for scenario name, details etc. 2018-12-16 19:01:14 +00:00
Ted John 19a687f2fa Change gParkEntrance to a vector so we can now have more than 4 2018-12-16 19:00:16 +00:00
Michael Steenbeek 59f9476ecd
Change 'entrance style' to 'station style' 2018-12-16 19:38:30 +01:00
Michael Steenbeek e2a91e55e5
Fix compile error in EditorObjectSelection.cpp 2018-12-16 17:10:45 +01:00
Michael Steenbeek d145ae6922
Fix #8450: Track designer window has drawing problems and crashes 2018-12-16 10:02:40 +01:00
ζeh Matt 7d19a5bc77 Refactor memcpy to std::memcpy and memset to std::memset (#8408) 2018-12-15 22:23:31 +01:00
Michael Steenbeek 7d7e8e2638
Merge pull request #8453 from Gymnasiast/fix/8033
Fix #8033: Crash when placing 64th sign
2018-12-15 21:24:09 +01:00
Michael Steenbeek 6d0f0334d7
Merge pull request #8339 from ZehMatt/realtime-ticks
Use real time ticks for UI effects.
2018-12-15 21:00:44 +01:00
Gymnasiast 806073ec59 Fix 'Object index exceeds maximum' spam 2018-12-15 20:34:28 +01:00
Gymnasiast 0d775f48ec Clean up scenery ghost flags 2018-12-15 20:31:41 +01:00
Michael Steenbeek 705fb94f58
Fix #8406: Add 'Entrance style:' label to Ride window 2018-12-15 19:00:37 +01:00
Hielke Morsink 04c3d9a97a Fix #8443: Crash when clicking default vehicle for hacked ride 2018-12-15 11:35:36 +01:00
Ted John e2e2d4b7bf Fix #8433: Crash if master server response is not valid JSON
Protect fetch_servers_callback from bad JSON responses
2018-12-14 17:10:50 +00:00
Michael Steenbeek cf44ea7e24
Fix #3832: Track piece colour scheme paint not network-safe 2018-12-11 22:17:52 +01:00
Ted John 76d761c299 Fix #8414: Rides tab in object selection window is broken
Widgets were still being created for disabled object types which were placed at same position as ride tab.
2018-12-10 19:50:12 +00:00
Ted John 9dc860b526 Fix compile errors 2018-12-10 00:26:12 +00:00
Ted John 4b77d76303 Hide new object tabs until we have new save format 2018-12-09 23:30:40 +00:00
Ted John 06f203a7e7 Implement surfaces, edges and stations as objects 2018-12-09 23:30:40 +00:00
roosen5 d9806305b0 Fix #8358: infinite loop when changing vehicle count on stopped ride. (#8375)
The sprite_remove in Sprite.cpp tries to find itself inside the quadrant.
It does not find itself, and because the rest of the code assumes that it will always find it
The normal code tries to set the value of the next_in_quadrant so that whoever points at it, will now point at its next sprite.
But because it didn't find whoever was pointing to it, it would set the pointer to SPRITE_INDEX_NULL to its next sprite.
This would lead to cycles in the linked list

The reason that the sprite was not found is that during the entry of a ride, the position of a peep is set to LOCATION_NULL
Exiting a ride sets it back to whatever the location is of an exit.
However stopping a ride that still has people in it would go wrong, as the people are removed from the ride through ride_remove_peeps

This function was called during the PaintWindows.
The fact that this function is called during the painting is the problem, because of the tweening:
Before painting all the positions are stored (Which would at that point be the LOCATION_NULL), during the painting
the peep would be removed from the ride, setting their location to the enrance/exit
After painting is done all the positions are restored again, so the patched position is forgotten and then it would be
removing a sprite with location LOCATION_NULL and that goes wrong

The fix is to have the window update outside of paint
2018-12-09 20:46:04 +01:00
Matt 468d94a6ca Remove gCurrentViewportFlags 2018-12-05 23:09:17 +01:00
ζeh Matt dc7d14163f Fix OpenGL renderer causing infinite loop on hacked surfaces. (#8346) 2018-12-05 23:00:08 +01:00
ζeh Matt 940fff4bbf Fix dereferencing nullptr when game objects are missing. (#8360) 2018-12-05 22:59:15 +01:00
Matt 862ef3018c Use gCurrentRealTimeTicks whenever appropriate. 2018-12-01 17:00:11 +01:00
Matt 4bc69a0111 Introduce gCurrentRealTimeTicks and refactor some variable names. 2018-12-01 16:36:00 +01:00
Michał Janiszewski ebd4e8f5d6
Provide more checks when handling possibly-gone windows (#8331) 2018-11-30 23:32:55 +01:00
Hielke Morsink 354d973a48 Use std::size instead of Util::CountOf 2018-11-23 21:59:08 +01:00
Michał Janiszewski 0d2751a54e
Hide the network class declaration to Network.cpp (#8276)
The Network class is not used by anyone other than free functions in
Network.cpp, nor should it be used by anyone with the current design.

This change leaves only the publicly-exposed functions left in the
header, drastically reducing amount of required headers in network.h,
one of the heaviest headers we had so far.
2018-11-19 23:10:54 +01:00
ζeh Matt 3a1c14146a Fix #8253: Prevent null dereference. 2018-11-12 21:34:05 +01:00
Michael Steenbeek 82aba96728 Cheats: use 'weather' instead of 'climate' (#8246) 2018-11-10 14:30:41 +01:00
Hielke Morsink 107faaf821 Add and use game action for setting the climate
Also reordered the registered game actions the same as headers, so they are easier to find.
2018-11-08 22:39:13 +01:00
Hielke Morsink 2170c26e93 Include what gets used
To reduce including "big" files, like game.h", and just include the headers that are needed. Partly used IWYU to find the headers, but removed the ones that are hard requirements of included headers, like common.h and gameactions.h.
2018-11-07 22:19:33 +01:00
Hielke Morsink 7a57bf1d5c Move climate dropdown from objective options to scenario options 2018-11-06 22:53:31 +01:00
ζeh Matt 223ae74c6b Refactor code to obtain resolutions. (#8215) 2018-11-06 07:20:57 +01:00
Michael Steenbeek df768a3fad
Fix #8201: Only quarter scenery objects in one corner can be painted 2018-11-05 20:12:22 +01:00
Michael Steenbeek f8add7f62e
Rename rct_tile_element to TileElement 2018-11-01 13:53:50 +01:00
Michael Steenbeek f55f323723
Allow building footpaths on 'corner down' terrain 2018-11-01 11:04:32 +01:00
Michael Steenbeek a8f526ae48
Allow on-ride photos and water S-bends on the Water Coaster 2018-11-01 10:12:45 +01:00
Michael Steenbeek 5f4cca3c7e Remove rest of access to footpath edges 2018-10-31 15:08:06 +01:00
Michael Steenbeek d89c3d9e67 Replace calls to get path edges
This replaces most calls/direct access to the footpath edges (i.e. the orthogonal directions, not the corners). This includes places where the whole byte was retrieved, but only compared against orthogonal directions.
2018-10-31 15:08:06 +01:00
Michael Steenbeek 84145a258d Fix very misleading use of tileElement->type in a union
It was a sprite, accessed as if it was a tileElement. Neither the method nor the resulting code made any sense.
2018-10-31 13:12:18 +01:00
Michael Steenbeek 687fbc2a0a Modify game_command_set_scenery_colour() to only take the scenery quadrant 2018-10-31 13:10:26 +01:00
Michael Steenbeek 0f4560598e Replace residual access to path element entry index field 2018-10-31 13:09:29 +01:00
Michael Steenbeek 66cde65f87 Replace C style function for getting slope direction 2018-10-31 13:09:19 +01:00
Michał Janiszewski 74ee2cf741
Fix types of windows scenery tab selections (#8179) 2018-10-29 14:52:07 -07:00
ζeh Matt 3e457436b1 Refactor some painting code. (#8144) 2018-10-26 10:49:27 -07:00
Michał Janiszewski 95175b44e9
Prevent recently closed window from having actions performed on it (#8143)
Fixes #8121
2018-10-24 20:57:39 +02:00