Function Requests!
MicalobiaCreated:
These are functions I made a while back for storing numbers up to 65536 on the graphics screen, despite the color buffer
COMMON DEF GNSET X%, Y%, N% 'Stops if number is out of range IF N%>65536 OR N%<0 THEN STOP VAR A% = N% MOD 2 VAR R% = FLOOR(N% / 2) MOD 32 VAR G% = FLOOR(N% / (32*2)) MOD 32 VAR B% = FLOOR(N% / (32 * 32 *2)) MOD 32 GPSET X%, Y%, RGB(A% * 255, R% * 8, G% * 8, B% * 8) END COMMON DEF GNFILL X%, Y%, X2%, Y2%, N% 'Stops if number is out of range IF N%>65536 OR N%<0 THEN STOP VAR A% = N% MOD 2 VAR R% = FLOOR(N% / 2) MOD 32 VAR G% = FLOOR(N% / (32*2)) MOD 32 VAR B% = FLOOR(N% / (32 * 32 *2)) MOD 32 GFILL X%, Y%, X2%, Y2%, RGB(A%, R% * 8, G% * 8, B% * 8) END COMMON DEF GNSPOIT(X%, Y%) VAR A%, R%, G%, B%, T% RGBREAD GSPOIT(X%, Y%) OUT A%, R%, G%, B% T% = 0 INC T%, A%>1 INC T%, R%/8 * 2 INC T%, (G%/8) * 32 * 2 INC T%, (B%/8) * 32 * 32 * 2 RETURN T% ENDSnail helped me realize that I could double the number with the alpha channel, and I feel he deserves credit for that.
A function for reading definitions created by SBANM
COMMON DEF SPADEF G%[] DIM V%[4096,10] FOR I=0 TO 3 EAT SHIFT(G%) NEXT COPY V%, G% FOR I = 0 TO 4095 U=V%[N,0]:V=V%[N,1] W=V%[N,2]:H=V%[N,3] X=V%[N,4]:Y=V%[N,5] A=1 A=A OR (V%[N,7]<<4) A=A OR (V%[N,8]<<3) A=A OR (V%[N,9]<<1) SPDEF N,U,V,W,H,X,Y,A NEXT END DEF EAT N END
I recommend that you use the more standardHmm... With some testing, it's a problem with the cosine function, and not the radian function. Which is annoying, to say the least. Working on solution now EDIT: As a side note, why is the standard eat sand? it's not like it make that much of a difference, but...DEF EAT SAND ENDoh and I suppose I should make a request. uh.... make a function that converts degrees to radians but make it so that COS(RAD(270)) is actually 0 (for example) I'm not sure if this is possible.