Gems/Atom builds

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
monroegm-disable-blank-issue-2
Esteban Papp 4 years ago
parent 41ad6d7b7a
commit f665f572f3

@ -258,9 +258,8 @@ bool CBaseLibrary::SaveLibrary(const char* name, bool saveEmptyLibrary)
}
if (!bRes)
{
string strMessage;
QByteArray filenameUtf8 = fileName.toUtf8();
strMessage.Format("The file %s is read-only and the save of the library couldn't be performed. Try to remove the \"read-only\" flag or check-out the file and then try again.", filenameUtf8.data());
AZStd::string strMessage = AZStd::string::format("The file %s is read-only and the save of the library couldn't be performed. Try to remove the \"read-only\" flag or check-out the file and then try again.", filenameUtf8.data());
CryMessageBox(strMessage.c_str(), "Saving Error", MB_OK | MB_ICONWARNING);
}
return bRes;

@ -206,11 +206,8 @@ namespace
static void LogToDebug([[maybe_unused]] QtMsgType Type, [[maybe_unused]] const QMessageLogContext& Context, const QString& message)
{
#if defined(WIN32) || defined(WIN64)
OutputDebugStringW(L"Qt: ");
OutputDebugStringW(reinterpret_cast<const wchar_t*>(message.utf16()));
OutputDebugStringW(L"\n");
#endif
AZ::Debug::Platform::OutputToDebugger("Qt", message.utf8());
AZ::Debug::Platform::OutputToDebugger(nullptr, "\n");
}
}

@ -1109,7 +1109,7 @@ void CEditorImpl::DetectVersion()
char ver[1024 * 8];
GetModuleFileName(NULL, exe, _MAX_PATH);
AZ::Utils::GetExecutablePath(exe, _MAX_PATH);
int verSize = GetFileVersionInfoSize(exe, &dwHandle);
if (verSize > 0)

@ -8,7 +8,6 @@
#pragma once
#include "StringUtils.h"
#include "../Include/SandboxAPI.h"
class QWidget;

