EditorAssetMgr.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /*
  2. ** Command & Conquer Renegade(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. *** 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 ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : LevelEdit *
  23. * *
  24. * $Archive:: /Commando/Code/Tools/LevelEdit/EditorAssetMgr.h $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 1/29/02 10:33a $*
  29. * *
  30. * $Revision:: 15 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __LEVELEDITASSETMGR_H
  39. #define __LEVELEDITASSETMGR_H
  40. #include "AssetMgr.H"
  41. #include "FFactory.H"
  42. /////////////////////////////////////////////////////////////////////////////
  43. //
  44. // EditorFileFactoryClass
  45. //
  46. /////////////////////////////////////////////////////////////////////////////
  47. class EditorFileFactoryClass : public FileFactoryClass
  48. {
  49. public:
  50. ///////////////////////////////////////////////////
  51. // Public methods
  52. ///////////////////////////////////////////////////
  53. virtual FileClass * Get_File (char const *filename);
  54. virtual void Return_File (FileClass *file);
  55. //
  56. // Search path support
  57. //
  58. static void Add_Search_Path (const char *path) { SearchPathList.Add (path); }
  59. static DynamicVectorClass<StringClass> & Get_Search_Path (void) { return SearchPathList; }
  60. private:
  61. ///////////////////////////////////////////////////
  62. // Private data
  63. ///////////////////////////////////////////////////
  64. static DynamicVectorClass<StringClass> SearchPathList;
  65. };
  66. /////////////////////////////////////////////////////////////////////////////
  67. //
  68. // EditorAssetMgrClass
  69. //
  70. /////////////////////////////////////////////////////////////////////////////
  71. class EditorAssetMgrClass : public WW3DAssetManager
  72. {
  73. public:
  74. ///////////////////////////////////////////////////
  75. // Public constructors/destructors
  76. ///////////////////////////////////////////////////
  77. EditorAssetMgrClass (void);
  78. virtual ~EditorAssetMgrClass (void) {}
  79. ///////////////////////////////////////////////////
  80. // Public methods
  81. ///////////////////////////////////////////////////
  82. //
  83. // Base class overrides
  84. //
  85. virtual RenderObjClass * Create_Render_Obj (const char * name);
  86. virtual HAnimClass * Get_HAnim (const char * name);
  87. virtual HTreeClass * Get_HTree (const char * name);
  88. virtual TextureClass * Get_Texture (const char *filename, TextureClass::MipCountType mip_level_count=TextureClass::MIP_LEVELS_ALL,WW3DFormat texture_format=WW3D_FORMAT_UNKNOWN, bool allow_compression=true);
  89. //
  90. // INI methods
  91. //
  92. virtual class EditorINIClass *Get_INI (const char *filename);
  93. //
  94. // Asset managment
  95. //
  96. virtual void Reload_File (const char *filename);
  97. virtual void Load_Resource_Texture (const char *filename);
  98. //
  99. // Directory methods
  100. //
  101. void Set_Current_Directory (LPCTSTR path) { m_CurrentDir = path; ::SetCurrentDirectory (m_CurrentDir); }
  102. const char * Get_Current_Directory (void) { return m_CurrentDir; }
  103. //
  104. // Load data from any type of w3d file
  105. //
  106. virtual bool Load_3D_Assets (const char * filename);
  107. //
  108. // Texture caching overrides
  109. //
  110. virtual void Open_Texture_File_Cache(const char * /*prefix*/);
  111. virtual void Close_Texture_File_Cache();
  112. protected:
  113. ///////////////////////////////////////////////////
  114. // Protected methods
  115. ///////////////////////////////////////////////////
  116. virtual bool Determine_Real_Location (LPCTSTR filename, CString &real_location);
  117. virtual bool Is_File_Here (LPCTSTR full_path, bool get_from_vss);
  118. private:
  119. ///////////////////////////////////////////////////
  120. //
  121. // Private member data
  122. //
  123. CString m_CurrentDir;
  124. };
  125. #endif //__LEVELEDITASSETMGR_H