Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
nullrobj.cpp
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/nullrobj.cpp $*
26 * *
27 * Author:: Greg Hjelstrom *
28 * *
29 * $Modtime:: 12/01/01 12:18p $*
30 * *
31 * $Revision:: 2 $*
32 * *
33 *---------------------------------------------------------------------------------------------*
34 * Functions: *
35 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
36
37
38#include "nullrobj.h"
39#include "chunkio.h"
40
41#include <string.h>
42
43
45
46
47
48
50{
51 strcpy(Name, name);
52}
53
55{
56 strcpy(Name, src.Name);
57}
58
60{
61 strcpy(Name, that.Name);
62
63 RenderObjClass::operator = (that); return *this;
64}
65
67{
68 return CLASSID_NULL;
69}
70
72{
73 return NEW_REF( Null3DObjClass, (*this));
74}
75
79
81{
82 sphere.Center.Set(0,0,0);
83 sphere.Radius = 0.1f;
84}
85
87{
88 box.Center.Set(0,0,0);
89 box.Extent.Set(0.1f,0.1f,0.1f);
90}
91
92/*
93** NullPrototypeClass
94*/
95
97{
98 // Note that the other members of the definition are uninitialized..
99 // So don't rely on them if the name is "NULL".
100 strcpy(Definition.Name, "NULL");
101}
102
107
108
109/*
110** NullLoaderClass
111*/
112
114{
116 cload.Read(&null,sizeof(null));
117 return W3DNEW NullPrototypeClass(null);
118}
#define W3DNEW
Definition always.h:109
Vector3 Center
Definition aabox.h:123
Vector3 Extent
Definition aabox.h:124
uint32 Read(void *buf, uint32 nbytes)
Definition chunkio.cpp:692
virtual RenderObjClass * Clone(void) const
Definition nullrobj.cpp:71
virtual void Get_Obj_Space_Bounding_Box(AABoxClass &box) const
Definition nullrobj.cpp:86
virtual void Render(RenderInfoClass &rinfo)
Definition nullrobj.cpp:76
Null3DObjClass & operator=(const Null3DObjClass &that)
Definition nullrobj.cpp:59
char Name[2 *W3D_NAME_LEN]
Definition nullrobj.h:68
virtual int Class_ID(void) const
Definition nullrobj.cpp:66
virtual void Get_Obj_Space_Bounding_Sphere(SphereClass &sphere) const
Definition nullrobj.cpp:80
Null3DObjClass(const char *name="NULL")
Definition nullrobj.cpp:49
virtual PrototypeClass * Load_W3D(ChunkLoadClass &cload)
Definition nullrobj.cpp:113
W3dNullObjectStruct Definition
Definition nullrobj.h:85
RenderObjClass(void)
Definition rendobj.cpp:170
RenderObjClass & operator=(const RenderObjClass &)
Definition rendobj.cpp:232
float Radius
Definition sphere.h:91
Vector3 Center
Definition sphere.h:90
WWINLINE void Set(float x, float y, float z)
Definition vector3.h:103
NullLoaderClass _NullLoader
Definition nullrobj.cpp:44
#define NEW_REF(C, P)
Definition refcount.h:62