Richard Boegli's CnC_Generals_Zero_Hour Fork
WIP
This is documentation of Richard Boegil's Zero Hour Fork
Loading...
Searching...
No Matches
dazzlesave.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 : Max2W3D *
24
* *
25
* $Archive:: /Commando/Code/Tools/max2w3d/dazzlesave.cpp $*
26
* *
27
* Original Author:: Greg Hjelstrom *
28
* *
29
* $Author:: Greg_h $*
30
* *
31
* $Modtime:: 9/21/00 4:14p $*
32
* *
33
* $Revision:: 1 $*
34
* *
35
*---------------------------------------------------------------------------------------------*
36
* Functions: *
37
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
38
39
40
#include "
dazzlesave.h
"
41
#include "
w3d_file.h
"
42
#include "
util.h
"
43
#include "
w3dappdata.h
"
44
#include "
errclass.h
"
45
46
47
DazzleSaveClass::DazzleSaveClass
48
(
49
char
* mesh_name,
50
char
* container_name,
51
INode * inode,
52
Matrix3
& exportspace,
53
TimeValue curtime,
54
Progress_Meter_Class
& meter
55
)
56
{
57
assert(mesh_name !=
NULL
);
58
assert(container_name !=
NULL
);
59
60
/*
61
** Set up the render object name
62
*/
63
memset(&W3DName,0,
sizeof
(W3DName));
64
if
((container_name !=
NULL
) && (strlen(container_name) > 0)) {
65
strcpy(W3DName,container_name);
66
strcat(W3DName,
"."
);
67
}
68
strcat(W3DName,mesh_name);
69
70
/*
71
** Dig the dazzle-type out of the appropriate App-Data chunk on
72
** the INode.
73
*/
74
W3DDazzleAppDataStruct
* dazzle_data =
W3DDazzleAppDataStruct::Get_App_Data
(inode);
75
strncpy(DazzleType,dazzle_data->
DazzleType
,
sizeof
(DazzleType));
76
}
77
78
79
80
int
DazzleSaveClass::Write_To_File
(
ChunkSaveClass
& csave)
81
{
82
csave.
Begin_Chunk
(
W3D_CHUNK_DAZZLE
);
83
84
csave.
Begin_Chunk
(
W3D_CHUNK_DAZZLE_NAME
);
85
csave.
Write
(W3DName,strlen(W3DName) + 1);
86
csave.
End_Chunk
();
87
88
csave.
Begin_Chunk
(
W3D_CHUNK_DAZZLE_TYPENAME
);
89
csave.
Write
(DazzleType,strlen(DazzleType) + 1);
90
csave.
End_Chunk
();
91
92
csave.
End_Chunk
();
93
return
0;
94
}
95
96
97
NULL
#define NULL
Definition
BaseType.h:92
W3D_CHUNK_DAZZLE_NAME
@ W3D_CHUNK_DAZZLE_NAME
Definition
w3d_file.h:484
W3D_CHUNK_DAZZLE
@ W3D_CHUNK_DAZZLE
Definition
w3d_file.h:483
W3D_CHUNK_DAZZLE_TYPENAME
@ W3D_CHUNK_DAZZLE_TYPENAME
Definition
w3d_file.h:485
w3d_file.h
ChunkSaveClass
Definition
chunkio.h:137
ChunkSaveClass::Write
uint32 Write(const void *buf, uint32 nbytes)
Definition
chunkio.cpp:264
ChunkSaveClass::Begin_Chunk
bool Begin_Chunk(uint32 id)
Definition
chunkio.cpp:108
ChunkSaveClass::End_Chunk
bool End_Chunk()
Definition
chunkio.cpp:148
DazzleSaveClass::DazzleSaveClass
DazzleSaveClass(char *mesh_name, char *container_name, INode *inode, Matrix3 &exportspace, TimeValue curtime, Progress_Meter_Class &meter)
Definition
dazzlesave.cpp:48
DazzleSaveClass::Write_To_File
int Write_To_File(ChunkSaveClass &csave)
Definition
dazzlesave.cpp:80
Matrix3
Definition
WWmatrix3.h:74
Progress_Meter_Class
Definition
PROGRESS.H:44
dazzlesave.h
errclass.h
W3DDazzleAppDataStruct
Definition
w3dappdata.h:394
W3DDazzleAppDataStruct::DazzleType
char DazzleType[128]
Definition
w3dappdata.h:410
W3DDazzleAppDataStruct::Get_App_Data
static W3DDazzleAppDataStruct * Get_App_Data(INode *node, bool create_if_missing=true)
Definition
w3dappdata.cpp:292
util.h
w3dappdata.h
Code
Tools
WW3D
max2w3d
dazzlesave.cpp
Generated by
1.13.2