Code/Editor

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-02 17:56:56 -07:00
parent 3b28267569
commit a14b4e478e
47 changed files with 208 additions and 1219 deletions
+18 -15
View File
@@ -26,6 +26,7 @@ AZ_POP_DISABLE_WARNING
#include <AzCore/IO/Path/Path.h>
#include <AzCore/JSON/document.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/Utils/Utils.h>
// AzFramework
#include <AzFramework/Terrain/TerrainDataRequestBus.h>
@@ -1107,16 +1108,18 @@ void CEditorImpl::DetectVersion()
DWORD dwHandle;
UINT len;
char ver[1024 * 8];
wchar_t ver[1024 * 8];
AZ::Utils::GetExecutablePath(exe, _MAX_PATH);
AZStd::wstring exeW;
AZStd::to_wstring(exeW, exe);
int verSize = GetFileVersionInfoSize(exe, &dwHandle);
int verSize = GetFileVersionInfoSizeW(exeW.c_str(), &dwHandle);
if (verSize > 0)
{
GetFileVersionInfo(exe, dwHandle, 1024 * 8, ver);
GetFileVersionInfoW(exeW.c_str(), dwHandle, 1024 * 8, ver);
VS_FIXEDFILEINFO* vinfo;
VerQueryValue(ver, "\\", (void**)&vinfo, &len);
VerQueryValueW(ver, L"\\", (void**)&vinfo, &len);
m_fileVersion.v[0] = vinfo->dwFileVersionLS & 0xFFFF;
m_fileVersion.v[1] = vinfo->dwFileVersionLS >> 16;
@@ -1557,31 +1560,31 @@ IExportManager* CEditorImpl::GetExportManager()
void CEditorImpl::AddUIEnums()
{
// Spec settings for shadow casting lights
string SpecString[4];
AZStd::string SpecString[4];
QStringList types;
types.push_back("Never=0");
SpecString[0].Format("VeryHigh Spec=%d", CONFIG_VERYHIGH_SPEC);
SpecString[0] = AZStd::string::format("VeryHigh Spec=%d", CONFIG_VERYHIGH_SPEC);
types.push_back(SpecString[0].c_str());
SpecString[1].Format("High Spec=%d", CONFIG_HIGH_SPEC);
SpecString[1] = AZStd::string::format("High Spec=%d", CONFIG_HIGH_SPEC);
types.push_back(SpecString[1].c_str());
SpecString[2].Format("Medium Spec=%d", CONFIG_MEDIUM_SPEC);
SpecString[2] = AZStd::string::format("Medium Spec=%d", CONFIG_MEDIUM_SPEC);
types.push_back(SpecString[2].c_str());
SpecString[3].Format("Low Spec=%d", CONFIG_LOW_SPEC);
SpecString[3] = AZStd::string::format("Low Spec=%d", CONFIG_LOW_SPEC);
types.push_back(SpecString[3].c_str());
m_pUIEnumsDatabase->SetEnumStrings("CastShadows", types);
// Power-of-two percentages
string percentStringPOT[5];
AZStd::string percentStringPOT[5];
types.clear();
percentStringPOT[0].Format("Default=%d", 0);
percentStringPOT[0] = AZStd::string::format("Default=%d", 0);
types.push_back(percentStringPOT[0].c_str());
percentStringPOT[1].Format("12.5=%d", 1);
percentStringPOT[1] = AZStd::string::format("12.5=%d", 1);
types.push_back(percentStringPOT[1].c_str());
percentStringPOT[2].Format("25=%d", 2);
percentStringPOT[2] = AZStd::string::format("25=%d", 2);
types.push_back(percentStringPOT[2].c_str());
percentStringPOT[3].Format("50=%d", 3);
percentStringPOT[3] = AZStd::string::format("50=%d", 3);
types.push_back(percentStringPOT[3].c_str());
percentStringPOT[4].Format("100=%d", 4);
percentStringPOT[4] = AZStd::string::format("100=%d", 4);
types.push_back(percentStringPOT[4].c_str());
m_pUIEnumsDatabase->SetEnumStrings("ShadowMinResPercent", types);
}