diff --git a/Game/Game.vcxproj b/Game/Game.vcxproj index f59a23b..11af1ff 100644 --- a/Game/Game.vcxproj +++ b/Game/Game.vcxproj @@ -72,7 +72,7 @@ cd assets -"$(SolutionDir)NFAssetBuilder\bin\x64$(Configuration)\NFAssetBuilder.exe" +"$(SolutionDir)NFAssetBuilder\bin\x64Release\NFAssetBuilder.exe" if exist "$(OutDir)assets" (rmdir "$(OutDir)assets" /S /Q && goto end) else goto end :end mkdir "$(OutDir)assets" @@ -105,7 +105,7 @@ if exist "base.nfpack" (copy "base.nfpack" "$(OutDir)assets\") cd assets -"$(SolutionDir)NFAssetBuilder\bin\x64$(Configuration)\NFAssetBuilder.exe" +"$(SolutionDir)NFAssetBuilder\bin\x64Release\NFAssetBuilder.exe" if exist "$(OutDir)assets" (rmdir "$(OutDir)assets" /S /Q && goto end) else goto end :end mkdir "$(OutDir)assets" diff --git a/NothinFancy/NothinFancy.vcxproj b/NothinFancy/NothinFancy.vcxproj index 214b1dc..1e6d76e 100644 --- a/NothinFancy/NothinFancy.vcxproj +++ b/NothinFancy/NothinFancy.vcxproj @@ -81,7 +81,7 @@ cd assets -"$(SolutionDir)NFAssetBuilder\bin\x64$(Configuration)\NFAssetBuilder.exe" +"$(SolutionDir)NFAssetBuilder\bin\x64Release\NFAssetBuilder.exe" @@ -116,7 +116,7 @@ cd assets -"$(SolutionDir)NFAssetBuilder\bin\x64$(Configuration)\NFAssetBuilder.exe" +"$(SolutionDir)NFAssetBuilder\bin\x64Release\NFAssetBuilder.exe" diff --git a/NothinFancy/src/Application.cpp b/NothinFancy/src/Application.cpp index 846ee07..d1c3caf 100644 --- a/NothinFancy/src/Application.cpp +++ b/NothinFancy/src/Application.cpp @@ -83,6 +83,7 @@ namespace nf { #ifdef _DEBUG Debug::startTimer(); SetThreadDescription(GetCurrentThread(), L"Input Thread"); + SetConsoleTitle(toWide("Nothin' Fancy v" + (std::string)NFVERSION).data()); #endif if (m_defaultState.empty()) NFError("No default gamestate has been set!"); diff --git a/NothinFancy/src/Assets.cpp b/NothinFancy/src/Assets.cpp index 04e313b..cc2e8d1 100644 --- a/NothinFancy/src/Assets.cpp +++ b/NothinFancy/src/Assets.cpp @@ -45,9 +45,11 @@ namespace nf { } AssetPack::AssetPack() : + m_member(false), m_loaded(false) { - + if (!Application::getApp() || !Application::getApp()->getCurrentState()) + m_member = true; } void AssetPack::load(const char* packName) { @@ -255,10 +257,9 @@ namespace nf { } m_loaded = true; - if (packName != "base.nfpack") { - if (!Application::getApp()->getCurrentState()->isRunning()) + if (packName != "base.nfpack") + if (Application::getApp()->getCurrentState()->isLoading() && m_member) Application::getApp()->getCurrentState()->m_nfObjects.push_back(this); - } } bool AssetPack::isLoaded() { diff --git a/NothinFancy/src/IntroGamestate.cpp b/NothinFancy/src/IntroGamestate.cpp index 3192cd2..9c2268a 100644 --- a/NothinFancy/src/IntroGamestate.cpp +++ b/NothinFancy/src/IntroGamestate.cpp @@ -9,8 +9,8 @@ namespace nf { m_scale = 2.0; m_logoTex.create(BaseAssets::logo, Vec2(0.0, 0.0)); m_logoTex.centered(true, true); - m_text.create("(c) Grayson Riffe 2021 | graysonriffe.com", Vec2(0.01f, 0.025f), Vec3(0.8f)); - m_text.setScale(0.6f); + m_verText.create("v" + (std::string)NFVERSION, Vec2(0.01f, 0.075f), Vec3(0.8f), 0.6f); + m_text.create("(c) Grayson Riffe 2021 | graysonriffe.com", Vec2(0.01f, 0.025f), Vec3(0.8f), 0.6f); m_start = std::chrono::steady_clock::now(); } @@ -32,6 +32,7 @@ namespace nf { void IntroGamestate::render(Renderer& renderer) { renderer.render(m_logoTex); + renderer.render(m_verText); renderer.render(m_text); } diff --git a/NothinFancy/src/include/nf/Assets.h b/NothinFancy/src/include/nf/Assets.h index 999544b..8f9da5a 100644 --- a/NothinFancy/src/include/nf/Assets.h +++ b/NothinFancy/src/include/nf/Assets.h @@ -149,6 +149,7 @@ namespace nf { void destroy() override; ~AssetPack(); private: + bool m_member; bool m_loaded; std::unordered_map m_assets; }; diff --git a/NothinFancy/src/include/nf/IntroGamestate.h b/NothinFancy/src/include/nf/IntroGamestate.h index f9045bd..7904c0a 100644 --- a/NothinFancy/src/include/nf/IntroGamestate.h +++ b/NothinFancy/src/include/nf/IntroGamestate.h @@ -17,6 +17,7 @@ namespace nf { std::chrono::steady_clock::time_point m_start; float m_scale; UITexture m_logoTex; + Text m_verText; Text m_text; }; } \ No newline at end of file diff --git a/STEMSln.sln b/STEMSln.sln index 9aff097..5c0f53b 100644 --- a/STEMSln.sln +++ b/STEMSln.sln @@ -26,8 +26,8 @@ Global {B7FEC2D6-1D8F-487E-89CB-FD611FD1AEB6}.Debug|x64.Build.0 = Debug|x64 {B7FEC2D6-1D8F-487E-89CB-FD611FD1AEB6}.Release|x64.ActiveCfg = Release|x64 {B7FEC2D6-1D8F-487E-89CB-FD611FD1AEB6}.Release|x64.Build.0 = Release|x64 - {771B4AEE-E2C6-4745-AC40-1EF57149612E}.Debug|x64.ActiveCfg = Debug|x64 - {771B4AEE-E2C6-4745-AC40-1EF57149612E}.Debug|x64.Build.0 = Debug|x64 + {771B4AEE-E2C6-4745-AC40-1EF57149612E}.Debug|x64.ActiveCfg = Release|x64 + {771B4AEE-E2C6-4745-AC40-1EF57149612E}.Debug|x64.Build.0 = Release|x64 {771B4AEE-E2C6-4745-AC40-1EF57149612E}.Release|x64.ActiveCfg = Release|x64 {771B4AEE-E2C6-4745-AC40-1EF57149612E}.Release|x64.Build.0 = Release|x64 EndGlobalSection diff --git a/docs/pages/1_install.md b/docs/pages/1_install.md index 483c643..dec5f27 100644 --- a/docs/pages/1_install.md +++ b/docs/pages/1_install.md @@ -52,14 +52,12 @@ as shown below. @image html blankproject.png "The template opened in Visual Studio" width=70% -To build the project, go to Build -> Build Solution or Build Project. Both do the same thing -since there's only one project in the solution initially. You could also hit the default -keyboard shortcut of `Ctrl-Shift-B`. +To build the project, go to Build -> Build Solution or Build Project, which will not build +your assets. You can also also hit the default keyboard shortcut of `Ctrl-Shift-B` to build +both your app and assets at once. -@note After your application is built, your assets are also built and placed into -the output `assets` directory. As your project grows, this could take longer and longer, -so this can be disabled in the project properties dialog under Build Events -> Post-Build Event. -Change "Use In Build" to "No" and save. +@note When the "Build Assets" project is built, the resulting NFPacks are moved to +the output `assets` directory next to your .exe for you. NF is a **statically-linked** library. This means that your build will not rely on any external dlls other than the MSVC redistributable. \ No newline at end of file