Commit Graph

2737 Commits

Author SHA1 Message Date
Duncan 00c9c07c11
Fix #14589: Crash in sign window after tileelement reorg (#14626)
TileElement pointers must always be revalidated every tick otherwise a tileelement reorg will cause them to point at the wrong element
2021-05-11 14:52:38 +01:00
Duncan 975ed665f8
Fix opengl extra zoom bugs (#14601)
* Fix #14449: Surface smoothing not working at extra zooms

Caused by two issues. One was spotted by @AaronVanGeffen in that surface smoothing was turned off. The other was caused by a bug in the opengl renderer that went unnoticed due to never being hit during normal play.

* Fix merrygoround and enterprise extra zoom peep drawing

* Add changelog entry
2021-05-10 12:43:46 -03:00
Duncan d46e4a9bb1
Network serialiser for entities (#14541)
* Start a network serialiser for entities

will be used only for checksums and replay diffs

* Continue work

* Use the new serailser for checksums

* Use new serialiser for replays

* keep compilers happy

* Try create checksum stream

* Fix compiling

* Split off class into seperate file

* Update Xcode project

* Increment network version

* Fix pragma mistake

* Fix none network builds

* Update replays

* Improve ChecksumStream and use FNV internally

* Small cleanups

* satisfy compilers

* Revert change of checksum size to simplfy rerecording

* Zero initialise data

* Fix serialiser

* Update replays again

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
Co-authored-by: Matt <m.moninger.h@gmail.com>
2021-05-09 19:12:44 +01:00
Ririan 417e5ae7d5
Fix Duplicate Entries in Free Food Ad Campaign
When opening and closing the dropdown box multiple times while attempting to create an ad campaign for free food vouchers, the game would duplicate the available food items in the list each time.

I discovered that it was because the vector wasn't being cleared each time the list was populated it, so an easy fix is to clear it before continuing.
2021-05-07 14:53:53 +02:00
Ted John 2a0535d966
Fix #13986: OpenGL: Track preview, flip/rotate does not update thumbnail
Invalidate SPR_TEMP so that it is not cached in the OpenGL drawing engine.
2021-04-27 11:30:52 +02:00
Michael Steenbeek c9943ee11d
Merge pull request #14458 from Gymnasiast/backport-nsf
Backport ride limit refactors from new-save-format
2021-04-20 23:25:53 +02:00
Duncan 8eabdf8c8f
Split guest and staff peep variables (#14462)
* Split guest and staff peep variables

* Move variable location

* Increment network version

* Update replays
2021-04-18 17:48:21 +01:00
Gymnasiast 1c5af028e1
Fix placing entrance/exit for ride ID >= 256 2021-04-16 18:56:16 +02:00
Gymnasiast d857dca36d
Replace hardcoded max number of trains per ride 2021-04-16 18:56:16 +02:00
Gymnasiast 084bfe0d48
Remove global from PlaceParkEntranceAction 2021-04-14 15:03:09 +02:00
Gymnasiast 5e28586a1c
Create ProvisionalFootpath struct 2021-04-14 14:56:28 +02:00
Gymnasiast 85157d8604
Move some globals to Footpath window 2021-04-14 14:31:10 +02:00
Hampus 1b64fc871b
Close #13805: Refactor Sign window to class (#14417)
* Refactor window to class: Sign

Fix: Refactor window to class: Sign #13805
2021-04-12 08:53:58 -03:00
Jacob Caudill 86e9fe6f19
Close #13788: Refactor News to new Window framework (#14404)
* Refactor News for new Window framework
2021-04-12 08:53:06 -03:00
Michał Janiszewski 7d2823d1f0
Merge pull request #14313 from adam-bloom/cmake_macos_app_bundle
cmake macOS .app bundle
2021-04-06 20:43:30 +02:00
Gymnasiast 79302e88a5
Rename _tileElement to _bannerElement 2021-04-03 22:43:57 +02:00
Gymnasiast f5ec127eaf
Fix #14409: NPE when demolishing banner 2021-04-03 22:09:24 +02:00
Gymnasiast 943e89d5a6
Use BannerElement instead of TileElement 2021-04-03 22:07:11 +02:00
Ted John ea961aed93
Fix #14428: No text visible in in-game console window (#14429) 2021-04-03 00:12:30 +01:00
adam-bloom e45d002562 Remove unnecessary verify_app function
fixup_bundle performs bundle verification, so this was a duplicate
2021-04-01 22:37:09 -06:00
adam-bloom dc0d77a951 include shaders (required for OpenGL) 2021-04-01 22:00:04 -06:00
adam-bloom 77ea64a5ef function for downloading object/sequence/dependency zips 2021-04-01 22:00:04 -06:00
adam-bloom 06e0e3db51 add MACOS_BUNDLE cmake option to build self-contained app bundle 2021-04-01 22:00:04 -06:00
Michael Steenbeek 7344b7fbfd
Use 16-bit ride_id_t thoughout and raise RIDE_ID_NULL (#14411)
* Replace RIDE_ENTRY_INDEX_NULL with OBJECT_ENTRY_INDEX_NULL

Ride entries are objects like any other, so there is little point having separate constants.

* Use ride_id_t in many more places

* Change RIDE_ID_NULL to 0xFFFF

* Increment network version

* Update replays

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2021-04-01 16:02:57 +01:00
Michael Steenbeek 9ee3c81768
Merge pull request #14397 from Gymnasiast/refactor/hardcoded-terrain-constants
Remove hardcoded terrain style constants from RCT1 and MapGen
2021-03-31 20:18:12 +02:00
Tulio Leao 7e78061e16 Use ScreenCoordsXY on InGameConsole 2021-03-29 09:34:11 -03:00
Tulio Leao bb8c275df6 Remove raw coords gfx_fill_rect_inset overload 2021-03-29 09:34:11 -03:00
Tulio Leao 08e182fba2 Use ScreenCoordsXY on Graph methods 2021-03-29 09:34:11 -03:00
Tulio Leao eab297f9ff Use ScreenCoordsXY on Graph::Draw 2021-03-29 09:34:11 -03:00
Tulio Leao d34dc3c924 Increase usage of ScreenRect' gfx_fill_rect_inset on Finances 2021-03-29 09:34:09 -03:00
Tulio Leao 090aadb647 Use ScreenCoordsXY on window_guest_stats_bars_paint 2021-03-29 09:31:05 -03:00
Tulio Leao aa88c8d181 Increase usage of gfx_fill_rect_inset that uses ScreenRect 2021-03-29 09:31:05 -03:00
Tulio Leao d5b5c10e80 Use ScreenCoordsXY for window_game_bottom_toolbar_draw_park_rating 2021-03-29 09:31:04 -03:00
Tulio Leao 2f608c32ab Use ScreenCoordsXY for window_ride_maintenance_draw_bar 2021-03-29 09:31:04 -03:00
Michał Janiszewski ed40badcb1
Initialise variable to fix Launchpad ppc64el builds
`src/openrct2-ui/windows/TopToolbar.cpp:2112:13: error: ‘side’ may be used uninitialized in this function [-Werror=maybe-uninitialized]`
2021-03-29 09:52:52 +02:00
Gymnasiast b3bbdcbfd5
Remove hardcoded terrain style constants from RCT1 and MapGen 2021-03-27 17:34:10 +01:00
Gymnasiast 22ba7a2bc1
Fix drawing; fix formatting 2021-03-27 15:56:01 +01:00
calvin 6342fd3d9a
Display track file path in track selector 2021-03-27 15:11:08 +01:00
Geoff B 6c8493cb69
Close #14253: Replace font size tokens with adjusted DrawText calls 2021-03-27 14:40:17 +01:00
Duncan 0a47d2157a
Use more specific types where appropriate (#14388)
It takes marginally more time to get a Peep than a Guest/Staff so may as well go straight to the correct type
2021-03-25 08:44:25 +00:00
TELK 040a3eb144
Fix part of #7489: Shortcuts work incorrectly for vertical tracks 2021-03-24 20:32:03 +01:00
Michael Steenbeek 19b1958822
Merge pull request #14332 from DKarandikar/develop
Close #13749: Move Banner window to new framework
2021-03-24 20:30:42 +01:00
Duncan 977d05ba29
Entity type5: Remove peep assigned type (#14380)
* Remove users of AssignedPeepType

* Remove AssignedPeepType

Field no longer required due to changes to EntityType

* Move enum to the RCT12 header

* Increment network version

* Update replays
2021-03-24 08:54:05 +00:00
Michael Steenbeek a5a63f839a
Allow passing ImageId into gfx_draw_sprite() 2021-03-23 11:58:09 +01:00
Daniel Karandikar d4efbdf531 Refactor InitTileElement
Break loop when going to go outside of Tile
2021-03-22 19:23:36 +00:00
Daniel Karandikar 5ef750a879 Tidy up BannerWindow::Initialise 2021-03-22 19:23:34 +00:00
Daniel Karandikar 1551389bf5 camelCase for local vars 2021-03-22 19:23:28 +00:00
Daniel Karandikar 248d6a0683 Prepend _ to private member fields 2021-03-22 19:23:20 +00:00
Michael Steenbeek d1267a276f
Merge pull request #14355 from duncanspumpkin/fix_14353
Fix #14353. Provide a buffer for text input
2021-03-20 14:58:02 +01:00
Michael Steenbeek 430711a33b
Cache HasFilePicker() value in UiContext 2021-03-20 14:51:15 +01:00
Cory Sanin f1cd58c292
Fix #14330: join_server uses config default_port 2021-03-20 14:09:47 +01:00
duncanspumpkin 820668d0aa Use unsafe strlen for platforms without strlen_s 2021-03-20 07:27:23 +00:00
duncanspumpkin ee575d5b8c Use std::vector to prevent violations of std string 2021-03-20 07:22:00 +00:00
duncanspumpkin 07b2945c5b Fix #14353. Provide a buffer for text input 2021-03-19 18:25:14 +00:00
Michael Steenbeek 850e7431c3
Merge pull request #14328 from Gymnasiast/fix/14315
Fix #14315: Crash when renaming APVC in Korean
2021-03-18 22:49:13 +01:00
Duncanspumpkin 0957542503
Implement C++ solution to truncate UTF8 strings 2021-03-18 22:14:12 +01:00
Maximilian Bottin 6f28914f61
Fix #14296: Allow early scenario completion in multiplayer 2021-03-18 20:30:11 +01:00
Duncan df7a284822
Entity type 2: Remove sprite_identifier (#14334)
* Start changing the underlying type

* Further work

* Complete refactor

* Further cleanup

* Remove pointless check

* Increment network and plugin versions

* Add defaults

* Further defaults

* Fix test paint

* Update replays
2021-03-17 08:04:41 +00:00
Duncan 6ec379cd0e
Split Entity Lists by Entity type (#14326)
* Make initial changes to add entity type

* Make further corrections

* Revert header changes

* Fix mistakes
2021-03-16 11:18:06 +00:00
Daniel Karandikar 1229ce6b22 Refactor Banner to use new Window framework
Also tidy up a couple of bits of duplicated code
Pulled out into CreateViewport method and tileElement member
2021-03-15 22:59:19 +00:00
Michael Steenbeek 96524e2b4a
Convert Land window to class 2021-03-15 23:08:00 +01:00
Gymnasiast 645685de18
Fix #14315: Crash when renaming APVC in Korean 2021-03-15 21:27:13 +01:00
Duncan 5474194905
Implement train view and remove linked_list_index (#13956)
* Make train manager view

* Remove linked list index field

* Remove merge mistake

* Fix further rebase errors

* Rename and add comments

* Update replays

* Fix Xcode project

* Increment network version

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2021-03-15 08:13:00 +00:00
manatails 4fe5b1dc79
Add "Vandals stopped" stat for security guards (#14071)
* Add a stat for security guards: Vandals stopped

* Update src/openrct2-ui/windows/Staff.cpp

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>

* Update src/openrct2/peep/Guest.cpp

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>

* No need to update screenCoords at the last line

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>

* Add changelog entry and bump network version

* Update to new UI code

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2021-03-14 09:18:35 -03:00
frutiemax 8acdcca712
Part of #12098: Use ScreenRect on gfx_filter_rect in Error.cpp (#14288) 2021-03-13 22:03:13 -03:00
frutiemax cd9873a78d
Use ScreenLine on gfx_draw_line_software 2021-03-13 16:52:58 +01:00
Michael Steenbeek 85c59b88be
Convert New Campaign window to a class 2021-03-13 16:51:54 +01:00
Michael Steenbeek 55fea26a96
Fix #14172: Assertion hit in window_tile_inspector_swap_elements() 2021-03-07 14:53:44 +01:00
Michael Steenbeek 01ddea5fab
Fix #14198: Crash when creating new folder 2021-03-06 20:07:18 +01:00
Ted John 966129dd7c
Remove network traffic window
Now available in the DevTools plugin.
2021-03-06 14:47:06 +01:00
Ted John b179f6e597
Merge pull request #13965 from telk5093/footpath_hotkeys
Make ride construction shortcuts work for footpath too
2021-03-06 01:27:18 +00:00
Michael Steenbeek 3b94132bab
Merge pull request #14219 from Gymnasiast/fix/14102
Fix #14102: NPE in window_tile_inspector_invalidate()
2021-03-03 22:48:16 +01:00
Gymnasiast 66a5e28832
Avoid referencing null tile elements or derivations 2021-03-03 22:06:16 +01:00
Michael Steenbeek 0b73781df8
Fix #14216: Second line of guest thoughts is set in wrong font 2021-03-03 16:00:03 +01:00
Gymnasiast 52d0689484
Add null checks to all other scenery object usages 2021-03-03 10:25:35 +01:00
Gymnasiast e332c2a691
Fix #14102: NPE in window_tile_inspector_invalidate() 2021-03-03 10:21:49 +01:00
Gymnasiast 229f374672
Improve positioning of mechanic status 2021-03-02 23:19:00 +01:00
Gymnasiast 50da55eaf3
Fix #14212: Multiline news messages are shown incorrectly 2021-03-02 22:48:33 +01:00
Gymnasiast 30edc834ee
Fix #14211: 'Mechanic X heading for ride' runs out of window 2021-03-02 22:37:15 +01:00
TELK 25bbbef7d1 Fix code formatting 2021-03-03 00:02:46 +09:00
Ted John 9b43ace649
Fix ui.showTextInput performance issue (#14210)
Over 2 GiB of memory was being allocated when calling ui.showTextInput. Restrict max length to 4 KiB.
2021-03-01 22:09:51 -03:00
Michael Steenbeek c98746c910
Fix #14206: Text runs out of Ride window
For some reason, the window used `gfx_draw_text_centred_wrapped()` before.
2021-03-01 20:31:15 +01:00
Ted John d3e54bb579
Merge pull request #14191 from IntelOrca/fix/14190-shortcut-crash
Fix #14190: Game crash likely related to plug-in hotkeys
Fix #14194: Pressing WASD in text box moves main viewport, too
Fix #14195: Binding (NumPad) Enter to send message closes the chat
2021-03-01 14:13:45 +00:00
adam-bloom d1057d66fc fix mingw builds 2021-02-28 15:48:30 -07:00
adam-bloom 9efe184538 macOS cmake CI fixes
Use ninja instead of make for faster builds
Proper library linking of dependencies
2021-02-28 15:48:30 -07:00
Adam 81fe5ad2cd
Remove unused const: MusicStyleNames 2021-02-28 22:57:23 +01:00
Gymnasiast a0523339d3
Apply review request 2021-02-28 21:24:17 +01:00
Ted John 083d22adf2 Fix #14195: Binding (NumPad) Enter to send message closes the chat 2021-02-28 14:08:16 +00:00
Ted John 789b04b4aa Fix #14194: Pressing WASD in text box moves main viewport, too 2021-02-28 14:07:56 +00:00
Ted John 17a29dfe87 Fix #14190: Game crash likely related to plug-in hotkeys
Do not cache references to RegisteredShortcut as they can be invalidated when new shortcuts are registered / removed.
Use a map to improve query performance of shortcut by ID.
Store a separate list of strings for the map to use as a key.
2021-02-28 01:13:43 +00:00
Gymnasiast d6971fa79e
Fix rebase errors 2021-02-28 00:35:38 +01:00
Gymnasiast 7fd049c22e
Remove last remnants of gCurrentFontSpriteBase 2021-02-28 00:26:53 +01:00
Gymnasiast c40701d997
Make gfx_draw_string() take a TextPaint argument 2021-02-28 00:26:20 +01:00
Gymnasiast 503273793a
Remove gCurrentFontSpriteBase from some functions 2021-02-28 00:26:20 +01:00
Gymnasiast 826f6c7442
Reduce usage of gCurrentFontSpriteBase 2021-02-28 00:25:30 +01:00
Gymnasiast 3e536e2711
Change gfx_draw_string_*_wrapped() to DrawTextWrapped() 2021-02-28 00:23:01 +01:00
Gymnasiast e2ebc9d43b
Replace gfx_draw_string_left() with DrawTextBasic() 2021-02-28 00:23:00 +01:00
Gymnasiast d5f79b7972
Replace gfx_draw_string_centred() with DrawTextBasic() 2021-02-28 00:23:00 +01:00
Gymnasiast 4d9c278ebc
Unify calls to DrawTextBasic 2021-02-28 00:23:00 +01:00
Gymnasiast 2477933c51
Turn font sprite base into a strong enum 2021-02-28 00:23:00 +01:00