-
Notifications
You must be signed in to change notification settings - Fork 646
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
draw octants directly rather than relying on font #5433
base: main
Are you sure you want to change the base?
Conversation
a25ac8b
to
659e715
Compare
hrmmm, do the builtin draws only run when we can't find these glyphs in the font? that would explain things. i'd suggest giving them primacy should that be the case, but can understand going the other way. |
659e715
to
ea1299d
Compare
Take a look at this. There are a couple of places in |
const OctantMin = 0x1cd00; | ||
const OctantMax = 0x1cde5; | ||
const Octants = [OctantMax - OctantMin + 1][8]bool{ | ||
[_]bool{ false, false, true, false, false, false, false, false }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems rather tedious and error-prone to convert the name of the octant from "BLOCK OCTANT-12345" to a boolean array like this. With comptime strings and inline for loops this can be made so much easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hrmmm, i agree that using the language's native features for this kind of thing would be far less opaque. i'm intrigued, but doubt i'll get to it this weekend--feel encouraged to use this PR as a starting point to do something better. i have no emotional ties to this matrix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the pointers to the ziggery, though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't reviewed this PR yet but I agree this code is very C (no surprise!). Zig's comptime facilities should allow us to do something much nicer here I believe.
got it, much appreciated |
ea1299d
to
d58e04d
Compare
d58e04d
to
fafeb49
Compare
yQuads()
anddraw_octant()
, pretty obvious extensions of existing code. to allocate up to 3 potential remainder lines, consider that octants will often appear in a rectangular subset of the terminal. we want the distributed excess uniformly distributed across such a region. so:Octant
s are octary arrays ofbool
, provided as a somewhat opaque constant tableOctant
is not the prettiest thing in the known universedraw_sextant()
anddraw_octant()
like notcurses did, almost certainlywith that said, i don't think
draw_octant()
is actually being called lol, so let's not merge this yet. happy to hear early feedback, though.