w3dexp.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. ** Command & Conquer Generals(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. /* $Header: /Commando/Code/Tools/max2w3d/w3dexp.h 22 10/23/00 5:34p Greg_h $ */
  19. /***********************************************************************************************
  20. *** Confidential - Westwood Studios ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Commando Tools - W3D export *
  24. * *
  25. * $Archive:: /Commando/Code/Tools/max2w3d/w3dexp.h $*
  26. * *
  27. * $Author:: Greg_h $*
  28. * *
  29. * $Modtime:: 10/23/00 5:24p $*
  30. * *
  31. * $Revision:: 22 $*
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef W3DEXP_H
  37. #define W3DEXP_H
  38. #include "always.h"
  39. #include <Max.h>
  40. #include "dllmain.h"
  41. #include "hiersave.h"
  42. #include "w3dutil.h"
  43. #include "resource.h"
  44. class MeshConnectionsClass;
  45. class GeometryExportTaskClass;
  46. class W3dExportClass : public SceneExport
  47. {
  48. public:
  49. W3dExportClass() {};
  50. ~W3dExportClass() {};
  51. int ExtCount() { return 1; };
  52. const TCHAR * Ext(int n) { return Get_String(IDS_W3D_FILE_EXTEN); };
  53. const TCHAR * LongDesc() { return Get_String(IDS_W3D_LONG_DESCRIPTION); };
  54. const TCHAR * ShortDesc() { return Get_String(IDS_W3D_SHORT_DESCRIPTION); };
  55. const TCHAR * AuthorName() { return Get_String(IDS_AUTHOR_NAME); };
  56. const TCHAR * CopyrightMessage() { return Get_String(IDS_COPYRIGHT_NOTICE); };
  57. const TCHAR * OtherMessage1() { return _T(""); };
  58. const TCHAR * OtherMessage2() { return _T(""); };
  59. unsigned int Version() { return 100; };
  60. void ShowAbout(HWND hWnd) {};
  61. int DoExport(const TCHAR *name,ExpInterface *ei,Interface *i, BOOL suppressPrompts=FALSE, DWORD options=0); // Export file
  62. protected:
  63. void DoOriginBasedExport(char *rootname, ChunkSaveClass &csave);
  64. public:
  65. friend BOOL CALLBACK ExportOptionsDlgProc(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam);
  66. static char CurrentExportPath[_MAX_DRIVE + _MAX_DIR + 1]; // Used to communicate from the exporter to the dialog.
  67. char CurrentScenePath[_MAX_DRIVE + _MAX_DIR + 1]; // directory where the current .max file is stored
  68. private:
  69. ExpInterface * ExportInterface;
  70. Interface * MaxInterface;
  71. TimeValue CurTime;
  72. int FrameRate;
  73. W3dExportOptionsStruct ExportOptions;
  74. char HierarchyFilename[_MAX_PATH];
  75. int FixupType;
  76. INode * RootNode;
  77. INodeListClass * RootList;
  78. INodeListClass * OriginList;
  79. INodeListClass * DamageRootList;
  80. HierarchySaveClass * HierarchyTree;
  81. bool get_export_options(BOOL suppress_prompts = FALSE);
  82. INodeListClass * get_origin_list(void);
  83. INodeListClass * get_damage_root_list(void);
  84. HierarchySaveClass * get_hierarchy_tree(void);
  85. bool get_base_object_tm(Matrix3 &tm);
  86. bool Export_Hierarchy(char * name,ChunkSaveClass & csave,Progress_Meter_Class & meter,INode *root);
  87. bool Export_Animation(char * name,ChunkSaveClass & csave,Progress_Meter_Class & meter,INode *root);
  88. bool Export_Damage_Animations(char * name,ChunkSaveClass & csave,Progress_Meter_Class &meter,INode *damage_root);
  89. bool Export_Geometry(char * name,ChunkSaveClass & csave,Progress_Meter_Class & meter,INode *root=NULL, MeshConnectionsClass **out_connection=NULL);
  90. bool Export_HLod (char *name, const char *htree_name, ChunkSaveClass &csave, Progress_Meter_Class &meter, MeshConnectionsClass **connections, int lod_count);
  91. bool Export_Collection(const char * name,ChunkSaveClass & csave,DynamicVectorClass<GeometryExportTaskClass *> & objlist,INodeListClass & placeholder_list,INodeListClass & transform_node_list);
  92. void Start_Progress_Bar(void);
  93. void End_Progress_Bar(void);
  94. };
  95. #endif