CrystalSpace

Public API Reference

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, 1, 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;
00256 
00263   virtual iSndSysWrapper* LoadSoundWrapper (const char *name,
00264         const char *fname) = 0;
00265 
00287   virtual csPtr<iLoaderStatus> ThreadedLoadMapFile (const char* filename,
00288         iRegion* region = 0, bool curRegOnly = true,
00289         bool checkDupes = false) = 0;
00290 
00319   virtual bool LoadMapFile (const char* filename, bool clearEngine = true,
00320         iRegion* region = 0, bool curRegOnly = true,
00321         bool checkDupes = false, iStreamSource* ssource = 0,
00322         iMissingLoaderData* missingdata = 0) = 0;
00323 
00352   virtual bool LoadMap (iDocumentNode* world_node, bool clearEngine = true,
00353         iRegion* region = 0, bool curRegOnly = true,
00354         bool checkDupes = false, iStreamSource* ssource = 0,
00355         iMissingLoaderData* missingdata = 0) = 0;
00356 
00375   virtual bool LoadLibraryFile (const char* filename, iRegion* region = 0,
00376         bool curRegOnly = true, bool checkDupes = false,
00377         iStreamSource* ssource = 0,
00378         iMissingLoaderData* missingdata = 0) = 0;
00379 
00398   virtual bool LoadLibrary (iDocumentNode* lib_node, iRegion* region = 0,
00399         bool curRegOnly = true, bool checkDupes = false,
00400         iStreamSource* ssource = 0,
00401         iMissingLoaderData* missingdata = 0) = 0;
00402 
00408   virtual csPtr<iMeshFactoryWrapper> LoadMeshObjectFactory (
00409         const char* fname, iStreamSource* ssource = 0) = 0;
00416   virtual csPtr<iMeshWrapper> LoadMeshObject (const char* fname,
00417         iStreamSource* ssource = 0) = 0;
00418 
00460   virtual bool Load (const char* fname, iBase*& result, iRegion* region = 0,
00461         bool curRegOnly = true, bool checkDupes = false,
00462         iStreamSource* ssource = 0, const char* override_name = 0,
00463         iMissingLoaderData* missingdata = 0) = 0;
00464 
00506   virtual bool Load (iDataBuffer* buffer, iBase*& result, iRegion* region = 0,
00507         bool curRegOnly = true, bool checkDupes = false,
00508         iStreamSource* ssource = 0, const char* override_name = 0,
00509         iMissingLoaderData* missingdata = 0) = 0;
00510 
00551   virtual bool Load (iDocumentNode* node, iBase*& result, iRegion* region = 0,
00552         bool curRegOnly = true, bool checkDupes = false,
00553         iStreamSource* ssource = 0, const char* override_name = 0,
00554         iMissingLoaderData* missingdata = 0) = 0;
00555 
00559   virtual csRef<iShader> LoadShader (const char* filename, bool registerShader = true) = 0;
00560   
00564   virtual void SetAutoRegions (bool autoRegions) = 0;
00565   
00569   virtual bool GetAutoRegions () = 0;
00570 };
00571 
00574 #endif // __CS_IMAP_PARSER_H__
00575 

Generated for Crystal Space 1.2.1 by doxygen 1.5.3