localize control flow and variables

State and control flow for modal mouse actions (dragging/resizing/etc)
was fragmented and scattered through main.c, making code convoluted and
hard to maintain.

I fixed that by applying good structured programming practics:
implementing sub-event-loops for those modal actions, rather than
checking which modal action is currently in action at the main
event-loop.

That commit took me more time than i expected... abstract out all
spaghettish, global-state control flow into a single, encapsulated
scope for each modal action… test if i broke anything… find any dead
code that is not used anymore (implementing that global state we had
before)…

I also put some `static` in global variables and routines, so the
compile can warn whether an unused variable/function is defined (and
help me on removing dead code).
This commit is contained in:
Lucas de Sena
2026-01-31 01:51:39 +00:00
parent 5bbae05fec
commit 8a59e5cc9e

1072
main.c

File diff suppressed because it is too large Load Diff