Commit Graph

699 Commits

Author SHA1 Message Date
Patric Stout
090616b4c9
Add: allow loading heightmaps from command-line (#11870)
If you want to load a file from tar, you have to give the file
inside the tar in order for it to work:

<tar-file>/<dir-in-tar>/<file>.png
2024-01-22 22:35:25 +00:00
Patric Stout
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 Stout
32fc740582
Fix: [SDL2] fullscreen always used the resolution of the first display (#11779) 2024-01-14 22:41:51 +00:00
Patric Stout
302ba93471
Fix: [SDL2] only resolutions of the first display were shown (#11778) 2024-01-14 22:25:54 +00:00
Patric Stout
d3ee045c2d
Codechange: refactor the Windows-only DllLoader in a cross-platform LibraryLoader (#11751) 2024-01-10 21:38:58 +00:00
Rubidium
e3f49ee7a0 Codechange: coding style fixes 2024-01-04 16:23:54 +01:00
Rubidium
2072e532f7 Codechange: replace NULL with nullptr 2023-12-26 07:18:52 +01:00
Peter Nelson
b85ecf9ac2
Codechange: Replace pointer to Sprite array with reference to SpriteCollection. (#11580)
Add `SpriteLoader::SpriteCollection` type which is an array of `SpriteLoad::Sprite`.

This removes the ambiguity of what `SpriteLoader::Sprite *` is pointing to,
and cleans up mismatches using both dereference -> and array access [] for the
same object.
2023-12-20 20:38:21 +00:00
Patric Stout
b866e52b17
Remove: officially mark Vista as no longer supported (#11531)
It is very likely Vista hasn't been working for years, but the
amount of users that use an OS that has been EoL for over 11 years
is very small, so reports happen rarely.
2023-12-02 22:12:50 +00:00
rubidium42
cb8612ba79 Remove: ZOOM_LVL_COUNT
This is the only enumeration with a COUNT and END. The logic of the COUNT
implied that BEGIN could be non-zero, but all but two uses of zoom level
assume that BEGIN is zero, making the separate count only confusing.
2023-11-29 21:12:28 -04:00
Peter Nelson
d4008850e3 Codechange: Ensure function opening { is on new line. 2023-11-09 20:15:38 +00:00
Rubidium
c6411168d8 Cleanup: missing spaces before continuation * in some comments 2023-11-01 22:56:11 +01:00
frosch
5733145c59 Cleanup: Remove unneeded parameters. 2023-09-19 22:49:59 +02:00
frosch
b5885295f0 Codechange: Use parameters, which should be used. 2023-09-19 22:49:59 +02:00
frosch
b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Rubidium
8c742b456f Codechange: use Textbuf directly, instead via several virtual functions in Window 2023-09-06 23:07:04 +02:00
glx22
4eddec9e79 Add: [Emscripten] Support for bootstrapping 2023-08-31 12:59:12 +02:00
glx22
3d1c4a8589 Codechange: [Emscripten] Improve syncfs synchronisation on exit/abort 2023-08-31 12:59:12 +02:00
Patric Stout
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
Patric Stout
5ac333c2cc
Fix: [MacOS] screen looks blue-ish when using newer SDKs (#11207)
The define kCGBitmapByteOrder32Host changed (around SDK 12?)
into an enum, which means an old #ifndef was triggering,
overwriting the value to 0. Sadly, 0 means Order16Big, causing
RGBA to become GRAB, which results in strange colours.

As we no longer support PPC, drop that piece of code completely.
2023-08-18 13:22:00 +02:00
Rubidium
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
Rubidium
3f18a8863a Codechange: use std::getline to read strings from stdin 2023-06-29 16:49:10 +02:00
Rubidium
fd380127f0 Codechange: use SignalObjectAndWait since we do not support older than Windows XP anymore 2023-06-28 23:22:14 +02:00
Owen Rudge
1a3d1bca59 Remove: OS/2 port 2023-06-16 14:29:14 +01:00
Patric Stout
6869f387ba
Fix 07add7a9: [Win32] use full monitor resolution for fullscreen (#10985)
On Windows in fullscreen you cannot reach the top with
the cursor for the halve of the height of your toolbar.

Additionally, on Win10 in fullscreen you can see the actual toolbar.
2023-06-11 12:00:02 +02:00
Rubidium
d5c0d3beb7 Codechange: unify the formatting of the game's caption 2023-06-07 08:02:46 +02:00
Patric Stout
07add7a96e
Fix: [Win32] position window in center of workspace of primary display (#10942) 2023-06-04 18:38:16 +00:00
Patric Stout
0e56a73fb8
Fix: disable hardware acceleration when GPU driver crashed the game last attempt (#10928) 2023-06-04 14:40:17 +00:00
Patric 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 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
PeterN
d086f288cd
Codechange: Remove duplicated includes. (#10888)
These are now included by stdafx.h so don't need to be included again.
2023-05-29 14:29:00 +01:00
Rubidium
275ebf4509 Codechange: replace fprintf(<FILE*> with fmt::print(<FILE*> 2023-05-21 15:12:02 +02:00
Peter Nelson
56085be9bd Codechange: Move includes for common STL headers to stdafx. 2023-05-17 10:14:41 +01:00
Patric Stout
60399e17bd Codechange: C++-ify the Layouter and related functions
They all now access a std::string_view, instead of a "const char *"
or std::string (in some cases).

Additionally, GetCharAtPosition and friends now return an index
instead of a "const char *", as it makes for a more clear interface.
2023-05-08 19:21:42 +02:00
Rubidium
68ff3fd062 Change: include fmt.h C++ headers in stdafx.h
This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
2023-05-08 16:49:23 +02:00
Rubidium
f74e26ca7e Codechange: replace error/usererror printf variant with fmt variant and rename 2023-04-25 17:55:09 +02:00
PeterN
e97bf271dc
Codechange: Make SpriteType, CargoSortType, SourceType and ScriptType enum classes. (#10663)
This avoids a (soft) namespace conflict between the four ST_* enums.
2023-04-16 20:00:55 +01:00
Charles Pigott
b282664242 Codechange: Replace all usages of alloca/AllocaM with more modern/less discouraged alternatives 2023-04-15 16:57:00 +01:00
Tyler Trahan
066ae6f3fb Codechange: Simplify some CodeQL-flagged trivial switches 2023-03-25 18:03:16 -04:00
Rubidium
24b5033a06 Fix #10568: "can savegame be loaded check" failed in dedicated server
* If loading fails, it usually returns SL_REINIT which doesn't trigger check
 * If savegame has NewGRFs, it complains NewGRFs are not allowed in intro game
2023-03-15 22:14:29 +01:00
rubidium42
6ba55e663e Codechange: do not hide variables with other variables 2023-01-29 07:21:34 +01:00
Rubidium
ae422be979 Cleanup: remove/replace trailing ; with . in comments 2023-01-26 23:47:55 +01:00
Henry Wilson
0b2567d882 Codechange: Remove shift as fast-forward key when _DEBUG is defined 2023-01-26 22:15:06 +01:00
Rubidium
46dfb309bc Fix #10309: [SDL] Uninitialized width and height when turning off full screen 2023-01-07 15:46:00 +01:00
Rubidium
0251786f46 Fix: virtual call from constructor
That fills an instance variable that is only read from the Game Options window
and that is overwritten when the video driver is started. Since you cannot get
into the Game Options window without starting the video driver, it is just
pointless and wrong code that would never be noticed by the end user.
2023-01-06 19:34:35 +01:00
Patric Stout
1fb101eabb
Codechange: address CodeQL issue "Multiplication result converted to larger type" (#10306)
Most are very unlikely to ever be triggered in our codebase; two
stand out: linkgraph and money cheat. Those, potentially, could
wrap earlier than expected.
2023-01-02 20:30:02 +00:00
Peter Nelson
9666e46739 Feature: Variable GUI scale.
GUI scale is now variable from 100% to 500%, and no longer restricted to
powers-of-2.
2022-11-12 18:28:39 +00:00
PeterN
4031894aef
Cleanup: Remove svn-style $Id$ comments. (#10122) 2022-11-01 18:24:31 -06:00
Bouke Haarsma
45d98f689a Fix #9993: Handle DPI changes on macOS and Windows 2022-10-16 16:52:14 +02:00
Bouke Haarsma
f3fd9b5895
Codechange: typo in code comment (#10061) 2022-09-29 00:12:21 +01:00