65 Commits

Author SHA1 Message Date
Anders Jenbo 005e7dcc23 chore: clang-tidy cleanup part 1 2026-04-03 22:57:48 +02:00
Anders Jenbo 6f319978e6 Migrate from libmpq to mpqfs (#8482)
Co-authored-by: staphen <staphen@gmail.com>
2026-03-30 00:14:11 +02: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
Anders Jenbo 1c76897f2c Apply simple const rules using clang-tidy 2025-08-16 01:21:36 +02:00
staphen 84546f85d4 Validate length of incoming deltas 2025-05-10 20:01:53 -04:00
Gleb Mazovetskiy 16a6fc62e1 Deduplicate some of the MPQ handling
Reuse libmpq functions where possible instead of our own.
2023-09-10 02:16:15 +01:00
Gleb Mazovetskiy 74755c8be7 Remove utils/stdcompat/cstddef.hpp 2023-08-14 01:54:29 +01:00
Gleb Mazovetskiy 4fa3732526 Add missing <cstdint> includes
Done with the following script:

```ruby
Dir["Source/**/*.{h,c,cc,cpp,hpp}"].each do |path|
  v = File.read(path)
  next if !v.include?("uint32_t") || v.include?("cstdint")

  lines = v.lines
  line_num = if lines[2].start_with?(" *")
    lines.index { |l| l.start_with?(" */") } + 3
  else
    3
  end

  lines.insert(line_num, "#include <cstdint>\n")

  File.write(path, lines.join(""))
end
```

then fixed-up manually
2023-05-10 13:50:12 +01:00
Anders Jenbo 9cae6dad7d Clean up most usages of DWORD 2022-07-14 23:50:12 +02:00
ephphatha 1ca84d59c5 Ensure working buffers are zero-initialised for PKWareLib
explode() and implode() both have comments saying they expect the buffers to be zero-init, however new[] default initialises arrays which for char[] leaves them in an implementation defined state. On MSVC the memory is unitialised. To be safe use std::make_unique<T[]>(size_t) as this value-initialises each element of the array.
2022-04-17 06:14:52 +02:00
Gleb Mazovetskiy 75222ccef8 Overhaul dependency options
Changes how dependency options are handled and moves them out of
`CMakeLists.txt`.

Major changes:

1. The static default now takes `TARGET_SUPPORTS_SHARED_LIBS` into account
2. The `DIST` setting no longer affects the static default.
3. The static option is now visible for system dependencies as well.
   (it was previously hidden by `cmake_dependent_option`).
4. The auto-detection mechanism for `libfmt` and `SDL_image` only
   applies if the setting has not been set.
5. SDL2 on Android is now also linked statically,
   resulting in a 1.1 MiB smaller APK.

When using non-system dependencies, the default should always be static,
as there are 2 main use cases for these:

1. Dependencies that we must currently vendor because our forks have
   significant changes that are not yet merged/released upstream.
2. Platforms that have no system packages, such as Android and iOS.

In both cases, static linking is the most appropriate default.
2021-12-07 18:32:25 +01:00
Gleb Mazovetskiy 868289dc17 Add missing <cstring> includes 2021-11-28 15:32:36 +00:00
Gleb Mazovetskiy 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 <anders@jenbo.dk>
2021-11-24 23:44:12 +01:00
Vladimir Olteanu 286eb7144a Get rid of InitHash 2021-08-19 01:44:13 +02:00
Anders Jenbo 8df8b940c4 Handle some clang-tidy issues 2021-08-07 16:30:14 +02:00
jmechnich c1f68198fc Source/encrypt.cpp: add missing header to fix mingw compilation error 2021-07-13 01:29:49 -07:00
Anders Jenbo 35ccc8eb1c Apply clang-tidy to code 2021-07-10 17:30:15 -07:00
Anders Jenbo 74b57558c9 🚚 Move local code to anonymous namespace 2021-07-10 17:30:15 -07:00
Anders Jenbo 8a4d38dd74 Stabalize clang-tidy runs 2021-06-27 03:42:51 +02:00
Anders Jenbo f167bd4dfb Clang-tidy: llvm-include-order 2021-06-27 01:45:49 +02:00
Anders Jenbo ec8d7bebe2 Clang-tidy: modernize-use-auto 2021-06-27 01:18:31 +02:00
Anders Jenbo d3098412ed Clang-tidy: readability-non-const-parameter 2021-06-27 00:59:29 +02:00
Anders Jenbo 22b632f04a ♻️Clean up implicit bool conversions 2021-06-26 08:57:59 -07:00
Kalebe Alves 0461529176 Move byte from engine.h 2021-05-27 16:04:27 +02:00
Anders Jenbo a095bc0bf7 ♻️Migrate more code away from miniwin 2021-05-13 02:30:18 +02:00
Gleb Mazovetskiy f33f7ae7eb 💨 Do not zero-initalize arrays we write to
`std::make_unique<T[]>(size)` always zero-initalizes the array.

C++20 has `std::make_unique_for_overwrite` to avoid that, while
older C++ versions can use the approach applied here.
2021-05-02 05:52:11 +02:00
Vladimir Olteanu 42bb50cf0f Cleanup of encrypt.{h,cpp} 2021-04-30 08:41:37 +02:00
Anders Jenbo bb4e1960e7 🎨 modernize-use-nullptr 2021-04-19 16:02:05 +02:00
Anders Jenbo c89bd9c001 🚨 Fix remaning warnings for clang and gcc 2021-04-19 02:44:39 +02:00
Anders Jenbo 997c1dba55 🚚 Split up all.h in to proper header relations 2021-04-16 01:04:54 +02:00
Anders Jenbo f450d6a125 🚚 Move defines to there proper files 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 630e507f63 🚚 Apply namespace 2021-04-06 15:21:25 +02:00
pionere d5a0fa8e85 get rid of a few warnings 2021-02-19 22:04:11 +01:00
Anders Jenbo 61b2d0de95 Merge branch 'master' of github.com:diasurgical/devilution 2020-12-16 02:24:39 +01:00
Anders Jenbo ede76a3b74 Clean up Decrypt and Encrypt 2020-12-05 20:47:23 +01:00
Anders Jenbo 43b5dea6e5 Merge branch 'master' of github.com:diasurgical/devilution 2020-11-03 00:56:51 +01:00
Anders Jenbo 57b6d13b55 Reorder encrypt.cpp 2020-11-02 15:56:32 +01:00
Anders Jenbo 7108145a04 Merge branch 'master' of github.com:diasurgical/devilution 2020-04-14 15:30:49 +02:00
Anders Jenbo 9e2cefa522 Fix InitHash 2020-04-09 00:13:58 +02:00
Anders Jenbo a94c2d656f Make hashtable in to a 2d array 2020-04-08 20:34:40 +02:00
Anders Jenbo cd18914026 Avoid void pointers 2020-04-08 20:34:38 +02:00
Anders Jenbo 6704657e71 Apply sematic codestyle 2020-04-08 20:34:29 +02:00
Anders Jenbo 776ab10476 Merge branch 'master' of github.com:diasurgical/devilution 2020-03-29 23:40:05 +02:00
Anders Jenbo 3c276a3cd3 Add documentation
- Add file documentation to about 1/4 of the files in Source
- Copy over a lot of the documentation from the sanctuary/notes repo
- Standardise all the existing documentation
- Create a configuration for Doxygen
- Add more documentation (engine.cpp is now fully documented)
2020-03-01 22:18:00 +01:00
Anders Jenbo 25993b4043 Merge branch 'master' of github.com:diasurgical/devilution 2020-02-14 23:03:31 +01:00
Anders Jenbo 20621a0642 add all.h and use in place of diablo.h (#2005)
Now diablo.h is treated in the same way as all other header files of
Source, as it only contains the declarations of global variables and
functions of diablo.cpp.

Besides consistency, this also enables mods to include diablo.h just
like any other header file without having to include every header file
(and without having to include C++ specific aspects of the now all.h).
2020-02-14 13:12:54 +01:00
Samuel-DEVULDER 9c516819c1 Make save game code big-endian compatible 2020-01-27 00:03:02 +01:00
Anders Jenbo 40cea40aa4 Remove windows call types collisions 2019-12-26 05:00:02 +01:00
Xadhoom 6856fb74e2 Merge upstream beanch 'devilution/master' 2019-04-25 20:44:01 +00:00