1 /******************************************************************************
2 * Arachnoid Graphics Plugin for Mupen64Plus
3 * http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
5 * Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 *****************************************************************************/
22 #ifndef COMBINER_STRUCTS_H_
23 #define COMBINER_STRUCTS_H_
28 // Internal combiner commands
35 // Internal generalized combiner inputs
45 #define COMBINED_ALPHA 8
46 #define TEXEL0_ALPHA 9
47 #define TEXEL1_ALPHA 10
48 #define PRIMITIVE_ALPHA 11
49 #define SHADE_ALPHA 12
51 #define LOD_FRACTION 14
52 #define PRIM_LOD_FRAC 15
60 //! Defines how mux-values are coded.
61 //TODO: check this size against GCC when i'm awake
91 unsigned int muxs1, muxs0;
94 unsigned long long mux;
98 //! Combiner operation
107 //! Combiner Stage with combiner operations
114 //! Combiner with combiner stages
118 CombinerStage stage[2];
124 int loadValue; //!< Load
125 int addValue; //!< Addition
126 int subValue; //!< Subract
127 int multValue; //!< Multiplication
131 //*****************************************************************************
132 //! Texture Environment Combiner Argument
133 //! Difines a color source and mathimatical operation to be performed
134 //*****************************************************************************
135 struct TexEnvCombinerArg
141 //*****************************************************************************
142 //! Texture Environment Combiner Stage
143 //*****************************************************************************
144 struct TexEnvCombinerStage
146 unsigned short constant;
149 TexEnvCombinerArg arg0, arg1, arg2;
150 unsigned short outputTexture;
153 //*****************************************************************************
154 //* Texture Environment Combiner
155 //! Stores information how graphics API should combine colors and set
156 //! Texture environment.
157 //*****************************************************************************
158 struct TexEnvCombiner
160 bool usesT0, usesT1, usesNoise;
164 unsigned short usedUnits;
168 unsigned short color, secondaryColor, alpha;
171 TexEnvCombinerStage color[8];
172 TexEnvCombinerStage alpha[8];