diff --git a/.vscode/buildEffects.ps1 b/.vscode/buildEffects.ps1 new file mode 100644 index 0000000..a6ed69b --- /dev/null +++ b/.vscode/buildEffects.ps1 @@ -0,0 +1,26 @@ +#!/bin/bash +# buildEffects +# 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..." + +Set-Location $PSScriptRoot +Set-Location ../project_name + + +$fxc = "C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Utilities\bin\x86\fxc.exe" + +$files = Get-ChildItem -Path "Content\*" -Recurse -Include *fx + +foreach ($file in $files) +{ + $fileName = $file.BaseName + $filePath = $file.FullName + & $fxc /T fx_2_0 $filePath /Fo "${filePath}b" + + Write-Output "Built ${fileName}.fx to ${filePath}b" +} + + diff --git a/.vscode/launch.json b/.vscode/launch.json index b26c771..6af6fd8 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,5 +1,5 @@ { - // Change "mono" to "clr" for 64-bit .NET Framework debugging on Windows. + // Delete unnecessary configurations if unneeded. "type" isnt supported for platform specifc properties. // (See: https://github.com/OmniSharp/omnisharp-vscode/wiki/Desktop-.NET-Framework) "version": "0.2.0", @@ -57,4 +57,4 @@ "port": 55555 } ] -} \ No newline at end of file +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json index fdf992d..693003f 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -49,7 +49,6 @@ ], "group": "build", "problemMatcher": "$msCompile", - "dependsOn": "Build Content", }, { @@ -77,6 +76,7 @@ "command": "start", "args": [ "/wait", + "\"project_name.exe\"", //names the console window "${workspaceFolder}/project_name/bin/Debug/project_name.exe" ] }, @@ -95,7 +95,8 @@ "command": "start", "args": [ "/wait", - "${workspaceFolder}/project_name/bin/Release/project_name.exe" + "\"project_name.exe\"", //names the console window + "${workspaceFolder}/project_name/bin/Release/project_name.exe" ] }, "dependsOn": "Build (Release)", @@ -118,7 +119,7 @@ }, "problemMatcher": "$msCompile" }, - + { "label": "Build Content", "type": "shell", @@ -162,7 +163,7 @@ }, "problemMatcher": "$msCompile" }, - + { "label": "Process T4 Templates", "type": "shell", @@ -180,4 +181,4 @@ "problemMatcher": "$msCompile", }, ] -} \ No newline at end of file +} diff --git a/MonoGameContent.targets b/MonoGameContent.targets index fa00c36..5437823 100644 --- a/MonoGameContent.targets +++ b/MonoGameContent.targets @@ -6,16 +6,22 @@ /Library/Frameworks/Mono.framework/External/xbuild + Condition=" '$(OS)' == 'Windows_NT' And '$(MonoGameInstallDirectory)' == '' And Exists('C:\Program Files (x86)\MSBuild\MonoGame\v3.0\MonoGame.Common.props') ">C:\Program Files (x86)\MSBuild + /Library/Frameworks/Mono.framework/External/xbuild $(MSBuildProgramFiles32) + $(MonoGameInstallDir)Tools\MGCB.exe bin/DesktopGL obj/DesktopGL - + - + @@ -34,7 +40,7 @@ /usr/local/bin/mono /usr/bin/mono mono - $(MonoGameInstallDir)Tools\MGCB.exe + "$(MonoGameContentBuilderExe)" $(MonoExe) $(MonoGameContentBuilderCmd) $(MonoMacResourcePrefix) @@ -46,17 +52,17 @@
/platform:$(MonoGamePlatform)
+ + - - - diff --git a/getFNA.ps1 b/getFNA.ps1 index 162c762..2dfcddd 100644 --- a/getFNA.ps1 +++ b/getFNA.ps1 @@ -11,6 +11,22 @@ function checkDotnet() catch [System.Management.Automation.CommandNotFoundException] { Write-Output "ERROR: Dotnet is not installed. Please install dotnet to download the t4 tool." + return 0; + } + return 1; +} + +function installT4 () +{ + if (checkDotnet) { Invoke-Expression 'dotnet tool install -g dotnet-t4' } +} + +function checkGit () +{ + try { git | Out-Null } + catch [System.Management.Automation.CommandNotFoundException] + { + Write-Output "ERROR: Git is not installed. Please install git to download FNA." exit } } @@ -34,21 +50,6 @@ function check7zip () } } -function installT4 () -{ - if (checkDotnet) { Invoke-Expression 'dotnet tool install -g dotnet-t4' } -} - -function checkGit () -{ - try { git | Out-Null } - catch [System.Management.Automation.CommandNotFoundException] - { - Write-Output "ERROR: Git is not installed. Please install git to download FNA." - exit - } -} - function downloadFNA() { checkGit @@ -101,23 +102,19 @@ checkMsbuild if (Test-Path "${PSScriptRoot}\FNA") { - #if ((Read-Host -Prompt "Update FNA (y/n)?") -like 'y') { $shouldUpdate = true } $shouldUpdate = Read-Host -Prompt "Update FNA (y/n)?" } else { - #if ((Read-Host -Prompt "Download FNA (y/n)?") -like 'y') { $shouldDownload = true } $shouldDownload = Read-Host -Prompt "Download FNA (y/n)?" } if (Test-Path "${PSScriptRoot}\fnalibs") { - #if ((Read-Host -Prompt "Redownload fnalibs (y/n)?") -like 'y') { $shouldDownloadLibs = true } $shouldDownloadLibs = Read-Host -Prompt "Redownload fnalibs (y/n)?" } else { - #if ((Read-Host -Prompt "Download fnalibs (y/n)?") -like 'y') { $shouldDownloadLibs = true } $shouldDownloadLibs = Read-Host -Prompt "Download fnalibs (y/n)?" } @@ -177,5 +174,4 @@ dotnet restore "Nez/Nez.sln" "Building..." msbuild "Nez/Nez.sln" msbuild -t:restore $newProjectName -msbuild -t:buildcontent $newProjectName msbuild "${newProjectName}.sln" diff --git a/getFNA.sh b/getFNA.sh old mode 100755 new mode 100644 diff --git a/project_name.sln b/project_name.sln index c930ef8..7720695 100644 --- a/project_name.sln +++ b/project_name.sln @@ -39,4 +39,4 @@ Global Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection -EndGlobal +EndGlobal \ No newline at end of file diff --git a/project_name/CompiledContent/nez-logo-black.png b/project_name/Content/Textures/nez-logo-black.png similarity index 100% rename from project_name/CompiledContent/nez-logo-black.png rename to project_name/Content/Textures/nez-logo-black.png diff --git a/project_name/DefaultScene.cs b/project_name/DefaultScene.cs old mode 100755 new mode 100644 index 2e1f3e1..3c5efa0 --- a/project_name/DefaultScene.cs +++ b/project_name/DefaultScene.cs @@ -16,7 +16,7 @@ namespace project_name .AddComponent() .AddComponent(new PrototypeSprite(20, 20)); - var logo = Content.Load("nez-logo-black"); + var logo = Content.LoadTexture("Textures/nez-logo-black"); CreateEntity("logo") .SetPosition(Screen.Center) .AddComponent(new SpriteRenderer(logo)); diff --git a/project_name/DemoComponent.cs b/project_name/DemoComponent.cs old mode 100755 new mode 100644 index 2c823a1..72280e8 --- a/project_name/DemoComponent.cs +++ b/project_name/DemoComponent.cs @@ -6,7 +6,7 @@ namespace project_name { public class DemoComponent : Component { - int _buttonClickCounter; + int _ButtonClickCounter; public override void OnAddedToEntity() { @@ -23,12 +23,13 @@ namespace project_name void ImGuiDraw() { // do your actual drawing here - ImGui.Begin("Your ImGui Window", ImGuiWindowFlags.AlwaysAutoResize); + ImGui.Begin("Your ImGui Window", ImGuiWindowFlags.AlwaysAutoResize); ImGui.Text("This is being drawn in DemoComponent"); - if(ImGui.Button($"Clicked me {_buttonClickCounter} times")) - _buttonClickCounter++; + if (ImGui.Button($"Clicked me {_ButtonClickCounter} times")) + _ButtonClickCounter++; ImGui.End(); } } } + diff --git a/project_name/Game1.cs b/project_name/Game1.cs old mode 100755 new mode 100644 diff --git a/project_name/T4Templates/ContentPathGenerator.tt b/project_name/T4Templates/ContentPathGenerator.tt old mode 100755 new mode 100644 diff --git a/project_name/project_name.csproj b/project_name/project_name.csproj index 9699cfa..a797bdc 100644 --- a/project_name/project_name.csproj +++ b/project_name/project_name.csproj @@ -38,7 +38,7 @@ PreserveNewest
- + @@ -58,7 +58,6 @@ - true true