-
Notifications
You must be signed in to change notification settings - Fork 1
/
texture_env_combine.h
86 lines (78 loc) · 1.9 KB
/
texture_env_combine.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
#ifndef TEXTURE_ENV_COMBINE_H
#define TEXTURE_ENV_COMBINE_H
struct TexEnvCombinerArg
{
GLenum source, operand;
};
struct TexEnvCombinerStage
{
WORD constant;
BOOL used;
GLenum combine;
TexEnvCombinerArg arg0, arg1, arg2;
WORD outputTexture;
};
struct TexEnvCombiner
{
BOOL usesT0, usesT1, usesNoise;
WORD usedUnits;
struct
{
WORD color, secondaryColor, alpha;
} vertex;
TexEnvCombinerStage color[8];
TexEnvCombinerStage alpha[8];
};
static TexEnvCombinerArg TexEnvArgs[] =
{
// CMB
{GL_PREVIOUS_ARB, GL_SRC_COLOR},
// T0
{GL_TEXTURE, GL_SRC_COLOR},
// T1
{GL_TEXTURE, GL_SRC_COLOR},
// PRIM
{GL_CONSTANT_ARB, GL_SRC_COLOR},
// SHADE
{GL_PRIMARY_COLOR_ARB, GL_SRC_COLOR},
// ENV
{GL_CONSTANT_ARB, GL_SRC_COLOR},
// CENTER
{GL_CONSTANT_ARB, GL_SRC_COLOR},
// SCALE
{GL_CONSTANT_ARB, GL_SRC_COLOR},
// CMBALPHA
{GL_PREVIOUS_ARB, GL_SRC_ALPHA},
// T0ALPHA
{GL_TEXTURE, GL_SRC_ALPHA},
// T1ALPHA
{GL_TEXTURE, GL_SRC_ALPHA},
// PRIMALPHA
{GL_CONSTANT_ARB, GL_SRC_ALPHA},
// SHADEALPHA
{GL_PRIMARY_COLOR_ARB, GL_SRC_ALPHA},
// ENVALPHA
{GL_CONSTANT_ARB, GL_SRC_COLOR},
// LODFRAC
{GL_CONSTANT_ARB, GL_SRC_COLOR},
// PRIMLODFRAC
{GL_CONSTANT_ARB, GL_SRC_COLOR},
// NOISE
{GL_TEXTURE, GL_SRC_COLOR},
// K4
{GL_CONSTANT_ARB, GL_SRC_COLOR},
// K5
{GL_CONSTANT_ARB, GL_SRC_COLOR},
// ONE
{GL_CONSTANT_ARB, GL_SRC_COLOR},
// ZERO
{GL_CONSTANT_ARB, GL_SRC_COLOR}
};
void Init_texture_env_combine();
TexEnvCombiner* Compile_texture_env_combine(Combiner* color, Combiner* alpha);
void Set_texture_env_combine(TexEnvCombiner* envCombiner);
void Update_texture_env_combine_Colors(TexEnvCombiner*);
void Uninit_texture_env_combine();
void BeginTextureUpdate_texture_env_combine();
void EndTextureUpdate_texture_env_combine();
#endif