2008-06-26 20:19:47 +02:00
|
|
|
|
2008-10-13 23:02:35 +02:00
|
|
|
#define PX_CREATE 1
|
|
|
|
#define PX_DESTROY 2
|
2008-10-16 14:00:10 +02:00
|
|
|
#define PX_CLEAR 3
|
|
|
|
#define PX_DRAW_RECT 4
|
|
|
|
#define PX_FILL_RECT 5
|
|
|
|
#define PX_LINE 6
|
|
|
|
#define PX_BLIT 7
|
|
|
|
#define PX_BLIT_TRANSPARENT 8
|
|
|
|
#define PX_BLIT_ALPHA 9
|
2008-10-13 23:02:35 +02:00
|
|
|
|
2008-09-24 16:30:07 +02:00
|
|
|
|
2008-06-26 20:19:47 +02:00
|
|
|
|
|
|
|
typedef unsigned int color_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2008-10-12 23:59:52 +02:00
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
}pt_t;
|
|
|
|
|
|
|
|
/*********** Clipping **********/
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int xmin;
|
|
|
|
int ymin;
|
|
|
|
int xmax;
|
|
|
|
int ymax;
|
|
|
|
}clip_t, *PTRclip;
|
|
|
|
|
|
|
|
#define CLIP_TOP 1
|
|
|
|
#define CLIP_BOTTOM 2
|
|
|
|
#define CLIP_RIGHT 4
|
|
|
|
#define CLIP_LEFT 8
|
|
|
|
|
|
|
|
int LineClip ( clip_t *clip, int *x1, int *y1, int *x2, int *y2 );
|
|
|
|
|
|
|
|
int BlockClip( clip_t *clip, int *x1, int *y1, int *x2, int* y2 );
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2009-02-08 19:41:45 +01:00
|
|
|
unsigned width;
|
|
|
|
unsigned height;
|
|
|
|
u32_t format;
|
|
|
|
u32_t flags;
|
|
|
|
size_t pitch;
|
2008-10-12 23:59:52 +02:00
|
|
|
void *mapped;
|
2009-02-08 19:41:45 +01:00
|
|
|
|
2008-10-12 23:59:52 +02:00
|
|
|
u32_t handle;
|
|
|
|
}pixmap_t;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2009-02-08 19:41:45 +01:00
|
|
|
unsigned width;
|
|
|
|
unsigned height;
|
|
|
|
u32_t format;
|
|
|
|
u32_t flags;
|
|
|
|
size_t pitch;
|
2008-10-12 23:59:52 +02:00
|
|
|
void *mapped;
|
|
|
|
|
|
|
|
unsigned pitch_offset;
|
2009-02-08 19:41:45 +01:00
|
|
|
addr_t local;
|
2008-10-12 23:59:52 +02:00
|
|
|
}local_pixmap_t;
|
|
|
|
|
2009-01-27 01:31:09 +01:00
|
|
|
#define PX_MEM_SYSTEM 0
|
|
|
|
#define PX_MEM_LOCAL 1
|
|
|
|
#define PX_MEM_GART 2
|
2008-07-04 11:14:15 +02:00
|
|
|
|
2009-01-27 01:31:09 +01:00
|
|
|
#define PX_MEM_MASK 3
|
|
|
|
|
2009-02-08 19:41:45 +01:00
|
|
|
#define PX_LOCK 1
|
2008-10-12 23:59:52 +02:00
|
|
|
|
2008-10-16 14:00:10 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
local_pixmap_t *dstpix;
|
|
|
|
|
|
|
|
color_t color;
|
|
|
|
}io_clear_t;
|
|
|
|
|
2008-10-12 23:59:52 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
local_pixmap_t *dstpix;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int x0;
|
|
|
|
int y0;
|
|
|
|
};
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int x1;
|
|
|
|
int y1;
|
|
|
|
};
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int w;
|
|
|
|
int h;
|
|
|
|
};
|
|
|
|
};
|
2008-07-04 11:14:15 +02:00
|
|
|
color_t color;
|
2008-10-15 12:31:44 +02:00
|
|
|
color_t border;
|
2008-10-16 14:00:10 +02:00
|
|
|
}io_draw_t;
|
2008-06-26 20:19:47 +02:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2008-10-12 23:59:52 +02:00
|
|
|
local_pixmap_t *dstpix;
|
2008-07-04 11:14:15 +02:00
|
|
|
|
2008-06-26 20:19:47 +02:00
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int w;
|
|
|
|
int h;
|
|
|
|
|
|
|
|
color_t bkcolor;
|
|
|
|
color_t fcolor;
|
|
|
|
|
|
|
|
u32_t bmp0;
|
|
|
|
u32_t bmp1;
|
2008-10-16 14:00:10 +02:00
|
|
|
color_t border;
|
|
|
|
}io_fill_t;
|
2008-06-27 12:46:14 +02:00
|
|
|
|
2008-06-26 20:19:47 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
2008-10-12 23:59:52 +02:00
|
|
|
local_pixmap_t *dstpix;
|
2008-07-04 11:14:15 +02:00
|
|
|
int dst_x;
|
|
|
|
int dst_y;
|
2008-07-03 13:35:35 +02:00
|
|
|
|
2008-10-12 23:59:52 +02:00
|
|
|
local_pixmap_t *srcpix;
|
2008-07-04 11:14:15 +02:00
|
|
|
int src_x;
|
|
|
|
int src_y;
|
|
|
|
int w;
|
|
|
|
int h;
|
2008-07-03 13:35:35 +02:00
|
|
|
|
2008-12-13 04:32:16 +01:00
|
|
|
union {
|
|
|
|
color_t key;
|
|
|
|
color_t alpha;
|
|
|
|
};
|
2008-10-16 14:00:10 +02:00
|
|
|
}io_blit_t;
|
|
|
|
|
|
|
|
|
2009-02-08 19:41:45 +01:00
|
|
|
static addr_t bind_pixmap(local_pixmap_t *pixmap);
|
|
|
|
|
|
|
|
|
2008-10-16 14:00:10 +02:00
|
|
|
int CreatePixmap(pixmap_t *io);
|
|
|
|
|
|
|
|
int DestroyPixmap(pixmap_t *io);
|
2008-07-03 13:35:35 +02:00
|
|
|
|
2008-10-16 14:00:10 +02:00
|
|
|
int ClearPixmap(io_clear_t *io);
|
2008-06-26 20:19:47 +02:00
|
|
|
|
2008-10-16 14:00:10 +02:00
|
|
|
int Line(io_draw_t *draw);
|
2008-06-26 20:19:47 +02:00
|
|
|
|
2008-10-16 14:00:10 +02:00
|
|
|
int DrawRect(io_draw_t * draw);
|
2008-06-26 20:19:47 +02:00
|
|
|
|
2008-10-16 14:00:10 +02:00
|
|
|
int FillRect(io_fill_t * fill);
|
2008-07-02 14:41:34 +02:00
|
|
|
|
2008-10-16 14:00:10 +02:00
|
|
|
int Blit(io_blit_t* blit);
|
2008-07-03 13:35:35 +02:00
|
|
|
|
2008-10-16 14:00:10 +02:00
|
|
|
int BlitTransparent(io_blit_t* blit);
|
2008-07-02 14:41:34 +02:00
|
|
|
|
2008-07-04 11:14:15 +02:00
|
|
|
|
2008-06-26 20:19:47 +02:00
|
|
|
|
2008-07-04 20:52:25 +02:00
|
|
|
|