Remove I3DEngine CryCommon Interface (#567)
Delete: - I3DEngine - Missions - Time of day - GameEffectsSystem Gem - ImageProcessing Gem - SVOGI Gem - Various other things that don't do anything now that the legacy renderer has been removed.
This commit is contained in:
@@ -1,77 +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 : declaration of struct CryEngineDecalInfo.
|
||||
|
||||
// Note:
|
||||
// 3D Engine and Character Animation subsystems (as well as perhaps
|
||||
// some others) transfer data about the decals that need to be spawned
|
||||
// via this structure. This is to avoid passing many parameters through
|
||||
// each function call, and to save on copying these parameters when just
|
||||
// simply passing the structure from one function to another.
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_CRYENGINEDECALINFO_H
|
||||
#define CRYINCLUDE_CRYCOMMON_CRYENGINEDECALINFO_H
|
||||
#pragma once
|
||||
|
||||
#include "Cry_Math.h"
|
||||
|
||||
// Summary:
|
||||
// Structure containing common parameters that describe a decal
|
||||
|
||||
struct SDecalOwnerInfo
|
||||
{
|
||||
SDecalOwnerInfo() { memset(this, 0, sizeof(*this)); nRenderNodeSlotId = nRenderNodeSlotSubObjectId = -1; }
|
||||
struct IStatObj* GetOwner(Matrix34A& objMat);
|
||||
|
||||
struct IRenderNode* pRenderNode; // Owner (decal will be attached to or wrapped around of this object)
|
||||
PodArray<struct SRNInfo>* pDecalReceivers;
|
||||
int nRenderNodeSlotId; // is set internally by 3dengine
|
||||
int nRenderNodeSlotSubObjectId; // is set internally by 3dengine
|
||||
int nMatID;
|
||||
};
|
||||
|
||||
struct CryEngineDecalInfo
|
||||
{
|
||||
SDecalOwnerInfo ownerInfo;
|
||||
Vec3 vPos; // Decal position (world coordinates)
|
||||
Vec3 vNormal; // Decal/face normal
|
||||
float fSize; // Decal size
|
||||
float fLifeTime; // Decal life time (in seconds)
|
||||
float fAngle; // Angle of rotation
|
||||
struct IStatObj* pIStatObj; // Decal geometry
|
||||
Vec3 vHitDirection; // Direction from weapon/player position to decal position (bullet direction)
|
||||
float fGrowTime, fGrowTimeAlpha;// Used for blood pools
|
||||
unsigned int nGroupId; // Used for multi-component decals
|
||||
bool bSkipOverlappingTest; // Always spawn decals even if there are a lot of other decals in same place
|
||||
bool bAssemble; // Assemble to bigger decals if more than 1 decal is on the same place
|
||||
bool bForceEdge; // force the decal to the nearest edge of the owner mesh and project it accordingly
|
||||
bool bForceSingleOwner; // Do not attempt to cast the decal into the environment even if it's large enough
|
||||
bool bDeferred;
|
||||
uint8 sortPrio;
|
||||
char szMaterialName[_MAX_PATH]; // name of material used for rendering the decal (in favor of szTextureName/nTid and the default decal shader)
|
||||
bool preventDecalOnGround; // mainly for decal placement support
|
||||
const Matrix33* pExplicitRightUpFront; // mainly for decal placement support
|
||||
|
||||
void GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer) const{}
|
||||
|
||||
// the constructor fills in some non-obligatory fields; the other fields must be filled in by the client
|
||||
CryEngineDecalInfo ()
|
||||
{
|
||||
memset(this, 0, sizeof(*this));
|
||||
ownerInfo.nRenderNodeSlotId = ownerInfo.nRenderNodeSlotSubObjectId = -1;
|
||||
sortPrio = 255;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_CRYENGINEDECALINFO_H
|
||||
@@ -1,98 +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
|
||||
|
||||
#include <platform.h>
|
||||
|
||||
#if defined(AZ_RESTRICTED_PLATFORM)
|
||||
#include AZ_RESTRICTED_FILE(Gem_h)
|
||||
#endif
|
||||
|
||||
#if defined(LINUX) || defined(APPLE) || defined(ANDROID)
|
||||
#define OPENGL 1
|
||||
#endif
|
||||
|
||||
#include <Common/RendererDefs.h>
|
||||
|
||||
#include <Cry_Math.h>
|
||||
#include <Cry_XOptimise.h>
|
||||
#include <Cry_Math.h>
|
||||
#include <Cry_Geo.h>
|
||||
#include <CryArray.h>
|
||||
#include <CryHeaders.h>
|
||||
#include <CrySizer.h>
|
||||
#include <CryArray.h>
|
||||
|
||||
#include <IProcess.h>
|
||||
#include <ITimer.h>
|
||||
#include <ISystem.h>
|
||||
#include <ILog.h>
|
||||
#include <IConsole.h>
|
||||
#include <IRenderer.h>
|
||||
#include <IRenderAuxGeom.h>
|
||||
#include <IEntityRenderState.h>
|
||||
#include <I3DEngine.h>
|
||||
#include <IStreamEngine.h>
|
||||
|
||||
#include <CryArray2d.h>
|
||||
#include <PoolAllocator.h>
|
||||
#include <Cry3DEngineBase.h>
|
||||
#include <cvars.h>
|
||||
#include <Material.h>
|
||||
#include <3dEngine.h>
|
||||
#include <ObjMan.h>
|
||||
#include <StlUtils.h>
|
||||
|
||||
#include <Common/CommonRender.h>
|
||||
#include <Common/Shaders/ShaderComponents.h>
|
||||
#include <Common/Shaders/Shader.h>
|
||||
#include <Common/Shaders/CShader.h>
|
||||
#include <Common/RenderMesh.h>
|
||||
#include <Common/RenderPipeline.h>
|
||||
#include <Common/RenderThread.h>
|
||||
#include <Common/Renderer.h>
|
||||
#include <Common/Textures/Texture.h>
|
||||
#include <Common/Shaders/Parser.h>
|
||||
|
||||
#include <RenderDll/Common/OcclQuery.h>
|
||||
#include <RenderDll/Common/DeferredRenderUtils.h>
|
||||
#include <RenderDll/Common/Textures/TextureManager.h>
|
||||
#include <RenderDll/Common/FrameProfiler.h>
|
||||
#include <RenderDll/XRenderD3D9/DeviceManager/DeviceManagerInline.h>
|
||||
#include <RenderDll/XRenderD3D9/DriverD3D.h>
|
||||
#include <RenderDll/XRenderD3D9/DeviceManager/TempDynBuffer.h>
|
||||
|
||||
#include <AzCore/PlatformDef.h>
|
||||
#include <AzCore/Asset/AssetCommon.h>
|
||||
#include <AzCore/Asset/AssetManager.h>
|
||||
#include <AzCore/Asset/AssetManagerBus.h>
|
||||
#include <AzCore/Asset/AssetTypeInfoBus.h>
|
||||
#include <AzCore/Component/Component.h>
|
||||
#include <AzCore/Component/ComponentBus.h>
|
||||
#include <AzCore/Component/ComponentApplicationBus.h>
|
||||
#include <AzCore/Component/Entity.h>
|
||||
#include <AzCore/Component/TickBus.h>
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
#include <AzCore/IO/GenericStreams.h>
|
||||
#include <AzCore/IO/FileIO.h>
|
||||
#include <AzCore/Math/Quaternion.h>
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzCore/XML/rapidxml.h>
|
||||
|
||||
#include <AzFramework/Asset/SimpleAsset.h>
|
||||
#include <AzFramework/Asset/AssetCatalogBus.h>
|
||||
#include <AzFramework/Entity/EntityDebugDisplayBus.h>
|
||||
|
||||
#include <LmbrCentral/Rendering/RenderNodeBus.h>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,53 +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_I3DENGINE_INFO_H
|
||||
#define CRYINCLUDE_CRYCOMMON_I3DENGINE_INFO_H
|
||||
#pragma once
|
||||
|
||||
#include "TypeInfo_impl.h"
|
||||
#include "IShader_info.h"
|
||||
#include <I3DEngine.h> // <> required for Interfuscator
|
||||
|
||||
STRUCT_INFO_BEGIN(SVisAreaManChunkHeader)
|
||||
STRUCT_VAR_INFO(nVersion, TYPE_INFO(int8))
|
||||
STRUCT_VAR_INFO(nDummy, TYPE_INFO(int8))
|
||||
STRUCT_VAR_INFO(nFlags, TYPE_INFO(int8))
|
||||
STRUCT_VAR_INFO(nFlags2, TYPE_INFO(int8))
|
||||
STRUCT_VAR_INFO(nChunkSize, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nVisAreasNum, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nPortalsNum, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nOcclAreasNum, TYPE_INFO(int))
|
||||
STRUCT_INFO_END(SVisAreaManChunkHeader)
|
||||
|
||||
STRUCT_INFO_BEGIN(SOcTreeNodeChunk)
|
||||
STRUCT_VAR_INFO(nChunkVersion, TYPE_INFO(int16))
|
||||
STRUCT_VAR_INFO(ucChildsMask, TYPE_INFO(int16))
|
||||
STRUCT_VAR_INFO(nodeBox, TYPE_INFO(AABB))
|
||||
STRUCT_VAR_INFO(nObjectsBlockSize, TYPE_INFO(int32))
|
||||
STRUCT_INFO_END(SOcTreeNodeChunk)
|
||||
|
||||
STRUCT_INFO_BEGIN(SHotUpdateInfo)
|
||||
STRUCT_VAR_INFO(nHeigtmap, TYPE_INFO(uint32))
|
||||
STRUCT_VAR_INFO(nObjTypeMask, TYPE_INFO(uint32))
|
||||
STRUCT_VAR_INFO(areaBox, TYPE_INFO(AABB))
|
||||
STRUCT_INFO_END(SHotUpdateInfo)
|
||||
|
||||
STRUCT_INFO_BEGIN(SCommonFileHeader)
|
||||
STRUCT_VAR_INFO(signature, TYPE_ARRAY(4, TYPE_INFO(char)))
|
||||
STRUCT_VAR_INFO(file_type, TYPE_INFO(uint8))
|
||||
STRUCT_VAR_INFO(flags, TYPE_INFO(uint8))
|
||||
STRUCT_VAR_INFO(version, TYPE_INFO(uint16))
|
||||
STRUCT_INFO_END(SCommonFileHeader)
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_I3DENGINE_INFO_H
|
||||
@@ -286,7 +286,6 @@ struct IRenderNode
|
||||
// Physicalizes node.
|
||||
virtual void Physicalize([[maybe_unused]] bool bInstant = false) {}
|
||||
|
||||
// Make sure I3DEngine::FreeRenderNodeState(this) is called in destructor of derived class.
|
||||
virtual ~IRenderNode() { assert(!m_pRNTmpData); };
|
||||
|
||||
// Summary:
|
||||
|
||||
@@ -1,33 +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 : Interface for LocalMemoryUsage
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_ILOCALMEMORYUSAGE_H
|
||||
#define CRYINCLUDE_CRYCOMMON_ILOCALMEMORYUSAGE_H
|
||||
#pragma once
|
||||
|
||||
|
||||
class CCamera;
|
||||
struct IRenderer;
|
||||
|
||||
struct ILocalMemoryUsage
|
||||
{
|
||||
virtual ~ILocalMemoryUsage(){}
|
||||
virtual void OnRender(IRenderer* pRenderer, const CCamera* camera) = 0;
|
||||
virtual void OnUpdate() = 0;
|
||||
virtual void DeleteGlobalData() = 0;
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_ILOCALMEMORYUSAGE_H
|
||||
@@ -273,7 +273,7 @@ struct IMaterial
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// material name
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Set material name, (Do not use this directly, to change material name use I3DEngine::RenameMatInfo method).
|
||||
//! Set material name, (Do not use this directly
|
||||
virtual void SetName(const char* pName) = 0;
|
||||
//! Returns material name.
|
||||
virtual const char* GetName() const = 0;
|
||||
@@ -404,7 +404,6 @@ struct IMaterial
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Makes this specific material enter sketch mode.
|
||||
// Se also: I3DEngine::LoadCGF, in I3DEngine.h.
|
||||
// Current supported sketch modes:
|
||||
// - 0, no sketch.
|
||||
// - 1, normal sketch mode.
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <ISplines.h>
|
||||
#include <IRenderer.h>
|
||||
#include <IRenderAuxGeom.h>
|
||||
#include <I3DEngine.h>
|
||||
#include <VectorSet.h>
|
||||
#include <CryName.h>
|
||||
|
||||
|
||||
@@ -202,7 +202,6 @@ struct IObjManager
|
||||
|
||||
// time counters
|
||||
virtual bool IsAfterWater(const Vec3& vPos, const SRenderingPassInfo& passInfo) = 0;
|
||||
virtual void GetObjectsStreamingStatus(I3DEngine::SObjectsStreamingStatus& outStatus) = 0;
|
||||
virtual void FreeNotUsedCGFs() = 0;
|
||||
virtual void MakeUnitCube() = 0;
|
||||
|
||||
|
||||
@@ -66,7 +66,6 @@ struct IConsole;
|
||||
struct IRemoteConsole;
|
||||
struct IRenderer;
|
||||
struct IProcess;
|
||||
struct I3DEngine;
|
||||
struct ITimer;
|
||||
struct ICryFont;
|
||||
struct IMovieSystem;
|
||||
@@ -123,8 +122,6 @@ namespace Serialization {
|
||||
struct IArchiveHost;
|
||||
}
|
||||
|
||||
struct ILocalMemoryUsage;
|
||||
|
||||
typedef void* WIN_HWND;
|
||||
|
||||
class CCamera;
|
||||
@@ -793,7 +790,6 @@ struct SSystemUpdateStats
|
||||
// ISystem
|
||||
struct SSystemGlobalEnvironment
|
||||
{
|
||||
I3DEngine* p3DEngine;
|
||||
AZ::IO::IArchive* pCryPak;
|
||||
AZ::IO::FileIOBase* pFileIO;
|
||||
IFileChangeMonitor* pFileChangeMonitor;
|
||||
@@ -801,7 +797,6 @@ struct SSystemGlobalEnvironment
|
||||
IOpticsManager* pOpticsManager;
|
||||
ITimer* pTimer;
|
||||
ICryFont* pCryFont;
|
||||
ILocalMemoryUsage* pLocalMemoryUsage;
|
||||
::IConsole* pConsole;
|
||||
ISystem* pSystem = nullptr;
|
||||
ILog* pLog;
|
||||
@@ -1113,25 +1108,9 @@ struct ISystem
|
||||
virtual void DoWorkDuringOcclusionChecks() = 0;
|
||||
virtual bool NeedDoWorkDuringOcclusionChecks() = 0;
|
||||
|
||||
// Summary:
|
||||
// Renders subsystems.
|
||||
virtual void Render() = 0;
|
||||
// Summary:
|
||||
// Begins rendering frame.
|
||||
virtual void RenderBegin() = 0;
|
||||
// Summary:
|
||||
// Ends rendering frame and swap back buffer.
|
||||
virtual void RenderEnd(bool bRenderStats = true, bool bMainWindow = true) = 0;
|
||||
|
||||
//! Update screen and call some important tick functions during loading.
|
||||
virtual void SynchronousLoadingTick(const char* pFunc, int line) = 0;
|
||||
|
||||
// Description:
|
||||
// Renders the statistics; this is called from RenderEnd, but if the
|
||||
// Host application (Editor) doesn't employ the Render cycle in ISystem,
|
||||
// it may call this method to render the essential statistics.
|
||||
virtual void RenderStatistics() = 0;
|
||||
|
||||
// Summary:
|
||||
// Returns the current used memory.
|
||||
virtual uint32 GetUsedMemory() = 0;
|
||||
@@ -1229,7 +1208,6 @@ struct ISystem
|
||||
virtual ICryFont* GetICryFont() = 0;
|
||||
virtual IMemoryManager* GetIMemoryManager() = 0;
|
||||
virtual IMovieSystem* GetIMovieSystem() = 0;
|
||||
virtual I3DEngine* GetI3DEngine() = 0;
|
||||
virtual ::IConsole* GetIConsole() = 0;
|
||||
virtual IRemoteConsole* GetIRemoteConsole() = 0;
|
||||
// Returns:
|
||||
|
||||
@@ -1,286 +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.
|
||||
#pragma once
|
||||
|
||||
struct SBezierKey;
|
||||
struct ITimeOfDayUpdateCallback;
|
||||
struct ISplineInterpolator;
|
||||
|
||||
|
||||
//! Interface to the Time Of Day functionality.
|
||||
struct ITimeOfDay
|
||||
{
|
||||
enum ETimeOfDayParamID
|
||||
{
|
||||
PARAM_SUN_COLOR,
|
||||
PARAM_SUN_INTENSITY,
|
||||
PARAM_SUN_SPECULAR_MULTIPLIER,
|
||||
|
||||
PARAM_FOG_COLOR,
|
||||
PARAM_FOG_COLOR_MULTIPLIER,
|
||||
PARAM_VOLFOG_HEIGHT,
|
||||
PARAM_VOLFOG_DENSITY,
|
||||
PARAM_FOG_COLOR2,
|
||||
PARAM_FOG_COLOR2_MULTIPLIER,
|
||||
PARAM_VOLFOG_HEIGHT2,
|
||||
PARAM_VOLFOG_DENSITY2,
|
||||
PARAM_VOLFOG_HEIGHT_OFFSET,
|
||||
|
||||
PARAM_FOG_RADIAL_COLOR,
|
||||
PARAM_FOG_RADIAL_COLOR_MULTIPLIER,
|
||||
PARAM_VOLFOG_RADIAL_SIZE,
|
||||
PARAM_VOLFOG_RADIAL_LOBE,
|
||||
|
||||
PARAM_VOLFOG_FINAL_DENSITY_CLAMP,
|
||||
|
||||
PARAM_VOLFOG_GLOBAL_DENSITY,
|
||||
PARAM_VOLFOG_RAMP_START,
|
||||
PARAM_VOLFOG_RAMP_END,
|
||||
PARAM_VOLFOG_RAMP_INFLUENCE,
|
||||
|
||||
PARAM_VOLFOG_SHADOW_DARKENING,
|
||||
PARAM_VOLFOG_SHADOW_DARKENING_SUN,
|
||||
PARAM_VOLFOG_SHADOW_DARKENING_AMBIENT,
|
||||
PARAM_VOLFOG_SHADOW_RANGE,
|
||||
|
||||
PARAM_VOLFOG2_HEIGHT,
|
||||
PARAM_VOLFOG2_DENSITY,
|
||||
PARAM_VOLFOG2_HEIGHT2,
|
||||
PARAM_VOLFOG2_DENSITY2,
|
||||
PARAM_VOLFOG2_GLOBAL_DENSITY,
|
||||
PARAM_VOLFOG2_RAMP_START,
|
||||
PARAM_VOLFOG2_RAMP_END,
|
||||
PARAM_VOLFOG2_COLOR1,
|
||||
PARAM_VOLFOG2_ANISOTROPIC1,
|
||||
PARAM_VOLFOG2_COLOR2,
|
||||
PARAM_VOLFOG2_ANISOTROPIC2,
|
||||
PARAM_VOLFOG2_BLEND_FACTOR,
|
||||
PARAM_VOLFOG2_BLEND_MODE,
|
||||
PARAM_VOLFOG2_COLOR,
|
||||
PARAM_VOLFOG2_ANISOTROPIC,
|
||||
PARAM_VOLFOG2_RANGE,
|
||||
PARAM_VOLFOG2_INSCATTER,
|
||||
PARAM_VOLFOG2_EXTINCTION,
|
||||
PARAM_VOLFOG2_GLOBAL_FOG_VISIBILITY,
|
||||
PARAM_VOLFOG2_FINAL_DENSITY_CLAMP,
|
||||
|
||||
PARAM_SKYLIGHT_SUN_INTENSITY,
|
||||
PARAM_SKYLIGHT_SUN_INTENSITY_MULTIPLIER,
|
||||
|
||||
PARAM_SKYLIGHT_KM,
|
||||
PARAM_SKYLIGHT_KR,
|
||||
PARAM_SKYLIGHT_G,
|
||||
|
||||
PARAM_SKYLIGHT_WAVELENGTH_R,
|
||||
PARAM_SKYLIGHT_WAVELENGTH_G,
|
||||
PARAM_SKYLIGHT_WAVELENGTH_B,
|
||||
|
||||
PARAM_NIGHSKY_HORIZON_COLOR,
|
||||
PARAM_NIGHSKY_HORIZON_COLOR_MULTIPLIER,
|
||||
PARAM_NIGHSKY_ZENITH_COLOR,
|
||||
PARAM_NIGHSKY_ZENITH_COLOR_MULTIPLIER,
|
||||
PARAM_NIGHSKY_ZENITH_SHIFT,
|
||||
|
||||
PARAM_NIGHSKY_START_INTENSITY,
|
||||
|
||||
PARAM_NIGHSKY_MOON_COLOR,
|
||||
PARAM_NIGHSKY_MOON_COLOR_MULTIPLIER,
|
||||
PARAM_NIGHSKY_MOON_INNERCORONA_COLOR,
|
||||
PARAM_NIGHSKY_MOON_INNERCORONA_COLOR_MULTIPLIER,
|
||||
PARAM_NIGHSKY_MOON_INNERCORONA_SCALE,
|
||||
PARAM_NIGHSKY_MOON_OUTERCORONA_COLOR,
|
||||
PARAM_NIGHSKY_MOON_OUTERCORONA_COLOR_MULTIPLIER,
|
||||
PARAM_NIGHSKY_MOON_OUTERCORONA_SCALE,
|
||||
|
||||
PARAM_CLOUDSHADING_SUNLIGHT_MULTIPLIER,
|
||||
PARAM_CLOUDSHADING_SUNLIGHT_CUSTOM_COLOR,
|
||||
PARAM_CLOUDSHADING_SUNLIGHT_CUSTOM_COLOR_MULTIPLIER,
|
||||
PARAM_CLOUDSHADING_SUNLIGHT_CUSTOM_COLOR_INFLUENCE,
|
||||
|
||||
PARAM_SUN_SHAFTS_VISIBILITY,
|
||||
PARAM_SUN_RAYS_VISIBILITY,
|
||||
PARAM_SUN_RAYS_ATTENUATION,
|
||||
PARAM_SUN_RAYS_SUNCOLORINFLUENCE,
|
||||
PARAM_SUN_RAYS_CUSTOMCOLOR,
|
||||
|
||||
PARAM_OCEANFOG_COLOR, // Remove when ocean related feature toggle is removed.
|
||||
PARAM_OCEANFOG_COLOR_MULTIPLIER, // Remove when ocean related feature toggle is removed.
|
||||
PARAM_OCEANFOG_DENSITY, // Remove when ocean related feature toggle is removed.
|
||||
|
||||
PARAM_SKYBOX_MULTIPLIER,
|
||||
|
||||
PARAM_HDR_FILMCURVE_SHOULDER_SCALE,
|
||||
PARAM_HDR_FILMCURVE_LINEAR_SCALE,
|
||||
PARAM_HDR_FILMCURVE_TOE_SCALE,
|
||||
PARAM_HDR_FILMCURVE_WHITEPOINT,
|
||||
|
||||
PARAM_HDR_COLORGRADING_COLOR_SATURATION,
|
||||
PARAM_HDR_COLORGRADING_COLOR_BALANCE,
|
||||
|
||||
PARAM_HDR_EYEADAPTATION_SCENEKEY,
|
||||
PARAM_HDR_EYEADAPTATION_MIN_EXPOSURE,
|
||||
PARAM_HDR_EYEADAPTATION_MAX_EXPOSURE,
|
||||
PARAM_HDR_EYEADAPTATION_EV_MIN,
|
||||
PARAM_HDR_EYEADAPTATION_EV_MAX,
|
||||
PARAM_HDR_EYEADAPTATION_EV_AUTO_COMPENSATION,
|
||||
PARAM_HDR_BLOOM_AMOUNT,
|
||||
|
||||
PARAM_COLORGRADING_FILTERS_GRAIN,
|
||||
PARAM_COLORGRADING_FILTERS_PHOTOFILTER_COLOR,
|
||||
PARAM_COLORGRADING_FILTERS_PHOTOFILTER_DENSITY,
|
||||
|
||||
PARAM_COLORGRADING_DOF_FOCUSRANGE,
|
||||
PARAM_COLORGRADING_DOF_BLURAMOUNT,
|
||||
|
||||
PARAM_SHADOWSC0_BIAS,
|
||||
PARAM_SHADOWSC0_SLOPE_BIAS,
|
||||
PARAM_SHADOWSC1_BIAS,
|
||||
PARAM_SHADOWSC1_SLOPE_BIAS,
|
||||
PARAM_SHADOWSC2_BIAS,
|
||||
PARAM_SHADOWSC2_SLOPE_BIAS,
|
||||
PARAM_SHADOWSC3_BIAS,
|
||||
PARAM_SHADOWSC3_SLOPE_BIAS,
|
||||
PARAM_SHADOWSC4_BIAS,
|
||||
PARAM_SHADOWSC4_SLOPE_BIAS,
|
||||
PARAM_SHADOWSC5_BIAS,
|
||||
PARAM_SHADOWSC5_SLOPE_BIAS,
|
||||
PARAM_SHADOWSC6_BIAS,
|
||||
PARAM_SHADOWSC6_SLOPE_BIAS,
|
||||
PARAM_SHADOWSC7_BIAS,
|
||||
PARAM_SHADOWSC7_SLOPE_BIAS,
|
||||
|
||||
PARAM_SHADOW_JITTERING,
|
||||
|
||||
PARAM_HDR_DYNAMIC_POWER_FACTOR,
|
||||
PARAM_TERRAIN_OCCL_MULTIPLIER,
|
||||
PARAM_SUN_COLOR_MULTIPLIER,
|
||||
|
||||
PARAM_TOTAL
|
||||
};
|
||||
|
||||
struct SPresetInfo
|
||||
{
|
||||
const char* m_pName;
|
||||
bool m_bCurrent;
|
||||
};
|
||||
|
||||
enum EVariableType
|
||||
{
|
||||
TYPE_FLOAT,
|
||||
TYPE_COLOR
|
||||
};
|
||||
struct SVariableInfo
|
||||
{
|
||||
const char* name; //!< Variable name.
|
||||
const char* displayName; //!< Variable user readable name.
|
||||
const char* group; //!< Group name.
|
||||
int nParamId;
|
||||
EVariableType type;
|
||||
float fValue[3]; //!< Value of the variable (3 needed for color type).
|
||||
ISplineInterpolator* pInterpolator; //!< Splines that control variable value.
|
||||
};
|
||||
struct SAdvancedInfo
|
||||
{
|
||||
float fStartTime;
|
||||
float fEndTime;
|
||||
float fAnimSpeed;
|
||||
};
|
||||
struct SEnvironmentInfo
|
||||
{
|
||||
SEnvironmentInfo()
|
||||
: bSunLinkedToTOD(true)
|
||||
, sunRotationLatitude(0)
|
||||
, sunRotationLongitude(0){}
|
||||
bool bSunLinkedToTOD;
|
||||
float sunRotationLatitude;
|
||||
float sunRotationLongitude;
|
||||
};
|
||||
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~ITimeOfDay(){}
|
||||
|
||||
virtual int GetPresetCount() const = 0;
|
||||
virtual bool GetPresetsInfos(SPresetInfo* resultArray, unsigned int arraySize) const = 0;
|
||||
virtual bool SetCurrentPreset(const char* szPresetName) = 0;
|
||||
virtual bool AddNewPreset(const char* szPresetName) = 0;
|
||||
virtual bool RemovePreset(const char* szPresetName) = 0;
|
||||
virtual bool SavePreset(const char* szPresetName) const = 0;
|
||||
virtual bool LoadPreset(const char* szFilePath) = 0;
|
||||
virtual void ResetPreset(const char* szPresetName) = 0;
|
||||
|
||||
virtual bool ImportPreset(const char* szPresetName, const char* szFilePath) = 0;
|
||||
virtual bool ExportPreset(const char* szPresetName, const char* szFilePath) const = 0;
|
||||
|
||||
//! Access to variables that control time of the day appearance.
|
||||
virtual int GetVariableCount() const = 0;
|
||||
virtual bool GetVariableInfo(int nIndex, SVariableInfo& varInfo) const = 0;
|
||||
virtual void SetVariableValue(int nIndex, float fValue[3]) = 0;
|
||||
|
||||
//! Editor interface.
|
||||
virtual bool InterpolateVarInRange(int nIndex, float fMin, float fMax, unsigned int nCount, Vec3* resultArray) const = 0;
|
||||
virtual uint GetSplineKeysCount(int nIndex, int nSpline) const = 0;
|
||||
virtual bool GetSplineKeysForVar(int nIndex, int nSpline, SBezierKey* keysArray, unsigned int keysArraySize) const = 0;
|
||||
virtual bool SetSplineKeysForVar(int nIndex, int nSpline, const SBezierKey* keysArray, unsigned int keysArraySize) = 0;
|
||||
virtual bool UpdateSplineKeyForVar(int nIndex, int nSpline, float fTime, float newValue) = 0;
|
||||
|
||||
virtual void ResetVariables() = 0;
|
||||
|
||||
//! Sets the time of the day specified in hours.
|
||||
virtual void SetTime(float fHour, bool bForceUpdate = false, bool bForceEnvUpdate = true) = 0;
|
||||
virtual float GetTime() = 0;
|
||||
|
||||
//! Sun position.
|
||||
virtual void SetSunPos(float longitude, float latitude) = 0;
|
||||
virtual float GetSunLatitude() = 0;
|
||||
virtual float GetSunLongitude() = 0;
|
||||
|
||||
//! Updates the current ToD.
|
||||
virtual void Tick() = 0;
|
||||
|
||||
|
||||
virtual void SetPaused(bool paused) = 0;
|
||||
|
||||
virtual void SetAdvancedInfo(const SAdvancedInfo& advInfo) = 0;
|
||||
virtual void GetAdvancedInfo(SAdvancedInfo& advInfo) = 0;
|
||||
|
||||
//! Updates engine parameters after variable values have been changed.
|
||||
virtual void Update(bool bInterpolate = true, bool bForceUpdate = false, bool bForceEnvUpdate = true) = 0;
|
||||
virtual void SetUpdateCallback(ITimeOfDayUpdateCallback* pCallback) = 0;
|
||||
|
||||
virtual void BeginEditMode() = 0;
|
||||
virtual void EndEditMode() = 0;
|
||||
|
||||
virtual void Serialize(XmlNodeRef& node, bool bLoading) = 0;
|
||||
virtual void Serialize(TSerialize ser) = 0;
|
||||
|
||||
virtual void SetTimer(ITimer* pTimer) = 0;
|
||||
virtual void SetEnvironmentSettings(const SEnvironmentInfo& envInfo) = 0;
|
||||
virtual void LerpWith(const ITimeOfDay& other, float lerpValue, ITimeOfDay& output) const = 0;
|
||||
|
||||
//! Multiplayer serialization.
|
||||
static const int NETSER_FORCESET = BIT(0);
|
||||
static const int NETSER_COMPENSATELAG = BIT(1);
|
||||
static const int NETSER_STATICPROPS = BIT(2);
|
||||
virtual void NetSerialize(TSerialize ser, float lag, uint32 flags) = 0;
|
||||
};
|
||||
|
||||
struct ITimeOfDayUpdateCallback
|
||||
{
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~ITimeOfDayUpdateCallback(){}
|
||||
virtual void BeginUpdate() = 0;
|
||||
virtual bool GetCustomValue(ITimeOfDay::ETimeOfDayParamID paramID, int dim, float* pValues, float& blendWeight) = 0;
|
||||
virtual void EndUpdate() = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
@@ -1,528 +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
|
||||
|
||||
#include <AzCore/Math/Aabb.h>
|
||||
|
||||
#include <I3DEngine.h>
|
||||
#include <ISerialize.h>
|
||||
#include <gmock/gmock.h>
|
||||
|
||||
// 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 I3DEngine,
|
||||
// it will probably be better to just manually add them here than try to run the script again.
|
||||
|
||||
class I3DEngineMock
|
||||
: public I3DEngine
|
||||
{
|
||||
public:
|
||||
// From IProcess
|
||||
MOCK_METHOD1(SetFlags,
|
||||
void(int));
|
||||
MOCK_METHOD0(GetFlags,
|
||||
int(void));
|
||||
|
||||
// From I3DEngine
|
||||
MOCK_METHOD0(Init,
|
||||
bool());
|
||||
MOCK_METHOD1(SetLevelPath,
|
||||
void(const char* szFolderName));
|
||||
MOCK_METHOD1(CheckMinSpec,
|
||||
bool(uint32 nMinSpec));
|
||||
MOCK_METHOD1(PrepareOcclusion,
|
||||
void(const CCamera& rCamera));
|
||||
MOCK_METHOD0(EndOcclusion,
|
||||
void());
|
||||
MOCK_METHOD2(LoadLevel,
|
||||
bool(const char* szFolderName, const char* szMissionName));
|
||||
MOCK_METHOD2(InitLevelForEditor,
|
||||
bool(const char* szFolderName, const char* szMissionName));
|
||||
MOCK_METHOD0(LevelLoadingInProgress,
|
||||
bool());
|
||||
MOCK_METHOD0(OnFrameStart,
|
||||
void());
|
||||
MOCK_METHOD0(PostLoadLevel,
|
||||
void());
|
||||
MOCK_METHOD0(LoadEmptyLevel,
|
||||
void());
|
||||
MOCK_METHOD0(UnloadLevel,
|
||||
void());
|
||||
MOCK_METHOD0(Update,
|
||||
void());
|
||||
MOCK_CONST_METHOD0(GetRenderingCamera,
|
||||
const CCamera&());
|
||||
MOCK_CONST_METHOD0(GetZoomFactor,
|
||||
float());
|
||||
MOCK_METHOD0(Tick,
|
||||
void());
|
||||
MOCK_METHOD0(UpdateShaderItems,
|
||||
void());
|
||||
MOCK_METHOD0(Release,
|
||||
void());
|
||||
MOCK_METHOD3(RenderWorld,
|
||||
void(int nRenderFlags, const SRenderingPassInfo& passInfo, const char* szDebugName));
|
||||
MOCK_METHOD2(RenderSceneReflection,
|
||||
void(int nRenderFlags, const SRenderingPassInfo& passInfo));
|
||||
MOCK_METHOD1(PreWorldStreamUpdate,
|
||||
void(const CCamera& cam));
|
||||
MOCK_METHOD0(WorldStreamUpdate,
|
||||
void());
|
||||
MOCK_METHOD0(ShutDown,
|
||||
void());
|
||||
MOCK_METHOD7(LoadStatObjUnsafeManualRef,
|
||||
IStatObj*(const char* fileName, const char* geomName, IStatObj::SSubObject** subObject,
|
||||
bool useStreaming, unsigned long loadingFlags, const void* data, int dataSize));
|
||||
MOCK_METHOD7(LoadStatObjAutoRef,
|
||||
_smart_ptr<IStatObj>(const char* fileName, const char* geomName, IStatObj::SSubObject** subObject,
|
||||
bool useStreaming, unsigned long loadingFlags, const void* data, int dataSize));
|
||||
MOCK_METHOD0(ProcessAsyncStaticObjectLoadRequests,
|
||||
void());
|
||||
MOCK_METHOD5(LoadStatObjAsync,
|
||||
void(LoadStaticObjectAsyncResult resultCallback, const char* szFileName, const char* szGeomName, bool bUseStreaming, unsigned long nLoadingFlags));
|
||||
MOCK_METHOD1(FindStatObjectByFilename,
|
||||
IStatObj*(const char* filename));
|
||||
MOCK_METHOD0(GetGSMRange,
|
||||
const float());
|
||||
MOCK_METHOD0(GetGSMRangeStep,
|
||||
const float());
|
||||
MOCK_METHOD0(GetLoadedObjectCount,
|
||||
int());
|
||||
MOCK_METHOD2(GetLoadedStatObjArray,
|
||||
void(IStatObj** pObjectsArray, int& nCount));
|
||||
MOCK_METHOD1(GetObjectsStreamingStatus,
|
||||
void(SObjectsStreamingStatus& outStatus));
|
||||
MOCK_METHOD2(GetStreamingSubsystemData,
|
||||
void(int subsystem, SStremaingBandwidthData& outData));
|
||||
MOCK_METHOD3(RegisterEntity,
|
||||
void(IRenderNode* pEntity, int nSID, int nSIDConsideredSafe));
|
||||
MOCK_METHOD1(SelectEntity,
|
||||
void(IRenderNode* pEntity));
|
||||
MOCK_METHOD0(IsSunShadows,
|
||||
bool());
|
||||
MOCK_METHOD2(MakeSystemMaterialFromShaderHelper
|
||||
, _smart_ptr<IMaterial>(const char* sShaderName, SInputShaderResources* Res));
|
||||
MOCK_METHOD1(CheckMinSpecHelper
|
||||
, bool(uint32 nMinSpec));
|
||||
MOCK_METHOD1(OnCasterDeleted
|
||||
, void(IShadowCaster* pCaster));
|
||||
MOCK_METHOD4(GetStatObjAndMatTables,
|
||||
void(DynArray<IStatObj*>* pStatObjTable, DynArray<_smart_ptr<IMaterial>>* pMatTable, DynArray<IStatInstGroup*>* pStatInstGroupTable, uint32 nObjTypeMask));
|
||||
#ifndef _RELEASE
|
||||
MOCK_METHOD1(AddObjToDebugDrawList,
|
||||
void(SObjectInfoToAddToDebugDrawList& objInfo));
|
||||
MOCK_CONST_METHOD0(IsDebugDrawListEnabled,
|
||||
bool());
|
||||
#endif
|
||||
MOCK_METHOD1(UnRegisterEntityDirect,
|
||||
void(IRenderNode* pEntity));
|
||||
MOCK_METHOD1(UnRegisterEntityAsJob,
|
||||
void(IRenderNode* pEnt));
|
||||
MOCK_CONST_METHOD1(IsUnderWater,
|
||||
bool(const Vec3& vPos));
|
||||
MOCK_METHOD1(SetOceanRenderFlags,
|
||||
void(uint8 nFlags));
|
||||
MOCK_CONST_METHOD0(GetOceanRenderFlags,
|
||||
uint8());
|
||||
MOCK_CONST_METHOD0(GetOceanVisiblePixelsCount,
|
||||
uint32());
|
||||
MOCK_METHOD3(GetBottomLevel,
|
||||
float(const Vec3& referencePos, float maxRelevantDepth, int objtypes));
|
||||
MOCK_METHOD2(GetBottomLevel,
|
||||
float(const Vec3& referencePos, float maxRelevantDepth));
|
||||
MOCK_METHOD2(GetBottomLevel,
|
||||
float(const Vec3& referencePos, int objflags));
|
||||
MOCK_METHOD0(GetWaterLevel,
|
||||
float());
|
||||
MOCK_METHOD3(GetWaterLevel,
|
||||
float(const Vec3* pvPos, IPhysicalEntity* pent, bool bAccurate));
|
||||
MOCK_CONST_METHOD1(GetAccurateOceanHeight,
|
||||
float(const Vec3& pCurrPos));
|
||||
MOCK_CONST_METHOD0(GetCausticsParams,
|
||||
CausticsParams());
|
||||
MOCK_CONST_METHOD0(GetOceanAnimationParams,
|
||||
OceanAnimationData());
|
||||
MOCK_CONST_METHOD1(GetHDRSetupParams,
|
||||
void(Vec4 pParams[5]));
|
||||
MOCK_METHOD0(ResetParticlesAndDecals,
|
||||
void());
|
||||
MOCK_METHOD1(CreateDecal,
|
||||
void(const CryEngineDecalInfo& Decal));
|
||||
MOCK_METHOD2(DeleteDecalsInRange,
|
||||
void(AABB* pAreaBox, IRenderNode* pEntity));
|
||||
MOCK_METHOD1(SetSunColor,
|
||||
void(Vec3 vColor));
|
||||
MOCK_METHOD0(GetSunAnimColor,
|
||||
Vec3());
|
||||
MOCK_METHOD1(SetSunAnimColor,
|
||||
void(const Vec3& color));
|
||||
MOCK_METHOD0(GetSunAnimSpeed,
|
||||
float());
|
||||
MOCK_METHOD1(SetSunAnimSpeed,
|
||||
void(float sunAnimSpeed));
|
||||
MOCK_METHOD0(GetSunAnimPhase,
|
||||
AZ::u8());
|
||||
MOCK_METHOD1(SetSunAnimPhase,
|
||||
void(AZ::u8 sunAnimPhase));
|
||||
MOCK_METHOD0(GetSunAnimIndex,
|
||||
AZ::u8());
|
||||
MOCK_METHOD1(SetSunAnimIndex,
|
||||
void(AZ::u8 sunAnimIndex));
|
||||
MOCK_METHOD1(SetRainParams,
|
||||
void(const SRainParams& rainParams));
|
||||
MOCK_METHOD1(GetRainParams,
|
||||
bool(SRainParams& rainParams));
|
||||
MOCK_METHOD5(SetSnowSurfaceParams,
|
||||
void(const Vec3& vCenter, float fRadius, float fSnowAmount, float fFrostAmount, float fSurfaceFreezing));
|
||||
MOCK_METHOD5(GetSnowSurfaceParams,
|
||||
bool(Vec3& vCenter, float& fRadius, float& fSnowAmount, float& fFrostAmount, float& fSurfaceFreezing));
|
||||
MOCK_METHOD7(SetSnowFallParams,
|
||||
void(int nSnowFlakeCount, float fSnowFlakeSize, float fSnowFallBrightness, float fSnowFallGravityScale, float fSnowFallWindScale, float fSnowFallTurbulence, float fSnowFallTurbulenceFreq));
|
||||
MOCK_METHOD7(GetSnowFallParams,
|
||||
bool(int& nSnowFlakeCount, float& fSnowFlakeSize, float& fSnowFallBrightness, float& fSnowFallGravityScale, float& fSnowFallWindScale, float& fSnowFallTurbulence, float& fSnowFallTurbulenceFreq));
|
||||
MOCK_METHOD1(SetMaxViewDistanceScale,
|
||||
void(float fScale));
|
||||
MOCK_METHOD1(GetMaxViewDistance,
|
||||
float(bool));
|
||||
MOCK_CONST_METHOD0(GetFrameLodInfo,
|
||||
const SFrameLodInfo&());
|
||||
MOCK_METHOD1(SetFrameLodInfo,
|
||||
void(const SFrameLodInfo& frameLodInfo));
|
||||
MOCK_METHOD1(SetFogColor,
|
||||
void(const Vec3& vFogColor));
|
||||
MOCK_METHOD0(GetFogColor,
|
||||
Vec3());
|
||||
MOCK_METHOD6(GetSkyLightParameters,
|
||||
void(Vec3& sunDir, Vec3& sunIntensity, float& Km, float& Kr, float& g, Vec3& rgbWaveLengths));
|
||||
MOCK_METHOD7(SetSkyLightParameters,
|
||||
void(const Vec3& sunDir, const Vec3& sunIntensity, float Km, float Kr, float g, const Vec3& rgbWaveLengths, bool forceImmediateUpdate));
|
||||
MOCK_CONST_METHOD0(GetLightsHDRDynamicPowerFactor,
|
||||
float());
|
||||
MOCK_CONST_METHOD3(IsTessellationAllowed,
|
||||
bool(const CRenderObject* pObj, const SRenderingPassInfo& passInfo, bool bIgnoreShadowPass));
|
||||
MOCK_METHOD3(SetRenderNodeMaterialAtPosition,
|
||||
void(EERType eNodeType, const Vec3& vPos, _smart_ptr<IMaterial> pMat));
|
||||
MOCK_METHOD1(OverrideCameraPrecachePoint,
|
||||
void(const Vec3& vPos));
|
||||
MOCK_METHOD4(AddPrecachePoint,
|
||||
int(const Vec3& vPos, const Vec3& vDir, float fTimeOut, float fImportanceFactor));
|
||||
MOCK_METHOD1(ClearPrecachePoint,
|
||||
void(int id));
|
||||
MOCK_METHOD0(ClearAllPrecachePoints,
|
||||
void());
|
||||
MOCK_METHOD1(GetPrecacheRoundIds,
|
||||
void(int pRoundIds[MAX_STREAM_PREDICTION_ZONES]));
|
||||
MOCK_METHOD5(TraceFogVolumes,
|
||||
void(const Vec3& vPos, const AABB& objBBox, SFogVolumeData& fogVolData, const SRenderingPassInfo& passInfo, bool fogVolumeShadingQuality));
|
||||
|
||||
MOCK_METHOD1(RemoveAllStaticObjects,
|
||||
void(int));
|
||||
MOCK_METHOD3(SetStatInstGroup,
|
||||
bool(int nGroupId, const IStatInstGroup& siGroup, int nSID));
|
||||
MOCK_METHOD3(GetStatInstGroup,
|
||||
bool(int, IStatInstGroup&, int));
|
||||
MOCK_METHOD3(OnExplosion,
|
||||
void(Vec3, float, bool));
|
||||
MOCK_METHOD1(SetPhysMaterialEnumerator,
|
||||
void(IPhysMaterialEnumerator* pPhysMaterialEnumerator));
|
||||
MOCK_METHOD0(GetPhysMaterialEnumerator,
|
||||
IPhysMaterialEnumerator*());
|
||||
MOCK_METHOD0(SetupDistanceFog,
|
||||
void());
|
||||
MOCK_METHOD1(LoadMissionDataFromXMLNode,
|
||||
void(const char* szMissionName));
|
||||
MOCK_METHOD2(LoadEnvironmentSettingsFromXML,
|
||||
void(XmlNodeRef, int));
|
||||
MOCK_METHOD0(LoadCompiledOctreeForEditor,
|
||||
bool());
|
||||
MOCK_CONST_METHOD0(GetSunDir,
|
||||
Vec3());
|
||||
MOCK_CONST_METHOD0(GetSunDirNormalized,
|
||||
Vec3());
|
||||
MOCK_CONST_METHOD0(GetRealtimeSunDirNormalized,
|
||||
Vec3());
|
||||
MOCK_METHOD0(GetDistanceToSectorWithWater,
|
||||
float());
|
||||
MOCK_CONST_METHOD0(GetSunColor,
|
||||
Vec3());
|
||||
MOCK_CONST_METHOD0(GetSSAOAmount,
|
||||
float());
|
||||
MOCK_CONST_METHOD0(GetSSAOContrast,
|
||||
float());
|
||||
MOCK_METHOD1(FreeRenderNodeState,
|
||||
void(IRenderNode* pEntity));
|
||||
MOCK_METHOD1(GetLevelFilePath,
|
||||
const char*(const char* szFileName));
|
||||
MOCK_METHOD4(DisplayInfo,
|
||||
void(float& fTextPosX, float& fTextPosY, float& fTextStepY, bool bEnhanced));
|
||||
MOCK_METHOD0(DisplayMemoryStatistics,
|
||||
void());
|
||||
|
||||
// Can't mock methods with variable parameters so just create empty bodies for them.
|
||||
void DrawTextRightAligned([[maybe_unused]] const float x, [[maybe_unused]] const float y, [[maybe_unused]] const char* format, ...) override {}
|
||||
void DrawTextRightAligned([[maybe_unused]] const float x, [[maybe_unused]] const float y, [[maybe_unused]] const float scale, [[maybe_unused]] const ColorF& color, [[maybe_unused]] const char* format, ...) override {}
|
||||
|
||||
MOCK_METHOD3(DrawBBoxHelper
|
||||
, void (const Vec3& vMin, const Vec3& vMax, ColorB col));
|
||||
MOCK_METHOD2(DrawBBoxHelper
|
||||
, void (const AABB& box, ColorB col));
|
||||
|
||||
MOCK_METHOD3(ActivatePortal,
|
||||
void(const Vec3& vPos, bool bActivate, const char* szEntityName));
|
||||
MOCK_CONST_METHOD1(GetMemoryUsage,
|
||||
void(ICrySizer* pSizer));
|
||||
MOCK_METHOD2(GetResourceMemoryUsage,
|
||||
void(ICrySizer* pSizer, const AABB& cstAABB));
|
||||
MOCK_METHOD1(CreateVisArea,
|
||||
IVisArea*(uint64 visGUID));
|
||||
MOCK_METHOD1(DeleteVisArea,
|
||||
void(IVisArea* pVisArea));
|
||||
MOCK_METHOD6(UpdateVisArea,
|
||||
void(IVisArea* pArea, const Vec3* pPoints, int nCount, const char* szName, const SVisAreaInfo& info, bool bReregisterObjects));
|
||||
MOCK_METHOD4(IsVisAreasConnected,
|
||||
bool(IVisArea* pArea1, IVisArea* pArea2, int nMaxRecursion, bool bSkipDisabledPortals));
|
||||
MOCK_METHOD0(CreateClipVolume,
|
||||
IClipVolume*());
|
||||
MOCK_METHOD1(DeleteClipVolume,
|
||||
void(IClipVolume* pClipVolume));
|
||||
MOCK_METHOD7(UpdateClipVolume,
|
||||
void(IClipVolume* pClipVolume, _smart_ptr<IRenderMesh> pRenderMesh, IBSPTree3D* pBspTree, const Matrix34& worldTM, bool bActive, uint32 flags, const char* szName));
|
||||
MOCK_METHOD1(CreateRenderNode,
|
||||
IRenderNode*(EERType type));
|
||||
MOCK_METHOD1(DeleteRenderNode,
|
||||
void(IRenderNode* pRenderNode));
|
||||
MOCK_METHOD1(SetWind,
|
||||
void(const Vec3& vWind));
|
||||
MOCK_CONST_METHOD2(GetWind,
|
||||
Vec3(const AABB& box, bool bIndoors));
|
||||
MOCK_CONST_METHOD1(GetGlobalWind,
|
||||
Vec3(bool bIndoors));
|
||||
MOCK_CONST_METHOD4(SampleWind,
|
||||
bool(Vec3* pSamples, int nSamples, const AABB& volume, bool bIndoors));
|
||||
MOCK_METHOD1(GetVisAreaFromPos,
|
||||
IVisArea*(const Vec3& vPos));
|
||||
MOCK_METHOD2(IntersectsVisAreas,
|
||||
bool(const AABB& box, void** pNodeCache));
|
||||
MOCK_METHOD4(ClipToVisAreas,
|
||||
bool(IVisArea* pInside, Sphere& sphere, Vec3 const& vNormal, void* pNodeCache));
|
||||
MOCK_METHOD1(EnableOceanRendering,
|
||||
void(bool bOcean));
|
||||
MOCK_METHOD1(AddTextureLoadHandler,
|
||||
void(ITextureLoadHandler* pHandler));
|
||||
MOCK_METHOD1(RemoveTextureLoadHandler,
|
||||
void(ITextureLoadHandler* pHandler));
|
||||
MOCK_METHOD1(GetTextureLoadHandlerForImage,
|
||||
ITextureLoadHandler*(const char* ext));
|
||||
MOCK_METHOD0(CreateLightSource,
|
||||
struct ILightSource*());
|
||||
MOCK_METHOD1(DeleteLightSource,
|
||||
void(ILightSource* pLightSource));
|
||||
MOCK_METHOD0(GetLightEntities,
|
||||
const PodArray<ILightSource*>* ());
|
||||
MOCK_METHOD3(GetLightVolumes,
|
||||
void(threadID nThreadID, SLightVolume*& pLightVols, uint32& nNumVols));
|
||||
MOCK_METHOD4(RegisterVolumeForLighting,
|
||||
uint16(const Vec3& vPos, f32 fRadius, uint8 nClipVolumeRef, const SRenderingPassInfo& passInfo));
|
||||
MOCK_METHOD1(RestoreTerrainFromDisk,
|
||||
bool(int));
|
||||
MOCK_METHOD1(GetFilePath,
|
||||
const char*(const char* szFileName));
|
||||
MOCK_CONST_METHOD0(GetPostEffectGroups,
|
||||
class IPostEffectGroupManager*());
|
||||
MOCK_CONST_METHOD0(GetPostEffectBaseGroup,
|
||||
class IPostEffectGroup*());
|
||||
MOCK_CONST_METHOD3(SetPostEffectParam,
|
||||
void(const char* pParam, float fValue, bool bForceValue));
|
||||
MOCK_CONST_METHOD3(SetPostEffectParamVec4,
|
||||
void(const char* pParam, const Vec4& pValue, bool bForceValue));
|
||||
MOCK_CONST_METHOD2(SetPostEffectParamString,
|
||||
void(const char* pParam, const char* pszArg));
|
||||
MOCK_CONST_METHOD2(GetPostEffectParam,
|
||||
void(const char* pParam, float& fValue));
|
||||
MOCK_CONST_METHOD2(GetPostEffectParamVec4,
|
||||
void(const char* pParam, Vec4& pValue));
|
||||
MOCK_CONST_METHOD2(GetPostEffectParamString,
|
||||
void(const char* pParam, const char*& pszArg));
|
||||
MOCK_METHOD1(GetPostEffectID,
|
||||
int32(const char* pPostEffectName));
|
||||
MOCK_METHOD1(ResetPostEffects,
|
||||
void(bool));
|
||||
MOCK_METHOD0(DisablePostEffects,
|
||||
void());
|
||||
MOCK_METHOD1(SetShadowsGSMCache,
|
||||
void(bool bCache));
|
||||
MOCK_METHOD2(SetCachedShadowBounds,
|
||||
void(const AABB& shadowBounds, float fAdditionalCascadesScale));
|
||||
MOCK_METHOD1(SetRecomputeCachedShadows,
|
||||
void(uint));
|
||||
MOCK_METHOD0(CheckMemoryHeap,
|
||||
void());
|
||||
MOCK_METHOD1(DeleteEntityDecals,
|
||||
void(IRenderNode* pEntity));
|
||||
MOCK_METHOD0(LockCGFResources,
|
||||
void());
|
||||
MOCK_METHOD0(UnlockCGFResources,
|
||||
void());
|
||||
MOCK_METHOD0(FreeUnusedCGFResources,
|
||||
void());
|
||||
MOCK_METHOD0(CreateStatObj,
|
||||
IStatObj*());
|
||||
MOCK_METHOD1(CreateStatObjOptionalIndexedMesh,
|
||||
IStatObj*(bool createIndexedMesh));
|
||||
MOCK_METHOD0(CreateIndexedMesh,
|
||||
IIndexedMesh*());
|
||||
MOCK_METHOD1(SerializeState,
|
||||
void(TSerialize ser));
|
||||
MOCK_METHOD1(PostSerialize,
|
||||
void(bool bReading));
|
||||
MOCK_METHOD0(GetMaterialHelpers,
|
||||
IMaterialHelpers&());
|
||||
MOCK_METHOD0(GetMaterialManager,
|
||||
IMaterialManager*());
|
||||
MOCK_METHOD0(GetObjManager,
|
||||
IObjManager*());
|
||||
MOCK_METHOD1(CreateChunkfileContent,
|
||||
CContentCGF*(const char* filename));
|
||||
MOCK_METHOD1(ReleaseChunkfileContent,
|
||||
void(CContentCGF*));
|
||||
MOCK_METHOD4(LoadChunkFileContent,
|
||||
bool(CContentCGF* pCGF, const char* filename, bool bNoWarningMode, bool bCopyChunkFile));
|
||||
MOCK_METHOD6(LoadChunkFileContentFromMem,
|
||||
bool(CContentCGF* pCGF, const void* pData, size_t nDataLen, uint32 nLoadingFlags, bool bNoWarningMode, bool bCopyChunkFile));
|
||||
MOCK_METHOD1(CreateChunkFile,
|
||||
IChunkFile*(bool));
|
||||
MOCK_CONST_METHOD3(CreateChunkFileWriter,
|
||||
ChunkFile::IChunkFileWriter*(EChunkFileFormat eFormat, AZ::IO::IArchive* pPak, const char* filename));
|
||||
MOCK_CONST_METHOD1(ReleaseChunkFileWriter,
|
||||
void(ChunkFile::IChunkFileWriter* p));
|
||||
MOCK_METHOD2(CreateOcean,
|
||||
bool(_smart_ptr<IMaterial> pTerrainWaterMat, float waterLevel));
|
||||
MOCK_METHOD0(DeleteOcean,
|
||||
void());
|
||||
MOCK_METHOD1(ChangeOceanMaterial,
|
||||
void(_smart_ptr<IMaterial> pMat));
|
||||
MOCK_METHOD1(ChangeOceanWaterLevel,
|
||||
void(float fWaterLevel));
|
||||
MOCK_METHOD1(InitMaterialDefautMappingAxis
|
||||
, void(_smart_ptr<IMaterial> pMat));
|
||||
MOCK_METHOD0(GetIVisAreaManager,
|
||||
IVisAreaManager*());
|
||||
MOCK_METHOD3(PrecacheLevel,
|
||||
void(bool bPrecacheAllVisAreas, Vec3* pPrecachePoints, int nPrecachePointsNum));
|
||||
MOCK_METHOD0(ProposeContentPrecache,
|
||||
void());
|
||||
MOCK_METHOD0(GetTimeOfDay,
|
||||
ITimeOfDay*());
|
||||
MOCK_METHOD1(SetSkyMaterialPath,
|
||||
void(const string& skyMaterialPath));
|
||||
MOCK_METHOD1(SetSkyLowSpecMaterialPath,
|
||||
void(const string& skyMaterialPath));
|
||||
MOCK_METHOD0(LoadSkyMaterial,
|
||||
void());
|
||||
MOCK_METHOD0(GetSkyMaterial,
|
||||
_smart_ptr<IMaterial>());
|
||||
MOCK_METHOD1(SetSkyMaterial,
|
||||
void(_smart_ptr<IMaterial> pSkyMat));
|
||||
MOCK_METHOD2(SetGlobalParameter,
|
||||
void(E3DEngineParameter param, const Vec3& v));
|
||||
MOCK_METHOD2(GetGlobalParameter,
|
||||
void(E3DEngineParameter param, Vec3& v));
|
||||
MOCK_METHOD1(SetShadowMode,
|
||||
void(EShadowMode shadowMode));
|
||||
MOCK_CONST_METHOD0(GetShadowMode,
|
||||
EShadowMode());
|
||||
MOCK_METHOD6(AddPerObjectShadow,
|
||||
void(IShadowCaster* pCaster, float fConstBias, float fSlopeBias, float fJitter, const Vec3& vBBoxScale, uint nTexSize));
|
||||
MOCK_METHOD1(RemovePerObjectShadow,
|
||||
void(IShadowCaster* pCaster));
|
||||
MOCK_METHOD1(GetPerObjectShadow,
|
||||
struct SPerObjectShadow*(IShadowCaster* pCaster));
|
||||
MOCK_METHOD2(GetCustomShadowMapFrustums,
|
||||
void(struct ShadowMapFrustum*& arrFrustums, int& nFrustumCount));
|
||||
MOCK_METHOD2(SaveStatObj,
|
||||
int(IStatObj* pStatObj, TSerialize ser));
|
||||
MOCK_METHOD1(LoadStatObj,
|
||||
IStatObj*(TSerialize ser));
|
||||
MOCK_METHOD2(CheckIntersectClouds,
|
||||
bool(const Vec3& p1, const Vec3& p2));
|
||||
MOCK_METHOD1(OnRenderMeshDeleted,
|
||||
void(IRenderMesh* pRenderMesh));
|
||||
MOCK_METHOD0(DebugDraw_UpdateDebugNode,
|
||||
void());
|
||||
MOCK_METHOD4(RayObjectsIntersection2D,
|
||||
bool(Vec3 vStart, Vec3 vEnd, Vec3& vHitPoint, EERType eERType));
|
||||
MOCK_METHOD3(RenderMeshRayIntersection,
|
||||
bool(IRenderMesh* pRenderMesh, SRayHitInfo& hitInfo, _smart_ptr<IMaterial> pCustomMtl));
|
||||
MOCK_METHOD3(CheckCreateRNTmpData
|
||||
, void(CRNTmpData** ppInfo, IRenderNode* pRNode, const SRenderingPassInfo& passInfo));
|
||||
MOCK_METHOD1(FreeRNTmpData,
|
||||
void(CRNTmpData** ppInfo));
|
||||
MOCK_METHOD0(IsObjectTreeReady
|
||||
, bool());
|
||||
MOCK_METHOD0(GetIObjectTree
|
||||
, IOctreeNode*());
|
||||
MOCK_METHOD2(GetObjectsByType,
|
||||
uint32(EERType, IRenderNode**));
|
||||
MOCK_METHOD4(GetObjectsByTypeInBox,
|
||||
uint32(EERType objType, const AABB& bbox, IRenderNode** pObjects, ObjectTreeQueryFilterCallback filterCallback));
|
||||
MOCK_METHOD2(GetObjectsInBox,
|
||||
uint32(const AABB& bbox, IRenderNode** pObjects));
|
||||
MOCK_METHOD2(GetObjectsByFlags,
|
||||
uint32(uint, IRenderNode**));
|
||||
MOCK_METHOD4(GetObjectsByTypeInBox,
|
||||
void(EERType objType, const AABB& bbox, PodArray<IRenderNode*>* pLstObjects, ObjectTreeQueryFilterCallback filterCallback));
|
||||
MOCK_METHOD2(OnObjectModified,
|
||||
void(IRenderNode* pRenderNode, uint dwFlags));
|
||||
MOCK_METHOD1(FillDebugFPSInfo,
|
||||
void(SDebugFPSInfo&));
|
||||
MOCK_METHOD0(GetLevelFolder,
|
||||
const char*());
|
||||
MOCK_METHOD0(IsAreaActivationInUse,
|
||||
bool());
|
||||
MOCK_METHOD3(RenderRenderNode_ShadowPass,
|
||||
void(IShadowCaster* pRNode, const SRenderingPassInfo& passInfo, AZ::LegacyJobExecutor* pJobExecutor));
|
||||
MOCK_METHOD0(GetOpticsManager,
|
||||
IOpticsManager*());
|
||||
MOCK_METHOD0(SyncProcessStreamingUpdate,
|
||||
void());
|
||||
MOCK_METHOD1(SetScreenshotCallback,
|
||||
void(IScreenshotCallback* pCallback));
|
||||
MOCK_METHOD8(ActivateObjectsLayer,
|
||||
void(uint16 nLayerId, bool bActivate, bool bPhys, bool bObjects, bool bStaticLights, const char* pLayerName, IGeneralMemoryHeap* pHeap, bool bCheckLayerActivation));
|
||||
MOCK_CONST_METHOD4(GetLayerMemoryUsage,
|
||||
void(uint16 nLayerId, ICrySizer* pSizer, int* pNumBrushes, int* pNumDecals));
|
||||
MOCK_METHOD2(SkipLayerLoading,
|
||||
void(uint16 nLayerId, bool bClearList));
|
||||
MOCK_METHOD2(PrecacheRenderNode,
|
||||
void(IRenderNode* pObj, float fEntDistanceReal));
|
||||
MOCK_METHOD0(GetDeferredPhysicsEventManager,
|
||||
IDeferredPhysicsEventManager*());
|
||||
MOCK_METHOD1(SetStreamableListener,
|
||||
void(IStreamedObjectListener* pListener));
|
||||
MOCK_METHOD1(GetRenderingPassCamera,
|
||||
CCamera*(const CCamera& rCamera));
|
||||
MOCK_METHOD3(GetSvoStaticTextures,
|
||||
void(I3DEngine::SSvoStaticTexInfo& svoInfo, PodArray<I3DEngine::SLightTI>* pLightsTI_S, PodArray<I3DEngine::SLightTI>* pLightsTI_D));
|
||||
MOCK_METHOD2(GetSvoBricksForUpdate,
|
||||
void(PodArray<SSvoNodeInfo>& arrNodeInfo, bool getDynamic));
|
||||
#if defined(USE_GEOM_CACHES)
|
||||
MOCK_METHOD1(LoadGeomCache,
|
||||
IGeomCache*(const char* szFileName));
|
||||
MOCK_METHOD1(FindGeomCacheByFilename,
|
||||
IGeomCache*(const char* szFileName));
|
||||
#endif
|
||||
MOCK_METHOD3(LoadDesignerObject,
|
||||
IStatObj*(int nVersion, const char* szBinaryStream, int size));
|
||||
|
||||
MOCK_METHOD0(WaitForCullingJobsCompletion,
|
||||
void());
|
||||
};
|
||||
|
||||
@@ -12,11 +12,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <IRenderer.h>
|
||||
#include <I3DEngine.h> // needed for SRenderingPassInfo definition
|
||||
#include <IVideoRenderer.h>
|
||||
#include <IImage.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
|
||||
|
||||
@@ -37,12 +37,6 @@ public:
|
||||
void());
|
||||
MOCK_METHOD0(NeedDoWorkDuringOcclusionChecks,
|
||||
bool());
|
||||
MOCK_METHOD0(Render,
|
||||
void());
|
||||
MOCK_METHOD0(RenderBegin,
|
||||
void());
|
||||
MOCK_METHOD2(RenderEnd,
|
||||
void(bool, bool));
|
||||
MOCK_METHOD2(SynchronousLoadingTick,
|
||||
void(const char* pFunc, int line));
|
||||
MOCK_METHOD0(RenderStatistics,
|
||||
@@ -124,8 +118,6 @@ public:
|
||||
IMovieSystem * ());
|
||||
MOCK_METHOD0(GetIAudioSystem,
|
||||
Audio::IAudioSystem * ());
|
||||
MOCK_METHOD0(GetI3DEngine,
|
||||
I3DEngine * ());
|
||||
MOCK_METHOD0(GetIConsole,
|
||||
::IConsole * ());
|
||||
MOCK_METHOD0(GetIRemoteConsole,
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <ITimer.h>
|
||||
|
||||
//! Simple stub timer that exposes a single simple interface for setting the current time.
|
||||
class StubTimer
|
||||
: public ITimer
|
||||
|
||||
@@ -1,215 +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.
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(WIN32)
|
||||
#include "CryWindows.h"
|
||||
#include "IRenderer.h"
|
||||
#include "IImage.h"
|
||||
#include "smartptr.h"
|
||||
#include "ImageExtensionHelper.h"
|
||||
|
||||
// Types supported by CreateResourceFromTexture
|
||||
enum EResourceType
|
||||
{
|
||||
eResourceType_IconBig,
|
||||
eResourceType_IconSmall,
|
||||
eResourceType_Cursor,
|
||||
};
|
||||
|
||||
// Loads a (DDS) texture resource from the renderer into a Win32 GDI resource.
|
||||
// Returns a HICON that must be closed with DestroyIcon(), or NULL on failure.
|
||||
static HICON CreateResourceFromTexture(IRenderer* pRenderer, const char* path, EResourceType type)
|
||||
{
|
||||
if (!pRenderer || !path || !*path)
|
||||
{
|
||||
// Invalid parameter passed
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Find the target dimensions of the GDI resource
|
||||
const int nRequestedWidth = GetSystemMetrics(type == eResourceType_IconBig ? SM_CXICON : type == eResourceType_IconSmall ? SM_CXSMICON : SM_CXCURSOR);
|
||||
const int nRequestedHeight = GetSystemMetrics(type == eResourceType_IconBig ? SM_CYICON : type == eResourceType_IconSmall ? SM_CYSMICON : SM_CYCURSOR);
|
||||
if (nRequestedWidth != nRequestedHeight || nRequestedHeight <= 0 || nRequestedWidth <= 0)
|
||||
{
|
||||
// Don't support non-squares icons or cursors
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Load texture.
|
||||
// in this case, we want to fall back on a null, not substiture the missing texture.
|
||||
_smart_ptr<IImageFile> pImage = pRenderer->EF_LoadImage(path, FIM_NOFALLBACKS);
|
||||
if (!pImage || pImage->mfGet_depth() != 1 || pImage->mfGet_NumSides() != 1 || pImage->mfGetTileMode() != eTM_None)
|
||||
{
|
||||
// Can't load texture, or texture is a cube-map or volume texture, or uses tiling of some kind
|
||||
return NULL;
|
||||
}
|
||||
byte* pImgRaw = pImage->mfGet_image(0);
|
||||
const ETEX_Format texFormat = pImage->mfGetFormat();
|
||||
|
||||
// Pick first mip level smaller than the GDI resource
|
||||
int nMip = 0;
|
||||
size_t offset = 0;
|
||||
int nMipWidth = pImage->mfGet_width();
|
||||
int nMipHeight = pImage->mfGet_height();
|
||||
while (nMipWidth > nRequestedWidth)
|
||||
{
|
||||
++nMip;
|
||||
offset += pRenderer->GetTextureFormatDataSize(nMipWidth, nMipHeight, 1, 1, texFormat);
|
||||
nMipWidth = max(nMipWidth / 2, 1);
|
||||
nMipHeight = max(nMipHeight / 2, 1);
|
||||
}
|
||||
pImgRaw += offset;
|
||||
if (nMip >= pImage->mfGet_numMips())
|
||||
{
|
||||
// No appropriate mip in the texture
|
||||
// Note: Consider creating a full mip-chain on the texture so this can't happen
|
||||
return NULL;
|
||||
}
|
||||
const size_t nRawSize = pRenderer->GetTextureFormatDataSize(nMipWidth, nMipHeight, 1, 1, texFormat);
|
||||
|
||||
#if 0
|
||||
// Check that DDS indexing is correct here
|
||||
offset += nRawSize;
|
||||
for (int nIdx = nMip + 1; nIdx < pImage->mfGet_numMips(); ++nIdx)
|
||||
{
|
||||
const int w = max(nMipWidth >> (nIdx - nMip), 1);
|
||||
const int h = max(nMipHeight >> (nIdx - nMip), 1);
|
||||
offset += pRenderer->GetTextureFormatDataSize(w, h, 1, 1, texFormat);
|
||||
}
|
||||
assert(offset == pImage->mfGet_ImageSize());
|
||||
#endif
|
||||
|
||||
// Type of bitmap to create
|
||||
BITMAPV5HEADER bi = { 0 };
|
||||
bi.bV5Size = sizeof(BITMAPV5HEADER);
|
||||
bi.bV5Width = nRequestedWidth;
|
||||
bi.bV5Height = -nRequestedHeight;
|
||||
bi.bV5Planes = 1;
|
||||
bi.bV5BitCount = 32;
|
||||
bi.bV5Compression = BI_BITFIELDS;
|
||||
// The following mask specification specifies a supported 32 BPP alpha format for Windows XP+
|
||||
bi.bV5AlphaMask = 0xFF000000;
|
||||
bi.bV5RedMask = 0x00FF0000;
|
||||
bi.bV5GreenMask = 0x0000FF00;
|
||||
bi.bV5BlueMask = 0x000000FF;
|
||||
|
||||
// Create the DIB section with an alpha channel
|
||||
const HDC hdc = GetDC(NULL);
|
||||
void* lpBits;
|
||||
const HBITMAP hBitmap = CreateDIBSection(hdc, (BITMAPINFO*)&bi, DIB_RGB_COLORS, &lpBits, NULL, 0);
|
||||
ReleaseDC(NULL, hdc);
|
||||
if (!hBitmap || !lpBits)
|
||||
{
|
||||
// Can't allocate OS bitmap
|
||||
return NULL;
|
||||
}
|
||||
GdiFlush();
|
||||
|
||||
// Decompress texture
|
||||
const bool bTryDecompress = texFormat != eTF_R8G8B8A8 && texFormat != eTF_B8G8R8A8 && texFormat != eTF_B8G8R8X8;
|
||||
byte* const pImgDecomp = bTryDecompress ? new byte[nMipWidth * nMipHeight * sizeof(int32)] : pImgRaw;
|
||||
const bool bImgDecompressed = bTryDecompress && pRenderer->DXTDecompress(pImgRaw, nRawSize, pImgDecomp, nMipWidth, nMipHeight, 1, texFormat, false, sizeof(int32));
|
||||
|
||||
// Check which conversions need to be performed
|
||||
const bool bSRGB = (pImage->mfGet_Flags() & CImageExtensionHelper::EIF_SRGBRead) != 0;
|
||||
const bool bSwap = (texFormat == eTF_R8G8B8A8) || bTryDecompress;
|
||||
|
||||
HICON result = NULL;
|
||||
if (!bTryDecompress || bImgDecompressed)
|
||||
{
|
||||
// Assign texture data with mismatching sizes
|
||||
// Note: Any pixels not in the selected mip will become 100% transparent black, no resizing is performed
|
||||
const size_t sourceRowStride = nMipWidth;
|
||||
const size_t targetRowStride = nRequestedWidth;
|
||||
const uint32* pSourceRow = (uint32*)pImgDecomp;
|
||||
uint32* pTargetRow = (uint32*)lpBits;
|
||||
|
||||
assert(sourceRowStride <= targetRowStride);
|
||||
assert(nMipHeight <= nRequestedHeight);
|
||||
assert(pSourceRow != pTargetRow);
|
||||
assert(pSourceRow && pTargetRow);
|
||||
|
||||
uint8 gammaTable[256];
|
||||
if (!bSRGB)
|
||||
{
|
||||
// Linear to sRGB table
|
||||
const float gamma = 1.0f / 2.2f;
|
||||
const float gammaMultiplier = 255.0f / powf(255.0f, gamma);
|
||||
for (int i = 0; i < 256; ++i)
|
||||
{
|
||||
gammaTable[i] = uint8(powf(float(i), gamma) * gammaMultiplier);
|
||||
}
|
||||
}
|
||||
else if (bSwap)
|
||||
{
|
||||
// sRGB to sRGB table (no change)
|
||||
for (int i = 0; i < 256; ++i)
|
||||
{
|
||||
gammaTable[i] = uint8(i);
|
||||
}
|
||||
}
|
||||
|
||||
for (int y = 0; y < nMipHeight; ++y, pSourceRow += sourceRowStride, pTargetRow += targetRowStride)
|
||||
{
|
||||
if (!bSwap && bSRGB)
|
||||
{
|
||||
memcpy(pTargetRow, pSourceRow, sourceRowStride * sizeof(uint32));
|
||||
}
|
||||
else
|
||||
{
|
||||
const uint32* pSourceTexel = pSourceRow;
|
||||
uint32* pTargetTexel = pTargetRow;
|
||||
for (int x = 0; x < nMipWidth; ++x, ++pSourceTexel, ++pTargetTexel)
|
||||
{
|
||||
const uint8 red = gammaTable[uint8(*pSourceTexel >> 0)];
|
||||
const uint8 green = gammaTable[uint8(*pSourceTexel >> 8)];
|
||||
const uint8 blue = gammaTable[uint8(*pSourceTexel >> 16)];
|
||||
const uint32 alpha = *pSourceTexel & 0xFF000000;
|
||||
*pTargetTexel = (red << (bSwap ? 16 : 0)) | (green << 8) | (blue << (bSwap ? 0 : 16)) | alpha;
|
||||
}
|
||||
}
|
||||
|
||||
// Fill remaining columns with zeros
|
||||
memset(pTargetRow + sourceRowStride, 0, (targetRowStride - sourceRowStride) * sizeof(uint32));
|
||||
}
|
||||
|
||||
// Fill remaining rows with zeros
|
||||
for (int y = nMipHeight; y < nRequestedHeight; ++y)
|
||||
{
|
||||
memset(pTargetRow, 0, targetRowStride * sizeof(uint32));
|
||||
pTargetRow += targetRowStride;
|
||||
}
|
||||
|
||||
// Convert to GDI icon
|
||||
ICONINFO iconinfo = {0};
|
||||
iconinfo.fIcon = type == eResourceType_Cursor ? FALSE : TRUE;
|
||||
iconinfo.hbmMask = ::CreateBitmap(nRequestedWidth, nRequestedHeight, 1, 1, NULL);
|
||||
iconinfo.hbmColor = hBitmap;
|
||||
result = ::CreateIconIndirect(&iconinfo);
|
||||
DeleteObject(iconinfo.hbmMask);
|
||||
}
|
||||
|
||||
// Clean up
|
||||
DeleteObject(hBitmap);
|
||||
if (bTryDecompress)
|
||||
{
|
||||
delete[] pImgDecomp;
|
||||
}
|
||||
pImage.reset();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -14,9 +14,6 @@ set(FILES
|
||||
CryCommon.cpp
|
||||
Allocator.h
|
||||
FinalizingSpline.h
|
||||
Gem.h
|
||||
I3DEngine.h
|
||||
I3DEngine_info.h
|
||||
IAudioInterfacesCommonData.h
|
||||
IAudioSystem.h
|
||||
IChunkFile.h
|
||||
@@ -86,7 +83,6 @@ set(FILES
|
||||
ITexture.h
|
||||
IThreadManager.h
|
||||
IThreadTask.h
|
||||
ITimeOfDay.h
|
||||
ITimer.h
|
||||
IValidator.h
|
||||
IVideoRenderer.h
|
||||
@@ -143,7 +139,6 @@ set(FILES
|
||||
CryAssert.h
|
||||
CryCrc32.h
|
||||
CryCustomTypes.h
|
||||
CryEngineDecalInfo.h
|
||||
CryFile.h
|
||||
CryFixedArray.h
|
||||
CryFixedString.h
|
||||
@@ -292,7 +287,6 @@ set(FILES
|
||||
platform_impl.cpp
|
||||
Win32specific.h
|
||||
Win64specific.h
|
||||
WindowsUtils.h
|
||||
CryExtension/CryCreateClassInstance.h
|
||||
CryExtension/CryGUID.h
|
||||
CryExtension/CryTypeID.h
|
||||
@@ -317,7 +311,6 @@ set(FILES
|
||||
CryPool/STLWrapper.h
|
||||
CryPool/ThreadSafe.h
|
||||
stl/STLAlignedAlloc.h
|
||||
ILocalMemoryUsage.h
|
||||
Serialization/Assert.h
|
||||
Serialization/BitVector.h
|
||||
Serialization/BitVectorImpl.h
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#
|
||||
|
||||
set(FILES
|
||||
Mocks/I3DEngineMock.h
|
||||
Mocks/IAudioSystemMock.h
|
||||
Mocks/IConsoleMock.h
|
||||
Mocks/ICryPakMock.h
|
||||
|
||||
Reference in New Issue
Block a user