Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
hlodsave.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 : Renegade / G *
24 * *
25 * $Archive:: /Commando/Code/Tools/max2w3d/hlodsave.h $*
26 * *
27 * $Author:: Greg_h $*
28 * *
29 * $Modtime:: 10/27/00 10:22a $*
30 * *
31 * $Revision:: 4 $*
32 * *
33 *---------------------------------------------------------------------------------------------*
34 * Functions: *
35 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
36
37
38#ifndef HLODSAVE_H
39#define HLODSAVE_H
40
41#include "always.h"
42
43#include <Max.h>
44#include <stdio.h>
45
46#include "w3d_file.h"
47#include "progress.h"
48#include "chunkio.h"
49#include "meshcon.h"
50
51
52class INodeListClass;
54
55
62{
63public:
64 HLodSaveClass (MeshConnectionsClass **connections, int lod_count, TimeValue CurTime,
65 char *name, const char *htree_name, Progress_Meter_Class &meter,
66 INodeListClass *origin_list);
67 ~HLodSaveClass (void);
68
69 bool Save (ChunkSaveClass &csave);
70
71
72protected:
73
74 /*
75 ** class HLodArrayEntry hold the HLOD tree that we will save out in the Save() method.
76 */
78 {
79 public:
83
84 HLodArrayEntry (int num_sub_objs = 0)
85 {
86 sub_obj = NULL;
88 Allocate_Sub_Objects(num_sub_objs);
89 }
90
92 {
93 if (sub_obj)
94 {
95 delete sub_obj;
96 sub_obj = NULL;
98 }
99 }
100
101 bool Allocate_Sub_Objects (int num)
102 {
103 if (num <= 0) return false;
104 num_sub_objects = 0;
106 if (!sub_obj) return false;
107 num_sub_objects = num;
108 return true;
109 }
110
111 bool operator == (const HLodArrayEntry & that) { return false; }
112 bool operator != (const HLodArrayEntry & that) { return !(*this == that); }
113 };
114
115 bool save_header (ChunkSaveClass &csave);
116 bool save_lod_arrays (ChunkSaveClass &csave);
118 bool save_proxy_array(ChunkSaveClass & csave);
119 bool save_sub_object_array(ChunkSaveClass & csave, const HLodArrayEntry & array);
120
125};
126
127
128
129#endif
#define NULL
Definition BaseType.h:92
Definition hlodsave.h:78
bool operator==(const HLodArrayEntry &that)
Definition hlodsave.h:111
bool operator!=(const HLodArrayEntry &that)
Definition hlodsave.h:112
~HLodArrayEntry(void)
Definition hlodsave.h:91
HLodArrayEntry(int num_sub_objs=0)
Definition hlodsave.h:84
bool Allocate_Sub_Objects(int num)
Definition hlodsave.h:101
W3dHLodSubObjectStruct * sub_obj
Definition hlodsave.h:81
int num_sub_objects
Definition hlodsave.h:82
W3dHLodArrayHeaderStruct header
Definition hlodsave.h:80
bool Save(ChunkSaveClass &csave)
Definition hlodsave.cpp:246
bool save_sub_object_array(ChunkSaveClass &csave, const HLodArrayEntry &array)
Definition hlodsave.cpp:400
bool save_lod_arrays(ChunkSaveClass &csave)
Definition hlodsave.cpp:312
W3dHLodHeaderStruct header
Definition hlodsave.h:121
HLodArrayEntry * lod_array
Definition hlodsave.h:122
bool save_header(ChunkSaveClass &csave)
Definition hlodsave.cpp:285
~HLodSaveClass(void)
Definition hlodsave.cpp:223
HLodArrayEntry aggregate_array
Definition hlodsave.h:123
bool save_aggregate_array(ChunkSaveClass &csave)
Definition hlodsave.cpp:343
HLodArrayEntry proxy_array
Definition hlodsave.h:124
bool save_proxy_array(ChunkSaveClass &csave)
Definition hlodsave.cpp:371
HLodSaveClass(MeshConnectionsClass **connections, int lod_count, TimeValue CurTime, char *name, const char *htree_name, Progress_Meter_Class &meter, INodeListClass *origin_list)
Definition hlodsave.cpp:99