11-14-2004, 02:23 AM
A complete list of QB's gfx commands with suggested alternative syntax and commentary, in rough alphabetical order:
1. CLS fillColor
2. COLOR fore, back
And maybe: COLOR(r, g, b) returns LONG
Is this confusing?:3. FLIP
for double buffering
4. GET [STEP](x1,y1)-[STEP](x2,y2),arrayname[(indices)]
EDIT: Problem: If you save the sprite to a file, what do you get? An SDL_Surface struct with no pixel data? When you PUT a string to a file, you get the data instead of a pointer - perhaps sprites could be handled similarly? With a built in SPRITE type (or whatever alias for "SDL_Surface") it could automagically append pixel data when you PUT a SPRITE to a file?
5. Doc should tell people INP(&H3C9) won't work, replaced with (maybe?) : longInt = PALETTE(color)
6. LINE [[STEP] (x1,y1)]-[STEP] (x2,y2) [,[color][,[B[F]][,style]]]
But maybe the style mask is 32 bit instead of 16 like QB? Or an extra param for # of bits in style? Should style not be supported? PureQB font routines use it, but so what?
7. PAINT [STEP] (x,y)[,[paint] [,[bordercolor] [,background]]]
Support ANY for bordercolor (to fill a region not bordered by a single color like most other paint routines) or maybe dropping bordercolor altogether depending on what SDL's paint equivalent can do?
Probably drop support for background param (nobody uses it) and passing a string to paint param (allows painting with a fill pattern)
8. PALETTE col, r, g, b
Doc for OUT should point to PALETTE
QB also supports: PALETTE USING array-name [(array-index)]
Nobody uses it, but it probably translates to SDL better (does SDL even have functions to set one pal entry at a time?)
9. POINT(x,y)
and POINT(0) current gfx cursor x coord, POINT(1) for y
POINT(2) and 3 not needed with no VIEW/WINDOW
10. PRESET (like PSET, but draws with background color instead of fore)
I suggest this be dropped, nobody uses it...
11. PSET [STEP](x,y) [,color]
12. PUT [STEP](x, y),arrayname[(indices)][,actionverb]
TRANS=color and SOLID for actionverb instead of XOR etc?
Or TRANS could use background color set by COLOR
13. The SCREEN function (row,column[,colorflag]) doesn't work in gfx modes, does it? Probably dropping it anyway, right?
SCREEN 12|13|(width, height)[, depth] ?
no apage,vpage params because multiple page support is replaced with double buffering and FLIP
14. VIEW [SCREEN] (x1,y1)-(x2,y2) [,[color][,border]]]
I suggest dropping both VIEW SCREEN and color,border params and making it set the clipping box instead of doing what QB's view does.
Not supported:
PCOPY (no multiple page support - double buffering with FLIP instead, right?)
DRAW
WINDOW
PMAP (useless without WINDOW)
1. CLS fillColor
2. COLOR fore, back
And maybe: COLOR(r, g, b) returns LONG
Is this confusing?:
Code:
COLOR COLOR(foreR, foreG, foreB), COLOR(backR, backG, backB)
for double buffering
4. GET [STEP](x1,y1)-[STEP](x2,y2),arrayname[(indices)]
EDIT: Problem: If you save the sprite to a file, what do you get? An SDL_Surface struct with no pixel data? When you PUT a string to a file, you get the data instead of a pointer - perhaps sprites could be handled similarly? With a built in SPRITE type (or whatever alias for "SDL_Surface") it could automagically append pixel data when you PUT a SPRITE to a file?
5. Doc should tell people INP(&H3C9) won't work, replaced with (maybe?) : longInt = PALETTE(color)
6. LINE [[STEP] (x1,y1)]-[STEP] (x2,y2) [,[color][,[B[F]][,style]]]
But maybe the style mask is 32 bit instead of 16 like QB? Or an extra param for # of bits in style? Should style not be supported? PureQB font routines use it, but so what?
7. PAINT [STEP] (x,y)[,[paint] [,[bordercolor] [,background]]]
Support ANY for bordercolor (to fill a region not bordered by a single color like most other paint routines) or maybe dropping bordercolor altogether depending on what SDL's paint equivalent can do?
Probably drop support for background param (nobody uses it) and passing a string to paint param (allows painting with a fill pattern)
8. PALETTE col, r, g, b
Doc for OUT should point to PALETTE
QB also supports: PALETTE USING array-name [(array-index)]
Nobody uses it, but it probably translates to SDL better (does SDL even have functions to set one pal entry at a time?)
9. POINT(x,y)
and POINT(0) current gfx cursor x coord, POINT(1) for y
POINT(2) and 3 not needed with no VIEW/WINDOW
10. PRESET (like PSET, but draws with background color instead of fore)
I suggest this be dropped, nobody uses it...
11. PSET [STEP](x,y) [,color]
12. PUT [STEP](x, y),arrayname[(indices)][,actionverb]
TRANS=color and SOLID for actionverb instead of XOR etc?
Or TRANS could use background color set by COLOR
13. The SCREEN function (row,column[,colorflag]) doesn't work in gfx modes, does it? Probably dropping it anyway, right?
SCREEN 12|13|(width, height)[, depth] ?
no apage,vpage params because multiple page support is replaced with double buffering and FLIP
14. VIEW [SCREEN] (x1,y1)-(x2,y2) [,[color][,border]]]
I suggest dropping both VIEW SCREEN and color,border params and making it set the clipping box instead of doing what QB's view does.
Not supported:
PCOPY (no multiple page support - double buffering with FLIP instead, right?)
DRAW
WINDOW
PMAP (useless without WINDOW)