Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic ndarray types. #126

Open
HexDecimal opened this issue Aug 20, 2022 · 0 comments
Open

Generic ndarray types. #126

HexDecimal opened this issue Aug 20, 2022 · 0 comments
Assignees

Comments

@HexDecimal
Copy link
Collaborator

I need to make a generic NDArray type in C99 to help with refactoring libtcod's FOV and pathfinding algorithms. TCOD_Map does not work how I want it to since it combines FOV and pathfinding in an unnecessary way.

I've messed around with several C++ implementations so far: 1 2 3 4 and what I think I've been missing from these is that I should've focused more on views into arrays more. Having a good generic constexpr view type which various storages can convert into will reduce duplicate code and complexity while not having much of a performance penalty.

For C99 I'll have to mess with a handful of hard-coded numeric types. I also want at least one view-like object that takes callbacks instead of strided memory which will remove any limitations on what can be used as a view. I'll wrap all of this up in a union type and maybe make all functions interacting with this inline.

@HexDecimal HexDecimal self-assigned this Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant