Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
agg_def.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/agg_def.cpp $*
26 * *
27 * Author:: Patrick Smith
28 * *
29 * $Modtime:: 4/05/01 10:21a $*
30 * *
31 * $Revision:: 5 $*
32 * *
33 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
34
35
36#include "agg_def.h"
37#include "htree.h"
38#include "w3derr.h"
39#include "chunkio.h"
40#include "wwdebug.h"
41#include "assetmgr.h"
42#include "matinfo.h"
43#include "texture.h"
44#include "wwstring.h"
45
46#include <windows.h>
47
48
50//
51// Local constants
52//
53const char * const EMPTY_STRING = "";
54
55
57//
58// Global variable initialization
59//
61
62
64//
65// AggregateDefClass
66//
68 : m_pName (NULL)
69{
70 // Set our member data to default settings
71 ::memset (&m_Info, 0, sizeof (m_Info));
72 ::memset (&m_MiscInfo, 0, sizeof (m_MiscInfo));
73 m_MiscInfo.OriginalClassID = RenderObjClass::CLASSID_HLOD;
74 return ;
75}
76
77
79//
80// AggregateDefClass
81//
83 : m_pName (NULL)
84{
85 // Set our member data to default settings
86 ::memset (&m_Info, 0, sizeof (m_Info));
87 ::memset (&m_MiscInfo, 0, sizeof (m_MiscInfo));
88 m_MiscInfo.OriginalClassID = RenderObjClass::CLASSID_HLOD;
89
90 // Invoke the assignment operator
91 (*this) = src;
92 return ;
93}
94
95
97//
98// AggregateDefClass
99//
101 : m_pName (NULL)
102{
103 // Set our member data to default settings
104 ::memset (&m_Info, 0, sizeof (m_Info));
105 ::memset (&m_MiscInfo, 0, sizeof (m_MiscInfo));
106 m_MiscInfo.OriginalClassID = RenderObjClass::CLASSID_HLOD;
107
108 Initialize (base_model);
109 return ;
110}
111
112
114//
115// ~AggregateDefClass
116//
118{
119 // Free the name buffer if necessary
120 if (m_pName != NULL) {
121
122 // free() is used because the buffer was allocated with ::_strdup().
123 ::free (m_pName);
124 m_pName = NULL;
125 }
126
128 return ;
129}
130
131
133//
134// operator=
135//
136const AggregateDefClass &
138{
139 int index;
140
141 // Free the name buffer if necessary
142 if (m_pName != NULL) {
143 ::free (m_pName);
144 m_pName = NULL;
145 }
146
147 // Start with a fresh set of data
149
150 // Copy the src object's name and info struct
151 Set_Name (src.Get_Name ());
152 ::memcpy (&m_Info, &src.m_Info, sizeof (m_Info));
153 ::memcpy (&m_MiscInfo, &src.m_MiscInfo, sizeof (m_MiscInfo));
154 m_Version = src.m_Version;
155
156 // Loop through all the entries in the src object's subobj list
157 for (index = 0; index < src.m_SubobjectList.Count (); index ++) {
158 W3dAggregateSubobjectStruct *pinfo = src.m_SubobjectList[index];
159 if (pinfo != NULL) {
160
161 // Copy the src object's info for this subobj
163 ::memcpy (new_info, pinfo, sizeof (W3dAggregateSubobjectStruct));
164
165 // Add this subobj to our list
166 m_SubobjectList.Add (new_info);
167 }
168 }
169
170 // Return a reference to ourselves
171 return *this;
172}
173
174
176//
177// Free_Subobject_List
178//
179void
181{
182 // Delete all the stucture pointers contained in the subobject list
183 for (int index = 0; index < m_SubobjectList.Count (); index ++) {
184 W3dAggregateSubobjectStruct *pinfo = m_SubobjectList[index];
185 if (pinfo) {
186 delete pinfo;
187 }
188 }
189
190 // Reset the lists contents
191 m_SubobjectList.Delete_All ();
192 return ;
193}
194
195
197//
198// Create
199//
202{
203 // Attempt to create an instance of the hierarchy
204 RenderObjClass *pmodel = Create_Render_Object (m_Info.BaseModelName);
205 if (pmodel != NULL) {
206
207 // Perform the aggregation
208 Attach_Subobjects (*pmodel);
209
210 // Let the new object know what its new name and base name are.
211 pmodel->Set_Name (m_pName);
212 pmodel->Set_Base_Model_Name (m_Info.BaseModelName);
214
215 } else {
216 WWDEBUG_SAY (("Unable to load aggregate %s.\r\n", m_Info.BaseModelName));
217 }
218
219 // Return a pointer to the new aggregate
220 return pmodel;
221}
222
223
225//
226// Find_Subobject
227//
230(
231 RenderObjClass &model,
232 const char mesh_path[MESH_PATH_ENTRIES][MESH_PATH_ENTRY_LEN],
233 const char bone_path[MESH_PATH_ENTRIES][MESH_PATH_ENTRY_LEN]
234)
235{
236 RenderObjClass *parent_model = &model;
237 parent_model->Add_Ref ();
238
239 // Loop through all the models in our "path" until we've either failed
240 // or found the exact mesh we were looking for...
241 for (int index = 1;
242 (mesh_path[index][0] != 0) && (parent_model != NULL);
243 index ++) {
244
245 // Look one level deeper into the subobject chain...
246 RenderObjClass *sub_obj = NULL;
247 if (bone_path[index][0] == 0) {
248 sub_obj = parent_model->Get_Sub_Object_By_Name (mesh_path[index]);
249 } else {
250
251 int bone_index = parent_model->Get_Bone_Index (bone_path[index]);
252 int subobj_count = parent_model->Get_Num_Sub_Objects_On_Bone (bone_index);
253
254 // Loop through all the subobjects on this bone
255 for (int subobj_index = 0; (subobj_index < subobj_count) && (sub_obj == NULL); subobj_index ++) {
256
257 // Is this the subobject we were looking for?
258 RenderObjClass *ptemp_obj = parent_model->Get_Sub_Object_On_Bone (subobj_index, bone_index);
259 if (::lstrcmpi (ptemp_obj->Get_Name (), mesh_path[index]) == 0) {
260 sub_obj = ptemp_obj;
261 } else {
262 REF_PTR_RELEASE (ptemp_obj);
263 }
264 }
265 }
266
267 REF_PTR_RELEASE (parent_model);
268
269 // The parent for the next iteration is the subobject on this one.
270 parent_model = sub_obj;
271 }
272
273 // Return a pointer to the subobject
274 return parent_model;
275}
276
277
279//
280// Attach_Subobjects
281//
282void
284{
285 // Now loop through all the subobjects and attach them to the appropriate bone
286 for (int index = 0; index < m_SubobjectList.Count (); index ++) {
287 W3dAggregateSubobjectStruct *psubobj_info = m_SubobjectList[index];
288 if (psubobj_info != NULL) {
289
290 // Now create this subobject and attach it to its bone.
291 RenderObjClass *prender_obj = Create_Render_Object (psubobj_info->SubobjectName);
292 if (prender_obj != NULL) {
293
294 // Attach this object to the requested bone
295 if (base_model.Add_Sub_Object_To_Bone (prender_obj, psubobj_info->BoneName) == false) {
296 WWDEBUG_SAY (("Unable to attach %s to %s.\r\n", psubobj_info->SubobjectName, psubobj_info->BoneName));
297 }
298
299 // Release our hold on this pointer
300 prender_obj->Release_Ref ();
301 } else {
302 WWDEBUG_SAY (("Unable to load aggregate subobject %s.\r\n", psubobj_info->SubobjectName));
303 }
304 }
305 }
306
307 return ;
308}
309
310
312//
313// Create_Render_Object
314//
317{
318 // Assume failure
319 RenderObjClass *prender_obj = NULL;
320
321 // Attempt to get an instance of the render object from the asset manager
322 prender_obj = WW3DAssetManager::Get_Instance()->Create_Render_Obj (passet_name);
323
324 // If we couldn't find the render object in the asset manager, then attempt to
325 // load it from file
326 if ((prender_obj == NULL) &&
327 Load_Assets (passet_name)) {
328
329 // It should be in the asset manager now, so attempt to get it again.
330 prender_obj = WW3DAssetManager::Get_Instance()->Create_Render_Obj (passet_name);
331 }
332
333 // Return a pointer to the render object
334 return prender_obj;
335}
336
337
339//
340// Load_Assets
341//
342bool
343AggregateDefClass::Load_Assets (const char *passet_name)
344{
345 // Assume failure
346 bool retval = false;
347
348 // Param OK?
349 if (passet_name != NULL) {
350
351 // Determine what the current working directory is
352 char path[MAX_PATH];
353 ::GetCurrentDirectory (sizeof (path), path);
354
355 // Ensure the path is directory delimited
356 if (path[::lstrlen(path)-1] != '\\') {
357 ::lstrcat (path, "\\");
358 }
359
360 // Assume the filename is simply the "asset name" + the w3d extension
361 ::lstrcat (path, passet_name);
362 ::lstrcat (path, ".w3d");
363
364 // If the file exists, then load it into the asset manager.
365 if (::GetFileAttributes (path) != 0xFFFFFFFF) {
367 }
368 }
369
370 // Return the true/false result code
371 return retval;
372}
373
374
376//
377// Initialize
378//
379void
381{
382 // Start with fresh lists
384
385 // Determine what the render objects original name was.
386 const char *orig_model_name = base_model.Get_Base_Model_Name ();
387 orig_model_name = (orig_model_name == NULL) ? base_model.Get_Name () : orig_model_name;
388
389 // Record information about this base model
390 ::lstrcpy (m_Info.BaseModelName, orig_model_name);
391 m_Info.SubobjectCount = 0;
392 m_MiscInfo.OriginalClassID = base_model.Class_ID ();
393 m_MiscInfo.Flags = 0;
394 m_MiscInfo.Flags |= base_model.Is_Sub_Objects_Match_LOD_Enabled () ? W3D_AGGREGATE_FORCE_SUB_OBJ_LOD : 0;
395
396
397 // Pass the aggregate name along
398 Set_Name (base_model.Get_Name ());
399
400 // Create a new instance of the model which we can use
401 // to compare with the supplied model and determine
402 // which 'bones-models' and textures are new.
403 RenderObjClass *pvanilla_model = (RenderObjClass *)Create_Render_Object (orig_model_name);
404
405 // Build lists of changes from the delta between the original model and the provided one
406 Build_Subobject_List (*pvanilla_model, base_model);
407
408 // Release the model if necessary
409 REF_PTR_RELEASE (pvanilla_model);
410 return ;
411}
412
413
414
416//
417// Build_Subobject_List
418//
419void
421(
422 RenderObjClass &original_model,
423 RenderObjClass &model
424)
425{
426 int index;
427
428 // Loop through all the bones in this render obj
429 int bone_count = model.Get_Num_Bones ();
430 for (int bone_index = 0; bone_index < bone_count; bone_index ++) {
431 const char *pbone_name = model.Get_Bone_Name (bone_index);
432
433 // Build a list of nodes that are contained in the vanilla model
434 DynamicVectorClass <RenderObjClass *> orig_node_list;
435 for (index = 0;
436 index < original_model.Get_Num_Sub_Objects_On_Bone (bone_index);
437 index ++) {
438 RenderObjClass *psubobj = original_model.Get_Sub_Object_On_Bone (index, bone_index);
439 if (psubobj != NULL) {
440 orig_node_list.Add (psubobj);
441 }
442 }
443
444 // Build a list of nodes that are contained in this bone
445 DynamicVectorClass <RenderObjClass *> node_list;
446 for (index = 0;
447 index < model.Get_Num_Sub_Objects_On_Bone (bone_index);
448 index ++) {
449 RenderObjClass *psubobj = model.Get_Sub_Object_On_Bone (index, bone_index);
450 if (psubobj != NULL) {
451 node_list.Add (psubobj);
452 }
453 }
454
455 int node_count = node_list.Count ();
456 if (node_count > 0) {
457
458 // Loop through the subobjects and add each one to our internal list
459 W3dAggregateSubobjectStruct subobj_info = { 0 };
460 for (int node_index = 0; node_index < node_count; node_index ++) {
461 RenderObjClass *psubobject = node_list[node_index];
462 WWASSERT (psubobject != NULL);
463
464 // Is this subobject new? (i.e. not in a 'vanilla' instance?)
465 const char *prototype_name = psubobject->Get_Name ();
466 if (psubobject != NULL &&
467 (Is_Object_In_List (prototype_name, orig_node_list) == false)) {
468
469 // Add this subobject to our list
470 ::lstrcpy (subobj_info.SubobjectName, prototype_name);
471 ::lstrcpy (subobj_info.BoneName, pbone_name);
472 Add_Subobject (subobj_info);
473 m_Info.SubobjectCount ++;
474
475 // Attach this render object to the 'original' model (this is done
476 // so we can do texture compares later)
477 RenderObjClass *prender_obj = WW3DAssetManager::Get_Instance ()->Create_Render_Obj (prototype_name);
478 ((RenderObjClass &)original_model).Add_Sub_Object_To_Bone (prender_obj, pbone_name);
479 REF_PTR_RELEASE (prender_obj);
480 }
481 }
482 }
483
484 // Free our hold on the render objs in the original node list
485 for (index = 0; index < orig_node_list.Count (); index ++) {
486 REF_PTR_RELEASE (orig_node_list[index]);
487 }
488 orig_node_list.Delete_All ();
489
490 // Free our hold on the render objs in the node list
491 for (index = 0; index < node_list.Count (); index ++) {
492 REF_PTR_RELEASE (node_list[index]);
493 }
494 node_list.Delete_All ();
495 }
496
497 return ;
498}
499
500
502//
503// Is_Object_In_List
504//
505bool
507(
508 const char *passet_name,
509 DynamicVectorClass <RenderObjClass *> &node_list
510)
511{
512 // Assume failure
513 bool retval = false;
514
515 // Loop through the nodes in the list until we've found the one
516 // were are looking for.
517 for (int node_index = 0; (node_index < node_list.Count ()) && (retval == false); node_index ++) {
518 RenderObjClass *prender_obj = node_list[node_index];
519
520 // Is this the render object we were looking for?
521 if (prender_obj != NULL &&
522 ::lstrcmpi (prender_obj->Get_Name (), passet_name) == 0) {
523 retval = true;
524 }
525 }
526
527 // Return the true/false result code
528 return retval;
529}
530
531
533//
534// Load
535//
538{
539 W3dTextureReplacerHeaderStruct header = { 0 };
540
541
542 while (chunk_load.Open_Chunk()) {
543
545
546 switch (chunk_load.Cur_Chunk_ID()) {
547
549 error = Read_Header(chunk_load);
550 break;
551
553 error = Read_Info(chunk_load);
554 break;
555
557 if (chunk_load.Read (&header, sizeof (header)) == sizeof (header)) {
558 if (header.ReplacedTexturesCount > 0) {
559 WWDEBUG_SAY(("Obsolete texture replacement chunk encountered in aggregate: %s\r\n",m_pName));
560 }
561 }
562 break;
563
565 error = Read_Class_Info(chunk_load);
566 break;
567
568 default:
569
570 // Unknown chunk.
571 break;
572 }
573 chunk_load.Close_Chunk();
574 if (error != WW3D_ERROR_OK) return (error);
575 }
576
577 return WW3D_ERROR_OK;
578}
579
580
582//
583// Read_Header
584//
587{
588 // Assume error
590
591 // Is this the header chunk?
592 W3dAggregateHeaderStruct header = { 0 };
593 if (chunk_load.Read (&header, sizeof (header)) == sizeof (header)) {
594
595 // Copy the name from the header structure
596 m_pName = ::_strdup (header.Name);
597 m_Version = header.Version;
598
599 // Success!
600 ret_val = WW3D_ERROR_OK;
601 }
602
603 // Return the WW3D_ERROR_TYPE return code
604 return ret_val;
605}
606
607
609//
610// Read_Info
611//
614{
615 // Assume error
617
618 // Read the chunk straight into our member structure
619 ::memset (&m_Info, 0, sizeof (m_Info));
620 if (chunk_load.Read (&m_Info, sizeof (m_Info)) == sizeof (m_Info)) {
621
622 // Success!
623 ret_val = WW3D_ERROR_OK;
624
625 // Read all the subobjects from the file
626 for (UINT isubobject = 0;
627 (isubobject < m_Info.SubobjectCount) && (ret_val == WW3D_ERROR_OK);
628 isubobject ++) {
629
630 // Read this subobject's definition from the file
631 ret_val = Read_Subobject (chunk_load);
632 }
633 }
634
635 // Return the WW3D_ERROR_TYPE return code
636 return ret_val;
637}
638
639
641//
642// Read_Subobject
643//
646{
647 // Assume error
649
650 // Read the subobject information from the file
651 W3dAggregateSubobjectStruct subobj_info = { 0 };
652 if (chunk_load.Read (&subobj_info, sizeof (subobj_info)) == sizeof (subobj_info)) {
653
654 // Add this subobject to our list
655 Add_Subobject (subobj_info);
656
657 // Success!
658 ret_val = WW3D_ERROR_OK;
659 }
660
661 // Return the WW3D_ERROR_TYPE return code
662 return ret_val;
663}
664
665
667//
668// Add_Subobject
669//
670void
672{
673 // Create a new structure and copy the contents of the src
675 ::lstrcpy (pnew_entry->SubobjectName, subobj_info.SubobjectName);
676 ::lstrcpy (pnew_entry->BoneName, subobj_info.BoneName);
677
678 // Add this new entry to the list
679 m_SubobjectList.Add (pnew_entry);
680 return ;
681}
682
683
685//
686// Read_Class_Info
687//
690{
691 // Assume error
693
694 // Read the chunk straight into our header structure
695 ::memset (&m_MiscInfo, 0, sizeof (m_MiscInfo));
696 if (chunk_load.Read (&m_MiscInfo, sizeof (m_MiscInfo)) == sizeof (m_MiscInfo)) {
697
698 // Success!
699 ret_val = WW3D_ERROR_OK;
700 }
701
702 // Return the WW3D_ERROR_TYPE return code
703 return ret_val;
704}
705
706
708//
709// Save
710//
713{
714 // Assume error
716
717 // Begin a chunk that identifies an aggregate
718 if (chunk_save.Begin_Chunk (W3D_CHUNK_AGGREGATE) == TRUE) {
719
720 // Attempt to save the different sections of the aggregate definition
721 if ((Save_Header (chunk_save) == WW3D_ERROR_OK) &&
722 (Save_Info (chunk_save) == WW3D_ERROR_OK) &&
723 (Save_Class_Info (chunk_save) == WW3D_ERROR_OK)) {
724
725 // Success!
726 ret_val = WW3D_ERROR_OK;
727 }
728
729 // Close the aggregate chunk
730 chunk_save.End_Chunk ();
731 }
732
733 // Return the WW3D_ERROR_TYPE return code
734 return ret_val;
735}
736
737
739//
740// Save_Header
741//
744{
745 // Assume error
747
748 // Begin a chunk that identifies the aggregate
749 if (chunk_save.Begin_Chunk (W3D_CHUNK_AGGREGATE_HEADER) == TRUE) {
750
751 // Fill the header structure
752 W3dAggregateHeaderStruct header = { 0 };
754 ::lstrcpyn (header.Name, m_pName, sizeof (header.Name));
755 header.Name[sizeof (header.Name) - 1] = 0;
756
757 // Write the header out to the chunk
758 if (chunk_save.Write (&header, sizeof (header)) == sizeof (header)) {
759 // Success!
760 ret_val = WW3D_ERROR_OK;
761 }
762
763 // End the header chunk
764 chunk_save.End_Chunk ();
765 }
766
767 // Return the WW3D_ERROR_TYPE return code
768 return ret_val;
769}
770
771
773//
774// Save_Info
775//
778{
779 // Assume error
781
782 // Begin a chunk that identifies the aggregate settings
783 if (chunk_save.Begin_Chunk (W3D_CHUNK_AGGREGATE_INFO) == TRUE) {
784
785 // Write the settings structure out to the chunk
786 if (chunk_save.Write (&m_Info, sizeof (m_Info)) == sizeof (m_Info)) {
787 // Success!
788 ret_val = WW3D_ERROR_OK;
789
790 // Write all the subobjects to the file
791 for (int isubobject = 0;
792 (isubobject < m_SubobjectList.Count ()) && (ret_val == WW3D_ERROR_OK);
793 isubobject ++) {
794
795 // Write this object to the file
796 ret_val = Save_Subobject (chunk_save, m_SubobjectList[isubobject]);
797 }
798 }
799
800 // End the settings chunk
801 chunk_save.End_Chunk ();
802 }
803
804 // Return the WW3D_ERROR_TYPE return code
805 return ret_val;
806}
807
808
810//
811// Save_Subobject
812//
815(
816 ChunkSaveClass &chunk_save,
818)
819{
820 // Assume error
822
823 // Write the subobj structure out to the chunk
824 if (chunk_save.Write (psubobject, sizeof (W3dAggregateSubobjectStruct)) == sizeof (W3dAggregateSubobjectStruct)) {
825
826 // Success!
827 ret_val = WW3D_ERROR_OK;
828 }
829
830 // Return the WW3D_ERROR_TYPE return code
831 return ret_val;
832}
833
834
836//
837// Save_Class_Info
838//
841{
842 // Assume error
844
845 // Begin a chunk that identifies the texture replacer header
846 if (chunk_save.Begin_Chunk (W3D_CHUNK_AGGREGATE_CLASS_INFO) == TRUE) {
847
848 // Write the class information structure out to the chunk
849 if (chunk_save.Write (&m_MiscInfo, sizeof (m_MiscInfo)) == sizeof (m_MiscInfo)) {
850
851 // Success!
852 ret_val = WW3D_ERROR_OK;
853 }
854
855 // End the class info chunk
856 chunk_save.End_Chunk ();
857 }
858
859 // Return the WW3D_ERROR_TYPE return code
860 return ret_val;
861}
862
863
865//
866// Load
867//
870{
871 // Assume failure
872 AggregatePrototypeClass *pprototype = NULL;
873
874 // Create a definition object
876 if (pdefinition != NULL) {
877
878 // Ask the definition object to load the aggregate data
879 if (pdefinition->Load_W3D (chunk_load) != WW3D_ERROR_OK) {
880
881 // Error! Free the definition
882 delete pdefinition;
883 pdefinition = NULL;
884 } else {
885
886 // Success! Create a prototype from the definition
887 pprototype = W3DNEW AggregatePrototypeClass (pdefinition);
888 }
889 }
890
891 // Return a pointer to the prototype
892 return pprototype;
893}
894
#define NULL
Definition BaseType.h:92
#define TRUE
Definition BaseType.h:109
#define WWASSERT
#define W3D_CURRENT_AGGREGATE_VERSION
Definition w3d_file.h:1962
const int MESH_PATH_ENTRIES
Definition w3d_file.h:1963
const int W3D_AGGREGATE_FORCE_SUB_OBJ_LOD
Definition w3d_file.h:2004
const int MESH_PATH_ENTRY_LEN
Definition w3d_file.h:1964
@ W3D_CHUNK_AGGREGATE_INFO
Definition w3d_file.h:461
@ W3D_CHUNK_TEXTURE_REPLACER_INFO
Definition w3d_file.h:462
@ W3D_CHUNK_AGGREGATE
Definition w3d_file.h:459
@ W3D_CHUNK_AGGREGATE_CLASS_INFO
Definition w3d_file.h:463
@ W3D_CHUNK_AGGREGATE_HEADER
Definition w3d_file.h:460
#define W3DNEW
Definition always.h:109
unsigned int UINT
Definition bittype.h:63
const char *const EMPTY_STRING
Definition agg_def.cpp:53
AggregateLoaderClass _AggregateLoader
Definition agg_def.cpp:60
const AggregateDefClass & operator=(const AggregateDefClass &src)
Definition agg_def.cpp:137
virtual WW3DErrorType Read_Header(ChunkLoadClass &chunk_load)
Definition agg_def.cpp:586
virtual WW3DErrorType Save_Class_Info(ChunkSaveClass &chunk_save)
Definition agg_def.cpp:840
virtual RenderObjClass * Create_Render_Object(const char *passet_name)
Definition agg_def.cpp:316
virtual WW3DErrorType Save_Subobject(ChunkSaveClass &chunk_save, W3dAggregateSubobjectStruct *psubobject)
Definition agg_def.cpp:815
const char * Get_Name(void) const
Definition agg_def.h:112
virtual void Attach_Subobjects(RenderObjClass &base_model)
Definition agg_def.cpp:283
virtual void Free_Subobject_List(void)
Definition agg_def.cpp:180
virtual bool Load_Assets(const char *asset_name)
Definition agg_def.cpp:343
virtual void Add_Subobject(const W3dAggregateSubobjectStruct &subobj_info)
Definition agg_def.cpp:671
virtual void Build_Subobject_List(RenderObjClass &original_model, RenderObjClass &model)
Definition agg_def.cpp:421
virtual WW3DErrorType Read_Class_Info(ChunkLoadClass &chunk_load)
Definition agg_def.cpp:689
virtual WW3DErrorType Save_Header(ChunkSaveClass &chunk_save)
Definition agg_def.cpp:743
AggregateDefClass(void)
Definition agg_def.cpp:67
void Set_Name(const char *pname)
Definition agg_def.h:113
void Initialize(RenderObjClass &base_model)
Definition agg_def.cpp:380
virtual RenderObjClass * Find_Subobject(RenderObjClass &model, const char mesh_path[MESH_PATH_ENTRIES][MESH_PATH_ENTRY_LEN], const char bone_path[MESH_PATH_ENTRIES][MESH_PATH_ENTRY_LEN])
Definition agg_def.cpp:230
virtual WW3DErrorType Load_W3D(ChunkLoadClass &chunk_load)
Definition agg_def.cpp:537
virtual ~AggregateDefClass(void)
Definition agg_def.cpp:117
virtual WW3DErrorType Save_Info(ChunkSaveClass &chunk_save)
Definition agg_def.cpp:777
virtual bool Is_Object_In_List(const char *passet_name, DynamicVectorClass< RenderObjClass * > &node_list)
Definition agg_def.cpp:507
virtual WW3DErrorType Save_W3D(ChunkSaveClass &chunk_save)
Definition agg_def.cpp:712
RenderObjClass * Create(void)
Definition agg_def.cpp:201
virtual WW3DErrorType Read_Info(ChunkLoadClass &chunk_load)
Definition agg_def.cpp:613
virtual WW3DErrorType Read_Subobject(ChunkLoadClass &chunk_load)
Definition agg_def.cpp:645
virtual PrototypeClass * Load_W3D(ChunkLoadClass &chunk_load)
Definition agg_def.cpp:869
bool Close_Chunk()
Definition chunkio.cpp:448
uint32 Cur_Chunk_ID()
Definition chunkio.cpp:484
uint32 Read(void *buf, uint32 nbytes)
Definition chunkio.cpp:692
bool Open_Chunk()
Definition chunkio.cpp:412
uint32 Write(const void *buf, uint32 nbytes)
Definition chunkio.cpp:264
bool Begin_Chunk(uint32 id)
Definition chunkio.cpp:108
bool End_Chunk()
Definition chunkio.cpp:148
void Delete_All(void)
Definition Vector.H:892
int Count(void) const
Definition Vector.H:507
bool Add(T const &object)
Definition Vector.H:671
WWINLINE void Release_Ref(void) const
Definition refcount.h:146
void Add_Ref(void) const
Definition refcount.cpp:171
virtual RenderObjClass * Get_Sub_Object_On_Bone(int index, int boneindex) const
Definition rendobj.h:316
virtual int Get_Num_Sub_Objects_On_Bone(int boneindex) const
Definition rendobj.h:315
int Is_Sub_Objects_Match_LOD_Enabled(void)
Definition rendobj.h:492
virtual void Set_Name(const char *name)
Definition rendobj.h:251
virtual void Set_Base_Model_Name(const char *name)
Definition rendobj.h:253
virtual const char * Get_Base_Model_Name(void) const
Definition rendobj.h:252
virtual int Add_Sub_Object_To_Bone(RenderObjClass *subobj, int bone_index)
Definition rendobj.h:319
void Set_Sub_Objects_Match_LOD(int onoff)
Definition rendobj.h:491
virtual int Get_Num_Bones(void)
Definition rendobj.h:352
virtual int Class_ID(void) const
Definition rendobj.h:249
virtual const char * Get_Bone_Name(int bone_index)
Definition rendobj.h:353
virtual const char * Get_Name(void) const
Definition rendobj.h:250
virtual RenderObjClass * Get_Sub_Object_By_Name(const char *name, int *index=NULL) const
Definition rendobj.cpp:527
virtual int Get_Bone_Index(const char *bonename)
Definition rendobj.h:354
virtual bool Load_3D_Assets(const char *filename)
Definition assetmgr.cpp:631
virtual RenderObjClass * Create_Render_Obj(const char *name)
Definition assetmgr.cpp:799
static WW3DAssetManager * Get_Instance(void)
Definition assetmgr.h:205
else return(RetVal)
#define REF_PTR_RELEASE(x)
Definition refcount.h:80
char Name[W3D_NAME_LEN]
Definition w3d_file.h:1969
char SubobjectName[W3D_NAME_LEN *2]
Definition w3d_file.h:1980
char BoneName[W3D_NAME_LEN *2]
Definition w3d_file.h:1981
WW3DErrorType
Definition w3derr.h:51
@ WW3D_ERROR_LOAD_FAILED
Definition w3derr.h:54
@ WW3D_ERROR_OK
Definition w3derr.h:52
@ WW3D_ERROR_SAVE_FAILED
Definition w3derr.h:55
#define WWDEBUG_SAY(x)
Definition wwdebug.h:114