diff --git a/.gitignore b/.gitignore index 0cb3aef..5694e90 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ .DS_Store +.vs FNA/ +ImGui.NET/ fnalibs/ project_name/bin project_name/obj diff --git a/project_name/.vscode/buildEffects.sh b/.vscode/buildEffects.sh similarity index 97% rename from project_name/.vscode/buildEffects.sh rename to .vscode/buildEffects.sh index 5e0174e..1cd37eb 100755 --- a/project_name/.vscode/buildEffects.sh +++ b/.vscode/buildEffects.sh @@ -6,6 +6,7 @@ printf "Starting build process...\n" +cd project_name for file in `find ./Content/** -name "*.fx"` ; do # Hush, wine... diff --git a/project_name/.vscode/launch.json b/.vscode/launch.json similarity index 79% rename from project_name/.vscode/launch.json rename to .vscode/launch.json index d2adc58..cae6c1a 100644 --- a/project_name/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,12 +8,12 @@ "name": "Launch", "type": "mono", "request": "launch", - "program": "${workspaceFolder}/bin/Debug/project_name.exe", + "program": "${workspaceFolder}/project_name/bin/Debug/project_name.exe", "cwd": "${workspaceFolder}", "preLaunchTask": "Build (Debug)", "osx":{ "env": { - "DYLD_LIBRARY_PATH": "${workspaceFolder}/bin/Debug/osx/" + "DYLD_LIBRARY_PATH": "${workspaceFolder}/project_name/bin/Debug/osx/" }, } }, diff --git a/project_name/.vscode/processT4Templates.sh b/.vscode/processT4Templates.sh similarity index 97% rename from project_name/.vscode/processT4Templates.sh rename to .vscode/processT4Templates.sh index fac433f..f6339ff 100755 --- a/project_name/.vscode/processT4Templates.sh +++ b/.vscode/processT4Templates.sh @@ -6,6 +6,8 @@ printf "Starting T4 processing...\n" +cd project_name + # create our output directory mkdir -p T4Templates/Output diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..2882144 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,29 @@ +{ + // This prevents Omnisharp from prematurely creating obj and bin directories. + // Change this to true after changing the name of the csproj file and running Restore Project. + "omnisharp.autoStart": true, + + // This just circumvents annoying default behavior with the C# extension... + // If you really like Code Lens, feel free to change this. + "csharp.referencesCodeLens.enabled": false, + + "files.exclude": { + "**/.[^v]*": true, // hide any files that start with a '.' but keep the .vscode folder + ".vs": true, // Visual Studio settings + "getFNA.sh": true, + "imgui.ini": true, + "MonoGameContent.targets": true, + "**/obj": true, + "**/bin": true, + ".gitignore": true, + ".gitmodules": true, + "README.md": true, + "fnalibs": true, + "project_name/CompiledContent/.mgstats": true, + "**/*.csproj*": true, + "**/*.sln": true, + "FNA/[^src]*": true, // hide everything but the src folder + "Nez/{[^DN]*}": true, // hide everything except what begins with D or N + "Nez/Nez.*.*": true, // hide the files in the root of the repo + } +} diff --git a/project_name/.vscode/tasks.json b/.vscode/tasks.json similarity index 79% rename from project_name/.vscode/tasks.json rename to .vscode/tasks.json index dc3564f..e27f8d5 100644 --- a/project_name/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -12,7 +12,7 @@ { "label": "Clean Project", "type": "shell", - "command": "msbuild /t:clean /p:configuration=Debug ; msbuild /t:clean /p:configuration=Release", + "command": "msbuild project_name /t:clean /p:configuration=Debug ; msbuild project_name /t:clean /p:configuration=Release", "group": "build", "problemMatcher": "$msCompile", }, @@ -22,6 +22,7 @@ "type": "shell", "command": "msbuild", "args": [ + "project_name", "/p:configuration=Debug", "/t:build" ], @@ -35,6 +36,7 @@ "type": "shell", "command": "msbuild", "args": [ + "project_name", "/p:configuration=Release", "/t:build" ], @@ -47,13 +49,13 @@ "type": "shell", "group": "build", "osx":{ - "command": "DYLD_LIBRARY_PATH=${workspaceFolder}/bin/Debug/osx/ mono ${workspaceFolder}/bin/Debug/project_name.exe" + "command": "DYLD_LIBRARY_PATH=${workspaceFolder}/project_name/bin/Debug/osx/ mono ${workspaceFolder}/project_name/bin/Debug/project_name.exe" }, "windows":{ "command": "cmd", "args": [ "/k", - "${workspaceFolder}/bin/Debug/project_name.exe" + "${workspaceFolder}/project_name/bin/Debug/project_name.exe" ] }, "dependsOn": "Build (Debug)", @@ -65,13 +67,13 @@ "type": "shell", "group": "build", "osx":{ - "command": "DYLD_LIBRARY_PATH=${workspaceFolder}/bin/Release/osx/ mono ${workspaceFolder}/bin/Release/project_name.exe" + "command": "DYLD_LIBRARY_PATH=${workspaceFolder}/project_name/bin/Release/osx/ mono ${workspaceFolder}/project_name/bin/Release/project_name.exe" }, "windows":{ "command": "cmd", "args": [ "/k", - "${workspaceFolder}/bin/Release/project_name.exe" + "${workspaceFolder}/project_name/bin/Release/project_name.exe" ] }, "dependsOn": "Build (Release)", @@ -95,9 +97,9 @@ "label": "Build Content", "type": "shell", "group": "build", - "command": "mono /Applications/Pipeline.app/Contents/MonoBundle/MGCB.exe /@:Content.mgcb", + "command": "msbuild /t:BuildContent", "options": { - "cwd": "${workspaceFolder}/CompiledContent" + "cwd": "${workspaceFolder}/project_name" }, "problemMatcher": "$msCompile" }, @@ -108,7 +110,7 @@ "group": "build", "command": "mono /Applications/Pipeline.app/Contents/MonoBundle/MGCB.exe /@:Content.mgcb -r", "options": { - "cwd": "${workspaceFolder}/CompiledContent" + "cwd": "${workspaceFolder}/project_name/CompiledContent" }, "problemMatcher": "$msCompile" }, @@ -117,7 +119,7 @@ "label": "Open Pipeline Tool", "type": "shell", "group": "build", - "command": "export MONOGAME_PIPELINE_PROJECT=${workspaceFolder}/CompiledContent/Content.mgcb && /Applications/Pipeline.app/Contents/MacOS/Pipeline", + "command": "export MONOGAME_PIPELINE_PROJECT=${workspaceFolder}/project_name/CompiledContent/Content.mgcb && /Applications/Pipeline.app/Contents/MacOS/Pipeline", "problemMatcher": "$msCompile" }, diff --git a/MonoGameContent.targets b/MonoGameContent.targets new file mode 100644 index 0000000..fa00c36 --- /dev/null +++ b/MonoGameContent.targets @@ -0,0 +1,93 @@ + + + + /Library/Frameworks/Mono.framework/External/xbuild + $(MSBuildProgramFiles32) + bin/DesktopGL + obj/DesktopGL + + + + + + + + + + + + true + + + + + $(MonoGameInstallDirectory)\MonoGame\v3.0\ + + /Library/Frameworks/Mono.framework/Versions/Current/bin/mono + /usr/local/bin/mono + /usr/bin/mono + mono + $(MonoGameInstallDir)Tools\MGCB.exe + "$(MonoGameContentBuilderExe)" + $(MonoExe) $(MonoGameContentBuilderCmd) + $(MonoMacResourcePrefix) + $(IPhoneResourcePrefix) + $(MonoAndroidAssetsPrefix) + $(PlatformResourcePrefix)\ + + /quiet +
/platform:$(MonoGamePlatform)
+
+ + + + + + + + + + +
+ + + + + BuildContent; + $(BuildDependsOn); + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/README.md b/README.md index 920663d..10c48de 100644 --- a/README.md +++ b/README.md @@ -18,10 +18,12 @@ Start new FNA projects with Nez quickly and easily with handy setup scripts, a v ## Setup Instructions ## 1. Download and unzip the ZIP archive (don't clone the repo!) -2. Run `./getFNA.sh` (macOS) to download the latest Nez, FNA and fnalibs to the directory. You can run this script again if you want to update either FNA or the fnalibs at a later point. Nez is setup as a submodule so you can update it in the normal fashion. -3. Open the newly-created and named `PROJECT_NAME_YOU_CHOSE.code-workspace` file (or open the project folder in Visual Studio Code or the top-level sln in Visual Studio) +2. Run `./getFNA.sh` (macOS) to download the latest Nez, FNA and fnalibs to the directory. You can run this script again if you want to update either FNA or the fnalibs at a later point. If you get missing DLL errors when running in Visual Studio copy the FNA libs into your `/usr/local/lib` folder. With Visual Studio Code `DYLD_LIBRARY_PATH` is set automatically so it won't show the DLL not found error. Nez is setup as a submodule so you can update it in the normal fashion. +3. Open the root folder that contains the .sln file in Visual Studio Code or the .sln file directly in Visual Studio -That's it! Now you're ready to build and run the base project. When developing raw content (files not processed by the Pipeline tool) should be placed in the `Content` folder and anything that needs processing should go in the `CompiledContent` folder and added to the Pipeline tool. +That's it! Now you're ready to build and run the base project. When developing, raw content (files not processed by the Pipeline tool) should be placed in the `Content` folder and anything that needs processing should go in the `CompiledContent` folder and added to the Pipeline tool. + +The setup process will also init a git repo for you with Nez added as a submodule. If you want to see the output of `Debug.*` calls in the VS Code Debug Console, you have to install a listener by adding this somewhere in your code (Game1 by default has one for you): `System.Diagnostics.Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(System.Console.Out));` diff --git a/getFNA.sh b/getFNA.sh index 34abdb6..64a2e36 100755 --- a/getFNA.sh +++ b/getFNA.sh @@ -42,7 +42,7 @@ function downloadFNA() echo "Downloading FNA..." git -C $MY_DIR clone https://github.com/FNA-XNA/FNA.git --recursive if [ $? -eq 0 ]; then - echo "Finished downloading!\n" + echo "Finished downloading!" else echo >&2 "ERROR: Unable to download successfully. Maybe try again later?" fi @@ -55,13 +55,14 @@ function updateFNA() echo "Updating to the latest git version of FNA..." git -C "$MY_DIR/FNA" pull --recurse-submodules if [ $? -eq 0 ]; then - echo "Finished updating!\n" + echo "Finished updating!" else echo >&2 "ERROR: Unable to update." exit 1 fi } + # Downloads and extracts prepackaged archive of native libraries ("fnalibs") function getLibs() { @@ -81,6 +82,7 @@ function getLibs() tar xjC $MY_DIR/fnalibs -f $MY_DIR/fnalibs.tar.bz2 if [ $? -eq 0 ]; then echo "Finished decompressing!" + echo "" rm $MY_DIR/fnalibs.tar.bz2 else >&2 echo "ERROR: Unable to decompress successfully." @@ -91,25 +93,33 @@ function getLibs() # Get the directory of this script MY_DIR=$(dirname "$BASH_SOURCE") + +# gather input + # FNA if [ ! -d "$MY_DIR/FNA" ]; then read -p "Download FNA (y/n)? " shouldDownload - if [[ $shouldDownload =~ ^[Yy]$ ]]; then - downloadFNA - fi else read -p "Update FNA (y/n)? " shouldUpdate - if [[ $shouldUpdate =~ ^[Yy]$ ]]; then - updateFNA - fi fi -# FNALIBS if [ ! -d "$MY_DIR/fnalibs" ]; then read -p "Download fnalibs (y/n)? " shouldDownloadLibs else read -p "Redownload fnalibs (y/n)? " shouldDownloadLibs fi + + +# act on the input + +# FNA +if [[ $shouldDownload =~ ^[Yy]$ ]]; then + downloadFNA +elif [[ $shouldUpdate =~ ^[Yy]$ ]]; then + updateFNA +fi + +# FNALIBS if [[ $shouldDownloadLibs =~ ^[Yy]$ ]]; then getLibs fi @@ -119,29 +129,25 @@ fi installT4 -# Rename project + +# Only proceed from here if we have not yet renamed the project if [ ! -d "$MY_DIR/project_name" ]; then # old project_name folder already renamed so we are all done here exit 1 fi - + read -p "Enter the project name to use for your folder and csproj file or 'exit' to quit: " newProjectName if [[ $newProjectName = 'exit' || -z "$newProjectName" ]]; then exit 1 fi -sed -i '' "s/project_name/$newProjectName/g" project_name.code-workspace -sed -i '' "s/project_name/$newProjectName/g" project_name.sln -sed -i '' "s/project_name/$newProjectName/g" .gitignore -sed -i '' "s/project_name/$newProjectName/g" project_name/project_name.sln -sed -i '' "s/project_name/$newProjectName/g" project_name/project_name.csproj -sed -i '' "s/project_name/$newProjectName/g" project_name/Game1.cs -sed -i '' "s/project_name/$newProjectName/g" project_name/Program.cs -sed -i '' "s/project_name/$newProjectName/g" project_name/.vscode/tasks.json -sed -i '' "s/project_name/$newProjectName/g" project_name/.vscode/launch.json +# any files that need to have project_name replaced with the new project name should be here +files=(project_name.sln .gitignore project_name/project_name.csproj project_name/Game1.cs project_name/Program.cs .vscode/tasks.json .vscode/settings.json .vscode/launch.json .vscode/buildEffects.sh .vscode/processT4Templates.sh) +for file in "${files[@]}"; do + sed -i '' "s/project_name/$newProjectName/g" $file +done -mv project_name.code-workspace "$newProjectName.code-workspace" mv project_name.sln "$newProjectName.sln" mv project_name/project_name.sln "project_name/$newProjectName.sln" mv project_name/project_name.csproj "project_name/$newProjectName.csproj" @@ -149,9 +155,17 @@ mv project_name/project_name.csproj.user "project_name/$newProjectName.csproj.us mv project_name "$newProjectName" git init -git submodule add git@github.com:prime31/Nez.FNA.git -cd Nez.FNA +git submodule add https://github.com/prime31/Nez.git +cd Nez git submodule init git submodule update -printf "\n\nManually run the following command:\n\nnuget restore Nez.FNA/Nez/Nez.sln && msbuild Nez.FNA/Nez/Nez.sln && msbuild /t:restore $newProjectName\n\n" +command -v pbcopy > /dev/null 2>&1 +if [ ! $? -eq 0 ]; then + printf "\n\nManually run the following command:\n\nnuget restore Nez/Nez.sln && msbuild Nez/Nez.sln && msbuild /t:restore $newProjectName\n\n" +else + echo "nuget restore Nez/Nez.sln && msbuild Nez/Nez.sln && msbuild /t:restore $newProjectName" | pbcopy + echo "" + echo "A build command was copied to your clipboard. Paste and run it now." + echo "" +fi diff --git a/project_name.code-workspace b/project_name.code-workspace deleted file mode 100644 index a2a64fb..0000000 --- a/project_name.code-workspace +++ /dev/null @@ -1,14 +0,0 @@ -{ - "folders": [ - { - "path": "project_name" - }, - { - "path": "Nez.FNA/Nez/Nez.Portable" - } - ], - "settings": { - "omnisharp.autoStart": true, - "csharp.referencesCodeLens.enabled": false - } -} \ No newline at end of file diff --git a/project_name.sln b/project_name.sln index 7d9eda8..daf790d 100644 --- a/project_name.sln +++ b/project_name.sln @@ -1,52 +1,25 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -GlobalSection(SolutionConfigurationPlatforms) = preSolution -Debug|Any CPU = Debug|Any CPU -Debug|x86 = Debug|x86 -Release|Any CPU = Release|Any CPU -Release|x86 = Release|x86 -GlobalSection(ProjectConfigurationPlatforms) = postSolution -{D488C5AD-5192-4A08-88FD-22219586ED9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{D488C5AD-5192-4A08-88FD-22219586ED9F}.Debug|Any CPU.Build.0 = Debug|Any CPU -{D488C5AD-5192-4A08-88FD-22219586ED9F}.Debug|x86.ActiveCfg = Debug|x86 -{D488C5AD-5192-4A08-88FD-22219586ED9F}.Debug|x86.Build.0 = Debug|x86 -{D488C5AD-5192-4A08-88FD-22219586ED9F}.Release|Any CPU.ActiveCfg = Release|Any CPU -{D488C5AD-5192-4A08-88FD-22219586ED9F}.Release|Any CPU.Build.0 = Release|Any CPU -{D488C5AD-5192-4A08-88FD-22219586ED9F}.Release|x86.ActiveCfg = Release|x86 -{D488C5AD-5192-4A08-88FD-22219586ED9F}.Release|x86.Build.0 = Release|x86 -{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|Any CPU.Build.0 = Debug|Any CPU -{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|x86.ActiveCfg = Debug|Any CPU -{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|x86.Build.0 = Debug|Any CPU -{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|Any CPU.ActiveCfg = Release|Any CPU -{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|Any CPU.Build.0 = Release|Any CPU -{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|x86.ActiveCfg = Release|Any CPU -{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|x86.Build.0 = Release|Any CPU -{F6DF8289-8138-41C7-B747-E672AFEE44A4}.Debug|Any CPU.ActiveCfg = Debug|x86 -{F6DF8289-8138-41C7-B747-E672AFEE44A4}.Debug|Any CPU.Build.0 = Debug|x86 -{F6DF8289-8138-41C7-B747-E672AFEE44A4}.Debug|x86.ActiveCfg = Debug|x86 -{F6DF8289-8138-41C7-B747-E672AFEE44A4}.Debug|x86.Build.0 = Debug|x86 -{F6DF8289-8138-41C7-B747-E672AFEE44A4}.Release|Any CPU.ActiveCfg = Release|x86 -{F6DF8289-8138-41C7-B747-E672AFEE44A4}.Release|Any CPU.Build.0 = Release|x86 -{F6DF8289-8138-41C7-B747-E672AFEE44A4}.Release|x86.ActiveCfg = Release|x86 -{F6DF8289-8138-41C7-B747-E672AFEE44A4}.Release|x86.Build.0 = Release|x86 -GlobalSection(SolutionProperties) = preSolution -HideSolutionNode = FALSE -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "project_name", "project_name\project_name.csproj", "{8C576ECC-147D-4B4A-8EC1-56533D26A178}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "project_name", "project_name\project_name.csproj", "{3CB9E917-FEF7-453F-A88D-6B85B552B058}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FNA", "FNA\FNA.csproj", "{35253CE1-C864-4CD3-8249-4D1319748E8F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nez.FNA", "Nez.FNA\Nez.FNA\Nez.FNA.csproj", "{11A5855C-B12C-4F8D-B935-56F3D0B671C3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nez.FNA", "Nez\Nez.Portable\Nez.FNA.csproj", "{11A5855C-B12C-4F8D-B935-56F3D0B671C3}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nez.FNA.ImGui", "Nez\Nez.ImGui\Nez.FNA.ImGui.csproj", "{16DA6D66-4DFD-46D4-A367-C02B48B80CAA}" +EndProject + Global GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8C576ECC-147D-4B4A-8EC1-56533D26A178}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8C576ECC-147D-4B4A-8EC1-56533D26A178}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3CB9E917-FEF7-453F-A88D-6B85B552B058}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3CB9E917-FEF7-453F-A88D-6B85B552B058}.Debug|Any CPU.Build.0 = Debug|Any CPU {35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|Any CPU.Build.0 = Debug|Any CPU {11A5855C-B12C-4F8D-B935-56F3D0B671C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {11A5855C-B12C-4F8D-B935-56F3D0B671C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {16DA6D66-4DFD-46D4-A367-C02B48B80CAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {16DA6D66-4DFD-46D4-A367-C02B48B80CAA}.Debug|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/project_name/.vscode/settings.json b/project_name/.vscode/settings.json deleted file mode 100644 index 5c6593d..0000000 --- a/project_name/.vscode/settings.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - // This prevents Omnisharp from prematurely creating obj and bin directories. - // Change this to true after changing the name of the csproj file and running Restore Project. - "omnisharp.autoStart": true, - - // This just circumvents annoying default behavior with the C# extension... - // If you really like Code Lens, feel free to change this. - "csharp.referencesCodeLens.enabled": false, - - "files.exclude": { - "obj": true, - "bin": true, - "CompiledContent/bin": true, - "CompiledContent/obj": true, - "CompiledContent/.mgstats": true, - "*.csproj.user": true, - "*.csproj": true, - "*.sln": true - } -} \ No newline at end of file diff --git a/project_name/Game1.cs b/project_name/Game1.cs index a5a2783..9f9faa5 100644 --- a/project_name/Game1.cs +++ b/project_name/Game1.cs @@ -1,4 +1,5 @@ using Nez; +using Nez.ImGuiTools; namespace project_name { @@ -14,7 +15,8 @@ namespace project_name #if DEBUG System.Diagnostics.Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(System.Console.Out)); #endif - + + // setup a Scene so we have something to show var newScene = new Scene(); newScene.addRenderer(new DefaultRenderer()); @@ -24,6 +26,11 @@ namespace project_name .addComponent(new Nez.Sprites.Sprite(logo)); scene = newScene; + + // optionally render Nez in an ImGui window + var imGuiManager = new ImGuiManager(); + Core.registerGlobalManager( imGuiManager ); + imGuiManager.setEnabled( true ); } } } \ No newline at end of file diff --git a/project_name/T4Templates/ContentPathGenerator.tt b/project_name/T4Templates/ContentPathGenerator.tt index 3376cc3..876e4e6 100644 --- a/project_name/T4Templates/ContentPathGenerator.tt +++ b/project_name/T4Templates/ContentPathGenerator.tt @@ -49,6 +49,9 @@ namespace Nez <#+ + // all the valid file extensions we should add to the output file + private string[] fileExtensionsToCopy = new string[] { ".xnb", ".png", ".ogg", ".wav", ".fxb" }; + // C# reserved keywords private System.Collections.Generic.List keywords = new System.Collections.Generic.List { @@ -63,7 +66,7 @@ namespace Nez void printDirectoryClass( string dir, int depth, string sourceFolder ) { var dirInfo = new DirectoryInfo( dir ); - var firstIndent = new string( ' ', depth * 5 ); + var firstIndent = new string( ' ', depth * 4 ); var className = generateClassName( dirInfo.Name, true ); WriteLine( "{0}public static class {1}\n{2}{{", firstIndent, className, firstIndent ); @@ -81,10 +84,10 @@ namespace Nez // prints a const string for each file in the directory void printContentFiles( string dir, int depth, string sourceFolder ) { - var firstIndent = new string( '\t', depth ); + var firstIndent = new string( ' ', depth * 4 ); var files = Directory.EnumerateFiles( dir ) - .Where( s => s.EndsWith( ".xnb" ) || s.EndsWith( ".png" ) || s.EndsWith( ".ogg" ) || s.EndsWith( ".wav" ) || s.EndsWith( ".fxb" ) ); + .Where( s => Array.IndexOf( fileExtensionsToCopy, Path.GetExtension( s ) ) >= 0 ); foreach( var file in files ) { // clear out all of the path up to the sourceFolder so we get just the relative path to the Content folder diff --git a/project_name/project_name.csproj b/project_name/project_name.csproj index fbd30aa..f6134a9 100644 --- a/project_name/project_name.csproj +++ b/project_name/project_name.csproj @@ -1,70 +1,87 @@ + - - - Exe - net471 - false - AnyCPU - project_name - DesktopGL - - - - - - - - - - - - PreserveNewest - - - - - - - Content/%(RecursiveDir)%(Filename)%(Extension) - PreserveNewest - - - - - - - - - - - - - true - true - - - - - - x86\%(RecursiveDir)%(Filename)%(Extension) - PreserveNewest - - - x64\%(RecursiveDir)%(Filename)%(Extension) - PreserveNewest - - - osx\%(RecursiveDir)%(Filename)%(Extension) - PreserveNewest - - - lib\%(RecursiveDir)%(Filename)%(Extension) - PreserveNewest - - - lib64\%(RecursiveDir)%(Filename)%(Extension) - PreserveNewest - - - + + Exe + net471 + false + AnyCPU + project_name + DesktopGL + True + + + + + + + + + + + + + Content/nez/effects/%(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + Content/nez/textures/%(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + + + + + PreserveNewest + + + + + + + Content/%(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + + + + + + + + + + + + + + + true + true + + + + + + x86\%(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + x64\%(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + osx\%(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + lib\%(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + lib64\%(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + diff --git a/project_name/project_name.sln b/project_name/project_name.sln deleted file mode 100644 index 8576363..0000000 --- a/project_name/project_name.sln +++ /dev/null @@ -1,24 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "project_name", "project_name.csproj", "{BD11109C-8FD1-4FFE-A3EF-8390A1EAE1A1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FNA", "../FNA/FNA.csproj", "{35253CE1-C864-4CD3-8249-4D1319748E8F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nez.FNA", "../Nez.FNA/Nez.FNA/Nez.FNA.csproj", "{11A5855C-B12C-4F8D-B935-56F3D0B671C3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nez.PipelineImporter", "../Nez.FNA/Nez/Nez.PipelineImporter/Nez.PipelineImporter.csproj", "{63E831F4-B847-4150-B5AF-CBE059EE27B8}" -EndProject - -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BD11109C-8FD1-4FFE-A3EF-8390A1EAE1A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BD11109C-8FD1-4FFE-A3EF-8390A1EAE1A1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BD11109C-8FD1-4FFE-A3EF-8390A1EAE1A1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BD11109C-8FD1-4FFE-A3EF-8390A1EAE1A1}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal