forked from voyageur/openglide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsdk2_glideutl.h
191 lines (161 loc) · 4.21 KB
/
sdk2_glideutl.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
/*
** Copyright (c) 1995, 3Dfx Interactive, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of 3Dfx Interactive, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** Use, duplication or disclosure by the Government is subject to restrictions
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
** rights reserved under the Copyright Laws of the United States.
**
** $Header$
** $Log$
** Revision 1.1.1.1 2001/06/25 18:00:50 paul
** v006 from sourceforge
**
** Revision 1.1.1.1 2001/02/01 16:24:51 fbarros
** Version 0.06
**
** CVs: ----------------------------------------------------------------------
**
*
* 11 1/07/98 11:18a Atai
* remove GrMipMapInfo and GrGC.mm_table in glide3
*
* 10 1/06/98 6:47p Atai
* undo grSplash and remove gu routines
*
* 9 1/05/98 6:04p Atai
* move 3df gu related data structure from glide.h to glideutl.h
*
* 8 12/18/97 2:13p Peter
* fogTable cataclysm
*
* 7 12/15/97 5:52p Atai
* disable obsolete glide2 api for glide3
*
* 6 8/14/97 5:32p Pgj
* remove dead code per GMT
*
* 5 6/12/97 5:19p Pgj
* Fix bug 578
*
* 4 3/05/97 9:36p Jdt
* Removed guFbWriteRegion added guEncodeRLE16
*
* 3 1/16/97 3:45p Dow
* Embedded fn protos in ifndef FX_GLIDE_NO_FUNC_PROTO
*/
/* Glide Utility routines */
#ifndef __GLIDEUTL_H__
#define __GLIDEUTL_H__
#ifdef __cplusplus
extern "C" {
#endif
#if defined(GLIDE3) && defined(GLIDE3_ALPHA)
/*
** 3DF texture file structs
*/
typedef struct
{
FxU32 width, height;
int small_lod, large_lod;
GrAspectRatio_t aspect_ratio;
GrTextureFormat_t format;
} Gu3dfHeader;
typedef struct
{
FxU8 yRGB[16];
FxI16 iRGB[4][3];
FxI16 qRGB[4][3];
FxU32 packed_data[12];
} GuNccTable;
typedef struct {
FxU32 data[256];
} GuTexPalette;
typedef union {
GuNccTable nccTable;
GuTexPalette palette;
} GuTexTable;
typedef struct
{
Gu3dfHeader header;
GuTexTable table;
void *data;
FxU32 mem_required; /* memory required for mip map in bytes. */
} Gu3dfInfo;
#endif
#ifndef FX_GLIDE_NO_FUNC_PROTO
/*
** rendering functions
*/
#ifndef GLIDE3_ALPHA
FX_ENTRY void FX_CALL
guAADrawTriangleWithClip( const GrVertex *a, const GrVertex
*b, const GrVertex *c);
FX_ENTRY void FX_CALL
guDrawTriangleWithClip(
const GrVertex *a,
const GrVertex *b,
const GrVertex *c
);
FX_ENTRY void FX_CALL
guDrawPolygonVertexListWithClip( int nverts, const GrVertex vlist[] );
/*
** hi-level rendering utility functions
*/
FX_ENTRY void FX_CALL
guAlphaSource( GrAlphaSource_t mode );
FX_ENTRY void FX_CALL
guColorCombineFunction( GrColorCombineFnc_t fnc );
FX_ENTRY int FX_CALL
guEncodeRLE16( void *dst,
void *src,
FxU32 width,
FxU32 height );
FX_ENTRY FxU16 * FX_CALL
guTexCreateColorMipMap( void );
#endif /* !GLIDE3_ALPHA */
#ifdef GLIDE3
FX_ENTRY void FX_CALL
guGammaCorrectionRGB( FxFloat red, FxFloat green, FxFloat blue );
#endif
/*
** fog stuff
*/
FX_ENTRY float FX_CALL
guFogTableIndexToW( int i );
FX_ENTRY void FX_CALL
guFogGenerateExp( GrFog_t fogtable[], float density );
FX_ENTRY void FX_CALL
guFogGenerateExp2( GrFog_t fogtable[], float density );
FX_ENTRY void FX_CALL
guFogGenerateLinear(GrFog_t fogtable[],
float nearZ, float farZ );
/*
** endian stuff
*/
#ifndef GLIDE3_ALPHA
FX_ENTRY FxU32 FX_CALL
guEndianSwapWords( FxU32 value );
FX_ENTRY FxU16 FX_CALL
guEndianSwapBytes( FxU16 value );
#endif /* !GLIDE3_ALPHA */
/*
** hi-level texture manipulation tools.
*/
FX_ENTRY FxBool FX_CALL
gu3dfGetInfo( const char *filename, Gu3dfInfo *info );
FX_ENTRY FxBool FX_CALL
gu3dfLoad( const char *filename, Gu3dfInfo *data );
#endif /* FX_GLIDE_NO_FUNC_PROTO */
#ifdef __cplusplus
}
#endif
#endif /* __GLIDEUTL_H__ */