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.

110 lines
3.9 KiB

  1. #!perl
  2. use File::Find;
  3. &BuildRemapTable;
  4. find(\&convert, "." );
  5. sub convert
  6. {
  7. return unless (/\.pcf$/i);
  8. return if (/^tmp\.pcf$/i);
  9. return if (/^tmp2\.pcf$/i);
  10. return if (/360\.pcf$/i);
  11. print STDERR "process ", $File::Find::name," ($_) dir=",`cd`," \n";
  12. my $fname=$_;
  13. print `p4 edit $fname`;
  14. print `dmxconvert -i $_ -o tmp.pcf -oe keyvalues2`;
  15. open(TMP, "tmp.pcf" ) || return;
  16. open(OUT, ">tmp2.pcf" ) || die;
  17. while(<TMP>)
  18. {
  19. s/[\n\r]//g;
  20. if ( (/^(\s*\"functionName\"\s*\"string\"\s*\")(.*)\"(.*)$/) &&
  21. length($map{$2}) )
  22. {
  23. $_=$1.$map{$2}.'"'.$3;
  24. }
  25. if ( (/^(\s*\"name\"\s*\"string\"\s*\")(.*)\"(.*)$/) &&
  26. length($map{$2}) )
  27. {
  28. $_=$1.$map{$2}.'"'.$3;
  29. }
  30. print OUT "$_\n";
  31. }
  32. close OUT;
  33. close TMP;
  34. print `dmxconvert -i tmp2.pcf -o $fname -ie keyvalues2 -oe binary`;
  35. unlink "tmp.pcf";
  36. unlink "tmp2.pcf";
  37. }
  38. sub BuildRemapTable
  39. {
  40. $map{"alpha_fade"}= "Alpha Fade and Decay";
  41. $map{"alpha_fade_in_random"}= "Alpha Fade In Random";
  42. $map{"alpha_fade_out_random"}= "Alpha Fade Out Random";
  43. $map{"basic_movement"}= "Movement Basic";
  44. $map{"color_fade"}= "Color Fade";
  45. $map{"controlpoint_light"}= "Color Light From Control Point";
  46. $map{"Dampen Movement Relative to Control Point"}= "Movement Dampen Relative to Control Point";
  47. $map{"Distance Between Control Points Scale"}= "Remap Distance Between Two Control Points to Scalar";
  48. $map{"Distance to Control Points Scale"}= "Remap Distance to Control Point to Scalar";
  49. $map{"lifespan_decay"}= "Lifespan Decay";
  50. $map{"lock to bone"}= "Movement Lock to Bone";
  51. $map{"postion_lock_to_controlpoint"}= "Movement Lock to Control Point";
  52. $map{"maintain position along path"}= "Movement Maintain Position Along Path";
  53. $map{"Match Particle Velocities"}= "Movement Match Particle Velocities";
  54. $map{"Max Velocity"}= "Movement Max Velocity";
  55. $map{"noise"}= "Noise Scalar";
  56. $map{"vector noise"}= "Noise Vector";
  57. $map{"oscillate_scalar"}= "Oscillate Scalar";
  58. $map{"oscillate_vector"}= "Oscillate Vector";
  59. $map{"Orient Rotation to 2D Direction"}= "Rotation Orient to 2D Direction";
  60. $map{"radius_scale"}= "Radius Scale";
  61. $map{"Random Cull"}= "Cull Random";
  62. $map{"remap_scalar"}= "Remap Scalar";
  63. $map{"rotation_movement"}= "Rotation Basic";
  64. $map{"rotation_spin"}= "Rotation Spin Roll";
  65. $map{"rotation_spin yaw"}= "Rotation Spin Yaw";
  66. $map{"alpha_random"}= "Alpha Random";
  67. $map{"color_random"}= "Color Random";
  68. $map{"create from parent particles"}= "Position From Parent Particles";
  69. $map{"Create In Hierarchy"}= "Position In CP Hierarchy";
  70. $map{"random position along path"}= "Position Along Path Random";
  71. $map{"random position on model"}= "Position on Model Random";
  72. $map{"sequential position along path"}= "Position Along Path Sequential";
  73. $map{"position_offset_random"}= "Position Modify Offset Random";
  74. $map{"position_warp_random"}= "Position Modify Warp Random";
  75. $map{"position_within_box"}= "Position Within Box Random";
  76. $map{"position_within_sphere"}= "Position Within Sphere Random";
  77. $map{"Inherit Velocity"}= "Velocity Inherit from Control Point";
  78. $map{"Initial Repulsion Velocity"}= "Velocity Repulse from World";
  79. $map{"Initial Velocity Noise"}= "Velocity Noise";
  80. $map{"Initial Scalar Noise"}= "Remap Noise to Scalar";
  81. $map{"Lifespan from distance to world"}= "Lifetime from Time to Impact";
  82. $map{"Pre-Age Noise"}= "Lifetime Pre-Age Noise";
  83. $map{"lifetime_random"}= "Lifetime Random";
  84. $map{"radius_random"}= "Radius Random";
  85. $map{"random yaw"}= "Rotation Yaw Random";
  86. $map{"Randomly Flip Yaw"}= "Rotation Yaw Flip Random";
  87. $map{"rotation_random"}= "Rotation Random";
  88. $map{"rotation_speed_random"}= "Rotation Speed Random";
  89. $map{"sequence_random"}= "Sequence Random";
  90. $map{"second_sequence_random"}= "Sequence Two Random";
  91. $map{"trail_length_random"}= "Trail Length Random";
  92. $map{"velocity_random"}= "Velocity Random";
  93. }