home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 March / Gamestar_82_2006-03_dvd.iso / DVDStar / Editace / quake4_sdkv10.exe / source / framework / declSkin.h < prev    next >
C/C++ Source or Header  |  2005-11-14  |  2KB  |  75 lines

  1. // Copyright (C) 2004 Id Software, Inc.
  2. //
  3.  
  4. #ifndef __DECLSKIN_H__
  5. #define __DECLSKIN_H__
  6.  
  7. /*
  8. ===============================================================================
  9.  
  10.     idDeclSkin
  11.  
  12. ===============================================================================
  13. */
  14.  
  15. typedef struct {
  16.     const idMaterial *        from;            // 0 == any unmatched shader
  17.     const idMaterial *        to;
  18. } skinMapping_t;
  19.  
  20. // RAVEN BEGIN
  21. // jsinger: allow support for serialization/deserialization of binary decls
  22. #ifdef RV_BINARYDECLS
  23. class idDeclSkin : public idDecl, public Serializable<'DSKN'> {
  24. public:
  25. // jsinger: allow exporting of this decl type in a preparsed form
  26.     virtual void            Write( SerialOutputStream &stream) const;
  27.     virtual void            AddReferences() const;
  28.                             idDeclSkin(SerialInputStream &stream);
  29. #else
  30. class idDeclSkin : public idDecl {
  31. #endif
  32. public:
  33.                             idDeclSkin();
  34.     virtual size_t            Size( void ) const;
  35.     virtual bool            SetDefaultText( void );
  36.     virtual const char *    DefaultDefinition( void ) const;
  37.     virtual bool            Parse( const char *text, const int textLength, bool noCaching );
  38.     virtual void            FreeData( void );
  39. // RAVEN BEGIN
  40. // mwhitlock: Xenon texture streaming
  41. #if defined(_XENON)
  42.     void                    StreamAllSkinTargets(bool inBackground);
  43.     void                    GetSkinTargetsList(idList<const idMaterial*>& outList) const;
  44. #endif
  45. // RAVEN END
  46.     const idMaterial *        RemapShaderBySkin( const idMaterial *shader ) const;
  47.  
  48.                             // model associations are just for the preview dialog in the editor
  49. // RAVEN BEGIN
  50. // jscott: inlined for access from tools dll
  51.     const int                GetNumModelAssociations() const { return( associatedModels.Num() ); }
  52. // jscott: to prevent a recursive crash
  53.     virtual    bool            RebuildTextSource( void ) { return( false ); }
  54. // scork: validation member for more detailed error-checks
  55.     virtual bool            Validate( const char *psText, int iTextLength, idStr &strReportTo ) const;
  56. // RAVEN END
  57.     const char *            GetAssociatedModel( int index ) const;
  58.  
  59. private:
  60.     idList<skinMapping_t>    mappings;
  61.     idStrList                associatedModels;
  62. };
  63.  
  64. // RAVEN BEGIN
  65. // jscott: inlined for access from tools dll
  66. ID_INLINE const char *idDeclSkin::GetAssociatedModel( int index ) const {
  67.     if ( index >= 0 && index < associatedModels.Num() ) {
  68.         return associatedModels[ index ];
  69.     }
  70.     return "";
  71. }
  72. // RAVEN END
  73.  
  74. #endif /* !__DECLSKIN_H__ */
  75.