Thinking ahead paid off
-
Over a year ago I made a funny function to take a rectangle (x1,y1,x2,y2) and "split" it by another rectangle, to yield up to 4 resulting rectangles by punching a second rectangle shaped hole in the first rectangle. I thought it might be useful someday. Today I used it. I was optimizing battery life for a remote I built, so I wanted to minimize the amount I was communicating to the display on it. I used this spit() function to knock out areas that were to be replaced with dynamically rendered bits so that when I rendered the background I wasn't rendering any area that would later be drawn to anyway. Ergo, I am never painting the same pixel twice. Woo! I feel smart right now. :-\
To err is human. Fortune favors the monsters.
-
Over a year ago I made a funny function to take a rectangle (x1,y1,x2,y2) and "split" it by another rectangle, to yield up to 4 resulting rectangles by punching a second rectangle shaped hole in the first rectangle. I thought it might be useful someday. Today I used it. I was optimizing battery life for a remote I built, so I wanted to minimize the amount I was communicating to the display on it. I used this spit() function to knock out areas that were to be replaced with dynamically rendered bits so that when I rendered the background I wasn't rendering any area that would later be drawn to anyway. Ergo, I am never painting the same pixel twice. Woo! I feel smart right now. :-\
To err is human. Fortune favors the monsters.
It can be used in many ways. Here's my little Windows for 8bit machine doc, check page 9. :) yx/yx-buddy.pdf at master · tstih/yx · GitHub[^]