Michael Lutz
f175e38666
Add: [Win32] Automatic zoom level suggestion for Win32 video driver.
...
The zoom level suggestion is based on the DPI scaling set in Windows.
We use 150% scaling as the threshold for 2X zoom and 300% scaling
as the threshold for 4X zoom.
4 years ago
Michael Lutz
22f5aeab07
Feature: Automatic UI and font zoom levels when supported by the OS.
4 years ago
Michael Lutz
f5555a6d26
Fix 9c872192: [OSX] Clear mouse button emulation flag.
4 years ago
Michael Lutz
e5c3253642
Add: [OSX] Setting to disable HiDPI graphics rendering.
4 years ago
Michael Lutz
0fc763bc55
Change: [OSX] Render screen in full native resolution on HiDPI displays.
4 years ago
Michael Lutz
8906e9e0fd
Codechange: Consistently use screen size and not driver resolution for determining window sizes.
4 years ago
Michael Lutz
acca56b6a5
Cleanup: [OSX] Improve some comments.
4 years ago
Michael Lutz
c78e559e88
Codechange: [OSX] Remove unused 'app active' flag.
4 years ago
Michael Lutz
9c8721922b
Fix: [OSX] An emulated right mouse down event has to be followed by right mouse up.
4 years ago
Michael Lutz
649ff5f9f9
Codechange: [OSX] Use relative mouse handling during scrolling.
4 years ago
Michael Lutz
43326d11d8
Change: [OSX] Use a layer-backed view to speed up drawing.
4 years ago
Michael Lutz
2a8c3a2cf6
Codechange: [OSX] Align backing buffer pitch for a tiny bit performance.
4 years ago
Michael Lutz
94b76ce9a4
Cleanup: [OSX] Move event loop into video driver file.
4 years ago
Michael Lutz
23389e9491
Remove: [OSX] Startup splash screen.
...
It wasn't displayed anyway as it was never copied to the bundle.
4 years ago
Michael Lutz
063b90b97d
Codechange: [OSX] Move key event handling to our view.
4 years ago
Michael Lutz
f4bd54fedd
Codechange: [OSX] Move mouse event handling to our NSView.
4 years ago
Michael Lutz
bd42fc94cc
Codechange: [OSX] Move some things from video driver to our NSView.
4 years ago
Michael Lutz
965ce12947
Codechange: [OSX] Use newer mouse tracking API.
4 years ago
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.
4 years ago
Michael Lutz
60f30036f1
Codechange: [OSX] Drain autoreleased objects in each game loop cycle.
4 years ago
Michael Lutz
8aaf4ea098
Codechange: [OSX] Split Window and back buffer creation in Cocoa video driver.
4 years ago
Michael Lutz
0eff7de659
Cleanup: [OSX] Doxygen comment style in video driver.
4 years ago
Michael Lutz
8ced72ab10
Codechange: [OSX] Inline some functions that are used in only one place.
4 years ago
Michael Lutz
13134f9d64
Codechange: [OSX] Replace #define with modern code.
4 years ago
Michael Lutz
88f6c7a9f3
Codechange: [OSX] Fold remaining Cocoa video subdriver into the main driver.
4 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.
4 years ago
Michael Lutz
4db7837d06
Codechange: [OSX] There is only one subdriver left, remove virtual dispatch.
4 years ago
Patric Stout
52317bb7df
Change: [SDL2] Remove unneeded delay of redrawing the screen
...
In testing, I could find no reason why this statement is here.
The comment is rather unclear (it states what it does, but not
why it would be needed).
This line of code was introduced with f4f40448
, which gives no
further insight on why it would be needed to have it here.
As such, let's remove it and see if anyone else reports any
problems with it. If so, this commit can be reverted and a more
clear comment should be added what this line of code is dealing
with (the WHY, not the WHAT).
4 years ago
Patric Stout
2e1535389a
Codechange: [SDL2] Don't use globals if we can do with locals
4 years ago
Patric Stout
2bbef6b5cf
Codechange: [SDL2] Name paint function Paint(), like other drivers do
...
This reduces confusion when reading different drivers.
4 years ago
Patric Stout
569ce6c7b4
Fix 30e69c51: palette was not marked dirty when creating a new
...
This means the code depended that the caller did this for us
before MakePalette() is executed, which is neither a
requirement nor a promise the code makes.
4 years ago
Patric Stout
2c9084d48c
Fix #8029 : [SDL2] disable draw-thread on wayland SDL video driver ( #8648 )
...
When the wayland SDL video driver is used, an EGL context is
created in the main thread. It is not allowed to update this
context from another thread, which is exactly what our draw-thread
is trying.
The other solution would be to move all of SDL into the
draw-thread, but that would introduce a whole scala of different
problems.
The wayland SDL backend is significantly faster than the
X11 SDL backend, but there is a performance hit nevertheless.
4 years ago
SamuXarick
a4035af337
Codechange: Apply coding style ( #8640 )
...
* Fix: Missing or needed spaces
* Codechange: Remove space
* Codechange: Remove space
* Codechange: More missing spaces
* Codechange: Missing spaces
* Codechange: Remove space
* Codechange: Remove space
4 years ago
Patric Stout
0e54c32452
Codechange: [SDL2] Use MakeDirty() to force a redraw
...
The original code is "strictly correct", but just reads really
weird, and we use MakeDirty() in several other places instead too.
4 years ago
Patric Stout
30e69c518b
Codechange: [SDL2] Rework how palette is updated
...
It now follows more what the Win32 driver does, and has far less
exceptions and special casing.
MakePalette creates the Palette and prepares surface.
UpdatePalette updates the Palette.
CheckPaletteAnim checks if UpdatePalette needs to be called and
marks the whole screen dirty so DrawSurfaceToScreen will do a
full redraw.
4 years ago
Patric Stout
eb80fefd1d
Fix: [SDL2] Display why SDL_CreateWindow() failed in case it does
...
All SDL_NNN errors print SDL_GetError, except for this one place.
4 years ago
Patric Stout
19345908cb
Codechange: [SDL2] Split away CreateMainWindow from CreateMainSurface
...
This makes the code a bit more readable, as both intentions are
more clear, and there is less nesting in the main function.
4 years ago
Patric Stout
8c37e5c526
Codechange: [SDL2] reworked the different surfaces to make it more readable
4 years ago
Patric Stout
8de325f256
Codechange: [SDL2] Only prepare "caption" if you are going to us it
4 years ago
Patric Stout
e41ec5b42e
Codechange: [SDL2] Minor code cleanup to remove silly variable
4 years ago
Patric Stout
678031f9b3
Codechange: [SDL2] Only set _cur_palette, never _local_palette
4 years ago
Patric Stout
f31b65825f
Codechange: [SDL2] Move FindStartupDisplay to its own function
4 years ago
Patric Stout
6916fc76bd
Codechange: [SDL2] reworked FindResolutions to be more like the rest
...
There was no default resolution fallback, and the code was different
from the win32 driver. It is now named the same and much more
similar.
4 years ago
Patric Stout
a52d716c88
Codechange: [SDL2] remove include-protection
...
This is already done by CMake: if SDL2 is not detected, this file
is not included.
4 years ago
Patric Stout
1eceee915e
Codechange: [SDL2/Win32] Be consistent how 0bpp blitters are not allowed
...
Sometimes it returned an usererror(), sometimes Start() failed.
Now it always fails on Start(), so nothing else has to check again
what blitter is used.
AfterBlitterChange() can never change to a 0bpp, so it is sufficient
to guard this with an assert().
4 years ago
Patric Stout
49df9c4155
Codechange: [Win32] Use _local_palette for most operations
...
Other drivers do this too, and this makes the world a bit more
the same.
4 years ago
Patric Stout
881d17d8f1
Codechange: [Win32] use CSleep() instead of Sleep() like everywhere else
...
Functional it is identical. Just helps future-us when searching
for sleeps.
4 years ago
Patric Stout
689404a4a1
Codechange: [Win32] Use return-early in RegisterWndClass()
4 years ago
Michael Lutz
7415964a4d
Codechange: [Win32] Remove Windows 95 specific mouse tracking work-around.
4 years ago
frosch
540fdfbf5a
Fix 0e62a398c7f: Only center the window, when it is smaller than the screen. ( #8581 )
4 years ago
frosch
0e62a398c7
Add: [SDL2] video driver parameter to put OpenTTD on a particular display on start. By default use the display where the mouse cursor is. ( #8572 )
4 years ago
Michael Lutz
fa60c1f8b9
Feature: Choose a sensible window size on a fresh OTTD config file. ( #8536 )
4 years ago
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants ( #8502 )
4 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.
4 years ago
Michael Lutz
6e8be3b03e
Fix #8067 : [OSX] Calculate title bar height instead of assuming a fixed value.
4 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.
4 years ago
Michael Lutz
c860a247d3
Change: [OSX] Hide Dock and menu during fullscreen mode.
4 years ago
Michael Lutz
6ad5489d01
Codechange: [OSX] Silence some annoying warnings.
4 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.
4 years ago
Michael Lutz
a61a741683
Change: [OSX] Compiling the Cocoa/Quartz video driver cannot be disabled anymore.
4 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.
4 years ago
Michael Lutz
65f65ad2ad
Codechange: Convert some more FIO functions to take std::string.
4 years ago
Michael Lutz
f3326d34e7
Codechange: Use std::string in FIO search path handling.
4 years ago
Michael Lutz
0c6e8a8123
Codechange: Store file search paths as std::string.
4 years ago
Charles Pigott
860c270c73
Codechange: Replace assert_compile macro with static_assert
4 years ago
Patric Stout
34051c10df
Doc: some comments for the win32 video driver ( #8409 )
...
Co-authored-by: Niels Martin Hansen <nielsm@indvikleren.dk>
4 years ago
Michael Lutz
4c1ee264a6
Fix: [OSX] Warning about ambiguous method (-Wobjc-multiple-method-names). ( #8399 )
4 years ago
Patric Stout
d5b9f7ac37
Add: [Emscripten] use "relative mouse mode" with SDL2
...
This mode doesn't wrap the mouse constantly, but requests SDL
to lock the mouse pointer. This is needed, as with Emscripten
you are not allowed to change the mouse poisition (only to lock
it into place).
4 years ago
Patric Stout
d15dc9f40f
Add: support for emscripten (play-OpenTTD-in-the-browser)
...
Emscripten compiles to WASM, which can be loaded via
HTML / JavaScript. This allows you to play OpenTTD inside a
browser.
Co-authored-by: milek7 <me@milek7.pl>
4 years ago
Patric Stout
2da07f7615
Codechange: unroll the SDL2 main loop
...
This commit prepares for the next commit, as Emscripten needs to
have a way to trigger a single iteration of the main loop. To
keep the real changes more clear, this commit only unrolls the
loop, and makes no changes to the logic itself.
4 years ago
Charles Pigott
348c231e12
Codechange: Make codestyle for CMake files consistent for 'control' statements
4 years ago
nikolas
c9aff698d0
Fix #8104 : Always add WINDOW_RESIZABLE flag to SDL2 ( #8211 )
...
This fixes a bug that can reproduced with these steps:
* Start openttd in fullscreen mode
* Turn off fullscreen mode
* Try to resize the window. The window can't be resized.
4 years ago
TechGeekNZ
fe1925931d
Cleanup: Correct typographic errors in code comments.
4 years ago
Patric Stout
56d54cf60e
Add: introduce CMake for project management
...
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.
Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.
This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.
Addtiionally, this heavily improves our detection of libraries, etc.
4 years ago
TechGeekNZ
cdd2892c49
Codechange: Realign SDL driver with SDL2 driver to ease maintenance and emphasise differences.
4 years ago
Niels Martin Hansen
764497206a
Fix #8066 : Try another fallback colourspace if first one fails
4 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.
5 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.
5 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.
5 years ago
Sebastian Pauka
bd3a5876b0
Fix #7644 : [Cocoa] Manually set colorspace to sRGB
5 years ago
xdavidwu
8fe38afd2b
Fix: [SDL2] Correct name of the video driver in debug log
...
SDL_GetVideoDriver(0) returns name of first video driver included in
the library, not the driver currently used.
SDL_GetCurrentVideoDriver() does what we want here.
5 years ago
S. D. Cloudt
13cc8a0cee
Cleanup: Removed SVN headers
5 years ago
Jonathan G Rennison
a15ace0f5b
Fix #7783 , Fix #7816 : [SDL2] Fix input handling in edit context
...
In particular this fixes handling of the shift key
5 years ago
Jonathan G Rennison
81f159434d
Codechange: Add EditBoxGainedFocus method to VideoDriver base class
5 years ago
Jonathan G Rennison
46f7c6a641
Change: [SDL2] Add an "unprintable" flag to struct VkMapping
...
SDL_Keysym::sym is not suitable for checking whether the character
is printable or not
5 years ago
Jonathan G Rennison
d41378c00a
Fix: [SDL2] Page down key not handled
...
SDLK_PAGEUP and SDLK_PAGEDOWN are not sequential
They must have separate entries in _vk_mapping
5 years ago
Jonathan G Rennison
3db399d7d9
Fix: [SDL2] Detection of backtick scancode
...
SDL_Keysym::scancode is a SDL_SCANCODE_* constant, not a raw scan code
5 years ago
Nikolas Nyby
4884dcacba
Fix #7784 : up/down/home/end key behavior in SDL2
...
Closes #7784 .
5 years ago
Michael Lutz
d5a9bd404a
Codechange: [OSX] Use std::unique_ptr with a custom deleter to simply memory management of Core Foundation types.
5 years ago
Nikolas Nyby
f13b184588
Codechange: Don't use SDL_CreateRGBSurfaceWithFormat()
...
This function requires libSDL 2.0.5 or higher. It looks like we don't
need to use it, and can just use the original SDL_CreateRGBSurface(),
with the masks set to 0, to trigger the default 8-bit format, which is
SDL_PIXELFORMAT_INDEX8.
Closes #7785
Note: this code path is activated by using an 8-bit blitter, like:
./bin/openttd -b 8bpp-simple
5 years ago
JMcKiern
04f659e768
Fix: Some typos found using codespell
5 years ago
nikolas
2d27e8e685
Add #6173 : New SDL 2 based video and sound drivers ( #7086 )
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
Michael Lutz
994664dec5
Fix #7644 : [OSX] Try to use system colour space to avoid video output performance degradation.
5 years ago
Andy
9014633866
Fix: change Quartz driver colorSpace handling to address certain macOS performance issues ( #7644 )
5 years ago
nikolas
9d6fb257c3
Cleanup: Remove duplicate thread.h include ( #7683 )
5 years ago
glx
9195f2337a
Codechange: use std::vector for _resolutions
6 years ago
Henry Wilson
7c8e7c6b6e
Codechange: Use null pointer literal instead of the NULL macro
6 years ago
Michael Lutz
967b27a2c1
Codechange: C++11 STL has a function for getting the number of CPU cores.
6 years ago
Michael Lutz
ae748166d0
Codechange: Use platform independent C++11 function for sleeping on a thread.
6 years ago
Michael Lutz
05bc2ed7cb
Codechange: Replace custom thread code with C++11 thread objects.
...
We assume a conforming C++11 compiler environment that has a valid <thread>-header.
Failure to run a real thread is handled gracefully.
6 years ago
Michael Lutz
05f4e73608
Codechange: Replace custom mutex code with C++11 mutex'es.
...
A conforming compiler with a valid <mutex>-header is expected.
Most parts of the code assume that locking a mutex will never fail unexpectedly,
which is generally true on all common platforms that don't just pretend to
be C++11. The use of condition variables in driver code is checked.
6 years ago
Niels Martin Hansen
66c60e52ba
Change: [SDL] Do not offer video smaller than 640x480
6 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.
6 years ago
Patric Stout
e3c639a09f
Remove: ENABLE_NETWORK switch
...
This switch has been a pain for years. Often disabling broke
compilation, as no developer compiles OpenTTD without, neither do
any of our official binaries.
Additionaly, it has grown so hugely in our codebase, that it
clearly shows that the current solution was a poor one. 350+
instances of "#ifdef ENABLE_NETWORK" were in the code, of which
only ~30 in the networking code itself. The rest were all around
the code to do the right thing, from GUI to NewGRF.
A more proper solution would be to stub all the functions, and
make sure the rest of the code can simply assume network is
available. This was also partially done, and most variables were
correct if networking was disabled. Despite that, often the #ifdefs
were still used.
With the recent removal of DOS, there is also no platform anymore
which we support where networking isn't working out-of-the-box.
All in all, it is time to remove the ENABLE_NETWORK switch. No
replacement is planned, but if you feel we really need this option,
we welcome any Pull Request which implements this in a way that
doesn't crawl through the code like this diff shows we used to.
6 years ago
Patric Stout
72c5f2b3ee
Remove: DOS support
...
In 10 years there was no active development on DOS. Although it
turned out to still work, the FPS was very bad. There is little
interest in the current community to look into this.
Further more, we like to switch to c++11 functions for threads,
which are not implemented by DJGPP, the only current compiler
for DOS.
Additionally, DOS is the only platform which does not support
networking. It is the reason we have tons of #ifdefs to support
disabling networking.
By removing DOS support, we can both use c++11 functions for threads,
and remove all the code related to disabling network. Sadly, this
means we have to see DOS go.
Of course, if you feel up for the task, simply revert this commit,
and implement stub c++11 functions for threads and stub functions
for networking. We are more than happy to accept such Pull Request.
6 years ago
Patric Stout
f58db44ff2
Remove: BeOS support (deprecated by Haiku)
...
In 10 years there is no commit to change how BeOS works, and we
have no active maintainer for it. It is unlikely it works in its
current state (but not impossible).
With the arrival of SDL2 (and removal of SDL), BeOS is no longer
support. SDL2 suggests to use Haiku instead of BeOS.
6 years ago
Patric Stout
7784d77713
Remove: MorphOS / AmigaOS support
...
In 10 years there is no commit to change how MorphOS works, and we
have no active maintainer for it. It is unlikely it works in its
current state (but not impossible).
With the arrival of SDL2 (and removal of SDL), MorphOS is no longer
support. There is an SDL2 port for MorphOS, but it is not maintained
by upstream SDL2, and nobody can currently test it out.
If anyone wants to re-add MorphOS, please do (revert this patch,
fix the problems, and create a Pull Request). If you need any help
doing so, let us know! It is not that we don't like MorphOS, it is
that we don't have anyone fixing the problems :(
6 years ago
Charles Pigott
c3bc7d657e
Codechange: Remove ability for SDL to be dynamically loaded on Windows
6 years ago
Alexander Weiss
77ab6f8ec7
Change: [OSX] Prevent 2D scrolling for traditional scroll wheel mice
6 years ago
Alexander Weiss
0bb395b21d
Change #6800 : [OSX] Use high-precision scrolling deltas for 2D scrolling
6 years ago
Charles Pigott
fe8c24e081
Codechange: Remove unnecessarily defined functions under MinGW
6 years ago
Charles Pigott
2d981a4b2c
Fix: A few minor compile warnings under MinGW
6 years ago
glx
c540d72445
Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined macro _WIN32
6 years ago
Niels Martin Hansen
2a868b9f3b
Feature: Framerate display window ( #6822 )
...
Frame rate and various game loop/graphics timing measurements and graphs. Accessible via the Help menu, and can print some stats in the console via the fps command.
6 years ago
Michael Lutz
dbfc417e65
Fix: [Win32] Garbage in OS window title if branch name was too long.
...
This was caused by a missing \0-character on reaching the buffer limit.
6 years ago
Alexander Weiss
3e910a5969
Change: [OSX] Disable macOS Sierra's automatic tab feature
6 years ago
Alexander Weiss
6df7ced343
Change: [OSX] Reversed pinch to zoom behaviour.
...
Made pinch out zoom in and pinch in zoom out, as virtually all macOS
applications do.
6 years ago
Michael Lutz
bb5584c835
Fix 74b7f0a: [OSX] Mouse cursor getting occasionally stuck.
7 years ago
Matthijs Kooijman
fa87212a76
Fix: Some spelling errors in printed messages
7 years ago
Patric Stout
aef69443e7
Remove: WinCE support
7 years ago
Patric Stout
85adde7485
Remove: PSP support
7 years ago
Michael Lutz
e0ae67cefa
Fix: [OSX] Compiler warning about an unused NULL argument.
7 years ago
Michael Lutz
6c3902ac41
Codechange: [OSX] Use newer APIs to get resolution information when available.
7 years ago
Michael Lutz
964d310cda
Codechange: [OSX] Use non-deprecated API for displaying an alert where supported.
7 years ago
Michael Lutz
74b7f0a9aa
Fix: [OSX] Remove some OSX compiler warnings on newer SDKs/compilers.
7 years ago
Michael Lutz
4bfd277017
Codechange: [Win32] Use OS function for mouse tracking if present.
7 years ago
michi_cc
c722cb26b8
(svn r27935) -Fix [FS#6629]: [Win32] Right mouse scrolling didn't work properly with the Windows 10 Fall Creators Update.
7 years ago
frosch
b4b98e5165
(svn r27893) -Codechange: Use fallthrough attribute. (LordAro)
7 years ago
frosch
b1fe837b8e
(svn r27775) -Fix [FS#6510]: Insufficient thread synchronisation when switching blitters. (JGR)
8 years ago
frosch
d5f82bf55b
(svn r27774) -Fix [FS#5889]: Enabling palette animation for 32bpp blitters while paused skipped initialisation of the palette and resulted in black windows.
...
-Revert (r23978): No SDL-specific fix required anymore. The new fix applies to all backends.
8 years ago
michi_cc
94b3965989
(svn r27675) -Fix [FS#6502]: [OSX] Building with 10.11 or 10.12 SDKs.
8 years ago
michi_cc
c83306391e
(svn r27673) -Add: [Win32] Thread names for windows debuggers.
8 years ago
frosch
31f046bd9b
(svn r27670) -Add: [FS#6471] Assign descriptive names to (GNU pthread) threads. (JGR)
8 years ago
alberth
0adfb1ac6f
(svn r27653) -Fix(r27647): Rename FileOperation enum and values to SaveLoadOperation to avoid nameclash with windows compiler toolkit.
8 years ago
alberth
597380e099
(svn r27650) -Codechange: Replace SaveOrLoadMode by FileOperation and DetailedFileType.
8 years ago
frosch
352e528cda
(svn r27167) -Fix: [SDL, Windows] Right-mouse-button scrolling scrolled/jumped way to far, when OpenTTD lagged during mouse event processing.
10 years ago
fonsinchen
306b6a11ee
(svn r27046) -Fix [FS#5812]: Don't require double-press from non-dead console hotkeys.
10 years ago
planetmaker
3df230af62
(svn r26943) -Fix: [Win32] Silence a warning about comparison of signed and unsigned variables when using gcc
10 years ago
michi_cc
5a2fd3630b
(svn r26818) -Fix [FS#AndyShouldHaveFoundFlySprayByNow] (r26758): [OSX] Line history and scrolling in the console window went on a walk.
10 years ago
michi_cc
2b3b8c93e7
(svn r26758) -Fix [FS#5972]: [OSX] Implement more of the text editing API to prevent crashes and improve IME support.
10 years ago
planetmaker
bcb9c64ac8
(svn r26709) -Fix (r15892 and others) [FS#6069]: [OSX] Compilation fails with some lzo2 versions if we define __LP64__ as 0 instead of checking whether it is defined (kernigh2)
10 years ago
rubidium
b476086c39
(svn r26538) -Codechange: remove double accounting of the drivers
11 years ago
frosch
631e8b45fd
(svn r26522) -Add: A config-file-only setting to disable usage of 8bpp video modes.
...
-Remove: [win32] fullscreen_bpp setting, which is replaced by above setting.
-Change: Disable usage of 8bpp blitters and video modes by default. Many modern OS and hardware cause issues with those.
11 years ago
rubidium
9ed12b0f07
(svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL)
11 years ago
rubidium
781dd48949
(svn r26502) -Fix: OSX compilation error
11 years ago
frosch
0e8bfeb7a9
(svn r26496) -Fix (r1547): Reading console input on dedicated server relied on unspecified behaviour.
11 years ago
rubidium
21f991e235
(svn r26489) -Codechange: properly account for the end of buffers in the file io code instead of assuming MAX_PATH is okay
11 years ago
rubidium
5b82822c12
(svn r26486) -Codechange: replace a number of snprintfs with seprintf
11 years ago
rubidium
0463dbdc9e
(svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values
11 years ago
planetmaker
3e9c10f9e1
(svn r26449) -Add: Allow more sound sleep for dedicated servers when there's nothing to do and nobody paying attention
11 years ago
michi_cc
e15446bc58
(svn r26367) -Fix: [Win32] Use a separate event to indicate that the drawing thread has finished initialising, preventing potential deadlocks.
11 years ago
fonsinchen
d8eda06a5a
(svn r26366) -Fix: Protect the windows video driver from concurrent access (frosch123)
11 years ago
fonsinchen
b4a015a4bd
(svn r26365) -Fix [FS#5867]: Don't draw the cursor when its sprite isn't ready and set _screen.dst_ptr immediately when the buffer changes (frosch123)
11 years ago
frosch
aaa6d0f9ae
(svn r26360) -Revert (r25550) / Fix [FS#5922]: ClientSizeChanged is only called via WndProcGdi which already has the mutex. The issue which r25550 tried to fix still exists as FS#5867.
11 years ago
frosch
27eede06c9
(svn r26351) -Fix: Protect all VideoDriver_SDL methods with the _draw_mutex.
11 years ago
rubidium
a942619911
(svn r26247) -Fix [FS#5854, FS#5855]: Possible out of bounds reads with the sse blitters (MJP)
11 years ago
rubidium
fb05674cb7
(svn r26211) -Add: specialised non-animated SS2 blitter (MJP)
...
With 32bpp base set about 30% faster than 32bpp-optimized, or about 10% for 8bpp base sets in the Draw function. Respectively about 5 and 1% of total run time
11 years ago
rubidium
2618d960e3
(svn r26209) -Codechange: remove some template magic and simplify some code
11 years ago
fonsinchen
c71aa27b92
(svn r26186) -Fix: Don't check for equality of MAC_OS_X_VERSION_MAX_ALLOWED.
11 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
2708aff853
(svn r26023) -Fix [FS#5805] (r25686): [OSX] Checking for a valid NSTextInputContext is supposed to fail on 10.4 according to docs, but somehow didn't, leading to a crash when an edit box lost focus.
11 years ago
rubidium
3b9f92e14c
(svn r26009) -Fix: warning about conditional expression with enumeral with non-enumeral type
11 years ago
michi_cc
a985f19d5a
(svn r26003) -Fix [FS#5795b] (r25743): [OSX] Some hotkeys were still triggered during text input.
11 years ago
michi_cc
8f8173c3fe
(svn r26002) -Fix: [OSX] If the console hotkey is a dead key, require two presses to toggle the console, allowing input of accented characters.
11 years ago
michi_cc
8ceef6ec61
(svn r26001) -Fix [FS#5795a] (r25686): [OSX] Clear any pending marked characters from an edit box losing focus.
11 years ago
rubidium
52883db91b
(svn r25970) -Fix [FS#5787]: [SDL] Recursive mutex locking when changing blitter
11 years ago
michi_cc
9b68e4f864
(svn r25962) -Fix (r25951): [OSX] Do the SDK version test the proper way 'round.
11 years ago
michi_cc
a41b8c851d
(svn r25951) -Fix [FS#5797]: [OSX] Disable the old fullscreen sub-driver when compiling with SDK versions 10.9+.
11 years ago
michi_cc
a298a62098
(svn r25950) -Codechange: [OSX] Move some functions used by all video sub-drivers into the common source file.
11 years ago
michi_cc
f36396929a
(svn r25751) -Fix (r25657): [OSX] Restore fullscreen state also when starting on 10.7+.
11 years ago
michi_cc
6bbca9307d
(svn r25743) -Fix [FS#5705]: [OSX] Text input into an edit box would trigger hotkeys.
11 years ago
fonsinchen
0baa72aff9
(svn r25714) -Fix: explicitly cast some things to silence warnings on GCC 4.0
11 years ago
fonsinchen
fd16b0c65c
(svn r25713) -Fix: use proper ObjC style to avoid problems if members are missing
11 years ago
fonsinchen
8222e18586
(svn r25712) -Fix: define kCGBitmapByteOrder32Host to 0 if it's missing.
11 years ago
fonsinchen
f42d60150d
(svn r25711) -Fix: don't use NULL as integer
11 years ago
fonsinchen
a9fde2856c
(svn r25710) -Fix: string arguments to NSNotificationCenter::addObserver and NSNotificationCenter::postNotificationName can't be const in certain versions of OSX
11 years ago
michi_cc
b3ecfbb67a
(svn r25693) -Add: [OSX] Support the new IME functions introduced with 10.5.
11 years ago
michi_cc
30867c487f
(svn r25691) -Add: [OSX] Support for mouse selection in the IME composition string.
11 years ago
michi_cc
e2ec0ddb03
(svn r25690) -Change: [OSX] Position the candidate window at the caret position.
11 years ago
michi_cc
f5e4131492
(svn r25689) -Add: [OSX] Display the IME composition string ourself.
11 years ago
michi_cc
c64e297e0c
(svn r25688) -Codechange: [OSX] Make our view aware of text input by IMEs.
11 years ago
michi_cc
643a294e68
(svn r25687) -Codechange: [OSX] Pass text input directly down to the text handling.
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
0883cf76e3
(svn r25684) -Change: [Win32] Draw the composition string ourselves if possible.
11 years ago
michi_cc
cbdfd31a3c
(svn r25682) -Change: [Win32] Position the IME candidate window at the caret position.
11 years ago
michi_cc
da09fd3077
(svn r25681) -Change: [Win32] Position the IME composition window at the caret position.
11 years ago
michi_cc
21126aec62
(svn r25680) -Codechange: [Win32] Cancel the current IME composition when the input focus changes.
11 years ago
michi_cc
7422120014
(svn r25679) -Codechange: [Win32] Get the result string of an IME input directly without a trip through the window messaging system.
11 years ago
michi_cc
13873d2534
(svn r25678) -Codechange: Notify the video driver when an edit box lost (global) focus so it can abort any current input composition.
11 years ago
michi_cc
63332afcf0
(svn r25675) -Fix: [Win32] Handle DBCS characters correctly in the non-Unicode build.
11 years ago
michi_cc
e37968aadd
(svn r25673) -Fix: [Win32] Use the right code page for converting ANSI strings into UTF-8 for non-Unicode builds. And don't crap out on DBCS code pages either.
11 years ago
michi_cc
fdc436b531
(svn r25672) -Fix: [Win32] Handle Unicode characters from outside the BMP correctly.
11 years ago
michi_cc
019984a14f
(svn r25671) -Codechange: Pass character and key code separately to the keyboard handler.
11 years ago
michi_cc
923eb009e8
(svn r25667) -Fix: [Win32] Only forward key presses to the IME system if an edit box has the input focus.
11 years ago
michi_cc
8b476de3bf
(svn r25666) -Feature [FS#4760]: [OSX] Pinch gesture support for zooming. (Based on patch by leecbaker)
11 years ago
michi_cc
8003da77aa
(svn r25665) -Fix [FS#4689]: [OSX] Crash when unhiding the main window.
11 years ago
michi_cc
1ae357e905
(svn r25664) -Add [FS#4847]: [OSX] Bootstrap downloading of a baseset. (Matthieu)
11 years ago
michi_cc
4ec314989d
(svn r25660) -Fix: [OSX] The name's OpenTTD, not OTTD.
11 years ago
michi_cc
d23fdfa403
(svn r25659) -Fix [FS#4420]: [OSX] System mouse cursor could become visible during dragging. (Matthieu)
11 years ago
michi_cc
408c595eb8
(svn r25658) -Fix [FS#4392]: [OSX] The mouse cursor would sometimes jump near the window borders. (Matthieu)
11 years ago
michi_cc
7ba4d425c8
(svn r25657) -Fix [FS#4744]: [OSX] The new 10.7 fullscreen code can now also be compiled with older SDK versions.
11 years ago
michi_cc
2702fe88d7
(svn r25656) -Cleanup: Coding style.
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
rubidium
d9065fbfbe
(svn r25550) -Fix [FS#5571]: [Windows] Race condition between two drawing threads could crash OpenTTD
11 years ago
rubidium
4fbcb73166
(svn r25523) -Fix [FS#5587]: SDL does not give an event when an application gets mouse focus while going to full screen, so manually force the mouse-is-in-window state
11 years ago
matthijs
0d28dc92fc
(svn r25318) -Fix: [SDL, FS#5580] Keyboard input stopped working after fullscreen toggle
11 years ago
rubidium
dcf3df65d3
(svn r25017) -Fix [FS#5466]: crash after bootstrap download of 32bits base set due to referencing a deleted mutex
12 years ago
matthijs
2752dd7bbe
(svn r25003) -Fix (r24993): [SDL] Keep a flag to remember if a hardware palette was requested.
...
- Previously, the code would query the SDL_HWPALETTE flag, which doesn't always match the requested value.
- This would cause SDL to be restarted on every window resize event, effectively breaking resizing.
12 years ago
matthijs
afd1e49224
(svn r25002) -Doc: [SDL] Fix typo in comment.
12 years ago
matthijs
328ed1cf94
(svn r24993) -Fix: [SDL] Improve 8bpp hardware palette support. Instead of always requesting SDL_HWPALETTE, it is now only done for 8bp blitters in fullscreen mode.
...
- This fixes 32bpp blitters on 8bpp X11, which would only render garbage with SDL_HWPALETTE.
- This prevents the colors of other applications from being messed up when running a 8bpp blitter on a 8bpp system.
- When running a 8bpp blitter on an 8bpp system without SDL_HWPALETTE (e.g., in windowed mode), this uses a new shadow surface with color approximation.
- The use of a hardware palette can be forced on and off using -v sdl:hw_palette=1 or -v sdl:hw_palette=0
12 years ago
matthijs
afcb4a25b2
(svn r24992) -Codechange: [SDL] Make CreateMainSurface and PollEvent private methods instead of static functions.
12 years ago
planetmaker
c24374f99c
(svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow)
12 years ago
rubidium
d5d96ba683
(svn r24877) -Fix: some whitespace "errors"
12 years ago
michi_cc
02f39ab1ee
(svn r24781) -Fix (r24762): [Win32] MinGW compiler warning.
12 years ago
michi_cc
e67c717c2f
(svn r24762) -Fix [FS#5359]: [Win32] Don't crash when switching to an unsupported fullscreen display mode (like 8 bpp modes in Windows 8).
12 years ago
yexo
1f75f81a41
(svn r24524) -Fix [FS#5296]: fix some compile problems in mac-only code (__ln__)
12 years ago
glx
ad48f766f7
(svn r24394) -Fix (r24188): changing resolution didn't resize the window
12 years ago
truebrain
353fd97de6
(svn r24189) -Fix: when going to fullscreen and back, restore to the resolution you were, not to the fullscreen resolution (Windows only)
13 years ago
truebrain
39912b7bde
(svn r24188) -Fix-ish [FS#5151] (r1): when changing the basics of a window (fullscreen, 8bpp/32bpp), and a window already exists, it was forced out of maximize mode, and its resolution/position was reset, often causing unwanted side-effects. As a "bonus", a WC_SIZE was triggered, and if the system was going from 8bpp to 32pp, this caused a forced window update in a limbo-state of the blitter (not fully 32bpp just yet, but for sure no longer 8bpp); this could cause random memory access which could lead to ACCESS_VIOLATIONS
13 years ago
rubidium
74785478ec
(svn r23980) -Fix (r23977): crash when starting with the 32bpp anim blitter
13 years ago
rubidium
4db85fcc4d
(svn r23978) -Fix: [SDL] Palette update was done too late making switching from 8bpp -> 32bpp look ugly
13 years ago
matthijs
311413a091
(svn r23910) -Fix: [SDL] Handle the SDL_VIDEOEXPOSE event.
...
- It seems this event is never triggered when using 1.2 (it has some
autorefresh feature which seems to have been removed in 1.3), but in theory
this event could also trigger on 1.2.
- Note that this fixes redraw issues when compiling against SDL 1.3, but it
still uses the "compatibility" rendering API using SDL_SetVideoMode and
SDL_UpdateRects. Eventually (when 1.3 is stable and released as 2.0), this
should probably be rewritting to use the new Windows and Renderers
available in SDL 1.3.
13 years ago
matthijs
cba6390973
(svn r23909) -Fix: [SDL] Fix keyboard-related segfault when compiling against SDL 1.3.
13 years ago
rubidium
af7ea8c525
(svn r23891) -Fix-ish: compile failures with SDL 1.3
13 years ago
michi_cc
52175a4260
(svn r23749) -Fix: [Win32] Work around a possible deadlock when initialising threaded drawing.
13 years ago
rubidium
fd559171b4
(svn r23527) -Codechange: unify colo(u)r as far as it goes
13 years ago
rubidium
7e7c262167
(svn r23488) -Fix [FS#4879] (r23241): artefacts when right click mouse moving with the allegro video driver
13 years ago
michi_cc
7099faba28
(svn r23482) -Change: [Win32] Move re-painting the window and doing palette animation into a separate thread.
13 years ago
rubidium
b231e80125
(svn r23470) -Codechange: move declaration of SwitchToMode to a header instead of declaring it in 6 other files
13 years ago
rubidium
ccededbf77
(svn r23451) -Codechange: [SDL] Move 32bpp-anim palette animation to the draw thread instead of the single threaded bit of the game loop. This causes a speedup of up to 15% when animation is turned on with the 32bpp-anim blitter
13 years ago
rubidium
61625e53c9
(svn r23448) -Fix: keep a local copy of the palette in the 32bpp animated blitter so changes of the palette data during the game don't influence drawing (with SDL)
13 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
rubidium
6e31c2f068
(svn r23241) -Codechange: make the decision when to go to the custom drawn cursor more prominently during the initialisation of OpenTTD
13 years ago
michi_cc
6a2735d24e
(svn r23119) -Fix: [Win32] Don't show a crash/assertion message box for a GUI-less video driver.
13 years ago
michi_cc
8c4c616cfe
(svn r23003) -Fix (r22999): Missing semicolon.
13 years ago
michi_cc
6dbb050a32
(svn r22999) -Codechange: Allow changing the blitter during the running game.
13 years ago
planetmaker
6a72d64dbe
(svn r22943) -Fix: [OSX] Typo broke debug compilation
13 years ago
planetmaker
58f00d786c
(svn r22921) -Fix: [OSX] Don't allow the old fullscreen mode also not as fallback on OSX 10.7. Also add a few sprinkles of coding style accross cocoa display drivers
13 years ago
rubidium
bffa93a4e9
(svn r22910) -Fix [FS#4617]: icon would (almost) never be shown for SDL builds
13 years ago
planetmaker
20e359acbe
(svn r22895) -Add: [OSX] Alternative code for the API calls deprecated in OSX 10.6 in the quartz video driver
13 years ago
planetmaker
45b099c655
(svn r22894) -Doc: Some sprinkles of doxygen for the cocoa video driver
13 years ago
planetmaker
bce482c76f
(svn r22893) -Fix [FS#4744]: [OSX] Compilation on OSX 10.7 was broken (based on patch by leecbaker)
...
-Add: [OSX] Support for fullscreen mode when compiled against SDK 10.7. Otherwise fullscreen mode is disabled when OpenTTD is run on OSX Lion
13 years ago
rubidium
9fe4b959ac
(svn r22818) -Fix [FS#4742] (r22796, rlongago): don't spawn threads for world generation and NewGRF scanning when using the dedicated or null video driver regardless of the used blitter
13 years ago
rubidium
421053a694
(svn r22788) -Codechange: move modal progress related functions and variables to progress.cpp/h
13 years ago
rubidium
37415b9cf7
(svn r22785) -Codechange: rename IsGeneratingWorld to HasModalProgress
13 years ago
planetmaker
e3d9879690
(svn r22678) -Doc: More doxygen sprinkles in MacOSX code and cocoa video driver
13 years ago
alberth
f1cae9960f
(svn r22512) -Add: Save heightmap.
14 years ago