136 Commits
Author SHA1 Message Date
Gleb MazovetskiyandClaude Fable 5 ac2d7fc731 Replace libfmt with std::format
- `fmt::format` with literal format strings -> `std::format`.
- `fmt::format(fmt::runtime(...))` -> `FormatRuntime` in the new
  `utils/format.hpp`, a std::vformat wrapper that is also safe under the
  P2905 lvalue requirement of `std::make_format_args`.
- `fmt::dynamic_format_arg_store` (Lua logging) -> a small hand-rolled
  per-field formatter over `std::variant`, returning `std::expected`.
- `fmt::format_int` -> `std::to_chars`.
- `fmt::join` -> manual joins at the two call sites.
- SDL_audiolib: new patch that rewrites aulib_log.h to use std::format
  and drops the fmt dependency from its CMakeLists.
- The `-static-libstdc++` guard now keys off
  `DEVILUTIONX_STATIC_SDL_AUDIOLIB` instead of `DEVILUTIONX_STATIC_LIBFMT`.
- libfmt removed from CMake, vcpkg, Brewfile, CI workflows,
  Dockerfiles, packaging scripts, UWP project, and docs.
- macOS bumped to 13.3+, iOS to 16.3+ (required for `<format>`)
- Amiga m68k: provide `__cmpdf2`, which is missing from the hard-float
  libgcc multilib but referenced via libstdc++'s long double paths.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-22 00:00:04 +02:00
LP f295e67b9f Add multiplayer event logging 2025-11-25 04:07:49 +01:00
Gleb Mazovetskiy 88f706e0d1 SDL3: Add some backports / compat helpers 2025-10-10 00:49:44 +01:00
Gleb Mazovetskiy 8f6e9810d0 SDL3: Make text_render_integration_test build
Adds support for just enough SDL3 to make `text_render_integration_test`
work.
2025-10-05 20:17:47 +01:00
Gleb Mazovetskiy d7647d6c63 More dependency untangling
1. Moves more assets-related stuff from `init` to `engine/assets`.
2. Removes `SDL_audiolib` dependency from `soundsample.h`.
3. Cleans up some unused/missing includes.
2025-01-09 18:19:44 +00:00
Gleb Mazovetskiy c31836eab8 Split up engine.{h,cpp}
Untangles dependencies by splitting up `engine.{h,cpp}` into 3 files:

1. `primitive_render`
2. `ticks` -- only contains `GetAnimationFrame` for now.
3. `GetWidth2` renamed to `CalculateSpriteTileCenterX` and moved to `levels/dun_tile.hpp`.
2025-01-09 08:51:55 +00:00
Gleb Mazovetskiy 7b0558146e Async load: Handle errors 2024-11-10 13:49:01 +01:00
Gleb Mazovetskiy 8c1a847f41 Remove utils/stdcompat/string_view.hpp 2023-08-14 09:59:14 +01:00
Gleb Mazovetskiy 197e1180b2 Add StrCat and StrAppend
Adds simple string / integer concatenation functions.

Many of the uses of `fmt::format` are simply concatenation
of a few strings and integers.

