Cry Legacy: the Lessening (#5961)

* Generic Cleanup

Removals:

* Unused cvars,member variables and defines
* Windows media center edition support routines
* CSystem - removed debug_GetCallStackRaw/GetRootWindowMessageHandler/
UnloadDLL/ShutdownModuleLibraries

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Fix CryMessageBox return values in Windows build

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Remove named selection group and a few smaller unused functionalities

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Remove ObjectManager export functionality + 2 deprecated functions

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Remove object legacy freeze/hide support from ObjectManager

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Remove ObjectManager duplicate name dection, as well as object renaming

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Remove ObjectManager serialization and selection callbacks

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* ObjectManager - remove MoveObjects/HitTestObject/EndEditParams and related members/functions

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Remove a bunch of unused clone related functionality + misc

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* ObjectManager - misc removals

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* ObjectManager - more removals

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Remove unused object selection/retrieval in ObjectManager and LoadObjects in ObjectLoader

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* CBaseObject - remove unused material layers mask support

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* More CBaseObject cleanups.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* CBaseObject - remove SubObj functions and IMouseCreateCallback

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Remove unused procedural floor management, helper scale and tags.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* CBaseObject - remove more unused methods.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Removals in multiple places.

CBaseObject - unused `OBJTYPE_DUMMY` flag removed, member `IsSameClass`
CObjectArchive removed unused methods/members
CObjectManager removed unused `Update` method

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* More removals

IDisplayViewport - HitTestLine/GetGridStep/setHitcontext/
GetConstructionPlane
Unused Cry_Matrix44 template specializations.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* O3DE.exe Project-Centric "Open Editor" fix (#5852)

* The O3DE.exe Open Editor button now attempts to open the Editor in the
build directory of the project being opened.

If their is no Editor within the build directory of the Project, it uses
the Editor.exe in the current O3DE.exe executable directory if it exists

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Engine .gitignore now ignores the build directory if placed in the
AutomatedTesting project

Previously it was just ignoring a `[Bb]uild` directory if it was
directly within the engine root.
This change matches the behavior of the project templates.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Renamed the ProjectUtils GetEditorDirectory function to
GetEditorExecutablePath

Added a platform specific implementation for retrieving the path to the
Editor executable in the GetEditorExectuablePath function.

It first attempts to locate the Editor via checking the project build
directory for an Editor executable before falling back to checking the
binary directory of the currently running O3DE executable.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Correct the MacOS GetEditorExecutablePath to return the Editor path

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Adding missing C++20 std::erase implementations (#5735)

There were already implementations for std::erase_if.
This adds the counterpart AZStd::erase versions

resolves #5734

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* More removals and refactors

`ShowMessage` and `CryMessageBox` return void now
Simplify code in `CSystem::WarningV`
Remove unused `CryGetTicksPerSec`
Remove unused WinBase functionality
Replace `nanosleep` call in WinBase with `std::this_thread::sleep_for`
Remove unused Win32Wrapper routines
Remove unused IFunctorBase.h and IEntityObjectListener.h
Fix VectorAndArray.cpp compilation
Use QMessageBox instead of CryMessageBox in the editor.
Remove empty ArchiveVars platform specific files

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Fix test code.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Remove an unused  function

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* CBaseObject and undo description removals.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* A bunch of removals

* Remove IRenderNode
* Remove editor's KDTree
* Remove StatObjBus, InstanceStatObjEventBus::ReleaseData is redundant (
same functionality in the only available handler is triggered by
`OnCryEditorCloseScene`)
* Remove CExportManager::AddStatObj/AddMeshes/AddMesh,
IExportManager::ExportSingleStatObj
* Remove CIconManager/IIconManager::GetObject
* Remove CBaseObject::IntersectRayMesh
* Remove IIndexedMesh and related structs.
* Unused IUndoObject::GetDescription and all derived implementations.
* Unused CUndoBaseLibrary/CUndoBaseLibraryManager
* Unused Matrix34_tpl typedefs
* Legacy Xml classes cleanup

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Remove unused `Vec3ToVector3D` helper

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* fix - remove unused static variable

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
This commit is contained in:
Artur K
2021-11-29 19:21:06 +01:00
committed by GitHub
parent a3835d8545
commit 56904d1799
115 changed files with 355 additions and 6354 deletions
+10 -161
View File
@@ -209,20 +209,7 @@ CSystem::CSystem(SharedEnvironmentInstance* pSharedEnvironment)
m_env.pSharedEnvironment = pSharedEnvironment;
//////////////////////////////////////////////////////////////////////////
m_pIFont = NULL;
m_pIFontUi = NULL;
m_rWidth = NULL;
m_rHeight = NULL;
m_rWidthAndHeightAsFractionOfScreenSize = NULL;
m_rMaxWidth = NULL;
m_rMaxHeight = NULL;
m_rColorBits = NULL;
m_rDepthBits = NULL;
m_cvSSInfo = NULL;
m_rStencilBits = NULL;
m_rFullscreen = NULL;
m_sysNoUpdate = NULL;
m_pProcess = NULL;
m_pCmdLine = NULL;
m_pLevelSystem = NULL;
m_pLocalizationManager = NULL;
@@ -230,18 +217,9 @@ CSystem::CSystem(SharedEnvironmentInstance* pSharedEnvironment)
#define AZ_RESTRICTED_SECTION SYSTEM_CPP_SECTION_2
#include AZ_RESTRICTED_FILE(System_cpp)
#endif
m_sys_min_step = 0;
m_sys_max_step = 0;
m_cvAIUpdate = NULL;
m_pUserCallback = NULL;
m_sys_memory_debug = NULL;
m_sysWarnings = NULL;
m_sysKeyboard = NULL;
m_sys_firstlaunch = NULL;
m_sys_enable_budgetmonitoring = NULL;
m_sys_preload = NULL;
// m_sys_filecache = NULL;
m_gpu_particle_physics = NULL;
@@ -256,22 +234,11 @@ CSystem::CSystem(SharedEnvironmentInstance* pSharedEnvironment)
m_bNoCrashDialog = false;
m_bNoErrorReportWindow = false;
m_pCVarQuit = NULL;
m_bForceNonDevMode = false;
m_bWasInDevMode = false;
m_bInDevMode = false;
m_bGameFolderWritable = false;
m_bDrawConsole = true;
m_bDrawUI = true;
m_nServerConfigSpec = CONFIG_VERYHIGH_SPEC;
m_nMaxConfigSpec = CONFIG_VERYHIGH_SPEC;
m_bPaused = false;
m_bNoUpdate = false;
m_nUpdateCounter = 0;
m_iApplicationInstance = -1;
@@ -293,7 +260,6 @@ CSystem::CSystem(SharedEnvironmentInstance* pSharedEnvironment)
m_bHasRenderedErrorMessage = false;
m_pDataProbe = nullptr;
#if AZ_LEGACY_CRYSYSTEM_TRAIT_USE_MESSAGE_HANDLER
RegisterWindowMessageHandler(this);
#endif
@@ -339,48 +305,15 @@ void CSystem::Release()
delete this;
}
//////////////////////////////////////////////////////////////////////////
void CSystem::FreeLib(AZStd::unique_ptr<AZ::DynamicModuleHandle>& hLibModule)
{
if (hLibModule)
{
if (hLibModule->IsLoaded())
{
hLibModule->Unload();
}
hLibModule.release();
}
}
//////////////////////////////////////////////////////////////////////////
IRemoteConsole* CSystem::GetIRemoteConsole()
{
return CRemoteConsole::GetInst();
}
//////////////////////////////////////////////////////////////////////////
void CSystem::SetForceNonDevMode(const bool bValue)
{
m_bForceNonDevMode = bValue;
if (bValue)
{
SetDevMode(false);
}
}
//////////////////////////////////////////////////////////////////////////
bool CSystem::GetForceNonDevMode() const
{
return m_bForceNonDevMode;
}
//////////////////////////////////////////////////////////////////////////
void CSystem::SetDevMode(bool bEnable)
{
if (bEnable)
{
m_bWasInDevMode = true;
}
m_bInDevMode = bEnable;
}
@@ -464,31 +397,13 @@ void CSystem::ShutDown()
// Release console variables.
SAFE_RELEASE(m_pCVarQuit);
SAFE_RELEASE(m_rWidth);
SAFE_RELEASE(m_rHeight);
SAFE_RELEASE(m_rWidthAndHeightAsFractionOfScreenSize);
SAFE_RELEASE(m_rMaxWidth);
SAFE_RELEASE(m_rMaxHeight);
SAFE_RELEASE(m_rColorBits);
SAFE_RELEASE(m_rDepthBits);
SAFE_RELEASE(m_cvSSInfo);
SAFE_RELEASE(m_rStencilBits);
SAFE_RELEASE(m_rFullscreen);
SAFE_RELEASE(m_sysWarnings);
SAFE_RELEASE(m_sysKeyboard);
SAFE_RELEASE(m_sys_firstlaunch);
SAFE_RELEASE(m_sys_enable_budgetmonitoring);
#if defined(AZ_RESTRICTED_PLATFORM)
#define AZ_RESTRICTED_SECTION SYSTEM_CPP_SECTION_3
#include AZ_RESTRICTED_FILE(System_cpp)
#endif
SAFE_RELEASE(m_sys_min_step);
SAFE_RELEASE(m_sys_max_step);
SAFE_DELETE(m_pLocalizationManager);
delete m_pCmdLine;
@@ -556,14 +471,6 @@ bool CSystem::IsQuitting() const
return wasExitMainLoopRequested;
}
//////////////////////////////////////////////////////////////////////////
void CSystem::SetIProcess(IProcess* process)
{
m_pProcess = process;
//if (m_pProcess)
//m_pProcess->SetPMessage("");
}
//////////////////////////////////////////////////////////////////////////
ISystem* CSystem::GetCrySystem()
{
@@ -659,7 +566,6 @@ bool CSystem::UpdatePreTickBus(int updateFlags, int nPauseMode)
AZ_TRACE_METHOD();
m_nUpdateCounter++;
#ifndef EXCLUDE_UPDATE_ON_CONSOLE
if (m_pUserCallback)
{
@@ -952,13 +858,16 @@ void CSystem::Warning(EValidatorModule module, EValidatorSeverity severity, int
}
//////////////////////////////////////////////////////////////////////////
int CSystem::ShowMessage(const char* text, const char* caption, unsigned int uType)
void CSystem::ShowMessage(const char* text, const char* caption, unsigned int uType)
{
if (m_pUserCallback)
{
return m_pUserCallback->ShowMessage(text, caption, uType);
m_pUserCallback->ShowMessage(text, caption, uType);
}
else
{
CryMessageBox(text, caption, uType);
}
return CryMessageBox(text, caption, uType);
}
inline const char* ValidatorModuleToString(EValidatorModule module)
@@ -1035,22 +944,18 @@ void CSystem::WarningV(EValidatorModule module, EValidatorSeverity severity, int
default:
break;
}
char szBuffer[MAX_WARNING_LENGTH];
vsnprintf_s(szBuffer, sizeof(szBuffer), sizeof(szBuffer) - 1, format, args);
AZStd::fixed_string<MAX_WARNING_LENGTH> fmt;
vsnprintf_s(fmt.data(), MAX_WARNING_LENGTH, MAX_WARNING_LENGTH - 1, format, args);
if (file && *file)
{
AZStd::fixed_string<MAX_WARNING_LENGTH> fmt = szBuffer;
fmt += " [File=";
fmt += file;
fmt += "]";
m_env.pLog->LogWithType(ltype, flags | VALIDATOR_FLAG_SKIP_VALIDATOR, "%s", fmt.c_str());
}
else
{
m_env.pLog->LogWithType(ltype, flags | VALIDATOR_FLAG_SKIP_VALIDATOR, "%s", szBuffer);
}
m_env.pLog->LogWithType(ltype, flags | VALIDATOR_FLAG_SKIP_VALIDATOR, "%s", fmt.c_str());
if (bDbgBreak && g_cvars.sys_error_debugbreak)
{
@@ -1135,34 +1040,6 @@ ILocalizationManager* CSystem::GetLocalizationManager()
return m_pLocalizationManager;
}
//////////////////////////////////////////////////////////////////////////
void CSystem::debug_GetCallStackRaw(void** callstack, uint32& callstackLength)
{
memset(callstack, 0, sizeof(void*) * callstackLength);
#if !defined(ANDROID)
callstackLength = 0;
#endif
#if AZ_LEGACY_CRYSYSTEM_TRAIT_CAPTURESTACK
uint32 nNumStackFramesToSkip = 1;
uint32 callstackCapacity = callstackLength;
if (callstackCapacity > 0x40)
{
callstackCapacity = 0x40;
}
callstackLength = RtlCaptureStackBackTrace(nNumStackFramesToSkip, callstackCapacity, callstack, NULL);
#elif defined(AZ_RESTRICTED_PLATFORM)
#define AZ_RESTRICTED_SECTION SYSTEM_CPP_SECTION_7
#include AZ_RESTRICTED_FILE(System_cpp)
#endif
if (callstackLength > 0)
{
std::reverse(callstack, callstack + callstackLength);
}
}
//////////////////////////////////////////////////////////////////////////
void CSystem::ExecuteCommandLine(bool deferred)
{
@@ -1201,12 +1078,6 @@ void CSystem::ExecuteCommandLine(bool deferred)
//gEnv->pConsole->ExecuteString("sys_RestoreSpec test*"); // to get useful debugging information about current spec settings to the log file
}
//////////////////////////////////////////////////////////////////////////
ESystemConfigSpec CSystem::GetMaxConfigSpec() const
{
return m_nMaxConfigSpec;
}
//////////////////////////////////////////////////////////////////////////
void CSystem::SetConfigPlatform(const ESystemConfigPlatform platform)
{
@@ -1401,23 +1272,6 @@ void CSystem::SetSystemGlobalState(const ESystemGlobalState systemGlobalState)
#endif // if AZ_LOADSCREENCOMPONENT_ENABLED
}
//////////////////////////////////////////////////////////////////////////
void* CSystem::GetRootWindowMessageHandler()
{
#if defined(AZ_RESTRICTED_PLATFORM)
#define AZ_RESTRICTED_SECTION SYSTEM_CPP_SECTION_9
#include AZ_RESTRICTED_FILE(System_cpp)
#endif
#if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED)
#undef AZ_RESTRICTED_SECTION_IMPLEMENTED
#elif defined(WIN32)
return reinterpret_cast<void*>(&WndProc);
#else
CRY_ASSERT(false && "This platform does not support window message handlers");
return NULL;
#endif
}
//////////////////////////////////////////////////////////////////////////
void CSystem::RegisterWindowMessageHandler(IWindowMessageHandler* pHandler)
{
@@ -1601,11 +1455,6 @@ bool CSystem::HandleMessage([[maybe_unused]] HWND hWnd, UINT uMsg, WPARAM wParam
#endif
std::shared_ptr<AZ::IO::FileIOBase> CSystem::CreateLocalFileIO()
{
return std::make_shared<AZ::IO::LocalFileIO>();
}
ILevelSystem* CSystem::GetILevelSystem()
{
return m_pLevelSystem;