Added ProdDebug config for end-user debugging; Logger stuff
This commit is contained in:
parent
2bc28afedd
commit
f691da4103
@ -5,6 +5,10 @@
|
|||||||
<Configuration>Debug</Configuration>
|
<Configuration>Debug</Configuration>
|
||||||
<Platform>x64</Platform>
|
<Platform>x64</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="ProdDebug|x64">
|
||||||
|
<Configuration>ProdDebug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="Release|x64">
|
<ProjectConfiguration Include="Release|x64">
|
||||||
<Configuration>Release</Configuration>
|
<Configuration>Release</Configuration>
|
||||||
<Platform>x64</Platform>
|
<Platform>x64</Platform>
|
||||||
@ -24,6 +28,12 @@
|
|||||||
<PlatformToolset>v143</PlatformToolset>
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ProdDebug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
@ -39,6 +49,9 @@
|
|||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ProdDebug|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
@ -48,6 +61,11 @@
|
|||||||
<OutDir>$(ProjectDir)bin\$(Platform)$(Configuration)\</OutDir>
|
<OutDir>$(ProjectDir)bin\$(Platform)$(Configuration)\</OutDir>
|
||||||
<IntDir>$(ProjectDir)int\$(Platform)$(Configuration)\</IntDir>
|
<IntDir>$(ProjectDir)int\$(Platform)$(Configuration)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ProdDebug|x64'">
|
||||||
|
<OutDir>$(ProjectDir)bin\$(Platform)$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(ProjectDir)int\$(Platform)$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
<OutDir>$(ProjectDir)bin\$(Platform)$(Configuration)\</OutDir>
|
<OutDir>$(ProjectDir)bin\$(Platform)$(Configuration)\</OutDir>
|
||||||
@ -57,7 +75,7 @@
|
|||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NFDEBUG;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)src\include\;$(SolutionDir)NothinFancy\src\include\</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(ProjectDir)src\include\;$(SolutionDir)NothinFancy\src\include\</AdditionalIncludeDirectories>
|
||||||
<ObjectFileName>$(IntDir)obj\</ObjectFileName>
|
<ObjectFileName>$(IntDir)obj\</ObjectFileName>
|
||||||
@ -78,6 +96,37 @@ if exist "$(OutDir)assets" (rmdir "$(OutDir)assets" /S /Q && goto end) e
|
|||||||
mkdir "$(OutDir)assets"
|
mkdir "$(OutDir)assets"
|
||||||
move "*.nfpack" "$(OutDir)assets\"
|
move "*.nfpack" "$(OutDir)assets\"
|
||||||
cd "$(SolutionDir)NothinFancy\assets"
|
cd "$(SolutionDir)NothinFancy\assets"
|
||||||
|
if exist "base.nfpack" (copy "base.nfpack" "$(OutDir)assets\")</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ProdDebug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>NFDEBUG;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)src\include\;$(SolutionDir)NothinFancy\src\include\</AdditionalIncludeDirectories>
|
||||||
|
<ObjectFileName>$(IntDir)obj\</ObjectFileName>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||||
|
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
|
||||||
|
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>cd assets
|
||||||
|
"$(SolutionDir)NFAssetBuilder\bin\x64Release\NFAssetBuilder.exe"
|
||||||
|
if exist "$(OutDir)assets" (rmdir "$(OutDir)assets" /S /Q && goto end) else goto end
|
||||||
|
:end
|
||||||
|
mkdir "$(OutDir)assets"
|
||||||
|
move "*.nfpack" "$(OutDir)assets\"
|
||||||
|
cd "$(SolutionDir)NothinFancy\assets"
|
||||||
if exist "base.nfpack" (copy "base.nfpack" "$(OutDir)assets\")</Command>
|
if exist "base.nfpack" (copy "base.nfpack" "$(OutDir)assets\")</Command>
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
|
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
|
||||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ProdDebug|x64'">
|
||||||
|
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
|
||||||
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
|
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
|
||||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
|
@ -5,6 +5,10 @@
|
|||||||
<Configuration>Debug</Configuration>
|
<Configuration>Debug</Configuration>
|
||||||
<Platform>x64</Platform>
|
<Platform>x64</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="ProdDebug|x64">
|
||||||
|
<Configuration>ProdDebug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="Release|x64">
|
<ProjectConfiguration Include="Release|x64">
|
||||||
<Configuration>Release</Configuration>
|
<Configuration>Release</Configuration>
|
||||||
<Platform>x64</Platform>
|
<Platform>x64</Platform>
|
||||||
@ -31,6 +35,13 @@
|
|||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ProdDebug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
<ImportGroup Label="ExtensionSettings">
|
<ImportGroup Label="ExtensionSettings">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
@ -42,6 +53,9 @@
|
|||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ProdDebug|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
@ -53,11 +67,16 @@
|
|||||||
<OutDir>$(ProjectDir)bin\$(Platform)$(Configuration)\</OutDir>
|
<OutDir>$(ProjectDir)bin\$(Platform)$(Configuration)\</OutDir>
|
||||||
<IntDir>$(ProjectDir)int\$(Platform)$(Configuration)\</IntDir>
|
<IntDir>$(ProjectDir)int\$(Platform)$(Configuration)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ProdDebug|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<OutDir>$(ProjectDir)bin\$(Platform)$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(ProjectDir)int\$(Platform)$(Configuration)\</IntDir>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>GLEW_STATIC;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NFDEBUG;GLEW_STATIC;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)src\include\;$(ProjectDir)dep\include\</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(ProjectDir)src\include\;$(ProjectDir)dep\include\</AdditionalIncludeDirectories>
|
||||||
<ObjectFileName>$(IntDir)obj\</ObjectFileName>
|
<ObjectFileName>$(IntDir)obj\</ObjectFileName>
|
||||||
@ -116,6 +135,43 @@
|
|||||||
<PostBuildEvent />
|
<PostBuildEvent />
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>cd assets
|
<Command>cd assets
|
||||||
|
"$(SolutionDir)NFAssetBuilder\bin\x64Release\NFAssetBuilder.exe"</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ProdDebug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>NFDEBUG;GLEW_STATIC;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)src\include\;$(ProjectDir)dep\include\</AdditionalIncludeDirectories>
|
||||||
|
<ObjectFileName>$(IntDir)obj\</ObjectFileName>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<TreatWarningAsError>true</TreatWarningAsError>
|
||||||
|
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
<Lib>
|
||||||
|
<AdditionalDependencies>glew32s.lib;opengl32.lib;freetype.lib;xaudio2.lib;Cabinet.lib;libogg.lib;libvorbis.lib;libvorbisfile.lib;PhysXFoundation.lib;PhysXCommon.lib;PhysX.lib;PhysXCooking.lib;PhysXExtensions.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Lib>
|
||||||
|
<Lib>
|
||||||
|
<AdditionalLibraryDirectories>$(ProjectDir)dep\lib\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalOptions>/ignore:4006 %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
|
||||||
|
</Lib>
|
||||||
|
<ProjectReference>
|
||||||
|
<LinkLibraryDependencies>true</LinkLibraryDependencies>
|
||||||
|
</ProjectReference>
|
||||||
|
<PostBuildEvent />
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>cd assets
|
||||||
"$(SolutionDir)NFAssetBuilder\bin\x64Release\NFAssetBuilder.exe"</Command>
|
"$(SolutionDir)NFAssetBuilder\bin\x64Release\NFAssetBuilder.exe"</Command>
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
@ -80,7 +80,7 @@ namespace nf {
|
|||||||
|
|
||||||
void Application::run() {
|
void Application::run() {
|
||||||
NFLog("Running application...");
|
NFLog("Running application...");
|
||||||
#ifdef _DEBUG
|
#ifdef NFDEBUG
|
||||||
Debug::startTimer();
|
Debug::startTimer();
|
||||||
SetThreadDescription(GetCurrentThread(), L"Input Thread");
|
SetThreadDescription(GetCurrentThread(), L"Input Thread");
|
||||||
SetConsoleTitle(toWide("Nothin' Fancy v" + (std::string)NFVERSION).data());
|
SetConsoleTitle(toWide("Nothin' Fancy v" + (std::string)NFVERSION).data());
|
||||||
@ -115,9 +115,10 @@ namespace nf {
|
|||||||
std::this_thread::sleep_for(std::chrono::milliseconds(5));
|
std::this_thread::sleep_for(std::chrono::milliseconds(5));
|
||||||
}
|
}
|
||||||
mainThread.join();
|
mainThread.join();
|
||||||
#ifdef _DEBUG
|
#ifdef NFDEBUG
|
||||||
Debug::stopTimer();
|
Debug::stopTimer();
|
||||||
#endif
|
#endif
|
||||||
|
NFLog("Exited application");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Application::hasCustomWindowIcon() {
|
bool Application::hasCustomWindowIcon() {
|
||||||
@ -312,7 +313,7 @@ namespace nf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Application::runMainGameThread() {
|
void Application::runMainGameThread() {
|
||||||
#ifdef _DEBUG
|
#ifdef NFDEBUG
|
||||||
SetThreadDescription(GetCurrentThread(), L"Main Engine Thread");
|
SetThreadDescription(GetCurrentThread(), L"Main Engine Thread");
|
||||||
#endif
|
#endif
|
||||||
m_renderer = new Renderer(this);
|
m_renderer = new Renderer(this);
|
||||||
@ -341,7 +342,7 @@ namespace nf {
|
|||||||
m_fpsDuration = m_fpsClock2 - m_fpsClock1;
|
m_fpsDuration = m_fpsClock2 - m_fpsClock1;
|
||||||
if (m_fpsDuration.count() >= 0.2) {
|
if (m_fpsDuration.count() >= 0.2) {
|
||||||
m_FPS = (int)std::round(1.0 / m_deltaTime);
|
m_FPS = (int)std::round(1.0 / m_deltaTime);
|
||||||
#ifdef _DEBUG
|
#ifdef NFDEBUG
|
||||||
static int i = 0;
|
static int i = 0;
|
||||||
i++;
|
i++;
|
||||||
if (i % 5 == 0)
|
if (i % 5 == 0)
|
||||||
@ -452,7 +453,6 @@ namespace nf {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WM_CLOSE: {
|
case WM_CLOSE: {
|
||||||
NFLog("Exiting NF application");
|
|
||||||
DestroyWindow(hWnd);
|
DestroyWindow(hWnd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ namespace nf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AudioEngine::runAudioThread() {
|
void AudioEngine::runAudioThread() {
|
||||||
#ifdef _DEBUG
|
#ifdef NFDEBUG
|
||||||
SetThreadDescription(GetCurrentThread(), L"Audio Thread");
|
SetThreadDescription(GetCurrentThread(), L"Audio Thread");
|
||||||
#endif
|
#endif
|
||||||
//Wait to initialize stuff until the master voice is created if it hasn't been already
|
//Wait to initialize stuff until the master voice is created if it hasn't been already
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
namespace nf {
|
namespace nf {
|
||||||
class PhysicsErrorCallback : public PxErrorCallback {
|
class PhysicsErrorCallback : public PxErrorCallback {
|
||||||
virtual void reportError(PxErrorCode::Enum code, const char* message, const char* file, int line) {
|
virtual void reportError(PxErrorCode::Enum code, const char* message, const char* file, int line) {
|
||||||
#ifdef _DEBUG
|
#ifdef NFDEBUG
|
||||||
Debug::ErrorImp(message, file, line);
|
Debug::ErrorImp(message, file, line);
|
||||||
__debugbreak();
|
__debugbreak();
|
||||||
#else
|
#else
|
||||||
|
@ -16,8 +16,10 @@ namespace nf {
|
|||||||
|
|
||||||
static const float deg2rad = (float)M_PI / 180.0f;
|
static const float deg2rad = (float)M_PI / 180.0f;
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef NFDEBUG
|
||||||
NFDEBUGINIT;
|
std::chrono::steady_clock::time_point Debug::m_initTime = std::chrono::high_resolution_clock::now();
|
||||||
|
bool Debug::m_timerStarted = false;
|
||||||
|
static HANDLE cmd = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
|
|
||||||
void Debug::startTimer() {
|
void Debug::startTimer() {
|
||||||
m_timerStarted = true;
|
m_timerStarted = true;
|
||||||
@ -31,45 +33,34 @@ namespace nf {
|
|||||||
void Debug::LogImp(const char* in) {
|
void Debug::LogImp(const char* in) {
|
||||||
if(m_timerStarted)
|
if(m_timerStarted)
|
||||||
printCurrentTime();
|
printCurrentTime();
|
||||||
std::printf("NF Log: %s\n", in);
|
std::printf("NF ");
|
||||||
|
SetConsoleTextAttribute(cmd, 6);
|
||||||
|
std::printf("Log: ");
|
||||||
|
SetConsoleTextAttribute(cmd, 7);
|
||||||
|
std::printf("%s\n", in);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Debug::LogImp(const std::string& in) {
|
void Debug::LogImp(const std::string& in) {
|
||||||
if (m_timerStarted)
|
LogImp(in.c_str());
|
||||||
printCurrentTime();
|
|
||||||
std::printf("NF Log: ");
|
|
||||||
std::cout << in << "\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Debug::LogImp(int in) {
|
void Debug::LogImp(int in) {
|
||||||
if (m_timerStarted)
|
LogImp(std::to_string(in));
|
||||||
printCurrentTime();
|
|
||||||
std::printf("NF Log: %i\n", in);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Debug::LogImp(float in) {
|
void Debug::LogImp(float in) {
|
||||||
if (m_timerStarted)
|
LogImp(std::to_string(in));
|
||||||
printCurrentTime();
|
|
||||||
std::printf("NF Log: %.4f\n", in);
|
|
||||||
}
|
}
|
||||||
//TODO: Test every Error in release mode
|
//TODO: Test every Error in release mode
|
||||||
void Debug::ErrorImp(const char* in, const char* filename, int line) {
|
void Debug::ErrorImp(const char* in, const char* filename, int line) {
|
||||||
if (m_timerStarted)
|
if (m_timerStarted)
|
||||||
printCurrentTime();
|
printCurrentTime();
|
||||||
static HANDLE cmd = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
||||||
SetConsoleTextAttribute(cmd, FOREGROUND_RED);
|
SetConsoleTextAttribute(cmd, FOREGROUND_RED);
|
||||||
std::printf("NF Error (%s, %i): %s\n", filename, line, in);
|
std::printf("NF Error (%s, %i): %s\n", filename, line, in);
|
||||||
SetConsoleTextAttribute(cmd, 7);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Debug::ErrorImp(const std::string& in, const char* filename, int line) {
|
void Debug::ErrorImp(const std::string& in, const char* filename, int line) {
|
||||||
if (m_timerStarted)
|
ErrorImp(in.c_str(), filename, line);
|
||||||
printCurrentTime();
|
|
||||||
static HANDLE cmd = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
||||||
SetConsoleTextAttribute(cmd, FOREGROUND_RED);
|
|
||||||
std::printf("NF Error (%s, %i): ", filename, line);
|
|
||||||
std::cout << in << "\n";
|
|
||||||
SetConsoleTextAttribute(cmd, 7);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Debug::printCurrentTime() {
|
void Debug::printCurrentTime() {
|
||||||
@ -91,7 +82,7 @@ namespace nf {
|
|||||||
if (!m_loading)
|
if (!m_loading)
|
||||||
NFLog("\"" + m_funcName + (std::string)"\" took " + std::to_string(dur.count() * 1000.0f) + (std::string)" ms.");
|
NFLog("\"" + m_funcName + (std::string)"\" took " + std::to_string(dur.count() * 1000.0f) + (std::string)" ms.");
|
||||||
else
|
else
|
||||||
NFLog("Loading took " + std::to_string(dur.count()) + (std::string)" seconds.");
|
NFLog("Loading state took " + std::to_string(dur.count()) + (std::string)" seconds.");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -21,12 +21,9 @@ namespace nf {
|
|||||||
* Current version of the engine in the format major.minor.patch
|
* Current version of the engine in the format major.minor.patch
|
||||||
*/
|
*/
|
||||||
#define NFVERSION "0.5.0"
|
#define NFVERSION "0.5.0"
|
||||||
#if defined(_DEBUG) || defined(doxygen)
|
#if defined(NFDEBUG) || defined(doxygen)
|
||||||
//Strips __FILE__ down to only the name of the file
|
//Strips __FILE__ down to only the name of the file
|
||||||
#define __FILENAME__ strrchr(__FILE__, '\\') + 1
|
#define __FILENAME__ strrchr(__FILE__, '\\') + 1
|
||||||
//Initializes static variables needed for debugging
|
|
||||||
#define NFDEBUGINIT std::chrono::steady_clock::time_point Debug::m_initTime = std::chrono::high_resolution_clock::now(); \
|
|
||||||
bool Debug::m_timerStarted = false
|
|
||||||
/**
|
/**
|
||||||
* @defgroup macros Macros
|
* @defgroup macros Macros
|
||||||
*
|
*
|
||||||
@ -113,7 +110,7 @@ __debugbreak();}
|
|||||||
#define NFSleepS(x)
|
#define NFSleepS(x)
|
||||||
#define NFSleepMS(x)
|
#define NFSleepMS(x)
|
||||||
#define NFLog(x)
|
#define NFLog(x)
|
||||||
#define NFError(x) {MessageBox(FindWindow(L"NFClass", NULL), toWide(x).data(), L"NF Engine Error", MB_OK | MB_ICONERROR);\
|
#define NFError(x) {MessageBox(FindWindow(L"NFClass", NULL), nf::toWide(x).data(), L"NF Engine Error", MB_OK | MB_ICONERROR);\
|
||||||
std::exit(-1);}
|
std::exit(-1);}
|
||||||
#define NFTimeFunc
|
#define NFTimeFunc
|
||||||
#define NFTimerLoad
|
#define NFTimerLoad
|
||||||
@ -414,9 +411,9 @@ std::exit(-1);}
|
|||||||
float w;
|
float w;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef NFIMPL
|
|
||||||
const std::wstring toWide(const char* in);
|
const std::wstring toWide(const char* in);
|
||||||
const std::wstring toWide(const std::string& in);
|
const std::wstring toWide(const std::string& in);
|
||||||
|
#ifndef NFIMPL
|
||||||
Vec4 degToQuat(const Vec3& in);
|
Vec4 degToQuat(const Vec3& in);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -15,19 +15,26 @@ EndProject
|
|||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|x64 = Debug|x64
|
Debug|x64 = Debug|x64
|
||||||
|
ProdDebug|x64 = ProdDebug|x64
|
||||||
Release|x64 = Release|x64
|
Release|x64 = Release|x64
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{1B9C5361-E301-41BF-97E7-56D65F11E2BB}.Debug|x64.ActiveCfg = Debug|x64
|
{1B9C5361-E301-41BF-97E7-56D65F11E2BB}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{1B9C5361-E301-41BF-97E7-56D65F11E2BB}.Debug|x64.Build.0 = Debug|x64
|
{1B9C5361-E301-41BF-97E7-56D65F11E2BB}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{1B9C5361-E301-41BF-97E7-56D65F11E2BB}.ProdDebug|x64.ActiveCfg = ProdDebug|x64
|
||||||
|
{1B9C5361-E301-41BF-97E7-56D65F11E2BB}.ProdDebug|x64.Build.0 = ProdDebug|x64
|
||||||
{1B9C5361-E301-41BF-97E7-56D65F11E2BB}.Release|x64.ActiveCfg = Release|x64
|
{1B9C5361-E301-41BF-97E7-56D65F11E2BB}.Release|x64.ActiveCfg = Release|x64
|
||||||
{1B9C5361-E301-41BF-97E7-56D65F11E2BB}.Release|x64.Build.0 = Release|x64
|
{1B9C5361-E301-41BF-97E7-56D65F11E2BB}.Release|x64.Build.0 = Release|x64
|
||||||
{B7FEC2D6-1D8F-487E-89CB-FD611FD1AEB6}.Debug|x64.ActiveCfg = Debug|x64
|
{B7FEC2D6-1D8F-487E-89CB-FD611FD1AEB6}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{B7FEC2D6-1D8F-487E-89CB-FD611FD1AEB6}.Debug|x64.Build.0 = Debug|x64
|
{B7FEC2D6-1D8F-487E-89CB-FD611FD1AEB6}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{B7FEC2D6-1D8F-487E-89CB-FD611FD1AEB6}.ProdDebug|x64.ActiveCfg = ProdDebug|x64
|
||||||
|
{B7FEC2D6-1D8F-487E-89CB-FD611FD1AEB6}.ProdDebug|x64.Build.0 = ProdDebug|x64
|
||||||
{B7FEC2D6-1D8F-487E-89CB-FD611FD1AEB6}.Release|x64.ActiveCfg = Release|x64
|
{B7FEC2D6-1D8F-487E-89CB-FD611FD1AEB6}.Release|x64.ActiveCfg = Release|x64
|
||||||
{B7FEC2D6-1D8F-487E-89CB-FD611FD1AEB6}.Release|x64.Build.0 = Release|x64
|
{B7FEC2D6-1D8F-487E-89CB-FD611FD1AEB6}.Release|x64.Build.0 = Release|x64
|
||||||
{771B4AEE-E2C6-4745-AC40-1EF57149612E}.Debug|x64.ActiveCfg = Release|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}.Debug|x64.Build.0 = Release|x64
|
||||||
|
{771B4AEE-E2C6-4745-AC40-1EF57149612E}.ProdDebug|x64.ActiveCfg = Release|x64
|
||||||
|
{771B4AEE-E2C6-4745-AC40-1EF57149612E}.ProdDebug|x64.Build.0 = Release|x64
|
||||||
{771B4AEE-E2C6-4745-AC40-1EF57149612E}.Release|x64.ActiveCfg = Release|x64
|
{771B4AEE-E2C6-4745-AC40-1EF57149612E}.Release|x64.ActiveCfg = Release|x64
|
||||||
{771B4AEE-E2C6-4745-AC40-1EF57149612E}.Release|x64.Build.0 = Release|x64
|
{771B4AEE-E2C6-4745-AC40-1EF57149612E}.Release|x64.Build.0 = Release|x64
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
Reference in New Issue
Block a user