Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
2.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef EXPRESSION_H
  8. #define EXPRESSION_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "utlvector.h"
  13. #include "mxBitmapTools.h"
  14. #include "hlfaceposer.h"
  15. #define GLOBAL_STUDIO_FLEX_CONTROL_COUNT ( MAXSTUDIOFLEXCTRL * 4 )
  16. //-----------------------------------------------------------------------------
  17. // Purpose:
  18. //-----------------------------------------------------------------------------
  19. class CExpUndoInfo
  20. {
  21. public:
  22. float setting[ GLOBAL_STUDIO_FLEX_CONTROL_COUNT ];
  23. float weight[ GLOBAL_STUDIO_FLEX_CONTROL_COUNT ];
  24. float redosetting[ GLOBAL_STUDIO_FLEX_CONTROL_COUNT ];
  25. float redoweight[ GLOBAL_STUDIO_FLEX_CONTROL_COUNT ];
  26. int counter;
  27. };
  28. class CExpression;
  29. class CExpClass;
  30. typedef unsigned int CRC32_t;
  31. //-----------------------------------------------------------------------------
  32. // Purpose:
  33. //-----------------------------------------------------------------------------
  34. class CExpression
  35. {
  36. public:
  37. CExpression ( void );
  38. ~CExpression ( void );
  39. CExpression( const CExpression& from );
  40. void SetModified( bool mod );
  41. bool GetModified( void );
  42. void ResetUndo( void );
  43. bool CanUndo( void );
  44. bool CanRedo( void );
  45. int UndoLevels( void );
  46. int UndoCurrent( void );
  47. const char *GetBitmapFilename( int modelindex );
  48. const char *GetBitmapCheckSum();
  49. CRC32_t GetBitmapCRC();
  50. void CreateNewBitmap( int modelindex );
  51. void PushUndoInformation( void );
  52. void PushRedoInformation( void );
  53. void Undo( void );
  54. void Redo( void );
  55. void SetSelected( bool selected );
  56. bool GetSelected( void );
  57. float *GetSettings( void );
  58. float *GetWeights( void );
  59. bool GetDirty( void );
  60. void SetDirty( bool dirty );
  61. void Revert( void );
  62. CExpClass *GetExpressionClass( void );
  63. void SetExpressionClass( char const *classname );
  64. // name of expression
  65. char name[32];
  66. int index;
  67. char description[128];
  68. mxbitmapdata_t m_Bitmap[ MAX_FP_MODELS ];
  69. bool m_bModified;
  70. // Undo information
  71. CUtlVector< CExpUndoInfo * > undo;
  72. int m_nUndoCurrent;
  73. bool m_bSelected;
  74. bool m_bDirty;
  75. private:
  76. // settings of fields
  77. float setting[ GLOBAL_STUDIO_FLEX_CONTROL_COUNT ];
  78. float weight[ GLOBAL_STUDIO_FLEX_CONTROL_COUNT ];
  79. char expressionclass[ 128 ];
  80. void WipeRedoInformation( void );
  81. };
  82. #endif // EXPRESSION_H