2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#include "AndroidRuntimeSettingsPrivatePCH.h"
|
|
|
|
|
|
|
|
|
|
#include "AndroidRuntimeSettings.h"
|
|
|
|
|
|
2015-09-21 01:23:29 -04:00
|
|
|
#if WITH_EDITOR
|
|
|
|
|
#include "TargetPlatform.h"
|
|
|
|
|
#include "IAndroid_MultiTargetPlatformModule.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-10-14 10:29:11 -04:00
|
|
|
UAndroidRuntimeSettings::UAndroidRuntimeSettings(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
: Super(ObjectInitializer)
|
2014-03-14 14:13:41 -04:00
|
|
|
, Orientation(EAndroidScreenOrientation::Landscape)
|
2014-04-23 19:40:10 -04:00
|
|
|
, bEnableGooglePlaySupport(false)
|
2015-09-21 01:23:29 -04:00
|
|
|
, bMultiTargetFormat_ETC1(true)
|
|
|
|
|
, bMultiTargetFormat_ETC2(true)
|
|
|
|
|
, bMultiTargetFormat_DXT(true)
|
|
|
|
|
, bMultiTargetFormat_PVRTC(true)
|
|
|
|
|
, bMultiTargetFormat_ATC(true)
|
|
|
|
|
, bMultiTargetFormat_ASTC(true)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
}
|
2014-09-18 15:10:00 -04:00
|
|
|
|
|
|
|
|
#if WITH_EDITOR
|
|
|
|
|
void UAndroidRuntimeSettings::PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent)
|
|
|
|
|
{
|
|
|
|
|
Super::PostEditChangeProperty(PropertyChangedEvent);
|
|
|
|
|
|
|
|
|
|
// Ensure that at least one architecture is supported
|
2015-06-17 12:56:56 -04:00
|
|
|
if (!bBuildForArmV7 && !bBuildForX86 && !bBuildForX8664)// && !bBuildForArm64)
|
2014-09-18 15:10:00 -04:00
|
|
|
{
|
|
|
|
|
bBuildForArmV7 = true;
|
2015-09-03 11:55:32 -04:00
|
|
|
UpdateSinglePropertyInConfigFile(GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, bBuildForArmV7)), GetDefaultConfigFilename());
|
2014-09-18 15:10:00 -04:00
|
|
|
}
|
2014-12-11 13:44:41 -05:00
|
|
|
|
|
|
|
|
// Ensure that at least one GPU architecture is supported
|
|
|
|
|
if (!bBuildForES2 && !bBuildForES31)
|
|
|
|
|
{
|
|
|
|
|
bBuildForES2 = true;
|
2015-09-03 11:55:32 -04:00
|
|
|
UpdateSinglePropertyInConfigFile(GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, bBuildForES2)), GetDefaultConfigFilename());
|
2014-12-11 13:44:41 -05:00
|
|
|
}
|
2015-09-21 01:23:29 -04:00
|
|
|
|
|
|
|
|
if (PropertyChangedEvent.Property != nullptr && PropertyChangedEvent.Property->GetName().StartsWith(TEXT("bMultiTargetFormat")))
|
|
|
|
|
{
|
|
|
|
|
UpdateSinglePropertyInConfigFile(PropertyChangedEvent.Property, GetDefaultConfigFilename());
|
|
|
|
|
|
|
|
|
|
// Ensure we have at least one format for Android_Multi
|
|
|
|
|
if (!bMultiTargetFormat_ETC1 && !bMultiTargetFormat_ETC2 && !bMultiTargetFormat_DXT && !bMultiTargetFormat_PVRTC && !bMultiTargetFormat_ATC && !bMultiTargetFormat_ASTC)
|
|
|
|
|
{
|
|
|
|
|
bMultiTargetFormat_ETC1 = true;
|
|
|
|
|
UpdateSinglePropertyInConfigFile(GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, bMultiTargetFormat_ETC1)), GetDefaultConfigFilename());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Notify the Android_MultiTargetPlatform module if it's loaded
|
|
|
|
|
IAndroid_MultiTargetPlatformModule* Module = FModuleManager::GetModulePtr<IAndroid_MultiTargetPlatformModule>("Android_MultiTargetPlatform");
|
|
|
|
|
if (Module)
|
|
|
|
|
{
|
|
|
|
|
Module->NotifySelectedFormatsChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-09-18 15:10:00 -04:00
|
|
|
}
|
2015-08-03 05:25:13 -04:00
|
|
|
|
2015-08-03 17:36:26 -04:00
|
|
|
void UAndroidRuntimeSettings::PostInitProperties()
|
2015-08-03 05:25:13 -04:00
|
|
|
{
|
2015-08-03 17:36:26 -04:00
|
|
|
Super::PostInitProperties();
|
|
|
|
|
|
|
|
|
|
// If the config has an AdMobAdUnitID then we migrate it on load and clear the value
|
2015-08-03 05:25:13 -04:00
|
|
|
if (!AdMobAdUnitID.IsEmpty())
|
|
|
|
|
{
|
|
|
|
|
AdMobAdUnitIDs.Add(AdMobAdUnitID);
|
|
|
|
|
AdMobAdUnitID.Empty();
|
2015-08-03 17:36:26 -04:00
|
|
|
UpdateDefaultConfigFile();
|
2015-08-03 05:25:13 -04:00
|
|
|
}
|
|
|
|
|
}
|
2014-09-18 15:10:00 -04:00
|
|
|
#endif
|