Commit Graph

11604 Commits

Author SHA1 Message Date
Michael Steenbeek 136b1e7456 Add sprite file option to force BMP encoding 2018-07-20 17:29:34 +02:00
Michael Steenbeek 93bc11a93a Refactor _spriteFontCharacterWidths 2018-07-20 15:56:21 +02:00
Michael Steenbeek 41dcae581a Remove support for the unused big font 2018-07-20 15:56:21 +02:00
Michael Steenbeek b2873d2f86 Use more constants 2018-07-20 15:08:25 +02:00
Michael Steenbeek 8530d56a66
Add Danish translation (#7771) 2018-07-19 21:15:54 +02:00
Øystein Dale de464e2783 Use a better constructor in StringBuilder::GetStdString 2018-07-18 23:57:11 +02:00
Michał Janiszewski 4a77801cb3
Increase the allowed aspect ratio epsilon (#7775) 2018-07-18 22:33:20 +01:00
Michał Janiszewski 10f6059f09
Fix #7793: Duplicate private keys generated (#7794) 2018-07-18 22:11:34 +01:00
Ted John 3d85ec4ea1
Fix #7786: Crash when importing a track design (#7790) 2018-07-18 21:19:25 +01:00
Øystein Dale 5744509b87 Fix memory leak in config
Assigning a pointer to std::string appears to only perform a copy and
does not transfer ownership of the pointer, thus the allocated memory is
will never be freed. Use StringBuilder::GetStdString() to avoid the
memory leak.
2018-07-18 00:57:37 +02:00
Øystein Dale 934e53869c Fix memory leaks in localisation
Assigning a pointer to std::string appears to only perform a copy and
does not transfer ownership of the pointer, thus the allocated memory is
will never be freed.

Implement a method to construct an std::string from a StringBuilder to
avoid memory leaks when retreiving the contents of a StringBuilder and
storing it in a std::string.
2018-07-18 00:07:48 +02:00
Øystein Dale 34cf068650 Fix memory leak when deserialising objects
Assigning a pointer to std::string appears to only perform a copy and
does not transfer ownership of the pointer, thus the allocated memory is
will never be freed. Use IStream::ReadStdString instead to return a
std::string directly, thus transferring ownership correctly.
2018-07-18 00:07:48 +02:00
Matthew Beaudin 183411aa54 Fix #7773: Once research has been completed, player is still charged for research 2018-07-17 21:54:42 +02:00
Michał Janiszewski ab20dcde9f
Use "secure version" of swcanf (#7774)
This makes mingw builds usable again
2018-07-16 07:38:57 +01:00
Ted John f728a5074a
Fix #7765: Crash when opening ride list window on Windows Vista (#7781)
It has been reported that Windows Vista crashes in LCMapStringEx when
using LOCALE_NAME_INVARIANT even though it is documented as supported.

As a counter measure, use LOCALE_NAME_USER_DEFAULT for the time being.
2018-07-14 08:52:12 +01:00
Christian F. Coors 54c0eff6a6 Show command descriptions even if only -a is passed (#7780) 2018-07-13 21:02:19 +02:00
Simmo Saan 3f8c3c32ea Fix #7766: Found ICU include directories being unused (#7767)
When ICU is installed separately from the system and paths configured in
CMake then the detected include directories should also be used for
compilation instead of blindly using unconfigured system includes.
SYSTEM flag ignores suggest-override warnings in ICU headers.
2018-07-08 22:16:27 +02:00
Brian Callahan 66bfd42551 Do not print which(1) errors to the console
On first launch of the game, OpenRCT2 tries to find Gnome or KDE eyecandy dialog programs zenity and kdialog to inform the user to set the `game_path`. It will fall back to an SDL popup with manual instructions if neither is found, which looks fine. However, if OpenRCT2 is launched from the command line, which will print "file not found" errors if you don't have zenity and/or kdialog installed, which might potentially confuse the user.

This patch routes the error messages to `/dev/null`, as we don't really care if those programs are not found.

See this thread on the OpenBSD mailing list: https://marc.info/?l=openbsd-ports&m=153020454402268&w=2
2018-07-07 20:53:50 +02:00
Michael Steenbeek 9e559d577a
Fix Steam path for Linux and macOS
While OpenRCT2 already had code to look up the Steam path on macOS and Linux, it didn't look in the correct directory. This meant that it wouldn't detect the presence of RCT2, even if the user had downloaded it via the Steam Console.
2018-07-05 09:42:52 +02:00
muemart 6365eaba66 Fix #3177: Wrong keys displayed in shortcut menu
SDL_GetScancodeName doesn't actually translate the scancode to the physical key, so first we need to convert the scancode to a keycode and then turn the keycode into a string.
2018-07-03 20:48:28 +02:00
Michał Janiszewski 13224104e4
Ensure HTTP request variables lives till it is used (#7744)
Solves https://www.reddit.com/r/openrct2/comments/8uftdh/
2018-06-28 22:23:21 +02:00
Ted John fe76c807aa Fix #7707: Opening scenario editor closes game
Ensure w is updated after closing the dropdown window.
2018-06-27 11:11:50 +02:00
Aaron van Geffen f963f969c1
Fix compilation on Linux, macOS. (#7732) 2018-06-26 11:16:03 +02:00
Ted John 0f2ccebfe7 Fix #7533: Screenshot is incorrectly named in CJK
For Windows, convert path to UTF-16 before passing to fstream constructor.
2018-06-25 18:14:55 +01:00
Gymnasiast 2172902b47 Update required objects version 2018-06-23 17:39:38 +02:00
Gymnasiast 5128737666 Rename some flags, move FLAG_16 to ride groups 2018-06-23 17:39:38 +02:00
spacek531 0861481cb6 First iteration 2018-06-23 16:24:01 +02:00
Ted John c640427d89 Add missing change from b80913d 2018-06-20 22:00:11 +01:00
Michał Janiszewski 3067534ef1
Merge pull request #6752 from janisozaur/android-cli
Fix #6751: Android CLI client is missing
2018-06-20 22:55:24 +02:00
Ted John b80913df08 Revert unintended changes in 1b08fb4
Change `FORMAT_uint16_t` back to `FORMAT_UINT16`
2018-06-20 21:42:52 +01:00
Ted John f79954bde3 Refactor map element organisation
Committing some changes that were originally for #7637.
- Refactor map_check_free_elements_and_reorganise
- Refactor map_strip_ghost_flag_from_elements
- Remove sub_68B089

I have removed sub_68B089 because this function was run every game tick
and 1000 times when trying to request some spare elements. It was a
lighter function which tried to stretch out the tile element pointers
behind any spare elements. In this day and age, doing a full tile
element defrag is very fast (even in debug mode it takes no more than
10ms), so I don't think keeping sub_68B089 is necessary.
2018-06-20 21:35:27 +01:00
Michał Janiszewski 5eda335b12 Link Android libopenrct2 with SDL2 for SDL_AndroidGetJNIEnv 2018-06-20 21:29:14 +02:00
Michał Janiszewski 0029fca38f Fix libraries linked to Android builds 2018-06-20 21:29:14 +02:00
Michał Janiszewski 362852f12e Fix #6751: Android CLI client is missing 2018-06-20 21:29:14 +02:00
Michael Steenbeek fae7c61f05 Fix config read/write 2018-06-20 17:56:57 +02:00
Michael Steenbeek 16f5c92bde Fix copy-paste error 2018-06-20 17:55:34 +02:00
Michael Steenbeek 1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Michael Steenbeek ec3a1e575e
Replace Math::Min and Max with std variants 2018-06-20 17:11:35 +02:00
Michael Steenbeek 323162cfe8
Fix #7711: Inverted Hairpin RC allows building invisible banked pieces 2018-06-20 11:32:29 +02:00
Michał Janiszewski 41b2168824 Fix namespace unused with HTTP disabled 2018-06-19 22:41:33 +02:00
Michał Janiszewski e1c5fda28d Compile Android builds with network support 2018-06-19 22:03:31 +02:00
Michał Janiszewski 6c4f714ecc
Update Android builds to use libs v0.9, link with ICU (#7712) 2018-06-19 21:57:44 +02:00
Michał Janiszewski 65d1c7f490
Fix and enable -Wtautological-unsigned-zero-compare (#7706) 2018-06-17 22:48:45 +02:00
Ted John 182bc1afe6 Fix #7696: Servers do not get registered on master server list
Correct the HTTP method used for the heartbeat request.
2018-06-16 22:37:23 +01:00
Ted John 98905fdbc3 Change g_window_list to use the heap for windows 2018-06-16 16:04:01 +01:00
Ted John 0f6138f8b6 Convert g_window_list to a std::vector 2018-06-16 16:04:01 +01:00
Ted John a716b4aa28 Remove use of window list in Viewport.cpp 2018-06-16 16:04:01 +01:00
Aaron van Geffen 1f5572fe28 Fix #7701: Strings overflow in drawing debug windows. (#7702)
The last widget was not taken into account.
2018-06-16 14:41:18 +01:00
Ted John 26666b1da9 Remove empty function: viewport_update_pointers 2018-06-15 23:15:52 +01:00
Michael Steenbeek c4cae83335
Fix AddRange to avoid duplicates in EntryList 2018-06-15 23:36:13 +02:00
Hielke Morsink 14d6625c15
Merge pull request #7695 from Broxzier/wide-path-debug
Add debug option to visualize wide path flags.
2018-06-15 17:07:50 +02:00
Hielke Morsink 0528a455e9 Automatically resize debug window to fit strings 2018-06-15 16:13:47 +02:00
Hielke Morsink 0fda25d365 Add debug option to visualize wide path flags.
This implements #7694
2018-06-15 16:08:25 +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
Michael Steenbeek d28e8a6126
Introduce calls to check for research markers 2018-06-15 12:11:03 +02:00
Hielke Morsink aad1e69d7e
Add parentheses to macro arguments (#7686)
This adds parentheses around macro arguments that are either negative or used for calculations inside the macro itself. Doing this avoids getting errors in code that may look right.
2018-06-15 10:54:05 +02:00
Michael Steenbeek 706843e135
Use `get_ride_entry()` to build the correct `rct_research_item` 2018-06-15 10:39:38 +02:00
Michael Steenbeek 74dd8a4eac
Merge pull request #5993 from wolfreak99/improved_window_inputs/ride_price_textinput
Make ride window prices allow text input
2018-06-15 10:09:37 +02:00
Michael Steenbeek 7bd4244797
Merge pull request #7628 from Chaosmeister/unpickable-research-items
make always researched researchitems unpickable.
2018-06-15 09:47:08 +02:00
Michael Steenbeek e6dcf43680 Adjust money-string functions for exchange rates 2018-06-15 09:36:17 +02:00
Aaron van Geffen ee64daae58 Fix event list. 2018-06-15 09:36:17 +02:00
Gymnasiast fe54cf5ee6 Allow forcing decimals 2018-06-15 09:36:17 +02:00
wolfreak99 961d25dbb9 Make ride window prices allow text input 2018-06-15 09:36:17 +02:00
Ted John fdb1d98868
Move rain window loop to libopenrct2ui (#7684) 2018-06-15 07:46:04 +01:00
Hielke Morsink c3cff07b91 Disallow placing items in-between always researched items
This adds a loop that iterates down the list, until it reaches either a researched item or the end.
2018-06-15 00:34:30 +02:00
Hielke Morsink c437f438f1 Remove invalid cast 2018-06-15 00:34:30 +02:00
Hielke Morsink 30b9d3a338 Move always_researched checks and add comments 2018-06-15 00:34:30 +02:00
Chaosmeister 308ae4b357 Make always-researched research items unpickable. 2018-06-15 00:34:30 +02:00
Michael Steenbeek 8a9dfa6033
Stop ride type dropdown state sharing among ride windows
This eliminates the _rideType variable, which was necessary when we still used a spinner and an Apply button, but is now no longer needed.
2018-06-14 20:15:31 +02:00
Aaron van Geffen e1f7efc7e9
Merge pull request #7665 from AaronVanGeffen/git_describe_version
Use `git describe` to express version in terms of closest tag
2018-06-14 16:57:25 +02:00
Aaron van Geffen fd74c6c93f Suppress branch info for releases on master. 2018-06-14 15:31:31 +02:00
spacek531 b79239586a Fix #7657: All vehicles ring a tram bell when crossing paths 2018-06-14 13:36:35 +02:00
Andy Ford ea371144e7 Fix #7643: No Money scenarios can have funding set to zero
If research funding is set to no funding and scenario money is turned
off, then update research at the normal rate.
2018-06-14 13:17:09 +02:00
Michael Steenbeek 9436dab66c
Fix #7655: Large portions of the screen do not invalidate properly
Also fixes #7676.
Error was introduced during refactoring in 85dc161c5a.
2018-06-14 12:01:55 +02:00
Ted John 9e9c2c072e Fix #7678: Crash when Loading or starting a new game...
...while having object selection window open

Close the object manager window before loading the next park.
2018-06-13 23:29:05 +01:00
Hielke Morsink 6b22a9d38b
Merge pull request #7586 from Broxzier/refactor/banner-ride-index
Banner code cleanups
2018-06-13 21:48:04 +02:00
Andy Ford 2ab3bd515d Fix #7673: Vehicle names cut in invention list (#7675)
* Fix #7673: Vehicle names cut in invention list

The string formatting was formatting based on the size of the
pointer to the buffer, not the buffer itself, this truncated all
vehicle names to 8 characters.

* Adjust Long Vehicle Names For Vertical Scrollbar

The ellipsis in long vehicle names were being cut off by
the scrollbar. Reduced the string formatting length by
vertical scrollbar size - 1. The extra 1 is for the fact
that the second column starts + 1 from the middlepoint of the box.
2018-06-13 21:44:25 +02:00
Ted John 86ca6be58b Fix #7674: Rides show up as random numbers in guest's ride list 2018-06-13 18:32:00 +01:00
Ted John dea935314e Add null check for showing guest's favourite ride 2018-06-13 18:27:32 +01:00
Hielke Morsink 6aa4704ea1 Use uint8 for ride index iterator 2018-06-13 15:44:20 +02:00
Ted John 7373987f0a
Merge pull request #6978 from tobiaskohlbau/refactor/network
HTTP: Refactor into modern C++
2018-06-12 21:50:46 +01:00
Ted John 9a94139242 Fix Linux builds 2018-06-12 21:18:13 +01:00
pkubaj fae367ccf9 Fix compilation with FreeBSD (#7668) 2018-06-12 20:46:34 +01:00
pkubaj 7a65faa477 Add string include (#7667)
LLVM 6.0 on FreeBSD needs it for basic_string template.
2018-06-12 20:46:20 +01:00
pkubaj 7fbbce5712 Include cstddef
This fixes compilation on FreeBSD and LLVM 6.0.
2018-06-12 14:38:59 +02:00
Aaron van Geffen 56250b43ab Use `git describe` to express version in terms of closest tag. 2018-06-12 00:25:04 +02:00
Aaron van Geffen 2cb0947620 Fix #7535: Render ẞ ligature in sprite font. 2018-06-11 22:34:01 +02:00
Aaron van Geffen 760f274d81 Fix #7616: Use unicode dingbats for +/- buttons in CJK languages. 2018-06-11 22:20:51 +02:00
Andy Ford ebf8c19272 Fix #7653: Loan spinner too small for big loans (#7663)
On large loans in the millions (e.g. Alton Towers / BPB), the loan
amount can extend that it runs over the loan spinner widget. This change
enlarges the loan box to allow for large loans.
2018-06-11 22:08:59 +02:00
Hielke Morsink 28a4cafffe Use constexpr and pragma once in banner.h
And fix two occurances where `BANNER_NULL` was used wrongly.
2018-06-11 14:47:50 +02:00
Hielke Morsink 7355b497a1 Use new banner index type
BannerIndex is defined in common.h (like some other types such as money32 and rct_string_id), so that banner.h wouldn't have to be includede everywhere. Later on, it may be nicer to have a custom types file instead of putting them all in common.h.
2018-06-11 13:29:41 +02:00
Hielke Morsink 08035f42f7 Fix compilation of SignSetNameAction.hpp
This header was missing some includes that it depends on. Some were included by other headers.
2018-06-11 13:29:32 +02:00
Hielke Morsink 388c2f9cb6 bump network version 2018-06-11 13:29:31 +02:00
Hielke Morsink 878288de76 Check for banner index correctly
At some places, BANNER_NULL and BANNER_INDEX_NULL were mixed, and at one point even MAX_BANNERS, causing the 250th banner to not be initialized properly. This commit makes the uses of those defines correct, and changes all relevant functions to return uint8 instead of sint32.
2018-06-11 13:21:48 +02:00
Hielke Morsink ead97a4638 Split colour into union with ride index
The colour field in the banner object is also used to store the ride index when a banner is linked to a ride. This commit turns this field into a union with both named fields, to make the code clearer.

It also changes the return types of related functions to uint8 instead of sint32, and makes use of the RIDE_ID_NULL define where applicable.
2018-06-11 13:21:48 +02:00
Aaron van Geffen 7cfa6aa176 Fix non-network builds. 2018-06-11 11:49:45 +02:00
Aaron van Geffen f1d4e5b596 Rename Http namespace, add default initialisers. 2018-06-11 11:19:04 +02:00
Michał Janiszewski bcd4e9c50b
Merge pull request #6284 from janisozaur/compiler-warnings
Compiler warnings
2018-06-11 11:06:34 +02:00
Tobias Kohlbau 62c25d88fb HTTP: refactor http into modern C++
Signed-off-by: Tobias Kohlbau <tobias@kohlbau.de>
2018-06-11 10:24:19 +02:00
Michał Janiszewski 5174119491 Disable -Wdocumentation for FreeType includes 2018-06-11 10:17:10 +02:00