Commit Graph

411 Commits (c46581e91f0e2c8f489494bb9cdc1752db79d8e5)

Author SHA1 Message Date
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 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Michael Lutz 967b27a2c1 Codechange: C++11 STL has a function for getting the number of CPU cores. 5 years ago
Michael Lutz ae748166d0 Codechange: Use platform independent C++11 function for sleeping on a thread. 5 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.
5 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.
5 years ago
Niels Martin Hansen 66c60e52ba Change: [SDL] Do not offer video smaller than 640x480 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
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.
5 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.
5 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.
5 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 :(
5 years ago
Charles Pigott c3bc7d657e Codechange: Remove ability for SDL to be dynamically loaded on Windows 5 years ago
Alexander Weiss 77ab6f8ec7 Change: [OSX] Prevent 2D scrolling for traditional scroll wheel mice 5 years ago
Alexander Weiss 0bb395b21d Change #6800: [OSX] Use high-precision scrolling deltas for 2D scrolling 5 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. 6 years ago
Matthijs Kooijman fa87212a76 Fix: Some spelling errors in printed messages 6 years ago
Patric Stout aef69443e7 Remove: WinCE support 6 years ago
Patric Stout 85adde7485 Remove: PSP support 6 years ago
Michael Lutz e0ae67cefa Fix: [OSX] Compiler warning about an unused NULL argument. 6 years ago
Michael Lutz 6c3902ac41 Codechange: [OSX] Use newer APIs to get resolution information when available. 6 years ago
Michael Lutz 964d310cda Codechange: [OSX] Use non-deprecated API for displaying an alert where supported. 6 years ago
Michael Lutz 74b7f0a9aa Fix: [OSX] Remove some OSX compiler warnings on newer SDKs/compilers. 6 years ago
Michael Lutz 4bfd277017 Codechange: [Win32] Use OS function for mouse tracking if present. 6 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) 7 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.
7 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. 9 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