79 Commits

Author SHA1 Message Date
Gleb Mazovetskiy a99cc9b40a SDL3: Some more migration 2025-10-09 01:28:37 +01:00
Gleb Mazovetskiy dd76f17e4b Rename endian.hpp to endian_read.hpp
Following #7620, which split the write functions into a separate header.
2025-01-08 17:38:36 +09:00
Gleb Mazovetskiy 74755c8be7 Remove utils/stdcompat/cstddef.hpp 2023-08-14 01:54:29 +01:00
Anders Jenbo eb7673e0ee Fix building on VS2017 (#4795) 2022-06-25 18:32:30 +02:00
Gleb Mazovetskiy c43aead8d1 Cleanup Diablo-SHA and codec.cpp
1. Switches to 32-bit based calculation throughout. This is faster and
   less error-prone as we only byte-swap once when reading and writing.
2. Removes global state from Diablo-SHA implementation.
2022-01-07 01:34:26 +00:00
Gleb Mazovetskiy 9c084dcb29 codec.cpp: Fix alignment and endianness issues 2022-01-06 23:17:29 +00:00
Gleb Mazovetskiy 868289dc17 Add missing <cstring> includes 2021-11-28 15:32:36 +00:00
Anders Jenbo 36645019c2 🚨 Fix compiler warning 2021-08-13 00:09:02 +02:00
Andrew James 0aea0782c7 Refactor Diablo-SHA to attempt to document behaviour through code (#2524)
* Hardcode the key and ensure buffers are appropriately sized.

If you do want to build the key at runtime the following initial state gets the right sequence:
```cpp
std::linear_congruential_engine<uint32_t, 214013, 2531011, 0> engine(3193970784);
for (auto &notch: key)
	notch = static_cast<byte>(engine() >> 16);
```

* Move public defines into sha.h, move private struct into .cpp

* Remove unused count member, clarify loop in SHA1Input

* Update circular shift to indicate desired behaviour, remove unnecessary negation.

The parameters are also reordered to match C++20 rotl/rotr and the usual order for shift operators.
2021-08-08 13:22:22 +02:00
Anders Jenbo 8df8b940c4 Handle some clang-tidy issues 2021-08-07 16:30:14 +02:00
Anders Jenbo a19e7b2a3b Remove some more use of miniwin 2021-07-17 23:54:13 +02:00
Anders Jenbo ef6275caac Clean up private function names 2021-07-12 17:59:22 -07:00
Anders Jenbo bc51e1616d 🎨 Apply clang-tidy 2021-07-08 08:14:03 -07:00
Anders Jenbo 20262e4569 🚚 Move local symbols in to anon namespace 2021-07-08 08:14:03 -07:00
Anders Jenbo 903d4bd2e1 Scope all for loops
This caused 7 of the loops to be rewriteen using range by clang-tidy
2021-07-08 08:14:03 -07:00
Anders Jenbo 4eabc6024b Apply various cleanups via Android Studio 2021-07-03 18:27:17 -07:00
Anders Jenbo 372b1dcba2 Clang-tidy: readability-identifier-naming.MemberCase: camelBack 2021-07-03 17:26:29 -07:00
Anders Jenbo b23f7bfb1d 🐛 Fix password expansion 2021-06-27 17:41:49 +02:00
Anders Jenbo e7f0ce2764 Apply cleanups to codec, control, and some of cursor 2021-06-27 07:47:15 -07:00
Anders Jenbo f99ef2c195 A couple of clean ups suggested by Android Studio/Clang Tidy 2021-06-18 16:17:46 +02: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
Anders Jenbo f884ba5340 🔥 Remove more miniwin dependencies 2021-04-29 23:04:56 +02:00
Anders Jenbo 373f28736f 🎨 Acceptable parts of modernize-* 2021-04-19 22:42:19 +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 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 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 f5c1079d6f eliminate unused code 2021-02-19 22:04:11 +01:00
Anders Jenbo 4794c8357c Merge branch 'master' of github.com:diasurgical/devilution 2020-11-02 03:59:47 +01:00
Anders Jenbo f0c80d87f1 Reorder codec.cpp 2020-11-02 01:12:28 +01:00
Anders Jenbo 2f8a52efaf Fix Visual Studio builds ... 2020-10-20 19:53:56 +02:00
Anders Jenbo 28c1832544 Fix Visual Studio builds 2020-10-20 19:47:39 +02:00
Anders Jenbo a3505ab904 Remove the std namespace from uint32_t
Again to help older compileres that aren't C++11 aware.
2020-05-14 11:44:15 +02:00
Anders Jenbo 69ad34f58f Consistently use NULL instead of nullptr
While nullptr does have extra checking, most of the code uses NULL and
nullptr makes it harder to port the code to some targets like the
original XBox
2020-05-14 11:44:15 +02:00
Anders Jenbo 7108145a04 Merge branch 'master' of github.com:diasurgical/devilution 2020-04-14 15:30:49 +02:00
Anders Jenbo 6704657e71 Apply sematic codestyle 2020-04-08 20:34:29 +02:00
Anders Jenbo 7db4ed749a Apply more enums, defines and types 2020-04-08 20:18:11 +02:00
Anders Jenbo 776ab10476 Merge branch 'master' of github.com:diasurgical/devilution 2020-03-29 23:40:05 +02:00
Gleb Mazovetskiy 8e8e7307aa codec.cpp codec_init_key: Minor clean-up 2020-03-11 23:11:23 +01:00
Robin Eklind 3130ae3593 codec: fix build error of codec.cpp when compiling as C
Prior to this commit, the following error was encountered when compiling
as C using Clang:

	Source/codec.cpp:20:2: error: must use 'struct' tag to refer to type 'CodecSignature'
			  CodecSignature *sig;
			  ^
			  struct
2020-03-08 15:59:29 +01: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
Anders Jenbo 3ab9b7f2d3 Inline rand 2020-02-01 15:23:03 +01:00
Anders Jenbo fae2be813a Merge branch 'master' of github.com:diasurgical/devilution 2019-09-28 04:31:04 +02:00
qndel c629eb1e60 codec_decode cleanup (#1661) 2019-09-18 00:51:49 +02:00
Anders Jenbo f187fe7d3a Merge branch 'master' of github.com:diasurgical/devilution 2019-06-22 18:14:48 +02:00