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.

76 lines
2.4 KiB

  1. //====== Copyright c 1996-2007, Valve Corporation, All rights reserved. =======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef CFGPROCESSOR_H
  9. #define CFGPROCESSOR_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "tier1/smartptr.h"
  14. /*
  15. Layout of the internal structures is as follows:
  16. |-------- shader1.fxc ---------||--- shader2.fxc ---||--------- shader3.fxc -----||-...
  17. | 0 s s 3 s s s s 8 s 10 s s s || s s 2 3 4 s s s 8 || 0 s s s 4 s s s 8 9 s s s ||-...
  18. | 0 1 2 3 4 5 6 7 8 9 10 * * * 14 * * * * *20 * * 23 * * *27 * * * * * * *35 * * *
  19. GetSection( 10 ) -> shader1.fxc
  20. GetSection( 27 ) -> shader3.fxc
  21. GetNextCombo( 3, 3, 14 ) -> shader1.fxc : ( riCommandNumber = 8, rhCombo = "8" )
  22. GetNextCombo( 10, 10, 14 ) -> NULL : ( riCommandNumber = 14, rhCombo = NULL )
  23. GetNextCombo( 22, 8, 36 ) -> shader3.fxc : ( riCommandNumber = 23, rhCombo = "0" )
  24. GetNextCombo( 29, -1, 36 ) -> shader3.fxc : ( riCommandNumber = 31, rhCombo = "8" )
  25. */
  26. class CUtlInplaceBuffer;
  27. namespace CfgProcessor
  28. {
  29. // Working with configuration
  30. void ReadConfiguration( FILE *fInputStream );
  31. void ReadConfiguration( CUtlInplaceBuffer *fInputStream );
  32. struct CfgEntryInfo
  33. {
  34. char const *m_szName; // Name of the shader, e.g. "shader_ps20b"
  35. char const *m_szShaderFileName; // Name of the src file, e.g. "shader_psxx.fxc"
  36. uint64 m_numCombos; // Total possible num of combos, e.g. 1024
  37. uint64 m_numDynamicCombos; // Num of dynamic combos, e.g. 4
  38. uint64 m_numStaticCombos; // Num of static combos, e.g. 256
  39. uint64 m_iCommandStart; // Start command, e.g. 0
  40. uint64 m_iCommandEnd; // End command, e.g. 1024
  41. };
  42. void DescribeConfiguration( CArrayAutoPtr < CfgEntryInfo > &rarrEntries );
  43. // Working with combos
  44. typedef struct {} * ComboHandle;
  45. ComboHandle Combo_GetCombo( uint64 iCommandNumber );
  46. ComboHandle Combo_GetNext( uint64 &riCommandNumber, ComboHandle &rhCombo, uint64 iCommandEnd );
  47. void Combo_FormatCommand( ComboHandle hCombo, char *pchBuffer );
  48. uint64 Combo_GetCommandNum( ComboHandle hCombo );
  49. uint64 Combo_GetComboNum( ComboHandle hCombo );
  50. CfgEntryInfo const *Combo_GetEntryInfo( ComboHandle hCombo );
  51. ComboHandle Combo_Alloc( ComboHandle hComboCopyFrom );
  52. void Combo_Assign( ComboHandle hComboDst, ComboHandle hComboSrc );
  53. void Combo_Free( ComboHandle &rhComboFree );
  54. }; // namespace CfgProcessor
  55. #endif // #ifndef CFGPROCESSOR_H