Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
rddesc.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:: /Commando/Code/ww3d2/rddesc.h $*
26 * *
27 * $Author:: Jani_p $*
28 * *
29 * $Modtime:: 12/04/01 5:20p $*
30 * *
31 * $Revision:: 6 $*
32 * *
33 *---------------------------------------------------------------------------------------------*
34 * Functions: *
35 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
36
37
38#if defined(_MSC_VER)
39#pragma once
40#endif
41
42#ifndef RDDESC_H
43#define RDDESC_H
44
45#include "vector.h"
46#include "wwstring.h"
47#include <d3d8types.h>
48#include <d3d8caps.h>
49
51{
52public:
54 ResolutionDescClass(int w,int h,int bits) : Width(w), Height(h), BitDepth(bits) { }
55 bool operator == (const ResolutionDescClass & src) { return ((Width==src.Width) && (Height==src.Height) && (BitDepth==src.BitDepth)); }
56 bool operator != (const ResolutionDescClass & src) { return ((Width!=src.Width) || (Height!=src.Height) || (BitDepth!=src.BitDepth)); }
57
58 int Width;
59 int Height;
62};
63
64
66{
67
68public:
69
70 RenderDeviceDescClass(void) : DeviceName(NULL), DeviceVendor(NULL), DevicePlatform(NULL),
71 DriverName(NULL), DriverVendor(NULL), DriverVersion(NULL),
72 HardwareName(NULL), HardwareVendor(NULL), HardwareChipset(NULL)
73 {
74 }
75
77 {
78 }
79
81 {
82 set_device_name(src.Get_Device_Name());
83 set_device_vendor(src.Get_Device_Vendor());
84 set_device_platform(src.Get_Device_Platform());
85 set_driver_name(src.Get_Driver_Name());
86 set_driver_vendor(src.Get_Driver_Vendor());
87 set_driver_version(src.Get_Driver_Version());
88 set_hardware_name(src.Get_Hardware_Name());
89 set_hardware_vendor(src.Get_Hardware_Vendor());
90 set_hardware_chipset(src.Get_Hardware_Chipset());
91 Caps=src.Caps;
92 AdapterIdentifier=src.AdapterIdentifier;
93 ResArray = src.ResArray;
94 return *this;
95 }
96
97 bool operator == (const RenderDeviceDescClass & /*src*/) { return false; }
98 bool operator != (const RenderDeviceDescClass & /*src*/) { return true; }
99
100 const char * Get_Device_Name() const { return DeviceName; }
101 const char * Get_Device_Vendor() const { return DeviceVendor; }
102 const char * Get_Device_Platform() const { return DevicePlatform; }
103
104 const char * Get_Driver_Name() const { return DriverName; }
105 const char * Get_Driver_Vendor() const { return DriverVendor; }
106 const char * Get_Driver_Version() const { return DriverVersion; }
107
108 const char * Get_Hardware_Name() const { return HardwareName; }
109 const char * Get_Hardware_Vendor() const { return HardwareVendor; }
110 const char * Get_Hardware_Chipset() const { return HardwareChipset; }
111
112 const DynamicVectorClass<ResolutionDescClass> & Enumerate_Resolutions(void) const { return ResArray; }
113 const D3DCAPS8& Get_Caps() const { return Caps; }
114 const D3DADAPTER_IDENTIFIER8& Get_Adapter_Identifier() const { return AdapterIdentifier; }
115
116private:
117
118 void set_device_name(const char * name) { DeviceName=name; }
119 void set_device_vendor(const char * name) { DeviceVendor=name; }
120 void set_device_platform(const char * name) { DevicePlatform=name; }
121 void set_driver_name(const char * name) { DriverName=name; }
122 void set_driver_vendor(const char * name) { DriverVendor=name; }
123 void set_driver_version(const char * name) { DriverVersion=name; }
124 void set_hardware_name(const char * name) { HardwareName=name; }
125 void set_hardware_vendor(const char * name) { HardwareVendor=name; }
126 void set_hardware_chipset(const char * name) { HardwareChipset=name; }
127
128 void reset_resolution_list(void) { ResArray.Delete_All(); }
129 void add_resolution(int w,int h,int bits);
130
131 StringClass DeviceName;
132 StringClass DeviceVendor;
133 StringClass DevicePlatform;
134
135 StringClass DriverName;
136 StringClass DriverVendor;
137 StringClass DriverVersion;
138
139 StringClass HardwareName;
140 StringClass HardwareVendor;
141 StringClass HardwareChipset;
142
143 D3DCAPS8 Caps;
144 D3DADAPTER_IDENTIFIER8 AdapterIdentifier;
145
146 DynamicVectorClass<ResolutionDescClass> ResArray;
147
148 friend class WW3D;
149 friend class DX8Wrapper;
150};
151
152
153inline void RenderDeviceDescClass::add_resolution(int w,int h,int bits)
154{
155 bool found = false;
156 for (int i=0; i<ResArray.Count(); i++) {
157 if ( (ResArray[i].Width == w) &&
158 (ResArray[i].Height == h) &&
159 (ResArray[i].BitDepth == bits))
160 {
161 found = true;
162 }
163 }
164
165 if (!found) {
166 ResArray.Add(ResolutionDescClass(w,h,bits));
167 }
168}
169
170
171#endif
172
#define NULL
Definition BaseType.h:92
int Count(void) const
Definition Vector.H:507
const DynamicVectorClass< ResolutionDescClass > & Enumerate_Resolutions(void) const
Definition rddesc.h:112
const D3DADAPTER_IDENTIFIER8 & Get_Adapter_Identifier() const
Definition rddesc.h:114
const char * Get_Driver_Vendor() const
Definition rddesc.h:105
bool operator!=(const RenderDeviceDescClass &)
Definition rddesc.h:98
RenderDeviceDescClass & operator=(const RenderDeviceDescClass &src)
Definition rddesc.h:80
const char * Get_Driver_Version() const
Definition rddesc.h:106
const D3DCAPS8 & Get_Caps() const
Definition rddesc.h:113
RenderDeviceDescClass(void)
Definition rddesc.h:70
const char * Get_Device_Vendor() const
Definition rddesc.h:101
friend class DX8Wrapper
Definition rddesc.h:149
~RenderDeviceDescClass(void)
Definition rddesc.h:76
const char * Get_Hardware_Chipset() const
Definition rddesc.h:110
const char * Get_Hardware_Name() const
Definition rddesc.h:108
const char * Get_Device_Platform() const
Definition rddesc.h:102
bool operator==(const RenderDeviceDescClass &)
Definition rddesc.h:97
const char * Get_Device_Name() const
Definition rddesc.h:100
friend class WW3D
Definition rddesc.h:148
const char * Get_Hardware_Vendor() const
Definition rddesc.h:109
const char * Get_Driver_Name() const
Definition rddesc.h:104
ResolutionDescClass(int w, int h, int bits)
Definition rddesc.h:54
bool operator==(const ResolutionDescClass &src)
Definition rddesc.h:55
ResolutionDescClass(void)
Definition rddesc.h:53
bool operator!=(const ResolutionDescClass &src)
Definition rddesc.h:56