@ -10,8 +10,6 @@
#pragma once
#include <QString>
#include <CryString.h>
#include "UnicodeFunctions.h"
#include <QApplication>
#include <QDropEvent>
@ -36,28 +34,6 @@ public:
namespace QtUtil
{
// From QString to CryString
inline CryStringT<char> ToString(const QString& str)
{
return Unicode::Convert<CryStringT<char> >(str);
}
// From CryString to QString
inline QString ToQString(const CryStringT<char>& str)
{
return Unicode::Convert<QString>(str);
}
// From const char * to QString
inline QString ToQString(const char* str, size_t len = -1)
{
if (len == -1)
{
len = strlen(str);
}
return Unicode::Convert<QString>(str, str + len);
}
// Replacement for CString::trimRight()
inline QString trimRight(const QString& str)
{

@ -10,7 +10,6 @@
#pragma once
#include "CryThread.h"
#include "StringUtils.h"
#include "../Include/SandboxAPI.h"
#include <QString>
#include <QFileInfo>

@ -15,24 +15,20 @@
#include <AzToolsFramework/API/EditorAssetSystemAPI.h> // for ebus events
#include <AzFramework/StringFunc/StringFunc.h>
#include <AzFramework/API/ApplicationAPI.h>
#include <AzCore/std/string/conversions.h>
#include <QRegularExpression>
namespace
{
string g_currentModName; // folder name only!
}
namespace Path
{
//////////////////////////////////////////////////////////////////////////
void SplitPath(const QString& rstrFullPathFilename, QString& rstrDriveLetter, QString& rstrDirectory, QString& rstrFilename, QString& rstrExtension)
{
string strFullPathString(rstrFullPathFilename.toUtf8().data());
string strDriveLetter;
string strDirectory;
string strFilename;
string strExtension;
AZStd::string strFullPathString(rstrFullPathFilename.toUtf8().data());
AZStd::string strDriveLetter;
AZStd::string strDirectory;
AZStd::string strFilename;
AZStd::string strExtension;
char* szPath((char*)strFullPathString.c_str());
char* pchLastPosition(szPath);
@ -81,16 +77,16 @@ namespace Path
strFilename.assign(pchLastPosition, pchCurrentPosition);
}
rstrDriveLetter = strDriveLetter;
rstrDirectory = strDirectory;
rstrFilename = strFilename;
rstrExtension = strExtension;
rstrDriveLetter = strDriveLetter.c_str();
rstrDirectory = strDirectory.c_str();
rstrFilename = strFilename.c_str();
rstrExtension = strExtension.c_str();
}
//////////////////////////////////////////////////////////////////////////
void GetDirectoryQueue(const QString& rstrSourceDirectory, QStringList& rcstrDirectoryTree)
{
string strCurrentDirectoryName;
string strSourceDirectory(rstrSourceDirectory.toUtf8().data());
AZStd::string strCurrentDirectoryName;
AZStd::string strSourceDirectory(rstrSourceDirectory.toUtf8().data());
const char* szSourceDirectory(strSourceDirectory.c_str());
const char* pchCurrentPosition(szSourceDirectory);
const char* pchLastPosition(szSourceDirectory);
@ -207,7 +203,9 @@ namespace Path
bool IsFolder(const char* pPath)
{
DWORD attrs = GetFileAttributes(pPath);
AZStd::wstring pPathW;
AZStd::to_wstring(pPathW, pPath);
DWORD attrs = GetFileAttributes(pPathW.c_str());
if (attrs == FILE_ATTRIBUTE_DIRECTORY)
{
@ -255,16 +253,17 @@ namespace Path
/// Get the data folder
AZStd::string GetEditingGameDataFolder()
{
static AZStd::string s_currentModName;
// query the editor root. The bus exists in case we want tools to be able to override this.
if (g_currentModName.empty())
if (s_currentModName.empty())
{
return GetGameAssetsFolder();
}
AZStd::string str(GetGameAssetsFolder());
str += "Mods\\";
str += g_currentModName;
str += s_currentModName;
return str;
}

@ -93,7 +93,7 @@ namespace Path
#endif
file = path_buffer;
}
inline void Split(const string& filepath, string& path, string& file)
inline void Split(const AZStd::string& filepath, AZStd::string& path, AZStd::string& file)
{
char path_buffer[_MAX_PATH];
char drive[_MAX_DRIVE];
@ -101,7 +101,7 @@ namespace Path
char fname[_MAX_FNAME];
char ext[_MAX_EXT];
#ifdef AZ_COMPILER_MSVC
_splitpath_s(filepath, drive, AZ_ARRAY_SIZE(drive), dir, AZ_ARRAY_SIZE(dir), 0, 0, 0, 0);
_splitpath_s(filepath.c_str(), drive, AZ_ARRAY_SIZE(drive), dir, AZ_ARRAY_SIZE(dir), 0, 0, 0, 0);
_makepath_s(path_buffer, AZ_ARRAY_SIZE(path_buffer), drive, dir, 0, 0);
path = path_buffer;
_makepath_s(path_buffer, AZ_ARRAY_SIZE(path_buffer), 0, 0, fname, ext);
@ -137,7 +137,7 @@ namespace Path
filename = fname;
fext = ext;
}
inline void Split(const string& filepath, string& path, string& filename, string& fext)
inline void Split(const AZStd::string& filepath, AZStd::string& path, AZStd::string& filename, AZStd::string& fext)
{
char path_buffer[_MAX_PATH];
char drive[_MAX_DRIVE];
@ -145,7 +145,7 @@ namespace Path
char fname[_MAX_FNAME];
char ext[_MAX_EXT];
#ifdef AZ_COMPILER_MSVC
_splitpath_s(filepath, drive, AZ_ARRAY_SIZE(drive), dir, AZ_ARRAY_SIZE(dir), fname, AZ_ARRAY_SIZE(fname), ext, AZ_ARRAY_SIZE(ext));
_splitpath_s(filepath.c_str(), drive, AZ_ARRAY_SIZE(drive), dir, AZ_ARRAY_SIZE(dir), fname, AZ_ARRAY_SIZE(fname), ext, AZ_ARRAY_SIZE(ext));
_makepath_s(path_buffer, AZ_ARRAY_SIZE(path_buffer), drive, dir, 0, 0);
#else
_splitpath(filepath, drive, dir, fname, ext);
@ -271,7 +271,7 @@ namespace Path
}
template<size_t size>
inline void AddBackslash(AZstd::fixed_string<size>* path)
inline void AddBackslash(AZStd::fixed_string<size>* path)
{
if (path->empty())
{
@ -284,7 +284,7 @@ namespace Path
}
template<size_t size>
inline void AddSlash(AZstd::fixed_string<size>* path)
inline void AddSlash(AZStd::fixed_string<size>* path)
{
if (path->empty())
{
@ -357,7 +357,7 @@ namespace Path
{
return CaselessPaths(GetRelativePath(path, true));
}
inline string FullPathToGamePath(const char* path)
inline AZStd::string FullPathToGamePath(const char* path)
{
return CaselessPaths(GetRelativePath(path, true)).toUtf8().data();
}
@ -394,7 +394,7 @@ namespace Path
inline QString GetAudioLocalizationFolder(bool returnAbsolutePath)
{
// Omit the trailing slash!
QString sLocalizationFolder(QString(PathUtil::GetLocalizationFolder()).left(static_cast<int>(PathUtil::GetLocalizationFolder().size()) - 1));
QString sLocalizationFolder(QString(PathUtil::GetLocalizationFolder().c_str()).left(static_cast<int>(PathUtil::GetLocalizationFolder().size()) - 1));
if (!sLocalizationFolder.isEmpty())
{

@ -80,9 +80,7 @@ namespace AZStd
}
else
{
// Workaround to defer static_assert evaluation until this function is invoked by using the template parameter
using StringType = AZStd::basic_string<string::value_type, string::traits_type, Allocator1>;
static_assert(!AZStd::is_same_v<StringType, StringType>, "only wchar_t types of size 2 or 4 can be converted to utf8");
static_assert(false, "only wchar_t types of size 2 or 4 can be converted to utf8");
}
}
@ -123,6 +121,22 @@ namespace AZStd
static_assert(!AZStd::is_same_v<StringType, StringType>, "Cannot convert a utf8 string to a wchar_t that isn't size 2 or 4");
}
}
static inline void to_wstring(wchar_t* dest, size_t destSize, const char* first, const char* last)
{
if constexpr (Size == 2)
{
Utf8::Unchecked::utf8to16(first, last, dest, destSize);
}
else if constexpr (Size == 4)
{
Utf8::Unchecked::utf8to32(first, last, dest, destSize);
}
else
{
static_assert(false, "Cannot convert a utf8 string to a wchar_t that isn't size 2 or 4");
}
}
};
}
// 21.5: numeric conversions
@ -348,7 +362,7 @@ namespace AZStd
{
if (srcLen == 0)
{
srcLen = wcslen(str) + 1;
srcLen = wcslen(str);
}
if (srcLen > 0)
@ -497,6 +511,19 @@ namespace AZStd
return to_wstring(dest, src.c_str(), src.length());
}
inline void to_wstring(wchar_t* dest, size_t destSize, const char* str, size_t srcLen = 0)
{
if (srcLen == 0)
{
srcLen = strlen(str) + 1;
}
if (srcLen > 0)
{
Internal::WCharTPlatformConverter<>::to_wstring(dest, destSize, str, str + srcLen + 1); // copy null terminator
}
}
// Convert a range of chars to lower case
#if defined(AZSTD_USE_OLD_RW_STL)
template<class Iterator>

@ -201,7 +201,7 @@ struct IStreamable
virtual void StartStreaming(bool bFinishNow, IReadStream_AutoPtr* ppStream) = 0;
virtual int GetStreamableContentMemoryUsage(bool bJustForDebug = false) = 0;
virtual void ReleaseStreamableContent() = 0;
virtual void GetStreamableName(string& sName) = 0;
virtual void GetStreamableName(AZStd::string& sName) = 0;
virtual uint32 GetLastDrawMainFrameId() = 0;
virtual bool IsUnloadable() const = 0;
@ -239,8 +239,8 @@ struct IStatObj
SSubObject() { bShadowProxy = 0; }
EStaticSubObjectType nType;
string name;
string properties;
AZStd::string name;
AZStd::string properties;
int nParent; // Index of the parent sub object, if there`s hierarchy between them.
Matrix34 tm; // Transformation matrix.
Matrix34 localTM; // Local transformation matrix, relative to parent.
@ -510,10 +510,10 @@ struct IStatObj
virtual bool IsUnloadable() const = 0;
virtual void SetCanUnload(bool value) = 0;
virtual string& GetFileName() = 0;
virtual const string& GetFileName() const = 0;
virtual AZStd::string& GetFileName() = 0;
virtual const AZStd::string& GetFileName() const = 0;
virtual const string& GetCGFNodeName() const = 0;
virtual const AZStd::string& GetCGFNodeName() const = 0;
// Summary:
// Returns the filename of the object

@ -101,7 +101,13 @@ public:
XmlString(const char* str)
: AZStd::string(str) {};
operator const char*() const {
size_t GetAllocatedMemory() const
{
return sizeof(XmlString) + capacity() * sizeof(AZStd::string::value_type);
}
operator const char*() const
{
return c_str();
}
};

@ -10,13 +10,14 @@
#include <algorithm>
#include <AzCore/PlatformIncl.h>
#include <AzCore/Utils/Utils.h>
#include <time.h>
namespace CrashHandler
{
void GetExecutablePathA(char* pathBuffer, int& bufferSize)
void GetExecutablePath(char* pathBuffer, int& bufferSize)
{
GetModuleFileNameA(nullptr, pathBuffer, bufferSize);
AZ::Utils::GetExecutablePath(pathBuffer, bufferSize);
}
void GetExecutablePathW(wchar_t* pathBuffer, int& bufferSize)

@ -358,13 +358,11 @@ GridHubComponent::GridHubComponent()
m_isLogToFile = false;
#ifdef AZ_PLATFORM_WINDOWS
TCHAR name[MAX_COMPUTERNAME_LENGTH + 1];
wchar_t name[MAX_COMPUTERNAME_LENGTH + 1];
DWORD dwCompNameLen = AZ_ARRAY_SIZE(name);
if ( GetComputerName(name, &dwCompNameLen) != 0 )
if (GetComputerName(name, &dwCompNameLen) != 0)
{
char c[MAX_COMPUTERNAME_LENGTH + 1];
wcstombs(c, name, AZ_ARRAY_SIZE(c));
m_hubName = c;
AZStd::to_string(m_hubName, name);
}
else
#endif

@ -16,7 +16,6 @@
#include <shlguid.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <tchar.h>
#endif
#include "gridhub.hxx"
@ -39,6 +38,7 @@ AZ_POP_DISABLE_WARNING
#include <AzCore/Math/Crc.h>
#include <AzCore/IO/SystemFile.h>
#include <AzCore/std/parallel/mutex.h>
#include <AzCore/Utils/Utils.h>
#ifdef AZ_PLATFORM_WINDOWS
#include <Shlwapi.h>
@ -53,9 +53,9 @@ AZ_POP_DISABLE_WARNING
#endif
#ifdef AZ_PLATFORM_WINDOWS
#define GRIDHUB_TSR_SUFFIX _T("_copyapp_")
#define GRIDHUB_TSR_NAME _T("GridHub_copyapp_.exe")
#define GRIDHUB_IMAGE_NAME _T("GridHub.exe")
#define GRIDHUB_TSR_SUFFIX L"_copyapp_"
#define GRIDHUB_TSR_NAME L"GridHub_copyapp_.exe"
#define GRIDHUB_IMAGE_NAME L"GridHub.exe"
#else
#define GRIDHUB_TSR_SUFFIX "_copyapp_"
#define GRIDHUB_TSR_NAME "GridHub_copyapp_"
@ -191,7 +191,7 @@ protected:
specializations.Append("gridhub");
}
QString m_originalExeFileName;
QString m_originalExeFileName;
QDateTime m_originalExeLastModified;
bool m_monitorForExeChanges;
bool m_needToRelaunch;
@ -305,22 +305,22 @@ public:
{
#ifdef AZ_PLATFORM_WINDOWS
HRESULT hres;
TCHAR startupFolder[MAX_PATH] = {0};
TCHAR fullLinkName[MAX_PATH] = {0};
wchar_t startupFolder[MAX_PATH] = {0};
wchar_t fullLinkName[MAX_PATH] = {0};
LPITEMIDLIST pidlFolder = NULL;
hres = SHGetFolderLocation(0,/*CSIDL_COMMON_STARTUP all users required admin access*/CSIDL_STARTUP,NULL,0,&pidlFolder);
if (SUCCEEDED(hres))
{
if( SHGetPathFromIDList(pidlFolder,startupFolder) )
if (SHGetPathFromIDList(pidlFolder, startupFolder))
{
_tcscat_s(fullLinkName,startupFolder);
_tcscat_s(fullLinkName,"\\Amazon Grid Hub.lnk");
wcscat_s(fullLinkName, startupFolder);
wcscat_s(fullLinkName, L"\\Amazon Grid Hub.lnk");
}
CoTaskMemFree(pidlFolder);
}
if( moduleFilename.isEmpty() || _tcslen(fullLinkName) == 0 )
if( moduleFilename.isEmpty() || wcslen(fullLinkName) == 0 )
return;
// for development, never autoadd to startup
@ -342,8 +342,8 @@ public:
IPersistFile* ppf;
// Set the path to the shortcut target and add the description.
psl->SetPath(moduleFilename.toUtf8().data());
psl->SetDescription("Amazon Grid Hub");
psl->SetPath(moduleFilename.toStdWString().c_str());
psl->SetDescription(L"Amazon Grid Hub");
// Query IShellLink for the IPersistFile interface, used for saving the
// shortcut in persistent storage.
@ -351,16 +351,8 @@ public:
if (SUCCEEDED(hres))
{
WCHAR wsz[MAX_PATH];
// Ensure that the string is Unicode.
MultiByteToWideChar(CP_ACP, 0, fullLinkName, -1, wsz, MAX_PATH);
// Add code here to check return value from MultiByteWideChar
// for success.
// Save the link by calling IPersistFile::Save.
hres = ppf->Save(wsz, TRUE);
hres = ppf->Save(fullLinkName, TRUE);
ppf->Release();
}
psl->Release();
@ -412,13 +404,17 @@ GridHubApplication::Create(const Descriptor& descriptor, const StartupParameters
{
bool isError = false;
#ifdef AZ_PLATFORM_WINDOWS
TCHAR originalExeFileName[MAX_PATH];
if (GetModuleFileName(NULL, originalExeFileName, AZ_ARRAY_SIZE(originalExeFileName)))
char originalExeFileName[MAX_PATH];
if (AZ::Utils::GetExecutablePath(originalExeFileName, AZ_ARRAY_SIZE(originalExeFileName)).m_pathStored == AZ::Utils::ExecutablePathResult::Success)
{
PathRemoveFileSpec(originalExeFileName);
PathAppend(originalExeFileName, GRIDHUB_IMAGE_NAME);
wchar_t originalExeFileNameW[MAX_PATH];
AZStd::to_wstring(originalExeFileNameW, MAX_PATH, originalExeFileName, MAX_PATH);
PathRemoveFileSpec(originalExeFileNameW);
PathAppend(originalExeFileNameW, GRIDHUB_IMAGE_NAME);
m_originalExeFileName = originalExeFileName;
AZStd::string finalExeFileName;
AZStd::to_string(finalExeFileName, originalExeFileNameW);
m_originalExeFileName = finalExeFileName.c_str();
m_originalExeLastModified = QFileInfo(m_originalExeFileName).lastModified();
}
@ -489,18 +485,20 @@ void GridHubApplication::RegisterCoreComponents()
void CopyAndRun(bool failSilently)
{
#ifdef AZ_PLATFORM_WINDOWS
TCHAR myFileName[MAX_PATH] = { _T(0) };
if (GetModuleFileName(NULL, myFileName, MAX_PATH ))
char myFileName[MAX_PATH] = { 0 };
if (AZ::Utils::GetExecutablePath(myFileName, MAX_PATH).m_pathStored == AZ::Utils::ExecutablePathResult::Success)
{
TCHAR sourceProcPath[MAX_PATH] = { _T(0) };
TCHAR targetProcPath[MAX_PATH] = { _T(0) };
TCHAR procDrive[MAX_PATH] = { _T(0) };
TCHAR procDir[MAX_PATH] = { _T(0) };
TCHAR procFname[MAX_PATH] = { _T(0) };
TCHAR procExt[MAX_PATH] = { _T(0) };
_tsplitpath_s(myFileName, procDrive, procDir, procFname, procExt);
_tmakepath_s(sourceProcPath, procDrive, procDir, GRIDHUB_IMAGE_NAME, NULL);
_tmakepath_s(targetProcPath, procDrive, procDir, GRIDHUB_TSR_NAME, NULL);
wchar_t myFileNameW[MAX_PATH] = { 0 };
AZStd::to_wstring(myFileNameW, MAX_PATH, myFileName, MAX_PATH);
wchar_t sourceProcPath[MAX_PATH] = { 0 };
wchar_t targetProcPath[MAX_PATH] = { 0 };
wchar_t procDrive[MAX_PATH] = { 0 };
wchar_t procDir[MAX_PATH] = { 0 };
wchar_t procFname[MAX_PATH] = { 0 };
wchar_t procExt[MAX_PATH] = { 0 };
_wsplitpath_s(myFileNameW, procDrive, procDir, procFname, procExt);
_wmakepath_s(sourceProcPath, procDrive, procDir, GRIDHUB_IMAGE_NAME, NULL);
_wmakepath_s(targetProcPath, procDrive, procDir, GRIDHUB_TSR_NAME, NULL);
if (CopyFileEx(sourceProcPath, targetProcPath, NULL, NULL, NULL, 0))
{
STARTUPINFO si;
@ -527,9 +525,9 @@ void CopyAndRun(bool failSilently)
{
if (!failSilently)
{
TCHAR errorMsg[1024] = { _T(0) };
_stprintf_s(errorMsg, _T("Failed to copy GridHub. Make sure that %s%s is writable!"), procFname, procExt);
MessageBox(NULL, errorMsg, NULL, MB_ICONSTOP|MB_OK);
wchar_t errorMsg[1024] = { 0 };
swprintf_s(errorMsg, L"Failed to copy GridHub. Make sure that %s%s is writable!", procFname, procExt);
MessageBoxW(NULL, errorMsg, NULL, MB_ICONSTOP|MB_OK);
}
}
}
@ -565,16 +563,18 @@ void CopyAndRun(bool failSilently)
void RelaunchImage()
{
#ifdef AZ_PLATFORM_WINDOWS
TCHAR myFileName[MAX_PATH] = { _T(0) };
if (GetModuleFileName(NULL, myFileName, MAX_PATH))
char myFileName[MAX_PATH] = { 0 };
if (AZ::Utils::GetExecutablePath(myFileName, MAX_PATH).m_pathStored == AZ::Utils::ExecutablePathResult::Success)
{
TCHAR targetProcPath[MAX_PATH] = { _T(0) };
TCHAR procDrive[MAX_PATH] = { _T(0) };
TCHAR procDir[MAX_PATH] = { _T(0) };
TCHAR procFname[MAX_PATH] = { _T(0) };
TCHAR procExt[MAX_PATH] = { _T(0) };
_tsplitpath_s(myFileName, procDrive, procDir, procFname, procExt);
_tmakepath_s(targetProcPath, procDrive, procDir, GRIDHUB_IMAGE_NAME, NULL);
wchar_t myFileNameW[MAX_PATH] = { 0 };
AZStd::to_wstring(myFileNameW, MAX_PATH, myFileName, MAX_PATH);
wchar_t targetProcPath[MAX_PATH] = { 0 };
wchar_t procDrive[MAX_PATH] = { 0 };
wchar_t procDir[MAX_PATH] = { 0 };
wchar_t procFname[MAX_PATH] = { 0 };
wchar_t procExt[MAX_PATH] = { 0 };
_wsplitpath_s(myFileNameW, procDrive, procDir, procFname, procExt);
_wmakepath_s(targetProcPath, procDrive, procDir, GRIDHUB_IMAGE_NAME, NULL);
STARTUPINFO si;
PROCESS_INFORMATION pi;
@ -635,8 +635,8 @@ int main(int argc, char *argv[])
{
#ifdef AZ_PLATFORM_WINDOWS
TCHAR exeFileName[MAX_PATH];
if( GetModuleFileName(NULL,exeFileName,AZ_ARRAY_SIZE(exeFileName)) )
char exeFileName[MAX_PATH];
if (AZ::Utils::GetExecutablePath(exeFileName, AZ_ARRAY_SIZE(exeFileName)).m_pathStored == AZ::Utils::ExecutablePathResult::Success)
#elif defined AZ_PLATFORM_LINUX
//KDAB_TODO
char exeFileName[MAXPATHLEN];
@ -661,7 +661,7 @@ int main(int argc, char *argv[])
{
#ifdef AZ_PLATFORM_WINDOWS
// Create a OS named mutex while the OS is running
HANDLE hInstanceMutex = CreateMutex(NULL,TRUE,"Global\\GridHub-Instance");
HANDLE hInstanceMutex = CreateMutex(NULL, TRUE, L"Global\\GridHub-Instance");
AZ_Assert(hInstanceMutex!=NULL,"Failed to create OS mutex [GridHub-Instance]\n");
if( hInstanceMutex != NULL && GetLastError() == ERROR_ALREADY_EXISTS)
{

@ -19,7 +19,7 @@
namespace LuxCoreUI
{
void LaunchLuxCoreUI(const AZStd::string& luxCoreExeFullPath, AZStd::string& commandLine);
void LaunchLuxCoreUI(const AZStd::string& luxCoreExeFullPath, const AZStd::string& commandLine);
}
namespace AZ

@ -7,11 +7,12 @@
*/
#include <AzCore/std/string/string.h>
#include <AzCore/std/string/conversions.h>
#include <AzCore/PlatformIncl.h>
namespace LuxCoreUI
{
void LaunchLuxCoreUI(const AZStd::string& luxCoreExeFullPath, AZStd::string& commandLine)
void LaunchLuxCoreUI(const AZStd::string& luxCoreExeFullPath, const AZStd::string& commandLine)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
@ -20,9 +21,14 @@ namespace LuxCoreUI
si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi));
AZStd::wstring luxCoreExeFullPathW;
AZStd::to_wstring(luxCoreExeFullPathW, luxCoreExeFullPath.c_str());
AZStd::wstring commandLineW;
AZStd::to_wstring(commandLineW, commandLine.c_str());
// start the program up
CreateProcess(luxCoreExeFullPath.data(), // the path
commandLine.data(), // Command line
CreateProcessW(luxCoreExeFullPathW.c_str(), // the path
commandLineW.data(), // Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE

@ -78,7 +78,7 @@ namespace AZ
}
constexpr uint32_t SubKeyLength = 256;
char subKeyName[SubKeyLength];
wchar_t subKeyName[SubKeyLength];
uint32_t driverVersion = 0;

@ -18,7 +18,7 @@ namespace AZ
bool GetWindowsVersionFromSystemDLL(WindowsVersion* windowsVersion)
{
// We get the file version of one of the system DLLs to get the OS version.
constexpr const char* dllName = "Kernel32.dll";
constexpr const wchar_t* dllName = L"Kernel32.dll";
VS_FIXEDFILEINFO* fileInfo = nullptr;
DWORD handle;
DWORD infoSize = GetFileVersionInfoSize(dllName, &handle);
@ -28,7 +28,7 @@ namespace AZ
if (GetFileVersionInfo(dllName, handle, infoSize, versionData.data()) != 0)
{
UINT len;
const char* subBlock = "\\";
const wchar_t* subBlock = L"\\";
if (VerQueryValue(versionData.data(), subBlock, reinterpret_cast<LPVOID*>(&fileInfo), &len) != 0)
{
windowsVersion->m_majorVersion = HIWORD(fileInfo->dwProductVersionMS);

@ -13,9 +13,13 @@ namespace AZ
namespace DX12
{
FenceEvent::FenceEvent(const char* name)
: m_EventHandle(CreateEvent(nullptr, false, false, name))
: m_EventHandle(nullptr)
, m_name(name)
{}
{
AZStd::wstring nameW;
AZStd::to_wstring(nameW, name);
m_EventHandle = CreateEvent(nullptr, false, false, nameW.c_str());
}
FenceEvent::~FenceEvent()
{

@ -28,6 +28,7 @@ ly_add_target(
BUILD_DEPENDENCIES
PRIVATE
AZ::CrashHandler
AZ::AzCore
)
# Load the "Gem::CrashReporting" module in Clients and Servers

@ -159,7 +159,7 @@ namespace EMotionFX
(azrtti_typeid<>(conditionPrototype) != azrtti_typeid<AnimGraphTransitionCondition>()))
{
AZ::TypeId type = azrtti_typeid<>(conditionPrototype);
OutputDebugString(AZStd::string::format("Condition: Name=%s, Type=%s\n", conditionPrototype->GetPaletteName(), type.ToString<AZStd::string>().c_str()).c_str());
AZ::Debug::Platform::OutputToDebugger(nullptr, AZStd::string::format("Condition: Name=%s, Type=%s\n", conditionPrototype->GetPaletteName(), type.ToString<AZStd::string>().c_str()).c_str());
result.emplace_back(azrtti_typeid<>(conditionPrototype));
}
}

@ -1963,7 +1963,7 @@ void CLightAnimWrapper::InvalidateAllNodes()
CLightAnimWrapper* CLightAnimWrapper::FindLightAnim(const char* name)
{
LightAnimWrapperCache::const_iterator it = ms_lightAnimWrapperCache.find(CONST_TEMP_STRING(name));
LightAnimWrapperCache::const_iterator it = ms_lightAnimWrapperCache.find(name);
return it != ms_lightAnimWrapperCache.end() ? (*it).second : 0;
}
@ -1976,7 +1976,7 @@ void CLightAnimWrapper::CacheLightAnim(const char* name, CLightAnimWrapper* p)
//////////////////////////////////////////////////////////////////////////
void CLightAnimWrapper::RemoveCachedLightAnim(const char* name)
{
ms_lightAnimWrapperCache.erase(CONST_TEMP_STRING(name));
ms_lightAnimWrapperCache.erase(name);
}
#ifdef MOVIESYSTEM_SUPPORT_EDITING

@ -48,7 +48,7 @@ public:
static void InvalidateAllNodes();
private:
typedef std::map<string, CLightAnimWrapper*> LightAnimWrapperCache;
typedef std::map<AZStd::string, CLightAnimWrapper*> LightAnimWrapperCache;
static StaticInstance<LightAnimWrapperCache> ms_lightAnimWrapperCache;
static AZStd::intrusive_ptr<IAnimSequence> ms_pLightAnimSet;

@ -10,6 +10,7 @@
#include <AzCore/IO/SystemFile.h>
#include <AzCore/std/string/conversions.h>
#include <AzCore/Utils/Utils.h>
#include <AzCore/PlatformIncl.h>
#include <shlobj.h>
@ -99,7 +100,7 @@ namespace SaveData
AZStd::string GetExecutableName()
{
char moduleFileName[AZ_MAX_PATH_LEN];
GetModuleFileNameA(nullptr, moduleFileName, AZ_MAX_PATH_LEN);
AZ::Utils::GetExecutablePath(moduleFileName, AZ_MAX_PATH_LEN);
const AZStd::string moduleFileNameString(moduleFileName);
const size_t executableNameStart = moduleFileNameString.find_last_of('\\') + 1;

Loading…
Cancel
Save