126 Commits
Author SHA1 Message Date
obligaron 22ec684671 Fix some MSVC warnings 2023-12-02 12:57:34 +01:00
obligaron 7cd7a3445f Remove global SetPiece Handling 2023-11-28 17:24:18 +01:00
obligaron 42e1b82a91 Use GetDunSize in loops 2023-11-28 17:24:18 +01:00
obligaron dc85e7db43 Introduce GetDunSize 2023-11-28 17:24:18 +01:00
Gleb Mazovetskiy 0d19c1b773 Slightly optimize loading same-sprite monsters
For monsters with the same sprite, load the sprite from the file system only once.

Example:

```
VERBOSE: Loaded monster graphics: falspear\phall   452 KiB   x1
VERBOSE: Loaded monster graphics: skelbow\sklbw    618 KiB   x1
VERBOSE: Loaded monster graphics: skelsd\sklsr     610 KiB   x1
VERBOSE: Loaded monster graphics: goatbow\goatb    832 KiB   x1
VERBOSE: Loaded monster graphics: bat\bat          282 KiB   x2 <-- here we only load the sprite once
VERBOSE: Loaded monster graphics: rhino\rhino     1306 KiB   x1
VERBOSE: Loaded monster graphics: golem\golem      298 KiB   x1
VERBOSE:  Total monster graphics:                 4401 KiB 4684 KiB
```

Here, the bat sprite will be loaded from the MPQ only once.
For the second sprite, we simply clone the first sprite before applying TRNs.

This also reduces the size of `MonsterData` from 88 bytes to 80.

