Age | Commit message (Collapse) | Author |
|
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).
|
|
|
|
This reduces confusion when reading different drivers.
|
|
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.
|
|
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.
|
|
* Fix: Missing or needed spaces
* Codechange: Remove space
* Codechange: Remove space
* Codechange: More missing spaces
* Codechange: Missing spaces
* Codechange: Remove space
* Codechange: Remove space
|
|
The original code is "strictly correct", but just reads really
weird, and we use MakeDirty() in several other places instead too.
|
|
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.
|
|
All SDL_NNN errors print SDL_GetError, except for this one place.
|
|
This makes the code a bit more readable, as both intentions are
more clear, and there is less nesting in the main function.
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
This is already done by CMake: if SDL2 is not detected, this file
is not included.
|
|
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().
|
|
Other drivers do this too, and this makes the world a bit more
the same.
|
|
Functional it is identical. Just helps future-us when searching
for sleeps.
|
|
|
|
|
|
(#8581)
|
|
start. By default use the display where the mouse cursor is. (#8572)
|
|
|
|
|
|
The fix for #8067 solves the real issue, making this workaround unneeded.
|
|
|
|
This replicates the behaviour on e.g. Windows, which saves the original window size.
|
|
|
|
|
|
instead simply initialise the buffer on allocation.
|
|
anymore.
|
|
drawing code and moving the window/event handling to a different file.
This is just a code move/rename, not a functionality change.
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Niels Martin Hansen <nielsm@indvikleren.dk>
|
|
(#8399)
|
|
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).
|
|
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>
|
|
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.
|
|
|
|
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.
|
|
|
|
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.
|
|
emphasise differences.
|
|
|
|
|