Commit Graph

150 Commits

Author SHA1 Message Date
Tulio Leao 724a6d4dcf Make rct_window use ScreenCoordsXY 2020-03-02 20:51:01 -03:00
Tulio Leao 09fad0ef7f Change rct_viewport to use ScreenCoordsXY 2020-03-02 20:50:58 -03:00
Michael Steenbeek d395d67b95
Merge pull request #10846 from tupaschoal/const-ref-screencoords
Prefer const ref to send ScreenCoordsXY over
2020-03-01 14:17:51 +01:00
Tulio Leao 9bcd20e0e6 Prefer const ref to send ScreenCoordsXY over 2020-02-29 08:25:48 -03:00
Tulio Leao 826478a8ef Use ScreenCoordsXY on UiContext.cpp 2020-02-22 16:01:20 -03:00
Michael Steenbeek d7f23bc5bf
Close #6898: Remove LOADMM and LOADRCT1 commands (#10546) 2020-01-12 14:26:33 +01:00
Duncan 099404b505
Merge pull request #10381 from tupaschoal/cursorsate-store-coords
Make CursorState store a ScreenCoordsXY object
2019-12-18 20:10:51 +00:00
Tulio Leao c2c40fa951 Create ScreenCoordsXY on UIContext mouse/finger functions (#10382) 2019-12-17 18:46:28 +01:00
Tulio Leao 2cd3add373 Make CursorState store a ScreenCoordsXY object 2019-12-14 23:30:55 -03:00
Tulio Leao 9d09f1b95c Use ScreenCoordsXY on context cursor operations (#10364) 2019-12-14 22:52:18 +01:00
Tom Lankhorst 6eea943083 Pass SDL_WINDOW_ALLOW_HIGHDPI to SDL_CreateWindow (#10125) 2019-10-21 22:36:05 +02:00
Tulio Leao 5f916b79ae Use ScreenCoordsXY for MouseInput (#10120) 2019-10-20 19:10:30 +02:00
Matt 951f5009ef
Refactor window storage to use std::list instead of std::vector 2019-05-29 19:32:18 +02:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Michał Janiszewski ecfbf60cc4 Drop SDL2/ prefix on includes
pkg-config, cmake, all demos and tests define the path with SDL2/
already included.
2019-01-06 17:29:29 +01:00
ζeh Matt 223ae74c6b Refactor code to obtain resolutions. (#8215) 2018-11-06 07:20:57 +01:00
tombomp 38cc4692f6 Fix #7473: Disable audio on focus loss not correct
Previously only muted the volume if sound effects was enabled, but ride music is also a possible source of sound.
2018-10-16 23:07:41 +02:00
youngspe c1cd8619e0 Fix #1496: scrolling on touch devices (#8060)
* Fix #1496: scrolling on touch devices

* correct formatting errors
2018-10-09 20:50:17 +02:00
youngspe c543c1078d Fix 7760: Touchscreen presses are handled twice (#8056) 2018-10-06 17:43:39 +02:00
Christian Schubert 48d6e2f58f Added 'open custom content folder' button to toolbar menu. 2018-09-13 22:18:09 +02:00
Linus Unnebäck fd07be587a
Remove Math::Clamp in favour of std::clamp 2018-08-12 16:47:12 +01:00
clang-format d787872cbe Indent preprocessor directives 2018-07-23 16:00:23 +02:00
clang-format b02dfdbc93 Binpack function arguments together
Previously when the arguments of a function wouldn't fit on a single line, clang-format would put each argument on its own line instead. By enabling the binpack parameter setting, it tried to fit as many on one line as possible instead.

Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:22 +02:00
clang-format 9c022606f1 clang-format UI root 2018-07-23 16:00:14 +02:00
Michał Janiszewski 4a77801cb3
Increase the allowed aspect ratio epsilon (#7775) 2018-07-18 22:33:20 +01:00
Michael Steenbeek 1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02: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
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
Ted John fdb1d98868
Move rain window loop to libopenrct2ui (#7684) 2018-06-15 07:46:04 +01:00
Ted John ae6af47341 Move TitleSequencePlayer to libopenrct2ui 2018-06-10 23:39:56 +01:00
Ted John 5a368ce6d9 Move theme code to libopenrct2ui 2018-06-10 23:34:27 +01:00
Ted John e38f4df575 [wip] Move themes to libopenrct2ui 2018-06-10 23:34:12 +01:00
Hielke Morsink de3cab59bb Fix warnings reported by travis 2018-06-05 16:07:54 +02:00
Ted John 92f6ac7333 Rename header files to match renamed source files 2018-06-01 09:38:30 +02:00
Ted John 7eb1703f36 Remove old bitmap code via UiContext 2018-05-13 01:11:56 +01:00
Ted John 302fe00805 Always pass shared_ptr by reference 2018-05-11 20:39:00 +01:00
Ted John 7b610fd3c0 Use shared_ptr more for UiContext in relation to DrawingEngine 2018-05-11 20:37:48 +01:00
Ted John 7dc170ef85 Use shared_ptr for long-life objects
Use unique_ptr and shared_ptr for IContext, IPlatformEnvironment, IUiContext, and IAudioContext.
2018-05-11 20:37:48 +01:00
Ted John dbbd5b89e6 Fix assert in SDL2 (debug) 2018-05-04 20:24:35 +01:00
Ted John dd0573b235 Move in game console to UI library 2018-03-22 20:16:58 +00:00
Ted John ec9e812ea7 Replace gConsoleOpen with function 2018-03-22 20:16:58 +00:00
Michał Janiszewski cd065d4f41 Reduce includes in common header 2018-03-20 00:27:58 +01:00
Ted John 39a38dc193 Include SDL2 using sub directory 2018-03-09 16:28:47 +01:00
Marijn van der Werf 4c956def67 Update UI imports 2018-01-18 22:57:55 +01:00
ZehMatt 84f2917f59 Use const and constexpr whenever possible. 2018-01-11 22:29:08 +01:00
Ted John c3eab7ead6 Refactor window.c to C++ 2018-01-07 12:39:58 +01:00
Ted John c974daf467 Refactor console.c to C++ 2018-01-07 12:39:58 +01:00
Michael Steenbeek 755add6c9a
Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
Michał Janiszewski 4d0c88fb94 Mark constructors explicit (#6928) 2018-01-04 01:12:34 +00:00
Michael Steenbeek 6dc49d643a Compile files in base dir as C++ 2017-12-13 08:03:48 +01:00
Christian F. Coors 0aa515355a Add cursor scaling 2017-12-12 22:11:40 +01:00
Aaron van Geffen 837b177d9d Simplify UI scaling display quality options (#6764)
Simplify UI scaling display quality options.

This removes three options:
* 'Use NN scaling at integer scales', as NN is decidedly preferable at integer scales.
* Anisotropic scaling, as it produces results very similar (if not equal) to linear scaling.
* NN as a selectable option in the dropdown - NN is forced on integer scales and unavailable for non-integer scales.
2017-12-03 22:35:16 +01:00
Philip Goto 19abb62586 Add Smooth NN scaling to OpenGL renderer 2017-11-06 23:05:21 +01:00
Philip Goto 6377ac7bfb Create enum for scale quality 2017-11-06 23:05:21 +01:00
Philip Goto b66df2d6db Add smooth nearest neighbor scaling
This commit implements smooth nearest neighbor scaling, this scaling method looks sharper than linear scaling and not deformed like NN scaling.
2017-11-06 23:05:21 +01:00
LRFLEW 7db8d0f00a OpenGL: Fix linear DPI scaling 2017-10-30 16:21:49 +01:00
Christian F. Coors ecc6bf5120 Fix scrolling with mouse wheel 2017-10-06 10:17:43 +02:00
Marijn van der Werf ac910a5979 Move Error, Campaign and Ride Demolition windows 2017-09-24 22:41:49 +02:00
Michał Janiszewski 00fd18809c Move extern "C" {} blocks to headers (#6282) 2017-09-18 17:05:28 +02:00
ζeh Matt 1f3ccae8b1 Refactor remaining image flag constants to defined G1_* flags. (#6217)
Refactor gUnk9DE568 and gUnk9DE56C to be type of rct_xy16 called gPaintSpritePosition
Rename unk_9ABDA4 to gCurrentColourPalette.
Rename gUnkEDF81C to gCurrentImageType.
Rename sub_679236_679662_679B0D_679FF1 to pixel_is_present.
Remove unused variables _unk9ABDAE, _unk9AC149, unk_9E3CE4, only ever assigned but never read.
Remove unreferenced variable unk_9E3CDC.
Clean up some parts in sub_679236_679662_679B0D_679FF1.
Remove function sub_68371D and references, it assigns variables that are never used.
Add assert determine if unused code.
2017-09-02 14:01:08 +01:00
wolfreak99 8e93c69e47 Implement console scrolling by pageup and pagedown 2017-08-26 18:19:03 +02:00
Ted John 6699d0885b Merge pull request #6065 from IntelOrca/refactor/remove-rct2.c
Move remaining functions out rct2.c
2017-07-30 18:09:26 +01:00
Michał Janiszewski 9eb0dc6ea9 Fix wrong mouse button being released on FingerUp event 2017-07-30 17:57:07 +02:00
Michał Janiszewski eb76b188ae Ensure UiContext deletes allocated resources 2017-07-30 17:34:30 +02:00
Ted John 8bc4e52ae9 Move rct2_quit to Context 2017-07-29 20:28:18 +01:00
ZehMatt fabf7f9fb5 Refactored window flags only being updated every 1000ms. 2017-07-25 08:33:57 +02:00
Ted John 7fbcf1ab0b Move rct2_update into Context 2017-07-16 23:25:11 +01:00
William Wallace ae110a9159 Allow switching between OpenGL and other renderers without restarting 2017-07-13 19:04:37 +01:00
rwjuk 214bf3988b Implement 'missing objects' window
Implement 'missing objects' window

Basic implementation of 'bad objects' window

Add new object_load_error.c

Add object_load_error.c

Faffing about

String stuff

Stuff

Get window basically displaying

Proper col header for object

Display object types

Display file name and explanatory message

Probably about time I added myself to the dev list

Cleanup and comments

Make bad object window work with SC6

Fix whitespace, string IDs, flip core function sense

Fix spacing in string_ids.h

Fix string ID snafu

Fix HasNoInvalidObjects() sense

Attempt to refactor this to pass data properly

Move typedefs to separate header

Fix up signatures

Add park_load_result_types.h

Clean up includes and remnants of prev implementation

Split duplication into function, free invalid entries list on close

Use pointer for object_validity_result param

Fixup string IDs

Use LoadObject() directly

Use dependency injection, fix string termination

Xcode fix, make helper function static

Fix buffer overrun and memory leak

Use SDL for clipboard functionality

Fix function & variable declarations

Rework editor_read_s6() to use new park load result type

Update changelog for #5624

[ci skip]

Fix mem leak, function signature and whitespace
2017-07-01 01:28:51 +01:00
Ted John 1dae7f9f32 Move SDL_LoadBMP call to libopenrct2ui (#5616) 2017-06-14 19:47:22 +01:00
Ted John cbd53f920c Create IWindowManager to open window from libopenrct2 2017-06-11 17:23:51 +01:00
Ted John dfa1b47a4f Move keyboard shortcut code to libopenrct2ui. 2017-06-11 16:52:15 +01:00
Ted John 0d8f9d6618 Refactor IPlatformEnvironment (#5590) 2017-06-11 12:53:37 +01:00
Ted John fc899d15ef Remove SDL_Window from IDrawingEngine and UiContext 2017-06-10 22:18:54 +01:00
Ted John abb857e51d Remove platform_get_non_window_flags 2017-06-10 16:40:08 +01:00
Ted John 852ea898e7 Fix #5534: Unable to select any full screen resolutions 2017-06-02 18:36:21 +01:00
Michał Janiszewski 79d76759bb Fix #5516: Update copyrights for 2017
Not all files were necessarily _changed_, but all were touched, see
https://github.com/OpenRCT2/OpenRCT2/pull/4932
2017-06-01 21:55:10 +02:00
Ted John 3ca1b48384 Open the game window on the last remembered display 2017-05-29 22:39:17 +02:00
Ted John e313568a27 Initialise UiContext input fields
This was causing undefined data to appear in _keysPressed which caused shortcuts to be invoked on startup.
2017-05-29 22:38:46 +02:00
Richard Jenkins aa5151503a Fix formatting 2017-05-29 22:38:46 +02:00
Richard Jenkins 999a467b9a Add SetKeysPressed() function to UiContext 2017-05-29 22:38:46 +02:00
Richard Jenkins 63771389c3 Remove whitespace in UiContext.cpp 2017-05-29 22:38:45 +02:00
Richard Jenkins e8ec7ee58f Implement building of libopenrct2 and OpenRCT-UI for macOS
Initial setup of xcode for multiple targets

libopenrct2 partially working

Restore macOS mach_info init

Get macOS OpenRCT2-ui working if hackish

Implement UiContext for macOS properly

Put tabbing cancellation code back
2017-05-29 22:38:45 +02:00
Ted John 41f376f7aa Add final to implementations 2017-05-29 22:38:44 +02:00
Ted John 50197f04ed Fix boolean warning 2017-05-29 22:38:44 +02:00
Ted John cf0dcb4753 Refactor file / directory dialogs to UiContext 2017-05-29 22:38:43 +02:00
Ted John 3fcd42fe2b Move more window code to UiContext 2017-05-29 22:38:43 +02:00
Ted John a020a9fbef Fix premature deletion of platform context 2017-05-29 22:38:43 +02:00
Ted John 0440c3deea Clean up audio.cpp 2017-05-29 22:38:43 +02:00
Ted John d206d181f2 Move audio code to UI project 2017-05-29 22:38:43 +02:00
Ted John bd9839ff50 Get the game working
Mostly just needed to resolve screen size which is now retrieved via ui context.
2017-05-29 22:38:43 +02:00
Ted John 7163973bd2 Start moving code from OpenRCT2 to Context 2017-05-29 22:38:42 +02:00
Ted John 9d24e47e6f Fix build 2017-05-29 22:38:42 +02:00
Ted John f736e8ff96 Move more platform code to UiContext 2017-05-29 22:38:42 +02:00
Ted John 5885cb646f Start moving window logic to UI project 2017-05-29 22:38:42 +02:00
Ted John 10182879da Invert Context and UiContext dependencies 2017-05-29 22:38:42 +02:00
Ted John 89780363ee Add openrct2-ui cmake project 2017-05-29 22:38:42 +02:00
Ted John 006a76c099 Refactor registration of drawing engines 2017-05-29 22:38:42 +02:00
Ted John bf3749833d Allow drawing engine registration via context interfaces 2017-05-29 22:38:42 +02:00