Commit Graph

42 Commits

Author SHA1 Message Date
Rubidium 8c742b456f Codechange: use Textbuf directly, instead via several virtual functions in Window 2023-09-06 23:07:04 +02:00
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
Rubidium d5c0d3beb7 Codechange: unify the formatting of the game's caption 2023-06-07 08:02:46 +02:00
Patric Stout 0d840b4570 Codechange: remove queue_wrap / last_position from mouse movement
No backend uses it anymore, so also no longer any need to support
it.
2023-06-04 00:40:56 +02:00
Rubidium 275ebf4509 Codechange: replace fprintf(<FILE*> with fmt::print(<FILE*> 2023-05-21 15:12:02 +02:00
Peter Nelson 56085be9bd Codechange: Move includes for common STL headers to stdafx. 2023-05-17 10:14:41 +01:00
Patric Stout 60399e17bd Codechange: C++-ify the Layouter and related functions
They all now access a std::string_view, instead of a "const char *"
or std::string (in some cases).

Additionally, GetCharAtPosition and friends now return an index
instead of a "const char *", as it makes for a more clear interface.
2023-05-08 19:21:42 +02:00
Peter Nelson 9666e46739 Feature: Variable GUI scale.
GUI scale is now variable from 100% to 500%, and no longer restricted to
powers-of-2.
2022-11-12 18:28:39 +00:00
Bouke Haarsma 45d98f689a Fix #9993: Handle DPI changes on macOS and Windows 2022-10-16 16:52:14 +02:00
Bouke Haarsma f3fd9b5895
Codechange: typo in code comment (#10061) 2022-09-29 00:12:21 +01:00
Michael Lutz 57b992717b Codechange: Extend DrawSpriteToRgbaBuffer to work with 8bpp blitters. 2022-01-01 12:19:30 +01:00
Michael Lutz 69c8ed9965 Codechange: [OSX] Simplify touchbar button data definition. 2022-01-01 12:19:30 +01:00
Michael Lutz b351cbe490 Fix #9743: [OSX] Only (re-)create touchbar sprites when requested by the main loop. 2022-01-01 12:19:30 +01:00
Michael Lutz f40e82a19d Fix #9743: [OSX] Don't try to render touchbar sprites with invalid zoom level. 2022-01-01 12:19:30 +01:00
Michael Lutz 80fc5fb46c Change: [OSX] Allow touchbar usage on all supported OS versions.
Touchbar support was introduced in 10.12.2. There's no need to limit
support to 10.15+, as the convenience class NSButtonTouchBarItem is
easily replicated.
2022-01-01 12:19:30 +01:00
Danny de Bruijne 753b1d7e15 Feature: Add selected toolbar buttons to MacBook Pro Touch Bar 2021-09-23 21:03:00 +02:00
Michael Lutz 37116a7575 Codechange: [OSX] Remove old code that has no effect on current OSX versions. 2021-06-22 21:09:37 +02:00
Michael Lutz 0d5d3083bd Codechange: [OSX] Use more exact enum names where introduced with the 10.12 SDK.
The enum values still have the exact same numerical values, but the 10.12
SDK introduced more explicit names (e.g. like NSEventTypeApplicationDefined
instead of NSApplicationDefined) for several enum constants.
Use them when available.
2021-06-22 21:09:37 +02:00
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
Michael Lutz 25656a10cb Fix #8808: [OSX, OpenGL] Crash on switching blitters due to double-mapping the video buffer. 2021-03-08 15:43:22 +01:00
Patric Stout 6a8c461e38 Codechange: [OSX] GameLoop is really more like MainLoop
MainLoop() is used to bootstrap OSX, where later a callback is
done to GameLoop() to execute OpenTTD. All other video drivers
don't need that, so what is in GameLoop is in MainLoop for all
other drivers. This is rather confusing. So, instead, name
GameLoop MainLoopReal to be more in sync with the other drivers.
2021-02-24 21:58:47 +01:00
milek7 751f595bb6 Fix: VkMapping declarations violated C++ ODR rule. 2021-02-14 23:19:50 +01:00
Michael Lutz f5555a6d26 Fix 9c872192: [OSX] Clear mouse button emulation flag. 2021-02-14 12:58:45 +01:00
Michael Lutz e5c3253642 Add: [OSX] Setting to disable HiDPI graphics rendering. 2021-02-14 11:50:18 +01:00
Michael Lutz 0fc763bc55 Change: [OSX] Render screen in full native resolution on HiDPI displays. 2021-02-14 11:50:18 +01:00
Michael Lutz acca56b6a5 Cleanup: [OSX] Improve some comments. 2021-02-13 22:21:17 +01:00
Michael Lutz c78e559e88 Codechange: [OSX] Remove unused 'app active' flag. 2021-02-13 22:21:17 +01:00
Michael Lutz 9c8721922b Fix: [OSX] An emulated right mouse down event has to be followed by right mouse up. 2021-02-13 22:21:17 +01:00
Michael Lutz 649ff5f9f9 Codechange: [OSX] Use relative mouse handling during scrolling. 2021-02-13 22:21:17 +01:00
Michael Lutz 063b90b97d Codechange: [OSX] Move key event handling to our view. 2021-02-13 22:21:17 +01:00
Michael Lutz f4bd54fedd Codechange: [OSX] Move mouse event handling to our NSView. 2021-02-13 22:21:17 +01:00
Michael Lutz bd42fc94cc Codechange: [OSX] Move some things from video driver to our NSView. 2021-02-13 22:21:17 +01:00
Michael Lutz 965ce12947 Codechange: [OSX] Use newer mouse tracking API. 2021-02-13 22:21:17 +01:00
Michael Lutz 42af13c141 Codechange: [OSX] Split drawing into its own subview.
This allows the drawing backend code to be independent
of any event or command handling.
2021-02-13 22:21:17 +01:00
Michael Lutz 60f30036f1 Codechange: [OSX] Drain autoreleased objects in each game loop cycle. 2021-02-13 22:21:17 +01:00
Michael Lutz 8aaf4ea098 Codechange: [OSX] Split Window and back buffer creation in Cocoa video driver. 2021-02-13 22:21:17 +01:00
Michael Lutz 88f6c7a9f3 Codechange: [OSX] Fold remaining Cocoa video subdriver into the main driver. 2021-02-13 22:21:17 +01:00
Michael Lutz 4db7837d06 Codechange: [OSX] There is only one subdriver left, remove virtual dispatch. 2021-02-13 22:21:17 +01:00
Michael Lutz 4ce53cb851 Fix: [OSX] Quitting in fullscreen mode would loose the original window size.
This replicates the behaviour on e.g. Windows, which saves the original window size.
2021-01-03 21:20:28 +01:00
Michael Lutz c860a247d3 Change: [OSX] Hide Dock and menu during fullscreen mode. 2021-01-03 21:20:28 +01:00
Michael Lutz 7bdaabf5f1 Cleanup: [OSX] Remove cargo cult back-buffer alpha setting on show/hide and instead simply initialise the buffer on allocation. 2021-01-03 13:25:32 +01:00
Michael Lutz 9ccef816f9 Codechange: [OSX] Re-arrange the OSX video driver code by combining all drawing code and moving the window/event handling to a different file.
This is just a code move/rename, not a functionality change.
2021-01-03 13:25:32 +01:00