Counter Strike : Global Offensive Source Code
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.

115 lines
2.6 KiB

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