|
| 1 | +#ifndef CBLOCK_H |
| 2 | +#define CBLOCK_H |
| 3 | + |
| 4 | +#include "jimk.h" |
| 5 | + |
| 6 | +/* Function: xorblock |
| 7 | + * |
| 8 | + * Exclusive or a rectangle with colour. Clipped to fit 320x200 screen. |
| 9 | + * Used for text cursor. |
| 10 | + * |
| 11 | + * dst - byte plane to draw on. |
| 12 | + * x,y - upper left corner of rectangle. |
| 13 | + * width, height - dimensions of rectangle in pixels. |
| 14 | + * col - colour to xor with block. |
| 15 | + */ |
| 16 | +extern void xorblock(UBYTE *dst, int x, int y, int width, int height, int col); |
| 17 | + |
| 18 | +/* Function: cblock |
| 19 | + * |
| 20 | + * Draw a rectangle in a solid colour. Not clipped. |
| 21 | + * Used heavily by menu drawing routines. |
| 22 | + * |
| 23 | + * dst - byte plane to draw on. |
| 24 | + * x, y - upper left corner of rectangle. |
| 25 | + * width, height - dimensions of rectangle in pixels. |
| 26 | + * col - colour to set block. |
| 27 | + */ |
| 28 | +extern void cblock(UBYTE *dst, int x, int y, int width, int height, int col); |
| 29 | + |
| 30 | +/* Function: chli |
| 31 | + * |
| 32 | + * Draw a horizontal line in a solid colour. Not clipped. Used by |
| 33 | + * menu routines. |
| 34 | + * |
| 35 | + * dst - byte plane to draw on. |
| 36 | + * x, y - left end of line. |
| 37 | + * width - width of line. |
| 38 | + * col - colour of line. |
| 39 | + */ |
| 40 | +extern void chli(UBYTE *dst, int x, int y, int width, int col); |
| 41 | + |
| 42 | +/* Function: cvli |
| 43 | + * |
| 44 | + * Draw a vertical line in a solid colour. Not clipped. Used by |
| 45 | + * menu routines. |
| 46 | + * |
| 47 | + * dst - byte plane to draw on. |
| 48 | + * x, y - left end of line. |
| 49 | + * height - height of line. |
| 50 | + * col - colour of line. |
| 51 | + */ |
| 52 | +extern void cvli(UBYTE *dst, int x, int y, int height, int col); |
| 53 | + |
| 54 | +/* Function: cdot |
| 55 | + * |
| 56 | + * Draw a single pixel dot. Clipped to 320x200. |
| 57 | + * |
| 58 | + * dst - byte plane to draw on. |
| 59 | + * x, y - screen position. |
| 60 | + * col - dot colour. |
| 61 | + */ |
| 62 | +extern void cdot(UBYTE *dst, int x, int y, int col); |
| 63 | + |
| 64 | +#ifndef SLUFF |
| 65 | + |
| 66 | +#define xorrop(col, x, y, width, height) \ |
| 67 | + xorblock(vf.p, x, y, width, height, col) |
| 68 | + |
| 69 | +#define colblock(col, x, y, x2, y2) \ |
| 70 | + cblock(vf.p, x, y, (x2)-(x)+1, (y2)-(y)+1, col) |
| 71 | + |
| 72 | +#define colrop(col, x, y, width, height) \ |
| 73 | + cblock(vf.p, x, y, (width+1), (height+1), col) |
| 74 | + |
| 75 | +#define color_hslice(y, height, col) \ |
| 76 | + cblock(vf.p, 0, y, vf.w, height, col) |
| 77 | + |
| 78 | +#define hline(y, x0, x1, col) \ |
| 79 | + chli(vf.p, x0, y, (x1)-(x0)+1, col) |
| 80 | + |
| 81 | +#define vline(x, y0, y1, col) \ |
| 82 | + cvli(vf.p, x, y0, (y1)-(y0)+1, col) |
| 83 | + |
| 84 | +#endif /* SLUFF */ |
| 85 | + |
| 86 | +#endif |
0 commit comments