I'm making a program that uses GSAVE to copy a section of the screen to an array. The problem is the color codes. They aren't like the standard color codes used in other graphics commands. I understand how the regular color codes work but I don't know how these "32 bit" or "16 bit" color codes (as stated in the GSAVE manual page) work. How can I convert them?
GSAVE Color Codes
Root / Programming Questions / [.]
HackTheWorldsCreated:
Convert to what? If you want the standard normal usual RGBREAD accessible color codes, use 32 bit and whatever flag says that.There is no flag for 16 or 32 bit color. It only accepts 8-bit color codes.
If you want it for GLOAD, it doesn't really matter, just make sure you use 16-16 or 32-32.That's the thing. I'm not using GLOAD. Instead of running some for loops with GSPOIT I wanted to use GSAVE as it is much faster, but I need 8 bit color codes. I don't know how the 16 bit color codes work. Btw, thanks for responding.
All standard graphics commands (GPSET, GLINE, etc.) in SmileBASIC 3 use 32-bit integer values for color input. Stored as ARGB, 8 bits per channel. The RGB() function takes 3 or 4 8-bit integer values to turn into the 32-bit format.
The graphics screens, however, do not store the screen in full 32-bit. Instead, it stores them in 16-bit. ARGB. 1 bit to A and 5 for each of RGB.
The GSAVE and GLOAD commands allow you to load and save in either format by setting a flag.
Yeah I figured that out by now. It was throwing me off because the manual refers to 8-bit colors codes even though it's just 8-bit per channel and 32-bit color codes. Thanks for your help!