Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
texturefilter.h
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
4**
5** This program is free software: you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation, either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19/***********************************************************************************************
20 *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
21 ***********************************************************************************************
22 * *
23 * Project Name : WW3D *
24 * *
25 * $Archive:: ww3d2/texturefilter.h $*
26 * *
27 * $Org Author:: Kenny Mitchell $*
28 * *
29 * Author : Kenny Mitchell *
30 * *
31 * $Modtime:: 08/05/02 1:27p $*
32 * *
33 * $Revision:: 1 $*
34 * *
35 * 08/05/02 KM Texture filter class abstraction *
36 *---------------------------------------------------------------------------------------------*
37 * Functions: *
38 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
39
40#ifndef TEXTUREFILTER_H
41#define TEXTUREFILTER_H
42
43#ifndef DX8_WRAPPER_H
44//#include "dx8wrapper.h"
45#endif
46
48{
49 MIP_LEVELS_ALL=0, // generate all mipmap levels down to 1x1 size
50 MIP_LEVELS_1, // no mipmapping at all (just one mip level)
61 MIP_LEVELS_MAX // This isn't to be used (use MIP_LEVELS_ALL instead), it is just an enum for creating static tables etc.
62};
63
64
65// NOTE: Since "texture wrapping" (NOT TEXTURE WRAP MODE - THIS IS
66// SOMETHING ELSE) is a global state that affects all texture stages,
67// and this class only affects its own stage, we will not worry about
68// it for now. Later (probably when we implement world-oriented
69// environment maps) we will consider where to put it.
70
71// This is legacy and should be phased out into wwshade shader states
72// keeping as an abstracted class for now to support this transition later
74{
75public:
76
85
92
98
99 TextureFilterClass(MipCountType mip_level_count);
100
101 void Apply(unsigned int stage);
102
103 // Filter and MIPmap settings:
104 FilterType Get_Min_Filter(void) const { return TextureMinFilter; }
105 FilterType Get_Mag_Filter(void) const { return TextureMagFilter; }
106 FilterType Get_Mip_Mapping(void) const { return MipMapFilter; }
107 void Set_Min_Filter(FilterType filter) { TextureMinFilter=filter; }
108 void Set_Mag_Filter(FilterType filter) { TextureMagFilter=filter; }
109 void Set_Mip_Mapping(FilterType mipmap);
110
111 // Texture address mode
112 TxtAddrMode Get_U_Addr_Mode(void) const { return UAddressMode; }
113 TxtAddrMode Get_V_Addr_Mode(void) const { return VAddressMode; }
114 void Set_U_Addr_Mode(TxtAddrMode mode) { UAddressMode=mode; }
115 void Set_V_Addr_Mode(TxtAddrMode mode) { VAddressMode=mode; }
116
117 // This needs to be called after device has been created
118 static void _Init_Filters(TextureFilterMode texture_filter);
119
123
124private:
125 // State not contained in the Direct3D texture object:
126 FilterType TextureMinFilter;
127 FilterType TextureMagFilter;
128 FilterType MipMapFilter;
129 TxtAddrMode UAddressMode;
130 TxtAddrMode VAddressMode;
131};
132
133#endif
void Apply(unsigned int stage)
Apply filters (legacy)
static void _Set_Default_Mip_Filter(FilterType filter)
Set default mip filter (legacy)
static void _Init_Filters(TextureFilterMode texture_filter)
Init filters (legacy)
static void _Set_Default_Min_Filter(FilterType filter)
Set default min filter (legacy)
void Set_Mip_Mapping(FilterType mipmap)
Set mip mapping filter (legacy)
static void _Set_Default_Mag_Filter(FilterType filter)
Set default mag filter (legacy)
void Set_Mag_Filter(FilterType filter)
void Set_Min_Filter(FilterType filter)
FilterType Get_Mip_Mapping(void) const
TxtAddrMode Get_U_Addr_Mode(void) const
void Set_V_Addr_Mode(TxtAddrMode mode)
TxtAddrMode Get_V_Addr_Mode(void) const
FilterType Get_Mag_Filter(void) const
FilterType Get_Min_Filter(void) const
TextureFilterClass(MipCountType mip_level_count)
void Set_U_Addr_Mode(TxtAddrMode mode)
MipCountType
@ MIP_LEVELS_3
@ MIP_LEVELS_12
@ MIP_LEVELS_11
@ MIP_LEVELS_ALL
@ MIP_LEVELS_6
@ MIP_LEVELS_10
@ MIP_LEVELS_5
@ MIP_LEVELS_4
@ MIP_LEVELS_2
@ MIP_LEVELS_MAX
@ MIP_LEVELS_8
@ MIP_LEVELS_1
@ MIP_LEVELS_7
unsigned char filter
Definition vchannel.cpp:272