Mercurial > hg > dmlib
view dmline.c @ 241:3bff024a91be
Move 3D line/sprite renderer to separate module.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 09 Oct 2012 13:02:55 +0300 |
parents | a2abd0b991b6 |
children | 9d015d32841a |
line wrap: on
line source
/* * DMLib * -- Arbitrary line drawing functions * Programmed and designed by Matti 'ccr' Hamalainen * (C) Copyright 2011 Tecnic Software productions (TNSP) */ #include "dmlib.h" /* Clip line coordinates. Return value: * = 0 : No clipping needed. * > 0 : Clipped. Line partially inside the clipping area. * < 0 : Line completely outside the clipping area. */ #define dmClipBits(Q, x, y) \ do { \ Q = 0; \ if (x < clipX0) Q |= 1; \ else \ if (x > clipX1) Q |= 2; \ if (y < clipY0) Q |= 4; \ else \ if (y > clipY1) Q |= 8; \ } while (0) #define xA (*x0) #define xB (*x1) #define yA (*y0) #define yB (*y1) #define DM_CLIP_FUNC dmClipLineCoordsInt #define DM_COORD_TYPE int #include "dmlineclip.h" #define DM_CLIP_FUNC dmClipLineCoordsFloat #define DM_COORD_TYPE DMFloat #include "dmlineclip.h" #include "dmlinefunc.h"