Fixed implicit type conversion for type specialization
This commit is contained in:
@@ -403,7 +403,7 @@ int32 Editor::LoadProduct()
|
||||
}
|
||||
|
||||
// Create new project option
|
||||
if (CommandLine::Options.NewProject)
|
||||
if (CommandLine::Options.NewProject.IsTrue())
|
||||
{
|
||||
Array<String> projectFiles;
|
||||
FileSystem::DirectoryGetFiles(projectFiles, projectPath, TEXT("*.flaxproj"), DirectorySearchOption::TopDirectoryOnly);
|
||||
@@ -428,7 +428,7 @@ int32 Editor::LoadProduct()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CommandLine::Options.NewProject)
|
||||
if (CommandLine::Options.NewProject.IsTrue())
|
||||
{
|
||||
if (projectPath.IsEmpty())
|
||||
projectPath = Platform::GetWorkingDirectory();
|
||||
@@ -529,7 +529,7 @@ int32 Editor::LoadProduct()
|
||||
if (projectPath.IsEmpty())
|
||||
{
|
||||
#if PLATFORM_HAS_HEADLESS_MODE
|
||||
if (CommandLine::Options.Headless)
|
||||
if (CommandLine::Options.Headless.IsTrue())
|
||||
{
|
||||
Platform::Fatal(TEXT("Missing project path."));
|
||||
return -1;
|
||||
@@ -657,7 +657,7 @@ Window* Editor::CreateMainWindow()
|
||||
bool Editor::Init()
|
||||
{
|
||||
// Scripts project files generation from command line
|
||||
if (CommandLine::Options.GenProjectFiles)
|
||||
if (CommandLine::Options.GenProjectFiles.IsTrue())
|
||||
{
|
||||
const String customArgs = TEXT("-verbose -log -logfile=\"Cache/Intermediate/ProjectFileLog.txt\"");
|
||||
const bool failed = ScriptsBuilder::GenerateProject(customArgs);
|
||||
|
||||
@@ -147,7 +147,7 @@ SplashScreen::~SplashScreen()
|
||||
void SplashScreen::Show()
|
||||
{
|
||||
// Skip if already shown or in headless mode
|
||||
if (IsVisible() || CommandLine::Options.Headless)
|
||||
if (IsVisible() || CommandLine::Options.Headless.IsTrue())
|
||||
return;
|
||||
|
||||
LOG(Info, "Showing splash screen");
|
||||
|
||||
@@ -119,7 +119,7 @@ void Log::Logger::Write(const StringView& msg)
|
||||
IsDuringLog = true;
|
||||
|
||||
// Send message to standard process output
|
||||
if (CommandLine::Options.Std)
|
||||
if (CommandLine::Options.Std.IsTrue())
|
||||
{
|
||||
#if PLATFORM_TEXT_IS_CHAR16
|
||||
StringAnsi ansi(msg);
|
||||
|
||||
@@ -631,9 +631,9 @@ void EngineImpl::InitPaths()
|
||||
FileSystem::CreateDirectory(Globals::ProjectContentFolder);
|
||||
if (!FileSystem::DirectoryExists(Globals::ProjectSourceFolder))
|
||||
FileSystem::CreateDirectory(Globals::ProjectSourceFolder);
|
||||
if (CommandLine::Options.ClearCache)
|
||||
if (CommandLine::Options.ClearCache.IsTrue())
|
||||
FileSystem::DeleteDirectory(Globals::ProjectCacheFolder, true);
|
||||
else if (CommandLine::Options.ClearCookerCache)
|
||||
else if (CommandLine::Options.ClearCookerCache.IsTrue())
|
||||
FileSystem::DeleteDirectory(Globals::ProjectCacheFolder / TEXT("Cooker"), true);
|
||||
if (!FileSystem::DirectoryExists(Globals::ProjectCacheFolder))
|
||||
FileSystem::CreateDirectory(Globals::ProjectCacheFolder);
|
||||
|
||||
@@ -104,7 +104,7 @@ bool GraphicsService::Init()
|
||||
GPUDevice* device = nullptr;
|
||||
|
||||
// Null
|
||||
if (!device && CommandLine::Options.Null)
|
||||
if (!device && CommandLine::Options.Null.IsTrue())
|
||||
{
|
||||
#if GRAPHICS_API_NULL
|
||||
device = CreateGPUDeviceNull();
|
||||
@@ -114,7 +114,7 @@ bool GraphicsService::Init()
|
||||
}
|
||||
|
||||
// Vulkan
|
||||
if (!device && CommandLine::Options.Vulkan)
|
||||
if (!device && CommandLine::Options.Vulkan.IsTrue())
|
||||
{
|
||||
#if GRAPHICS_API_VULKAN
|
||||
device = CreateGPUDeviceVulkan();
|
||||
@@ -124,7 +124,7 @@ bool GraphicsService::Init()
|
||||
}
|
||||
|
||||
// DirectX 12
|
||||
if (!device && CommandLine::Options.D3D12)
|
||||
if (!device && CommandLine::Options.D3D12.IsTrue())
|
||||
{
|
||||
#if GRAPHICS_API_DIRECTX12
|
||||
if (Platform::IsWindows10())
|
||||
@@ -137,7 +137,7 @@ bool GraphicsService::Init()
|
||||
}
|
||||
|
||||
// DirectX 11 and DirectX 10
|
||||
if (!device && (CommandLine::Options.D3D11 || CommandLine::Options.D3D10))
|
||||
if (!device && (CommandLine::Options.D3D11.IsTrue() || CommandLine::Options.D3D10.IsTrue()))
|
||||
{
|
||||
#if GRAPHICS_API_DIRECTX11
|
||||
device = CreateGPUDeviceDX11();
|
||||
@@ -193,10 +193,10 @@ bool GraphicsService::Init()
|
||||
// Initialize
|
||||
if (device->IsDebugToolAttached
|
||||
#if USE_EDITOR || !BUILD_RELEASE
|
||||
|| CommandLine::Options.ShaderProfile
|
||||
|| CommandLine::Options.ShaderProfile.IsTrue()
|
||||
#endif
|
||||
#if USE_EDITOR
|
||||
|| CommandLine::Options.ShaderDebug
|
||||
|| CommandLine::Options.ShaderDebug.IsTrue()
|
||||
#endif
|
||||
)
|
||||
{
|
||||
|
||||
@@ -249,12 +249,12 @@ bool ShaderAssetBase::LoadShaderCache(ShaderCacheResult& result)
|
||||
options.SourceLength = sourceLength;
|
||||
options.Profile = shaderProfile;
|
||||
options.Output = &cacheStream;
|
||||
if (CommandLine::Options.ShaderDebug)
|
||||
if (CommandLine::Options.ShaderDebug.IsTrue())
|
||||
{
|
||||
options.GenerateDebugData = true;
|
||||
options.NoOptimize = true;
|
||||
}
|
||||
else if (CommandLine::Options.ShaderProfile)
|
||||
else if (CommandLine::Options.ShaderProfile.IsTrue())
|
||||
{
|
||||
options.GenerateDebugData = true;
|
||||
}
|
||||
|
||||
@@ -193,8 +193,8 @@ bool ShaderCacheManagerService::Init()
|
||||
CacheVersion cacheVersion;
|
||||
const String cacheVerFile = rootDir / TEXT("CacheVersion");
|
||||
#if USE_EDITOR
|
||||
const bool shaderDebug = CommandLine::Options.ShaderDebug;
|
||||
const bool shaderProfile = CommandLine::Options.ShaderProfile;
|
||||
const bool shaderDebug = CommandLine::Options.ShaderDebug.IsTrue();
|
||||
const bool shaderProfile = CommandLine::Options.ShaderProfile.IsTrue();
|
||||
#else
|
||||
const bool shaderDebug = false;
|
||||
#endif
|
||||
|
||||
@@ -106,9 +106,9 @@ GPUDevice* GPUDeviceDX11::Create()
|
||||
#else
|
||||
D3D_FEATURE_LEVEL maxAllowedFeatureLevel = D3D_FEATURE_LEVEL_11_0;
|
||||
#endif
|
||||
if (CommandLine::Options.D3D10)
|
||||
if (CommandLine::Options.D3D10.IsTrue())
|
||||
maxAllowedFeatureLevel = D3D_FEATURE_LEVEL_10_0;
|
||||
else if (CommandLine::Options.D3D11)
|
||||
else if (CommandLine::Options.D3D11.IsTrue())
|
||||
maxAllowedFeatureLevel = D3D_FEATURE_LEVEL_11_0;
|
||||
#if !USE_EDITOR && PLATFORM_WINDOWS
|
||||
auto winSettings = WindowsPlatformSettings::Get();
|
||||
@@ -209,11 +209,11 @@ GPUDevice* GPUDeviceDX11::Create()
|
||||
}
|
||||
GPUAdapterDX selectedAdapter = adapters[selectedAdapterIndex];
|
||||
uint32 vendorId = 0;
|
||||
if (CommandLine::Options.NVIDIA)
|
||||
if (CommandLine::Options.NVIDIA.IsTrue())
|
||||
vendorId = GPU_VENDOR_ID_NVIDIA;
|
||||
else if (CommandLine::Options.AMD)
|
||||
else if (CommandLine::Options.AMD.IsTrue())
|
||||
vendorId = GPU_VENDOR_ID_AMD;
|
||||
else if (CommandLine::Options.Intel)
|
||||
else if (CommandLine::Options.Intel.IsTrue())
|
||||
vendorId = GPU_VENDOR_ID_INTEL;
|
||||
if (vendorId != 0)
|
||||
{
|
||||
|
||||
@@ -161,11 +161,11 @@ GPUDevice* GPUDeviceDX12::Create()
|
||||
}
|
||||
GPUAdapterDX selectedAdapter = adapters[selectedAdapterIndex];
|
||||
uint32 vendorId = 0;
|
||||
if (CommandLine::Options.NVIDIA)
|
||||
if (CommandLine::Options.NVIDIA.IsTrue())
|
||||
vendorId = GPU_VENDOR_ID_NVIDIA;
|
||||
else if (CommandLine::Options.AMD)
|
||||
else if (CommandLine::Options.AMD.IsTrue())
|
||||
vendorId = GPU_VENDOR_ID_AMD;
|
||||
else if (CommandLine::Options.Intel)
|
||||
else if (CommandLine::Options.Intel.IsTrue())
|
||||
vendorId = GPU_VENDOR_ID_INTEL;
|
||||
if (vendorId != 0)
|
||||
{
|
||||
@@ -425,7 +425,7 @@ bool GPUDeviceDX12::Init()
|
||||
|
||||
#if !BUILD_RELEASE
|
||||
// Prevent the GPU from overclocking or under-clocking to get consistent timings
|
||||
if (CommandLine::Options.ShaderProfile)
|
||||
if (CommandLine::Options.ShaderProfile.IsTrue())
|
||||
{
|
||||
_device->SetStablePowerState(TRUE);
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ void PlatformBase::Fatal(const Char* msg, void* context)
|
||||
void PlatformBase::Error(const Char* msg)
|
||||
{
|
||||
#if PLATFORM_HAS_HEADLESS_MODE
|
||||
if (CommandLine::Options.Headless)
|
||||
if (CommandLine::Options.Headless.IsTrue())
|
||||
{
|
||||
#if PLATFORM_TEXT_IS_CHAR16
|
||||
StringAnsi ansi(msg);
|
||||
@@ -385,7 +385,7 @@ void PlatformBase::Error(const Char* msg)
|
||||
void PlatformBase::Warning(const Char* msg)
|
||||
{
|
||||
#if PLATFORM_HAS_HEADLESS_MODE
|
||||
if (CommandLine::Options.Headless)
|
||||
if (CommandLine::Options.Headless.IsTrue())
|
||||
{
|
||||
std::cout << "Warning: " << msg << std::endl;
|
||||
}
|
||||
@@ -399,7 +399,7 @@ void PlatformBase::Warning(const Char* msg)
|
||||
void PlatformBase::Info(const Char* msg)
|
||||
{
|
||||
#if PLATFORM_HAS_HEADLESS_MODE
|
||||
if (CommandLine::Options.Headless)
|
||||
if (CommandLine::Options.Headless.IsTrue())
|
||||
{
|
||||
std::cout << "Info: " << msg << std::endl;
|
||||
}
|
||||
|
||||
@@ -616,7 +616,7 @@ bool WindowsPlatform::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)
|
||||
if (CommandLine::Options.Std.IsTrue())
|
||||
{
|
||||
// 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]
|
||||
|
||||
Reference in New Issue
Block a user