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

Split out new crate all-is-cubes-base. #491

Merged
merged 3 commits into from
May 2, 2024
Merged

Split out new crate all-is-cubes-base. #491

merged 3 commits into from
May 2, 2024

Conversation

kpreid
Copy link
Owner

@kpreid kpreid commented May 2, 2024

It contains the majority of code from the math and util modules of all-is-cubes.

This new crate will enable us to use raycast in the build script of all-is-cubes to generate fully pre-calculated light propagation data (#490). It may also assist in further splitting of all-is-cubes into separately compilable parts, if I find such divisions worth making.

I chose the name “base” to be sufficiently abstract that it will not become unsuitable for its purpose (being the crate that all others eventually depend on) regardless of exactly what it evolves to contain. I also considered “all-is-cubes-core”, but I feel that only the crate containing Block and Space deserves that name if I were to use it.

Also, because it's now possible and convenient, the macros notnan, rgb_const, and rgba_const have been moved to all_is_cubes::math. (This is only possible because macro re-exports can be exported from specific modules, even though macro_rules declarations can only be exported from the crate root.)

This is used for all of our conditional `std::error::Error`
implementations, which will allow the impls to exist when needed to
satisfy `ErrorIfStd` bounds even when the `util` module is split to
another crate and therefore won't necessarily share `cfg`s with the
code that needs to contain the implementations.

All this can hopefully go away some day when `core::error::Error`
exists.
@kpreid kpreid force-pushed the math-split branch 2 times, most recently from 9c5c620 to 863ddfc Compare May 2, 2024 19:42
kpreid added 2 commits May 2, 2024 13:54
It contains the majority of code from the `math` and `util` modules of
`all-is-cubes`.

This new crate will enable us to use `raycast` in the build script of
`all-is-cubes` to generate fully pre-calculated light propagation data.
It may also assist in further splitting of `all-is-cubes` into
separately compilable parts, if I find such divisions worth making.

I chose the name “base” to be sufficiently abstract that it will not
become unsuitable for its purpose (being the crate that all others
eventually depend on) regardless of exactly what it evolves to contain.
I also considered “all-is-cubes-core”, but I feel that only the crate
containing `Block` and `Space` deserves that name if I were to use it.

Also, because it's now possible and convenient, the macros `notnan`,
`rgb_const`, and `rgba_const` have been moved to `all_is_cubes::math`.
(This is only possible because macro re-exports can be exported from
specific modules, even though `macro_rules` declarations can only be
exported from the crate root.)
@kpreid kpreid merged commit 45a772d into main May 2, 2024
13 of 14 checks passed
@kpreid kpreid deleted the math-split branch May 2, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant