18 Commits
Author SHA1 Message Date
Anders Jenbo 005e7dcc23 chore: clang-tidy cleanup part 1 2026-04-03 22:57:48 +02:00
Anders Jenbo 1c76897f2c Apply simple const rules using clang-tidy 2025-08-16 01:21:36 +02:00
staphen ba773259cd Fix gcc/MSVC compiler warnings 2025-01-29 17:12:38 +00:00
staphen a21a04d451 Fix off-by-one in path finding logic 2025-01-28 04:58:52 +01:00
Gleb Mazovetskiy 3e6b501d82 Fix pathfinding and increase player path limit
The previous implementation didn't behave quite like A-* is supposed to.

After trying to figure out what's causing it and giving up,
I've reimplemented it in a straightforward manner.
Now it seems to work a lot better.

Also increases maximum player path length to 100 steps.
We still only store the first 25 steps in the save file for vanilla
compatibility.
2025-01-26 17:38:05 +01:00
Gleb Mazovetskiy ee16071761 Untangle pathfinding dependencies
1. Makes `path.cpp` concerned solely with the pathfinding algorithm.
2. Turns `path_test` into a standalone test.
2025-01-25 08:14:34 +00:00
Gleb Mazovetskiy d7647d6c63 More dependency untangling
1. Moves more assets-related stuff from `init` to `engine/assets`.
2. Removes `SDL_audiolib` dependency from `soundsample.h`.
3. Cleans up some unused/missing includes.
2025-01-09 18:19:44 +00:00
Gleb Mazovetskiy e692acb049 Pathfinding: Rename functions
Rename functions to better reflect what they do.
2024-11-10 08:57:33 +00:00
Gleb Mazovetskiy 624afafe58 Extract Crawl to a library
Also adds a test and a benchmark
2024-08-07 02:01:23 +01:00
Eric Robinson 0ac30d101d Refactor TileHasAny() (#7085) 2024-04-19 08:04:26 +02:00
qndel b5ab3a10a2 correct IsTileWalkable to mark tiles out of bounds as not walkable 2023-08-12 18:10:22 +02: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 6dca019de2 Use function_ref instead of function
`function_ref` is a lightweight function pointer,
whereas `std::function` always involves a heap allocation.
2022-11-02 11:46:15 +00:00
Anders Jenbo 7c9111ddb0 Correct casing for isDoor() 2022-08-04 01:37:03 +02:00
ephphatha 0ce76a3f13 Add Object lookup method to mimic map::at() 2022-07-28 12:47:13 +02:00
Gleb Mazovetskiy c8ddf7df65 Crawl: Move implementation from header to cpp 2022-07-09 11:29:31 +02:00
Vladimir Olteanu f463f08642 Refactor FindClosestValidPosition to use Crawl 2022-07-07 18:55:34 +02:00
Anders Jenbo 72656b3011 Move path and palette to the engine folder 2022-06-24 16:34:20 +02:00