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.

27 lines
456 B

  1. if( scalar( @ARGV ) != 1 )
  2. {
  3. die "Usage: playback_numprims.pl frame.txt\n";
  4. }
  5. open INPUT, shift || die;
  6. $numprims = 0;
  7. $numcalls = 0;
  8. while( <INPUT> )
  9. {
  10. if( /DrawIndexedPrimitive.*numPrimitives:\s*(\d+)\s*$/i )
  11. {
  12. $numprims += $1;
  13. if( $1 > 85 )
  14. {
  15. $numfreeprims += $1;
  16. }
  17. else
  18. {
  19. $numfreeprims += 85;
  20. }
  21. $numcalls++;
  22. }
  23. }
  24. close INPUT;
  25. print "$numprims primitives\n";
  26. print "$numfreeprims freeprimitives\n";
  27. print "$numcalls calls\n";