142 Commits
Author SHA1 Message Date
Gleb Mazovetskiy 1bbe8bfe08 SDL3: Even more migration 2025-10-09 01:28:37 +01:00
Anders Jenbo 1c76897f2c Apply simple const rules using clang-tidy 2025-08-16 01:21:36 +02:00
Gleb Mazovetskiy d3248e969a Untangle more dependencies
This allows us to make `clx_render_benchmark` and
`text_render_integration_test` standalone.
2025-07-20 14:11:36 +01:00
qndel 24f108f193 fix many typos (#7322) 2024-08-09 21:13:42 +02:00
Gleb Mazovetskiy e350d9be06 Remove SNetGet/SetLastError
The only named code that was ever set is `STORM_ERROR_NO_MESSAGES_WAITING`.
There was also a call in `menu.cpp` which as far as I can tell is not
needed (if it is, it should be replaced by something else).
2023-11-14 02:53:49 +00:00
Gleb Mazovetskiy c19bfe87fa Remove utils/stdcompat/algorithm.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
obligaron fbdc2d7900 Skip rendering on low-end devices 2023-02-17 22:55:24 +01:00
qndel efaf334965 typos and code cleanup 2022-12-19 17:34:15 +01:00
Gleb Mazovetskiy 38e37e0d53 Fix warnings/errors with -funsigned-char 2022-12-05 07:52:13 +01:00
obligaron eca1a68bec AnimationInfo: Use fixed point math for fractions 2022-11-06 12:31:40 +00:00
obligaron 5eaee56030 Avoid dramatically speed up in solo multiplayer 2022-10-23 11:00:32 +02:00
Anders Jenbo 3ae834148a Split event handeling from general miniwin features 2022-07-10 21:13:39 +02:00
Anders Jenbo 2d21fc372e Remove more miniwin code 2022-07-10 21:13:39 +02: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 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
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
Siddharth singh chouhan ba161f623e Move documentation from implementations to declarations. (#2858) 2021-09-13 15:45:38 +02:00
obligaron 77f9bded9e Introduce demo namespace 2021-08-19 00:03:58 +02:00
Vladimir Olteanu 3638a20c76 Make SdlThread constructor explicit 2021-08-13 04:13:03 +02:00
obligaron fb562b29e9 Timedemo: Regard ProcessInput and gfProgressToNextGameTick 2021-07-31 20:12:31 +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
Vladimir Olteanu e6412ff8ab Use SdlThread in nthread 2021-07-22 01:20:23 +02:00
Vladimir Olteanu fae1e4eee5 Replace CCritSect with SdlMutex 2021-07-21 08:10:46 +02:00
Anders Jenbo 069249f318 🚚 Move local function to anonymous namespace i-p 2021-07-19 05:44:20 +02:00
Anders Jenbo a19e7b2a3b Remove some more use of miniwin 2021-07-17 23:54:13 +02:00
Anders Jenbo bc0d1f7ac0 clang-tidy/Android Stuidio cleanups 3 2021-07-04 16:09:32 -07:00
Anders Jenbo a7c7fa0030 Fully apply clang-tidy/format to all files 2021-07-03 16:41:43 -07:00
Anders Jenbo ecea12fc15 Clang-tidy: ParameterCase 2021-07-03 15:46:39 -07:00
Anders Jenbo a350fb0b15 Clang-tidy: FunctionCase part 1 2021-07-03 03:45:33 +02:00
Anders Jenbo 0f2ad469ea ♻️Clean up variable initialization 2021-06-27 14:58:51 -07:00
Anders Jenbo 8e07ef8fe5 Clang-tidy: misc-unused-parameters 2021-06-27 17:34:32 +02:00
Anders Jenbo fa54499aeb Clang-tidy: readability-uppercase-literal-suffix
Strip suffixes
2021-06-27 03:17:36 +02:00
Anders Jenbo 2bdb6caa07 Cleanup majority of remaning implicit bool conversions (#2234) 2021-06-26 21:05:45 +02:00
Anders Jenbo d8fa29c972 Clean up more implicit bool conversion 2021-06-26 10:07:02 -07:00
Anders Jenbo 22b632f04a ♻️Clean up implicit bool conversions 2021-06-26 08:57:59 -07:00
staphen 1ca50e65eb Fix and reenable SNetReceiveTurns on 3DS 2021-06-20 16:31:25 -07:00
obligaron 050ee5d7bb ADL: Bugfix hero flicker when Diablo is killed 2021-05-09 15:17:31 +02:00
Anders Jenbo f884ba5340 🔥 Remove more miniwin dependencies 2021-04-29 23:04:56 +02:00
Anders Jenbo 3b04f67194 🔥 Remove a chunk of miniwin types 2021-04-29 23:04:56 +02:00
Anders Jenbo 1e3ed903be 🎨 strip redundant else 2021-04-22 00:39:48 +02:00
Jmgr 1d84156509 Simplify bitshift divisions/multiplications 2021-04-21 05:31:17 +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 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
obligaron 9fbe139f64 cache ProgressToNextGameTick and update it only once before rendering 2021-04-12 20:44:29 +02:00
obligaronandAnders Jenbo 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 <[email protected]>
StartPlrHit: always initialize skippedAnimationFrames

Co-authored-by: Anders Jenbo <[email protected]>
Update nthread_GetProgressToNextGameTick comment

Co-authored-by: Anders Jenbo <[email protected]>
fix spelling "lenght" instead of "length"

Update NewPlrAnim comment

Co-authored-by: Anders Jenbo <[email protected]>
GetFrameToUseForPlayerRendering: avoid one "else"
2021-04-12 20:44:29 +02:00