SPEC-7531 Change Code/CryEngine to Code/Legacy (#1634)
* git mv Code\CryEngine Code\Legacy * redirecting CMakeLists.txt * fixing uic warning * Some more CryEngine mentions * validation scripts Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IAudioSystem.h>
|
||||
|
||||
namespace Audio
|
||||
{
|
||||
struct AudioProxyMock
|
||||
: public IAudioProxy
|
||||
{
|
||||
MOCK_METHOD2(Initialize, void(const char* const sObjectName, bool bInitAsync /* = true */));
|
||||
MOCK_METHOD0(Release, void());
|
||||
MOCK_METHOD0(Reset, void());
|
||||
MOCK_METHOD1(StopTrigger, void(TAudioControlID nTriggerID));
|
||||
MOCK_METHOD2(SetSwitchState, void(TAudioControlID nSwitchID, TAudioSwitchStateID nStateID));
|
||||
MOCK_METHOD2(SetRtpcValue, void(TAudioControlID nRtpcID, float fValue));
|
||||
MOCK_METHOD1(SetObstructionCalcType, void(EAudioObjectObstructionCalcType eObstructionType));
|
||||
MOCK_METHOD1(SetPosition, void(const SATLWorldPosition& rPosition));
|
||||
MOCK_METHOD1(SetPosition, void(const AZ::Vector3& rPosition));
|
||||
MOCK_METHOD2(SetEnvironmentAmount, void(TAudioEnvironmentID nEnvironmentID, float fAmount));
|
||||
MOCK_METHOD0(SetCurrentEnvironments, void());
|
||||
MOCK_CONST_METHOD0(GetAudioObjectID, TAudioObjectID());
|
||||
};
|
||||
|
||||
struct AudioSystemMock
|
||||
: public IAudioSystem
|
||||
{
|
||||
MOCK_METHOD0(Initialize, bool());
|
||||
MOCK_METHOD0(Release, void());
|
||||
MOCK_METHOD1(PushRequest, void(const SAudioRequest& rAudioRequestData));
|
||||
MOCK_METHOD4(AddRequestListener, void(AudioRequestCallbackType func, void* pObjectToListenTo, EAudioRequestType requestType /* = eART_AUDIO_ALL_REQUESTS */, TATLEnumFlagsType specificRequestMask /* = ALL_AUDIO_REQUEST_SPECIFIC_TYPE_FLAGS */));
|
||||
MOCK_METHOD2(RemoveRequestListener, void(AudioRequestCallbackType func, void* pObjectToListenTo));
|
||||
MOCK_METHOD0(ExternalUpdate, void());
|
||||
MOCK_CONST_METHOD1(GetAudioTriggerID, TAudioControlID(const char* sAudioTriggerName));
|
||||
MOCK_CONST_METHOD1(GetAudioRtpcID, TAudioControlID(const char* sAudioRtpcName));
|
||||
MOCK_CONST_METHOD1(GetAudioSwitchID, TAudioControlID(const char* sAudioSwitchName));
|
||||
MOCK_CONST_METHOD2(GetAudioSwitchStateID, TAudioSwitchStateID(const TAudioControlID nSwitchID, const char* sAudioStateName));
|
||||
MOCK_CONST_METHOD1(GetAudioPreloadRequestID, TAudioPreloadRequestID(const char* sAudioPreloadRequestName));
|
||||
MOCK_CONST_METHOD1(GetAudioEnvironmentID, TAudioEnvironmentID(const char* sAudioEnvironmentName));
|
||||
MOCK_METHOD1(ReserveAudioListenerID, bool(TAudioObjectID& rAudioListenerID));
|
||||
MOCK_METHOD1(ReleaseAudioListenerID, bool(TAudioObjectID nAudioObjectID));
|
||||
MOCK_METHOD1(OnCVarChanged, void(ICVar* const pCVar));
|
||||
MOCK_METHOD1(GetInfo, void(SAudioSystemInfo& rAudioSystemInfo));
|
||||
MOCK_CONST_METHOD0(GetControlsPath, const char*());
|
||||
MOCK_METHOD0(UpdateControlsPath, void());
|
||||
MOCK_METHOD0(GetFreeAudioProxy, IAudioProxy*());
|
||||
MOCK_METHOD1(FreeAudioProxy, void(IAudioProxy* pIAudioProxy));
|
||||
MOCK_CONST_METHOD2(GetAudioControlName, const char*(EAudioControlType eAudioEntityType, TATLIDType nAudioEntityID));
|
||||
MOCK_CONST_METHOD2(GetAudioSwitchStateName, const char*(TAudioControlID switchID, TAudioSwitchStateID stateID));
|
||||
};
|
||||
|
||||
} // namespace Audio
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IConsole.h>
|
||||
#include <AzTest/AzTest.h>
|
||||
|
||||
#include <SFunctor.h>
|
||||
|
||||
class CVarMock
|
||||
: public ICVar
|
||||
{
|
||||
public:
|
||||
MOCK_METHOD0(Release, void());
|
||||
MOCK_CONST_METHOD0(GetIVal, int());
|
||||
MOCK_CONST_METHOD0(GetI64Val, int64());
|
||||
MOCK_CONST_METHOD0(GetFVal, float());
|
||||
MOCK_CONST_METHOD0(GetString, const char*());
|
||||
MOCK_CONST_METHOD0(GetDataProbeString, const char*());
|
||||
MOCK_METHOD1(Set, void(const char*));
|
||||
MOCK_METHOD1(ForceSet, void(const char*));
|
||||
MOCK_METHOD1(Set, void(float));
|
||||
MOCK_METHOD1(Set, void(int));
|
||||
MOCK_METHOD1(ClearFlags, void(const int));
|
||||
MOCK_CONST_METHOD0(GetFlags, int());
|
||||
MOCK_METHOD1(SetFlags, int(const int));
|
||||
MOCK_METHOD0(GetType, int());
|
||||
MOCK_CONST_METHOD0(GetName, const char*());
|
||||
MOCK_METHOD0(GetHelp, const char*());
|
||||
MOCK_CONST_METHOD0(IsConstCVar, bool());
|
||||
MOCK_METHOD1(SetOnChangeCallback, void(ConsoleVarFunc));
|
||||
MOCK_METHOD1(AddOnChangeFunctor, uint64(const SFunctor& pChangeFunctor));
|
||||
MOCK_CONST_METHOD0(GetNumberOfOnChangeFunctors, uint64());
|
||||
MOCK_CONST_METHOD1(GetOnChangeFunctor, const SFunctor&(uint64));
|
||||
MOCK_METHOD1(RemoveOnChangeFunctor, bool(uint64));
|
||||
MOCK_CONST_METHOD0(GetOnChangeCallback, ConsoleVarFunc());
|
||||
MOCK_CONST_METHOD1(GetMemoryUsage, void(class ICrySizer* pSizer));
|
||||
MOCK_CONST_METHOD0(GetRealIVal, int());
|
||||
MOCK_METHOD2(SetLimits, void(float, float));
|
||||
MOCK_METHOD2(GetLimits, void(float&, float&));
|
||||
MOCK_METHOD0(HasCustomLimits, bool());
|
||||
MOCK_METHOD1(SetDataProbeString, void(const char*));
|
||||
};
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_ICONSOLEMOCK_H
|
||||
#define CRYINCLUDE_CRYCOMMON_ICONSOLEMOCK_H
|
||||
#pragma once
|
||||
|
||||
#include <IConsole.h>
|
||||
#include <AzTest/AzTest.h>
|
||||
|
||||
// Implements the Console interface
|
||||
class ConsoleMock
|
||||
: public ::IConsole
|
||||
{
|
||||
public:
|
||||
MOCK_METHOD0(Release, void());
|
||||
MOCK_METHOD1(Init, void(ISystem * pSystem));
|
||||
MOCK_METHOD5(RegisterString, ICVar * (const char* sName, const char* sValue, int nFlags, const char* help, ConsoleVarFunc pChangeFunc));
|
||||
MOCK_METHOD5(RegisterInt, ICVar * (const char* sName, int iValue, int nFlags, const char* help, ConsoleVarFunc pChangeFunc));
|
||||
MOCK_METHOD5(RegisterInt64, ICVar * (const char* sName, int64 iValue, int nFlags, const char* help, ConsoleVarFunc pChangeFunc));
|
||||
MOCK_METHOD5(RegisterFloat, ICVar * (const char* sName, float fValue, int nFlags, const char* help, ConsoleVarFunc pChangeFunc));
|
||||
MOCK_METHOD7(Register, ICVar * (const char* name, float* src, float defaultvalue, int nFlags, const char* help, ConsoleVarFunc pChangeFunc, bool allowModify));
|
||||
MOCK_METHOD7(Register, ICVar * (const char* name, int* src, int defaultvalue, int nFlags, const char* help, ConsoleVarFunc pChangeFunc, bool allowModify));
|
||||
MOCK_METHOD7(Register, ICVar * (const char* name, const char** src, const char* defaultvalue, int nFlags, const char* help, ConsoleVarFunc pChangeFunc, bool allowModify));
|
||||
MOCK_METHOD1(Register, ICVar * (ICVar * pVar));
|
||||
MOCK_METHOD2(UnregisterVariable, void(const char* sVarName, bool bDelete ));
|
||||
MOCK_METHOD1(SetScrollMax, void(int value));
|
||||
MOCK_METHOD1(AddOutputPrintSink, void(IOutputPrintSink * inpSink));
|
||||
MOCK_METHOD1(RemoveOutputPrintSink, void(IOutputPrintSink * inpSink));
|
||||
MOCK_METHOD2(ShowConsole, void(bool show, int iRequestScrollMax));
|
||||
MOCK_METHOD2(DumpCVars, void(ICVarDumpSink * pCallback, unsigned int nFlagsFilter));
|
||||
MOCK_METHOD2(CreateKeyBind, void(const char* sCmd, const char* sRes));
|
||||
MOCK_METHOD2(SetImage, void (ITexture * pImage, bool bDeleteCurrent));
|
||||
MOCK_METHOD0(GetImage, ITexture * ());
|
||||
MOCK_METHOD1(StaticBackground, void (bool bStatic));
|
||||
MOCK_METHOD1(SetLoadingImage, void(const char* szFilename));
|
||||
MOCK_CONST_METHOD3(GetLineNo, bool(int indwLineNo, char* outszBuffer, int indwBufferSize));
|
||||
MOCK_CONST_METHOD0(GetLineCount, int ());
|
||||
MOCK_METHOD1(GetCVar, ICVar * (const char* name));
|
||||
MOCK_METHOD3(GetVariable, char*(const char* szVarName, const char* szFileName, const char* def_val));
|
||||
MOCK_METHOD3(GetVariable, float (const char* szVarName, const char* szFileName, float def_val));
|
||||
MOCK_METHOD1(PrintLine, void (const char* s));
|
||||
MOCK_METHOD1(PrintLinePlus, void (const char* s));
|
||||
MOCK_METHOD0(GetStatus, bool());
|
||||
MOCK_METHOD0(Clear, void());
|
||||
MOCK_METHOD0(Update, void());
|
||||
MOCK_METHOD0(Draw, void());
|
||||
MOCK_METHOD4(AddCommand, bool (const char* sCommand, ConsoleCommandFunc func, int nFlags, const char* sHelp));
|
||||
MOCK_METHOD4(AddCommand, bool (const char* sName, const char* sScriptFunc, int nFlags, const char* sHelp));
|
||||
MOCK_METHOD1(RemoveCommand, void (const char* sName));
|
||||
MOCK_METHOD3(ExecuteString, void (const char* command, bool bSilentMode, bool bDeferExecution ));
|
||||
MOCK_METHOD0(IsOpened, bool ());
|
||||
MOCK_METHOD0(GetNumVars, int());
|
||||
MOCK_METHOD0(GetNumVisibleVars, int());
|
||||
MOCK_METHOD3(GetSortedVars, size_t (const char** pszArray, size_t numItems, const char* szPrefix));
|
||||
MOCK_METHOD1(AutoComplete, const char*(const char* substr));
|
||||
MOCK_METHOD1(AutoCompletePrev, const char*(const char* substr));
|
||||
MOCK_METHOD1(ProcessCompletion, const char*(const char* szInputBuffer));
|
||||
MOCK_METHOD2(RegisterAutoComplete, void (const char* sVarOrCommand, IConsoleArgumentAutoComplete * pArgAutoComplete));
|
||||
MOCK_METHOD1(UnRegisterAutoComplete, void (const char* sVarOrCommand));
|
||||
MOCK_METHOD0(ResetAutoCompletion, void ());
|
||||
MOCK_CONST_METHOD1(GetMemoryUsage, void (ICrySizer * pSizer));
|
||||
MOCK_METHOD1(ResetProgressBar, void (int nProgressRange));
|
||||
MOCK_METHOD0(TickProgressBar, void ());
|
||||
MOCK_METHOD1(SetInputLine, void (const char* szLine));
|
||||
MOCK_METHOD1(DumpKeyBinds, void (IKeyBindDumpSink * pCallback));
|
||||
MOCK_CONST_METHOD1(FindKeyBind, const char*(const char* sCmd));
|
||||
MOCK_METHOD0(GetNumCheatVars, int ());
|
||||
MOCK_METHOD2(SetCheatVarHashRange, void (size_t firstVar, size_t lastVar));
|
||||
MOCK_METHOD0(CalcCheatVarHash, void ());
|
||||
MOCK_METHOD0(IsHashCalculated, bool ());
|
||||
MOCK_METHOD0(GetCheatVarHash, uint64 ());
|
||||
MOCK_METHOD1(PrintCheatVars, void (bool bUseLastHashRange));
|
||||
MOCK_METHOD1(GetCheatVarAt, char* (uint32 nOffset));
|
||||
MOCK_METHOD1(AddConsoleVarSink, void (IConsoleVarSink * pSink));
|
||||
MOCK_METHOD1(RemoveConsoleVarSink, void (IConsoleVarSink * pSink));
|
||||
MOCK_METHOD1(GetHistoryElement, const char*(bool bUpOrDown));
|
||||
MOCK_METHOD1(AddCommandToHistory, void (const char* szCommand));
|
||||
MOCK_METHOD2(LoadConfigVar, void (const char* sVariable, const char* sValue));
|
||||
MOCK_METHOD1(EnableActivationKey, void (bool bEnable));
|
||||
MOCK_METHOD2(SetClientDataProbeString, void (const char* pName, const char* pValue));
|
||||
|
||||
// can't mock variadic methods, so just override here.
|
||||
void Exit([[maybe_unused]] const char* command, ...) override {};
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_ICONSOLEMOCK_H
|
||||
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzTest/AzTest.h>
|
||||
#include <AzCore/IO/FileIO.h>
|
||||
#include <AzFramework/Archive/INestedArchive.h>
|
||||
#include <AzFramework/Archive/IArchive.h>
|
||||
|
||||
|
||||
struct CryPakMock
|
||||
: AZ::IO::IArchive
|
||||
{
|
||||
MOCK_METHOD5(AdjustFileName, const char*(AZStd::string_view src, char* dst, size_t dstSize, uint32_t nFlags, bool skipMods));
|
||||
MOCK_METHOD1(Init, bool(AZStd::string_view szBasePath));
|
||||
MOCK_METHOD0(Release, void());
|
||||
MOCK_CONST_METHOD1(IsInstalledToHDD, bool(AZStd::string_view acFilePath));
|
||||
|
||||
MOCK_METHOD5(OpenPack, bool(AZStd::string_view, uint32_t, AZStd::intrusive_ptr<AZ::IO::MemoryBlock>, AZStd::fixed_string<AZ::IO::IArchive::MaxPath>*, bool));
|
||||
MOCK_METHOD6(OpenPack, bool(AZStd::string_view, AZStd::string_view, uint32_t, AZStd::intrusive_ptr<AZ::IO::MemoryBlock>, AZStd::fixed_string<AZ::IO::IArchive::MaxPath>*, bool));
|
||||
MOCK_METHOD3(OpenPacks, bool(AZStd::string_view pWildcard, uint32_t nFlags, AZStd::vector<AZStd::fixed_string<AZ::IO::IArchive::MaxPath>>* pFullPaths));
|
||||
MOCK_METHOD4(OpenPacks, bool(AZStd::string_view pBindingRoot, AZStd::string_view pWildcard, uint32_t nFlags, AZStd::vector<AZStd::fixed_string<AZ::IO::IArchive::MaxPath>>* pFullPaths));
|
||||
MOCK_METHOD2(ClosePack, bool(AZStd::string_view pName, uint32_t nFlags));
|
||||
MOCK_METHOD2(ClosePacks, bool(AZStd::string_view pWildcard, uint32_t nFlags));
|
||||
MOCK_METHOD1(FindPacks, bool(AZStd::string_view pWildcardIn));
|
||||
MOCK_METHOD3(SetPacksAccessible, bool(bool bAccessible, AZStd::string_view pWildcard, uint32_t nFlags));
|
||||
MOCK_METHOD3(SetPackAccessible, bool(bool bAccessible, AZStd::string_view pName, uint32_t nFlags));
|
||||
MOCK_METHOD3(LoadPakToMemory, bool(AZStd::string_view pName, EInMemoryArchiveLocation eLoadToMemory, AZStd::intrusive_ptr<AZ::IO::MemoryBlock> pMemoryBlock));
|
||||
MOCK_METHOD2(LoadPaksToMemory, void(int nMaxPakSize, bool bLoadToMemory));
|
||||
MOCK_METHOD1(GetMod, const char*(int index));
|
||||
MOCK_METHOD1(ParseAliases, void(AZStd::string_view szCommandLine));
|
||||
MOCK_METHOD3(SetAlias, void(AZStd::string_view szName, AZStd::string_view szAlias, bool bAdd));
|
||||
MOCK_METHOD2(GetAlias, const char*(AZStd::string_view szName, bool bReturnSame));
|
||||
MOCK_METHOD0(Lock, void());
|
||||
MOCK_METHOD0(Unlock, void());
|
||||
MOCK_METHOD1(SetLocalizationFolder, void(AZStd::string_view sLocalizationFolder));
|
||||
MOCK_CONST_METHOD0(GetLocalizationFolder, const char*());
|
||||
MOCK_CONST_METHOD0(GetLocalizationRoot, const char*());
|
||||
MOCK_METHOD3(FOpen, AZ::IO::HandleType(AZStd::string_view pName, const char* mode, uint32_t nFlags));
|
||||
MOCK_METHOD4(FReadRaw, size_t(void* data, size_t length, size_t elems, AZ::IO::HandleType handle));
|
||||
MOCK_METHOD3(FReadRawAll, size_t(void* data, size_t nFileSize, AZ::IO::HandleType handle));
|
||||
MOCK_METHOD2(FGetCachedFileData, void*(AZ::IO::HandleType handle, size_t & nFileSize));
|
||||
MOCK_METHOD4(FWrite, size_t(const void* data, size_t length, size_t elems, AZ::IO::HandleType handle));
|
||||
MOCK_METHOD3(FGets, char*(char*, int, AZ::IO::HandleType));
|
||||
MOCK_METHOD1(Getc, int(AZ::IO::HandleType));
|
||||
MOCK_METHOD1(FGetSize, size_t(AZ::IO::HandleType f));
|
||||
MOCK_METHOD2(FGetSize, size_t(AZStd::string_view pName, bool bAllowUseFileSystem));
|
||||
MOCK_METHOD1(IsInPak, bool(AZ::IO::HandleType handle));
|
||||
MOCK_METHOD1(RemoveFile, bool(AZStd::string_view pName));
|
||||
MOCK_METHOD1(RemoveDir, bool(AZStd::string_view pName));
|
||||
MOCK_METHOD1(IsAbsPath, bool(AZStd::string_view pPath));
|
||||
MOCK_METHOD3(FSeek, size_t(AZ::IO::HandleType handle, uint64_t seek, int mode));
|
||||
MOCK_METHOD1(FTell, uint64_t(AZ::IO::HandleType handle));
|
||||
MOCK_METHOD1(FClose, int(AZ::IO::HandleType handle));
|
||||
MOCK_METHOD1(FEof, int(AZ::IO::HandleType handle));
|
||||
MOCK_METHOD1(FFlush, int(AZ::IO::HandleType handle));
|
||||
MOCK_METHOD1(PoolMalloc, void*(size_t size));
|
||||
MOCK_METHOD1(PoolFree, void(void* p));
|
||||
MOCK_METHOD3(PoolAllocMemoryBlock, AZStd::intrusive_ptr<AZ::IO::MemoryBlock> (size_t nSize, const char* sUsage, size_t nAlign));
|
||||
MOCK_METHOD2(FindFirst, AZ::IO::ArchiveFileIterator(AZStd::string_view pDir, AZ::IO::IArchive::EFileSearchType));
|
||||
MOCK_METHOD1(FindNext, AZ::IO::ArchiveFileIterator(AZ::IO::ArchiveFileIterator handle));
|
||||
MOCK_METHOD1(FindClose, bool(AZ::IO::ArchiveFileIterator));
|
||||
MOCK_METHOD1(GetModificationTime, AZ::IO::IArchive::FileTime(AZ::IO::HandleType f));
|
||||
MOCK_METHOD2(IsFileExist, bool(AZStd::string_view sFilename, EFileSearchLocation));
|
||||
MOCK_METHOD1(IsFolder, bool(AZStd::string_view sPath));
|
||||
MOCK_METHOD1(GetFileSizeOnDisk, AZ::IO::IArchive::SignedFileSize(AZStd::string_view filename));
|
||||
MOCK_METHOD2(MakeDir, bool(AZStd::string_view szPath, bool bGamePathMapping));
|
||||
MOCK_METHOD4(OpenArchive, AZStd::intrusive_ptr<AZ::IO::INestedArchive> (AZStd::string_view szPath, AZStd::string_view bindRoot, uint32_t nFlags, AZStd::intrusive_ptr<AZ::IO::MemoryBlock> pData));
|
||||
MOCK_METHOD1(GetFileArchivePath, const char* (AZ::IO::HandleType f));
|
||||
MOCK_METHOD5(RawCompress, int(const void* pUncompressed, size_t* pDestSize, void* pCompressed, size_t nSrcSize, int nLevel));
|
||||
MOCK_METHOD4(RawUncompress, int(void* pUncompressed, size_t* pDestSize, const void* pCompressed, size_t nSrcSize));
|
||||
MOCK_METHOD1(RecordFileOpen, void(ERecordFileOpenList eList));
|
||||
MOCK_METHOD2(RecordFile, void(AZ::IO::HandleType in, AZStd::string_view szFilename));
|
||||
MOCK_METHOD1(GetResourceList, AZ::IO::IResourceList * (ERecordFileOpenList eList));
|
||||
MOCK_METHOD2(SetResourceList, void(ERecordFileOpenList eList, AZ::IO::IResourceList * pResourceList));
|
||||
MOCK_METHOD0(GetRecordFileOpenList, AZ::IO::IArchive::ERecordFileOpenList());
|
||||
MOCK_METHOD2(ComputeCRC, uint32_t(AZStd::string_view szPath, uint32_t nFileOpenFlags));
|
||||
MOCK_METHOD4(ComputeMD5, bool(AZStd::string_view szPath, uint8_t* md5, uint32_t nFileOpenFlags, bool useDirectAccess));
|
||||
MOCK_METHOD1(RegisterFileAccessSink, void(AZ::IO::IArchiveFileAccessSink * pSink));
|
||||
MOCK_METHOD1(UnregisterFileAccessSink, void(AZ::IO::IArchiveFileAccessSink * pSink));
|
||||
MOCK_METHOD1(DisableRuntimeFileAccess, void(bool status));
|
||||
MOCK_METHOD2(DisableRuntimeFileAccess, bool(bool status, AZStd::thread_id threadId));
|
||||
MOCK_METHOD2(CheckFileAccessDisabled, bool(AZStd::string_view name, const char* mode));
|
||||
MOCK_METHOD1(SetRenderThreadId, void(AZStd::thread_id renderThreadId));
|
||||
MOCK_CONST_METHOD0(GetPakPriority, AZ::IO::ArchiveLocationPriority());
|
||||
MOCK_CONST_METHOD1(GetFileOffsetOnMedia, uint64_t(AZStd::string_view szName));
|
||||
MOCK_CONST_METHOD1(GetFileMediaType, EStreamSourceMediaType(AZStd::string_view szName));
|
||||
MOCK_METHOD0(GetLevelPackOpenEvent, auto()->LevelPackOpenEvent*);
|
||||
MOCK_METHOD0(GetLevelPackCloseEvent, auto()->LevelPackCloseEvent*);
|
||||
|
||||
// Implementations required for variadic functions
|
||||
virtual int FPrintf([[maybe_unused]] AZ::IO::HandleType handle, [[maybe_unused]] const char* format, ...) PRINTF_PARAMS(3, 4)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#include <ILog.h>
|
||||
|
||||
class LogMock
|
||||
: public ILog
|
||||
{
|
||||
public:
|
||||
MOCK_METHOD3(LogV,
|
||||
void(ELogType nType, const char* szFormat, va_list args));
|
||||
MOCK_METHOD4(LogV,
|
||||
void(ELogType nType, int flags, const char* szFormat, va_list args));
|
||||
MOCK_METHOD0(Release,
|
||||
void());
|
||||
MOCK_METHOD2(SetFileName,
|
||||
bool(const char* fileNameOrFullPath, bool doBackups));
|
||||
MOCK_METHOD0(GetFileName,
|
||||
const char*());
|
||||
MOCK_METHOD0(GetBackupFileName,
|
||||
const char*());
|
||||
|
||||
virtual void Log([[maybe_unused]] const char* szCommand, ...) override {}
|
||||
virtual void LogWarning([[maybe_unused]] const char* szCommand, ...) override {}
|
||||
virtual void LogError([[maybe_unused]] const char* szCommand, ...) override {}
|
||||
virtual void LogAlways([[maybe_unused]] const char* szCommand, ...) override {}
|
||||
virtual void LogPlus([[maybe_unused]] const char* command, ...) override {}
|
||||
virtual void LogToFile([[maybe_unused]] const char* command, ...) override {}
|
||||
virtual void LogToFilePlus([[maybe_unused]] const char* command, ...) override {}
|
||||
virtual void LogToConsole([[maybe_unused]] const char* command, ...) override {}
|
||||
virtual void LogToConsolePlus([[maybe_unused]] const char* command, ...) override {}
|
||||
virtual void UpdateLoadingScreen([[maybe_unused]] const char* command, ...) override {}
|
||||
|
||||
MOCK_METHOD1(SetVerbosity,
|
||||
void(int verbosity));
|
||||
MOCK_METHOD0(GetVerbosityLevel,
|
||||
int());
|
||||
MOCK_METHOD1(AddCallback,
|
||||
void(ILogCallback * pCallback));
|
||||
MOCK_METHOD1(RemoveCallback,
|
||||
void(ILogCallback * pCallback));
|
||||
MOCK_METHOD0(Update,
|
||||
void());
|
||||
MOCK_METHOD0(GetModuleFilter,
|
||||
const char*());
|
||||
MOCK_CONST_METHOD1(GetMemoryUsage,
|
||||
void(ICrySizer * pSizer));
|
||||
MOCK_METHOD1(Indent,
|
||||
void(class CLogIndenter * indenter));
|
||||
MOCK_METHOD1(Unindent,
|
||||
void(class CLogIndenter * indenter));
|
||||
MOCK_METHOD0(FlushAndClose,
|
||||
void());
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "IConsole.h"
|
||||
|
||||
// Auto-generated by gmock_gen.py
|
||||
|
||||
class IRemoteConsoleMock
|
||||
: public IRemoteConsole
|
||||
{
|
||||
public:
|
||||
MOCK_METHOD0(RegisterConsoleVariables, void());
|
||||
MOCK_METHOD0(UnregisterConsoleVariables, void());
|
||||
MOCK_METHOD0(Start, void());
|
||||
MOCK_METHOD0(Stop, void());
|
||||
MOCK_CONST_METHOD0(IsStarted, bool());
|
||||
MOCK_METHOD1(AddLogMessage, void(const char* log));
|
||||
MOCK_METHOD1(AddLogWarning, void(const char* log));
|
||||
MOCK_METHOD1(AddLogError, void(const char* log));
|
||||
MOCK_METHOD0(Update, void());
|
||||
MOCK_METHOD2(RegisterListener, void(IRemoteConsoleListener* pListener, const char* name));
|
||||
MOCK_METHOD1(UnregisterListener, void(IRemoteConsoleListener* pListener));
|
||||
};
|
||||
@@ -0,0 +1,853 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <IRenderer.h>
|
||||
#include <gmock/gmock.h>
|
||||
|
||||
struct SRendItemSorter {};
|
||||
struct SRenderingPassInfo {};
|
||||
struct SClipVolumeBlendInfo {};
|
||||
struct SFogVolumeData {};
|
||||
|
||||
// the following was generated using google's python script to autogenerate mocks.
|
||||
// however, it needed some hand-editing to make it work, so if you add functions to IRenderer,
|
||||
// it will probably be better to just manually add them here than try to run the script again
|
||||
// hand-edits are marked with 'hand-edit'. Everything else was autogenerated.
|
||||
|
||||
class IRendererMock
|
||||
: public IRenderer
|
||||
{
|
||||
public:
|
||||
MOCK_METHOD1(AddRenderDebugListener,
|
||||
void(IRenderDebugListener * pRenderDebugListener));
|
||||
MOCK_METHOD1(RemoveRenderDebugListener,
|
||||
void(IRenderDebugListener * pRenderDebugListener));
|
||||
MOCK_CONST_METHOD0(GetRenderType,
|
||||
ERenderType());
|
||||
|
||||
// Hand-edit: Googlemock cannot handle 14 param functions.
|
||||
WIN_HWND Init(int, int, int, int, unsigned int, int, int, bool, bool, WIN_HINSTANCE, WIN_HWND = 0,
|
||||
bool = false, const SCustomRenderInitArgs* = 0, bool = false) override { return nullptr; }
|
||||
|
||||
MOCK_METHOD0(PostInit,
|
||||
void());
|
||||
MOCK_CONST_METHOD0(IsPost3DRendererEnabled,
|
||||
bool());
|
||||
MOCK_METHOD0(GetFeatures,
|
||||
int());
|
||||
|
||||
// Hand-edit: Googlemock doesn't like 'const void' as a return type:
|
||||
const void SetApiVersion(const AZStd::string&) override {}
|
||||
const void SetAdapterDescription(const AZStd::string&) override {}
|
||||
|
||||
MOCK_CONST_METHOD0(GetApiVersion,
|
||||
const AZStd::string& ());
|
||||
MOCK_CONST_METHOD0(GetAdapterDescription,
|
||||
const AZStd::string& ());
|
||||
MOCK_METHOD3(GetVideoMemoryUsageStats,
|
||||
void(size_t&, size_t&, bool));
|
||||
MOCK_CONST_METHOD0(GetNumGeomInstances,
|
||||
int());
|
||||
MOCK_CONST_METHOD0(GetNumGeomInstanceDrawCalls,
|
||||
int());
|
||||
MOCK_CONST_METHOD0(GetCurrentNumberOfDrawCalls,
|
||||
int());
|
||||
MOCK_CONST_METHOD2(GetCurrentNumberOfDrawCalls,
|
||||
void(int& nGeneral, int& nShadowGen));
|
||||
MOCK_CONST_METHOD1(GetCurrentNumberOfDrawCalls,
|
||||
int(uint32 EFSListMask));
|
||||
MOCK_CONST_METHOD1(GetCurrentDrawCallRTTimes,
|
||||
float(uint32 EFSListMask));
|
||||
MOCK_METHOD1(SetDebugRenderNode,
|
||||
void(IRenderNode * pRenderNode));
|
||||
MOCK_CONST_METHOD1(IsDebugRenderNode,
|
||||
bool(IRenderNode * pRenderNode));
|
||||
MOCK_METHOD1(DeleteContext,
|
||||
bool(WIN_HWND hWnd));
|
||||
MOCK_METHOD4(CreateContext,
|
||||
bool(WIN_HWND, bool, int, int));
|
||||
MOCK_METHOD1(SetCurrentContext,
|
||||
bool(WIN_HWND hWnd));
|
||||
MOCK_METHOD0(MakeMainContextActive,
|
||||
void());
|
||||
MOCK_METHOD0(GetCurrentContextHWND,
|
||||
WIN_HWND());
|
||||
MOCK_METHOD0(IsCurrentContextMainVP,
|
||||
bool());
|
||||
MOCK_CONST_METHOD0(GetCurrentContextViewportHeight,
|
||||
int());
|
||||
MOCK_CONST_METHOD0(GetCurrentContextViewportWidth,
|
||||
int());
|
||||
MOCK_METHOD1(ShutDown,
|
||||
void(bool));
|
||||
MOCK_METHOD0(ShutDownFast,
|
||||
void());
|
||||
MOCK_METHOD1(EnumDisplayFormats,
|
||||
int(SDispFormat * Formats));
|
||||
MOCK_METHOD1(EnumAAFormats,
|
||||
int(SAAFormat * Formats));
|
||||
MOCK_METHOD6(ChangeResolution,
|
||||
bool(int nNewWidth, int nNewHeight, int nNewColDepth, int nNewRefreshHZ, bool bFullScreen, bool bForceReset));
|
||||
MOCK_METHOD0(BeginFrame,
|
||||
void());
|
||||
MOCK_METHOD1(InitSystemResources,
|
||||
void(int nFlags));
|
||||
MOCK_METHOD0(InitTexturesSemantics,
|
||||
void());
|
||||
MOCK_METHOD1(FreeResources,
|
||||
void(int nFlags));
|
||||
MOCK_METHOD0(Release,
|
||||
void());
|
||||
MOCK_METHOD1(RenderDebug,
|
||||
void(bool));
|
||||
MOCK_METHOD0(EndFrame,
|
||||
void());
|
||||
MOCK_METHOD0(ForceSwapBuffers,
|
||||
void());
|
||||
MOCK_METHOD0(TryFlush,
|
||||
void());
|
||||
MOCK_CONST_METHOD4(GetViewport,
|
||||
void(int* x, int* y, int* width, int* height));
|
||||
MOCK_METHOD5(SetViewport,
|
||||
void(int, int, int, int, int));
|
||||
MOCK_METHOD4(SetRenderTile,
|
||||
void(f32, f32, f32, f32));
|
||||
MOCK_METHOD4(SetScissor,
|
||||
void(int, int, int, int));
|
||||
MOCK_METHOD0(GetViewProjectionMatrix,
|
||||
Matrix44A & ());
|
||||
MOCK_METHOD1(SetTranspOrigCameraProjMatrix,
|
||||
void(Matrix44A & matrix));
|
||||
MOCK_METHOD2(GetScreenAspect,
|
||||
EScreenAspectRatio(int nWidth, int nHeight));
|
||||
MOCK_METHOD2(SetViewportDownscale,
|
||||
Vec2(float xscale, float yscale));
|
||||
MOCK_METHOD1(SetViewParameters,
|
||||
void(const CameraViewParameters& viewParameters));
|
||||
MOCK_METHOD1(ApplyViewParameters,
|
||||
void(const CameraViewParameters& viewParameters));
|
||||
MOCK_METHOD5(DrawDynVB,
|
||||
void(SVF_P3F_C4B_T2F * pBuf, uint16 * pInds, int nVerts, int nInds, PublicRenderPrimitiveType nPrimType));
|
||||
|
||||
// Hand-edit: google mock has issues with DynUiPrimitiveList
|
||||
void DrawDynUiPrimitiveList([[maybe_unused]] DynUiPrimitiveList& primitives, [[maybe_unused]] int totalNumVertices, [[maybe_unused]] int totalNumIndices) override { return; }
|
||||
|
||||
MOCK_METHOD1(SetCamera,
|
||||
void(const CCamera& cam));
|
||||
MOCK_METHOD0(GetCamera,
|
||||
const CCamera& ());
|
||||
MOCK_METHOD1(GetRenderViewForThread,
|
||||
CRenderView * (int nThreadID));
|
||||
MOCK_METHOD1(SetGammaDelta,
|
||||
bool(float fGamma));
|
||||
MOCK_METHOD0(RestoreGamma,
|
||||
void(void));
|
||||
MOCK_METHOD3(ChangeDisplay,
|
||||
bool(unsigned int width, unsigned int height, unsigned int cbpp));
|
||||
MOCK_METHOD7(ChangeViewport,
|
||||
void(unsigned int, unsigned int, unsigned int, unsigned int, bool, float, float));
|
||||
MOCK_CONST_METHOD6(SaveTga,
|
||||
bool(unsigned char* sourcedata, int sourceformat, int w, int h, const char* filename, bool flip));
|
||||
MOCK_METHOD1(SetTexture,
|
||||
void(int tnum));
|
||||
MOCK_METHOD2(SetTexture,
|
||||
void(int tnum, int nUnit));
|
||||
MOCK_METHOD0(SetWhiteTexture,
|
||||
void());
|
||||
MOCK_CONST_METHOD0(GetWhiteTextureId,
|
||||
int());
|
||||
MOCK_CONST_METHOD0(GetBlackTextureId,
|
||||
int());
|
||||
|
||||
// Hand-edit: google mock can only do up to 10 parameters
|
||||
void Draw2dImage(float, float, float, float, int, float, float, float, float, float, float, float, float, float, float) override {};
|
||||
MOCK_METHOD1(Draw2dImageStretchMode,
|
||||
void(bool stretch));
|
||||
|
||||
// Hand-edit: google mock can only do up to 10 parameters
|
||||
void Push2dImage(float, float, float, float, int, float, float, float, float, float, float, float, float, float, float, float) override {};
|
||||
|
||||
MOCK_METHOD0(Draw2dImageList,
|
||||
void());
|
||||
|
||||
// Hand-edit: Hand-edit: google mock can only do up to 10 parameters
|
||||
void DrawImage(float, float, float, float, int, float, float, float, float, float, float, float, float, bool) override {}
|
||||
|
||||
// Hand-edit: google mock can only do up to 10 parameters
|
||||
void DrawImageWithUV(float, float, float, float, float, int, float*, float*, float, float, float, float, bool) override {}
|
||||
|
||||
MOCK_METHOD1(PushWireframeMode,
|
||||
void(int mode));
|
||||
MOCK_METHOD0(PopWireframeMode,
|
||||
void());
|
||||
MOCK_CONST_METHOD0(GetHeight,
|
||||
int());
|
||||
MOCK_CONST_METHOD0(GetWidth,
|
||||
int());
|
||||
MOCK_CONST_METHOD0(GetPixelAspectRatio,
|
||||
float());
|
||||
MOCK_CONST_METHOD0(GetOverlayHeight,
|
||||
int());
|
||||
MOCK_CONST_METHOD0(GetOverlayWidth,
|
||||
int());
|
||||
MOCK_CONST_METHOD0(GetMaxSquareRasterDimension,
|
||||
int());
|
||||
MOCK_METHOD0(SwitchToNativeResolutionBackbuffer,
|
||||
void());
|
||||
MOCK_METHOD1(GetMemoryUsage,
|
||||
void(ICrySizer * Sizer));
|
||||
MOCK_METHOD1(GetBandwidthStats,
|
||||
void(float* fBandwidthRequested));
|
||||
MOCK_METHOD1(SetTextureStreamListener,
|
||||
void(ITextureStreamListener * pListener));
|
||||
MOCK_METHOD2(GetOcclusionBuffer,
|
||||
int(uint16 * pOutOcclBuffer, Matrix44 * pmCamBuffer));
|
||||
MOCK_METHOD2(ScreenShot,
|
||||
bool(const char*, int));
|
||||
MOCK_METHOD0(GetColorBpp,
|
||||
int());
|
||||
MOCK_METHOD0(GetDepthBpp,
|
||||
int());
|
||||
MOCK_METHOD0(GetStencilBpp,
|
||||
int());
|
||||
MOCK_CONST_METHOD0(IsStereoEnabled,
|
||||
bool());
|
||||
MOCK_CONST_METHOD0(GetNearestRangeMax,
|
||||
float());
|
||||
MOCK_METHOD0(GetPerInstanceConstantBufferPoolPointer,
|
||||
PerInstanceConstantBufferPool * ());
|
||||
MOCK_METHOD6(ProjectToScreen,
|
||||
bool(float ptx, float pty, float ptz, float* sx, float* sy, float* sz));
|
||||
MOCK_METHOD9(UnProject,
|
||||
int(float sx, float sy, float sz, float* px, float* py, float* pz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4]));
|
||||
MOCK_METHOD6(UnProjectFromScreen,
|
||||
int(float sx, float sy, float sz, float* px, float* py, float* pz));
|
||||
MOCK_METHOD1(GetModelViewMatrix,
|
||||
void(float* mat));
|
||||
MOCK_METHOD1(GetProjectionMatrix,
|
||||
void(float* mat));
|
||||
MOCK_METHOD7(WriteDDS,
|
||||
bool(const byte * dat, int wdt, int hgt, int Size, const char* name, ETEX_Format eF, int NumMips));
|
||||
MOCK_METHOD6(WriteTGA,
|
||||
bool(const byte * dat, int wdt, int hgt, const char* name, int src_bits_per_pixel, int dest_bits_per_pixel));
|
||||
MOCK_METHOD6(WriteJPG,
|
||||
bool(const byte*, int, int, char*, int, int));
|
||||
MOCK_METHOD6(FontCreateTexture,
|
||||
int(int, int, byte*, ETEX_Format, bool, const char*));
|
||||
MOCK_METHOD6(FontUpdateTexture,
|
||||
bool(int nTexId, int X, int Y, int USize, int VSize, byte * pData));
|
||||
MOCK_METHOD2(FontSetTexture,
|
||||
void(int nTexId, int nFilterMode));
|
||||
MOCK_METHOD2(FontSetRenderingState,
|
||||
void(bool overrideViewProjMatrices, TransformationMatrices & backupMatrices));
|
||||
MOCK_METHOD3(FontSetBlending,
|
||||
void(int src, int dst, int baseState));
|
||||
MOCK_METHOD2(FontRestoreRenderingState,
|
||||
void(bool overrideViewProjMatrices, const TransformationMatrices& restoringMatrices));
|
||||
MOCK_METHOD3(FlushRTCommands,
|
||||
bool(bool bWait, bool bImmediatelly, bool bForce));
|
||||
MOCK_CONST_METHOD7(DrawStringU,
|
||||
void(IFFont_RenderProxy * pFont, float x, float y, float z, const char* pStr, bool asciiMultiLine, const STextDrawContext& ctx));
|
||||
MOCK_METHOD0(RT_CurThreadList,
|
||||
int());
|
||||
MOCK_METHOD6(EF_PrecacheResource,
|
||||
bool(SShaderItem*, float, float, int, int, int));
|
||||
MOCK_METHOD4(EF_PrecacheResource,
|
||||
bool(IShader * pSH, float fMipFactor, float fTimeToReady, int Flags));
|
||||
MOCK_METHOD6(EF_PrecacheResource,
|
||||
bool(ITexture*, float, float, int, int, int));
|
||||
MOCK_METHOD6(EF_PrecacheResource,
|
||||
bool(IRenderMesh * pPB, _smart_ptr<IMaterial> pMaterial, float fMipFactor, float fTimeToReady, int Flags, int nUpdateId));
|
||||
MOCK_METHOD5(EF_PrecacheResource,
|
||||
bool(CDLight * pLS, float fMipFactor, float fTimeToReady, int Flags, int nUpdateId));
|
||||
|
||||
// Hand-edit: google mock can only do up to 10 parameters
|
||||
ITexture* EF_CreateCompositeTexture([[maybe_unused]] int type, [[maybe_unused]] const char* szName, [[maybe_unused]] int nWidth, [[maybe_unused]] int nHeight, [[maybe_unused]] int nDepth, [[maybe_unused]] int nMips, [[maybe_unused]] int nFlags, [[maybe_unused]] ETEX_Format eTF, [[maybe_unused]] const STexComposition* pCompositions, [[maybe_unused]] size_t nCompositions, [[maybe_unused]] int8 nPriority = -1) override { return nullptr; }
|
||||
|
||||
MOCK_METHOD0(PostLevelLoading,
|
||||
void());
|
||||
MOCK_METHOD0(PostLevelUnload,
|
||||
void());
|
||||
MOCK_METHOD10(EF_AddPolygonToScene,
|
||||
CRenderObject * (SShaderItem & si, int numPts, const SVF_P3F_C4B_T2F * verts, const SPipTangents * tangs, CRenderObject * obj, const SRenderingPassInfo& passInfo, uint16 * inds, int ninds, int nAW, const SRendItemSorter& rendItemSorter));
|
||||
MOCK_METHOD10(EF_AddPolygonToScene,
|
||||
CRenderObject * (SShaderItem & si, CRenderObject * obj, const SRenderingPassInfo& passInfo, int numPts, int ninds, SVF_P3F_C4B_T2F * &verts, SPipTangents * &tangs, uint16 * &inds, int nAW, const SRendItemSorter& rendItemSorter));
|
||||
MOCK_METHOD0(ForceUpdateGlobalShaderParameters,
|
||||
void());
|
||||
MOCK_METHOD0(EF_GetShaderMissLogPath,
|
||||
const char*());
|
||||
MOCK_METHOD1(EF_GetShaderNames,
|
||||
string * (int& nNumShaders));
|
||||
MOCK_METHOD1(EF_ReloadFile,
|
||||
bool(const char* szFileName));
|
||||
MOCK_METHOD1(EF_ReloadFile_Request,
|
||||
bool(const char* szFileName));
|
||||
MOCK_METHOD3(EF_GetRemapedShaderMaskGen,
|
||||
uint64(const char*, uint64, bool));
|
||||
MOCK_METHOD3(EF_GetShaderGlobalMaskGenFromString,
|
||||
uint64(const char*, const char*, uint64));
|
||||
MOCK_METHOD2(EF_GetStringFromShaderGlobalMaskGen,
|
||||
AZStd::string(const char*, uint64));
|
||||
MOCK_CONST_METHOD1(GetShaderProfile,
|
||||
const SShaderProfile& (EShaderType eST));
|
||||
MOCK_METHOD2(EF_SetShaderQuality,
|
||||
void(EShaderType eST, EShaderQuality eSQ));
|
||||
MOCK_CONST_METHOD0(EF_GetRenderQuality,
|
||||
ERenderQuality());
|
||||
MOCK_METHOD1(EF_GetShaderQuality,
|
||||
EShaderQuality(EShaderType eST));
|
||||
MOCK_METHOD5(EF_LoadShaderItem,
|
||||
SShaderItem(const char*, bool, int, SInputShaderResources*, uint64));
|
||||
MOCK_METHOD3(EF_LoadShader,
|
||||
IShader * (const char*, int, uint64));
|
||||
MOCK_METHOD1(EF_ReloadShaderFiles,
|
||||
void(int nCategory));
|
||||
MOCK_METHOD0(EF_ReloadTextures,
|
||||
void());
|
||||
MOCK_METHOD1(EF_GetTextureByID,
|
||||
ITexture * (int Id));
|
||||
MOCK_METHOD2(EF_GetTextureByName,
|
||||
ITexture * (const char*, uint32));
|
||||
MOCK_METHOD2(EF_LoadTexture,
|
||||
ITexture * (const char*, uint32));
|
||||
MOCK_METHOD2(EF_LoadCubemapTexture,
|
||||
ITexture * (const char*, uint32));
|
||||
MOCK_METHOD1(EF_LoadDefaultTexture,
|
||||
ITexture * (const char* nameTex));
|
||||
MOCK_METHOD1(EF_LoadLightmap,
|
||||
int(const char* name));
|
||||
MOCK_METHOD1(EF_StartEf,
|
||||
void(const SRenderingPassInfo& passInfo));
|
||||
MOCK_METHOD3(EF_GetObjData,
|
||||
SRenderObjData * (CRenderObject * pObj, bool bCreate, int nThreadID));
|
||||
MOCK_METHOD1(EF_GetObject_Temp,
|
||||
CRenderObject * (int nThreadID));
|
||||
MOCK_METHOD2(EF_DuplicateRO,
|
||||
CRenderObject * (CRenderObject * pObj, const SRenderingPassInfo& passInfo));
|
||||
MOCK_METHOD7(EF_AddEf,
|
||||
void(IRenderElement * pRE, SShaderItem & pSH, CRenderObject * pObj, const SRenderingPassInfo& passInfo, int nList, int nAW, const SRendItemSorter& rendItemSorter));
|
||||
MOCK_METHOD4(EF_EndEf3D,
|
||||
void(int nFlags, int nPrecacheUpdateId, int nNearPrecacheUpdateId, const SRenderingPassInfo& passInfo));
|
||||
MOCK_METHOD1(EF_InvokeShadowMapRenderJobs,
|
||||
void(int nFlags));
|
||||
MOCK_METHOD1(EF_IsFakeDLight,
|
||||
bool(const CDLight * Source));
|
||||
MOCK_METHOD2(EF_ADDDlight,
|
||||
void(CDLight * Source, const SRenderingPassInfo& passInfo));
|
||||
MOCK_METHOD1(EF_UpdateDLight,
|
||||
bool(SRenderLight * pDL));
|
||||
MOCK_METHOD1(EF_AddDeferredDecal,
|
||||
bool(const SDeferredDecal& rDecal));
|
||||
MOCK_METHOD4(EF_AddDeferredLight,
|
||||
int(const CDLight& pLight, float fMult, const SRenderingPassInfo& passInfo, const SRendItemSorter& rendItemSorter));
|
||||
MOCK_METHOD1(EF_GetDeferredLightsNum,
|
||||
uint32(eDeferredLightType));
|
||||
MOCK_METHOD0(EF_ClearDeferredLightsList,
|
||||
void());
|
||||
MOCK_METHOD1(EF_AddDeferredClipVolume,
|
||||
uint8(const IClipVolume * pClipVolume));
|
||||
MOCK_METHOD2(EF_SetDeferredClipVolumeBlendData,
|
||||
bool(const IClipVolume * pClipVolume, const SClipVolumeBlendInfo& blendInfo));
|
||||
MOCK_METHOD0(EF_ClearDeferredClipVolumesList,
|
||||
void());
|
||||
MOCK_METHOD0(EF_ReleaseDeferredData,
|
||||
void());
|
||||
MOCK_METHOD1(EF_ReleaseInputShaderResource,
|
||||
void(SInputShaderResources * pRes));
|
||||
MOCK_METHOD3(EF_SetPostEffectParam,
|
||||
void(const char*, float, bool));
|
||||
MOCK_METHOD3(EF_SetPostEffectParamVec4,
|
||||
void(const char*, const Vec4&, bool));
|
||||
MOCK_METHOD2(EF_SetPostEffectParamString,
|
||||
void(const char* pParam, const char* pszArg));
|
||||
MOCK_METHOD2(EF_GetPostEffectParam,
|
||||
void(const char* pParam, float& fValue));
|
||||
MOCK_METHOD2(EF_GetPostEffectParamVec4,
|
||||
void(const char* pParam, Vec4 & pValue));
|
||||
MOCK_METHOD2(EF_GetPostEffectParamString,
|
||||
void(const char* pParam, const char* & pszArg));
|
||||
MOCK_METHOD1(EF_GetPostEffectID,
|
||||
int32(const char* pPostEffectName));
|
||||
MOCK_METHOD1(EF_ResetPostEffects,
|
||||
void(bool));
|
||||
MOCK_METHOD0(SyncPostEffects,
|
||||
void());
|
||||
MOCK_METHOD0(EF_DisableTemporalEffects,
|
||||
void());
|
||||
MOCK_METHOD3(EF_AddWaterSimHit,
|
||||
void(const Vec3& vPos, float scale, float strength));
|
||||
MOCK_METHOD0(EF_DrawWaterSimHits,
|
||||
void());
|
||||
MOCK_METHOD1(EF_EndEf2D,
|
||||
void(bool bSort));
|
||||
MOCK_METHOD0(ForceGC,
|
||||
void());
|
||||
MOCK_CONST_METHOD0(GetPolyCount,
|
||||
int());
|
||||
MOCK_CONST_METHOD2(GetPolyCount,
|
||||
void(int& nPolygons, int& nShadowVolPolys));
|
||||
MOCK_METHOD1(SetClearColor,
|
||||
void(const Vec3& vColor));
|
||||
MOCK_METHOD1(SetClearBackground,
|
||||
void(bool bClearBackground));
|
||||
MOCK_METHOD4(CreateRenderMesh,
|
||||
_smart_ptr<IRenderMesh>(const char*, const char*, IRenderMesh::SInitParamerers*, ERenderMeshType));
|
||||
|
||||
// Hand-edit: google mock can only do up to 10 parameters
|
||||
virtual _smart_ptr<IRenderMesh> CreateRenderMeshInitialized(
|
||||
const void*, int, const AZ::Vertex::Format&, const vtx_idx*, int, const PublicRenderPrimitiveType,
|
||||
const char*, const char*, ERenderMeshType = eRMT_Static, int = 1, int = 0,
|
||||
[[maybe_unused]] bool (*PrepareBufferCallback)(IRenderMesh*, bool) = nullptr, void* = nullptr, bool = false, bool = true,
|
||||
const SPipTangents* = nullptr, bool = false, Vec3* = nullptr)
|
||||
{
|
||||
return _smart_ptr<IRenderMesh>();
|
||||
}
|
||||
|
||||
MOCK_METHOD1(GetFrameID,
|
||||
int(bool));
|
||||
MOCK_CONST_METHOD0(GetCameraFrameID,
|
||||
int());
|
||||
MOCK_CONST_METHOD0(IsRenderToTextureActive,
|
||||
bool());
|
||||
MOCK_METHOD4(MakeMatrix,
|
||||
void(const Vec3& pos, const Vec3& angles, const Vec3& scale, Matrix34 * mat));
|
||||
MOCK_METHOD4(DrawTextQueued,
|
||||
void(Vec3 pos, SDrawTextInfo & ti, const char* format, va_list args));
|
||||
MOCK_METHOD3(DrawTextQueued,
|
||||
void(Vec3 pos, SDrawTextInfo & ti, const char* text));
|
||||
MOCK_CONST_METHOD1(ScaleCoordX,
|
||||
float(float value));
|
||||
MOCK_CONST_METHOD1(ScaleCoordY,
|
||||
float(float value));
|
||||
MOCK_CONST_METHOD2(ScaleCoord,
|
||||
void(float& x, float& y));
|
||||
MOCK_METHOD2(SetState,
|
||||
void(int, int));
|
||||
MOCK_METHOD1(SetCullMode,
|
||||
void(int));
|
||||
MOCK_METHOD5(SetStencilState,
|
||||
void(int, uint32, uint32, uint32, bool));
|
||||
MOCK_METHOD1(PushProfileMarker,
|
||||
void(const char* label));
|
||||
MOCK_METHOD1(PopProfileMarker,
|
||||
void(const char* label));
|
||||
MOCK_METHOD1(EnableFog,
|
||||
bool(bool enable));
|
||||
MOCK_METHOD1(SetFogColor,
|
||||
void(const ColorF& color));
|
||||
MOCK_METHOD4(SetColorOp,
|
||||
void(byte eCo, byte eAo, byte eCa, byte eAa));
|
||||
MOCK_METHOD1(SetSrgbWrite,
|
||||
void(bool srgbWrite));
|
||||
MOCK_METHOD1(RequestFlushAllPendingTextureStreamingJobs,
|
||||
void(int nFrames));
|
||||
MOCK_METHOD1(SetTexturesStreamingGlobalMipFactor,
|
||||
void(float fFactor));
|
||||
MOCK_METHOD1(GetIRenderAuxGeom,
|
||||
IRenderAuxGeom * (void*));
|
||||
MOCK_METHOD0(GetISvoRenderer,
|
||||
ISvoRenderer * ());
|
||||
MOCK_METHOD0(GetIColorGradingController,
|
||||
IColorGradingController * ());
|
||||
MOCK_METHOD0(GetIStereoRenderer,
|
||||
IStereoRenderer * ());
|
||||
MOCK_METHOD7(Create2DTexture,
|
||||
ITexture * (const char* name, int width, int height, int numMips, int flags, unsigned char* data, ETEX_Format format));
|
||||
|
||||
void TextToScreen([[maybe_unused]] float x, [[maybe_unused]] float y, [[maybe_unused]] const char* format, ...) override {}
|
||||
void TextToScreenColor([[maybe_unused]] int x, [[maybe_unused]] int y, [[maybe_unused]] float r, [[maybe_unused]] float g, [[maybe_unused]] float b, [[maybe_unused]] float a, [[maybe_unused]] const char* format, ...) override {}
|
||||
|
||||
MOCK_METHOD0(ResetToDefault,
|
||||
void());
|
||||
MOCK_METHOD4(SetMaterialColor,
|
||||
void(float r, float g, float b, float a));
|
||||
MOCK_METHOD0(SetDefaultRenderStates,
|
||||
void());
|
||||
MOCK_METHOD10(Graph,
|
||||
void(byte * g, int x, int y, int wdt, int hgt, int nC, int type, const char* text, ColorF & color, float fScale));
|
||||
MOCK_METHOD0(EF_RenderTextMessages,
|
||||
void());
|
||||
MOCK_METHOD1(ClearTargetsImmediately,
|
||||
void(uint32 nFlags));
|
||||
MOCK_METHOD3(ClearTargetsImmediately,
|
||||
void(uint32 nFlags, const ColorF& Colors, float fDepth));
|
||||
MOCK_METHOD2(ClearTargetsImmediately,
|
||||
void(uint32 nFlags, const ColorF& Colors));
|
||||
MOCK_METHOD2(ClearTargetsImmediately,
|
||||
void(uint32 nFlags, float fDepth));
|
||||
MOCK_METHOD1(ClearTargetsLater,
|
||||
void(uint32 nFlags));
|
||||
MOCK_METHOD3(ClearTargetsLater,
|
||||
void(uint32 nFlags, const ColorF& Colors, float fDepth));
|
||||
MOCK_METHOD2(ClearTargetsLater,
|
||||
void(uint32 nFlags, const ColorF& Colors));
|
||||
MOCK_METHOD2(ClearTargetsLater,
|
||||
void(uint32 nFlags, float fDepth));
|
||||
MOCK_METHOD8(ReadFrameBuffer,
|
||||
void(unsigned char*, int, int, int, ERB_Type, bool, int, int));
|
||||
MOCK_METHOD4(ReadFrameBufferFast,
|
||||
void(uint32*, int, int, bool));
|
||||
MOCK_METHOD1(EnableVSync,
|
||||
void(bool enable));
|
||||
MOCK_METHOD1(CreateResourceAsync,
|
||||
void(SResourceAsync * Resource));
|
||||
MOCK_METHOD1(ReleaseResourceAsync,
|
||||
void(SResourceAsync * Resource));
|
||||
MOCK_METHOD1(ReleaseResourceAsync,
|
||||
void(AZStd::unique_ptr<SResourceAsync> Resource));
|
||||
|
||||
// Hand-edit: google mock can only do up to 10 parameters
|
||||
unsigned int DownLoadToVideoMemory(const byte*, int, int, ETEX_Format, ETEX_Format, int, bool = true,
|
||||
int = FILTER_BILINEAR, int = 0, const char* = nullptr, int = 0, EEndian = eLittleEndian,
|
||||
RectI* = nullptr, bool = false) override { return 0; }
|
||||
|
||||
unsigned int DownLoadToVideoMemory3D(const byte*, int, int, [[maybe_unused]] int d, ETEX_Format, ETEX_Format, int, bool = true,
|
||||
int = FILTER_BILINEAR, int = 0, const char* = nullptr, int = 0, EEndian = eLittleEndian,
|
||||
RectI* = nullptr, bool = false) override { return 0; }
|
||||
|
||||
unsigned int DownLoadToVideoMemoryCube(const byte*, int, int, ETEX_Format, ETEX_Format, int, bool = true,
|
||||
int = FILTER_BILINEAR, int = 0, const char* = nullptr, int = 0, EEndian = eLittleEndian,
|
||||
RectI* = nullptr, bool = false) override { return 0; }
|
||||
|
||||
MOCK_METHOD9(UpdateTextureInVideoMemory,
|
||||
void(uint32, const byte*, int, int, int, int, ETEX_Format, int, int));
|
||||
MOCK_METHOD8(DXTCompress,
|
||||
bool(const byte * raw_data, int nWidth, int nHeight, ETEX_Format eTF, bool bUseHW, bool bGenMips, int nSrcBytesPerPix, MIPDXTcallback callback));
|
||||
MOCK_METHOD9(DXTDecompress,
|
||||
bool(const byte * srcData, size_t srcFileSize, byte * dstData, int nWidth, int nHeight, int nMips, ETEX_Format eSrcTF, bool bUseHW, int nDstBytesPerPix));
|
||||
MOCK_METHOD1(RemoveTexture,
|
||||
void(unsigned int TextureId));
|
||||
MOCK_METHOD1(DeleteFont,
|
||||
void(IFFont * font));
|
||||
MOCK_METHOD3(CaptureFrameBufferFast,
|
||||
bool(unsigned char* pDstRGBA8, int destinationWidth, int destinationHeight));
|
||||
MOCK_METHOD3(CopyFrameBufferFast,
|
||||
bool(unsigned char* pDstRGBA8, int destinationWidth, int destinationHeight));
|
||||
MOCK_METHOD1(RegisterCaptureFrame,
|
||||
bool(ICaptureFrameListener * pCapture));
|
||||
MOCK_METHOD1(UnRegisterCaptureFrame,
|
||||
bool(ICaptureFrameListener * pCapture));
|
||||
MOCK_METHOD2(InitCaptureFrameBufferFast,
|
||||
bool(uint32, uint32));
|
||||
MOCK_METHOD0(CloseCaptureFrameBufferFast,
|
||||
void(void));
|
||||
MOCK_METHOD0(CaptureFrameBufferCallBack,
|
||||
void(void));
|
||||
MOCK_METHOD1(RegisterSyncWithMainListener,
|
||||
void(ISyncMainWithRenderListener * pListener));
|
||||
MOCK_METHOD1(RemoveSyncWithMainListener,
|
||||
void(const ISyncMainWithRenderListener * pListener));
|
||||
MOCK_METHOD5(Set2DMode,
|
||||
void(uint32, uint32, TransformationMatrices&, float, float));
|
||||
MOCK_METHOD1(Unset2DMode,
|
||||
void(const TransformationMatrices& restoringMatrices));
|
||||
MOCK_METHOD7(Set2DModeNonZeroTopLeft,
|
||||
void(float, float, float, float, TransformationMatrices&, float, float));
|
||||
MOCK_METHOD1(ScreenToTexture,
|
||||
int(int nTexID));
|
||||
MOCK_METHOD1(EnableSwapBuffers,
|
||||
void(bool bEnable));
|
||||
MOCK_METHOD0(GetHWND,
|
||||
WIN_HWND());
|
||||
MOCK_METHOD1(SetWindowIcon,
|
||||
bool(const char* path));
|
||||
MOCK_METHOD1(OnEntityDeleted,
|
||||
void(struct IRenderNode* pRenderNode));
|
||||
MOCK_METHOD5(CreateRenderTarget,
|
||||
int(const char* name, int nWidth, int nHeight, const ColorF& clearColor, ETEX_Format eTF));
|
||||
MOCK_METHOD1(DestroyRenderTarget,
|
||||
bool(int nHandle));
|
||||
MOCK_METHOD3(ResizeRenderTarget,
|
||||
bool(int nHandle, int nWidth, int nHeight));
|
||||
MOCK_METHOD2(SetRenderTarget,
|
||||
bool(int, SDepthTexture*));
|
||||
MOCK_METHOD3(CreateDepthSurface,
|
||||
SDepthTexture * (int, int, bool));
|
||||
MOCK_METHOD1(DestroyDepthSurface,
|
||||
void(SDepthTexture * pDepthSurf));
|
||||
MOCK_METHOD1(PauseTimer,
|
||||
void(bool bPause));
|
||||
MOCK_METHOD0(CreateShaderPublicParams,
|
||||
IShaderPublicParams * ());
|
||||
MOCK_CONST_METHOD2(GetThreadIDs,
|
||||
void(threadID & mainThreadID, threadID & renderThreadID));
|
||||
MOCK_METHOD1(EnableGPUTimers2,
|
||||
void(bool bEnabled));
|
||||
MOCK_METHOD1(AllowGPUTimers2,
|
||||
void(bool bAllow));
|
||||
MOCK_CONST_METHOD2(GetRPPStats,
|
||||
const RPProfilerStats * (ERenderPipelineProfilerStats, bool));
|
||||
MOCK_CONST_METHOD1(GetRPPStatsArray,
|
||||
const RPProfilerStats * (bool));
|
||||
MOCK_METHOD4(GetPolygonCountByType,
|
||||
int(uint32, EVertexCostTypes, uint32, bool));
|
||||
MOCK_METHOD5(SetCloudShadowsParams,
|
||||
void(int nTexID, const Vec3& speed, float tiling, bool invert, float brightness));
|
||||
MOCK_METHOD2(PushFogVolumeContribution,
|
||||
uint16(const SFogVolumeData& fogVolData, const SRenderingPassInfo& passInfo));
|
||||
MOCK_METHOD2(PushFogVolume,
|
||||
void(class CREFogVolume * pFogVolume, const SRenderingPassInfo& passInfo));
|
||||
MOCK_METHOD0(GetMaxTextureSize,
|
||||
int());
|
||||
MOCK_METHOD1(GetTextureFormatName,
|
||||
const char*(ETEX_Format eTF));
|
||||
MOCK_METHOD5(GetTextureFormatDataSize,
|
||||
int(int nWidth, int nHeight, int nDepth, int nMips, ETEX_Format eTF));
|
||||
MOCK_METHOD2(SetDefaultMaterials,
|
||||
void(_smart_ptr<IMaterial> pDefMat, _smart_ptr<IMaterial> pTerrainDefMat));
|
||||
MOCK_CONST_METHOD0(GetGPUParticleEngine,
|
||||
IGPUParticleEngine * ());
|
||||
MOCK_CONST_METHOD0(GetActiveGPUCount,
|
||||
uint32());
|
||||
MOCK_METHOD0(GetShadowFrustumMGPUCache,
|
||||
ShadowFrustumMGPUCache * ());
|
||||
|
||||
MOCK_CONST_METHOD0(GetCachedShadowsResolution,
|
||||
const StaticArray<int, MAX_GSM_LODS_NUM>&());
|
||||
|
||||
MOCK_METHOD1(SetCachedShadowsResolution,
|
||||
void(const StaticArray<int, MAX_GSM_LODS_NUM>&arrResolutions));
|
||||
MOCK_CONST_METHOD1(UpdateCachedShadowsLodCount,
|
||||
void(int nGsmLods));
|
||||
MOCK_METHOD1(SetTexturePrecaching,
|
||||
void(bool stat));
|
||||
MOCK_METHOD2(RT_InsertGpuCallback,
|
||||
void(uint32 context, GpuCallbackFunc callback));
|
||||
MOCK_METHOD1(EnablePipelineProfiler,
|
||||
void(bool bEnable));
|
||||
MOCK_METHOD1(GetRenderTimes,
|
||||
void(SRenderTimes & outTimes));
|
||||
MOCK_METHOD0(GetGPUFrameTime,
|
||||
float());
|
||||
MOCK_METHOD1(EnableBatchMode,
|
||||
void(bool enable));
|
||||
MOCK_METHOD1(EnableLevelUnloading,
|
||||
void(bool enable));
|
||||
MOCK_METHOD0(OnLevelLoadFailed,
|
||||
void());
|
||||
#if !defined(_RELEASE)
|
||||
MOCK_METHOD1(GetDrawCallsInfoPerMesh,
|
||||
RNDrawcallsMapMesh & (bool));
|
||||
MOCK_METHOD1(GetDrawCallsInfoPerMeshPreviousFrame,
|
||||
RNDrawcallsMapMesh & (bool));
|
||||
MOCK_METHOD1(GetDrawCallsInfoPerNodePreviousFrame,
|
||||
RNDrawcallsMapNode & (bool));
|
||||
MOCK_METHOD1(GetDrawCallsPerNode,
|
||||
int(IRenderNode * pRenderNode));
|
||||
MOCK_METHOD1(ForceRemoveNodeFromDrawCallsMap,
|
||||
void(IRenderNode * pNode));
|
||||
#endif
|
||||
MOCK_METHOD1(CollectDrawCallsInfo,
|
||||
void(bool status));
|
||||
MOCK_METHOD1(CollectDrawCallsInfoPerNode,
|
||||
void(bool status));
|
||||
MOCK_METHOD0(HasLoadedDefaultResources,
|
||||
bool());
|
||||
MOCK_METHOD3(EF_CreateSkinningData,
|
||||
SSkinningData * (uint32, bool, bool));
|
||||
MOCK_METHOD4(EF_CreateRemappedSkinningData,
|
||||
SSkinningData * (uint32 nNumBones, SSkinningData * pSourceSkinningData, uint32 nCustomDataSize, uint32 pairGuid));
|
||||
MOCK_METHOD0(EF_ClearSkinningDataPool,
|
||||
void());
|
||||
MOCK_METHOD0(EF_GetSkinningPoolID,
|
||||
int());
|
||||
MOCK_METHOD1(ClearShaderItem,
|
||||
void(SShaderItem * pShaderItem));
|
||||
MOCK_METHOD2(UpdateShaderItem,
|
||||
void(SShaderItem * pShaderItem, _smart_ptr<IMaterial> pMaterial));
|
||||
MOCK_METHOD2(ForceUpdateShaderItem,
|
||||
void(SShaderItem * pShaderItem, _smart_ptr<IMaterial> pMaterial));
|
||||
MOCK_METHOD2(RefreshShaderResourceConstants,
|
||||
void(SShaderItem * pShaderItem, IMaterial * pMaterial));
|
||||
MOCK_METHOD0(IsStereoModeChangePending,
|
||||
bool());
|
||||
MOCK_METHOD1(LockParticleVideoMemory,
|
||||
void(uint32 nId));
|
||||
MOCK_METHOD1(UnLockParticleVideoMemory,
|
||||
void(uint32 nId));
|
||||
MOCK_METHOD1(BeginSpawningGeneratingRendItemJobs,
|
||||
void(int nThreadID));
|
||||
MOCK_METHOD1(BeginSpawningShadowGeneratingRendItemJobs,
|
||||
void(int nThreadID));
|
||||
MOCK_METHOD0(EndSpawningGeneratingRendItemJobs,
|
||||
void());
|
||||
MOCK_METHOD1(StartLoadtimePlayback,
|
||||
void(ILoadtimeCallback* pCallback));
|
||||
MOCK_METHOD0(StopLoadtimePlayback,
|
||||
void());
|
||||
|
||||
MOCK_METHOD0(GetGenerateRendItemJobExecutor,
|
||||
AZ::LegacyJobExecutor*());
|
||||
MOCK_METHOD0(GetGenerateShadowRendItemJobExecutor,
|
||||
AZ::LegacyJobExecutor*());
|
||||
MOCK_METHOD0(GetGenerateRendItemJobExecutorPreProcess,
|
||||
AZ::LegacyJobExecutor*());
|
||||
MOCK_METHOD1(GetFinalizeRendItemJobExecutor,
|
||||
AZ::LegacyJobExecutor*(int nThreadID));
|
||||
MOCK_METHOD1(GetFinalizeShadowRendItemJobExecutor,
|
||||
AZ::LegacyJobExecutor*(int nThreadID));
|
||||
MOCK_METHOD0(FlushPendingTextureTasks,
|
||||
void());
|
||||
MOCK_METHOD1(SetShadowJittering,
|
||||
void(float fShadowJittering));
|
||||
MOCK_CONST_METHOD0(GetShadowJittering,
|
||||
float());
|
||||
MOCK_METHOD0(LoadShaderStartupCache,
|
||||
bool());
|
||||
MOCK_METHOD0(UnloadShaderStartupCache,
|
||||
void());
|
||||
MOCK_METHOD0(LoadShaderLevelCache,
|
||||
bool());
|
||||
MOCK_METHOD0(UnloadShaderLevelCache,
|
||||
void());
|
||||
MOCK_METHOD1(StartScreenShot,
|
||||
void(int e_ScreenShot));
|
||||
MOCK_METHOD1(EndScreenShot,
|
||||
void(int e_ScreenShot));
|
||||
MOCK_METHOD3(SetRendererCVar,
|
||||
void(ICVar*, const char*, bool));
|
||||
MOCK_METHOD0(GetRenderPipeline,
|
||||
SRenderPipeline * ());
|
||||
MOCK_METHOD0(GetShaderManager,
|
||||
CShaderMan * ());
|
||||
MOCK_METHOD0(GetRenderThread,
|
||||
SRenderThread * ());
|
||||
MOCK_METHOD0(GetWhiteTexture,
|
||||
ITexture * ());
|
||||
MOCK_METHOD3(GetTextureForName,
|
||||
ITexture * (const char* name, uint32 nFlags, ETEX_Format eFormat));
|
||||
MOCK_METHOD0(GetViewParameters,
|
||||
const CameraViewParameters& ());
|
||||
MOCK_METHOD0(GetFrameReset,
|
||||
uint32());
|
||||
MOCK_METHOD0(GetDepthBufferOrig,
|
||||
SDepthTexture * ());
|
||||
MOCK_METHOD0(GetBackBufferWidth,
|
||||
uint32());
|
||||
MOCK_METHOD0(GetBackBufferHeight,
|
||||
uint32());
|
||||
MOCK_METHOD0(GetDeviceBufferManager,
|
||||
CDeviceBufferManager * ());
|
||||
MOCK_CONST_METHOD0(GetRenderTileInfo,
|
||||
const SRenderTileInfo * ());
|
||||
MOCK_METHOD0(GetIdentityMatrix,
|
||||
Matrix44A());
|
||||
MOCK_CONST_METHOD0(RT_GetCurrGpuID,
|
||||
int32());
|
||||
MOCK_METHOD0(GenerateTextureId,
|
||||
int());
|
||||
MOCK_METHOD2(SetCull,
|
||||
void(ECull, bool));
|
||||
MOCK_METHOD10(DrawQuad,
|
||||
void(float x0, float y0, float x1, float y1, const ColorF& color, float z, float s0, float t0, float s1, float t1));
|
||||
MOCK_METHOD9(DrawQuad3D,
|
||||
void(const Vec3& v0, const Vec3& v1, const Vec3& v2, const Vec3& v3, const ColorF& color, float ftx0, float fty0, float ftx1, float fty1));
|
||||
MOCK_METHOD0(FX_ResetPipe,
|
||||
void());
|
||||
MOCK_METHOD4(FX_GetDepthSurface,
|
||||
SDepthTexture * (int, int, bool, bool));
|
||||
MOCK_METHOD5(FX_CheckOverflow,
|
||||
void(int, int, IRenderElement*, int*, int*));
|
||||
MOCK_METHOD1(FX_PreRender,
|
||||
void(int Stage));
|
||||
MOCK_METHOD0(FX_PostRender,
|
||||
void());
|
||||
MOCK_METHOD3(FX_SetState,
|
||||
void(int, int, int));
|
||||
MOCK_METHOD3(FX_CommitStates,
|
||||
void(const SShaderTechnique * pTech, const SShaderPass * pPass, bool bUseMaterialState));
|
||||
MOCK_METHOD1(FX_Commit,
|
||||
void(bool));
|
||||
MOCK_METHOD2(FX_SetVertexDeclaration,
|
||||
long(int StreamMask, const AZ::Vertex::Format& vertexFormat));
|
||||
MOCK_METHOD7(FX_DrawIndexedPrimitive,
|
||||
void(eRenderPrimitiveType, int, int, int, int, int, bool));
|
||||
MOCK_METHOD3(FX_SetIStream,
|
||||
long(const void* pB, uint32 nOffs, RenderIndexType idxType));
|
||||
MOCK_METHOD5(FX_SetVStream,
|
||||
long(int, const void*, uint32, uint32, uint32));
|
||||
MOCK_METHOD4(FX_DrawPrimitive,
|
||||
void(eRenderPrimitiveType, int, int, int));
|
||||
MOCK_METHOD1(FX_ClearTarget,
|
||||
void(ITexture * pTex));
|
||||
MOCK_METHOD1(FX_ClearTarget,
|
||||
void(SDepthTexture * pTex));
|
||||
MOCK_METHOD4(FX_SetRenderTarget,
|
||||
bool(int, void*, SDepthTexture*, uint32));
|
||||
MOCK_METHOD4(FX_PushRenderTarget,
|
||||
bool(int, void*, SDepthTexture*, uint32));
|
||||
MOCK_METHOD7(FX_SetRenderTarget,
|
||||
bool(int, CTexture*, SDepthTexture*, bool, int, bool, uint32));
|
||||
MOCK_METHOD6(FX_PushRenderTarget,
|
||||
bool(int, CTexture*, SDepthTexture*, int, bool, uint32));
|
||||
MOCK_METHOD1(FX_RestoreRenderTarget,
|
||||
bool(int nTarget));
|
||||
MOCK_METHOD1(FX_PopRenderTarget,
|
||||
bool(int nTarget));
|
||||
MOCK_METHOD1(FX_SetActiveRenderTargets,
|
||||
void(bool bAllowDIP));
|
||||
MOCK_METHOD4(FX_Start,
|
||||
void(CShader * ef, int nTech, CShaderResources * Res, IRenderElement * re));
|
||||
MOCK_METHOD1(RT_PopRenderTarget,
|
||||
void(int nTarget));
|
||||
MOCK_METHOD5(RT_SetViewport,
|
||||
void(int, int, int, int, int));
|
||||
MOCK_METHOD4(RT_PushRenderTarget,
|
||||
void(int nTarget, CTexture * pTex, SDepthTexture * pDS, int nS));
|
||||
MOCK_METHOD5(EF_Scissor,
|
||||
void(bool bEnable, int sX, int sY, int sWdt, int sHgt));
|
||||
|
||||
#ifdef SUPPORT_HW_MOUSE_CURSOR
|
||||
MOCK_METHOD0(GetIHWMouseCursor,
|
||||
IHWMouseCursor * ());
|
||||
#endif
|
||||
|
||||
MOCK_METHOD0(GetRecursionLevel,
|
||||
int());
|
||||
MOCK_METHOD2(GetIntegerConfigurationValue,
|
||||
int(const char* varName, int defaultValue));
|
||||
MOCK_METHOD2(GetFloatConfigurationValue,
|
||||
float(const char* varName, float defaultValue));
|
||||
MOCK_METHOD2(GetBooleanConfigurationValue,
|
||||
bool(const char* varName, bool defaultValue));
|
||||
MOCK_METHOD3(ApplyDepthTextureState,
|
||||
void(int unit, int nFilter, bool clamp));
|
||||
MOCK_METHOD0(GetZTargetTexture,
|
||||
ITexture * ());
|
||||
MOCK_METHOD1(GetTextureState,
|
||||
int(const STexState& TS));
|
||||
MOCK_METHOD7(TextureDataSize,
|
||||
uint32(uint32, uint32, uint32, uint32, uint32, ETEX_Format, ETEX_TileMode));
|
||||
MOCK_METHOD6(ApplyForID,
|
||||
void(int nID, int nTUnit, int nTState, int nTexMaterialSlot, int nSUnit, bool useWhiteDefault));
|
||||
MOCK_METHOD9(Create3DTexture,
|
||||
ITexture * (const char* szName, int nWidth, int nHeight, int nDepth, int nMips, int nFlags, const byte * pData, ETEX_Format eTFSrc, ETEX_Format eTFDst));
|
||||
MOCK_METHOD1(IsTextureExist,
|
||||
bool(const ITexture * pTex));
|
||||
MOCK_METHOD1(NameForTextureFormat,
|
||||
const char*(ETEX_Format eTF));
|
||||
MOCK_METHOD1(NameForTextureType,
|
||||
const char*(ETEX_Type eTT));
|
||||
MOCK_METHOD0(IsVideoThreadModeEnabled,
|
||||
bool());
|
||||
MOCK_METHOD5(CreateDynTexture2,
|
||||
IDynTexture * (uint32 nWidth, uint32 nHeight, uint32 nTexFlags, const char* szSource, ETexPool eTexPool));
|
||||
MOCK_METHOD0(GetCurrentTextureAtlasSize,
|
||||
uint32());
|
||||
MOCK_METHOD2(BeginProfilerSection,
|
||||
void(const char*, uint32));
|
||||
MOCK_METHOD1(EndProfilerSection,
|
||||
void(const char*));
|
||||
MOCK_METHOD1(AddProfilerLabel,
|
||||
void(const char*));
|
||||
|
||||
MOCK_METHOD5(EF_QueryImpl,
|
||||
void(ERenderQueryTypes eQuery, void* pInOut0, uint32 nInOutSize0, void* pInOut1, uint32 nInOutSize1));
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#include <ISystem.h>
|
||||
#include <Cry_Camera.h>
|
||||
|
||||
#ifdef GetUserName
|
||||
#undef GetUserName
|
||||
#endif
|
||||
|
||||
class SystemMock
|
||||
: public ISystem
|
||||
{
|
||||
public:
|
||||
MOCK_METHOD0(Release,
|
||||
void());
|
||||
MOCK_METHOD0(GetGlobalEnvironment,
|
||||
SSystemGlobalEnvironment * ());
|
||||
MOCK_METHOD2(UpdatePreTickBus,
|
||||
bool(int, int));
|
||||
MOCK_METHOD2(UpdatePostTickBus,
|
||||
bool(int, int));
|
||||
MOCK_METHOD0(UpdateLoadtime,
|
||||
bool());
|
||||
MOCK_METHOD0(RenderStatistics,
|
||||
void());
|
||||
MOCK_METHOD0(GetUserName,
|
||||
const char*());
|
||||
MOCK_METHOD0(Quit,
|
||||
void());
|
||||
MOCK_METHOD1(Relaunch,
|
||||
void(bool bRelaunch));
|
||||
MOCK_CONST_METHOD0(IsQuitting,
|
||||
bool());
|
||||
MOCK_METHOD1(SerializingFile,
|
||||
void(int mode));
|
||||
MOCK_CONST_METHOD0(IsSerializingFile,
|
||||
int());
|
||||
MOCK_CONST_METHOD0(IsRelaunch,
|
||||
bool());
|
||||
|
||||
void FatalError([[maybe_unused]] const char* sFormat, ...) override {}
|
||||
void ReportBug([[maybe_unused]] const char* sFormat, ...) override {}
|
||||
|
||||
MOCK_METHOD6(WarningV,
|
||||
void(EValidatorModule module, EValidatorSeverity severity, int flags, const char* file, const char* format, va_list args));
|
||||
|
||||
void Warning([[maybe_unused]] EValidatorModule module, [[maybe_unused]] EValidatorSeverity severity, [[maybe_unused]] int flags, [[maybe_unused]] const char* file, [[maybe_unused]] const char* format, ...) override {}
|
||||
|
||||
MOCK_METHOD3(ShowMessage,
|
||||
int(const char* text, const char* caption, unsigned int uType));
|
||||
MOCK_METHOD1(CheckLogVerbosity,
|
||||
bool(int verbosity));
|
||||
MOCK_METHOD0(GetIViewSystem,
|
||||
IViewSystem * ());
|
||||
MOCK_METHOD0(GetILevelSystem,
|
||||
ILevelSystem * ());
|
||||
MOCK_METHOD0(GetINameTable,
|
||||
INameTable * ());
|
||||
MOCK_METHOD0(GetICmdLine,
|
||||
ICmdLine * ());
|
||||
MOCK_METHOD0(GetILog,
|
||||
ILog * ());
|
||||
MOCK_METHOD0(GetIPak,
|
||||
AZ::IO::IArchive * ());
|
||||
MOCK_METHOD0(GetICryFont,
|
||||
ICryFont * ());
|
||||
MOCK_METHOD0(GetIMovieSystem,
|
||||
IMovieSystem * ());
|
||||
MOCK_METHOD0(GetIAudioSystem,
|
||||
Audio::IAudioSystem * ());
|
||||
MOCK_METHOD0(GetIConsole,
|
||||
::IConsole * ());
|
||||
MOCK_METHOD0(GetIRemoteConsole,
|
||||
IRemoteConsole * ());
|
||||
MOCK_METHOD0(GetIProfilingSystem,
|
||||
IProfilingSystem * ());
|
||||
MOCK_METHOD0(GetISystemEventDispatcher,
|
||||
ISystemEventDispatcher * ());
|
||||
MOCK_METHOD0(GetITimer,
|
||||
ITimer * ());
|
||||
MOCK_METHOD1(SetForceNonDevMode,
|
||||
void(bool bValue));
|
||||
MOCK_CONST_METHOD0(GetForceNonDevMode,
|
||||
bool());
|
||||
MOCK_CONST_METHOD0(WasInDevMode,
|
||||
bool());
|
||||
MOCK_CONST_METHOD0(IsDevMode,
|
||||
bool());
|
||||
MOCK_METHOD3(CreateXmlNode,
|
||||
XmlNodeRef(const char*, bool, bool));
|
||||
MOCK_METHOD4(LoadXmlFromBuffer,
|
||||
XmlNodeRef(const char*, size_t, bool, bool));
|
||||
MOCK_METHOD2(LoadXmlFromFile,
|
||||
XmlNodeRef(const char*, bool));
|
||||
MOCK_METHOD0(GetXmlUtils,
|
||||
IXmlUtils * ());
|
||||
MOCK_METHOD1(SetViewCamera,
|
||||
void(CCamera & Camera));
|
||||
MOCK_METHOD0(GetViewCamera,
|
||||
CCamera & ());
|
||||
MOCK_METHOD1(IgnoreUpdates,
|
||||
void(bool bIgnore));
|
||||
MOCK_METHOD1(SetIProcess,
|
||||
void(IProcess * process));
|
||||
MOCK_METHOD0(GetIProcess,
|
||||
IProcess * ());
|
||||
MOCK_CONST_METHOD0(IsTestMode,
|
||||
bool());
|
||||
MOCK_METHOD3(SetFrameProfiler,
|
||||
void(bool on, bool display, char* prefix));
|
||||
MOCK_METHOD0(GetFileVersion,
|
||||
const SFileVersion&());
|
||||
MOCK_METHOD0(GetProductVersion,
|
||||
const SFileVersion&());
|
||||
MOCK_METHOD0(GetBuildVersion,
|
||||
const SFileVersion&());
|
||||
|
||||
MOCK_METHOD1(AddCVarGroupDirectory,
|
||||
void(const string&));
|
||||
MOCK_METHOD0(SaveConfiguration,
|
||||
void());
|
||||
MOCK_METHOD3(LoadConfiguration,
|
||||
void(const char*, ILoadConfigurationEntrySink*, bool));
|
||||
|
||||
MOCK_CONST_METHOD0(GetMaxConfigSpec,
|
||||
ESystemConfigSpec());
|
||||
MOCK_CONST_METHOD0(GetConfigPlatform,
|
||||
ESystemConfigPlatform());
|
||||
MOCK_METHOD1(SetConfigPlatform,
|
||||
void(ESystemConfigPlatform platform));
|
||||
MOCK_CONST_METHOD0(IsPaused,
|
||||
bool());
|
||||
MOCK_METHOD0(GetLocalizationManager,
|
||||
ILocalizationManager * ());
|
||||
MOCK_METHOD0(GetNoiseGen,
|
||||
CPNoise3 * ());
|
||||
MOCK_METHOD0(GetUpdateCounter,
|
||||
uint64());
|
||||
MOCK_METHOD1(RegisterErrorObserver,
|
||||
bool(IErrorObserver * errorObserver));
|
||||
MOCK_METHOD1(UnregisterErrorObserver,
|
||||
bool(IErrorObserver * errorObserver));
|
||||
MOCK_METHOD4(OnAssert,
|
||||
void(const char* condition, const char* message, const char* fileName, unsigned int fileLineNumber));
|
||||
MOCK_CONST_METHOD0(IsAssertDialogVisible,
|
||||
bool());
|
||||
MOCK_METHOD1(SetAssertVisible,
|
||||
void(bool bAssertVisble));
|
||||
MOCK_METHOD1(SetConsoleDrawEnabled,
|
||||
void(bool enabled));
|
||||
MOCK_METHOD1(SetUIDrawEnabled,
|
||||
void(bool enabled));
|
||||
MOCK_METHOD0(GetApplicationInstance,
|
||||
int());
|
||||
MOCK_METHOD1(GetApplicationLogInstance,
|
||||
int(const char* logFilePath));
|
||||
MOCK_METHOD0(ClearErrorMessages,
|
||||
void());
|
||||
MOCK_METHOD2(debug_GetCallStack,
|
||||
void(const char** pFunctions, int& nCount));
|
||||
MOCK_METHOD2(debug_LogCallStack,
|
||||
void(int, int));
|
||||
MOCK_METHOD1(ExecuteCommandLine,
|
||||
void(bool));
|
||||
MOCK_METHOD1(GetUpdateStats,
|
||||
void(SSystemUpdateStats & stats));
|
||||
MOCK_METHOD0(GetSystemGlobalState,
|
||||
ESystemGlobalState(void));
|
||||
MOCK_METHOD1(SetSystemGlobalState,
|
||||
void(ESystemGlobalState systemGlobalState));
|
||||
|
||||
#if !defined(_RELEASE)
|
||||
MOCK_CONST_METHOD0(IsSavingResourceList,
|
||||
bool());
|
||||
#endif
|
||||
|
||||
MOCK_METHOD0(GetRootWindowMessageHandler,
|
||||
void*());
|
||||
MOCK_METHOD1(RegisterWindowMessageHandler,
|
||||
void(IWindowMessageHandler * pHandler));
|
||||
MOCK_METHOD1(UnregisterWindowMessageHandler,
|
||||
void(IWindowMessageHandler * pHandler));
|
||||
MOCK_METHOD0(CreateLocalFileIO,
|
||||
std::shared_ptr<AZ::IO::FileIOBase>());
|
||||
|
||||
MOCK_METHOD2(ForceMaxFps, void(bool, int));
|
||||
};
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <ITexture.h>
|
||||
#include <AzTest/AzTest.h>
|
||||
|
||||
class ITextureMock
|
||||
: public ITexture
|
||||
{
|
||||
public:
|
||||
MOCK_METHOD0(AddRef,
|
||||
int());
|
||||
MOCK_METHOD0(Release,
|
||||
int());
|
||||
MOCK_METHOD0(ReleaseForce,
|
||||
int());
|
||||
MOCK_CONST_METHOD0(GetClearColor,
|
||||
const ColorF& ());
|
||||
MOCK_CONST_METHOD0(GetDstFormat,
|
||||
const ETEX_Format());
|
||||
MOCK_CONST_METHOD0(GetSrcFormat,
|
||||
const ETEX_Format());
|
||||
MOCK_CONST_METHOD0(GetTexType,
|
||||
const ETEX_Type());
|
||||
MOCK_METHOD2(ApplyTexture,
|
||||
void(int, int));
|
||||
MOCK_CONST_METHOD0(GetName,
|
||||
const char*());
|
||||
MOCK_CONST_METHOD0(GetWidth,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetHeight,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetDepth,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetTextureID,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetFlags,
|
||||
const uint32());
|
||||
MOCK_CONST_METHOD0(GetNumMips,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetRequiredMip,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetDeviceDataSize,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetDataSize,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetTextureType,
|
||||
const ETEX_Type());
|
||||
MOCK_METHOD1(SetTextureType,
|
||||
void(ETEX_Type type));
|
||||
MOCK_CONST_METHOD0(IsTextureLoaded,
|
||||
const bool());
|
||||
MOCK_METHOD4(PrecacheAsynchronously,
|
||||
void(float, int, int, int));
|
||||
MOCK_METHOD4(GetData32,
|
||||
uint8 * (int nSide, int nLevel, uint8 * pDst, ETEX_Format eDstFormat));
|
||||
MOCK_METHOD1(SetFilter,
|
||||
bool(int nFilter));
|
||||
MOCK_METHOD1(SetClamp,
|
||||
void(bool bEnable));
|
||||
MOCK_CONST_METHOD0(GetAvgBrightness,
|
||||
float());
|
||||
MOCK_CONST_METHOD1(StreamCalculateMipsSigned,
|
||||
int(float fMipFactor));
|
||||
MOCK_CONST_METHOD0(GetStreamableMipNumber,
|
||||
int());
|
||||
MOCK_CONST_METHOD1(GetStreamableMemoryUsage,
|
||||
int(int nStartMip));
|
||||
MOCK_CONST_METHOD0(GetMinLoadedMip,
|
||||
int());
|
||||
MOCK_METHOD2(Readback,
|
||||
void(AZ::u32 subresourceIndex, StagingHook callback));
|
||||
MOCK_METHOD0(Reload,
|
||||
bool());
|
||||
MOCK_CONST_METHOD0(GetFormatName,
|
||||
const char*());
|
||||
MOCK_CONST_METHOD0(GetTypeName,
|
||||
const char*());
|
||||
MOCK_CONST_METHOD0(IsStreamedVirtual,
|
||||
const bool());
|
||||
MOCK_CONST_METHOD0(IsShared,
|
||||
const bool());
|
||||
MOCK_CONST_METHOD0(IsStreamable,
|
||||
const bool());
|
||||
MOCK_CONST_METHOD1(IsStreamedIn,
|
||||
bool(const int nMinPrecacheRoundIds[2]));
|
||||
MOCK_CONST_METHOD0(GetAccessFrameId,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetTextureDstFormat,
|
||||
const ETEX_Format());
|
||||
MOCK_CONST_METHOD0(GetTextureSrcFormat,
|
||||
const ETEX_Format());
|
||||
MOCK_CONST_METHOD0(IsPostponed,
|
||||
bool());
|
||||
MOCK_CONST_METHOD1(IsParticularMipStreamed,
|
||||
const bool(float fMipFactor));
|
||||
MOCK_METHOD3(GetLowResSystemCopy,
|
||||
const ColorB * (uint16 & nWidth, uint16 & nHeight, int** ppLowResSystemCopyAtlasId));
|
||||
MOCK_METHOD1(SetKeepSystemCopy,
|
||||
void(bool bKeepSystemCopy));
|
||||
MOCK_METHOD8(UpdateTextureRegion,
|
||||
void(const uint8_t * data, int nX, int nY, int nZ, int USize, int VSize, int ZSize, ETEX_Format eTFSrc));
|
||||
MOCK_CONST_METHOD0(GetDevTexture,
|
||||
CDeviceTexture * ());
|
||||
};
|
||||
|
||||
class ITextureLoadHandlerMock
|
||||
: public ITextureLoadHandler
|
||||
{
|
||||
public:
|
||||
MOCK_METHOD2(LoadTextureData,
|
||||
bool(const char* path, STextureLoadData & loadData));
|
||||
MOCK_CONST_METHOD1(SupportsExtension,
|
||||
bool(const char* ext));
|
||||
MOCK_METHOD0(Update,
|
||||
void());
|
||||
};
|
||||
|
||||
class IDynTextureMock
|
||||
: public IDynTexture
|
||||
{
|
||||
public:
|
||||
MOCK_METHOD0(Release,
|
||||
void());
|
||||
MOCK_METHOD4(GetSubImageRect,
|
||||
void(uint32 & nX, uint32 & nY, uint32 & nWidth, uint32 & nHeight));
|
||||
MOCK_METHOD4(GetImageRect,
|
||||
void(uint32 & nX, uint32 & nY, uint32 & nWidth, uint32 & nHeight));
|
||||
MOCK_METHOD0(GetTextureID,
|
||||
int());
|
||||
MOCK_METHOD0(Lock,
|
||||
void());
|
||||
MOCK_METHOD0(UnLock,
|
||||
void());
|
||||
MOCK_METHOD0(GetWidth,
|
||||
int());
|
||||
MOCK_METHOD0(GetHeight,
|
||||
int());
|
||||
MOCK_METHOD0(IsValid,
|
||||
bool());
|
||||
MOCK_CONST_METHOD0(GetFlags,
|
||||
uint8());
|
||||
MOCK_METHOD1(SetFlags,
|
||||
void(uint8 flags));
|
||||
MOCK_METHOD2(Update,
|
||||
bool(int nNewWidth, int nNewHeight));
|
||||
MOCK_METHOD2(Apply,
|
||||
void(int, int));
|
||||
MOCK_METHOD0(ClearRT,
|
||||
bool());
|
||||
MOCK_METHOD4(SetRT,
|
||||
bool(int nRT, bool bPush, struct SDepthTexture* pDepthSurf, bool bScreenVP));
|
||||
MOCK_METHOD0(SetRectStates,
|
||||
bool());
|
||||
MOCK_METHOD2(RestoreRT,
|
||||
bool(int nRT, bool bPop));
|
||||
MOCK_METHOD0(GetTexture,
|
||||
ITexture * ());
|
||||
MOCK_METHOD0(SetUpdateMask,
|
||||
void());
|
||||
MOCK_METHOD0(ResetUpdateMask,
|
||||
void());
|
||||
MOCK_METHOD0(IsSecondFrame,
|
||||
bool());
|
||||
MOCK_METHOD2(GetImageData32,
|
||||
bool(uint8 * pData, int nDataSize));
|
||||
};
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#ifndef CRYINCLUDE_CRYSYSTEM_ITIMERMOCK_H
|
||||
#define CRYINCLUDE_CRYSYSTEM_ITIMERMOCK_H
|
||||
#pragma once
|
||||
|
||||
#include <ISerialize.h>
|
||||
#include <ITimer.h>
|
||||
#include <AzTest/AzTest.h>
|
||||
|
||||
// Implements all common timing routines
|
||||
class TimerMock
|
||||
: public ITimer
|
||||
{
|
||||
public:
|
||||
MOCK_METHOD0(ResetTimer, void());
|
||||
MOCK_METHOD0(UpdateOnFrameStart, void());
|
||||
MOCK_CONST_METHOD1(GetCurrTime, float(ETimer which));
|
||||
MOCK_CONST_METHOD0(GetAsyncTime, CTimeValue());
|
||||
MOCK_METHOD0(GetAsyncCurTime, float());
|
||||
MOCK_CONST_METHOD1(GetFrameTime, float(ETimer which));
|
||||
MOCK_CONST_METHOD0(GetRealFrameTime, float());
|
||||
MOCK_CONST_METHOD0(GetTimeScale, float());
|
||||
MOCK_CONST_METHOD1(GetTimeScale, float(uint32 channel));
|
||||
MOCK_METHOD2(SetTimeScale, void(float scale, uint32 channel));
|
||||
MOCK_METHOD0(ClearTimeScales, void());
|
||||
MOCK_METHOD1(EnableTimer, void(bool bEnable));
|
||||
MOCK_METHOD0(GetFrameRate, float());
|
||||
MOCK_METHOD2(GetProfileFrameBlending, float(float* pfBlendTime, int* piBlendMode));
|
||||
MOCK_METHOD1(Serialize, void(TSerialize ser));
|
||||
MOCK_CONST_METHOD0(IsTimerEnabled, bool());
|
||||
MOCK_METHOD2(PauseTimer, bool(ETimer which, bool bPause));
|
||||
MOCK_METHOD1(IsTimerPaused, bool(ETimer which));
|
||||
MOCK_METHOD2(SetTimer, bool(ETimer which, float timeInSeconds));
|
||||
MOCK_METHOD2(SecondsToDateUTC, void(time_t time, struct tm& outDateUTC));
|
||||
MOCK_METHOD1(DateToSecondsUTC, time_t(struct tm& timePtr));
|
||||
MOCK_METHOD1(TicksToSeconds, float(int64 ticks));
|
||||
MOCK_METHOD0(GetTicksPerSecond, int64());
|
||||
|
||||
MOCK_CONST_METHOD1(GetFrameStartTime, const CTimeValue&(ETimer which));
|
||||
MOCK_METHOD0(CreateNewTimer, ITimer * ());
|
||||
|
||||
MOCK_METHOD2(EnableFixedTimeMode, void(bool enable, float timeStep));
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYSYSTEM_ITIMERMOCK_H
|
||||
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <ITimer.h>
|
||||
|
||||
//! Simple stub timer that exposes a single simple interface for setting the current time.
|
||||
class StubTimer
|
||||
: public ITimer
|
||||
{
|
||||
public:
|
||||
// Stub methods
|
||||
void SetTime(float seconds)
|
||||
{
|
||||
m_frameStartTime.SetSeconds(seconds);
|
||||
}
|
||||
//~Stub methods
|
||||
|
||||
StubTimer(float frameTime)
|
||||
: m_frameTime(frameTime)
|
||||
, m_frameRate(1.0f / frameTime)
|
||||
, m_frameStartTime(0.0f)
|
||||
{
|
||||
}
|
||||
virtual ~StubTimer() {};
|
||||
|
||||
// ITimer
|
||||
void ResetTimer() override {}
|
||||
void UpdateOnFrameStart() override {}
|
||||
float GetCurrTime([[maybe_unused]] ETimer which = ETIMER_GAME) const override
|
||||
{
|
||||
// return the same as the frame start time
|
||||
return m_frameStartTime.GetSeconds();
|
||||
}
|
||||
const CTimeValue& GetFrameStartTime([[maybe_unused]] ETimer which = ETIMER_GAME) const override
|
||||
{
|
||||
return m_frameStartTime;
|
||||
}
|
||||
CTimeValue GetAsyncTime() const override
|
||||
{
|
||||
return m_frameStartTime;
|
||||
}
|
||||
float GetAsyncCurTime() override
|
||||
{
|
||||
return m_frameStartTime.GetSeconds();
|
||||
}
|
||||
float GetFrameTime([[maybe_unused]] ETimer which = ETIMER_GAME) const override
|
||||
{
|
||||
return m_frameTime;
|
||||
}
|
||||
float GetRealFrameTime() const override
|
||||
{
|
||||
return m_frameTime;
|
||||
}
|
||||
float GetTimeScale() const override
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
float GetTimeScale([[maybe_unused]] uint32 channel) const override
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
void ClearTimeScales() override {}
|
||||
void SetTimeScale([[maybe_unused]] float s, [[maybe_unused]] uint32 channel = 0) override {}
|
||||
void EnableTimer([[maybe_unused]] bool bEnable) override {}
|
||||
bool IsTimerEnabled() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
float GetFrameRate() override
|
||||
{
|
||||
return m_frameRate;
|
||||
}
|
||||
float GetProfileFrameBlending([[maybe_unused]] float* pfBlendTime = 0, [[maybe_unused]] int* piBlendMode = 0) override
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
void Serialize([[maybe_unused]] TSerialize ser) override {}
|
||||
bool PauseTimer([[maybe_unused]] ETimer which, [[maybe_unused]] bool bPause) override { return false; }
|
||||
bool IsTimerPaused([[maybe_unused]] ETimer which) override { return false; }
|
||||
bool SetTimer([[maybe_unused]] ETimer which, [[maybe_unused]] float timeInSeconds) override { return false; }
|
||||
void SecondsToDateUTC([[maybe_unused]] time_t time, [[maybe_unused]] struct tm& outDateUTC) override {}
|
||||
time_t DateToSecondsUTC([[maybe_unused]] struct tm& timePtr) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
float TicksToSeconds([[maybe_unused]] int64 ticks) override
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
int64 GetTicksPerSecond() override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
ITimer* CreateNewTimer() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
void EnableFixedTimeMode([[maybe_unused]] bool enable, [[maybe_unused]] float timeStep) override {}
|
||||
// ~ITimer
|
||||
|
||||
private:
|
||||
CTimeValue m_frameStartTime;
|
||||
float m_frameTime;
|
||||
float m_frameRate;
|
||||
};
|
||||
Reference in New Issue
Block a user