38 Commits
Author SHA1 Message Date
Anders Jenbo 48aa2a5ba2 Block MP when overwrites are present 2026-07-08 13:45:41 -04:00
Stephen C. Wills e2a9dbd6ee Open Track integrity of assets that modify game engine logic 2026-06-22 00:02:05 +02:00
Gleb Mazovetskiy 88f706e0d1 SDL3: Add some backports / compat helpers 2025-10-10 00:49:44 +01:00
Gleb Mazovetskiy 1bbe8bfe08 SDL3: Even more migration 2025-10-09 01:28:37 +01:00
Gleb Mazovetskiy 58fe44f836 init.h -> init.hpp 2025-05-18 22:37:09 +01:00
Gleb Mazovetskiy b890edfd56 Support mods with UNPACKED_MPQS 2025-05-18 22:37:09 +01:00
Anders Jenbo 96112e675b Handle loaded MPQ files in a map instead of bespoke globals (#7887) 2025-04-07 17:17:05 +02:00
Gleb Mazovetskiy d94bc424df sgOptions -> GetOptions()
In C++, globals initialization order accross translation units is not
defined. Accessing a global via a function ensures that it is initialized.

This will be needed for #7638, which will statically initialize change
handlers after the Options object has been initialized.
2025-01-13 11:57:25 +00:00
Gleb Mazovetskiy b76feb2be3 Extract game mode out of init.cpp
Untangles some dependencies
2025-01-09 11:02:19 +00: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 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
Gleb Mazovetskiy 41f43ea3f5 Support unpacked MPQs from devilutionx-mpq-tools
https://github.com/diasurgical/devilutionx-mpq-tools produces an unpacked MPQ
with all the graphics converted to CLX and the unused files removed.
This is primarily useful on RAM-constrained platforms, such as PS2,
because it eliminates the MPQ overhead.

Adds a build option to load from such unpacked directories instead of the MPQ.

These directories are searched for in the same locations
where the MPQs would be searched for otherwise.

Example directory layout:

* /usr/local/share/diasurgical/devilutionx/diabdat/ -- unpacked and converted diabdat.mpq
* /usr/local/share/diasurgical/devilutionx/hellfire/ -- unpacked and converted hellfire MPQs (all of them merged into 1 directory)
* /usr/local/share/diasurgical/devilutionx/fonts/ -- unpacked fonts.mpq
* /usr/local/share/diasurgical/devilutionx/pl/ -- unpacked pl.mpq

These directory structure is produced by calling `unpack_and_minify_mpq`
2022-10-11 18:00:57 +01:00
staphen 8292256e4d Only load Hellfire music when Hellfire is active 2022-08-22 15:54:33 +02:00
Gleb Mazovetskiy f9f6949af2 Clean up effects_play_sound, gfnSoundFunction 2022-07-16 10:59:40 +01:00
Gleb Mazovetskiy 779ccaca17 Overhaul translation fetching
1. Do not modify the map after loading. Instead, return string views
   (guaranteed to be null-terminated) from look up functions and return
   the key directly if not found.
2. Use an `unorded_map` instead of `map` where available (C++20).
   Saves a bit of RAM (~50 KiB) and improves lookup performance.
2022-06-14 12:46:36 +01:00
Anders Jenbo 9d082389d8 Clean up music track selection 2022-05-10 15:16:38 +02:00
Anders Jenbo 0645d9b2a1 Correct missing hellfire level mapping in leveltype
Hellfire never added the 2 new dungion types, instead it makes
additional checks on currlevel. This is confusing and mess, so cleaned
it up.
2022-05-10 15:16:38 +02:00
staphen 5093d324ee Fix order of operations when reading from Single Player save 2022-04-24 16:18:36 +02:00
Anders Jenbo 1409e604f5 Reduce string conversions 2022-03-20 11:04:15 +01:00
obligaron e48b949dad Stop music on diablo exit 2022-03-01 22:22:05 +01:00
obligaron d765fad1cc Continue playing music in menus 2022-02-27 17:38:36 +01:00
obligaron 79b926c375 Move more options to OptionEntryBase 2022-02-05 20:51:54 +01:00
obligaron f02264f69c Implement settings menu 2021-11-24 09:31:39 +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
Anders Jenbo e880f25c85 Fix viewing into in Hellfire Shareware mode 2021-10-28 23:02:10 +02:00
Anders Jenbo 87f98695b5 Do not try to render menu when not properly initialized
Fixes #3206
2021-10-22 01:02:40 +02:00
qndel 60aa86b974 make credits go back to proper menu 2021-10-21 21:57:35 +02:00
qndel b9fbd4b188 prevent cutting off button sound 2021-10-21 21:39:18 +02:00
obligaron 49c351d3e9 Allow playing intro in spawn if diabdat_mpq is present 2021-10-21 20:34:19 +02:00
obligaron d401376ea4 Fix hardware cursor gets white when switching game 2021-10-21 10:26:37 +02:00
obligaron f51768a567 Add the possibility to switch to shareware 2021-10-21 04:16:13 +02:00
obligaron 1d0f4cb13d Add new Extras menu with the possibility to switch game 2021-10-21 04:16:13 +02:00
obligaron 3a40448485 Store last selected hero in options 2021-10-08 21:47:39 +02:00
Anders Jenbo 4044fadeb5 Clean up some players references 2021-08-30 03:26:17 +02:00
obligaron 77f9bded9e Introduce demo namespace 2021-08-19 00:03:58 +02:00
Anders Jenbo d523fc1e81 Cleanups 2021-08-02 10:12:40 +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
Jonathan Bergeron 33ad9fa187 renamed Source/mainmenu.cpp and .h to menu.cpp/.h 2021-07-18 01:31:15 +02:00