Remove lots of unused things from CrySystem (#765)
Remove lots of unused things from CrySystem
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
// Description : Provides the interface for the lz4 hc decompress wrapper
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_ILZ4DECOMPRESSOR_H
|
||||
#define CRYINCLUDE_CRYCOMMON_ILZ4DECOMPRESSOR_H
|
||||
#pragma once
|
||||
|
||||
|
||||
struct ILZ4Decompressor
|
||||
{
|
||||
protected:
|
||||
virtual ~ILZ4Decompressor() {}; // use Release()
|
||||
|
||||
public:
|
||||
virtual bool DecompressData(const char* pIn, char* pOut, const uint outputSize) const = 0;
|
||||
|
||||
virtual void Release() = 0;
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_ILZ4DECOMPRESSOR_H
|
||||
@@ -76,14 +76,9 @@ struct IViewSystem;
|
||||
class ICrySizer;
|
||||
class IXMLBinarySerializer;
|
||||
struct IReadWriteXMLSink;
|
||||
struct ITextModeConsole;
|
||||
struct IAVI_Reader;
|
||||
class CPNoise3;
|
||||
struct ILocalizationManager;
|
||||
struct IZLibCompressor;
|
||||
struct IZLibDecompressor;
|
||||
struct ILZ4Decompressor;
|
||||
class IZStdDecompressor;
|
||||
struct IOutputPrintSink;
|
||||
struct IWindowMessageHandler;
|
||||
|
||||
@@ -524,7 +519,6 @@ struct SSystemInitParams
|
||||
ISystemUserCallback* pUserCallback;
|
||||
const char* sLogFileName; // File name to use for log.
|
||||
bool autoBackupLogs; // if true, logs will be automatically backed up each startup
|
||||
IValidator* pValidator; // You can specify different validator object to use by System.
|
||||
IOutputPrintSink* pPrintSync; // Print Sync which can be used to catch all output from engine
|
||||
char szSystemCmdLine[2048]; // Command line.
|
||||
|
||||
@@ -554,7 +548,6 @@ struct SSystemInitParams
|
||||
pUserCallback = NULL;
|
||||
sLogFileName = NULL;
|
||||
autoBackupLogs = true;
|
||||
pValidator = NULL;
|
||||
pPrintSync = NULL;
|
||||
memset(szSystemCmdLine, 0, sizeof(szSystemCmdLine));
|
||||
|
||||
@@ -828,14 +821,6 @@ struct ISystem
|
||||
// Retrieve the name of the user currently logged in to the computer.
|
||||
virtual const char* GetUserName() = 0;
|
||||
|
||||
// Summary:
|
||||
// Gets current supported CPU features flags. (CPUF_SSE, CPUF_SSE2, CPUF_3DNOW, CPUF_MMX)
|
||||
virtual int GetCPUFlags() = 0;
|
||||
|
||||
// Summary:
|
||||
// Gets number of CPUs
|
||||
virtual int GetLogicalCPUCount() = 0;
|
||||
|
||||
// Summary:
|
||||
// Quits the application.
|
||||
virtual void Quit() = 0;
|
||||
@@ -852,13 +837,6 @@ struct ISystem
|
||||
|
||||
virtual bool IsRelaunch() const = 0;
|
||||
|
||||
// Summary:
|
||||
// Displays an error message to display info for certain time
|
||||
// Arguments:
|
||||
// acMessage - Message to show
|
||||
// fTime - Amount of seconds to show onscreen
|
||||
virtual void DisplayErrorMessage(const char* acMessage, float fTime, const float* pfColor = 0, bool bHardError = true) = 0;
|
||||
|
||||
// Description:
|
||||
// Displays error message.
|
||||
// Logs it to console and file and error message box then terminates execution.
|
||||
@@ -889,14 +867,9 @@ struct ISystem
|
||||
// return the related subsystem interface
|
||||
|
||||
//
|
||||
virtual IZLibCompressor* GetIZLibCompressor() = 0;
|
||||
virtual IZLibDecompressor* GetIZLibDecompressor() = 0;
|
||||
virtual ILZ4Decompressor* GetLZ4Decompressor() = 0;
|
||||
virtual IZStdDecompressor* GetZStdDecompressor() = 0;
|
||||
virtual IViewSystem* GetIViewSystem() = 0;
|
||||
virtual ILevelSystem* GetILevelSystem() = 0;
|
||||
virtual INameTable* GetINameTable() = 0;
|
||||
virtual IValidator* GetIValidator() = 0;
|
||||
virtual ICmdLine* GetICmdLine() = 0;
|
||||
virtual ILog* GetILog() = 0;
|
||||
virtual AZ::IO::IArchive* GetIPak() = 0;
|
||||
@@ -917,7 +890,6 @@ struct ISystem
|
||||
virtual bool GetForceNonDevMode() const = 0;
|
||||
virtual bool WasInDevMode() const = 0;
|
||||
virtual bool IsDevMode() const = 0;
|
||||
virtual bool IsMODValid(const char* szMODName) const = 0;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -974,13 +946,6 @@ struct ISystem
|
||||
// Gets build version.
|
||||
virtual const SFileVersion& GetBuildVersion() = 0;
|
||||
|
||||
// Summary:
|
||||
// Data compression
|
||||
//##@{
|
||||
virtual bool CompressDataBlock(const void* input, size_t inputSize, void* output, size_t& outputSize, int level = 3) = 0;
|
||||
virtual bool DecompressDataBlock(const void* input, size_t inputSize, void* output, size_t& outputSize) = 0;
|
||||
//##@}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Configuration.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -1002,21 +967,8 @@ struct ISystem
|
||||
// pCallback - 0 means normal LoadConfigVar behaviour is used
|
||||
virtual void LoadConfiguration(const char* sFilename, ILoadConfigurationEntrySink* pSink = 0, bool warnIfMissing = true) = 0;
|
||||
|
||||
// Summary:
|
||||
// Retrieves current configuration specification for client or server.
|
||||
// Arguments:
|
||||
// bClient - If true returns local client config spec, if false returns server config spec.
|
||||
virtual ESystemConfigSpec GetConfigSpec(bool bClient = true) = 0;
|
||||
|
||||
virtual ESystemConfigSpec GetMaxConfigSpec() const = 0;
|
||||
|
||||
// Summary:
|
||||
// Changes current configuration specification for client or server.
|
||||
// Arguments:
|
||||
// bClient - If true changes client config spec (sys_spec variable changed),
|
||||
// if false changes only server config spec (as known on the client).
|
||||
virtual void SetConfigSpec(ESystemConfigSpec spec, ESystemConfigPlatform platform, bool bClient) = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Summary:
|
||||
@@ -1028,10 +980,6 @@ struct ISystem
|
||||
virtual void SetConfigPlatform(ESystemConfigPlatform platform) = 0;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Summary:
|
||||
// Detects and set optimal spec.
|
||||
virtual void AutoDetectSpec(bool detectResolution) = 0;
|
||||
|
||||
// Summary:
|
||||
// Query if system is now paused.
|
||||
// Pause flag is set when calling system update with pause mode.
|
||||
@@ -1041,8 +989,6 @@ struct ISystem
|
||||
// Retrieves localized strings manager interface.
|
||||
virtual ILocalizationManager* GetLocalizationManager() = 0;
|
||||
|
||||
virtual ITextModeConsole* GetITextModeConsole() = 0;
|
||||
|
||||
// Summary:
|
||||
// Retrieves the perlin noise singleton instance.
|
||||
virtual CPNoise3* GetNoiseGen() = 0;
|
||||
@@ -1133,22 +1079,10 @@ struct ISystem
|
||||
virtual ESystemGlobalState GetSystemGlobalState(void) = 0;
|
||||
virtual void SetSystemGlobalState(ESystemGlobalState systemGlobalState) = 0;
|
||||
|
||||
// Summary:
|
||||
// Asynchronous memcpy
|
||||
// Note sync variable will be incremented (in calling thread) before job starts
|
||||
// and decremented when job finishes. Multiple async copies can therefore be
|
||||
// tied to the same sync variable, therefore it's advised to wait for completion with
|
||||
// while(*sync) (yield());
|
||||
virtual void AsyncMemcpy(void* dst, const void* src, size_t size, int nFlags, volatile int* sync) = 0;
|
||||
// </interfuscator:shuffle>
|
||||
|
||||
#if !defined(_RELEASE)
|
||||
virtual bool IsSavingResourceList() const = 0;
|
||||
#endif
|
||||
|
||||
// Initializes Steam if needed and returns if it was successful
|
||||
virtual bool SteamInit() = 0;
|
||||
|
||||
// Summary:
|
||||
// Gets the root window message handler function
|
||||
// The returned pointer is platform-specific:
|
||||
@@ -1752,44 +1686,6 @@ inline void CryLogAlways(const char* format, ...)
|
||||
|
||||
#endif // EXCLUDE_NORMAL_LOG
|
||||
|
||||
/*****************************************************
|
||||
ASYNC MEMCPY FUNCTIONS
|
||||
*****************************************************/
|
||||
|
||||
// Complex delegation required because it is not really easy to
|
||||
// export a external standalone symbol like a memcpy function when
|
||||
// building with modules. Dll pay an extra indirection cost for calling this
|
||||
// function.
|
||||
#if !defined(AZ_MONOLITHIC_BUILD)
|
||||
# define CRY_ASYNC_MEMCPY_DELEGATE_TO_CRYSYSTEM
|
||||
#endif
|
||||
#define CRY_ASYNC_MEMCPY_API extern "C"
|
||||
|
||||
// Note sync variable will be incremented (in calling thread) before job starts
|
||||
// and decremented when job finishes. Multiple async copies can therefore be
|
||||
// tied to the same sync variable, therefore wait for completion with
|
||||
// while(*sync) (yield());
|
||||
#if defined(CRY_ASYNC_MEMCPY_DELEGATE_TO_CRYSYSTEM)
|
||||
inline void cryAsyncMemcpy(
|
||||
void* dst
|
||||
, const void* src
|
||||
, size_t size
|
||||
, int nFlags
|
||||
, volatile int* sync)
|
||||
{
|
||||
GetISystem()->AsyncMemcpy(dst, src, size, nFlags, sync);
|
||||
}
|
||||
# else
|
||||
CRY_ASYNC_MEMCPY_API void cryAsyncMemcpy(
|
||||
void* dst
|
||||
, const void* src
|
||||
, size_t size
|
||||
, int nFlags
|
||||
, volatile int* sync);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Additional headers.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
// Description : Allows creation of text mode displays the for dedicated server
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_ITEXTMODECONSOLE_H
|
||||
#define CRYINCLUDE_CRYCOMMON_ITEXTMODECONSOLE_H
|
||||
#pragma once
|
||||
|
||||
|
||||
struct ITextModeConsole
|
||||
{
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~ITextModeConsole() {}
|
||||
virtual Vec2_tpl<int> BeginDraw() = 0;
|
||||
virtual void PutText(int x, int y, const char* msg) = 0;
|
||||
virtual void EndDraw() = 0;
|
||||
virtual void OnShutdown() = 0;
|
||||
|
||||
virtual void SetTitle([[maybe_unused]] const char* title) {}
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_ITEXTMODECONSOLE_H
|
||||
@@ -1,219 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_IZLIBCOMPRESSOR_H
|
||||
#define CRYINCLUDE_CRYCOMMON_IZLIBCOMPRESSOR_H
|
||||
#pragma once
|
||||
|
||||
|
||||
/*
|
||||
wrapper interface for the zlib compression / deflate interface
|
||||
|
||||
supports multiple compression streams with an async compatible wrapper
|
||||
|
||||
Gotchas:
|
||||
the ptr to the input data must remain valid whilst the stream is deflating
|
||||
the ptr to the output buffer must remain valid whilst the stream is deflating
|
||||
|
||||
****************************************************************************************
|
||||
|
||||
usage example:
|
||||
|
||||
IZLibCompressor *pComp=GetISystem()->GetIZLibCompressor();
|
||||
// see deflateInit2() documentation zlib manual for more info on the parameters here
|
||||
// this initializes the stream to produce a gzip format block with fairly low memory requirements
|
||||
IZLibDeflateStream *pStream=pComp->CreateDeflateStream(2,eZMeth_Deflated,24,3,eZStrat_Default,eZFlush_NoFlush);
|
||||
char *pOutput=new char[512]; // arbitrary size
|
||||
const char *pInputData="This is an example piece of data that is to be compressed. It can be any arbitrary block of binary data - not just text";
|
||||
const int inputBlockSize=16; // to simulate streaming of input, this example provides the input in 16 byte blocks
|
||||
int totalInput=sizeof(pInputData);
|
||||
int bytesInput=0;
|
||||
bool done=false;
|
||||
FILE *outputFile=fopen("myfile.gz","rb");
|
||||
|
||||
do
|
||||
{
|
||||
EZDeflateState state=pStream->GetState();
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case eZDefState_AwaitingInput:
|
||||
// 'stream' input data, there is no restriction on the block size you can input, if all the data is available immediately, input all of it at once
|
||||
{
|
||||
int inputSize=min(inputBlockSize,totalInput-bytesInput);
|
||||
|
||||
if (inputSize<=0)
|
||||
{
|
||||
pStream->EndInput();
|
||||
}
|
||||
else
|
||||
{
|
||||
pStream->Input(pInputData+bytesInput,inputSize);
|
||||
bytesInput+=inputSize;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case eZDefState_Deflating:
|
||||
// do something more interesting... like getting out of this loop and running the rest of your game...
|
||||
break;
|
||||
|
||||
case eZDefState_ConsumeOutput:
|
||||
// stream output to a file
|
||||
{
|
||||
int bytesToOutput=pStream->GetBytesOutput();
|
||||
|
||||
if (bytesToOutput>0)
|
||||
{
|
||||
fwrite(pOutput,1,bytesToOutput,outputFile);
|
||||
}
|
||||
|
||||
pStream->SetOutputBuffer(pOutput,sizeof(pOutput));
|
||||
}
|
||||
break;
|
||||
|
||||
case eZDefState_Finished:
|
||||
case ezDefState_Error:
|
||||
done=true;
|
||||
break;
|
||||
}
|
||||
|
||||
} while (!done);
|
||||
|
||||
fclose(outputFile);
|
||||
|
||||
pStream->Release();
|
||||
delete [] pOutput;
|
||||
|
||||
****************************************************************************************/
|
||||
|
||||
// don't change the order of these zlib wrapping enum values without updating the mapping
|
||||
// implementation in CZLibCompressorStream
|
||||
enum EZLibStrategy
|
||||
{
|
||||
eZStrat_Default, // Z_DEFAULT_STRATEGY
|
||||
eZStrat_Filtered, // Z_FILTERED
|
||||
eZStrat_HuffmanOnly, // Z_HUFFMAN_ONLY
|
||||
eZStrat_RLE // Z_RLE
|
||||
};
|
||||
enum EZLibMethod
|
||||
{
|
||||
eZMeth_Deflated // Z_DEFLATED
|
||||
};
|
||||
enum EZLibFlush
|
||||
{
|
||||
eZFlush_NoFlush, // Z_NO_FLUSH
|
||||
eZFlush_PartialFlush, // Z_PARTIAL_FLUSH
|
||||
eZFlush_SyncFlush, // Z_SYNC_FLUSH
|
||||
eZFlush_FullFlush, // Z_FULL_FLUSH
|
||||
};
|
||||
|
||||
enum EZDeflateState
|
||||
{
|
||||
eZDefState_AwaitingInput, // caller must call Input() or Finish() to continue
|
||||
eZDefState_Deflating, // caller must wait
|
||||
eZDefState_ConsumeOutput, // caller must consume output and then call SetOutputBuffer() to continue
|
||||
eZDefState_Finished, // stream finished, caller must call Release() to destroy stream
|
||||
eZDefState_Error // error has occurred and the stream has been closed and will no longer compress
|
||||
};
|
||||
|
||||
struct IZLibDeflateStream
|
||||
{
|
||||
protected:
|
||||
virtual ~IZLibDeflateStream() {}; // use Release()
|
||||
|
||||
public:
|
||||
struct SStats
|
||||
{
|
||||
int bytesInput;
|
||||
int bytesOutput;
|
||||
int curMemoryUsed;
|
||||
int peakMemoryUsed;
|
||||
};
|
||||
|
||||
// <interfuscator:shuffle>
|
||||
// Description:
|
||||
// Specifies the output buffer for the deflate operation
|
||||
// Should be set before providing input
|
||||
// The specified buffer must remain valid (ie do not free) whilst compression is in progress (state == eZDefState_Deflating)
|
||||
virtual void SetOutputBuffer(char* pInBuffer, int inSize) = 0;
|
||||
|
||||
// Description:
|
||||
// Returns the number of bytes from the output buffer that are ready to be consumed. After consuming any output, you should call SetOutputBuffer() again to mark the buffer as available
|
||||
virtual int GetBytesOutput() = 0;
|
||||
|
||||
// Description:
|
||||
// Begins compressing the source data pInSource of length inSourceSize to a previously specified output buffer
|
||||
// Only valid to be called if the stream is in state eZDefState_AwaitingInput
|
||||
// The specified buffer must remain valid (ie do not free) whilst compression is in progress (state == eZDefState_Deflating)
|
||||
virtual void Input(const char* pInSource, int inSourceSize) = 0;
|
||||
|
||||
// Description:
|
||||
// Finishes the compression, causing all data to be flushed to the output buffer
|
||||
// Once called no more data can be input
|
||||
// After calling the caller must wait until GetState() reutrns eZDefState_Finished
|
||||
virtual void EndInput() = 0;
|
||||
|
||||
// Description:
|
||||
// Returns the state of the stream,
|
||||
virtual EZDeflateState GetState() = 0;
|
||||
|
||||
// Description:
|
||||
// Gets stats on deflate stream, valid to call at anytime
|
||||
virtual void GetStats(SStats* pOutStats) = 0;
|
||||
|
||||
// Description:
|
||||
// Deletes the deflate stream. Will assert if stream is in an invalid state to be released (in state eZDefState_Deflating)
|
||||
virtual void Release() = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
// md5 support structure
|
||||
struct SMD5Context
|
||||
{
|
||||
uint32 buf[4];
|
||||
uint32 bits[2];
|
||||
unsigned char in[64];
|
||||
};
|
||||
|
||||
struct IZLibCompressor
|
||||
{
|
||||
protected:
|
||||
virtual ~IZLibCompressor() {}; // use Release()
|
||||
|
||||
public:
|
||||
// <interfuscator:shuffle>
|
||||
// Description:
|
||||
// Creates a deflate stream to compress data using zlib
|
||||
// See documentation for zlib deflateInit2() for usage details
|
||||
// inFlushMethod is passed to calls to zlib deflate(), see zlib docs on deflate() for more details
|
||||
virtual IZLibDeflateStream* CreateDeflateStream(int inLevel, EZLibMethod inMethod, int inWindowBits, int inMemLevel, EZLibStrategy inStrategy, EZLibFlush inFlushMethod) = 0;
|
||||
|
||||
virtual void Release() = 0;
|
||||
|
||||
// Description:
|
||||
// Initializes an MD5 context
|
||||
virtual void MD5Init(SMD5Context* pIOCtx) = 0;
|
||||
|
||||
// Description:
|
||||
// Digests some data into an existing MD5 context
|
||||
virtual void MD5Update(SMD5Context* pIOCtx, const char* pInBuff, unsigned int len) = 0;
|
||||
|
||||
// Description:
|
||||
// Closes the MD5 context and extract the final 16 byte MD5 digest value
|
||||
virtual void MD5Final(SMD5Context * pIOCtx, char outDigest[16]) = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_IZLIBCOMPRESSOR_H
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
class IZStdDecompressor
|
||||
{
|
||||
public:
|
||||
virtual bool DecompressData(const char* pIn, const uint inputSize, char* pOut, const uint outputSize) = 0;
|
||||
virtual void Release() = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IZStdDecompressor() = default; // use Release()
|
||||
};
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
// Description : Provides the interface for the zlib inflate wrapper
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_IZLIBDECOMPRESSOR_H
|
||||
#define CRYINCLUDE_CRYCOMMON_IZLIBDECOMPRESSOR_H
|
||||
#pragma once
|
||||
|
||||
|
||||
enum EZInflateState
|
||||
{
|
||||
eZInfState_AwaitingInput, // caller must call Input() to continue
|
||||
eZInfState_Inflating, // caller must wait
|
||||
eZInfState_ConsumeOutput, // caller must consume output and then call SetOutputBuffer() to continue
|
||||
eZInfState_Finished, // caller must call Release()
|
||||
eZInfState_Error // error has occurred and the stream has been closed and will no longer compress
|
||||
};
|
||||
|
||||
struct IZLibInflateStream
|
||||
{
|
||||
protected:
|
||||
virtual ~IZLibInflateStream() {}; // use Release()
|
||||
|
||||
public:
|
||||
struct SStats
|
||||
{
|
||||
int bytesInput;
|
||||
int bytesOutput;
|
||||
int curMemoryUsed;
|
||||
int peakMemoryUsed;
|
||||
};
|
||||
|
||||
// Description:
|
||||
// Specifies the output buffer for the inflate operation
|
||||
// Should be set before providing input
|
||||
// The specified buffer must remain valid (ie do not free) whilst compression is in progress (state == eZInfState_Inflating)
|
||||
virtual void SetOutputBuffer(char* pInBuffer, unsigned int inSize) = 0;
|
||||
|
||||
// Description:
|
||||
// Returns the number of bytes from the output buffer that are ready to be consumed. After consuming any output, you should call SetOutputBuffer() again to mark the buffer as available
|
||||
virtual unsigned int GetBytesOutput() = 0;
|
||||
|
||||
// Description:
|
||||
// Begins decompressing the source data pInSource of length inSourceSize to a previously specified output buffer
|
||||
// Only valid to be called if the stream is in state eZInfState_AwaitingInput
|
||||
// The specified buffer must remain valid (ie do not free) whilst compression is in progress (state == eZInfState_Inflating)
|
||||
virtual void Input(const char* pInSource, unsigned int inSourceSize) = 0;
|
||||
|
||||
// Description:
|
||||
// Finishes the compression, causing all data to be flushed to the output buffer
|
||||
// Once called no more data can be input
|
||||
// After calling the caller must wait until GetState() reuturns eZInfState_Finished
|
||||
virtual void EndInput() = 0;
|
||||
|
||||
// Description:
|
||||
// Returns the state of the stream,
|
||||
virtual EZInflateState GetState() = 0;
|
||||
|
||||
// Description:
|
||||
// Gets stats on inflate stream, valid to call at anytime
|
||||
virtual void GetStats(SStats* pOutStats) = 0;
|
||||
|
||||
// Description:
|
||||
// Deletes the inflate stream. Will assert if stream is in an invalid state to be released (in state eZInfState_Inflating)
|
||||
virtual void Release() = 0;
|
||||
};
|
||||
|
||||
struct IZLibDecompressor
|
||||
{
|
||||
protected:
|
||||
virtual ~IZLibDecompressor() {}; // use Release()
|
||||
|
||||
public:
|
||||
// Description:
|
||||
// Creates a inflate stream to decompress data using zlib
|
||||
virtual IZLibInflateStream* CreateInflateStream() = 0;
|
||||
|
||||
virtual void Release() = 0;
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_IZLIBDECOMPRESSOR_H
|
||||
|
||||
@@ -39,10 +39,6 @@ public:
|
||||
void());
|
||||
MOCK_METHOD0(GetUserName,
|
||||
const char*());
|
||||
MOCK_METHOD0(GetCPUFlags,
|
||||
int());
|
||||
MOCK_METHOD0(GetLogicalCPUCount,
|
||||
int());
|
||||
MOCK_METHOD0(Quit,
|
||||
void());
|
||||
MOCK_METHOD1(Relaunch,
|
||||
@@ -55,8 +51,6 @@ public:
|
||||
int());
|
||||
MOCK_CONST_METHOD0(IsRelaunch,
|
||||
bool());
|
||||
MOCK_METHOD4(DisplayErrorMessage,
|
||||
void(const char*, float, const float*, bool));
|
||||
|
||||
void FatalError([[maybe_unused]] const char* sFormat, ...) override {}
|
||||
void ReportBug([[maybe_unused]] const char* sFormat, ...) override {}
|
||||
@@ -70,22 +64,12 @@ public:
|
||||
int(const char* text, const char* caption, unsigned int uType));
|
||||
MOCK_METHOD1(CheckLogVerbosity,
|
||||
bool(int verbosity));
|
||||
MOCK_METHOD0(GetIZLibCompressor,
|
||||
IZLibCompressor * ());
|
||||
MOCK_METHOD0(GetIZLibDecompressor,
|
||||
IZLibDecompressor * ());
|
||||
MOCK_METHOD0(GetLZ4Decompressor,
|
||||
ILZ4Decompressor * ());
|
||||
MOCK_METHOD0(GetZStdDecompressor,
|
||||
IZStdDecompressor * ());
|
||||
MOCK_METHOD0(GetIViewSystem,
|
||||
IViewSystem * ());
|
||||
MOCK_METHOD0(GetILevelSystem,
|
||||
ILevelSystem * ());
|
||||
MOCK_METHOD0(GetINameTable,
|
||||
INameTable * ());
|
||||
MOCK_METHOD0(GetIValidator,
|
||||
IValidator * ());
|
||||
MOCK_METHOD0(GetICmdLine,
|
||||
ICmdLine * ());
|
||||
MOCK_METHOD0(GetILog,
|
||||
@@ -116,8 +100,6 @@ public:
|
||||
bool());
|
||||
MOCK_CONST_METHOD0(IsDevMode,
|
||||
bool());
|
||||
MOCK_CONST_METHOD1(IsMODValid,
|
||||
bool(const char* szMODName));
|
||||
MOCK_METHOD3(CreateXmlNode,
|
||||
XmlNodeRef(const char*, bool, bool));
|
||||
MOCK_METHOD4(LoadXmlFromBuffer,
|
||||
@@ -147,11 +129,6 @@ public:
|
||||
MOCK_METHOD0(GetBuildVersion,
|
||||
const SFileVersion&());
|
||||
|
||||
MOCK_METHOD5(CompressDataBlock,
|
||||
bool(const void*, size_t, void*, size_t &, int));
|
||||
|
||||
MOCK_METHOD4(DecompressDataBlock,
|
||||
bool(const void* input, size_t inputSize, void* output, size_t & outputSize));
|
||||
MOCK_METHOD1(AddCVarGroupDirectory,
|
||||
void(const string&));
|
||||
MOCK_METHOD0(SaveConfiguration,
|
||||
@@ -159,24 +136,16 @@ public:
|
||||
MOCK_METHOD3(LoadConfiguration,
|
||||
void(const char*, ILoadConfigurationEntrySink*, bool));
|
||||
|
||||
MOCK_METHOD1(GetConfigSpec,
|
||||
ESystemConfigSpec(bool));
|
||||
MOCK_CONST_METHOD0(GetMaxConfigSpec,
|
||||
ESystemConfigSpec());
|
||||
MOCK_METHOD3(SetConfigSpec,
|
||||
void(ESystemConfigSpec spec, ESystemConfigPlatform platform, bool bClient));
|
||||
MOCK_CONST_METHOD0(GetConfigPlatform,
|
||||
ESystemConfigPlatform());
|
||||
MOCK_METHOD1(SetConfigPlatform,
|
||||
void(ESystemConfigPlatform platform));
|
||||
MOCK_METHOD1(AutoDetectSpec,
|
||||
void(bool detectResolution));
|
||||
MOCK_CONST_METHOD0(IsPaused,
|
||||
bool());
|
||||
MOCK_METHOD0(GetLocalizationManager,
|
||||
ILocalizationManager * ());
|
||||
MOCK_METHOD0(GetITextModeConsole,
|
||||
ITextModeConsole * ());
|
||||
MOCK_METHOD0(GetNoiseGen,
|
||||
CPNoise3 * ());
|
||||
MOCK_METHOD0(GetUpdateCounter,
|
||||
@@ -213,16 +182,12 @@ public:
|
||||
ESystemGlobalState(void));
|
||||
MOCK_METHOD1(SetSystemGlobalState,
|
||||
void(ESystemGlobalState systemGlobalState));
|
||||
MOCK_METHOD5(AsyncMemcpy,
|
||||
void(void* dst, const void* src, size_t size, int nFlags, volatile int* sync));
|
||||
|
||||
#if !defined(_RELEASE)
|
||||
MOCK_CONST_METHOD0(IsSavingResourceList,
|
||||
bool());
|
||||
#endif
|
||||
|
||||
MOCK_METHOD0(SteamInit,
|
||||
bool());
|
||||
MOCK_METHOD0(GetRootWindowMessageHandler,
|
||||
void*());
|
||||
MOCK_METHOD1(RegisterWindowMessageHandler,
|
||||
|
||||
@@ -40,8 +40,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define USE_STEAM 0 // Enable this to start using Steam
|
||||
|
||||
// The following definitions are used by Sandbox and RC to determine which platform support is needed
|
||||
#define TOOLS_SUPPORT_POWERVR
|
||||
#define TOOLS_SUPPORT_ETC2COMP
|
||||
|
||||
@@ -33,14 +33,6 @@ namespace AZ
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* This event gets posted at the end of CD3D9Renderer's EF_Scene3D method.
|
||||
* CSystem (in SystemRenderer.cpp) uses this to render the console, aux geom and UI
|
||||
* in a manner that will make sure the render calls end up as part of the scene's render.
|
||||
* This is important or else those render calls won't show up properly in VR.
|
||||
*/
|
||||
virtual void OnScene3DEnd() {};
|
||||
|
||||
/**
|
||||
* This event gets posted at the beginning of CD3D9Renderer's FreeResources method, before the resources have been freed.
|
||||
*/
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Description : Ebus for querying thermal information of the device.
|
||||
|
||||
#pragma once
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
|
||||
// The different types of temperature sensor that could be available on the device.
|
||||
enum class ThermalSensorType : int
|
||||
{
|
||||
CPU = 0,
|
||||
GPU,
|
||||
Battery,
|
||||
Count
|
||||
};
|
||||
|
||||
// Handles requests for thermal information
|
||||
class ThermalInfoHandler : public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
|
||||
virtual ~ThermalInfoHandler() = default;
|
||||
|
||||
/**
|
||||
* Returns the current temperature of a specific sensor in Celcius degrees.
|
||||
* If the type of sensor is not available on the device it returns 0.
|
||||
*
|
||||
* \param sensor The sensor type.
|
||||
*/
|
||||
virtual float GetSensorTemp(ThermalSensorType sensor) = 0;
|
||||
|
||||
/**
|
||||
* Returns the temperature that is considered as overheating for a specific sensor.
|
||||
* The value returned is in Celcius degrees.
|
||||
*
|
||||
* \param sensor The sensor type.
|
||||
*/
|
||||
virtual float GetSensorOverheatingTemp(ThermalSensorType sensor) = 0;
|
||||
};
|
||||
|
||||
using ThermalInfoRequestsBus = AZ::EBus<ThermalInfoHandler>;
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ set(FILES
|
||||
LocalizationManagerBus.h
|
||||
LocalizationManagerBus.inl
|
||||
ILog.h
|
||||
ILZ4Decompressor.h
|
||||
IMaterial.h
|
||||
IMeshBaking.h
|
||||
IMiniLog.h
|
||||
@@ -56,7 +55,6 @@ set(FILES
|
||||
IStereoRenderer.h
|
||||
ISurfaceType.h
|
||||
ISystem.h
|
||||
ITextModeConsole.h
|
||||
ITexture.h
|
||||
ITimer.h
|
||||
IValidator.h
|
||||
@@ -64,9 +62,6 @@ set(FILES
|
||||
IViewSystem.h
|
||||
IWindowMessageHandler.h
|
||||
IXml.h
|
||||
IZLibCompressor.h
|
||||
IZlibDecompressor.h
|
||||
IZStdDecompressor.h
|
||||
IProximityTriggerSystem.h
|
||||
MicrophoneBus.h
|
||||
physinterface.h
|
||||
|
||||
Reference in New Issue
Block a user