blitlib
Blit draws a shape into the used bitmap at a position, with the
blitter; the shape’s handle is placed at that position. The blitter
works directly on the bitmap, so blitting is fast, but nothing remembers
what was under the shape. To draw a shape and remove it again later, use
queued blits (QBlit) or buffered blits (BBlit).
How the shape is combined with what is already in the bitmap is the
blit mode, set with BlitMode. CookieMode (the start value),
EraseMode, InvMode and SolidMode give the usual modes, for example
BlitMode EraseMode: with the cookie mode, the shape’s pixels of colour
0 leave the background visible. This needs the shape’s cookie
(shapeslib).
In Amiga mode the commands take the blitter from the system and give it back after each blit; in Blitz mode they use it directly. With runtime error checking, a blit outside the bitmap is the error “Coords outside of BitMap”, and a shape without a cookie the error “Shape does not have a cookie cut”.
Based on the blitlib guide by Acid Software.
Library number 150.
Commands
Blit
Draws the shape into the used bitmap at the position, in the blit mode. With Excessonoff, the bitplanes of the bitmap beyond the shape’s depth are set or cleared under the shape, one bit of the value for each of them.
Statement. Help text: Shape#,X,Y[,Excessonoff]
2 forms:
.w, .w, .w.w, .w, .w, .w
BlitColl
True (-1) if the shape at the position covers a pixel of the used bitmap that is not colour 0, else false (0). It follows the outline of the shape, so the bitmap should hold only what the shape may collide with. Test before blitting the shape itself.
Function, result .w. Help text: (Shape#,x,y)
Arguments: .w, .w, .w
BlitMode
The blit mode of the following Blit commands, a value of the blitter’s control register BLTCON0, with the minterm in bits 0 to 7 and the channels used in bits 8 to 11. CookieMode, EraseMode, InvMode and SolidMode give the usual ones. Blit uses channel A for the shape’s cookie, B for its data, and C and D for the bitmap.
Statement. Help text: BLTCON0
Arguments: .w
Block
Copies the shape into the used bitmap at the position as it is, without a mask; the x position is rounded down to a multiple of 16. It needs no cookie and is meant for shapes whose width is a multiple of 16, such as the tiles of a map.
Statement. Help text: Shape#,X,Y
Arguments: .w, .w, .w
CookieMode
The blit mode that draws the shape and leaves the background visible where the shape has colour 0; the start value.
Function, result .w. No help text.
No arguments.
EraseMode
The blit mode that clears the bitmap where the shape has pixels.
Function, result .w. No help text.
No arguments.
InvMode
The blit mode that inverts the bitmap where the shape has pixels.
Function, result .w. No help text.
No arguments.
SolidMode
The blit mode that sets the bitmap where the shape has pixels.
Function, result .w. No help text.
No arguments.