1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 21:13:05 +01:00
Commit Graph

22032 Commits

Author SHA1 Message Date
mix
daf8c186d3 Add is animating state to scenery doors 2025-06-13 21:13:32 +01:00
mix
e467f5db02 Add temporary map animations 2025-06-13 21:13:32 +01:00
ζeh Matt
769a85afb7 Refactor how map animations are created and stored 2025-06-13 21:13:32 +01:00
mix
a12cf878fa Fix #17365: Surface slope wrong on x axis when expanding map size 2025-06-11 14:02:42 +02:00
Hielke Morsink
4d9f56b447 Fix: undefined behaviour in string construction (#24602)
Explicitly used `s` string literal suffix to ensure all concatenations are performed between `std::string` objects. This prevents unsafe implicit conversions and resolves a GCC warning about potential memory overlap caused by mixing raw string literals and `std::string` temporaries.

I ran into this issue when compiling OpenRCT2 for raspberry pi using GCC 12. The error it threw was:

```
In file included from /usr/include/c++/12/string:40,
                 from /usr/include/c++/12/stdexcept:39,
                 from /usr/include/c++/12/system_error:41,
                 from /usr/include/c++/12/bits/fs_fwd.h:35,
                 from /usr/include/c++/12/filesystem:44,
                 from OpenRCT2/src/openrct2/interface/../core/FileSystem.hpp:35,
                 from OpenRCT2/src/openrct2/interface/Screenshot.h:12,
                 from OpenRCT2/src/openrct2/interface/Screenshot.cpp:10:
In static member function ‘static constexpr std::char_traits<char>::char_type* std::char_traits<char>::copy(char_type*, const char_type*, std::size_t)’,
    inlined from ‘static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:423:21,
    inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.tcc:532:22,
    inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:2171:19,
    inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:1858:29,
    inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:3531:35,
    inlined from ‘ScreenshotGetNextPath()::<lambda(int)>’ at OpenRCT2/src/openrct2/interface/Screenshot.cpp:158:41,
    inlined from ‘std::optional<std::__cxx11::basic_string<char> > ScreenshotGetNextPath()’ at OpenRCT2/src/openrct2/interface/Screenshot.cpp:164:39:
/usr/include/c++/12/bits/char_traits.h:431:56: error: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ accessing 9223372036854775811 or more bytes at offsets [3, 9223372036854775807] and 2 may overlap up to 9223372036854775815 bytes at offset -4 [-Werror=restrict]
  431 |         return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
      |                                        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/libopenrct2.dir/build.make:2736: CMakeFiles/libopenrct2.dir/src/openrct2/interface/Screenshot.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:89: CMakeFiles/libopenrct2.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
```
2025-06-11 10:00:51 +02:00
Gymnasiast
81e3181ebb Pass ScreenSize to makeWindowShim() 2025-06-10 23:21:15 +02:00
Gymnasiast
bdba89f428 Pass ScreenSize to window creation functions 2025-06-10 23:20:28 +02:00
Gymnasiast
bd6ae5848c Rename remaining methods in Widget.h to lowerCamelCase 2025-06-10 23:20:18 +02:00
Aaron van Geffen
dac097ce64 Rework news options into one tab in the news window 2025-06-10 21:13:05 +00:00
Aaron van Geffen
ec3f9d1272 Disable scenario options rather than hiding them (#24559) 2025-06-10 20:05:06 +00:00
mix
6d1b8eba48 Fix ride window vehicle tab crop, position, zoomed out glitching 2025-06-10 19:29:25 +00:00
Michael Steenbeek
01d0fa52ea Merge pull request #24600 from Gymnasiast/refactor/window-stuff-2
Small widget code style refactor
2025-06-10 20:58:51 +02:00
mix
64e5602d60 Fix right click ride construction bugs when ghost track on same tile 2025-06-10 20:35:43 +02:00
Gymnasiast
757ab61b20 Refactor WidgetFlags to FlagHolder 2025-06-10 19:55:37 +02:00
Gymnasiast
650fa3ae2e Rename WindowWidgetType to WidgetType and change for new code style 2025-06-10 19:55:12 +02:00
Gymnasiast
149468406b Update WindowColour enum for new code style 2025-06-10 19:53:12 +02:00
Gymnasiast
86e265f093 Make widget creation functions lowerCamelCase 2025-06-10 19:51:21 +02:00
Aaron van Geffen
34a22113eb Default to using screenshots for scenario previews 2025-05-30 21:42:53 +02:00
Aaron van Geffen
a4e92770fd Defer temp object Load/Unload to calling side 2025-05-28 00:58:25 +02:00
Aaron van Geffen
342f10a63c Load scenario previews using temp objects too 2025-05-27 23:17:25 +02:00
Aaron van Geffen
d51a1754b4 Work around TryClassifyFile not working with .sea files 2025-05-25 22:21:08 +02:00
Aaron van Geffen
2b41a99449 Add scenario meta files for the remaining RCT1 DLC scenarios 2025-05-24 15:14:18 +02:00
Aaron van Geffen
0f59d6dd02 Optionally allow scenario previews to use screenshots 2025-05-21 18:07:19 +02:00
mix
8c8d3435f1 Rewrite ParkPreview::drawPreviewImage to use SPR_TEMP 2025-05-21 00:03:35 +02:00
Aaron van Geffen
ed6aa6c356 Show 'loading' stub while preview is being loaded 2025-05-16 21:44:57 +02:00
Aaron van Geffen
7cd59ab75f Create park preview images from scenario meta objects 2025-05-16 14:33:21 +02:00
Aaron van Geffen
66d67e2ee6 Populate image table for scenario meta objects 2025-05-16 13:02:36 +02:00
Aaron van Geffen
2d8d1e3eee Rename ScenarioText object type to ScenarioMeta 2025-05-16 12:54:14 +02:00
Aaron van Geffen
0779b9f0ab Replace window shim and widget macros with constexpr functions (#24566) 2025-06-07 23:02:14 +02:00
Tulio Leao
b8d73b523c Release v0.4.23
- Feature: [#22476] “Time since last inspection” statistic is available in the rides window.
- Feature: [#24313] [Plugin] Add API for setting a ride vehicle’s sprite to a smoke plume.
- Improved: [#24345] Vehicle fallback sprites are less likely to glitch with the track.
- Improved: [#24362, #24491] The Windows installer is now translated as well.
- Improved: [#24364] Improve the fallback vehicle sprites for Zero G Rolls, and allow small ones to be built without cheats if the fallbacks are available.
- Improved: [#24368] Clicking the in-game update notication now leads to a more user-friendly download page.
- Improved: [#24400] Ride list in preservation window is now sorted alphabetically.
- Improved: [#24409] Steam installs of RCT Classic are now detected automatically.
- Improved: [#24413] Better performance when moving the viewport on Windows and Linux platforms.
- Improved: [#24417] Improve the fallback vehicle sprites for Dive Loops.
- Improved: [#24433] The ride, new ride, scenery, path, viewport, park and tool windows no longer redraw every frame if they have not changed.
- Improved: [#24467] Apply tweening only to on-screen entities when not zoomed out for better performance with uncapped FPS.
- Improved: [#24474] More efficiently search viewports when playing Audio.
- Improved: [#24479] More descriptive error messages for `set` commands in the in-game console.
- Improved: [#24563] The Linux .desktop file will now request the more powerful dedicated GPU on hybrid graphics systems.
- Change: [#24342, #24484] g2.dat is now split into g2.dat, fonts.dat and tracks.dat.
- Change: [#24362] The Windows installer now prevents installing to the same folder as RollerCoaster Tycoon 2 or Classic.
- Change: [#24418] Small & Large Zero G Rolls can now be built on the LIM Launched RC without cheats if vehicle sprites are available.
- Fix: [#5269] Font bugs when using the Russian release of RCT2 as the base game.
- Fix: [#11071, #22958] The virtual floor does not always draw correctly.
- Fix: [#18220] Some custom RCT1 scenarios are detected as competition DLC scenarios.
- Fix: [#20095] UCES Halloween - Cemetery Ridge scenario has mismatched entrance/exit on haunted house.
- Fix: [#20158] Custom animated scenery .DATs with frame offsets draw a random sprite at the end of their animation.
- Fix: [#22628] Potential crash while rebuilding the scenario index.
- Fix: [#23289] Dodgems and Flying Saucer cars can spawn on top of each other when the ride is opened.
- Fix: [#24332] Banner font renders differently when using RCT Classic as the base game.
- Fix: [#24343] Large gently sloped turns are buildable without cheats when the vehicles do not have sprites for them.
- Fix: [#24346] Possible crash during line drawing in OpenGL mode.
- Fix: [#24353] ‘Show dirty visuals’ is off by one pixel and does not work correctly with higher framerates.
- Fix: [#24362] When upgrading from an older version on Windows, old versions of official objects are not always removed.
- Fix: [#24366] Zero G Rolls have some incorrect vehicle yaw rotations.
- Fix: [#24371] Fix divide by zero in the scenery window when there is no scenery.
- Fix: [#24378] Prevent ride and stall statistics from overflowing.
- Fix: [#24388] Shortcut keys are not localised based on the user’s language settings.
- Fix: [#24403] Park fences draw underneath and through opaque water.
- Fix: [#24406] The network status window uses an undefined string for its title.
- Fix: [#24444] In the object load error window, the guide text overlaps when the title bar is enlarged.
- Fix: [#24446] [Plugin] Fix regression breaking the track iterator on specific track pieces.
- Fix: [#24447] Shortcut list is not refreshed when changing language.
- Fix: [#24448] Shortcuts involving the Caps Lock key are wrongly localised to NumPad Dot.
- Fix: [#24464] Window and viewport visibility is not calculated correctly causing minor performance issues.
- Fix: [#24488] Objects are not always redrawn immediately when they are reloaded from the Object Selection window.
- Fix: [#24544] RCT1 Maze designs with wooden walls are not imported correctly.
- Fix: [#24567] Long flat-to-steep wooden mine support sprites don't connect to flat supports exactly.
2025-06-07 05:46:48 -03:00
Tulio Leao
78fd458cfc Update backtrace token for upcoming release 2025-06-07 04:27:15 -03:00
mix
c97191a3d7 Add required sprites to unbanked and banked large gently sloped turns 2025-06-03 23:52:49 +02:00
mix
2d364ec070 Fix guest window viewport on pick up and thoughts not invalidating (#24535) 2025-06-03 07:04:10 -03:00
Michael Steenbeek
a3494d5358 Fix #24544: RCT1 Maze designs with wooden walls not imported correctly 2025-06-02 21:26:48 +00:00
Aaron van Geffen
ac21ff24c5 Remove const_cast in GetWidgetByIndex (#24554) 2025-06-02 19:48:57 +02:00
mix
5e2923b1ea Add constants to vehicle paint functions that use corkscrew sprites 2025-05-31 15:48:55 +01:00
mix
e225998452 Add bounding box index constants to vehicle paint functions 2025-05-31 15:48:55 +01:00
mix
be563676df Add const to z parameter of vehicle paint functions 2025-05-31 15:48:55 +01:00
mix
bda27e57ab Rename spriteNum to spriteIndex in vehicle paint and add const 2025-05-31 15:48:55 +01:00
mix
b78906a8b6 Use original intended bounding box for fallback vehicle sprites 2025-05-31 15:48:55 +01:00
matheusvb3
8dd7b7976f Prevent ride and stall statistics from overflowing (#24378)
* Prevent ride and stall statistic from overflowing

Clamps guestsFavourite, totalCustomers, lastInspection, totalProfit, numPrimaryItemsSold and numSecondaryItemsSold

* Change line of comment in Ride.h

This caused the tooltip with the comment to appear when hovering over notFixedTimeout instead of breakdownSoundModifier in Visual Studio

* Remove redundant overflow prevention

* Invalidate maintenance tab

Missed this before. Also fix an issue I inadvertently caused with PR #23719 when updating the count of vandals stopped

* Deduce lastInspection type in compile time

* Add changelog entry
2025-05-31 03:10:36 +03:00
Michael Steenbeek
dea020fe7a Move TD46 stuff to own file 2025-05-30 00:04:52 +02:00
Michael Steenbeek
5088d60085 Merge pull request #24484 from Gymnasiast/refactor/split-g2-further
Split tracks.dat from g2.dat
2025-05-29 22:16:42 +02:00
Gymnasiast
c2b4158573 Split tracks.dat from g2.dat 2025-05-29 21:25:33 +02:00
Matt
fb834e64aa Merge pull request #24474 from Harry-Hopkinson/more-efficiently-search-viewports
Fix #24426: More efficiently search viewports.
2025-05-29 21:24:14 +03:00
Aaron van Geffen
f64d5bb4a6 Implement OnLanguageChange event for ScenarioSelect window (#24519) 2025-05-28 00:31:43 +02:00
Matt
d2e3430df2 Add the ability to temporarily load objects without registering them (#24521) 2025-05-27 22:13:42 +00:00
Aaron van Geffen
a7b12594c8 Perform an additional name check for competition scenarios (#24518) 2025-05-27 22:14:54 +02:00
Harry-Hopkinson
2b19320db3 Remove unused function (WindowGetPreviousViewport) 2025-05-27 18:26:08 +00:00
mix
594ecf54ac Fix new ride window not always updating when searching (#24515) 2025-05-27 20:23:02 +02:00