Commit Graph
106 Commits
Author SHA1 Message Date
Peter NelsonandPeter Nelson 5aae8e2d64 Codechange: make Subdirectory a scoped enum 2026-04-05 21:46:07 +01:00
Rubidiumandrubidium42 8f9ceeec75 Codechange: add parameter and return documentation 2026-02-18 22:56:54 +01:00
Rubidiumandrubidium42 22d6a7b5ad Codechange: remove unneeded/unused return type 2026-02-04 00:27:30 +01:00
Maxandrubidium42 c918a29e49 Fix #12937: Allow the computer to go to sleep while the game is paused 2025-12-23 21:47:25 +01:00
Cyprian KlimaszewskiandGitHub 99f04f27de Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-07 11:25:08 +00:00
Peter NelsonandGitHub 4b7a3241bf Codechange: Remove unnecessary 'core' includes. (#14867) 2025-12-07 08:36:58 +00:00
Rubidiumandrubidium42 4c1cd4fe4c Codefix: remove unused mem_func includes 2025-05-06 20:03:35 +02:00
froschandGitHub 2a62eea005 Codefix: Comment style. (#14064) 2025-04-21 17:25:09 +02:00
froschandfrosch 20805ba84b Codechange: Use EncodeUtf8 and DecodeUtf8 directly, when dealing with a single character. 2025-04-03 18:43:41 +02:00
stormconeandGitHub f8f76eb9f3 Fix 089c7a2: SDL2 application name hint was not effective. (#13926) 2025-04-01 16:07:38 +02:00
Eri the SwitchandPeter Nelson 69ee8a8480 Add: Implement 2D map scrolling under SDL2 (#13167)
Use a base multiplier to keep the existing option range (1-15).

SDL2 >= 2.18 allows for considerably smoother scrolling, but
basic support for earlier versions is included.
2024-12-14 15:43:31 +00:00
Peter NelsonandPeter Nelson 3be0166801 Codechange: Use std::ranges::find where possible.
Replace `std::find(range.begin(), range.end(), ...)` with `std::ranges::find(range, ...)`.
2024-11-24 10:36:03 +00:00
Charles PigottandGitHub 884b93c4c0 Add: Set application name for SDL2 (#13061) 2024-11-06 19:51:03 +00:00
Jonathan G Rennisonandrubidium42 8710e9b8c8 Fix #12608: SDL keycode to vkey mapping 2024-05-07 18:33:29 +02:00
Peter NelsonandGitHub 90029beb49 Codechange: Ensure SDLK mappings stay in the expected order. (#12608)
Add a constexpr constructor that ensures at compile-time that the source SDLK range matches the target range.
2024-05-02 23:19:08 +01:00
FenandGitHub 2559bdfa6f Fix 2d27e8e: Update numpad keycodes for SDL2, making it usable (#12596)
* Fix 2d27e8e: Update numpad keycodes for SDL2, making it usable

* Cleanup: List sdl2 numpad mappings individually
2024-05-01 23:10:01 +02:00
Peter NelsonandPeter Nelson 332cbca36e Codechange: Pass std::string_view from drivers instead of char *. 2024-04-10 22:02:04 +01:00
Peter NelsonandPeter Nelson cdfffb551c Fix: sym->sym accidentally changed to sym prevented keys working with SDL. 2024-04-08 18:21:42 +01:00
Rubidiumandrubidium42 62f5c595f3 Codechange: use range-based for loops and let count be correct count 2024-04-07 23:08:33 +02:00
froschandGitHub 603154899a Add: [SDL2] Driver parameter 'no_mouse_capture' to ease interactive debugging (#12336) 2024-03-23 20:48:26 +01:00
Patric StoutandGitHub a3cfd23cf9 Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Patric StoutandGitHub 375074577f Fix: [SDL] remove hint to avoid hardware acceleration (#11790)
This hint was once needed because of the way we handled surfaces.
But as OpenGL already uses a hardware surface, we already had to
fix all the issues that comes with it. As that is generic code,
this hint is no longer actually needed. Further more, recent SDL
versions break because of it on Wayland.
2024-01-15 21:57:55 +01:00
Patric StoutandGitHub 32fc740582 Fix: [SDL2] fullscreen always used the resolution of the first display (#11779) 2024-01-14 22:41:51 +00:00
Patric StoutandGitHub 302ba93471 Fix: [SDL2] only resolutions of the first display were shown (#11778) 2024-01-14 22:25:54 +00:00
glx22andLoïc Guilloux 4eddec9e79 Add: [Emscripten] Support for bootstrapping 2023-08-31 12:59:12 +02:00
glx22andLoïc Guilloux 3d1c4a8589 Codechange: [Emscripten] Improve syncfs synchronisation on exit/abort 2023-08-31 12:59:12 +02:00
Patric StoutandGitHub 502414b567 Fix: [Emscripten] config not saved on exit game (#11248)
When changing a Game Option and pressing Exit Game, the changes
were not actually stored. This because the post-mainloop code
was never executed for Emscripten.
2023-08-31 10:10:11 +01:00
Rubidiumandrubidium42 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
Rubidiumandrubidium42 d5c0d3beb7 Codechange: unify the formatting of the game's caption 2023-06-07 08:02:46 +02:00
Patric StoutandPatric 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
Patric StoutandPatric Stout a969a78f81 Fix: [SDL] unify the way X11 and Wayland handle mouse events
Basically, we drop RelativeMode completely, and use the same trick
as used by the Windows driver: read all motion events till the last
one, and use that as value.
2023-06-04 00:40:56 +02:00
Henry Wilsonandrubidium42 0b2567d882 Codechange: Remove shift as fast-forward key when _DEBUG is defined 2023-01-26 22:15:06 +01:00
Rubidiumandrubidium42 46dfb309bc Fix #10309: [SDL] Uninitialized width and height when turning off full screen 2023-01-07 15:46:00 +01:00
Niels Martin Hansen 345dcd3c7b Add: Show current video driver info in Options window 2022-05-03 21:03:30 +02:00
embeddedtandGitHub 883e4ea325 Change: [Emscripten] set default scrolling mode to non-pointer-locking (#9191) 2021-06-28 18:39:09 +02:00
Patric StoutandPatric Stout 74186998a2 Codechange: use _cur_palette the same in all the drivers
It was a bit of a mixed bag. With this change, gfx.cpp is in
control who accesses _cur_palette from the video-drivers.
2021-06-26 20:28:05 +02:00
Rubidiumandrubidium42 f904aef176 Cleanup: use nullptr instead of 0 or NULL 2021-06-17 16:18:30 +02:00
rubidium42andrubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
seanandGitHub 0464a50ab8 Add: Display refresh rate game option (#8813) 2021-03-09 10:22:52 +01:00
Patric StoutandPatric Stout e56d2c63c3 Add: [Video] move GameLoop into its own thread
This allows drawing to happen while the GameLoop is doing an
iteration too.

Sadly, not much drawing currently can be done while the GameLoop
is running, as for example PollEvent() or UpdateWindows() can
influence the game-state. As such, they first need to acquire a
lock on the game-state before they can be called.

Currently, the main advantage is the time spend in Paint(), which
for non-OpenGL drivers can be a few milliseconds. For OpenGL this
is more like 0.05 milliseconds; in these instances this change
doesn't add any benefits for now.

This is an alternative to the former "draw-thread", which moved
the drawing in a thread for some OSes. It has similar performance
gain as this does, although this implementation allows for more
finer control over what suffers when the GameLoop takes too
long: drawing or the next GameLoop. For now they both suffer
equally.
2021-03-08 19:18:55 +01:00
Patric StoutandPatric Stout 4610aa7ae3 Remove: [Video] no longer draw in a thread
Drawing in a thread is a bit odd, and often leads to surprising
issues. For example, OpenGL would only allow it if you move the
full context to the thread. Which is not always easily done on
all OSes.
In general, the advise is to handle system events and drawing
from the main thread, and do everything else in other threads.
So, let's be more like other games.

Additionally, putting the drawing routine in a thread was only
done for a few targets.

Upcoming commit will move the GameLoop in a thread, which will
work for all targets.
2021-03-08 19:18:55 +01:00
Patric StoutandGitHub 04db99749b Fix #8784: using alt+enter didn't update the fullscreen toggle visibly (#8820)
Basically, the window was not invalidated, so it was never redrawn.
This made it look like it wasn't working, but it really was.
2021-03-08 16:57:59 +01:00
Patric StoutandCharles Pigott c3dc27e37e Add: settings to limit your fast-forward game speed
By default this setting is set to 2500% normal game speed.
2021-02-28 18:04:51 +00:00
Patric StoutandPatric Stout 67d3c6aa71 Codechange: [Video] move InteractiveRandom() to the VideoDriver 2021-02-24 21:58:47 +01:00
Patric StoutandPatric Stout c409f45ddd Codechange: [Video] make the prototype of PollEvent() the same for all drivers
Additionally, call it from the draw-tick.
2021-02-24 21:58:47 +01:00
Michael Lutz 421b599541 Codechange: [SDL2] Split driver in base-part and default backend 2021-02-22 22:16:07 +01:00
Michael Lutz a77b202767 Codechange: [SDL] Move dirty_rect to class scope. 2021-02-22 22:16:07 +01:00
Patric StoutandMichael Lutz e75858ce5e Codechange: [SDL2] Allow several places to hook into the SDL driver
This allows future subdrivers to use these to manage their
own flow.
2021-02-22 22:16:07 +01:00
Patric StoutandMichael Lutz 101e394475 Codechange: [SDL2] Move functions and variables to class-scope
This allows future subdrivers to override them.
2021-02-22 22:16:07 +01:00
Patric StoutandMichael Lutz 0d58bc9384 Codechange: [SDL2] Move SDLSurface code to its own function
This increases readability, and allow future subdrivers to not
use SDLSurface to draw.
2021-02-22 22:16:07 +01:00