Fix autoclose command + condition to pause the console only if no debugger and no autoclose

This commit is contained in:
2026-02-16 11:13:53 -05:00
parent b6e9d95552
commit 762cfe52cf
7 changed files with 112 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
#pragma once
#include <Core/Common/CoreTypes.h>
#include <Graphics/D3D12/D3D12Buffer.h>
#include <Juliet.h>
namespace Juliet
@@ -31,6 +32,11 @@ namespace Juliet
} // namespace Memory
namespace Debug
{
JULIET_API bool IsDebuggerPresent();
} // namespace Debug
using EntryPointFunc = int (*)(int, wchar_t**);
JULIET_API int Bootstrap(EntryPointFunc entryPointFunc, int argc, wchar_t** argv);
} // namespace Juliet

View File

@@ -21,6 +21,14 @@ namespace Juliet
}
} // namespace Memory
namespace Debug
{
bool IsDebuggerPresent()
{
return Internal::IsDebuggerPresent();
}
} // namespace Debug
int Bootstrap(EntryPointFunc entryPointFunc, int argc, wchar_t** argv)
{
return Internal::OS_Main(entryPointFunc, argc, argv);

View File

@@ -2,16 +2,17 @@
namespace Juliet
{
namespace Memory
{
namespace Internal
namespace Memory::Internal
{
Byte* OS_Reserve(size_t size);
bool OS_Commit(Byte* ptr, size_t size);
void OS_Release(Byte* ptr, size_t size);
} // namespace Internal
} // namespace Memory
} // namespace Memory::Internal
namespace Debug::Internal
{
bool IsDebuggerPresent();
} // namespace Debug::Internal
namespace Internal
{
int OS_Main(EntryPointFunc entryPointFunc, int argc, wchar_t** argv);

View File

@@ -39,6 +39,14 @@ namespace Juliet
}
} // namespace Memory::Internal
namespace Debug::Internal
{
bool IsDebuggerPresent()
{
return ::IsDebuggerPresent();
}
} // namespace Debug::Internal
namespace
{
// Used to handle a crash/exception
@@ -78,7 +86,8 @@ namespace Juliet
closesocket(Sock);
}
return entryPointFunc(argc, argv);
int result = entryPointFunc(argc, argv);
return result;
}
} // namespace Internal
} // namespace Juliet

View File

