Conversation
djempuiw
commented
May 19, 2024
- Fixed loading of ART files with animation
- Fixed pathfinding for square geometry
- Fixed Map rendering for square geometry
- Fixed cursor offset
- Fixed pathfinding for square geometry - Fixed Map rendering for square geometry - Fixed cursor offset
Source/Tools/ImageBaker.cpp
Outdated
| } | ||
| else { | ||
| dir_art = (dir + 1) % 8; | ||
| // dir_art = (dir + 1) % 8; |
There was a problem hiding this comment.
How it work before? I don't think that not necessary code.
There was a problem hiding this comment.
It was crashing, because offset in SetCurPos has to start with dir_art = 0, and then go through all pictures in order 0 ... 7, and have correct FrameSize shifts.
The correct art orientation is then set here: (dir_art + 6) % 8
But sorry I just realized there is a mistake now for hexagonal case, I will update soon.
There was a problem hiding this comment.
In your case we iterate 8 times but fill only 6 dirs, so two times is unnecessary.
We must use
auto& sequence = dir == 0 ? collection.Main : collection.Dirs[dir - 1];
and fill dirs one by one.
There was a problem hiding this comment.
You have to iterate 8 times anyway to apply correct file position shifts, they have different FrameSize. Can only skip processing pixels
There was a problem hiding this comment.
This lines have to run for every direction to correctly calculate data offset:
file.SetCurPos(curpos);
curpos += frame_info.FrameSize;
|
Added skipping |
- fix it in the correct place