Merge branch 'development' into cmake/warn_virtual
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> # Conflicts: # Code/Legacy/CryCommon/IConsole.h # Code/Legacy/CrySystem/LocalizedStringManager.h # Code/Legacy/CrySystem/XConsole.h # Code/Legacy/CrySystem/XConsoleVariable.h # Code/Legacy/CrySystem/XML/XmlUtils.cpp # cmake/Platform/Common/Clang/Configurations_clang.cmake
This commit is contained in:
@@ -236,10 +236,7 @@ QString CEditorCommandManager::Execute(const AZStd::string& module, const AZStd:
|
||||
}
|
||||
else
|
||||
{
|
||||
QString errMsg;
|
||||
|
||||
errMsg = QStringLiteral("Error: Trying to execute a unknown command, '%1'!").arg(fullName.c_str());
|
||||
CryLogAlways(errMsg.toUtf8().data());
|
||||
CryLogAlways("Error: Trying to execute a unknown command, '%s'!", fullName.c_str());
|
||||
}
|
||||
|
||||
return "";
|
||||
@@ -272,10 +269,7 @@ QString CEditorCommandManager::Execute(const AZStd::string& cmdLine)
|
||||
}
|
||||
else
|
||||
{
|
||||
QString errMsg;
|
||||
|
||||
errMsg = QStringLiteral("Error: Trying to execute a unknown command, '%1'!").arg(cmdLine.c_str());
|
||||
CryLogAlways(errMsg.toUtf8().data());
|
||||
CryLogAlways("Error: Trying to execute a unknown command, '%s'!", cmdLine.c_str());
|
||||
}
|
||||
|
||||
return "";
|
||||
@@ -294,10 +288,7 @@ void CEditorCommandManager::Execute(int commandId)
|
||||
}
|
||||
else
|
||||
{
|
||||
QString errMsg;
|
||||
|
||||
errMsg = QStringLiteral("Error: Trying to execute a unknown command of ID '%1'!").arg(commandId);
|
||||
CryLogAlways(errMsg.toUtf8().data());
|
||||
CryLogAlways("Error: Trying to execute a unknown command of ID '%d'!", commandId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ void CConsoleDialog::SetInfoText(const char* text)
|
||||
{
|
||||
if (gEnv && gEnv->pLog) // before log system was initialized
|
||||
{
|
||||
CryLogAlways(text);
|
||||
CryLogAlways("%s", text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,9 +26,6 @@
|
||||
#include <AzQtComponents/Components/Widgets/ScrollBar.h>
|
||||
#include <AzQtComponents/Components/Widgets/SliderCombo.h>
|
||||
|
||||
// CryCommon
|
||||
#include <CryCommon/SFunctor.h>
|
||||
|
||||
// Editor
|
||||
#include "QtViewPaneManager.h"
|
||||
#include "Core/QtEditorApplication.h"
|
||||
@@ -392,7 +389,7 @@ void CConsoleSCB::RegisterViewClass()
|
||||
opts.showInMenu = true;
|
||||
opts.builtInActionId = ID_VIEW_CONSOLEWINDOW;
|
||||
opts.shortcut = QKeySequence(Qt::Key_QuoteLeft);
|
||||
|
||||
|
||||
AzToolsFramework::RegisterViewPane<CConsoleSCB>(LyViewPane::Console, LyViewPane::CategoryTools, opts);
|
||||
}
|
||||
|
||||
@@ -606,8 +603,7 @@ static CVarBlock* VarBlockFromConsoleVars()
|
||||
|
||||
// Add our on change handler so we can update the CVariable created for
|
||||
// the matching ICVar that has been modified
|
||||
SFunctor onChange;
|
||||
onChange.Set(OnVariableUpdated, i, pCVar);
|
||||
AZStd::function<void()> onChange = [row=i,pCVar=pCVar]() { OnVariableUpdated(row,pCVar); };
|
||||
pCVar->AddOnChangeFunctor(onChange);
|
||||
|
||||
pVariable->SetDescription(pCVar->GetHelp());
|
||||
@@ -929,7 +925,7 @@ QWidget* ConsoleVariableItemDelegate::createEditor(QWidget* parent, const QStyle
|
||||
return editor;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If we get here, value being edited is a string, so use our styled line
|
||||
// edit widget
|
||||
AzQtComponents::StyledLineEdit* lineEdit = new AzQtComponents::StyledLineEdit(parent);
|
||||
|
||||
@@ -1887,16 +1887,6 @@ void CCryEditDoc::SetDocumentReady(bool bReady)
|
||||
m_bDocumentReady = bReady;
|
||||
}
|
||||
|
||||
void CCryEditDoc::GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
{
|
||||
SIZER_COMPONENT_NAME(pSizer, "UndoManager(estimate)");
|
||||
GetIEditor()->GetUndoManager()->GetMemoryUsage(pSizer);
|
||||
}
|
||||
|
||||
pSizer->Add(*this);
|
||||
}
|
||||
|
||||
void CCryEditDoc::RegisterConsoleVariables()
|
||||
{
|
||||
doc_validate_surface_types = gEnv->pConsole->GetCVar("doc_validate_surface_types");
|
||||
|
||||
@@ -129,8 +129,6 @@ public: // Create from serialization only
|
||||
void RegisterListener(IDocListener* listener);
|
||||
void UnregisterListener(IDocListener* listener);
|
||||
|
||||
void GetMemoryUsage(ICrySizer* pSizer) const;
|
||||
|
||||
static bool IsBackupOrTempLevelSubdirectory(const QString& folderName);
|
||||
protected:
|
||||
|
||||
|
||||
@@ -249,60 +249,6 @@ void CErrorReport::SetImmediateMode(bool bEnable)
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CErrorReport::Report(SValidatorRecord& record)
|
||||
{
|
||||
if ((record.flags & VALIDATOR_FLAG_IGNORE_IN_EDITOR))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CErrorRecord err;
|
||||
if (record.text)
|
||||
{
|
||||
err.error = record.text;
|
||||
}
|
||||
if (record.description)
|
||||
{
|
||||
err.description = record.description;
|
||||
}
|
||||
if (record.file)
|
||||
{
|
||||
err.file = record.file;
|
||||
}
|
||||
else
|
||||
{
|
||||
err.file = m_currentFilename;
|
||||
}
|
||||
err.severity = (CErrorRecord::ESeverity)record.severity;
|
||||
|
||||
err.assetScope = record.assetScope;
|
||||
|
||||
err.flags = 0;
|
||||
if (record.flags & VALIDATOR_FLAG_FILE)
|
||||
{
|
||||
err.flags |= CErrorRecord::FLAG_NOFILE;
|
||||
}
|
||||
if (record.flags & VALIDATOR_FLAG_TEXTURE)
|
||||
{
|
||||
err.flags |= CErrorRecord::FLAG_TEXTURE;
|
||||
}
|
||||
if (record.flags & VALIDATOR_FLAG_SCRIPT)
|
||||
{
|
||||
err.flags |= CErrorRecord::FLAG_SCRIPT;
|
||||
}
|
||||
if (record.flags & VALIDATOR_FLAG_AI)
|
||||
{
|
||||
err.flags |= CErrorRecord::FLAG_AI;
|
||||
}
|
||||
|
||||
err.module = record.module;
|
||||
err.pObject = m_pObject;
|
||||
err.pItem = m_pItem;
|
||||
|
||||
ReportError(err);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CErrorReport::SetCurrentValidatorObject(CBaseObject* pObject)
|
||||
{
|
||||
|
||||
@@ -121,11 +121,6 @@ public:
|
||||
//! Assign current filename.
|
||||
void SetCurrentFile(const QString& file);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Implement IValidator interface.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void Report(SValidatorRecord& record);
|
||||
|
||||
private:
|
||||
//! Array of all error records added to report.
|
||||
std::vector<CErrorRecord> m_errors;
|
||||
|
||||
@@ -176,11 +176,6 @@ struct SSystemUserCallback
|
||||
return CryMessageBox(text, caption, uType);
|
||||
}
|
||||
|
||||
void GetMemoryUsage(ICrySizer* pSizer) override
|
||||
{
|
||||
GetIEditor()->GetMemoryUsage(pSizer);
|
||||
}
|
||||
|
||||
void OnSplashScreenDone()
|
||||
{
|
||||
m_pLogo = nullptr;
|
||||
|
||||
@@ -5,10 +5,6 @@
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_EDITOR_GAMEEXPORTER_H
|
||||
#define CRYINCLUDE_EDITOR_GAMEEXPORTER_H
|
||||
#pragma once
|
||||
|
||||
#include "Util/PakFile.h"
|
||||
@@ -62,7 +58,7 @@ public:
|
||||
// In auto exporting mode, highest possible settings will be chosen and no UI dialogs will be shown.
|
||||
void SetAutoExportMode(bool bAuto) { m_bAutoExportMode = bAuto; }
|
||||
|
||||
bool Export(unsigned int flags = 0, EEndian eExportEndian = GetPlatformEndian(), const char* subdirectory = 0);
|
||||
bool Export(unsigned int flags = 0, EEndian eExportEndian = eEndianness_Little, const char* subdirectory = 0);
|
||||
|
||||
static CGameExporter* GetCurrentExporter() { return m_pCurrentExporter; }
|
||||
|
||||
@@ -116,5 +112,3 @@ void SetupTerrainInfo(const size_t octreeCompiledDataSize, Func&& setupTerrainFn
|
||||
setupTerrainFn(octreeCompiledDataSize);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // CRYINCLUDE_EDITOR_GAMEEXPORTER_H
|
||||
|
||||
@@ -701,7 +701,6 @@ struct IEditor
|
||||
|
||||
virtual CUIEnumsDatabase* GetUIEnumsDatabase() = 0;
|
||||
virtual void AddUIEnums() = 0;
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) = 0;
|
||||
virtual void ReduceMemory() = 0;
|
||||
|
||||
//! Export manager for exporting objects and a terrain from the game to DCC tools
|
||||
|
||||
@@ -1506,18 +1506,6 @@ void CEditorImpl::ShowStatusText(bool bEnable)
|
||||
m_bShowStatusText = bEnable;
|
||||
}
|
||||
|
||||
void CEditorImpl::GetMemoryUsage(ICrySizer* pSizer)
|
||||
{
|
||||
SIZER_COMPONENT_NAME(pSizer, "Editor");
|
||||
|
||||
if (GetDocument())
|
||||
{
|
||||
SIZER_COMPONENT_NAME(pSizer, "Document");
|
||||
|
||||
GetDocument()->GetMemoryUsage(pSizer);
|
||||
}
|
||||
}
|
||||
|
||||
void CEditorImpl::ReduceMemory()
|
||||
{
|
||||
GetIEditor()->GetUndoManager()->ClearRedoStack();
|
||||
|
||||
@@ -280,7 +280,6 @@ public:
|
||||
void SetMatEditMode(bool bIsMatEditMode);
|
||||
CUIEnumsDatabase* GetUIEnumsDatabase() { return m_pUIEnumsDatabase; };
|
||||
void AddUIEnums();
|
||||
void GetMemoryUsage(ICrySizer* pSizer);
|
||||
void ReduceMemory();
|
||||
// Get Export manager
|
||||
IExportManager* GetExportManager();
|
||||
|
||||
@@ -64,10 +64,7 @@ void CIconManager::Reset()
|
||||
int i;
|
||||
for (i = 0; i < sizeof(m_objects) / sizeof(m_objects[0]); i++)
|
||||
{
|
||||
if (m_objects[i])
|
||||
{
|
||||
m_objects[i]->Release();
|
||||
}
|
||||
delete m_objects[i];
|
||||
m_objects[i] = nullptr;
|
||||
}
|
||||
for (i = 0; i < eIcon_COUNT; i++)
|
||||
|
||||
@@ -24,16 +24,15 @@ inline AZStd::string ToString(const QString& s)
|
||||
|
||||
class CCommand
|
||||
{
|
||||
static inline bool FromString(int32 &val, const char* s) {
|
||||
if(!s)
|
||||
static inline bool FromString(int32& val, const char* s)
|
||||
{
|
||||
if (!s)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
val = (int)strtol(s, nullptr, 10);
|
||||
if(val==0 && errno!=0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
val = static_cast<int>(strtol(s, nullptr, 10));
|
||||
const bool parsing_error = val == 0 && errno != 0;
|
||||
return !parsing_error;
|
||||
}
|
||||
public:
|
||||
CCommand(
|
||||
|
||||
@@ -15,6 +15,6 @@ struct IEditorMaterial
|
||||
: public CBaseLibraryItem
|
||||
{
|
||||
virtual int GetFlags() const = 0;
|
||||
virtual _smart_ptr<IMaterial> GetMatInfo(bool bUseExistingEngineMaterial = false) = 0;
|
||||
virtual IMaterial* GetMatInfo(bool bUseExistingEngineMaterial = false) = 0;
|
||||
virtual void DisableHighlightForFrame() = 0;
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
struct IEditorMaterialManager
|
||||
{
|
||||
virtual void GotoMaterial(_smart_ptr<IMaterial> pMaterial) = 0;
|
||||
virtual void GotoMaterial(IMaterial* pMaterial) = 0;
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_EDITOR_MATERIAL_MATERIALMANAGER_H
|
||||
|
||||
@@ -9,23 +9,18 @@
|
||||
|
||||
|
||||
// Description : Class that collects error reports to present them later.
|
||||
|
||||
#ifndef CRYINCLUDE_EDITOR_INTERFACE_ERRORREPORT_H
|
||||
#define CRYINCLUDE_EDITOR_INTERFACE_ERRORREPORT_H
|
||||
#pragma once
|
||||
|
||||
#include <IValidator.h>
|
||||
|
||||
// forward declarations.
|
||||
class CParticleItem;
|
||||
class CBaseObject;
|
||||
class CBaseLibraryItem;
|
||||
class CErrorRecord;
|
||||
class QString;
|
||||
|
||||
/*! Error report manages collection of errors occurred during map analyzes or level load.
|
||||
*/
|
||||
struct IErrorReport
|
||||
: public IValidator
|
||||
{
|
||||
virtual ~IErrorReport(){}
|
||||
|
||||
@@ -62,12 +57,4 @@ struct IErrorReport
|
||||
|
||||
//! Assign current filename.
|
||||
virtual void SetCurrentFile(const QString& file) = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Implement IValidator interface.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void Report(SValidatorRecord& record) = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif // CRYINCLUDE_EDITOR_ERRORREPORT_H
|
||||
|
||||
@@ -89,7 +89,6 @@ public:
|
||||
//! Get array of objects, managed by manager (not contain sub objects of groups).
|
||||
//! @param layer if 0 get objects for all layers, or layer to get objects from.
|
||||
virtual void GetObjects(CBaseObjectsArray& objects) const = 0;
|
||||
//virtual void GetObjects(DynArray<CBaseObject*>& objects) const = 0;
|
||||
|
||||
//! Get array of objects that pass the filter.
|
||||
//! @param filter The filter functor, return true if you want to get the certain obj, return false if want to skip it.
|
||||
|
||||
@@ -172,7 +172,6 @@ public:
|
||||
MOCK_METHOD0(IsSourceControlConnected, bool());
|
||||
MOCK_METHOD0(GetUIEnumsDatabase, CUIEnumsDatabase* ());
|
||||
MOCK_METHOD0(AddUIEnums, void());
|
||||
MOCK_METHOD1(GetMemoryUsage, void(ICrySizer* ));
|
||||
MOCK_METHOD0(ReduceMemory, void());
|
||||
MOCK_METHOD0(GetExportManager, IExportManager* ());
|
||||
MOCK_METHOD2(SetEditorConfigSpec, void(ESystemConfigSpec , ESystemConfigPlatform ));
|
||||
|
||||
@@ -67,7 +67,7 @@ SANDBOX_API void ErrorV(const char* format, va_list argList)
|
||||
str += szBuffer;
|
||||
|
||||
//CLogFile::WriteLine( str );
|
||||
CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_ERROR, str.toUtf8().data());
|
||||
CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_ERROR, "%s", str.toUtf8().data());
|
||||
|
||||
if (!CCryEditApp::instance()->IsInTestMode() && !CCryEditApp::instance()->IsInExportMode() && !CCryEditApp::instance()->IsInLevelLoadTestMode())
|
||||
{
|
||||
@@ -95,7 +95,7 @@ SANDBOX_API void WarningV(const char* format, va_list argList)
|
||||
char szBuffer[MAX_LOGBUFFER_SIZE];
|
||||
azvsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, format, argList);
|
||||
|
||||
CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_WARNING, szBuffer);
|
||||
CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_WARNING, "%s", szBuffer);
|
||||
|
||||
bool bNoUI = false;
|
||||
ICVar* pCVar = gEnv->pConsole->GetCVar("sys_no_crash_dialog");
|
||||
@@ -478,7 +478,7 @@ void CLogFile::WriteString(const char* pszString)
|
||||
{
|
||||
if (gEnv && gEnv->pLog)
|
||||
{
|
||||
gEnv->pLog->LogPlus(pszString);
|
||||
gEnv->pLog->LogPlus("%s", pszString);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2735,7 +2735,7 @@ bool CBaseObject::IntersectRayMesh(const Vec3& raySrc, const Vec3& rayDir, SRayH
|
||||
return false;
|
||||
}
|
||||
|
||||
Matrix34A worldTM;
|
||||
Matrix34 worldTM;
|
||||
IStatObj* pStatObj = pRenderNode->GetEntityStatObj(0, 0, &worldTM);
|
||||
if (!pStatObj)
|
||||
{
|
||||
@@ -2743,7 +2743,7 @@ bool CBaseObject::IntersectRayMesh(const Vec3& raySrc, const Vec3& rayDir, SRayH
|
||||
}
|
||||
|
||||
// transform decal into object space
|
||||
Matrix34A worldTM_Inverted = worldTM.GetInverted();
|
||||
Matrix34 worldTM_Inverted = worldTM.GetInverted();
|
||||
Matrix33 worldRot(worldTM_Inverted);
|
||||
worldRot.Transpose();
|
||||
// put hit direction into the object space
|
||||
|
||||
@@ -710,7 +710,7 @@ void CObjectManager::ShowDuplicationMsgWarning(CBaseObject* obj, const QString&
|
||||
);
|
||||
|
||||
// If id is taken.
|
||||
CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_WARNING, sRenameWarning.toUtf8().data());
|
||||
CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_WARNING, "%s", sRenameWarning.toUtf8().data());
|
||||
|
||||
if (bShowMsgBox)
|
||||
{
|
||||
@@ -760,17 +760,6 @@ void CObjectManager::GetObjects(CBaseObjectsArray& objects) const
|
||||
}
|
||||
}
|
||||
|
||||
//void CObjectManager::GetObjects(DynArray<CBaseObject*>& objects) const
|
||||
//{
|
||||
// CBaseObjectsArray objectArray;
|
||||
// GetObjects(objectArray);
|
||||
// objects.clear();
|
||||
// for (size_t i = 0, iCount(objectArray.size()); i < iCount; ++i)
|
||||
// {
|
||||
// objects.push_back(objectArray[i]);
|
||||
// }
|
||||
//}
|
||||
|
||||
void CObjectManager::GetObjects(CBaseObjectsArray& objects, BaseObjectFilterFunctor const& filter) const
|
||||
{
|
||||
objects.clear();
|
||||
|
||||
@@ -122,7 +122,6 @@ public:
|
||||
//! Get array of objects, managed by manager (not contain sub objects of groups).
|
||||
//! @param layer if 0 get objects for all layers, or layer to get objects from.
|
||||
void GetObjects(CBaseObjectsArray& objects) const;
|
||||
//void GetObjects(DynArray<CBaseObject*>& objects) const;
|
||||
|
||||
//! Get array of objects that pass the filter.
|
||||
//! @param filter The filter functor, return true if you want to get the certain obj, return false if want to skip it.
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include <AzToolsFramework/ToolsComponents/EditorEntityIconComponentBus.h>
|
||||
#include <AzToolsFramework/Undo/UndoCacheInterface.h>
|
||||
#include <LmbrCentral/Rendering/RenderNodeBus.h>
|
||||
#include <LmbrCentral/Rendering/MaterialOwnerBus.h>
|
||||
|
||||
#include <IDisplayViewport.h>
|
||||
#include <CryCommon/Cry_GeoIntersect.h>
|
||||
|
||||
@@ -24,11 +24,7 @@ PLUGIN_API IPlugin* CreatePluginInstance(PLUGIN_INIT_PARAM* pInitParam)
|
||||
// Make sure the ffmpeg command can be executed before registering the command
|
||||
if (!CFFMPEGPlugin::RuntimeTest())
|
||||
{
|
||||
AZStd::string msg =
|
||||
"FFMPEG plugin: Failed to execute FFmepg. Please run Setup Assistant, "
|
||||
"go to the 'Optional software' section of the 'Install software' tab, "
|
||||
"and make sure the FFmpeg executable is correctly configured.";
|
||||
GetIEditor()->GetSystem()->GetILog()->Log(msg.c_str());
|
||||
GetIEditor()->GetSystem()->GetILog()->Log("FFMPEG plugin: Failed to execute FFmpeg. Please install FFmpeg.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -313,7 +313,7 @@ namespace
|
||||
{
|
||||
if (strcmp(pMessage, "") != 0)
|
||||
{
|
||||
CryLogAlways(pMessage);
|
||||
CryLogAlways("%s", pMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -719,8 +719,7 @@ bool CSequenceBatchRenderDialog::GetResolutionFromCustomResText(const char* cust
|
||||
int scannedWidth = retCustomWidth; // initialize with default fall-back values - they'll be overwritten in the case of a succesful sscanf below.
|
||||
int scannedHeight = retCustomHeight;
|
||||
|
||||
QString strFormat = QString::fromLatin1(customResFormat).replace(QRegularExpression(QStringLiteral("%\\d")), QStringLiteral("%d"));
|
||||
scanSuccess = (azsscanf(customResText, strFormat.toStdString().c_str(), &scannedWidth, &scannedHeight) == 2);
|
||||
scanSuccess = (azsscanf(customResText, "Custom(%d x %d)...", &scannedWidth, &scannedHeight) == 2);
|
||||
if (scanSuccess)
|
||||
{
|
||||
retCustomWidth = scannedWidth;
|
||||
|
||||
@@ -62,17 +62,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// to get memory statistics
|
||||
void GetMemoryUsage(ICrySizer* pSizer)
|
||||
{
|
||||
for (int i = 0; i < m_undoSteps.size(); i++)
|
||||
{
|
||||
m_undoSteps[i]->GetMemoryUsage(pSizer);
|
||||
}
|
||||
|
||||
pSizer->Add(*this);
|
||||
}
|
||||
|
||||
private:
|
||||
//! Undo steps included in this step.
|
||||
std::vector<CUndoStep*> m_undoSteps;
|
||||
@@ -746,31 +735,6 @@ int CUndoManager::GetMaxUndoStep() const
|
||||
return GetIEditor()->GetEditorSettings()->undoLevels;
|
||||
}
|
||||
|
||||
void CUndoManager::GetMemoryUsage(ICrySizer* pSizer)
|
||||
{
|
||||
if (m_currentUndo)
|
||||
{
|
||||
m_currentUndo->GetMemoryUsage(pSizer);
|
||||
}
|
||||
|
||||
if (m_superUndo)
|
||||
{
|
||||
m_superUndo->GetMemoryUsage(pSizer);
|
||||
}
|
||||
|
||||
for (std::list<CUndoStep*>::const_iterator it = m_undoStack.begin(); it != m_undoStack.end(); it++)
|
||||
{
|
||||
(*it)->GetMemoryUsage(pSizer);
|
||||
}
|
||||
|
||||
for (std::list<CUndoStep*>::const_iterator it = m_redoStack.begin(); it != m_redoStack.end(); it++)
|
||||
{
|
||||
(*it)->GetMemoryUsage(pSizer);
|
||||
}
|
||||
|
||||
pSizer->Add(*this);
|
||||
}
|
||||
|
||||
void CUndoManager::AddListener(IUndoManagerListener* pListener)
|
||||
{
|
||||
stl::push_back_unique(m_listeners, pListener);
|
||||
|
||||
+1
-18
@@ -12,9 +12,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "IUndoManagerListener.h"
|
||||
#include "CrySizer.h" // ICrySizer
|
||||
#include "IUndoObject.h"
|
||||
#include <AzCore/Asset/AssetManager.h>
|
||||
#include <CryCommon/StlUtils.h>
|
||||
|
||||
struct IUndoObject;
|
||||
class CSuperUndoStep;
|
||||
@@ -79,20 +79,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// to get memory statistics
|
||||
void GetMemoryUsage(ICrySizer* pSizer)
|
||||
{
|
||||
size_t nThisSize = sizeof(*this);
|
||||
|
||||
for (int i = 0; i < m_undoObjects.size(); i++)
|
||||
{
|
||||
nThisSize += m_undoObjects[i]->GetSize();
|
||||
}
|
||||
|
||||
pSizer->Add(m_name);
|
||||
pSizer->Add(this, nThisSize);
|
||||
}
|
||||
|
||||
// get undo object at index i
|
||||
IUndoObject* GetUndoObject(int i = 0)
|
||||
{
|
||||
@@ -241,9 +227,6 @@ public:
|
||||
void ClearUndoStack(int num);
|
||||
void ClearRedoStack(int num);
|
||||
|
||||
// to get memory statistics
|
||||
void GetMemoryUsage(ICrySizer* pSizer);
|
||||
|
||||
void AddListener(IUndoManagerListener* pListener);
|
||||
void RemoveListener(IUndoManagerListener* pListener);
|
||||
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
#include <Cry_Color.h>
|
||||
#include <CryCommon/ISystem.h>
|
||||
|
||||
//! Typedef for quaternion.
|
||||
//typedef CryQuat Quat;
|
||||
|
||||
#include <QColor>
|
||||
#include <QDataStream>
|
||||
#include <QGuiApplication>
|
||||
|
||||
@@ -52,7 +52,7 @@ bool CImageASC::Save(const QString& fileName, const CFloatImage& image)
|
||||
}
|
||||
|
||||
// First print the file header
|
||||
fprintf(file, fileHeader.c_str());
|
||||
fprintf(file, "%s", fileHeader.c_str());
|
||||
|
||||
// Then print all the pixels.
|
||||
for (uint32 y = 0; y < height; y++)
|
||||
|
||||
@@ -103,7 +103,7 @@ bool CImageUtil::SavePGM(const QString& fileName, const CImageEx& image)
|
||||
}
|
||||
|
||||
// First print the file header
|
||||
fprintf(file, fileHeader.c_str());
|
||||
fprintf(file, "%s", fileHeader.c_str());
|
||||
|
||||
// Then print all the pixels.
|
||||
for (uint32 y = 0; y < height; y++)
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
struct SStatObj
|
||||
{
|
||||
Matrix34 tm;
|
||||
_smart_ptr<IStatObj> pStatObj;
|
||||
IStatObj* pStatObj;
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
@@ -78,7 +78,7 @@ bool CMemoryBlock::Allocate(int size, int uncompressedSize)
|
||||
{
|
||||
QString str;
|
||||
str = QStringLiteral("CMemoryBlock::Allocate failed to allocate %1Mb of Memory").arg(size / (1024 * 1024));
|
||||
CryLogAlways(str.toUtf8().data());
|
||||
CryLogAlways("%s", str.toUtf8().data());
|
||||
|
||||
QMessageBox::critical(QApplication::activeWindow(), QString(), str + QString("\r\nSandbox will try to reduce its working memory set to free memory for this allocation."));
|
||||
GetIEditor()->ReduceMemory();
|
||||
|
||||
Reference in New Issue
Block a user