28 Commits
Author SHA1 Message Date
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