@@ -498,15 +498,15 @@ JulietApplication& GetEditorApplication()
return EditorApplication;
}
int JulietMain(int, wchar_t**)
int JulietMain(int argc, wchar_t** argv)
{
if (__argc > 1)
if (argc > 1)
{
for (int i = 1; i < __argc; ++i)
for (int i = 1; i < argc; ++i)
{
if (strcmp(__argv[i], "-autoclose") == 0 && (i + 1 < __argc))
if (wcscmp(argv[i], L"-autoclose") == 0 && (i + 1 < argc))
{
int frames = atoi(__argv[i + 1]);
int frames = _wtoi(argv[i + 1]);
EditorApplication.SetAutoCloseFrameCount(frames);
}
}
@@ -516,7 +516,7 @@ int JulietMain(int, wchar_t**)
// Pause here to not close the console window immediatly on stop
// Only pause if not in auto-close mode
if (EditorApplication.GetAutoCloseFrameCount() == -1)
if (EditorApplication.GetAutoCloseFrameCount() == -1 && !Debug::IsDebuggerPresent())
{
system("PAUSE");
}

0
misc/agent_error.log Normal file
View File

73
misc/agent_output.log Normal file
View File

@@ -0,0 +1,73 @@
[2026-02-16 16:02:02.4149977] Starting Unit Tests...
Running Paged Memory Arena Tests...
[2026-02-16 16:02:02.4153152] Allocating from W:\Classified\Juliet\Juliet\src\Core\Memory\MemoryArenaTests.cpp : 23l
[2026-02-16 16:02:02.4154229] Allocating from W:\Classified\Juliet\Juliet\src\Core\Memory\MemoryArena.cpp : 181l
[2026-02-16 16:02:02.4264282] Allocating from W:\Classified\Juliet\Juliet\src\Core\Memory\MemoryArenaTests.cpp : 122l
[2026-02-16 16:02:02.4266593] Allocating from W:\Classified\Juliet\Juliet\src\Core\Memory\MemoryArenaTests.cpp : 141l
All Paged MemoryArena tests passed.
[2026-02-16 16:02:02.4268147] Allocating from Juliet/include\Core/Container/Vector.h : 22l
[2026-02-16 16:02:02.4269590] Allocating from Juliet/include\Core/Container/Vector.h : 22l
[2026-02-16 16:02:02.4270984] Allocating from Juliet/include\Core/Container/Vector.h : 22l
[2026-02-16 16:02:02.4272310] Allocating from Juliet/include\Core/Container/Vector.h : 22l
[2026-02-16 16:02:02.4273792] Allocating from W:\Classified\Juliet\Juliet\src\UnitTest\Container\VectorUnitTest.cpp : 152l
[2026-02-16 16:02:02.4275180] Allocating from W:\Classified\Juliet\Juliet\src\UnitTest\Container\VectorUnitTest.cpp : 212l
[2026-02-16 16:02:02.4276613] Allocating from W:\Classified\Juliet\Juliet\src\UnitTest\Container\VectorUnitTest.cpp : 231l
[2026-02-16 16:02:02.4277980] Allocating from W:\Classified\Juliet\Juliet\src\UnitTest\Container\VectorUnitTest.cpp : 258l
[2026-02-16 16:02:02.4279316] Allocating from W:\Classified\Juliet\Juliet\src\UnitTest\Container\VectorUnitTest.cpp : 275l
[2026-02-16 16:02:02.4280555] Unit Tests Completed Successfully.
[2026-02-16 16:02:02.4281360] Allocating from W:\Classified\Juliet\Juliet\src\Core\HAL\Display\Display.cpp : 26l
[2026-02-16 16:02:02.4282502] Allocating from Juliet/include\Core/Container/Vector.h : 22l
[2026-02-16 16:02:02.4283584] Initializing Juliet Application...
[2026-02-16 16:02:02.4284436] w:\Classified\Juliet\bin\x64Clang-Debug\
[2026-02-16 16:02:02.6190578] Allocating from W:\Classified\Juliet\Juliet\src\Graphics\D3D12\D3D12GraphicsDevice.cpp : 709l
[2026-02-16 16:02:02.6205209] D3D12 Driver Infos:
[2026-02-16 16:02:02.6206266] D3D12 Adapter: AMD Radeon RX 5700 XT
[2026-02-16 16:02:02.6206942] D3D12 Driver Version: 32.0.21041.1000
[2026-02-16 16:02:02.7715117] DX12: D3D12Device Created: 000001AE0FCD6AC0
[2026-02-16 16:02:02.7716961] DX12: Debug Info Logger Initialized
[2026-02-16 16:02:02.7759926] Allocating from W:\Classified\Juliet\Juliet\src\Graphics\D3D12\D3D12Common.cpp : 52l
[2026-02-16 16:02:02.7762940] Allocating from W:\Classified\Juliet\Juliet\src\Graphics\D3D12\D3D12Common.cpp : 52l
[2026-02-16 16:02:02.7764796] Allocating from W:\Classified\Juliet\Juliet\src\Graphics\D3D12\D3D12Common.cpp : 52l
[2026-02-16 16:02:02.7767423] Allocating from W:\Classified\Juliet\Juliet\src\Graphics\D3D12\D3D12Common.cpp : 52l
[2026-02-16 16:02:02.7769776] Allocating from W:\Classified\Juliet\Juliet\src\Graphics\D3D12\D3D12DescriptorHeap.cpp : 15l
[2026-02-16 16:02:02.7862548] Allocating from W:\Classified\Juliet\Juliet\src\Core\HAL\Display\Display.cpp : 83l
[2026-02-16 16:02:02.8281025] CreateBuffer: Device=000001AE0FCD6AC0, Size=1024, Type=Base Use=StructuredBuffer
[2026-02-16 16:02:02.8287554] -> SRV DescriptorIndex=1
[2026-02-16 16:02:02.8288672] CreateBuffer: Device=000001AE0FCD6AC0, Size=1024, Type=TransferUpload Use=None
[2026-02-16 16:02:02.8304524] Allocating from W:\Classified\Juliet\JulietApp\main.cpp : 174l
[2026-02-16 16:02:02.8306076] Allocating from W:\Classified\Juliet\Juliet\src\Core\HotReload\HotReload.cpp : 14l
[2026-02-16 16:02:02.8561774] Allocating from W:\Classified\Juliet\JulietApp\main.cpp : 200l
[2026-02-16 16:02:02.8563269] Allocating from W:\Classified\Juliet\JulietApp\main.cpp : 201l
Game Arena Allocated: 000001AE56E00080
Door is Opened
Rock has 100 health points
[2026-02-16 16:02:02.8565687] CreateBuffer: Device=000001AE0FCD6AC0, Size=458752, Type=Base Use=StructuredBuffer
[2026-02-16 16:02:02.8575789] -> SRV DescriptorIndex=2
[2026-02-16 16:02:02.8576717] CreateBuffer: Device=000001AE0FCD6AC0, Size=458752, Type=TransferUpload Use=None
[2026-02-16 16:02:02.8583558] Allocating from W:\Classified\Juliet\Juliet\src\Core\ImGui\ImGuiService.cpp : 44l
ImGuiRenderer_Initialize: device=000001AE2B1AC730, g_ImGuiState=00007FFE66A66140, Initialized=0
[2026-02-16 16:02:02.8634723] CreateBuffer: Device=000001AE0FCD6AC0, Size=262144, Type=TransferUpload Use=None
ImGuiService: Running Unit Tests...
TestImGui: Context Verified.
TestImGui: IO Verified. Backend: imgui_impl_win32
TestImGui: Version Verified: 1.92.6 WIP
TestImGui: Fonts Verified.
TestImGui: Fonts Built Status: 1
TestImGui: Font Atlas Verified.
TestImGui: Style Verified.
TestImGui: About to DrawList check.
ImGui tests passed (Exhaustive).
[2026-02-16 16:02:02.8744932] CreateBuffer: Device=000001AE0FCD6AC0, Size=101400, Type=Base Use=StructuredBuffer
[2026-02-16 16:02:02.8754236] -> SRV DescriptorIndex=4
[2026-02-16 16:02:02.8755349] CreateBuffer: Device=000001AE0FCD6AC0, Size=101400, Type=TransferUpload Use=None
[2026-02-16 16:02:02.8762446] CreateBuffer: Device=000001AE0FCD6AC0, Size=20258, Type=Base Use=IndexBuffer
[2026-02-16 16:02:02.8768422] CreateBuffer: Device=000001AE0FCD6AC0, Size=20258, Type=TransferUpload Use=None
[2026-02-16 16:02:02.8797340] CreateBuffer: Device=000001AE0FCD6AC0, Size=101400, Type=Base Use=StructuredBuffer
[2026-02-16 16:02:02.8805045] -> SRV DescriptorIndex=5
[2026-02-16 16:02:02.8806249] CreateBuffer: Device=000001AE0FCD6AC0, Size=101400, Type=TransferUpload Use=None
[2026-02-16 16:02:02.8812642] CreateBuffer: Device=000001AE0FCD6AC0, Size=20258, Type=Base Use=IndexBuffer
[2026-02-16 16:02:02.8819564] CreateBuffer: Device=000001AE0FCD6AC0, Size=20258, Type=TransferUpload Use=None
[2026-02-16 16:02:03.7970638] Auto-closing application as requested.
[2026-02-16 16:02:03.8504471] Shutting down Juliet Application...
Shutting down game...
[2026-02-16 16:02:03.8768023] Juliet App shutdown Completed