diff --git a/.gitignore b/.gitignore index ba3f579..1ddc2ed 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ FNA/ fnalibs/ project_name/bin/ project_name/obj/ +project_name/CompiledContent/.mgstats diff --git a/getFNA.sh b/getFNA.sh index 7d26acb..35b8f23 100755 --- a/getFNA.sh +++ b/getFNA.sh @@ -91,4 +91,16 @@ else fi if [[ $shouldDownloadLibs =~ ^[Yy]$ ]]; then getLibs -fi \ No newline at end of file +fi + + +# Rename project +read -p "Enter the project name to use for your folder and csproj file: " newProjectName +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 + +mv project_name/project_name.csproj "project_name/$newProjectName.csproj" +mv project_name "$newProjectName" diff --git a/project_name/.vscode/buildEffects.ps1 b/project_name/.vscode/buildEffects.ps1 deleted file mode 100644 index 842c2d0..0000000 --- a/project_name/.vscode/buildEffects.ps1 +++ /dev/null @@ -1,17 +0,0 @@ -# Compiles all .fx files found in the project's Content directory. -# Intended for usage with VS Code Build Tasks tooling. -# You may need to change the path to fxc.exe depending on your installation. - -Write-Output "Starting build process..." - -Get-ChildItem ".\Content\" -R -Filter *.fx | -Foreach-Object { - $fileFullname = $_.FullName - $fileBasename = $_.BaseName - $fileDirectory = $_.Directory.FullName - - & 'C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Utilities\bin\x86\fxc.exe' ` - /T fx_2_0 $fileFullname /Fo "$fileDirectory\$fileBasename.fxb" - - Write-Output "" -} \ No newline at end of file diff --git a/project_name/.vscode/settings.json b/project_name/.vscode/settings.json index b4537c8..6498dc9 100644 --- a/project_name/.vscode/settings.json +++ b/project_name/.vscode/settings.json @@ -6,4 +6,12 @@ // 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 + } } \ No newline at end of file diff --git a/project_name/.vscode/tasks.json b/project_name/.vscode/tasks.json index 06fb8a6..0dcf6fe 100644 --- a/project_name/.vscode/tasks.json +++ b/project_name/.vscode/tasks.json @@ -88,6 +88,28 @@ "command": "& ${workspaceFolder}/.vscode/buildEffects.ps1" }, "problemMatcher": "$msCompile" - } + }, + + { + "label": "Build Content", + "type": "shell", + "group": "build", + "command": "mono /Applications/Pipeline.app/Contents/MonoBundle/MGCB.exe /@:Content.mgcb", + "options": { + "cwd": "${workspaceFolder}/CompiledContent" + }, + "problemMatcher": "$msCompile" + }, + + { + "label": "Force Build Content", + "type": "shell", + "group": "build", + "command": "mono /Applications/Pipeline.app/Contents/MonoBundle/MGCB.exe /@:Content.mgcb -r", + "options": { + "cwd": "${workspaceFolder}/CompiledContent" + }, + "problemMatcher": "$msCompile" + }, ] } \ No newline at end of file diff --git a/project_name/CompiledContent/Content.mgcb b/project_name/CompiledContent/Content.mgcb new file mode 100644 index 0000000..76111de --- /dev/null +++ b/project_name/CompiledContent/Content.mgcb @@ -0,0 +1,18 @@ + +#----------------------------- Global Properties ----------------------------# + +/outputDir:bin/$(Platform) +/intermediateDir:obj/$(Platform) +/platform:DesktopGL +/config: +/profile:HiDef +/compress:False + +#-------------------------------- References --------------------------------# + +/reference:../../Nez.FNA/Nez/Nez.PipelineImporter/bin/Debug/Ionic.ZLib.dll +/reference:../../Nez.FNA/Nez/Nez.PipelineImporter/bin/Debug/Newtonsoft.Json.dll +/reference:../../Nez.FNA/Nez/Nez.PipelineImporter/bin/Debug/Nez.PipelineImporter.dll +/reference:../../Nez.FNA/Nez/Nez.PipelineImporter/bin/Debug/Nez.dll + +#---------------------------------- Content ---------------------------------# diff --git a/project_name/project_name.csproj b/project_name/project_name.csproj index 1344f5e..3a44b8b 100644 --- a/project_name/project_name.csproj +++ b/project_name/project_name.csproj @@ -19,6 +19,23 @@ PreserveNewest + + + + + Content/%(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + + + + + + + + + diff --git a/win_getFNA.ps1 b/win_getFNA.ps1 deleted file mode 100644 index f6cd6ed..0000000 --- a/win_getFNA.ps1 +++ /dev/null @@ -1,118 +0,0 @@ -# Program: win_getFNA -# Author: Caleb Cornett -# Usage: ./win_getFNA.ps1 -# Description: Quick and easy way to install a local copy of FNA and its native libraries. -# NOTE: 7-Zip must be installed to decompress fnalibs. - -# Checks if git is installed -function checkGit() -{ - git --version > $null 2>&1 - if ( -Not $? ) { - Write-Error "ERROR: Git is required to pull FNA from the command line." - Write-Output "Either install git or download and unzip FNA manually." - exit 1 - } -} - -# Clones FNA from the git master branch -function downloadFNA() -{ - checkGit - Write-Output "Downloading FNA..." - git -C $PSScriptRoot clone https://github.com/FNA-XNA/FNA.git --recursive - if ($?) { - Write-Output "Finished downloading!" - } - else { - Write-Error "ERROR: Unable to download successfully. Maybe try again later?" - } -} - -# Pulls FNA from the git master branch -function updateFNA() -{ - checkGit - Write-Output "Updating to the latest git version of FNA..." - git -C $PSScriptRoot/FNA pull --recurse-submodules - if ($?) { - Write-Output "Finished updating!" - } - else { - Write-Error "ERROR: Unable to update." - } -} - -function getLibs() -{ - # Downloading - Write-Output "Downloading latest fnalibs..." - Invoke-WebRequest -Uri http://fna.flibitijibibo.com/archive/fnalibs.tar.bz2 -OutFile $PSScriptRoot/fnalibs.tar.bz2 - if ($?) { - Write-Output "Finished downloading!" - } - else { - Write-Error "ERROR: Unable to download successfully. Maybe try again later?" - exit 1 - } - - # Is 7Zip installed? - # Edit this to be Program Files (x86) if you installed the 32-bit version. - $7zip = 'C:\Program Files\7-Zip\7z.exe' - & $7zip >$null - if (-Not $?) - { - Write-Error "7Zip is required to decompress fnalibs." - exit 1 - } - - # Decompress - & $7zip x -y $PSScriptRoot/fnalibs.tar.bz2 -o"$PSScriptRoot" - & $7zip x -y $PSScriptRoot/fnalibs.tar -o"$PSScriptRoot/fnalibs" >$null - - if ($?) - { - Write-Output "Finished decompressing!" - Remove-Item $PSScriptRoot/fnalibs.tar.bz2 - Remove-Item $PSScriptRoot/fnalibs.tar - } - else - { - Write-Error "ERROR: Unable to decompress successfully." - } -} - - -# FNA -if ( -Not (Test-Path -Path "$PSScriptRoot/FNA") ) -{ - $shouldDownload = Read-Host "Download FNA (y/n)? " - if ($shouldDownload -match "^[Yy]$") - { - downloadFNA - } -} -else -{ - $shouldUpdate = Read-Host "Update FNA (y/n)? " - if ($shouldUpdate -match "^[Yy]$") - { - updateFNA - } -} - -# FNALIBS -$shouldDownloadLibs = "" -if ( -Not (Test-Path -Path "$PSScriptRoot/fnalibs") ) -{ - $shouldDownloadLibs = Read-Host "Download fnalibs (y/n)? " -} -else -{ - $shouldDownloadLibs = Read-Host "Redownload fnalibs (y/n)? " -} - -if ($shouldDownloadLibs -match "^[Yy]$") -{ - getLibs -} \ No newline at end of file