Commit Graph

9875 Commits

Author SHA1 Message Date
Michał Janiszewski 35644a66e0 Fix android build 2017-10-19 10:48:25 +02:00
Michał Janiszewski 8fd2266bda Refactor includes (#6512)
* Refactor Intent.h inclusion

* Use forward declaration of ITcpSocket

* Remove unused include

* Forward declare rct_ride_entry

* Remove unused headers

* Forward-declare rct_drawpixelinfo

* Remove unused headers

* Lower header include from header to source file

* Reduce included headers

* Reduce includes
2017-10-19 10:01:05 +02:00
Marijn van der Werf bcb6b83a7d Fix #6514: Groupbox titles break format arguments 2017-10-18 21:55:20 +02:00
blackhand1001 ce0650daf5 Change min energy cheat to the correct min value 32.
Change min energy cheat to the correct min value 32. This fixes the issue with the min energy cheat that causes it to reset to 255 a few seconds after applying it.
2017-10-18 21:52:46 +02:00
Duncan d224f1219e Reintroduce error titles to game actions. Small refactor. (#6462)
* Reintroduce error title to game actions. Small refactor.

Removed setting error titles in any calling functions.
Refactored place park entrance result to conform with other game actions.

* Remove unread variable (fixing Travis)
2017-10-18 19:57:36 +01:00
Robert Jordan ec22d04089 Fix #6470: Title sequence naming issues
Predefined title sequence filenames are now treated as "reserved".
Custom title sequences cannot use reserved names and an error will
appear if the user tries.

Duplicating predefined title sequence now uses default text of
predefined sequence's proper name instead of filename.

Renamed `WIDX_TITLE_EDITOR_RENAME_SAVE_BUTTON` to
`WIDX_TITLE_EDITOR_RENAME_BUTTON` to follow formatting of other preset
button ids.

Added string id 6154, `STR_ERROR_RESERVED_NAME`, "Name is reserved".
2017-10-18 11:18:14 +02:00
Aaron van Geffen d6ee66acb4 Split/rename ROW_HEIGHT constant into widget-specific ones. 2017-10-18 11:17:22 +02:00
Aaron van Geffen 7e9a5bbb6b Increase padding for finances summary and marketing tab. 2017-10-18 11:17:22 +02:00
Michael Steenbeek ac7652f61d Create define for MONEY16_UNDEFINED 2017-10-18 08:06:16 +02:00
Michael Steenbeek 79365b7a91 Merge pull request #6075 from marijnvdwerf/ui/text-paint
Refactor text painting
2017-10-18 07:49:13 +02:00
Christian F. Coors e5ce3859a3 Fix Intent pointers/strings 2017-10-17 22:31:05 +02:00
Marijn van der Werf fcfa4ffcc2 Apply requested changes 2017-10-17 22:24:34 +02:00
Michael Steenbeek 221e42b56e Merge pull request #6505 from Gymnasiast/refactor/track-c
Compile track.c as C++, fix preview Z offsets
2017-10-17 19:51:15 +02:00
Michael Steenbeek 08929b8b19 Fix missed -1 pointer comparisons 2017-10-17 17:05:57 +02:00
Michael Steenbeek a23a40b447 Fix alignment and include order 2017-10-17 16:16:20 +02:00
Michael Steenbeek 0cb1e57cc6 Fix preview Z offset table entries 2017-10-17 13:59:57 +02:00
Michael Steenbeek a1621e4eb1 Track.cpp and Track.h: fix formatting 2017-10-17 13:55:53 +02:00
Michael Steenbeek bb01699b7d Compile track.c as C++ 2017-10-17 13:51:47 +02:00
Aaron van Geffen 60aa849a83 Increase height for items in shortcuts window.
This increases the height for each item in the keyboard shortcuts window from 10px to 12px.
While this may not seem like much, it ensures the text no longer overlaps for Japanese and Korean.
At also has the added benefit of making the window look a bit nicer for Western languages.
2017-10-17 11:39:24 +02:00
Michał Janiszewski 6695a4ce13 Fix #6497: Boat hire boats do not return to station
Credit goes to @duncanspumpkin
2017-10-17 10:17:39 +02:00
Arnav Borborah 8271da85a2 Fix arguments to main() 2017-10-17 00:04:40 +02:00
Michael Steenbeek 6a66ef8668 Merge pull request #6442 from janisozaur/vehicle-cpp
Compile vehicle.c as C++
2017-10-16 17:15:43 +02:00
Michał Janiszewski 9ca73ffde2 Compact the switch statement 2017-10-16 10:42:40 +02:00
Michał Janiszewski 5843d72ece Add comment explaining commented out code
[ci skip]
2017-10-16 10:19:47 +02:00
Robert Jordan 9d5c6a4127 Use proper names for predefined themes
Predefined themes *RCT1* and *RCT2* will now be called their respective
game name*RollerCoaster Tycoon 1* or *RollerCoaster Tycoon 2* in the
current language.

Predefined themes in the config file now are prefixed with an asterisk
like they are supposed to be. AKA `*RCT1` instead of `RCT1`.

This will invalidate the user's currently selected theme in the config
file, but only if they were using RCT1's theme.
2017-10-16 10:04:09 +02:00
Christian F. Coors e1d24641a4 Fix saving without dialog in new scenario 2017-10-16 08:07:10 +02:00
Aaron van Geffen 08f7aba817 Rename 'blend' function to 'blendColours'. 2017-10-15 22:31:11 +02:00
Aaron van Geffen 551fdabc7f Make the hinting threshold configurable per font.
This addresses the issue that tofu would not show up in Arial on macOS if the
threshold was set to 60. It being the fallback font, it is important that they
do, which requires lowering to at most 43.

However, it is even more important that the threshold is left at 60 for kanji
in e.g. Japanese to render properly.

Hence, for the moment, Arial is the only font now using a hinting threshold
of 40, for now.
2017-10-15 22:31:11 +02:00
Aaron van Geffen 899c859948 Use light hinting mode iff hinting is enabled.
This makes use of TTF_SetFontHinting, which was ported from SDL_ttf for the occasion.
2017-10-15 22:31:11 +02:00
Marijn van der Werf 4213a66069 Improve colour blending 2017-10-15 22:31:11 +02:00
Aaron van Geffen 579c578777 Address regression: do not blend to remappable colour areas. 2017-10-15 22:31:11 +02:00
Aaron van Geffen 5e7f9c4762 Allow enabling/disabling hinting through console. 2017-10-15 22:31:11 +02:00
Aaron van Geffen d4c5218ba2 Move blending code to colour.c. 2017-10-15 22:31:11 +02:00
Marijn van der Werf d6349d0095 Calculate blended palette index 2017-10-15 22:31:11 +02:00
Aaron van Geffen 0ed3ef3704 Use ColourMapA where possible. 2017-10-15 22:31:11 +02:00
Aaron van Geffen 4b7ebcb51c Handle two rare cases: for red losses in finance window, and text in theme window. 2017-10-15 22:31:11 +02:00
Aaron van Geffen fec0568b29 Shade black backgrounds differently (e.g. IME) 2017-10-15 22:31:11 +02:00
Aaron van Geffen f2e795b4ef Handle hinted font rendering in scrolled texts, too. 2017-10-15 22:31:11 +02:00
Aaron van Geffen 346cfdf135 Account for colour intensity as well as outlined texts. 2017-10-15 22:31:11 +02:00
Aaron van Geffen 2dcf9c73e7 Make font hinting optional through config.ini. 2017-10-15 22:31:11 +02:00
Aaron van Geffen ea034e85fa Simulate font hinting when using TrueType fonts for better legibility. 2017-10-15 22:31:11 +02:00
Aaron van Geffen 3357d32ec4 Port TTF_RenderUTF8_Shaded and TTF_drawLine_Shaded from SDL_ttf. 2017-10-15 22:31:11 +02:00
Michał Janiszewski 49d58dde3e Review fixes 2017-10-15 22:07:47 +02:00
Michał Janiszewski a7be24b2b4 MSVC fixes 2017-10-15 22:07:47 +02:00
Michał Janiszewski d365407384 Apply formatting 2017-10-15 22:07:47 +02:00
Michał Janiszewski d9af76d5a1 Exclude parts of Vehicle.cpp from auto-formatting 2017-10-15 22:07:47 +02:00
Michał Janiszewski f27a7a5918 Compile vehicle.c as C++ 2017-10-15 22:07:47 +02:00
Gymnasiast 07cdc79bd7 Replace two missed -1 NULL pointers 2017-10-15 21:41:10 +02:00
Martin Müller ffdc854c1f Fix #5741: Disappearing land/construction rights indicators 2017-10-15 16:11:08 +02:00
Tomas Dittmann e393ff1f22 Stop using (void*)-1 for invalid pointers 2017-10-15 15:53:16 +02:00
Robert Jordan 74f1eb39a8 Fix: TitleSequence spelling errors
```c++
bool TileSequenceSave(TitleSequence * seq);
bool TileSequenceAddPark(TitleSequence * seq, const utf8 * path, const
utf8 * name);
bool TileSequenceRenamePark(TitleSequence * seq, size_t index, const
utf8 * name);
```

Renamed to:

```c++
bool TitleSequenceSave(TitleSequence * seq);
bool TitleSequenceAddPark(TitleSequence * seq, const utf8 * path, const
utf8 * name);
bool TitleSequenceRenamePark(TitleSequence * seq, size_t index, const
utf8 * name);
```
2017-10-15 10:33:10 +02:00
Ted John a65192b141 Do not use float 2017-10-14 23:38:51 +02:00
Ted John a8c9c758f4 Fix a couple of bugs 2017-10-14 23:38:51 +02:00
Ted John 55c420b738 Fix code style 2017-10-14 23:38:51 +02:00
Marijn van der Werf d596c0139f Combine text paint functions 2017-10-14 23:38:51 +02:00
Marijn van der Werf c01bcea391 Introduce more constants for text rendering 2017-10-14 23:38:50 +02:00
Krutonium fd459f0791 Add a visible notification for missing KDialog/Zenity 2017-10-14 22:16:51 +02:00
Robert Jordan 0313183d13 Fix #6318: Can't fire staff that are being placed 2017-10-14 22:14:45 +02:00
Mark van Renswoude ce73d3a8a5 Fix #6390: Crash when renaming rides in multiplayer 2017-10-14 14:21:06 +02:00
Michael Steenbeek 7f9c25a7a9 Use constant for LOCATION_NULL, split off location stuff to Location.h 2017-10-13 22:23:07 +02:00
Michał Janiszewski ab3835719a Compile peep and staff logic as C++ 2017-10-13 10:06:36 +02:00
Robert Jordan 7d6bfa19ea Fix #6452: scenario text truncated when switching architectures
`ScenarioFileIndex`'s `Serialize` and `Deserialize` now read and write each
individual value of a `scenario_index_entry` instead of the entire struct
at once. Thus the difference in pointer sizes of `highscore` on different
architecture builds will not cause issues with `scenarios.idx`.
2017-10-13 10:00:42 +02:00
Michał Janiszewski 7dad101f70 Include stdbool.h in Guard.hpp
C only has `bool` type when `stdbool.h` is included.
2017-10-13 08:00:32 +02:00
Michael Steenbeek 202244eda6 Revert "Remember last used rotation for rides with no tracks."
This reverts commit 7dc6e4e9c3.
This commit caused hacked rides (like rollercoasters set to Crooked House) to crash
2017-10-12 23:24:51 +02:00
Tomas Dittmann 6d29fd5c77 Set null viewports to NULL, not -1 2017-10-12 21:43:39 +02:00
Tomas Dittmann 88742dce80 Ensure null objects are written as -1 to SV6 2017-10-12 21:23:54 +02:00
Michael Steenbeek 3a9dc3f491 Ensure that get_ride_entry returns NULL on invalid ride entries 2017-10-12 21:07:35 +02:00
ZehMatt 7dc6e4e9c3 Remember last used rotation for rides with no tracks. 2017-10-12 21:06:04 +02:00
Michael Steenbeek 3a2aeda398 Refactor expenditure table and history graph 2017-10-12 20:35:59 +02:00
Michael Steenbeek d342272dda Fix usage of RIDE_ID_NULL 2017-10-12 13:35:04 +02:00
Michał Janiszewski 8c885c92a4 Fix MinGW release builds 2017-10-12 12:45:00 +02:00
Robert Jordan 559a4c0953 Fix #6445: set favourite ride to N/A when importing from RCT1/AA 2017-10-12 12:40:57 +02:00
Michael Steenbeek 42d6a10952 Compile management as C++ 2017-10-11 21:38:26 +02:00
Michał Janiszewski 07f7928382 Indent namespace contents in KeyboardShortcut.cpp 2017-10-11 11:30:40 +02:00
Michael Steenbeek 34200848a9 Fix Xcode project; rename input.h 2017-10-11 11:30:38 +02:00
Michał Janiszewski 992721bdb7 Remove C sources from libopenrct2ui.vcxproj globs 2017-10-11 11:30:37 +02:00
Michał Janiszewski bc1d3c0cb2 Remove C sources from glob patterns for openrct2-ui 2017-10-11 11:30:37 +02:00
Michał Janiszewski 50fa761fa0 Apply C++ formatting to Input.cpp 2017-10-11 11:30:36 +02:00
Michał Janiszewski f04c871515 Compile input.c as C++ 2017-10-11 11:30:35 +02:00
Michał Janiszewski 83bb8721f8 Apply C++ formatting 2017-10-11 11:30:34 +02:00
Michał Janiszewski b55f966a87 Compile keyboard_shortcut as C++ 2017-10-11 11:30:33 +02:00
Daniel Trujillo Viedma 39ecd37d27 Fix fault in #6401: append extensions only when saving 2017-10-11 09:43:49 +02:00
Michael Steenbeek 17557569d0 Turn 'unlock all prices' into a regular option
This uses a previously unused S6 flag to save this option persistently.
This should not make S6 import much harder, but should reduce the amount of questions about S4 import.

Also refactor the checks whether the user can ask money for rides or entry. This should make it a lot easier
when our own save format comes around.
2017-10-11 08:33:17 +02:00
Duncan f97068d0b6 Fix #6420: Demolishing rides refunds twice as much as the ride costs to build 2017-10-11 07:58:49 +02:00
LRFLEW 0868902f11 Rework OpenGL API declarations 2017-10-10 22:26:35 +02:00
Michael Steenbeek 64da0e8f8d Fix some formatting in peep.c
JENKINS!!
2017-10-10 15:17:39 +02:00
Michał Janiszewski 89fb6b2144 Fix android builds
[ci skip]
2017-10-10 14:53:33 +02:00
Michał Janiszewski 16bd2c6439 Fix #6430: endless vomiting
Mistake during refactor
2017-10-10 14:02:50 +02:00
duncanspumpkin 665aac7394 Fix #6413: Draw Maze previews correctly.
Mistake made during refactoring. Apply flag was not being passed to the game command and this meant that only the query to check if a maze element could be placed was called.
2017-10-10 12:43:54 +02:00
Michael Steenbeek 6621faf27a Fix #6196: Guest's energy underflows and never decreases
Issue caused by using max where min was intended.
This also reverts an earlier change in capping the energy target, since it seems to max out at 255, unlike energy itself.
2017-10-10 10:06:56 +02:00
Daniel Trujillo Viedma 9dc04ed07a Fix #3510: Auto append file extension when not specified on save 2017-10-10 09:55:40 +02:00
Michael Steenbeek 5cc5761a25 Fix #6414: raise maximum launch speed of the Corkscrew to 96 km/h 2017-10-10 09:53:36 +02:00
Michael Steenbeek 3c8184dfa1 Handle Polish in the RCT2-to-Unicode conversion
Also removed the misidentified A_MINUSCULE and CENT.
2017-10-10 09:22:38 +02:00
Michael Steenbeek 71686e88b5 Render Polish with the sprite font
Fixes the sprite lookup table for the Polish characters.
Switches the font settings for Polish from TTF to sprite.
2017-10-10 09:22:38 +02:00
Michał Janiszewski c4538496c5 Make sure variables are either static or declared externally 2017-10-09 22:59:40 +02:00
Michał Janiszewski b05bdf28fc Fix compilation with older clang
Older clang would expand the macros and spot that clamping unsigned
values to [0, MAX] is a tautological operation and produce an error.

As these are tautological operations, no network version change should
be needed.
2017-10-09 17:34:37 +02:00
Duncan 6e1521caec Reintroduce error messages when trying to open invalid rides (#6381)
* Reintroduce error messages when trying to open invalid rides

Mistake made during action refactor. I've added the ability to specify the error title and error args as well in the result constructor. In addition the set status will now perform a query to check if it is valid preventing error messages hitting the server.

* Bring error message setting into the function

This prevents any other function corrupting the message args. Looking at you update ride window.

* Increment network version for error message fix on set status

* Reintroduce the error title to set ride name

* Try not to introduce bugs due to inverting logic
2017-10-09 15:50:49 +01:00
Michael Steenbeek 9effe3a599 Merge pull request #6417 from janisozaur/rides-as-cpp
Compile rides as C++
2017-10-09 15:56:38 +02:00
Michael Steenbeek e25d6b807d Fix refactor error in MiniGolf.cpp 2017-10-09 15:33:34 +02:00
Michael Steenbeek 2fd4d39456 Fix compilation in Visual Studio 2017-10-09 15:24:51 +02:00