Fix building for Xbox Scarlett

This commit is contained in:
Wojtek Figat
2021-07-02 10:53:38 +02:00
parent 7e8ebd758b
commit 404891fe01
4 changed files with 33 additions and 25 deletions

View File

@@ -10,7 +10,6 @@
#include "Engine/Core/Math/Math.h"
#include "Engine/Core/Collections/HashFunctions.h"
#include "Engine/Core/Log.h"
#include "Engine/Engine/CommandLine.h"
#include "IncludeWindowsHeaders.h"
#include <Psapi.h>
#include <WinSock2.h>
@@ -19,7 +18,6 @@
#include <WinBase.h>
#include <xmmintrin.h>
#include <intrin.h>
#include <cstdio>
#pragma comment(lib, "Iphlpapi.lib")
namespace
@@ -65,28 +63,6 @@ bool Win32Platform::Init()
if (PlatformBase::Init())
return true;
// Init console output (engine is linked with /SUBSYSTEM:WINDOWS so it lacks of proper console output on Windows)
if (CommandLine::Options.Std)
{
// Attaches output of application to parent console, returns true if running in console-mode
// [Reference: https://www.tillett.info/2013/05/13/how-to-create-a-windows-program-that-works-as-both-as-a-gui-and-console-application]
if (AttachConsole(ATTACH_PARENT_PROCESS))
{
const HANDLE consoleHandleOut = GetStdHandle(STD_OUTPUT_HANDLE);
if (consoleHandleOut != INVALID_HANDLE_VALUE)
{
freopen("CONOUT$", "w", stdout);
setvbuf(stdout, NULL, _IONBF, 0);
}
const HANDLE consoleHandleError = GetStdHandle(STD_ERROR_HANDLE);
if (consoleHandleError != INVALID_HANDLE_VALUE)
{
freopen("CONOUT$", "w", stderr);
setvbuf(stderr, NULL, _IONBF, 0);
}
}
}
// Init timing
LARGE_INTEGER frequency;
const auto freqResult = QueryPerformanceFrequency(&frequency);