`StrCat` is an easier-to-read alternative to such uses of `fmt`.
2022-07-10 06:14:58 +02:00
Gleb Mazovetskiy 72660d9189 Migrate snprintf to fmt (#4845)
* Migrate `app_fatal` from printf to libfmt
* Migrate snprintf to fmt
2022-07-02 02:36:17 +02:00
Gleb Mazovetskiy 1fc8ecb6f6 Add fmt::runtime annotations for C++20 support
`fmt` requires non-contexpr format string arguments to be wrapped in
`fmt::runtime` in C++20.
2022-06-14 12:46:36 +01:00
Gleb Mazovetskiy 779ccaca17 Overhaul translation fetching
1. Do not modify the map after loading. Instead, return string views
   (guaranteed to be null-terminated) from look up functions and return
   the key directly if not found.
2. Use an `unorded_map` instead of `map` where available (C++20).
   Saves a bit of RAM (~50 KiB) and improves lookup performance.
2022-06-14 12:46:36 +01:00
Anders Jenbo 1409e604f5 Reduce string conversions 2022-03-20 11:04:15 +01:00
Gleb MazovetskiyandAnders Jenbo 7e1fea6f76 clang-format all files in {Source,test}/
Also includes a few manual tweaks to comments and newlines for better results.

Co-authored-by: Anders Jenbo <[email protected]>
2021-11-24 23:44:12 +01:00
Anders Jenbo 6e63354cd1 Remove safe guards around strings own the input for 2021-11-22 10:07:31 +01:00
Anders Jenbo 799f1763af Performce UTF8 aware limited string copies 2021-11-22 03:28:51 +01:00
Gleb Mazovetskiy 3d308983a8 Migrate to libmpq
libmpq is a much simpler alternative to StormLib for reading MPQ archives.

We use our own fork of libmpq: https://github.com/diasurgical/libmpq

Impact:

* DevilutionX is now a lot more portable. Unlike StormLib, libmpq only
  needs platform-specific code for Windows.
* Locks around file access **removed** (instead we duplicate the file descriptor for streamed audio only).
* RAM usage is **300 KiB** lower than StormLib.
* Stripped release linux_x86_64 binary is **32 KiB** smaller.
* Amiga build now hangs instead of crashing.
2021-11-06 23:51:42 +00:00
Gleb Mazovetskiy 7e230df94a Allow forcing Hellfire with command-line flags
This is useful for systems such as batocera.linux that have dynamic
launcher items that depend on the presence of the appropriate MPQ files.
2021-10-25 13:52:14 +01:00
BC Ko f8fa0e5f76 documenation cleanup: appfat 2021-08-30 13:51:42 +02:00
Anders Jenbo d523fc1e81 Cleanups 2021-08-02 10:12:40 +02:00
Vladimir Olteanu 2d0c818a63 Use SdlThread stuff in appfat.cpp 2021-07-22 01:20:23 +02:00
Anders Jenbo d9e33b36f4 🔥 Delete FileErrDlg as it is now unused 2021-06-27 07:47:15 -07:00
Anders Jenbo f167bd4dfb Clang-tidy: llvm-include-order 2021-06-27 01:45:49 +02:00
Jmgr bbd39aa513 Replace sprintfs with strcpy for translatable strings 2021-05-21 01:02:45 +02:00
Jmgr 6e85cde978 Update format strings 2021-05-21 01:02:45 +02:00
Jmgr 0c27e756f7 Add fmt::format 2021-05-21 01:02:45 +02:00
Anders Jenbo 34744c068f ♻️Consitantly use %i and not %d 2021-05-15 14:17:52 +02:00
arcas 6502a3ca4d Adding resources for translation (#1973) 2021-05-15 14:12:28 +02:00
Anders Jenbo dbf5662ce6 :note: Update MPQ error messages 2021-05-08 04:38:07 +02:00
Anders Jenbo 72bed0709c ♻️Remove some magic numbers form appfat 2021-05-02 15:27:38 +02:00
Gleb Mazovetskiy 47c93c2f9c 🧹 Fix more -Wformat warnings 2021-05-01 22:19:27 +02:00
Anders Jenbo b69d18f12d 🌐 Enable translation of all remaning strings 2021-04-25 21:32:41 +02:00
Anders Jenbo dbfa9c27a5 ✨ Enable translation for all menus 2021-04-25 06:55:11 +02:00
Anders Jenbo f8e3672469 ♻️Fully apply clang-tidy rules to a few files 2021-04-20 19:39:38 +02:00
Anders Jenbo 660eeb19d2 🎨 Apply agreeable part of clang-tidy to appfat and automap 2021-04-19 03:51:41 +02:00
Anders Jenbo 8c821e98d3 🚚 Restructure files 2021-04-16 03:57:22 +02:00
Anders Jenbo 997c1dba55 🚚 Split up all.h in to proper header relations 2021-04-16 01:04:54 +02:00
Anders Jenbo 6e1a106a38 🚚 Move header we implement into the project 2021-04-16 01:04:54 +02:00
Anders Jenbo bfb3c11c2b 🎨 Change namespace to devilution 2021-04-06 15:21:25 +02:00
Anders Jenbo 501c536017 🎨 Clean up appfat 2021-04-06 11:57:08 +02:00
Anders Jenbo 3593266ef7 Converte all Levels when cross loading saves 2021-02-27 14:51:37 +01:00
pionere f5c1079d6f eliminate unused code 2021-02-19 22:04:11 +01:00
qndel ab9911064f unify checks for single and multiplayer 2021-02-18 22:32:01 +01:00
Anders Jenbo 4794c8357c Merge branch 'master' of github.com:diasurgical/devilution 2020-11-02 03:59:47 +01:00
Anders Jenbo 5a8f8eadb1 Clean up appfat.cpp 2020-11-02 01:29:14 +01:00
Anders Jenbo 72e2637061 Merge branch 'master' of github.com:diasurgical/devilution 2020-10-25 17:38:06 +01:00
Gleb Mazovetskiy ec329e645c Fix all "no-write-strings" warnings 2020-10-25 15:37:51 +01:00
Anders Jenbo e073422ce7 Unify executable for Spawn and Retail
The game will now autodetect if it should run in shareware mode or full
retail based on the found mpq file. Additionally it can beforced in the
shareware mode with --spawn even if the retail data is found.

This simplifies a lot of the spagetty code and lets us better refactor,
also worth noteing is that we won't have to setup a secound set of build
tests.
2020-10-20 19:42:01 +02:00
qndel 41fc140628 GetErrorStr cleanup 2020-10-12 05:31:09 +02:00
Anders Jenbo 7e04c63977 Merge branch 'hellfire' of github.com:diasurgical/devilution 2020-10-11 23:53:07 +02:00