GPAINT vs GFILL
Root / Submissions / [.]
randoCreated:
So here's something I've discovered when programming the light system for Wonderflonium. Pretty much, don't fill your entire screen with one color using GPAINT; use GFILL instead. To make the light system work, I am just making the screen dark and lighting up areas around light sources. To make the screen totally black, I used GPAINT at first. But this dropped the speed all the way down to an inconsistent 50 FPS, which caused all sorts of bad things like a BG flicker. But when I switched to GFILL, the program ran at a smooth 60 FPS, which looked so much better (especially since I have weapons animated with SPANIM.) I believe this is because GPAINT uses some sort of algorithm to find pixels of the same color, while GFILL only fills the specified area and doesn't have to check if it's allowed to fill certain pixels.
Well, it's faster to use GFILL if you just need to fill the visible part of the screen
GCLS:GPAINT 0,0,#RED: 70 per second
GCLS #RED: 1200 per second
GFILL 0,0,399,239,#RED: 2900 per second
What if you use GCLIP?
GCLIP 1,0,0,399,239 lets GCLS match GFILL.
What I did was GCLS then use GPAINT to make everything black, which was slow as heck
12me21 I actually used GCLS anyway
Maybe I should change that...
EDIT: It's changed and it works properly. The way I handle it is pretty much IF DAY THEN GCLS ELSE GFILL