home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / extras / Direct3D / Tools / Maya40 / xporttranslator.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-08  |  1.6 KB  |  59 lines

  1. #ifndef xfileTranslator_h
  2. #define xfileTranslator_h
  3.  
  4. #include <maya/MPxFileTranslator.h>
  5.  
  6. class xfileTranslator: public MPxFileTranslator 
  7. {
  8.     public:
  9.  
  10.         xfileTranslator(){};    // constructor
  11.        ~xfileTranslator(){};    // destructor
  12.  
  13.         static void* creator()    
  14.             { return new xfileTranslator(); };
  15.         MStatus reader(const MFileObject& file, const MString& optionsString, MPxFileTranslator::FileAccessMode mode)
  16.             { return MS::kSuccess; };
  17.         MStatus writer(const MFileObject& file, const MString& optionsString, MPxFileTranslator::FileAccessMode mode);
  18.         bool haveReadMethod() const 
  19.             { return false; };
  20.         bool haveWriteMethod() const 
  21.             { return true; };
  22.         bool canBeOpened() const 
  23.             { return false; };
  24.         MString defaultExtension() const 
  25.             { return ""; };
  26.         MFileKind identifyFile (const MFileObject& fileName, const char *buffer, short size) const 
  27.             { return kIsMyFileType; };
  28.  
  29. };
  30.  
  31.  
  32.  
  33. #define WRITE_FLOAT(pbCur, fVal)    {                                \
  34.                                         float* pf = (float*)pbCur;    \
  35.                                         *(pf++) = fVal;                \
  36.                                         pbCur = (PBYTE)pf;            \
  37.                                     }
  38.  
  39. #define WRITE_PCHAR(pbCur, pcVal)    {                                \
  40.                                         char** ppc = (char**)pbCur;    \
  41.                                         *(ppc++) = pcVal;            \
  42.                                         pbCur = (PBYTE)ppc;            \
  43.                                     }
  44.  
  45. #define WRITE_DWORD(pbCur, dwVal)    {                                \
  46.                                         DWORD* pdw = (DWORD*)pbCur;    \
  47.                                         *(pdw++) = dwVal;            \
  48.                                         pbCur = (PBYTE)pdw;            \
  49.                                     }
  50.  
  51. #define WRITE_WORD(pbCur, wVal)        {                                \
  52.                                         WORD* pw = (WORD*)pbCur;    \
  53.                                         *(pw++) = wVal;                \
  54.                                         pbCur = (PBYTE)pw;            \
  55.                                     }
  56.  
  57. #define    SCENE_ROOT    "SCENE_ROOT"
  58.  
  59. #endif