ok so you need to outline a rectangle on square grid, you know yer pixels... logically you can choose to do it on the inside of the rectangle, to make sure you don't go out of bounds, or on the outside if you need the in-bound pixels untouched... however a very common choice is to go completely insane and do the top and left edges on the inside and bottom and right edges on the outside:

github.com/OpenBW/openbw/blob/

Follow

nevermind, the right edge is on the inside too, it's just the bottom, so lets file this under off by one errors... I'm just too used to the two dimensions being consistent

witness code compression (>^-^)>
ix.io/3vy0/cpp

>but you introduced three new libraries :v

libraries don't count :V

>but your version is also slower :v

it can be optimized >:V nothing inherently slow about it :<

Show thread

undefined behavior on line 75!

I should probably stop staring at this and do something useful instead...

Show thread

ended up reworking a lot of the ui code... all the Xes and Ys and half-assed SDL wrappers were getting on my nerves, so partially replaced them with my own half-assed SDL wrappers and vector library...

notabug.org/fuglycodelord420/o

what's new objectively? well you can make an SCV now by pressing S...

Show thread

things that bit me:

operator precedence
note: algebra am I right?

overload resolution
note: a universal reference without type constraints in an overload set should be a yellow flag

value/reference semantics:
note: if you want to absolutely make sure you are referring to a value as a constant and not owning one, use const pointer to const value (or something like std::reference_wrapper to exclude nullptr), not a const reference, since, as we all know, a const reference can bind to a temporary and extend its lifetime.

final thoughts: god I wish I had a garbage collector or a borrow checker to save me from... wait none of these are memory errors? how come?

Show thread
Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.