Rice Video Plugin for GLES1.1
[mupen64plus-pandora.git] / source / rice_gles / src / CNvTNTCombiner.h
CommitLineData
d07c171f 1/*
2Copyright (C) 2003 Rice1964
3
4This program is free software; you can redistribute it and/or
5modify it under the terms of the GNU General Public License
6as published by the Free Software Foundation; either version 2
7of the License, or (at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program; if not, write to the Free Software
16Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17*/
18
19#ifndef _NVIDIA_TNT_COMBINER_H_
20#define _NVIDIA_TNT_COMBINER_H_
21
22#include <vector>
23
24#include "Combiner.h"
25
26typedef struct
27{
28 uint8 arg0;
29 uint8 arg1;
30 uint8 arg2;
31 uint8 arg3;
32} TNT2CombType;
33
34typedef struct {
35 union {
36 struct {
37 unsigned int rgbOp;
38 unsigned int alphaOp;
39 };
40 unsigned int ops[2];
41 };
42
43 union {
44 struct {
45 uint8 rgbArg0;
46 uint8 rgbArg1;
47 uint8 rgbArg2;
48 uint8 rgbArg3;
49 uint8 alphaArg0;
50 uint8 alphaArg1;
51 uint8 alphaArg2;
52 uint8 alphaArg3;
53 };
54 TNT2CombType Combs[2];
55 uint8 args[2][4];
56 };
57
58 int constant;
59} TNT2CombinerType;
60
61typedef struct {
62 uint32 dwMux0;
63 uint32 dwMux1;
64 union {
65 struct {
66 TNT2CombinerType unit1;
67 TNT2CombinerType unit2;
68 };
69 TNT2CombinerType units[2];
70 };
71 int numOfUnits;
72} TNT2CombinerSaveType;
73
74class CNvTNTCombiner
75{
76protected:
77 CNvTNTCombiner();
78 virtual ~CNvTNTCombiner();
79
80 int FindCompiledMux();
81 int ParseDecodedMux(); // Compile the decodedMux into NV register combiner setting
82 virtual void ParseDecodedMuxForConstants(TNT2CombinerSaveType &res);
83 int SaveParserResult(TNT2CombinerSaveType &result);
84
85#ifdef DEBUGGER
86 void DisplaySimpleMuxString();
87#endif
88 std::vector<TNT2CombinerSaveType> m_vCompiledTNTSettings;
89 int m_lastIndexTNT;
90 DecodedMux **m_ppDecodedMux;
91};
92
93#endif
94