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:
https://github.com/OpenBW/openbw/blob/d5fe2306ecb08efdea877a7f4117b178292137cb/ui/ui.h#L1284-L1293
witness code compression (>^-^)>
http://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 :<
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...
https://notabug.org/fuglycodelord420/openbw/commits/1aa93b122d1da807267d78d52e600f1dee390777
what's new objectively? well you can make an SCV now by pressing S...
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?
#cpp