55 Commits
Author SHA1 Message Date
Gleb Mazovetskiy 124d113b57 Extract spell data to a TSV 2023-12-05 21:33:23 +01:00
KPhoenix b8738ab4cf Validation: Validate Item Drop Packets 2023-11-20 06:37:52 +01:00
Gleb Mazovetskiy f566359e4f Migrate item data to txtdata/ 2023-11-14 00:20:17 +00:00
Gleb Mazovetskiy 2eae121931 Migrate monstdat to a data file
We may want to migrate this to 1 file per monster but for now the
migration is as close to the hard-coded version as possible.

Sprites that are used by multiple monsters are only loaded from disk
once.
2023-11-10 06:01:40 +00:00
ephphatha 6a8f4b12da Get base block bonus from data struct instead of storing a copy 2023-09-20 05:49:54 +02:00
staphen a151219b9b Don't validate creation flags on gold 2023-09-03 17:03:25 +02:00
Gleb Mazovetskiy af869ac732 Merge branch 'master' into dev-merged 2023-09-01 20:49:34 +01:00
staphen 4deae11871 Fix PlayerNetPack validation and tests 2023-08-27 21:34:38 +02:00
Anders Jenboandstaphen bf7135dd11 Adjust tests to work with data driven levels (#6509)
Co-authored-by: staphen <[email protected]>
2023-08-26 02:06:45 +02:00
Stephen C. Wills 7b06703842 Add tests for net player validation (#6492) 2023-08-21 00:18:03 +02:00
Anders Jenbo b38efb6ccf Fix code style 2023-04-30 05:44:43 +02:00
Anders Jenbo 6e7ed13336 Add missing Hellfire healing potions to test data 2023-04-30 05:29:27 +02:00
Anders Jenbo 116bd3f626 Decompose iCreateInfo fixture table 2023-04-30 05:29:25 +02:00
obligaron eeca953615 Introduce UpdateHellfireFlag to set missing CF_HELLFIRE flag 2023-04-13 00:07:00 +02:00
obligaron 0426908988 Introduce GetTranslatedItemName/GetTranslatedItemNameMagical 2023-04-13 00:07:00 +02:00
KPhoenix d813f13700 enum spell_id -> enum class SpellID 2023-02-05 10:24:58 +00:00
Gleb Mazovetskiy cea6a01de7 More item packing fix on big-endian
Refs #5573
2022-12-08 12:08:36 +01:00
Gleb Mazovetskiy 44c3bc4038 pack_test: Make fixtures little-endian on BE
Packed items are supposed to be little-endian even on big-endian
systems. Makes all test fixtures little-endian.

Refs #5573
2022-12-07 10:19:02 +01:00
obligaron b3aa08589b Don't use MyPlayer in UnPackItem and dependend methods 2022-08-26 18:18:40 +02:00
Gleb Mazovetskiy 188dc79f6e Make Players a vector 2022-08-26 13:22:04 +09:00
qndel 354e329644 Players[MyPlayerId] -> MyPlayer 2022-05-31 05:35:52 +02:00
DakkJaniels dad46e1905 Item special effect enum (#4129) 2022-04-19 15:44:46 +02:00
Gleb Mazovetskiy f8a72fddd3 Reduce 12px font space width from 9px to 5px
Fixes #4397
2022-04-14 01:19:06 +02:00
staphen b85485b8f3 Resolve game crash when syncing Diablo items in Hellfire games 2022-01-17 00:31:27 +01:00
KPhoenix fb8f0c3501 Update pack_test.cpp 2022-01-03 09:29:45 +01:00
Gleb Mazovetskiy 076b0c0c05 Overhaul tests
1. Adds a `libdevilution_so` target when tests are enabled.
2. Each test file is now a separate binary target linked against `libdevilutionx_so` (can now run tests in parallel).
3. Tests are now defined in a separate `test/CMakeLists.txt` file.
4. Building the tests is now controlled by the standard `BUILD_TESTING` option (defined by CTest).
5. Tests are now built by default.
6. On CI, test errors are now reported.

Also:

* `.clang-format`: Enable SortIncludes in tests
* `path_test.cpp`: Fix -Wsign-compare
2021-12-16 20:26:51 +00:00
Andrew James 4a940b1b07 Remove uses of Items[] as a temporary for other Item variables (#2924) 2021-11-25 09:34:13 +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 7d91bc461a Improve asset file opening
Avoid wrapping asset files via StormLib, open them directly via SDL
instead.
2021-10-24 16:21:39 +01:00
Anders Jenbo 84e73e9a53 Match correct generated names in tests 2021-10-12 21:05:19 +02:00
Anders Jenbo 116d3301f8 Load font during tests that depends on it 2021-10-12 21:05:19 +02:00
ephphatha 96451ec6ce Update spawn tests 2021-10-07 03:18:17 +02:00
ephphatha a985df1242 Align formatting 2021-10-07 03:18:17 +02:00
ephphatha e261de18f0 Update hellfire unpack tests to recognise full staff name 2021-10-07 03:18:17 +02:00
ephphatha f7e0c31d8d Update item tests to handle staff name prefix changes
#3039 changed the way staff variants were named but the item tests were expecting the old logic which called them all "Staff of".
2021-10-07 03:18:17 +02:00
Juliano Leal Goncalves 379a27b64a ♻️ Convert 'ItemType' enum to enum class
🎨 Rename 'ItemType' elements to enum class standards
2021-09-13 00:25:49 +02:00
Anders Jenbo b74feb01dc 🐛 Correctly check if item name will fit in the info panel 2021-09-12 01:37:28 +02:00
Juliano Leal Goncalves 7841c4731e 🚚 Rename 'PkItemStruct' to 'ItemPack' 2021-08-30 13:40:08 +02:00
Juliano Leal Goncalves bb2dfdfb73 🚚 Rename 'ItemStruct' to 'Item' 2021-08-30 13:40:08 +02:00
Anders Jenbo 96bf75b502 Rename player globals 2021-07-08 02:01:14 -07:00
Anders Jenbo c3eed43012 Add "useful" items to test 2021-06-19 08:47:23 -07:00
Anders Jenbo 27591cc29f Fix spawn save game compatability 2021-06-06 04:51:43 +02:00
Anders Jenbo 17c130b2ea Add 5 items to the tests 2021-06-06 00:03:37 +02:00
Anders Jenbo 58d1e362e4 ✅ Add 38 items to the item tests 2021-06-03 23:22:30 +02:00
Anders Jenbo 2200a78c11 ✅ Add 4 unique items to test suite 2021-05-29 18:41:44 +02:00
Anders Jenbo 6c8b116f6c 🐛 Evaluate item names the same as the original 2021-05-13 22:09:27 +02:00
Anders Jenbo e665a0c4b0 ♻️Draw info box text using DrawString 2021-05-10 22:28:21 +02:00
Anders Jenbo c11945e62b 🎨 Fix line endings 2021-05-07 23:22:51 +02:00
Jmgr c33182d6de Modernize deprecated headers 2021-04-25 02:50:31 +02:00
Anders Jenbo a5f062b747 🎨 Use stdint instead of SDL types 2021-04-24 05:17:59 +02:00