When we migrate monster data to a TSV, the sprite IDs can be generated automatically at load time.
2023-11-10 06:01:40 +00:00
obligaron 631111f405 Fix MSVC warnings in themes.cpp 2023-11-05 23:14:45 +01:00
obligaron 9bf1fd48b0 Fix a few MSVC warnings (#6782) 2023-11-05 18:23:53 +01:00
Gleb Mazovetskiy d1d27c8368 Rename error -> diablo_msg 2023-10-14 09:45:24 +01:00
Gleb Mazovetskiy fa155d4ffd Dungeon tiles: Port over some cleanups from #6636 2023-09-23 18:02:43 +01:00
ephphatha c1f3dcb705 Use safer versions of random number functions instead of GenerateRnd 2023-09-19 16:52:40 +02:00
Gleb Mazovetskiy e5c426c315 Make IsWall easier for the compiler to inline
This appears to be a very hot function.
Makes it fully inlineable (even in Debug mode).
2023-09-18 21:26:13 +01:00
Gleb Mazovetskiy cf925d1edc Replace tuples with structs
Structs are more readable because the fields have names.
2023-09-13 13:47:47 +01:00
Gleb Mazovetskiy 0f77cc3797 Force-inline methods to improve debug build perf
This has little or no effect on the optimized build
but significantly improves performance of the headless debug build

`timedemo_test` on my machine goes from 3s to 2s.
2023-09-10 02:14:01 +01:00
ephphatha da76e131e4 Add getter/setter for character levels to ensure _pNextExper stays synced 2023-08-24 05:46:44 +02:00
Gleb Mazovetskiy c19bfe87fa Remove utils/stdcompat/algorithm.hpp 2023-08-14 01:54:29 +01:00
Gleb Mazovetskiy 14540164a7 Remove utils/stdcompat/optional.hpp 2023-08-14 01:54:29 +01:00
Gleb Mazovetskiy 62d067b653 Remove utils/stdcompat/abs.hpp 2023-08-14 01:54:29 +01:00
Gleb Mazovetskiy 74755c8be7 Remove utils/stdcompat/cstddef.hpp 2023-08-14 01:54:29 +01:00
qndel 728b632960 fix typos 2023-08-12 18:10:22 +02:00
Gleb Mazovetskiy 8101e2c0ba Add c_any_of and friends
Adds handy helpers for performing algorithms on the entire container.
They're prefixed with `c_` for container.

This naming convention is identical to some popular C++ libraries, such
as Abseil.
2023-08-12 16:24:01 +01:00
ikonomov ee91d9ecf5 update arenas
Removed the murky pools, simplified the areas and made them accessible without teleport.
2023-07-15 02:23:01 +02:00
obligaron 8832c26955 Fix PoolFix() to always replace dirt ceiling tiles if they are adjacent to a ground lava tile (#6266) 2023-06-25 21:25:36 +02:00
Anders Jenbo 8f74f86a6e 🐛 Use the alternate stairs up banner is active 2023-06-15 04:55:32 +02:00
obligaron c0b2d5569f When checking chamber of bone entry also check the current dungeon level 2023-06-09 17:43:06 +02:00
Gleb Mazovetskiy 5bf0b8bc96 Add more missing <cstdint> includes
https://github.com/diasurgical/devilutionX/pull/6095 only added includes
for `uint32_t`, this PR also adds the includes for the remaining
integral types.
2023-05-10 16:29:27 +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
ephphatha 3bbb80d849 Introduce temporary function to advance the global rng state and discard results 2023-05-07 16:35:03 +02:00
Anders Jenbo 261776b255 Correct OOB check in PrepareInnerBorders() 2023-04-29 19:23:50 +02:00
DakkJaniels 000516ebf9 Update gendung.h (#6038) 2023-04-24 18:15:40 +02:00
Anders Jenbo 2f908277a8 Apply pre calculated lighting for quest levels 2023-04-24 17:20:17 +02:00
Anders Jenbo 4db65d94de Add glow to Crypt lava tiles 2023-04-24 14:20:06 +02:00
Anders Jenbo 828a52dc6d Clean up ProcessLightsList() 2023-04-22 17:14:19 +02:00
Anders Jenbo e969a8ad01 Invert player to vision relation 2023-04-21 21:25:19 +02:00
Anders Jenbo 382212b98c Remove DisableLighting from release builds 2023-04-21 21:25:19 +02:00
Anders Jenbo 779f16280c Consistently use uint8_t for lighting values 2023-04-18 23:53:04 +02:00
obligaron 1a150ed193 Multiplayer: Ensure monster hitpoints are calculated reproducable in quest/set-maps (#5958)
* Always use the same seed for generating set/quest maps

* Use setlvltype for loading quest/set-map (instead of leveltype)

* Ensure dungeon flags are reset when loading a quest/set-map
2023-04-09 02:32:52 +02:00
obligaron 4cdd7ff2d9 Replace ReturnLevel/LevelTyp/LvlPosition 2023-03-12 19:30:57 +01:00
obligaron f4b2fee532 Transform Lazarus portal position to world space earlier 2023-03-12 19:30:57 +01:00
obligaron 44de539afb Introduce CronerStoneStruct::isAvailable() 2023-03-02 01:23:59 +01:00
obligaronandqndel 3a31539c7e Multiplayer: Enable Warlord of Blood Quest
Update Source/quests.h

Co-authored-by: qndel <[email protected]>
2023-02-20 21:30:50 +01:00
Gleb Mazovetskiy 09d7f99c32 Optimize IsTileSafe
Add dungeon flags for Fire/Lightning Wall and use them to check if the
monster considers the tile safe.
2022-12-09 05:00:14 +01:00
Gleb Mazovetskiy 38e37e0d53 Fix warnings/errors with -funsigned-char 2022-12-05 07:52:13 +01:00
Gleb Mazovetskiy 79b330825d dun_render: Avoid Invalid tile type
1. Do not call `RenderTile` with invalid values to begin with.
2. Move mask selection out of `RenderTile`.
2022-12-05 01:32:29 +01:00
obligaron f8705c51a2 Make skeleton king's lair multiplayer compatible 2022-11-14 06:58:56 +01:00
obligaron d0978672e9 Make Poisoned Water Supply quest multiplayer compatible 2022-11-11 03:27:37 +01:00
obligaron 5a45ee4eba Update diablo pentagram when quest state changes 2022-11-11 03:27:37 +01:00
obligaron 9a1bf42519 Always set lazarus portal position 2022-11-11 03:27:37 +01:00
obligaron 5fe20e3d32 Make Lazarus quest map multiplayer compatible 2022-11-11 03:27:37 +01:00
staphen 21bd760bfa Bypass CMD_PUTITEM when triggering CMD_OPENHIVE or CMD_OPENGRAVE 2022-10-25 07:14:03 +02:00
Gleb Mazovetskiy 0f6a4be8ab trigs.cpp: Fix build error 2022-10-16 12:43:58 +01:00