Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
w3d_util.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/w3d_util.h $*
26 * *
27 * Author:: Greg Hjelstrom *
28 * *
29 * $Modtime:: 1/08/01 10:04a $*
30 * *
31 * $Revision:: 1 $*
32 * *
33 *---------------------------------------------------------------------------------------------*
34 * Functions: *
35 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
36
37
38#if defined(_MSC_VER)
39#pragma once
40#endif
41
42#ifndef W3D_UTIL_H
43#define W3D_UTIL_H
44
45#include "always.h"
46#include "w3d_file.h"
47
48class Vector3;
49class Vector4;
50class Quaternion;
51class ShaderClass;
52
53/*
54** These functions are just simple helpers which convert to and from the W3D file-format
55** structures and the equivalent runtime classes.
56*/
58{
59public:
60
61 static void Convert_Vector(const W3dVectorStruct & v,Vector3 * set);
62 static void Convert_Vector(const Vector3 & v,W3dVectorStruct * set);
63
64 static void Convert_Quaternion(const W3dQuaternionStruct & q,Quaternion * set);
65 static void Convert_Quaternion(const Quaternion & q,W3dQuaternionStruct * set);
66
67 static void Convert_Color(const W3dRGBStruct & rgb,Vector3 * set);
68 static void Convert_Color(const Vector3 & v,W3dRGBStruct * set);
69
70 static void Convert_Color(const W3dRGBAStruct & rgb,Vector4 * set);
71 static void Convert_Color(const Vector4 & v,W3dRGBAStruct * set);
72
73 static void Convert_Shader(const W3dShaderStruct & shader,ShaderClass * set);
74 static void Convert_Shader(const ShaderClass & shader,W3dShaderStruct * set);
75
76};
77
78#endif
79
80
static void Convert_Quaternion(const W3dQuaternionStruct &q, Quaternion *set)
Definition w3d_util.cpp:59
static void Convert_Vector(const W3dVectorStruct &v, Vector3 *set)
Definition w3d_util.cpp:45
static void Convert_Color(const W3dRGBStruct &rgb, Vector3 *set)
Definition w3d_util.cpp:75
static void Convert_Shader(const W3dShaderStruct &shader, ShaderClass *set)
Definition w3d_util.cpp:106
int q
Definition test1.cpp:94