Commit Graph

68 Commits (2f8e63e9548f8624d5dd333759bac82f66343010)

Author SHA1 Message Date
Michael Lutz b351cbe490 Fix #9743: [OSX] Only (re-)create touchbar sprites when requested by the main loop. 2 years ago
sean 0464a50ab8
Add: Display refresh rate game option (#8813) 3 years ago
Patric Stout b93d7dd3cb
Add: Option to (dis-)allow accelerated video drivers. (#8819)
The video drivers using the OpenGL backend are currently our only
accelerated drivers. The options defaults to off for macOS builds and
to on everywhere else.

Co-authored-by: Michael Lutz <michi@icosahedron.de>
3 years ago
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.
3 years ago
Patric Stout c409f45ddd Codechange: [Video] make the prototype of PollEvent() the same for all drivers
Additionally, call it from the draw-tick.
3 years ago
Michael Lutz 7f55f0a264 Codechange: [OSX] Add support for (un)locking the video buffer. 3 years ago
Michael Lutz 2f25e9bdf8 Codechange: [OSX] Separate video driver into a base and a Quartz implementation. 3 years ago
Michael Lutz f3c192c63d Codechange: [OSX] Only keep a total dirty rect for drawing.
When drawing an 8bpp screen buffer, palette resolving was done for each
dirty rectangle. In areas with high activity, this would mean a pixel might
have been resolved multiple times. Also, if too many individual updates
were queued, the whole screen would be refreshed, even if unnecessary.

All other drivers only keep one overall dirty rect, so do it here as well.
3 years ago
Patric Stout ec1dd0bf61 Codechange: be consistent in what CheckPaletteAnim() does and when it is called
Additionally, make sure this is a class method. Later commits
will make use of this.
3 years ago
Patric Stout 790fa7102e Codechange: be consistent in naming the paint function Paint()
Also move this function to be a class member. This to allow
further deduplicating of code in a later commit.
3 years ago
Patric Stout 661eb39ecc Codechange: move all input-handling of video-drivers into InputLoop 3 years ago
Michael Lutz 8d780e0607 Add: [OSX] Automatic zoom level suggestion for Cocoa video driver. 3 years ago
Michael Lutz acca56b6a5 Cleanup: [OSX] Improve some comments. 3 years ago
Michael Lutz c78e559e88 Codechange: [OSX] Remove unused 'app active' flag. 3 years ago
Michael Lutz 94b76ce9a4 Cleanup: [OSX] Move event loop into video driver file. 3 years ago
Michael Lutz f4bd54fedd Codechange: [OSX] Move mouse event handling to our NSView. 3 years ago
Michael Lutz bd42fc94cc Codechange: [OSX] Move some things from video driver to our NSView. 3 years ago
Michael Lutz 8aaf4ea098 Codechange: [OSX] Split Window and back buffer creation in Cocoa video driver. 3 years ago
Michael Lutz 0eff7de659 Cleanup: [OSX] Doxygen comment style in video driver. 3 years ago
Michael Lutz 8ced72ab10 Codechange: [OSX] Inline some functions that are used in only one place. 3 years ago
Michael Lutz 13134f9d64 Codechange: [OSX] Replace #define with modern code. 3 years ago
Michael Lutz 88f6c7a9f3 Codechange: [OSX] Fold remaining Cocoa video subdriver into the main driver. 3 years ago
Michael Lutz e6bea3961f Change: [OSX] Replace screen resolution list with suggested window sizes.
We never change the real screen resolution on OSX. As such, offering a list
of resolutions is pointless. Instead of that, offer the user a list of
commonly used window sizes up to the current screen size.
3 years ago
Michael Lutz 4db7837d06 Codechange: [OSX] There is only one subdriver left, remove virtual dispatch. 3 years ago
Michael Lutz fa60c1f8b9
Feature: Choose a sensible window size on a fresh OTTD config file. (#8536) 3 years ago
Michael Lutz 979b4af6ca Revert 4ce53cb8: [OSX] Delayed fullscreen switch is not needed anymore.
The fix for #8067 solves the real issue, making this workaround unneeded.
3 years ago
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.
3 years ago
Michael Lutz c860a247d3 Change: [OSX] Hide Dock and menu during fullscreen mode. 3 years ago
Michael Lutz 7bdaabf5f1 Cleanup: [OSX] Remove cargo cult back-buffer alpha setting on show/hide and instead simply initialise the buffer on allocation. 3 years ago
Michael Lutz a61a741683 Change: [OSX] Compiling the Cocoa/Quartz video driver cannot be disabled anymore. 3 years ago
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.
3 years ago
Michael Lutz 37bc2f8064 Codechange: Use std::string in the driver and blitter selection code. 4 years ago
Michael Lutz 9dd8b3d430 Remove: [OSX] Stuff that is pre-10.7 from the Cocoa/Quartz video driver. 4 years ago
Michael Lutz 0e5be3887c Remove: [OSX] Old fullscreen subdriver for pre 10.7 systems.
Since the move to C++11, building for pre 10.7 is not possible with the native
Apple tools. Also, due to bitrot, the file doesn't even compile anymore. While
this could be fixed, it shows that this subdriver is basically never used anymore.
4 years ago
Michael Lutz a31cbbf67f Remove: [OSX] QuickDraw video subdriver used for OSX versions up to 10.4.
Since the C++11 move, getting OpenTTD to compile and run for anything
below 10.7 basically requires building a custom compiler and libc++.
Also, the QuickDraw subdriver crashes on more modern OSX version. While this
is fixable, keeping the driver around is probably pointless.
4 years ago
Sebastian Pauka bd3a5876b0 Fix #7644: [Cocoa] Manually set colorspace to sRGB 4 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Michael Lutz ed6a427fcc Change: [OSX] Recreate backing store if the colour profile of the screen (or the screen) the game window is one changes.
This will result in changing colours if moving OpenTTD from one screen to another, but should avoid performance problems if the window is moved.
5 years ago
Henry Wilson af7d9020a1 Codechange: Use override specifer for overriding member declarations
This is a C++11 feature that allows the compiler to check that a virtual
member declaration overrides a base-class member with the same signature.

Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked
as virtual despite being a template.
5 years ago
Michael Lutz 74b7f0a9aa Fix: [OSX] Remove some OSX compiler warnings on newer SDKs/compilers. 6 years ago
rubidium defda16eb6 (svn r26108) -Codechange: some coding style (whitespace) 11 years ago
rubidium 6996b441d9 (svn r26107) -Codechange/cleanup: remove some coding bloat and simplify the driver factory instatiations 11 years ago
michi_cc b3ecfbb67a (svn r25693) -Add: [OSX] Support the new IME functions introduced with 10.5. 11 years ago
michi_cc c64e297e0c (svn r25688) -Codechange: [OSX] Make our view aware of text input by IMEs. 11 years ago
michi_cc e4d48f3a3b (svn r25686) -Codechange: [OSX] Abandon IME input if the edit box lost the focus. 11 years ago
michi_cc 6d50b10074 (svn r25655) -Fix: [OSX] Mouse cursor wasn't displayed properly after switching to fullscreen on 10.7+. (Based on patch by Maedhros) 11 years ago
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 12 years ago
rubidium 2ccbd2a6f5 (svn r23446) -Codechange: move _cur_palette and it's related first/count dirty variables into a single structure 13 years ago
michi_cc 6dbb050a32 (svn r22999) -Codechange: Allow changing the blitter during the running game. 13 years ago
planetmaker 45b099c655 (svn r22894) -Doc: Some sprinkles of doxygen for the cocoa video driver 13 years ago