From 3bf9df6b2785fa6d951086978a3e66f49427166a Mon Sep 17 00:00:00 2001 From: FluorescentCIAAfricanAmerican <0934gj3049fk@protonmail.com> Date: Wed, 22 Apr 2020 12:56:21 -0400 Subject: 1 --- devtools/AddFunctionPrologue.py | 116 ++ devtools/CheckSurfaceProps.py | 153 ++ devtools/DisableAppVerifier.bat | 7 + devtools/DisableSrcdsAppVerifier.bat | 7 + devtools/EnableAppVerifier.bat | 12 + devtools/EnableSrcdsAppVerifier.bat | 12 + devtools/FindClasses.py | 97 ++ devtools/GDPerf.sys | Bin 0 -> 1696 bytes devtools/PME.reg | Bin 0 -> 418 bytes devtools/PMELib.htm | 206 +++ devtools/WildcardSearch.py | 61 + devtools/WiseInstallerHelpers/LicenseViewed.cpp | 217 +++ devtools/WiseInstallerHelpers/LicenseViewed.vpc | 31 + .../UpdateProgress/UpdateProgress.cpp | 460 ++++++ .../UpdateProgress/UpdateProgress.vpc | 18 + devtools/analyzeconfig/__init__.py | 133 ++ devtools/base.xcconfig | 40 + devtools/bin/IntegrateOpenVR.bat | 77 + devtools/bin/IntegratePanorama.bat | 85 ++ .../bin/IntegrateSteamNetworkingSocketsSDK.bat | 34 + devtools/bin/LicenseViewed.dll | Bin 0 -> 45056 bytes devtools/bin/McCopy.pl | 1321 +++++++++++++++++ devtools/bin/UpdateProgress.exe | Bin 0 -> 45056 bytes devtools/bin/VProject.exe | Bin 0 -> 77824 bytes devtools/bin/build_sdk_vcproj.py | 11 + devtools/bin/buildshaderlist.pl | 22 + devtools/bin/buildtest.pl | 83 ++ devtools/bin/check_gcc_compile.pl | 23 + devtools/bin/checkin.pl | 660 +++++++++ devtools/bin/checkshaderchecksums.pl | 116 ++ devtools/bin/copyshaderincfiles.pl | 86 ++ devtools/bin/copyshaders.pl | 172 +++ devtools/bin/crc32filewithincludes.pl | 41 + devtools/bin/d3dx10_33.dll | Bin 0 -> 443752 bytes devtools/bin/d3dx9_33.dll | Bin 0 -> 3495784 bytes devtools/bin/dbmon.exe | Bin 0 -> 100352 bytes devtools/bin/diff.exe | Bin 0 -> 68096 bytes devtools/bin/diff3.exe | Bin 0 -> 49664 bytes devtools/bin/diffmemstats.exe | Bin 0 -> 172032 bytes devtools/bin/ezxmlfile.py | 175 +++ devtools/bin/fix_particle_operator_names.pl | 110 ++ devtools/bin/fixcopyrights.py | 177 +++ devtools/bin/fontmaker.exe | Bin 0 -> 339968 bytes devtools/bin/fontmaker.pdb | Bin 0 -> 5303296 bytes devtools/bin/fxc_prep.pl | 949 +++++++++++++ devtools/bin/gnu/libiconv2.dll | Bin 0 -> 898048 bytes devtools/bin/gnu/libintl3.dll | Bin 0 -> 101888 bytes devtools/bin/gnu/touch.exe | Bin 0 -> 78848 bytes devtools/bin/grep.exe | Bin 0 -> 82944 bytes devtools/bin/limit_vtf_sizes.pl | 94 ++ devtools/bin/linux/ccache | Bin 0 -> 220410 bytes devtools/bin/linux/p4 | Bin 0 -> 2614024 bytes devtools/bin/make360def.pl | 329 +++++ devtools/bin/makewav.exe | Bin 0 -> 905216 bytes devtools/bin/masm.exe | Bin 0 -> 49152 bytes devtools/bin/mc.exe | Bin 0 -> 650048 bytes devtools/bin/md5.exe | Bin 0 -> 17845 bytes devtools/bin/mksln.pl | 388 +++++ devtools/bin/ml.err | 280 ++++ devtools/bin/ml.exe | Bin 0 -> 366080 bytes devtools/bin/oldfxc.exe | Bin 0 -> 753664 bytes devtools/bin/osx32/ccache | Bin 0 -> 138984 bytes devtools/bin/osx32/protoc | Bin 0 -> 1382408 bytes devtools/bin/osx32/xcode_ccache_wrapper | 3 + devtools/bin/playback_getframe.pl | 24 + devtools/bin/playback_getstate.pl | 169 +++ devtools/bin/playback_gettexlock.pl | 27 + devtools/bin/playback_getvb.pl | 23 + devtools/bin/playback_numframes.bat | 1 + devtools/bin/playback_numprims.pl | 27 + devtools/bin/psh_prep.pl | 333 +++++ devtools/bin/putty/LICENCE | 25 + devtools/bin/putty/README.txt | 40 + devtools/bin/putty/pageant.exe | Bin 0 -> 135168 bytes devtools/bin/putty/plink.exe | Bin 0 -> 282624 bytes devtools/bin/putty/pscp.exe | Bin 0 -> 294912 bytes devtools/bin/putty/psftp.exe | Bin 0 -> 307200 bytes devtools/bin/putty/putty.cnt | 492 +++++++ devtools/bin/putty/putty.exe | Bin 0 -> 454656 bytes devtools/bin/putty/putty.hlp | Bin 0 -> 629483 bytes devtools/bin/putty/puttycm.exe | Bin 0 -> 1916928 bytes devtools/bin/putty/puttygen.exe | Bin 0 -> 172032 bytes devtools/bin/recentchanges.pl | 79 ++ devtools/bin/robocopy.exe | Bin 0 -> 188416 bytes devtools/bin/run_unit_tests.pl | 137 ++ devtools/bin/sed.exe | Bin 0 -> 46080 bytes devtools/bin/separate_vcprojs.py | 27 + devtools/bin/setup_vmpi.pl | 60 + devtools/bin/shaderinfo.pl | 36 + devtools/bin/signcode.exe | Bin 0 -> 25872 bytes devtools/bin/smtpmail.exe | Bin 0 -> 116224 bytes devtools/bin/splitdiff3.pl | 54 + devtools/bin/srgb_colorspace.pl | 451 ++++++ devtools/bin/sscode.exe | Bin 0 -> 241724 bytes devtools/bin/steamlicense.txt | 14 + devtools/bin/tee.exe | Bin 0 -> 16896 bytes devtools/bin/test_binaries.exe | Bin 0 -> 40960 bytes devtools/bin/test_linux_compile.pl | 64 + devtools/bin/timeprecise.exe | Bin 0 -> 49152 bytes devtools/bin/timethis.exe | Bin 0 -> 8192 bytes devtools/bin/uniqexe.exe | Bin 0 -> 23552 bytes devtools/bin/uniqifylist.pl | 6 + devtools/bin/updatecef.bat | 14 + devtools/bin/updatecef.sh | 11 + devtools/bin/updateshaders.pl | 305 ++++ devtools/bin/valve_p4_create_changelist.cmd | 65 + devtools/bin/valve_p4_edit_to_changelist.cmd | 99 ++ devtools/bin/valve_perl_helpers.pl | 558 ++++++++ devtools/bin/vmpi_chpass.pl | 116 ++ devtools/bin/vmpi_test.pl | 385 +++++ devtools/bin/vpc | 46 + devtools/bin/vpc.exe | Bin 0 -> 1843712 bytes devtools/bin/vpc.pdb | Bin 0 -> 14708736 bytes devtools/bin/vpc2linuxmake.pl | 684 +++++++++ devtools/bin/vpcall.bat | 1 + devtools/bin/vpccrccheck.exe | Bin 0 -> 83296 bytes devtools/bin/vpcgames.bat | 1 + devtools/bin/vpesign.exe | Bin 0 -> 360448 bytes devtools/bin/vsdotnetxmlparser.py | 218 +++ devtools/bin/vsh_prep.pl | 1106 +++++++++++++++ devtools/bin/vtf_flags_convert.pl | 80 ++ devtools/bin/vtfscrewtree.pl | 83 ++ devtools/bin/vzip.exe | Bin 0 -> 94208 bytes devtools/bin/wtf.pl | 221 +++ devtools/bin/wtf.txt | 18 + devtools/bin/xbspinfo.exe | Bin 0 -> 81920 bytes devtools/bin/xsync.bat | 163 +++ devtools/build_solution_remote.py | 615 ++++++++ devtools/dbmon/dbmon.c | 163 +++ devtools/dbmon/dbmon.vpc | 35 + devtools/debug.xcconfig | 4 + devtools/devstudio macros/autoexp.dat | 231 +++ devtools/devstudio macros/comments.dsm | 270 ++++ devtools/devstudio macros/usertype.dat | 315 +++++ devtools/devstudio templates/valvelib.awx | Bin 0 -> 49152 bytes devtools/devstudio templates/valvelib.hlp | Bin 0 -> 5899 bytes devtools/diffmemstats/diffmemstats.cpp | 444 ++++++ devtools/diffmemstats/diffmemstats.sln | 20 + devtools/diffmemstats/diffmemstats.vpc | 31 + devtools/dlexer.py | 140 ++ devtools/ep2_deathmap/ep2_deathmap.cpp | 1315 +++++++++++++++++ devtools/ep2_deathmap/ep2_deathmap.vpc | 54 + devtools/fix_tlog.py | 166 +++ devtools/fix_tlogs.bat | 8 + devtools/gendbg.sh | 44 + devtools/getmirror/StdAfx.cpp | 15 + devtools/getmirror/StdAfx.h | 30 + devtools/getmirror/getmirror.cpp | 145 ++ devtools/getmirror/getmirror.vpc | 43 + devtools/getmirror/syncfrommirror.bat | 84 ++ devtools/goldsrc_port_scripts/PySourceSafe.py | 259 ++++ devtools/goldsrc_port_scripts/VisitFiles.py | 83 ++ devtools/goldsrc_port_scripts/WildcardSearch.py | 61 + devtools/goldsrc_port_scripts/find_game_sounds.py | 59 + .../goldsrc_port_scripts/goldsrc_qc_9way_blends.py | 87 ++ devtools/goldsrc_port_scripts/port_models.py | 226 +++ devtools/goldsrc_port_scripts/qc_origin_fix.py | 35 + devtools/macros/EnvironmentEvents.VB | Bin 0 -> 3022 bytes devtools/macros/Module1.VB | Bin 0 -> 172 bytes devtools/macros/Perforce.VB | Bin 0 -> 6536 bytes devtools/macros/Valve.VB | Bin 0 -> 19948 bytes devtools/macros/Valve.vsmacros | Bin 0 -> 161792 bytes devtools/macros/Valve.vsmproj | Bin 0 -> 8810 bytes devtools/macros/Valve.vsmprojex | Bin 0 -> 2272 bytes devtools/macros/Valve.vsmprojey | Bin 0 -> 2242 bytes devtools/macros/Valve2005.VB | Bin 0 -> 2062 bytes devtools/macros/Valve2005.vsmacros | Bin 0 -> 89600 bytes devtools/makefile_base_posix.mak | 610 ++++++++ devtools/makemissinganims.pl | 106 ++ devtools/mapbuild/buildMaps.pl | 895 ++++++++++++ devtools/mapbuild/buildall.bat | 22 + devtools/mapbuild/buildmod.bat | 74 + devtools/mapbuild/readme.txt | 45 + devtools/mapbuild/syncChangedMaps.pl | 103 ++ devtools/mat_check.pl | 30 + devtools/matcheck_dod.bat | 1 + devtools/p4EditChangelist.py | 35 + devtools/p4debugscan.py | 59 + devtools/p4helpers.py | 161 +++ devtools/p4sizes.py | 37 + devtools/p4submit.py | 121 ++ devtools/parse_analyze_errors.py | 574 ++++++++ devtools/processgamestats/StdAfx.cpp | 15 + devtools/processgamestats/StdAfx.h | 26 + devtools/processgamestats/base_gamestats_parse.h | 34 + devtools/processgamestats/cs_gamestats.h | 45 + devtools/processgamestats/cstrike_gamestats.db | 191 +++ .../processgamestats/cstrike_gamestats_parse.cpp | 235 +++ devtools/processgamestats/ep1_gamestats.db | 47 + devtools/processgamestats/ep2_gamestats.db | 168 +++ devtools/processgamestats/ep2_gamestats_parse.cpp | 606 ++++++++ devtools/processgamestats/portal_gamestats.db | 47 + devtools/processgamestats/processgamestats.cpp | 982 +++++++++++++ devtools/processgamestats/processgamestats.vpc | 78 + devtools/processgamestats/tf_gamestats.db | 227 +++ devtools/processgamestats/tf_gamestats_parse.cpp | 480 +++++++ devtools/release.xcconfig | 4 + devtools/search_and_replace_template.py | 58 + devtools/shotmaker.pl | 955 +++++++++++++ devtools/smtpmail/simplesocket.cpp | 162 +++ devtools/smtpmail/simplesocket.h | 40 + devtools/smtpmail/smtpmail.cpp | 247 ++++ devtools/smtpmail/smtpmail.vpc | 38 + devtools/sourcesdk_def.mak | 1 + devtools/srcdsAppVerifierSettings.reg | Bin 0 -> 3398 bytes devtools/steam_def.mak | 1 + .../swigwin-1.3.34/Lib/allegrocl/allegrocl.swg | 543 +++++++ .../swigwin-1.3.34/Lib/allegrocl/inout_typemaps.i | 111 ++ devtools/swigwin-1.3.34/Lib/allegrocl/longlongs.i | 36 + devtools/swigwin-1.3.34/Lib/allegrocl/std_list.i | 233 +++ devtools/swigwin-1.3.34/Lib/allegrocl/std_string.i | 218 +++ devtools/swigwin-1.3.34/Lib/allegrocl/typemaps.i | 4 + devtools/swigwin-1.3.34/Lib/allkw.swg | 31 + devtools/swigwin-1.3.34/Lib/attribute.i | 24 + devtools/swigwin-1.3.34/Lib/carrays.i | 120 ++ devtools/swigwin-1.3.34/Lib/cdata.i | 82 ++ devtools/swigwin-1.3.34/Lib/cffi/cffi.swg | 284 ++++ devtools/swigwin-1.3.34/Lib/chicken/chicken.swg | 773 ++++++++++ devtools/swigwin-1.3.34/Lib/chicken/chickenkw.swg | 31 + devtools/swigwin-1.3.34/Lib/chicken/chickenrun.swg | 377 +++++ .../swigwin-1.3.34/Lib/chicken/extra-install.list | 3 + .../swigwin-1.3.34/Lib/chicken/multi-generic.scm | 152 ++ devtools/swigwin-1.3.34/Lib/chicken/std_string.i | 100 ++ .../swigwin-1.3.34/Lib/chicken/swigclosprefix.scm | 31 + .../Lib/chicken/tinyclos-multi-generic.patch | 150 ++ devtools/swigwin-1.3.34/Lib/chicken/typemaps.i | 318 +++++ devtools/swigwin-1.3.34/Lib/clisp/clisp.swg | 35 + devtools/swigwin-1.3.34/Lib/cmalloc.i | 113 ++ devtools/swigwin-1.3.34/Lib/constraints.i | 227 +++ devtools/swigwin-1.3.34/Lib/cpointer.i | 183 +++ .../swigwin-1.3.34/Lib/csharp/boost_shared_ptr.i | 229 +++ devtools/swigwin-1.3.34/Lib/csharp/csharp.swg | 971 +++++++++++++ devtools/swigwin-1.3.34/Lib/csharp/csharphead.swg | 329 +++++ devtools/swigwin-1.3.34/Lib/csharp/csharpkw.swg | 94 ++ devtools/swigwin-1.3.34/Lib/csharp/director.swg | 50 + devtools/swigwin-1.3.34/Lib/csharp/enums.swg | 89 ++ devtools/swigwin-1.3.34/Lib/csharp/enumsimple.swg | 91 ++ .../swigwin-1.3.34/Lib/csharp/enumtypesafe.swg | 133 ++ devtools/swigwin-1.3.34/Lib/csharp/std_common.i | 5 + devtools/swigwin-1.3.34/Lib/csharp/std_deque.i | 1 + devtools/swigwin-1.3.34/Lib/csharp/std_except.i | 33 + devtools/swigwin-1.3.34/Lib/csharp/std_map.i | 175 +++ devtools/swigwin-1.3.34/Lib/csharp/std_pair.i | 37 + devtools/swigwin-1.3.34/Lib/csharp/std_string.i | 114 ++ devtools/swigwin-1.3.34/Lib/csharp/std_vector.i | 384 +++++ devtools/swigwin-1.3.34/Lib/csharp/std_wstring.i | 117 ++ devtools/swigwin-1.3.34/Lib/csharp/stl.i | 15 + devtools/swigwin-1.3.34/Lib/csharp/typemaps.i | 291 ++++ devtools/swigwin-1.3.34/Lib/csharp/wchar.i | 105 ++ devtools/swigwin-1.3.34/Lib/cstring.i | 15 + devtools/swigwin-1.3.34/Lib/cwstring.i | 14 + devtools/swigwin-1.3.34/Lib/exception.i | 271 ++++ devtools/swigwin-1.3.34/Lib/gcj/cni.i | 43 + devtools/swigwin-1.3.34/Lib/gcj/cni.swg | 17 + devtools/swigwin-1.3.34/Lib/gcj/javaprims.i | 422 ++++++ devtools/swigwin-1.3.34/Lib/guile/Makefile | 4 + devtools/swigwin-1.3.34/Lib/guile/common.scm | 76 + devtools/swigwin-1.3.34/Lib/guile/cplusplus.i | 25 + .../swigwin-1.3.34/Lib/guile/extra-install.list | 2 + devtools/swigwin-1.3.34/Lib/guile/ghinterface.i | 39 + devtools/swigwin-1.3.34/Lib/guile/guile.i | 36 + devtools/swigwin-1.3.34/Lib/guile/guile_gh.swg | 74 + devtools/swigwin-1.3.34/Lib/guile/guile_gh_run.swg | 261 ++++ devtools/swigwin-1.3.34/Lib/guile/guile_scm.swg | 53 + .../swigwin-1.3.34/Lib/guile/guile_scm_run.swg | 485 +++++++ devtools/swigwin-1.3.34/Lib/guile/guilemain.i | 47 + devtools/swigwin-1.3.34/Lib/guile/interpreter.i | 62 + devtools/swigwin-1.3.34/Lib/guile/list-vector.i | 491 +++++++ devtools/swigwin-1.3.34/Lib/guile/pointer-in-out.i | 105 ++ devtools/swigwin-1.3.34/Lib/guile/ports.i | 56 + devtools/swigwin-1.3.34/Lib/guile/std_common.i | 27 + devtools/swigwin-1.3.34/Lib/guile/std_deque.i | 1 + devtools/swigwin-1.3.34/Lib/guile/std_except.i | 12 + devtools/swigwin-1.3.34/Lib/guile/std_map.i | 1351 ++++++++++++++++++ devtools/swigwin-1.3.34/Lib/guile/std_pair.i | 871 ++++++++++++ devtools/swigwin-1.3.34/Lib/guile/std_string.i | 90 ++ devtools/swigwin-1.3.34/Lib/guile/std_vector.i | 413 ++++++ devtools/swigwin-1.3.34/Lib/guile/stl.i | 15 + devtools/swigwin-1.3.34/Lib/guile/swigrun.i | 49 + devtools/swigwin-1.3.34/Lib/guile/typemaps.i | 454 ++++++ devtools/swigwin-1.3.34/Lib/inttypes.i | 94 ++ devtools/swigwin-1.3.34/Lib/java/arrays_java.i | 391 +++++ .../swigwin-1.3.34/Lib/java/boost_shared_ptr.i | 192 +++ devtools/swigwin-1.3.34/Lib/java/director.swg | 185 +++ devtools/swigwin-1.3.34/Lib/java/enums.swg | 117 ++ devtools/swigwin-1.3.34/Lib/java/enumsimple.swg | 74 + devtools/swigwin-1.3.34/Lib/java/enumtypesafe.swg | 121 ++ .../swigwin-1.3.34/Lib/java/enumtypeunsafe.swg | 75 + devtools/swigwin-1.3.34/Lib/java/java.swg | 1195 ++++++++++++++++ devtools/swigwin-1.3.34/Lib/java/javahead.swg | 103 ++ devtools/swigwin-1.3.34/Lib/java/javakw.swg | 70 + devtools/swigwin-1.3.34/Lib/java/std_common.i | 5 + devtools/swigwin-1.3.34/Lib/java/std_deque.i | 1 + devtools/swigwin-1.3.34/Lib/java/std_except.i | 33 + devtools/swigwin-1.3.34/Lib/java/std_map.i | 179 +++ devtools/swigwin-1.3.34/Lib/java/std_pair.i | 37 + devtools/swigwin-1.3.34/Lib/java/std_string.i | 120 ++ devtools/swigwin-1.3.34/Lib/java/std_vector.i | 54 + devtools/swigwin-1.3.34/Lib/java/std_wstring.i | 175 +++ devtools/swigwin-1.3.34/Lib/java/stl.i | 13 + devtools/swigwin-1.3.34/Lib/java/typemaps.i | 449 ++++++ devtools/swigwin-1.3.34/Lib/java/various.i | 151 ++ devtools/swigwin-1.3.34/Lib/linkruntime.c | 22 + devtools/swigwin-1.3.34/Lib/lua/_std_common.i | 96 ++ devtools/swigwin-1.3.34/Lib/lua/carrays.i | 8 + devtools/swigwin-1.3.34/Lib/lua/lua.swg | 207 +++ devtools/swigwin-1.3.34/Lib/lua/lua_fnptr.i | 128 ++ devtools/swigwin-1.3.34/Lib/lua/luarun.swg | 754 ++++++++++ devtools/swigwin-1.3.34/Lib/lua/luaruntime.swg | 77 + devtools/swigwin-1.3.34/Lib/lua/luatypemaps.swg | 353 +++++ devtools/swigwin-1.3.34/Lib/lua/std_common.i | 5 + devtools/swigwin-1.3.34/Lib/lua/std_deque.i | 1 + devtools/swigwin-1.3.34/Lib/lua/std_except.i | 43 + devtools/swigwin-1.3.34/Lib/lua/std_map.i | 63 + devtools/swigwin-1.3.34/Lib/lua/std_pair.i | 45 + devtools/swigwin-1.3.34/Lib/lua/std_string.i | 155 ++ devtools/swigwin-1.3.34/Lib/lua/std_vector.i | 134 ++ devtools/swigwin-1.3.34/Lib/lua/stl.i | 13 + devtools/swigwin-1.3.34/Lib/lua/typemaps.i | 541 +++++++ devtools/swigwin-1.3.34/Lib/lua/wchar.i | 46 + devtools/swigwin-1.3.34/Lib/math.i | 85 ++ devtools/swigwin-1.3.34/Lib/modula3/modula3.swg | 750 ++++++++++ .../swigwin-1.3.34/Lib/modula3/modula3head.swg | 67 + devtools/swigwin-1.3.34/Lib/modula3/typemaps.i | 77 + devtools/swigwin-1.3.34/Lib/mzscheme/Makefile | 4 + devtools/swigwin-1.3.34/Lib/mzscheme/mzrun.swg | 511 +++++++ devtools/swigwin-1.3.34/Lib/mzscheme/mzscheme.swg | 58 + devtools/swigwin-1.3.34/Lib/mzscheme/std_common.i | 23 + devtools/swigwin-1.3.34/Lib/mzscheme/std_deque.i | 1 + devtools/swigwin-1.3.34/Lib/mzscheme/std_map.i | 1351 ++++++++++++++++++ devtools/swigwin-1.3.34/Lib/mzscheme/std_pair.i | 873 ++++++++++++ devtools/swigwin-1.3.34/Lib/mzscheme/std_string.i | 60 + devtools/swigwin-1.3.34/Lib/mzscheme/std_vector.i | 436 ++++++ devtools/swigwin-1.3.34/Lib/mzscheme/stl.i | 14 + devtools/swigwin-1.3.34/Lib/mzscheme/typemaps.i | 354 +++++ devtools/swigwin-1.3.34/Lib/ocaml/carray.i | 136 ++ devtools/swigwin-1.3.34/Lib/ocaml/class.swg | 66 + devtools/swigwin-1.3.34/Lib/ocaml/cstring.i | 271 ++++ devtools/swigwin-1.3.34/Lib/ocaml/director.swg | 103 ++ .../swigwin-1.3.34/Lib/ocaml/extra-install.list | 5 + devtools/swigwin-1.3.34/Lib/ocaml/libswigocaml.h | 20 + devtools/swigwin-1.3.34/Lib/ocaml/ocaml.i | 61 + devtools/swigwin-1.3.34/Lib/ocaml/ocaml.swg | 602 ++++++++ devtools/swigwin-1.3.34/Lib/ocaml/ocamldec.swg | 172 +++ devtools/swigwin-1.3.34/Lib/ocaml/ocamlkw.swg | 64 + devtools/swigwin-1.3.34/Lib/ocaml/preamble.swg | 17 + devtools/swigwin-1.3.34/Lib/ocaml/std_common.i | 22 + devtools/swigwin-1.3.34/Lib/ocaml/std_complex.i | 65 + devtools/swigwin-1.3.34/Lib/ocaml/std_deque.i | 31 + devtools/swigwin-1.3.34/Lib/ocaml/std_list.i | 222 +++ devtools/swigwin-1.3.34/Lib/ocaml/std_map.i | 173 +++ devtools/swigwin-1.3.34/Lib/ocaml/std_pair.i | 37 + devtools/swigwin-1.3.34/Lib/ocaml/std_string.i | 179 +++ devtools/swigwin-1.3.34/Lib/ocaml/std_vector.i | 92 ++ devtools/swigwin-1.3.34/Lib/ocaml/stl.i | 15 + devtools/swigwin-1.3.34/Lib/ocaml/swig.ml | 159 +++ devtools/swigwin-1.3.34/Lib/ocaml/swig.mli | 61 + devtools/swigwin-1.3.34/Lib/ocaml/swigp4.ml.in | 118 ++ devtools/swigwin-1.3.34/Lib/ocaml/typecheck.i | 179 +++ devtools/swigwin-1.3.34/Lib/ocaml/typemaps.i | 319 +++++ devtools/swigwin-1.3.34/Lib/ocaml/typeregister.swg | 2 + devtools/swigwin-1.3.34/Lib/perl5/Makefile.in | 138 ++ devtools/swigwin-1.3.34/Lib/perl5/Makefile.pl | 21 + devtools/swigwin-1.3.34/Lib/perl5/attribute.i | 1 + devtools/swigwin-1.3.34/Lib/perl5/carrays.i | 2 + devtools/swigwin-1.3.34/Lib/perl5/cdata.i | 1 + devtools/swigwin-1.3.34/Lib/perl5/cmalloc.i | 1 + devtools/swigwin-1.3.34/Lib/perl5/cni.i | 12 + devtools/swigwin-1.3.34/Lib/perl5/cpointer.i | 1 + devtools/swigwin-1.3.34/Lib/perl5/cstring.i | 1 + devtools/swigwin-1.3.34/Lib/perl5/exception.i | 5 + .../swigwin-1.3.34/Lib/perl5/extra-install.list | 2 + devtools/swigwin-1.3.34/Lib/perl5/factory.i | 1 + devtools/swigwin-1.3.34/Lib/perl5/jstring.i | 48 + devtools/swigwin-1.3.34/Lib/perl5/noembed.h | 93 ++ devtools/swigwin-1.3.34/Lib/perl5/perl5.swg | 42 + devtools/swigwin-1.3.34/Lib/perl5/perlerrors.swg | 49 + .../swigwin-1.3.34/Lib/perl5/perlfragments.swg | 23 + devtools/swigwin-1.3.34/Lib/perl5/perlhead.swg | 102 ++ devtools/swigwin-1.3.34/Lib/perl5/perlinit.swg | 76 + devtools/swigwin-1.3.34/Lib/perl5/perlkw.swg | 251 ++++ devtools/swigwin-1.3.34/Lib/perl5/perlmacros.swg | 2 + devtools/swigwin-1.3.34/Lib/perl5/perlmain.i | 85 ++ devtools/swigwin-1.3.34/Lib/perl5/perlopers.swg | 56 + .../swigwin-1.3.34/Lib/perl5/perlprimtypes.swg | 328 +++++ devtools/swigwin-1.3.34/Lib/perl5/perlrun.swg | 467 ++++++ devtools/swigwin-1.3.34/Lib/perl5/perlruntime.swg | 8 + devtools/swigwin-1.3.34/Lib/perl5/perlstrings.swg | 54 + devtools/swigwin-1.3.34/Lib/perl5/perltypemaps.swg | 91 ++ devtools/swigwin-1.3.34/Lib/perl5/perluserdir.swg | 2 + devtools/swigwin-1.3.34/Lib/perl5/reference.i | 235 +++ devtools/swigwin-1.3.34/Lib/perl5/std_common.i | 29 + devtools/swigwin-1.3.34/Lib/perl5/std_deque.i | 1 + devtools/swigwin-1.3.34/Lib/perl5/std_except.i | 1 + devtools/swigwin-1.3.34/Lib/perl5/std_list.i | 368 +++++ devtools/swigwin-1.3.34/Lib/perl5/std_map.i | 175 +++ devtools/swigwin-1.3.34/Lib/perl5/std_pair.i | 37 + devtools/swigwin-1.3.34/Lib/perl5/std_string.i | 2 + devtools/swigwin-1.3.34/Lib/perl5/std_vector.i | 571 ++++++++ devtools/swigwin-1.3.34/Lib/perl5/stl.i | 14 + devtools/swigwin-1.3.34/Lib/perl5/typemaps.i | 374 +++++ devtools/swigwin-1.3.34/Lib/php4/const.i | 53 + devtools/swigwin-1.3.34/Lib/php4/globalvar.i | 332 +++++ devtools/swigwin-1.3.34/Lib/php4/php4.swg | 298 ++++ devtools/swigwin-1.3.34/Lib/php4/php4init.swg | 12 + devtools/swigwin-1.3.34/Lib/php4/php4kw.swg | 461 ++++++ devtools/swigwin-1.3.34/Lib/php4/php4run.swg | 222 +++ devtools/swigwin-1.3.34/Lib/php4/phppointers.i | 42 + devtools/swigwin-1.3.34/Lib/php4/std_common.i | 13 + devtools/swigwin-1.3.34/Lib/php4/std_deque.i | 1 + devtools/swigwin-1.3.34/Lib/php4/std_map.i | 175 +++ devtools/swigwin-1.3.34/Lib/php4/std_pair.i | 37 + devtools/swigwin-1.3.34/Lib/php4/std_string.i | 73 + devtools/swigwin-1.3.34/Lib/php4/std_vector.i | 132 ++ devtools/swigwin-1.3.34/Lib/php4/stl.i | 15 + devtools/swigwin-1.3.34/Lib/php4/typemaps.i | 171 +++ devtools/swigwin-1.3.34/Lib/php4/utils.i | 59 + devtools/swigwin-1.3.34/Lib/pike/pike.swg | 317 +++++ devtools/swigwin-1.3.34/Lib/pike/pikekw.swg | 55 + devtools/swigwin-1.3.34/Lib/pike/pikerun.swg | 73 + devtools/swigwin-1.3.34/Lib/pike/std_string.i | 63 + devtools/swigwin-1.3.34/Lib/pointer.i | 14 + devtools/swigwin-1.3.34/Lib/python/Makefile.in | 135 ++ devtools/swigwin-1.3.34/Lib/python/README | 105 ++ devtools/swigwin-1.3.34/Lib/python/argcargv.i | 92 ++ devtools/swigwin-1.3.34/Lib/python/attribute.i | 1 + .../swigwin-1.3.34/Lib/python/boost_shared_ptr.i | 207 +++ devtools/swigwin-1.3.34/Lib/python/carrays.i | 9 + devtools/swigwin-1.3.34/Lib/python/ccomplex.i | 29 + devtools/swigwin-1.3.34/Lib/python/cdata.i | 1 + devtools/swigwin-1.3.34/Lib/python/cmalloc.i | 1 + devtools/swigwin-1.3.34/Lib/python/cni.i | 2 + devtools/swigwin-1.3.34/Lib/python/complex.i | 6 + devtools/swigwin-1.3.34/Lib/python/cpointer.i | 1 + devtools/swigwin-1.3.34/Lib/python/cstring.i | 1 + devtools/swigwin-1.3.34/Lib/python/cwstring.i | 3 + devtools/swigwin-1.3.34/Lib/python/defarg.swg | 37 + devtools/swigwin-1.3.34/Lib/python/director.swg | 482 +++++++ devtools/swigwin-1.3.34/Lib/python/embed.i | 115 ++ devtools/swigwin-1.3.34/Lib/python/embed15.i | 118 ++ devtools/swigwin-1.3.34/Lib/python/exception.i | 6 + devtools/swigwin-1.3.34/Lib/python/factory.i | 1 + devtools/swigwin-1.3.34/Lib/python/file.i | 43 + devtools/swigwin-1.3.34/Lib/python/implicit.i | 7 + devtools/swigwin-1.3.34/Lib/python/jstring.i | 72 + devtools/swigwin-1.3.34/Lib/python/pyapi.swg | 36 + devtools/swigwin-1.3.34/Lib/python/pybackward.swg | 45 + devtools/swigwin-1.3.34/Lib/python/pyclasses.swg | 144 ++ devtools/swigwin-1.3.34/Lib/python/pycomplex.swg | 86 ++ devtools/swigwin-1.3.34/Lib/python/pycontainer.swg | 766 ++++++++++ devtools/swigwin-1.3.34/Lib/python/pydocs.swg | 18 + devtools/swigwin-1.3.34/Lib/python/pyerrors.swg | 69 + devtools/swigwin-1.3.34/Lib/python/pyfragments.swg | 23 + devtools/swigwin-1.3.34/Lib/python/pyhead.swg | 88 ++ devtools/swigwin-1.3.34/Lib/python/pyinit.swg | 288 ++++ devtools/swigwin-1.3.34/Lib/python/pyiterators.swg | 380 +++++ devtools/swigwin-1.3.34/Lib/python/pymacros.swg | 4 + devtools/swigwin-1.3.34/Lib/python/pyopers.swg | 129 ++ devtools/swigwin-1.3.34/Lib/python/pyprimtypes.swg | 292 ++++ devtools/swigwin-1.3.34/Lib/python/pyrun.swg | 1496 ++++++++++++++++++++ devtools/swigwin-1.3.34/Lib/python/pyruntime.swg | 13 + devtools/swigwin-1.3.34/Lib/python/pystdcommon.swg | 259 ++++ devtools/swigwin-1.3.34/Lib/python/pystrings.swg | 75 + devtools/swigwin-1.3.34/Lib/python/python.swg | 59 + devtools/swigwin-1.3.34/Lib/python/pythonkw.swg | 136 ++ devtools/swigwin-1.3.34/Lib/python/pythreads.swg | 66 + devtools/swigwin-1.3.34/Lib/python/pytuplehlp.swg | 8 + devtools/swigwin-1.3.34/Lib/python/pytypemaps.swg | 98 ++ devtools/swigwin-1.3.34/Lib/python/pyuserdir.swg | 245 ++++ devtools/swigwin-1.3.34/Lib/python/pywstrings.swg | 61 + devtools/swigwin-1.3.34/Lib/python/std_alloc.i | 1 + .../swigwin-1.3.34/Lib/python/std_basic_string.i | 103 ++ devtools/swigwin-1.3.34/Lib/python/std_carray.i | 54 + .../swigwin-1.3.34/Lib/python/std_char_traits.i | 1 + devtools/swigwin-1.3.34/Lib/python/std_common.i | 44 + devtools/swigwin-1.3.34/Lib/python/std_complex.i | 22 + devtools/swigwin-1.3.34/Lib/python/std_container.i | 2 + devtools/swigwin-1.3.34/Lib/python/std_deque.i | 27 + devtools/swigwin-1.3.34/Lib/python/std_except.i | 1 + devtools/swigwin-1.3.34/Lib/python/std_ios.i | 3 + devtools/swigwin-1.3.34/Lib/python/std_iostream.i | 8 + devtools/swigwin-1.3.34/Lib/python/std_list.i | 28 + devtools/swigwin-1.3.34/Lib/python/std_map.i | 247 ++++ devtools/swigwin-1.3.34/Lib/python/std_multimap.i | 79 ++ devtools/swigwin-1.3.34/Lib/python/std_multiset.i | 44 + devtools/swigwin-1.3.34/Lib/python/std_pair.i | 139 ++ devtools/swigwin-1.3.34/Lib/python/std_set.i | 58 + devtools/swigwin-1.3.34/Lib/python/std_sstream.i | 1 + devtools/swigwin-1.3.34/Lib/python/std_streambuf.i | 1 + devtools/swigwin-1.3.34/Lib/python/std_string.i | 1 + devtools/swigwin-1.3.34/Lib/python/std_vector.i | 27 + devtools/swigwin-1.3.34/Lib/python/std_vectora.i | 31 + devtools/swigwin-1.3.34/Lib/python/std_wios.i | 1 + devtools/swigwin-1.3.34/Lib/python/std_wiostream.i | 10 + devtools/swigwin-1.3.34/Lib/python/std_wsstream.i | 1 + .../swigwin-1.3.34/Lib/python/std_wstreambuf.i | 1 + devtools/swigwin-1.3.34/Lib/python/std_wstring.i | 3 + devtools/swigwin-1.3.34/Lib/python/stl.i | 7 + devtools/swigwin-1.3.34/Lib/python/typemaps.i | 151 ++ devtools/swigwin-1.3.34/Lib/python/wchar.i | 21 + devtools/swigwin-1.3.34/Lib/r/cdata.i | 1 + devtools/swigwin-1.3.34/Lib/r/exception.i | 8 + devtools/swigwin-1.3.34/Lib/r/r.swg | 208 +++ devtools/swigwin-1.3.34/Lib/r/rcontainer.swg | 198 +++ devtools/swigwin-1.3.34/Lib/r/rfragments.swg | 177 +++ devtools/swigwin-1.3.34/Lib/r/ropers.swg | 70 + devtools/swigwin-1.3.34/Lib/r/rrun.swg | 373 +++++ devtools/swigwin-1.3.34/Lib/r/rstdcommon.swg | 216 +++ devtools/swigwin-1.3.34/Lib/r/rtype.swg | 200 +++ devtools/swigwin-1.3.34/Lib/r/srun.swg | 150 ++ devtools/swigwin-1.3.34/Lib/r/std_alloc.i | 1 + devtools/swigwin-1.3.34/Lib/r/std_common.i | 2 + devtools/swigwin-1.3.34/Lib/r/std_container.i | 2 + devtools/swigwin-1.3.34/Lib/r/std_deque.i | 1 + devtools/swigwin-1.3.34/Lib/r/std_except.i | 1 + devtools/swigwin-1.3.34/Lib/r/std_pair.i | 1 + devtools/swigwin-1.3.34/Lib/r/std_string.i | 1 + devtools/swigwin-1.3.34/Lib/r/std_vector.i | 10 + devtools/swigwin-1.3.34/Lib/r/stl.i | 8 + devtools/swigwin-1.3.34/Lib/r/typemaps.i | 1 + devtools/swigwin-1.3.34/Lib/ruby/Makefile.swig | 42 + devtools/swigwin-1.3.34/Lib/ruby/argcargv.i | 48 + devtools/swigwin-1.3.34/Lib/ruby/attribute.i | 1 + devtools/swigwin-1.3.34/Lib/ruby/carrays.i | 6 + devtools/swigwin-1.3.34/Lib/ruby/cdata.i | 1 + devtools/swigwin-1.3.34/Lib/ruby/cmalloc.i | 1 + devtools/swigwin-1.3.34/Lib/ruby/cni.i | 2 + devtools/swigwin-1.3.34/Lib/ruby/cpointer.i | 1 + devtools/swigwin-1.3.34/Lib/ruby/cstring.i | 1 + devtools/swigwin-1.3.34/Lib/ruby/director.swg | 382 +++++ devtools/swigwin-1.3.34/Lib/ruby/embed.i | 16 + devtools/swigwin-1.3.34/Lib/ruby/exception.i | 5 + devtools/swigwin-1.3.34/Lib/ruby/extconf.rb | 9 + .../swigwin-1.3.34/Lib/ruby/extra-install.list | 3 + devtools/swigwin-1.3.34/Lib/ruby/factory.i | 1 + devtools/swigwin-1.3.34/Lib/ruby/file.i | 32 + devtools/swigwin-1.3.34/Lib/ruby/jstring.i | 44 + devtools/swigwin-1.3.34/Lib/ruby/progargcargv.i | 34 + devtools/swigwin-1.3.34/Lib/ruby/ruby.swg | 72 + devtools/swigwin-1.3.34/Lib/ruby/rubyapi.swg | 36 + devtools/swigwin-1.3.34/Lib/ruby/rubyautodoc.swg | 110 ++ devtools/swigwin-1.3.34/Lib/ruby/rubyclasses.swg | 395 ++++++ devtools/swigwin-1.3.34/Lib/ruby/rubycomplex.swg | 129 ++ devtools/swigwin-1.3.34/Lib/ruby/rubycontainer.swg | 1131 +++++++++++++++ .../Lib/ruby/rubycontainer_extended.swg | 139 ++ devtools/swigwin-1.3.34/Lib/ruby/rubydef.swg | 1 + devtools/swigwin-1.3.34/Lib/ruby/rubyerrors.swg | 154 ++ devtools/swigwin-1.3.34/Lib/ruby/rubyfragments.swg | 23 + devtools/swigwin-1.3.34/Lib/ruby/rubyhead.swg | 139 ++ devtools/swigwin-1.3.34/Lib/ruby/rubyinit.swg | 1 + devtools/swigwin-1.3.34/Lib/ruby/rubyiterators.swg | 935 ++++++++++++ devtools/swigwin-1.3.34/Lib/ruby/rubykw.swg | 72 + devtools/swigwin-1.3.34/Lib/ruby/rubymacros.swg | 13 + devtools/swigwin-1.3.34/Lib/ruby/rubyopers.swg | 55 + devtools/swigwin-1.3.34/Lib/ruby/rubyprimtypes.swg | 220 +++ devtools/swigwin-1.3.34/Lib/ruby/rubyrun.swg | 444 ++++++ devtools/swigwin-1.3.34/Lib/ruby/rubyruntime.swg | 9 + .../swigwin-1.3.34/Lib/ruby/rubystdautodoc.swg | 37 + devtools/swigwin-1.3.34/Lib/ruby/rubystdcommon.swg | 265 ++++ .../swigwin-1.3.34/Lib/ruby/rubystdfunctors.swg | 162 +++ devtools/swigwin-1.3.34/Lib/ruby/rubystrings.swg | 61 + devtools/swigwin-1.3.34/Lib/ruby/rubytracking.swg | 160 +++ devtools/swigwin-1.3.34/Lib/ruby/rubytypemaps.swg | 62 + devtools/swigwin-1.3.34/Lib/ruby/rubyuserdir.swg | 10 + devtools/swigwin-1.3.34/Lib/ruby/rubywstrings.swg | 76 + devtools/swigwin-1.3.34/Lib/ruby/std_alloc.i | 1 + .../swigwin-1.3.34/Lib/ruby/std_basic_string.i | 97 ++ devtools/swigwin-1.3.34/Lib/ruby/std_char_traits.i | 1 + devtools/swigwin-1.3.34/Lib/ruby/std_common.i | 44 + devtools/swigwin-1.3.34/Lib/ruby/std_complex.i | 22 + devtools/swigwin-1.3.34/Lib/ruby/std_container.i | 2 + devtools/swigwin-1.3.34/Lib/ruby/std_deque.i | 30 + devtools/swigwin-1.3.34/Lib/ruby/std_except.i | 1 + devtools/swigwin-1.3.34/Lib/ruby/std_functors.i | 29 + devtools/swigwin-1.3.34/Lib/ruby/std_ios.i | 14 + devtools/swigwin-1.3.34/Lib/ruby/std_iostream.i | 12 + devtools/swigwin-1.3.34/Lib/ruby/std_list.i | 41 + devtools/swigwin-1.3.34/Lib/ruby/std_map.i | 417 ++++++ devtools/swigwin-1.3.34/Lib/ruby/std_multimap.i | 226 +++ devtools/swigwin-1.3.34/Lib/ruby/std_multiset.i | 53 + devtools/swigwin-1.3.34/Lib/ruby/std_pair.i | 207 +++ devtools/swigwin-1.3.34/Lib/ruby/std_queue.i | 33 + devtools/swigwin-1.3.34/Lib/ruby/std_set.i | 216 +++ devtools/swigwin-1.3.34/Lib/ruby/std_sstream.i | 2 + devtools/swigwin-1.3.34/Lib/ruby/std_stack.i | 35 + devtools/swigwin-1.3.34/Lib/ruby/std_streambuf.i | 1 + devtools/swigwin-1.3.34/Lib/ruby/std_string.i | 9 + devtools/swigwin-1.3.34/Lib/ruby/std_vector.i | 52 + devtools/swigwin-1.3.34/Lib/ruby/std_vectora.i | 36 + devtools/swigwin-1.3.34/Lib/ruby/std_wstring.i | 3 + devtools/swigwin-1.3.34/Lib/ruby/stl.i | 15 + devtools/swigwin-1.3.34/Lib/ruby/timeval.i | 64 + devtools/swigwin-1.3.34/Lib/ruby/typemaps.i | 317 +++++ devtools/swigwin-1.3.34/Lib/runtime.swg | 38 + devtools/swigwin-1.3.34/Lib/shared_ptr.i | 57 + devtools/swigwin-1.3.34/Lib/std/README | 22 + devtools/swigwin-1.3.34/Lib/std/_std_deque.i | 126 ++ devtools/swigwin-1.3.34/Lib/std/std_alloc.i | 77 + devtools/swigwin-1.3.34/Lib/std/std_basic_string.i | 270 ++++ devtools/swigwin-1.3.34/Lib/std/std_carray.swg | 64 + devtools/swigwin-1.3.34/Lib/std/std_char_traits.i | 140 ++ devtools/swigwin-1.3.34/Lib/std/std_common.i | 244 ++++ devtools/swigwin-1.3.34/Lib/std/std_container.i | 113 ++ devtools/swigwin-1.3.34/Lib/std/std_deque.i | 127 ++ devtools/swigwin-1.3.34/Lib/std/std_except.i | 68 + devtools/swigwin-1.3.34/Lib/std/std_ios.i | 260 ++++ devtools/swigwin-1.3.34/Lib/std/std_iostream.i | 339 +++++ devtools/swigwin-1.3.34/Lib/std/std_list.i | 148 ++ devtools/swigwin-1.3.34/Lib/std/std_map.i | 124 ++ devtools/swigwin-1.3.34/Lib/std/std_multimap.i | 87 ++ devtools/swigwin-1.3.34/Lib/std/std_multiset.i | 83 ++ devtools/swigwin-1.3.34/Lib/std/std_pair.i | 163 +++ devtools/swigwin-1.3.34/Lib/std/std_queue.i | 129 ++ devtools/swigwin-1.3.34/Lib/std/std_set.i | 119 ++ devtools/swigwin-1.3.34/Lib/std/std_sstream.i | 195 +++ devtools/swigwin-1.3.34/Lib/std/std_stack.i | 128 ++ devtools/swigwin-1.3.34/Lib/std/std_streambuf.i | 94 ++ devtools/swigwin-1.3.34/Lib/std/std_string.i | 13 + devtools/swigwin-1.3.34/Lib/std/std_vector.i | 184 +++ devtools/swigwin-1.3.34/Lib/std/std_vectora.i | 7 + devtools/swigwin-1.3.34/Lib/std/std_wios.i | 7 + devtools/swigwin-1.3.34/Lib/std/std_wiostream.i | 7 + devtools/swigwin-1.3.34/Lib/std/std_wsstream.i | 7 + devtools/swigwin-1.3.34/Lib/std/std_wstreambuf.i | 7 + devtools/swigwin-1.3.34/Lib/std/std_wstring.i | 14 + devtools/swigwin-1.3.34/Lib/std_except.i | 58 + devtools/swigwin-1.3.34/Lib/stdint.i | 109 ++ devtools/swigwin-1.3.34/Lib/stl.i | 10 + devtools/swigwin-1.3.34/Lib/swig.swg | 670 +++++++++ devtools/swigwin-1.3.34/Lib/swigarch.i | 65 + devtools/swigwin-1.3.34/Lib/swigerrors.swg | 16 + devtools/swigwin-1.3.34/Lib/swiginit.swg | 236 +++ devtools/swigwin-1.3.34/Lib/swiglabels.swg | 102 ++ devtools/swigwin-1.3.34/Lib/swigrun.i | 11 + devtools/swigwin-1.3.34/Lib/swigrun.swg | 569 ++++++++ devtools/swigwin-1.3.34/Lib/swigwarn.swg | 258 ++++ devtools/swigwin-1.3.34/Lib/swigwarnings.swg | 128 ++ devtools/swigwin-1.3.34/Lib/tcl/Makefile.in | 133 ++ devtools/swigwin-1.3.34/Lib/tcl/attribute.i | 1 + devtools/swigwin-1.3.34/Lib/tcl/carrays.i | 4 + devtools/swigwin-1.3.34/Lib/tcl/cdata.i | 1 + devtools/swigwin-1.3.34/Lib/tcl/cmalloc.i | 1 + devtools/swigwin-1.3.34/Lib/tcl/cni.i | 2 + devtools/swigwin-1.3.34/Lib/tcl/cpointer.i | 1 + devtools/swigwin-1.3.34/Lib/tcl/cstring.i | 1 + devtools/swigwin-1.3.34/Lib/tcl/cwstring.i | 2 + devtools/swigwin-1.3.34/Lib/tcl/exception.i | 6 + devtools/swigwin-1.3.34/Lib/tcl/factory.i | 1 + devtools/swigwin-1.3.34/Lib/tcl/jstring.i | 42 + devtools/swigwin-1.3.34/Lib/tcl/mactclinit.c | 93 ++ devtools/swigwin-1.3.34/Lib/tcl/mactkinit.c | 236 +++ devtools/swigwin-1.3.34/Lib/tcl/std_common.i | 20 + devtools/swigwin-1.3.34/Lib/tcl/std_deque.i | 1 + devtools/swigwin-1.3.34/Lib/tcl/std_except.i | 1 + devtools/swigwin-1.3.34/Lib/tcl/std_map.i | 173 +++ devtools/swigwin-1.3.34/Lib/tcl/std_pair.i | 37 + devtools/swigwin-1.3.34/Lib/tcl/std_string.i | 2 + devtools/swigwin-1.3.34/Lib/tcl/std_vector.i | 422 ++++++ devtools/swigwin-1.3.34/Lib/tcl/std_wstring.i | 2 + devtools/swigwin-1.3.34/Lib/tcl/stl.i | 14 + devtools/swigwin-1.3.34/Lib/tcl/tcl8.swg | 45 + devtools/swigwin-1.3.34/Lib/tcl/tclapi.swg | 107 ++ devtools/swigwin-1.3.34/Lib/tcl/tclerrors.swg | 76 + devtools/swigwin-1.3.34/Lib/tcl/tclfragments.swg | 22 + devtools/swigwin-1.3.34/Lib/tcl/tclinit.swg | 106 ++ devtools/swigwin-1.3.34/Lib/tcl/tclinterp.i | 20 + devtools/swigwin-1.3.34/Lib/tcl/tclkw.swg | 10 + devtools/swigwin-1.3.34/Lib/tcl/tclmacros.swg | 4 + devtools/swigwin-1.3.34/Lib/tcl/tclopers.swg | 46 + devtools/swigwin-1.3.34/Lib/tcl/tclprimtypes.swg | 239 ++++ devtools/swigwin-1.3.34/Lib/tcl/tclresult.i | 30 + devtools/swigwin-1.3.34/Lib/tcl/tclrun.swg | 695 +++++++++ devtools/swigwin-1.3.34/Lib/tcl/tclruntime.swg | 15 + devtools/swigwin-1.3.34/Lib/tcl/tclsh.i | 88 ++ devtools/swigwin-1.3.34/Lib/tcl/tclstrings.swg | 31 + devtools/swigwin-1.3.34/Lib/tcl/tcltypemaps.swg | 89 ++ devtools/swigwin-1.3.34/Lib/tcl/tcluserdir.swg | 5 + devtools/swigwin-1.3.34/Lib/tcl/tclwstrings.swg | 70 + devtools/swigwin-1.3.34/Lib/tcl/typemaps.i | 467 ++++++ devtools/swigwin-1.3.34/Lib/tcl/wish.i | 149 ++ devtools/swigwin-1.3.34/Lib/typemaps/README | 54 + devtools/swigwin-1.3.34/Lib/typemaps/attribute.swg | 205 +++ devtools/swigwin-1.3.34/Lib/typemaps/carrays.swg | 117 ++ devtools/swigwin-1.3.34/Lib/typemaps/cdata.swg | 78 + devtools/swigwin-1.3.34/Lib/typemaps/cmalloc.swg | 113 ++ devtools/swigwin-1.3.34/Lib/typemaps/cpointer.swg | 160 +++ devtools/swigwin-1.3.34/Lib/typemaps/cstring.swg | 9 + devtools/swigwin-1.3.34/Lib/typemaps/cstrings.swg | 292 ++++ devtools/swigwin-1.3.34/Lib/typemaps/cwstring.swg | 10 + devtools/swigwin-1.3.34/Lib/typemaps/enumint.swg | 28 + devtools/swigwin-1.3.34/Lib/typemaps/exception.swg | 89 ++ devtools/swigwin-1.3.34/Lib/typemaps/factory.swg | 88 ++ devtools/swigwin-1.3.34/Lib/typemaps/fragments.swg | 458 ++++++ devtools/swigwin-1.3.34/Lib/typemaps/implicit.swg | 208 +++ devtools/swigwin-1.3.34/Lib/typemaps/inoutlist.swg | 296 ++++ devtools/swigwin-1.3.34/Lib/typemaps/misctypes.swg | 21 + devtools/swigwin-1.3.34/Lib/typemaps/primtypes.swg | 320 +++++ devtools/swigwin-1.3.34/Lib/typemaps/ptrtypes.swg | 211 +++ .../swigwin-1.3.34/Lib/typemaps/std_except.swg | 96 ++ .../swigwin-1.3.34/Lib/typemaps/std_string.swg | 27 + .../swigwin-1.3.34/Lib/typemaps/std_strings.swg | 82 ++ .../swigwin-1.3.34/Lib/typemaps/std_wstring.swg | 26 + devtools/swigwin-1.3.34/Lib/typemaps/string.swg | 24 + devtools/swigwin-1.3.34/Lib/typemaps/strings.swg | 594 ++++++++ .../swigwin-1.3.34/Lib/typemaps/swigmacros.swg | 245 ++++ .../swigwin-1.3.34/Lib/typemaps/swigobject.swg | 37 + devtools/swigwin-1.3.34/Lib/typemaps/swigtype.swg | 604 ++++++++ .../swigwin-1.3.34/Lib/typemaps/swigtypemaps.swg | 170 +++ devtools/swigwin-1.3.34/Lib/typemaps/traits.swg | 316 +++++ devtools/swigwin-1.3.34/Lib/typemaps/typemaps.swg | 160 +++ devtools/swigwin-1.3.34/Lib/typemaps/valtypes.swg | 216 +++ devtools/swigwin-1.3.34/Lib/typemaps/void.swg | 84 ++ devtools/swigwin-1.3.34/Lib/typemaps/wstring.swg | 25 + devtools/swigwin-1.3.34/Lib/uffi/uffi.swg | 103 ++ devtools/swigwin-1.3.34/Lib/wchar.i | 14 + devtools/swigwin-1.3.34/Lib/windows.i | 152 ++ devtools/swigwin-1.3.34/Lib/xml/typemaps.i | 3 + devtools/swigwin-1.3.34/Lib/xml/xml.swg | 1 + devtools/swigwin-1.3.34/foo.bat | 514 +++++++ devtools/swigwin-1.3.34/swig.exe | Bin 0 -> 1407675 bytes devtools/syncfrommirror/Redir.cpp | 358 +++++ devtools/syncfrommirror/Redir.h | 60 + devtools/syncfrommirror/Redirect.cpp | 152 ++ devtools/syncfrommirror/Redirect.h | 55 + devtools/syncfrommirror/StdAfx.cpp | 15 + devtools/syncfrommirror/StdAfx.h | 33 + devtools/syncfrommirror/res/syncfrommirror.ico | Bin 0 -> 29926 bytes devtools/syncfrommirror/res/syncfrommirror.rc2 | 13 + devtools/syncfrommirror/resource.h | 34 + devtools/syncfrommirror/syncfrommirror.cpp | 70 + devtools/syncfrommirror/syncfrommirror.h | 54 + devtools/syncfrommirror/syncfrommirror.rc | 196 +++ devtools/syncfrommirror/syncfrommirror.vpc | 60 + devtools/syncfrommirror/syncfrommirrorDlg.cpp | 275 ++++ devtools/syncfrommirror/syncfrommirrorDlg.h | 78 + devtools/tagbuild/StdAfx.cpp | 15 + devtools/tagbuild/StdAfx.h | 26 + devtools/tagbuild/tagbuild.cpp | 180 +++ devtools/tagbuild/tagbuild.vpc | 49 + devtools/test_binaries/COMMON.C | 583 ++++++++ devtools/test_binaries/COMMON.H | 27 + devtools/test_binaries/EXEDUMP.C | 532 +++++++ devtools/test_binaries/EXEDUMP.H | 8 + devtools/test_binaries/EXTRNVAR.H | 16 + devtools/test_binaries/OBJDUMP.C | 132 ++ devtools/test_binaries/OBJDUMP.H | 8 + devtools/test_binaries/PEDUMP.C | 139 ++ devtools/test_binaries/test_binaries.cpp | 149 ++ devtools/test_binaries/test_binaries.vpc | 18 + devtools/tf2AppVerifierSettings.reg | Bin 0 -> 3366 bytes devtools/vcodepickle.py | 1034 ++++++++++++++ devtools/version_script.linux.txt | 14 + devtools/vs_nop_tools/lib.exe | Bin 0 -> 6656 bytes devtools/vs_nop_tools/link.exe | Bin 0 -> 6656 bytes devtools/vs_nop_tools/mt.exe | Bin 0 -> 6656 bytes devtools/vs_nop_tools/readme.txt | 3 + devtools/vstools/mt.exe | Bin 0 -> 883008 bytes devtools/vstools/readme.txt | 1 + 758 files changed, 96166 insertions(+) create mode 100644 devtools/AddFunctionPrologue.py create mode 100644 devtools/CheckSurfaceProps.py create mode 100644 devtools/DisableAppVerifier.bat create mode 100644 devtools/DisableSrcdsAppVerifier.bat create mode 100644 devtools/EnableAppVerifier.bat create mode 100644 devtools/EnableSrcdsAppVerifier.bat create mode 100644 devtools/FindClasses.py create mode 100644 devtools/GDPerf.sys create mode 100644 devtools/PME.reg create mode 100644 devtools/PMELib.htm create mode 100644 devtools/WildcardSearch.py create mode 100644 devtools/WiseInstallerHelpers/LicenseViewed.cpp create mode 100644 devtools/WiseInstallerHelpers/LicenseViewed.vpc create mode 100644 devtools/WiseInstallerHelpers/UpdateProgress/UpdateProgress.cpp create mode 100644 devtools/WiseInstallerHelpers/UpdateProgress/UpdateProgress.vpc create mode 100644 devtools/analyzeconfig/__init__.py create mode 100644 devtools/base.xcconfig create mode 100644 devtools/bin/IntegrateOpenVR.bat create mode 100644 devtools/bin/IntegratePanorama.bat create mode 100644 devtools/bin/IntegrateSteamNetworkingSocketsSDK.bat create mode 100644 devtools/bin/LicenseViewed.dll create mode 100644 devtools/bin/McCopy.pl create mode 100644 devtools/bin/UpdateProgress.exe create mode 100644 devtools/bin/VProject.exe create mode 100644 devtools/bin/build_sdk_vcproj.py create mode 100644 devtools/bin/buildshaderlist.pl create mode 100644 devtools/bin/buildtest.pl create mode 100644 devtools/bin/check_gcc_compile.pl create mode 100644 devtools/bin/checkin.pl create mode 100644 devtools/bin/checkshaderchecksums.pl create mode 100644 devtools/bin/copyshaderincfiles.pl create mode 100644 devtools/bin/copyshaders.pl create mode 100644 devtools/bin/crc32filewithincludes.pl create mode 100644 devtools/bin/d3dx10_33.dll create mode 100644 devtools/bin/d3dx9_33.dll create mode 100644 devtools/bin/dbmon.exe create mode 100644 devtools/bin/diff.exe create mode 100644 devtools/bin/diff3.exe create mode 100644 devtools/bin/diffmemstats.exe create mode 100644 devtools/bin/ezxmlfile.py create mode 100644 devtools/bin/fix_particle_operator_names.pl create mode 100644 devtools/bin/fixcopyrights.py create mode 100644 devtools/bin/fontmaker.exe create mode 100644 devtools/bin/fontmaker.pdb create mode 100644 devtools/bin/fxc_prep.pl create mode 100644 devtools/bin/gnu/libiconv2.dll create mode 100644 devtools/bin/gnu/libintl3.dll create mode 100644 devtools/bin/gnu/touch.exe create mode 100644 devtools/bin/grep.exe create mode 100644 devtools/bin/limit_vtf_sizes.pl create mode 100644 devtools/bin/linux/ccache create mode 100644 devtools/bin/linux/p4 create mode 100644 devtools/bin/make360def.pl create mode 100644 devtools/bin/makewav.exe create mode 100644 devtools/bin/masm.exe create mode 100644 devtools/bin/mc.exe create mode 100644 devtools/bin/md5.exe create mode 100644 devtools/bin/mksln.pl create mode 100644 devtools/bin/ml.err create mode 100644 devtools/bin/ml.exe create mode 100644 devtools/bin/oldfxc.exe create mode 100644 devtools/bin/osx32/ccache create mode 100644 devtools/bin/osx32/protoc create mode 100644 devtools/bin/osx32/xcode_ccache_wrapper create mode 100644 devtools/bin/playback_getframe.pl create mode 100644 devtools/bin/playback_getstate.pl create mode 100644 devtools/bin/playback_gettexlock.pl create mode 100644 devtools/bin/playback_getvb.pl create mode 100644 devtools/bin/playback_numframes.bat create mode 100644 devtools/bin/playback_numprims.pl create mode 100644 devtools/bin/psh_prep.pl create mode 100644 devtools/bin/putty/LICENCE create mode 100644 devtools/bin/putty/README.txt create mode 100644 devtools/bin/putty/pageant.exe create mode 100644 devtools/bin/putty/plink.exe create mode 100644 devtools/bin/putty/pscp.exe create mode 100644 devtools/bin/putty/psftp.exe create mode 100644 devtools/bin/putty/putty.cnt create mode 100644 devtools/bin/putty/putty.exe create mode 100644 devtools/bin/putty/putty.hlp create mode 100644 devtools/bin/putty/puttycm.exe create mode 100644 devtools/bin/putty/puttygen.exe create mode 100644 devtools/bin/recentchanges.pl create mode 100644 devtools/bin/robocopy.exe create mode 100644 devtools/bin/run_unit_tests.pl create mode 100644 devtools/bin/sed.exe create mode 100644 devtools/bin/separate_vcprojs.py create mode 100644 devtools/bin/setup_vmpi.pl create mode 100644 devtools/bin/shaderinfo.pl create mode 100644 devtools/bin/signcode.exe create mode 100644 devtools/bin/smtpmail.exe create mode 100644 devtools/bin/splitdiff3.pl create mode 100644 devtools/bin/srgb_colorspace.pl create mode 100644 devtools/bin/sscode.exe create mode 100644 devtools/bin/steamlicense.txt create mode 100644 devtools/bin/tee.exe create mode 100644 devtools/bin/test_binaries.exe create mode 100644 devtools/bin/test_linux_compile.pl create mode 100644 devtools/bin/timeprecise.exe create mode 100644 devtools/bin/timethis.exe create mode 100644 devtools/bin/uniqexe.exe create mode 100644 devtools/bin/uniqifylist.pl create mode 100644 devtools/bin/updatecef.bat create mode 100644 devtools/bin/updatecef.sh create mode 100644 devtools/bin/updateshaders.pl create mode 100644 devtools/bin/valve_p4_create_changelist.cmd create mode 100644 devtools/bin/valve_p4_edit_to_changelist.cmd create mode 100644 devtools/bin/valve_perl_helpers.pl create mode 100644 devtools/bin/vmpi_chpass.pl create mode 100644 devtools/bin/vmpi_test.pl create mode 100644 devtools/bin/vpc create mode 100644 devtools/bin/vpc.exe create mode 100644 devtools/bin/vpc.pdb create mode 100644 devtools/bin/vpc2linuxmake.pl create mode 100644 devtools/bin/vpcall.bat create mode 100644 devtools/bin/vpccrccheck.exe create mode 100644 devtools/bin/vpcgames.bat create mode 100644 devtools/bin/vpesign.exe create mode 100644 devtools/bin/vsdotnetxmlparser.py create mode 100644 devtools/bin/vsh_prep.pl create mode 100644 devtools/bin/vtf_flags_convert.pl create mode 100644 devtools/bin/vtfscrewtree.pl create mode 100644 devtools/bin/vzip.exe create mode 100644 devtools/bin/wtf.pl create mode 100644 devtools/bin/wtf.txt create mode 100644 devtools/bin/xbspinfo.exe create mode 100644 devtools/bin/xsync.bat create mode 100644 devtools/build_solution_remote.py create mode 100644 devtools/dbmon/dbmon.c create mode 100644 devtools/dbmon/dbmon.vpc create mode 100644 devtools/debug.xcconfig create mode 100644 devtools/devstudio macros/autoexp.dat create mode 100644 devtools/devstudio macros/comments.dsm create mode 100644 devtools/devstudio macros/usertype.dat create mode 100644 devtools/devstudio templates/valvelib.awx create mode 100644 devtools/devstudio templates/valvelib.hlp create mode 100644 devtools/diffmemstats/diffmemstats.cpp create mode 100644 devtools/diffmemstats/diffmemstats.sln create mode 100644 devtools/diffmemstats/diffmemstats.vpc create mode 100644 devtools/dlexer.py create mode 100644 devtools/ep2_deathmap/ep2_deathmap.cpp create mode 100644 devtools/ep2_deathmap/ep2_deathmap.vpc create mode 100644 devtools/fix_tlog.py create mode 100644 devtools/fix_tlogs.bat create mode 100644 devtools/gendbg.sh create mode 100644 devtools/getmirror/StdAfx.cpp create mode 100644 devtools/getmirror/StdAfx.h create mode 100644 devtools/getmirror/getmirror.cpp create mode 100644 devtools/getmirror/getmirror.vpc create mode 100644 devtools/getmirror/syncfrommirror.bat create mode 100644 devtools/goldsrc_port_scripts/PySourceSafe.py create mode 100644 devtools/goldsrc_port_scripts/VisitFiles.py create mode 100644 devtools/goldsrc_port_scripts/WildcardSearch.py create mode 100644 devtools/goldsrc_port_scripts/find_game_sounds.py create mode 100644 devtools/goldsrc_port_scripts/goldsrc_qc_9way_blends.py create mode 100644 devtools/goldsrc_port_scripts/port_models.py create mode 100644 devtools/goldsrc_port_scripts/qc_origin_fix.py create mode 100644 devtools/macros/EnvironmentEvents.VB create mode 100644 devtools/macros/Module1.VB create mode 100644 devtools/macros/Perforce.VB create mode 100644 devtools/macros/Valve.VB create mode 100644 devtools/macros/Valve.vsmacros create mode 100644 devtools/macros/Valve.vsmproj create mode 100644 devtools/macros/Valve.vsmprojex create mode 100644 devtools/macros/Valve.vsmprojey create mode 100644 devtools/macros/Valve2005.VB create mode 100644 devtools/macros/Valve2005.vsmacros create mode 100644 devtools/makefile_base_posix.mak create mode 100644 devtools/makemissinganims.pl create mode 100644 devtools/mapbuild/buildMaps.pl create mode 100644 devtools/mapbuild/buildall.bat create mode 100644 devtools/mapbuild/buildmod.bat create mode 100644 devtools/mapbuild/readme.txt create mode 100644 devtools/mapbuild/syncChangedMaps.pl create mode 100644 devtools/mat_check.pl create mode 100644 devtools/matcheck_dod.bat create mode 100644 devtools/p4EditChangelist.py create mode 100644 devtools/p4debugscan.py create mode 100644 devtools/p4helpers.py create mode 100644 devtools/p4sizes.py create mode 100644 devtools/p4submit.py create mode 100644 devtools/parse_analyze_errors.py create mode 100644 devtools/processgamestats/StdAfx.cpp create mode 100644 devtools/processgamestats/StdAfx.h create mode 100644 devtools/processgamestats/base_gamestats_parse.h create mode 100644 devtools/processgamestats/cs_gamestats.h create mode 100644 devtools/processgamestats/cstrike_gamestats.db create mode 100644 devtools/processgamestats/cstrike_gamestats_parse.cpp create mode 100644 devtools/processgamestats/ep1_gamestats.db create mode 100644 devtools/processgamestats/ep2_gamestats.db create mode 100644 devtools/processgamestats/ep2_gamestats_parse.cpp create mode 100644 devtools/processgamestats/portal_gamestats.db create mode 100644 devtools/processgamestats/processgamestats.cpp create mode 100644 devtools/processgamestats/processgamestats.vpc create mode 100644 devtools/processgamestats/tf_gamestats.db create mode 100644 devtools/processgamestats/tf_gamestats_parse.cpp create mode 100644 devtools/release.xcconfig create mode 100644 devtools/search_and_replace_template.py create mode 100644 devtools/shotmaker.pl create mode 100644 devtools/smtpmail/simplesocket.cpp create mode 100644 devtools/smtpmail/simplesocket.h create mode 100644 devtools/smtpmail/smtpmail.cpp create mode 100644 devtools/smtpmail/smtpmail.vpc create mode 100644 devtools/sourcesdk_def.mak create mode 100644 devtools/srcdsAppVerifierSettings.reg create mode 100644 devtools/steam_def.mak create mode 100644 devtools/swigwin-1.3.34/Lib/allegrocl/allegrocl.swg create mode 100644 devtools/swigwin-1.3.34/Lib/allegrocl/inout_typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/allegrocl/longlongs.i create mode 100644 devtools/swigwin-1.3.34/Lib/allegrocl/std_list.i create mode 100644 devtools/swigwin-1.3.34/Lib/allegrocl/std_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/allegrocl/typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/allkw.swg create mode 100644 devtools/swigwin-1.3.34/Lib/attribute.i create mode 100644 devtools/swigwin-1.3.34/Lib/carrays.i create mode 100644 devtools/swigwin-1.3.34/Lib/cdata.i create mode 100644 devtools/swigwin-1.3.34/Lib/cffi/cffi.swg create mode 100644 devtools/swigwin-1.3.34/Lib/chicken/chicken.swg create mode 100644 devtools/swigwin-1.3.34/Lib/chicken/chickenkw.swg create mode 100644 devtools/swigwin-1.3.34/Lib/chicken/chickenrun.swg create mode 100644 devtools/swigwin-1.3.34/Lib/chicken/extra-install.list create mode 100644 devtools/swigwin-1.3.34/Lib/chicken/multi-generic.scm create mode 100644 devtools/swigwin-1.3.34/Lib/chicken/std_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/chicken/swigclosprefix.scm create mode 100644 devtools/swigwin-1.3.34/Lib/chicken/tinyclos-multi-generic.patch create mode 100644 devtools/swigwin-1.3.34/Lib/chicken/typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/clisp/clisp.swg create mode 100644 devtools/swigwin-1.3.34/Lib/cmalloc.i create mode 100644 devtools/swigwin-1.3.34/Lib/constraints.i create mode 100644 devtools/swigwin-1.3.34/Lib/cpointer.i create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/boost_shared_ptr.i create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/csharp.swg create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/csharphead.swg create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/csharpkw.swg create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/director.swg create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/enums.swg create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/enumsimple.swg create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/enumtypesafe.swg create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/std_common.i create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/std_deque.i create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/std_except.i create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/std_map.i create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/std_pair.i create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/std_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/std_vector.i create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/std_wstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/stl.i create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/csharp/wchar.i create mode 100644 devtools/swigwin-1.3.34/Lib/cstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/cwstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/exception.i create mode 100644 devtools/swigwin-1.3.34/Lib/gcj/cni.i create mode 100644 devtools/swigwin-1.3.34/Lib/gcj/cni.swg create mode 100644 devtools/swigwin-1.3.34/Lib/gcj/javaprims.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/Makefile create mode 100644 devtools/swigwin-1.3.34/Lib/guile/common.scm create mode 100644 devtools/swigwin-1.3.34/Lib/guile/cplusplus.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/extra-install.list create mode 100644 devtools/swigwin-1.3.34/Lib/guile/ghinterface.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/guile.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/guile_gh.swg create mode 100644 devtools/swigwin-1.3.34/Lib/guile/guile_gh_run.swg create mode 100644 devtools/swigwin-1.3.34/Lib/guile/guile_scm.swg create mode 100644 devtools/swigwin-1.3.34/Lib/guile/guile_scm_run.swg create mode 100644 devtools/swigwin-1.3.34/Lib/guile/guilemain.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/interpreter.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/list-vector.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/pointer-in-out.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/ports.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/std_common.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/std_deque.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/std_except.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/std_map.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/std_pair.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/std_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/std_vector.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/stl.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/swigrun.i create mode 100644 devtools/swigwin-1.3.34/Lib/guile/typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/inttypes.i create mode 100644 devtools/swigwin-1.3.34/Lib/java/arrays_java.i create mode 100644 devtools/swigwin-1.3.34/Lib/java/boost_shared_ptr.i create mode 100644 devtools/swigwin-1.3.34/Lib/java/director.swg create mode 100644 devtools/swigwin-1.3.34/Lib/java/enums.swg create mode 100644 devtools/swigwin-1.3.34/Lib/java/enumsimple.swg create mode 100644 devtools/swigwin-1.3.34/Lib/java/enumtypesafe.swg create mode 100644 devtools/swigwin-1.3.34/Lib/java/enumtypeunsafe.swg create mode 100644 devtools/swigwin-1.3.34/Lib/java/java.swg create mode 100644 devtools/swigwin-1.3.34/Lib/java/javahead.swg create mode 100644 devtools/swigwin-1.3.34/Lib/java/javakw.swg create mode 100644 devtools/swigwin-1.3.34/Lib/java/std_common.i create mode 100644 devtools/swigwin-1.3.34/Lib/java/std_deque.i create mode 100644 devtools/swigwin-1.3.34/Lib/java/std_except.i create mode 100644 devtools/swigwin-1.3.34/Lib/java/std_map.i create mode 100644 devtools/swigwin-1.3.34/Lib/java/std_pair.i create mode 100644 devtools/swigwin-1.3.34/Lib/java/std_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/java/std_vector.i create mode 100644 devtools/swigwin-1.3.34/Lib/java/std_wstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/java/stl.i create mode 100644 devtools/swigwin-1.3.34/Lib/java/typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/java/various.i create mode 100644 devtools/swigwin-1.3.34/Lib/linkruntime.c create mode 100644 devtools/swigwin-1.3.34/Lib/lua/_std_common.i create mode 100644 devtools/swigwin-1.3.34/Lib/lua/carrays.i create mode 100644 devtools/swigwin-1.3.34/Lib/lua/lua.swg create mode 100644 devtools/swigwin-1.3.34/Lib/lua/lua_fnptr.i create mode 100644 devtools/swigwin-1.3.34/Lib/lua/luarun.swg create mode 100644 devtools/swigwin-1.3.34/Lib/lua/luaruntime.swg create mode 100644 devtools/swigwin-1.3.34/Lib/lua/luatypemaps.swg create mode 100644 devtools/swigwin-1.3.34/Lib/lua/std_common.i create mode 100644 devtools/swigwin-1.3.34/Lib/lua/std_deque.i create mode 100644 devtools/swigwin-1.3.34/Lib/lua/std_except.i create mode 100644 devtools/swigwin-1.3.34/Lib/lua/std_map.i create mode 100644 devtools/swigwin-1.3.34/Lib/lua/std_pair.i create mode 100644 devtools/swigwin-1.3.34/Lib/lua/std_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/lua/std_vector.i create mode 100644 devtools/swigwin-1.3.34/Lib/lua/stl.i create mode 100644 devtools/swigwin-1.3.34/Lib/lua/typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/lua/wchar.i create mode 100644 devtools/swigwin-1.3.34/Lib/math.i create mode 100644 devtools/swigwin-1.3.34/Lib/modula3/modula3.swg create mode 100644 devtools/swigwin-1.3.34/Lib/modula3/modula3head.swg create mode 100644 devtools/swigwin-1.3.34/Lib/modula3/typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/mzscheme/Makefile create mode 100644 devtools/swigwin-1.3.34/Lib/mzscheme/mzrun.swg create mode 100644 devtools/swigwin-1.3.34/Lib/mzscheme/mzscheme.swg create mode 100644 devtools/swigwin-1.3.34/Lib/mzscheme/std_common.i create mode 100644 devtools/swigwin-1.3.34/Lib/mzscheme/std_deque.i create mode 100644 devtools/swigwin-1.3.34/Lib/mzscheme/std_map.i create mode 100644 devtools/swigwin-1.3.34/Lib/mzscheme/std_pair.i create mode 100644 devtools/swigwin-1.3.34/Lib/mzscheme/std_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/mzscheme/std_vector.i create mode 100644 devtools/swigwin-1.3.34/Lib/mzscheme/stl.i create mode 100644 devtools/swigwin-1.3.34/Lib/mzscheme/typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/carray.i create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/class.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/cstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/director.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/extra-install.list create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/libswigocaml.h create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/ocaml.i create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/ocaml.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/ocamldec.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/ocamlkw.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/preamble.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/std_common.i create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/std_complex.i create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/std_deque.i create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/std_list.i create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/std_map.i create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/std_pair.i create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/std_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/std_vector.i create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/stl.i create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/swig.ml create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/swig.mli create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/swigp4.ml.in create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/typecheck.i create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/ocaml/typeregister.swg create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/Makefile.in create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/Makefile.pl create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/attribute.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/carrays.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/cdata.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/cmalloc.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/cni.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/cpointer.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/cstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/exception.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/extra-install.list create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/factory.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/jstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/noembed.h create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/perl5.swg create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/perlerrors.swg create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/perlfragments.swg create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/perlhead.swg create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/perlinit.swg create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/perlkw.swg create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/perlmacros.swg create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/perlmain.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/perlopers.swg create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/perlprimtypes.swg create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/perlrun.swg create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/perlruntime.swg create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/perlstrings.swg create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/perltypemaps.swg create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/perluserdir.swg create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/reference.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/std_common.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/std_deque.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/std_except.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/std_list.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/std_map.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/std_pair.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/std_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/std_vector.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/stl.i create mode 100644 devtools/swigwin-1.3.34/Lib/perl5/typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/php4/const.i create mode 100644 devtools/swigwin-1.3.34/Lib/php4/globalvar.i create mode 100644 devtools/swigwin-1.3.34/Lib/php4/php4.swg create mode 100644 devtools/swigwin-1.3.34/Lib/php4/php4init.swg create mode 100644 devtools/swigwin-1.3.34/Lib/php4/php4kw.swg create mode 100644 devtools/swigwin-1.3.34/Lib/php4/php4run.swg create mode 100644 devtools/swigwin-1.3.34/Lib/php4/phppointers.i create mode 100644 devtools/swigwin-1.3.34/Lib/php4/std_common.i create mode 100644 devtools/swigwin-1.3.34/Lib/php4/std_deque.i create mode 100644 devtools/swigwin-1.3.34/Lib/php4/std_map.i create mode 100644 devtools/swigwin-1.3.34/Lib/php4/std_pair.i create mode 100644 devtools/swigwin-1.3.34/Lib/php4/std_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/php4/std_vector.i create mode 100644 devtools/swigwin-1.3.34/Lib/php4/stl.i create mode 100644 devtools/swigwin-1.3.34/Lib/php4/typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/php4/utils.i create mode 100644 devtools/swigwin-1.3.34/Lib/pike/pike.swg create mode 100644 devtools/swigwin-1.3.34/Lib/pike/pikekw.swg create mode 100644 devtools/swigwin-1.3.34/Lib/pike/pikerun.swg create mode 100644 devtools/swigwin-1.3.34/Lib/pike/std_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/pointer.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/Makefile.in create mode 100644 devtools/swigwin-1.3.34/Lib/python/README create mode 100644 devtools/swigwin-1.3.34/Lib/python/argcargv.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/attribute.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/boost_shared_ptr.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/carrays.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/ccomplex.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/cdata.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/cmalloc.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/cni.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/complex.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/cpointer.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/cstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/cwstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/defarg.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/director.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/embed.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/embed15.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/exception.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/factory.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/file.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/implicit.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/jstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/pyapi.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pybackward.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pyclasses.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pycomplex.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pycontainer.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pydocs.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pyerrors.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pyfragments.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pyhead.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pyinit.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pyiterators.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pymacros.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pyopers.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pyprimtypes.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pyrun.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pyruntime.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pystdcommon.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pystrings.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/python.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pythonkw.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pythreads.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pytuplehlp.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pytypemaps.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pyuserdir.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/pywstrings.swg create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_alloc.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_basic_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_carray.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_char_traits.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_common.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_complex.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_container.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_deque.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_except.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_ios.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_iostream.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_list.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_map.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_multimap.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_multiset.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_pair.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_set.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_sstream.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_streambuf.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_vector.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_vectora.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_wios.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_wiostream.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_wsstream.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_wstreambuf.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/std_wstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/stl.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/python/wchar.i create mode 100644 devtools/swigwin-1.3.34/Lib/r/cdata.i create mode 100644 devtools/swigwin-1.3.34/Lib/r/exception.i create mode 100644 devtools/swigwin-1.3.34/Lib/r/r.swg create mode 100644 devtools/swigwin-1.3.34/Lib/r/rcontainer.swg create mode 100644 devtools/swigwin-1.3.34/Lib/r/rfragments.swg create mode 100644 devtools/swigwin-1.3.34/Lib/r/ropers.swg create mode 100644 devtools/swigwin-1.3.34/Lib/r/rrun.swg create mode 100644 devtools/swigwin-1.3.34/Lib/r/rstdcommon.swg create mode 100644 devtools/swigwin-1.3.34/Lib/r/rtype.swg create mode 100644 devtools/swigwin-1.3.34/Lib/r/srun.swg create mode 100644 devtools/swigwin-1.3.34/Lib/r/std_alloc.i create mode 100644 devtools/swigwin-1.3.34/Lib/r/std_common.i create mode 100644 devtools/swigwin-1.3.34/Lib/r/std_container.i create mode 100644 devtools/swigwin-1.3.34/Lib/r/std_deque.i create mode 100644 devtools/swigwin-1.3.34/Lib/r/std_except.i create mode 100644 devtools/swigwin-1.3.34/Lib/r/std_pair.i create mode 100644 devtools/swigwin-1.3.34/Lib/r/std_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/r/std_vector.i create mode 100644 devtools/swigwin-1.3.34/Lib/r/stl.i create mode 100644 devtools/swigwin-1.3.34/Lib/r/typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/Makefile.swig create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/argcargv.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/attribute.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/carrays.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/cdata.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/cmalloc.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/cni.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/cpointer.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/cstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/director.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/embed.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/exception.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/extconf.rb create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/extra-install.list create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/factory.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/file.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/jstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/progargcargv.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/ruby.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubyapi.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubyautodoc.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubyclasses.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubycomplex.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubycontainer.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubycontainer_extended.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubydef.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubyerrors.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubyfragments.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubyhead.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubyinit.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubyiterators.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubykw.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubymacros.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubyopers.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubyprimtypes.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubyrun.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubyruntime.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubystdautodoc.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubystdcommon.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubystdfunctors.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubystrings.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubytracking.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubytypemaps.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubyuserdir.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/rubywstrings.swg create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_alloc.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_basic_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_char_traits.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_common.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_complex.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_container.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_deque.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_except.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_functors.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_ios.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_iostream.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_list.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_map.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_multimap.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_multiset.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_pair.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_queue.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_set.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_sstream.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_stack.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_streambuf.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_vector.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_vectora.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/std_wstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/stl.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/timeval.i create mode 100644 devtools/swigwin-1.3.34/Lib/ruby/typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/runtime.swg create mode 100644 devtools/swigwin-1.3.34/Lib/shared_ptr.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/README create mode 100644 devtools/swigwin-1.3.34/Lib/std/_std_deque.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_alloc.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_basic_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_carray.swg create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_char_traits.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_common.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_container.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_deque.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_except.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_ios.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_iostream.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_list.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_map.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_multimap.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_multiset.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_pair.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_queue.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_set.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_sstream.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_stack.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_streambuf.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_vector.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_vectora.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_wios.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_wiostream.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_wsstream.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_wstreambuf.i create mode 100644 devtools/swigwin-1.3.34/Lib/std/std_wstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/std_except.i create mode 100644 devtools/swigwin-1.3.34/Lib/stdint.i create mode 100644 devtools/swigwin-1.3.34/Lib/stl.i create mode 100644 devtools/swigwin-1.3.34/Lib/swig.swg create mode 100644 devtools/swigwin-1.3.34/Lib/swigarch.i create mode 100644 devtools/swigwin-1.3.34/Lib/swigerrors.swg create mode 100644 devtools/swigwin-1.3.34/Lib/swiginit.swg create mode 100644 devtools/swigwin-1.3.34/Lib/swiglabels.swg create mode 100644 devtools/swigwin-1.3.34/Lib/swigrun.i create mode 100644 devtools/swigwin-1.3.34/Lib/swigrun.swg create mode 100644 devtools/swigwin-1.3.34/Lib/swigwarn.swg create mode 100644 devtools/swigwin-1.3.34/Lib/swigwarnings.swg create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/Makefile.in create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/attribute.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/carrays.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/cdata.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/cmalloc.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/cni.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/cpointer.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/cstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/cwstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/exception.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/factory.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/jstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/mactclinit.c create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/mactkinit.c create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/std_common.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/std_deque.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/std_except.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/std_map.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/std_pair.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/std_string.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/std_vector.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/std_wstring.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/stl.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tcl8.swg create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tclapi.swg create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tclerrors.swg create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tclfragments.swg create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tclinit.swg create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tclinterp.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tclkw.swg create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tclmacros.swg create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tclopers.swg create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tclprimtypes.swg create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tclresult.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tclrun.swg create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tclruntime.swg create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tclsh.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tclstrings.swg create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tcltypemaps.swg create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tcluserdir.swg create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/tclwstrings.swg create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/tcl/wish.i create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/README create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/attribute.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/carrays.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/cdata.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/cmalloc.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/cpointer.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/cstring.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/cstrings.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/cwstring.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/enumint.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/exception.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/factory.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/fragments.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/implicit.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/inoutlist.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/misctypes.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/primtypes.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/ptrtypes.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/std_except.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/std_string.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/std_strings.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/std_wstring.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/string.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/strings.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/swigmacros.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/swigobject.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/swigtype.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/swigtypemaps.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/traits.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/typemaps.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/valtypes.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/void.swg create mode 100644 devtools/swigwin-1.3.34/Lib/typemaps/wstring.swg create mode 100644 devtools/swigwin-1.3.34/Lib/uffi/uffi.swg create mode 100644 devtools/swigwin-1.3.34/Lib/wchar.i create mode 100644 devtools/swigwin-1.3.34/Lib/windows.i create mode 100644 devtools/swigwin-1.3.34/Lib/xml/typemaps.i create mode 100644 devtools/swigwin-1.3.34/Lib/xml/xml.swg create mode 100644 devtools/swigwin-1.3.34/foo.bat create mode 100644 devtools/swigwin-1.3.34/swig.exe create mode 100644 devtools/syncfrommirror/Redir.cpp create mode 100644 devtools/syncfrommirror/Redir.h create mode 100644 devtools/syncfrommirror/Redirect.cpp create mode 100644 devtools/syncfrommirror/Redirect.h create mode 100644 devtools/syncfrommirror/StdAfx.cpp create mode 100644 devtools/syncfrommirror/StdAfx.h create mode 100644 devtools/syncfrommirror/res/syncfrommirror.ico create mode 100644 devtools/syncfrommirror/res/syncfrommirror.rc2 create mode 100644 devtools/syncfrommirror/resource.h create mode 100644 devtools/syncfrommirror/syncfrommirror.cpp create mode 100644 devtools/syncfrommirror/syncfrommirror.h create mode 100644 devtools/syncfrommirror/syncfrommirror.rc create mode 100644 devtools/syncfrommirror/syncfrommirror.vpc create mode 100644 devtools/syncfrommirror/syncfrommirrorDlg.cpp create mode 100644 devtools/syncfrommirror/syncfrommirrorDlg.h create mode 100644 devtools/tagbuild/StdAfx.cpp create mode 100644 devtools/tagbuild/StdAfx.h create mode 100644 devtools/tagbuild/tagbuild.cpp create mode 100644 devtools/tagbuild/tagbuild.vpc create mode 100644 devtools/test_binaries/COMMON.C create mode 100644 devtools/test_binaries/COMMON.H create mode 100644 devtools/test_binaries/EXEDUMP.C create mode 100644 devtools/test_binaries/EXEDUMP.H create mode 100644 devtools/test_binaries/EXTRNVAR.H create mode 100644 devtools/test_binaries/OBJDUMP.C create mode 100644 devtools/test_binaries/OBJDUMP.H create mode 100644 devtools/test_binaries/PEDUMP.C create mode 100644 devtools/test_binaries/test_binaries.cpp create mode 100644 devtools/test_binaries/test_binaries.vpc create mode 100644 devtools/tf2AppVerifierSettings.reg create mode 100644 devtools/vcodepickle.py create mode 100644 devtools/version_script.linux.txt create mode 100644 devtools/vs_nop_tools/lib.exe create mode 100644 devtools/vs_nop_tools/link.exe create mode 100644 devtools/vs_nop_tools/mt.exe create mode 100644 devtools/vs_nop_tools/readme.txt create mode 100644 devtools/vstools/mt.exe create mode 100644 devtools/vstools/readme.txt (limited to 'devtools') diff --git a/devtools/AddFunctionPrologue.py b/devtools/AddFunctionPrologue.py new file mode 100644 index 0000000..8d44f8d --- /dev/null +++ b/devtools/AddFunctionPrologue.py @@ -0,0 +1,116 @@ + + +# Assuming all functions begin with ')' followed by '{', just find the matching brace and +# add a line with 'g_pVCR->SyncToken("");' + +import dlexer +import sys + + +class BlankStruct: + pass + + +def MatchParensBack( list, iStart ): + parenCount = -1 + for i in range( 0, iStart ): + if list[iStart-i].id == __TOKEN_OPENPAREN: + parenCount += 1 + elif list[iStart-i].id == __TOKEN_CLOSEPAREN: + parenCount -= 1 + + if parenCount == 0: + return iStart - i + + return -1 + + +if len( sys.argv ) >= 2: + + # Setup the parser. + parser = dlexer.DLexer( 0 ) + + __TOKEN_NEWLINE = parser.AddToken( '\n' ) + __TOKEN_WHITESPACE = parser.AddToken( '[ \\t\\f\\v]+' ) + __TOKEN_OPENBRACE = parser.AddToken( '{' ) + __TOKEN_CLOSEBRACE = parser.AddToken( '}' ) + __TOKEN_OPENPAREN = parser.AddToken( '\(' ) + __TOKEN_CLOSEPAREN = parser.AddToken( '\)' ) + __TOKEN_COMMENT = parser.AddToken( r"\/\/.*" ) + + __TOKEN_CONST = parser.AddToken( "const" ) + __TOKEN_IF = parser.AddToken( "if" ) + __TOKEN_WHILE = parser.AddToken( "while" ) + __TOKEN_FOR = parser.AddToken( "for" ) + __TOKEN_SWITCH = parser.AddToken( "switch" ) + + validChars = r"\~\@\#\$\%\^\&\!\,\w\.-/\[\]\<\>\"" + __TOKEN_IDENT = parser.AddToken( '[' + validChars + ']+' ) + __TOKEN_OPERATOR = parser.AddToken( "\=|\+" ) + __TOKEN_SCOPE_OPERATOR = parser.AddToken( "::" ) + __TOKEN_IGNORE = parser.AddToken( r"\#|\;|\:|\||\?|\'|\\|\*|\-|\`" ) + + head = None + + # First, read all the tokens into a list. + list = [] + parser.BeginReadFile( sys.argv[1] ) + while 1: + m = parser.GetToken() + if m: + list.append( m ) + else: + break + + + # Make a list of all the non-whitespace ones. + nw = [] + for token in list: + if token.id == __TOKEN_NEWLINE or token.id == __TOKEN_WHITESPACE: + token.iNonWhitespace = -2222 + else: + token.iNonWhitespace = len( nw ) + nw.append( token ) + + + # Get ready to output sync tokens. + file = open( sys.argv[1], 'r' ) + fileLines = file.readlines() + file.close() + + + curLine = 1 + iCur = 0 + + file = open( sys.argv[1], 'w' ) + + # Now, search for the patterns we're interested in. + # Look for :: '(' ')' followed by a '{'. This would be a function. + for token in list: + file.write( token.val ) + if token.id == __TOKEN_NEWLINE: + curLine += 1 + + if token.id == __TOKEN_OPENBRACE: + i = token.iNonWhitespace + if i >= 6: + if nw[i-1].id == __TOKEN_CLOSEPAREN: + pos = MatchParensBack( nw, i-2 ) + if pos != -1: + if nw[pos-1].id == __TOKEN_IDENT: + #ADD PROLOGUE CODE HERE + #file.write( "\n\tg_pVCR->SyncToken( \"%d_%s\" ); // AUTO-GENERATED SYNC TOKEN\n" % (iCur, nw[pos-1].val) ) + iCur += 1 + + # TEST CODE TO PRINT OUT FUNCTION NAMES + #if nw[pos-2].id == __TOKEN_SCOPE_OPERATOR: + # print "%d: %s::%s" % ( curLine, nw[pos-3].val, nw[pos-1].val ) + #else: + # print "%d: %s" % ( curLine, nw[pos-1].val ) + + file.close() + +else: + + print "VCRMode_AddSyncTokens " + diff --git a/devtools/CheckSurfaceProps.py b/devtools/CheckSurfaceProps.py new file mode 100644 index 0000000..80ee6c7 --- /dev/null +++ b/devtools/CheckSurfaceProps.py @@ -0,0 +1,153 @@ + +import WildcardSearch +import sys +import re +import os + + +curProps = {} + + +modelsContentFallbackDir = "c:\\hl2\\hl2\\models" +modelsContentDir = "c:\\hl2\\cstrike\\models" + +materialsFallbackDir = "c:\\hl2\\hl2\\materials" +materialsDir = "c:\\hl2\\cstrike\\materials" +mapsDir = "c:\\hl2\\cstrike\\maps" +exeDir = "c:\\hl2\\bin" + + +# RE to look for '$surfaceProp blah' +surfacePropRE = re.compile( r'\"?\$surfaceprop\"?\s+\"?(?P[^\"]+)\"?', re.IGNORECASE ) + + + +# ------------------------------------------------------------------------------------------- # +# Helper functions. +# ------------------------------------------------------------------------------------------- # + +def FileExists(f): + try: + file = open(f) + except IOError: + exists = 0 + else: + exists = 1 + file.close() + return exists + + +def PrintFilename( filename ): + print filename + + +def SearchFile( filename ): + f = open( filename, "rt" ) + + PrintFilename( filename ) + + fileData = f.read() + match = surfacePropRE.search( fileData ) + if match: + propName = match.group( 1 ).upper() + curProps[propName] = 1 + + f.close() + + + +# ------------------------------------------------------------------------------------------- # +# Search all the map files for texture names and model files. +# ------------------------------------------------------------------------------------------- # + +usedVMTFiles = {} +modelFiles = {} + + +# RE to look for 'material blah' +materialRE = re.compile( r'\"?\material\"?\s+\"?(?P[^\"]+)\"?', re.IGNORECASE ) + +# Look for a model name referenced in the VMF file. +modelRE = re.compile( r'\"models\/(?P.+)\.mdl\"', re.IGNORECASE ) + + +files = WildcardSearch.WildcardSearch( mapsDir + "\\*.vmf", 1 ) +for filename in files: + f = open( filename, "rt" ) + fileData = f.read() + f.close() + + PrintFilename( filename ) + + # Get all the model names. + allMatches = modelRE.findall( fileData ) + for match in allMatches: + modelFiles[match.upper()] = 1 + + # Get all the texture names. + allMatches = materialRE.findall( fileData ) + for match in allMatches: + vmtName = match + usedVMTFiles[vmtName] = 1 + + +# ------------------------------------------------------------------------------------------- # +# Search all the model files for surface props. +# ------------------------------------------------------------------------------------------- # + +# Make sure we look at ALL models in the CStrike folder. +for filename in WildcardSearch.WildcardSearch( modelsContentDir + "\\*.mdl", 1 ): + modelFiles[filename.upper()] = 1 + +for iModel in modelFiles.keys(): + iModel = iModel.replace( "/", "\\" ) + filename = modelsContentDir + "\\" + iModel + ".mdl" + if not FileExists( filename ): + filename = modelsContentFallbackDir + "\\" + iModel + ".mdl" + + if FileExists( filename ): + PrintFilename( filename ) + + cmd = exeDir + "\\studiomdl.exe -PrintSurfaceProps " + filename + f = os.popen( cmd ) + if f: + output = f.readlines() + returnValue = f.close() + + if returnValue == None: + for line in output: + curProps[line.upper().strip()] = 1 + + + +# ------------------------------------------------------------------------------------------- # +# Search all the texture files for surface props. +# ------------------------------------------------------------------------------------------- # + +for iFile in usedVMTFiles.keys(): + filename = materialsDir + "\\" + iFile + ".vmt" + if not FileExists( filename ): + filename = materialsFallbackDir + "\\" + iFile + ".vmt" + + if FileExists( filename ): + SearchFile( filename ) + + + + +# ------------------------------------------------------------------------------------------- # +# Output the results. +# ------------------------------------------------------------------------------------------- # + +print "\n" +print "---------------------------------" +print "- Surface types found" +print "---------------------------------\n" + +sortedList = [x for x in curProps.keys()] +sortedList.sort() + +for x in sortedList: + print x + + diff --git a/devtools/DisableAppVerifier.bat b/devtools/DisableAppVerifier.bat new file mode 100644 index 0000000..86c2931 --- /dev/null +++ b/devtools/DisableAppVerifier.bat @@ -0,0 +1,7 @@ +@echo Created per the instructions at https://intranet.valvesoftware.com/wiki/index.php/AppVerifier_for_finding_memory_bugs_and_other_problems +@echo Disabling AppVerifier for TF2 +@echo This must be run with administrator privileges + +reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\hl2.exe" /f +@rem Delete from the Wow64 node as well, just to be sure. +reg delete "HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\hl2.exe" /f diff --git a/devtools/DisableSrcdsAppVerifier.bat b/devtools/DisableSrcdsAppVerifier.bat new file mode 100644 index 0000000..55c754d --- /dev/null +++ b/devtools/DisableSrcdsAppVerifier.bat @@ -0,0 +1,7 @@ +@echo Created per the instructions at https://intranet.valvesoftware.com/wiki/index.php/AppVerifier_for_finding_memory_bugs_and_other_problems +@echo Disabling AppVerifier for srcds +@echo This must be run with administrator privileges + +reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\srcds.exe" /f +@rem Delete from the Wow64 node as well, just to be sure. +reg delete "HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\srcds.exe" /f diff --git a/devtools/EnableAppVerifier.bat b/devtools/EnableAppVerifier.bat new file mode 100644 index 0000000..7a20100 --- /dev/null +++ b/devtools/EnableAppVerifier.bat @@ -0,0 +1,12 @@ +@echo Created per the instructions at https://intranet.valvesoftware.com/wiki/index.php/AppVerifier_for_finding_memory_bugs_and_other_problems +@echo Enabling AppVerifier with reasonable settings for TF2 +@echo This must be run with administrator privileges + +@rem The settings are created using the App Verifier UI and can be exported to the .reg file +@rem with this command: +@rem REG EXPORT "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\hl2.exe" tf2AppVerifierSettings.reg /y + +@rem Import the App Verifier settings +reg import %~dp0tf2AppVerifierSettings.reg +@rem Increase the size of the database of alloc/free stacks from 8 MB (too small) to 100 MB. +reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\hl2.exe" /v StackTraceDatabaseSizeInMB /t REG_DWORD /d 100 /f diff --git a/devtools/EnableSrcdsAppVerifier.bat b/devtools/EnableSrcdsAppVerifier.bat new file mode 100644 index 0000000..1625540 --- /dev/null +++ b/devtools/EnableSrcdsAppVerifier.bat @@ -0,0 +1,12 @@ +@echo Created per the instructions at https://intranet.valvesoftware.com/wiki/index.php/AppVerifier_for_finding_memory_bugs_and_other_problems +@echo Enabling AppVerifier with reasonable settings for srcds +@echo This must be run with administrator privileges + +@rem The settings are created using the App Verifier UI and can be exported to the .reg file +@rem with this command: +@rem REG EXPORT "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\srcds.exe" srcdsAppVerifierSettings.reg /y + +@rem Import the App Verifier settings +reg import %~dp0srcdsAppVerifierSettings.reg +@rem Increase the size of the database of alloc/free stacks from 8 MB (too small) to 100 MB. +reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\srcds.exe" /v StackTraceDatabaseSizeInMB /t REG_DWORD /d 100 /f diff --git a/devtools/FindClasses.py b/devtools/FindClasses.py new file mode 100644 index 0000000..ea9f490 --- /dev/null +++ b/devtools/FindClasses.py @@ -0,0 +1,97 @@ + + +# Assuming all functions begin with ')' followed by '{', just find the matching brace and +# add a line with 'g_pVCR->SyncToken("");' + +import dlexer +import sys +import WildcardSearch + + +class BlankStruct: + pass + + +def MatchParensBack( list, iStart ): + parenCount = -1 + for i in range( 0, iStart ): + if list[iStart-i].id == __TOKEN_OPENPAREN: + parenCount += 1 + elif list[iStart-i].id == __TOKEN_CLOSEPAREN: + parenCount -= 1 + + if parenCount == 0: + return iStart - i + + return -1 + + +# Setup the parser. +parser = dlexer.DLexer( 0 ) + +__TOKEN_NEWLINE = parser.AddToken( '\n' ) +__TOKEN_WHITESPACE = parser.AddToken( '[ \\t\\f\\v]+' ) +__TOKEN_OPENBRACE = parser.AddToken( '{' ) +__TOKEN_CLOSEBRACE = parser.AddToken( '}' ) +__TOKEN_OPENPAREN = parser.AddToken( '\(' ) +__TOKEN_CLOSEPAREN = parser.AddToken( '\)' ) +__TOKEN_COMMENT = parser.AddToken( r"\/\/.*" ) + +__TOKEN_CONST = parser.AddToken( "const" ) +__TOKEN_IF = parser.AddToken( "if" ) +__TOKEN_WHILE = parser.AddToken( "while" ) +__TOKEN_FOR = parser.AddToken( "for" ) +__TOKEN_SWITCH = parser.AddToken( "switch" ) +__TOKEN_CLASS = parser.AddToken( "class" ) +__TOKEN_PUBLIC = parser.AddToken( "public" ) +__TOKEN_TYPEDEF = parser.AddToken( "typedef" ) +__TOKEN_BASECLASS = parser.AddToken( "BaseClass" ) + +validChars = r"\~\@\#\$\%\^\&\!\w\.-/\[\]\<\>\"" +__TOKEN_IDENT = parser.AddToken( '[' + validChars + ']+' ) +__TOKEN_OPERATOR = parser.AddToken( "\=|\+" ) +__TOKEN_SCOPE_OPERATOR = parser.AddToken( "::" ) +__TOKEN_COLON = parser.AddToken( ":" ) +__TOKEN_IGNORE = parser.AddToken( r"\#|\;|\:|\||\?|\'|\\|\*|\-|\`|\," ) + +for i in range( 1, len( sys.argv ) ): + for filename in WildcardSearch.WildcardSearch( sys.argv[i] ): + + head = None + + # First, read all the tokens into a list. + list = [] + parser.BeginReadFile( filename ) + while 1: + m = parser.GetToken() + if m: + list.append( m ) + else: + break + + + # Make a list of all the non-whitespace ones. + nw = [] + for token in list: + if token.id == __TOKEN_NEWLINE or token.id == __TOKEN_WHITESPACE: + token.iNonWhitespace = -2222 + else: + token.iNonWhitespace = len( nw ) + nw.append( token ) + + curLine = 1 + + # Now, search for the patterns we're interested in. + # Look for 'class : public { + curClassName = "" + curBaseClassName = "" + for token in list: + if token.id == __TOKEN_NEWLINE: + curLine += 1 + elif token.id == __TOKEN_CLASS: + i = token.iNonWhitespace + if nw[i+1].id == __TOKEN_IDENT and nw[i+2].id == __TOKEN_COLON and nw[i+3].id == __TOKEN_PUBLIC and nw[i+4].id == __TOKEN_IDENT: + curClassName = nw[i+1].val + curBaseClassName = nw[i+4].val + print "class %s : public %s" % (curClassName, curBaseClassName) + diff --git a/devtools/GDPerf.sys b/devtools/GDPerf.sys new file mode 100644 index 0000000..fc2a458 Binary files /dev/null and b/devtools/GDPerf.sys differ diff --git a/devtools/PME.reg b/devtools/PME.reg new file mode 100644 index 0000000..0868360 Binary files /dev/null and b/devtools/PME.reg differ diff --git a/devtools/PMELib.htm b/devtools/PMELib.htm new file mode 100644 index 0000000..7c5e06c --- /dev/null +++ b/devtools/PMELib.htm @@ -0,0 +1,206 @@ + + + + + + + +New Page 1 + + + + +

PMELib 1.0

+

Introduction

+

    This library is an interface to the Performance Monitoring +Events (PME) that are available in the Pentium P5, P6 and P4 processors.  +There are 18 counters that let you gather information about what the processor is +going during execution.  They are described in these manuals:

+
+

IA-32 + Intel Architecture Software Developer's Manual Volume 1: Basic Architecture

+

IA-32 + Intel Architecture Software Developer's Manual Volume 2A: Instruction Set + Reference, A-M

+

IA-32 + Intel Architecture Software Developer's Manual Volume 2B: Instruction Set + Reference, N-Z

+

IA-32 + Intel Architecture Software Developer's Manual Volume 3: System Programming + Guide

+

        See + chapter 15, Appendix A and Appendix B

+
+

Pentium 4 documentation is available here

+

This library  is an extension to the utilities from the Game Developer's +Magazine article +by Robert Wyatt in May 1998.  The library is now in a class and included +the Pentium 4 processor.  Only Intel is currently supported and +tested.  

+

 

+

Send feedback to doug@nvidia.com

+

 

+

 

+

Installation

+

    Window NT and Windows XP are supported and tested.  +Win98 may work, however.

+

    

+

    You need to install a driver, set some registry settings +and reboot.  If you installed the GDPerf.sys from the GD magazine article, +you can skip the installation step. It uses the same driver.  Let me know +if you have problems.

+

        In the Installation +directory

+

            copy +GDPerf.sys to the window driver directory

+

                        +copy GDPerf.sys C:\windows\system32\drivers

+

                    +there is a batch file as an example

+

            Run the +PMELib.reg file to set the registry settings

+

            Reboot

+

 

+

Configuring PMELib 

+

For P5 and P6 processors (anything before Pentium 4), You use the same +interfaces that are described in the Game Developer article.  They have +just been incorporated in to the PMELib as is.

+

In the Pentium 4, are 18 performance +monitoring counters and more than 40 Events Modes that can be captured.  +Each Mode has a bit mask that indicates which tests to perform.  These are +described in Appendix A of IA-32 +Intel Architecture Software Developer's Manual Volume 3: System Programming +Guide   Each of these event +mode has a class dedicated to it.  The event modes are listed below.

+
+

Set PerfTest2 for an example.

+

Step 1) Choose an Event Mode class

+

    Example:

+

           + Event_branch_retired event;

+

 

+

Step 2)  Set the Event Mask for the selected Event + Mode

+

    Example:

+

        event.eventMask->MMNP = 1;

+

        event.eventMask->MMTP = 1;

+

 

+

Step 3)  Set the privilege level to capture data + from with the SetCaptureMode method

+
+

OS_Only, // ring 0, driver  + level only +

+

USR_Only, // app level, privilege + levels  1 2 and 3 +

+

OS_and_USR, // all levels 0, 1, 2 + and 3 + +

+
+

        Optionally, you + can enable tagging in the SetCaptureMode method.

+

        Example:

+

                + SetCaptureMode(OS_and_USR, TagEnable, 34);

+

 

+

Step 4) Optional Configuration

+

        At this + point you can configure Tagging, Filtering, Overflow and Cascading + options.  You can also select one of the legal counters for the selected + Event Mode.

+

Step 5) Set the process priority to high

+
+

This reduces the noise from other processes interfering.  If you + have an infinite loop in you code and you have these set, you may hang and + need to reboot

+

Example:

+

    PME * pme = PME::Instance();

+

    pme->SetProcessPriority(ProcessPriorityHigh);

+ +

 

+
+ +

Step 6) Start using the counters

+

        Each Event Mode + counter has the follow ability:

+
+

        Stop

+

        Start

+

        Clear - set to + 0

+

        Read

+

        Write - write a + 64 bit counter value

+
+

        

+

Step 7) Set the process priority to normal

+

        pme->SetProcessPriority(ProcessPriorityNormal);

+

 

+
+

Event Modes:

+
+
+

Event_TC_deliver_mode

+

Event_BPU_fetch_request

+

Event_ITLB_reference

+

Event_memory_cancel

+

Event_memory_complete

+

Event_load_port_replay

+

Event_store_port_replay

+

Event_MOB_load_replay

+

Event_page_walk_type

+

Event_BSQ_cache_reference

+

Event_IOQ_allocation

+

Event_IOQ_active_entries

+

Event_FSB_data_activity

+

Event_BSQ_allocation

+

Event_BSQ_active_entries

+

Event_SSE_input_assist

+

Event_packed_SP_uop

+

Event_packed_DP_uop

+

Event_scalar_SP_uop

+

Event_scalar_DP_uop

+

Event_64bit_MMX_uop

+

Event_128bit_MMX_uop

+

Event_x87_FP_uop

+

Event_x87_SIMD_moves_uop

+

Event_TC_misc

+

Event_global_power_events

+

Event_tc_ms_xfer

+

Event_uop_queue_writes

+

Event_retired_mispred_branch_type

+

Event_retired_branch_type

+

Event_resource_stall

+

Event_WC_Buffer

+

Event_b2b_cycles

+

Event_bnr

+

Event_snoop

+

Event_response

+

Event_front_end_event

+

Event_execution_event

+

Event_replay_event

+

Event_instr_retired

+

Event_uops_retired

+

Event_uop_type

+

Event_branch_retired

+

Event_mispred_branch_retired

+

Event_x87_assist

+

Event_machine_clear

+
+
+

Credits

+

http://www.gamasutra.com/features/wyatts_world/19990528/pentium3_08.htm

+

Used some tables from Mikael Pettersson's  +pertctf + +

+

Used the detect code from +Kamen Yotov's  ia32lib library

+

 

+

 

+ + + + diff --git a/devtools/WildcardSearch.py b/devtools/WildcardSearch.py new file mode 100644 index 0000000..7477644 --- /dev/null +++ b/devtools/WildcardSearch.py @@ -0,0 +1,61 @@ + +from __future__ import generators +import os +import re +import stat + + +# This takes a DOS filename wildcard like *abc.t?t and returns a regex string that will match it. +def GetRegExForDOSWildcard( wildcard ): + # First find the base directory name. + iLast = wildcard.rfind( "/" ) + if iLast == -1: + iLast = wildcard.rfind( "\\" ) + + if iLast == -1: + dirName = "." + dosStyleWildcard = wildcard + else: + dirName = wildcard[0:iLast] + dosStyleWildcard = wildcard[iLast+1:] + + # Now generate a regular expression for the search. + # DOS -> RE + # * -> .* + # . -> \. + # ? -> . + reString = dosStyleWildcard.replace( ".", r"\." ).replace( "*", ".*" ).replace( "?", "." ) + return reString + + +# +# Useful function to return a list of files in a directory based on a dos-style wildcard like "*.txt" +# +# for name in WildcardSearch( "d:/hl2/src4/dt*.cpp", 1 ): +# print name +# +def WildcardSearch( wildcard, bRecurse=0 ): + reString = GetRegExForDOSWildcard( wildcard ) + matcher = re.compile( reString, re.IGNORECASE ) + + return __GetFiles_R( matcher, dirName, bRecurse ) + +def __GetFiles_R( matcher, dirName, bRecurse ): + fileList = [] + # For each file, see if we can find the regular expression. + files = os.listdir( dirName ) + for baseName in files: + filename = dirName + "/" + baseName + + mode = os.stat( filename )[stat.ST_MODE] + if stat.S_ISREG( mode ): + # Make sure the file matches the search string. + if matcher.match( baseName ): + fileList.append( filename ) + + elif bRecurse and stat.S_ISDIR( mode ): + fileList += __GetFiles_R( matcher, filename, bRecurse ) + + return fileList + + diff --git a/devtools/WiseInstallerHelpers/LicenseViewed.cpp b/devtools/WiseInstallerHelpers/LicenseViewed.cpp new file mode 100644 index 0000000..037c26d --- /dev/null +++ b/devtools/WiseInstallerHelpers/LicenseViewed.cpp @@ -0,0 +1,217 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Checks to see if the user has completely viewed the EULA before activing the accept/decline radio buttons +// +//=============================================================================// +#include < windows.h > +#include < msi.h > +#include < msiquery.h > +#include +#include +#include +#include + +#define CHILD_WINDOW_OF_LICENSE "vHackLicenseWindowSibling092304" +#define WINDOW_CLASS_OF_EULA_WINDOW "RichEdit20W" +#define ALLOWABLE_POS_FROM_BOTTOM 5 + +//----------------------------------------------------------------------------- +// Purpose: Call back function for EnumChildWindows +// Input : hwnd - +// lParam - +// Output : BOOL CALLBACK +//----------------------------------------------------------------------------- +BOOL CALLBACK EnumChildProc(HWND hwnd,LPARAM lParam) +{ + TCHAR buf[100]; + + GetClassName( hwnd, (LPTSTR)&buf, 100 ); + if ( _tcscmp( buf, _T( WINDOW_CLASS_OF_EULA_WINDOW ) ) == 0 ) + { + *(HWND*)lParam = hwnd; + return FALSE; + } + return TRUE; +} + +//----------------------------------------------------------------------------- +// Purpose: Context for searching sub windows... +//----------------------------------------------------------------------------- +struct FindParams_t +{ + HWND wnd; + char searchtext[ 512 ]; +}; + +//----------------------------------------------------------------------------- +// Purpose: +// Input : hwnd - +// lParam - +// Output : BOOL CALLBACK +//----------------------------------------------------------------------------- +BOOL CALLBACK EnumChildrenLookingForSpecialControl(HWND hwnd,LPARAM lParam) +{ + FindParams_t *p = ( FindParams_t *)lParam; + + char buf[ 512 ]; + GetWindowText( hwnd, buf, sizeof( buf ) ); + + if ( !stricmp( buf, p->searchtext ) ) + { + p->wnd = hwnd; + return FALSE; + } + return TRUE; +} + +//----------------------------------------------------------------------------- +// Purpose: +// Input : hwnd - +// lParam - +// Output : BOOL CALLBACK +//----------------------------------------------------------------------------- +BOOL CALLBACK EnumChildWindowsProc(HWND hwnd, LPARAM lParam) +{ + // Now search for the special hidden text control inside a top level window + + FindParams_t *p = ( FindParams_t *)lParam; + + FindParams_t special; + memset( &special, 0, sizeof( special ) ); + strcpy( special.searchtext, p->searchtext ); + + EnumChildWindows( hwnd, EnumChildrenLookingForSpecialControl, (LPARAM)&special ); + if ( special.wnd != NULL ) + { + p->wnd = hwnd; + return FALSE; + } + + return TRUE; +} + +//----------------------------------------------------------------------------- +// Purpose: Finds given a root window, finds a child window which itself has a special child window with the specified text string as the window title. +// e.g.: +// if root == NULL (desktop), then you can search the top level dialogs (Half-Life 2 Setup,e.g.) for a subwindow with "vHackxxx" as the text, this would +// return the appropriate top level dialog. +// Input : root - +// *text - +// Output : HWND +//----------------------------------------------------------------------------- +HWND FindWindowHavingChildWithSpecifiedText( HWND root, char const *text ) +{ + FindParams_t params; + memset( ¶ms, 0, sizeof( params ) ); + + strncpy( params.searchtext, text, sizeof( params.searchtext ) - 1 ); + + EnumChildWindows( root, EnumChildWindowsProc, (LPARAM)¶ms ); + + return params.wnd; +} + +//----------------------------------------------------------------------------- +// Purpose: +// Input : *text - +// Output : HWND +//----------------------------------------------------------------------------- +HWND FindTopLevelWindowHavingChildWithSpecifiedText( char const *text ) +{ + return FindWindowHavingChildWithSpecifiedText( GetDesktopWindow(), text ); +} + + +//*********************************************************** +//** Custom action to check if the license is completly +//** viewed. +//**--------------------------------------------------------- +//** Return values: +//** (1) Always returns success +//** (2) Sets the private property LicenseViewed when +//** the text is scrolled to near end. +//**--------------------------------------------------------- +//** Usage: +//** (1) Find installer window by looking for child with specified text. Can't +//** just use window title because it's translated into foreign languages +//** (2) In the license agreement dialog, on the scrollable +//** text control event, call the custom action +//** CheckLicenseViewed using a DoAction +//** (3) For the Next button, modify the Enable +//** ControlCondition to include the property +//** LicenseViewed +//**--------------------------------------------------------- +//*********************************************************** + +// Needs to be exported as non-__stdcall with C name mangling (no mangling) +extern "C" __declspec( dllexport ) UINT CheckLicenseViewed(MSIHANDLE hMSI) +{ + HWND hWnd; + HWND hWndChild=NULL; + + if (MsiEvaluateCondition(hMSI,"LicenseViewed")==MSICONDITION_FALSE) + { + hWnd = FindTopLevelWindowHavingChildWithSpecifiedText(CHILD_WINDOW_OF_LICENSE ); + if (hWnd) + { + EnumChildWindows( hWnd, EnumChildProc, (LPARAM)&hWndChild ); + if ( hWndChild ) + { + SCROLLINFO sinfo; + memset( &sinfo, 0, sizeof( sinfo ) ); + sinfo.cbSize=sizeof(sinfo); + sinfo.fMask=SIF_TRACKPOS | SIF_RANGE | SIF_POS | SIF_PAGE; + GetScrollInfo(hWndChild, SB_VERT, &sinfo); + //max range depends on page size + UINT MaxScrollPos = sinfo.nMax - ( sinfo.nPage - 1 ); + //max less, say ALLOWABLE_POS_FROM_BOTTOM - an allowable max. + MaxScrollPos = MaxScrollPos - ALLOWABLE_POS_FROM_BOTTOM; + + // THIS IS A HACK, but the RichEdit20W control has a bug where while the thumb is being dragged, the position doesn't + // get updated. In fact, it doesn't get updated until the next time + UINT nScrollPos = ::SendMessage(hWndChild, EM_GETTHUMB, 0, 0); + + bool trackedPastEnd = false; // (UINT)sinfo.nTrackPos >= MaxScrollPos ? true : false; + bool positionedPastEnd = nScrollPos >= MaxScrollPos ? true : false; + // Note above, this method doesn't always work... but maybe it will work in win98 and the other won't, etc. etc. + bool positionedPastEnd2 = (UINT)sinfo.nPos >= MaxScrollPos ? true : false; + + /* + + HDC dc = GetDC( GetDesktopWindow() ); + COLORREF oldColor = SetTextColor( dc, RGB( 255, 0, 0 ) ); + + char sz[ 256 ]; + _snprintf( sz, sizeof( sz ), "max %i page %i msp %i track %u pos %u pos2 %u", + sinfo.nMax, + sinfo.nPage, + MaxScrollPos, + sinfo.nTrackPos, + sinfo.nPos, + nScrollPos ); + + RECT rc; + rc.left = 0; + rc.right = 1000; + rc.top = 20; + rc.bottom = 50; + + DrawText( dc, sz, -1, &rc, DT_NOPREFIX ); + + SetTextColor( dc, oldColor ); + ReleaseDC( GetDesktopWindow(), dc ); + */ + + if ( trackedPastEnd || positionedPastEnd || positionedPastEnd2 ) + { + MsiSetProperty(hMSI, TEXT("LicenseViewed"), TEXT("1")); + } + else + { + MsiSetProperty(hMSI, TEXT("LicenseViewed"), NULL); + } + } + } + } + return ERROR_SUCCESS; +} \ No newline at end of file diff --git a/devtools/WiseInstallerHelpers/LicenseViewed.vpc b/devtools/WiseInstallerHelpers/LicenseViewed.vpc new file mode 100644 index 0000000..7f9d36e --- /dev/null +++ b/devtools/WiseInstallerHelpers/LicenseViewed.vpc @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------------- +// LICENSEVIEWED.VPC +// +// Project Script +//----------------------------------------------------------------------------- + +$Macro SRCDIR "..\.." +$Macro OUTBINDIR "$SRCDIR\..\game\bin" + +$Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" + +$Configuration +{ + $Compiler + { + $PreprocessorDefinitions "$BASE;LicenseViewed_EXPORTS" + } + + $Linker + { + $AdditionalDependencies "$BASE msi.lib odbc32.lib odbccp32.lib" + } +} + +$Project "LicenseViewed" +{ + $Folder "Source Files" + { + $File "LicenseViewed.cpp" + } +} diff --git a/devtools/WiseInstallerHelpers/UpdateProgress/UpdateProgress.cpp b/devtools/WiseInstallerHelpers/UpdateProgress/UpdateProgress.cpp new file mode 100644 index 0000000..f00f413 --- /dev/null +++ b/devtools/WiseInstallerHelpers/UpdateProgress/UpdateProgress.cpp @@ -0,0 +1,460 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: A simple app which looks for the HL2 wise installer and ticks the progress bar due +// to a bug with installing more than 2GB of data using the current ver of the windows installer +// +//=============================================================================// + +#include +#include +#include +#include +#include + + +#define FIND_WINDOW_TEXT_PROGRESSDIALOG "vHackWiseProgressDialog092304" +#define FIND_WINDOW_TEXT_CHANGEDISKDIALOG "vHackWiseProgressDialogChangeCD092304" +#define FIND_WINDOW_TEXT_CANCELDIALOG "vHackWiseProgressDialogCancel092304" + +static char szAppName[] = "vWiseProgressBarHackWndClass"; + +// The full bar is this many ticks (which are about 100 msec apart, so 30 seconds to walk bar +#define PROGRESS_TICKS 75 +#define PROGRESS_WAIT_TICKS 20 + +// After this long, if we didn't find the setup dialog, exit the application +#define SEARCH_TIMEOUT_SECONDS 60 + +#define WISE_PROGRESS_BAR_WINDOW_CLASS "msctls_progress32" + +//----------------------------------------------------------------------------- +// Purpose: Globals +//----------------------------------------------------------------------------- +struct Globals_t +{ + + DWORD m_nLastThink; + DWORD m_nStartTick; + + bool m_bFoundWindow; + HWND m_hProgressBar; + HWND m_hDialog; + + UINT m_nTickCounter; +}; + +static Globals_t g; + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +struct FindParams_t +{ + HWND wnd; + char searchtext[ 512 ]; +}; + +//----------------------------------------------------------------------------- +// Purpose: +// Input : hwnd - +// lParam - +// Output : BOOL CALLBACK +//----------------------------------------------------------------------------- +BOOL CALLBACK EnumChildrenLookingForSpecialControl(HWND hwnd,LPARAM lParam) +{ + FindParams_t *p = ( FindParams_t *)lParam; + + char buf[ 512 ]; + + GetWindowText( hwnd, buf, sizeof( buf ) ); + if ( !stricmp( buf, p->searchtext ) ) + { + p->wnd = hwnd; + return FALSE; + } + return TRUE; +} + +//----------------------------------------------------------------------------- +// Purpose: +// Input : hwnd - +// lParam - +// Output : BOOL CALLBACK +//----------------------------------------------------------------------------- +BOOL CALLBACK EnumChildWindowsProc(HWND hwnd, LPARAM lParam) +{ + // Now search for the special hidden text control inside a top level window + + FindParams_t *p = ( FindParams_t *)lParam; + + FindParams_t special; + memset( &special, 0, sizeof( special ) ); + strcpy( special.searchtext, p->searchtext ); + + EnumChildWindows( hwnd, EnumChildrenLookingForSpecialControl, (LPARAM)&special ); + if ( special.wnd != NULL ) + { + p->wnd = hwnd; + return FALSE; + } + + return TRUE; +} + +//----------------------------------------------------------------------------- +// Purpose: +// Input : root - +// *text - +// Output : HWND +//----------------------------------------------------------------------------- +HWND FindWindowHavingChildWithSpecifiedText( HWND root, char const *text ) +{ + FindParams_t params; + memset( ¶ms, 0, sizeof( params ) ); + + strncpy( params.searchtext, text, sizeof( params.searchtext ) - 1 ); + + EnumChildWindows( root, EnumChildWindowsProc, (LPARAM)¶ms ); + + return params.wnd; +} + + +//----------------------------------------------------------------------------- +// Purpose: +// Input : *text - +// Output : HWND +//----------------------------------------------------------------------------- +HWND FindTopLevelWindowHavingChildWithSpecifiedText( char const *text ) +{ + return FindWindowHavingChildWithSpecifiedText( GetDesktopWindow(), text ); +} + +//----------------------------------------------------------------------------- +// Purpose: Search for window of class WISE_PROGRESS_BAR_WINDOW_CLASS +// Input : hwnd - +// lParam - +// Output : BOOL CALLBACK +//----------------------------------------------------------------------------- +BOOL CALLBACK EnumFindProgressBarInDialog( HWND hwnd,LPARAM lParam ) +{ + char buf[100]; + + GetClassName( hwnd, buf, sizeof( buf ) ); + if ( !stricmp( buf, WISE_PROGRESS_BAR_WINDOW_CLASS ) ) + { + *(HWND*)lParam = hwnd; + return FALSE; + } + return TRUE; +} + +//----------------------------------------------------------------------------- +// Purpose: Hides the window +// Input : visible - +//----------------------------------------------------------------------------- +void ShowProgressBar( bool visible ) +{ + if ( !g.m_hProgressBar ) + return; + + DWORD style = GetWindowLong( g.m_hProgressBar, GWL_STYLE ); + if ( visible ) + { + style |= WS_VISIBLE; + } + else + { + style &= ~WS_VISIBLE; + } + + SetWindowLong( g.m_hProgressBar, GWL_STYLE, style ); + InvalidateRect( g.m_hDialog, NULL, TRUE ); +} + +//----------------------------------------------------------------------------- +// Purpose: Search for the progress dialog +//----------------------------------------------------------------------------- +void SearchForWindow() +{ + HWND hProgressDialog = FindTopLevelWindowHavingChildWithSpecifiedText( FIND_WINDOW_TEXT_PROGRESSDIALOG ); + if ( !hProgressDialog ) + { + return; + } + + HWND hWndChild = NULL; + + EnumChildWindows( hProgressDialog, EnumFindProgressBarInDialog, (LPARAM)&hWndChild ); + if ( !hWndChild ) + return; + + g.m_bFoundWindow = true; + g.m_hProgressBar = hWndChild; + g.m_hDialog = hProgressDialog; + + // Hide the progress bar on the dialog since we'll be drawing our own + ShowProgressBar( false ); +} + +void DrawProgressBar( HDC dc, bool showTicks, float frac ) +{ + // Get progress bar rectangle + RECT rc; + GetClientRect( g.m_hProgressBar, &rc ); + + //InflateRect( &rc, 2, 2 ); + + int w = rc.right - rc.left; + int h = rc.bottom - rc.top; + + HDC dcMemory = CreateCompatibleDC( dc ); + HBITMAP bmMemory = CreateCompatibleBitmap( dc, w, h ); + HBITMAP bmOld = (HBITMAP)SelectObject( dcMemory, bmMemory ); + + { + + HBRUSH clearColor = CreateSolidBrush( GetSysColor( COLOR_BTNFACE ) ); + + FillRect( dcMemory, &rc, clearColor ); + + // Create blue tick brush + HBRUSH br = CreateSolidBrush( RGB( 2, 62, 134 ) ); + // Create background brush of same color as dialog background + HBRUSH bg = CreateSolidBrush( RGB( 153, 175, 199) ); + + // Create a black / shadow colored pen to frame the progress bar + HPEN blackpen; + blackpen = CreatePen( PS_SOLID, 1, GetSysColor( COLOR_BTNSHADOW ) ); + + // Select items into dcMemory + HPEN oldPen = (HPEN)SelectObject( dcMemory, blackpen ); + HBRUSH oldBrush = (HBRUSH)SelectObject( dcMemory, bg ); + + rc.bottom = rc.top + 15; + RoundRect( dcMemory, rc.left, rc.top, rc.right, rc.bottom, 5, 5 ); + + // Inset by one unit + InflateRect( &rc, -1, -1 ); + + if ( showTicks ) + { + HRGN clipRegion = (HRGN)CreateRectRgn( rc.left+1, rc.top, rc.right-1, rc.bottom );; + + SelectClipRgn( dcMemory, clipRegion ); + + int numblocks = 8; + int blockwidth = 6; + int blockgap = 2; + + int size = numblocks * ( blockwidth + blockgap ); + + // Determine width of progress bar work area + int width = rc.right - rc.left + 2 * size; + + // Compute right edge of progress bar + RECT rcProgress = rc; + rcProgress.right = rcProgress.left - size + ( int )( frac * width + 0.5f ); + rcProgress.left = rcProgress.right - size; + + for ( int block = 0; block < numblocks; ++block ) + { + RECT rcBlock; + rcBlock.left = rcProgress.left + block * ( blockwidth + blockgap ); + rcBlock.right = rcBlock.left + blockwidth; + rcBlock.top = rcProgress.top + 1; + rcBlock.bottom = rcProgress.bottom - 1; + + // Fill in progress bar + FillRect( dcMemory, &rcBlock, br ); + } + + SelectClipRgn( dcMemory, NULL ); + DeleteObject( clipRegion ); + } + + // Restore GDI states + SelectObject( dcMemory, oldBrush ); + SelectObject( dcMemory, oldPen ); + + DeleteObject( blackpen ); + + DeleteObject( bg ); + DeleteObject( br ); + DeleteObject( clearColor ); + } + + POINT pt; + pt.x = pt.y = 0; + + // Convert top left of progress bar to screen space + ClientToScreen( g.m_hProgressBar, &pt ); + // and then back to dialog relative space + ScreenToClient( g.m_hDialog, &pt ); + + // Offset the progress bar rect to the right position in the dialog + OffsetRect( &rc, pt.x, pt.y ); + + BitBlt( dc, rc.left, rc.top, w, h, dcMemory, 0, 0, SRCCOPY ); + + SelectObject( dcMemory, bmOld ); + DeleteObject( bmMemory ); + + DeleteObject( dcMemory ); +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void UpdateProgress() +{ + // If the "Insert next CD" or "Exit Setup" dialogs are showing, stop advancing the progress bar + HWND hSwapDiskDialog = FindWindowHavingChildWithSpecifiedText( GetDesktopWindow(), FIND_WINDOW_TEXT_CHANGEDISKDIALOG ); + HWND hCancelDialog = FindWindowHavingChildWithSpecifiedText( GetDesktopWindow(), FIND_WINDOW_TEXT_CANCELDIALOG ); + if ( !hSwapDiskDialog && !hCancelDialog ) + { + g.m_nTickCounter++; + } + + if ( !g.m_hProgressBar || !g.m_hDialog ) + return; + + int remainder = ( g.m_nTickCounter % PROGRESS_TICKS ); + + bool showTicks = ( remainder <= PROGRESS_WAIT_TICKS ) ? false : true; + + int currentTick = max( 0, remainder - PROGRESS_WAIT_TICKS ); + int totalTicks = PROGRESS_TICKS - PROGRESS_WAIT_TICKS; + + float frac = ( float )( currentTick % totalTicks ) / ( float )( totalTicks - 1 ); + + HDC dc = GetDC( g.m_hDialog ); + { + // Draw the progress bar + DrawProgressBar( dc, showTicks, frac ); + } + ReleaseDC( g.m_hDialog, dc ); +} + +//----------------------------------------------------------------------------- +// Purpose: Either searches for window or updates progress +// The app will quit if the dialog is found and then goes away +// The app wil also quit if the dialog was not found after waiting 60 seconds +//----------------------------------------------------------------------------- +void Think() +{ + // Only think once every 100 msec + DWORD curTick = GetTickCount(); + if ( curTick - g.m_nLastThink < 50 ) + { + return; + } + + g.m_nLastThink = curTick; + + // Haven't found window yet, keep searching + if ( !g.m_bFoundWindow ) + { + SearchForWindow(); + + // Wise never got going..., abort this app... + if ( ( curTick - g.m_nStartTick ) > ( SEARCH_TIMEOUT_SECONDS * 1000 ) ) + { + PostQuitMessage( 0 ); + } + } + else + { + // Only redraw progress once every 100 msec + UpdateProgress(); + + // If the progress dialog does away, exit this app immediately + if ( !IsWindow( g.m_hDialog ) ) + { + PostQuitMessage( 0 ); + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: Main entry point +// Input : hInstance - +// hPrevInstance - +// nCmdShow - +// Output : int APIENTRY +//----------------------------------------------------------------------------- +int APIENTRY WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, + int nCmdShow) +{ + + HWND hwnd ; + WNDCLASS wndclass ; + + wndclass.style = CS_HREDRAW | CS_VREDRAW ; + wndclass.lpfnWndProc = DefWindowProc; + wndclass.cbClsExtra = 0 ; + wndclass.cbWndExtra = 0 ; + wndclass.hInstance = hInstance ; + wndclass.hIcon = NULL; + wndclass.hCursor = NULL; + wndclass.hbrBackground = NULL; + wndclass.lpszMenuName = NULL ; + wndclass.lpszClassName = szAppName ; + + if ( !RegisterClass (&wndclass) ) + { + return 0 ; + } + + hwnd = CreateWindow + ( + szAppName, + TEXT (""), + WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, CW_USEDEFAULT, + NULL, NULL, hInstance, NULL + ); + + if (!hwnd) + return 0 ; + + ShowWindow( hwnd, SW_HIDE ) ; + + // Remember when we started + g.m_nStartTick = GetTickCount(); + + bool done = false; + while ( 1 ) + { + MSG msg; + + while ( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) + { + if ( msg.message == WM_QUIT ) + { + done = true; + break; + } + + TranslateMessage (&msg) ; + DispatchMessage (&msg) ; + } + + if ( done ) + break; + + Think(); + Sleep( 20 ); + } + + // Restore progress bar as needed + ShowProgressBar( true ); + + return 0; +} + + + diff --git a/devtools/WiseInstallerHelpers/UpdateProgress/UpdateProgress.vpc b/devtools/WiseInstallerHelpers/UpdateProgress/UpdateProgress.vpc new file mode 100644 index 0000000..1527322 --- /dev/null +++ b/devtools/WiseInstallerHelpers/UpdateProgress/UpdateProgress.vpc @@ -0,0 +1,18 @@ +//----------------------------------------------------------------------------- +// UPDATEPROGRESS.VPC +// +// Project Script +//----------------------------------------------------------------------------- + +$Macro SRCDIR "..\..\.." +$Macro OUTBINDIR "$SRCDIR\devtools\bin" + +$Include "$SRCDIR\vpc_scripts\source_exe_win_win32_base.vpc" + +$Project "UpdateProgress" +{ + $Folder "Source Files" + { + $File "UpdateProgress.cpp" + } +} diff --git a/devtools/analyzeconfig/__init__.py b/devtools/analyzeconfig/__init__.py new file mode 100644 index 0000000..afc5f4d --- /dev/null +++ b/devtools/analyzeconfig/__init__.py @@ -0,0 +1,133 @@ +""" +This file exists to mark this directory as being a Python package, +and to contain project specific configurations for parse_analyze_errors.py. +See http://www.python.org/doc/essays/packages.html for details. +Other Python scripts could be put into this directory and would be +imported as analyzeconfig.scriptname. +""" + + + +""" +The VC++ 2012 compiler had a crashing bug when you use /analyze. Depending on the frequency +of this crash (which varies per project) we can either ignore it or try to proceed. If abortOnCompilerCrash +is true then parsing stops when a compiler crash is detected, no warnings are reported, and the +last-known-good is left unchanged so that the next build will give correct diffs. +""" +abortOnCompilerCrash = True + + + +""" +Normally the last-known-good report is updated whenever a build passes with no fatal warnings. However if +the compiler keeps crashing then this means that the last-known-good will keep changing, leading to false +reports of new warnings. Also, a project may decide that they don't want any new warnings. This setting +controls updating of the last-known-good file. +""" +updateLastKnownGood = True + + + +""" +Some warnings occur in Microsoft header files. We need to ignore these. Substring +matching is done on these. +""" +ignorePaths = [ + r"microsoft visual studio 10.0\vc", + r"microsoft visual studio 11.0\vc", + r"microsoft sdks\windows\v7.0a", + r"microsoft xbox 360 sdk\include", + r"windows kits\8.0\include", + r"thirdparty\dxsdk\include", + r"thirdparty\physx301\physxsdk", + ] + + + +""" +This list contains warnings which /analyze can identify with (ideally) 100% +accuracy and which the team believes should always be fixed. This typically +includes varargs mismatches of all kinds. +The layout is designed to match the warningsToText array to make it easy to +copy between them. + +This array should probably be empty when /analyze is first run on a project +but should be filled in as much as practical in order to avoid regressions. +""" +alwaysFatalWarnings = { + 4189 : "Local variable is initialized but not referenced", + 4789 : "Destination of memory copy is too small", + 6053 : "Call to may not zero-terminate string", + 6057 : "Buffer overrun due to number of characters/number of bytes mismatch", + 6059 : "Incorrect length parameter", + 6063 : "Missing string argument", + 6064 : "Missing integer argument", + 6066 : "Non-pointer passed as parameter when pointer is required", + 6067 : "Parameter in call must be the address of the string", + 6209 : "Using sizeof when a character count might be needed. Annotate with OUT_Z_CAP or its relatives", + 6269 : "Possible incorrect order of operations: dereference ignored", + 6270 : "Missing float argument to varargs function", + 6271 : "Extra argument passed: parameter is not used by the format string", + 6272 : "Non-float passed as argument when float is required", + 6273 : "Non-integer passed as a parameter when integer is required", + 6274 : "Non-character passed as parameter '5' when character is required", + 6278 : "Buffer is allocated with array new [], but deleted with scalar delete. Destructors will not be called", + 6281 : "Incorrect order of operations: relational operators have higher precedence than bitwise operators", + 6282 : "Incorrect operator: assignment of constant in Boolean context", + 6283 : "Buffer is allocated with array new [], but deleted with scalar delete", + 6284 : "Object passed as a parameter when string is required", + 6290 : "Bitwise operation on logical result: ! has higher precedence than &. Use && or (!(x & y)) instead", + 6293 : "Ill-defined for-loop: counts down from minimum.", + #6298 : "Using a read-only string as a writable string argument", + 6302 : "Format string mismatch: character string passed as parameter when wide character string is required", + 6306 : "Incorrect call to 'fprintf*': consider using 'vfprintf*' which accepts a va_list as an argument", + # This warning seems to show up in some template code so it can't be a fatal warning. + #6313 : "Incorrect operator: zero-valued flag cannot be tested with bitwise-and. Use an equality test to check for zero-valued flags", + 6314 : "Incorrect order of operations: bitwise-or has higher precedence than the conditional-expression operator", + 6315 : "Incorrect order of operations: bitwise-and has higher precedence than bitwise-or", + 6316 : "Incorrect operator: tested expression is constant and non-zero. Use bitwise-and to determine whether bits are set.", + 6317 : "Incorrect operator: logical-not (!) is not interchangeable with ones-complement (~)", + 6328 : "Wrong parameter type passed", + 6334 : "Sizeof operator applied to an expression with an operator might yield unexpected results", + 6336 : "Arithmetic operator has precedence over question operator, use parentheses to clarify intent", + 6522 : "Invalid size specification: expression must be of integral type", + 6523 : "Invalid size specification: parameter 'size' not found", + 28252 : "Inconsistent annotation", + 28253 : "Inconsistent annotation", + } + + + +""" +This list contains warnings which /analyze can identify with (ideally) 100% +accuracy and which the team wishes to avoid introducing new instances of. +This could include variable shadowing, alloca in a loop, or other bugs +which are problematic to fix all legacy instances of. +""" +fatalWhenNewWarnings = { + # Having variable shadowing be fatal on new warnings would be great, but it's best to see if + # that is what the team wants. + #6244 : "Local declaration shadows declaration of same name in global scope", + #6246 : "Local declaration shadows declaration of same name in outer scope", + 6263 : "Using _alloca in a loop: this can quickly overflow stack", +} + + + +# The paths on the build machines are very long and make reading the results cumbersome. +# Remap them down to something more compact. +remaps = { + r"c:\buildslave_source\dota_staging_analyzebuild_win32\build\src" : r"D:\dota\staging\src", + r"c:\buildslave_source2\buildbot\source2_analyzebuild_win32\build\src" : r"D:\source2\src", + r"c:\buildslave_steam\steam_main_analyze_win32\build\src" : r"D:\clients\steam_main\src", + } + + + +# Some warnings are only kept on so that we can see the statistics they give us. +# They shouldn't count towards the total warning count. +# 6262: Excessive stack usage in function +# 28159: Consider using 'GetTickCount64' instead of 'GetTickCount' +# 6244: Local declaration shadows declaration of same name in global scope +# 6246: Local declaration shadows declaration of same name in outer scope +informationalWarnings = ["6262", "28159", "6244", "6246"] diff --git a/devtools/base.xcconfig b/devtools/base.xcconfig new file mode 100644 index 0000000..c2ad0ee --- /dev/null +++ b/devtools/base.xcconfig @@ -0,0 +1,40 @@ +ALWAYS_SEARCH_USER_PATHS = YES +HEADER_SEARCH_PATHS = $(HEADER_SEARCH_PATHS) $(SDKROOT)/usr/include/malloc + +ARCHS = i386 +ONLY_ACTIVE_ARCH = NO +COPY_PHASE_STRIP = NO +DEBUG_INFORMATION_FORMAT = dwarf-with-dsym + +DEAD_CODE_STRIPPING = YES +PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES + +GCC_C_LANGUAGE_STANDARD = gnu99 +GCC_ENABLE_OBJC_EXCEPTIONS = YES +GCC_SYMBOLS_PRIVATE_EXTERN = YES +GCC_INLINES_ARE_PRIVATE_EXTERN = YES +GCC_REUSE_STRINGS = YES + +CLANG_CXX_LIBRARY = libc++ +GCC_PREPROCESSOR_DEFINITIONS = _DLL_EXT=.dylib VPROF_LEVEL=1 NO_HOOK_MALLOC=1 PNG_NO_PEDANTIC_WARNINGS +BASE_CFLAGS= -Usprintf -Ustrncpy -UPROTECTED_THINGS_ENABLE -ftemplate-depth=512 + +GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO +WARNING_CFLAGS = -Wno-deprecated-writable-strings -Wno-switch-enum -Wno-switch -Wno-unused-value -Wno-parentheses -Wno-logical-op-parentheses -Wno-c++11-narrowing -Wno-inconsistent-missing-override + +// CLANG - and use the ccache wrapper +GCC_VERSION = com.apple.compilers.llvm.clang.1_0 +CC = $(SOURCE_ROOT)/devtools/bin/osx32/xcode_ccache_wrapper +LDPLUSPLUS = $(DT_TOOLCHAIN_DIR)/usr/bin/clang++ +//CLANG_WARN_CXX0X_EXTENSIONS = NO +CLANG_CXX_LANGUAGE_STANDARD = c++11 + +// include gets confused, 'cause ivp has one, and the system has one, and only one +// gets into the header map, so sacrifice speed for corectness. +USE_HEADERMAP = NO + +SDKROOT = macosx10.10 +MACOSX_DEPLOYMENT_TARGET = 10.7 +GCC_FAST_MATH = YES +CLANG_LINK_OBJC_RUNTIME = false + diff --git a/devtools/bin/IntegrateOpenVR.bat b/devtools/bin/IntegrateOpenVR.bat new file mode 100644 index 0000000..767a8c8 --- /dev/null +++ b/devtools/bin/IntegrateOpenVR.bat @@ -0,0 +1,77 @@ +@echo off + +:: Use this batch file to integrate steam client binaries directly from +:: //steam/rel/client. This only really affects the binaries that gameservers +:: use. (The client should use the binaries from the steam client that is +:: running.) We do this when we want some feature or bugfix in the steam +:: binaries, but don't want to integarte a whole new SDK. + +:: +:: Set source paths +:: + +SET VRP4Path=%1 +SET IntegDate=%2 +set BINS_ONLY=0 + +if !%IntegDate%!==!/bins! ( +SET IntegDate= +SET BINS_ONLY=1 +) + + +if !%VRP4Path%!==!! ( + echo Usage: %0 VRP4Path + echo. + echo VRP4Path should be the perforce server path to the branch you want to integrate from, + echo e.g. "//vr/steamvr/sdk_release/" + goto :end +) + +:: Use this when copying from official distribution. +SET DestRoot=..\..\.. +set P4Root=%VRP4Path% +set SRCDIR_HEADERS=headers/... +set SRCDIR_DLL=bin +set SRCDIR_LIB=lib + +:: +:: Copy files +:: + +:: Client Win32 binaries +call :CopyOneFile %SRCDIR_DLL%/win32 openvr_api.dll game\bin +call :CopyOneFile %SRCDIR_LIB%/win32 openvr_api.lib src\lib\public + +:: Client Linux binaries +call :CopyOneFile %SRCDIR_DLL%/linux32 libopenvr_api.so game\bin +call :CopyOneFile %SRCDIR_LIB%/linux32 libopenvr_api.so src\lib\public\linux32 + +:: Client Mac binaries. Note that there's no dedicated server on the Mac, +:: so we can ship a smaller set +call :CopyOneFile %SRCDIR_DLL%/osx32 libopenvr_api.dylib game\bin +call :CopyOneFile %SRCDIR_LIB%/osx32 libopenvr_api.dylib src\lib\public\osx32 + +if !%BINS_ONLY%!==!1! ( + goto :end +) + +:: Headers +ECHO --------------------------------------------- +ECHO Integrating Steam Headers from %P4Root%/%SRCDIR_HEADERS% +ECHO to %DestRoot%\src\public\steam\... + +p4 integrate -d -i %P4Root%/%SRCDIR_HEADERS%%IntegDate% %DestRoot%\src\public\openvr\... +p4 resolve -at %DestRoot%\src\public\openvr\... + +goto :end + +:CopyOneFile + ECHO --------------------------------------------- + ECHO Integrating %P4Root%/%1/%2 + ECHO to %DestRoot%\%3\%2 + P4 integrate -d -i %P4Root%/%1/%2%IntegDate% %DestRoot%\%3\%2 + P4 resolve -at %DestRoot%\%3\%2 + echo. + +:end diff --git a/devtools/bin/IntegratePanorama.bat b/devtools/bin/IntegratePanorama.bat new file mode 100644 index 0000000..7131a2e --- /dev/null +++ b/devtools/bin/IntegratePanorama.bat @@ -0,0 +1,85 @@ +@echo off + +:: Use this batch file to integrate panorama and associated libs from //Steam/main/ + +:: +:: Set source paths +:: + +SET SteamP4Path=%1 + +if !%SteamP4Path%!==!! ( + echo Usage: %0 SteamP4Path + echo. + echo SteamP4Path should be the perforce server path to the branch you want to integrate from, + echo e.g. "//Steam/rel/client" or "//Steam/main" + goto :end +) + +set ThirdPartyPath=//thirdpartycode/nonredist +set V8Path=%ThirdPartyPath%/v8 +set V8Bin=%V8Path%/out/ia32.release +set V8Headers=%V8Path%/include + +set DestRoot=../../.. +set DestLibs=%DestRoot%/src/lib/common/linux32/release +set DestHeaders=%DestRoot%/src/public/panorama +set DestSrc=%DestRoot%/src/panorama/... +set DestV8Headers=%DestRoot%/src/external/v8/include + +set SrcHeaders=src/public/panorama +set SrcMain=src/panorama/... + +:: +:: Copy files +:: + +:: Client Linux binaries +call :CopyOneFile %V8Bin% libicudata.a %DestLibs% +call :CopyOneFile %V8Bin% libv8_libplatform.a %DestLibs% +call :CopyOneFile %V8Bin%/lib.target libicui18n.so %DestLibs% +call :CopyOneFile %V8Bin%/lib.target libv8.so %DestLibs% +call :CopyOneFile %V8Bin%/lib.target libicuuc.so %DestLibs% + +:: Client Win32 binaries +:: TODO + +:: Client Mac binaries. Note that there's no dedicated server on the Mac, +:: so we can ship a smaller set +:: TODO + +:: V8 Headers +ECHO --------------------------------------------- +ECHO Integrating V8 Headers from %V8Headers%/... +ECHO to %DestV8Headers%/... + +p4 integrate -d -i %V8Headers%/... %DestV8Headers%/... +p4 resolve -at %DestV8Headers%/... + +:: Headers +ECHO --------------------------------------------- +ECHO Integrating Panorama Headers from %SteamP4Path%/%SrcHeaders%/... +ECHO to %DestHeaders%/... + +p4 integrate -d -i %SteamP4Path%/%SrcHeaders%/... %DestHeaders%/... +p4 resolve -at %DestHeaders%/... + +:: Src +ECHO --------------------------------------------- +ECHO Integrating Panorama Sources from %SteamP4Path%/%SrcMain%/... +ECHO to %DestSrc%/... + +p4 integrate -d -i %SteamP4Path%/%SrcMain%/... %DestSrc%/... +p4 resolve -at %DestSrc%/... + +goto :end + +:CopyOneFile + ECHO --------------------------------------------- + ECHO Integrating %1/%2 + ECHO to %3 + P4 integrate -d -i %1/%2 %3/%2 + P4 resolve -at %3/%2 + echo. + +:end diff --git a/devtools/bin/IntegrateSteamNetworkingSocketsSDK.bat b/devtools/bin/IntegrateSteamNetworkingSocketsSDK.bat new file mode 100644 index 0000000..51b8433 --- /dev/null +++ b/devtools/bin/IntegrateSteamNetworkingSocketsSDK.bat @@ -0,0 +1,34 @@ +SET SRC=//Steam/sdr_public +SET DEST=../../.. + +:: 32 bit windows +p4 copy %SRC%/bin/win32/steamnetworkingsockets.lib %DEST%/src/lib/public/steamnetworkingsockets.lib +p4 copy %SRC%/bin/win32/steamnetworkingsockets.dll %DEST%/game/bin/steamnetworkingsockets.dll + +:: 64-bit windows +::p4 copy %SRC%/bin/win64/steamnetworkingsockets.lib %DEST%/src/lib/public/x64/steamnetworkingsockets.lib +::p4 copy %SRC%/bin/win64/steamnetworkingsockets.dll %DEST%/game/bin/x64/steamnetworkingsockets.dll + +:: GC. TF doesn't use SDR for actual connectivity, so we don't need to generate any tickets +::p4 copy %SRC%/bin/win64/steamdatagram_ticketgen.lib %DEST%/src/lib/public/x64/steamdatagram_ticketgen.lib +::p4 copy %SRC%/bin/win64/steamdatagram_ticketgen.dll %DEST%/game/csgo/bin/gc/x64/steamdatagram_ticketgen.dll +::p4 copy %SRC%/bin/win32/steamdatagram_ticketgen.lib %DEST%/src/lib/public/steamdatagram_ticketgen.lib +::p4 copy %SRC%/bin/win32/steamdatagram_ticketgen.dll %DEST%/game/csgo/bin/gc/steamdatagram_ticketgen.dll + +:: 32-bit Linux, older toolchain. That should work just fine for the linux client. +p4 copy %SRC%/bin/linux32/libsteamnetworkingsockets.so %DEST%/game/bin/libsteamnetworkingsockets.so +p4 copy %SRC%/bin/linux32/libsteamnetworkingsockets.so %DEST%/src/lib/public/linux32/libsteamnetworkingsockets.so + +:: 64-bit Linux, depends on Steam runtime +::p4 copy %SRC%/bin/ubuntu12_64/libsteamnetworkingsockets.so %DEST%/game/bin/linux64/libsteamnetworkingsockets.so +::p4 copy %SRC%/bin/ubuntu12_64/libsteamnetworkingsockets.so %DEST%/src/lib/public/linux64/libsteamnetworkingsockets.so + +:: OSX (32- and 64-bit fat binaries) +p4 copy %SRC%/client/Steam.AppBundle/Steam/Contents/MacOS/libsteamnetworkingsockets.dylib %DEST%/game/bin/libsteamnetworkingsockets.dylib +p4 copy %SRC%/client/Steam.AppBundle/Steam/Contents/MacOS/libsteamnetworkingsockets.dylib %DEST%/src/lib/public/osx32/libsteamnetworkingsockets.dylib + +:: Tool +::p4 copy %SRC%/bin/win64/steamdatagram_certtool.exe %DEST%/src/devtools/bin/steamdatagram_certtool.exe + +p4 integrate %SRC%/src/public/steamnetworkingsockets/... %DEST%/src/public/steamnetworkingsockets/... +p4 resolve -as diff --git a/devtools/bin/LicenseViewed.dll b/devtools/bin/LicenseViewed.dll new file mode 100644 index 0000000..ba9522f Binary files /dev/null and b/devtools/bin/LicenseViewed.dll differ diff --git a/devtools/bin/McCopy.pl b/devtools/bin/McCopy.pl new file mode 100644 index 0000000..a5ddd2a --- /dev/null +++ b/devtools/bin/McCopy.pl @@ -0,0 +1,1321 @@ +use strict; + +# todo: make sure and create the target directory if it doesn't exist. +# todo: make this work either direction +# todo: fix any case problems + +my $g_protocol_version = "mccopy1\n"; +my $g_opt_port = 7070; +my $g_server_md5 = 0; + +use IO::Socket; + +sub GetMD5 +{ + my $filename = shift; + $filename =~ s,/,\\,g; +# print "$filename\n"; + print "."; + my( $cmd ) = "md5.exe < \"$filename\""; +# print $cmd . "\n"; + open MD5, "$cmd|"; + my $out = ; + close MD5; + $out =~ s/^.*\=\s+//; + $out =~ s/\n//g; +# print "'" . $out . "'" . "\n"; + return $out; +} + +################################################################################################ +# SERVER CODE +################################################################################################ +sub SendFileName +{ + my( $sock ) = shift; + my( $file ) = shift; + my( $isdir ) = -d $file; + + if( $isdir ) + { + if( $file =~ m/\/\.$/ || # "." + $file =~ m/\/\.\.$/ ) # ".." + { + return; + } + } + + my( @statinfo ) = stat $file; + if( @statinfo ) + { + my( $mtime ) = $statinfo[9]; + my( $mode ) = $statinfo[2]; +# my( $mtimestr ) = scalar( localtime( $mtime ) ); + my( $size ) = $statinfo[7]; + if( $isdir ) + { + print $sock "d\n"; + } + else + { + print $sock "f\n"; + } + print $sock &RemoveBaseDir( $file ) . "\n"; + print $sock $mtime . "\n"; + printf $sock "%o\n", $mode; + print $sock $size . "\n"; + if( !$isdir && $g_server_md5 ) + { + print $sock &GetMD5( $file ) . "\n"; + } +# print $file . "\n"; +# print $mtime . "\n"; +# print $mode . "\n"; +# print $md5 . "\n"; + } + else + { + print "CAN'T STAT $file\n"; + } + + if( $isdir ) + { + SendDirName( $sock, $file ); + } +} + + +sub SendDirName +{ + my( $sock ) = shift; + my( $dirname ) = shift; + if( $dirname =~ m/\/\.$/ || # "." + $dirname =~ m/\/\.\.$/ ) # ".." + { + return; + } + + local( *SRCDIR ); + opendir SRCDIR, $dirname; + my( @dir ) = readdir SRCDIR; + closedir SRCDIR; + + my( $item ); + while( $item = shift @dir ) + { + &SendFileName( $sock, $dirname . "/" . $item ); + } +} + +sub GetFile +{ + my( $sock ) = shift; + my( $filename ) = shift; + my( $localfilename ) = &AddBaseDir( $filename ); + print "GetFile: $filename ($localfilename)\n"; + local( *FILE ); + open FILE, "<$localfilename"; + binmode( FILE ); + my( $filebits ); + seek FILE, 0, 2; + my( $size ) = tell FILE; + if( $size < 0 ) + { + die "$filename \$size == $size\n"; + } + seek FILE, 0, 0; + read FILE, $filebits, $size; + close FILE; +# print "sending $filename: $size\n"; + print $sock $filebits; +# print "finished sending $filename\n"; +} + +sub HandleCommand +{ + my( $sock ) = shift; + my( $cmd ) = shift; + + if( $cmd =~ m/dirlistmd5\s+(.*)$/ ) + { + $g_server_md5 = 1; + &SetBaseDir( $1 ); + &SendDirName( $sock, $1 ); + print $sock "\n"; # terminating newline to end reply + } + elsif( $cmd =~ m/dirlist\s+(.*)$/ ) + { + $g_server_md5 = 0; + &SetBaseDir( $1 ); + &SendDirName( $sock, $1 ); + print $sock "\n"; # terminating newline to end reply + } + elsif( $cmd =~ m/getfile\s+(.*)$/ ) + { + &GetFile( $sock, $1 ); + } +} + +sub RunServer +{ + my( $hostname ) = `hostname`; +# my( $hostname ) = "localhost"; + $hostname =~ s/\n//; # remove newlines + + my $sock = new IO::Socket::INET ( + LocalHost => $hostname, + LocalPort => $g_opt_port, + Proto => 'tcp', + Listen => 1, + Reuse => 1, + ); + die "Could not create socket: $!\n" unless $sock; + + my( $clientnum ) = 0; + while( 1 ) + { + my $new_sock = $sock->accept(); + print "accept!\n"; + if( fork() == 0 ) + { + print "$clientnum: opening connection...\n"; + my $version = <$new_sock>; + if( $version ne $g_protocol_version ) + { + die "wrong protocol version: server: $g_protocol_version client: %version\n"; + } + my $command; + while(defined($command = <$new_sock>)) + { + print "$clientnum: command: $command"; + &HandleCommand( $new_sock, $command ); + print "$clientnum: done with $command"; + } + print "$clientnum: closing connection...\n"; + close( $new_sock ); + exit; + } + $clientnum++; + } + + close($sock); # never get here. +} + +################################################################################################ +# CLIENT CODE +################################################################################################ + + +# all options that we might care about from rsync: +# -v, --verbose increase verbosity +# -q, --quiet decrease verbosity +# -c, --checksum always checksum +# -a, --archive archive mode +# -r, --recursive recurse into directories +# -R, --relative use relative path names +# -b, --backup make backups (default ~ suffix) +# --backup-dir=DIR put backups in the specified directory +# --suffix=SUFFIX override backup suffix +# -u, --update update only (don't overwrite newer files) +# -p, --perms preserve permissions +# -t, --times preserve times +# -n, --dry-run show what would have been transferred +# --existing only update files that already exist +# --delete delete files that don't exist on the sending side +# --delete-excluded also delete excluded files on the receiving side +# --delete-after delete after transferring, not before +# --max-delete=NUM don't delete more than NUM files +# --force force deletion of directories even if not empty +# --timeout=TIME set IO timeout in seconds +# -I, --ignore-times don't exclude files that match length and time +# --size-only only use file size when determining if a file should be transferred +# -T --temp-dir=DIR create temporary files in directory DIR +# --compare-dest=DIR also compare destination files relative to DIR +# -P equivalent to --partial --progress +# -z, --compress compress file data +# --exclude=PATTERN exclude files matching PATTERN +# --exclude-from=FILE exclude patterns listed in FILE +# --include=PATTERN don't exclude files matching PATTERN +# --include-from=FILE don't exclude patterns listed in FILE +# --version print version number +# --daemon run as a rsync daemon +# --address bind to the specified address +# --stats give some file transfer stats +# --progress show progress during transfer +# -h, --help show this help screen + +# options that are actually implemented: +# +sub Usage +{ + print "\n"; + print "Usage:\n"; + print "perl McCopy.pl --server\n"; + print "or\n"; + print "perl McCopy.pl [options] srcdir dstdir\n"; + print "\n"; + print "ie:\n"; + print "perl McCopy.pl --verbose --recursive remotemachine:u:/hl u:/hl.work\n"; + print "\n"; + print "where \"remotemachine\" is running a McCopy server\n"; + print "\n"; + print "options are:\n"; + print "--server run as server (ignores other options)\n"; + print "--port N (default 7070)\n"; + print "--verbose\n"; + print "--test don't actually copy or delete any files\n"; + print "--ignore-time don't use file mtimes as a criterion for file that need\n"; + print " to be copied.\n"; + print "--ignore-permissions don't use file permissions as a criterion for file that\n"; + print " need to be copied.\n"; + print "--ignore-size don't use file size as a criterion for file that need\n"; + print " to be copied.\n"; + print "--md5 Use md5 checksums\n"; + print "--recursive\n"; + print "--delete-readonly delete readonly files in dst\n"; + print " that don't exist in src\n"; + print "--delete-writable delete writable files in dst\n"; + print "--delete-dirs delete directories in dst that don't exist in src\n"; + print "--clobber-writable-newer\n"; + print " write over upon copy files that have been modified locally\n"; + print "--delete-excluded delete files on dst that are excluded using --exclude\n"; + print "--exclude exclude files containing perl regular expression, ie:\n"; + print " --exclude /.*release.*/i\n"; + print "--include override --exclude for files containing perl regular expression, ie:\n"; + print " --include /.*debughlp.*/i\n"; + print "--mirror same as --recursive --delete-readonly --delete-writable\n"; + print " --clobber-writable-newer --delete-excluded --delete-dirs\n"; + print "--mirror-safe same as --recursive --delete-readonly --delete-dirs\n"; + exit; +} + +# default command line options +my $g_opt_server = 0; +my $g_opt_test = 0; +my $g_opt_verbose = 0; +my $g_opt_recursive = 0; +my $g_opt_deletereadonly = 0; +my $g_opt_deletewritable = 0; +my $g_opt_clobberwritablenewer = 0; +my $g_opt_deleteexcluded = 0; +my $g_opt_deletedirs = 0; +my $g_opt_ignoretime = 0; +my $g_opt_ignoreperms = 0; +my $g_opt_ignoresize = 0; +my @g_opt_exclude; +my @g_opt_include; +my $g_opt_src; +my $g_opt_dst; +my $g_opt_md5; + +my $g_src_is_local; +my $g_src_machine = ""; +my $g_src_path; + +my $g_dst_is_local; +my $g_dst_machine = ""; +my $g_dst_path; + +# indexed by $filename +my %g_remote_mtime; +my %g_remote_mode; +my %g_remote_isdir; +my %g_remote_size; +my %g_remote_md5; + +my %g_local_mtime; +my %g_local_mode; +my %g_local_isdir; +my %g_local_size; +my %g_local_md5; + +my %g_alreadycomparedtime; +my %g_alreadycomparedpermissions; +my %g_alreadycomparedsize; +my %g_alreadycomparedmd5; + +my %g_files_to_delete; +my %g_dirs_to_delete; +my %g_files_to_copy; +my %g_dirs_to_create; + +my $g_max_time_delta = 2; # in seconds + +my $g_basedir; + +sub BackToForwardSlash +{ + my( $path ) = shift; + $path =~ s,\\,/,g; + return $path; +} + +sub ForwardToBackSlash +{ + my( $path ) = shift; + $path =~ s,/,\\,g; + return $path; +} + +sub SetBaseDir +{ + $g_basedir = shift; +# print "\$g_basedir: $g_basedir\n"; +} + +sub RemoveFileName +{ + my( $in ) = shift; + $in = &BackToForwardSlash( $in ); + $in =~ s,/[^/]*$,,; + return $in; +} + +sub RemovePath +{ + my( $in ) = shift; + $in = &BackToForwardSlash( $in ); + $in =~ s,^(.*)/([^/]*)$,$2,; + return $in; +} + + +sub MakeDirHier +{ + my( $in ) = shift; +# print "MakeDirHier( $in )\n"; + $in = &BackToForwardSlash( $in ); + my( @path ); + while( $in =~ m,/, ) # while $in still has a slash + { + my( $end ) = &RemovePath( $in ); + push @path, $end; +# print $in . "\n"; + $in = &RemoveFileName( $in ); + } + my( $i ); + my( $numelems ) = scalar( @path ); + my( $curpath ); + for( $i = $numelems - 1; $i >= 0; $i-- ) + { + $curpath .= "/" . $path[$i]; + my( $dir ) = $in . $curpath; + if( !stat $dir ) + { + print "mkdir $dir\n"; + mkdir $dir, 0777; + } + } +} + +sub RemoveBaseDir +{ + my( $path ) = shift; +# print "removebasedir: $path "; + $path =~ s,^$g_basedir/,,; +# print "$path\n"; + return $path; +} + +sub AddBaseDir +{ + my( $path ) = shift; + return $g_basedir . "/" . $path; +} + +sub FixPath +{ + my( $path ) = shift; + # backslash to forward slash + $path =~ s,\\,/,g; + # remove trailing slash + $path =~ s,/$,,; + return $path; +} + +sub ProcessLongCommand +{ + my( $cmd ) = shift; + if( $cmd =~ m/--verbose/ ) + { + $g_opt_verbose = 1; + } + elsif( $cmd =~ m/--server/ ) + { + $g_opt_server = 1; + } + elsif( $cmd =~ m/--test/ ) + { + $g_opt_test = 1; + } + elsif( $cmd =~ m/--ignore-time/ ) + { + $g_opt_ignoretime = 1; + } + elsif( $cmd =~ m/--ignore-permissions/ ) + { + $g_opt_ignoreperms = 1; + } + elsif( $cmd =~ m/--ignore-size/ ) + { + $g_opt_ignoresize = 1; + } + elsif( $cmd =~ m/--md5/ ) + { + $g_opt_md5 = 1; + } + elsif( $cmd =~ m/--recursive/ ) + { + $g_opt_recursive = 1; + } + elsif( $cmd =~ m/--mirror-safe/ ) + { + $g_opt_recursive = 1; + $g_opt_deletereadonly = 1; + $g_opt_deletewritable = 0; + $g_opt_clobberwritablenewer = 0; + $g_opt_deleteexcluded = 0; + $g_opt_deletedirs = 1; + } + elsif( $cmd =~ m/--mirror/ ) + { + $g_opt_recursive = 1; + $g_opt_deletereadonly = 1; + $g_opt_deletewritable = 1; + $g_opt_clobberwritablenewer = 1; + $g_opt_deleteexcluded = 1; + $g_opt_deletedirs = 1; + } + elsif( $cmd =~ m/--delete-readonly/ ) + { + $g_opt_deletereadonly = 1; + } + elsif( $cmd =~ m/--delete-writable/ ) + { + $g_opt_deletewritable = 1; + } + elsif( $cmd =~ m/--clobber-writable-newer/ ) + { + $g_opt_clobberwritablenewer = 1; + } + elsif( $cmd =~ m/--delete-excluded/ ) + { + $g_opt_deleteexcluded = 1; + } + elsif( $cmd =~ m/--delete-dirs/ ) + { + $g_opt_deletedirs = 1; + } +} + +sub ProcessCommandLine +{ + my( $cmd ); + while( $cmd = shift ) + { + # hack - special case for exclude since it has an argument + if( $cmd =~ m/^--exclude/ ) + { + push @g_opt_exclude, shift; + } + elsif( $cmd =~ m/^--include/ ) + { + push @g_opt_include, shift; + } + elsif( $cmd =~ m/^--port/ ) + { + $g_opt_port = shift; + } + elsif( $cmd =~ m/^--/ ) + { + &ProcessLongCommand( $cmd ); + } + elsif( $cmd =~ m/^-/ ) + { + print "short command $cmd\n"; + } + else + { + if( !defined( $g_opt_src ) ) + { + $g_opt_src = &FixPath( $cmd ); + } + elsif( !defined( $g_opt_dst ) ) + { + $g_opt_dst = &FixPath( $cmd ); + } + else + { + print "Don't understand $cmd\n"; + &Usage(); + } + } + } +} + +sub PrintOptions +{ + if( $g_opt_verbose ) + { + print "\n"; + print "Options:\n"; + print "\$g_opt_src = $g_opt_src\n"; + print "\$g_opt_dst = $g_opt_dst\n"; + print "\$g_opt_test = $g_opt_test\n"; + print "\$g_opt_ignoretime = $g_opt_ignoretime\n"; + print "\$g_opt_ignoreperms = $g_opt_ignoreperms\n"; + print "\$g_opt_ignoresize = $g_opt_ignoresize\n"; + print "\$g_opt_verbose = $g_opt_verbose\n"; + print "\$g_opt_recursive = $g_opt_recursive\n"; + print "\$g_opt_deletereadonly = $g_opt_deletereadonly\n"; + print "\$g_opt_deletewritable = $g_opt_deletewritable\n"; + print "\$g_opt_clobberwritablenewer = $g_opt_clobberwritablenewer\n"; + print "\$g_opt_deleteexcluded = $g_opt_deleteexcluded\n"; + print "\@g_opt_exclude = @g_opt_exclude\n"; + print "\n"; + } +} + +sub ValidateOptions +{ + if( $g_opt_server ) + { + return; + } + if( !defined( $g_opt_src ) ) + { + print "src not defined\n"; + Usage(); + } + if( !defined( $g_opt_dst ) ) + { + print "dst not defined\n"; + Usage(); + } + if( !$g_opt_recursive ) + { + print "--recursive must be used. . non-recursive operation not supported\n"; + Usage(); + } +} + +# src/dst looks like: +# gary:u:/hl2/hl2 +# u:/hl2/hl2 +# /hl2/hl2 + +sub ParseSrcDstPaths +{ +# print $g_opt_src . "\n"; + if( $g_opt_src =~ m/(\S+)\:(\S\:\S*)/ ) + { + $g_src_is_local = 0; + $g_src_machine = $1; + $g_src_path = $2; + } + elsif( $g_opt_src =~ m/(\S+)\:(\/\/.*)/ ) + { + # //gary://maxwell/common/ + $g_src_is_local = 0; + $g_src_machine = $1; + $g_src_path = $2; + } + elsif( $g_opt_src =~ m/^(\S:.*)/ ) + { + $g_src_is_local = 1; + $g_src_path = $1; + } + else + { + $g_src_is_local = 1; + $g_src_path = $1; + } + + if( $g_opt_dst =~ m/(\S+):(\S:\S+)/ ) + { + $g_dst_is_local = 0; + $g_dst_machine = $1; + $g_dst_path = $2; + } + elsif( $g_opt_dst =~ m/^(\S:\S+)/ ) + { + $g_dst_is_local = 1; + $g_dst_path = $1; + } + else + { + $g_dst_is_local = 1; + $g_dst_path = $1; + } + + if( $g_src_is_local ) + { + die "my src directories not supported yet. . run the server on the other end.\n"; + } + if( !$g_dst_is_local ) + { + die "remote dst directories not supported yet. . run the server on the other end.\n"; + } + if( $g_src_is_local == $g_dst_is_local ) + { + die "src and dst on the same machine not supported. . use robocopy\n"; + } + + &MakeDirHier( $g_dst_path ); + + &SetBaseDir( $g_dst_path ); + + if( $g_opt_verbose ) + { + print "\n\$g_src_is_local = $g_src_is_local\n"; + print "\$g_src_machine = $g_src_machine\n"; + print "\$g_src_path = $g_src_path\n"; + print "\$g_dst_is_local = $g_dst_is_local\n"; + print "\$g_dst_machine = $g_dst_machine\n"; + print "\$g_dst_path = $g_dst_path\n\n"; + } +} + +&ProcessCommandLine( @ARGV ); +&ValidateOptions(); +&PrintOptions(); + +if( $g_opt_server ) +{ + &RunServer(); + exit; +} + +&ParseSrcDstPaths(); + +sub GetRemoteDirList +{ + my( $sock ) = shift; + my( $remotedirname ) = shift; + if( $g_opt_md5 ) + { + print $sock "dirlistmd5 $remotedirname\n"; + } + else + { + print $sock "dirlist $remotedirname\n"; + } + my( $filename, $mtime, $mode, $size ); + my $fileordir; +# while( defined( $fileordir = <$sock> ) ) + while( 1 ) + { + $fileordir = <$sock>; + die "Lost connection!!!" if !defined( $fileordir ); + last if $fileordir=~ m/^\n$/; + + $filename = <$sock>; + $mtime = <$sock>; + $mode = <$sock>; + $size = <$sock>; + my $md5 = ""; + if( ( $fileordir =~ /f/i ) && $g_opt_md5 ) + { + $md5 = <$sock>; + } + if( 0 ) + { + print "file: $filename"; + print "fileordir: $fileordir"; + print "mtime: $mtime"; + print "mode: $mode"; + print "size: $size\n"; + } + $filename =~ s/\n//; + $mtime =~ s/\n//; + $mode =~ s/\n//; + $size =~ s/\n//; + $md5 =~ s/\n//; + if( $fileordir =~ m/d/ ) + { +# print $filename . " is a dir\n"; + $g_remote_isdir{$filename} = 1; + } + else + { + $g_remote_isdir{$filename} = 0; + } + $g_remote_mtime{$filename} = $mtime; +# print $g_remote_mtime{$filename}; + $g_remote_mode{$filename} = $mode; + $g_remote_size{$filename} = $size; + if( $g_opt_md5 ) + { + $g_remote_md5{$filename} = $md5; + } + } +} + +sub GetLocalDirList_File +{ + my( $filename ) = shift; + my( $isdir ) = -d $filename; + if( $isdir ) + { + if( $filename =~ m/\/\.$/ || # "." + $filename =~ m/\/\.\.$/ ) # ".." + { + return; + } + } + + if( $isdir ) + { + GetLocalDirList_Dir( $filename ); + } + my( @statinfo ) = stat $filename; + if( @statinfo ) + { + my( $mtime ) = $statinfo[9]; + my( $mode ) = $statinfo[2]; +# my( $mtimestr ) = scalar( localtime( $mtime ) ); + my( $size ) = $statinfo[7]; + my( $filename_nobase ) = &RemoveBaseDir( $filename ); + $g_local_isdir{$filename_nobase} = $isdir; + $g_local_mtime{$filename_nobase} = $mtime; + $g_local_mode{$filename_nobase} = sprintf "%o", $mode; + $g_local_size{$filename_nobase} = $size; + if( !$isdir && $g_opt_md5 ) + { + $g_local_md5{$filename_nobase} = &GetMD5( $filename ); + } + } + else + { + print "CAN'T STAT $filename\n"; + } +} + +sub GetLocalDirList_Dir +{ + my( $dirname ) = shift; + if( $dirname =~ m/\/\.$/ || # "." + $dirname =~ m/\/\.\.$/ ) # ".." + { + return; + } + + local( *SRCDIR ); + opendir SRCDIR, $dirname; + my( @dir ) = readdir SRCDIR; + closedir SRCDIR; + + my( $item ); + while( $item = shift @dir ) + { + &GetLocalDirList_File( $dirname . "/" . $item ); + } +} + +sub IsExcluded +{ + my( $filename ) = shift; + my( $regexp ); + foreach $regexp ( @g_opt_include ) + { + if( eval "\$filename =~ $regexp" ) + { + return 0; + } + } + foreach $regexp ( @g_opt_exclude ) + { + if( eval "\$filename =~ $regexp" ) + { + if( defined( $g_local_mtime{$filename} ) ) + { + if( $g_opt_deleteexcluded ) + { + print "excluding and deleting $filename\n" if( $g_opt_verbose ); + if( defined $g_remote_isdir{$filename} ) + { + if( $g_remote_isdir{$filename} ) + { + $g_dirs_to_delete{$filename} = 1; + } + else + { + $g_files_to_delete{$filename} = 1; + } + } + elsif( defined $g_local_isdir{$filename} ) + { + if( $g_local_isdir{$filename} ) + { + $g_dirs_to_delete{$filename} = 1; + } + else + { + $g_files_to_delete{$filename} = 1; + } + } + else + { + die; + } + } + else + { + print "excluding but keeping my copy of $filename\n" if( $g_opt_verbose ); + } + } + else + { + print "excluding $filename, which doesn't exist locally\n" if( $g_opt_verbose ); + } + return 1; + } + } + return 0; +} + +sub CompareTime +{ + if( $g_opt_ignoretime ) + { + return; + } + my( $filename ) = shift; + # hack! ignore directories. . seems like robocopy does too. + if( $g_remote_isdir{$filename} || $g_local_isdir{$filename} ) + { + return; + } + + if( defined( $g_alreadycomparedtime{$filename} ) ) + { + return; + } + $g_alreadycomparedtime{$filename} = 1; + + # compare times + my( $deltatime ) = $g_local_mtime{$filename} - $g_remote_mtime{$filename}; +# print "g_remote_mtime: " . $g_remote_mtime{$filename} . "\n"; +# print "g_local_mtime: " . $g_local_mtime{$filename} . "\n"; +# print "deltatime: $deltatime\n"; + if( !( ( $deltatime >= -$g_max_time_delta && $deltatime <= $g_max_time_delta ) || + ( $deltatime + 3600 >= -$g_max_time_delta && $deltatime + 3600 <= $g_max_time_delta ) || + ( $deltatime - 3600 >= -$g_max_time_delta && $deltatime - 3600 <= $g_max_time_delta ) ) ) + { + $g_files_to_copy{$filename} = 1; + if( $g_opt_verbose ) + { + print "timedelta of $deltatime for $filename\n"; + } + } +} + +sub ComparePermissions +{ + if( $g_opt_ignoreperms ) + { + return; + } + my( $filename ) = shift; + if( defined( $g_alreadycomparedpermissions{$filename} ) ) + { + return; + } + $g_alreadycomparedpermissions{$filename} = 1; + + # compare permissions + if( $g_remote_mode{$filename} != $g_local_mode{$filename} ) + { + if( !$g_remote_isdir{$filename} ) + { + $g_files_to_copy{$filename} = 1; + } + else + { + MakeLocalFileAttribsMatchRemote( $filename ); + } + if( $g_opt_verbose ) + { + printf "permissions different for $filename: %s %s\n", $g_remote_mode{$filename}, $g_local_mode{$filename}; + } + } +} + +sub CompareSize +{ + if( $g_opt_ignoresize ) + { + return; + } + my( $filename ) = shift; + if( defined( $g_alreadycomparedsize{$filename} ) ) + { + return; + } + $g_alreadycomparedsize{$filename} = 1; + + # compare permissions + if( $g_remote_size{$filename} != $g_local_size{$filename} ) + { + $g_files_to_copy{$filename} = 1; + if( $g_opt_verbose ) + { + printf "size different for $filename: %d!=%d\n", $g_remote_size{$filename}, $g_local_size{$filename}; + } + } +} + +sub CompareMD5 +{ + if( !$g_opt_md5 ) + { + return; + } + my( $filename ) = shift; + if( defined( $g_alreadycomparedmd5{$filename} ) ) + { + return; + } + $g_alreadycomparedmd5{$filename} = 1; + + # compare md5 + if( $g_remote_md5{$filename} ne $g_local_md5{$filename} ) + { + $g_files_to_copy{$filename} = 1; + if( $g_opt_verbose ) + { + printf "md5 different for $filename: %s!=%s\n", $g_remote_md5{$filename}, $g_local_md5{$filename}; + } + } + else + { + my( $diff ) = 0; + my( $deltatime ) = $g_local_mtime{$filename} - $g_remote_mtime{$filename}; + if( $g_remote_size{$filename} != $g_local_size{$filename} ) + { + $diff = 1; + print "size different\n"; + } + if( $g_remote_mode{$filename} != $g_local_mode{$filename} ) + { + $diff = 1; + print "mode different\n"; + } + if( !( ( $deltatime >= -$g_max_time_delta && $deltatime <= $g_max_time_delta ) || + ( $deltatime + 3600 >= -$g_max_time_delta && $deltatime + 3600 <= $g_max_time_delta ) || + ( $deltatime - 3600 >= -$g_max_time_delta && $deltatime - 3600 <= $g_max_time_delta ) ) ) + { + $diff = 1; + print "time different\n"; + } + if( $diff ) + { + print "fixing up file attribs for $filename\n"; + MakeLocalFileAttribsMatchRemote( $filename ); + } + } +} + +#print "socket: PeerAddr: \"$g_src_machine\"\n"; +my $sock = new IO::Socket::INET ( + PeerAddr => $g_src_machine, + PeerPort => $g_opt_port, + Proto => 'tcp', + ); +die "Could not create socket: $!\n" unless $sock; + +print $sock $g_protocol_version; +my $remotedirname = $g_src_path; +print "Getting remote dirlist for $remotedirname\n"; +&GetRemoteDirList( $sock, $remotedirname ); + +my $localdirname = $g_dst_path; +print "Getting local dirlist for $localdirname\n"; +&GetLocalDirList_Dir( $localdirname ); + +my $remote_filename; +foreach $remote_filename (keys %g_remote_mtime) +{ + next if( &IsExcluded( $remote_filename ) ); + if( !defined( $g_local_mtime{$remote_filename} ) ) + { + if( $g_remote_isdir{$remote_filename} ) + { +# print "dir "; + $g_dirs_to_create{$remote_filename} = 1; + } + else + { +# print "file "; + $g_files_to_copy{$remote_filename} = 1; + } + if( $g_opt_verbose ) + { + print "doesn't exist locally and will be copied: $remote_filename\n"; + } + } + else + { + &CompareTime( $remote_filename ); + &ComparePermissions( $remote_filename ); + &CompareSize( $remote_filename ); + &CompareMD5( $remote_filename ); + } +} + +my $local_filename; +foreach $local_filename (keys %g_local_mtime) +{ + next if( &IsExcluded( $local_filename ) ); + if( !defined( $g_remote_mtime{$local_filename} ) ) + { + if( $g_local_isdir{$local_filename} ) + { + $g_dirs_to_delete{$local_filename} = 1; +# print "dir "; + } + else + { + $g_files_to_delete{$local_filename} = 1; +# print "file "; + } +# print $local_filename . " doesn't exist remotely\n"; + } + else + { + &CompareTime( $local_filename ); + &ComparePermissions( $local_filename ); + &CompareSize( $local_filename ); + } +} + +#%g_files_to_delete; +#%g_dirs_to_delete; +#%g_files_to_copy; +#%g_dirs_to_create; + +sub IsWritable +{ + my( $file ) = shift; + my( $perms ) = oct( $g_local_mode{$file} ); + if( $perms & 2 ) + { + return 1; + } + else + { + return 0; + } +} + +sub UnlinkFile +{ + my( $file ) = shift; + + print "del " . &ForwardToBackSlash( $file ) . "\n"; + if( !$g_opt_test ) + { + chmod 0666, $file || die; + unlink $file || die; + } +} + +sub UnlinkDir +{ + my( $file ) = shift; + + print "rmdir " . &ForwardToBackSlash( $file ) . "\n"; + if( !$g_opt_test ) + { + chmod 0777, $file || die; + if( !( rmdir $file ) ) + { + print "Couldn't rmdir " . &ForwardToBackSlash( $file ) . "\n"; + } + } +} + +sub DeleteOrphanFile +{ + my( $file ) = shift; +# print "\$g_local_isdir{$file} = $g_local_isdir{$file}\n"; + # print "DeleteOrphanFile( $file )\n"; + my( $localfile ) = &AddBaseDir( $file ); + my( $iswritable ) = &IsWritable( $file ); + if( $iswritable ) + { + if( $g_opt_deletewritable ) + { + &UnlinkFile( &AddBaseDir( $file ) ); + } + else + { + print "Would have deleted \"$file\" (use --delete-writable to delete)\n"; + } + } + else + { + if( $g_opt_deletereadonly ) + { + &UnlinkFile( &AddBaseDir( $file ) ); + } + else + { + print "Would have deleted \"$file\" (use --delete-readonly to delete)\n"; + } + } +} + +sub DeleteOrphanDir +{ + my $dir = shift; + my( $localdir ) = &AddBaseDir( $dir ); + if( $g_opt_deletedirs ) + { + &UnlinkDir( $localdir ); + } + else + { + print "Would have deleted \"$dir\" (use --delete-dirs to delete)\n"; + } +} + +sub MakeLocalFileAttribsMatchRemote +{ + return if( $g_opt_test ); + my( $file ) = shift; + my( $localfilename ) = &AddBaseDir( $file ); + + # Make it writable so that we can tweak permissions/time. + chmod 0666, $localfilename || die $!; + + # Set the time on the file to match the remote + my( @statresult ); + if( !( @statresult = stat $localfilename ) ) + { + die "couldn't stat $localfilename locally\n"; + } + # @statresult[8] == access time. . we don't care to change this. + utime $statresult[8], $g_remote_mtime{$file}, $localfilename || die $!; + + # Set the permissions on the file to match the remote + chmod oct( $g_remote_mode{$file} ), $localfilename || die $!; +} + +sub CopyFileFromRemote +{ + my( $file ) = shift; + if( &IsWritable( $file ) && !$g_opt_clobberwritablenewer && $g_local_mtime{$file} > $g_remote_mtime{$file} ) + { + print "Would have copied \"$file\" (use --clobber-writable-newer to copy)\n"; + return; + } + print "copy $file from remote ($g_remote_size{$file} bytes)\n"; + if( !$g_opt_test ) + { + my( $localfilename ) = &AddBaseDir( $file ); + # make the my version writable so that we can write over it, if it exists + if( $g_local_mtime{$file} ) + { + chmod 0666, $localfilename || die $!; + } + print $sock "getfile $file\n"; + my( $size ) = $g_remote_size{$file}; + my( $filebits ); +# print "reading $file: $size\n"; + my( $readsize ) = read $sock, $filebits, $size; + if( $readsize != $size ) + { + die "read size ($readsize) != expected size ($size) for $file\nYou either:\n\t1) lost your connection\n\t2) the remote file has changed since start of mccopy\n"; + } + +# print "finished with $file\n"; + local( *FILE ); +# print "opening $localfilename\n"; + open FILE, ">$localfilename" || die $!; +# print "binmode $localfilename"; + binmode( FILE ) || die $!; +# print "after binmode $localfilename"; + print FILE $filebits; + close FILE || die $!; +# print "closed $localfilename\n"; + + MakeLocalFileAttribsMatchRemote( $file ); + } +} + +sub PrettifyTime +{ + my( $inseconds ) = shift; + my( $hours, $minutes, $seconds ); + my( @blah ) = gmtime( $inseconds ); + $hours = $blah[2]; + $minutes = $blah[1]; + $seconds = $blah[0]; + return sprintf "%02d:%02d:%02d", $hours, $minutes, $seconds; +} + +# remove my files that aren't on remote +my $file; +foreach $file (keys %g_files_to_delete) +{ + &DeleteOrphanFile( $file ); +} + +# remove my dirs that aren't on remote +my $dir; +foreach $dir (sort { length $b <=> length $a } keys( %g_dirs_to_delete ) ) +{ + &DeleteOrphanDir( $dir ); +} + + +# create my dirs that are only on remote +foreach $dir (sort { length $a <=> length $b } keys( %g_dirs_to_create) ) +{ + my( $localdir ) = &AddBaseDir( $dir ); + print "mkdir $localdir, 0777\n"; + if( !$g_opt_test ) + { + mkdir $localdir, 0777 || die $!; + } +} + +# calculate the total size of files to transfer +my $totalbytes = 0; +foreach $file ( keys %g_files_to_copy ) +{ + $totalbytes += $g_remote_size{$file}; +} + +print "$totalbytes bytes to copy\n"; + +# copy files from remote that are different +my $bytescopied = 0; +my $starttime = time; +foreach $file (sort( keys %g_files_to_copy ) ) +{ + &CopyFileFromRemote( $file ); + $bytescopied += $g_remote_size{$file}; + my $curtime = time; + my $deltatime = $curtime - $starttime; + my $percentdone; + if( $totalbytes ) + { + $percentdone = ( $bytescopied * 1.0 ) / $totalbytes; + } + if( $totalbytes && $percentdone && $deltatime ) + { + printf "progress: %.1f%% %s/%s %d bytes/sec\n", + $percentdone * 100, + &PrettifyTime( $deltatime ), + &PrettifyTime( 1.0 / $percentdone * $deltatime ), + $bytescopied / $deltatime; + } +} + +print "done!\n"; + +close($sock); + + diff --git a/devtools/bin/UpdateProgress.exe b/devtools/bin/UpdateProgress.exe new file mode 100644 index 0000000..d0da70f Binary files /dev/null and b/devtools/bin/UpdateProgress.exe differ diff --git a/devtools/bin/VProject.exe b/devtools/bin/VProject.exe new file mode 100644 index 0000000..9c64ddf Binary files /dev/null and b/devtools/bin/VProject.exe differ diff --git a/devtools/bin/build_sdk_vcproj.py b/devtools/bin/build_sdk_vcproj.py new file mode 100644 index 0000000..b8759e0 --- /dev/null +++ b/devtools/bin/build_sdk_vcproj.py @@ -0,0 +1,11 @@ + +from vsdotnetxmlparser import * + + +WriteSeparateVCProj( LoadVCProj( 'cl_dll\\client.vcproj' ), ["Debug SDK|Win32", "Release SDK|Win32"], 'cl_dll\\client_sdk.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'cl_dll\\client.vcproj' ), ["Debug HL2|Win32", "Release HL2|Win32"], 'cl_dll\\client_sdk_hl2.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'cl_dll\\client.vcproj' ), ["Debug HL2MP|Win32", "Release HL2MP|Win32"], 'cl_dll\\client_sdk_hl2mp.vcproj' ) + +WriteSeparateVCProj( LoadVCProj( 'dlls\\hl.vcproj' ), ["Debug SDK|Win32", "Release SDK|Win32"], 'dlls\\hl_sdk.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'dlls\\hl.vcproj' ), ["Debug HL2|Win32", "Release HL2|Win32"], 'dlls\\hl_sdk_hl2.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'dlls\\hl.vcproj' ), ["Debug HL2MP|Win32", "Release HL2MP|Win32"], 'dlls\\hl_sdk_hl2mp.vcproj' ) diff --git a/devtools/bin/buildshaderlist.pl b/devtools/bin/buildshaderlist.pl new file mode 100644 index 0000000..98a4051 --- /dev/null +++ b/devtools/bin/buildshaderlist.pl @@ -0,0 +1,22 @@ +use File::DosGlob; +@ARGV = map { + my @g = File::DosGlob::glob($_) if /[*?]/; + @g ? @g : $_; + } @ARGV; + +open FILE, ">__tmpshaderlist.txt"; + +foreach $arg (@ARGV) +{ + if( $arg =~ m/\.fxc$/i || $arg =~ m/\.vsh$/i || $arg =~ m/\.psh$/i ) + { + print $arg . "\n"; + print FILE $arg . "\n"; + } +} + +close FILE; + +system "buildshaders.bat __tmpshaderlist"; + +unlink "__tmpshaderlist.txt"; \ No newline at end of file diff --git a/devtools/bin/buildtest.pl b/devtools/bin/buildtest.pl new file mode 100644 index 0000000..16730b5 --- /dev/null +++ b/devtools/bin/buildtest.pl @@ -0,0 +1,83 @@ +use strict; + +sub DoBuild +{ + my @output; + my $buildtype = shift; + if( $buildtype eq "release" ) + { + open BUILD, "dev_build_all.bat|"; + } + elsif( $buildtype eq "debug" ) + { + open BUILD, "dev_build_all.bat debug|"; + } + else + { + die; + } + my $buildfailed = 0; + while( ) + { + if( /Build Errors\!/ ) + { + $buildfailed = 1; + } + print; + push @output, $_; + } + close build; + + if( $buildfailed ) + { + open CHANGES, "p4 changes -m 10 -s submitted //ValveGames/main/src/...|"; + my @changes = ; + close CHANGES; + open EMAIL, ">email.txt"; + print EMAIL "LAST 10 SUBMITS TO MAIN:\n"; + print EMAIL @changes; + print EMAIL "\n"; + my $line; + foreach $line ( @output ) + { + if( $line =~ m/error/i ) + { + print EMAIL $line; + } + } + print EMAIL "--------------------------------------------\n\n\n\n"; + print EMAIL @output; + close EMAIL; + system "devtools\\bin\\smtpmail.exe -to srcdev\@valvesoftware.com -from srcdev\@valvesoftware.com -subject \"FIX THE BUILD\! ($buildtype)\" -verbose email.txt"; +# system "devtools\\bin\\smtpmail.exe -to gary\@valvesoftware.com -from srcdev\@valvesoftware.com -subject \"FIX THE BUILD\! ($buildtype)\" -verbose email.txt"; + } +} + +while( 1 ) +{ + $ENV{"USE_INCREDIBUILD"} = "1"; + system "p4 sync > sync.txt 2>&1"; + my $hasChange = 1; + my $line; + open SYNC, " ) + { + if( m/File\(s\) up-to-date/ ) + { + $hasChange = 0; + } + print; + } + close SYNC; + if( $hasChange ) + { + print "changes checked in\n"; + &DoBuild( "release" ); + &DoBuild( "debug" ); + } + else + { + print "no changes checked in\n"; + sleep 30; + } +} \ No newline at end of file diff --git a/devtools/bin/check_gcc_compile.pl b/devtools/bin/check_gcc_compile.pl new file mode 100644 index 0000000..4d70637 --- /dev/null +++ b/devtools/bin/check_gcc_compile.pl @@ -0,0 +1,23 @@ +#! perl + +# scan all .o files for illegal instructions from passing aggregates to varargs functions. + +use File::Find; + +find( \&CheckFile, "." ); + +sub CheckFile + { + return unless (/\.o$/ ); + open( DIS, "objdump --disassemble -C $_|" ) || die "can't process $_"; + while( ) + { + $symbol = $1 if ( /^[0-9]+ \<(.*)\>:/ ); + if ( /\s+ud2a/ ) + { + print "Illegal instruction in $symbol in ", $File::Find::name, "\n"; + } + + } + + } diff --git a/devtools/bin/checkin.pl b/devtools/bin/checkin.pl new file mode 100644 index 0000000..8b4eddd --- /dev/null +++ b/devtools/bin/checkin.pl @@ -0,0 +1,660 @@ +use strict; + +################################################### +# CONFIG VARS +################################################### + +# FIXME: load these from a separate file so that each user can have their own config without editingthis file. +my $g_P4UserName = "gary"; + +my $g_LocalBaseDir = "u:\\hl2"; +my $g_LocalBranchSubdir = "src5"; +my $g_LocalBranchName = "gary_src5"; +my $g_LocalBranchClient = "gary_work_src5"; + +my $g_MainCopyBaseDir = "u:\\hl2"; +my $g_LocalBranchMainCopySubdir = "src5_main"; +my $g_LocalBranchMainCopyName = "gary_src5_main"; +#my $g_LocalBranchMainCopyClient = "gary_work_src5_main"; + +my $g_MainBaseDir = "u:\\hl2_main"; +my $g_MainBranchSubdir = "src_main"; +#my $g_MainBranchName = "gary_src_main"; +#my $g_MainBranchClient = "gary_work_src_main"; + +my $g_UseIncredibuildForMain = 1; + +# FIXME: need to make this work for those that don't work on HL2. +my $g_LocalBranchHasHL1Port = 0; +my $g_LocalBranchHasCSPort = 0; +my $g_LocalBranchHasTF2 = 0; + +my $g_CheckinFileStampTimes = "c:\\checkin_filetimes.txt"; + +# either use VSS directly via the command-line, or use Tom's tool. +my $g_UseVSS = 0; + +################################################### +# Helper vars made up of config vars +################################################### + +my $g_LocalBranchDir = "$g_LocalBaseDir\\$g_LocalBranchSubdir"; +my $g_LocalBranchMainCopyDir = "$g_MainCopyBaseDir\\$g_LocalBranchMainCopySubdir"; +my $g_MainBranchDir = "$g_MainBaseDir\\$g_MainBranchSubdir"; + +################################################### + +my $g_DebugStub = 0; + +my $stage = shift; +if( $stage != 1 && + $stage != 2 && + $stage != 3 && + $stage ne "syncmain" && + $stage ne "syncmainsrc" && + $stage ne "synclocal" && + $stage ne "synclocalrelease" && + $stage ne "synclocaldebug" && + $stage ne "synclocalsrc" && + $stage ne "synclocalsrcrelease" && + $stage ne "sync" && + $stage ne "syncmaincontent" ) +{ + print "checkin.pl 1 : to get started with a checkin\n"; + print "checkin.pl 2 : second stage of checkin\n"; + print "checkin.pl 3 : third stage of checkin\n"; + print "checkin.pl syncmain : sync main source and content, then build\n"; + print "checkin.pl syncmainsrc : sync main source then build\n"; + print "checkin.pl syncmaincontent : sync main content only\n"; + print "checkin.pl synclocal : merge personal branch, sync content,\n"; + print " then build.\n"; + print "checkin.pl synclocalrelease : merge personal branch, sync content,\n"; + print " then build (release only).\n"; + print "checkin.pl synclocaldebug : merge personal branch, sync content,\n"; + print " then build (debug only).\n"; + print "checkin.pl synclocalsrc : merge personal branch, then build.\n"; + print "checkin.pl synclocalsrcrelease : merge personal branch, then build\n"; + print " (release only).\n"; + print "checkin.pl sync : merge personal branch, sync main src,\n"; + print " sync content for both, and then build\n"; + print " the whole thing.\n"; + die; +} + +sub RunCmd +{ + my $cmd = shift; + print $cmd . "\n"; + if( !$g_DebugStub ) + { + return system $cmd; + } +} + +sub CD +{ + my $dir = shift; + print "cd $dir\n"; + if( !$g_DebugStub ) + { + chdir $dir; + } +} + +sub SSGet +{ + my $vssdir = shift; + my $localdir = shift; + + &CD( $localdir ); + &RunCmd( "ss WorkFold $vssdir $localdir" ); + print "\n"; + my $cmd = "ss get $vssdir -R"; + local( *SS ); + open SS, "$cmd|"; + my $workingdir; + while( ) + { + # FIXME: clean up this output. + $_ =~ s/\n//; + if( m/^\$/ ) + { + $workingdir = $_; +# print "WORKING DIR: $_\n"; + } + elsif( m/^getting/i ) + { + print "GETTING: $workingdir $_\n"; + } + elsif( m/^replacing local file/i ) + { + print "REPLACING: $workingdir $_\n"; + } + elsif( m/^File/ ) + { + print "ALREADY EXISTS: $workingdir $_\n"; + } + else + { +# print "WTF: $_\n"; + } + } + close SS; +} + +sub FastSSGet +{ + my $localdir = shift; + my $option = shift; + + &RunCmd( "\\\\hl2vss\\hl2vss\\win32\\syncfrommirror.bat $option $localdir" ); +} + +sub FileIsWritable +{ + my $file = shift; + + my @statresult = stat $file; + die if !@statresult; + my $perms = oct( $statresult[2] ); + if( $perms & 2 ) + { + return 1; + } + else + { + return 0; + } +} + +sub CompareDirs +{ + my $filesThatHaveChanged = shift; + my $filesThatHaveNotChanged = shift; + my @out = `robocopy $g_MainBaseDir\\checkinbins\\. $g_MainBaseDir\\. /S /L /V`; + my $line; + my $cwd; + foreach $line ( @out ) + { + next if( $line =~ /\*EXTRA Dir/ ); + next if( $line =~ /\*EXTRA Dir/ ); + next if( $line =~ /\*EXTRA File/ ); + if( $line =~ m/\s*\d+\s+(\S+\\)/ ) + { + $cwd = $1; + next; + } + if( $line =~ m/\s+Older\s+\d+\s+(\S+)/ ) + { + my $testfilename = $cwd . $1; + my $filename = $testfilename; + $filename =~ s/\\checkinbins//i; + my $diffresult = system "diff $testfilename $filename > nil"; + if( $diffresult != 0 ) + { + push @{$filesThatHaveChanged}, $filename; + } + else + { + if( &FileIsWritable( $filename ) ) + { + push @{$filesThatHaveNotChanged}, $filename; + } + } + next; + } + elsif( $line =~ m/\s+same\s+\d+\s+(\S+)/ ) + { + my $filename = $cwd . $1; + $filename =~ s/\\checkinbins//i; + if( &FileIsWritable( $filename ) ) + { + push @{$filesThatHaveNotChanged}, $filename; + } + next; + } + if( $line =~ m/\s+New File\s+\d+\s+(\S+)/ ) + { + die "$cwd $1 didn't build!\n"; + } + print "DEBUG: unhandled line: $line\n"; + } +} + +sub CheckoutFile +{ + my $file = shift; + print "-----------------\nchecking out $file\n"; + if( $file =~ /src_main/i ) + { + # need to use p4 to check this one out. + my $dir = $file; + $dir =~ s/\\([^\\]*)$//; + &CD( $dir ); + &RunCmd( "p4 edit $1" ); + } + else + { + my $dir = $file; + $dir =~ s/\\([^\\]*)$//; + &CD( $dir ); + $file =~ s,\\,/,g; + if( $file =~ m/cstrike/i || $file =~ m/hl1/i ) + { + $file =~ s,u:/hl2_main/,\$/hl1ports/release/dev/,gi; + &RunCmd( "ss WorkFold \$/hl1ports/release/dev $g_MainBaseDir" ); + } + elsif( $file =~ m/\/tf2/i ) + { + $file =~ s,u:/hl2_main/,\$/tf2/release/dev/,gi; + &RunCmd( "ss WorkFold \$/tf2/release/dev $g_MainBaseDir" ); + } + else + { + $file =~ s,u:/hl2_main/,\$/hl2/release/dev/,gi; + &RunCmd( "ss WorkFold \$/hl2/release/dev $g_MainBaseDir" ); + } + print "\n"; + &RunCmd( "ss Checkout -G- $file" ); + } +} + +sub RevertFile +{ + my $file = shift; + print "-----------------\nreverting $file\n"; + if( $file =~ /src_main/i ) + { + # need to use p4 to revert this one + my $dir = $file; + $dir =~ s/\\([^\\]*)$//; + &CD( $dir ); + &RunCmd( "p4 sync -f $1" ); + } + else + { + my $dir = $file; + $dir =~ s/\\([^\\]*)$//; + &CD( $dir ); + $file =~ s,\\,/,g; + my $vssfile = $file; + if( $file =~ m/cstrike/i || $file =~ m/hl1/i ) + { + $vssfile =~ s,u:/hl2_main/,\$/hl1ports/release/dev/,gi; + &RunCmd( "ss WorkFold \$/hl1ports/release/dev $g_MainBaseDir" ); + } + elsif( $file =~ m/\/tf2/i ) + { + $vssfile =~ s,u:/hl2_main/,\$/tf2/release/dev/,gi; + &RunCmd( "ss WorkFold \$/tf2/release/dev $g_MainBaseDir" ); + } + else + { + $vssfile =~ s,u:/hl2_main/,\$/hl2/release/dev/,gi; + &RunCmd( "ss WorkFold \$/hl2/release/dev $g_MainBaseDir" ); + } + print "\n"; + unlink $file; + &RunCmd( "ss Get -I- $vssfile" ); + } +} + +sub SyncMainSource +{ + # SYNC MAIN + &CD( $g_MainBranchDir ); + &RunCmd( "p4 sync" ); +} + +sub SyncMainContent +{ + # SYNC VSS + &CD( $g_MainBranchDir ); + &RunCmd( "clean.bat" ); + if( $g_UseVSS ) + { + &SSGet( "\$/hl2/release/dev", $g_MainBaseDir ); + &SSGet( "\$/hl1ports/release/dev", $g_MainBaseDir ); + # NOTE: only get tf2 bin since we aren't testing tf2 right now + &SSGet( "\$/tf2/release/dev/tf2/bin", "$g_MainBaseDir/tf2/bin" ); + } + else + { + &FastSSGet( $g_MainBaseDir, "all" ); + } +} + +sub BuildMain +{ + if( $g_UseIncredibuildForMain ) + { + $ENV{"USE_INCREDIBUILD"} = "1"; + } + &CD( $g_MainBranchDir ); + &RunCmd( "clean.bat" ); + &RunCmd( "build_hl2.bat" ); + &RunCmd( "build_hl1_game.bat" ); + &RunCmd( "build_cs_game.bat" ); + &RunCmd( "build_tf2_game.bat" ); + if( $g_UseIncredibuildForMain ) + { + undef $ENV{"USE_INCREDIBUILD"}; + } +} + +sub SyncLocalBranchSource +{ + &CD( $g_LocalBranchDir ); + &RunCmd( "p4mf.bat $g_LocalBranchName $g_LocalBranchClient pause" ); + # FIXME: This needs to specify the changelist since p4mf makes a new changelist. +# &RunCmd( "p4 submit" ); + +} + +sub SyncMainCopySource +{ + &CD( $g_LocalBranchMainCopyDir ); + &RunCmd( "p4 integrate -d -i -b $g_LocalBranchMainCopyName" ); + &RunCmd( "p4 resolve -at ..." ); + # Update the changelist and submit + &RunCmd( "p4 change -o | sed -e \"s//Merge from main/g\" | p4 submit -i" ); +} + +sub SyncLocalBranchContent +{ + &CD( $g_LocalBranchDir ); + + # CLEAN LOCAL BRANCH + &RunCmd( "clean.bat" ); + + # SYNC VSS + if( $g_UseVSS ) + { + &SSGet( "\$/hl2/release/dev", $g_LocalBaseDir ); + if( $g_LocalBranchHasHL1Port || $g_LocalBranchHasCSPort ) + { + &SSGet( "\$/hl1ports/release/dev", $g_LocalBaseDir ); + } + if( $g_LocalBranchHasTF2 ) + { + &SSGet( "\$/tf2/release/dev", $g_LocalBaseDir ); + } + } + else + { + if( $g_LocalBranchHasHL1Port || $g_LocalBranchHasCSPort ) + { + &FastSSGet( $g_LocalBaseDir, "all" ); + } + else + { + &FastSSGet( $g_LocalBaseDir, "hl2" ); + } + # FIXME: screwed on tf2 here. + } +} + +sub BuildLocalBranch +{ + &CD( $g_LocalBranchDir ); + + # BUILD DEBUG if we don't want release only + if( !( $stage =~ /release/i ) ) + { + # CLEAN LOCAL BRANCH + &RunCmd( "clean.bat" ); + + &RunCmd( "build_hl2.bat debug" ); + if( $g_LocalBranchHasHL1Port ) + { + &RunCmd( "build_hl1_game.bat debug" ); + } + if( $g_LocalBranchHasCSPort ) + { + &RunCmd( "build_cs_game.bat debug" ); + } + if( $g_LocalBranchHasTF2 ) + { + &RunCmd( "build_tf2_game.bat debug" ); + } + } + + if( !( $stage =~ /debug/i ) ) + { + # CLEAN LOCAL BRANCH + &RunCmd( "clean.bat" ); + + # BUILD RELEASE + &RunCmd( "build_hl2.bat" ); + if( $g_LocalBranchHasHL1Port ) + { + &RunCmd( "build_hl1_game.bat" ); + } + if( $g_LocalBranchHasCSPort ) + { + &RunCmd( "build_cs_game.bat" ); + } + if( $g_LocalBranchHasTF2 ) + { + &RunCmd( "build_tf2_game.bat" ); + } + } +} + +sub GetMainUpToDate +{ + &SyncMainSource(); + &SyncMainContent(); + &BuildMain(); +} + +sub LockPerforce +{ + while( 1 ) + { + my $thing = `p4mutex lock main_src 0 $g_P4UserName 207.173.178.12:1666`; + print $thing; + last if $thing =~ /Success/; + sleep 30; + } +} + +sub SaveMainTimeStampsBeforeIntegrate +{ + &CD( $g_MainBranchDir ); + # Get a list of files that are going to be integrated into main so that we can save off their time stamp info. + my @filestointegrate = `p4 integrate -n -r -b $g_LocalBranchName`; + my $file; + local( * TIMESTAMPS ); + open TIMESTAMPS, ">$g_CheckinFileStampTimes"; + foreach $file ( @filestointegrate ) + { + $file =~ s,//ValveGames/main/src/([^#]*)\#.*,$1,gi; + $file =~ s/\n//; + $file =~ s,\\,/,g; + my $localfilename = "$g_MainBranchDir/$file"; + my @statinfo = stat $localfilename; + next if !@statinfo; + my $mtime = $statinfo[9]; + print TIMESTAMPS $file . "|" . $mtime . "\n"; + } + close TIMESTAMPS; +} + +sub SetMainTimeStampsOnRevertedFiles +{ + &CD( $g_MainBranchDir ); + # Get a list of files that we might have to revert times on if they aren't in the changelist. + local( *TIMESTAMPS ); + open TIMESTAMPS, "<$g_CheckinFileStampTimes"; + my @timestamps = ; + my %filetotimestamp; + my $i; + for( $i = 0; $i < scalar( @timestamps ); $i++ ) + { + $timestamps[$i] =~ s/\n//; + $timestamps[$i] =~ m/^(.*)\|(.*)$/; + $filetotimestamp{$1} = $2; + } + close TIMESTAMPS; + + my $key; + foreach $key( keys( %filetotimestamp ) ) + { + print "before: \'$key\" \"$filetotimestamp{$key}\"\n"; + } + + local( *CHANGELIST ); + open CHANGELIST, "p4 change -o|"; + while( ) + { + if( m,//ValveGames/main/src/(.*)\s+\#,i ) + { + if( defined $filetotimestamp{$1} ) + { + undef $filetotimestamp{$1}; + } + } + } + close CHANGELIST; + + foreach $key( keys( %filetotimestamp ) ) + { + if( defined $filetotimestamp{$key} ) + { + my $filename = $g_MainBranchDir . "/" . $key; + $filename =~ s,/,\\,g; + my @statresults; + if( @statresults = stat $filename ) + { + my $mode = $statresults[2]; + my $atime = $statresults[8]; + my $mtime = $statresults[9]; + + print "reverting timestamp for $filename\n"; + + chmod 0666, $filename || die $!; + + utime $atime, $filetotimestamp{$key}, $filename || die $!; + + chmod $mode, $filename || die $!; + } + } + } +} + + +if( $stage eq "synclocal" || $stage eq "synclocalrelease" || $stage eq "synclocaldebug" || $stage eq "sync" ) +{ + &SyncLocalBranchSource(); + &SyncMainCopySource(); + &SyncLocalBranchContent(); + &BuildLocalBranch(); +} + +if( $stage eq "synclocalsrc" || $stage eq "synclocalsrcrelease" ) +{ + &SyncLocalBranchSource(); + &SyncMainCopySource(); + &BuildLocalBranch(); +} + +if( $stage eq "syncmainsrc" ) +{ + &SyncMainSource(); + &BuildMain(); +} + +if( $stage eq "syncmain" || $stage eq "sync" ) +{ + &GetMainUpToDate(); +} + +if( $stage eq "syncmaincontent" ) +{ + &SyncMainContent(); +} + +if( $stage == 1 ) +{ + # lock p4 +# &LockPerforce(); + + &GetMainUpToDate(); + + # merge main into local branch + &SyncLocalBranchSource(); + + # TODO: need a way to detect if there are conflicts or not. If there are, pause here. + + # Make a copy of targets so that we can tell which ones changed. + &RunCmd( "robocopy $g_MainBaseDir\\ $g_MainBaseDir\\checkinbins\\ /purge" ); + &RunCmd( "robocopy $g_MainBaseDir\\bin\\. $g_MainBaseDir\\checkinbins\\bin\\. /mir" ); + &RunCmd( "robocopy $g_MainBaseDir\\hl2\\bin\\. $g_MainBaseDir\\checkinbins\\hl2\\bin\\. /mir" ); + &RunCmd( "robocopy $g_MainBaseDir\\hl1\\bin\\. $g_MainBaseDir\\checkinbins\\hl1\\bin\\. /mir" ); + &RunCmd( "robocopy $g_MainBaseDir\\cstrike\\bin\\. $g_MainBaseDir\\checkinbins\\cstrike\\bin\\. /mir" ); + &RunCmd( "robocopy $g_MainBaseDir\\tf2\\bin\\. $g_MainBaseDir\\checkinbins\\tf2\\bin\\. /mir" ); + &RunCmd( "robocopy $g_MainBaseDir\\platform\\servers\\. $g_MainBaseDir\\checkinbins\\platform\\servers\\. /mir" ); + &RunCmd( "robocopy $g_MainBranchDir\\lib\\. $g_MainBaseDir\\checkinbins\\$g_MainBranchSubdir\\lib\\. /mir" ); + + # integrate from personal branch into main. . accept theirs. + # TODO: need to check if main has a changelist or not and warn! + &CD( $g_MainBranchDir ); + + &SaveMainTimeStampsBeforeIntegrate(); + + &RunCmd( "p4 integrate -r -b $g_LocalBranchName" ); + + &RunCmd( "p4 resolve -at ..." ); + + # revert unchanged files. + my @unchanged = `p4 diff -sr`; + my $file; + foreach $file ( @unchanged ) + { + &RunCmd( "p4 revert $file" ); + } + + print "Do \"checkin.pl 2\" when you are done reverting unchanging files and fixing up any other diffs in your main client.\n"; +} +elsif( $stage == 2 ) +{ + &SetMainTimeStampsOnRevertedFiles(); + + # build main with the new changes + &BuildMain(); + + # compare what we just built to what we saved off earlier + my @filesToCheckOut; + my @filesThatHaveNotChanged; + &CompareDirs( \@filesToCheckOut, \@filesThatHaveNotChanged ); + + my $file; +# $g_DebugStub = 1; + foreach $file ( @filesThatHaveNotChanged ) + { + &RevertFile( $file ); + } + + foreach $file ( @filesToCheckOut ) + { + &CheckoutFile( $file ); + } + + print "-----------------\n"; + print "Do \"checkin.pl 3\" when you are finished testing to checkin files and release the mutex.\n"; +} +elsif( $stage == 3 ) +{ + my @filesToCheckOut; + my @filesThatHaveNotChanged; + &CompareDirs( \@filesToCheckOut, \@filesThatHaveNotChanged ); + + # TODO: check stuff in here and unlock p4 + # TODO: go ahead and sync src_main to main so that they match + # TODO: merge main into src again so any changes that you made while checking in are propogated + + &SyncMainCopySource(); +} + + diff --git a/devtools/bin/checkshaderchecksums.pl b/devtools/bin/checkshaderchecksums.pl new file mode 100644 index 0000000..26841cb --- /dev/null +++ b/devtools/bin/checkshaderchecksums.pl @@ -0,0 +1,116 @@ +use String::CRC32; +BEGIN {use File::Basename; push @INC, dirname($0); } +require "valve_perl_helpers.pl"; + +sub GetShaderType +{ + my $shadername = shift; + my $shadertype; + if( $shadername =~ m/\.vsh/i ) + { + $shadertype = "vsh"; + } + elsif( $shadername =~ m/\.psh/i ) + { + $shadertype = "psh"; + } + elsif( $shadername =~ m/\.fxc/i ) + { + $shadertype = "fxc"; + } + else + { + die; + } + return $shadertype; +} + +sub GetShaderSrc +{ + my $shadername = shift; + if ( $shadername =~ m/^(.*)-----/i ) + { + return $1; + } + else + { + return $shadername; + } +} + +sub GetShaderType +{ + my $shadername = shift; + my $shadertype; + if( $shadername =~ m/\.vsh/i ) + { + $shadertype = "vsh"; + } + elsif( $shadername =~ m/\.psh/i ) + { + $shadertype = "psh"; + } + elsif( $shadername =~ m/\.fxc/i ) + { + $shadertype = "fxc"; + } + else + { + die; + } + return $shadertype; +} + +sub GetShaderBase +{ + my $shadername = shift; + if ( $shadername =~ m/-----(.*)$/i ) + { + return $1; + } + else + { + my $shadertype = &GetShaderType( $shadername ); + $shadername =~ s/\.$shadertype//i; + return $shadername; + } +} + +$g_x360 = 0; +$g_vcsext = ".vcs"; + +while( 1 ) +{ + $inputbase = shift; + + if( $inputbase =~ m/-x360/ ) + { + $g_x360 = 1; + $g_vcsext = ".360.vcs"; + } + else + { + last; + } +} + +# rip the txt off the end if it's there. +$inputbase =~ s/\.txt//i; + +my @srcfiles = &LoadShaderListFile( $inputbase ); + +foreach $srcfile ( @srcfiles ) +{ + my $shadertype = &GetShaderType( $srcfile ); + my $shaderbase = &GetShaderBase( $srcfile ); + my $shadersrc = &GetShaderSrc( $srcfile ); + my $vcsFileName = "..\\..\\..\\game\\hl2\\shaders\\$shadertype\\$shaderbase" . $g_vcsext; +# print "shadersrc: $shadersrc vcsFileName: $vcsFileName\n"; + + if( $g_x360 && ( $shaderbase =~ m/_ps20$/i ) ) + { + next; # skip _ps20 files for 360 + } + + &CheckCRCAgainstTarget( $shadersrc, $vcsFileName, 1 ); +} diff --git a/devtools/bin/copyshaderincfiles.pl b/devtools/bin/copyshaderincfiles.pl new file mode 100644 index 0000000..0625833 --- /dev/null +++ b/devtools/bin/copyshaderincfiles.pl @@ -0,0 +1,86 @@ +BEGIN {use File::Basename; push @INC, dirname($0); } +require "valve_perl_helpers.pl"; +use Cwd; +use String::CRC32; + +my $txtfilename = shift; +my $arg = shift; + +my $is360 = 0; +my $platformextension = ""; +if( $arg =~ m/-x360/i ) +{ + $is360 = 1; + $platformextension = ".360"; +} + +# Get the changelist number for the Shader Auto Checkout changelist. Will create the changelist if it doesn't exist. +my $changelistnumber = `valve_p4_create_changelist.cmd ..\\..\\..\\game\\hl2\\shaders \"Shader Auto Checkout VCS\"`; +# Get rid of the newline +$changelistnumber =~ s/\n//g; + +my $changelistarg = ""; +if( $changelistnumber != 0 ) +{ + $changelistarg = "-c $changelistnumber" +} + +open TXTFILE, "<$txtfilename"; + +my $src; +my $dst; +while( $src = ) +{ + # get rid of comments + $src =~ s,//.*,,g; + + # skip blank lines + if( $src =~ m/^\s*$/ ) + { + next; + } + + # Get rid of newlines. + $src =~ s/\n//g; + + # Save off the shader source filename. + my $dst = $src; + + $dst =~ s/_tmp//gi; + + # Does the dst exist? + my $dstexists = -e $dst; + my $srcexists = -e $src; + # What are the time stamps for the src and dst? + my $srcmodtime = ( stat $src )[9]; + my $dstmodtime = ( stat $dst )[9]; + + # Open for edit or add if different than what is in perforce already. + if( !$dstexists || ( $srcmodtime != $dstmodtime ) ) + { + # Make the target writable if it exists + if( $dstexists ) + { + MakeFileWritable( $dst ); + } + + my $dir = $dst; + $dir =~ s,([^/\\]*$),,; # rip the filename off the end + my $filename = $1; + + # create the target directory if it doesn't exist + if( !$dstexists ) + { + &MakeDirHier( $dir, 0777 ); + } + + # copy the file to its targets. . . we want to see STDERR here if there is an error. + my $cmd = "copy $src $dst > nul"; +# print STDERR "$cmd\n"; + system $cmd; + + MakeFileReadOnly( $dst ); + } +} + +close TXTFILE; diff --git a/devtools/bin/copyshaders.pl b/devtools/bin/copyshaders.pl new file mode 100644 index 0000000..cb849a8 --- /dev/null +++ b/devtools/bin/copyshaders.pl @@ -0,0 +1,172 @@ +BEGIN {use File::Basename; push @INC, dirname($0); } +require "valve_perl_helpers.pl"; +use Cwd; +use String::CRC32; + +sub ReadInputFileWithIncludes +{ + local( $filename ) = shift; + + local( *INPUT ); + local( $output ); + + open INPUT, "<$filename" || die; + + local( $line ); + local( $linenum ) = 1; + while( $line = ) + { + if( $line =~ m/\#include\s+\"(.*)\"/i ) + { + $output.= ReadInputFileWithIncludes( $1 ); + } + else + { + $output .= $line; + } + } + + close INPUT; + return $output; +} + +sub PatchCRC +{ + my $filename = shift; + my $crc = shift; +# print STDERR "PatchCRC( $filename, $crc )\n"; + local( *FP ); + open FP, "+<$filename" || die; + binmode( FP ); + seek FP, 6 * 4, 0; + my $uInt = "I"; + if( $filename =~ m/360/ ) + { + $uInt = "N"; + } + print FP pack $uInt, $crc; + close FP; +} + +my $txtfilename = shift; +my $arg = shift; + +my $is360 = 0; +my $platformextension = ""; +if( $arg =~ m/-x360/i ) +{ + $is360 = 1; + $platformextension = ".360"; +} + +# Get the changelist number for the Shader Auto Checkout changelist. Will create the changelist if it doesn't exist. +my $changelistnumber = `valve_p4_create_changelist.cmd ..\\..\\..\\game\\hl2\\shaders \"Shader Auto Checkout VCS\"`; +# Get rid of the newline +$changelistnumber =~ s/\n//g; + +my $changelistarg = ""; +if( $changelistnumber != 0 ) +{ + $changelistarg = "-c $changelistnumber" +} + +open TXTFILE, "<$txtfilename"; + +my $src; +my $dst; +while( $src = ) +{ + # get rid of comments + $src =~ s,//.*,,g; + + # skip blank lines + if( $src =~ m/^\s*$/ ) + { + next; + } + + # Get rid of newlines. + $src =~ s/\n//g; + + # Save off the shader source filename. + my $shadersrcfilename = $src; + $shadersrcfilename =~ s/-----.*$//; + # use only target basename. + $src =~ s/^.*-----//; + + # where the binary vcs file is + my $spath = ""; + + if ( $shadersrcfilename =~ m@\.fxc@i ) + { + $spath = "shaders\\fxc\\"; + } + if ( $shadersrcfilename =~ m@\.vsh@i ) + { + $spath = "shaders\\vsh\\"; + } + if ( $shadersrcfilename =~ m@\.psh@i ) + { + $spath = "shaders\\psh\\"; + } + + # make the source have path and extension + $src = $spath . $src . $platformextension . ".vcs"; + + # build the dest filename. + $dst = $src; + + $dst =~ s/shaders\\/..\\..\\..\\game\\hl2\\shaders\\/i; + + # Does the dst exist? + my $dstexists = -e $dst; + my $srcexists = -e $src; + # What are the time stamps for the src and dst? + my $srcmodtime = ( stat $src )[9]; + my $dstmodtime = ( stat $dst )[9]; + + # Write $dst to a file so that we can do perforce stuff to it later. + local( *VCSLIST ); + open VCSLIST, ">>vcslist.txt" || die; + print VCSLIST $dst . "\n"; + close VCSLIST; + + # Open for edit or add if different than what is in perforce already. + if( !$dstexists || ( $srcmodtime != $dstmodtime ) ) + { + if ( $srcexists && $shadersrcfilename =~ m@\.fxc@i ) + { + # Get the CRC for the source file. + my $srccode = ReadInputFileWithIncludes( $shadersrcfilename ); + my $crc = crc32( $srccode ); + + # Patch the source VCS file with the CRC32 of the source code used to build that file. + PatchCRC( $src, $crc ); + } + + # Make the target vcs writable if it exists + if( $dstexists ) + { + MakeFileWritable( $dst ); + } + + my $dir = $dst; + $dir =~ s,([^/\\]*$),,; # rip the filename off the end + my $filename = $1; + + # create the target directory if it doesn't exist + if( !$dstexists ) + { + &MakeDirHier( $dir, 0777 ); + } + + # copy the file to its targets. . . we want to see STDERR here if there is an error. + my $cmd = "copy $src $dst > nul"; +# print STDERR "$cmd\n"; + system $cmd; + + MakeFileReadOnly( $dst ); + } +} + +close TXTFILE; diff --git a/devtools/bin/crc32filewithincludes.pl b/devtools/bin/crc32filewithincludes.pl new file mode 100644 index 0000000..6c90778 --- /dev/null +++ b/devtools/bin/crc32filewithincludes.pl @@ -0,0 +1,41 @@ +use String::CRC32; + +sub ReadInputFileWithIncludes +{ + local( $filename ) = shift; + + local( *INPUT ); + local( $output ); + + open INPUT, "<$filename" || die; + + local( $line ); + local( $linenum ) = 1; + while( $line = ) + { + if( $line =~ m/\#include\s+\"(.*)\"/i ) + { + $output.= ReadInputFileWithIncludes( $1 ); + } + else + { + $output .= $line; + } + } + + close INPUT; + return $output; +} + +if( !scalar( @ARGV ) ) +{ + die "Usage: crc32filewithincludes.pl filename\n"; +} + +$data = &ReadInputFileWithIncludes( shift ); + +#print "data: $data\n"; + +$crc = crc32( $data ); +print $crc; +exit 0; diff --git a/devtools/bin/d3dx10_33.dll b/devtools/bin/d3dx10_33.dll new file mode 100644 index 0000000..05342c8 Binary files /dev/null and b/devtools/bin/d3dx10_33.dll differ diff --git a/devtools/bin/d3dx9_33.dll b/devtools/bin/d3dx9_33.dll new file mode 100644 index 0000000..a005f8f Binary files /dev/null and b/devtools/bin/d3dx9_33.dll differ diff --git a/devtools/bin/dbmon.exe b/devtools/bin/dbmon.exe new file mode 100644 index 0000000..ef8c64a Binary files /dev/null and b/devtools/bin/dbmon.exe differ diff --git a/devtools/bin/diff.exe b/devtools/bin/diff.exe new file mode 100644 index 0000000..2797ffd Binary files /dev/null and b/devtools/bin/diff.exe differ diff --git a/devtools/bin/diff3.exe b/devtools/bin/diff3.exe new file mode 100644 index 0000000..9ee2632 Binary files /dev/null and b/devtools/bin/diff3.exe differ diff --git a/devtools/bin/diffmemstats.exe b/devtools/bin/diffmemstats.exe new file mode 100644 index 0000000..5f4e329 Binary files /dev/null and b/devtools/bin/diffmemstats.exe differ diff --git a/devtools/bin/ezxmlfile.py b/devtools/bin/ezxmlfile.py new file mode 100644 index 0000000..a32ea5e --- /dev/null +++ b/devtools/bin/ezxmlfile.py @@ -0,0 +1,175 @@ + +import sys, re, vsdotnetxmlparser + + + +class EZXMLError: + pass + + +class EZXMLElement: + """ + Members: + Name : string + Attrs : list with attributes [(name,value), (name, value), ...] + Children : list of XMLElements + Parent : parent XMLElement + """ + def GetAttributeValue( self, attrName ): + for a in self.Attrs: + if a[0] == attrName: + return a[1] + return None + + def RemoveAttribute( self, attrName ): + for i,a in enumerate( self.Attrs ): + if a[0] == attrName: + self.Attrs.pop( i ) + return 1 + + return 0 + + def RemoveFromParent( self ): + if not self.Parent: + raise EZXMLError + + self.Parent.Children.remove( self ) + + +class EZXMLFile: + # + # PUBLIC INTERFACE + # + def __init__( self, data ): + self.Version = '' + self.Encoding = '' + self.RootElement = None + self.__CurElement = None + self.__ElementIndexRE = re.compile( r'<(?P.+)>(?P.+)' ) + + #p = xml.parsers.expat.ParserCreate() + p = vsdotnetxmlparser.VSDotNetXMLParser() + + p.ordered_attributes = 1 + p.XmlDeclHandler = self.__xml_decl_handler + p.StartElementHandler = self.__start_element + p.EndElementHandler = self.__end_element + + p.Parse( data, 1 ) + + + # Write the current contents to a file. + def WriteFile( self, file ): + file.write( '\r\n' % (self.Version, self.Encoding) ) + if self.RootElement: + self.__WriteFile_R( file, self.RootElement, 0 ) + + """ + Find an element (starting at the root). + If elementName has backslashes in it (like 'VisualStudioProject\Configurations\Tool'), then it will recurse into each element. + Each element can also have an optional count telling which element to find: + 'VisualStudioProject\Configurations\<3>Tool' + """ + def GetElement( self, elementName ): + if not self.RootElement: + return None + + pathList = elementName.split( '\\' ) + return self.__GetElementByPath_R( [self.RootElement], pathList, 0 ) + + + """ + AttributePath is specified the same way as GetElement. + Returns None if the path to the element or attribute doesn't exist. + """ + def GetAttribute( self, attributePath ): + if not self.RootElement: + return None + + pathList = attributePath.split( '\\' ) + attributeName = pathList.pop() + e = self.__GetElementByPath_R( [self.RootElement], pathList, 0 ) + if e: + return e.GetAttributeValue( attributeName ) + else: + return None + + + + # + # INTERNAL STUFF + # + def __GetElementByPath_R( self, curElementList, pathList, index ): + indexToFind = 1 + indexFound = 0 + m = self.__ElementIndexRE.match( pathList[index] ) + if m: + nameToFind = m.group('name').upper() + indexToFind = int( m.group('index') ) + else: + nameToFind = pathList[index].upper() + + for x in curElementList: + if x.Name.upper() == nameToFind: + indexFound += 1 + if indexFound == indexToFind: + if index == len( pathList ) - 1: + return x + else: + return self.__GetElementByPath_R( x.Children, pathList, index+1 ) + + return None + + def __WriteFile_R( self, file, curElement, indentLevel ): + tabChars = "" + for i in xrange(0,indentLevel): + tabChars = tabChars + '\t' + file.write( tabChars ) + + keyListLen = len( curElement.Attrs ) + if keyListLen == 0: + file.write( '<%s>\r\n' % (curElement.Name) ) + else: + file.write( '<%s\r\n' % (curElement.Name) ) + + bClosedBlock = 0 + for i,e in enumerate( curElement.Attrs ): + file.write( tabChars + '\t' ) + file.write( '%s="%s"' % (e[0], e[1]) ) + + # VS.NET XML files use this special syntax on elements that have attributes and no children. + if len( curElement.Children ) == 0 and i == keyListLen-1 and curElement.Name != 'File': + file.write( '/>\r\n' ) + bClosedBlock = 1 + elif i == keyListLen-1: + file.write( '>\r\n' ) + else: + file.write( '\r\n' ) + + for child in curElement.Children: + self.__WriteFile_R( file, child, indentLevel+1 ) + + if not bClosedBlock: + file.write( tabChars ) + file.write( '\r\n' % (curElement.Name) ) + + # XML parser handler functions + def __xml_decl_handler( self, version, encoding, standalone ): + self.Version = version + self.Encoding = encoding + + def __start_element( self, name, attrs ): + e = EZXMLElement() + e.Name = name + e.Attrs = zip( attrs[::2], attrs[1::2] ) # Cool slicing trick.. this takes a list like [1,2,3,4] and makes it into [[1,2], [3,4]] + e.Children = None + e.Parent = self.__CurElement + e.Children = [] + if self.__CurElement: + self.__CurElement.Children.append( e ) + else: + self.RootElement = e + self.__CurElement = e + + def __end_element( self, name ): + self.__CurElement = self.__CurElement.Parent diff --git a/devtools/bin/fix_particle_operator_names.pl b/devtools/bin/fix_particle_operator_names.pl new file mode 100644 index 0000000..c0f5ee0 --- /dev/null +++ b/devtools/bin/fix_particle_operator_names.pl @@ -0,0 +1,110 @@ +#!perl +use File::Find; + +&BuildRemapTable; + +find(\&convert, "." ); + + +sub convert + { + return unless (/\.pcf$/i); + return if (/^tmp\.pcf$/i); + return if (/^tmp2\.pcf$/i); + return if (/360\.pcf$/i); + print STDERR "process ", $File::Find::name," ($_) dir=",`cd`," \n"; + my $fname=$_; + print `p4 edit $fname`; + print `dmxconvert -i $_ -o tmp.pcf -oe keyvalues2`; + open(TMP, "tmp.pcf" ) || return; + open(OUT, ">tmp2.pcf" ) || die; + while() + { + s/[\n\r]//g; + if ( (/^(\s*\"functionName\"\s*\"string\"\s*\")(.*)\"(.*)$/) && + length($map{$2}) ) + { + $_=$1.$map{$2}.'"'.$3; + } + if ( (/^(\s*\"name\"\s*\"string\"\s*\")(.*)\"(.*)$/) && + length($map{$2}) ) + { + $_=$1.$map{$2}.'"'.$3; + } + print OUT "$_\n"; + } + close OUT; + close TMP; + print `dmxconvert -i tmp2.pcf -o $fname -ie keyvalues2 -oe binary`; + unlink "tmp.pcf"; + unlink "tmp2.pcf"; +} + + + + + + + + + + + + +sub BuildRemapTable +{ + $map{"alpha_fade"}= "Alpha Fade and Decay"; + $map{"alpha_fade_in_random"}= "Alpha Fade In Random"; + $map{"alpha_fade_out_random"}= "Alpha Fade Out Random"; + $map{"basic_movement"}= "Movement Basic"; + $map{"color_fade"}= "Color Fade"; + $map{"controlpoint_light"}= "Color Light From Control Point"; + $map{"Dampen Movement Relative to Control Point"}= "Movement Dampen Relative to Control Point"; + $map{"Distance Between Control Points Scale"}= "Remap Distance Between Two Control Points to Scalar"; + $map{"Distance to Control Points Scale"}= "Remap Distance to Control Point to Scalar"; + $map{"lifespan_decay"}= "Lifespan Decay"; + $map{"lock to bone"}= "Movement Lock to Bone"; + $map{"postion_lock_to_controlpoint"}= "Movement Lock to Control Point"; + $map{"maintain position along path"}= "Movement Maintain Position Along Path"; + $map{"Match Particle Velocities"}= "Movement Match Particle Velocities"; + $map{"Max Velocity"}= "Movement Max Velocity"; + $map{"noise"}= "Noise Scalar"; + $map{"vector noise"}= "Noise Vector"; + $map{"oscillate_scalar"}= "Oscillate Scalar"; + $map{"oscillate_vector"}= "Oscillate Vector"; + $map{"Orient Rotation to 2D Direction"}= "Rotation Orient to 2D Direction"; + $map{"radius_scale"}= "Radius Scale"; + $map{"Random Cull"}= "Cull Random"; + $map{"remap_scalar"}= "Remap Scalar"; + $map{"rotation_movement"}= "Rotation Basic"; + $map{"rotation_spin"}= "Rotation Spin Roll"; + $map{"rotation_spin yaw"}= "Rotation Spin Yaw"; + $map{"alpha_random"}= "Alpha Random"; + $map{"color_random"}= "Color Random"; + $map{"create from parent particles"}= "Position From Parent Particles"; + $map{"Create In Hierarchy"}= "Position In CP Hierarchy"; + $map{"random position along path"}= "Position Along Path Random"; + $map{"random position on model"}= "Position on Model Random"; + $map{"sequential position along path"}= "Position Along Path Sequential"; + $map{"position_offset_random"}= "Position Modify Offset Random"; + $map{"position_warp_random"}= "Position Modify Warp Random"; + $map{"position_within_box"}= "Position Within Box Random"; + $map{"position_within_sphere"}= "Position Within Sphere Random"; + $map{"Inherit Velocity"}= "Velocity Inherit from Control Point"; + $map{"Initial Repulsion Velocity"}= "Velocity Repulse from World"; + $map{"Initial Velocity Noise"}= "Velocity Noise"; + $map{"Initial Scalar Noise"}= "Remap Noise to Scalar"; + $map{"Lifespan from distance to world"}= "Lifetime from Time to Impact"; + $map{"Pre-Age Noise"}= "Lifetime Pre-Age Noise"; + $map{"lifetime_random"}= "Lifetime Random"; + $map{"radius_random"}= "Radius Random"; + $map{"random yaw"}= "Rotation Yaw Random"; + $map{"Randomly Flip Yaw"}= "Rotation Yaw Flip Random"; + $map{"rotation_random"}= "Rotation Random"; + $map{"rotation_speed_random"}= "Rotation Speed Random"; + $map{"sequence_random"}= "Sequence Random"; + $map{"second_sequence_random"}= "Sequence Two Random"; + $map{"trail_length_random"}= "Trail Length Random"; + $map{"velocity_random"}= "Velocity Random"; +} + diff --git a/devtools/bin/fixcopyrights.py b/devtools/bin/fixcopyrights.py new file mode 100644 index 0000000..ba43986 --- /dev/null +++ b/devtools/bin/fixcopyrights.py @@ -0,0 +1,177 @@ +#!/usr/bin/python +# ========= Copyright Valve Corporation, All rights reserved. ============ + +import subprocess +import re +import os +import sys + +reValve = re.compile( "valve", flags = re.IGNORECASE ) +reTurtleRock = re.compile( "turtle rock", flags = re.IGNORECASE ) +reCopyright = re.compile( "copyright", flags = re.IGNORECASE ) +sOutputCopyright = "//========= Copyright Valve Corporation, All rights reserved. ============//\n" + +def IsOldCopyrightLine( line ): + if( len( reCopyright.findall( line ) ) == 0 ): + return False + if( len( reValve.findall( line ) ) == 0 + and len( reTurtleRock.findall( line ) ) == 0 ): + return False + + return True + + +rFilesWithNoCopyrightNotice = [] + +def FixCopyrightNotice( sFullPath ): + nLine = 0 + + f = open( sFullPath, "r" ) + if( not f ): + print( "Unable to open file " + sFullPath + "\n" ) + return + + rFileContents = f.readlines() + f.close() + nOldCopyright = -1 + for line in rFileContents: + if( nLine < 10 ): + if( line == sOutputCopyright ): + # File already has the right notice + return + if( IsOldCopyrightLine( line ) ): + nOldCopyright = nLine + break + + nLine += 1 + if( nOldCopyright == -1 ): + rFilesWithNoCopyrightNotice.append( sFullPath ) + rFileContents.insert( 0, sOutputCopyright ) + else: + rFileContents[ nOldCopyright ] = sOutputCopyright + + # open the file for edit + subprocess.call( [ "p4", "edit", sFullPath ], stdout = subprocess.PIPE ) + + # open the file for writing + f = open( sFullPath, "w" ) + f.writelines( rFileContents ) + f.close() + +rDirsToSkip = [ + 'thirdparty', + 'external', + 'BinkSDK', + 'bink', + 'bink_x360', + 'freetype', + 'GL', + 'maya', + 'miles', + 'curl', + 'ihfx', + 'lxma', + 'modo', + 'openal', + 'opengl', + 'p4api', + 'python', + 'quicktime_win32', + 'xsi', + 'speex', + 'ocaml', + 'perl5', + 'dx10sdk', + 'dx11sdk', + 'dx9sdk', + 'haptics', + 'ajb', + 'stb', + 'havok', + 'hk_physics', + 'lua', + 'maxsdk', + 'x360xdk', + 'swigwin-1.3.34', + 'sapi51', + 'WMPSDK10', + 'FontMaker', + 'mxtk', + 'nvtristriplib', + 'g15', + 'lzma', + 'libparsifal-0.8.3', + 'parsifal', + 'libpng', + 'mysql', + 'zip', + 'zlib', + 'Zlib', + 'windowssdk', + 'bzip2', + 'jpeglib', + 'MakeGameData', + 'toollib', + ] + +rFileExtensionsToSkip = [ + '.pb.h', + '.pb.cpp', + '.spa.h', + 'ATI_Compress.h', + 'luaxlib.h', + 'lua.h', + 'luaconf.h', + 'lualib.h', + 'eax.h', + 'IceKey.cpp', + 'nvtc.h', + 'amd3dx.h', + 'halton.h', + 'snappy', + 'extendedtrace', + ] + +def FixCopyrightNoticeWalk( sPath ): + for root, dirs, files in os.walk( sPath ): + print "Walking directory", root + #print root, dirs + for sDir in rDirsToSkip: + if sDir in dirs: + print "Skipping dir ", os.path.join( root, sDir ) + dirs.remove( sDir ) + + for sFilename in files: + sShortFilename, sFileExt = os.path.splitext( sFilename ) + + if( sFileExt in [ '.cpp', '.h' ] ): + bSkip = False + for sExt in rFileExtensionsToSkip: + if sExt in sFilename: + bSkip = True + + #print "filename=", sFilename + if( bSkip ): + print "Skipping ", sFilename, "because of its extension" + else: + FixCopyrightNotice( os.path.join( root, sFilename ) ) + + +#FixCopyrightNotice( os.path.join( "..", "..", "bitmap", "bitmap.cpp" ) ) +#FixCopyrightNoticeWalk( os.path.join( "..", "..", "bitmap" ) ) + +if( len( sys.argv ) != 2 ): + print "Usage: fixcopyrights.py " + sys.exit(1) + +FixCopyrightNoticeWalk( sys.argv[1] ) + +if( len( rFilesWithNoCopyrightNotice ) ): + + f = open( "newcopyrights.txt", "w" ) + for file in rFilesWithNoCopyrightNotice: + f.write( file + "\n" ) + f.close() + + print "Copyright notices added to", len( rFilesWithNoCopyrightNotice ), "files. See newcopyrights.txt for a list\n" + diff --git a/devtools/bin/fontmaker.exe b/devtools/bin/fontmaker.exe new file mode 100644 index 0000000..350aee9 Binary files /dev/null and b/devtools/bin/fontmaker.exe differ diff --git a/devtools/bin/fontmaker.pdb b/devtools/bin/fontmaker.pdb new file mode 100644 index 0000000..ee89fcb Binary files /dev/null and b/devtools/bin/fontmaker.pdb differ diff --git a/devtools/bin/fxc_prep.pl b/devtools/bin/fxc_prep.pl new file mode 100644 index 0000000..9f67ca5 --- /dev/null +++ b/devtools/bin/fxc_prep.pl @@ -0,0 +1,949 @@ +BEGIN {use File::Basename; push @INC, dirname($0); } +require "valve_perl_helpers.pl"; + +sub ReadInputFile +{ + local( $filename ) = shift; + local( *INPUT ); + local( @output ); + open INPUT, "<$filename" || die; + + local( $line ); + local( $linenum ) = 1; + while( $line = ) + { +# print "LINE: $line"; +# $line =~ s/\n//g; +# local( $postfix ) = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; +# $postfix .= "; LINEINFO($filename)($linenum)\n"; + if( $line =~ m/\#include\s+\"(.*)\"/i ) + { + push @output, &ReadInputFile( $1 ); + } + else + { +# push @output, $line . $postfix; + push @output, $line; + } + $linenum++; + } + + close INPUT; +# print "-----------------\n"; +# print @output; +# print "-----------------\n"; + return @output; +} + +$dynamic_compile = defined $ENV{"dynamic_shaders"} && $ENV{"dynamic_shaders"} != 0; +$generateListingFile = 0; +$spewCombos = 0; + +@startTimes = times; +$startTime = time; + +$g_produceCppClasses = 1; +$g_produceCompiledVcs = 1; + +while( 1 ) +{ + $fxc_filename = shift; + if( $fxc_filename =~ m/-source/ ) + { + shift; + } + elsif( $fxc_filename =~ m/-nv3x/i ) + { + $nvidia = 1; + } + elsif( $fxc_filename =~ m/-ps20a/i ) + { + $ps2a = 1; + } + elsif( $fxc_filename =~ m/-x360/i ) + { + # enable x360 + $g_x360 = 1; + } + elsif( $fxc_filename =~ m/-novcs/i ) + { + $g_produceCompiledVcs = 0; + } + elsif( $fxc_filename =~ m/-nocpp/i ) + { + $g_produceCppClasses = 0; + } + else + { + last; + } +} + +$argstring = $fxc_filename; +$fxc_basename = $fxc_filename; +$fxc_basename =~ s/^.*-----//; +$fxc_filename =~ s/-----.*$//; + +$debug = 0; +$forcehalf = 0; + +sub ToUpper +{ + local( $in ) = shift; + $in =~ tr/a-z/A-Z/; + return $in; +} + +sub CreateCCodeToSpewDynamicCombo +{ + local( $out ) = ""; + + $out .= "\t\tOutputDebugString( \"src:$fxc_filename vcs:$fxc_basename dynamic index\" );\n"; + $out .= "\t\tchar tmp[128];\n"; + $out .= "\t\tint shaderID = "; + local( $scale ) = 1; + for( $i = 0; $i < scalar( @dynamicDefineNames ); $i++ ) + { + local( $name ) = @dynamicDefineNames[$i]; + local( $varname ) = "m_n" . $name; + $out .= "( $scale * $varname ) + "; + $scale *= $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1; + } + $out .= "0;\n"; + if( scalar( @dynamicDefineNames ) + scalar( @staticDefineNames ) > 0 ) + { + $out .= "\t\tint nCombo = shaderID;\n"; + } + + my $type = GetShaderType( $fxc_filename ); + for( $i = 0; $i < scalar( @dynamicDefineNames ); $i++ ) + { + $out .= "\t\tint n$dynamicDefineNames[$i] = nCombo % "; + $out .= ( $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1 ) + $dynamicDefineMin[$i]; + $out .= ";\n"; + + $out .= "\t\tsprintf( tmp, \"\%d\", n$dynamicDefineNames[$i] );\n"; + $out .= "\t\tOutputDebugString( \" $dynamicDefineNames[$i]"; + $out .= "=\" );\n"; + $out .= "\t\tOutputDebugString( tmp );\n"; + + $out .= "\t\tnCombo = nCombo / " . ( $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1 ) . ";\n"; + $out .= "\n"; + } + $out .= "\t\tOutputDebugString( \"\\n\" );\n"; + return $out; +} + +sub CreateCCodeToSpewStaticCombo +{ + local( $out ) = ""; + + $out .= "\t\tOutputDebugString( \"src:$fxc_filename vcs:$fxc_basename static index\" );\n"; + $out .= "\t\tchar tmp[128];\n"; + $out .= "\t\tint shaderID = "; + + local( $scale ) = 1; + for( $i = 0; $i < scalar( @dynamicDefineNames ); $i++ ) + { + $scale *= $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1; + } + for( $i = 0; $i < scalar( @staticDefineNames ); $i++ ) + { + local( $name ) = @staticDefineNames[$i]; + local( $varname ) = "m_n" . $name; + $out .= "( $scale * $varname ) + "; + $scale *= $staticDefineMax[$i] - $staticDefineMin[$i] + 1; + } + $out .= "0;\n"; + +# $out .= "\t\tsprintf( tmp, \"\%d\\n\", shaderID );\n"; +# $out .= "\t\tOutputDebugString( tmp );\n\n"; + if( scalar( @staticDefineNames ) + scalar( @staticDefineNames ) > 0 ) + { + $out .= "\t\tint nCombo = shaderID;\n"; + } + + my $type = GetShaderType( $fxc_filename ); + for( $i = 0; $i < scalar( @dynamicDefineNames ); $i++ ) + { + $out .= "\t\tnCombo = nCombo / " . ( $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1 ) . ";\n"; + } + for( $i = 0; $i < scalar( @staticDefineNames ); $i++ ) + { + $out .= "\t\tint n$staticDefineNames[$i] = nCombo % "; + $out .= ( $staticDefineMax[$i] - $staticDefineMin[$i] + 1 ) + $staticDefineMin[$i]; + $out .= ";\n"; + + $out .= "\t\tsprintf( tmp, \"\%d\", n$staticDefineNames[$i] );\n"; + $out .= "\t\tOutputDebugString( \" $staticDefineNames[$i]"; + $out .= "=\" );\n"; + $out .= "\t\tOutputDebugString( tmp );\n"; + + $out .= "\t\tnCombo = nCombo / " . ( $staticDefineMax[$i] - $staticDefineMin[$i] + 1 ) . ";\n"; + $out .= "\n"; + } + $out .= "\t\tOutputDebugString( \"\\n\" );\n"; + return $out; +} + +sub WriteHelperVar +{ + local( $name ) = shift; + local( $min ) = shift; + local( $max ) = shift; + local( $varname ) = "m_n" . $name; + local( $boolname ) = "m_b" . $name; + push @outputHeader, "private:\n"; + push @outputHeader, "\tint $varname;\n"; + push @outputHeader, "#ifdef _DEBUG\n"; + push @outputHeader, "\tbool $boolname;\n"; + push @outputHeader, "#endif\n"; + push @outputHeader, "public:\n"; + # int version of set function + push @outputHeader, "\tvoid Set" . $name . "( int i )\n"; + push @outputHeader, "\t{\n"; + push @outputHeader, "\t\tAssert( i >= $min && i <= $max );\n"; + push @outputHeader, "\t\t$varname = i;\n"; + push @outputHeader, "#ifdef _DEBUG\n"; + push @outputHeader, "\t\t$boolname = true;\n"; + push @outputHeader, "#endif\n"; + push @outputHeader, "\t}\n"; + # bool version of set function + push @outputHeader, "\tvoid Set" . $name . "( bool i )\n"; + push @outputHeader, "\t{\n"; +# push @outputHeader, "\t\tAssert( i >= $min && i <= $max );\n"; + push @outputHeader, "\t\t$varname = i ? 1 : 0;\n"; + push @outputHeader, "#ifdef _DEBUG\n"; + push @outputHeader, "\t\t$boolname = true;\n"; + push @outputHeader, "#endif\n"; + push @outputHeader, "\t}\n"; +} + +sub WriteStaticBoolExpression +{ + local( $prefix ) = shift; + local( $operator ) = shift; + for( $i = 0; $i < scalar( @staticDefineNames ); $i++ ) + { + if( $i ) + { + push @outputHeader, " $operator "; + } + local( $name ) = @staticDefineNames[$i]; + local( $boolname ) = "m_b" . $name; + push @outputHeader, "$prefix$boolname"; + } + push @outputHeader, ";\n"; +} + +sub WriteDynamicBoolExpression +{ + local( $prefix ) = shift; + local( $operator ) = shift; + for( $i = 0; $i < scalar( @dynamicDefineNames ); $i++ ) + { + if( $i ) + { + push @outputHeader, " $operator "; + } + local( $name ) = @dynamicDefineNames[$i]; + local( $boolname ) = "m_b" . $name; + push @outputHeader, "$prefix$boolname"; + } + push @outputHeader, ";\n"; +} + +sub WriteDynamicHelperClasses +{ + local( $basename ) = $fxc_basename; + $basename =~ tr/A-Z/a-z/; + local( $classname ) = $basename . "_Dynamic_Index"; + push @outputHeader, "class $classname\n"; + push @outputHeader, "{\n"; + for( $i = 0; $i < scalar( @dynamicDefineNames ); $i++ ) + { + $name = $dynamicDefineNames[$i]; + $min = $dynamicDefineMin[$i]; + $max = $dynamicDefineMax[$i]; + &WriteHelperVar( $name, $min, $max ); + } + push @outputHeader, "public:\n"; +# push @outputHeader, "void SetPixelShaderIndex( IShaderAPI *pShaderAPI ) { pShaderAPI->SetPixelShaderIndex( GetIndex() ); }\n"; + push @outputHeader, "\t$classname()\n"; + push @outputHeader, "\t{\n"; + for( $i = 0; $i < scalar( @dynamicDefineNames ); $i++ ) + { + local( $name ) = @dynamicDefineNames[$i]; + local( $boolname ) = "m_b" . $name; + local( $varname ) = "m_n" . $name; + push @outputHeader, "#ifdef _DEBUG\n"; + push @outputHeader, "\t\t$boolname = false;\n"; + push @outputHeader, "#endif // _DEBUG\n"; + push @outputHeader, "\t\t$varname = 0;\n"; + } + push @outputHeader, "\t}\n"; + push @outputHeader, "\tint GetIndex()\n"; + push @outputHeader, "\t{\n"; + push @outputHeader, "\t\t// Asserts to make sure that we aren't using any skipped combinations.\n"; + foreach $skip (@perlskipcodeindividual) + { + # can't do this static and dynamic can see each other. +# $skip =~ s/\$/m_n/g; +# $skip =~ s/defined//g; +# push @outputHeader, "\t\tAssert( !( $skip ) );\n"; +# print "\t\tAssert( !( $skip ) );\n"; + } + push @outputHeader, "\t\t// Asserts to make sure that we are setting all of the combination vars.\n"; + + push @outputHeader, "#ifdef _DEBUG\n"; + if( scalar( @dynamicDefineNames ) > 0 ) + { + push @outputHeader, "\t\tbool bAllDynamicVarsDefined = "; + WriteDynamicBoolExpression( "", "&&" ); + } + if( scalar( @dynamicDefineNames ) > 0 ) + { + push @outputHeader, "\t\tAssert( bAllDynamicVarsDefined );\n"; + } + push @outputHeader, "#endif // _DEBUG\n"; + + if( $spewCombos && scalar( @dynamicDefineNames ) ) + { + push @outputHeader, &CreateCCodeToSpewDynamicCombo(); + } + push @outputHeader, "\t\treturn "; + local( $scale ) = 1; + for( $i = 0; $i < scalar( @dynamicDefineNames ); $i++ ) + { + local( $name ) = @dynamicDefineNames[$i]; + local( $varname ) = "m_n" . $name; + push @outputHeader, "( $scale * $varname ) + "; + $scale *= $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1; + } + push @outputHeader, "0;\n"; + push @outputHeader, "\t}\n"; + push @outputHeader, "};\n"; + push @outputHeader, "\#define shaderDynamicTest_" . $basename . " "; + my $prefix; + my $shaderType = &GetShaderType( $fxc_filename ); + if( $shaderType =~ m/^vs/i ) + { + $prefix = "vsh_"; + } + else + { + $prefix = "psh_"; + } + for( $i = 0; $i < scalar( @dynamicDefineNames ); $i++ ) + { + local( $name ) = @dynamicDefineNames[$i]; + push @outputHeader, $prefix . "forgot_to_set_dynamic_" . $name . " + "; + } + push @outputHeader, "0\n"; +} + +sub WriteStaticHelperClasses +{ + local( $basename ) = $fxc_basename; + $basename =~ tr/A-Z/a-z/; + local( $classname ) = $basename . "_Static_Index"; + push @outputHeader, "#include \"shaderlib/cshader.h\"\n"; + push @outputHeader, "class $classname\n"; + push @outputHeader, "{\n"; + for( $i = 0; $i < scalar( @staticDefineNames ); $i++ ) + { + $name = $staticDefineNames[$i]; + $min = $staticDefineMin[$i]; + $max = $staticDefineMax[$i]; + &WriteHelperVar( $name, $min, $max ); + } + push @outputHeader, "public:\n"; +# push @outputHeader, "void SetShaderIndex( IShaderShadow *pShaderShadow ) { pShaderShadow->SetPixelShaderIndex( GetIndex() ); }\n"; + push @outputHeader, "\t$classname( )\n"; + push @outputHeader, "\t{\n"; + for( $i = 0; $i < scalar( @staticDefineNames ); $i++ ) + { + local( $name ) = @staticDefineNames[$i]; + local( $boolname ) = "m_b" . $name; + local( $varname ) = "m_n" . $name; + if ( length( $staticDefineInit{$name} ) ) + { + push @outputHeader, "#ifdef _DEBUG\n"; + push @outputHeader, "\t\t$boolname = true;\n"; + push @outputHeader, "#endif // _DEBUG\n"; + push @outputHeader, "\t\t$varname = $staticDefineInit{$name};\n"; + } + else + { + push @outputHeader, "#ifdef _DEBUG\n"; + push @outputHeader, "\t\t$boolname = false;\n"; + push @outputHeader, "#endif // _DEBUG\n"; + push @outputHeader, "\t\t$varname = 0;\n"; + } + } + push @outputHeader, "\t}\n"; + push @outputHeader, "\tint GetIndex()\n"; + push @outputHeader, "\t{\n"; + push @outputHeader, "\t\t// Asserts to make sure that we aren't using any skipped combinations.\n"; + foreach $skip (@perlskipcodeindividual) + { + $skip =~ s/\$/m_n/g; +# push @outputHeader, "\t\tAssert( !( $skip ) );\n"; + } + push @outputHeader, "\t\t// Asserts to make sure that we are setting all of the combination vars.\n"; + + push @outputHeader, "#ifdef _DEBUG\n"; + if( scalar( @staticDefineNames ) > 0 ) + { + push @outputHeader, "\t\tbool bAllStaticVarsDefined = "; + WriteStaticBoolExpression( "", "&&" ); + + } + if( scalar( @staticDefineNames ) > 0 ) + { + push @outputHeader, "\t\tAssert( bAllStaticVarsDefined );\n"; + } + push @outputHeader, "#endif // _DEBUG\n"; + + if( $spewCombos && scalar( @staticDefineNames ) ) + { + push @outputHeader, &CreateCCodeToSpewStaticCombo(); + } + push @outputHeader, "\t\treturn "; + local( $scale ) = 1; + for( $i = 0; $i < scalar( @dynamicDefineNames ); $i++ ) + { + $scale *= $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1; + } + for( $i = 0; $i < scalar( @staticDefineNames ); $i++ ) + { + local( $name ) = @staticDefineNames[$i]; + local( $varname ) = "m_n" . $name; + push @outputHeader, "( $scale * $varname ) + "; + $scale *= $staticDefineMax[$i] - $staticDefineMin[$i] + 1; + } + push @outputHeader, "0;\n"; + push @outputHeader, "\t}\n"; + push @outputHeader, "};\n"; + push @outputHeader, "\#define shaderStaticTest_" . $basename . " "; + my $prefix; + my $shaderType = &GetShaderType( $fxc_filename ); + if( $shaderType =~ m/^vs/i ) + { + $prefix = "vsh_"; + } + else + { + $prefix = "psh_"; + } + for( $i = 0; $i < scalar( @staticDefineNames ); $i++ ) + { + local( $name ) = @staticDefineNames[$i]; + push @outputHeader, $prefix . "forgot_to_set_static_" . $name . " + " unless (length($staticDefineInit{$name} )); + } + push @outputHeader, "0\n"; +} + +sub GetNewMainName +{ + local( $shadername ) = shift; + local( $combo ) = shift; + local( $i ); + $shadername =~ s/\./_/g; + local( $name ) = $shadername; + for( $i = 0; $i < scalar( @defineNames ); $i++ ) + { + local( $val ) = ( $combo % ( $defineMax[$i] - $defineMin[$i] + 1 ) ) + $defineMin[$i]; + $name .= "_" . $defineNames[$i] . "_" . $val; + $combo = $combo / ( $defineMax[$i] - $defineMin[$i] + 1 ); + } +# return $name; + return "main"; +} + +sub RenameMain +{ + local( $shadername ) = shift; + local( $combo ) = shift; + local( $name ) = &GetNewMainName( $shadername, $combo ); + return "/Dmain=$name /E$name "; +} + +sub GetShaderType +{ + local( $shadername ) = shift; # hack - use global variables + $shadername = $fxc_basename; + if( $shadername =~ m/ps30/i ) + { + if( $debug ) + { + return "ps_3_sw"; + } + else + { + return "ps_3_0"; + } + } + elsif( $shadername =~ m/ps20b/i ) + { + return "ps_2_b"; + } + elsif( $shadername =~ m/ps20/i ) + { + if( $debug ) + { + return "ps_2_sw"; + } + else + { + if( $ps2a ) + { + return "ps_2_a"; + } + else + { + return "ps_2_0"; + } + } + } + elsif( $shadername =~ m/ps14/i ) + { + return "ps_1_4"; + } + elsif( $shadername =~ m/ps11/i ) + { + return "ps_1_1"; + } + elsif( $shadername =~ m/vs30/i ) + { + if( $debug ) + { + return "vs_3_sw"; + } + else + { + return "vs_3_0"; + } + } + elsif( $shadername =~ m/vs20/i ) + { + if( $debug ) + { + return "vs_2_sw"; + } + else + { + return "vs_2_0"; + } + } + elsif( $shadername =~ m/vs14/i ) + { + return "vs_1_1"; + } + elsif( $shadername =~ m/vs11/i ) + { + return "vs_1_1"; + } + else + { + die "\n\nSHADERNAME = $shadername\n\n"; + } +} + +sub CalcNumCombos +{ + local( $i, $numCombos ); + $numCombos = 1; + for( $i = 0; $i < scalar( @dynamicDefineNames ); $i++ ) + { + $numCombos *= $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1; + } + for( $i = 0; $i < scalar( @staticDefineNames ); $i++ ) + { + $numCombos *= $staticDefineMax[$i] - $staticDefineMin[$i] + 1; + } + return $numCombos; +} + +sub CalcNumDynamicCombos +{ + local( $i, $numCombos ); + $numCombos = 1; + for( $i = 0; $i < scalar( @dynamicDefineNames ); $i++ ) + { + $numCombos *= $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1; + } + return $numCombos; +} + +sub CreateCFuncToCreateCompileCommandLine +{ + local( $out ) = ""; + + $out .= "\t\tOutputDebugString( \"compiling src:$fxc_filename vcs:$fxc_basename \" );\n"; + $out .= "\t\tchar tmp[128];\n"; + $out .= "\t\tsprintf( tmp, \"\%d\\n\", shaderID );\n"; + $out .= "\t\tOutputDebugString( tmp );\n"; + $out .= "\t\tstatic PrecompiledShaderByteCode_t byteCode;\n"; + if( scalar( @dynamicDefineNames ) + scalar( @staticDefineNames ) > 0 ) + { + $out .= "\t\tint nCombo = shaderID;\n"; + } + +# $out .= "\tvoid BuildCompileCommandLine( int nCombo, char *pResult, int maxLength )\n"; +# $out .= "\t{\n"; + $out .= "\t\tD3DXMACRO "; + $out .= "defineMacros"; + $out .= "["; + $out .= scalar( @dynamicDefineNames ) + scalar( @staticDefineNames ) + 1; # add 1 for null termination + $out .= "];\n"; + if( scalar( @dynamicDefineNames ) + scalar( @staticDefineNames ) > 0 ) + { + $out .= "\t\tchar tmpStringBuf[1024];\n"; + $out .= "\t\tchar *pTmpString = tmpStringBuf;\n\n"; + } + + local( $i ); + my $type = GetShaderType( $fxc_filename ); + for( $i = 0; $i < scalar( @dynamicDefineNames ); $i++ ) + { + $out .= "\t\tsprintf( pTmpString, \"%d\", nCombo % "; + $out .= ( $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1 ) + $dynamicDefineMin[$i]; + $out .= " );\n"; + $out .= "\t\tdefineMacros"; + $out .= "["; + $out .= $i; + $out .= "]"; + $out .= "\.Name = "; + $out .= "\"$dynamicDefineNames[$i]\";\n"; + + $out .= "\t\tint n$dynamicDefineNames[$i] = nCombo % "; + $out .= ( $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1 ) + $dynamicDefineMin[$i]; + $out .= ";\n"; + $out .= "\t\tUNUSED( n$dynamicDefineNames[$i] );\n"; + + $out .= "\t\tdefineMacros"; + $out .= "["; + $out .= $i; + $out .= "]"; + $out .= "\.Definition = "; + $out .= "pTmpString;\n"; + $out .= "\t\tpTmpString += strlen( pTmpString ) + 1;\n"; + + $out .= "\t\tsprintf( tmp, \"\%d\", n$dynamicDefineNames[$i] );\n"; + $out .= "\t\tOutputDebugString( \" $dynamicDefineNames[$i]"; + $out .= "=\" );\n"; + $out .= "\t\tOutputDebugString( tmp );\n"; + + $out .= "\t\tnCombo = nCombo / " . ( $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1 ) . ";\n"; + $out .= "\n"; + } + for( $i = 0; $i < scalar( @staticDefineNames ); $i++ ) + { + $out .= "\t\tsprintf( pTmpString, \"%d\", nCombo % "; + $out .= ( $staticDefineMax[$i] - $staticDefineMin[$i] + 1 ) + $staticDefineMin[$i]; + $out .= " );\n"; + $out .= "\t\tdefineMacros"; + $out .= "["; + $out .= $i + scalar( @dynamicDefineNames ); + $out .= "]"; + $out .= "\.Name = "; + $out .= "\"$staticDefineNames[$i]\";\n"; + + $out .= "\t\tint n$staticDefineNames[$i] = nCombo % "; + $out .= ( $staticDefineMax[$i] - $staticDefineMin[$i] + 1 ) + $staticDefineMin[$i]; + $out .= ";\n"; + $out .= "\t\tUNUSED( n$staticDefineNames[$i] );\n"; + + $out .= "\t\tdefineMacros"; + $out .= "["; + $out .= $i + scalar( @dynamicDefineNames ); + $out .= "]"; + $out .= "\.Definition = "; + $out .= "pTmpString;\n"; + $out .= "\t\tpTmpString += strlen( pTmpString ) + 1;\n"; + + $out .= "\t\tsprintf( tmp, \"\%d\", n$staticDefineNames[$i] );\n"; + $out .= "\t\tOutputDebugString( \" $staticDefineNames[$i]"; + $out .= "=\" );\n"; + $out .= "\t\tOutputDebugString( tmp );\n"; + + $out .= "\t\tnCombo = nCombo / " . ( $staticDefineMax[$i] - $staticDefineMin[$i] + 1 ) . ";\n"; + $out .= "\n"; + } + + $out .= "\t\tOutputDebugString( \"\\n\" );\n"; + + $cskipcode = $perlskipcode; + $cskipcode =~ s/\$/n/g; + $out .= "\t\tif( $cskipcode )\n\t\t{\n"; + $out .= "\t\t\tstatic char blah[4] = { 0, 0, 0, 0 };\n"; + $out .= "\t\t\tbyteCode.m_pRawData = blah;\n"; + $out .= "\t\t\tbyteCode.m_nSizeInBytes = 4;\n"; + $out .= "\t\t\treturn byteCode;\n"; + $out .= "\t\t}\n"; + + + + $out .= "\t\t// Must null terminate macros.\n"; + $out .= "\t\tdefineMacros["; + $out .= scalar( @dynamicDefineNames ) + scalar( @staticDefineNames ); + $out .= "]"; + $out .= ".Name = NULL;\n"; + $out .= "\t\tdefineMacros["; + $out .= scalar( @dynamicDefineNames ) + scalar( @staticDefineNames ); + $out .= "]"; + $out .= ".Definition = NULL;\n\n"; + + + $out .= "\t\tLPD3DXBUFFER pShader; // NOTE: THESE LEAK!!!\n"; + $out .= "\t\tLPD3DXBUFFER pErrorMessages; // NOTE: THESE LEAK!!!\n"; + $out .= "\t\tHRESULT hr = D3DXCompileShaderFromFile( \"u:\\\\hl2_e3_2004\\\\src_e3_2004\\\\materialsystem\\\\stdshaders\\\\$fxc_filename\",\n\t\t\tdefineMacros,\n\t\t\tNULL, // LPD3DXINCLUDE \n\t\t\t\"main\",\n\t\t\t\"$type\",\n\t\t\t0, // DWORD Flags\n\t\t\t&pShader,\n\t\t\t&pErrorMessages,\n\t\t\tNULL // LPD3DXCONSTANTTABLE *ppConstantTable\n\t\t\t );\n"; + $out .= "\t\tif( hr != D3D_OK )\n"; + $out .= "\t\t{\n"; + $out .= "\t\t\tconst char *pErrorMessageString = ( const char * )pErrorMessages->GetBufferPointer();\n"; + $out .= "\t\t\tOutputDebugString( pErrorMessageString );\n"; + $out .= "\t\t\tOutputDebugString( \"\\n\" );\n"; + $out .= "\t\t\tAssert( 0 );\n"; + $out .= "\t\t\tstatic char blah[4] = { 0, 0, 0, 0 };\n"; + $out .= "\t\t\tbyteCode.m_pRawData = blah;\n"; + $out .= "\t\t\tbyteCode.m_nSizeInBytes = 4;\n"; + $out .= "\t\t}\n"; + $out .= "\t\telse\n"; + $out .= "\t\t{\n"; + $out .= "\t\t\tbyteCode.m_pRawData = pShader->GetBufferPointer();\n"; + $out .= "\t\t\tbyteCode.m_nSizeInBytes = pShader->GetBufferSize();\n"; + $out .= "\t\t}\n"; + $out .= "\t\treturn byteCode;\n"; + return $out; +} + +#print "--------\n"; + +if ( $g_x360 ) +{ + $fxctmp = "fxctmp9_360_tmp"; +} +else +{ + $fxctmp = "fxctmp9_tmp"; +} + +if( !stat $fxctmp ) +{ + mkdir $fxctmp, 0777 || die $!; +} + +# suck in an input file (using includes) +#print "$fxc_filename..."; +@fxc = ReadInputFile( $fxc_filename ); + +# READ THE TOP OF THE FILE TO FIND SHADER COMBOS +foreach $line ( @fxc ) +{ + $line="" if ($g_x360 && ($line=~/\[PC\]/)); # line marked as [PC] when building for x360 + $line="" if (($g_x360 == 0) && ($line=~/\[XBOX\]/)); # line marked as [XBOX] when building for pc + + if ( $fxc_basename =~ m/_ps(\d+\w?)$/i ) + { + my $psver = $1; + $line="" if (($line =~/\[ps\d+\w?\]/i) && ($line!~/\[ps$psver\]/i)); # line marked for a version of compiler and not what we build + } + if ( $fxc_basename =~ m/_vs(\d+\w?)$/i ) + { + my $vsver = $1; + $line="" if (($line =~/\[vs\d+\w?\]/i) && ($line!~/\[vs$vsver\]/i)); # line marked for a version of compiler and not what we build + } + + my $init_expr; + + $init_expr = $1 if ( $line=~/\[\=([^\]]+)\]/); # parse default init expression for combos + + $line=~s/\[[^\[\]]*\]//; # cut out all occurrences of + # square brackets and whatever is + # inside all these modifications + # to the line are seen later when + # processing skips and centroids + + next if( $line =~ m/^\s*$/ ); + + if( $line =~ m/^\s*\/\/\s*STATIC\s*\:\s*\"(.*)\"\s+\"(\d+)\.\.(\d+)\"/ ) + { + local( $name, $min, $max ); + $name = $1; + $min = $2; + $max = $3; + # print STDERR "STATIC: \"$name\" \"$min..$max\"\n"; + push @staticDefineNames, $name; + push @staticDefineMin, $min; + push @staticDefineMax, $max; + $staticDefineInit{$name}=$init_expr; + } + elsif( $line =~ m/^\s*\/\/\s*DYNAMIC\s*\:\s*\"(.*)\"\s+\"(\d+)\.\.(\d+)\"/ ) + { + local( $name, $min, $max ); + $name = $1; + $min = $2; + $max = $3; + # print STDERR "DYNAMIC: \"$name\" \"$min..$max\"\n"; + push @dynamicDefineNames, $name; + push @dynamicDefineMin, $min; + push @dynamicDefineMax, $max; + } +} +# READ THE WHOLE FILE AND FIND SKIP STATEMENTS +foreach $line ( @fxc ) +{ + if( $line =~ m/^\s*\/\/\s*SKIP\s*\s*\:\s*(.*)$/ ) + { + # print $1 . "\n"; + $perlskipcode .= "(" . $1 . ")||"; + push @perlskipcodeindividual, $1; + } +} + +if( defined $perlskipcode ) +{ + $perlskipcode .= "0"; + $perlskipcode =~ s/\n//g; +} +else +{ + $perlskipcode = "0"; +} + +# READ THE WHOLE FILE AND FIND CENTROID STATEMENTS +foreach $line ( @fxc ) +{ + if( $line =~ m/^\s*\/\/\s*CENTROID\s*\:\s*TEXCOORD(\d+)\s*$/ ) + { + $centroidEnable{$1} = 1; +# print "CENTROID: $1\n"; + } +} + +if( $spewCombos ) +{ + push @outputHeader, "#include \"windows.h\"\n"; +} + +#push @outputHeader, "\#include \"shaderlib\\baseshader.h\"\n"; +#push @outputHeader, "IShaderDynamicAPI *CBaseShader::s_pShaderAPI;\n"; + +# Go ahead an compute the mask of samplers that need to be centroid sampled +$centroidMask = 0; +foreach $centroidRegNum ( keys( %centroidEnable ) ) +{ +# print "THING: $samplerName $centroidRegNum\n"; + $centroidMask += 1 << $centroidRegNum; +} + +#printf "0x%x\n", $centroidMask; + +$numCombos = &CalcNumCombos(); +#print "$numCombos combos\n"; + + +if( $g_produceCompiledVcs && !$dynamic_compile ) +{ + open FOUT, ">>filelistgen.txt" || die "can't open filelistgen.txt"; + + print FOUT "**** generated by fxc_prep.pl ****\n"; + print FOUT "#BEGIN " . $fxc_basename . "\n"; + print FOUT "$fxc_filename" . "\n"; + print FOUT "#DEFINES-D:\n"; + for( $i = 0; $i < scalar( @dynamicDefineNames ); \$i++ ) + { + print FOUT "$dynamicDefineNames[$i]="; + print FOUT $dynamicDefineMin[$i]; + print FOUT ".."; + print FOUT $dynamicDefineMax[$i]; + print FOUT "\n"; + } + print FOUT "#DEFINES-S:\n"; + for( $i = 0; $i < scalar( @staticDefineNames ); \$i++ ) + { + print FOUT "$staticDefineNames[$i]="; + print FOUT $staticDefineMin[$i]; + print FOUT ".."; + print FOUT $staticDefineMax[$i]; + print FOUT "\n"; + } + print FOUT "#SKIP:\n"; + print FOUT "$perlskipcode\n"; + print FOUT "#COMMAND:\n"; + # first line + print FOUT "fxc.exe "; + print FOUT "/DTOTALSHADERCOMBOS=$numCombos "; + print FOUT "/DCENTROIDMASK=$centroidMask "; + print FOUT "/DNUMDYNAMICCOMBOS=" . &CalcNumDynamicCombos() . " "; + print FOUT "/DFLAGS=0x0 "; # Nothing here for now. + print FOUT "\n"; +#defines go here +# second line + print FOUT &RenameMain( $fxc_filename, $i ); + print FOUT "/T" . &GetShaderType( $fxc_filename ) . " "; + print FOUT "/DSHADER_MODEL_" . &ToUpper( &GetShaderType( $fxc_filename ) ) . "=1 "; + if( $nvidia ) + { + print FOUT "/DNV3X=1 "; # enable NV3X codepath + } + if ( $g_x360 ) + { + print FOUT "/D_X360=1 "; # shaders can identify X360 centric code + # print FOUT "/Xbe:2- "; # use the less-broken old back end + } + if( $debug ) + { + print FOUT "/Od "; # disable optimizations + print FOUT "/Zi "; # enable debug info + } +# print FOUT "/Zi "; # enable debug info + print FOUT "/nologo "; +# print FOUT "/Fhtmpshader.h "; + print FOUT "/Foshader.o "; + print FOUT "$fxc_filename"; + print FOUT ">output.txt 2>&1"; + print FOUT "\n"; + #end of command line + print FOUT "#END\n"; + print FOUT "**** end ****\n"; + + close FOUT; +} + +if ( $g_produceCppClasses ) +{ + # Write out the C++ helper class for picking shader combos + &WriteStaticHelperClasses(); + &WriteDynamicHelperClasses(); + my $incfilename = "$fxctmp\\$fxc_basename" . ".inc"; + &WriteFile( $incfilename, join( "", @outputHeader ) ); +} + + + +if( $generateListingFile ) +{ + my $listFileName = "$fxctmp/$fxc_basename" . ".lst"; + print "writing $listFileName\n"; + if( !open FILE, ">$listFileName" ) + { + die; + } + print FILE @listingOutput; + close FILE; +} + + +@endTimes = times; + +$endTime = time; + +#printf "Elapsed user time: %.2f seconds!\n", $endTimes[0] - $startTimes[0]; +#printf "Elapsed system time: %.2f seconds!\n", $endTimes[1] - $startTimes[1]; +#printf "Elapsed child user time: %.2f seconds!\n", $endTimes[2] - $startTimes[2]; +#printf "Elapsed child system time: %.2f seconds!\n", $endTimes[3] - $startTimes[3]; + +#printf "Elapsed total time: %.2f seconds!\n", $endTime - $startTime; + diff --git a/devtools/bin/gnu/libiconv2.dll b/devtools/bin/gnu/libiconv2.dll new file mode 100644 index 0000000..747073f Binary files /dev/null and b/devtools/bin/gnu/libiconv2.dll differ diff --git a/devtools/bin/gnu/libintl3.dll b/devtools/bin/gnu/libintl3.dll new file mode 100644 index 0000000..4f309be Binary files /dev/null and b/devtools/bin/gnu/libintl3.dll differ diff --git a/devtools/bin/gnu/touch.exe b/devtools/bin/gnu/touch.exe new file mode 100644 index 0000000..b1385cd Binary files /dev/null and b/devtools/bin/gnu/touch.exe differ diff --git a/devtools/bin/grep.exe b/devtools/bin/grep.exe new file mode 100644 index 0000000..6931618 Binary files /dev/null and b/devtools/bin/grep.exe differ diff --git a/devtools/bin/limit_vtf_sizes.pl b/devtools/bin/limit_vtf_sizes.pl new file mode 100644 index 0000000..66df3c3 --- /dev/null +++ b/devtools/bin/limit_vtf_sizes.pl @@ -0,0 +1,94 @@ +#!perl + +use File::Find; +use File::Basename; + +$dir_to_run_on = shift; +$max_size = shift; + +if ( (! length( $dir_to_run_on ) || (! $max_size ) ) ) + { + die "format is 'limit_vtf_sizes game_dir_to_run_on size'. maxisze -1 to unlimit"; + } + +open(CMDOUT,">\runit.cmd"); + +find(\&ProcessFile, $dir_to_run_on); + +close CMDOUT; + +sub ProcessFile + { + local($_) = $File::Find::name; + my $origname=$_; + my $srcname; + s@\\@/@g; + if (/\.vtf$/i) # is a vtf? + { + next if (m@/hud/@i); # don't shrink hud textures + next if (m@/vgui/@i); # don't shrink hud textures + my $vtex_it=0; + if ( s@game/(.*)/materials/@content/\1/materialsrc/@i ) + { + $srcname=$_; + s/\.vtf$/\.txt/i; + if (-e $_ ) + { + my $txtname=$_; + # decide whether or not to add the limits + open(TXTIN,$txtname) || die "can't open $_ for read something weird has happened"; + my $txtout; + my $should_add_it=1; + while( ) + { + next if ( ( $max_size == -1) && (/maxwidth/i || /maxheight/i) ); # lose this line + $txtout.=$_; + $should_add_it = 0 if (/maxwidth/i || /maxheight/i || /nomip/i || /reduce/i ); + } + close TXTIN; + if ($should_add_it ) + { + print `p4 edit $txtname`; + open(TXTOUT,">$txtname"); + print TXTOUT $txtout; + print TXTOUT "maxwidth $max_size\nmaxheight $max_size\n" if ($max_size != -1); + close TXTOUT; + $vtex_it = 1; + } + } + else + { + if (-d dirname($_) ) + { + print "$_ not found. Creating it\n"; + open(TXTOUT,">$_" ) || die "can't create $_?"; + print TXTOUT "maxwidth $max_size\nmaxheight $max_size\n" if( $max_size != -1); + close TXTOUT; + print `p4 add $_`; + $vtex_it=1; + } + else + { + print "directory does not exist in content for $_\n"; + } + } + } + else + { + die "I dont understand the file $_ : bad path?"; + } + if ($vtex_it) + { + my $name=$srcname; + $name=~s@\..*$@@; # kill extension + $cmd="vtex -nopause $name"; + $cmd=~s@/@\\@g; + print "execute:$cmd\n"; + print CMDOUT "$cmd\n"; +# print `$cmd`."\n"; + + } + + } + } + diff --git a/devtools/bin/linux/ccache b/devtools/bin/linux/ccache new file mode 100644 index 0000000..b275e56 Binary files /dev/null and b/devtools/bin/linux/ccache differ diff --git a/devtools/bin/linux/p4 b/devtools/bin/linux/p4 new file mode 100644 index 0000000..a3c980c Binary files /dev/null and b/devtools/bin/linux/p4 differ diff --git a/devtools/bin/make360def.pl b/devtools/bin/make360def.pl new file mode 100644 index 0000000..38aad9f --- /dev/null +++ b/devtools/bin/make360def.pl @@ -0,0 +1,329 @@ +############################################################### +# +# generateDEF.pl +# +# Parses a .map file and generates a .def file +# for exporting functions from a dll. +# +# Note: Map Exports must be enabled in the project properties +# +############################################################### + +my @baselist; +my @output; +my $baseLen = 63; + +###################################### +# Adds tabs for better formatting + +sub Add_Tabs +{ + my $name = shift; + my $num = int( ($baseLen - length( $name )) / 8 ); + + for( $i = 0; $i < $num; $i++ ) + { + push( @output, "\t" ); + } +} + +###################################### +# Open, validate, and read a file (not implemented yet) + +sub Read_File +{ + my $name = shift; + my @file = shift; + + # read in the file + if ( open(INFILE, "$name" ) ) + { + @file = ; + close( INFILE ); + } + else + { + print( "Error opening file $name\n" ); + exit 1; + } +} + +##################################### +# Start of script + +print( "Valve Software - make360def.pl\n" ); +print( "Copyright (c) 1996-2006, Valve LLC, All rights reserved.\n" ); + +my $filename = $ARGV[0]; +my $numArgs = 1; +my @lines = (); +my @deflines = (); + +if ( $ARGV[0] =~ /-check$/i ) +{ + $numArgs = 3; + $check = 1; + $filename = $ARGV[1]; + $defname = $ARGV[2]; +} +elsif ( $ARGV[0] =~ /-checkauto/i ) +{ + $defname = $ARGV[1]; + $check = 2; +} + +if ( @ARGV < $numArgs ) +{ + print( "ERROR: Missing filename(s)\n" ); + exit 1; +} + +if ( $check == 1 ) +{ + # swap filenames if necessary + if ( $filename =~ /.def/ ) + { + my $temp = $filename; + $filename = $defname; + $defname = $temp; + } + + # validate extensions + unless ( $filename =~ /.map/ && $defname =~ /.def/ ) + { + print( "ERROR: Invalid file extensions. -check requires a .map file and a .def file.\n" ); + exit 1; + } + + # read in the def file + if ( open(INFILE, "$defname" ) ) + { + @deflines = ; + close( INFILE ); + } + else + { + print( "ERROR: Couldn't open file $defname.\n" ); + exit 1; + } +} +elsif ( $check == 2 ) +{ + # read in the def file + if ( open(INFILE, "$defname" ) ) + { + @deflines = ; + close( INFILE ); + } + else + { + print( "ERROR: Couldn't open file $defname.\n" ); + exit 1; + } + + # validate that the first export is CreateInterface* + # validate that the export ordinals are sequential and ordered + + my $line; + my $start = false; + my $idx = 1; + for ( @deflines ) + { + $line = $_; + + if ( $line =~ /@(\d+)[ |\n]/ ) + { + if ( $1 == 1 ) + { + unless ( $line =~ /CreateInterface/ ) + { + # first export must be CreateInterface* + $line =~ /\s+([\S]*)/; + + print( "**************************************************\n" ); + print( " ERROR: First export must be CreateInterface*. \n" ); + print( " Export \"", $1, "\" found instead! \n" ); + print( " This is a FATAL ERROR with the def file. \n" ); + print( " Please contact an Xbox 360 engineer immediately.\n" ); + print( "**************************************************\n" ); + exit 1; + } + } + + if ( $1 != $idx ) + { + # exports are out of order + print( "**************************************************\n" ); + print( " ERROR: Def file exports are not sequential \n" ); + print( " This may cause unexpected behavior at runtime. \n" ); + print( " Please contact an Xbox 360 engineer immediately.\n" ); + print( "**************************************************\n" ); + exit 1; + } + + ++$idx; + } + } + + exit 0; +} + +# Get the base name + +$filename =~ /(\w+(\.360)?).map/; +my $basename = $1; + +# Read in the source file + +if ( open(INFILE, "$filename" ) ) +{ + @lines = ; + close( INFILE ); +} +else +{ + print( "ERROR: Couldn't open file $filename.\n" ); + exit 1; +} + +# Delete the lines up to the exports section + +my $len = 0; +my $exportsFound = 0; +for( @lines ) +{ + $len++; + if( /^ Exports$/ ) + { + splice( @lines, 0, $len+3 ); + $exportsFound = 1; + } +} + +if ( $exportsFound == 0 ) +{ + print( "ERROR: No Exports section found in $filename. " ); + print( "Relink the project with 'Map Exports' enabled.\n" ); + exit 1; +} + +if ( $check == 1 ) +{ + # Check for exports in the map that aren't in the def + print( "make360def: Comparing $filename and $defname\n" ); + + # strip the first 2 lines from the def + splice( @deflines, 0, 2 ); + + my $defEntryCt = $#deflines + 1; + my $defMatches = 0; + + # for each line in the map + for( @lines ) + { + my $found = 0; + + # Pull the export name from the map line + + my $mapline; + if ( /(\d+)\s+(\S+)/ ) + { + $mapline = $2; + } + else + { + # ignore this line + next; + } + + # for each line in the def + for( @deflines ) + { + /(\S+)/; + + if ( $1 =~ /^\Q$mapline\E$/ ) + { + $found = 1; + $defMatches++; + last; + } + } + + if ( $found == 0 ) + { + print( "ERROR: New export found in $filename, " ); + print( "so the map file and def file are out of sync. " ); + print( "You must relink the project to generate a new def file.\n" ); + exit 1; + } + } + + # Make sure all the def lines were matched + if ( $defMatches != $defEntryCt ) + { + print( "ERROR: An export was removed from $filename, " ); + print( "so the map file and def file are out of sync. " ); + print( "You must relink the project to generate a new def file.\n" ); + exit 1; + } + + print( "make360def: Comparison complete, files match.\n" ); + exit 0; +} + +# start the def file + +print( "make360def: Generating $basename.def\n" ); + +push( @output, "LIBRARY\t$basename.dll\n" ); +push( @output, "EXPORTS\n" ); + +# process each line in the export section + +my $interfacePrefix = "0000000000"; +for( @lines ) +{ + if ( /(\d+)\s+(\S+)/ ) + { + my $func = $2; + if ( $func =~ /CreateInterface/ ) + { + # Force createInterface to sort first + $func = join( '', $interfacePrefix, $func ); + } + + push( @baselist, $func ); + } +} + +# sort the list +my @sortedlist = sort {uc($a) cmp uc($b)} @baselist; +#my @sortedlist = @baselist; + +my $ordinal = 1; +for( @sortedlist ) +{ + my $func = $_; + if ( /$interfacePrefix(.*)/ ) + { + # Strip the added characters + $func = $1; + } + + push( @output, "\t$func\t" ); + Add_Tabs( $func ); + push( @output, "\@$ordinal\n" ); + $ordinal++; +} + +# write the def file + +print( "make360def: Saving $basename.def.\n" ); + +open ( OUTFILE, ">$basename.def" ); +print OUTFILE @output; +close ( OUTFILE ); + +print( "make360def: Finished.\n" ); + +exit 0; diff --git a/devtools/bin/makewav.exe b/devtools/bin/makewav.exe new file mode 100644 index 0000000..ede7e38 Binary files /dev/null and b/devtools/bin/makewav.exe differ diff --git a/devtools/bin/masm.exe b/devtools/bin/masm.exe new file mode 100644 index 0000000..c487faf Binary files /dev/null and b/devtools/bin/masm.exe differ diff --git a/devtools/bin/mc.exe b/devtools/bin/mc.exe new file mode 100644 index 0000000..c2f9b6d Binary files /dev/null and b/devtools/bin/mc.exe differ diff --git a/devtools/bin/md5.exe b/devtools/bin/md5.exe new file mode 100644 index 0000000..0e744f0 Binary files /dev/null and b/devtools/bin/md5.exe differ diff --git a/devtools/bin/mksln.pl b/devtools/bin/mksln.pl new file mode 100644 index 0000000..aec1c88 --- /dev/null +++ b/devtools/bin/mksln.pl @@ -0,0 +1,388 @@ +#!perl +use XML::Simple; +use Data::Dumper; +use Getopt::Long; +use File::Basename; +use Cwd 'abs_path'; +use Cwd; +use Digest::MD5 qw(md5 md5_hex md5_base64); + + +GetOptions( "verbose"=>\$verbose, + "projlist"=>\$projlist, + "x360"=>\$x360 ); + +$sln_name=shift || &PrintArgumentSummaryAndExit; + +my $curdir=cwd; + +$curdir=~ (m@(^.*/[a-z_]*src[0-9]?)@i) || die "Can't determine srcroot from current directory $curdir"; + +$srcroot=lc($1); + +$linker_tool_name="VCLinkerTool"; +$linker_tool_name="VCX360LinkerTool" if ($x360); + +@output_only_projects_dependent_upon = (); + +&ReadVPCProjects; +if ( $sln_name =~ /^\@(\S+)/) +{ + $sln_name=$1; + &ReadGroup($1); + foreach $proj (@PROJS) + { + &AddProject(lc(abs_path($proj)),1); + } + if ( $projlist ) + { + &WriteProjectListFile( $sln_name ); + } + else + { + &WriteSolutionFile($sln_name); + } +} +else +{ + # normal mode + while($_ = shift ) + { + if ( /^\@(\S+)/) + { + # accept group names + &ReadGroup($1); + foreach $proj (@PROJS) + { + &AddProject(lc(abs_path($proj)),1); + } + } + elsif ( /^\*(\S+)/) + { + push( @output_only_projects_dependent_upon, lc( $1 ) ); + &ReadGroup("everything"); + foreach $proj (@PROJS) + { + &AddProject(lc(abs_path($proj)),0); + } + } + else + { + unless(/\.vcproj/) # if no extension specified, assume its a project name from projects.vgc + { + $_=$projpath{lc($_)} if length($projpath{lc($_)}); + } + foreach $path (split(/\s+/,$_)) + { + $path=~s@\s+@@g; + &AddProject(lc(abs_path($path)),1) if length($path); + } + } + } + if ( $projlist ) + { + &WriteProjectListFile( $sln_name ); + } + else + { + &WriteSolutionFile($sln_name); + } +} + + +sub WriteSolutionFile +{ + local($sln)=@_; + $sln="$sln.sln" unless ( $sln=~/\./); # add extension if needed + if ( ( -e $sln && ( ! ( -w $sln ) ) ) ) + { + print STDERR "$sln is write-protected. Doing p4 edit.\n"; + print `p4 edit $sln`; + die "Failed to make $sln writeable" if ( ! ( -w $sln ) ); + } + open(SLN,">$sln" ) || die "can't open output $sln"; + # generate a guid for the sln + my $sln_guid="8BC9CEB8-8B4A-11D0-8D11-".substr(uc(md5_hex(basename($sln))),0,12); + + print SLN "\xef\xbb\xbf\nMicrosoft Visual Studio Solution File, Format Version 9.00\n# Visual Studio 2005\n"; + foreach $proj (@PROJECTS) + { + # check dependencies for "*" projects + if ( (! length( $force_project_inclusion{$proj} ) ) && + ( @output_only_projects_dependent_upon )) + { + my $skip_it = 1; + foreach $output_only ( @output_only_projects_dependent_upon ) + { + $skip_it = 0 if ( $output_only eq lc( $proj ) ); + foreach $lib (split(/,/,$depends_on{$proj})) + { + $skip_it = 0 if ( $output_only eq lc($lib) ); + foreach $prvd (split(/,/,$provider{$lib})) + { + $skip_it = 0 if ( $output_only eq $prvd ); + } + } + } + next if ( $skip_it ); + } + + print SLN "Project(\"{",$sln_guid,"}\") = \"$proj\", \"$relpath{$proj}\", \"$guid{$proj}\"\n"; + + #, now do dependencies + if ( length($depends_on{$proj} ) ) + { + print SLN "\tProjectSection(ProjectDependencies) = postProject\n"; + foreach $lib (split(/,/,$depends_on{$proj})) + { + if ( length($provider{$lib}) ) + { + foreach $prvd (split(/,/,$provider{$lib})) + { + print SLN "\t\t$guid{$prvd} = $guid{$prvd}\n" if ( length($prvd) ); + } + } + else + { + print "I don't know who provides $lib for $proj\n" if ( $verbose && length($lib) ); + } + + } + print SLN "\tEndProjectSection\n"; + } + print SLN "EndProject\n"; + } + + print SLN "Global\n"; + print SLN "\tGlobalSection(SolutionProperties) = preSolution\n"; + print SLN "\t\tHideSolutionNode = FALSE\n"; + print SLN "\tEndGlobalSection\n"; + print SLN "EndGlobal\n"; + close SLN; +} + +sub WriteProjectListFile +{ + local($txtfile) = @_; + $txtfile = "$txtfile.txt" unless ( $txtfile=~/\./); # add extension if needed + open(SLN,">$txtfile" ) || die "can't open output $txtfile"; + + foreach $proj (@PROJECTS) + { + # check dependencies for "*" projects + if ( (! length( $force_project_inclusion{$proj} ) ) && + ( @output_only_projects_dependent_upon )) + { + my $skip_it = 1; + foreach $output_only ( @output_only_projects_dependent_upon ) + { + $skip_it = 0 if ( $output_only eq lc( $proj ) ); + foreach $lib (split(/,/,$depends_on{$proj})) + { + $skip_it = 0 if ( $output_only eq lc($lib) ); + foreach $prvd (split(/,/,$provider{$lib})) + { + $skip_it = 0 if ( $output_only eq $prvd ); + } + } + } + next if ( $skip_it ); + } + + push @plist, $proj; + } + # now, we need to satisfy all dependencies + while( $#plist >= 0) + { + @worklist=@plist; + undef @plist; + PROJECT: foreach $proj( @worklist ) + { + if ( length($depends_on{$proj} ) ) + { + foreach $lib (split(/,/,$depends_on{$proj})) + { + if ( length($provider{$lib}) ) + { + foreach $prvd (split(/,/,$provider{$lib})) + { + if ( length( $prvd ) && ( !$already_did{$prvd} ) ) + { + push @plist, $proj; # can't do it yet + next PROJECT; + } + } + } + } + } + $already_did{$proj} = 1; + print SLN "$relpath{$proj}\n"; + } + } + close SLN; +} + +sub PrintArgumentSummaryAndExit +{ + print "Format of command is\n"; + my $switches="[ -projlist -verbose -x360 ]"; + print "\t MKSLN $switches proj1.vcproj proj2.vcproj ...\n"; + print "OR\t MKSLN $switches \@vpcgroupname\n"; + print "OR\t MKSLN $switches sln_name \@vpcgroupname\n"; + print "OR\t MKSLN $switches sln_name *project create a solution including only that project and things dependent on it.\n"; +} + + +sub AddProject +{ + local($fname, $force )=@_; + local($/); + print "add project $fname\n" if ( $verbose ); + open( VCP_IN, $fname ) || die "can't open $fname"; + my $xmltext=; + close VCP_IN; + my $xml=XMLin($xmltext, forcearray => [ 'File', 'Filter' ] ); #, keyattr =>[ 'name', 'key', 'id', 'Name']); + my $pname=lc($xml->{Name}); + $force_project_inclusion{$pname} = "yes" if ( $force ); + return if ($already_processed{$pname} ); + $already_processed{$pname}=1; + my $id=$xml->{ProjectGUID}; + unless( length($id) ) + { + die "project $fname doesn't have a guid. Generated by an old VPC?"; + } + $id = "{".$id."}" unless( $id=~ /}/); + $guid{$pname}=$id; + push @PROJECTS,$pname; + $vcprojpath{$pname}=$fname; + + #get targetname + my $targetname=$xml->{Name}; + # get output target + + my $tools=$xml->{Configurations}->{Configuration}[0]; + # walk the tool list to see if this project outpus a .lib that something might depend on + my $outputtarget; + foreach $tool (@{$tools->{'Tool'}}) + { + if ( $tool->{Name} eq "VCLibrarianTool" ) + { + my $outputtarget=lc(basename($tool->{OutputFile})); + $provider{$outputtarget}.=",$pname"; + print "$pname provides $outputtarget\n" if ($verbose); + } + if ( $tool->{Name} eq $linker_tool_name ) + { + my $outputtarget=$tool->{'ImportLibrary'}; + if ( length($outputtarget) ) + { + $outputtarget=~s/\$\(TargetName\)/$targetname/i; + $outputtarget=lc(basename($outputtarget)); + $outputtarget =~ s/\.lib/_360.lib/ if ( $x360 ); + $provider{$outputtarget}=basename($pname); + print "$pname provides $outputtarget\n" if ($verbose); + } + } + } + + foreach $filter (@{$xml->{Files}->{Filter}}) + { + foreach $file (@{$filter->{File}}) + { + my $f = lc($file->{RelativePath}); + if ( $f=~/\.lib$/i) # library dependency + { + my $libname=basename($f); + $depends_on{$pname}.=",".$libname; + print "$pname depends on $libname\n" if ($verbose); + } + } + } + # generate relative pathname + $fname=~s@^$srcroot/@@i; + $fname=~s@/@\\@g; + $relpath{$pname}=$fname; + +} + +sub ReadGroup +{ + local($matchgroup)=@_; + my $curmatch=0; + open(GROUPS,"$srcroot/vpc_scripts/groups.vgc") || die "can't open groups.vgc"; + while() + { + &FixupVPCLine; + if (/^\$Group\s+(.*)$/) + { + my $groups=" $1 "; + $groups=~s@\"@@g; + $curmatch=0; + $curmatch=1 if ( $groups=~/ $matchgroup /i ); + } + elsif ( $curmatch && (/^\s*\"([^\"]+)\"/) ) + { + my $proj=lc($1); + my $path=$projpath{$proj}; + if (length($path)) + { + foreach $prj (split(/\s+/, $path)) + { + $prj=~s@\s+@@g; + next unless (length($prj)); + if ( -e $prj ) + { + push @PROJS,$prj; + print "found proj $prj\n" if ($verbose); + } + else + { + print STDERR "can't find $prj\n"; + } + + } + } + else + { + print STDERR "couldn't find project name $proj (group = $matchgroup )\n"; + } + } + else + { + $curmatch = 0 if (/\}/); + } + + } +} + +sub ReadVPCProjects +{ + # group mode. ugh 100x harder to parse vpc than .vcproj + open(PROJS,"$srcroot/vpc_scripts/projects.vgc" ) || die "can't open projects.vgc"; + while() + { + &FixupVPCLine; + if (/^\s*\$Project\s+\"([^\"]+)\"/) + { + $curproj=$1; + } + elsif (/^\s*\"([^\"]+)\.vpc\"/) + { + my $base = $1; + $base="$base"."_x360" if ( $x360 ); + $projpath{lc($curproj)}.=" $base.vcproj"; + } + } + close PROJS; +} + +sub FixupVPCLine +{ + s@[\n\r]@@g; + s@//.*$@@g; # kill comments + + # use [] skips. need something smarter here. for now, implicit /allgames except hl1 and portalmp + $_=undef if ( /\$HL1/); + $_=undef if ( /\$PORTALMP/); +} + diff --git a/devtools/bin/ml.err b/devtools/bin/ml.err new file mode 100644 index 0000000..4aae01e --- /dev/null +++ b/devtools/bin/ml.err @@ -0,0 +1,280 @@ +FATAL +cannot open file +I/O error closing file +I/O error writing file +I/O error reading file +out of memory +assembler limit : macro parameter name table full +invalid command-line option +nesting level too deep +unmatched macro nesting +line too long +unmatched block nesting +directive must be in control block +error count exceeds 100; stopping assembly +invalid numerical command-line argument +too many arguments +statement too complex +N/A +missing source filename +COFF error writing file +invalid debug and browser data; file exceeds line limit +cannot find link.exe +cannot find cvpack.exe +SEVERE +memory operand not allowed in context +immediate operand not allowed +cannot have more than one ELSE clause per IF block +extra characters after statement +symbol type conflict +symbol redefinition +undefined symbol +non-benign record redefinition +syntax error +syntax error in expression +invalid type expression +distance invalid for word size of current segment +PROC, MACRO, or macro repeat directive must precede LOCAL +.MODEL must precede this directive +cannot define as public or external +segment attributes cannot change +expression expected +operator expected +invalid use of external symbol +operand must be RECORD type or field +identifier not a record +record constants may not span line breaks +instruction operands must be the same size +instruction operand must have size +invalid operand size for instruction +operands must be in same segment +constant expected +operand must be a memory expression +expression must be a code address +multiple base registers not allowed +multiple index registers not allowed +must be index or base register +invalid use of register +invalid INVOKE argument +must be in segment block +DUP too complex +too many initial values for structure +statement not allowed inside structure definition +missing operand for macro operator +line too long +segment register not allowed in context +string or text literal too long +statement too complex +identifier too long +invalid character in file +missing angle bracket or brace in literal +missing single or double quotation mark in string +empty (null) string +nondigit in number +syntax error in floating-point constant +real or BCD number not allowed +text item required +forced error +forced error : value equal to 0 +forced error : value not equal to 0 +forced error : symbol not defined +forced error : symbol defined +forced error : string blank +forced error : string not blank +forced error : strings equal +forced error : strings not equal +[ELSE]IF2/.ERR2 not allowed : single-pass assembler +expression too complex for .UNTILCXZ +can ALIGN only to power of 2 +structure alignment must be 1, 2, 4, 8, or 16 +expected +incompatible CPU mode and segment size +LOCK must be followed by a memory operation +instruction prefix not allowed +no operands allowed for this instruction +invalid instruction operands +initializer magnitude too large for specified size +cannot access symbol in given segment or group +operands have different frames +cannot access label through segment registers +jump destination too far +jump destination must specify a label +instruction does not allow NEAR indirect addressing +instruction does not allow FAR indirect addressing +instruction does not allow FAR direct addressing +jump distance not possible in current CPU mode +missing operand after unary operator +cannot mix 16- and 32-bit registers +invalid scale value +constant value too large +instruction or register not accepted in current CPU mode +reserved word expected +instruction form requires 80386/486 +END directive required at end of file +too many bits in RECORD +positive value expected +index value past end of string +count must be positive or zero +count value too large +operand must be relocatable +constant or relocatable label expected +segment, group, or segment register expected +segment expected +invalid operand for OFFSET +invalid use of external absolute +segment or group not allowed +cannot add two relocatable labels +cannot add memory expression and code label +segment exceeds 64K limit +invalid type for a data declaration +HIGH and LOW require immediate operands +N/A +cannot have implicit far jump or call to near label +use of register assumed to ERROR +only white space or comment can follow backslash +COMMENT delimiter expected +conflicting parameter definition +PROC and prototype calling conventions conflict +invalid radix tag +INVOKE argument type mismatch : argument +invalid coprocessor register +instructions and initialized data not allowed in AT segments +/AT switch requires the TINY memory model +cannot have segment address references with TINY model +language type must be specified +PROLOGUE must be macro function +EPILOGUE must be macro procedure +alternate identifier not allowed with EXTERNDEF +text macro nesting level too deep +N/A +missing macro argument +EXITM used inconsistently +macro function argument list too long +N/A +VARARG parameter must be last parameter +VARARG parameter not allowed with LOCAL +VARARG parameter requires C calling convention +ORG needs a constant or local offset +register value overwritten by INVOKE +structure too large to pass with INVOKE : argument +not overriding private proc as public +too many arguments to INVOKE +too few arguments to INVOKE +invalid data initializer +N/A +RET operand too large +too many operands to instruction +cannot have more than one .ELSE clause per .IF block +expected data label +cannot nest procedures +EXPORT must be FAR +procedure declared with two visibility attributes +macro label not defined +invalid symbol type in expression +byte register cannot be first operand +word register cannot be first operand +special register cannot be first operand +coprocessor register cannot be first operand +cannot change size of expression computations +syntax error in control-flow directive +cannot use 16-bit register with a 32-bit address +constant value out of range +missing right parenthesis +type is wrong size for register +structure cannot be instanced +non-benign structure redefinition: label incorrect +non-benign structure redefinition: too few labels +OLDSTRUCTS/NOOLDSTRUCTS state cannot be changed +non-benign structure redefinition: incorrect initializers +non-benign structure redefinition: too few initializers +non-benign structure redefinition: label has incorrect offset +structure field expected +unexpected literal found in expression +N/A +divide by zero in expression +directive must appear inside a macro +cannot expand macro function +too few bits in RECORD +macro function cannot redefine itself +N/A +invalid qualified type +floating-point initializer on an integer variable +nested structure improperly initialized +invalid use of FLAT +structure improperly initialized +improper list initialization +initializer must be a string or single item +initializer must be a single item +initializer must be a single byte +improper use of list initializer +improper literal initialization +extra characters in literal initialization +must use floating-point initializer +cannot use .EXIT for OS_OS2 with .8086 +invalid combination with segment alignment +INVOKE requires prototype for procedure +cannot include structure in self +symbol language attribute conflict +non-benign COMM redefinition +COMM variable exceeds 64K +parameter or local cannot have void type +cannot use TINY model with OS_OS2 +expression size must be 32 bits +.EXIT does not work with 32-bit segments +.STARTUP does not work with 32-bit segments +ORG directive not allowed in unions +D/T +illegal use of segment register +cannot declare scoped code label as PUBLIC +.MSFLOAT directive is obsolete : .MSFLOAT ignored +ESC instruction is obsolete : ESC ignored +missing operator in expression +missing right parenthesis in expression +missing left parenthesis in expression +reference to forward macro definition +16 bit segments not allowed with /coff option +FAR not allowed in flat model comm variables +invalid .model parameter for flat model +ALIAS name is empty +GROUP directive not allowed with /coff option +.FPO is not compatible with nested procedures +LEVEL 1 +cannot modify READONLY segment +N/A +non-unique STRUCT/UNION field used without qualification +start address on END directive ignored with .STARTUP +cannot ASSUME CS +unknown default prologue argument +too many arguments in macro call +option untranslated, directive required +invalid command-line option value, default is used +insufficent memory for /EP : /EP ignored +expected '>' on text literal +multiple .MODEL directives found : .MODEL ignored +line number information for segment without class 'CODE' +instructions and initialized data not supported in AT segments +directive ignored with /coff switch +/Gc switch incompatible with flat model +/AT switch incompatible with flat model +invalid command-line option +directive ignored without /coff switch +directive ignored outside a procedure +LOADDS ignored in flat model +debug information too complex for +with /coff switch, leading underscore required for start address +LEVEL 2 +@@: label defined but not referenced +expression expected, assume value 0 +EXTERNDEF previously assumed to be external +length of symbol previously assumed to be different +symbol previously assumed to not be in a group +types are different +calling convention not supported in flat model +LEVEL 3 +N/A +no return from procedure +N/A +conditional jump lengthened +procedure argument or local not referenced +expression may be pass-dependent +structure contains no members diff --git a/devtools/bin/ml.exe b/devtools/bin/ml.exe new file mode 100644 index 0000000..fe038ac Binary files /dev/null and b/devtools/bin/ml.exe differ diff --git a/devtools/bin/oldfxc.exe b/devtools/bin/oldfxc.exe new file mode 100644 index 0000000..21b640a Binary files /dev/null and b/devtools/bin/oldfxc.exe differ diff --git a/devtools/bin/osx32/ccache b/devtools/bin/osx32/ccache new file mode 100644 index 0000000..9b40bf9 Binary files /dev/null and b/devtools/bin/osx32/ccache differ diff --git a/devtools/bin/osx32/protoc b/devtools/bin/osx32/protoc new file mode 100644 index 0000000..f111cb2 Binary files /dev/null and b/devtools/bin/osx32/protoc differ diff --git a/devtools/bin/osx32/xcode_ccache_wrapper b/devtools/bin/osx32/xcode_ccache_wrapper new file mode 100644 index 0000000..475f508 --- /dev/null +++ b/devtools/bin/osx32/xcode_ccache_wrapper @@ -0,0 +1,3 @@ +#!/bin/bash + +exec $(dirname $0)/ccache "${DT_TOOLCHAIN_DIR}"/usr/bin/clang -Qunused-arguments "$@" diff --git a/devtools/bin/playback_getframe.pl b/devtools/bin/playback_getframe.pl new file mode 100644 index 0000000..137c598 --- /dev/null +++ b/devtools/bin/playback_getframe.pl @@ -0,0 +1,24 @@ +if( scalar( @ARGV ) != 2 ) +{ + die "Usage: playback_getframe.pl framenum blah.txt\n"; +} + +# getframe.pl framenum blah.txt +$line = 0; +$desiredFrame = shift; +$frame = 1; +open INPUT, shift || die; +while( ) +{ + $line++; + if( /Dx8Present/ ) + { + $frame++; + } + if( $frame == $desiredFrame ) + { + print "$line: $_"; + } + last if $frame > $desiredFrame; +} +close INPUT; diff --git a/devtools/bin/playback_getstate.pl b/devtools/bin/playback_getstate.pl new file mode 100644 index 0000000..0796e4e --- /dev/null +++ b/devtools/bin/playback_getstate.pl @@ -0,0 +1,169 @@ +# getfinalstate.pl blah.txt line +# note: the state is *before* the line that you specify +die "Usage: playback_getstate.pl blah.txt cmd\n" if scalar( @ARGV ) != 2; + +open INPUT, shift || die; +$desiredcmd = shift; +$line = 0; + +sub PadNumber +{ + local( $str ) = shift; + local( $desiredLen ) = shift; + local( $len ) = length $str; + while( $len < $desiredLen ) + { + $str = "0" . $str; + $len++; + } + return $str; +} + + +while( ) +{ + m/^cmd: (\d+) /; + $cmdnum = $1; +# print "$cmdnum\n"; + if( $cmdnum == $desiredcmd ) + { + print "$_"; + last; + } + if( /Dx8SetTextureStageState:\s*stage:\s*(\d+)\s*state:\s*(\S+)\s*,\s*value:\s*(\S+)/ ) + { + $texturestate{"$2 $1"} = $3; +# print "$1 $2 $3\n"; + } +# elsif( /Dx8SetTextureStageState/i ) +# { +# die "$_"; +# } + + if( /Dx8SetRenderState:\s*(\S+)\s+(\S+.*)*$/ ) + { + $renderstate{$1} = $2; + } +# elsif( /Dx8SetRenderState/i ) +# { +# die "$_"; +# } + + if( /Dx8SetVertexShaderConstant:\s*reg:\s*(\d+)\s*numvecs:\s*(\d+)\s*val:\s*(.*)$/ ) + { + local( $reg ) = $1; + local( $count ) = $2; + local( $val ) = $3; + local( $i ); + for( $i = 0; $i < $count; $i++, $reg++ ) + { + $val =~ s/^\s*(\[\s*\S+\s+\S+\s+\S+\s+\S+\s*\])(.*$)/$2/; + $vertconst{ "vshconst " . &PadNumber( $reg, 2 ) } = $1; + } + } +# elsif( /Dx8SetVertexShaderConstant/i ) +# { +# die "$_"; +# } + + if( /Dx8SetPixelShaderConstant:\s*reg:\s*(\d+)\s*numvecs:\s*(\d+)\s*val:\s*(.*)$/ ) + { + local( $reg ) = $1; + local( $count ) = $2; + local( $val ) = $3; + local( $i ); + for( $i = 0; $i < $count; $i++, $reg++ ) + { + $val =~ s/^\s*(\[\s*\S+\s+\S+\s+\S+\s+\S+\s*\])(.*$)/$2/; + $pixelconst{ "pshconst " . &PadNumber( $reg, 2 ) } = $1; + } + } +# elsif( /Dx8SetPixelShaderConstant/i ) +# { +# die "$_"; +# } + + if( /Dx8SetStreamSource:\s*vertexBufferID:\s*(\d+)\s*streamID:\s*(\d+)\s*vertexSize:\s*(\d+)\s*$/ ) + { + $streamsrc{$2} = "vertexBufferID: $1 vertexSize: $3"; + } +# elsif( /Dx8SetStreamSource/i ) +# { +# die "$_"; +# } + + if( /Dx8CreateVertexShader:\s*id:\s*(\d+)\s+dwDecl:\s*(.*)$/ ) + { + $vshdecl{$1} = $2; + } + elsif( /Dx8CreateVertexShader/i ) + { + die "$_"; + } + + if( /Dx8SetVertexShader:\s*vertexShader:\s*(\d+)\s*$/ ) + { + $currentVertexShader = $1; + } + elsif( /Dx8SetVertexShader:/i ) + { + die "$_"; + } + + if( /Dx8SetPixelShader:\s*pixelShader:\s*(\d+)\s*$/ ) + { + $currentPixelShader = $1; + } + elsif( /Dx8SetPixelShader:/i ) + { + die "$_"; + } + + if( /Dx8SetVertexBufferFormat:\s*id:\s*(\d+)\s*vertexFormat:\s*(.*)$/ ) + { + $vbformat{$1} = $2; + } + elsif( /Dx8SetVertexBufferFormat/i ) + { + die "$_"; + } +} +close INPUT; + +foreach $state ( sort( keys( %texturestate ) ) ) +{ + print "$state = $texturestate{$state}\n"; +} + +foreach $state ( sort( keys( %renderstate ) ) ) +{ + print "$state = $renderstate{$state}\n"; +} + +foreach $state ( sort( keys( %vertconst ) ) ) +{ + print "$state = $vertconst{$state}\n"; +} + +foreach $state ( sort( keys( %pixelconst ) ) ) +{ + print "$state = $pixelconst{$state}\n"; +} + +foreach $state ( sort( keys( %streamsrc ) ) ) +{ + $streamsrc{$state} =~ m/vertexBufferID:\s*(\d+)\s+/; + local( $vertbufid ) = $1; + print "stream $state = $streamsrc{$state} vbformat: $vbformat{$vertbufid}\n"; +} + +#foreach $state ( sort( keys( %vbformat ) ) ) +#{ +# print "vbformat $state = $vbformat{$state}\n"; +#} + +print "current vsh: $currentVertexShader vshdecl: $vshdecl{$currentVertexShader}\n"; +print "current psh: $currentPixelShader\n"; + + + diff --git a/devtools/bin/playback_gettexlock.pl b/devtools/bin/playback_gettexlock.pl new file mode 100644 index 0000000..bf03c6a --- /dev/null +++ b/devtools/bin/playback_gettexlock.pl @@ -0,0 +1,27 @@ +# This gives you all calls between lock and unlock for the specified texture. +# gettexlock.pl texid blah.txt +$desiredTexture = shift; +open INPUT, shift || die; +while( ) +{ + if( /Dx8LockTexture: id: (\d+)\s+/ ) + { + if( $1 == $desiredTexture ) + { + print "----------------------------------------------------\n"; + print; + $gotit = 1; + } + } + elsif( $gotit && /Dx8UnlockTexture: id: (\d+)\s+/ ) + { + die if $1 != $desiredTexture; + print; + $gotit = 0; + } + else + { + print if( $gotit ); + } +} +close INPUT; diff --git a/devtools/bin/playback_getvb.pl b/devtools/bin/playback_getvb.pl new file mode 100644 index 0000000..c2ac79b --- /dev/null +++ b/devtools/bin/playback_getvb.pl @@ -0,0 +1,23 @@ +# getframe.pl vbid blah.txt +$desiredVB = shift; +open INPUT, shift || die; +while( ) +{ + if( /Dx8VertexData: id: (\d+)\s+/ ) + { + if( $1 == $desiredVB ) + { + print; + $gotit = 1; + } + } + elsif( $gotit && /^vertex:/ ) + { + print; + } + else + { + $gotit = 0; + } +} +close INPUT; diff --git a/devtools/bin/playback_numframes.bat b/devtools/bin/playback_numframes.bat new file mode 100644 index 0000000..cc1f493 --- /dev/null +++ b/devtools/bin/playback_numframes.bat @@ -0,0 +1 @@ +grep Dx8Present %1 | wc -l diff --git a/devtools/bin/playback_numprims.pl b/devtools/bin/playback_numprims.pl new file mode 100644 index 0000000..f90946f --- /dev/null +++ b/devtools/bin/playback_numprims.pl @@ -0,0 +1,27 @@ +if( scalar( @ARGV ) != 1 ) +{ + die "Usage: playback_numprims.pl frame.txt\n"; +} +open INPUT, shift || die; +$numprims = 0; +$numcalls = 0; +while( ) +{ + if( /DrawIndexedPrimitive.*numPrimitives:\s*(\d+)\s*$/i ) + { + $numprims += $1; + if( $1 > 85 ) + { + $numfreeprims += $1; + } + else + { + $numfreeprims += 85; + } + $numcalls++; + } +} +close INPUT; +print "$numprims primitives\n"; +print "$numfreeprims freeprimitives\n"; +print "$numcalls calls\n"; diff --git a/devtools/bin/psh_prep.pl b/devtools/bin/psh_prep.pl new file mode 100644 index 0000000..1c44c41 --- /dev/null +++ b/devtools/bin/psh_prep.pl @@ -0,0 +1,333 @@ +use String::CRC32; +BEGIN {use File::Basename; push @INC, dirname($0); } +require "valve_perl_helpers.pl"; + +sub BuildDefineOptions +{ + local( $output ); + local( $combo ) = shift; + local( $i ); + for( $i = 0; $i < scalar( @dynamicDefineNames ); $i++ ) + { + local( $val ) = ( $combo % ( $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1 ) ) + $dynamicDefineMin[$i]; + $output .= "/D$dynamicDefineNames[$i]=$val "; + $combo = $combo / ( $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1 ); + } + for( $i = 0; $i < scalar( @staticDefineNames ); $i++ ) + { + local( $val ) = ( $combo % ( $staticDefineMax[$i] - $staticDefineMin[$i] + 1 ) ) + $staticDefineMin[$i]; + $output .= "/D$staticDefineNames[$i]=$val "; + $combo = $combo / ( $staticDefineMax[$i] - $staticDefineMin[$i] + 1 ); + } + return $output; +} + +sub CalcNumCombos +{ + local( $i, $numCombos ); + $numCombos = 1; + for( $i = 0; $i < scalar( @dynamicDefineNames ); $i++ ) + { + $numCombos *= $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1; + } + for( $i = 0; $i < scalar( @staticDefineNames ); $i++ ) + { + $numCombos *= $staticDefineMax[$i] - $staticDefineMin[$i] + 1; + } + return $numCombos; +} + +sub CalcNumDynamicCombos +{ + local( $i, $numCombos ); + $numCombos = 1; + for( $i = 0; $i < scalar( @dynamicDefineNames ); $i++ ) + { + $numCombos *= $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1; + } + return $numCombos; +} + +$g_dx9 = 1; + +while( 1 ) +{ + $psh_filename = shift; + + if( $psh_filename =~ m/-source/ ) + { + $g_SourceDir = shift; + } + elsif( $psh_filename =~ m/-x360/ ) + { + $g_x360 = 1; + } + else + { + last; + } +} + +$psh_filename =~ s/-----.*$//; + + +# Get the shader binary version number from a header file. +open FILE, "<$g_SourceDir\\public\\materialsystem\\shader_vcs_version.h" || die; +while( $line = ) +{ + if( $line =~ m/^\#define\s+SHADER_VCS_VERSION_NUMBER\s+(\d+)\s*$/ ) + { + $shaderVersion = $1; + last; + } +} +if( !defined $shaderVersion ) +{ + die "couldn't get shader version from shader_vcs_version.h"; +} +close FILE; + + + +local( @staticDefineNames ); +local( @staticDefineMin ); +local( @staticDefineMax ); +local( @dynamicDefineNames ); +local( @dynamicDefineMin ); +local( @dynamicDefineMax ); + +# Parse the combos. +open PSH, "<$psh_filename"; +while( ) +{ + last if( !m,^;, ); + s,^;\s*,,; + if( m/\s*STATIC\s*\:\s*\"(.*)\"\s+\"(\d+)\.\.(\d+)\"/ ) + { + local( $name, $min, $max ); + $name = $1; + $min = $2; + $max = $3; +# print "\"STATIC: $name\" \"$min..$max\"\n"; + if (/\[(.*)\]/) + { + $platforms=$1; + next if ( ($g_x360) && (!($platforms=~/XBOX/i)) ); + next if ( (!$g_x360) && (!($platforms=~/PC/i)) ); + } + push @staticDefineNames, $name; + push @staticDefineMin, $min; + push @staticDefineMax, $max; + } + elsif( m/\s*DYNAMIC\s*\:\s*\"(.*)\"\s+\"(\d+)\.\.(\d+)\"/ ) + { + local( $name, $min, $max ); + $name = $1; + $min = $2; + $max = $3; +# print "\"DYNAMIC: $name\" \"$min..$max\"\n"; + if (/\[(.*)\]/) + { + $platforms=$1; + next if ( ($g_x360) && (!($platforms=~/XBOX/i)) ); + next if ( (!$g_x360) && (!($platforms=~/PC/i)) ); + } + push @dynamicDefineNames, $name; + push @dynamicDefineMin, $min; + push @dynamicDefineMax, $max; + } +} +close PSH; + +$numCombos = &CalcNumCombos(); +$numDynamicCombos = &CalcNumDynamicCombos(); +print "$psh_filename\n"; +#print "$numCombos combos\n"; +#print "$numDynamicCombos dynamic combos\n"; + +if( $g_x360 ) +{ + $pshtmp = "pshtmp9_360"; +} +elsif( $g_dx9 ) +{ + $pshtmp = "pshtmp9"; +} +else +{ + $pshtmp = "pshtmp8"; +} +$basename = $psh_filename; +$basename =~ s/\.psh$//i; + +for( $shaderCombo = 0; $shaderCombo < $numCombos; $shaderCombo++ ) +{ + my $tempFilename = "shader$shaderCombo.o"; + unlink $tempFilename; + + if( $g_x360 ) + { + $cmd = "$g_SourceDir\\x360xdk\\bin\\win32\\psa /D_X360=1 /Foshader$shaderCombo.o /nologo " . &BuildDefineOptions( $shaderCombo ) . "$psh_filename > NIL"; + } + else + { + $cmd = "$g_SourceDir\\dx9sdk\\utilities\\psa /Foshader$shaderCombo.o /nologo " . &BuildDefineOptions( $shaderCombo ) . "$psh_filename > NIL"; + } + + if( !stat $pshtmp ) + { + mkdir $pshtmp, 0777 || die $!; + } + +# print $cmd . "\n"; + system $cmd || die $!; + + # Make sure a file got generated because sometimes the die above won't happen on compile errors. + my $filesize = (stat $tempFilename)[7]; + if ( !$filesize ) + { + die "Error compiling shader$shaderCombo.o"; + } + + push @outputHeader, @hdr; +} + +$basename =~ s/\.fxc//gi; +push @outputHeader, "static PrecompiledShaderByteCode_t " . $basename . "_pixel_shaders[" . $numCombos . "] = \n"; +push @outputHeader, "{\n"; +local( $j ); +for( $j = 0; $j < $numCombos; $j++ ) +{ + local( $thing ) = "pixelShader_" . $basename . "_" . $j; + push @outputHeader, "\t{ " . "$thing, sizeof( $thing ) },\n"; +} +push @outputHeader, "};\n"; + +push @outputHeader, "struct $basename" . "PixelShader_t : public PrecompiledShader_t\n"; +push @outputHeader, "{\n"; +push @outputHeader, "\t$basename" . "PixelShader_t()\n"; +push @outputHeader, "\t{\n"; +push @outputHeader, "\t\tm_nFlags = 0;\n"; +push @outputHeader, "\t\tm_pByteCode = " . $basename . "_pixel_shaders;\n"; +push @outputHeader, "\t\tm_nShaderCount = $numCombos;\n"; +#push @outputHeader, "\t\tm_nDynamicCombos = m_nShaderCount;\n"; +push @outputHeader, "\t\t// NOTE!!! psh_prep.pl shaders are always static combos!\n"; +push @outputHeader, "\t\tm_nDynamicCombos = 1;\n"; +push @outputHeader, "\t\tm_pName = \"$basename\";\n"; +if( $basename =~ /vs\d\d/ ) # hack +{ + push @outputHeader, "\t\tGetShaderDLL()->InsertPrecompiledShader( PRECOMPILED_VERTEX_SHADER, this );\n"; +} +else +{ + push @outputHeader, "\t\tGetShaderDLL()->InsertPrecompiledShader( PRECOMPILED_PIXEL_SHADER, this );\n"; +} +push @outputHeader, "\t}\n"; +push @outputHeader, "\tvirtual const PrecompiledShaderByteCode_t &GetByteCode( int shaderID )\n"; +push @outputHeader, "\t{\n"; +push @outputHeader, "\t\treturn m_pByteCode[shaderID];\n"; +push @outputHeader, "\t}\n"; +push @outputHeader, "};\n"; + +push @outputHeader, "static $basename" . "PixelShader_t $basename" . "_PixelShaderInstance;\n"; + + +&MakeDirHier( "shaders/psh" ); + +my $vcsName = ""; +if( $g_x360 ) +{ + $vcsName = $basename . ".360.vcs"; +} +else +{ + $vcsName = $basename . ".vcs"; +} + +open COMPILEDSHADER, ">shaders/psh/$vcsName" || die; +binmode( COMPILEDSHADER ); + +# +# Write out the part of the header that we know. . we'll write the rest after writing the object code. +# + +#print $numCombos . "\n"; + +# Pack arguments +my $sInt = "i"; +my $uInt = "I"; +if ( $g_x360 ) +{ + # Change arguments to "big endian long" + $sInt = "N"; + $uInt = "N"; +} + +open PSH, "<$psh_filename"; +my $crc = crc32( *PSH ); +close PSH; +#print STDERR "crc for $psh_filename: $crc\n"; + +# version +print COMPILEDSHADER pack $sInt, 4; +# totalCombos +print COMPILEDSHADER pack $sInt, $numCombos; +# dynamic combos +print COMPILEDSHADER pack $sInt, $numDynamicCombos; +# flags +print COMPILEDSHADER pack $uInt, 0x0; # nothing here for now. +# centroid mask +print COMPILEDSHADER pack $uInt, 0; +# reference size for diffs +print COMPILEDSHADER pack $uInt, 0; +# crc32 of the source code +print COMPILEDSHADER pack $uInt, $crc; + +my $beginningOfDir = tell COMPILEDSHADER; + +# Write out a blank directionary. . we'll fill it in later. +for( $i = 0; $i < $numCombos; $i++ ) +{ + # offset from beginning of file. + print COMPILEDSHADER pack $sInt, 0; + # size + print COMPILEDSHADER pack $sInt, 0; +} + +my $startByteCode = tell COMPILEDSHADER; +my @byteCodeStart; +my @byteCodeSize; + +# Write out the shader object code. +for( $shaderCombo = 0; $shaderCombo < $numCombos; $shaderCombo++ ) +{ + my $filename = "shader$shaderCombo\.o"; + my $filesize = (stat $filename)[7]; + + $byteCodeStart[$shaderCombo] = tell COMPILEDSHADER; + $byteCodeSize[$shaderCombo] = $filesize; + open SHADERBYTECODE, "<$filename"; + binmode SHADERBYTECODE; + + my $bin; + my $numread = read SHADERBYTECODE, $bin, $filesize; +# print "filename: $filename numread: $numread filesize: $filesize\n"; + close SHADERBYTECODE; + unlink $filename; + + print COMPILEDSHADER $bin; +} + +# Seek back to the directory and write it out. +seek COMPILEDSHADER, $beginningOfDir, 0; +for( $i = 0; $i < $numCombos; $i++ ) +{ + # offset from beginning of file. + print COMPILEDSHADER pack $sInt, $byteCodeStart[$i]; + # size + print COMPILEDSHADER pack $sInt, $byteCodeSize[$i]; +} + +close COMPILEDSHADER; + + diff --git a/devtools/bin/putty/LICENCE b/devtools/bin/putty/LICENCE new file mode 100644 index 0000000..1960cc2 --- /dev/null +++ b/devtools/bin/putty/LICENCE @@ -0,0 +1,25 @@ +PuTTY is copyright 1997-2007 Simon Tatham. + +Portions copyright Robert de Bath, Joris van Rantwijk, Delian +Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry, +Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus +Kuhn, and CORE SDI S.A. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation files +(the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/devtools/bin/putty/README.txt b/devtools/bin/putty/README.txt new file mode 100644 index 0000000..b4b5fba --- /dev/null +++ b/devtools/bin/putty/README.txt @@ -0,0 +1,40 @@ +PuTTY README +============ + +This is the README file for the PuTTY installer distribution. If +you're reading this, you've probably just run our installer and +installed PuTTY on your system. + +What should I do next? +---------------------- + +If you want to use PuTTY to connect to other computers, or use PSFTP +to transfer files, you should just be able to run them from the +Start menu. + +If you want to use the command-line-only file transfer utility PSCP, +you will probably want to put the PuTTY installation directory on +your PATH. How you do this depends on your version of Windows. On +Windows NT, 2000, and XP, you can set it using Control Panel > System; +on Windows 95, 98, and Me, you will need to edit AUTOEXEC.BAT. Consult +your Windows manuals for details. + +Some versions of Windows will refuse to run HTML Help files (.CHM) +if they are installed on a network drive. If you have installed +PuTTY on a network drive, you might want to check that the help file +works properly. If not, see http://support.microsoft.com/kb/896054 +for information on how to solve this problem. + +What do I do if it doesn't work? +-------------------------------- + +The PuTTY home web site is + + http://www.chiark.greenend.org.uk/~sgtatham/putty/ + +Here you will find our list of known bugs and pending feature +requests. If your problem is not listed in there, or in the FAQ, or +in the manuals, read the Feedback page to find out how to report +bugs to us. PLEASE read the Feedback page carefully: it is there to +save you time as well as us. Do not send us one-line bug reports +telling us `it doesn't work'. diff --git a/devtools/bin/putty/pageant.exe b/devtools/bin/putty/pageant.exe new file mode 100644 index 0000000..ea2379b Binary files /dev/null and b/devtools/bin/putty/pageant.exe differ diff --git a/devtools/bin/putty/plink.exe b/devtools/bin/putty/plink.exe new file mode 100644 index 0000000..a27bf36 Binary files /dev/null and b/devtools/bin/putty/plink.exe differ diff --git a/devtools/bin/putty/pscp.exe b/devtools/bin/putty/pscp.exe new file mode 100644 index 0000000..e511e5b Binary files /dev/null and b/devtools/bin/putty/pscp.exe differ diff --git a/devtools/bin/putty/psftp.exe b/devtools/bin/putty/psftp.exe new file mode 100644 index 0000000..1f986e7 Binary files /dev/null and b/devtools/bin/putty/psftp.exe differ diff --git a/devtools/bin/putty/putty.cnt b/devtools/bin/putty/putty.cnt new file mode 100644 index 0000000..84d15ef --- /dev/null +++ b/devtools/bin/putty/putty.cnt @@ -0,0 +1,492 @@ +:Title PuTTY User Manual +1 Title page=Top +1 Chapter 1: Introduction to PuTTY +2 Chapter 1: Introduction to PuTTY=t00000000 +2 Section 1.1: What are SSH, Telnet and Rlogin?=t00000001 +2 Section 1.2: How do SSH, Telnet and Rlogin differ?=t00000002 +1 Chapter 2: Getting started with PuTTY +2 Chapter 2: Getting started with PuTTY=t00000003 +2 Section 2.1: Starting a session=t00000004 +2 Section 2.2: Verifying the host key (SSH only)=t00000005 +2 Section 2.3: Logging in=t00000006 +2 Section 2.4: After logging in=t00000007 +2 Section 2.5: Logging out=t00000008 +1 Chapter 3: Using PuTTY +2 Chapter 3: Using PuTTY=t00000009 +2 Section 3.1: During your session +3 Section 3.1: During your session=t00000010 +3 Section 3.1.1: Copying and pasting text=t00000011 +3 Section 3.1.2: Scrolling the screen back=t00000012 +3 Section 3.1.3: The System menu +4 Section 3.1.3: The System menu=t00000013 +4 Section 3.1.3.1: The PuTTY Event Log=t00000014 +4 Section 3.1.3.2: Special commands=t00000015 +4 Section 3.1.3.3: Starting new sessions=t00000016 +4 Section 3.1.3.4: Changing your session settings=t00000017 +4 Section 3.1.3.5: Copy All to Clipboard=t00000018 +4 Section 3.1.3.6: Clearing and resetting the terminal=t00000019 +4 Section 3.1.3.7: Full screen mode=t00000020 +1 Section 3.2: Creating a log file of your session=t00000021 +1 Section 3.3: Altering your character set configuration=t00000022 +1 Section 3.4: Using X11 forwarding in SSH=t00000023 +1 Section 3.5: Using port forwarding in SSH=t00000024 +1 Section 3.6: Making raw TCP connections=t00000025 +1 Section 3.7: Connecting to a local serial line=t00000026 +2 Section 3.8: The PuTTY command line +3 Section 3.8: The PuTTY command line=t00000027 +3 Section 3.8.1: Starting a session from the command line=t00000028 +3 Section 3.8.2: -cleanup=options.cleanup +3 Section 3.8.3: Standard command-line options +4 Section 3.8.3: Standard command-line options=t00000029 +4 Section 3.8.3.1: -load: load a saved session=t00000030 +4 Section 3.8.3.2: Selecting a protocol: -ssh, -telnet, -rlogin, -raw=t00000031 +4 Section 3.8.3.3: -v: increase verbosity=t00000032 +4 Section 3.8.3.4: -l: specify a login name=t00000033 +4 Section 3.8.3.5: -L, -R and -D: set up port forwardings=t00000034 +4 Section 3.8.3.6: -m: read a remote command or script from a file=t00000035 +4 Section 3.8.3.7: -P: specify a port number=t00000036 +4 Section 3.8.3.8: -pw: specify a password=t00000037 +4 Section 3.8.3.9: -agent and -noagent: control use of Pageant for authentication=t00000038 +4 Section 3.8.3.10: -A and -a: control agent forwarding=t00000039 +4 Section 3.8.3.11: -X and -x: control X11 forwarding=t00000040 +4 Section 3.8.3.12: -t and -T: control pseudo-terminal allocation=t00000041 +4 Section 3.8.3.13: -N: suppress starting a shell or command=t00000042 +4 Section 3.8.3.14: -nc: make a remote network connection in place of a remote shell or command=t00000043 +4 Section 3.8.3.15: -C: enable compression=t00000044 +4 Section 3.8.3.16: -1 and -2: specify an SSH protocol version=t00000045 +4 Section 3.8.3.17: -4 and -6: specify an Internet protocol version=t00000046 +4 Section 3.8.3.18: -i: specify an SSH private key=t00000047 +4 Section 3.8.3.19: -pgpfp: display PGP key fingerprints=t00000048 +1 Chapter 4: Configuring PuTTY +2 Chapter 4: Configuring PuTTY=t00000049 +2 Section 4.1: The Session panel +3 Section 4.1: The Session panel=t00000050 +3 Section 4.1.1: The host name section=session.hostname +3 Section 4.1.2: Loading and storing saved sessions=session.saved +3 Section 4.1.3: ‘Close Window on Exit’=session.coe +2 Section 4.2: The Logging panel +3 Section 4.2: The Logging panel=logging.main +3 Section 4.2.1: ‘Log file name’=logging.filename +3 Section 4.2.2: ‘What to do if the log file already exists’=logging.exists +3 Section 4.2.3: ‘Flush log file frequently’=logging.flush +3 Section 4.2.4: Options specific to SSH packet logging +4 Section 4.2.4: Options specific to SSH packet logging=t00000051 +4 Section 4.2.4.1: ‘Omit known password fields’=logging.ssh.omitpassword +4 Section 4.2.4.2: ‘Omit session data’=logging.ssh.omitdata +2 Section 4.3: The Terminal panel +3 Section 4.3: The Terminal panel=t00000052 +3 Section 4.3.1: ‘Auto wrap mode initially on’=terminal.autowrap +3 Section 4.3.2: ‘DEC Origin Mode initially on’=terminal.decom +3 Section 4.3.3: ‘Implicit CR in every LF’=terminal.lfhascr +3 Section 4.3.4: ‘Use background colour to erase screen’=terminal.bce +3 Section 4.3.5: ‘Enable blinking text’=terminal.blink +3 Section 4.3.6: ‘Answerback to ^E’=terminal.answerback +3 Section 4.3.7: ‘Local echo’=terminal.localecho +3 Section 4.3.8: ‘Local line editing’=terminal.localedit +3 Section 4.3.9: Remote-controlled printing=terminal.printing +2 Section 4.4: The Keyboard panel +3 Section 4.4: The Keyboard panel=t00000053 +3 Section 4.4.1: Changing the action of the Backspace key=keyboard.backspace +3 Section 4.4.2: Changing the action of the Home and End keys=keyboard.homeend +3 Section 4.4.3: Changing the action of the function keys and keypad=keyboard.funkeys +3 Section 4.4.4: Controlling Application Cursor Keys mode=keyboard.appcursor +3 Section 4.4.5: Controlling Application Keypad mode=keyboard.appkeypad +3 Section 4.4.6: Using NetHack keypad mode=keyboard.nethack +3 Section 4.4.7: Enabling a DEC-like Compose key=keyboard.compose +3 Section 4.4.8: ‘Control-Alt is different from AltGr’=keyboard.ctrlalt +2 Section 4.5: The Bell panel +3 Section 4.5: The Bell panel=t00000054 +3 Section 4.5.1: ‘Set the style of bell’=bell.style +3 Section 4.5.2: ‘Taskbar/caption indication on bell’=bell.taskbar +3 Section 4.5.3: ‘Control the bell overload behaviour’=bell.overload +2 Section 4.6: The Features panel +3 Section 4.6: The Features panel=t00000055 +3 Section 4.6.1: Disabling application keypad and cursor keys=features.application +3 Section 4.6.2: Disabling xterm-style mouse reporting=features.mouse +3 Section 4.6.3: Disabling remote terminal resizing=features.resize +3 Section 4.6.4: Disabling switching to the alternate screen=features.altscreen +3 Section 4.6.5: Disabling remote window title changing=features.retitle +3 Section 4.6.6: Response to remote window title querying=features.qtitle +3 Section 4.6.7: Disabling destructive backspace=features.dbackspace +3 Section 4.6.8: Disabling remote character set configuration=features.charset +3 Section 4.6.9: Disabling Arabic text shaping=features.arabicshaping +3 Section 4.6.10: Disabling bidirectional text display=features.bidi +2 Section 4.7: The Window panel +3 Section 4.7: The Window panel=t00000056 +3 Section 4.7.1: Setting the size of the PuTTY window=window.size +3 Section 4.7.2: What to do when the window is resized=window.resize +3 Section 4.7.3: Controlling scrollback=window.scrollback +3 Section 4.7.4: ‘Push erased text into scrollback’=window.erased +2 Section 4.8: The Appearance panel +3 Section 4.8: The Appearance panel=t00000057 +3 Section 4.8.1: Controlling the appearance of the cursor=appearance.cursor +3 Section 4.8.2: Controlling the font used in the terminal window=appearance.font +3 Section 4.8.3: ‘Hide mouse pointer when typing in window’=appearance.hidemouse +3 Section 4.8.4: Controlling the window border=appearance.border +2 Section 4.9: The Behaviour panel +3 Section 4.9: The Behaviour panel=t00000058 +3 Section 4.9.1: Controlling the window title=appearance.title +3 Section 4.9.2: ‘Warn before closing window’=behaviour.closewarn +3 Section 4.9.3: ‘Window closes on ALT-F4’=behaviour.altf4 +3 Section 4.9.4: ‘System menu appears on ALT-Space’=behaviour.altspace +3 Section 4.9.5: ‘System menu appears on Alt alone’=behaviour.altonly +3 Section 4.9.6: ‘Ensure window is always on top’=behaviour.alwaysontop +3 Section 4.9.7: ‘Full screen on Alt-Enter’=behaviour.altenter +2 Section 4.10: The Translation panel +3 Section 4.10: The Translation panel=t00000059 +3 Section 4.10.1: Controlling character set translation=translation.codepage +3 Section 4.10.2: ‘Treat CJK ambiguous characters as wide’=translation.cjkambigwide +3 Section 4.10.3: ‘Caps Lock acts as Cyrillic switch’=translation.cyrillic +3 Section 4.10.4: Controlling display of line-drawing characters=translation.linedraw +3 Section 4.10.5: Controlling copy and paste of line drawing characters=selection.linedraw +2 Section 4.11: The Selection panel +3 Section 4.11: The Selection panel=t00000060 +3 Section 4.11.1: Pasting in Rich Text Format=selection.rtf +3 Section 4.11.2: Changing the actions of the mouse buttons=selection.buttons +3 Section 4.11.3: ‘Shift overrides application's use of mouse’=selection.shiftdrag +3 Section 4.11.4: Default selection mode=selection.rect +3 Section 4.11.5: Configuring word-by-word selection=selection.charclasses +2 Section 4.12: The Colours panel +3 Section 4.12: The Colours panel=t00000061 +3 Section 4.12.1: ‘Allow terminal to specify ANSI colours’=colours.ansi +3 Section 4.12.2: ‘Allow terminal to use xterm 256-colour mode’=colours.xterm256 +3 Section 4.12.3: ‘Bolded text is a different colour’=colours.bold +3 Section 4.12.4: ‘Attempt to use logical palettes’=colours.logpal +3 Section 4.12.5: ‘Use system colours’=colours.system +3 Section 4.12.6: Adjusting the colours in the terminal window=colours.config +2 Section 4.13: The Connection panel +3 Section 4.13: The Connection panel=t00000062 +3 Section 4.13.1: Using keepalives to prevent disconnection=connection.keepalive +3 Section 4.13.2: ‘Disable Nagle's algorithm’=connection.nodelay +3 Section 4.13.3: ‘Enable TCP keepalives’=connection.tcpkeepalive +3 Section 4.13.4: ‘Internet protocol’=connection.ipversion +2 Section 4.14: The Data panel +3 Section 4.14: The Data panel=t00000063 +3 Section 4.14.1: ‘Auto-login username’=connection.username +3 Section 4.14.2: ‘Terminal-type string’=connection.termtype +3 Section 4.14.3: ‘Terminal speeds’=connection.termspeed +3 Section 4.14.4: Setting environment variables on the server=telnet.environ +2 Section 4.15: The Proxy panel +3 Section 4.15: The Proxy panel=proxy.main +3 Section 4.15.1: Setting the proxy type=proxy.type +3 Section 4.15.2: Excluding parts of the network from proxying=proxy.exclude +3 Section 4.15.3: Name resolution when using a proxy=proxy.dns +3 Section 4.15.4: Username and password=proxy.auth +3 Section 4.15.5: Specifying the Telnet or Local proxy command=proxy.command +2 Section 4.16: The Telnet panel +3 Section 4.16: The Telnet panel=t00000064 +3 Section 4.16.1: ‘Handling of OLD_ENVIRON ambiguity’=telnet.oldenviron +3 Section 4.16.2: Passive and active Telnet negotiation modes=telnet.passive +3 Section 4.16.3: ‘Keyboard sends Telnet special commands’=telnet.specialkeys +3 Section 4.16.4: ‘Return key sends Telnet New Line instead of ^M’=telnet.newline +2 Section 4.17: The Rlogin panel +3 Section 4.17: The Rlogin panel=t00000065 +3 Section 4.17.1: ‘Local username’=rlogin.localuser +2 Section 4.18: The SSH panel +3 Section 4.18: The SSH panel=t00000066 +3 Section 4.18.1: Executing a specific command on the server=ssh.command +3 Section 4.18.2: ‘Don't start a shell or command at all’=ssh.noshell +3 Section 4.18.3: ‘Enable compression’=ssh.compress +3 Section 4.18.4: ‘Preferred SSH protocol version’=ssh.protocol +3 Section 4.18.5: Encryption algorithm selection=ssh.ciphers +2 Section 4.19: The Kex panel +3 Section 4.19: The Kex panel=t00000067 +3 Section 4.19.1: Key exchange algorithm selection=ssh.kex.order +3 Section 4.19.2: Repeat key exchange=ssh.kex.repeat +2 Section 4.20: The Auth panel +3 Section 4.20: The Auth panel=t00000068 +3 Section 4.20.1: ‘Bypass authentication entirely’=ssh.auth.bypass +3 Section 4.20.2: ‘Attempt authentication using Pageant’=ssh.auth.pageant +3 Section 4.20.3: ‘Attempt TIS or CryptoCard authentication’=ssh.auth.tis +3 Section 4.20.4: ‘Attempt keyboard-interactive authentication’=ssh.auth.ki +3 Section 4.20.5: ‘Allow agent forwarding’=ssh.auth.agentfwd +3 Section 4.20.6: ‘Allow attempted changes of username in SSH-2’=ssh.auth.changeuser +3 Section 4.20.7: ‘Private key file for authentication’=ssh.auth.privkey +2 Section 4.21: The TTY panel +3 Section 4.21: The TTY panel=t00000069 +3 Section 4.21.1: ‘Don't allocate a pseudo-terminal’=ssh.nopty +3 Section 4.21.2: Sending terminal modes=ssh.ttymodes +2 Section 4.22: The X11 panel +3 Section 4.22: The X11 panel=ssh.tunnels.x11 +3 Section 4.22.1: Remote X11 authentication=ssh.tunnels.x11auth +2 Section 4.23: The Tunnels panel +3 Section 4.23: The Tunnels panel=ssh.tunnels.portfwd +3 Section 4.23.1: Controlling the visibility of forwarded ports=ssh.tunnels.portfwd.localhost +3 Section 4.23.2: Selecting Internet protocol version for forwarded ports=ssh.tunnels.portfwd.ipversion +2 Section 4.24: The Bugs panel +3 Section 4.24: The Bugs panel=t00000070 +3 Section 4.24.1: ‘Chokes on SSH-1 ignore messages’=ssh.bugs.ignore1 +3 Section 4.24.2: ‘Refuses all SSH-1 password camouflage’=ssh.bugs.plainpw1 +3 Section 4.24.3: ‘Chokes on SSH-1 RSA authentication’=ssh.bugs.rsa1 +3 Section 4.24.4: ‘Miscomputes SSH-2 HMAC keys’=ssh.bugs.hmac2 +3 Section 4.24.5: ‘Miscomputes SSH-2 encryption keys’=ssh.bugs.derivekey2 +3 Section 4.24.6: ‘Requires padding on SSH-2 RSA signatures’=ssh.bugs.rsapad2 +3 Section 4.24.7: ‘Misuses the session ID in SSH-2 PK auth’=ssh.bugs.pksessid2 +3 Section 4.24.8: ‘Handles SSH-2 key re-exchange badly’=ssh.bugs.rekey2 +2 Section 4.25: The Serial panel +3 Section 4.25: The Serial panel=t00000071 +3 Section 4.25.1: Selecting a serial line to connect to=serial.line +3 Section 4.25.2: Selecting the speed of your serial line=serial.speed +3 Section 4.25.3: Selecting the number of data bits=serial.databits +3 Section 4.25.4: Selecting the number of stop bits=serial.stopbits +3 Section 4.25.5: Selecting the serial parity checking scheme=serial.parity +3 Section 4.25.6: Selecting the serial flow control scheme=serial.flow +1 Section 4.26: Storing configuration in a file=t00000072 +1 Chapter 5: Using PSCP to transfer files securely +2 Chapter 5: Using PSCP to transfer files securely=t00000073 +2 Section 5.1: Starting PSCP=t00000074 +2 Section 5.2: PSCP Usage +3 Section 5.2: PSCP Usage=t00000075 +3 Section 5.2.1: The basics +4 Section 5.2.1: The basics=t00000076 +4 Section 5.2.1.1: user=t00000077 +4 Section 5.2.1.2: host=t00000078 +4 Section 5.2.1.3: source=t00000079 +4 Section 5.2.1.4: target=t00000080 +3 Section 5.2.2: Options +4 Section 5.2.2: Options=t00000081 +4 Section 5.2.2.1: -ls list remote files=t00000082 +4 Section 5.2.2.2: -p preserve file attributes=t00000083 +4 Section 5.2.2.3: -q quiet, don't show statistics=t00000084 +4 Section 5.2.2.4: -r copies directories recursively=t00000085 +4 Section 5.2.2.5: -batch avoid interactive prompts=t00000086 +4 Section 5.2.2.6: -sftp, -scp force use of particular protocol=t00000087 +2 Section 5.2.3: Return value=t00000088 +2 Section 5.2.4: Using public key authentication with PSCP=t00000089 +1 Chapter 6: Using PSFTP to transfer files securely +2 Chapter 6: Using PSFTP to transfer files securely=t00000090 +2 Section 6.1: Starting PSFTP +3 Section 6.1: Starting PSFTP=t00000091 +3 Section 6.1.1: -b: specify a file containing batch commands=t00000092 +3 Section 6.1.2: -bc: display batch commands as they are run=t00000093 +3 Section 6.1.3: -be: continue batch processing on errors=t00000094 +3 Section 6.1.4: -batch: avoid interactive prompts=t00000095 +2 Section 6.2: Running PSFTP +3 Section 6.2: Running PSFTP=t00000096 +3 Section 6.2.1: General quoting rules for PSFTP commands=t00000097 +3 Section 6.2.2: Wildcards in PSFTP=t00000098 +3 Section 6.2.3: The open command: start a session=t00000099 +3 Section 6.2.4: The quit command: end your session=t00000100 +3 Section 6.2.5: The close command: close your connection=t00000101 +3 Section 6.2.6: The help command: get quick online help=t00000102 +3 Section 6.2.7: The cd and pwd commands: changing the remote working directory=t00000103 +3 Section 6.2.8: The lcd and lpwd commands: changing the local working directory=t00000104 +3 Section 6.2.9: The get command: fetch a file from the server=t00000105 +3 Section 6.2.10: The put command: send a file to the server=t00000106 +3 Section 6.2.11: The mget and mput commands: fetch or send multiple files=t00000107 +3 Section 6.2.12: The reget and reput commands: resuming file transfers=t00000108 +3 Section 6.2.13: The dir command: list remote files=t00000109 +3 Section 6.2.14: The chmod command: change permissions on remote files=t00000110 +3 Section 6.2.15: The del command: delete remote files=t00000111 +3 Section 6.2.16: The mkdir command: create remote directories=t00000112 +3 Section 6.2.17: The rmdir command: remove remote directories=t00000113 +3 Section 6.2.18: The mv command: move and rename remote files=t00000114 +3 Section 6.2.19: The ! command: run a local Windows command=t00000115 +1 Section 6.3: Using public key authentication with PSFTP=t00000116 +1 Chapter 7: Using the command-line connection tool Plink +2 Chapter 7: Using the command-line connection tool Plink=t00000117 +2 Section 7.1: Starting Plink=t00000118 +2 Section 7.2: Using Plink +3 Section 7.2: Using Plink=t00000119 +3 Section 7.2.1: Using Plink for interactive logins=t00000120 +3 Section 7.2.2: Using Plink for automated connections=t00000121 +3 Section 7.2.3: Plink command line options +4 Section 7.2.3: Plink command line options=t00000122 +4 Section 7.2.3.1: -batch: disable all interactive prompts=t00000123 +4 Section 7.2.3.2: -s: remote command is SSH subsystem=t00000124 +1 Section 7.3: Using Plink in batch files and scripts=t00000125 +1 Section 7.4: Using Plink with CVS=t00000126 +1 Section 7.5: Using Plink with WinCVS=t00000127 +1 Chapter 8: Using public keys for SSH authentication +2 Chapter 8: Using public keys for SSH authentication=t00000128 +2 Section 8.1: Public key authentication - an introduction=t00000129 +2 Section 8.2: Using PuTTYgen, the PuTTY key generator +3 Section 8.2: Using PuTTYgen, the PuTTY key generator=puttygen.general +3 Section 8.2.1: Generating a new key=t00000130 +3 Section 8.2.2: Selecting the type of key=puttygen.keytype +3 Section 8.2.3: Selecting the size (strength) of the key=puttygen.bits +3 Section 8.2.4: The ‘Generate’ button=puttygen.generate +3 Section 8.2.5: The ‘Key fingerprint’ box=puttygen.fingerprint +3 Section 8.2.6: Setting a comment for your key=puttygen.comment +3 Section 8.2.7: Setting a passphrase for your key=puttygen.passphrase +3 Section 8.2.8: Saving your private key to a disk file=puttygen.savepriv +3 Section 8.2.9: Saving your public key to a disk file=puttygen.savepub +3 Section 8.2.10: ‘Public key for pasting into authorized_keys file’=puttygen.pastekey +3 Section 8.2.11: Reloading a private key=puttygen.load +3 Section 8.2.12: Dealing with private keys in other formats=puttygen.conversions +1 Section 8.3: Getting ready for public key authentication=t00000131 +1 Chapter 9: Using Pageant for authentication +2 Chapter 9: Using Pageant for authentication=pageant.general +2 Section 9.1: Getting started with Pageant=t00000132 +2 Section 9.2: The Pageant main window +3 Section 9.2: The Pageant main window=t00000133 +3 Section 9.2.1: The key list box=pageant.keylist +3 Section 9.2.2: The ‘Add Key’ button=pageant.addkey +3 Section 9.2.3: The ‘Remove Key’ button=pageant.remkey +2 Section 9.3: The Pageant command line +3 Section 9.3: The Pageant command line=t00000134 +3 Section 9.3.1: Making Pageant automatically load keys on startup=t00000135 +3 Section 9.3.2: Making Pageant run another program=t00000136 +1 Section 9.4: Using agent forwarding=t00000137 +1 Section 9.5: Security considerations=t00000138 +1 Chapter 10: Common error messages +2 Chapter 10: Common error messages=t00000139 +2 Section 10.1: ‘The server's host key is not cached in the registry’=errors.hostkey.absent +2 Section 10.2: ‘WARNING - POTENTIAL SECURITY BREACH!’=errors.hostkey.changed +2 Section 10.3: ‘Out of space for port forwardings’=t00000140 +2 Section 10.4: ‘The first cipher supported by the server is ... below the configured warning threshold’=t00000141 +2 Section 10.5: ‘Server sent disconnect message type 2 (protocol error): "Too many authentication failures for root"’=t00000142 +2 Section 10.6: ‘Out of memory’=t00000143 +2 Section 10.7: ‘Internal error’, ‘Internal fault’, ‘Assertion failed’=t00000144 +2 Section 10.8: ‘Unable to use this private key file’, ‘Couldn't load private key’, ‘Key is of wrong type’=errors.cantloadkey +2 Section 10.9: ‘Server refused our public key’ or ‘Key refused’=t00000145 +2 Section 10.10: ‘Access denied’, ‘Authentication refused’=t00000146 +2 Section 10.11: ‘Incorrect CRC received on packet’ or ‘Incorrect MAC received on packet’=t00000147 +2 Section 10.12: ‘Incoming packet was garbled on decryption’=t00000148 +2 Section 10.13: ‘PuTTY X11 proxy: various errors’=t00000149 +2 Section 10.14: ‘Network error: Software caused connection abort’=t00000150 +2 Section 10.15: ‘Network error: Connection reset by peer’=t00000151 +2 Section 10.16: ‘Network error: Connection refused’=t00000152 +2 Section 10.17: ‘Network error: Connection timed out’=t00000153 +1 Appendix A: PuTTY FAQ +2 Appendix A: PuTTY FAQ=t00000154 +2 Section A.1: Introduction +3 Section A.1: Introduction=t00000155 +3 Question A.1.1: What is PuTTY?=t00000156 +2 Section A.2: Features supported in PuTTY +3 Section A.2: Features supported in PuTTY=t00000157 +3 Question A.2.1: Does PuTTY support SSH-2?=t00000158 +3 Question A.2.2: Does PuTTY support reading OpenSSH or ssh.com SSH-2 private key files?=t00000159 +3 Question A.2.3: Does PuTTY support SSH-1?=t00000160 +3 Question A.2.4: Does PuTTY support local echo?=t00000161 +3 Question A.2.5: Does PuTTY support storing settings, so I don't have to change them every time?=t00000162 +3 Question A.2.6: Does PuTTY support storing its settings in a disk file?=t00000163 +3 Question A.2.7: Does PuTTY support full-screen mode, like a DOS box?=t00000164 +3 Question A.2.8: Does PuTTY have the ability to remember my password so I don't have to type it every time?=t00000165 +3 Question A.2.9: Is there an option to turn off the annoying host key prompts?=t00000166 +3 Question A.2.10: Will you write an SSH server for the PuTTY suite, to go with the client?=t00000167 +3 Question A.2.11: Can PSCP or PSFTP transfer files in ASCII mode?=t00000168 +2 Section A.3: Ports to other operating systems +3 Section A.3: Ports to other operating systems=t00000169 +3 Question A.3.1: What ports of PuTTY exist?=t00000170 +3 Question A.3.2: Is there a port to Unix?=t00000171 +3 Question A.3.3: What's the point of the Unix port? Unix has OpenSSH.=t00000172 +3 Question A.3.4: Will there be a port to Windows CE or PocketPC?=t00000173 +3 Question A.3.5: Is there a port to Windows 3.1?=t00000174 +3 Question A.3.6: Will there be a port to the Mac?=t00000175 +3 Question A.3.7: Will there be a port to EPOC?=t00000176 +2 Section A.4: Embedding PuTTY in other programs +3 Section A.4: Embedding PuTTY in other programs=t00000177 +3 Question A.4.1: Is the SSH or Telnet code available as a DLL?=t00000178 +3 Question A.4.2: Is the SSH or Telnet code available as a Visual Basic component?=t00000179 +3 Question A.4.3: How can I use PuTTY to make an SSH connection from within another program?=t00000180 +2 Section A.5: Details of PuTTY's operation +3 Section A.5: Details of PuTTY's operation=t00000181 +3 Question A.5.1: What terminal type does PuTTY use?=t00000182 +3 Question A.5.2: Where does PuTTY store its data?=t00000183 +2 Section A.6: HOWTO questions +3 Section A.6: HOWTO questions=t00000184 +3 Question A.6.1: What login name / password should I use?=t00000185 +3 Question A.6.2: What commands can I type into my PuTTY terminal window?=t00000186 +3 Question A.6.3: How can I make PuTTY start up maximised?=t00000187 +3 Question A.6.4: How can I create a Windows shortcut to start a particular saved session directly?=t00000188 +3 Question A.6.5: How can I start an SSH session straight from the command line?=t00000189 +3 Question A.6.6: How do I copy and paste between PuTTY and other Windows applications?=t00000190 +3 Question A.6.7: How do I use all PuTTY's features (public keys, proxying, cipher selection, etc.) in PSCP, PSFTP and Plink?=t00000191 +3 Question A.6.8: How do I use PSCP.EXE? When I double-click it gives me a command prompt window which then closes instantly.=t00000192 +3 Question A.6.9: How do I use PSCP to copy a file whose name has spaces in?=t00000193 +2 Section A.7: Troubleshooting +3 Section A.7: Troubleshooting=t00000194 +3 Question A.7.1: Why do I see ‘Incorrect MAC received on packet’?=t00000195 +3 Question A.7.2: Why do I see ‘Fatal: Protocol error: Expected control record’ in PSCP?=t00000196 +3 Question A.7.3: I clicked on a colour in the Colours panel, and the colour didn't change in my terminal.=t00000197 +3 Question A.7.4: Plink on Windows 95 says it can't find WS2_32.DLL.=t00000198 +3 Question A.7.5: After trying to establish an SSH-2 connection, PuTTY says ‘Out of memory’ and dies.=t00000199 +3 Question A.7.6: When attempting a file transfer, either PSCP or PSFTP says ‘Out of memory’ and dies.=t00000200 +3 Question A.7.7: PSFTP transfers files much slower than PSCP.=t00000201 +3 Question A.7.8: When I run full-colour applications, I see areas of black space where colour ought to be, or vice versa.=t00000202 +3 Question A.7.9: When I change some terminal settings, nothing happens.=t00000203 +3 Question A.7.10: My PuTTY sessions unexpectedly close after they are idle for a while.=t00000204 +3 Question A.7.11: PuTTY's network connections time out too quickly when network connectivity is temporarily lost.=t00000205 +3 Question A.7.12: When I cat a binary file, I get ‘PuTTYPuTTYPuTTY’ on my command line.=t00000206 +3 Question A.7.13: When I cat a binary file, my window title changes to a nonsense string.=t00000207 +3 Question A.7.14: My keyboard stops working once PuTTY displays the password prompt.=t00000208 +3 Question A.7.15: One or more function keys don't do what I expected in a server-side application.=t00000209 +3 Question A.7.16: Since my SSH server was upgraded to OpenSSH 3.1p1/3.4p1, I can no longer connect with PuTTY.=t00000210 +3 Question A.7.17: Why do I see ‘Couldn't load private key from ...’? Why can PuTTYgen load my key but not PuTTY?=t00000211 +3 Question A.7.18: When I'm connected to a Red Hat Linux 8.0 system, some characters don't display properly.=t00000212 +3 Question A.7.19: Since I upgraded to PuTTY 0.54, the scrollback has stopped working when I run screen.=t00000213 +3 Question A.7.20: Since I upgraded Windows XP to Service Pack 2, I can't use addresses like 127.0.0.2.=t00000214 +3 Question A.7.21: PSFTP commands seem to be missing a directory separator (slash).=t00000215 +3 Question A.7.22: Do you want to hear about ‘Software caused connection abort’?=t00000216 +3 Question A.7.23: My SSH-2 session locks up for a few seconds every so often.=t00000217 +3 Question A.7.24: PuTTY fails to start up. Windows claims that ‘the application configuration is incorrect’.=t00000218 +2 Section A.8: Security questions +3 Section A.8: Security questions=t00000219 +3 Question A.8.1: Is it safe for me to download PuTTY and use it on a public PC?=t00000220 +3 Question A.8.2: What does PuTTY leave on a system? How can I clean up after it?=t00000221 +3 Question A.8.3: How come PuTTY now supports DSA, when the website used to say how insecure it was?=t00000222 +3 Question A.8.4: Couldn't Pageant use VirtualLock() to stop private keys being written to disk?=t00000223 +2 Section A.9: Administrative questions +3 Section A.9: Administrative questions=t00000224 +3 Question A.9.1: Would you like me to register you a nicer domain name?=t00000225 +3 Question A.9.2: Would you like free web hosting for the PuTTY web site?=t00000226 +3 Question A.9.3: Would you link to my web site from the PuTTY web site?=t00000227 +3 Question A.9.4: Why don't you move PuTTY to SourceForge?=t00000228 +3 Question A.9.5: Why can't I subscribe to the putty-bugs mailing list?=t00000229 +3 Question A.9.6: If putty-bugs isn't a general-subscription mailing list, what is?=t00000230 +3 Question A.9.7: How can I donate to PuTTY development?=t00000231 +3 Question A.9.8: Can I have permission to put PuTTY on a cover disk / distribute it with other software / etc?=t00000232 +3 Question A.9.9: Can you sign an agreement indemnifying us against security problems in PuTTY?=t00000233 +3 Question A.9.10: Can you sign this form granting us permission to use/distribute PuTTY?=t00000234 +3 Question A.9.11: Can you write us a formal notice of permission to use PuTTY?=t00000235 +3 Question A.9.12: Can you sign anything for us?=t00000236 +3 Question A.9.13: If you won't sign anything, can you give us some sort of assurance that you won't make PuTTY closed-source in future?=t00000237 +3 Question A.9.14: Can you provide us with export control information / FIPS certification for PuTTY?=t00000238 +2 Section A.10: Miscellaneous questions +3 Section A.10: Miscellaneous questions=t00000239 +3 Question A.10.1: Is PuTTY a port of OpenSSH, or based on OpenSSH?=t00000240 +3 Question A.10.2: Where can I buy silly putty?=t00000241 +3 Question A.10.3: What does ‘PuTTY’ mean?=t00000242 +3 Question A.10.4: How do I pronounce ‘PuTTY’?=t00000243 +1 Appendix B: Feedback and bug reporting +2 Appendix B: Feedback and bug reporting=t00000244 +2 Section B.1: General guidelines +3 Section B.1: General guidelines=t00000245 +3 Section B.1.1: Sending large attachments=t00000246 +3 Section B.1.2: Other places to ask for help=t00000247 +1 Section B.2: Reporting bugs=t00000248 +1 Section B.3: Requesting extra features=t00000249 +1 Section B.4: Requesting features that have already been requested=t00000250 +1 Section B.5: Support requests=t00000251 +1 Section B.6: Web server administration=t00000252 +1 Section B.7: Asking permission for things=t00000253 +1 Section B.8: Mirroring the PuTTY web site=t00000254 +1 Section B.9: Praise and compliments=t00000255 +1 Section B.10: E-mail address=t00000256 +1 Appendix C: PuTTY Licence +2 Appendix C: PuTTY Licence=t00000257 +1 Appendix D: PuTTY hacking guide +2 Appendix D: PuTTY hacking guide=t00000258 +2 Section D.1: Cross-OS portability=t00000259 +2 Section D.2: Multiple backends treated equally=t00000260 +2 Section D.3: Multiple sessions per process on some platforms=t00000261 +2 Section D.4: C, not C++=t00000262 +2 Section D.5: Security-conscious coding=t00000263 +2 Section D.6: Independence of specific compiler=t00000264 +2 Section D.7: Small code size=t00000265 +2 Section D.8: Single-threaded code=t00000266 +2 Section D.9: Keystrokes sent to the server wherever possible=t00000267 +2 Section D.10: 640×480 friendliness in configuration panels=t00000268 +2 Section D.11: Automatically generated Makefiles=t00000269 +2 Section D.12: Coroutines in ssh.c=t00000270 +2 Section D.13: Single compilation of each source file=t00000271 +2 Section D.14: Do as we say, not as we do=t00000272 +1 Appendix E: PuTTY download keys and signatures +2 Appendix E: PuTTY download keys and signatures=pgpfingerprints +2 Section E.1: Public keys=t00000273 +2 Section E.2: Security details +3 Section E.2: Security details=t00000274 +3 Section E.2.1: The Development Snapshots keys=t00000275 +3 Section E.2.2: The Releases keys=t00000276 +3 Section E.2.3: The Master Keys=t00000277 diff --git a/devtools/bin/putty/putty.exe b/devtools/bin/putty/putty.exe new file mode 100644 index 0000000..38b49b6 Binary files /dev/null and b/devtools/bin/putty/putty.exe differ diff --git a/devtools/bin/putty/putty.hlp b/devtools/bin/putty/putty.hlp new file mode 100644 index 0000000..92cfc98 Binary files /dev/null and b/devtools/bin/putty/putty.hlp differ diff --git a/devtools/bin/putty/puttycm.exe b/devtools/bin/putty/puttycm.exe new file mode 100644 index 0000000..cfb5ee9 Binary files /dev/null and b/devtools/bin/putty/puttycm.exe differ diff --git a/devtools/bin/putty/puttygen.exe b/devtools/bin/putty/puttygen.exe new file mode 100644 index 0000000..c548873 Binary files /dev/null and b/devtools/bin/putty/puttygen.exe differ diff --git a/devtools/bin/recentchanges.pl b/devtools/bin/recentchanges.pl new file mode 100644 index 0000000..b0674b2 --- /dev/null +++ b/devtools/bin/recentchanges.pl @@ -0,0 +1,79 @@ +# usage: recentchanges.pl +# +# Outputs changelist notes for changelists starting at the changelist number until now +# that involve files in the filespec, grouped by user. +# +# Output file is recentchanges.txt, output to the current working dir. + +BEGIN {use File::Basename; push @INC, dirname($0); } +require "valve_perl_helpers.pl"; + +# take in the revision number we want and the filespec to look at +my $from_changelist = shift; +my $branch = shift; + +if ( length($from_changelist) < 1 || length($branch) < 1 ) +{ + die "usage: recentchanges.pl <'from' changelist number> "; +} + +my $cmd = "p4 changes -l $branch\@$from_changelist,\@now"; +my @fstat = &RunCommand( $cmd ); + +my $lastuser; +my %changes; + +foreach $line ( @fstat ) +{ + #if the line starts with "Change" + #then store the user, all lines after this are changes by this user + if ( $line =~ m/^Change/ ) + { + my $data = 'Change (1234) on (date) by (name)@(clientspec)'; + + my @values = split(' ', $line); + + @usersplit = split('@', $values[5]); + + $lastuser = $usersplit[0]; + } + else + { + #this is a change line, associate it with the user in our %changes hash + + chomp($line); + + # skip empty and 'merge from main' lines + if ( length($line) > 0 && $line !~ m/Merge from main/ ) + { + #strip leading whitespace + $line =~ s/^\s+//; + + # if the first char is not '-', add '- ' to the front + if ( $line !~ m/^-/ ) + { + $line = "- $line"; + } + + push @{ $changes{$lastuser} }, $line; + } + } +} + +chdir(); +open(OUTFILE, ">recentchanges.txt"); + +foreach $user ( keys %changes ) +{ + print "$user\n"; + print OUTFILE "$user\n"; + foreach $i ( 0 .. $#{ $changes{$user} } ) + { + print "$changes{$user}[$i]\n"; + print OUTFILE "$changes{$user}[$i]\n"; + } + print "\n"; + print OUTFILE "\n"; +} + +close(OUTFILE); \ No newline at end of file diff --git a/devtools/bin/robocopy.exe b/devtools/bin/robocopy.exe new file mode 100644 index 0000000..88b081b Binary files /dev/null and b/devtools/bin/robocopy.exe differ diff --git a/devtools/bin/run_unit_tests.pl b/devtools/bin/run_unit_tests.pl new file mode 100644 index 0000000..4b70292 --- /dev/null +++ b/devtools/bin/run_unit_tests.pl @@ -0,0 +1,137 @@ +#! perl + +use File::Find; +use Cwd; +use File::Basename; +use Getopt::Long; + + + +$last_errors=""; +$nosync = 0; +$mail = 0; +$daemon = 0; +$mailto="cgreen"; +$mailfrom="autotest"; +$ignoremutex = 0; + +$result = GetOptions( + "nosync" => \$nosync, + "daemon" => \$daemon, + "mailto:s" => \$mailto, + "mailfrom:s" => \$mailfrom, + "ignoremutex" => \$ignoremutex, + "mail" => \$mail ); + +$iter = 0; +while( 1 ) +{ + my $hasChange = 1; + my $mutex_held = 0; + unless($nosync) + { + # check for mutex held + unless( $ignoremutex || $nosync ) + { + open(MUTEX,"p4 counters|") || die "cant' run p4"; + while() + { + $mutex_held = 1 if ( /main_src_lock_\S+\s*=\s*1/); + } + close MUTEX; + } + unless( $mutex_held ) + { + print STDERR "Syncing...\n"; + system "p4 sync > sync.txt 2>&1"; + open SYNC, " ) + { + if( m/File\(s\) up-to-date/ ) + { + $hasChange = 0; + } + print; + } + close SYNC; + } + } + if ( $mutex_held ) + { + print STDERR "mutex held, waiting\n"; + } + else + { + if( $hasChange || ($iter == 0 ) ) + { + print "Running tests\n"; + &RunUnitTests; + } + else + { + print "no changes\n"; + } + $iter++; + last unless ($daemon); + } + sleep 30; +} + + + +sub RunUnitTests +{ + $error_output =""; + find(\&Visitfile,"."); + if ( length($error_output ) ) + { + print STDERR "errors detected\n"; + open CHANGES, "p4 changes -m 10 -s submitted //ValveGames/main/src/...|"; + my @changes = ; + close CHANGES; + + if ( $mail && ($error_output ne $last_errors ) ) + { + use Net::SMTP; + + $smtp = Net::SMTP->new('exchange2.valvesoftware.com'); + $smtp->mail($mailfrom); + $smtp->to($mailto); + + $smtp->data(); + $smtp->datasend("To: $mailto\n"); + $smtp->datasend("Subject: Errors from Unit tests\n"); + $smtp->datasend($error_output); + $smtp->datasend("-" x 75); + $smtp->datasend("\nLAST 10 SUBMITS TO MAIN:\n"); + $smtp->datasend(join("",@changes ) ); + $smtp->dataend(); + $smtp->quit; + } + } + $last_errors = $error_output; +} + +sub Visitfile + { + local($_)= $File::Find::name; + next unless( -e "test_error_reporting.pl" ); + if (/\.(pl|exe|bat)$/i) + { + unlink("errors.txt"); + my $extension=$1; + $extension=~tr/A-Z/a-z/; + my $cmd; + $cmd="perl $_" if ( $extension eq "pl"); + $cmd="$_" if ( $extension eq "exe"); + $cmd="$_" if ( $extension eq "bat"); + print STDERR "run $cmd: ",`$cmd`,"\n"; + if (open(ERRIN,"errors.txt" ) ) + { + local($/); + print STDERR "errors found!\n"; + $error_output.="* Failed test: $cmd: ".."\n"; + close ERRIN; + } + } +} diff --git a/devtools/bin/sed.exe b/devtools/bin/sed.exe new file mode 100644 index 0000000..db6416f Binary files /dev/null and b/devtools/bin/sed.exe differ diff --git a/devtools/bin/separate_vcprojs.py b/devtools/bin/separate_vcprojs.py new file mode 100644 index 0000000..59c7608 --- /dev/null +++ b/devtools/bin/separate_vcprojs.py @@ -0,0 +1,27 @@ + + +from vsdotnetxmlparser import * + + +#print f.GetAttribute( 'VisualStudioProject\\Configurations\\Configuration\\<2>Tool\\CommandLine' ) + + +WriteSeparateVCProj( LoadVCProj( 'cl_dll\\client.vcproj' ), ["Debug DoD|Win32", "Release DoD|Win32"], 'cl_dll\\client_dod.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'cl_dll\\client.vcproj' ), ["Debug CounterStrike|Win32", "Release CounterStrike|Win32"], 'cl_dll\\client_cs.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'cl_dll\\client.vcproj' ), ["Debug HL1|Win32", "Release HL1|Win32"], 'cl_dll\\client_hl1.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'cl_dll\\client.vcproj' ), ["Debug HL2|Win32", "Release HL2|Win32"], 'cl_dll\\client_hl2.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'cl_dll\\client.vcproj' ), ["Debug TF2|Win32", "Release TF2|Win32"], 'cl_dll\\client_tf2.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'cl_dll\\client.vcproj' ), ["Debug SDK|Win32", "Release SDK|Win32"], 'cl_dll\\client_temp_sdk.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'cl_dll\\client.vcproj' ), ["Debug HL2MP|Win32", "Release HL2MP|Win32"], 'cl_dll\\client_hl2mp.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'cl_dll\\client.vcproj' ), ["Debug Episodic HL2|Win32", "Release Episodic HL2|Win32"], 'cl_dll\\client_episodic.vcproj' ) + + +WriteSeparateVCProj( LoadVCProj( 'dlls\\hl.vcproj' ), ["Debug DoD|Win32", "Release DoD|Win32"], 'dlls\\hl_dod.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'dlls\\hl.vcproj' ), ["Debug CounterStrike|Win32", "Release CounterStrike|Win32"], 'dlls\\hl_cs.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'dlls\\hl.vcproj' ), ["Debug HL1|Win32", "Release HL1|Win32"], 'dlls\\hl_hl1.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'dlls\\hl.vcproj' ), ["Debug HL2|Win32", "Release HL2|Win32"], 'dlls\\hl_hl2.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'dlls\\hl.vcproj' ), ["Debug TF2|Win32", "Release TF2|Win32"], 'dlls\\hl_tf2.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'dlls\\hl.vcproj' ), ["Debug SDK|Win32", "Release SDK|Win32"], 'dlls\\hl_temp_sdk.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'dlls\\hl.vcproj' ), ["Debug HL2MP|Win32", "Release HL2MP|Win32"], 'dlls\\hl_hl2mp.vcproj' ) +WriteSeparateVCProj( LoadVCProj( 'dlls\\hl.vcproj' ), ["Debug Episodic HL2|Win32", "Release Episodic HL2|Win32"], 'dlls\\hl_episodic.vcproj' ) + diff --git a/devtools/bin/setup_vmpi.pl b/devtools/bin/setup_vmpi.pl new file mode 100644 index 0000000..63fe12e --- /dev/null +++ b/devtools/bin/setup_vmpi.pl @@ -0,0 +1,60 @@ + +# This script sets up VMPI. + +$pathToExes = "..\\..\\..\\game\\bin"; # assuming we're under hl2\src\devtools\bin. +my $baseNetworkPath = @ARGV[0]; + +if ( $baseNetworkPath ) +{ + my @filesToCopy = ( + "tier0.dll", + "vstdlib.dll", + "vmpi_service.exe", + "vmpi_service_ui.exe", + "vmpi_service_install.exe", + "WaitAndRestart.exe", + "vmpi_transfer.exe", + "filesystem_stdio.dll" ); + + # Verify that the files we're interested in exist. + foreach $filename ( @filesToCopy ) + { + my $fullFilename = "$pathToExes\\$filename"; + if ( !( -e $fullFilename ) ) + { + die "Missing $fullFilename.\n"; + } + } + + # Create the directories on the network. + if ( !( -e $baseNetworkPath ) ) + { + mkdir $baseNetworkPath or die "Can't create directory: $baseNetworkPath"; + } + + if ( !( -e "$baseNetworkPath\\services" ) ) + { + mkdir( "$baseNetworkPath\\services" ) or die "ERROR: Can't create directory: $baseNetworkPath\\services"; + } + + + # Now copy all the files up. + foreach $filename ( @filesToCopy ) + { + my $fullFilename = "$pathToExes\\$filename"; + `"copy $fullFilename $baseNetworkPath\\services"`; + } + + print "\n"; + print "Finished installing VMPI into $baseNetworkPath.\n\n"; + print "Have all available worker machines run:\n"; + print " $baseNetworkPath\\services\\vmpi_service_install.exe\n"; + print "to setup the worker service.\n"; +} +else +{ + print "setup_vmpi.pl \n"; + print "example: setup_vmpi.pl \\\\ftknox\\scratch\\vmpi\n"; +} + + diff --git a/devtools/bin/shaderinfo.pl b/devtools/bin/shaderinfo.pl new file mode 100644 index 0000000..57a8157 --- /dev/null +++ b/devtools/bin/shaderinfo.pl @@ -0,0 +1,36 @@ +#! perl + +my $fname=shift || die "format is shaderinfo blah.vcs"; + +open(SHADER, $fname) || die "can't open $fname"; +binmode SHADER; + +read(SHADER,$header,20); +($ver,$ntotal,$ndynamic,$flags,$centroidmask)=unpack("LLLLL",$header); + +#print "Version $ver total combos=$ntotal, num dynamic combos=$ndynamic,\n flags=$flags, centroid mask=$centroidmask\n"; + +read(SHADER,$refsize,4); +$refsize=unpack("L",$refsize); +#print "Size of reference shader for diffing=$refsize\n"; + +seek(SHADER,$refsize,1); + +$nskipped_combos=0; +for(1..$ntotal) + { + read(SHADER,$combodata,8); + ($ofs,$combosize)=unpack("LL",$combodata); + if ( $ofs == 0xffffffff) + { + $nskipped_combos++; + } + else + { + } + } +#print "$nskipped_combos skipped, for an actual total of ",$ntotal-$nskipped_combos,"\n"; +#print "Real to skipped ratio = ",($ntotal-$nskipped_combos)/$ntotal,"\n"; +# csv output - name, real combos, virtual combos, dynamic combos +my $real_combos=$ntotal-$nskipped_combos; +print "$fname,$real_combos,$ntotal,$ndynamic\n"; diff --git a/devtools/bin/signcode.exe b/devtools/bin/signcode.exe new file mode 100644 index 0000000..c84c55f Binary files /dev/null and b/devtools/bin/signcode.exe differ diff --git a/devtools/bin/smtpmail.exe b/devtools/bin/smtpmail.exe new file mode 100644 index 0000000..dd8ac1f Binary files /dev/null and b/devtools/bin/smtpmail.exe differ diff --git a/devtools/bin/splitdiff3.pl b/devtools/bin/splitdiff3.pl new file mode 100644 index 0000000..ccba3a9 --- /dev/null +++ b/devtools/bin/splitdiff3.pl @@ -0,0 +1,54 @@ +$infilename = shift; +$outfilename1 = shift; +$outfilename2 = shift; +open INPUT, $infilename || die; +@input = ; +close INPUT; + +open MERGEDMINE, ">$outfilename1" || die; +open MERGEDTHEIRS, ">$outfilename2" || die; + +for( $i = 0; $i < scalar( @input ); $i++ ) +{ + $line = $input[$i]; + + if( $line =~ m/^(.*)<<<<<<>>>>>>/ ) + { + $first = $second = 0; + print MERGEDTHEIRS $1; + next; + } + + if( $first ) + { + print MERGEDMINE $line; + } + elsif( $second ) + { + print MERGEDTHEIRS $line; + } + else + { + print MERGEDMINE $line; + print MERGEDTHEIRS $line; + } +} + +close MERGEDMINE; +close MERGEDTHEIRS; diff --git a/devtools/bin/srgb_colorspace.pl b/devtools/bin/srgb_colorspace.pl new file mode 100644 index 0000000..3c5404c --- /dev/null +++ b/devtools/bin/srgb_colorspace.pl @@ -0,0 +1,451 @@ + +# +# Arguments parsing +# + +local $script = $0; + +while ( 1 ) +{ + local $arg = shift; + if ( $arg =~ /-catsrgb1/i ) + { goto RUN_CAT_SRGB_1; } + if ( $arg =~ /-safecat/i ) + { goto RUN_SAFE_CAT; } + if ( $arg =~ /-delaywrite/i ) + { goto RUN_DELAY_WRITE; } + if ( $arg =~ /-processvmts/i ) + { goto RUN_PROCESS_VMTS; } + + # default mode - forward to processvmts: + # exit system( "dir" ); + exit system( "dir /s /b *.vmt | perl $script -processvmts" ); +} + + + + +RUN_CAT_SRGB_1: +# +# ----------- Adding "srgb 1" to options list -------- +# + +local $bAlreadyHasSrgb1 = 0; +while ( <> ) +{ + local $line = $_; + print $line; + $bAlreadyHasSrgb1 = 1 if $line =~ /srgb(.*)1/i; +} +print "\nsrgb 1\n" if !$bAlreadyHasSrgb1; +exit 0; + + + +RUN_DELAY_WRITE: +# +# ----------- Delay write to a file (essentially delayed shell redirection) ---- +# +local *fileptr; +local $filename = shift; + +local @lines; +while ( <> ) { push( @lines, $_ ); } + +open( fileptr, ">$filename" ); +foreach ( @lines ) { print fileptr $_ ; } +close( fileptr ); + +exit 0; + + + +RUN_SAFE_CAT: +# +# ----------- Cat of a non-existing file will succeed ---- +# +local *fileptr; +local $filename = shift; + +exit 1 if !open( fileptr, "<$filename" ); +while ( ) { print $_ ; } +close( fileptr ); + +exit 0; + + + + +RUN_PROCESS_VMTS: +# +# ----------- Processing the list of vmts ------------ +# + + +# +# Lookup array of directories under which to search for +# textures when resolving texture paths from vmt. +# +local @textureslookup = ( +# "u:/data/content/tf/", +# "u:/data/content/portal/", + +# "u:/data/content/ep2/", +# "u:/data/content/episodic/", + "u:/data/content/hl2/", +); + +# +# Mapping of shaders that require srgb conversion for +# basetextures. Entries listed lowercase, mapped to 1. +# +local %srgbshaders = ( + vertexlitgeneric => 1, + lightmappedgeneric => 1, + unlitgeneric => 1, + eyerefract => 1, + portalrefract => 1, + aftershock => 1, + sky => 1, + lightmappedreflective => 1, + portalstaticoverlay => 1, + particlesphere => 1, + shatteredglass => 1, + sprite => 1, + spritecard => 1, + teeth => 1, + treeleaf => 1, + vortwarp => 1, + water => 1, + windowimposter => 1, + worldtwotextureblend => 1, + worldvertexalpha => 1, +); + +# +# Mapping of variables that we will be looking for. +# +local %shadervarscheck = ( + basetexture => 1, + basetexture2 => 1, + basetexture3 => 1, + basetexture4 => 1, + envmap => 1, + iris => 1, + ambientoccltexture => 1, + refracttinttexture => 1, + albedo => 1, + compress => 1, + stretch => 1, + emissiveblendbasetexture => 1, + emissiveblendtexture => 1, + fleshinteriortexture => 1, + fleshbordertexture1d => 1, + fleshsubsurfacetexture => 1, + fleshcubetexture => 1, + texture2 => 1, + hdrcompressedtexture => 1, + hdrcompressedtexture0 => 1, + hdrcompressedtexture1 => 1, + hdrcompressedtexture2 => 1, + portalcolortexture => 1, + monitorscreen => 1, + staticblendtexture => 1, + refracttexture => 1, + reflecttexture => 1, +); + +# +# After parsing the list of vmt files contains a map of +# texture names as keys to the list of two elements: +# [0] +# 0: texture is non-srgb +# 1: texture is srgb and needs conversion +# -1: texture is ambiguous +# [1] +# list of vmts referring to the texture +# +local %textures2convert; + + +# +# Parse our list of vmt files +# Generate the list with "dir /s /b *.vmt" +# +while ( <> ) +{ + + local $fname = $_; + $fname =~ s/^\s*(.*)\s*$/$1/; + $fname =~ s/\\/\//g; +# print "-" . $fname . "-\n"; + + # Open the file + local *vmtfileptr; + open( vmtfileptr, "<$fname" ) || die; + + local $line; + local $shadername; + local %basetexture; + local $basetexture_real; + local $basetexture_blacklisted = 0; + + # Find shadername and textures + while ( $line = ) + { + $line =~ s/^\s*(.*)\s*$/$1/; + $line = lc( $line ); + + if ( $. == 1 ) + { + $shadername = $line; + $shadername =~ s/\"//g; + } + + while ( ( $varname, undef ) = each %shadervarscheck ) + { + next if $line !~ /^\s*["]?\$$varname["]?\s+(.*)$/i; + + $line = $1; + if ( $line =~ /^\"([^\"])*\"(.*)$/ ) { + $line =~ s/^\"([^\"]*)\"(.*)$/$1/; + } else { + $line =~ s/^(\S*)(.*)$/$1/; + } + $line =~ s/^\s*(.*)\s*$/$1/; + $line =~ s/\\/\//g; + + next if $line =~ /^\_rt/i; + + $basetexture{ $line } = 1; + $basetexture_real = $line if $varname =~ /^basetexture$/i; + last; + } + + # blacklist stuff + $basetexture_blacklisted = 1 if $line =~ /^\s*["]?\$extractgreenalpha["]?\s*(.*)$/i; + print ">>> $fname blacklisted by >>> $line >>>\n" if $line =~ /^\s*["]?\$extractgreenalpha["]?\s*(.*)$/i; + } + + delete $basetexture{ $basetexture_real } if $basetexture_blacklisted; + print ">>> blacklisted texture: $basetexture_real .\n" if $basetexture_blacklisted; + delete $basetexture{ "env_cubemap" }; + + close vmtfileptr; + + # Print the shader and the base texture +# print "\tshader = " . $shadername . "\n"; +# foreach ( keys %basetexture ) { print "\ttexture = " . $_ . "\n" }; + + # If the texture needs a conversion stick it into the map + local $isSrgb = 1; #--shadercheck--( exists $srgbshaders{ $shadername } ? 1 : 0 ); + + foreach ( keys %basetexture ) + { + local $basetexture = $_; + if ( exists $textures2convert{ $basetexture } ) + { + # Check for validity + $isSrgb = -1 if $textures2convert{ $basetexture }->[0] != $isSrgb; + } + else + { + $textures2convert{ $basetexture } = [ $isSrgb, [] ]; + } + + $textures2convert{ $basetexture }->[0] = $isSrgb; + push( @{ $textures2convert{ $basetexture }->[1] }, $fname ); + } + +} + + +# +# Now walk over the accumulated textures and establish the srgb mapping +# +local @failedtextures; +while ( ( $basetexture, $value ) = each %textures2convert ) +{ + + local $isSrgb = $value->[0]; + + if ( -1 == $isSrgb ) + { + print "Warning: Ambiguity for "; + print "$basetexture from "; + foreach ( @{ $value->[1] } ) { print " $_"; }; + print "!\n"; + } + + next if 1 != $isSrgb; + + # + # Need to convert this texture + # + local $res = ConvertTexture( $basetexture ); + push( @failedtextures, $basetexture ) if !$res; + +} + +# Dump failed textures +if ( $#failedtextures > 0 ) +{ + print "\n---- errors ----\n"; + foreach ( @failedtextures ) + { + local $basetexture = $_; + print "ERROR: $basetexture in "; + foreach ( @{ $textures2convert{ $basetexture }->[1] } ) { print " $_"; } + print ";\n"; + } + print "---- end ----\n"; +} + + +# +# Converts a texture. +# Returns 1 for txt, 2 for psd, 3 for newly created txt. +# Returns 0 when nothing found. +# +sub ConvertTexture +{ + + local $basetexture = shift; + local $result = 0; + print "-- $basetexture ... "; + + foreach ( @textureslookup ) + { + # Try to open the txt file + local $txpath = $_ . "materialsrc/" . $basetexture; + if ( -f "$txpath.txt" || -f "$txpath.tga" ) + { + # Check it out + print "txt, p4 ... "; + `p4 edit "$txpath.txt" >nul 2>&1`; + `p4 lock "$txpath.txt" >nul 2>&1`; + + `perl $script -safecat "$txpath.txt" | perl $script -catsrgb1 | perl $script -delaywrite "$txpath.txt"`; + + `p4 add "$txpath.txt" >nul 2>&1` if -f "$txpath.txt"; + + # Also patch the VTF + $txpath =~ s,/content/,/game/,; + $txpath =~ s,/materialsrc/,/materials/,; + #PatchVtfFile( "$txpath.vtf" ); + + print "done ... "; + ++ $result; + } + if ( -f "$txpath.psd" ) + { + # Check it out + print "psd, p4 ... "; + `p4 edit "$txpath.psd" >nul 2>&1`; + `p4 lock "$txpath.psd" >nul 2>&1`; + + `psdinfo -read "$txpath.psd" | perl $script -catsrgb1 | psdinfo -write "$txpath.psd"`; + + `p4 add "$txpath.psd" >nul 2>&1`; + + # Also patch the VTF + $txpath =~ s,/content/,/game/,; + $txpath =~ s,/materialsrc/,/materials/,; + #PatchVtfFile( "$txpath.vtf" ); + + print "done ... "; + ++ $result; + } + } + + foreach ( @textureslookup ) + { + # Try to find the vtf file + local $txpath = $_ . "materials/" . $basetexture; + $txpath =~ s,/content/,/game/,i; + if ( -f "$txpath.vtf" ) + { + if ( !$result ) + { + # Create the text file then + print "src missing ... "; + $txpath =~ s,/game/,/content/,,i; + $txpath =~ s,/materials/,/materialsrc/,; + + `p4 edit "$txpath.txt" >nul 2>&1`; + `p4 lock "$txpath.txt" >nul 2>&1`; + + `perl $script -safecat "$txpath.txt" | perl $script -catsrgb1 | perl $script -delaywrite "$txpath.txt"`; + + `p4 add "$txpath.txt" >nul 2>&1` if -f "$txpath.txt"; + + # Also patch the VTF + $txpath =~ s,/content/,/game/,; + $txpath =~ s,/materialsrc/,/materials/,; + } + PatchVtfFile( "$txpath.vtf" ); + + print "done ... "; + ++ $result; + } + } + + if ( !$result ) + { + print "ERROR: not found.\n"; + } + else + { + print "ok.\n"; + } + return $result; + +} + +exit 0; + + +RUN_PATCH_VTF: +# +# ----------- Patch a VTF file -------- +# + +local $filename = shift; +exit PatchVtfFile( $filename ); + +sub PatchVtfFile +{ + + local *fileptr; + local $filename = shift; + local $vtfFlags; + + print "vtf, p4 ... "; + `p4 edit "$filename" >nul 2>&1`; + `p4 lock "$filename" >nul 2>&1`; + + if ( !open( fileptr, "+<$filename" ) ) + { + print "VTF missing ... "; + return 1; + } + binmode( fileptr ); + + seek( fileptr, 5 * 4, 0 ); + read( fileptr, $vtfFlags, 4 ); + $vtfFlags = unpack( "I", $vtfFlags ); + + # adding SRGB flag + $vtfFlags = $vtfFlags | 0x00000040; # mask or + + seek( fileptr, 5 * 4, 0 ); + print fileptr pack( "I", $vtfFlags ); + + close( fileptr ); + + print "vtf ok ... "; + return 0; + +} + + diff --git a/devtools/bin/sscode.exe b/devtools/bin/sscode.exe new file mode 100644 index 0000000..02bbb12 Binary files /dev/null and b/devtools/bin/sscode.exe differ diff --git a/devtools/bin/steamlicense.txt b/devtools/bin/steamlicense.txt new file mode 100644 index 0000000..cafa009 --- /dev/null +++ b/devtools/bin/steamlicense.txt @@ -0,0 +1,14 @@ +"Universe" +{ + "Public" + { + "Keys" + { + "CodeSignature" + { + "EncryptedPrivateKey" "6DA7F10F1B16A4012FFDE4BB09B857A8E3254573CDE9C0E91B12AEF01E8B1624FB8606058946D7D45AEE3C73EE69F6BC30CE703D25ACAC7C96DC5A87EB8DE6B2820AF5BDD5835E3BBA8C6BF679595323212E82E1BCEF57EAF06338084D3E0592F7B9A6F1BBE752947F72BC80C4A50493F7ECBA39FD73CF02BBEFF407BFCD9D956E0F337D4A68D82998979BD11409BC2A908580DB2DB3FECB96D1F95DB4C28E50900B0413D02D5073E669B54A090F5B19CA6B8A918B81CEC7EEF105E181235713B8BE293E149CF6F3CBA0AAC96B6017ECC51B00C31526F357CCD3F5889FC5895C3787399AE22CCA53B3AADEBC2D1FE3A6C1D628A0CF8D68808A08BDADA904555613B00889CD4A59F1B42FC88ACEE2C350CB4EA12B8A9CD3CE16A7E4832817D2A4C7B420AFC3BC3596513B4E3690508848AF55D83693E30199E97A42467B24585DEA5C6311D94BDE922FD7795B434D6ACCB544A04E290D3D944727D35C1A9478F33E82D3C6B97EE615FAFD0A82CCCB65EABD07580630FA6C654631695B5A0F1B9AD1E86297499E1DDC992D82D782B67AA809B8102780327A7DB4EB56FBA0FB5614D65E88A88BF322CE21DB5651CBABB0A01DAC97F78E1A92EA3CF5C2EA23A4921264137F2CCE3417857FD93347BD9C46EFD89E0016912BD7ED807252EEF43C88573EE3D66F345E55B185A9372D0A84DF574895EC4D2BF4572A1D1250D6BAB76C528B17957DA67201331C3CE20D255C2A01CA704E05F65FA9DFCF498B84F3E4E0C3D42F9D6FDAC0DD5708512F609FFF6290BEA8B00B758474E03391C475E376DD3A4586939E08454D293BF3D365D8472AF36125008630BE95339D893BF061E178CC46BC0BEB6D8420BF366E612718D4C30F39B6276DBE155F744A88663E2BAE53DC83B5BF60704BEAF9002EE1AB64E5E644" + "PublicKey" "30819D300D06092A864886F70D010101050003818B0030818702818100B1260881BDFE84463D88C6AB8DB914A2E593893C10508B8A5ABDF692E9A5419A3EDBAE86A052849983B75E3B425C18178B260003D857DF0B6505C6CF9C84F5859FCE3B63F1FB2D4818501F6C5FA4AD1430EEB081A74ABD74CD1F4AA1FCCA3B88DD0548AED34443CEB52444EAE9099AA4FE66B2E6224D02381C248025C7044079020111" + } + } + } +} diff --git a/devtools/bin/tee.exe b/devtools/bin/tee.exe new file mode 100644 index 0000000..7b32b2a Binary files /dev/null and b/devtools/bin/tee.exe differ diff --git a/devtools/bin/test_binaries.exe b/devtools/bin/test_binaries.exe new file mode 100644 index 0000000..0bd7b0c Binary files /dev/null and b/devtools/bin/test_binaries.exe differ diff --git a/devtools/bin/test_linux_compile.pl b/devtools/bin/test_linux_compile.pl new file mode 100644 index 0000000..b04d2bb --- /dev/null +++ b/devtools/bin/test_linux_compile.pl @@ -0,0 +1,64 @@ +#perl + +#! perl + +use Getopt::Long; + +$mail = 1; +$mailto="cgreen"; +$mailfrom="cgreen\@valvesoftware.com"; +$branch="main"; + + +$result = GetOptions( + "nosync" => \$nosync, + "clean" => \$clean, + "mailto:s" => \$mailto, + "branch:s" => \$branch, + "mailfrom:s" => \$mailfrom, + "mail" => \$mail ); + +print STDERR `p4 sync` unless ($nosync); +print STDERR `perl devtools/bin/vpc2linuxmake.pl`; +print STDERR `make clean` if ($clean); + +open(ERROROUT, "./linux_makeinorder.sh 2>&1 |" ) || die "can't create pipe to compile"; +while() + { + my $iserror = /error:/; + $iserror = 1 if (/^.*:\d+:\d+:/); + $errtxt .= $_ if ($iserror ); + print $_; + } +if (length($errtxt) ) + { + if ($mail) + { + use Net::SMTP; + + open CHANGES, "p4 changes -m 10 -s submitted //ValveGames/$branch/src/...|"; + my @changes = ; + close CHANGES; + + $smtp = Net::SMTP->new('exchange2.valvesoftware.com'); + $smtp->mail($mailfrom); + $smtp->to($mailto); + + $smtp->data(); + $smtp->datasend("To: $mailto\n"); + $smtp->datasend("Subject: [$branch broken in linux]\n"); + $smtp->datasend("\nThere are errors building $branch for linux.\nSome help is available at http://intranet.valvesoftware.com/wiki/index.php/Writing_code_that_is_compatible_between_gcc_and_visual_studio\n\n$errtxt"); + $smtp->datasend("-" x 75); + $smtp->datasend("\nLAST 10 SUBMITS TO MAIN:\n"); + $smtp->datasend(join("",@changes ) ); + $smtp->dataend(); + $smtp->quit; + } + else + { + print STDERR "*****ERRORS****\n$errtxt\n"; + } + } + + + diff --git a/devtools/bin/timeprecise.exe b/devtools/bin/timeprecise.exe new file mode 100644 index 0000000..93371e0 Binary files /dev/null and b/devtools/bin/timeprecise.exe differ diff --git a/devtools/bin/timethis.exe b/devtools/bin/timethis.exe new file mode 100644 index 0000000..45b5179 Binary files /dev/null and b/devtools/bin/timethis.exe differ diff --git a/devtools/bin/uniqexe.exe b/devtools/bin/uniqexe.exe new file mode 100644 index 0000000..4164b29 Binary files /dev/null and b/devtools/bin/uniqexe.exe differ diff --git a/devtools/bin/uniqifylist.pl b/devtools/bin/uniqifylist.pl new file mode 100644 index 0000000..1c3fd9c --- /dev/null +++ b/devtools/bin/uniqifylist.pl @@ -0,0 +1,6 @@ +foreach $_ (sort <> ) +{ + next if( defined( $prevline ) && $_ eq $prevline ); + $prevline = $_; + print; +} diff --git a/devtools/bin/updatecef.bat b/devtools/bin/updatecef.bat new file mode 100644 index 0000000..5e296f9 --- /dev/null +++ b/devtools/bin/updatecef.bat @@ -0,0 +1,14 @@ +rem script to update libcef from Steam/main to this project +rem brings over all the dll's and import libraries and support libraries plus updates the header files +rem run this, then resolve the changelist in perforce and submit +SET SRCDIR=//Steam/main +SET PUBLISH_SCRIPT=//thirdpartycode/nonredist/chromeemb/dev/publish_cef_to_steam.py + +rem Resolve this to an absolute path +pushd %~dp0..\..\.. +SET DSTDIR=%CD% +popd + +p4 print -q -o "%TMP%\publish.py" %PUBLISH_SCRIPT% +python "%TMP%\publish.py" --game=tf2 "%DSTDIR%" "%SRCDIR%" +p4 merge %SRCDIR%/client/bin/icudt.dll %DSTDIR%/game/bin/icudt.dll diff --git a/devtools/bin/updatecef.sh b/devtools/bin/updatecef.sh new file mode 100644 index 0000000..27ced7b --- /dev/null +++ b/devtools/bin/updatecef.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Bash script to update libcef from Steam/main to this project +# brings over all the dll's and import libraries and support libraries plus updates the header files +# run this, then resolve the changelist in perforce and submit + +SRCDIR=//Steam/main +PUBLISH_SCRIPT=//thirdpartycode/nonredist/chromeemb/dev/publish_cef_to_steam.py +DSTDIR="$(cd $(dirname "$0")/../../.. && echo $PWD)" + +p4 print -q $PUBLISH_SCRIPT | python - --game=tf2 "$DSTDIR" "$SRCDIR" +p4 merge $SRCDIR/client/bin/icudt.dll $DSTDIR/game/bin/icudt.dll diff --git a/devtools/bin/updateshaders.pl b/devtools/bin/updateshaders.pl new file mode 100644 index 0000000..93f57ff --- /dev/null +++ b/devtools/bin/updateshaders.pl @@ -0,0 +1,305 @@ +use String::CRC32; +BEGIN {use File::Basename; push @INC, dirname($0); } +require "valve_perl_helpers.pl"; + +$dynamic_compile = defined $ENV{"dynamic_shaders"} && $ENV{"dynamic_shaders"} != 0; + +$depnum = 0; +$baseSourceDir = "."; + +my %dep; + +sub GetAsmShaderDependencies_R +{ + local( $shadername ) = shift; + local( *SHADER ); + + open SHADER, "<$shadername"; + while( ) + { + if( m/^\s*\#\s*include\s+\"(.*)\"/ ) + { + # make sure it isn't in there already. + if( !defined( $dep{$1} ) ) + { + $dep{$1} = 1; + GetAsmShaderDependencies_R( $1 ); + } + } + } + close SHADER; +} + +sub GetAsmShaderDependencies +{ + local( $shadername ) = shift; + undef %dep; + GetAsmShaderDependencies_R( $shadername ); +# local( $i ); +# foreach $i ( keys( %dep ) ) +# { +# print "$shadername depends on $i\n"; +# } + return keys( %dep ); +} + +sub GetShaderType +{ + my $shadername = shift; + my $shadertype; + if( $shadername =~ m/\.vsh/i ) + { + $shadertype = "vsh"; + } + elsif( $shadername =~ m/\.psh/i ) + { + $shadertype = "psh"; + } + elsif( $shadername =~ m/\.fxc/i ) + { + $shadertype = "fxc"; + } + else + { + die; + } + return $shadertype; +} + +sub GetShaderSrc +{ + my $shadername = shift; + if ( $shadername =~ m/^(.*)-----/i ) + { + return $1; + } + else + { + return $shadername; + } +} + +sub GetShaderBase +{ + my $shadername = shift; + if ( $shadername =~ m/-----(.*)$/i ) + { + return $1; + } + else + { + my $shadertype = &GetShaderType( $shadername ); + $shadername =~ s/\.$shadertype//i; + return $shadername; + } +} + +sub DoAsmShader +{ + my $argstring = shift; + my $shadername = &GetShaderSrc( $argstring ); + my $shaderbase = &GetShaderBase( $argstring ); + my $shadertype = &GetShaderType( $argstring ); + my $incfile = ""; + if( $shadertype eq "fxc" || $shadertype eq "vsh" ) + { + $incfile = $shadertype . "tmp9" . $g_tmpfolder . "\\$shaderbase.inc "; + } + + my $vcsfile = $shaderbase . $g_vcsext; + my $bWillCompileVcs = 1; + if( ( $shadertype eq "fxc") && $dynamic_compile ) + { + $bWillCompileVcs = 0; + } + if( $shadercrcpass{$argstring} ) + { + $bWillCompileVcs = 0; + } + + if( $bWillCompileVcs ) + { + &output_makefile_line( $incfile . "shaders\\$shadertype\\$vcsfile: $shadername @dep\n") ; + } + else + { + # psh files don't need a rule at this point since they don't have inc files and we aren't compiling a vcs. + if( $shadertype eq "fxc" || $shadertype eq "vsh" ) + { + &output_makefile_line( $incfile . ": $shadername @dep\n") ; + } + } + + + my $x360switch = ""; + my $moreswitches = ""; + if( !$bWillCompileVcs && $shadertype eq "fxc" ) + { + $moreswitches .= "-novcs "; + } + if( $g_x360 ) + { + $x360switch = "-x360"; + + if( $bWillCompileVcs && ( $shaderbase =~ m/_ps20$/i ) ) + { + $moreswitches .= "-novcs "; + $bWillCompileVcs = 0; + } + } + + # if we are psh and we are compiling the vcs, we don't need this rule. + if( !( $shadertype eq "psh" && !$bWillCompileVcs ) ) + { + &output_makefile_line( "\tperl $g_SourceDir\\devtools\\bin\\" . $shadertype . "_prep.pl $moreswitches $x360switch -source \"$g_SourceDir\" $argstring\n") ; + } + + if( $bWillCompileVcs ) + { + &output_makefile_line( "\techo $shadername>> filestocopy.txt\n") ; + my $dep; + foreach $dep( @dep ) + { + &output_makefile_line( "\techo $dep>> filestocopy.txt\n") ; + } + } + &output_makefile_line( "\n") ; +} + +if( scalar( @ARGV ) == 0 ) +{ + die "Usage updateshaders.pl shaderprojectbasename\n\tie: updateshaders.pl stdshaders_dx6\n"; +} + +$g_x360 = 0; +$g_tmpfolder = "_tmp"; +$g_vcsext = ".vcs"; + +while( 1 ) +{ + $inputbase = shift; + + if( $inputbase =~ m/-source/ ) + { + $g_SourceDir = shift; + } + elsif( $inputbase =~ m/-x360/ ) + { + $g_x360 = 1; + $g_tmpfolder = "_360_tmp"; + $g_vcsext = ".360.vcs"; + } + elsif( $inputbase =~ m/-execute/ ) + { + $g_execute = 1; + } + elsif( $inputbase =~ m/-nv3x/ ) + { + $nv3x = 1; + } + else + { + last; + } +} + +my @srcfiles = &LoadShaderListFile( $inputbase ); + +open MAKEFILE, ">makefile\.$inputbase"; +open COPYFILE, ">makefile\.$inputbase\.copy"; +open INCLIST, ">inclist.txt"; +open VCSLIST, ">vcslist.txt"; + +# make a default dependency that depends on all of the shaders. +&output_makefile_line( "default: ") ; +foreach $shader ( @srcfiles ) +{ + my $shadertype = &GetShaderType( $shader ); + my $shaderbase = &GetShaderBase( $shader ); + my $shadersrc = &GetShaderSrc( $shader ); + if( $shadertype eq "fxc" || $shadertype eq "vsh" ) + { + # We only generate inc files for fxc and vsh files. + my $incFileName = "$shadertype" . "tmp9" . $g_tmpfolder . "\\" . $shaderbase . "\.inc"; + &output_makefile_line( " $incFileName" ); + &output_inclist_line( "$incFileName\n" ); + } + + my $vcsfile = $shaderbase . $g_vcsext; + + my $compilevcs = 1; + if( $shadertype eq "fxc" && $dynamic_compile ) + { + $compilevcs = 0; + } + if( $g_x360 && ( $shaderbase =~ m/_ps20$/i ) ) + { + $compilevcs = 0; + } + if( $compilevcs ) + { + my $vcsFileName = "..\\..\\..\\game\\hl2\\shaders\\$shadertype\\$shaderbase" . $g_vcsext; + # We want to check for perforce operations even if the crc matches in the event that a file has been manually reverted and needs to be checked out again. + &output_vcslist_line( "$vcsFileName\n" ); + $shadercrcpass{$shader} = &CheckCRCAgainstTarget( $shadersrc, $vcsFileName, 0 ); + if( $shadercrcpass{$shader} ) + { + $compilevcs = 0; + } + } + if( $compilevcs ) + { + &output_makefile_line( " shaders\\$shadertype\\$vcsfile" ); + # emit a list of vcs files to copy to the target since we want to build them. + &output_copyfile_line( GetShaderSrc($shader) . "-----" . GetShaderBase($shader) . "\n" ); + } +} +&output_makefile_line( "\n\n") ; + +# Insert all of our vertex shaders and depencencies +$lastshader = ""; +foreach $shader ( @srcfiles ) +{ + my $currentshader = &GetShaderSrc( $shader ); + if ( $lastshader ne $currentshader ) + { + $lastshader = $currentshader; + @dep = &GetAsmShaderDependencies( $lastshader ); + } + &DoAsmShader( $shader ); +} +close VCSLIST; +close INCLIST; +close COPYFILE; +close MAKEFILE; + +# nuke the copyfile if it is zero length +if( ( stat "makefile\.$inputbase\.copy" )[7] == 0 ) +{ + unlink "makefile\.$inputbase\.copy"; +} + +sub output_makefile_line +{ + local ($_)=@_; + print MAKEFILE $_; +} + +sub output_copyfile_line +{ + local ($_)=@_; + print COPYFILE $_; +} + +sub output_vcslist_line +{ + local ($_)=@_; + print VCSLIST $_; +} + +sub output_inclist_line +{ + local ($_)=@_; + print INCLIST $_; +} + diff --git a/devtools/bin/valve_p4_create_changelist.cmd b/devtools/bin/valve_p4_create_changelist.cmd new file mode 100644 index 0000000..2fe364a --- /dev/null +++ b/devtools/bin/valve_p4_create_changelist.cmd @@ -0,0 +1,65 @@ +@echo off + +:: // This will make all new env variables local to this script +setlocal + +:: // Make sure we have 2 args +if .%2.==.. ( + echo *** [valve_p4_create_changelist] Error calling command! No file or changelist specified for checkout! Usage: valve_p4_create_changelist.cmd fileOrPath "Description" + endlocal + exit /b 1 +) + +:: // Get file info +set valveTmpPathOnly="%~d1%~p1" +if "%valveTmpPathOnly%"=="" ( + echo *** [valve_p4_create_changelist] Error! Can't parse file or path "%1"! + endlocal + exit /b 1 +) + +:: // Change directories so that the p4 set commands give use useful data +pushd %valveTmpPathOnly% + +:: // Find user +for /f "tokens=2 delims== " %%A in ('p4 set ^| find /i "P4USER="') do set valveP4User=%%A +if "%valveP4User%"=="" goto RegularCheckout +rem //echo User="%valveP4User%" + +:: // Find client +for /f "tokens=2 delims== " %%A in ('p4 set ^| find /i "P4CLIENT="') do set valveP4Client=%%A +if "%valveP4Client%"=="" goto RegularCheckout +rem //echo Client="%valveP4Client%" + +:: // Search for existing changelist that matches command line arg +set valveP4ChangelistName=%2% +set valveP4ChangelistName=%valveP4ChangelistName:~1,-1% +for /f "tokens=2 delims= " %%A in ('p4 changes -u %valveP4User% -s pending -c %valveP4Client% ^| sort /r ^| find /i "'%valveP4ChangelistName%"') do set valveP4ChangelistNumber=%%A +if NOT "%valveP4ChangelistNumber%"=="" goto HaveChangelist + +:: // We didn't find a matching changelist but we did figure enough out to create a new changelist +rem //echo Creating New Changelist +for /f "tokens=2 delims= " %%A in ('^( echo Change: new ^& echo Client: %valveP4Client% ^& echo User: %valveP4User% ^& echo Status: new ^& echo Description: %valveP4ChangelistName%^&echo.^) ^| p4 change -i') do set valveP4ChangelistNumberJustCreated=%%A +if "%valveP4ChangelistNumberJustCreated%"=="" goto RegularCheckout + +:: // Now search for the changelist number even though we already have it to try to clean up after the race condition when it's hit +:: // This way, if more than one changelist is created in parallel, this will hopefully cause them to be checked out into the same changelist and the empty one deleted +for /f "tokens=2 delims= " %%A in ('p4 changes -u %valveP4User% -s pending -c %valveP4Client% ^| sort /r ^| find /i "'%valveP4ChangelistName%"') do set valveP4ChangelistNumber=%%A +if "%valveP4ChangelistNumber%"=="" goto RegularCheckout + +if NOT "%valveP4ChangelistNumber%"=="%valveP4ChangelistNumberJustCreated%" p4 change -d %valveP4ChangelistNumberJustCreated% 2>&1 >nul + +:: // We have a changelist number +:HaveChangelist +echo %valveP4ChangelistNumber% +goto End + +:: // Can't find or create the changelist, output 0 +:RegularCheckout +echo 0 +goto End + +:End +popd +endlocal +exit /b 0 diff --git a/devtools/bin/valve_p4_edit_to_changelist.cmd b/devtools/bin/valve_p4_edit_to_changelist.cmd new file mode 100644 index 0000000..5c8c2ea --- /dev/null +++ b/devtools/bin/valve_p4_edit_to_changelist.cmd @@ -0,0 +1,99 @@ +@echo off + +:: // This will make all new env variables local to this script +setlocal + +:: // If called with the start command, we need to exit, so also make sure you pass EXIT as the third param! +:: // Also, if you modify this script, make sure that endlocal and exit are within ()'s so valveExitArg works! +:: // Type 'help set' at a command prompt if you don't understand why. +if NOT "%3"=="EXIT" set valveExitArg=/b + +:: // Make sure we have 2 args +if .%2.==.. ( + echo *** [valve_p4_edit_to_changelist] Error calling command! No file or changelist specified for checkout! Usage: valve_p4_edit_to_changelist.cmd file "Description" [EXIT] + endlocal + exit %valveExitArg% 1 +) + +:: // Get file info +set valveTmpFileName="%~n1%~x1" +set valveTmpFullFilePath="%~f1" +set valveTmpPathOnly="%~d1%~p1" + +if "%valveTmpFileName%"=="" ( + echo *** [valve_p4_edit_to_changelist] Error! Can't parse filename "%1"! + endlocal + exit %valveExitArg% 1 +) + +if "%valveTmpFullFilePath%"=="" ( + echo *** [valve_p4_edit_to_changelist] Error! Can't parse filename "%1"! + endlocal + exit %valveExitArg% 1 +) + +if "%valveTmpPathOnly%"=="" ( + echo *** [valve_p4_edit_to_changelist] Error! Can't parse filename "%1"! + endlocal + exit %valveExitArg% 1 +) + +:: // Change directories so that the p4 set commands give use useful data +pushd %valveTmpPathOnly% + +:: // Find user +for /f "tokens=2 delims== " %%A in ('p4 set ^| find /i "P4USER="') do set valveP4User=%%A +if "%valveP4User%"=="" goto RegularCheckout +rem //echo User="%valveP4User%" + +:: // Find client +for /f "tokens=2 delims== " %%A in ('p4 set ^| find /i "P4CLIENT="') do set valveP4Client=%%A +if "%valveP4Client%"=="" goto RegularCheckout +rem //echo Client="%valveP4Client%" + +:: // Search for existing changelist that matches command line arg +set valveP4ChangelistName=%2% +set valveP4ChangelistName=%valveP4ChangelistName:~1,-1% +for /f "tokens=2 delims= " %%A in ('p4 changes -u %valveP4User% -s pending -c %valveP4Client% ^| sort /r ^| find /i "'%valveP4ChangelistName%"') do set valveP4ChangelistNumber=%%A +if NOT "%valveP4ChangelistNumber%"=="" goto HaveChangelist + +:: // We didn't find a matching changelist but we did figure enough out to create a new changelist +rem //echo Creating New Changelist +for /f "tokens=2 delims= " %%A in ('^( echo Change: new ^& echo Client: %valveP4Client% ^& echo User: %valveP4User% ^& echo Status: new ^& echo Description: %valveP4ChangelistName%^&echo.^) ^| p4 change -i') do set valveP4ChangelistNumberJustCreated=%%A +if "%valveP4ChangelistNumberJustCreated%"=="" goto RegularCheckout + +:: // Now search for the changelist number even though we already have it to try to clean up after the race condition when it's hit +:: // This way, if more than one changelist is created in parallel, this will hopefully cause them to be checked out into the same changelist and the empty one deleted +for /f "tokens=2 delims= " %%A in ('p4 changes -u %valveP4User% -s pending -c %valveP4Client% ^| sort /r ^| find /i "'%valveP4ChangelistName%"') do set valveP4ChangelistNumber=%%A +if "%valveP4ChangelistNumber%"=="" goto RegularCheckout + +if NOT "%valveP4ChangelistNumber%"=="%valveP4ChangelistNumberJustCreated%" p4 change -d %valveP4ChangelistNumberJustCreated% 2>&1 >nul + +:: // We have a changelist number +:HaveChangelist +set valveP4ChangelistArg=-c %valveP4ChangelistNumber% +rem //echo valveP4ChangelistArg="%valveP4ChangelistArg%" +rem //echo ChangelistNumber="%valveP4ChangelistNumber%" +rem //echo ChangelistName="%valveP4ChangelistName%" + +:: // Check the file out +:RegularCheckout +SET SEDPATH=%~dp0sed.exe +rem The sed command replaces '//' with the empty string and replaces '...' with '---' +rem This is necessary so that VS will not interpret "//source2/main" or "... source2/main" as +rem a path. Interpreting it as a path means that pressing F8 in the VS error window will stop on +rem these output lines, which is a nuisance when looking for real errors and warnings, and it means +rem that VS will try to open \\source2\main\... which will often cause a 2-3 second hang! +if "%VALVE_WAIT_ON_P4%"=="" ( + p4 edit %valveP4ChangelistArg% %valveTmpFullFilePath% 2>&1 | %SEDPATH% -e s!//!! -e s!\.\.\.!---! | find /v /i "- currently opened for edit" | find /v /i "- also opened by" | find /v /i "- file(s) not on client" | find /v /i "- can't change from" +) ELSE ( + :: // Filter out largely benign messages unless we're explicitly waiting on p4 results a la buildbot + p4 edit %valveP4ChangelistArg% %valveTmpFullFilePath% 2>&1 | %SEDPATH% -e s!//!! -e s!\.\.\.!---! | find /v /i "- also opened by" +) + +goto End + +:End +popd +( endlocal + exit %valveExitArg% 0 ) diff --git a/devtools/bin/valve_perl_helpers.pl b/devtools/bin/valve_perl_helpers.pl new file mode 100644 index 0000000..9257767 --- /dev/null +++ b/devtools/bin/valve_perl_helpers.pl @@ -0,0 +1,558 @@ +sub BackToForwardSlash +{ + my( $path ) = shift; + $path =~ s,\\,/,g; + return $path; +} + +sub RemoveFileName +{ + my( $in ) = shift; + $in = &BackToForwardSlash( $in ); + $in =~ s,/[^/]*$,,; + return $in; +} + +sub RemovePath +{ + my( $in ) = shift; + $in = &BackToForwardSlash( $in ); + $in =~ s,^(.*)/([^/]*)$,$2,; + return $in; +} + +sub MakeDirHier +{ + my( $in ) = shift; +# print "MakeDirHier( $in )\n"; + $in = &BackToForwardSlash( $in ); + my( @path ); + while( $in =~ m,/, ) # while $in still has a slash + { + my( $end ) = &RemovePath( $in ); + push @path, $end; +# print $in . "\n"; + $in = &RemoveFileName( $in ); + } + my( $i ); + my( $numelems ) = scalar( @path ); + my( $curpath ); + for( $i = $numelems - 1; $i >= 0; $i-- ) + { + $curpath .= "/" . $path[$i]; + my( $dir ) = $in . $curpath; + if( !stat $dir ) + { +# print "mkdir $dir\n"; + mkdir $dir, 0777; + } + } +} + +sub FileExists +{ + my $filename = shift; + my @statresult = stat $filename; + my $iswritable = @statresult != 0; + return $iswritable; +} + +sub MakeFileWritable +{ + my $filename = shift; + if ( &FileExists( $filename ) ) + { + chmod 0666, $filename || die; + } +} + +sub MakeFileReadOnly +{ + my $filename = shift; + chmod 0444, $filename || die; +} + +# Run a command and get stdout and stderr to an array +sub RunCommand +{ + my $cmd = shift; +# print STDERR "command: $cmd\n"; + system "$cmd > cmdout.txt 2>&1" || die; + local( *FILE ); + open FILE, "; +# print STDERR "command output: @output\n"; + close FILE; + unlink "cmdout.txt" || die; + return @output; +} + +sub PerforceEditOrAdd +{ + return; + my $filename = shift; + my $changelistarg = shift; + + # Is the file on the client? + my $cmd = "p4 fstat \"$filename\""; + my @p4output = &RunCommand( $cmd ); + my $p4output = join "", @p4output; + if( $p4output =~ m/no such file/ ) + { + # not on client. . add + my $cmd = "p4 add $changelistarg $filename"; + my @p4output = &RunCommand( $cmd ); + my $p4output = join "", @p4output; + if( $p4output =~ m/opened for add/ ) + { + print $p4output; + return; + } + print "ERROR: $p4output"; + return; + } + + # The file is known to be on the client at this point. + + # Is it open for edit? + if( $p4output =~ m/action edit/ ) + { + # Is is open for edit, let's see if it's still different. + # check for opened files that are not different from the revision in the depot. + my $cmd = "p4 diff -sr \"$filename\""; + my @p4output = &RunCommand( $cmd ); + my $outputstring = join "", @p4output; + # check for empty string + if( !( $outputstring =~ m/^\s*$/ ) ) + { + my $cmd = "p4 revert \"$filename\""; + my @p4output = &RunCommand( $cmd ); + my $outputstring = join "", @p4output; + print $outputstring; + return; + } + } + + # check for unopened files that are different from the revision in the depot. + my $cmd = "p4 diff -se \"$filename\""; + my @p4output = &RunCommand( $cmd ); + my $outputstring = join "", @p4output; + # check for empty string + if( $outputstring =~ m/^\s*$/ ) + { + &MakeFileReadOnly( $filename ); + return; + } + + # We need to edit the file since it is known to be different here. + my $cmd = "p4 edit $changelistarg \"$filename\""; + my @p4output = &RunCommand( $cmd ); + + my $line; + foreach $line ( @p4output ) + { + if( $line =~ m/not on client/ ) + { + #print "notonclient..."; + print "ERROR: @p4output\n"; + return; + } + if( $line =~ m/currently opened for edit/ ) + { + return; + } + if( $line =~ m/opened for edit/ ) + { + print $line; + } + } +} + +sub FileIsWritable +{ + local( $filename ) = shift; + local( @statresult ) = stat $filename; + local( $mode, $iswritable ); + $mode = oct( $statresult[2] ); + $iswritable = ( $mode & 2 ) != 0; + return $iswritable; +} + +sub TouchFile +{ + my $filename = shift; + if( !&FileExists( $filename ) ) + { + if( !open FILE, ">$filename" ) + { + die; + } + close FILE; + } + my $now = time; + local( *FILE ); + utime $now, $now, $filename; +} + +sub FileExistsInPerforce +{ + my $filename = shift; + my @output = &RunCommand( "p4 fstat $filename" ); + my $line; + foreach $line (@output) + { + if( $line =~ m/no such file/ ) + { + return 0; + } + } + return 1; +} + +sub PerforceWriteFile +{ + my $filename = shift; + my $filecontents = shift; +# my $changelistname = shift; + + # Get the changelist number for the Shader Auto Checkout changelist. Will create the changelist if it doesn't exist. +# my $changelistnumber = `valve_p4_create_changelist.cmd . \"$changelistname\"`; + # Get rid of the newline +# $changelistnumber =~ s/\n//g; + +# my $changelistarg = ""; +# if( $changelistnumber != 0 ) +# { +# $changelistarg = "-c $changelistnumber" +# } + + # Make the target vcs writable if it exists + MakeFileWritable( $filename ); + + # Write the file. + local( *FP ); + open FP, ">$filename"; + print FP $filecontents; + close FP; + + # Do whatever needs to happen with perforce for this file. +# &PerforceEditOrAdd( $filename, $changelistarg ); +} + +sub WriteFile +{ + my $filename = shift; + my $filecontents = shift; + + # Make the target vcs writable if it exists + MakeFileWritable( $filename ); + + # Write the file. + local( *FP ); + open FP, ">$filename"; + print FP $filecontents; + close FP; +} + +sub PrintCleanPerforceOutput +{ + my $line; + while( $line = shift ) + { + if( $line =~ m/currently opened/i ) + { + next; + } + if( $line =~ m/already opened for edit/i ) + { + next; + } + if( $line =~ m/also opened/i ) + { + next; + } + if( $line =~ m/add of existing file/i ) + { + next; + } + print $line; + } +} + +# HACK!!!! Need to pass something in to do this rather than hard coding. +sub NormalizePerforceFilename +{ + my $line = shift; + + # remove newlines. + $line =~ s/\n//; + # downcase. + $line =~ tr/[A-Z]/[a-z]/; + # backslash to forwardslash + $line =~ s,\\,/,g; + + # for inc files HACK! + $line =~ s/^.*(fxctmp9.*)/$1/i; + $line =~ s/^.*(vshtmp9.*)/$1/i; + + # for vcs files. HACK! + $line =~ s,^.*game/hl2/shaders/,,i; + + return $line; +} + +sub MakeSureFileExists +{ + local( $filename ) = shift; + local( $testexists ) = shift; + local( $testwrite ) = shift; + + local( @statresult ) = stat $filename; + if( !@statresult && $testexists ) + { + die "$filename doesn't exist!\n"; + } + local( $mode, $iswritable ); + $mode = oct( $statresult[2] ); + $iswritable = ( $mode & 2 ) != 0; + if( !$iswritable && $testwrite ) + { + die "$filename isn't writable!\n"; + } +} + +sub LoadShaderListFile_GetShaderType +{ + my $shadername = shift; + my $shadertype; + if( $shadername =~ m/\.vsh/i ) + { + $shadertype = "vsh"; + } + elsif( $shadername =~ m/\.psh/i ) + { + $shadertype = "psh"; + } + elsif( $shadername =~ m/\.fxc/i ) + { + $shadertype = "fxc"; + } + else + { + die; + } + return $shadertype; +} + +sub LoadShaderListFile_GetShaderSrc +{ + my $shadername = shift; + if ( $shadername =~ m/^(.*)-----/i ) + { + return $1; + } + else + { + return $shadername; + } +} + +sub LoadShaderListFile_GetShaderBase +{ + my $shadername = shift; + if ( $shadername =~ m/-----(.*)$/i ) + { + return $1; + } + else + { + my $shadertype = &LoadShaderListFile_GetShaderType( $shadername ); + $shadername =~ s/\.$shadertype//i; + return $shadername; + } +} + +sub LoadShaderListFile +{ + my $inputbase = shift; + + my @srcfiles; + &MakeSureFileExists( "$inputbase.txt", 1, 0 ); + + open SHADERLISTFILE, "<$inputbase.txt" || die; + my $line; + while( $line = ) + { + $line =~ s/\/\/.*$//; # remove comments "//..." + $line =~ s/^\s*//; # trim leading whitespace + $line =~ s/\s*$//; # trim trailing whitespace + next if( $line =~ m/^\s*$/ ); + if( $line =~ m/\.fxc/ || $line =~ m/\.vsh/ || $line =~ m/\.psh/ ) + { + my $shaderbase = &LoadShaderListFile_GetShaderBase( $line ); + + if( $ENV{"DIRECTX_FORCE_MODEL"} =~ m/^30$/i ) # forcing all shaders to be ver. 30 + { + my $targetbase = $shaderbase; + $targetbase =~ s/_ps2x/_ps30/i; + $targetbase =~ s/_ps20b/_ps30/i; + $targetbase =~ s/_ps20/_ps30/i; + $targetbase =~ s/_vs20/_vs30/i; + $targetbase =~ s/_vsxx/_vs30/i; + push @srcfiles, ( $line . "-----" . $targetbase ); + } + else + { + if( $shaderbase =~ m/_ps2x/i ) + { + my $targetbase = $shaderbase; + $targetbase =~ s/_ps2x/_ps20/i; + push @srcfiles, ( $line . "-----" . $targetbase ); + + $targetbase = $shaderbase; + $targetbase =~ s/_ps2x/_ps20b/i; + push @srcfiles, ( $line . "-----" . $targetbase ); + } + elsif( $shaderbase =~ m/_vsxx/i ) + { + my $targetbase = $shaderbase; + $targetbase =~ s/_vsxx/_vs11/i; + push @srcfiles, ( $line . "-----" . $targetbase ); + + $targetbase = $shaderbase; + $targetbase =~ s/_vsxx/_vs20/i; + push @srcfiles, ( $line . "-----" . $targetbase ); + } + else + { + push @srcfiles, ( $line . "-----" . $shaderbase ); + } + } + } + } + close SHADERLISTFILE; + return @srcfiles; +} + +sub ReadInputFileWithIncludes +{ + local( $filename ) = shift; +# print STDERR "ReadInputFileWithIncludes: $filename\n"; + + local( *INPUT ); + local( $output ); + +# print STDERR "before open\n"; + open INPUT, "<$filename" || die; +# print STDERR "after open\n"; + + local( $line ); + while( $line = ) + { +# print STDERR $line; + if( $line =~ m/\#include\s+\"(.*)\"/i ) + { + $output.= ReadInputFileWithIncludes( $1 ); + } + else + { + $output .= $line; + } + } + + close INPUT; + return $output; +} + +sub GetCRCFromSourceFile +{ + my $filename = shift; + my $data = &ReadInputFileWithIncludes( $filename ); +# print STDERR $data; + $crc = crc32( $data ); +# print STDERR "GetCRCFromSourceFile: $crc\n"; + return $crc; +} + +sub GetCRCFromVCSFile +{ + my $filename = shift; +# print STDERR "GetCRCFromVCSFile $filename\n"; + local( *FP ); + open FP, "<$filename" || die "GetCRCFromVCSFile: can't open file $filename\n"; + binmode( FP ); + + # unpack arguments + my $sInt = "i"; + my $uInt = "I"; + if( $filename =~ m/\.360\./ ) + { + # Change arguments to "big endian long" + $sInt = "N"; + $uInt = "N"; + } + + my $header; + read FP, $header, 7 * 4 || die "updateshaders.pl:GetCRCFromVCSFile: can't read header for $filename\n"; + my $version,$numCombos,$numDynamicCombos,$flags,$centroidMask,$refSize,$crc; + ($version,$numCombos,$numDynamicCombos,$flags,$centroidMask,$refSize,$crc) = unpack "$sInt$sInt$sInt$uInt$uInt$uInt$uInt", $header; + unless( $version == 4 || $version == 5 || $version == 6 ) + { + print STDERR "ERROR: GetCRCFromVCSFile: $filename is version $version\n"; + return 0; + } +# print STDERR "version: $version\n"; +# print STDERR "numCombos: $numCombos\n"; +# print STDERR "numDynamicCombos: $numDynamicCombos\n"; +# print STDERR "flags: $flags\n"; +# print STDERR "centroidMask: $centroidMask\n"; +# print STDERR "refSize: $refSize\n"; +# print STDERR "GetCRCFromVCSFile: $crc\n"; + close( FP ); + return $crc; +} + +sub CheckCRCAgainstTarget +{ + my $srcFileName = shift; + my $vcsFileName = shift; + my $warn = shift; + + # Make sure both files exist. +# print STDERR "$srcFileName doesn't exist\n" if( !( -e $srcFileName ) ); +# print STDERR "$vcsFileName doesn't exist\n" if( !( -e $vcsFileName ) ); + if( !( -e $srcFileName ) ) + { + if( $warn ) + { + print "$srcFileName missing\n"; + } + return 0; + } + if( !( -e $vcsFileName ) ) + { + if( $warn ) + { + print "$vcsFileName missing\n"; + } + return 0; + } +# print STDERR "CheckCRCAgainstTarget( $srcFileName, $vcsFileName );\n"; +# print STDERR "vcsFileName: $vcsFileName\n"; +# print STDERR "vcsFileName: $srcFileName\n"; + my $vcsCRC = &GetCRCFromVCSFile( $vcsFileName ); + my $srcCRC = &GetCRCFromSourceFile( $srcFileName ); + if( $warn && ( $vcsCRC != $srcCRC ) ) + { + print "$vcsFileName checksum ($vcsCRC) != $srcFileName checksum: ($srcCRC)\n"; + } + +# return 0; # use this to skip crc checking. +# if( $vcsCRC == $srcCRC ) +# { +# print STDERR "CRC passed for $srcFileName $vcsFileName $vcsCRC\n"; +# } + return $vcsCRC == $srcCRC; +} + +1; diff --git a/devtools/bin/vmpi_chpass.pl b/devtools/bin/vmpi_chpass.pl new file mode 100644 index 0000000..12ccf8a --- /dev/null +++ b/devtools/bin/vmpi_chpass.pl @@ -0,0 +1,116 @@ +#!/usr/bin/perl -w +use IO::Socket::INET; +use Sys::Hostname; +use Data::Dumper; +use Getopt::Long; +use Pod::Usage; +use strict; + +use constant VMPI_PROTOCOL_VERSION => 5; + +use constant VMPI_MESSAGE_BASE => 71; +use constant VMPI_PING_REQUEST => VMPI_MESSAGE_BASE+2; +use constant VMPI_PING_RESPONSE => VMPI_MESSAGE_BASE+3; +use constant VMPI_FORCE_PASSWORD_CHANGE => VMPI_MESSAGE_BASE+11; + +use constant VMPI_PASSWORD_OVERRIDE => -111; + +use constant VMPI_SERVICE_PORT => 23397; +use constant VMPI_LAST_SERVICE_PORT => VMPI_SERVICE_PORT + 15; + +my $list = undef; +my $pass = ""; +my $help = 0; +my $man = 0; + +GetOptions("file=s" => \$list, + "pass=s" => \$pass, + "help|?" => \$help, + "man" => \$man) or pod2usage(1); +pod2usage(2) if $help; +pod2usage(-exitstatus=>0, -verbose=>2) if $man; + +my @machines = @ARGV; +if ($list) { + if (open(my $listfh, $list)) { + while(my $line = <$listfh>) { + chomp($line); + next unless $line =~ /\S/; + push @machines, $line; + } + } +} + +if (!@machines) { + warn "No machines specified\n"; + pod2usage(3); +} + +my $message = BuildMessage(VMPI_PROTOCOL_VERSION, VMPI_FORCE_PASSWORD_CHANGE); +$message .= pack("Z*", $pass); +my $length = length($message); + +my $socket = CreateSocket(); +# send the message 3 times to make sure it gets it +for (1..3) { + for my $host (@machines) { + SendMessage($socket, $host, $message); + } + sleep(1); +} + + +sub CreateSocket { + return IO::Socket::INET->new(Proto=>'udp'); +} + +sub BuildMessage { + my $ver = shift; + my $type = shift; + + my $message = pack("CcCC", $ver, VMPI_PASSWORD_OVERRIDE, 0, $type); + return $message; +} + +sub SendMessage { + my $socket = shift; + my $host = shift; + my $message = shift; + + my $ip = gethostbyname($host); + if (!$ip) { + warn "Can't resolve: $host\n"; + return; + } + + for my $port (VMPI_SERVICE_PORT..VMPI_LAST_SERVICE_PORT) { + my $ipaddr = sockaddr_in($port, $ip); + defined(send($socket, $message, 0, $ipaddr)) || warn("SEND: $!\n"); + } +} + +__END__ + +=head1 NAME + +vmpi_chpass.pl - Sets the VMPI password on a set of machines + +=head1 SYNOPSIS + +vmpi_chpass.pl [-pass ] [-help|-?] [-man] + -file | ... + + Options: + -file A file that contains the names of machines to use + -pass Password to set + -help|-? Display command line usage + -man Display full documentation + +=head1 DESCRIPTION + +B sets the password on the given list of machines. The +machines can be given as separate arguments on the command line or as +a list in a text file. If the password is not given, the password is +removed from the machines, opening them up for general use. + +=cut diff --git a/devtools/bin/vmpi_test.pl b/devtools/bin/vmpi_test.pl new file mode 100644 index 0000000..4fe22d2 --- /dev/null +++ b/devtools/bin/vmpi_test.pl @@ -0,0 +1,385 @@ +#!/usr/bin/perl -w +use Getopt::Long; +use Pod::Usage; +use Sys::Hostname; +use File::Copy; +use File::Path; +use Time::HiRes qw(gettimeofday tv_interval); +use Cwd; +use strict; + +use vars qw(%TESTS %STATS $ABORT_RUN $MPI_GRAPHICS); + +# To add a new test, just create a new hash entry that has code +# references for the Prep, Run and Clean stages of the test. +# The new test can be selected using the -test option. + +%TESTS = ( + 'vrad' => { + 'PREP' => \&VRADPrep, + 'RUN' => \&VRADRun, + 'CLEAN' => \&VRADClean, + }, + + 'vvis' => { + 'PREP' => \&VVISPrep, + 'RUN' => \&VVISRun, + 'CLEAN' => \&VVISClean, + }, + + 'shadercompile' => { + 'PREP' => \&ShaderPrep, + 'RUN' => \&ShaderRun, + 'CLEAN' => \&ShaderClean, + } + ); + +%STATS = (); +$ABORT_RUN = 0; +$MPI_GRAPHICS = 0; + +local $SIG{INT} = sub { + $ABORT_RUN = 1; +}; + +my $start = 4; +my $stop = 32; +my $step = 4; +my $test = "vrad"; +my $list = undef; +my $help = 0; +my $man = 0; + +my @work_list = (); +GetOptions("file=s" => \$list, + "test=s" => \$test, + "workerlist=s" => sub { + shift; local $_ = shift; + @work_list = split(',', $_) + }, + "start|s=i" => \$start, + "stop|e=i" => \$stop, + "step=i" => \$step, + "graphics" => \$MPI_GRAPHICS, + "help|?" => \$help, + "man" => \$man) or pod2usage(2); +pod2usage(1) if $help; +pod2usage(-exitstatus => 0, -verbose => 2) if $man; + +my @extra_args = @ARGV; + +unless (@work_list) { + for (my $workers = $stop; $workers >= $start; $workers -= $step) { + push @work_list, $workers; + } +} + +if (defined($list)) { + @work_list = ReadMachineList($list, \@work_list); +} + +unless (@work_list) { + die "No workers in list\n"; +} + +my $logfile = "$test-$$.log"; +print "Testing: ", join(", ", @work_list), "\n"; +print "Logging to $logfile\n"; + +# Redirect console to log file and unbuffer the output +open STDOUT, ">$logfile"; +open STDERR, ">>$logfile"; +my $oldfh = select(STDOUT); $| = 1; +select(STDERR); $| = 1; +select($oldfh); + +# Lock the list of machines if given +# Prepare for the test +# Run the test over the work list +# Clean up after the test +# Release lock on list of machines if given + +my $pass = defined($list) ? ReserveMachines($list, $test) : ''; +TestPrep($test, @extra_args); +for my $workers (@work_list) { + last if $ABORT_RUN; + TestRun($test, $workers, $pass, @extra_args); +} +TestClean($test, @extra_args); +ReleaseMachines($list) if defined($list); + +sub ReadMachineList +{ + my $list = shift; + my $work_list = shift; + + my @machines = (); + + if (open(my $listfh, $list)) { + while(my $line = <$listfh>) { + chomp($line); + next unless $line =~ /\S/; + push @machines, $line; + } + } + + my @capped_list = grep { $_ <= scalar(@machines) } @{$work_list}; + if ($#{$work_list} > $#capped_list) { + print "Not enough machines to run test\n"; + print "Reducing max workers\n\n"; + } + return @capped_list; +} + +sub SetVMPIPass { + my $machines = shift; + my $pass = shift; + + system("vmpi_chpass.pl", "-p", $pass, "-f", $machines); +} + +sub ReserveMachines +{ + my $list = shift; + my $pass = shift; + + my $host = lc hostname(); + $pass .= "-test-$host-$$"; + SetVMPIPass($list, $pass); + return $pass; +} + +sub ReleaseMachines +{ + my $machines = shift; + SetVMPIPass($machines, ''); +} + +sub DoTestFunc +{ + my $test = shift; + my $func = shift; + my $workers = $_[0]; + + if (exists($TESTS{$test}{$func})) { + my $start = [gettimeofday]; + &{$TESTS{$test}{$func}}(@_); + my $stop = [gettimeofday]; + my $time = tv_interval($start, $stop); + $STATS{$func}{$workers} = $time / 60; + } + else { + die "Failed to locate test function for: $test($func)\n"; + } +} + +sub TestPrep +{ + my $test = shift; + DoTestFunc($test, 'PREP', 0, '', @_); +} + +sub TestRun +{ + my $test = shift; + DoTestFunc($test, 'RUN', @_); +} + +sub TestClean +{ + my $test = shift; + DoTestFunc($test, 'CLEAN', 0, '', @_); +} + +sub GetMPIArgs +{ + my $n_workers = shift; + my $pass = shift; + + my @args = ("-mpi"); + push(@args, "-mpi_workercount", $n_workers) if $n_workers > 0; + push(@args, "-mpi_pw", $pass) if $pass; + push(@args, "-mpi_graphics", "-mpi_trackevents") if $MPI_GRAPHICS; + return @args; +} + + +sub VRADPrep +{ + my $n_workers = shift; + my $pass = shift; + my $basename = shift; + my @extra_args = @_; + my @mpi_args = GetMPIArgs($n_workers, $pass); + + system("vbsp", $basename); + system("vvis", @mpi_args, @extra_args, $basename); + copy("$basename.bsp", "$basename-$$.bsp"); +} + +sub VRADRun +{ + my $n_workers = shift; + my $pass = shift; + my $basename = shift; + my @extra_args = @_; + my @mpi_args = GetMPIArgs($n_workers, $pass); + + copy("$basename-$$.bsp", "$basename.bsp"); + system("vrad", "-final", "-staticproppolys", "-staticproplighting", + @mpi_args, @extra_args, $basename); + +} + +sub VRADClean +{ + my $n_workers = shift; + my $pass = shift; + my $basename = shift; + + unlink("$basename.bsp", "$basename-$$.bsp"); +} + + +sub VVISPrep +{ + my $n_workers = shift; + my $pass = shift; + my $basename = shift; + my @mpi_args = GetMPIArgs($n_workers, $pass); + + system("vbsp", $basename); + copy("$basename.bsp", "$basename-$$.bsp"); +} + +sub VVISRun +{ + my $n_workers = shift; + my $pass = shift; + my $basename = shift; + my @extra_args = @_; + my @mpi_args = GetMPIArgs($n_workers, $pass); + + copy("$basename-$$.bsp", "$basename.bsp"); + system("vvis", @mpi_args, $pass, @extra_args, $basename); +} + +sub VVISClean +{ + my $n_workers = shift; + my $pass = shift; + my $basename = shift; + + unlink("$basename.bsp", "$basename-$$.bsp"); +} + +sub ShaderPrep +{ + my $n_workers = shift; + my $pass = shift; + my $basename = shift; + + $ENV{DIRECTX_SDK_VER}='pc09.00'; + $ENV{DIRECTX_SDK_BIN_DIR}='dx9sdk\\utilities'; + $ENV{PATH} .= ";..\\..\\devtools\\bin"; + + my $src_base = "../.."; + my $dos_base = $src_base; + $dos_base =~ s|/|\\|g; + + unlink("makefile.$basename"); + unlink(qw(filelist.txt filestocopy.txt filelistgen.txt inclist.txt vcslist.txt)); + rmtree("shaders"); + mkpath(["shaders/fxc", "shaders/vsh", "shaders/psh"]); + + print "Update Shaders\n"; + system("updateshaders.pl", "-source", $dos_base, $basename); + + print "Prep Shaders\n"; + system("nmake", "/S", "/C", "-f", "makefile.$basename"); + if (open(my $fh, ">>filestocopy.txt")) { + print $fh "$dos_base\\$ENV{DIRECTX_SDK_BIN_DIR}\\dx_proxy.dll\n"; + print $fh "$dos_base\\..\\game\\bin\\shadercompile.exe\n"; + print $fh "$dos_base\\..\\game\\bin\\shadercompile_dll.dll\n"; + print $fh "$dos_base\\..\\game\\bin\\vstdlib.dll\n"; + print $fh "$dos_base\\..\\game\\bin\\tier0.dll\n"; + } + + print "Uniqify List\n"; + system("uniqifylist.pl < filestocopy.txt > uniquefilestocopy.txt"); + copy("filelistgen.txt", "filelist.txt"); + print "Done Prep\n"; +} + +sub ShaderRun +{ + my $n_workers = shift; + my $pass = shift; + my $basename = shift; + my @extra_args = @_; + my @mpi_args = GetMPIArgs($n_workers, $pass); + + my $old_dir = getcwd(); + my $dos_dir = $old_dir; + $dos_dir =~ s|/|\\|g; + + system("shadercompile", "-allowdebug", "-shaderpath", $dos_dir, @mpi_args, @extra_args); +} + +sub ShaderClean +{ + my $n_workers = shift; + my $pass = shift; + my $basename = shift; + + unlink("makefile.$basename"); + unlink(qw(filelist.txt filestocopy.txt filelistgen.txt inclist.txt vcslist.txt)); + mkpath(["shaders/fxc", "shaders/vsh", "shaders/psh"]); +} + +END { + if (%STATS) { + print "\n\n", "-"x70, "\n\n"; + for my $func (qw(PREP RUN CLEAN)) { + print "$func\n"; + print "="x length($func), "\n"; + for my $workers (sort {$a <=> $b} keys %{$STATS{$func}}) { + printf("%3d, %6.3f\n", $workers, $STATS{$func}{$workers}); + } + print "\n"; + } + } +} + +__END__ + +=head1 NAME + +vmpi_test.pl - Test utility to automate execution of VMPI tools + +=head1 SYNOPSIS + +vmpi_test.pl [-test ] [-file ] [-start ] [-stop ] [-step ] [-workerlist ] [-graphics] [-help|-?] [-man] + + Options: + -test The name of the test to run + -file A file that contains the names of machines to use + -start Lowest worker count to test + -stop Highest worker count to test + -step Interval to increment worker count + -workerlist A comma separated list of worker counts to test + -graphics Enable MPI visual work unit tracker + -help|-? Display command line usage + -man Display full documentation + +=head1 DESCRIPTION + +B executes a specified test for each number of worker +counts given on the command line. The worker counts can be provided as +a start, stop and step relationship, or it can be specified using a +comma separated list. An optional host list file can be provided to +restrict the test to a given set of machines. These machines will have +a VMPI password applied to them so that you will get exclusive access +to them. + +=cut diff --git a/devtools/bin/vpc b/devtools/bin/vpc new file mode 100644 index 0000000..de694fd --- /dev/null +++ b/devtools/bin/vpc @@ -0,0 +1,46 @@ +#!/bin/bash + +OS=`uname` +SCRIPTPATH=`dirname $0` +FORCEARG="" + +case $OS in +"Darwin") + BINNAME=vpc_osx + ;; +"Linux") + BINNAME=vpc_linux + ;; +*) + echo "Couldn't find appropriate VPC binary, fix the script." + exit -1 + ;; +esac + +CWD=`pwd` +cd $SCRIPTPATH/../../external/vpc/utils/vpc +# ask make if we need to do any work, returns 0 if we don't, +# non zero if we do. +make -q +RC=$? +if [ $RC -eq 1 ]; then + FORCEARG="/f" +elif [ $RC -eq 2 ]; then + FORCEARG="/f" + make clean +fi +make -j4 +if [ $? -ne 0 ]; then + exit -1 +fi + +cd $CWD + +if [ $OS == "Darwin" ]; then + $SCRIPTPATH/$BINNAME $FORCEARG $@ +elif [ $OS == "Linux" ]; then + $SCRIPTPATH/$BINNAME $FORCEARG $@ +else + echo "Couldn't find appropriate VPC binary, fix the script." + exit -1 +fi diff --git a/devtools/bin/vpc.exe b/devtools/bin/vpc.exe new file mode 100644 index 0000000..e611043 Binary files /dev/null and b/devtools/bin/vpc.exe differ diff --git a/devtools/bin/vpc.pdb b/devtools/bin/vpc.pdb new file mode 100644 index 0000000..9ead163 Binary files /dev/null and b/devtools/bin/vpc.pdb differ diff --git a/devtools/bin/vpc2linuxmake.pl b/devtools/bin/vpc2linuxmake.pl new file mode 100644 index 0000000..1a94f16 --- /dev/null +++ b/devtools/bin/vpc2linuxmake.pl @@ -0,0 +1,684 @@ +#!perl +use IO::File; +use File::Basename; +use File::Find; +use Cwd; +use Cwd 'abs_path'; + + + +$nprocs=`grep vendor_id /proc/cpuinfo | wc -l `; +$nprocs=~s/[\n\r]//g; +print "$nprocs processors found\n"; + +#find where to include master make file from +$srcdir=getcwd; +die "can't determine path to src" + unless ($srcdir=~s@/src.*$@/src@); + + +find( { wanted=> \&handle_vpc_file } ,"$srcdir"); # search through all directories for .vpc files + +@MAINTARGETS=("all", "clean", "objs"); +@TARGETS=("all", "clean", "objs", "tags"); + + + +# now, write a master makefile in each dir, and a master-master makefile in ~/src +foreach $dir ( keys %dir_written ) +{ + open( MAKEOUT,">$dir/Makefile" ) || die "can't write $dir/Makefile"; + foreach $target ( @TARGETS ) + { + print MAKEOUT "$target:\n"; + foreach $_ (split(/,/,$dir_written{$dir}) ) + { + print MAKEOUT "\tmake -j $nprocs -f $_ $target\n" if length($_); + } + } + close MAKEOUT; +} + +# now, write a master makefile in ~/src +open( MAKEOUT,">$srcdir/Makefile" ) || die "can't write master makefile to $srcdir"; +foreach $target ( @MAINTARGETS ) +{ + print MAKEOUT "$target:\n"; + foreach $dir ( keys %dir_written ) + { + print MAKEOUT "\tmake -j $nprocs -C $dir $target #$dir_conf_type{$dir}\n" if ($dir_conf_type{$dir} eq "lib"); + } + foreach $dir ( keys %dir_written ) + { + print MAKEOUT "\tmake -j $nprocs -C $dir $target #$dir_conf_type{$dir}\n" if ($dir_conf_type{$dir} ne "lib"); + } + +} +print MAKEOUT "\n\nmakefiles:\n\tperl $srcdir/devtools/bin/vpc2linuxmake.pl\n"; +print MAKEOUT "\ntags:\n\trm -f $srcdir/TAGS\n"; +print MAKEOUT "\tetags -a -C -o $srcdir/TAGS public/*.cpp public/*.h public/*/*.cpp public/*/*.h common/*.cpp common/*.h\n"; + +foreach $dir ( keys %dir_written ) +{ + print MAKEOUT "\tmake -C $dir tags\n"; +} + + +close MAKEOUT; + +sub handle_vpc_file +{ + # called for each file in the callers dir tree + my $dir=$File::Find::dir; + return if ( $dir=~/vpc_scripts/i ); + if ( /_base\.vpc$/i ) + { + unless ( /hk_base\.vpc$/i ) + { + return; + } + } + + if ( /_include\.vpc$/i ) + { + unless ( /hk_base\.vpc$/i ) + { + return; + } + } + + if (/\.vpc$/) + { + (%ignore_file,@DEFINES, @CPPFILES, @CXXFILES,@CFILES, @LITERAL_LIBFILES,@LIBFILES, %define_seen,%macros,%include_seen,@INCLUDEDIRS)=undef; + undef $buildforlinux; + undef $conf_type; + $OptimizerLevel='$(SAFE_OPTFLAGS_GCC_422)'; + $SymbolVisibility='hidden'; + + + # some defines to ignore in vpc files when generating linux include files + + $define_seen{'WIN32'}=1; + $define_seen{'_WIN32'}=1; + $define_seen{'_WINDOWS'}=1; + $define_seen{'_USRDLL'}=1; + $define_seen{'DEBUG'}=1; + $define_seen{'_DEBUG'}=1; + $define_seen{'NDEBUG'}=1; + $define_seen{'_CRT_SECURE_NO_DEPRECATE'}=1; + $define_seen{'_CRT_NONSTDC_NO_DEPRECATE'}=1; + $define_seen{'fopen'}=1; + #print "$_\n"; + &ParseVPC($_); + + $pname=lc($pname); + $pname=~s/\s+/_/g; + $pname=~s/[\(\)]//g; + # if anything seen, output a makefile + if ( $buildforlinux && ( @CPPFILES || @CXXFILES || @CFILES || @LIBFILES ) ) + { + print STDERR "writing project $pname\n"; + $projdir=getcwd; + $projdir=~s@/$@@; + $dir_written{$projdir}.=",$pname.mak"; + $dir_conf_type{$projdir}=$conf_type; + &WriteMakefile("$projdir/$pname.mak"); + &WriteCodeBlocksProj("$projdir/$pname.cbp"); + } + else + { + die "no .lib or source files found in .vpc" if ( $buildforlinux ); + } + } +} + + +sub WriteCodeBlocksProj +{ + local($_)=@_; + + open(CBPROJ,">$_") || die "can't write $_"; + + print CBPROJ <
+ + + +