Commit Graph

26488 Commits

Author SHA1 Message Date
Michał Janiszewski
dfcb527ada Ensure TTF system is torn down in correct order (#21707)
`TTFDispose` uses `gCurrentTTFFontSet` to deallocate internal resources.
Having the function called after global variable got changed meant it
tried to deallocate incorrect font and would subsequently call
`FT_Done_Face` on a struct having internal data set to nullptr.

Reproduction is fairly easy:
1. launch the game in Korean (I made sure to have all the indexes primed
   for this language beforehand - i.e. launch it twice),
2. switch to Japanese,
3. switch back to Korean

Fixes #21664
2024-04-02 00:52:40 +02:00
John Kastner
6ea091841f Fix memory leak loading malformed SawyerChunk (#21508)
* Fix memory leak loading malformed `SawyerChunk`

A temporary buffer was not free'd after failing to parse in
`SawyerChunkReader::ReadChunkTrack`. Fix this following the pattern used
in `SawyerChunkReader::ReadChunk` by wrapping the relevant code in a
`try` block with `FreeLargeTempBuffer` called when an exception is
caught.

* Use unique_ptr

* Remove `AllocateLargeTempBuffer`

---------

Co-authored-by: Michał Janiszewski <janisozaur@gmail.com>
2024-04-01 22:40:14 +00:00
Claudio Tiecher
a94e6c54d8 Part of #21421: replace define with constexpr (#21679) 2024-04-01 07:00:32 -03:00
Michael Steenbeek
9062049be1 Fix sound effects not working with RCTC base, fix audio object conflict
Due to this overwriting of object IDs, loading the sound effects would not work on RCTC. This overwriting also caused object conflicts which weren’t always won by the RCTC one. This fixes both problems by using non-clashing names, and only renaming one to `rct2.audio.base`, the name expected by the asset packs.
2024-03-31 22:28:17 +00:00
Michał Janiszewski
06081eb23d Fix #21691: Use correct iterator in RideCheckTrackContainsBanked (#21701) 2024-04-01 00:23:37 +02:00
Michael Steenbeek
19a65d1642 Bump network version for large scenery fix (#21699) 2024-03-31 19:25:19 +02:00
Michael Steenbeek
0668f0fb92 Fix #21695: Cannot remove large scenery 2024-03-31 17:57:14 +02:00
Michał Janiszewski
d8ba574e6c Default-initialise more members of Ride (#21694)
It seems they got omitted in https://github.com/OpenRCT2/OpenRCT2/pull/21514
2024-03-31 00:12:24 +01:00
Michael Steenbeek
8d16c0a73d Merge pull request #21647 from Gymnasiast/refactor/image-import
Refactor image import
2024-03-31 00:08:31 +01:00
Michael Steenbeek
ab73fe7317 Merge pull request #21514 from ZehMatt/ride-initialization
Default Ride initialization
2024-03-30 23:34:20 +01:00
ζeh Matt
84d1f502b1 Rename NO_TRAIN to kNoTrain 2024-03-30 23:18:51 +01:00
ζeh Matt
f14b86426d Remove some unnecessary field assignments in RideCreateAction 2024-03-30 23:18:51 +01:00
ζeh Matt
e3343f263f Default initialize newly created Rides 2024-03-30 23:18:08 +01:00
ζeh Matt
d969a4f80d Default initialize all members in Ride 2024-03-30 23:18:08 +01:00
Gymnasiast
88eca0d518 Move everything in ImageImporter.cpp into namespace 2024-03-30 18:13:03 +01:00
Gymnasiast
c232aa9b0c Create import meta object, use single method for JSON parsing 2024-03-30 18:13:03 +01:00
Gymnasiast
eb2cda6a56 Replace "forceBmp": true with "format": "raw" 2024-03-30 18:13:02 +01:00
Michael Steenbeek
27e43b3a94 Merge pull request #21581 from pfroud/cleanup-error-logging
Cleanup error logging
2024-03-30 18:08:12 +01:00
Gymnasiast
18232341c8 Remove unused variables 2024-03-30 17:31:59 +01:00
Peter Froud
c4b7845c26 Use if... else if 2024-03-30 17:15:17 +01:00
Peter Froud
869d1b398b Assign variable in condition for documentation 2024-03-30 17:15:17 +01:00
Peter Froud
322321645b Add STR_ERR_INVALID_COLOUR 2024-03-30 17:15:14 +01:00
Peter Froud
2b1d5ad9b7 Use specific error stringIDs 2024-03-30 17:12:54 +01:00
Peter Froud
276ff311cf Add LOG_WARNING about bugged scenery entry 2024-03-30 17:12:54 +01:00
Peter Froud
1f698dfc76 Add LOG_ERROR calls 2024-03-30 17:12:54 +01:00