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:
+35
-33
@@ -19,6 +19,7 @@
|
||||
#include <AzCore/Asset/AssetManager.h>
|
||||
#include <AzCore/Interface/Interface.h>
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
#include <MathConversion.h>
|
||||
|
||||
// AzFramework
|
||||
#include <AzFramework/Archive/IArchive.h>
|
||||
@@ -53,6 +54,7 @@
|
||||
#include "MainWindow.h"
|
||||
#include "LevelFileDialog.h"
|
||||
#include "StatObjBus.h"
|
||||
#include "Undo/Undo.h"
|
||||
|
||||
#include <Atom/RPI.Public/ViewportContext.h>
|
||||
#include <Atom/RPI.Public/ViewportContextBus.h>
|
||||
@@ -95,7 +97,7 @@ namespace Internal
|
||||
{
|
||||
bool SaveLevel()
|
||||
{
|
||||
if (!GetIEditor()->GetDocument()->DoSave(GetIEditor()->GetDocument()->GetActivePathName(), TRUE))
|
||||
if (!GetIEditor()->GetDocument()->DoSave(GetIEditor()->GetDocument()->GetActivePathName(), true))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -261,7 +263,7 @@ void CCryEditDoc::DeleteContents()
|
||||
GetIEditor()->GetObjectManager()->DeleteAllObjects();
|
||||
|
||||
// Load scripts data
|
||||
SetModifiedFlag(FALSE);
|
||||
SetModifiedFlag(false);
|
||||
SetModifiedModules(eModifiedNothing);
|
||||
// Clear error reports if open.
|
||||
CErrorReportDialog::Clear();
|
||||
@@ -303,7 +305,7 @@ void CCryEditDoc::Save(TDocMultiArchive& arrXmlAr)
|
||||
{
|
||||
CAutoDocNotReady autoDocNotReady;
|
||||
|
||||
if (arrXmlAr[DMAS_GENERAL] != NULL)
|
||||
if (arrXmlAr[DMAS_GENERAL] != nullptr)
|
||||
{
|
||||
(*arrXmlAr[DMAS_GENERAL]).root = XmlHelpers::CreateXmlNode("Level");
|
||||
(*arrXmlAr[DMAS_GENERAL]).root->setAttr("WaterColor", m_waterColor);
|
||||
@@ -481,7 +483,7 @@ void CCryEditDoc::Load(TDocMultiArchive& arrXmlAr, const QString& szFilename)
|
||||
|
||||
if (!pObj)
|
||||
{
|
||||
pObj = GetIEditor()->GetObjectManager()->NewObject("SequenceObject", 0, fullname);
|
||||
pObj = GetIEditor()->GetObjectManager()->NewObject("SequenceObject", nullptr, fullname);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -665,7 +667,7 @@ int CCryEditDoc::GetModifiedModule()
|
||||
return m_modifiedModuleFlags;
|
||||
}
|
||||
|
||||
BOOL CCryEditDoc::CanCloseFrame()
|
||||
bool CCryEditDoc::CanCloseFrame()
|
||||
{
|
||||
// Ask the base class to ask for saving, which also includes the save
|
||||
// status of the plugins. Additionaly we query if all the plugins can exit
|
||||
@@ -674,21 +676,21 @@ BOOL CCryEditDoc::CanCloseFrame()
|
||||
// are not serialized in the project file
|
||||
if (!SaveModified())
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!GetIEditor()->GetPluginManager()->CanAllPluginsExitNow())
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// If there is an export in process, exiting will corrupt it
|
||||
if (CGameExporter::GetCurrentExporter() != nullptr)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CCryEditDoc::SaveModified()
|
||||
@@ -733,7 +735,7 @@ bool CCryEditDoc::OnOpenDocument(const QString& lpszPathName)
|
||||
TOpenDocContext context;
|
||||
if (!BeforeOpenDocument(lpszPathName, context))
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return DoOpenDocument(context);
|
||||
}
|
||||
@@ -776,7 +778,7 @@ bool CCryEditDoc::BeforeOpenDocument(const QString& lpszPathName, TOpenDocContex
|
||||
context.absoluteLevelPath = absolutePath;
|
||||
context.absoluteSlicePath = "";
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CCryEditDoc::DoOpenDocument(TOpenDocContext& context)
|
||||
@@ -813,7 +815,7 @@ bool CCryEditDoc::DoOpenDocument(TOpenDocContext& context)
|
||||
if (!LoadXmlArchiveArray(arrXmlAr, levelFilePath, levelFolderAbsolutePath))
|
||||
{
|
||||
m_bLoadFailed = true;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!LoadLevel(arrXmlAr, context.absoluteLevelPath))
|
||||
@@ -825,7 +827,7 @@ bool CCryEditDoc::DoOpenDocument(TOpenDocContext& context)
|
||||
|
||||
if (m_bLoadFailed)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Load AZ entities for the editor.
|
||||
@@ -846,7 +848,7 @@ bool CCryEditDoc::DoOpenDocument(TOpenDocContext& context)
|
||||
|
||||
if (m_bLoadFailed)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
StartStreamingLoad();
|
||||
@@ -863,7 +865,7 @@ bool CCryEditDoc::DoOpenDocument(TOpenDocContext& context)
|
||||
// level.
|
||||
SetLevelExported(true);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CCryEditDoc::OnNewDocument()
|
||||
@@ -959,7 +961,7 @@ bool CCryEditDoc::BeforeSaveDocument(const QString& lpszPathName, TSaveDocContex
|
||||
bool bSaved(true);
|
||||
|
||||
context.bSaved = bSaved;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CCryEditDoc::HasLayerNameConflicts() const
|
||||
@@ -1044,7 +1046,7 @@ bool CCryEditDoc::AfterSaveDocument([[maybe_unused]] const QString& lpszPathName
|
||||
else
|
||||
{
|
||||
CLogFile::WriteLine("$3Document successfully saved");
|
||||
SetModifiedFlag(FALSE);
|
||||
SetModifiedFlag(false);
|
||||
SetModifiedModules(eModifiedNothing);
|
||||
MainWindow::instance()->ResetAutoSaveTimers();
|
||||
}
|
||||
@@ -1596,7 +1598,7 @@ bool CCryEditDoc::LoadLevel(TDocMultiArchive& arrXmlAr, const QString& absoluteC
|
||||
// Set level path directly *after* DeleteContents(), since that will unload the previous level and clear the level path.
|
||||
GetIEditor()->GetGameEngine()->SetLevelPath(folderPath);
|
||||
|
||||
SetModifiedFlag(TRUE); // dirty during de-serialize
|
||||
SetModifiedFlag(true); // dirty during de-serialize
|
||||
SetModifiedModules(eModifiedAll);
|
||||
Load(arrXmlAr, absoluteCryFilePath);
|
||||
|
||||
@@ -1606,7 +1608,7 @@ bool CCryEditDoc::LoadLevel(TDocMultiArchive& arrXmlAr, const QString& absoluteC
|
||||
{
|
||||
pIPak->GetResourceList(AZ::IO::IArchive::RFOM_NextLevel)->Clear();
|
||||
}
|
||||
SetModifiedFlag(FALSE); // start off with unmodified
|
||||
SetModifiedFlag(false); // start off with unmodified
|
||||
SetModifiedModules(eModifiedNothing);
|
||||
SetDocumentReady(true);
|
||||
GetIEditor()->Notify(eNotify_OnEndLoad);
|
||||
@@ -1982,7 +1984,7 @@ void CCryEditDoc::OnStartLevelResourceList()
|
||||
gEnv->pCryPak->GetResourceList(AZ::IO::IArchive::RFOM_Level)->Clear();
|
||||
}
|
||||
|
||||
BOOL CCryEditDoc::DoFileSave()
|
||||
bool CCryEditDoc::DoFileSave()
|
||||
{
|
||||
if (GetEditMode() == CCryEditDoc::DocumentEditingMode::LevelEdit)
|
||||
{
|
||||
@@ -2000,15 +2002,15 @@ BOOL CCryEditDoc::DoFileSave()
|
||||
QString newLevelPath = filename.left(filename.lastIndexOf('/') + 1);
|
||||
GetIEditor()->GetDocument()->SetPathName(filename);
|
||||
GetIEditor()->GetGameEngine()->SetLevelPath(newLevelPath);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!IsDocumentReady())
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return Internal::SaveLevel();
|
||||
@@ -2063,7 +2065,7 @@ void CCryEditDoc::InitEmptyLevel(int /*resolution*/, int /*unitSize*/, bool /*bU
|
||||
GetISystem()->GetISystemEventDispatcher()->OnSystemEvent(ESYSTEM_EVENT_LEVEL_LOAD_END, 0, 0);
|
||||
|
||||
GetIEditor()->Notify(eNotify_OnEndNewScene);
|
||||
SetModifiedFlag(FALSE);
|
||||
SetModifiedFlag(false);
|
||||
SetLevelExported(false);
|
||||
SetModifiedModules(eModifiedNothing);
|
||||
|
||||
@@ -2077,13 +2079,13 @@ void CCryEditDoc::CreateDefaultLevelAssets([[maybe_unused]] int resolution, [[ma
|
||||
|
||||
void CCryEditDoc::OnEnvironmentPropertyChanged(IVariable* pVar)
|
||||
{
|
||||
if (pVar == NULL)
|
||||
if (pVar == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
XmlNodeRef node = GetEnvironmentTemplate();
|
||||
if (node == NULL)
|
||||
if (node == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2101,7 +2103,7 @@ void CCryEditDoc::OnEnvironmentPropertyChanged(IVariable* pVar)
|
||||
|
||||
XmlNodeRef groupNode = node->getChild(nGroup);
|
||||
|
||||
if (groupNode == NULL)
|
||||
if (groupNode == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2112,7 +2114,7 @@ void CCryEditDoc::OnEnvironmentPropertyChanged(IVariable* pVar)
|
||||
}
|
||||
|
||||
XmlNodeRef childNode = groupNode->getChild(nChild);
|
||||
if (childNode == NULL)
|
||||
if (childNode == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2139,7 +2141,7 @@ QString CCryEditDoc::GetCryIndexPath(const char* levelFilePath) const
|
||||
return Path::AddPathSlash(levelPath + levelName + "_editor");
|
||||
}
|
||||
|
||||
BOOL CCryEditDoc::LoadXmlArchiveArray(TDocMultiArchive& arrXmlAr, const QString& absoluteLevelPath, const QString& levelPath)
|
||||
bool CCryEditDoc::LoadXmlArchiveArray(TDocMultiArchive& arrXmlAr, const QString& absoluteLevelPath, const QString& levelPath)
|
||||
{
|
||||
auto pIPak = GetIEditor()->GetSystem()->GetIPak();
|
||||
|
||||
@@ -2148,7 +2150,7 @@ BOOL CCryEditDoc::LoadXmlArchiveArray(TDocMultiArchive& arrXmlAr, const QString&
|
||||
CXmlArchive* pXmlAr = new CXmlArchive();
|
||||
if (!pXmlAr)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
CXmlArchive& xmlAr = *pXmlAr;
|
||||
@@ -2159,7 +2161,7 @@ BOOL CCryEditDoc::LoadXmlArchiveArray(TDocMultiArchive& arrXmlAr, const QString&
|
||||
bool openLevelPakFileSuccess = pIPak->OpenPack(levelPath.toUtf8().data(), absoluteLevelPath.toUtf8().data());
|
||||
if (!openLevelPakFileSuccess)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
CPakFile pakFile;
|
||||
@@ -2167,13 +2169,13 @@ BOOL CCryEditDoc::LoadXmlArchiveArray(TDocMultiArchive& arrXmlAr, const QString&
|
||||
pIPak->ClosePack(absoluteLevelPath.toUtf8().data());
|
||||
if (!loadFromPakSuccess)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
FillXmlArArray(arrXmlAr, &xmlAr);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CCryEditDoc::ReleaseXmlArchiveArray(TDocMultiArchive& arrXmlAr)
|
||||
|
||||
Reference in New Issue
Block a user