Commit graph

51 commits

Author SHA1 Message Date
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
Siddharth singh chouhan
ba161f623e
Move documentation from implementations to declarations. (#2858) 2021-09-13 15:45:38 +02:00
Anders Jenbo
eda4a5061e Implement demo recording and playback
This records all keyboard and mouse events to a file and lets you play
it back at a later point with a differen game speed.
2021-07-31 20:12:31 +02:00
Anders Jenbo
a19e7b2a3b Remove some more use of miniwin 2021-07-17 23:54:13 +02:00
Anders Jenbo
9ebdb6db69 General clean up 2021-07-08 03:30:25 -07:00
Anders Jenbo
bc0d1f7ac0 clang-tidy/Android Stuidio cleanups 3 2021-07-04 16:09:32 -07:00
Anders Jenbo
5fdb9ce459 🎨 Format code 2021-04-19 00:37:33 +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
obligaron
9fbe139f64 cache ProgressToNextGameTick and update it only once before rendering 2021-04-12 20:44:29 +02:00
obligaron
c7b9ffec1f Decouple Animations from Gamelogi (Smooth Animations for skipped Frames).
NewPlrAnim: Use default arguments instead of overloads

StartPlrHit: Fix skippedAnimationFrames - Frames starts with 1

Add missing comment for StartPlrHit

Fix GotHit-Animation: Skipping Frames corrected and adjusted _pAnimGameTicksSinceSequenceStarted for animations that don't start with a additional tick.
Thanks @StephenCWills for the gothit skipping frame calculation logic :-)

Update StartWalk: calculated numSkippedFrames in own line.

Co-authored-by: Anders Jenbo <anders@jenbo.dk>
StartPlrHit: always initialize skippedAnimationFrames

Co-authored-by: Anders Jenbo <anders@jenbo.dk>
Update nthread_GetProgressToNextGameTick comment

Co-authored-by: Anders Jenbo <anders@jenbo.dk>
fix spelling "lenght" instead of "length"

Update NewPlrAnim comment

Co-authored-by: Anders Jenbo <anders@jenbo.dk>
GetFrameToUseForPlayerRendering: avoid one "else"
2021-04-12 20:44:29 +02:00
Anders Jenbo
e7ae8ddd04 🚚 Move all enums to there respective headers 2021-04-10 16:30:00 +02:00
Anders Jenbo
93d42b62b8 ♻️ Change BOOL to bool 2021-04-09 15:13:02 +02:00
Anders Jenbo
433edc63ea ♻️ Consistently use pragma once to guard the headers 2021-04-06 15:21:25 +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
4ae75753c8 Merge branch 'master' of github.com:diasurgical/devilution 2020-11-09 01:24:02 +01:00
Anders Jenbo
b31da5aec3 Reorder nthread.h 2020-11-04 18:32:24 +01:00
Joel Falcou
c4223d4c29 Per file basis use of extern C 2020-04-22 13:15:29 +02:00
Joel Falcou
64d26a7934 Sanitize use of namespace
Wrap individual headers in dvl namespace to prevent
including standard header in another namespace.
2020-04-22 13:15:29 +02:00
Anders Jenbo
776ab10476 Merge branch 'master' of github.com:diasurgical/devilution 2020-03-29 23:40:05 +02:00
Robin Eklind
038666db18 nthread: add parameter name to nthread_handler
Fixes the following error when compiling as C with Clang:

	Source/dthread.cpp:92:46: error: parameter name omitted
	unsigned int __stdcall dthread_handler(void *)
																^

Related to #2017.
2020-03-09 00:32:23 +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
c26fa8fa3f Remove threading from miniwin 2020-02-11 01:24:43 +01:00
Anders Jenbo
40cea40aa4 Remove windows call types collisions 2019-12-26 05:00:02 +01:00
Nam Nguyen
f707e696db glpMsgTbl stores 64-bit pointers to turn_t variables. This won't fit inside int. 2019-09-14 22:08:07 +02:00
Anders Jenbo
e2bff090d6 Come up with names for all remaning arguments 2019-07-21 00:57:53 +02:00
Anders Jenbo
1d7a548cd7 Clean up nthread.cpp 2019-05-21 00:32:10 +01:00
qndel
addde67e56 nthread_start bin exact 2019-05-11 20:39:54 +01:00
qndel
bca7111fc4 nthread_send_and_recv_turn bin exact 2019-05-11 13:32:33 +01:00
qndel
68463704d9 nthread_recv_turns bin exact 2019-05-11 11:37:31 +01:00
galaxyhaxz
cef65ea0b6 Implement Critical section constructor 2019-04-15 01:16:43 +02:00
galaxyhaxz
4e01e03711 Cleanup default calling conventions 2019-04-09 12:04:00 +02:00
Anders Jenbo
9d44169ac7 multi_upgrade (#583)
* Clean up multi_upgrade

* Correct variable names

* Correct variable types
2019-01-26 17:30:09 +01:00
Anders Jenbo
b048de798a SetMissAnim & SetMissDir (#584)
* Clean up SetMissAnim & SetMissDir

* Use enums for _miAnimType

* Use const for gdwMsgLenTbl & glpMsgTbl
2019-01-26 17:28:48 +01:00
Anders Jenbo
cfbe27f3b8 Clean up (#568)
* Clean up mana checks

* Don't expose static globals
2019-01-15 10:15:48 +01:00
Anders Jenbo
9b7da61dcf Auto format src 2019-01-13 18:55:59 +01:00
Anders Jenbo
e795b6116a Make use of atexit() C compatible (#537) 2019-01-01 03:05:29 +01:00
Anders Jenbo
b5f69dccdc C compatability from d-p (#519) 2018-12-29 17:54:22 +01:00
galaxyhaxz
040b4b0cc9 Cleanup game_loop 2018-12-19 22:40:53 +01:00
Anders Jenbo
69d68254d5
Clean up msg.cpp (#502)
* Clean up msg_wait_for_turns
* Clean up msg_get_next_packet
* Clean up msg_pre_packet
* Clean up DeltaSaveLevel
* Simple clean ups for msg.cpp
* Clean up NetSendCmdQuest
* Clean up NetSendCmdGItem
* Clean up NetSendCmdGItem2
* Clean up NetSendCmdPItem
* Clean up NetSendCmdChItem
* Clean up NetSendCmdDItem
* Clean up multi_send_packet
* Clean up msg_errorf
* Clean up i_own_level
* Clean up msg_free_packets
2018-12-16 16:15:13 +01:00
Anders Jenbo
ab3a6208d2 Use "BOOLEAN" instead of "bool"
bool is not defined in C
2018-11-26 12:35:03 +01:00
galaxyhaxz
b3fdda7c18
GM_Game+others (#458) 2018-11-11 11:22:19 -06:00
Anders Jenbo
8317d80d94 Clean up threading 2018-10-23 00:54:09 +02:00
Andrew Dunstan
1430acc47f msg.cpp cleanup part #0 2018-10-18 02:37:33 +02:00
nomdenom
fc136511d1 Add variable names to nthread
Also inline some parameters that were just copied to local variables.
2018-09-23 12:11:19 -07:00
galaxyhaxz
38b498ac4b
Add 'const' to data to match original binary (#200) 2018-09-09 15:40:23 -05:00
galaxyhaxz
49a6f4f9fc
Add include guards, prepare for XRef (#28)
Add definitions, other junk.
2018-06-20 05:17:44 -05:00
galaxyhaxz
bb01c6f084
Remove the "fear factor" (#21)
Snakes, spiders, Demons, what scares you?
2018-06-18 19:16:32 -05:00