Merge branch 'development' into cmake/SPEC-7484

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

# Conflicts:
#	Code/Editor/ConfigGroup.cpp
#	Code/Editor/ControlMRU.cpp
#	Code/Editor/CryEdit.cpp
#	Code/Editor/CryEdit.h
#	Code/Editor/IEditorImpl.cpp
#	Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameController.cpp
This commit is contained in:
Esteban Papp
2021-08-10 09:23:34 -07:00
1040 changed files with 29662 additions and 44251 deletions
@@ -114,6 +114,9 @@ namespace Camera
//! Makes the camera the active view
virtual void MakeActiveView() = 0;
//! Check if this camera is the active render camera
virtual bool IsActiveView() = 0;
//! Get the camera frustum's aggregate configuration
virtual Configuration GetCameraConfiguration()
{
@@ -24,7 +24,9 @@
#include <sys/ioctl.h>
#include <sys/resource.h> // for iopolicy
#include <time.h>
#include <unistd.h>
extern char **environ;
namespace AzFramework
{
@@ -45,7 +47,7 @@ namespace AzFramework
// result == 0 means child PID is still running, nothing to check
if (result == -1)
{
AZ_TracePrintf("ProcessWatcher", "IsChildProcessDone could not determine child process status (waitpid errno %d). assuming process either failed to launch or terminated unexpectedly\n", errno);
AZ_TracePrintf("ProcessWatcher", "IsChildProcessDone could not determine child process status (waitpid errno %d(%s)). assuming process either failed to launch or terminated unexpectedly\n", errno, strerror(errno));
exitCode = 0;
}
else if (result == childProcessId)
@@ -274,28 +276,27 @@ namespace AzFramework
azstrcat(commandAndArgs[i], token.size(), token.c_str());
}
commandAndArgs[commandTokens.size()] = nullptr;
char** environmentVariables = nullptr;
int numEnvironmentVars = 0;
constexpr int MaxEnvVariables = 128;
using EnvironmentVariableContainer = AZStd::fixed_vector<char*, MaxEnvVariables>;
EnvironmentVariableContainer environmentVariables;
for (char **env = ::environ; *env; env++)
{
environmentVariables.push_back(*env);
}
if (processLaunchInfo.m_environmentVariables)
{
const int numEnvironmentVars = processLaunchInfo.m_environmentVariables->size();
// Adding one more as exec expects the array to have a nullptr as the last element
environmentVariables = new char*[numEnvironmentVars + 1];
for (int i = 0; i < numEnvironmentVars; i++)
for (AZStd::string& processLaunchEnv : *processLaunchInfo.m_environmentVariables)
{
const AZStd::string& envVarString = processLaunchInfo.m_environmentVariables->at(i);
environmentVariables[i] = new char[envVarString.size() + 1];
environmentVariables[i][0] = '\0';
azstrcat(environmentVariables[i], envVarString.size(), envVarString.c_str());
environmentVariables.push_back(processLaunchEnv.data());
}
environmentVariables[numEnvironmentVars] = NULL;
}
environmentVariables.push_back(nullptr);
pid_t child_pid = fork();
if (IsIdChildProcess(child_pid))
{
ExecuteCommandAsChild(commandAndArgs, environmentVariables, processLaunchInfo, processData.m_startupInfo);
ExecuteCommandAsChild(commandAndArgs, environmentVariables.data(), processLaunchInfo, processData.m_startupInfo);
}
processData.m_childProcessId = child_pid;
@@ -303,15 +304,6 @@ namespace AzFramework
// Close these handles as they are only to be used by the child process
processData.m_startupInfo.CloseAllHandles();
if (processLaunchInfo.m_environmentVariables)
{
for (int i = 0; i < numEnvironmentVars; i++)
{
delete [] environmentVariables[i];
}
delete [] environmentVariables;
}
for (int i = 0; i < commandTokens.size(); i++)
{
delete [] commandAndArgs[i];
@@ -8,6 +8,7 @@
#include <../Common/WinAPI/AzFramework/Input/Devices/Keyboard/InputDeviceKeyboard_WinAPI.h>
#include <AzFramework/Input/Buses/Notifications/RawInputNotificationBus_Platform.h>
#include <AzCore/Module/Environment.h>
////////////////////////////////////////////////////////////////////////////////////////////////////
namespace
@@ -29,7 +30,7 @@ namespace AzFramework
{
////////////////////////////////////////////////////////////////////////////////////////////
//! Count of the number instances of this class that have been created
static int s_instanceCount;
static AZ::EnvironmentVariable<int> s_instanceCount;
public:
////////////////////////////////////////////////////////////////////////////////////////////
@@ -106,7 +107,7 @@ namespace AzFramework
}
////////////////////////////////////////////////////////////////////////////////////////////////
int InputDeviceKeyboardWindows::s_instanceCount = 0;
AZ::EnvironmentVariable<int> InputDeviceKeyboardWindows::s_instanceCount = nullptr;
////////////////////////////////////////////////////////////////////////////////////////////////
InputDeviceKeyboardWindows::InputDeviceKeyboardWindows(InputDeviceKeyboard& inputDevice)
@@ -116,8 +117,10 @@ namespace AzFramework
, m_hasFocus(false)
, m_hasTextEntryStarted(false)
{
if (s_instanceCount++ == 0)
if (!s_instanceCount)
{
s_instanceCount = AZ::Environment::CreateVariable<int>("InputDeviceKeyboardInstanceCount", 1);
// Register for raw keyboard input
RAWINPUTDEVICE rawInputDevice;
rawInputDevice.usUsagePage = RAW_INPUT_KEYBOARD_USAGE_PAGE;
@@ -128,6 +131,10 @@ namespace AzFramework
AZ_Assert(result, "Failed to register raw input device: keyboard");
AZ_UNUSED(result);
}
else
{
s_instanceCount.Set(s_instanceCount.Get() + 1);
}
RawInputNotificationBusWindows::Handler::BusConnect();
}
@@ -137,7 +144,8 @@ namespace AzFramework
{
RawInputNotificationBusWindows::Handler::BusDisconnect();
if (--s_instanceCount == 0)
int instanceCount = s_instanceCount.Get();
if (--instanceCount == 0)
{
// Deregister from raw keyboard input
RAWINPUTDEVICE rawInputDevice;
@@ -148,7 +156,13 @@ namespace AzFramework
const BOOL result = RegisterRawInputDevices(&rawInputDevice, 1, sizeof(rawInputDevice));
AZ_Assert(result, "Failed to deregister raw input device: keyboard");
AZ_UNUSED(result);
s_instanceCount.Reset();
}
else
{
s_instanceCount.Set(instanceCount);
}
}
////////////////////////////////////////////////////////////////////////////////////////////////
@@ -7,6 +7,7 @@
*/
#include <AzCore/PlatformIncl.h>
#include <AzCore/Module/Environment.h>
#include <AzFramework/Input/Devices/Mouse/InputDeviceMouse.h>
#include <AzFramework/Input/Buses/Notifications/RawInputNotificationBus_Platform.h>
#include <AzFramework/Input/Buses/Requests/InputSystemCursorRequestBus.h>
@@ -43,7 +44,7 @@ namespace AzFramework
{
////////////////////////////////////////////////////////////////////////////////////////////
//! Count of the number instances of this class that have been created
static int s_instanceCount;
static AZ::EnvironmentVariable<int> s_instanceCount;
public:
////////////////////////////////////////////////////////////////////////////////////////////
@@ -125,7 +126,7 @@ namespace AzFramework
}
////////////////////////////////////////////////////////////////////////////////////////////////
int InputDeviceMouseWindows::s_instanceCount = 0;
AZ::EnvironmentVariable<int> InputDeviceMouseWindows::s_instanceCount = nullptr;
////////////////////////////////////////////////////////////////////////////////////////////////
InputDeviceMouseWindows::InputDeviceMouseWindows(InputDeviceMouse& inputDevice)
@@ -137,18 +138,24 @@ namespace AzFramework
{
memset(&m_lastClientRect, 0, sizeof(m_lastClientRect));
if (s_instanceCount++ == 0)
if (!s_instanceCount)
{
s_instanceCount = AZ::Environment::CreateVariable<int>("InputDeviceMouseInstanceCount", 1);
// Register for raw mouse input
RAWINPUTDEVICE rawInputDevice;
rawInputDevice.usUsagePage = RAW_INPUT_MOUSE_USAGE_PAGE;
rawInputDevice.usUsage = RAW_INPUT_MOUSE_USAGE;
rawInputDevice.dwFlags = 0;
rawInputDevice.hwndTarget = 0;
rawInputDevice.usUsage = RAW_INPUT_MOUSE_USAGE;
rawInputDevice.dwFlags = 0;
rawInputDevice.hwndTarget = 0;
const BOOL result = RegisterRawInputDevices(&rawInputDevice, 1, sizeof(rawInputDevice));
AZ_Assert(result, "Failed to register raw input device: mouse");
AZ_UNUSED(result);
}
else
{
s_instanceCount.Set(s_instanceCount.Get() + 1);
}
RawInputNotificationBusWindows::Handler::BusConnect();
}
@@ -161,7 +168,8 @@ namespace AzFramework
// Cleanup system cursor visibility and constraint
SetSystemCursorState(SystemCursorState::Unknown);
if (--s_instanceCount == 0)
int instanceCount = s_instanceCount.Get();
if (--instanceCount == 0)
{
// Deregister from raw mouse input
RAWINPUTDEVICE rawInputDevice;
@@ -172,6 +180,12 @@ namespace AzFramework
const BOOL result = RegisterRawInputDevices(&rawInputDevice, 1, sizeof(rawInputDevice));
AZ_Assert(result, "Failed to deregister raw input device: mouse");
AZ_UNUSED(result);
s_instanceCount.Reset();
}
else
{
s_instanceCount.Set(instanceCount);
}
}