1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
|
/*
Copyright (C) 2001 by Jorrit Tyberghein
Copyright (C) 2001 by W.C.A. Wijngaards
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _SPR3DLDR_H_
#define _SPR3DLDR_H_
#include "imap/reader.h"
#include "imap/writer.h"
#include "iutil/eventh.h"
#include "iutil/comp.h"
struct iEngine;
struct iSkeletonLimb;
struct iReporter;
struct iPluginManager;
struct iObjectRegistry;
/**
* Sprite 3D factory loader.
*/
class csSprite3DFactoryLoader : public iLoaderPlugin
{
private:
iReporter* reporter;
iPluginManager* plugin_mgr;
iObjectRegistry* object_reg;
// Load a skeleton.
bool LoadSkeleton (iReporter* reporter, iSkeletonLimb* limb, char* buf);
public:
SCF_DECLARE_IBASE;
/// Constructor.
csSprite3DFactoryLoader (iBase*);
/// Destructor.
virtual ~csSprite3DFactoryLoader ();
/// Register plugin with the system driver
virtual bool Initialize (iObjectRegistry *object_reg);
/// Parse a given string and return a new object for it.
virtual iBase* Parse (const char* string, iLoaderContext* ldr_context,
iBase* context);
struct eiComponent : public iComponent
{
SCF_DECLARE_EMBEDDED_IBASE(csSprite3DFactoryLoader);
virtual bool Initialize (iObjectRegistry* p)
{ return scfParent->Initialize(p); }
} scfiComponent;
};
/**
* Sprite3D factory saver.
*/
class csSprite3DFactorySaver : public iSaverPlugin
{
private:
iReporter* reporter;
iPluginManager* plugin_mgr;
iObjectRegistry* object_reg;
// Save a skeleton.
void SaveSkeleton (iSkeletonLimb* limb, csString& str);
public:
SCF_DECLARE_IBASE;
/// Constructor.
csSprite3DFactorySaver (iBase*);
/// Destructor.
virtual ~csSprite3DFactorySaver ();
/// Register plugin with the system driver
virtual bool Initialize (iObjectRegistry *object_reg);
/// Write down given object and add to string vector.
virtual void WriteDown (iBase *obj, iFile *file);
struct eiComponent : public iComponent
{
SCF_DECLARE_EMBEDDED_IBASE(csSprite3DFactorySaver);
virtual bool Initialize (iObjectRegistry* p)
{ return scfParent->Initialize(p); }
} scfiComponent;
};
/**
* Sprite 3D loader.
*/
class csSprite3DLoader : public iLoaderPlugin
{
private:
iReporter* reporter;
iPluginManager* plugin_mgr;
iObjectRegistry* object_reg;
public:
SCF_DECLARE_IBASE;
/// Constructor.
csSprite3DLoader (iBase*);
/// Destructor.
virtual ~csSprite3DLoader ();
/// Register plugin with the system driver
virtual bool Initialize (iObjectRegistry *object_reg);
/// Parse a given string and return a new object for it.
virtual iBase* Parse (const char* string, iLoaderContext* ldr_context,
iBase* context);
struct eiComponent : public iComponent
{
SCF_DECLARE_EMBEDDED_IBASE(csSprite3DLoader);
virtual bool Initialize (iObjectRegistry* p)
{ return scfParent->Initialize(p); }
} scfiComponent;
};
/**
* Sprite3D saver.
*/
class csSprite3DSaver : public iSaverPlugin
{
private:
iReporter* reporter;
iPluginManager* plugin_mgr;
iObjectRegistry* object_reg;
public:
SCF_DECLARE_IBASE;
/// Constructor.
csSprite3DSaver (iBase*);
/// Destructor.
virtual ~csSprite3DSaver ();
/// Register plugin with the system driver
virtual bool Initialize (iObjectRegistry *object_reg);
/// Write down given object and add to string vector.
virtual void WriteDown (iBase *obj, iFile *file);
struct eiComponent : public iComponent
{
SCF_DECLARE_EMBEDDED_IBASE(csSprite3DSaver);
virtual bool Initialize (iObjectRegistry* p)
{ return scfParent->Initialize(p); }
} scfiComponent;
};
#endif // _SPR3DLDR_H_
|