Mercurial > hg > dmlib
diff dmdrawline.h @ 232:79dac918c81e
Modularize line clipping etc. a lot, and export all line drawing and
blitting functions.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 08 Oct 2012 09:01:05 +0300 |
parents | 92cc5e1fa180 |
children | a2abd0b991b6 |
line wrap: on
line diff
--- a/dmdrawline.h Mon Oct 08 06:44:35 2012 +0300 +++ b/dmdrawline.h Mon Oct 08 09:01:05 2012 +0300 @@ -1,11 +1,20 @@ +/* + * DMLib + * -- Simple Bresenham's style line drawing + * Programmed and designed by Matti 'ccr' Hamalainen + * (C) Copyright 2011-2012 Tecnic Software productions (TNSP) + */ -static int DM_DRAWLINE_NAME (SDL_Surface *screen, int x0, int y0, int x1, int y1, const Uint32 col) +int DM_DRAWLINE_NAME (SDL_Surface *screen, int x0, int y0, int x1, int y1, const Uint32 col) +#ifdef DM_HEADER +; +#else { int dx, dy, xstep, ystep; const int qpitch = screen->pitch / DM_DRAWLINE_DST_BYTES; // Clipping - if (dmClipLineCoords(&x0, &y0, &x1, &y1, screen) < 0) + if (dmClipLineCoordsInt(&x0, &y0, &x1, &y1, screen) < 0) return -1; // Compute initial deltas @@ -77,6 +86,7 @@ return 0; } +#endif #undef DM_DRAWLINE_NAME #undef DM_DRAWLINE_DST_BYTES