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.

105 lines
1.6 KiB

  1. for( $i = 0; $i < 16; $i++ )
  2. {
  3. print "\#define SHADER_CLASS$i(name,help";
  4. for( $j = 0; $j < $i; $j++ )
  5. {
  6. print ",p$j,p$j" . "type,p$j" . "default,p$j" . "help\\\n\t\t";
  7. }
  8. print ")\\\n";
  9. print "\tstatic const char *s_HelpString = help;\\\n";
  10. print "\tstatic const char *s_ParamNames[] = {";
  11. if( $i == 0 )
  12. {
  13. print "NULL";
  14. }
  15. else
  16. {
  17. for( $j = 0; $j < $i; $j++ )
  18. {
  19. print "\\\n\t\t\"\$\" #p$j";
  20. if( $j != $i - 1 )
  21. {
  22. print ",";
  23. }
  24. }
  25. }
  26. print "\\\n\t};\\\n";
  27. print "\tstatic ShaderParamType_t s_ParamType[] = {";
  28. if( $i == 0 )
  29. {
  30. print "SHADER_PARAM_TYPE_INTEGER";
  31. }
  32. else
  33. {
  34. for( $j = 0; $j < $i; $j++ )
  35. {
  36. print "\\\n\t\tp$j" . "type";
  37. if( $j != $i - 1 )
  38. {
  39. print ",";
  40. }
  41. }
  42. }
  43. print "\\\n\t};\\\n";
  44. print "\tstatic const char *s_ParamDefault[] = {";
  45. if( $i == 0 )
  46. {
  47. print "\"\"";
  48. }
  49. else
  50. {
  51. for( $j = 0; $j < $i; $j++ )
  52. {
  53. print "\\\n\t\tp$j" . "default";
  54. if( $j != $i - 1 )
  55. {
  56. print ",";
  57. }
  58. }
  59. }
  60. print "\\\n\t};\\\n";
  61. print "\tstatic const char *s_ParamHelp[] = {";
  62. if( $i == 0 )
  63. {
  64. print "\"\"";
  65. }
  66. else
  67. {
  68. for( $j = 0; $j < $i; $j++ )
  69. {
  70. print "\\\n\t\tp$j" . "help";
  71. if( $j != $i - 1 )
  72. {
  73. print ",";
  74. }
  75. }
  76. }
  77. print "\\\n\t};\\\n";
  78. print "\\\n\tenum {";
  79. if( $i == 0 )
  80. {
  81. print "DUMMY_PARAM";
  82. }
  83. else
  84. {
  85. for( $j = 0; $j < $i; $j++ )
  86. {
  87. print "\\\n\t\tp$j";
  88. if( $j == 0 )
  89. {
  90. print " = NUM_SHADER_MATERIAL_VARS";
  91. }
  92. if( $j != $i - 1 )
  93. {
  94. print ",";
  95. }
  96. }
  97. }
  98. print "\\\n\t};\\\n";
  99. print "\tstatic const char *s_Name = #name;\\\n\tclass CShader_ ## name : public Shader_t\n\n";
  100. }