Commit Graph

10607 Commits

Author SHA1 Message Date
Hielke Morsink 7c0bcc2c34 Handle codepoints for text colour in a nicer way
This replaces a couple more buffers with std::strings and makes {WINDOW_COLOUR_2} the default colour when adding a new line. Codepoints for any other colour will be added, and overwrite the codepoint that gets calculated in `console_draw` (which is only there for when the user has text set to black).
2018-01-23 16:43:33 +01:00
Hielke Morsink 3633d56e3e Refactor and cleanup in-game console to use C++ strings
Instead of storing the console text in one large buffer, it gets stored in a vector of strings. This makes the code easier to understand, as the `std::string`s now handle the buffer lenghts, instead of doing that manually and bloating the code with it, but at the cost of some performance (not noticable though). This fixes an issue where the buffer would be cut off when the total length exeeded the buffer length.
With this commit printed warnings and errors will have a red and yellow colour. It looks like this was intended, but it didn't work before, and makes `gfx_draw_string` and related functions take const strings.
2018-01-23 16:43:33 +01:00
pss9205 6b716dc157 Fix #7021: Extra rating factors overflow the vehicle tab in Korean (#7073) 2018-01-23 16:06:37 +01:00
Gymnasiast 9a362a8aa3 Import RCT1 gardens correctly 2018-01-22 20:25:29 +01:00
Gymnasiast 498ca56f57 Fix unicode values of some characters 2018-01-22 12:16:22 +01:00
Gymnasiast 6bf09e7abb Add preview images for RCT1 edge styles 2018-01-22 11:44:38 +01:00
ZehMatt 1f5140ae94 Fix benchgfx attemping to render unloaded parks. 2018-01-21 21:46:11 +00:00
ZehMatt abd74dbb1e Add exception handling in LoadParkFromFile. 2018-01-21 21:46:11 +00:00
Michael Steenbeek fdeaaa5631
Allow selecting RCT1 map edges in land tool 2018-01-21 17:18:00 +01:00
Ted John 02d783a993 Fix build 2018-01-21 12:41:42 +00:00
Ted John cebe13984f Remove most of remaining memory functions from libopenrct2ui 2018-01-21 11:17:41 +00:00
Ted John 131286f758 Refactor memory handling in OpenGLShaderProgram.cpp 2018-01-21 11:17:41 +00:00
Ted John 7f8b795842 Refactor memory handling in EditorObjectSelection.cpp 2018-01-21 11:17:41 +00:00
Ted John 589e0f40d0 Refactor memory handling in Map.cpp 2018-01-21 11:17:41 +00:00
Ted John cb44dc5c21 Fix changelog 2018-01-21 11:17:41 +00:00
Ted John b52333f532 Refactor memory handling in TitleScenarioSelect.cpp 2018-01-21 11:17:40 +00:00
Ted John 4d57a4b03a Refactor memory handling in TrackDesignPlace.cpp 2018-01-21 11:17:40 +00:00
Ted John cbbb35bf79 Refactor memory handling in ObjectLoadError.cpp 2018-01-21 11:17:40 +00:00
Ted John badb90ba20 Refactor memory handling in Changelog.cpp 2018-01-21 11:17:40 +00:00
Ted John ba5bc415c7 Refactor memory handling in window sources 2018-01-21 11:17:40 +00:00
Ted John 0b8575270c Refactor memory handling in audio sources 2018-01-21 11:17:40 +00:00
Richard Jenkins 104419f6b2 Fix #7060: Ride window settings can underflow 2018-01-20 20:34:39 +00:00
Ted John 51df68a7d9
Merge pull request #7051 from IntelOrca/refactor/remaining-ride-to-cpp
Refactor remaining ride sources to C++
2018-01-19 10:49:54 +00:00
Ted John 6d63729a40 Fix MSVC 2018-01-18 22:59:30 +00:00
Ted John aa0d7645da Refactor ride_ratings.c to C++ 2018-01-18 22:33:06 +00:00
Richard Jenkins d9725702ca Make console text colour themeable 2018-01-18 23:18:23 +01:00
Richard Jenkins 78a5406468 Visual improvements to the in-game console 2018-01-18 23:18:23 +01:00
Ted John f2014fb6b1 Refactor music_list.c to C++ 2018-01-18 22:08:56 +00:00
Ted John 6a8cce710c Refactor track_design_save.c to C++ 2018-01-18 22:04:09 +00:00
Marijn van der Werf d09134e64a Decrease Window dependencies in Vehicle.cpp 2018-01-18 22:57:55 +01:00
Marijn van der Werf 7d0417a366 Import private headers in remaining files 2018-01-18 22:57:55 +01:00
Marijn van der Werf baf56db937 Use rct_window internals in Theme 2018-01-18 22:57:55 +01:00
Marijn van der Werf 7aa2cd7ac5 Move peep list refreshing to UI module 2018-01-18 22:57:55 +01:00
Marijn van der Werf 430bf482f2 Add viewport getter 2018-01-18 22:57:55 +01:00
Marijn van der Werf aa0933d08a Convert rct_window to opaque pointer 2018-01-18 22:57:55 +01:00
Marijn van der Werf 4c956def67 Update UI imports 2018-01-18 22:57:55 +01:00
Michał Janiszewski a634b7e2cb Add comment explaining reasoning behind our own getumask() 2018-01-18 22:47:10 +01:00
Michał Janiszewski c6e2f1a6ea Fix Android.cpp 2018-01-18 22:42:54 +01:00
Ted John 61450353cb Fix build for Linux 2018-01-18 21:25:54 +00:00
Michael Steenbeek f551a150fe Fix Xcode project 2018-01-18 21:13:38 +00:00
Ted John 974ef800cb Rename remaining platform c files to cpp 2018-01-18 21:12:41 +00:00
Ted John d9d2b2373d Rename crash.h to Crash.h 2018-01-18 21:12:41 +00:00
Ted John 34d41aeadd Convert shared.c to C++ 2018-01-18 21:12:41 +00:00
Richard Jenkins 3df8ae6960 Use colour defines in dazzling colours array 2018-01-18 21:28:51 +01:00
Michał Janiszewski 409a995e7f Discard const on returned type 2018-01-18 19:06:27 +01:00
Michał Janiszewski 48c3225cb7 Fix types of caught exception in IniReader.cpp 2018-01-18 19:06:05 +01:00
Richard Jenkins af76cef94b
Fix bracket placement 2018-01-18 14:08:06 +00:00
Ted John 8630498213
Convert platform/windows.c to C++ (#7044) 2018-01-18 12:50:34 +00:00
Ted John bea500638b Remove old file enumerator functions from platform 2018-01-18 11:38:52 +01:00
Ted John cb720025fa Replace platform_enumerate_directories_begin with FileScanner code
This is isn't a particularly pretty implementation but it is only temporary until we can use std::filesystem.
2018-01-18 11:38:52 +01:00
Ted John 6fd56d140d Remove remaining uses of platform_enumerate_files_begin 2018-01-18 11:38:52 +01:00
Ted John d8b3fb01a7 Fix FileScanner not taking notice of recurse flag 2018-01-18 11:38:52 +01:00
Michał Janiszewski 4eb2ceac47 Fix #7004: Placing track design makes the park disappear 2018-01-18 10:30:34 +01:00
Grant Barker 52ad1e1795 fix make error on macOS 2018-01-17 23:54:57 +00:00
Aaron van Geffen a1e7a18a67 Cheats window: format braces et cetera. 2018-01-16 23:22:52 +01:00
Aaron van Geffen c951c7b539 Ride cheats: reorder and group cheats in boxes by function.
* Change button order.
* Move checkboxes into a more logical order.
* Add group boxes around checkboxes.
2018-01-16 23:22:52 +01:00
Michał Janiszewski 3ba0cc3dae Add missed constexprs 2018-01-14 16:13:37 +01:00
Ted John 888f60c583 Use new platform functions in theme.cpp
Also uses std::string instead of C strings in most places.
2018-01-14 01:17:04 +00:00
Ted John ca7f9dec8e Move function out of C extern 2018-01-14 01:06:47 +00:00
Ted John 9afbfe02ab Add new helper to check if raining 2018-01-14 01:06:47 +00:00
Ted John 742690b4f4 Add enums for weather effect and rain level 2018-01-14 01:06:47 +00:00
Ted John 68202db51c Make ClimateWeatherData and ClimateWeatherGloomColours internal to Climate.cpp 2018-01-14 01:06:47 +00:00
Ted John 83cdd56825 Unify current and next climate state into common struct 2018-01-14 01:06:47 +00:00
Adakite Systems 0681ba4e04 Read and set edge scrolling speed via config
- For future reference, the default edge scrolling speed
value of 12 is retained.
2018-01-14 00:51:51 +00:00
Michael Steenbeek 037b236d8f Add the RCT1 edge styles 2018-01-13 15:39:22 +01:00
deurklink c1c6413337 Fix #7011: Swinging and bobsleigh cars going backwards swing in the wrong direction
This fix will make swinging rides like the suspended swinging coaster and the bobsleigh coaster back to the outside of corners when moving backwards (For example during a rollback). This was an original bug in RCT2.
2018-01-13 15:28:07 +01:00
Aaron van Geffen c581656693 Add extra padding to label text in track install window.
Also fixes the window height, not just to accommodate the extra padding,
but also to accommodate the 'space required' field.
2018-01-12 22:29:32 +01:00
Richard Jenkins 8fb5f5c2be
Fix #6993: Inverting track design causes a crash 2018-01-12 15:42:02 +00:00
ZehMatt 84f2917f59 Use const and constexpr whenever possible. 2018-01-11 22:29:08 +01:00
Aaron van Geffen 81398d9225 Reset resize widget's top position properly when invalidating. 2018-01-11 20:27:40 +01:00
Aaron van Geffen 4d219c3abe Refactor name and path into std::string, too. 2018-01-11 20:27:40 +01:00
Aaron van Geffen eb0ad92e6d Use std::vector as LoadSaveListItem container. 2018-01-11 20:27:40 +01:00
Aaron van Geffen fce2996a73 Format braces in LoadSave.cpp. 2018-01-11 20:27:40 +01:00
Aaron van Geffen 6a404eb5dc Make MINGW happy, too. 2018-01-11 20:27:40 +01:00
Richard Jenkins 4a4aa80f31 Fix Windows implementation 2018-01-11 20:27:40 +01:00
Aaron van Geffen aa82df2647 Experimental: use system date/time settings on Windows. 2018-01-11 20:27:40 +01:00
Aaron van Geffen ada31ede29 Change header/sort button appearance. 2018-01-11 20:27:40 +01:00
Aaron van Geffen 9d96377e9b Infer optimal date width when opening load/save window.
In order to accomodate MSVC, we're not using strptime.
2018-01-11 20:27:40 +01:00
Aaron van Geffen 004e60ccc6 Use virtual columns to align date and time.
This also makes the date column use a fixed width. Useful when resizing.
2018-01-11 20:27:40 +01:00
Aaron van Geffen ca172b46c1 Make load/save window resizeable. 2018-01-11 20:27:40 +01:00
Aaron van Geffen c77b00898d Show formatted dates in load/save window. 2018-01-11 20:27:40 +01:00
Michael Steenbeek 1787af8084 Fix #7003: Building sloped paths trough flat ones causes glitches 2018-01-11 16:30:11 +01:00
Michael Steenbeek 47a23603ae Remove unused functions 2018-01-11 13:25:09 +01:00
Michael Steenbeek a0d43d2bd3 Fix Math::Clamp calls 2018-01-11 13:25:09 +01:00
Michael Steenbeek cd5a1ba888 Compile files in world folder as C++ 2018-01-11 13:25:09 +01:00
Aaron van Geffen 1d7bec8a11 Make the virtual floor optional, on by default. 2018-01-11 10:37:40 +01:00
Aaron van Geffen 0527f50c7f Take previous virtual floor area into account when invalidating. 2018-01-11 10:37:40 +01:00
Aaron van Geffen 87ad60be31 Adjust virtual floor height by path construction direction. 2018-01-11 10:37:40 +01:00
Richard Jenkins 9e5502afe3 Enable virtual floor for paths 2018-01-11 10:37:40 +01:00
Aaron van Geffen cccaab37fe Fix track height computation for non-track rides. 2018-01-11 10:37:40 +01:00
Michael Steenbeek a410872fec Move VirtualFloor.cpp to the paint folder and fix Xcode project 2018-01-11 10:37:40 +01:00
Aaron van Geffen c835832e79 Compile the virtual floor code as C++.
Add a proper header file for the virtual floor in the process.
2018-01-11 10:37:40 +01:00
Aaron van Geffen 84026529b4 Introduce new variable gMapVirtualFloorVisible to determine visibility.
This addresses compilation issues for projects that contain no UI code.
Also working towards better invalidation for the software renderer.
2018-01-11 10:37:40 +01:00
Aaron van Geffen 4246b84130 Invalidate virtual floor once selection has changed.
Cache the position of the last invalidate call to prevent a big dip in performance.
2018-01-11 10:37:40 +01:00
Jeroen D Stout fb745d1575 Implement invalidate virtual floor tiles function 2018-01-11 10:37:40 +01:00
Jeroen D Stout dd2e69cf7a Place virtual floor at the effective z-position when placing track pieces 2018-01-11 10:37:40 +01:00
Michał Janiszewski c031f6c5fa Don't reference virtual floor from testpaint 2018-01-11 10:37:40 +01:00
Jeroen D Stout ea37c599e3 Let virtual floor set height function take visibility into account 2018-01-11 10:37:40 +01:00
Jeroen D Stout 3516cb944c Correct check for virtual floor in map 2018-01-11 10:37:40 +01:00
Jeroen D Stout c8785bac55 Add virtual floor removal check to input 2018-01-11 10:37:40 +01:00