1 /*
2 
3 Copyright (C) 2015-2018 Night Dive Studios, LLC.
4 
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 
18 */
19 /*
20  * $Source: n:/project/lib/src/2d/RCS/fl8slin.c $
21  * $Revision: 1.5 $
22  * $Author: lmfeeney $
23  * $Date: 1994/06/11 01:24:10 $
24  *
25  * Routine to draw a gouraud shaded line to a flat 8 canvas.
26  *
27  * This file is part of the 2d library.
28  *
29  * $Log: fl8slin.c $
30  * Revision 1.5  1994/06/11  01:24:10  lmfeeney
31  * guts of the routine moved to fl8{c,s}lin.h, per fill type
32  * line drawers are created by defining macros and including
33  * this file
34  *
35  * Revision 1.4  1994/05/06  18:19:13  lmfeeney
36  * rewritten for greater accuracy and speed
37  *
38  * Revision 1.3  1993/10/19  09:50:58  kaboom
39  * Replaced #include <grd.h" with new headers split from grd.h.
40  *
41  * Revision 1.2  1993/10/01  16:01:20  kaboom
42  * Pared down includes to reduce dependencies.
43  *
44  * Revision 1.1  1993/07/01  22:12:15  spaz
45  * Initial revision
46  */
47 
48 #include "cnvdat.h"
49 #include "plytyp.h"
50 #include <stdlib.h>
51 
52 /* not all fill routines use all parms */
53 // MLA #pragma off (unreferenced)
54 
55 #undef macro_plot_i
56 #define macro_plot_i(x, p, i) \
57     do {                      \
58         p[x] = i;             \
59     } while (0)
60 
gri_flat8_usline_norm(long c,long parm,grs_vertex * v0,grs_vertex * v1)61 void gri_flat8_usline_norm(long c, long parm, grs_vertex *v0, grs_vertex *v1) {
62 #include "fl8slin.h"
63 }
64 
65 #undef macro_plot_i
66 #define macro_plot_i(x, p, i)              \
67     do {                                   \
68         p[x] = (long)(((uchar *)parm)[i]); \
69     } while (0)
70 
gri_flat8_usline_clut(long c,long parm,grs_vertex * v0,grs_vertex * v1)71 void gri_flat8_usline_clut(long c, long parm, grs_vertex *v0, grs_vertex *v1) {
72 #include "fl8slin.h"
73 }
74 
75 #undef macro_plot_i
76 #define macro_plot_i(x, p, i) \
77     do {                      \
78         p[x] = p[x] ^ i;      \
79     } while (0)
80 
gri_flat8_usline_xor(long c,long parm,grs_vertex * v0,grs_vertex * v1)81 void gri_flat8_usline_xor(long c, long parm, grs_vertex *v0, grs_vertex *v1) {
82 #include "fl8slin.h"
83 }
84 
85     /* punt */
86 
87 #undef macro_plot_i
88 #define macro_plot_i(x, p, i) \
89     do {                      \
90         p[x] = i;             \
91     } while (0)
92 
gri_flat8_usline_blend(long c,long parm,grs_vertex * v0,grs_vertex * v1)93 void gri_flat8_usline_blend(long c, long parm, grs_vertex *v0, grs_vertex *v1) {
94 #include "fl8slin.h"
95 }
96