## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# 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 "igraphic/image.h"
    00031 #include "ivideo/txtmgr.h"
    00032 #include "imap/streamsource.h"
    00033
    00034 struct iDocumentNode;
    00035 struct iImage;
    00036 struct iLight;
    00037 struct iMaterialWrapper;
    00038 struct iMeshWrapper;
    00039 struct iMeshFactoryWrapper;
    00040 struct iRegion;
    00041 struct iSector;
    00042 struct iShader;
    00043 struct iTextureHandle;
    00044 struct iTextureManager;
    00045 struct iTextureWrapper;
    00046 struct iSndSysData;
    00047 struct iSndSysWrapper;
    00048 struct iSndSysStream;
    00049
    00053 struct iLoaderStatus : public virtual iBase
    00054 {
    00055   SCF_INTERFACE (iLoaderStatus, 1, 0, 0);
    00056
    00058   virtual bool IsReady () = 0;
    00060   virtual bool IsError () = 0;
    00061 };
    00062
    00068 struct iMissingLoaderData : public virtual iBase
    00069 {
    00070   SCF_INTERFACE (iMissingLoaderData, 1, 0, 0);
    00071
    00078   virtual iMaterialWrapper* MissingMaterial (const char* name,
    00079         const char* filename) = 0;
    00080
    00087   virtual iTextureWrapper* MissingTexture (const char* name,
    00088       const char* filename) = 0;
    00089
    00096   virtual iShader* MissingShader (const char* name) = 0;
    00097
    00104   virtual iMeshFactoryWrapper* MissingFactory (const char* name) = 0;
    00105
    00112   virtual iMeshWrapper* MissingMesh (const char* name) = 0;
    00113
    00120   virtual iSector* MissingSector (const char* name) = 0;
    00121
    00128   virtual iLight* MissingLight (const char* name) = 0;
    00129 };
    00130
    00134 struct iLoader : public virtual iBase
    00135 {
    00136   SCF_INTERFACE (iLoader, 2, 0, 0);
    00137
    00144   virtual csPtr<iImage> LoadImage (const char* Filename,
    00145     int Format = CS_IMGFMT_INVALID) = 0;
    00158   virtual csPtr<iTextureHandle> LoadTexture (const char* Filename,
    00159         int Flags = CS_TEXTURE_3D, iTextureManager *tm = 0,
    00160         csRef<iImage>* image=0) = 0;
    00186   virtual iTextureWrapper* LoadTexture (const char *Name,
    00187         const char *FileName,
    00188         int Flags = CS_TEXTURE_3D, iTextureManager *tm = 0,
    00189         bool reg = true, bool create_material = true,
    00190         bool free_image = true, iRegion* region = 0) = 0;
    00191
    00199   virtual csPtr<iImage> LoadImage (iDataBuffer* buf,
    00200     int Format = CS_IMGFMT_INVALID) = 0;
    00214   virtual csPtr<iTextureHandle> LoadTexture (iDataBuffer* buf,
    00215         int Flags = CS_TEXTURE_3D, iTextureManager *tm = 0,
    00216         csRef<iImage>* image=0) = 0;
    00240   virtual iTextureWrapper* LoadTexture (const char *Name,
    00241         iDataBuffer* buf,
    00242         int Flags = CS_TEXTURE_3D, iTextureManager *tm = 0,
    00243         bool reg = true, bool create_material = true,
    00244         bool free_image = true) = 0;
    00245
    00247   virtual csPtr<iSndSysData> LoadSoundSysData (const char *fname) = 0;
    00254   virtual csPtr<iSndSysStream> LoadSoundStream (const char *fname,
    00255         int mode3d) = 0;
    00266   CS_DEPRECATED_METHOD_MSG("Use LoadSoundStream() without mode3d parameter instead.")
    00267   virtual iSndSysWrapper* LoadSoundWrapper (const char *name,
    00268         const char *fname, int mode3d) = 0;
    00269
    00276   virtual iSndSysWrapper* LoadSoundWrapper (const char *name,
    00277         const char *fname) = 0;
    00278
    00300   virtual csPtr<iLoaderStatus> ThreadedLoadMapFile (const char* filename,
    00301         iRegion* region = 0, bool curRegOnly = true,
    00302         bool checkDupes = false) = 0;
    00303
    00332   virtual bool LoadMapFile (const char* filename, bool clearEngine = true,
    00333         iRegion* region = 0, bool curRegOnly = true,
    00334         bool checkDupes = false, iStreamSource* ssource = 0,
    00335         iMissingLoaderData* missingdata = 0) = 0;
    00336
    00365   virtual bool LoadMap (iDocumentNode* world_node, bool clearEngine = true,
    00366         iRegion* region = 0, bool curRegOnly = true,
    00367         bool checkDupes = false, iStreamSource* ssource = 0,
    00368         iMissingLoaderData* missingdata = 0) = 0;
    00369
    00388   virtual bool LoadLibraryFile (const char* filename, iRegion* region = 0,
    00389         bool curRegOnly = true, bool checkDupes = false,
    00390         iStreamSource* ssource = 0,
    00391         iMissingLoaderData* missingdata = 0) = 0;
    00392
    00411   virtual bool LoadLibrary (iDocumentNode* lib_node, iRegion* region = 0,
    00412         bool curRegOnly = true, bool checkDupes = false,
    00413         iStreamSource* ssource = 0,
    00414         iMissingLoaderData* missingdata = 0) = 0;
    00415
    00421   virtual csPtr<iMeshFactoryWrapper> LoadMeshObjectFactory (
    00422         const char* fname, iStreamSource* ssource = 0) = 0;
    00429   virtual csPtr<iMeshWrapper> LoadMeshObject (const char* fname,
    00430         iStreamSource* ssource = 0) = 0;
    00431
    00473   virtual bool Load (const char* fname, iBase*& result, iRegion* region = 0,
    00474         bool curRegOnly = true, bool checkDupes = false,
    00475         iStreamSource* ssource = 0, const char* override_name = 0,
    00476         iMissingLoaderData* missingdata = 0) = 0;
    00477
    00519   virtual bool Load (iDataBuffer* buffer, iBase*& result, iRegion* region = 0,
    00520         bool curRegOnly = true, bool checkDupes = false,
    00521         iStreamSource* ssource = 0, const char* override_name = 0,
    00522         iMissingLoaderData* missingdata = 0) = 0;
    00523
    00564   virtual bool Load (iDocumentNode* node, iBase*& result, iRegion* region = 0,
    00565         bool curRegOnly = true, bool checkDupes = false,
    00566         iStreamSource* ssource = 0, const char* override_name = 0,
    00567         iMissingLoaderData* missingdata = 0) = 0;
    00568
    00572   virtual bool LoadShader (const char* filename) = 0;
    00573
    00577   virtual void SetAutoRegions (bool autoRegions) = 0;
    00578
    00582   virtual bool GetAutoRegions () = 0;
    00583 };
    00584
    00587 #endif // __CS_IMAP_PARSER_H__
    00588