imap/loader.h
Go to the documentation of this file.00001 /* 00002 The Crystal Space geometry loader interface 00003 Copyright (C) 2000 by Andrew Zabolotny <bit@eltech.ru> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 */ 00019 00020 #ifndef __CS_IMAP_PARSER_H__ 00021 #define __CS_IMAP_PARSER_H__ 00022 00028 #include "csutil/scf_interface.h" 00029 00030 #include "iengine/region.h" 00031 #include "igraphic/image.h" 00032 #include "ivideo/txtmgr.h" 00033 #include "imap/streamsource.h" 00034 00035 #include "csutil/deprecated_warn_off.h" 00036 00037 struct iCollection; 00038 struct iDocumentNode; 00039 struct iImage; 00040 struct iLight; 00041 struct iMaterialWrapper; 00042 struct iMeshWrapper; 00043 struct iMeshFactoryWrapper; 00044 struct iSector; 00045 struct iShader; 00046 struct iTextureHandle; 00047 struct iTextureManager; 00048 struct iTextureWrapper; 00049 struct iSndSysData; 00050 struct iSndSysWrapper; 00051 struct iSndSysStream; 00052 00053 // The keep type flags for collections. 00054 #define KEEP_ALL 0 00055 #define KEEP_USED 1 00056 00062 struct iMissingLoaderData : public virtual iBase 00063 { 00064 SCF_INTERFACE (iMissingLoaderData, 1, 0, 0); 00065 00072 virtual iMaterialWrapper* MissingMaterial (const char* name, 00073 const char* filename) = 0; 00074 00081 virtual iTextureWrapper* MissingTexture (const char* name, 00082 const char* filename) = 0; 00083 00090 virtual iShader* MissingShader (const char* name) = 0; 00091 00098 virtual iMeshFactoryWrapper* MissingFactory (const char* name) = 0; 00099 00106 virtual iMeshWrapper* MissingMesh (const char* name) = 0; 00107 00114 virtual iSector* MissingSector (const char* name) = 0; 00115 00122 virtual iLight* MissingLight (const char* name) = 0; 00123 }; 00124 00128 struct csLoadResult 00129 { 00131 bool success; 00145 iBase* result; 00146 }; 00147 00151 struct iLoader : public virtual iBase 00152 { 00153 SCF_INTERFACE (iLoader, 4, 0, 0); 00154 00156 00163 virtual csPtr<iImage> LoadImage (const char* Filename, 00164 int Format = CS_IMGFMT_INVALID) = 0; 00177 virtual csPtr<iTextureHandle> LoadTexture (const char* Filename, 00178 int Flags = CS_TEXTURE_3D, iTextureManager *tm = 0, 00179 csRef<iImage>* image=0) = 0; 00180 00182 virtual csPtr<iSndSysData> LoadSoundSysData (const char *fname) = 0; 00183 00190 virtual csPtr<iSndSysStream> LoadSoundStream (const char *fname, 00191 int mode3d) = 0; 00192 00199 virtual iSndSysWrapper* LoadSoundWrapper (const char *name, 00200 const char *fname) = 0; 00201 00209 virtual csPtr<iImage> LoadImage (iDataBuffer* buf, 00210 int Format = CS_IMGFMT_INVALID) = 0; 00224 virtual csPtr<iTextureHandle> LoadTexture (iDataBuffer* buf, 00225 int Flags = CS_TEXTURE_3D, iTextureManager *tm = 0, 00226 csRef<iImage>* image=0) = 0; 00250 virtual iTextureWrapper* LoadTexture (const char *Name, 00251 iDataBuffer* buf, 00252 int Flags = CS_TEXTURE_3D, iTextureManager *tm = 0, 00253 bool reg = true, bool create_material = true, 00254 bool free_image = true) = 0; 00255 00261 virtual csPtr<iMeshFactoryWrapper> LoadMeshObjectFactory ( 00262 const char* fname, iStreamSource* ssource = 0) = 0; 00269 virtual csPtr<iMeshWrapper> LoadMeshObject (const char* fname, 00270 iStreamSource* ssource = 0) = 0; 00271 00275 virtual csRef<iShader> LoadShader (const char* filename, bool registerShader = true) = 0; 00276 00278 00303 virtual iTextureWrapper* LoadTexture (const char *Name, 00304 const char *FileName, int Flags = CS_TEXTURE_3D, iTextureManager *tm = 0, 00305 bool reg = true, bool create_material = true, bool free_image = true, 00306 iCollection* Collection = 0, uint keepFlags = KEEP_ALL) = 0; 00307 CS_DEPRECATED_METHOD_MSG("Regions are deprecated. Use Collections instead.") 00308 virtual iTextureWrapper* LoadTexture (const char *Name, 00309 const char *FileName, int Flags, iTextureManager *tm, 00310 bool reg, bool create_material, bool free_image, 00311 iRegion* region) = 0; 00312 /* Hack to ensure source compatibility when a 0 collection/region is used. 00313 * Remove with region variant. */ 00314 CS_FORCEINLINE iTextureWrapper* LoadTexture (const char *Name, 00315 const char *FileName, int Flags, iTextureManager *tm, 00316 bool reg, bool create_material, bool free_image, 00317 int dummy) 00318 { 00319 return LoadTexture (Name, FileName, Flags, tm, reg, create_material, 00320 free_image, (iCollection*)0); 00321 } 00323 00325 00362 virtual bool LoadMapFile (const char* filename, bool clearEngine = true, 00363 iCollection* collection = 0, bool curRegOnly = true, 00364 bool checkDupes = false, iStreamSource* ssource = 0, 00365 iMissingLoaderData* missingdata = 0, uint keepFlags = KEEP_ALL) = 0; 00366 CS_DEPRECATED_METHOD_MSG("Regions are deprecated. Use Collections instead.") 00367 virtual bool LoadMapFile (const char* filename, bool clearEngine, 00368 iRegion* region, bool curRegOnly = true, 00369 bool checkDupes = false, iStreamSource* ssource = 0, 00370 iMissingLoaderData* missingdata = 0) = 0; 00371 /* Hack to ensure source compatibility when a 0 collection/region is used. 00372 * Remove with region variant. */ 00373 CS_FORCEINLINE bool LoadMapFile (const char* filename, bool clearEngine, 00374 int dummy, bool curRegOnly = true, 00375 bool checkDupes = false, iStreamSource* ssource = 0, 00376 iMissingLoaderData* missingdata = 0, uint keepFlags = KEEP_ALL) 00377 { 00378 return LoadMapFile (filename, clearEngine, (iCollection*)0, curRegOnly, 00379 checkDupes, ssource, missingdata, keepFlags); 00380 } 00382 00384 00420 virtual bool LoadMap (iDocumentNode* world_node, bool clearEngine = true, 00421 iCollection* collection = 0, bool curRegOnly = true, 00422 bool checkDupes = false, iStreamSource* ssource = 0, 00423 iMissingLoaderData* missingdata = 0, uint keepFlags = KEEP_ALL) = 0; 00424 CS_DEPRECATED_METHOD_MSG("Regions are deprecated. Use Collections instead.") 00425 virtual bool LoadMap (iDocumentNode* world_node, bool clearEngine, 00426 iRegion* region, bool curRegOnly = true, 00427 bool checkDupes = false, iStreamSource* ssource = 0, 00428 iMissingLoaderData* missingdata = 0) = 0; 00429 /* Hack to ensure source compatibility when a 0 collection/region is used. 00430 * Remove with region variant. */ 00431 CS_FORCEINLINE bool LoadMap (iDocumentNode* world_node, bool clearEngine, 00432 int dummy, bool curRegOnly = true, 00433 bool checkDupes = false, iStreamSource* ssource = 0, 00434 iMissingLoaderData* missingdata = 0) 00435 { 00436 return LoadMap (world_node, clearEngine, (iCollection*)0, curRegOnly, 00437 checkDupes, ssource, missingdata); 00438 } 00440 00442 00464 virtual bool LoadLibraryFile (const char* filename, iCollection* collection = 0, 00465 bool searchCollectionOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00466 iMissingLoaderData* missingdata = 0, uint keepFlags = KEEP_ALL) = 0; 00467 CS_DEPRECATED_METHOD_MSG("Regions are deprecated. Use Collections instead.") 00468 virtual bool LoadLibraryFile (const char* filename, iRegion* region, 00469 bool searchregionOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00470 iMissingLoaderData* missingdata = 0) = 0; 00471 /* Hack to ensure source compatibility when a 0 collection/region is used. 00472 * Remove with region variant. */ 00473 CS_FORCEINLINE bool LoadLibraryFile (const char* filename, int dummy, 00474 bool searchregionOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00475 iMissingLoaderData* missingdata = 0) 00476 { 00477 return LoadLibraryFile (filename, (iCollection*)0, searchregionOnly, 00478 checkDupes, ssource, missingdata); 00479 } 00481 00483 00505 virtual bool LoadLibrary (iDocumentNode* lib_node, iCollection* collection = 0, 00506 bool searchCollectionOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00507 iMissingLoaderData* missingdata = 0, uint keepFlags = KEEP_ALL) = 0; 00508 CS_DEPRECATED_METHOD_MSG("Regions are deprecated. Use Collections instead.") 00509 virtual bool LoadLibrary (iDocumentNode* lib_node, iRegion* region, 00510 bool searchRegionOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00511 iMissingLoaderData* missingdata = 0) = 0; 00512 /* Hack to ensure source compatibility when a 0 collection/region is used. 00513 * Remove with region variant. */ 00514 CS_FORCEINLINE bool LoadLibrary (iDocumentNode* lib_node, int dummy, 00515 bool searchRegionOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00516 iMissingLoaderData* missingdata = 0) 00517 { 00518 return LoadLibrary (lib_node, (iCollection*)0, searchRegionOnly, 00519 checkDupes, ssource, missingdata); 00520 } 00521 //@) 00522 00524 00570 virtual csLoadResult Load (const char* fname, iCollection* collection = 0, 00571 bool searchCollectionOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00572 const char* override_name = 0, iMissingLoaderData* missingdata = 0, 00573 uint keepFlags = KEEP_ALL) = 0; 00574 CS_DEPRECATED_METHOD_MSG("Regions are deprecated. Use Collections instead.") 00575 virtual csLoadResult Load (const char* fname, iRegion* region, 00576 bool searchRegionOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00577 const char* override_name = 0, iMissingLoaderData* missingdata = 0) = 0; 00578 /* Hack to ensure source compatibility when a 0 collection/region is used. 00579 * Remove with region variant. */ 00580 CS_FORCEINLINE csLoadResult Load (const char* fname, int dummy, 00581 bool searchRegionOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00582 const char* override_name = 0, iMissingLoaderData* missingdata = 0) 00583 { 00584 return Load (fname, (iCollection*)0, searchRegionOnly, checkDupes, ssource, 00585 override_name, missingdata); 00586 } 00588 00590 00636 virtual csLoadResult Load (iDataBuffer* buffer, iCollection* collection = 0, 00637 bool searchCollectionOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00638 const char* override_name = 0, iMissingLoaderData* missingdata = 0, 00639 uint keepFlags = KEEP_ALL) = 0; 00640 CS_DEPRECATED_METHOD_MSG("Regions are deprecated. Use Collections instead.") 00641 virtual csLoadResult Load (iDataBuffer* buffer, iRegion* region, 00642 bool searchRegionOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00643 const char* override_name = 0, iMissingLoaderData* missingdata = 0) = 0; 00644 /* Hack to ensure source compatibility when a 0 collection/region is used. 00645 * Remove with region variant. */ 00646 CS_FORCEINLINE csLoadResult Load (iDataBuffer* buffer, int dummy, 00647 bool searchRegionOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00648 const char* override_name = 0, iMissingLoaderData* missingdata = 0) 00649 { 00650 return Load (buffer, (iCollection*)0, searchRegionOnly, checkDupes, 00651 ssource, override_name, missingdata); 00652 } 00654 00656 00701 virtual csLoadResult Load (iDocumentNode* node, iCollection* collection = 0, 00702 bool searchCollectionOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00703 const char* override_name = 0, iMissingLoaderData* missingdata = 0, 00704 uint keepFlags = KEEP_ALL) = 0; 00705 CS_DEPRECATED_METHOD_MSG("Regions are deprecated. Use Collections instead.") 00706 virtual csLoadResult Load (iDocumentNode* node, iRegion* region, 00707 bool searchRegionOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00708 const char* override_name = 0, iMissingLoaderData* missingdata = 0) = 0; 00709 /* Hack to ensure source compatibility when a 0 collection/region is used. 00710 * Remove with region variant. */ 00711 CS_FORCEINLINE csLoadResult Load (iDocumentNode* node, int dummy, 00712 bool searchRegionOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00713 const char* override_name = 0, iMissingLoaderData* missingdata = 0) 00714 { 00715 return Load (node, (iCollection*)0, searchRegionOnly, checkDupes, ssource, 00716 override_name, missingdata); 00717 } 00719 00725 CS_DEPRECATED_METHOD_MSG("Use iLoader::Load() returning csLoadResult instead") 00726 virtual bool Load (const char* fname, iBase*& result, iRegion* region = 0, 00727 bool curRegOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00728 const char* override_name = 0, iMissingLoaderData* missingdata = 0) = 0; 00729 00735 CS_DEPRECATED_METHOD_MSG("Use iLoader::Load() returning csLoadResult instead") 00736 virtual bool Load (iDataBuffer* buffer, iBase*& result, iRegion* region = 0, 00737 bool curRegOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00738 const char* override_name = 0, iMissingLoaderData* missingdata = 0) = 0; 00739 00745 CS_DEPRECATED_METHOD_MSG("Use iLoader::Load() returning csLoadResult instead") 00746 virtual bool Load (iDocumentNode* node, iBase*& result, iRegion* region = 0, 00747 bool curRegOnly = true, bool checkDupes = false, iStreamSource* ssource = 0, 00748 const char* override_name = 0, iMissingLoaderData* missingdata = 0) = 0; 00749 00754 CS_DEPRECATED_METHOD_MSG("Regions are deprecated. Use Collections instead.") 00755 virtual void SetAutoRegions (bool autoRegions) = 0; 00756 00761 CS_DEPRECATED_METHOD_MSG("Regions are deprecated. Use Collections instead.") 00762 virtual bool GetAutoRegions () = 0; 00763 }; 00764 00767 #include "csutil/deprecated_warn_on.h" 00768 00769 #endif // __CS_IMAP_PARSER_H__ 00770
Generated for Crystal Space 1.4.0 by doxygen 1.5.8