1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00
Commit Graph

55 Commits

Author SHA1 Message Date
duncanspumpkin
a262f325ed Refactor sprite_remove 2020-01-19 17:15:52 +00:00
duncanspumpkin
65c6564165 Use SpriteBase instead of rct_sprite for move_sprite_to_list 2020-01-19 17:15:52 +00:00
duncanspumpkin
164acc85cc Rename sprites to newer style naming 2020-01-19 17:10:53 +00:00
duncanspumpkin
4e796ec92d Increase Sprite size to 0x200
This should allow for major refactoring of the sprite classes
2020-01-19 17:08:57 +00:00
Gymnasiast
62fcbb07ca Rename methods to GetBaseZ/GetClearanceZ 2019-12-23 20:08:37 +01:00
Gymnasiast
7d11858dbe Create getter for GetBaseHeight()/GetClearanceHeight() 2019-12-23 20:05:24 +01:00
Tulio Leao
a2c7ecc6e5 Make Map::map_get_first_element_at() use CoordsXY (#10413)
* Make Map::map_get_first_element_at() use CoordsXY

* Fix clang-format on ClearAction.hpp

* Prefer TileDIrectionDelta over hardcoded delta on RideConstruction

* Use named Direction constants

* Make Compat::map_get_first_element_at() use CoordsXY
2019-12-23 07:35:41 +00:00
Matt
d60cdbe5f2 Fix #10420: Money effect causing false positive desync 2019-12-22 07:50:51 +01:00
Tulio Leao
b793d7e79a Avoid dereferencing map_get_first_element_at nullptr on libopenrct2 (#10013)
* Avoid dereferencing map_get_first_element_at nullptr on Map.cpp

* Avoid dereferencing map_get_first_element_at nullptr on MapAnimation.cpp

Returning true or internal control variable, based on what was seen on `map_animation_invalidate_track_onridephoto`

* Avoid dereferencing map_get_first_element_at nullptr on Park.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Scenery.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Sprite.cpp

* Avoid dereferencing map_get_first_element_at nullptr on TileInspector.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Wall.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Fountain.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Footpath.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Entrance.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Banner.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Vehicle.cpp

* Avoid dereferencing map_get_first_element_at nullptr on TrackDesignSave.cpp

* Avoid dereferencing map_get_first_element_at nullptr on TrackDesign.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Track.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Station.cpp

* Avoid dereferencing map_get_first_element_at nullptr on RideRatings.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Ride.cpp

* Avoid dereferencing map_get_first_element_at nullptr on S4Importer.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Staff.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Peep.cpp

* Avoid dereferencing map_get_first_element_at nullptr on GuestPathfinding.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Guest.cpp

* Avoid dereferencing map_get_first_element_at nullptr on VirtualFloor.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Paint.TileElement.cpp

* Fix issues raised on review

* Fix remaining review issues.

* Early exit on loops if tileElement is nullptr

* Fix clang-format issues
2019-10-09 15:02:21 +01:00
duncanspumpkin
927c8a4e85 Create ScreenCoords struct. Refactor 3d_to_2d again 2019-08-19 20:04:58 +01:00
duncanspumpkin
9619fd384d Refactor map_is_location_owned to use CoordsXYZ 2019-08-19 20:04:56 +01:00
Ted John
60db202ea7 Return nullptr in get_sprite if out of range 2019-08-10 12:18:51 +01:00
Ted John
85e63cbe3b Do not include name in peep checksum 2019-07-29 20:21:02 +01:00
Ted John
40d49b93d3 Do not use user strings for peep names 2019-07-29 19:18:16 +01:00
Matt
f3638ca858 Address code review 2019-07-24 18:12:25 +02:00
Matt
3395079737 Remove NUM_SPRITE_LISTS macro and replace with SPRITE_LIST_COUNT for consistency 2019-07-24 17:53:54 +02:00
Matt
98a17fe8d9 Refactor create_sprite and remove unnecessary move_sprite_to_list 2019-07-24 17:53:51 +02:00
Duncan
4e44818a04 Merge pull request #9449 from ZehMatt/refactor/sprite-list-pow2
Remove unnecessary multiplication and division for sprite lists
2019-07-13 09:37:35 +01:00
Jim Armstrong
9c976daa51 Refactor #9474: Refactor jumping fountain code (#9475)
* Refactor jumping_fountain_update to Update

* Refactor jumping_fountain_get_type to GetType

* Refactor jumping_fountain_continue to Continue

Fix typos and misc refactoring

* Refactor begin and create functions into static member functions

Move jumping_fountain_begin and jumping_fountain_create into the rct_jumping_fountain struct and make them static

* Refactor remaining fountain functionality into member functions

* Rename JumpingFountain struct and move to proper header file

JumpingFountain code was refactored to conform to variable naming conventions and moved into the Fountain.h file.

rct_sprite_generic struct was moved to SpriteBase.h - this was done to get around a circular header dependency between Fountain.h and Sprite.h

* Set access modifier for private functions

* Change JumpingFountain variable names to TitleCase

* Refactor #9474: Clarify where auto is being used with pointers

* Refactor #9474: Change function names for clarity

* Refactor #9474: Fix incorrect function names
2019-07-11 20:38:30 +01:00
Matt
fc3afb3349 Remove unnecessary multiplication and division for sprite lists 2019-06-22 17:38:28 +02:00
aw20368
3ee6be0dbf Fix #9288: Replace repeated 3d to 2d functions (#9301)
Replaced duplicate 3d to 2d code with translate_3d_to_2d_with_z(...).
2019-05-30 22:41:53 +02:00
aw20368
8c20b635bd Fix #9270: Refactor money effect
Changed static functions to rct_money_effect member functions. GetStringId now returns std::pair.
2019-05-21 21:22:47 +02:00
Greg Hennis
1fcedae3bc Fix #9258: Rename SPRITE_LIST_NULL to ..._FREE (#9260) 2019-05-15 19:07:01 +02:00
Filip Gawin
6833da77e3 Simplify boolean expresions 2019-05-10 22:00:38 +02:00
Michael Steenbeek
da6794ad9e Refactor second argument to move_sprite_to_list() 2019-05-08 22:11:51 +02:00
Aaron van Geffen
2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
ζeh Matt
3b69c1c75e Fix #8055: Ignore rendering specific fields for sprite checksum. (#8895) 2019-03-16 21:53:26 +01:00
Ted John
ca023f7c5e Fix #8829: invalid read in window_guest_open 2019-03-09 13:05:12 +00:00
Ted John
520b1b4819 Try out changed sprite structs for main game 2019-02-25 12:29:31 +00:00
Matt
ccc3227113 Cleanup. 2018-12-29 19:23:27 +01:00
Matt
6e2514cd0d Refactor sprite_checksum, returns rct_sprite_checksum now. 2018-12-29 19:23:27 +01:00
ζeh Matt
7d19a5bc77 Refactor memcpy to std::memcpy and memset to std::memset (#8408) 2018-12-15 22:23:31 +01:00
Hielke Morsink
354d973a48 Use std::size instead of Util::CountOf 2018-11-23 21:59:08 +01:00
Michael Steenbeek
f8add7f62e Rename rct_tile_element to TileElement 2018-11-01 13:53:50 +01:00
Matt
a89b352fb2 Rename rct_sprite::unknown to rct_sprite::generic 2018-08-20 18:27:40 +02:00
Linus Unnebäck
fd07be587a Remove Math::Clamp in favour of std::clamp 2018-08-12 16:47:12 +01:00
clang-format
b02dfdbc93 Binpack function arguments together
Previously when the arguments of a function wouldn't fit on a single line, clang-format would put each argument on its own line instead. By enabling the binpack parameter setting, it tried to fit as many on one line as possible instead.

Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:22 +02:00
clang-format
5c55fd6132 clang-format world 2018-07-23 16:00:12 +02:00
Michael Steenbeek
1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Hielke Morsink
0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00
Ted John
f94018ef37 Fix #7630: Server disconnects clients immediately
Clear the length of the sprite hash buffer. It was growing longer and longer every time the hash was calculated.
2018-06-05 23:19:31 +01:00
Ted John
72293f2208 Implement new Crypt code and remove CNG for now 2018-06-01 21:27:34 +01:00
Ted John
865bfb7b1b Refactor implementations to different files 2018-06-01 21:27:33 +01:00
Ted John
f880290b00 Create WinSSL implementation and refactor to class 2018-06-01 21:27:33 +01:00
Michael Steenbeek
b573bd49b3 Replace all occurrences of tile_element_is_last_for_tile() 2018-05-24 11:44:53 +02:00
duncanspumpkin
fcb66b7449 Start refactoring pathfinding to use tileCoords 2018-05-05 11:42:34 +01:00
Michael Steenbeek
5f9d40be7a Replace tile_element_get_type() with struct method 2018-05-02 19:27:04 +02:00
Hielke Morsink
49cf840f28 Fix memset byte value too big (#7447)
`memset` takes an integer as argument which gets converted to an unsigned byte. `SPRITE_INDEX_NULL` has a value of 0xFFFF, essentially cutting it to 0xFF. Calling `std::fill_n` instead of `memcpy` assigns the given value to each element in its range rather than setting the bytes. In this case, the result is the same.

None of the other calls to `memset` in the project use values bigger than 0xFF.
2018-04-25 14:47:03 +02:00
Michał Janiszewski
764520076f Reduce header inclusion
* Update includes in PlatformEnvironment.cpp

* Update includes in ParkImporter.h

* Update includes of OpenRCT2.h

* Update includes in Intro.h

* Remove unused include from Input.cpp

* Update includes of Imaging.h

* Update includes in Game.h

* Update includes in Editor.h

* Update includes of Context.cpp

* Update includes in Cheats.cpp, CmdlineSprite.cpp

* Update includes of some source files

* Update includes in some cpp files

* Update includes in some cpp files

* Update includes in TextureCache.h

* Fix tests

* Update includes in Font.cpp

* Update includes in LightFX files

* Update some includes

* Fix GCC builds

* Update some includes

* Update some includes

* Update includes in FontsFamilies.*

* Update includes of Console.h

* Improve includes in Window.h

* Improve headers in Viewport.h/Window.h

* Fix MSVC build

* Fix network-less builds

* Reduce inclusion of Map.h
2018-03-13 13:14:02 +01:00
Gymnasiast
cd8d40d8a5 Include missing header 2018-03-01 20:10:34 +01:00