Terrain brush fixups#129
Conversation
BogdanW3
commented
Feb 17, 2026
- Use DP to optimize the apply call's updated area
- Fix the 3x3 kernel for cliff_near
- Unflip the brush's display
|
Rewriting it to use a stack based approach is really good. I would maybe make some suggestions on the design. Instead of taking a std::vector<uint8_t> visited(static_cast<size_t>(corner_width * corner_height), 0);Is a bit pessimitic in allocating for the full map while most operations will likely never even trigger any cliff changes. A hashmap (hive::unordered_map is quite optimized too) will likely be better in most cases with only the worst case (whole map change) being a bit worse.
Nice catch on the bugs :) |
|
Thanks for the reply! Indeed it sounds like I can just use the area as an input as well, especially with the suggested change to a hashmap, but sadly my attempts to do that haven't been successful thus far. |