User:Visualphoenix: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 13: | Line 13: | ||
=== updateshaders.pl === | === updateshaders.pl === | ||
<pre> | <pre> | ||
--- mod/src/devtools/bin/updateshaders.pl 2005- | --- mod/src/devtools/bin/updateshaders.pl 2005-07-14 09:58:54.000000000 -0500 | ||
+++ mod/src/devtools/bin/updateshaders.pl 2005- | +++ mod/src/devtools/bin/updateshaders.pl 2005-10-11 23:42:36.000000000 -0500 | ||
@@ -105,7 +105,7 @@ | @@ -105,7 +105,7 @@ | ||
{ | { | ||
$xboxswitch = "-xbox "; | $xboxswitch = "-xbox "; | ||
} | } | ||
- print MAKEFILE "\t | - print MAKEFILE "\t$g_SourceDir\\devtools\\bin\\perl.exe $g_SourceDir\\devtools\\bin\\" . $shadertype . "_prep.pl $xboxswitch -shaderoutputdir $shaderoutputdir -source \"$g_SourceDir\" $shadername\n"; | ||
+ print MAKEFILE "\t$g_SourceDir\\devtools\\bin\\perl.exe $g_SourceDir\\devtools\\bin\\" . $shadertype . "_prep.pl $xboxswitch -shaderoutputdir $shaderoutputdir -source \"$g_SourceDir\" $shadername\n"; | + print MAKEFILE "\t\"$g_SourceDir\\devtools\\bin\\perl.exe\" \"$g_SourceDir\\devtools\\bin\\" . $shadertype . "_prep.pl\" $xboxswitch -shaderoutputdir $shaderoutputdir -source \"$g_SourceDir\" $shadername\n"; | ||
my $filename; | my $filename; | ||
if( $shadertype eq "fxc" ) | if( $shadertype eq "fxc" ) | ||
Line 37: | Line 28: | ||
if( $g_xbox ) | if( $g_xbox ) | ||
{ | { | ||
- print MAKEFILE | - print MAKEFILE " $shadertype" . "tmp_xbox\\" . $shaderbase . "\.inc"; | ||
+ print MAKEFILE " $shadertype" . "tmp_xbox\\" . $shaderbase . "\.inc"; | + print MAKEFILE " \"$shadertype" . "tmp_xbox\\" . $shaderbase . "\.inc\""; | ||
} | } | ||
else | else | ||
{ | { | ||
- print MAKEFILE | - print MAKEFILE " $shadertype" . "tmp9\\" . $shaderbase . "\.inc"; | ||
+ print MAKEFILE " $shadertype" . "tmp9\\" . $shaderbase . "\.inc"; | + print MAKEFILE " \"$shadertype" . "tmp9\\" . $shaderbase . "\.inc\""; | ||
} | } | ||
} | } | ||
- print MAKEFILE | - print MAKEFILE " $shaderoutputdir\\$shadertype\\$shaderbase\.vcs"; | ||
+ print MAKEFILE " $shaderoutputdir\\$shadertype\\$shaderbase\.vcs"; | + print MAKEFILE " \"$shaderoutputdir\\$shadertype\\$shaderbase\.vcs\""; | ||
} | } | ||
print MAKEFILE "\n\n"; | print MAKEFILE "\n\n"; | ||
Line 55: | Line 46: | ||
if( $g_xbox ) | if( $g_xbox ) | ||
{ | { | ||
- print MAKEFILE "\tdel /f /q | - print MAKEFILE "\tdel /f /q $shadertype" . "tmp_xbox\\" . $shaderbase . "\.inc\n"; | ||
+ print MAKEFILE "\tdel /f /q $shadertype" . "tmp_xbox\\" . $shaderbase . "\.inc\n"; | + print MAKEFILE "\tdel /f /q \"$shadertype" . "tmp_xbox\\" . $shaderbase . "\.inc\"\n"; | ||
} | } | ||
else | else | ||
{ | { | ||
- print MAKEFILE "\tdel /f /q | - print MAKEFILE "\tdel /f /q $shadertype" . "tmp9\\" . $shaderbase . "\.inc\n"; | ||
+ print MAKEFILE "\tdel /f /q $shadertype" . "tmp9\\" . $shaderbase . "\.inc\n"; | + print MAKEFILE "\tdel /f /q \"$shadertype" . "tmp9\\" . $shaderbase . "\.inc\"\n"; | ||
} | } | ||
} | } | ||
Line 69: | Line 60: | ||
=== buildshaders.bat === | === buildshaders.bat === | ||
<pre> | <pre> | ||
--- mod/src/materialsystem/stdshaders/buildshaders.bat 2005-10 | --- mod/src/materialsystem/stdshaders/buildshaders.bat 2005-07-14 10:00:36.000000000 -0500 | ||
+++ mod/src/materialsystem/stdshaders/buildshaders.bat 2005- | +++ mod/src/materialsystem/stdshaders/buildshaders.bat 2005-10-11 23:01:08.000000000 -0500 | ||
@@ -36,7 +36,7 @@ | @@ -36,7 +36,7 @@ | ||
REM **************** | REM **************** | ||
:set_xbox_args | :set_xbox_args | ||
set xbox_args=-xbox | set xbox_args=-xbox | ||
-set targetdir= | -set targetdir=%vproject%\shaders_xbox | ||
+set targetdir=%vproject%\shaders_xbox | +set targetdir="%vproject%\shaders_xbox" | ||
goto build_shaders | goto build_shaders | ||
Line 84: | Line 75: | ||
:set_mod_args | :set_mod_args | ||
-if not exist | -if not exist %sourcesdk%\bin\shadercompile.exe goto NoShaderCompile | ||
-set ChangeToDir= | -set ChangeToDir=%sourcesdk%\bin | ||
+if not exist %sourcesdk%\bin\shadercompile.exe goto NoShaderCompile | +if not exist "%sourcesdk%\bin\shadercompile.exe" goto NoShaderCompile | ||
+set ChangeToDir=%sourcesdk%\bin | +set ChangeToDir="%sourcesdk%\bin" | ||
if /i "%4" NEQ "-source" goto NoSourceDirSpecified | if /i "%4" NEQ "-source" goto NoSourceDirSpecified | ||
Line 95: | Line 86: | ||
:NoShaderCompile | :NoShaderCompile | ||
echo - | echo - | ||
-echo - ERROR: shadercompile.exe doesn't exist in | -echo - ERROR: shadercompile.exe doesn't exist in %sourcesdk%\bin | ||
+echo - ERROR: shadercompile.exe doesn't exist in %sourcesdk%\bin | +echo - ERROR: shadercompile.exe doesn't exist in "%sourcesdk%\bin" | ||
echo - | echo - | ||
goto end | goto end | ||
Line 104: | Line 95: | ||
REM Execute distributed process on work/build list | REM Execute distributed process on work/build list | ||
REM **************** | REM **************** | ||
-"%SrcDirBase%\devtools\bin\perl" "%SrcDirBase%\materialsystem\stdshaders\runvmpi.pl" %xbox_args% -changetodir %ChangeToDir% %SDKArgs% | -"%SrcDirBase%\devtools\bin\perl" "%SrcDirBase%\materialsystem\stdshaders\runvmpi.pl" %xbox_args% -changetodir "%ChangeToDir%" %SDKArgs% | ||
+"%SrcDirBase%\devtools\bin\perl" "%SrcDirBase%\materialsystem\stdshaders\runvmpi.pl" %xbox_args% -changetodir | +"%SrcDirBase%\devtools\bin\perl" "%SrcDirBase%\materialsystem\stdshaders\runvmpi.pl" %xbox_args% -changetodir %ChangeToDir% %SDKArgs% | ||
REM **************** | REM **************** | ||
Line 113: | Line 104: | ||
=== runvmpi.pl === | === runvmpi.pl === | ||
<pre> | <pre> | ||
--- mod/src/materialsystem/stdshaders/runvmpi.pl 2005-10 | --- mod/src/materialsystem/stdshaders/runvmpi.pl 2005-07-14 10:00:34.000000000 -0500 | ||
+++ mod/src/materialsystem/stdshaders/runvmpi.pl 2005- | +++ mod/src/materialsystem/stdshaders/runvmpi.pl 2005-10-11 22:34:02.000000000 -0500 | ||
@@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
$shaderpath =~ s,/,\\,g; | $shaderpath =~ s,/,\\,g; | ||
chdir $changeToDir; | chdir $changeToDir; | ||
-$cmdToRun = "shadercompile.exe $noMPI $xboxFlag -shaderpath | -$cmdToRun = "shadercompile.exe $noMPI $xboxFlag -shaderpath $shaderpath -mpi_workercount 32 -allowdebug $gameFlag"; | ||
+$cmdToRun = "shadercompile.exe $noMPI $xboxFlag -shaderpath $shaderpath -mpi_workercount 32 -allowdebug $gameFlag"; | +$cmdToRun = "shadercompile.exe $noMPI $xboxFlag -shaderpath \"$shaderpath\" -mpi_workercount 32 -allowdebug $gameFlag"; | ||
system $cmdToRun; | system $cmdToRun; | ||
Line 128: | Line 119: | ||
=== build_sample_shaders.bat === | === build_sample_shaders.bat === | ||
<pre> | <pre> | ||
--- mod/src/sdkshaders/build_sample_shaders.bat 2005- | --- mod/src/sdkshaders/build_sample_shaders.bat 2005-07-14 09:57:02.000000000 -0500 | ||
+++ mod/src/sdkshaders/build_sample_shaders.bat 2005- | +++ mod/src/sdkshaders/build_sample_shaders.bat 2005-10-11 23:38:18.000000000 -0500 | ||
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
rem **** Call the batch files to build our stuff. | rem **** Call the batch files to build our stuff. | ||
-call ..\materialsystem\stdshaders\buildshaders.bat | -call ..\materialsystem\stdshaders\buildshaders.bat sdk_shaders -game "%__GameDir%" -source .. | ||
+call ..\materialsystem\stdshaders\buildshaders.bat | +call ..\materialsystem\stdshaders\buildshaders.bat kmp_shaders -game "%__GameDir%" -source .\.. | ||
goto end | goto end | ||
</pre> | </pre> |
Revision as of 21:45, 11 October 2005
sdkshaders: fix for spaces in path
Issue: Any attempt to compile the SDK shaders for a mod with spaces in the path name results in failure:
(ie: "C:\Program Files\Steam\SteamApps\SourceMods\MODNAME\src\src\sdkshaders")
This is due to the fact that the perl scripts and bat files have not been properly modified to handle spaces in the path.
Ray "VisualPhoenix" Barbiero has provided the following patches:
Note: These patches have been tested on paths with and without spaces.
updateshaders.pl
--- mod/src/devtools/bin/updateshaders.pl 2005-07-14 09:58:54.000000000 -0500 +++ mod/src/devtools/bin/updateshaders.pl 2005-10-11 23:42:36.000000000 -0500 @@ -105,7 +105,7 @@ { $xboxswitch = "-xbox "; } - print MAKEFILE "\t$g_SourceDir\\devtools\\bin\\perl.exe $g_SourceDir\\devtools\\bin\\" . $shadertype . "_prep.pl $xboxswitch -shaderoutputdir $shaderoutputdir -source \"$g_SourceDir\" $shadername\n"; + print MAKEFILE "\t\"$g_SourceDir\\devtools\\bin\\perl.exe\" \"$g_SourceDir\\devtools\\bin\\" . $shadertype . "_prep.pl\" $xboxswitch -shaderoutputdir $shaderoutputdir -source \"$g_SourceDir\" $shadername\n"; my $filename; if( $shadertype eq "fxc" ) { @@ -199,14 +199,14 @@ # We only generate inc files for fxc and vsh files. if( $g_xbox ) { - print MAKEFILE " $shadertype" . "tmp_xbox\\" . $shaderbase . "\.inc"; + print MAKEFILE " \"$shadertype" . "tmp_xbox\\" . $shaderbase . "\.inc\""; } else { - print MAKEFILE " $shadertype" . "tmp9\\" . $shaderbase . "\.inc"; + print MAKEFILE " \"$shadertype" . "tmp9\\" . $shaderbase . "\.inc\""; } } - print MAKEFILE " $shaderoutputdir\\$shadertype\\$shaderbase\.vcs"; + print MAKEFILE " \"$shaderoutputdir\\$shadertype\\$shaderbase\.vcs\""; } print MAKEFILE "\n\n"; @@ -221,11 +221,11 @@ # We only generate inc files for fxc and vsh files. if( $g_xbox ) { - print MAKEFILE "\tdel /f /q $shadertype" . "tmp_xbox\\" . $shaderbase . "\.inc\n"; + print MAKEFILE "\tdel /f /q \"$shadertype" . "tmp_xbox\\" . $shaderbase . "\.inc\"\n"; } else { - print MAKEFILE "\tdel /f /q $shadertype" . "tmp9\\" . $shaderbase . "\.inc\n"; + print MAKEFILE "\tdel /f /q \"$shadertype" . "tmp9\\" . $shaderbase . "\.inc\"\n"; } } print MAKEFILE "\tdel /f /q \"$shaderoutputdir\\$shadertype\\$shaderbase\.vcs\"\n";
buildshaders.bat
--- mod/src/materialsystem/stdshaders/buildshaders.bat 2005-07-14 10:00:36.000000000 -0500 +++ mod/src/materialsystem/stdshaders/buildshaders.bat 2005-10-11 23:01:08.000000000 -0500 @@ -36,7 +36,7 @@ REM **************** :set_xbox_args set xbox_args=-xbox -set targetdir=%vproject%\shaders_xbox +set targetdir="%vproject%\shaders_xbox" goto build_shaders @@ -45,8 +45,8 @@ REM **************** :set_mod_args -if not exist %sourcesdk%\bin\shadercompile.exe goto NoShaderCompile -set ChangeToDir=%sourcesdk%\bin +if not exist "%sourcesdk%\bin\shadercompile.exe" goto NoShaderCompile +set ChangeToDir="%sourcesdk%\bin" if /i "%4" NEQ "-source" goto NoSourceDirSpecified set SrcDirBase=%~5 @@ -75,7 +75,7 @@ :NoShaderCompile echo - -echo - ERROR: shadercompile.exe doesn't exist in %sourcesdk%\bin +echo - ERROR: shadercompile.exe doesn't exist in "%sourcesdk%\bin" echo - goto end @@ -129,7 +129,7 @@ REM **************** REM Execute distributed process on work/build list REM **************** -"%SrcDirBase%\devtools\bin\perl" "%SrcDirBase%\materialsystem\stdshaders\runvmpi.pl" %xbox_args% -changetodir "%ChangeToDir%" %SDKArgs% +"%SrcDirBase%\devtools\bin\perl" "%SrcDirBase%\materialsystem\stdshaders\runvmpi.pl" %xbox_args% -changetodir %ChangeToDir% %SDKArgs% REM **************** REM Copy the generated files to the output dir.
runvmpi.pl
--- mod/src/materialsystem/stdshaders/runvmpi.pl 2005-07-14 10:00:34.000000000 -0500 +++ mod/src/materialsystem/stdshaders/runvmpi.pl 2005-10-11 22:34:02.000000000 -0500 @@ -41,7 +41,7 @@ $shaderpath =~ s,/,\\,g; chdir $changeToDir; -$cmdToRun = "shadercompile.exe $noMPI $xboxFlag -shaderpath $shaderpath -mpi_workercount 32 -allowdebug $gameFlag"; +$cmdToRun = "shadercompile.exe $noMPI $xboxFlag -shaderpath \"$shaderpath\" -mpi_workercount 32 -allowdebug $gameFlag"; system $cmdToRun; # other options..
build_sample_shaders.bat
--- mod/src/sdkshaders/build_sample_shaders.bat 2005-07-14 09:57:02.000000000 -0500 +++ mod/src/sdkshaders/build_sample_shaders.bat 2005-10-11 23:38:18.000000000 -0500 @@ -9,7 +9,7 @@ rem **** Call the batch files to build our stuff. -call ..\materialsystem\stdshaders\buildshaders.bat sdk_shaders -game "%__GameDir%" -source .. +call ..\materialsystem\stdshaders\buildshaders.bat kmp_shaders -game "%__GameDir%" -source .\.. goto end