Editor: Only create Win32 console & redirect logging if not attached

This commit is contained in:
Luke Street 2020-04-18 03:02:44 -04:00
parent 2b62bb9577
commit 7f15390d4f
2 changed files with 5 additions and 7 deletions

View File

@ -207,7 +207,8 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR lpCmdLine, int) {
for (int i = 0; i < argc; ++i) for (int i = 0; i < argc; ++i)
booArgv[i + 1] = argv[i]; booArgv[i + 1] = argv[i];
if (IsClientLoggingEnabled(argc + 1, booArgv)) const DWORD outType = GetFileType(GetStdHandle(STD_OUTPUT_HANDLE));
if (IsClientLoggingEnabled(argc + 1, booArgv) && outType == FILE_TYPE_UNKNOWN)
logvisor::CreateWin32Console(); logvisor::CreateWin32Console();
return wmain(argc + 1, booArgv); return wmain(argc + 1, booArgv);
} }

View File

@ -417,12 +417,7 @@ void CStateManager::SetupParticleHook(const CActor& actor) const {
void CStateManager::MurderScriptInstanceNames() { xb40_uniqueInstanceNames.clear(); } void CStateManager::MurderScriptInstanceNames() { xb40_uniqueInstanceNames.clear(); }
std::string CStateManager::HashInstanceName(CInputStream& in) { std::string CStateManager::HashInstanceName(CInputStream& in) {
if (hecl::com_developer && hecl::com_developer->toBoolean()) {
return in.readString(); return in.readString();
} else {
while (in.readByte() != 0) {};
return "";
}
} }
void CStateManager::SetActorAreaId(CActor& actor, TAreaId aid) { void CStateManager::SetActorAreaId(CActor& actor, TAreaId aid) {
@ -517,6 +512,7 @@ void CStateManager::BuildDynamicLightListForWorld() {
} }
void CStateManager::DrawDebugStuff() const { void CStateManager::DrawDebugStuff() const {
#ifndef NDEBUG
for (CEntity* ent : GetActorObjectList()) { for (CEntity* ent : GetActorObjectList()) {
if (TCastToPtr<CPatterned> ai = ent) { if (TCastToPtr<CPatterned> ai = ent) {
if (CPathFindSearch* path = ai->GetSearchPath()) { if (CPathFindSearch* path = ai->GetSearchPath()) {
@ -524,6 +520,7 @@ void CStateManager::DrawDebugStuff() const {
} }
} }
} }
#endif
} }
void CStateManager::RenderCamerasAndAreaLights() { void CStateManager::RenderCamerasAndAreaLights() {