-
Notifications
You must be signed in to change notification settings - Fork 0
/
r_draw.h
102 lines (82 loc) · 2.1 KB
/
r_draw.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#ifndef __R_DRAW__
#define __R_DRAW__
enum column_pipeline_e
{
RDC_PIPELINE_STANDARD,
RDC_PIPELINE_TRANSLATED,
RDC_PIPELINE_FUZZ,
RDC_PIPELINE_MAXPIPELINES,
};
enum draw_filter_type_e
{
RDRAW_FILTER_NONE,
RDRAW_FILTER_POINT,
RDRAW_FILTER_LINEAR,
RDRAW_FILTER_ROUNDED,
RDRAW_FILTER_MAXFILTERS
};
enum sloped_edge_type_e
{
RDRAW_MASKEDCOLUMNEDGE_SQUARE,
RDRAW_MASKEDCOLUMNEDGE_SLOPED
};
typedef struct
{
int x;
int yl;
int yh;
int z;
int iscale;
int texturemid;
int texheight;
int texu;
const byte *source;
const byte *prevsource;
const byte *nextsource;
const lighttable_t *colormap;
const lighttable_t *nextcolormap;
const byte *translation;
int edgeslope;
int drawingmasked;
enum sloped_edge_type_e edgetype;
} draw_column_vars_t;
typedef struct
{
int y;
int x1;
int x2;
int z;
int xfrac;
int yfrac;
int xstep;
int ystep;
const byte *source;
const lighttable_t *colormap;
const lighttable_t *nextcolormap;
} draw_span_vars_t;
typedef struct
{
byte *byte_topleft;
int byte_pitch;
enum draw_filter_type_e filterwall;
enum draw_filter_type_e filterfloor;
enum draw_filter_type_e filtersprite;
enum draw_filter_type_e filterz;
enum draw_filter_type_e filterpatch;
enum sloped_edge_type_e sprite_edges;
enum sloped_edge_type_e patch_edges;
int mag_threshold;
} draw_vars_t;
extern draw_vars_t drawvars;
extern byte *translationtables;
typedef void (*R_DrawColumn_f)(draw_column_vars_t *dcvars);
R_DrawColumn_f R_GetDrawColumnFunc(enum column_pipeline_e type, enum draw_filter_type_e filter, enum draw_filter_type_e filterz);
typedef void (*R_DrawSpan_f)(draw_span_vars_t *dsvars);
R_DrawSpan_f R_GetDrawSpanFunc(enum draw_filter_type_e filter, enum draw_filter_type_e filterz);
void R_DrawSpan(draw_span_vars_t *dsvars);
void R_InitBuffer(int width, int height);
void R_InitTranslationTables(void);
void R_ResetColumnBuffer(void);
void R_SetDefaultDrawColumnVars(draw_column_vars_t *dcvars);
void R_VideoErase(int x, int y, int count);
#endif