1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 00:04:43 +01:00
Commit Graph

1543 Commits

Author SHA1 Message Date
Aaron van Geffen
e300ca8277 Move .maxBankLoan into ParkData struct 2025-08-13 22:29:25 +02:00
Aaron van Geffen
68a4991971 Move .bankLoan into ParkData struct 2025-08-13 21:24:06 +02:00
Aaron van Geffen
94f40e46ef Move .companyValue into ParkData struct 2025-08-13 21:08:00 +02:00
Aaron van Geffen
b842537616 Move .cash, .cashHistory into ParkData struct 2025-08-13 20:23:14 +02:00
mix
b43e3e6727 Add option to draw bounding boxes to command line screenshot command (#24949) 2025-08-12 05:57:20 -03:00
Joel Teichroeb
a146f38194 Fix #24173: Allow all game speeds between 1 and 8 if developer mode is on (#24270) 2025-08-07 12:10:24 +02:00
Michał Janiszewski
f6292b4c13 Use clang-format 20 (#24861)
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
2025-07-31 11:01:48 +02:00
Michał Janiszewski
763242b14d Add ability to scroll the map with gamepad stick 2025-07-03 22:48:59 +02:00
Garv Changrani
b47506dd90 Close #24665: Don't return empty strings with quotes for std::string 2025-07-02 13:33:54 +02:00
Cory Sanin
6fc950d38f Feature: Add optional screenshot argument for Z coord 2025-06-24 00:19:24 +02:00
mix
8d2309a4c2 Change magic numbers to constants in Viewport::Invalidate function 2025-06-13 21:13:34 +01:00
mix
92dd81b9ea Change tile related magic numbers to consts in map animation code 2025-06-13 21:13:34 +01:00
mix
8a5145678c Pass viewport through map animation invalidation functions 2025-06-13 21:13:33 +01:00
mix
e464b2ebe7 Don't invalidate map animations for tiles that are not in view 2025-06-13 21:13:33 +01: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
Aaron van Geffen
dac097ce64 Rework news options into one tab in the news window 2025-06-10 21:13:05 +00: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
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
Harry-Hopkinson
2b19320db3 Remove unused function (WindowGetPreviousViewport) 2025-05-27 18:26:08 +00:00
73
6bbb0e8348 Fix typo on VIEWPORT_FLAG_INDEPENDENT_ROTATION
This fixes a typo on a variable.
2025-05-26 12:05:13 +02:00
Harry Hopkinson
994cc858e8 More efficiently search viewports for playing Audio 2025-05-26 08:37:44 +01:00
Harry Hopkinson
371dcc28f5 More efficiently search viewports 2025-05-26 08:37:15 +01:00
Gymnasiast
d2615beb6e Change News enums to use lowerCamelCase 2025-05-24 23:47:18 +02:00
Tulio Leao
b04348c56b Make error message on console set command more descriptive
Previously when using `set variable something` you would always get the non-helpful message: "set variable command failed, likely due to permissions."

Since all of these are going through game actions, we can use the GameActionResult to return something more meaningful. For example, trying to do `set game_speed 5`:
Before:
![image](https://github.com/user-attachments/assets/7e52143b-ca5d-461c-8475-408ba6346350)

After:
![image](https://github.com/user-attachments/assets/44160ceb-954b-41f6-80e3-fe581403b404)
2025-05-23 15:44:16 +02:00
mix
12606f3d9b Simplify the code of a couple of viewport screen coord calculations 2025-05-22 20:58:55 +01:00
mix
03d31d1a7c Fix viewport invalidation offsetting position each loop iteration 2025-05-22 20:58:55 +01:00
mix
5e51c89d9f Fix extra viewport invalidating every frame 2025-05-22 20:58:55 +01:00
mix
0b5fb11be9 Remove unnecessary window OnResize calls 2025-05-22 20:58:54 +01:00
mix
04c3113593 Simplify window visibility check iteration 2025-05-21 21:37:07 +01:00
mix
cc813e3f16 Refactor window visibility cache and fix viewport visibility 2025-05-21 18:06:06 +01:00
Gymnasiast
b68b177737 Change MAX_BANNERS to kMaxBanners 2025-05-20 22:57:03 +02:00
Matt
e20824d1fa Fix #24422: More than one viewport is causing issues 2025-05-17 22:38:25 +02:00
Matt
77511786b2 Merge pull request #24407 from ZehMatt/windows-storage
Eliminate more shared_ptr usage
2025-05-17 01:18:00 +03:00
ζeh Matt
c37327a9c9 Use continuous but stable storage for viewports 2025-05-17 00:45:08 +03:00
ζeh Matt
39479d7b12 Use vector and unique_ptr for windows storage 2025-05-17 00:45:08 +03:00
Matt
42df41efdb Remove the use of shared_ptr for the Context (#24404)
* Replace shared_ptr with unique_ptr for Context systems, return refs

* Fix all the users

* clang-format fix

* Fix linux builds
2025-05-15 22:46:06 +03:00
Matt
6335c31336 Rename DrawPixelInfo to RenderTarget (#24339)
* Begin backend separation, rename type DrawingPixelInfo to RenderTarget

* Rename dpi variables to rt
2025-05-04 22:06:46 +00:00
mix
9ace1a8a2b Fix #24303: Track pieces do not draw in the ride construction window 2025-04-29 02:28:12 +01:00
Aaron van Geffen
7e9cc6df5d Merge pull request #24288 from AaronVanGeffen/close-buttons
Generalise white close button strings to all translucent title bars
2025-04-26 11:30:29 +02:00
ζeh Matt
12063aa884 Rename SetLocation to SetViewportLocation, this is less confusing 2025-04-25 17:48:39 +03:00
ζeh Matt
7a764a05a8 Ensure we invalidate the window when changing viewport location 2025-04-25 17:48:39 +03:00
ζeh Matt
8503faa289 Set viewport location immediately, fixes rotation using stale position 2025-04-25 17:48:39 +03:00
ζeh Matt
eb6b554d77 Fix screenshots not having a render context 2025-04-25 17:48:37 +03:00
ζeh Matt
576a757200 Add safe guards to make sure we have a valid drawing context 2025-04-25 17:48:37 +03:00
ζeh Matt
e3062985c0 Fix code calling ViewportUpdatePosition this is incorrect 2025-04-25 17:48:37 +03:00
ζeh Matt
c9bba5ee63 Workaround for OpenGL renderer viewport panning, turn it into a hybrid 2025-04-25 17:48:36 +03:00
ζeh Matt
911f821245 Simplify + clang-format correction 2025-04-25 17:48:36 +03:00
ζeh Matt
6d63b1f752 Skip dead windows in some iterations 2025-04-25 17:48:36 +03:00
Gymnasiast
734c0959ef Widen WindowFlags to 32 bits 2025-04-19 14:07:02 +02:00