Merge branch 'main' into smoke_migration_branch
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icons / Toolbar / Non Uniform Scaling</title>
|
||||
<defs>
|
||||
<rect id="path-1" x="3" y="3" width="18" height="18"></rect>
|
||||
<mask id="mask-2" maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" x="0" y="0" width="18" height="18" fill="white">
|
||||
<use xlink:href="#path-1"></use>
|
||||
</mask>
|
||||
</defs>
|
||||
<g id="Icons-/-Toolbar-/-Non-Uniform-Scaling" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Group">
|
||||
<rect id="Icon-Background" x="0" y="0" width="24" height="24"></rect>
|
||||
<g id="Group-3" transform="translate(4.644661, 5.000000)" fill="#65C98C">
|
||||
<rect id="Rectangle" x="3.16582489" y="1.21320344" width="1.95262146" height="5"></rect>
|
||||
<polygon id="Rectangle" points="4.14213562 -1.71418435e-13 8.28427125 4.14213562 -1.11910481e-13 4.14213562"></polygon>
|
||||
</g>
|
||||
<g id="Group-4" transform="translate(13.073593, 10.857864)" fill="#65C98C">
|
||||
<g id="Group-2" transform="translate(0.000000, 0.000000)">
|
||||
<rect id="Rectangle" x="0" y="3.16582489" width="4" height="1.95262146"></rect>
|
||||
<polygon id="Rectangle" points="5.71320344 4.14213562 1.57106781 8.28427125 1.57106781 1.14575016e-13"></polygon>
|
||||
</g>
|
||||
</g>
|
||||
<rect id="Rectangle" stroke="#65C98C" fill="#65C98C" x="3.5" y="12.5" width="8" height="8"></rect>
|
||||
<use id="Rectangle" stroke="#65C98C" mask="url(#mask-2)" stroke-width="2" stroke-dasharray="1" xlink:href="#path-1"></use>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"Amazon": {
|
||||
"AssetProcessor": {
|
||||
"Settings": {
|
||||
"RC cgf": {
|
||||
"ignore": true
|
||||
},
|
||||
"RC fbx": {
|
||||
"ignore": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,5 +53,6 @@ set(GEM_DEPENDENCIES
|
||||
Gem::ImguiAtom
|
||||
Gem::Atom_AtomBridge
|
||||
Gem::AtomFont
|
||||
Gem::NvCloth
|
||||
Gem::Blast
|
||||
)
|
||||
|
||||
@@ -68,5 +68,6 @@ set(GEM_DEPENDENCIES
|
||||
Gem::ImguiAtom
|
||||
Gem::AtomFont
|
||||
Gem::AtomToolsFramework.Editor
|
||||
Gem::NvCloth.Editor
|
||||
Gem::Blast.Editor
|
||||
)
|
||||
|
||||
@@ -107,20 +107,21 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
endif()
|
||||
|
||||
## NvCloth ##
|
||||
# [TODO LYN-1928] Enable when AutomatedTesting runs with Atom
|
||||
#if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
# ly_add_pytest(
|
||||
# NAME AutomatedTesting::NvClothTests
|
||||
# TEST_SUITE main
|
||||
# TEST_SERIAL
|
||||
# PATH ${CMAKE_CURRENT_LIST_DIR}/NvCloth/TestSuite_Active.py
|
||||
# TIMEOUT 1500
|
||||
# RUNTIME_DEPENDENCIES
|
||||
# Legacy::Editor
|
||||
# AZ::AssetProcessor
|
||||
# AutomatedTesting.Assets
|
||||
# )
|
||||
#endif()
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::NvClothTests_Main
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/NvCloth/TestSuite_Active.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
NvCloth
|
||||
)
|
||||
endif()
|
||||
|
||||
## Editor Python Bindings ##
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
|
||||
+5
-3
@@ -11,7 +11,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
# Test case ID : C18977329
|
||||
# Test Case Title : Add cloth simulation to a Mesh
|
||||
# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/18977329
|
||||
|
||||
# fmt: off
|
||||
class Tests:
|
||||
@@ -20,7 +19,7 @@ class Tests:
|
||||
exit_game_mode = ("Exited game mode", "Failed to exit game mode")
|
||||
# fmt: on
|
||||
|
||||
def run():
|
||||
def C18977329_NvCloth_AddClothSimulationToMesh():
|
||||
"""
|
||||
Summary:
|
||||
Load level with Entity having Mesh and Cloth components already setup. Verify that editor remains stable in Game mode.
|
||||
@@ -89,4 +88,7 @@ def run():
|
||||
helper.close_editor()
|
||||
|
||||
if __name__ == "__main__":
|
||||
run()
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(C18977329_NvCloth_AddClothSimulationToMesh)
|
||||
|
||||
+5
-3
@@ -11,7 +11,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
# Test case ID : C18977330
|
||||
# Test Case Title : Add cloth simulation to an Actor
|
||||
# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/18977330
|
||||
|
||||
# fmt: off
|
||||
class Tests:
|
||||
@@ -20,7 +19,7 @@ class Tests:
|
||||
exit_game_mode = ("Exited game mode", "Failed to exit game mode")
|
||||
# fmt: on
|
||||
|
||||
def run():
|
||||
def C18977330_NvCloth_AddClothSimulationToActor():
|
||||
"""
|
||||
Summary:
|
||||
Load level with Entity having Actor and Cloth components already setup. Verify that editor remains stable in Game mode.
|
||||
@@ -89,4 +88,7 @@ def run():
|
||||
helper.close_editor()
|
||||
|
||||
if __name__ == "__main__":
|
||||
run()
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(C18977330_NvCloth_AddClothSimulationToActor)
|
||||
|
||||
@@ -21,14 +21,15 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesti
|
||||
|
||||
from base import TestAutomationBase
|
||||
|
||||
@pytest.mark.SUITE_main
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(TestAutomationBase):
|
||||
@pytest.mark.xfail(reason="Running with atom null renderer is causing this test to fail")
|
||||
def test_C18977329_NvCloth_AddClothSimulationToMesh(self, request, workspace, editor, launcher_platform):
|
||||
from . import C18977329_NvCloth_AddClothSimulationToMesh as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
@pytest.mark.xfail(reason="Running with atom null renderer is causing this test to fail")
|
||||
def test_C18977330_NvCloth_AddClothSimulationToActor(self, request, workspace, editor, launcher_platform):
|
||||
from . import C18977330_NvCloth_AddClothSimulationToActor as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
@@ -12,7 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
# Test case ID : C28798177
|
||||
# Test Case Title : White Box Tool Component can be added to an Entity
|
||||
# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/28798177
|
||||
|
||||
|
||||
# fmt:off
|
||||
|
||||
@@ -12,7 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
# Test case ID : C28798205
|
||||
# Test Case Title : From the White Box Component Card the White Box Mesh can be set to be invisible in Game View
|
||||
# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/28798205
|
||||
|
||||
|
||||
# fmt:off
|
||||
|
||||
@@ -12,7 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
# Test case ID : C29279329
|
||||
# Test Case Title : White Box mesh shape can be changed with the Default Shape dropdown on the Component
|
||||
# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/29279329
|
||||
|
||||
|
||||
# fmt:off
|
||||
|
||||
@@ -18,7 +18,7 @@ import pytest
|
||||
import editor_python_test_tools.hydra_test_utils as hydra
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
EDITOR_TIMEOUT = 120
|
||||
EDITOR_TIMEOUT = 300
|
||||
TEST_DIRECTORY = os.path.join(os.path.dirname(__file__), "atom_hydra_scripts")
|
||||
|
||||
|
||||
@@ -27,6 +27,155 @@ TEST_DIRECTORY = os.path.join(os.path.dirname(__file__), "atom_hydra_scripts")
|
||||
@pytest.mark.parametrize("level", ["auto_test"])
|
||||
class TestAtomEditorComponentsMain(object):
|
||||
|
||||
# It requires at least one test
|
||||
def test_Dummy(self, request, editor, level, workspace, project, launcher_platform):
|
||||
pass
|
||||
@pytest.mark.test_case_id(
|
||||
"C32078130", # Display Mapper
|
||||
"C32078129", # Light
|
||||
"C32078131", # Radius Weight Modifier
|
||||
"C32078127", # PostFX Layer
|
||||
"C32078125", # Physical Sky
|
||||
"C32078115", # Global Skylight (IBL)
|
||||
"C32078121", # Exposure Control
|
||||
"C32078120", # Directional Light
|
||||
"C32078119", # DepthOfField
|
||||
"C32078118") # Decal (Atom)
|
||||
def test_AtomEditorComponents_AddedToEntity(self, request, editor, level, workspace, project, launcher_platform):
|
||||
cfg_args = [level]
|
||||
|
||||
expected_lines = [
|
||||
# Decal (Atom) Component
|
||||
"Decal (Atom) Entity successfully created",
|
||||
"Decal (Atom)_test: Component added to the entity: True",
|
||||
"Decal (Atom)_test: Component removed after UNDO: True",
|
||||
"Decal (Atom)_test: Component added after REDO: True",
|
||||
"Decal (Atom)_test: Entered game mode: True",
|
||||
"Decal (Atom)_test: Exit game mode: True",
|
||||
"Decal (Atom) Controller|Configuration|Material: SUCCESS",
|
||||
"Decal (Atom)_test: Entity is hidden: True",
|
||||
"Decal (Atom)_test: Entity is shown: True",
|
||||
"Decal (Atom)_test: Entity deleted: True",
|
||||
"Decal (Atom)_test: UNDO entity deletion works: True",
|
||||
"Decal (Atom)_test: REDO entity deletion works: True",
|
||||
# DepthOfField Component
|
||||
"DepthOfField Entity successfully created",
|
||||
"DepthOfField_test: Component added to the entity: True",
|
||||
"DepthOfField_test: Component removed after UNDO: True",
|
||||
"DepthOfField_test: Component added after REDO: True",
|
||||
"DepthOfField_test: Entered game mode: True",
|
||||
"DepthOfField_test: Exit game mode: True",
|
||||
"DepthOfField_test: Entity disabled initially: True",
|
||||
"DepthOfField_test: Entity enabled after adding required components: True",
|
||||
"DepthOfField Controller|Configuration|Camera Entity: SUCCESS",
|
||||
"DepthOfField_test: Entity is hidden: True",
|
||||
"DepthOfField_test: Entity is shown: True",
|
||||
"DepthOfField_test: Entity deleted: True",
|
||||
"DepthOfField_test: UNDO entity deletion works: True",
|
||||
"DepthOfField_test: REDO entity deletion works: True",
|
||||
# Exposure Control Component
|
||||
"Exposure Control Entity successfully created",
|
||||
"Exposure Control_test: Component added to the entity: True",
|
||||
"Exposure Control_test: Component removed after UNDO: True",
|
||||
"Exposure Control_test: Component added after REDO: True",
|
||||
"Exposure Control_test: Entered game mode: True",
|
||||
"Exposure Control_test: Exit game mode: True",
|
||||
"Exposure Control_test: Entity disabled initially: True",
|
||||
"Exposure Control_test: Entity enabled after adding required components: True",
|
||||
"Exposure Control_test: Entity is hidden: True",
|
||||
"Exposure Control_test: Entity is shown: True",
|
||||
"Exposure Control_test: Entity deleted: True",
|
||||
"Exposure Control_test: UNDO entity deletion works: True",
|
||||
"Exposure Control_test: REDO entity deletion works: True",
|
||||
# Global Skylight (IBL) Component
|
||||
"Global Skylight (IBL) Entity successfully created",
|
||||
"Global Skylight (IBL)_test: Component added to the entity: True",
|
||||
"Global Skylight (IBL)_test: Component removed after UNDO: True",
|
||||
"Global Skylight (IBL)_test: Component added after REDO: True",
|
||||
"Global Skylight (IBL)_test: Entered game mode: True",
|
||||
"Global Skylight (IBL)_test: Exit game mode: True",
|
||||
"Global Skylight (IBL) Controller|Configuration|Diffuse Image: SUCCESS",
|
||||
"Global Skylight (IBL) Controller|Configuration|Specular Image: SUCCESS",
|
||||
"Global Skylight (IBL)_test: Entity is hidden: True",
|
||||
"Global Skylight (IBL)_test: Entity is shown: True",
|
||||
"Global Skylight (IBL)_test: Entity deleted: True",
|
||||
"Global Skylight (IBL)_test: UNDO entity deletion works: True",
|
||||
"Global Skylight (IBL)_test: REDO entity deletion works: True",
|
||||
# Physical Sky Component
|
||||
"Physical Sky Entity successfully created",
|
||||
"Physical Sky component was added to entity",
|
||||
"Entity has a Physical Sky component",
|
||||
"Physical Sky_test: Component added to the entity: True",
|
||||
"Physical Sky_test: Component removed after UNDO: True",
|
||||
"Physical Sky_test: Component added after REDO: True",
|
||||
"Physical Sky_test: Entered game mode: True",
|
||||
"Physical Sky_test: Exit game mode: True",
|
||||
"Physical Sky_test: Entity is hidden: True",
|
||||
"Physical Sky_test: Entity is shown: True",
|
||||
"Physical Sky_test: Entity deleted: True",
|
||||
"Physical Sky_test: UNDO entity deletion works: True",
|
||||
"Physical Sky_test: REDO entity deletion works: True",
|
||||
# PostFX Layer Component
|
||||
"PostFX Layer Entity successfully created",
|
||||
"PostFX Layer_test: Component added to the entity: True",
|
||||
"PostFX Layer_test: Component removed after UNDO: True",
|
||||
"PostFX Layer_test: Component added after REDO: True",
|
||||
"PostFX Layer_test: Entered game mode: True",
|
||||
"PostFX Layer_test: Exit game mode: True",
|
||||
"PostFX Layer_test: Entity is hidden: True",
|
||||
"PostFX Layer_test: Entity is shown: True",
|
||||
"PostFX Layer_test: Entity deleted: True",
|
||||
"PostFX Layer_test: UNDO entity deletion works: True",
|
||||
"PostFX Layer_test: REDO entity deletion works: True",
|
||||
# Radius Weight Modifier Component
|
||||
"Radius Weight Modifier Entity successfully created",
|
||||
"Radius Weight Modifier_test: Component added to the entity: True",
|
||||
"Radius Weight Modifier_test: Component removed after UNDO: True",
|
||||
"Radius Weight Modifier_test: Component added after REDO: True",
|
||||
"Radius Weight Modifier_test: Entered game mode: True",
|
||||
"Radius Weight Modifier_test: Exit game mode: True",
|
||||
"Radius Weight Modifier_test: Entity is hidden: True",
|
||||
"Radius Weight Modifier_test: Entity is shown: True",
|
||||
"Radius Weight Modifier_test: Entity deleted: True",
|
||||
"Radius Weight Modifier_test: UNDO entity deletion works: True",
|
||||
"Radius Weight Modifier_test: REDO entity deletion works: True",
|
||||
# Light Component
|
||||
"Light Entity successfully created",
|
||||
"Light_test: Component added to the entity: True",
|
||||
"Light_test: Component removed after UNDO: True",
|
||||
"Light_test: Component added after REDO: True",
|
||||
"Light_test: Entered game mode: True",
|
||||
"Light_test: Exit game mode: True",
|
||||
"Light_test: Entity is hidden: True",
|
||||
"Light_test: Entity is shown: True",
|
||||
"Light_test: Entity deleted: True",
|
||||
"Light_test: UNDO entity deletion works: True",
|
||||
"Light_test: REDO entity deletion works: True",
|
||||
# Display Mapper Component
|
||||
"Display Mapper Entity successfully created",
|
||||
"Display Mapper_test: Component added to the entity: True",
|
||||
"Display Mapper_test: Component removed after UNDO: True",
|
||||
"Display Mapper_test: Component added after REDO: True",
|
||||
"Display Mapper_test: Entered game mode: True",
|
||||
"Display Mapper_test: Exit game mode: True",
|
||||
"Display Mapper_test: Entity is hidden: True",
|
||||
"Display Mapper_test: Entity is shown: True",
|
||||
"Display Mapper_test: Entity deleted: True",
|
||||
"Display Mapper_test: UNDO entity deletion works: True",
|
||||
"Display Mapper_test: REDO entity deletion works: True",
|
||||
]
|
||||
|
||||
unexpected_lines = [
|
||||
"failed to open",
|
||||
"Traceback (most recent call last):",
|
||||
]
|
||||
|
||||
hydra.launch_and_validate_results(
|
||||
request,
|
||||
TEST_DIRECTORY,
|
||||
editor,
|
||||
"hydra_AtomEditorComponents_AddedToEntity.py",
|
||||
timeout=EDITOR_TIMEOUT,
|
||||
expected_lines=expected_lines,
|
||||
unexpected_lines=unexpected_lines,
|
||||
halt_on_unexpected=True,
|
||||
null_renderer=True,
|
||||
cfg_args=cfg_args,
|
||||
)
|
||||
|
||||
@@ -19,170 +19,6 @@ import pytest
|
||||
@pytest.mark.parametrize("level", ["auto_test"])
|
||||
class TestAtomEditorComponentsSandbox(object):
|
||||
|
||||
@pytest.mark.test_case_id(
|
||||
"C32078117", # Area Light
|
||||
"C32078130", # Display Mapper
|
||||
"C32078129", # Light
|
||||
"C32078131", # Radius Weight Modifier
|
||||
"C32078127", # PostFX Layer
|
||||
"C32078126", # Point Light
|
||||
"C32078125", # Physical Sky
|
||||
"C32078115", # Global Skylight (IBL)
|
||||
"C32078121", # Exposure Control
|
||||
"C32078120", # Directional Light
|
||||
"C32078119", # DepthOfField
|
||||
"C32078118") # Decal
|
||||
def test_AtomEditorComponents_AddedToEntity(self, request, editor, level, workspace, project, launcher_platform):
|
||||
cfg_args = [level]
|
||||
|
||||
expected_lines = [
|
||||
# Decal Component
|
||||
"Decal (Atom) Entity successfully created",
|
||||
"Decal (Atom)_test: Component added to the entity: True",
|
||||
"Decal (Atom)_test: Component removed after UNDO: True",
|
||||
"Decal (Atom)_test: Component added after REDO: True",
|
||||
"Decal (Atom)_test: Entered game mode: True",
|
||||
"Decal (Atom)_test: Exit game mode: True",
|
||||
"Decal (Atom) Controller|Configuration|Material: SUCCESS",
|
||||
"Decal (Atom)_test: Entity is hidden: True",
|
||||
"Decal (Atom)_test: Entity is shown: True",
|
||||
"Decal (Atom)_test: Entity deleted: True",
|
||||
"Decal (Atom)_test: UNDO entity deletion works: True",
|
||||
"Decal (Atom)_test: REDO entity deletion works: True",
|
||||
# DepthOfField Component
|
||||
"DepthOfField Entity successfully created",
|
||||
"DepthOfField_test: Component added to the entity: True",
|
||||
"DepthOfField_test: Component removed after UNDO: True",
|
||||
"DepthOfField_test: Component added after REDO: True",
|
||||
"DepthOfField_test: Entered game mode: True",
|
||||
"DepthOfField_test: Exit game mode: True",
|
||||
"DepthOfField_test: Entity disabled initially: True",
|
||||
"DepthOfField_test: Entity enabled after adding required components: True",
|
||||
"DepthOfField Controller|Configuration|Camera Entity: SUCCESS",
|
||||
"DepthOfField_test: Entity is hidden: True",
|
||||
"DepthOfField_test: Entity is shown: True",
|
||||
"DepthOfField_test: Entity deleted: True",
|
||||
"DepthOfField_test: UNDO entity deletion works: True",
|
||||
"DepthOfField_test: REDO entity deletion works: True",
|
||||
# Directional Light Component
|
||||
"Directional Light Entity successfully created",
|
||||
"Directional Light_test: Component added to the entity: True",
|
||||
"Directional Light_test: Component removed after UNDO: True",
|
||||
"Directional Light_test: Component added after REDO: True",
|
||||
"Directional Light_test: Entered game mode: True",
|
||||
"Directional Light_test: Exit game mode: True",
|
||||
"Directional Light Controller|Configuration|Shadow|Camera: SUCCESS",
|
||||
"Directional Light_test: Entity is hidden: True",
|
||||
"Directional Light_test: Entity is shown: True",
|
||||
"Directional Light_test: Entity deleted: True",
|
||||
"Directional Light_test: UNDO entity deletion works: True",
|
||||
"Directional Light_test: REDO entity deletion works: True",
|
||||
# Exposure Control Component
|
||||
"Exposure Control Entity successfully created",
|
||||
"Exposure Control_test: Component added to the entity: True",
|
||||
"Exposure Control_test: Component removed after UNDO: True",
|
||||
"Exposure Control_test: Component added after REDO: True",
|
||||
"Exposure Control_test: Entered game mode: True",
|
||||
"Exposure Control_test: Exit game mode: True",
|
||||
"Exposure Control_test: Entity disabled initially: True",
|
||||
"Exposure Control_test: Entity enabled after adding required components: True",
|
||||
"Exposure Control_test: Entity is hidden: True",
|
||||
"Exposure Control_test: Entity is shown: True",
|
||||
"Exposure Control_test: Entity deleted: True",
|
||||
"Exposure Control_test: UNDO entity deletion works: True",
|
||||
"Exposure Control_test: REDO entity deletion works: True",
|
||||
# Global Skylight (IBL) Component
|
||||
"Global Skylight (IBL) Entity successfully created",
|
||||
"Global Skylight (IBL)_test: Component added to the entity: True",
|
||||
"Global Skylight (IBL)_test: Component removed after UNDO: True",
|
||||
"Global Skylight (IBL)_test: Component added after REDO: True",
|
||||
"Global Skylight (IBL)_test: Entered game mode: True",
|
||||
"Global Skylight (IBL)_test: Exit game mode: True",
|
||||
"Global Skylight (IBL) Controller|Configuration|Diffuse Image: SUCCESS",
|
||||
"Global Skylight (IBL) Controller|Configuration|Specular Image: SUCCESS",
|
||||
"Global Skylight (IBL)_test: Entity is hidden: True",
|
||||
"Global Skylight (IBL)_test: Entity is shown: True",
|
||||
"Global Skylight (IBL)_test: Entity deleted: True",
|
||||
"Global Skylight (IBL)_test: UNDO entity deletion works: True",
|
||||
"Global Skylight (IBL)_test: REDO entity deletion works: True",
|
||||
# Physical Sky Component
|
||||
"Physical Sky Entity successfully created",
|
||||
"Physical Sky component was added to entity",
|
||||
"Entity has a Physical Sky component",
|
||||
"Physical Sky_test: Component added to the entity: True",
|
||||
"Physical Sky_test: Component removed after UNDO: True",
|
||||
"Physical Sky_test: Component added after REDO: True",
|
||||
"Physical Sky_test: Entered game mode: True",
|
||||
"Physical Sky_test: Exit game mode: True",
|
||||
"Physical Sky_test: Entity is hidden: True",
|
||||
"Physical Sky_test: Entity is shown: True",
|
||||
"Physical Sky_test: Entity deleted: True",
|
||||
"Physical Sky_test: UNDO entity deletion works: True",
|
||||
"Physical Sky_test: REDO entity deletion works: True",
|
||||
# PostFX Layer Component
|
||||
"PostFX Layer Entity successfully created",
|
||||
"PostFX Layer_test: Component added to the entity: True",
|
||||
"PostFX Layer_test: Component removed after UNDO: True",
|
||||
"PostFX Layer_test: Component added after REDO: True",
|
||||
"PostFX Layer_test: Entered game mode: True",
|
||||
"PostFX Layer_test: Exit game mode: True",
|
||||
"PostFX Layer_test: Entity is hidden: True",
|
||||
"PostFX Layer_test: Entity is shown: True",
|
||||
"PostFX Layer_test: Entity deleted: True",
|
||||
"PostFX Layer_test: UNDO entity deletion works: True",
|
||||
"PostFX Layer_test: REDO entity deletion works: True",
|
||||
# Radius Weight Modifier Component
|
||||
"Radius Weight Modifier Entity successfully created",
|
||||
"Radius Weight Modifier_test: Component added to the entity: True",
|
||||
"Radius Weight Modifier_test: Component removed after UNDO: True",
|
||||
"Radius Weight Modifier_test: Component added after REDO: True",
|
||||
"Radius Weight Modifier_test: Entered game mode: True",
|
||||
"Radius Weight Modifier_test: Exit game mode: True",
|
||||
"Radius Weight Modifier_test: Entity is hidden: True",
|
||||
"Radius Weight Modifier_test: Entity is shown: True",
|
||||
"Radius Weight Modifier_test: Entity deleted: True",
|
||||
"Radius Weight Modifier_test: UNDO entity deletion works: True",
|
||||
"Radius Weight Modifier_test: REDO entity deletion works: True",
|
||||
# Light Component
|
||||
"Light Entity successfully created",
|
||||
"Light_test: Component added to the entity: True",
|
||||
"Light_test: Component removed after UNDO: True",
|
||||
"Light_test: Component added after REDO: True",
|
||||
"Light_test: Entered game mode: True",
|
||||
"Light_test: Exit game mode: True",
|
||||
"Light_test: Entity is hidden: True",
|
||||
"Light_test: Entity is shown: True",
|
||||
"Light_test: Entity deleted: True",
|
||||
"Light_test: UNDO entity deletion works: True",
|
||||
"Light_test: REDO entity deletion works: True",
|
||||
# Display Mapper Component
|
||||
"Display Mapper Entity successfully created",
|
||||
"Display Mapper_test: Component added to the entity: True",
|
||||
"Display Mapper_test: Component removed after UNDO: True",
|
||||
"Display Mapper_test: Component added after REDO: True",
|
||||
"Display Mapper_test: Entered game mode: True",
|
||||
"Display Mapper_test: Exit game mode: True",
|
||||
"Display Mapper_test: Entity is hidden: True",
|
||||
"Display Mapper_test: Entity is shown: True",
|
||||
"Display Mapper_test: Entity deleted: True",
|
||||
"Display Mapper_test: UNDO entity deletion works: True",
|
||||
"Display Mapper_test: REDO entity deletion works: True",
|
||||
]
|
||||
|
||||
unexpected_lines = [
|
||||
"failed to open",
|
||||
"Traceback (most recent call last):",
|
||||
]
|
||||
|
||||
hydra.launch_and_validate_results(
|
||||
request,
|
||||
TEST_DIRECTORY,
|
||||
editor,
|
||||
"hydra_AtomEditorComponents_AddedToEntity.py",
|
||||
timeout=EDITOR_TIMEOUT,
|
||||
expected_lines=expected_lines,
|
||||
unexpected_lines=unexpected_lines,
|
||||
halt_on_unexpected=True,
|
||||
null_renderer=True,
|
||||
cfg_args=cfg_args,
|
||||
)
|
||||
# It requires at least one test
|
||||
def test_Dummy(self, request, editor, level, workspace, project, launcher_platform):
|
||||
pass
|
||||
|
||||
+1
-1
@@ -98,5 +98,5 @@ if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
|
||||
from utils import Report
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(C14861501_PhysXCollider_RenderMeshAutoAssigned)
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ def C14976308_ScriptCanvas_SetKinematicTargetTransform():
|
||||
the script deactivates Signal, Sphere's transform will update to that of Transform_Target.
|
||||
NOTE: There is a known bug (LY-107723) which causes the rotation to update to a value that is not sufficiently close
|
||||
to the expected result when using Set Kinematic Target which will cause the test to fail:
|
||||
https://jira.agscollab.com/browse/LY-107723
|
||||
LY-107723
|
||||
|
||||
Test Steps:
|
||||
1) Open level and enter game mode
|
||||
|
||||
@@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# Test case ID : C3510644
|
||||
# Test Case Title : Check that the collision layer and collision group of the terrain can be changed
|
||||
# and the collision behavior of the terrain changes accordingly
|
||||
# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/3510644
|
||||
|
||||
|
||||
# fmt: off
|
||||
|
||||
+1
-1
@@ -114,5 +114,5 @@ if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
|
||||
from utils import Report
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(C4044695_PhysXCollider_AddMultipleSurfaceFbx)
|
||||
|
||||
@@ -239,7 +239,7 @@ def C6321601_Force_HighValuesDirectionAxes():
|
||||
force_notification_handler.add_callback("OnCalculateNetForce", on_calc_net_force)
|
||||
|
||||
# Wait for 3 secs, because there is a known bug identified and filed in
|
||||
# JIRA https://jira.agscollab.com/browse/LY-107677
|
||||
# JIRA LY-107677
|
||||
# The error "[Error] Huge object being added to a COctreeNode, name: 'MeshComponentRenderNode', objBox:"
|
||||
# will show (if occured) in about 3 sec into the game mode.
|
||||
helper.wait_for_condition(has_physx_error, 3.0)
|
||||
|
||||
@@ -50,7 +50,7 @@ class TestAutomation(TestAutomationBase):
|
||||
unexpected_lines = ["Assert"]
|
||||
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
|
||||
|
||||
# BUG: https://jira.agscollab.com/browse/LY-107723")
|
||||
# BUG: LY-107723")
|
||||
def test_C14976308_ScriptCanvas_SetKinematicTargetTransform(self, request, workspace, editor):
|
||||
from . import C14976308_ScriptCanvas_SetKinematicTargetTransform as test_module
|
||||
|
||||
|
||||
@@ -429,6 +429,8 @@ class TestAutomation(TestAutomationBase):
|
||||
from . import C4976236_AddPhysxColliderComponent as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
@pytest.mark.xfail(
|
||||
reason="This will fail due to this issue ATOM-15487.")
|
||||
def test_C14861502_PhysXCollider_AssetAutoAssigned(self, request, workspace, editor, launcher_platform):
|
||||
from . import C14861502_PhysXCollider_AssetAutoAssigned as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
'''
|
||||
This unittest might have to be refactored once changes to Physmaterial_Editor.py are made.
|
||||
These changes will occur after the but, reverence below is resloved.
|
||||
Bug: https://jira.agscollab.com/browse/LY-107392
|
||||
Bug: LY-107392
|
||||
'''
|
||||
class Tests:
|
||||
opening_bad_file = ("Bad file could not be opened", "Bad file was opened")
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92569013
|
||||
Test Case Title: Script Event file can be created
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569013
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
Test case ID: T92568942
|
||||
Test Case Title: Clicking the "+" button and selecting "New Script Event" opens the
|
||||
Asset Editor with a new Script Event asset
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92568942
|
||||
"""
|
||||
|
||||
from PySide2 import QtWidgets
|
||||
|
||||
@@ -11,7 +11,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92568856
|
||||
Test Case Title: Multiple Entities can be targeted in the Debugger tool
|
||||
URLs of the test case: https://testrail.agscollab.com/index.php?/tests/view/92568856
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92569137
|
||||
Test Case Title: Multiple Graphs can be targeted in the Debugger tool
|
||||
URLs of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569137
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: C1702824
|
||||
Test Case Title: Docking
|
||||
URLs of the test case: https://testrail.agscollab.com/index.php?/cases/view/1702824
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -11,10 +11,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92569049
|
||||
Test Case Title: Edit > Undo undoes the last action
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569049
|
||||
Test case ID: T92569051
|
||||
Test Case Title: Edit > Redo redoes the last undone action
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569051
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92562978
|
||||
Test Case Title: Script Canvas Component can be added to an entity
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92562978
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -11,10 +11,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92569037
|
||||
Test Case Title: File > New Script creates a new script
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569037
|
||||
Test case ID: T92569039
|
||||
Test Case Title: File > Open opens the Open... dialog
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569039
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
@@ -11,11 +11,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92563070
|
||||
Test Case Title: Graphs can be closed by clicking X on the Graph name tab
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92563070
|
||||
Test case ID: T92563068
|
||||
Test Case Title: Save Prompt: User is prompted to save a graph on close after
|
||||
creating a new graph
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92563068
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
@@ -11,10 +11,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92569079
|
||||
Test Case Title: View > Zoom In zooms the graph in
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569079
|
||||
Test case ID: T92569081
|
||||
Test Case Title: View > Zoom In zooms the graph out
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569081
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ remove or modify any license notices. This file is distributed on an "AS IS" BAS
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
"""
|
||||
|
||||
|
||||
def init():
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../EditorPythonTestTools/editor_python_test_tools')
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
"""
|
||||
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.
|
||||
|
||||
Test case ID: T92562988
|
||||
Test Case Title: Left-click/double click expands and collapses node categories
|
||||
"""
|
||||
|
||||
|
||||
# fmt: off
|
||||
class Tests():
|
||||
pane_open = ("Script Canvas pane successfully opened", "Script Canvas pane failed to open")
|
||||
click_expand = ("Category expanded on left click", "Category failed to expand on left click")
|
||||
click_collapse = ("Category collapsed on left click", "Category failed to collapse on left click")
|
||||
dClick_expand = ("Category expanded on double click", "Category failed to expand on double click")
|
||||
dClick_collapse = ("Category collapsed on double click", "Category failed to collapse on double click")
|
||||
# fmt: on
|
||||
|
||||
|
||||
def NodeCategory_ExpandOnClick():
|
||||
"""
|
||||
Summary:
|
||||
Verifying the expand/collapse functionality on node categories
|
||||
|
||||
Expected Behavior:
|
||||
The node category should expand when double clicked or when the drop down indicator is
|
||||
left-clicked. Once expanded, it should be collapsed via the same actions.
|
||||
|
||||
Test Steps:
|
||||
1) Open Script Canvas pane
|
||||
2) Get the SC window objects
|
||||
3) Ensure all categories are collapsed for a clean state
|
||||
4) Left-Click on a node category arrow to expand it
|
||||
5) Verify it expanded
|
||||
6) Left-Click on a node category arrow to collapse it
|
||||
7) Verify it collapsed
|
||||
8) Double-Click on a node category to expand it
|
||||
9) Verify it expanded
|
||||
10) Double-Click on a node category to collapse it
|
||||
11) Verify it collapsed
|
||||
|
||||
Note:
|
||||
- This test file must be called from the Open 3D Engine Editor command terminal
|
||||
- Any passed and failed tests are written to the Editor.log file.
|
||||
Parsing the file or running a log_monitor are required to observe the test results.
|
||||
|
||||
:return: None
|
||||
"""
|
||||
from utils import Report
|
||||
from PySide2 import QtCore, QtWidgets, QtTest
|
||||
from PySide2.QtTest import QTest
|
||||
import pyside_utils
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
def left_click_arrow(item_view, index):
|
||||
original_state = item_view.isExpanded(index)
|
||||
rect_center_y = item_view.visualRect(index).center().y()
|
||||
rect_left_x = item_view.visualRect(index).left()
|
||||
for i in range(5): # this range can be increased for safe side
|
||||
QtTest.QTest.mouseClick(
|
||||
item_view.viewport(),
|
||||
QtCore.Qt.LeftButton,
|
||||
QtCore.Qt.NoModifier,
|
||||
QtCore.QPoint(rect_left_x - i, rect_center_y),
|
||||
)
|
||||
if item_view.isExpanded(index) != original_state:
|
||||
break
|
||||
|
||||
def double_click(item_view, index):
|
||||
item_index_center = item_view.visualRect(index).center()
|
||||
# Left click on the item before trying to double click, will otherwise fail to expand
|
||||
# as first click would highlight and second click would be a 'single click'
|
||||
pyside_utils.item_view_index_mouse_click(item_view, index)
|
||||
QTest.mouseDClick(item_view.viewport(), QtCore.Qt.LeftButton, QtCore.Qt.NoModifier, item_index_center)
|
||||
|
||||
# 1) Open Script Canvas pane
|
||||
general.open_pane("Script Canvas")
|
||||
Report.critical_result(Tests.pane_open, general.is_pane_visible("Script Canvas"))
|
||||
|
||||
# 2) Get the SC window objects
|
||||
editor_window = pyside_utils.get_editor_main_window()
|
||||
sc = editor_window.findChild(QtWidgets.QDockWidget, "Script Canvas")
|
||||
if sc.findChild(QtWidgets.QDockWidget, "NodePalette") is None:
|
||||
action = pyside_utils.find_child_by_pattern(sc, {"text": "Node Palette", "type": QtWidgets.QAction})
|
||||
action.trigger()
|
||||
node_palette = sc.findChild(QtWidgets.QDockWidget, "NodePalette")
|
||||
nodeTree = node_palette.findChild(QtWidgets.QTreeView, "treeView")
|
||||
ai_index = pyside_utils.find_child_by_pattern(nodeTree, "AI")
|
||||
|
||||
# 3) Ensure all categories are collapsed for a clean state
|
||||
nodeTree.collapseAll()
|
||||
|
||||
# 4) Left-Click on a node category arrow to expand it
|
||||
left_click_arrow(nodeTree, ai_index)
|
||||
|
||||
# 5) Verify it expanded
|
||||
Report.result(Tests.click_expand, nodeTree.isExpanded(ai_index))
|
||||
|
||||
# 6) Left-Click on a node category arrow to collapse it
|
||||
left_click_arrow(nodeTree, ai_index)
|
||||
|
||||
# 7) Verify it collapsed
|
||||
Report.result(Tests.click_collapse, not nodeTree.isExpanded(ai_index))
|
||||
|
||||
# 8) Double-Click on a node category to expand it
|
||||
double_click(nodeTree, ai_index)
|
||||
|
||||
# 9) Verify it expanded
|
||||
Report.result(Tests.dClick_expand, nodeTree.isExpanded(ai_index))
|
||||
|
||||
# 10) Double-Click on a node category to collapse it
|
||||
double_click(nodeTree, ai_index)
|
||||
|
||||
# 11) Verify it collapsed
|
||||
Report.result(Tests.dClick_collapse, not nodeTree.isExpanded(ai_index))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
from utils import Report
|
||||
Report.start_test(NodeCategory_ExpandOnClick)
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92568982
|
||||
Test Case Title: Renaming variables in the Node Inspector
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92568982
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92562993
|
||||
Test Case Title: Clicking the X button on the Search Box clears the currently entered string
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92562993
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
"""
|
||||
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.
|
||||
"""
|
||||
|
||||
|
||||
# fmt: off
|
||||
class Tests():
|
||||
set_search_string = ("Search string is set", "Search string is not set")
|
||||
search_string_deleted = ("Search string deleted as expected", "Search string not deleted")
|
||||
# fmt: on
|
||||
|
||||
|
||||
def NodePalette_SearchText_Deletion():
|
||||
"""
|
||||
Summary:
|
||||
We enter some string in the Node Palette Search box, select that text and delete it.
|
||||
|
||||
Expected Behavior:
|
||||
After RightClick->Delete the text in the Searchbox should be deleted.
|
||||
|
||||
Test Steps:
|
||||
1) Open Script Canvas window (Tools > Script Canvas)
|
||||
2) Get the SC window object
|
||||
3) Open Node Manager if not opened already
|
||||
4) Set some string in the Search box
|
||||
5) Verify if the test string is set
|
||||
6) Delete search string using right click and verify if it is cleared
|
||||
|
||||
Note:
|
||||
- This test file must be called from the Open 3D Engine Editor command terminal
|
||||
- Any passed and failed tests are written to the Editor.log file.
|
||||
Parsing the file or running a log_monitor are required to observe the test results.
|
||||
|
||||
:return: None
|
||||
"""
|
||||
|
||||
from PySide2 import QtWidgets, QtTest, QtCore
|
||||
|
||||
from utils import TestHelper as helper
|
||||
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
import pyside_utils
|
||||
|
||||
TEST_STRING = "TestString"
|
||||
|
||||
# 1) Open Script Canvas window (Tools > Script Canvas)
|
||||
general.idle_enable(True)
|
||||
general.open_pane("Script Canvas")
|
||||
helper.wait_for_condition(lambda: general.is_pane_visible("Script Canvas"), 3.0)
|
||||
|
||||
# 2) Get the SC window object
|
||||
editor_window = pyside_utils.get_editor_main_window()
|
||||
sc = editor_window.findChild(QtWidgets.QDockWidget, "Script Canvas")
|
||||
|
||||
# 3) Open Node Manager if not opened already
|
||||
if sc.findChild(QtWidgets.QDockWidget, "NodePalette") is None:
|
||||
action = pyside_utils.find_child_by_pattern(sc, {"text": "Node Palette", "type": QtWidgets.QAction})
|
||||
action.trigger()
|
||||
node_palette = sc.findChild(QtWidgets.QDockWidget, "NodePalette")
|
||||
search_frame = node_palette.findChild(QtWidgets.QFrame, "searchFrame")
|
||||
|
||||
# 4) Set some string in the Search box
|
||||
search_box = search_frame.findChild(QtWidgets.QLineEdit, "searchFilter")
|
||||
search_box.setText(TEST_STRING)
|
||||
|
||||
# 5) Verify if the test string is set
|
||||
result = helper.wait_for_condition(lambda: search_box.text() == TEST_STRING, 1.0)
|
||||
Report.result(Tests.set_search_string, result)
|
||||
|
||||
# 6) Delete search string using right click and verify if it is cleared
|
||||
QtTest.QTest.keyClick(search_box, QtCore.Qt.Key_A, QtCore.Qt.ControlModifier)
|
||||
pyside_utils.trigger_context_menu_entry(search_box, "Delete")
|
||||
result = helper.wait_for_condition(lambda: search_box.text() == "", 2.0)
|
||||
Report.result(Tests.search_string_deleted, result)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
|
||||
imports.init()
|
||||
from utils import Report
|
||||
|
||||
Report.start_test(NodePalette_SearchText_Deletion)
|
||||
@@ -11,7 +11,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92568940
|
||||
Test Case Title: Categories and Nodes can be selected
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92568940
|
||||
"""
|
||||
|
||||
|
||||
|
||||
-1
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92569253 // T92569254
|
||||
Test Case Title: On Entity Activated // On Entity Deactivated
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569253 // https://testrail.agscollab.com/index.php?/tests/view/92569254
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: C1702834 // C1702823
|
||||
Test Case Title: Opening pane // Closing pane
|
||||
URLs of the test case: https://testrail.agscollab.com/index.php?/cases/view/1702834 and
|
||||
https://testrail.agscollab.com/index.php?/cases/view/1702823
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: C1702821 // C1702832
|
||||
Test Case Title: Retain visibility, size and location upon Script Canvas restart
|
||||
URLs of the test case: https://testrail.agscollab.com/index.php?/cases/view/1702821 and
|
||||
https://testrail.agscollab.com/index.php?/cases/view/1702832
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: C1702829
|
||||
Test Case Title: Resizing pane
|
||||
URLs of the test case: https://testrail.agscollab.com/index.php?/cases/view/1702829
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
Test case ID: T92562986
|
||||
Test Case Title: Changing the assigned Script Canvas Asset on an entity properly updates
|
||||
level functionality
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92562986
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92563190
|
||||
Test Case Title: A single Entity with two Script Canvas components works properly
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92563190
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92563191
|
||||
Test Case Title: Two Entities can use the same Graph asset successfully at RunTime
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92563191
|
||||
"""
|
||||
|
||||
|
||||
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
"""
|
||||
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.
|
||||
|
||||
Test Case Title: Event can return a value of set type successfully
|
||||
"""
|
||||
|
||||
|
||||
# fmt: off
|
||||
class Tests():
|
||||
level_created = ("Successfully created temporary level", "Failed to create temporary level")
|
||||
entity_created = ("Successfully created test entity", "Failed to create test entity")
|
||||
enter_game_mode = ("Successfully entered game mode", "Failed to enter game mode")
|
||||
lines_found = ("Successfully found expected message", "Failed to find expected message")
|
||||
exit_game_mode = ("Successfully exited game mode", "Failed to exit game mode")
|
||||
# fmt: on
|
||||
|
||||
|
||||
def ScriptEvents_ReturnSetType_Successfully():
|
||||
"""
|
||||
Summary: A temporary level is created with an Entity having ScriptCanvas component.
|
||||
ScriptEvent(T92569006_ScriptEvent.scriptevents) is created with one Method that has a return value.
|
||||
ScriptCanvas(T92569006_ScriptCanvas.scriptcanvas) is attached to Entity. Graph has Send node that sends the Method
|
||||
of the ScriptEvent and prints the returned result ( On Entity Activated -> Send node -> Print) and Receive node is
|
||||
set to return custom value ( Receive node -> Print).
|
||||
Verify that the entity containing T92569006_ScriptCanvas.scriptcanvas should print the custom value set in both
|
||||
Send and Receive nodes.
|
||||
|
||||
Expected Behavior:
|
||||
After entering game mode, the graph on the entity should print an expected message to the console
|
||||
|
||||
Test Steps:
|
||||
1) Create test level
|
||||
2) Create test entity
|
||||
3) Start Tracer
|
||||
4) Enter Game Mode
|
||||
5) Read for line
|
||||
6) Exit Game Mode
|
||||
|
||||
Note:
|
||||
- This test file must be called from the Open 3D Engine Editor command terminal
|
||||
- Any passed and failed tests are written to the Editor.log file.
|
||||
Parsing the file or running a log_monitor are required to observe the test results.
|
||||
|
||||
:return: None
|
||||
"""
|
||||
import os
|
||||
from editor_entity_utils import EditorEntity as Entity
|
||||
from utils import Report
|
||||
from utils import TestHelper as helper
|
||||
from utils import Tracer
|
||||
|
||||
import azlmbr.legacy.general as general
|
||||
import azlmbr.asset as asset
|
||||
import azlmbr.math as math
|
||||
import azlmbr.bus as bus
|
||||
|
||||
LEVEL_NAME = "tmp_level"
|
||||
WAIT_TIME = 3.0 # SECONDS
|
||||
EXPECTED_LINES = ["T92569006_ScriptEvent_Sent", "T92569006_ScriptEvent_Received"]
|
||||
SC_ASSET_PATH = os.path.join("ScriptCanvas", "T92569006_ScriptCanvas.scriptcanvas")
|
||||
|
||||
def create_editor_entity(name, sc_asset):
|
||||
entity = Entity.create_editor_entity(name)
|
||||
sc_comp = entity.add_component("Script Canvas")
|
||||
asset_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", sc_asset, math.Uuid(), False)
|
||||
sc_comp.set_component_property_value("Script Canvas Asset|Script Canvas Asset", asset_id)
|
||||
Report.critical_result(Tests.entity_created, entity.id.isValid())
|
||||
|
||||
def locate_expected_lines(line_list: list):
|
||||
found_lines = [printInfo.message.strip() for printInfo in section_tracer.prints]
|
||||
|
||||
return all(line in found_lines for line in line_list)
|
||||
|
||||
# 1) Create temp level
|
||||
general.idle_enable(True)
|
||||
result = general.create_level_no_prompt(LEVEL_NAME, 128, 1, 512, True)
|
||||
Report.critical_result(Tests.level_created, result == 0)
|
||||
helper.wait_for_condition(lambda: general.get_current_level_name() == LEVEL_NAME, WAIT_TIME)
|
||||
general.close_pane("Error Report")
|
||||
|
||||
# 2) Create test entity
|
||||
create_editor_entity("TestEntity", SC_ASSET_PATH)
|
||||
|
||||
# 3) Start Tracer
|
||||
with Tracer() as section_tracer:
|
||||
|
||||
# 4) Enter Game Mode
|
||||
helper.enter_game_mode(Tests.enter_game_mode)
|
||||
|
||||
# 5) Read for line
|
||||
lines_located = helper.wait_for_condition(lambda: locate_expected_lines(EXPECTED_LINES), WAIT_TIME)
|
||||
Report.result(Tests.lines_found, lines_located)
|
||||
|
||||
# 6) Exit Game Mode
|
||||
helper.exit_game_mode(Tests.exit_game_mode)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
|
||||
imports.init()
|
||||
|
||||
from utils import Report
|
||||
|
||||
Report.start_test(ScriptEvents_ReturnSetType_Successfully)
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92567321
|
||||
Test Case Title: Script Events: Can send and receive a script event across multiple entities successfully
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92567321
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92567320
|
||||
Test Case Title: Script Events: Can send and receive a script event successfully
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92567320
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -183,6 +183,23 @@ class TestAutomation(TestAutomationBase):
|
||||
from . import ScriptEvents_SendReceiveSuccessfully as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
@pytest.mark.parametrize("level", ["tmp_level"])
|
||||
def test_ScriptEvents_ReturnSetType_Successfully(self, request, workspace, editor, launcher_platform, project, level):
|
||||
def teardown():
|
||||
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
|
||||
request.addfinalizer(teardown)
|
||||
file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True)
|
||||
from . import ScriptEvents_ReturnSetType_Successfully as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_NodeCategory_ExpandOnClick(self, request, workspace, editor, launcher_platform):
|
||||
from . import NodeCategory_ExpandOnClick as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_NodePalette_SearchText_Deletion(self, request, workspace, editor, launcher_platform):
|
||||
from . import NodePalette_SearchText_Deletion as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
# NOTE: We had to use hydra_test_utils.py, as TestAutomationBase run_test method
|
||||
# fails because of pyside_utils import
|
||||
@pytest.mark.SUITE_periodic
|
||||
@@ -251,4 +268,4 @@ class TestScriptCanvasTests(object):
|
||||
expected_lines,
|
||||
auto_test_mode=False,
|
||||
timeout=60,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -13,11 +13,6 @@ Test Case Title: Tools > Node Palette toggles the Node Palette
|
||||
Tools > Node Inspector toggles the Node Inspector
|
||||
Tools > Bookmarks toggles the Bookmarks
|
||||
Tools > Variable Manager toggles the Variable Manager
|
||||
|
||||
URLs of the test case: https://testrail.agscollab.com/index.php?/cases/view/92569165
|
||||
https://testrail.agscollab.com/index.php?/cases/view/92569167
|
||||
https://testrail.agscollab.com/index.php?/cases/view/92569168
|
||||
https://testrail.agscollab.com/index.php?/cases/view/92569170
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: C1702825 // C1702831
|
||||
Test Case Title: Undocking // Closing script canvas with the pane floating
|
||||
URLs of the test case: https://testrail.agscollab.com/index.php?/cases/view/1702825 &
|
||||
https://testrail.agscollab.com/index.php?/cases/view/1702831
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,10 +10,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92564789
|
||||
Test Case Title: Each Variable type can be created
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92564789
|
||||
Test case ID: T92568873
|
||||
Test Case Title: Each Variable type can be deleted
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92568873
|
||||
"""
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a2a3360287a4711882c4254d64ca2ba70cd743012a7d38ca29aa2a57f151efaa
|
||||
size 6661
|
||||
oid sha256:e15d484113e8151072b410924747a8ad304f6f12457fad577308c0491693ab34
|
||||
size 5472
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<download name="C18977329_NvCloth_AddClothSimulationToMesh" type="Map">
|
||||
<index src="filelist.xml" dest="filelist.xml"/>
|
||||
<files>
|
||||
<file src="level.pak" dest="level.pak" size="9946" md5="7368d6ce15bfc09a92f694efe73a00ec"/>
|
||||
<file src="level.pak" dest="level.pak" size="97C8" md5="64e64e1e3345dacace01dde152c72250"/>
|
||||
</files>
|
||||
</download>
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cd8105f020151e65093988dfb09ab42ff8d33ef5b97c61fbe0011384870aadf8
|
||||
size 39238
|
||||
oid sha256:64de37c805b0be77cdb7a85b5406af58b7f845e7d97fec1721ac5d789bb641db
|
||||
size 38856
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f53fb5e096ff562e9f0f12856ce387891596776d086f49c7ed3a59dcd0a0c11a
|
||||
size 6535
|
||||
oid sha256:7b595323d4d51211463dea0338abb6ce2a4a0a8d41efb12ac3c9dccd1f972171
|
||||
size 5504
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<download name="C18977330_NvCloth_AddClothSimulationToActor" type="Map">
|
||||
<index src="filelist.xml" dest="filelist.xml"/>
|
||||
<files>
|
||||
<file src="level.pak" dest="level.pak" size="990B" md5="7c17ac9bc5bd3e14e196b731a7e8eed7"/>
|
||||
<file src="level.pak" dest="level.pak" size="9941" md5="297730934d657d7ca57a7357ee9cd566"/>
|
||||
</files>
|
||||
</download>
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:87fbd9fda267daa505f11276b64f47c26115bee9e6d14f2a6f5a1cf1e1234218
|
||||
size 39179
|
||||
oid sha256:617c455668fc41cb7fd69de690e4aa3c80f2cb36deaa371902b79de18fcd1cb2
|
||||
size 39233
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,126 @@
|
||||
<ObjectStream version="3">
|
||||
<Class name="ScriptEventsAsset" version="1" type="{CB4D603E-8CB0-4D80-8165-4244F28AF187}">
|
||||
<Class name="ScriptEvent" field="m_definition" version="1" type="{10A08CD3-32C9-4E18-8039-4B8A8157918E}">
|
||||
<Class name="unsigned int" field="m_version" value="4" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="VersionedProperty" field="m_name" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{1E4A668C-8300-4047-AEA2-F5FEBF11EBA0}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Name" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="1" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}">
|
||||
<Class name="VersionedProperty" field="element" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{1E4A668C-8300-4047-AEA2-F5FEBF11EBA0}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Name" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZStd::string" field="m_data" value="EventName" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZStd::string" field="m_data" value="T92569006_ScriptEvent" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="VersionedProperty" field="m_category" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{73D97530-40F2-48FD-91BA-C20ABB0C6620}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Category" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZStd::string" field="m_data" value="Script Events" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="VersionedProperty" field="m_tooltip" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{9D4BB4C1-8A94-43B9-BED7-C104D7758916}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Tooltip" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZStd::string" field="m_data" value="" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="VersionedProperty" field="m_addressType" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{8D528B1F-1FEE-43BA-BD5D-C7EB3707B781}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Address Type" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZ::Uuid" field="m_data" value="{C0F1AFAD-5CB3-450E-B0F5-ADB5D46B0E22}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::vector" field="m_methods" type="{D9866B79-D11A-58E6-B974-0B45783F53A4}">
|
||||
<Class name="Method" field="element" type="{E034EA83-C798-413D-ACE8-4923C51CF4F7}">
|
||||
<Class name="VersionedProperty" field="m_name" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{0DEB2C25-6B32-44B7-9750-56CAA789C016}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Name" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZStd::string" field="m_data" value="MethodName" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="VersionedProperty" field="m_tooltip" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{664A28E6-AD74-4EA7-BDE8-49CA02D1C5C7}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Tooltip" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZStd::string" field="m_data" value="" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="VersionedProperty" field="m_returnType" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{D2C6D979-A036-4523-B79E-98D3A1D4F623}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="String" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="1" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}">
|
||||
<Class name="VersionedProperty" field="element" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{A2629A45-21A2-4101-BF0D-1F843B3398D7}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Return Type" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZ::Uuid" field="m_data" value="{C0F1AFAD-5CB3-450E-B0F5-ADB5D46B0E22}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZ::Uuid" field="m_data" value="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::vector" field="m_parameters" type="{6ED13EA7-791B-57A8-A4F1-560B5F35B472}">
|
||||
<Class name="Parameter" field="element" type="{0DA4809B-08A6-49DC-9024-F81645D97FAC}">
|
||||
<Class name="VersionedProperty" field="m_name" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{CD536CCB-29E7-4155-8C20-E37FA3B3A3D2}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Name" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZStd::string" field="m_data" value="ParameterName" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="VersionedProperty" field="m_tooltip" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{62907B85-6C12-49E3-8A92-82E41AF029D5}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Tooltip" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZStd::string" field="m_data" value="" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="VersionedProperty" field="m_type" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{E3509DD4-13B0-4096-8AC4-115D9A8BCD6B}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="String" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZ::Uuid" field="m_data" value="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</ObjectStream>
|
||||
|
||||
+29
-6
@@ -25,13 +25,37 @@ include(cmake/LySet.cmake)
|
||||
include(cmake/Version.cmake)
|
||||
include(cmake/OutputDirectory.cmake)
|
||||
|
||||
# Set the engine_path and engine_json
|
||||
set(o3de_engine_path ${CMAKE_CURRENT_LIST_DIR})
|
||||
set(o3de_engine_json ${o3de_engine_path}/engine.json)
|
||||
|
||||
if(NOT PROJECT_NAME)
|
||||
project(O3DE
|
||||
LANGUAGES C CXX
|
||||
VERSION ${LY_VERSION_STRING}
|
||||
)
|
||||
|
||||
# o3de manifest
|
||||
include(cmake/o3de_manifest.cmake)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Resolve this engines name and restricted path
|
||||
################################################################################
|
||||
o3de_engine_name(${o3de_engine_json} o3de_engine_name)
|
||||
o3de_restricted_path(${o3de_engine_json} o3de_engine_restricted_path)
|
||||
message(STATUS "O3DE Engine Name: ${o3de_engine_name}")
|
||||
message(STATUS "O3DE Engine Path: ${o3de_engine_path}")
|
||||
if(o3de_engine_restricted_path)
|
||||
message(STATUS "O3DE Engine Restricted Path: ${o3de_engine_restricted_path}")
|
||||
endif()
|
||||
|
||||
# add the engines cmake folder to the CMAKE_MODULE_PATH
|
||||
list(APPEND CMAKE_MODULE_PATH "${o3de_engine_path}/cmake")
|
||||
|
||||
################################################################################
|
||||
# Initialize
|
||||
################################################################################
|
||||
include(cmake/GeneralSettings.cmake)
|
||||
include(cmake/FileUtil.cmake)
|
||||
include(cmake/PAL.cmake)
|
||||
@@ -60,20 +84,19 @@ include(cmake/Projects.cmake)
|
||||
if(NOT INSTALLED_ENGINE)
|
||||
# Add the rest of the targets
|
||||
add_subdirectory(Code)
|
||||
add_subdirectory(Gems)
|
||||
else()
|
||||
ly_find_o3de_packages()
|
||||
endif()
|
||||
|
||||
# Add external subdirectories listed in the manifest
|
||||
list(APPEND LY_EXTERNAL_SUBDIRS ${o3de_engine_external_subdirectories})
|
||||
|
||||
set(enabled_platforms
|
||||
${PAL_PLATFORM_NAME}
|
||||
${LY_PAL_TOOLS_ENABLED})
|
||||
|
||||
foreach(restricted_platform ${PAL_RESTRICTED_PLATFORMS})
|
||||
if(restricted_platform IN_LIST enabled_platforms)
|
||||
add_subdirectory(restricted/${restricted_platform})
|
||||
endif()
|
||||
endforeach()
|
||||
# Add any engine restricted platforms as external subdirs
|
||||
o3de_add_engine_restricted_platform_external_subdirs()
|
||||
|
||||
if(NOT INSTALLED_ENGINE)
|
||||
add_subdirectory(scripts)
|
||||
|
||||
@@ -1,158 +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 __CREBASECLOUD_H__
|
||||
#define __CREBASECLOUD_H__
|
||||
|
||||
//================================================================================
|
||||
|
||||
class SCloudParticle
|
||||
{
|
||||
public:
|
||||
inline SCloudParticle();
|
||||
inline SCloudParticle(const Vec3& vPos, float fRadius, const ColorF& baseColor, float fTransparency = 0);
|
||||
inline SCloudParticle(const Vec3& vPos, float fRadiusX, float fRadiusY, float fRotMin, float fRotMax, Vec2 vUV[]);
|
||||
inline ~SCloudParticle();
|
||||
|
||||
float GetRadiusX() const { return m_fSize[0]; }
|
||||
float GetRadiusY() const { return m_fSize[1]; }
|
||||
float GetTransparency() const { return m_fTransparency; }
|
||||
const Vec3& GetPosition() const { return m_vPosition; }
|
||||
const ColorF& GetBaseColor() const { return m_vBaseColor; }
|
||||
uint32 GetNumLitColors() const { return m_vLitColors.size(); }
|
||||
inline const ColorF GetLitColor(unsigned int index) const;
|
||||
float GetSquareSortDistance() const { return m_fSquareSortDistance; }
|
||||
|
||||
//! Sets the radius of the particle.
|
||||
void SetRadiusX(float rad) { m_fSize[0] = rad; }
|
||||
void SetRadiusY(float rad) { m_fSize[1] = rad; }
|
||||
void SetTransparency(float trans) { m_fTransparency = trans; }
|
||||
void SetPosition(const Vec3& pos) { m_vPosition = pos; }
|
||||
void SetBaseColor(const ColorF& col) { m_vBaseColor = col; }
|
||||
void AddLitColor(const ColorF& col) { m_vLitColors.push_back(col); }
|
||||
void ClearLitColors() { m_vLitColors.clear(); }
|
||||
void SetSquareSortDistance(float fSquareDistance) { m_fSquareSortDistance = fSquareDistance; }
|
||||
|
||||
bool operator<(const SCloudParticle& p) const
|
||||
{
|
||||
return (m_fSquareSortDistance < p.m_fSquareSortDistance);
|
||||
}
|
||||
|
||||
bool operator>(const SCloudParticle& p) const
|
||||
{
|
||||
return (m_fSquareSortDistance > p.m_fSquareSortDistance);
|
||||
}
|
||||
|
||||
protected:
|
||||
float m_fTransparency;
|
||||
Vec3 m_vPosition;
|
||||
float m_fSize[2];
|
||||
float m_fRotMin;
|
||||
float m_fRotMax;
|
||||
ColorF m_vBaseColor;
|
||||
TArray<ColorF> m_vLitColors;
|
||||
Vec3 m_vEye;
|
||||
|
||||
// for sorting particles during shading
|
||||
float m_fSquareSortDistance;
|
||||
public:
|
||||
Vec2 m_vUV[2];
|
||||
};
|
||||
|
||||
inline SCloudParticle::SCloudParticle()
|
||||
{
|
||||
m_fSize[0] = 0;
|
||||
m_fTransparency = 0;
|
||||
m_vPosition = Vec3(0, 0, 0);
|
||||
m_vBaseColor = Col_Black;
|
||||
m_vEye = Vec3(0, 0, 0);
|
||||
m_fSquareSortDistance = 0;
|
||||
|
||||
m_vLitColors.clear();
|
||||
}
|
||||
|
||||
inline SCloudParticle::SCloudParticle(const Vec3& pos, float fRadius, const ColorF& baseColor, float fTransparency)
|
||||
{
|
||||
m_fSize[0] = fRadius;
|
||||
m_fSize[1] = fRadius;
|
||||
m_fTransparency = fTransparency;
|
||||
m_vPosition = pos;
|
||||
m_vBaseColor = baseColor;
|
||||
m_vUV[0] = Vec2(0, 0);
|
||||
m_vUV[1] = Vec2(1, 1);
|
||||
|
||||
m_fRotMin = 0;
|
||||
m_fRotMax = 0;
|
||||
m_vEye = Vec3(0, 0, 0);
|
||||
m_fSquareSortDistance = 0;
|
||||
|
||||
m_vLitColors.clear();
|
||||
}
|
||||
|
||||
inline SCloudParticle::SCloudParticle(const Vec3& vPos, float fRadiusX, float fRadiusY, float fRotMin, float fRotMax, Vec2 vUV[2])
|
||||
{
|
||||
m_fSize[0] = fRadiusX;
|
||||
m_fSize[1] = fRadiusY;
|
||||
m_vPosition = vPos;
|
||||
m_vBaseColor = Col_White;
|
||||
m_vUV[0] = vUV[0];
|
||||
m_vUV[1] = vUV[1];
|
||||
m_fRotMin = fRotMin;
|
||||
m_fRotMax = fRotMax;
|
||||
|
||||
m_fTransparency = 1.0f;
|
||||
m_vEye = Vec3(0, 0, 0);
|
||||
m_fSquareSortDistance = 0;
|
||||
|
||||
m_vLitColors.clear();
|
||||
}
|
||||
|
||||
inline SCloudParticle::~SCloudParticle()
|
||||
{
|
||||
m_vLitColors.clear();
|
||||
}
|
||||
|
||||
inline const ColorF SCloudParticle::GetLitColor(unsigned int index) const
|
||||
{
|
||||
if (index <= m_vLitColors.size())
|
||||
{
|
||||
return m_vLitColors[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
return Col_Black;
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
class CREBaseCloud
|
||||
: public CRendElementBase
|
||||
{
|
||||
friend class CRECloud;
|
||||
|
||||
public:
|
||||
CREBaseCloud()
|
||||
: CRendElementBase()
|
||||
{
|
||||
mfSetType(eDATA_Cloud);
|
||||
mfUpdateFlags(FCEF_TRANSFORM);
|
||||
}
|
||||
virtual void SetParticles(SCloudParticle* pParticles, int nNumParticles) = 0;
|
||||
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
pSizer->AddObject(this, sizeof(*this));
|
||||
}
|
||||
};
|
||||
|
||||
#endif // __CREBASECLOUD_H__
|
||||
@@ -1,66 +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 _CREFOGVOLUME_
|
||||
#define _CREFOGVOLUME_
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "VertexFormats.h"
|
||||
|
||||
|
||||
struct IFogVolumeRenderNode;
|
||||
|
||||
|
||||
class CREFogVolume
|
||||
: public CRendElementBase
|
||||
{
|
||||
public:
|
||||
CREFogVolume();
|
||||
|
||||
virtual ~CREFogVolume();
|
||||
virtual void mfPrepare(bool bCheckOverflow);
|
||||
virtual bool mfDraw(CShader* ef, SShaderPass* sfm);
|
||||
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
pSizer->AddObject(this, sizeof(*this));
|
||||
}
|
||||
|
||||
Vec3 m_center;
|
||||
uint32 m_viewerInsideVolume : 1;
|
||||
uint32 m_affectsThisAreaOnly : 1;
|
||||
uint32 m_stencilRef : 8;
|
||||
uint32 m_volumeType : 1;
|
||||
uint32 m_reserved : 21;
|
||||
AABB m_localAABB;
|
||||
Matrix34 m_matWSInv;
|
||||
float m_globalDensity;
|
||||
float m_densityOffset;
|
||||
float m_nearCutoff;
|
||||
Vec2 m_softEdgesLerp;
|
||||
ColorF m_fogColor; // color already combined with fHDRDynamic
|
||||
Vec3 m_heightFallOffDirScaled;
|
||||
Vec3 m_heightFallOffBasePoint;
|
||||
Vec3 m_eyePosInWS;
|
||||
Vec3 m_eyePosInOS;
|
||||
Vec3 m_rampParams;
|
||||
Vec3 m_windOffset;
|
||||
float m_noiseScale;
|
||||
Vec3 m_noiseFreq;
|
||||
float m_noiseOffset;
|
||||
float m_noiseElapsedTime;
|
||||
Vec3 m_scale;
|
||||
};
|
||||
|
||||
|
||||
#endif // #ifndef _CREFOGVOLUME_
|
||||
@@ -1,63 +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 _CREGameEffect_
|
||||
#define _CREGameEffect_
|
||||
|
||||
#pragma once
|
||||
|
||||
//==================================================================================================
|
||||
// Name: IREGameEffect
|
||||
// Desc: Interface for game effect render elements, designed to be instantiated in game code, and
|
||||
// called from the CREGameEffect within the engine. This then allows render elements
|
||||
// to be created in game code as well as in the engine.
|
||||
// Author: James Chilvers
|
||||
//==================================================================================================
|
||||
struct IREGameEffect
|
||||
{
|
||||
virtual ~IREGameEffect(){}
|
||||
|
||||
virtual void mfPrepare(bool bCheckOverflow) = 0;
|
||||
virtual bool mfDraw(CShader* ef, SShaderPass* sfm, CRenderObject* renderObj) = 0;
|
||||
};//------------------------------------------------------------------------------------------------
|
||||
|
||||
//==================================================================================================
|
||||
// Name: CREGameEffect
|
||||
// Desc: Render element that uses the IREGameEffect interface for its functionality
|
||||
// Author: James Chilvers
|
||||
//==================================================================================================
|
||||
class CREGameEffect
|
||||
: public CRendElementBase
|
||||
{
|
||||
public:
|
||||
|
||||
CREGameEffect();
|
||||
~CREGameEffect();
|
||||
|
||||
// CRendElementBase interface
|
||||
void mfPrepare(bool bCheckOverflow);
|
||||
bool mfDraw(CShader* ef, SShaderPass* sfm);
|
||||
|
||||
// CREGameEffect interface
|
||||
inline void SetPrivateImplementation(IREGameEffect* pImpl) { m_pImpl = pImpl; }
|
||||
inline IREGameEffect* GetPrivateImplementation() const { return m_pImpl; }
|
||||
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
pSizer->AddObject(this, sizeof(*this));
|
||||
}
|
||||
private:
|
||||
|
||||
IREGameEffect* m_pImpl; // Implementation of of render element
|
||||
};//------------------------------------------------------------------------------------------------
|
||||
|
||||
#endif // #ifndef _CREGameEffect_
|
||||
@@ -1,95 +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 : Backend part of geometry cache rendering
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_CREGEOMCACHE_H
|
||||
#define CRYINCLUDE_CRYCOMMON_CREGEOMCACHE_H
|
||||
#pragma once
|
||||
|
||||
#if defined(USE_GEOM_CACHES)
|
||||
|
||||
#include <Vertex.h>
|
||||
#include <CryCommon/StaticInstance.h>
|
||||
|
||||
class CREGeomCache
|
||||
: public CRendElementBase
|
||||
{
|
||||
public:
|
||||
struct SMeshInstance
|
||||
{
|
||||
AABB m_aabb;
|
||||
Matrix34 m_matrix;
|
||||
Matrix34 m_prevMatrix;
|
||||
};
|
||||
|
||||
struct SMeshRenderData
|
||||
{
|
||||
DynArray<SMeshInstance> m_instances;
|
||||
_smart_ptr<IRenderMesh> m_pRenderMesh;
|
||||
};
|
||||
|
||||
struct UpdateList
|
||||
{
|
||||
CryCriticalSection m_mutex;
|
||||
AZStd::vector<CREGeomCache*, AZ::AZStdAlloc<CryLegacySTLAllocator>> m_geoms;
|
||||
};
|
||||
|
||||
public:
|
||||
CREGeomCache();
|
||||
~CREGeomCache();
|
||||
|
||||
bool Update(const int flags, const bool bTesselation);
|
||||
static void UpdateModified();
|
||||
|
||||
// CRendElementBase interface
|
||||
virtual bool mfUpdate(int Flags, bool bTessellation);
|
||||
virtual void mfPrepare(bool bCheckOverflow);
|
||||
virtual bool mfDraw(CShader* ef, SShaderPass* sfm);
|
||||
|
||||
// CREGeomCache interface
|
||||
virtual void InitializeRenderElement(const uint numMeshes, _smart_ptr<IRenderMesh>* pMeshes, uint16 materialId);
|
||||
virtual void SetupMotionBlur(CRenderObject* pRenderObject, const SRenderingPassInfo& passInfo);
|
||||
|
||||
virtual volatile int* SetAsyncUpdateState(int& threadId);
|
||||
virtual DynArray<SMeshRenderData>* GetMeshFillDataPtr();
|
||||
virtual DynArray<SMeshRenderData>* GetRenderDataPtr();
|
||||
virtual void DisplayFilledBuffer(const int threadId);
|
||||
|
||||
|
||||
AZ::Vertex::Format GetVertexFormat() const override;
|
||||
bool GetGeometryInfo(SGeometryInfo &streams) override;
|
||||
|
||||
private:
|
||||
uint16 m_materialId;
|
||||
volatile bool m_bUpdateFrame[2];
|
||||
volatile int m_transformUpdateState[2];
|
||||
|
||||
// We use a double buffered m_meshFillData array for input from the main thread. When data
|
||||
// was successfully sent from the main thread it gets copied to m_meshRenderData
|
||||
// This simplifies the cases where frame data is missing, e.g. meshFillData is not updated for a frame
|
||||
// Note that meshFillData really needs to be double buffered because the copy occurs in render thread
|
||||
// so the next main thread could already be touching the data again
|
||||
//
|
||||
// Note: m_meshRenderData is directly accessed for ray intersections via GetRenderDataPtr.
|
||||
// This is safe, because it's only used in editor.
|
||||
DynArray<SMeshRenderData> m_meshFillData[2];
|
||||
DynArray<SMeshRenderData> m_meshRenderData;
|
||||
|
||||
static StaticInstance<UpdateList> sm_updateList[2]; // double buffered update lists
|
||||
|
||||
AZ::Vertex::Format m_geomCacheVertexFormat;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // CRYINCLUDE_CRYCOMMON_CREGEOMCACHE_H
|
||||
@@ -1,194 +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
|
||||
|
||||
#include <IRenderer.h>
|
||||
#include "Cry_Camera.h"
|
||||
|
||||
//================================================================================
|
||||
|
||||
struct SDynTexture2;
|
||||
struct SDynTexture;
|
||||
class IDynTexture;
|
||||
class CameraViewParameters;
|
||||
|
||||
struct IImposterRenderElement
|
||||
{
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const = 0;
|
||||
virtual void mfPrepare(bool bCheckOverflow) = 0;
|
||||
virtual bool mfDraw(CShader* ef, SShaderPass* sl) = 0;
|
||||
virtual const SMinMaxBox& mfGetWorldSpaceBounds() = 0;
|
||||
|
||||
virtual bool IsSplit() = 0;
|
||||
virtual bool IsScreenImposter() = 0;
|
||||
|
||||
virtual float GetRadiusX() = 0;
|
||||
virtual float GetRadiusY() = 0;
|
||||
virtual Vec3* GetQuadCorners() = 0;
|
||||
virtual Vec3 GetNearPoint() = 0;
|
||||
virtual Vec3 GetFarPoint() = 0;
|
||||
virtual float GetErrorToleranceCosAngle() = 0;
|
||||
virtual uint32 GetState() = 0;
|
||||
virtual int GetAlphaRef() = 0;
|
||||
virtual ColorF GetColorHelper() = 0;
|
||||
virtual Vec3 GetLastSunDirection() = 0;
|
||||
virtual uint8 GetLastBestEdge() = 0;
|
||||
virtual float GetNear() = 0;
|
||||
virtual float GetFar() = 0;
|
||||
virtual float GetTransparency() = 0;
|
||||
virtual Vec3 GetPosition();
|
||||
virtual int GetLogResolutionX() = 0;
|
||||
virtual int GetLogResolutionY() = 0;
|
||||
virtual CameraViewParameters& GetLastViewParameters() = 0;
|
||||
virtual IDynTexture* GetTexture() = 0;
|
||||
virtual IDynTexture* GetScreenTexture() = 0;
|
||||
virtual IDynTexture* GetFrontTexture() = 0;
|
||||
virtual IDynTexture* GetDepthTexture() = 0;
|
||||
virtual const SMinMaxBox& GetWorldSpaceBounds() = 0;
|
||||
|
||||
virtual void SetBBox(const Vec3& min, const Vec3& max) = 0;
|
||||
virtual void SetScreenImposterState(bool state) = 0;
|
||||
virtual void SetState(uint32 state) = 0;
|
||||
virtual void SetAlphaRef(uint32 ref) = 0;
|
||||
virtual void SetPosition(Vec3 pos) = 0;
|
||||
virtual void SetFrameResetValue(int frameResetValue) = 0;
|
||||
virtual void SetTexture(IDynTexture* texture) = 0;
|
||||
virtual void SetScreenTexture(IDynTexture* texture) = 0;
|
||||
virtual void SetFrontTexture(IDynTexture* texture) = 0;
|
||||
virtual void SetDepthTexture(IDynTexture* texture) = 0;
|
||||
};
|
||||
|
||||
class CREImposter
|
||||
: public CRendElementBase
|
||||
{
|
||||
friend class CRECloud;
|
||||
static IDynTexture* m_pScreenTexture;
|
||||
|
||||
CameraViewParameters m_LastViewParameters;
|
||||
bool m_bScreenImposter;
|
||||
bool m_bSplit;
|
||||
float m_fRadiusX;
|
||||
float m_fRadiusY;
|
||||
Vec3 m_vQuadCorners[4]; // in world space, relative to m_vPos, in clockwise order, can be rotated
|
||||
Vec3 m_vNearPoint;
|
||||
Vec3 m_vFarPoint;
|
||||
int m_nLogResolutionX;
|
||||
int m_nLogResolutionY;
|
||||
IDynTexture* m_pTexture;
|
||||
IDynTexture* m_pFrontTexture;
|
||||
IDynTexture* m_pTextureDepth;
|
||||
float m_fErrorToleranceCosAngle; // cosine of m_fErrorToleranceAngle used to check if IsImposterValid
|
||||
SMinMaxBox m_WorldSpaceBV;
|
||||
uint32 m_State;
|
||||
int m_AlphaRef;
|
||||
float m_fCurTransparency;
|
||||
ColorF m_ColorHelper;
|
||||
Vec3 m_vPos;
|
||||
Vec3 m_vLastSunDir;
|
||||
uint8 m_nLastBestEdge; // 0..11 this edge is favored to not jitter between different edges
|
||||
float m_fNear;
|
||||
float m_fFar;
|
||||
|
||||
bool IsImposterValid(const CameraViewParameters& viewParameters, float fRadiusX, float fRadiusY, float fCamRadiusX, float fCamRadiusY,
|
||||
const int iRequiredLogResX, const int iRequiredLogResY, const uint32 dwBestEdge);
|
||||
|
||||
bool Display(bool bDisplayFrontOfSplit);
|
||||
|
||||
public:
|
||||
int m_nFrameReset;
|
||||
int m_FrameUpdate;
|
||||
float m_fTimeUpdate;
|
||||
|
||||
static int m_MemUpdated;
|
||||
static int m_MemPostponed;
|
||||
static int m_PrevMemUpdated;
|
||||
static int m_PrevMemPostponed;
|
||||
|
||||
CREImposter()
|
||||
: CRendElementBase()
|
||||
, m_pTexture(NULL)
|
||||
, m_pFrontTexture(NULL)
|
||||
, m_pTextureDepth(NULL)
|
||||
, m_bSplit(false)
|
||||
, m_fRadiusX(0)
|
||||
, m_fRadiusY(0)
|
||||
, m_fErrorToleranceCosAngle(cos(DEG2RAD(0.25f)))
|
||||
, m_bScreenImposter(false)
|
||||
, m_State(GS_DEPTHWRITE)
|
||||
, m_AlphaRef(-1)
|
||||
, m_fCurTransparency(1.0f)
|
||||
, m_FrameUpdate(0)
|
||||
, m_nFrameReset(0)
|
||||
, m_fTimeUpdate(0)
|
||||
, m_vLastSunDir(0, 0, 0)
|
||||
, m_nLogResolutionX(0)
|
||||
, m_nLogResolutionY(0)
|
||||
, m_nLastBestEdge(0)
|
||||
{
|
||||
mfSetType(eDATA_Imposter);
|
||||
mfUpdateFlags(FCEF_TRANSFORM);
|
||||
m_ColorHelper = Col_White;
|
||||
}
|
||||
virtual ~CREImposter()
|
||||
{
|
||||
ReleaseResources();
|
||||
}
|
||||
|
||||
bool UpdateImposter();
|
||||
void ReleaseResources();
|
||||
|
||||
bool PrepareForUpdate();
|
||||
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
pSizer->AddObject(this, sizeof(*this));
|
||||
}
|
||||
virtual void mfPrepare(bool bCheckOverflow);
|
||||
virtual bool mfDraw(CShader* ef, SShaderPass* sl);
|
||||
const SMinMaxBox& mfGetWorldSpaceBounds() { return m_WorldSpaceBV; }
|
||||
|
||||
virtual bool IsSplit() { return m_bSplit; }
|
||||
virtual bool IsScreenImposter() { return m_bScreenImposter; }
|
||||
|
||||
virtual float GetRadiusX() { return m_fRadiusX; }
|
||||
virtual float GetRadiusY() { return m_fRadiusY; }
|
||||
virtual Vec3* GetQuadCorners() { return &m_vQuadCorners[0]; }
|
||||
virtual Vec3 GetNearPoint() { return m_vNearPoint; }
|
||||
virtual Vec3 GetFarPoint() { return m_vFarPoint; }
|
||||
virtual float GetErrorToleranceCosAngle() { return m_fErrorToleranceCosAngle; }
|
||||
virtual uint32 GetState() { return m_State; }
|
||||
virtual int GetAlphaRef() { return m_AlphaRef; }
|
||||
virtual ColorF GetColorHelper() { return m_ColorHelper; }
|
||||
virtual Vec3 GetLastSunDirection() { return m_vLastSunDir; }
|
||||
virtual uint8 GetLastBestEdge() { return m_nLastBestEdge; }
|
||||
virtual float GetNear() { return m_fNear; }
|
||||
virtual float GetFar() { return m_fFar; }
|
||||
virtual float GetTransparency() { return m_fCurTransparency; }
|
||||
virtual Vec3 GetPosition();
|
||||
virtual int GetLogResolutionX() { return m_nLogResolutionX; }
|
||||
virtual int GetLogResolutionY() { return m_nLogResolutionY; }
|
||||
virtual CameraViewParameters& GetLastViewParameters() { return m_LastViewParameters; }
|
||||
virtual IDynTexture** GetTexture() { return &m_pTexture; }
|
||||
virtual IDynTexture** GetScreenTexture() { return &m_pScreenTexture; }
|
||||
virtual IDynTexture** GetFrontTexture() { return &m_pFrontTexture; }
|
||||
virtual IDynTexture** GetDepthTexture() { return &m_pTextureDepth; }
|
||||
virtual const SMinMaxBox& GetWorldSpaceBounds() { return m_WorldSpaceBV; }
|
||||
virtual int GetFrameReset() { return m_nFrameReset; }
|
||||
virtual void SetBBox(const Vec3& min, const Vec3& max) { m_WorldSpaceBV.SetMin(min); m_WorldSpaceBV.SetMax(max); }
|
||||
virtual void SetScreenImposterState(bool state) { m_bScreenImposter = state; }
|
||||
virtual void SetState(uint32 state) { m_State = state; }
|
||||
virtual void SetAlphaRef(uint32 ref) { m_AlphaRef = ref; }
|
||||
virtual void SetPosition(Vec3 pos) { m_vPos = pos; }
|
||||
virtual void SetFrameResetValue(int frameResetValue) { m_nFrameReset = frameResetValue; }
|
||||
};
|
||||
@@ -1,57 +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 __CREMESH_H__
|
||||
#define __CREMESH_H__
|
||||
|
||||
class CREMesh
|
||||
: public CRendElementBase
|
||||
{
|
||||
public:
|
||||
|
||||
struct CRenderChunk* m_pChunk;
|
||||
class CRenderMesh* m_pRenderMesh;
|
||||
|
||||
// Copy of Chunk to avoid indirections
|
||||
int32 m_nFirstIndexId;
|
||||
int32 m_nNumIndices;
|
||||
|
||||
uint32 m_nFirstVertId;
|
||||
uint32 m_nNumVerts;
|
||||
|
||||
protected:
|
||||
CREMesh()
|
||||
{
|
||||
mfSetType(eDATA_Mesh);
|
||||
mfUpdateFlags(FCEF_TRANSFORM);
|
||||
|
||||
m_pChunk = NULL;
|
||||
m_pRenderMesh = NULL;
|
||||
m_nFirstIndexId = -1;
|
||||
m_nNumIndices = -1;
|
||||
m_nFirstVertId = 0;
|
||||
m_nNumVerts = 0;
|
||||
}
|
||||
|
||||
virtual ~CREMesh()
|
||||
{
|
||||
}
|
||||
|
||||
// Ideally should be declared and left unimplemented to prevent slicing at compile time
|
||||
// but this would prevent auto code gen in renderer later on.
|
||||
// To track potential slicing, uncomment the following (and their equivalent in CREMeshImpl)
|
||||
//CREMesh(CREMesh&);
|
||||
//CREMesh& operator=(CREMesh& rhs);
|
||||
};
|
||||
|
||||
#endif // __CREMESH_H__
|
||||
@@ -1,116 +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 __CREOCCLUSIONQUERY_H__
|
||||
#define __CREOCCLUSIONQUERY_H__
|
||||
|
||||
#define SUPP_HMAP_OCCL
|
||||
#define SUPP_HWOBJ_OCCL
|
||||
|
||||
//=============================================================
|
||||
|
||||
class CRenderMesh;
|
||||
|
||||
class CREOcclusionQuery
|
||||
: public CRendElementBase
|
||||
{
|
||||
friend class CRender3D;
|
||||
bool m_bSucceeded;
|
||||
public:
|
||||
|
||||
int m_nVisSamples;
|
||||
int m_nCheckFrame;
|
||||
int m_nDrawFrame;
|
||||
Vec3 m_vBoxMin;
|
||||
Vec3 m_vBoxMax;
|
||||
|
||||
UINT_PTR m_nOcclusionID; // this will carry a pointer LPDIRECT3DQUERY9, so it needs to be 64-bit on Windows 64
|
||||
|
||||
CRenderMesh* m_pRMBox;
|
||||
static uint32 m_nQueriesPerFrameCounter;
|
||||
static uint32 m_nReadResultNowCounter;
|
||||
static uint32 m_nReadResultTryCounter;
|
||||
|
||||
CREOcclusionQuery()
|
||||
{
|
||||
m_nOcclusionID = 0;
|
||||
|
||||
m_nVisSamples = 800 * 600;
|
||||
m_nCheckFrame = 0;
|
||||
m_nDrawFrame = 0;
|
||||
m_vBoxMin = Vec3(0, 0, 0);
|
||||
m_vBoxMax = Vec3(0, 0, 0);
|
||||
m_pRMBox = NULL;
|
||||
|
||||
mfSetType(eDATA_OcclusionQuery);
|
||||
mfUpdateFlags(FCEF_TRANSFORM);
|
||||
}
|
||||
|
||||
bool RT_ReadResult_Try(uint32 nDefaultNumSamples);
|
||||
|
||||
ILINE bool HasSucceeded() const { return m_bSucceeded; }
|
||||
|
||||
virtual ~CREOcclusionQuery();
|
||||
|
||||
virtual void mfPrepare(bool bCheckOverflow);
|
||||
virtual bool mfDraw(CShader* ef, SShaderPass* sfm);
|
||||
virtual void mfReset();
|
||||
virtual bool mfReadResult_Try(uint32 nDefaultNumSamples = 1);
|
||||
virtual bool mfReadResult_Now();
|
||||
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
pSizer->AddObject(this, sizeof(*this));
|
||||
}
|
||||
};
|
||||
|
||||
struct OcclusionTestClient
|
||||
{
|
||||
OcclusionTestClient()
|
||||
: nLastOccludedMainFrameID(0)
|
||||
, nLastVisibleMainFrameID(0)
|
||||
{
|
||||
#ifdef SUPP_HMAP_OCCL
|
||||
vLastVisPoint.Set(0, 0, 0);
|
||||
nTerrainOccLastFrame = 0;
|
||||
#endif
|
||||
#ifdef SUPP_HWOBJ_OCCL
|
||||
bOccluded = true;
|
||||
pREOcclusionQuery = 0;
|
||||
#endif
|
||||
//nInstantTestRequested=0;
|
||||
}
|
||||
#ifdef SUPP_HWOBJ_OCCL
|
||||
~OcclusionTestClient()
|
||||
{
|
||||
if (pREOcclusionQuery)
|
||||
{
|
||||
pREOcclusionQuery->Release(false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
uint32 nLastVisibleMainFrameID, nLastOccludedMainFrameID;
|
||||
uint32 nLastShadowCastMainFrameID, nLastNoShadowCastMainFrameID;
|
||||
#ifdef SUPP_HMAP_OCCL
|
||||
Vec3 vLastVisPoint;
|
||||
int nTerrainOccLastFrame;
|
||||
#endif
|
||||
#ifdef SUPP_HWOBJ_OCCL
|
||||
CREOcclusionQuery* pREOcclusionQuery;
|
||||
uint8 bOccluded;
|
||||
#endif
|
||||
//uint8 nInstantTestRequested;
|
||||
};
|
||||
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_CREOCCLUSIONQUERY_H
|
||||
@@ -1,56 +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_CREPOSTPROCESS_H
|
||||
#define CRYINCLUDE_CRYCOMMON_CREPOSTPROCESS_H
|
||||
#pragma once
|
||||
|
||||
|
||||
class CREPostProcess
|
||||
: public CRendElementBase
|
||||
{
|
||||
friend class CD3D9Renderer;
|
||||
|
||||
public:
|
||||
|
||||
CREPostProcess();
|
||||
virtual ~CREPostProcess();
|
||||
|
||||
virtual void mfPrepare(bool bCheckOverflow);
|
||||
virtual bool mfDraw(CShader* ef, SShaderPass* sfm);
|
||||
|
||||
// Use for setting numeric values, vec4 (colors, position, vectors, wtv), strings
|
||||
virtual int mfSetParameter(const char* pszParam, float fValue, bool bForceValue = false) const;
|
||||
virtual int mfSetParameterVec4(const char* pszParam, const Vec4& pValue, bool bForceValue = false) const;
|
||||
virtual int mfSetParameterString(const char* pszParam, const char* pszArg) const;
|
||||
|
||||
virtual void mfGetParameter(const char* pszParam, float& fValue) const;
|
||||
virtual void mfGetParameterVec4(const char* pszParam, Vec4& pValue) const;
|
||||
virtual void mfGetParameterString(const char* pszParam, const char*& pszArg) const;
|
||||
|
||||
virtual int32 mfGetPostEffectID(const char* pPostEffectName) const;
|
||||
|
||||
// Reset all post processing effects
|
||||
virtual void Reset(bool bOnSpecChange = false);
|
||||
virtual void mfReset()
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
pSizer->AddObject(this, sizeof(*this));
|
||||
}
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_CREPOSTPROCESS_H
|
||||
@@ -1,40 +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 _CREPRISMOBJECT_
|
||||
#define _CREPRISMOBJECT_
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(EXCLUDE_DOCUMENTATION_PURPOSE)
|
||||
|
||||
class CREPrismObject
|
||||
: public CRendElementBase
|
||||
{
|
||||
public:
|
||||
CREPrismObject();
|
||||
|
||||
virtual ~CREPrismObject() {}
|
||||
virtual void mfPrepare(bool bCheckOverflow);
|
||||
virtual bool mfDraw(CShader* ef, SShaderPass* sfm);
|
||||
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
pSizer->AddObject(this, sizeof(*this));
|
||||
}
|
||||
|
||||
Vec3 m_center;
|
||||
};
|
||||
|
||||
#endif // EXCLUDE_DOCUMENTATION_PURPOSE
|
||||
|
||||
#endif // _CREPRISMOBJECT_
|
||||
@@ -1,92 +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 __CRESKY_H__
|
||||
#define __CRESKY_H__
|
||||
|
||||
//=============================================================
|
||||
|
||||
#include "VertexFormats.h"
|
||||
#include <Vertex.h>
|
||||
|
||||
struct SSkyLightRenderParams;
|
||||
|
||||
class CRESky
|
||||
: public CRendElementBase
|
||||
{
|
||||
friend class CRender3D;
|
||||
|
||||
public:
|
||||
|
||||
float m_fTerrainWaterLevel;
|
||||
float m_fSkyBoxStretching;
|
||||
float m_fAlpha;
|
||||
int m_nSphereListId;
|
||||
|
||||
public:
|
||||
CRESky();
|
||||
virtual ~CRESky();
|
||||
virtual void mfPrepare(bool bCheckOverflow);
|
||||
virtual bool mfDraw(CShader* ef, SShaderPass* sfm);
|
||||
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
pSizer->AddObject(this, sizeof(*this));
|
||||
}
|
||||
|
||||
AZ::Vertex::Format GetVertexFormat() const override;
|
||||
bool GetGeometryInfo(SGeometryInfo& streams) override;
|
||||
|
||||
private:
|
||||
AZ::Vertex::Format m_skyVertexFormat;
|
||||
};
|
||||
|
||||
class CREHDRSky
|
||||
: public CRendElementBase
|
||||
{
|
||||
public:
|
||||
CREHDRSky();
|
||||
virtual ~CREHDRSky();
|
||||
virtual void mfPrepare(bool bCheckOverflow);
|
||||
virtual bool mfDraw(CShader* ef, SShaderPass* sfm);
|
||||
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
pSizer->AddObject(this, sizeof(*this));
|
||||
}
|
||||
|
||||
void GenerateSkyDomeTextures(int32 width, int32 height);
|
||||
|
||||
virtual AZ::Vertex::Format GetVertexFormat() const override;
|
||||
virtual bool GetGeometryInfo(SGeometryInfo& streams) override;
|
||||
|
||||
public:
|
||||
const SSkyLightRenderParams* m_pRenderParams;
|
||||
int m_moonTexId;
|
||||
class CTexture* m_pSkyDomeTextureMie;
|
||||
class CTexture* m_pSkyDomeTextureRayleigh;
|
||||
|
||||
static void SetCommonMoonParams(CShader* ef, bool bUseMoon = false);
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
private:
|
||||
int m_skyDomeTextureLastTimeStamp;
|
||||
int m_frameReset;
|
||||
class CStars* m_pStars;
|
||||
AZ::Vertex::Format m_hdrSkyVertexFormat;
|
||||
};
|
||||
|
||||
|
||||
#endif // __CRESKY_H__
|
||||
@@ -1,70 +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 _CREVOLUMEOBJECT_
|
||||
#define _CREVOLUMEOBJECT_
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "VertexFormats.h"
|
||||
|
||||
|
||||
struct IVolumeObjectRenderNode;
|
||||
|
||||
struct IVolumeTexture
|
||||
{
|
||||
public:
|
||||
virtual ~IVolumeTexture() {}
|
||||
virtual void Release() = 0;
|
||||
virtual bool Create(unsigned int width, unsigned int height, unsigned int depth, unsigned char* pData) = 0;
|
||||
virtual bool Update(unsigned int width, unsigned int height, unsigned int depth, const unsigned char* pData) = 0;
|
||||
virtual int GetTexID() const = 0;
|
||||
virtual uint32 GetWidth() const = 0;
|
||||
virtual uint32 GetHeight() const = 0;
|
||||
virtual uint32 GetDepth() const = 0;
|
||||
virtual ITexture* GetTexture() const = 0;
|
||||
};
|
||||
|
||||
class CREVolumeObject
|
||||
: public CRendElementBase
|
||||
{
|
||||
public:
|
||||
CREVolumeObject();
|
||||
|
||||
virtual ~CREVolumeObject();
|
||||
virtual void mfPrepare(bool bCheckOverflow);
|
||||
virtual bool mfDraw(CShader* ef, SShaderPass* sfm);
|
||||
|
||||
virtual IVolumeTexture* CreateVolumeTexture() const;
|
||||
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
pSizer->AddObject(this, sizeof(*this));
|
||||
}
|
||||
|
||||
Vec3 m_center;
|
||||
Matrix34 m_matInv;
|
||||
Vec3 m_eyePosInWS;
|
||||
Vec3 m_eyePosInOS;
|
||||
Plane_tpl<f32> m_volumeTraceStartPlane;
|
||||
AABB m_renderBoundsOS;
|
||||
bool m_viewerInsideVolume;
|
||||
bool m_nearPlaneIntersectsVolume;
|
||||
float m_alpha;
|
||||
float m_scale;
|
||||
|
||||
IVolumeTexture* m_pDensVol;
|
||||
IVolumeTexture* m_pShadVol;
|
||||
_smart_ptr<IRenderMesh> m_pHullMesh;
|
||||
};
|
||||
|
||||
#endif // #ifndef _CREVOLUMEOBJECT_
|
||||
@@ -1,57 +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 _CREWATEROCEAN_
|
||||
#define _CREWATEROCEAN_
|
||||
|
||||
class CWater;
|
||||
|
||||
class CREWaterOcean
|
||||
: public CRendElementBase
|
||||
{
|
||||
public:
|
||||
CREWaterOcean();
|
||||
virtual ~CREWaterOcean();
|
||||
|
||||
virtual void mfPrepare(bool bCheckOverflow);
|
||||
virtual bool mfDraw(CShader* ef, SShaderPass* sfm);
|
||||
virtual void mfGetPlane(Plane_tpl<f32>& pl);
|
||||
|
||||
virtual void Create(uint32 nVerticesCount, SVF_P3F_C4B_T2F* pVertices, uint32 nIndicesCount, const void* pIndices, uint32 nIndexSizeof);
|
||||
void ReleaseOcean();
|
||||
|
||||
virtual Vec3 GetPositionAt(float x, float y) const;
|
||||
virtual Vec4* GetDisplaceGrid() const;
|
||||
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
pSizer->AddObject(this, sizeof(*this));
|
||||
}
|
||||
private:
|
||||
|
||||
uint32 m_nVerticesCount;
|
||||
uint32 m_nIndicesCount;
|
||||
uint32 m_nIndexSizeof;
|
||||
|
||||
void* m_pVertDecl;
|
||||
void* m_pVertices;
|
||||
void* m_pIndices;
|
||||
|
||||
private:
|
||||
|
||||
void UpdateFFT();
|
||||
void FrameUpdate();
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,110 +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 _CREWATERVOLUME_
|
||||
#define _CREWATERVOLUME_
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "VertexFormats.h"
|
||||
|
||||
class CREWaterVolume
|
||||
: public CRendElementBase
|
||||
{
|
||||
public:
|
||||
CREWaterVolume();
|
||||
|
||||
virtual ~CREWaterVolume();
|
||||
virtual void mfPrepare(bool bCheckOverflow);
|
||||
virtual bool mfDraw(CShader* ef, SShaderPass* sfm);
|
||||
virtual void mfGetPlane(Plane_tpl<f32>& pl);
|
||||
virtual void mfCenter(Vec3& vCenter, CRenderObject* pObj);
|
||||
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
pSizer->AddObject(this, sizeof(*this));
|
||||
}
|
||||
|
||||
public:
|
||||
struct SParams
|
||||
{
|
||||
SParams()
|
||||
: m_pVertices(0)
|
||||
, m_pIndices(0)
|
||||
, m_numVertices(0)
|
||||
, m_numIndices(0)
|
||||
, m_center(0, 0, 0)
|
||||
, m_WSBBox(Vec3(-1, -1, -1), Vec3(1, 1, 1))
|
||||
, m_fogPlane(Vec3(0, 0, 1), 0)
|
||||
, m_fogDensity(0.1f)
|
||||
, m_fogColor(0.2f, 0.5f, 0.7f)
|
||||
, m_fogColorAffectedBySun(true)
|
||||
, m_fogShadowing(0.5f)
|
||||
, m_caustics(true)
|
||||
, m_causticIntensity(1.0f)
|
||||
, m_causticTiling(1.0f)
|
||||
, m_causticHeight(0.9f)
|
||||
, m_viewerInsideVolume(false)
|
||||
, m_viewerCloseToWaterPlane(false)
|
||||
, m_viewerCloseToWaterVolume(false)
|
||||
{
|
||||
}
|
||||
|
||||
const SVF_P3F_C4B_T2F* m_pVertices;
|
||||
const uint16* m_pIndices;
|
||||
|
||||
size_t m_numVertices;
|
||||
size_t m_numIndices;
|
||||
|
||||
Vec3 m_center;
|
||||
AABB m_WSBBox;
|
||||
|
||||
Plane_tpl<f32> m_fogPlane;
|
||||
float m_fogDensity;
|
||||
Vec3 m_fogColor;
|
||||
bool m_fogColorAffectedBySun;
|
||||
float m_fogShadowing;
|
||||
|
||||
bool m_caustics;
|
||||
float m_causticIntensity;
|
||||
float m_causticTiling;
|
||||
float m_causticHeight;
|
||||
|
||||
bool m_viewerInsideVolume;
|
||||
bool m_viewerCloseToWaterPlane;
|
||||
bool m_viewerCloseToWaterVolume;
|
||||
};
|
||||
|
||||
struct SOceanParams
|
||||
{
|
||||
SOceanParams()
|
||||
: m_fogColor(0.2f, 0.5f, 0.7f)
|
||||
, m_fogColorShallow(0.2f, 0.5f, 0.7f)
|
||||
, m_fogDensity(0.2f)
|
||||
{
|
||||
}
|
||||
|
||||
Vec3 m_fogColor;
|
||||
Vec3 m_fogColorShallow;
|
||||
float m_fogDensity;
|
||||
};
|
||||
|
||||
public:
|
||||
const SParams* m_pParams;
|
||||
const SOceanParams* m_pOceanParams;
|
||||
bool m_drawWaterSurface;
|
||||
bool m_drawFastPath;
|
||||
};
|
||||
|
||||
|
||||
#endif // #ifndef _CREWATERVOLUME_
|
||||
@@ -45,43 +45,6 @@ void CryAssertTrace(const char* szFormat, ...)
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
bool CryAssert(const char* szCondition, const char* szFile,unsigned int line, bool *pIgnore)
|
||||
{
|
||||
if (!gEnv) return false;
|
||||
|
||||
gEnv->pSystem->OnAssert(szCondition, gs_szMessage, szFile, line);
|
||||
|
||||
if (!gEnv->bNoAssertDialog && !gEnv->bIgnoreAllAsserts)
|
||||
{
|
||||
EDialogAction action = MacOSXHandleAssert(szCondition, szFile, line, gs_szMessage, gEnv->pRenderer != NULL);
|
||||
|
||||
switch (action) {
|
||||
case eDAStop:
|
||||
raise(SIGABRT);
|
||||
exit(-1);
|
||||
case eDABreak:
|
||||
return true;
|
||||
case eDAIgnoreAll:
|
||||
gEnv->bIgnoreAllAsserts = true;
|
||||
break;
|
||||
case eDAIgnore:
|
||||
*pIgnore = true;
|
||||
break;
|
||||
case eDAReportAsBug:
|
||||
if ( gEnv && gEnv->pSystem)
|
||||
{
|
||||
gEnv->pSystem->ReportBug("Assert: %s - %s", szCondition,gs_szMessage);
|
||||
}
|
||||
|
||||
case eDAContinue:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}*/
|
||||
|
||||
bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, bool* pIgnore)
|
||||
{
|
||||
|
||||
@@ -116,7 +116,6 @@ namespace CryMemory
|
||||
struct ICustomMemoryHeap;
|
||||
class IGeneralMemoryHeap;
|
||||
class IPageMappingHeap;
|
||||
class IDefragAllocator;
|
||||
class IMemoryAddressRange;
|
||||
|
||||
// Description:
|
||||
@@ -180,8 +179,6 @@ struct IMemoryManager
|
||||
|
||||
virtual IMemoryAddressRange* ReserveAddressRange(size_t capacity, const char* sName) = 0;
|
||||
virtual IPageMappingHeap* CreatePageMappingHeap(size_t addressSpace, const char* sName) = 0;
|
||||
|
||||
virtual IDefragAllocator* CreateDefragAllocator() = 0;
|
||||
};
|
||||
|
||||
// Global function implemented in CryMemoryManager_impl.h
|
||||
|
||||
@@ -620,24 +620,24 @@ public:
|
||||
bool IsPointVisible(const Vec3& p) const;
|
||||
|
||||
//sphere-frustum test
|
||||
bool IsSphereVisible_F(const Sphere& s) const;
|
||||
uint8 IsSphereVisible_FH(const Sphere& s) const; //this is going to be the exact version of sphere-culling
|
||||
bool IsSphereVisible_F(const ::Sphere& s) const;
|
||||
uint8 IsSphereVisible_FH(const ::Sphere& s) const; //this is going to be the exact version of sphere-culling
|
||||
|
||||
// AABB-frustum test
|
||||
// Fast
|
||||
bool IsAABBVisible_F(const AABB& aabb) const;
|
||||
uint8 IsAABBVisible_FH(const AABB& aabb, bool* pAllInside) const;
|
||||
uint8 IsAABBVisible_FH(const AABB& aabb) const;
|
||||
bool IsAABBVisible_F(const ::AABB& aabb) const;
|
||||
uint8 IsAABBVisible_FH(const ::AABB& aabb, bool* pAllInside) const;
|
||||
uint8 IsAABBVisible_FH(const ::AABB& aabb) const;
|
||||
|
||||
// Exact
|
||||
bool IsAABBVisible_E(const AABB& aabb) const;
|
||||
uint8 IsAABBVisible_EH(const AABB& aabb, bool* pAllInside) const;
|
||||
uint8 IsAABBVisible_EH(const AABB& aabb) const;
|
||||
bool IsAABBVisible_E(const ::AABB& aabb) const;
|
||||
uint8 IsAABBVisible_EH(const ::AABB& aabb, bool* pAllInside) const;
|
||||
uint8 IsAABBVisible_EH(const ::AABB& aabb) const;
|
||||
|
||||
// Multi-camera
|
||||
bool IsAABBVisible_EHM(const AABB& aabb, bool* pAllInside) const;
|
||||
bool IsAABBVisible_EM(const AABB& aabb) const;
|
||||
bool IsAABBVisible_FM(const AABB& aabb) const;
|
||||
bool IsAABBVisible_EHM(const ::AABB& aabb, bool* pAllInside) const;
|
||||
bool IsAABBVisible_EM(const ::AABB& aabb) const;
|
||||
bool IsAABBVisible_FM(const ::AABB& aabb) const;
|
||||
|
||||
//OBB-frustum test
|
||||
bool IsOBBVisible_F(const Vec3& wpos, const OBB& obb) const;
|
||||
@@ -1386,7 +1386,7 @@ inline bool CCamera::IsPointVisible(const Vec3& p) const
|
||||
// return values
|
||||
// CULL_EXCLUSION = sphere outside of frustum (very fast rejection-test)
|
||||
// CULL_INTERSECT = sphere and frustum intersects or sphere in completely inside frustum
|
||||
inline bool CCamera::IsSphereVisible_F(const Sphere& s) const
|
||||
inline bool CCamera::IsSphereVisible_F(const ::Sphere& s) const
|
||||
{
|
||||
if ((m_fp[0] | s.center) > s.radius)
|
||||
{
|
||||
@@ -1427,7 +1427,7 @@ inline bool CCamera::IsSphereVisible_F(const Sphere& s) const
|
||||
// CULL_EXCLUSION = sphere outside of frustum (very fast rejection-test)
|
||||
// CULL_INTERSECT = sphere intersects the borders of the frustum, further checks necessary
|
||||
// CULL_INCLUSION = sphere is complete inside the frustum, no further checks necessary
|
||||
inline uint8 CCamera::IsSphereVisible_FH(const Sphere& s) const
|
||||
inline uint8 CCamera::IsSphereVisible_FH(const ::Sphere& s) const
|
||||
{
|
||||
f32 nc, rc, lc, tc, bc, cc;
|
||||
if ((nc = m_fp[0] | s.center) > s.radius)
|
||||
|
||||
@@ -794,7 +794,7 @@ struct HWVSphere
|
||||
radius = r;
|
||||
}
|
||||
|
||||
ILINE HWVSphere(const Sphere& sp)
|
||||
ILINE HWVSphere(const ::Sphere& sp)
|
||||
{
|
||||
center = HWVLoadVecUnaligned(&sp.center);
|
||||
radius = SIMDFLoadFloat(sp.radius);
|
||||
|
||||
@@ -1179,7 +1179,7 @@ namespace Distance {
|
||||
// float result = Distance::Point_TriangleSq( pos, triangle );
|
||||
//----------------------------------------------------------------------------------
|
||||
template<typename F>
|
||||
ILINE F Sphere_TriangleSq(const Sphere& s, const Triangle_tpl<F>& t)
|
||||
ILINE F Sphere_TriangleSq(const ::Sphere& s, const Triangle_tpl<F>& t)
|
||||
{
|
||||
F sqdistance = Distance::Point_TriangleSq(s.center, t) - (s.radius * s.radius);
|
||||
if (sqdistance < 0)
|
||||
@@ -1190,7 +1190,7 @@ namespace Distance {
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
ILINE F Sphere_TriangleSq(const Sphere& s, const Triangle_tpl<F>& t, Vec3_tpl<F>& output)
|
||||
ILINE F Sphere_TriangleSq(const ::Sphere& s, const Triangle_tpl<F>& t, Vec3_tpl<F>& output)
|
||||
{
|
||||
F sqdistance = Distance::Point_TriangleSq(s.center, t, output) - (s.radius * s.radius);
|
||||
if (sqdistance < 0)
|
||||
|
||||
@@ -792,7 +792,7 @@ namespace Intersect {
|
||||
//--- 0x03 = two intersection, lineseg has ENTRY and EXIT point --
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
inline unsigned char Line_Sphere(const Line& line, const Sphere& s, Vec3& i0, Vec3& i1)
|
||||
inline unsigned char Line_Sphere(const Line& line, const ::Sphere& s, Vec3& i0, Vec3& i1)
|
||||
{
|
||||
Vec3 end = line.pointonline + line.direction;
|
||||
|
||||
@@ -830,7 +830,7 @@ namespace Intersect {
|
||||
//--- 0x03 = two intersection, lineseg has ENTRY and EXIT point --
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
inline unsigned char Ray_Sphere(const Ray& ray, const Sphere& s, Vec3& i0, Vec3& i1)
|
||||
inline unsigned char Ray_Sphere(const Ray& ray, const ::Sphere& s, Vec3& i0, Vec3& i1)
|
||||
{
|
||||
Vec3 end = ray.origin + ray.direction;
|
||||
float a = ray.direction | ray.direction;
|
||||
@@ -863,7 +863,7 @@ namespace Intersect {
|
||||
return intersection;
|
||||
}
|
||||
|
||||
inline bool Ray_SphereFirst(const Ray& ray, const Sphere& s, Vec3& intPoint)
|
||||
inline bool Ray_SphereFirst(const Ray& ray, const ::Sphere& s, Vec3& intPoint)
|
||||
{
|
||||
Vec3 p2;
|
||||
unsigned char res = Ray_Sphere(ray, s, intPoint, p2);
|
||||
@@ -886,7 +886,7 @@ namespace Intersect {
|
||||
//--- 0x02 = one intersection, lineseg has just an EXIT point but no ENTRY point (ls.start is inside the sphere) --
|
||||
//--- 0x03 = two intersection, lineseg has ENTRY and EXIT point --
|
||||
//----------------------------------------------------------------------------------
|
||||
inline unsigned char Lineseg_Sphere(const Lineseg& ls, const Sphere& s, Vec3& i0, Vec3& i1)
|
||||
inline unsigned char Lineseg_Sphere(const Lineseg& ls, const ::Sphere& s, Vec3& i0, Vec3& i1)
|
||||
{
|
||||
Vec3 dir = (ls.end - ls.start);
|
||||
|
||||
@@ -931,7 +931,7 @@ namespace Intersect {
|
||||
}
|
||||
|
||||
|
||||
inline bool Lineseg_SphereFirst(const Lineseg& lineseg, const Sphere& s, Vec3& intPoint)
|
||||
inline bool Lineseg_SphereFirst(const Lineseg& lineseg, const ::Sphere& s, Vec3& intPoint)
|
||||
{
|
||||
Vec3 p2;
|
||||
uint8 res = Lineseg_Sphere(lineseg, s, intPoint, p2);
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace Overlap {
|
||||
// Checks if a point is inside a sphere.
|
||||
// Example:
|
||||
// bool result=Overlap::Point_Sphere( point, sphere );
|
||||
ILINE bool Point_Sphere(const Vec3& p, const Sphere& s)
|
||||
ILINE bool Point_Sphere(const Vec3& p, const ::Sphere& s)
|
||||
{
|
||||
Vec3 distc = p - s.center;
|
||||
f32 sqrad = s.radius * s.radius;
|
||||
@@ -407,7 +407,7 @@ namespace Overlap {
|
||||
|
||||
|
||||
//! check if a Lineseg and a Sphere overlap
|
||||
inline bool Lineseg_Sphere(const Lineseg& ls, const Sphere& s)
|
||||
inline bool Lineseg_Sphere(const Lineseg& ls, const ::Sphere& s)
|
||||
{
|
||||
float radius2 = s.radius * s.radius;
|
||||
|
||||
@@ -729,7 +729,7 @@ namespace Overlap {
|
||||
* 0 = no overlap
|
||||
* 1 = overlap
|
||||
*----------------------------------------------------------------------------------*/
|
||||
ILINE bool Sphere_AABB(const Sphere& s, const AABB& aabb)
|
||||
ILINE bool Sphere_AABB(const ::Sphere& s, const AABB& aabb)
|
||||
{
|
||||
Vec3 center(s.center);
|
||||
|
||||
@@ -746,7 +746,7 @@ namespace Overlap {
|
||||
}
|
||||
|
||||
// As Sphere_AABB but ignores z parts
|
||||
ILINE bool Sphere_AABB2D(const Sphere& s, const AABB& aabb)
|
||||
ILINE bool Sphere_AABB2D(const ::Sphere& s, const AABB& aabb)
|
||||
{
|
||||
Vec3 center(s.center);
|
||||
|
||||
@@ -776,7 +776,7 @@ namespace Overlap {
|
||||
* 0x01 = Sphere and AABB overlap
|
||||
* 0x02 = Sphere in inside AABB
|
||||
*/
|
||||
ILINE char Sphere_AABB_Inside(const Sphere& s, const AABB& aabb)
|
||||
ILINE char Sphere_AABB_Inside(const ::Sphere& s, const AABB& aabb)
|
||||
{
|
||||
if (Sphere_AABB(s, aabb))
|
||||
{
|
||||
@@ -819,7 +819,7 @@ namespace Overlap {
|
||||
//--- 0 = no overlap ---------------------------
|
||||
//--- 1 = overlap -----------------
|
||||
//----------------------------------------------------------------------------------
|
||||
inline bool Sphere_OBB(const Sphere& s, const OBB& obb)
|
||||
inline bool Sphere_OBB(const ::Sphere& s, const OBB& obb)
|
||||
{
|
||||
//first we transform the sphere-center into the AABB-space of the OBB
|
||||
Vec3 SphereInOBBSpace = s.center * obb.m33;
|
||||
@@ -861,7 +861,7 @@ namespace Overlap {
|
||||
//--- 0 = no overlap ---------------------------
|
||||
//--- 1 = overlap -----------------
|
||||
//----------------------------------------------------------------------------------
|
||||
inline bool Sphere_Sphere(const Sphere& s1, const Sphere& s2)
|
||||
inline bool Sphere_Sphere(const ::Sphere& s1, const ::Sphere& s2)
|
||||
{
|
||||
Vec3 distc = s1.center - s2.center;
|
||||
f32 sqrad = (s1.radius + s2.radius) * (s1.radius + s2.radius);
|
||||
@@ -884,7 +884,7 @@ namespace Overlap {
|
||||
//--- 1 = overlap -----------------
|
||||
//----------------------------------------------------------------------------------
|
||||
template<typename F>
|
||||
ILINE bool Sphere_Triangle(const Sphere& s, const Triangle_tpl<F>& t)
|
||||
ILINE bool Sphere_Triangle(const ::Sphere& s, const Triangle_tpl<F>& t)
|
||||
{
|
||||
//create a "bouding sphere" around triangle for fast rejection test
|
||||
Vec3_tpl<F> middle = (t.v0 + t.v1 + t.v2) * (1 / 3.0f);
|
||||
@@ -899,7 +899,7 @@ namespace Overlap {
|
||||
SqRad0 = (F)fsel(SqRad0 - SqRad2, SqRad0, SqRad2);
|
||||
|
||||
//first simple rejection-test...
|
||||
if (Sphere_Sphere(s, Sphere(middle, sqrt_tpl(SqRad0))) == 0)
|
||||
if (Sphere_Sphere(s, ::Sphere(middle, sqrt_tpl(SqRad0))) == 0)
|
||||
{
|
||||
return 0; //overlap not possible
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
// Description : Interface to the Mini GUI subsystem
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_ICRYMINIGUI_H
|
||||
#define CRYINCLUDE_CRYCOMMON_ICRYMINIGUI_H
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <smartptr.h>
|
||||
#include <Cry_Color.h>
|
||||
#include <CryExtension/ICryUnknown.h>
|
||||
|
||||
namespace minigui
|
||||
{
|
||||
struct IMiniCtrl;
|
||||
|
||||
// Rectangle class
|
||||
struct Rect
|
||||
{
|
||||
float left;
|
||||
float top;
|
||||
float right;
|
||||
float bottom;
|
||||
|
||||
Rect()
|
||||
: left(0)
|
||||
, top(0)
|
||||
, right(0)
|
||||
, bottom(0) {}
|
||||
Rect(float l, float t, float r, float b)
|
||||
: left(l)
|
||||
, top(t)
|
||||
, right(r)
|
||||
, bottom(b) {}
|
||||
Rect(const Rect& rc) { left = rc.left; top = rc.top; right = rc.right; bottom = rc.bottom; }
|
||||
bool IsPointInside(float x, float y) const { return x >= left && x <= right && y >= top && y <= bottom; }
|
||||
float Width() const { return right - left; }
|
||||
float Height() const { return bottom - top; }
|
||||
};
|
||||
|
||||
typedef void(* ClickCallback)(void* data, bool onOff);
|
||||
typedef void(* RenderCallback)(float x, float y);
|
||||
|
||||
enum EMiniCtrlStatus
|
||||
{
|
||||
eCtrl_Hidden = BIT(0), // Control is hidden.
|
||||
eCtrl_Highlight = BIT(1), // Control is highlight (probably mouse over).
|
||||
eCtrl_Focus = BIT(2), // Control have focus (from keyboard).
|
||||
eCtrl_Checked = BIT(3), // Control have checked mark.
|
||||
eCtrl_NoBorder = BIT(4), // Control have no border.
|
||||
eCtrl_CheckButton = BIT(5), // Button control behave as a check button.
|
||||
eCtrl_TextAlignCentre = BIT(6), // Draw text aligned centre
|
||||
eCtrl_AutoResize = BIT(7), // Auto resize depending on text length
|
||||
eCtrl_Moveable = BIT(8), // Dynamically reposition ctrl
|
||||
eCtrl_CloseButton = BIT(9), // Control has close button
|
||||
};
|
||||
enum EMiniCtrlEvent
|
||||
{
|
||||
eCtrlEvent_LButtonDown = BIT(0),
|
||||
eCtrlEvent_LButtonUp = BIT(1),
|
||||
eCtrlEvent_LButtonPressed = BIT(2),
|
||||
eCtrlEvent_MouseOver = BIT(3),
|
||||
eCtrlEvent_MouseOff = BIT(4),
|
||||
eCtrlEvent_DPadLeft = BIT(5),
|
||||
eCtrlEvent_DPadRight = BIT(6),
|
||||
eCtrlEvent_DPadUp = BIT(7),
|
||||
eCtrlEvent_DPadDown = BIT(8),
|
||||
};
|
||||
|
||||
// Types of the supported controls
|
||||
enum EMiniCtrlType
|
||||
{
|
||||
eCtrlType_Unknown = 0,
|
||||
eCtrlType_Button,
|
||||
eCtrlType_Menu,
|
||||
eCtrlType_InfoBox,
|
||||
eCtrlType_Table,
|
||||
};
|
||||
|
||||
struct SMetrics
|
||||
{
|
||||
float fTextSize;
|
||||
float fTitleSize;
|
||||
|
||||
// Colors.
|
||||
ColorB clrFrameBorder;
|
||||
ColorB clrFrameBorderHighlight;
|
||||
ColorB clrFrameBorderOutOfFocus;
|
||||
ColorB clrChecked;
|
||||
ColorB clrBackground;
|
||||
ColorB clrBackgroundHighlight;
|
||||
ColorB clrBackgroundSelected;
|
||||
ColorB clrTitle;
|
||||
ColorB clrText;
|
||||
ColorB clrTextSelected;
|
||||
|
||||
uint8 outOfFocusAlpha;
|
||||
};
|
||||
|
||||
enum ECommand
|
||||
{
|
||||
eCommand_ButtonPress,
|
||||
eCommand_ButtonChecked,
|
||||
eCommand_ButtonUnchecked,
|
||||
};
|
||||
// Command sent from the control.
|
||||
struct SCommand
|
||||
{
|
||||
ECommand command;
|
||||
IMiniCtrl* pCtrl;
|
||||
int nCtrlID;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Event listener interface for the MiniGUI
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
struct IMiniGUIEventListener
|
||||
{
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~IMiniGUIEventListener(){}
|
||||
virtual void OnCommand(SCommand& cmd) = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
// Interface to the GUI
|
||||
struct IMiniGUI
|
||||
: public ICryUnknown
|
||||
{
|
||||
public:
|
||||
CRYINTERFACE_DECLARE(IMiniGUI, 0xea09d34268814f2a, 0xaf1034e04b076011);
|
||||
|
||||
// <interfuscator:shuffle>
|
||||
virtual void Init() = 0;
|
||||
virtual void Done() = 0;
|
||||
virtual void Draw() = 0;
|
||||
virtual void Reset() = 0;
|
||||
|
||||
virtual void SaveState() = 0;
|
||||
virtual void RestoreState() = 0;
|
||||
|
||||
virtual void SetEnabled(bool status) = 0;
|
||||
virtual void SetInFocus(bool status) = 0;
|
||||
virtual bool InFocus() = 0;
|
||||
|
||||
virtual void SetEventListener(IMiniGUIEventListener* pListener) = 0;
|
||||
|
||||
virtual SMetrics& Metrics() = 0;
|
||||
|
||||
// Makes a new control
|
||||
virtual IMiniCtrl* CreateCtrl(IMiniCtrl* pParentCtrl, int nCtrlID, EMiniCtrlType type, int nCtrlFlags, const Rect& rc, const char* title) = 0;
|
||||
|
||||
// Remove all controls.
|
||||
virtual void RemoveAllCtrl() = 0;
|
||||
|
||||
virtual void OnCommand(SCommand& cmd) = 0;
|
||||
|
||||
virtual IMiniCtrl* GetCtrlFromPoint(float x, float y) const = 0;
|
||||
|
||||
virtual void SetMovingCtrl(IMiniCtrl* pCtrl) = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
DECLARE_SMART_POINTERS(IMiniGUI);
|
||||
|
||||
struct IMiniCtrl
|
||||
: public _reference_target_t
|
||||
{
|
||||
// <interfuscator:shuffle>
|
||||
virtual void Reset() = 0;
|
||||
|
||||
virtual void SaveState() = 0;
|
||||
virtual void RestoreState() = 0;
|
||||
|
||||
// For system call only.
|
||||
virtual void SetGUI(IMiniGUI* pGUI) = 0;
|
||||
virtual IMiniGUI* GetGUI() const = 0;
|
||||
|
||||
virtual EMiniCtrlType GetType() const = 0;
|
||||
|
||||
virtual int GetId() const = 0;
|
||||
virtual void SetId(int id) = 0;
|
||||
|
||||
virtual const char* GetTitle() const = 0;
|
||||
virtual void SetTitle(const char* title) = 0;
|
||||
|
||||
virtual Rect GetRect() const = 0;
|
||||
virtual void SetRect(const Rect& rc) = 0;
|
||||
|
||||
virtual void SetFlag(uint32 flag) = 0;
|
||||
virtual void ClearFlag(uint32 flag) = 0;
|
||||
virtual bool CheckFlag(uint32 flag) const = 0;
|
||||
|
||||
// Sub Controls handling.
|
||||
virtual void AddSubCtrl(IMiniCtrl* pCtrl) = 0;
|
||||
virtual void RemoveSubCtrl(IMiniCtrl* pCtrl) = 0;
|
||||
virtual void RemoveAllSubCtrl() = 0;
|
||||
virtual int GetSubCtrlCount() const = 0;
|
||||
virtual IMiniCtrl* GetSubCtrl(int nIndex) const = 0;
|
||||
virtual IMiniCtrl* GetParent() const = 0;
|
||||
|
||||
// Check if point is inside any of the sub controls.
|
||||
virtual IMiniCtrl* GetCtrlFromPoint(float x, float y) = 0;
|
||||
|
||||
virtual void OnPaint(class CDrawContext& dc) = 0;
|
||||
|
||||
virtual void SetVisible(bool state) = 0;
|
||||
|
||||
// Events from GUI
|
||||
virtual void OnEvent([[maybe_unused]] float x, [[maybe_unused]] float y, EMiniCtrlEvent) {};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// When set, this control will be enabling/disabling specified cvar
|
||||
// when button not checked fOffValue will be set on cvar, when checked fOnValue will be set.
|
||||
virtual bool SetControlCVar(const char* sCVarName, float fOffValue, float fOnValue) = 0;
|
||||
|
||||
virtual bool SetClickCallback(ClickCallback callback, void* pCallbackData) = 0;
|
||||
|
||||
virtual bool SetRenderCallback(RenderCallback callback) = 0;
|
||||
|
||||
virtual bool SetConnectedCtrl(IMiniCtrl* pConnectedCtrl) = 0;
|
||||
|
||||
//resize text box based what text is present
|
||||
virtual void AutoResize() = 0;
|
||||
|
||||
//Create close 'X' button for control
|
||||
virtual void CreateCloseButton() = 0;
|
||||
|
||||
//Move control
|
||||
virtual void Move(float x, float y) = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
typedef _smart_ptr<IMiniCtrl> IMiniCtrlPtr;
|
||||
|
||||
class IMiniGuiCommon
|
||||
{
|
||||
public:
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~IMiniGuiCommon(){}
|
||||
virtual bool IsHidden() = 0;
|
||||
virtual void Hide(bool stat) = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
class IMiniTable
|
||||
: public IMiniGuiCommon
|
||||
{
|
||||
public:
|
||||
// <interfuscator:shuffle>
|
||||
virtual int AddColumn(const char* name) = 0;
|
||||
virtual void RemoveColumns() = 0;
|
||||
virtual int AddData(int columnIndex, ColorB col, const char* format, ...) = 0;
|
||||
virtual void ClearTable() = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
class IMiniInfoBox
|
||||
: public IMiniGuiCommon
|
||||
{
|
||||
public:
|
||||
// <interfuscator:shuffle>
|
||||
virtual void SetTextIndent(float x) = 0;
|
||||
virtual void SetTextSize(float sz) = 0;
|
||||
virtual void ClearEntries() = 0;
|
||||
virtual void AddEntry(const char* str, ColorB col, float textSize) = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#define MINIGUI_BEGIN namespace minigui {
|
||||
#define MINIGUI_END }
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_ICRYMINIGUI_H
|
||||
@@ -1,95 +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_IDEFERREDCOLLISIONEVENT_H
|
||||
#define CRYINCLUDE_CRYCOMMON_IDEFERREDCOLLISIONEVENT_H
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <IThreadTask.h>
|
||||
|
||||
struct EventPhys;
|
||||
|
||||
// Base class for all deferred physics events
|
||||
// Basically this class works like a future,
|
||||
// Start() start the computation(some in the main thread, major part in a task/job)
|
||||
// Result() will sync the task operation and return the result
|
||||
struct IDeferredPhysicsEvent
|
||||
: public IThreadTask
|
||||
{
|
||||
// enum list of all types of deferred events
|
||||
enum DeferredEventType
|
||||
{
|
||||
PhysCallBack_OnCollision
|
||||
};
|
||||
|
||||
IDeferredPhysicsEvent(){}
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~IDeferredPhysicsEvent(){}
|
||||
|
||||
// == "future" like interface == //
|
||||
|
||||
// start the execution of the event
|
||||
virtual void Start() = 0;
|
||||
|
||||
// sync the event and do all necessary post-processing, then return the result
|
||||
virtual int Result(EventPhys* pOrigEvent = 0) = 0;
|
||||
|
||||
// just wait for the event to finish
|
||||
virtual void Sync() = 0;
|
||||
|
||||
// check if the async computation part has finished
|
||||
virtual bool HasFinished() = 0;
|
||||
|
||||
// Get the concrete Type of this deferred event
|
||||
virtual DeferredEventType GetType() const = 0;
|
||||
|
||||
// returns a ptr to the original physics event
|
||||
virtual EventPhys* PhysicsEvent() = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
|
||||
// Manager class for deferred physics events
|
||||
struct IDeferredPhysicsEventManager
|
||||
{
|
||||
// type of create function used to create needed deferred events in the HandleEvent function
|
||||
typedef IDeferredPhysicsEvent*(* CreateEventFunc)(const EventPhys* pEvent);
|
||||
|
||||
IDeferredPhysicsEventManager(){}
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~IDeferredPhysicsEventManager(){}
|
||||
|
||||
// dispatch an deferred event to the task thread
|
||||
virtual void DispatchDeferredEvent(IDeferredPhysicsEvent* pEvent) = 0;
|
||||
|
||||
// Encapsulates common logic for deferred events, should be called from the physics callbacks
|
||||
// handles the cvar management as well as deferred event creating
|
||||
virtual int HandleEvent(const EventPhys* pEvent, IDeferredPhysicsEventManager::CreateEventFunc, IDeferredPhysicsEvent::DeferredEventType) = 0;
|
||||
|
||||
// Register and Unregister Deferred events in the manager to allow
|
||||
virtual void RegisterDeferredEvent(IDeferredPhysicsEvent* pDeferredEvent) = 0;
|
||||
virtual void UnRegisterDeferredEvent(IDeferredPhysicsEvent* pDeferredEvent) = 0;
|
||||
|
||||
// Delete all Deferred Events in flight, use only when also clearing the physics event queue
|
||||
// or else this call results in dangling points, mostly used for save/load
|
||||
virtual void ClearDeferredEvents() = 0;
|
||||
|
||||
virtual void Update() = 0;
|
||||
|
||||
virtual IDeferredPhysicsEvent* GetLastCollisionEventForEntity(IPhysicalEntity* pPhysEnt) = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_IDEFERREDCOLLISIONEVENT_H
|
||||
@@ -1,155 +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_IDEFRAGALLOCATOR_H
|
||||
#define CRYINCLUDE_CRYCOMMON_IDEFRAGALLOCATOR_H
|
||||
#pragma once
|
||||
|
||||
|
||||
struct IDefragAllocatorStats
|
||||
{
|
||||
size_t nCapacity;
|
||||
size_t nInUseSize;
|
||||
uint32 nInUseBlocks;
|
||||
uint32 nFreeBlocks;
|
||||
uint32 nPinnedBlocks;
|
||||
uint32 nMovingBlocks;
|
||||
uint32 nLargestFreeBlockSize;
|
||||
uint32 nSmallestFreeBlockSize;
|
||||
uint32 nMeanFreeBlockSize;
|
||||
uint32 nCancelledMoveCount;
|
||||
};
|
||||
|
||||
struct IDefragAllocatorCopyNotification
|
||||
{
|
||||
IDefragAllocatorCopyNotification()
|
||||
: bDstIsValid(false)
|
||||
, bSrcIsUnneeded(false)
|
||||
, bCancel(false)
|
||||
{
|
||||
}
|
||||
|
||||
bool bDstIsValid;
|
||||
bool bSrcIsUnneeded;
|
||||
|
||||
// Flag to indicate that the copy can't be initiated after all - currently only cancelling before a relocate
|
||||
// is begun is supported, and the destination region must be stable
|
||||
bool bCancel;
|
||||
};
|
||||
|
||||
class IDefragAllocatorPolicy
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
InvalidUserMoveId = 0xffffffff
|
||||
};
|
||||
|
||||
public:
|
||||
// <interfuscator:shuffle>
|
||||
virtual uint32 BeginCopy(void* pContext, UINT_PTR dstOffset, UINT_PTR srcOffset, UINT_PTR size, IDefragAllocatorCopyNotification* pNotification) = 0;
|
||||
virtual void Relocate(uint32 userMoveId, void* pContext, UINT_PTR newOffset, UINT_PTR oldOffset, UINT_PTR size) = 0;
|
||||
virtual void CancelCopy(uint32 userMoveId, void* pContext, bool bSync) = 0;
|
||||
|
||||
// Perform the copy and relocate immediately - will only be called when UnAppendSegment is
|
||||
virtual void SyncCopy(void* pContext, UINT_PTR dstOffset, UINT_PTR srcOffset, UINT_PTR size) = 0;
|
||||
// </interfuscator:shuffle>
|
||||
|
||||
protected:
|
||||
virtual ~IDefragAllocatorPolicy() {}
|
||||
};
|
||||
|
||||
class IDefragAllocator
|
||||
{
|
||||
public:
|
||||
typedef uint32 Hdl;
|
||||
enum
|
||||
{
|
||||
InvalidHdl = 0,
|
||||
};
|
||||
|
||||
struct AllocatePinnedResult
|
||||
{
|
||||
Hdl hdl;
|
||||
UINT_PTR offs;
|
||||
UINT_PTR usableSize;
|
||||
};
|
||||
|
||||
enum EBlockSearchKind
|
||||
{
|
||||
eBSK_BestFit,
|
||||
eBSK_FirstFit
|
||||
};
|
||||
|
||||
struct Policy
|
||||
{
|
||||
Policy()
|
||||
: pDefragPolicy(NULL)
|
||||
, maxAllocs(0)
|
||||
, maxSegments(1)
|
||||
, blockSearchKind(eBSK_BestFit)
|
||||
{
|
||||
}
|
||||
|
||||
IDefragAllocatorPolicy* pDefragPolicy;
|
||||
size_t maxAllocs;
|
||||
size_t maxSegments;
|
||||
EBlockSearchKind blockSearchKind;
|
||||
};
|
||||
|
||||
public:
|
||||
// <interfuscator:shuffle>
|
||||
virtual void Release(bool bDiscard = false) = 0;
|
||||
|
||||
virtual void Init(UINT_PTR capacity, UINT_PTR alignment, const Policy& policy = Policy()) = 0;
|
||||
|
||||
virtual bool AppendSegment(UINT_PTR capacity) = 0;
|
||||
virtual void UnAppendSegment() = 0;
|
||||
|
||||
virtual Hdl Allocate(size_t sz, const char* source, void* pContext = NULL) = 0;
|
||||
virtual Hdl AllocateAligned(size_t sz, size_t alignment, const char* source, void* pContext = NULL) = 0;
|
||||
virtual AllocatePinnedResult AllocatePinned(size_t sz, const char* source, void* pContext = NULL) = 0;
|
||||
virtual bool Free(Hdl hdl) = 0;
|
||||
|
||||
virtual void ChangeContext(Hdl hdl, void* pNewContext) = 0;
|
||||
|
||||
virtual size_t GetAllocated() const = 0;
|
||||
virtual IDefragAllocatorStats GetStats() = 0;
|
||||
|
||||
virtual void DisplayMemoryUsage(const char* title, unsigned int allocatorDisplayOffset = 0) = 0;
|
||||
|
||||
virtual size_t DefragmentTick(size_t maxMoves, size_t maxAmount, bool bForce = false) = 0;
|
||||
|
||||
virtual UINT_PTR UsableSize(Hdl hdl) = 0;
|
||||
|
||||
// Pin the chunk until the next defrag tick, when it will be automatically unpinned
|
||||
virtual UINT_PTR WeakPin(Hdl hdl) = 0;
|
||||
|
||||
// Pin the chunk until Unpin is called
|
||||
virtual UINT_PTR Pin(Hdl hdl) = 0;
|
||||
|
||||
virtual void Unpin(Hdl hdl) = 0;
|
||||
|
||||
virtual const char* GetSourceOf(Hdl hdl) = 0;
|
||||
// </interfuscator:shuffle>
|
||||
|
||||
#ifndef _RELEASE
|
||||
virtual void DumpState(const char* filename) = 0;
|
||||
virtual void RestoreState(const char* filename) = 0;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual ~IDefragAllocator() {}
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_IDEFRAGALLOCATOR_H
|
||||
@@ -1,56 +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_IFILECHANGEMONITOR_H
|
||||
#define CRYINCLUDE_CRYCOMMON_IFILECHANGEMONITOR_H
|
||||
#pragma once
|
||||
|
||||
struct IFileChangeListener
|
||||
{
|
||||
enum EChangeType
|
||||
{
|
||||
//! error or unknown change type
|
||||
eChangeType_Unknown,
|
||||
//! the file was created
|
||||
eChangeType_Created,
|
||||
//! the file was deleted
|
||||
eChangeType_Deleted,
|
||||
//! the file was modified (size changed,write)
|
||||
eChangeType_Modified,
|
||||
//! this is the old name of a renamed file
|
||||
eChangeType_RenamedOldName,
|
||||
//! this is the new name of a renamed file
|
||||
eChangeType_RenamedNewName
|
||||
};
|
||||
|
||||
virtual ~IFileChangeListener() = default;
|
||||
|
||||
virtual void OnFileChange(const char* sFilename, EChangeType eType) = 0;
|
||||
};
|
||||
|
||||
struct IFileChangeMonitor
|
||||
{
|
||||
virtual ~IFileChangeMonitor() = default;
|
||||
|
||||
// <interfuscator:shuffle>
|
||||
// Register the path of a file or directory to monitor
|
||||
// Path is relative to game directory, e.g. "Libs/WoundSystem/" or "Libs/WoundSystem/HitLocations.xml"
|
||||
virtual bool RegisterListener(IFileChangeListener* pListener, const char* sMonitorItem) = 0;
|
||||
// This function can be used to monitor files of specific type, e.g.
|
||||
// RegisterListener(pListener, "Animations", "caf")
|
||||
virtual bool RegisterListener(IFileChangeListener* pListener, const char* sFolder, const char* sExtension) = 0;
|
||||
virtual bool UnregisterListener(IFileChangeListener* pListener) = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_IFILECHANGEMONITOR_H
|
||||
@@ -33,8 +33,6 @@ struct ICryFont;
|
||||
struct IFFont;
|
||||
struct FontFamily;
|
||||
|
||||
struct IRenderer;
|
||||
|
||||
struct SVF_P2F_C4B_T2F_F4B;
|
||||
|
||||
extern "C"
|
||||
@@ -100,9 +98,6 @@ struct ICryFont
|
||||
//! \param glyphSizeY Height (in pixels) of the characters to be rendered at in the font texture.
|
||||
virtual void AddCharsToFontTextures(FontFamilyPtr pFontFamily, const char* pChars, int glyphSizeX = defaultGlyphSizeX, int glyphSizeY = defaultGlyphSizeY) = 0;
|
||||
|
||||
// Summary:
|
||||
// Globally sets common font render properties based on the initialized renderer
|
||||
virtual void SetRendererProperties(IRenderer* pRenderer) = 0;
|
||||
// Summary:
|
||||
// Puts the objects used in this module into the sizer interface
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const = 0;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <smartptr.h>
|
||||
#include <IDefragAllocator.h> // <> required for Interfuscator
|
||||
#include <IGeneralMemoryHeap.h> // <> required for Interfuscator
|
||||
#include <smartptr.h>
|
||||
|
||||
|
||||
@@ -1,47 +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 : IOverloadSceneManager interface declaration.
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_IOVERLOADSCENEMANAGER_H
|
||||
#define CRYINCLUDE_CRYCOMMON_IOVERLOADSCENEMANAGER_H
|
||||
#pragma once
|
||||
|
||||
//==================================================================================================
|
||||
// Name: COverloadSceneManager
|
||||
// Desc: Manages overload values (eg CPU,GPU etc)
|
||||
// 1.0="everything is ok" 0.0="very bad frame rate"
|
||||
// various systems can use this information and control what is currently in the scene
|
||||
// Author: James Chilvers
|
||||
//==================================================================================================
|
||||
struct IOverloadSceneManager
|
||||
{
|
||||
public:
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~IOverloadSceneManager() {}
|
||||
|
||||
virtual void Reset() = 0;
|
||||
virtual void Update() = 0;
|
||||
|
||||
// Override auto-calculated scale to reach targetfps.
|
||||
// frameScale is clamped to internal min/max values,
|
||||
// dt is the length of time in seconds to transition
|
||||
virtual void OverrideScale(float frameScale, float dt) = 0;
|
||||
|
||||
// Go back to auto-calculated scale from an overridden scale
|
||||
virtual void ResetScale(float dt) = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};//------------------------------------------------------------------------------------------------
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_IOVERLOADSCENEMANAGER_H
|
||||
@@ -109,7 +109,7 @@ struct NavigationBlocker
|
||||
, costMultMod(0)
|
||||
, radialDecay(false) {AZ_Assert(false, "Should never get called"); }
|
||||
|
||||
Sphere sphere;
|
||||
::Sphere sphere;
|
||||
bool radialDecay;
|
||||
bool directional;
|
||||
|
||||
|
||||
@@ -1,145 +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 to the Performance HUD
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_IPERFHUD_H
|
||||
#define CRYINCLUDE_CRYCOMMON_IPERFHUD_H
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <CryExtension/ICryUnknown.h>
|
||||
#include <CryExtension/Impl/ClassWeaver.h>
|
||||
#include <ICryMiniGUI.h>
|
||||
#include <IXml.h>
|
||||
|
||||
struct ICryPerfHUDWidget
|
||||
: public _reference_target_t
|
||||
{
|
||||
//
|
||||
enum EWidgetID
|
||||
{
|
||||
eWidget_Warnings = 0,
|
||||
eWidget_RenderStats,
|
||||
eWidget_StreamingStats,
|
||||
eWidget_RenderBatchStats,
|
||||
eWidget_FpsBuckets,
|
||||
eWidget_Particles,
|
||||
eWidget_PakFile,
|
||||
eWidget_Num, //number of widgets
|
||||
};
|
||||
|
||||
ICryPerfHUDWidget(int id = -1)
|
||||
: m_id(id)
|
||||
{}
|
||||
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~ICryPerfHUDWidget() {}
|
||||
|
||||
virtual void Reset() = 0;
|
||||
virtual void Update() = 0;
|
||||
virtual bool ShouldUpdate() = 0;
|
||||
virtual void LoadBudgets(XmlNodeRef perfXML) = 0;
|
||||
virtual void SaveStats(XmlNodeRef statsXML) = 0;
|
||||
virtual void Enable(int mode) = 0;
|
||||
virtual void Disable() = 0;
|
||||
// </interfuscator:shuffle>
|
||||
|
||||
int m_id;
|
||||
};
|
||||
|
||||
// Base Interface for all engine module extensions
|
||||
struct ICryPerfHUD
|
||||
: public ICryUnknown
|
||||
{
|
||||
CRYINTERFACE_DECLARE(ICryPerfHUD, 0x268d142e043d464c, 0xa0776580f81b988a);
|
||||
|
||||
struct PerfBucket
|
||||
{
|
||||
ILINE PerfBucket(float _target)
|
||||
{
|
||||
target = _target;
|
||||
timeAtTarget = 0.f;
|
||||
}
|
||||
|
||||
float target;
|
||||
float timeAtTarget;
|
||||
};
|
||||
|
||||
enum EHudState
|
||||
{
|
||||
eHudOff = 0,
|
||||
eHudInFocus,
|
||||
eHudOutOfFocus,
|
||||
eHudNumStates,
|
||||
};
|
||||
|
||||
// <interfuscator:shuffle>
|
||||
// Called once to initialize HUD.
|
||||
virtual void Init() = 0;
|
||||
virtual void Done() = 0;
|
||||
virtual void Draw() = 0;
|
||||
virtual void LoadBudgets() = 0;
|
||||
virtual void SaveStats(const char* filename = NULL) = 0;
|
||||
virtual void ResetWidgets() = 0;
|
||||
virtual void SetState(EHudState state) = 0;
|
||||
virtual void Reset() = 0;
|
||||
virtual void Destroy() = 0;
|
||||
|
||||
// Retrieve name of the extension module.
|
||||
virtual void Show(bool bRestoreState) = 0;
|
||||
|
||||
virtual void AddWidget(ICryPerfHUDWidget* pWidget) = 0;
|
||||
virtual void RemoveWidget(ICryPerfHUDWidget* pWidget) = 0;
|
||||
|
||||
virtual minigui::IMiniCtrl* CreateMenu(const char* name, minigui::IMiniCtrl* pParent = NULL) = 0;
|
||||
virtual bool CreateCVarMenuItem(minigui::IMiniCtrl* pMenu, const char* name, const char* controlVar, float controlVarOn, float controlVarOff) = 0;
|
||||
virtual bool CreateCallbackMenuItem(minigui::IMiniCtrl* pMenu, const char* name, minigui::ClickCallback clickCallback, void* pCallbackData) = 0;
|
||||
virtual minigui::IMiniInfoBox* CreateInfoMenuItem(minigui::IMiniCtrl* pMenu, const char* name, minigui::RenderCallback renderCallback, const minigui::Rect& rect, bool onAtStart = false) = 0;
|
||||
virtual minigui::IMiniTable* CreateTableMenuItem(minigui::IMiniCtrl* pMenu, const char* name) = 0;
|
||||
|
||||
virtual minigui::IMiniCtrl* GetMenu(const char* name) = 0;
|
||||
|
||||
virtual void EnableWidget(ICryPerfHUDWidget::EWidgetID id, int mode) = 0;
|
||||
virtual void DisableWidget(ICryPerfHUDWidget::EWidgetID id) = 0;
|
||||
|
||||
//Warnings - Widget Specific interface
|
||||
virtual void AddWarning(float duration, const char* fmt, va_list argList) = 0;
|
||||
virtual bool WarningsWindowEnabled() const = 0;
|
||||
|
||||
//FPS - Widget Specific interface
|
||||
virtual const std::vector<PerfBucket>* GetFpsBuckets(float& totalTime) const = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
DECLARE_SMART_POINTERS(ICryPerfHUD);
|
||||
|
||||
void CryPerfHUDWarning(float duration, const char*, ...) PRINTF_PARAMS(2, 3);
|
||||
inline void CryPerfHUDWarning(float duration, const char* format, ...)
|
||||
{
|
||||
if (gEnv && gEnv->pSystem)
|
||||
{
|
||||
ICryPerfHUD* pPerfHud = gEnv->pSystem->GetPerfHUD();
|
||||
|
||||
if (pPerfHud)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
pPerfHud->AddWarning(duration, format, args);
|
||||
va_end(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_IPERFHUD_H
|
||||
@@ -1472,7 +1472,6 @@ struct IRenderer
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
// Shaders/Shaders management /////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual void EF_SetShaderMissCallback(ShaderCacheMissCallback callback) = 0;
|
||||
virtual const char* EF_GetShaderMissLogPath() = 0;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1533,10 +1532,6 @@ struct IRenderer
|
||||
virtual int EF_LoadLightmap (const char* name) = 0;
|
||||
virtual bool EF_RenderEnvironmentCubeHDR (int size, Vec3& Pos, TArray<unsigned short>& vecData) = 0;
|
||||
|
||||
// Summary:
|
||||
// Creates new RE (RenderElement) of type (edt).
|
||||
virtual IRenderElement* EF_CreateRE (EDataType edt) = 0;
|
||||
|
||||
// Summary:
|
||||
// Starts using of the shaders (return first index for allow recursions).
|
||||
virtual void EF_StartEf (const SRenderingPassInfo& passInfo) = 0;
|
||||
@@ -2385,26 +2380,6 @@ private:
|
||||
virtual void EF_QueryImpl(ERenderQueryTypes eQuery, void* pInOut0, uint32 nInOutSize0, void* pInOut1, uint32 nInOutSize1) = 0;
|
||||
};
|
||||
|
||||
// util class to change wireframe mode
|
||||
class CScopedWireFrameMode
|
||||
{
|
||||
public:
|
||||
CScopedWireFrameMode(IRenderer* pRenderer, int nMode)
|
||||
: m_pRenderer(pRenderer)
|
||||
, m_nMode(nMode)
|
||||
{
|
||||
(void) m_nMode; // removes not used warning
|
||||
pRenderer->PushWireframeMode(nMode);
|
||||
}
|
||||
~CScopedWireFrameMode()
|
||||
{
|
||||
m_pRenderer->PopWireframeMode();
|
||||
}
|
||||
private:
|
||||
IRenderer* m_pRenderer;
|
||||
int m_nMode;
|
||||
};
|
||||
|
||||
struct SShaderCacheStatistics
|
||||
{
|
||||
size_t m_nTotalLevelShaderCacheMisses;
|
||||
|
||||
@@ -3413,6 +3413,6 @@ struct SShaderGraphBlock
|
||||
typedef std::vector<SShaderGraphBlock*> FXShaderGraphBlocks;
|
||||
typedef FXShaderGraphBlocks::iterator FXShaderGraphBlocksItor;
|
||||
|
||||
#include "RendElement.h"
|
||||
#include <CryCommon/StaticInstance.h>
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_ISHADER_H
|
||||
|
||||
@@ -89,7 +89,6 @@ struct IResourceManager;
|
||||
struct ITextModeConsole;
|
||||
struct IAVI_Reader;
|
||||
class CPNoise3;
|
||||
struct IFileChangeMonitor;
|
||||
struct IVisualLog;
|
||||
struct ILocalizationManager;
|
||||
struct ICryFactoryRegistry;
|
||||
@@ -99,7 +98,6 @@ struct IZLibDecompressor;
|
||||
struct ILZ4Decompressor;
|
||||
class IZStdDecompressor;
|
||||
struct IOutputPrintSink;
|
||||
struct IOverloadSceneManager;
|
||||
struct IThreadManager;
|
||||
struct IServiceNetwork;
|
||||
struct IRemoteCommandManager;
|
||||
@@ -130,7 +128,6 @@ struct CLoadingTimeProfiler;
|
||||
class ICmdLine;
|
||||
|
||||
struct INotificationNetwork;
|
||||
struct ICryPerfHUD;
|
||||
class ILyShine;
|
||||
|
||||
namespace JobManager {
|
||||
@@ -641,14 +638,12 @@ struct SSystemInitParams
|
||||
bool bDedicatedServer; // When running a dedicated server.
|
||||
bool bExecuteCommandLine; // can be switched of to suppress the feature or do it later during the initialization.
|
||||
bool bSkipFont; // Don't load CryFont.dll
|
||||
bool bSkipRenderer; // Don't load Renderer
|
||||
bool bSkipConsole; // Don't create console
|
||||
bool bSkipNetwork; // Don't create Network
|
||||
bool bSkipWebsocketServer; // Don't create the WebSocket server
|
||||
bool bMinimal; // Don't load banks
|
||||
bool bTesting; // CryUnit
|
||||
bool bNoRandom; //use fixed generator init/seed
|
||||
bool bShaderCacheGen; // When running in shadercache gen mode
|
||||
bool bUnattendedMode; // When running as part of a build on build-machines: Prevent popping up of any dialog
|
||||
bool bSkipMovie; // Don't load movie
|
||||
bool bSkipAnimation; // Don't load animation
|
||||
@@ -699,7 +694,6 @@ struct SSystemInitParams
|
||||
bExecuteCommandLine = true;
|
||||
bExecuteCommandLine = true;
|
||||
bSkipFont = false;
|
||||
bSkipRenderer = false;
|
||||
bSkipConsole = false;
|
||||
bSkipNetwork = false;
|
||||
#if defined(WIN32) || defined(WIN64)
|
||||
@@ -712,7 +706,6 @@ struct SSystemInitParams
|
||||
bMinimal = false;
|
||||
bTesting = false;
|
||||
bNoRandom = false;
|
||||
bShaderCacheGen = false;
|
||||
bUnattendedMode = false;
|
||||
bSkipMovie = false;
|
||||
bSkipAnimation = false;
|
||||
@@ -792,7 +785,6 @@ struct SSystemGlobalEnvironment
|
||||
{
|
||||
AZ::IO::IArchive* pCryPak;
|
||||
AZ::IO::FileIOBase* pFileIO;
|
||||
IFileChangeMonitor* pFileChangeMonitor;
|
||||
IProfileLogSystem* pProfileLogSystem;
|
||||
IOpticsManager* pOpticsManager;
|
||||
ITimer* pTimer;
|
||||
@@ -806,7 +798,6 @@ struct SSystemGlobalEnvironment
|
||||
IRenderer* pRenderer;
|
||||
IMaterialEffects* pMaterialEffects;
|
||||
ISoftCodeMgr* pSoftCodeMgr;
|
||||
IOverloadSceneManager* pOverloadSceneManager;
|
||||
IServiceNetwork* pServiceNetwork;
|
||||
IRemoteCommandManager* pRemoteCommandManager;
|
||||
ILyShine* pLyShine;
|
||||
@@ -1127,14 +1118,6 @@ struct ISystem
|
||||
// Gets number of CPUs
|
||||
virtual int GetLogicalCPUCount() = 0;
|
||||
|
||||
// Summary:
|
||||
// Return the rendering driver name. GL or Metal
|
||||
virtual const char* GetRenderingDriverName() const = 0;
|
||||
|
||||
// Summary:
|
||||
// Dumps the memory usage statistics to the logging default MB. (can be KB)
|
||||
virtual void DumpMemoryUsageStatistics(bool bUseKB = false) = 0;
|
||||
|
||||
// Summary:
|
||||
// Quits the application.
|
||||
virtual void Quit() = 0;
|
||||
@@ -1145,9 +1128,6 @@ struct ISystem
|
||||
// Returns true if the application is in the shutdown phase.
|
||||
virtual bool IsQuitting() const = 0;
|
||||
// Summary:
|
||||
// Returns true if the application was initialized to generate the shader cache.
|
||||
virtual bool IsShaderCacheGenMode() const = 0;
|
||||
// Summary:
|
||||
// Tells the system in which way we are using the serialization system.
|
||||
virtual void SerializingFile(int mode) = 0;
|
||||
virtual int IsSerializingFile() const = 0;
|
||||
@@ -1195,7 +1175,6 @@ struct ISystem
|
||||
virtual IZLibDecompressor* GetIZLibDecompressor() = 0;
|
||||
virtual ILZ4Decompressor* GetLZ4Decompressor() = 0;
|
||||
virtual IZStdDecompressor* GetZStdDecompressor() = 0;
|
||||
virtual ICryPerfHUD* GetPerfHUD() = 0;
|
||||
virtual INotificationNetwork* GetINotificationNetwork() = 0;
|
||||
virtual IViewSystem* GetIViewSystem() = 0;
|
||||
virtual ILevelSystem* GetILevelSystem() = 0;
|
||||
@@ -1217,16 +1196,10 @@ struct ISystem
|
||||
virtual IProfilingSystem* GetIProfilingSystem() = 0;
|
||||
virtual ISystemEventDispatcher* GetISystemEventDispatcher() = 0;
|
||||
virtual IVisualLog* GetIVisualLog() = 0;
|
||||
virtual IFileChangeMonitor* GetIFileChangeMonitor() = 0;
|
||||
|
||||
virtual WIN_HWND GetHWND() = 0;
|
||||
|
||||
virtual IRenderer* GetIRenderer() = 0;
|
||||
virtual ITimer* GetITimer() = 0;
|
||||
virtual IThreadManager* GetIThreadManager() = 0;
|
||||
|
||||
//irtual IThreadManager* GetIThreadManager() = 0;
|
||||
|
||||
virtual void SetLoadingProgressListener(ILoadingProgressListener* pListener) = 0;
|
||||
virtual ISystem::ILoadingProgressListener* GetLoadingProgressListener() const = 0;
|
||||
|
||||
@@ -1234,7 +1207,6 @@ struct ISystem
|
||||
// Game is created after System init, so has to be set explicitly.
|
||||
virtual void SetIMaterialEffects(IMaterialEffects* pMaterialEffects) = 0;
|
||||
virtual void SetIOpticsManager(IOpticsManager* pOpticsManager) = 0;
|
||||
virtual void SetIFileChangeMonitor(IFileChangeMonitor* pFileChangeMonitor) = 0;
|
||||
virtual void SetIVisualLog(IVisualLog* pVisualLog) = 0;
|
||||
|
||||
//virtual const char *GetGamePath()=0;
|
||||
@@ -1377,10 +1349,6 @@ struct ISystem
|
||||
// Non-0 if the state was indeed changed, 0 if already in that state.
|
||||
virtual int SetThreadState(ESubsystem subsys, bool bActive) = 0;
|
||||
|
||||
// Summary:
|
||||
// Creates and returns a usable object implementing ICrySizer interface.
|
||||
virtual ICrySizer* CreateSizer() = 0;
|
||||
|
||||
// Summary:
|
||||
// Query if system is now paused.
|
||||
// Pause flag is set when calling system update with pause mode.
|
||||
@@ -1491,11 +1459,6 @@ struct ISystem
|
||||
// returns zeroes if no updates happened yet
|
||||
virtual void GetUpdateStats(SSystemUpdateStats& stats) = 0;
|
||||
|
||||
// Description:
|
||||
// Useful to investigate memory fragmentation.
|
||||
// Every time you call this from the console: #System.DumpMemoryCoverage()
|
||||
// it adds a line to "MemoryCoverage.bmp" (generated the first time, there is a max line count).
|
||||
virtual void DumpMemoryCoverage() = 0;
|
||||
virtual ESystemGlobalState GetSystemGlobalState(void) = 0;
|
||||
virtual void SetSystemGlobalState(ESystemGlobalState systemGlobalState) = 0;
|
||||
|
||||
|
||||
@@ -1,373 +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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzFramework/API/ApplicationAPI.h>
|
||||
|
||||
#include "LoadScreenComponent.h"
|
||||
#include <IConsole.h>
|
||||
|
||||
#if AZ_LOADSCREENCOMPONENT_ENABLED
|
||||
|
||||
namespace
|
||||
{
|
||||
// Due to issues with DLLs sometimes there can be different values of gEnv in different DLLs.
|
||||
// So we use this preferred method of getting the global environment
|
||||
SSystemGlobalEnvironment* GetGlobalEnv()
|
||||
{
|
||||
if (!GetISystem())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return GetISystem()->GetGlobalEnvironment();
|
||||
}
|
||||
|
||||
static const char* const s_gameFixedFpsCvarName = "game_load_screen_sequence_fixed_fps";
|
||||
static const char* const s_gameMaxFpsCvarName = "game_load_screen_max_fps";
|
||||
static const char* const s_gameMinimumLoadTimeCvarName = "game_load_screen_minimum_time";
|
||||
|
||||
static const char* const s_levelFixedFpsCvarName = "level_load_screen_sequence_fixed_fps";
|
||||
static const char* const s_levelMaxFpsCvarName = "level_load_screen_max_fps";
|
||||
static const char* const s_levelMinimumLoadTimeCvarName = "level_load_screen_minimum_time";
|
||||
}
|
||||
|
||||
void LoadScreenComponent::Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
|
||||
|
||||
if (serializeContext)
|
||||
{
|
||||
serializeContext->Class<LoadScreenComponent, AZ::Component>()
|
||||
->Version(1)
|
||||
;
|
||||
|
||||
AZ::EditContext* editContext = serializeContext->GetEditContext();
|
||||
if (editContext)
|
||||
{
|
||||
editContext->Class<LoadScreenComponent>(
|
||||
"Load screen manager", "Allows management of a load screen")
|
||||
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
|
||||
->Attribute(AZ::Edit::Attributes::Category, "Game")
|
||||
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b))
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LoadScreenComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
|
||||
{
|
||||
provided.push_back(AZ_CRC("LoadScreenService", 0x901b031c));
|
||||
}
|
||||
|
||||
void LoadScreenComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
|
||||
{
|
||||
incompatible.push_back(AZ_CRC("LoadScreenService", 0x901b031c));
|
||||
}
|
||||
|
||||
void LoadScreenComponent::Reset()
|
||||
{
|
||||
m_loadScreenState = LoadScreenState::None;
|
||||
|
||||
m_fixedDeltaTimeInSeconds = -1.0f;
|
||||
m_maxDeltaTimeInSeconds = -1.0f;
|
||||
m_previousCallTimeForUpdateAndRender = CTimeValue();
|
||||
m_processingLoadScreen.store(false);
|
||||
|
||||
// Reset CVars so they're not carried over to other levels
|
||||
SSystemGlobalEnvironment* pGEnv = GetGlobalEnv();
|
||||
if (pGEnv && pGEnv->pConsole)
|
||||
{
|
||||
if (ICVar* var = pGEnv->pConsole->GetCVar(s_levelFixedFpsCvarName))
|
||||
{
|
||||
var->Set("");
|
||||
}
|
||||
if (ICVar* var = pGEnv->pConsole->GetCVar(s_levelMaxFpsCvarName))
|
||||
{
|
||||
var->Set("");
|
||||
}
|
||||
if (ICVar* var = pGEnv->pConsole->GetCVar(s_levelMinimumLoadTimeCvarName))
|
||||
{
|
||||
var->Set("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LoadScreenComponent::LoadConfigSettings(const char* fixedFpsVarName, const char* maxFpsVarName, const char* minimumLoadTimeVarName)
|
||||
{
|
||||
m_fixedDeltaTimeInSeconds = -1.0f;
|
||||
m_maxDeltaTimeInSeconds = -1.0f;
|
||||
m_minimumLoadTimeInSeconds = 0.0f;
|
||||
|
||||
SSystemGlobalEnvironment* pGEnv = GetGlobalEnv();
|
||||
if (pGEnv && pGEnv->pConsole)
|
||||
{
|
||||
ICVar* fixedFpsVar = pGEnv->pConsole->GetCVar(fixedFpsVarName);
|
||||
if (fixedFpsVar && fixedFpsVar->GetFVal() > 0.0f)
|
||||
{
|
||||
m_fixedDeltaTimeInSeconds = (1.0f / fixedFpsVar->GetFVal());
|
||||
}
|
||||
|
||||
ICVar* maxFpsVar = pGEnv->pConsole->GetCVar(maxFpsVarName);
|
||||
if (maxFpsVar && maxFpsVar->GetFVal() > 0.0f)
|
||||
{
|
||||
m_maxDeltaTimeInSeconds = (1.0f / maxFpsVar->GetFVal());
|
||||
}
|
||||
|
||||
if (ICVar* minimumLoadTimeVar = pGEnv->pConsole->GetCVar(minimumLoadTimeVarName))
|
||||
{
|
||||
// Never allow values below 0 seconds
|
||||
m_minimumLoadTimeInSeconds = AZStd::max<float>(minimumLoadTimeVar->GetFVal(), 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LoadScreenComponent::Init()
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
void LoadScreenComponent::Activate()
|
||||
{
|
||||
CrySystemEventBus::Handler::BusConnect();
|
||||
LoadScreenBus::Handler::BusConnect(GetEntityId());
|
||||
}
|
||||
|
||||
void LoadScreenComponent::Deactivate()
|
||||
{
|
||||
CrySystemEventBus::Handler::BusDisconnect();
|
||||
LoadScreenBus::Handler::BusDisconnect(GetEntityId());
|
||||
}
|
||||
|
||||
void LoadScreenComponent::OnCrySystemInitialized(ISystem& system, const SSystemInitParams&)
|
||||
{
|
||||
SSystemGlobalEnvironment* pGEnv = system.GetGlobalEnvironment();
|
||||
|
||||
// Can't use macros here because we have to use our pointer.
|
||||
if (pGEnv && pGEnv->pConsole)
|
||||
{
|
||||
pGEnv->pConsole->Register("ly_EnableLoadingThread", &m_loadingThreadEnabled, 0, VF_NULL,
|
||||
"EXPERIMENTAL. Enable fully threaded loading where the LoadingScreen is drawn on a thread that isn't loading data.");
|
||||
}
|
||||
|
||||
if (pGEnv && !pGEnv->IsEditor())
|
||||
{
|
||||
// If not running from the editor, then run GameStart
|
||||
GameStart();
|
||||
}
|
||||
}
|
||||
|
||||
void LoadScreenComponent::OnCrySystemShutdown(ISystem&)
|
||||
{
|
||||
}
|
||||
|
||||
void LoadScreenComponent::UpdateAndRender()
|
||||
{
|
||||
SSystemGlobalEnvironment* pGEnv = GetGlobalEnv();
|
||||
|
||||
if (m_loadScreenState == LoadScreenState::Showing && pGEnv && pGEnv->pTimer)
|
||||
{
|
||||
AZ_Assert(GetCurrentThreadId() == pGEnv->mMainThreadId, "UpdateAndRender should only be called from the main thread");
|
||||
|
||||
// Throttling.
|
||||
if (!m_previousCallTimeForUpdateAndRender.GetValue())
|
||||
{
|
||||
// This is the first call to UpdateAndRender().
|
||||
m_previousCallTimeForUpdateAndRender = pGEnv->pTimer->GetAsyncTime();
|
||||
}
|
||||
|
||||
const CTimeValue callTimeForUpdateAndRender = pGEnv->pTimer->GetAsyncTime();
|
||||
const float deltaTimeInSeconds = fabs((callTimeForUpdateAndRender - m_previousCallTimeForUpdateAndRender).GetSeconds());
|
||||
|
||||
// Early-out: We DON'T need to execute UpdateAndRender() at a higher frequency than 30 FPS.
|
||||
const bool shouldThrottle = m_maxDeltaTimeInSeconds > 0.0f && deltaTimeInSeconds < m_maxDeltaTimeInSeconds;
|
||||
|
||||
if (!shouldThrottle)
|
||||
{
|
||||
bool expectedValue = false;
|
||||
if (m_processingLoadScreen.compare_exchange_strong(expectedValue, true))
|
||||
{
|
||||
m_previousCallTimeForUpdateAndRender = callTimeForUpdateAndRender;
|
||||
|
||||
const float updateDeltaTime = (m_fixedDeltaTimeInSeconds == -1.0f) ? deltaTimeInSeconds : m_fixedDeltaTimeInSeconds;
|
||||
|
||||
EBUS_EVENT(LoadScreenUpdateNotificationBus, UpdateAndRender, updateDeltaTime);
|
||||
|
||||
// Some platforms (iOS, OSX) require system events to be pumped in order to update the screen
|
||||
AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::PumpSystemEventLoopUntilEmpty);
|
||||
|
||||
m_processingLoadScreen.store(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LoadScreenComponent::GameStart()
|
||||
{
|
||||
if (m_loadScreenState == LoadScreenState::None)
|
||||
{
|
||||
LoadConfigSettings(s_gameFixedFpsCvarName, s_gameMaxFpsCvarName, s_gameMinimumLoadTimeCvarName);
|
||||
|
||||
const bool usingLoadingThread = IsLoadingThreadEnabled();
|
||||
|
||||
AZ::EBusLogicalResult<bool, AZStd::logical_or<bool>> anyHandled(false);
|
||||
EBUS_EVENT_RESULT(anyHandled, LoadScreenNotificationBus, NotifyGameLoadStart, usingLoadingThread);
|
||||
|
||||
if (anyHandled.value)
|
||||
{
|
||||
if (usingLoadingThread)
|
||||
{
|
||||
m_loadScreenState = LoadScreenState::ShowingMultiThreaded;
|
||||
|
||||
GetGlobalEnv()->pRenderer->StartLoadtimePlayback(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_loadScreenState = LoadScreenState::Showing;
|
||||
|
||||
// Kick-start the first frame.
|
||||
UpdateAndRender();
|
||||
}
|
||||
|
||||
if (ITimer* timer = GetGlobalEnv()->pTimer)
|
||||
{
|
||||
m_lastStartTime = timer->GetAsyncTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LoadScreenComponent::LevelStart()
|
||||
{
|
||||
if (m_loadScreenState == LoadScreenState::None)
|
||||
{
|
||||
LoadConfigSettings(s_levelFixedFpsCvarName, s_levelMaxFpsCvarName, s_levelMinimumLoadTimeCvarName);
|
||||
|
||||
const bool usingLoadingThread = IsLoadingThreadEnabled();
|
||||
|
||||
AZ::EBusLogicalResult<bool, AZStd::logical_or<bool>> anyHandled(false);
|
||||
EBUS_EVENT_RESULT(anyHandled, LoadScreenNotificationBus, NotifyLevelLoadStart, usingLoadingThread);
|
||||
|
||||
if (anyHandled.value)
|
||||
{
|
||||
if (usingLoadingThread)
|
||||
{
|
||||
m_loadScreenState = LoadScreenState::ShowingMultiThreaded;
|
||||
|
||||
GetGlobalEnv()->pRenderer->StartLoadtimePlayback(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_loadScreenState = LoadScreenState::Showing;
|
||||
|
||||
// Kick-start the first frame.
|
||||
UpdateAndRender();
|
||||
}
|
||||
|
||||
if (ITimer* timer = GetGlobalEnv()->pTimer)
|
||||
{
|
||||
m_lastStartTime = timer->GetAsyncTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LoadScreenComponent::Pause()
|
||||
{
|
||||
if (m_loadScreenState == LoadScreenState::Showing)
|
||||
{
|
||||
m_loadScreenState = LoadScreenState::Paused;
|
||||
}
|
||||
else if (m_loadScreenState == LoadScreenState::ShowingMultiThreaded)
|
||||
{
|
||||
m_loadScreenState = LoadScreenState::PausedMultithreaded;
|
||||
}
|
||||
}
|
||||
|
||||
void LoadScreenComponent::Resume()
|
||||
{
|
||||
if (m_loadScreenState == LoadScreenState::Paused)
|
||||
{
|
||||
m_loadScreenState = LoadScreenState::Showing;
|
||||
}
|
||||
else if (m_loadScreenState == LoadScreenState::PausedMultithreaded)
|
||||
{
|
||||
m_loadScreenState = LoadScreenState::ShowingMultiThreaded;
|
||||
}
|
||||
}
|
||||
|
||||
void LoadScreenComponent::Stop()
|
||||
{
|
||||
// If we were actually in a load screen, check if we need to wait longer.
|
||||
if (m_loadScreenState != LoadScreenState::None && m_minimumLoadTimeInSeconds > 0.0f)
|
||||
{
|
||||
if (ITimer* timer = GetGlobalEnv()->pTimer)
|
||||
{
|
||||
CTimeValue currentTime = timer->GetAsyncTime();
|
||||
float timeSinceStart = currentTime.GetDifferenceInSeconds(m_lastStartTime);
|
||||
|
||||
while (timeSinceStart < m_minimumLoadTimeInSeconds)
|
||||
{
|
||||
// Simple loop that makes sure the loading screens update but also doesn't consume the whole core.
|
||||
|
||||
if (m_loadScreenState == LoadScreenState::Showing)
|
||||
{
|
||||
EBUS_EVENT(LoadScreenBus, UpdateAndRender);
|
||||
}
|
||||
|
||||
CrySleep(0);
|
||||
|
||||
currentTime = timer->GetAsyncTime();
|
||||
timeSinceStart = currentTime.GetDifferenceInSeconds(m_lastStartTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_loadScreenState == LoadScreenState::ShowingMultiThreaded)
|
||||
{
|
||||
// This will block until the other thread completes.
|
||||
GetGlobalEnv()->pRenderer->StopLoadtimePlayback();
|
||||
}
|
||||
|
||||
if (m_loadScreenState != LoadScreenState::None)
|
||||
{
|
||||
EBUS_EVENT(LoadScreenNotificationBus, NotifyLoadEnd);
|
||||
}
|
||||
|
||||
Reset();
|
||||
|
||||
m_loadScreenState = LoadScreenState::None;
|
||||
}
|
||||
|
||||
bool LoadScreenComponent::IsPlaying()
|
||||
{
|
||||
return m_loadScreenState != LoadScreenState::None;
|
||||
}
|
||||
|
||||
void LoadScreenComponent::LoadtimeUpdate(float deltaTime)
|
||||
{
|
||||
if (m_loadScreenState == LoadScreenState::ShowingMultiThreaded)
|
||||
{
|
||||
EBUS_EVENT(LoadScreenUpdateNotificationBus, LoadThreadUpdate, deltaTime);
|
||||
}
|
||||
}
|
||||
|
||||
void LoadScreenComponent::LoadtimeRender()
|
||||
{
|
||||
if (m_loadScreenState == LoadScreenState::ShowingMultiThreaded)
|
||||
{
|
||||
EBUS_EVENT(LoadScreenUpdateNotificationBus, LoadThreadRender);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // if AZ_LOADSCREENCOMPONENT_ENABLED
|
||||
@@ -1,106 +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/Component/Component.h>
|
||||
#include <AzCore/Component/EntityId.h>
|
||||
#include <AzCore/std/parallel/atomic.h>
|
||||
|
||||
#include <CrySystemBus.h>
|
||||
#include <LoadScreenBus.h>
|
||||
#include <IRenderer.h>
|
||||
|
||||
#if AZ_LOADSCREENCOMPONENT_ENABLED
|
||||
|
||||
/*
|
||||
* This component is responsible for managing the load screen.
|
||||
*/
|
||||
class LoadScreenComponent
|
||||
: public AZ::Component
|
||||
, public CrySystemEventBus::Handler
|
||||
, public LoadScreenBus::Handler
|
||||
, public ILoadtimeCallback
|
||||
{
|
||||
public:
|
||||
AZ_COMPONENT(LoadScreenComponent, "{97CDBD6C-C621-4427-87C8-10E1B8F947FF}");
|
||||
|
||||
LoadScreenComponent() = default;
|
||||
~LoadScreenComponent() = default;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// AZ::Component interface implementation
|
||||
void Init() override;
|
||||
void Activate() override;
|
||||
void Deactivate() override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// CrySystemEvents
|
||||
void OnCrySystemInitialized(ISystem&, const SSystemInitParams& params) override;
|
||||
void OnCrySystemShutdown(ISystem&) override;
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// LoadScreenBus interface implementation
|
||||
void UpdateAndRender() override;
|
||||
void GameStart() override;
|
||||
void LevelStart() override;
|
||||
void Pause() override;
|
||||
void Resume() override;
|
||||
void Stop() override;
|
||||
bool IsPlaying() override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// ILoadtimeCallback interface implementation
|
||||
void LoadtimeUpdate(float deltaTime) override;
|
||||
void LoadtimeRender() override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline bool IsLoadingThreadEnabled() const
|
||||
{
|
||||
return m_loadingThreadEnabled != 0;
|
||||
}
|
||||
|
||||
protected:
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
|
||||
static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
|
||||
|
||||
private:
|
||||
void Reset();
|
||||
void LoadConfigSettings(const char* fixedFpsVarName, const char* maxFpsVarName, const char* minimumLoadTimeVarName);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
enum class LoadScreenState
|
||||
{
|
||||
None,
|
||||
Showing,
|
||||
ShowingMultiThreaded,
|
||||
Paused,
|
||||
PausedMultithreaded,
|
||||
};
|
||||
LoadScreenState m_loadScreenState{ LoadScreenState::None };
|
||||
|
||||
float m_fixedDeltaTimeInSeconds{ -1.0f };
|
||||
float m_maxDeltaTimeInSeconds{ -1.0f };
|
||||
float m_minimumLoadTimeInSeconds{ 0.0f };
|
||||
|
||||
CTimeValue m_lastStartTime;
|
||||
CTimeValue m_previousCallTimeForUpdateAndRender;
|
||||
AZStd::atomic_bool m_processingLoadScreen{ false };
|
||||
|
||||
int32_t m_loadingThreadEnabled{ 0 };
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
};
|
||||
|
||||
#endif // if AZ_LOADSCREENCOMPONENT_ENABLED
|
||||
@@ -40,6 +40,4 @@ public:
|
||||
IMemoryAddressRange* (size_t capacity, const char* sName));
|
||||
MOCK_METHOD2(CreatePageMappingHeap,
|
||||
IPageMappingHeap* (size_t addressSpace, const char* sName));
|
||||
MOCK_METHOD0(CreateDefragAllocator,
|
||||
IDefragAllocator*());
|
||||
};
|
||||
|
||||
@@ -286,8 +286,6 @@ public:
|
||||
CRenderObject * (SShaderItem & si, CRenderObject * obj, const SRenderingPassInfo& passInfo, int numPts, int ninds, SVF_P3F_C4B_T2F * &verts, SPipTangents * &tangs, uint16 * &inds, int nAW, const SRendItemSorter& rendItemSorter));
|
||||
MOCK_METHOD0(ForceUpdateGlobalShaderParameters,
|
||||
void());
|
||||
MOCK_METHOD1(EF_SetShaderMissCallback,
|
||||
void(ShaderCacheMissCallback callback));
|
||||
MOCK_METHOD0(EF_GetShaderMissLogPath,
|
||||
const char*());
|
||||
MOCK_METHOD1(EF_GetShaderNames,
|
||||
@@ -334,8 +332,6 @@ public:
|
||||
int(const char* name));
|
||||
MOCK_METHOD3(EF_RenderEnvironmentCubeHDR,
|
||||
bool(int size, Vec3 & Pos, TArray<unsigned short>&vecData));
|
||||
MOCK_METHOD1(EF_CreateRE,
|
||||
IRenderElement * (EDataType edt));
|
||||
MOCK_METHOD1(EF_StartEf,
|
||||
void(const SRenderingPassInfo& passInfo));
|
||||
MOCK_METHOD3(EF_GetObjData,
|
||||
|
||||
@@ -49,18 +49,12 @@ public:
|
||||
int());
|
||||
MOCK_METHOD0(GetLogicalCPUCount,
|
||||
int());
|
||||
MOCK_CONST_METHOD0(GetRenderingDriverName,
|
||||
const char*());
|
||||
MOCK_METHOD1(DumpMemoryUsageStatistics,
|
||||
void(bool));
|
||||
MOCK_METHOD0(Quit,
|
||||
void());
|
||||
MOCK_METHOD1(Relaunch,
|
||||
void(bool bRelaunch));
|
||||
MOCK_CONST_METHOD0(IsQuitting,
|
||||
bool());
|
||||
MOCK_CONST_METHOD0(IsShaderCacheGenMode,
|
||||
bool());
|
||||
MOCK_METHOD1(SerializingFile,
|
||||
void(int mode));
|
||||
MOCK_CONST_METHOD0(IsSerializingFile,
|
||||
@@ -90,8 +84,6 @@ public:
|
||||
ILZ4Decompressor * ());
|
||||
MOCK_METHOD0(GetZStdDecompressor,
|
||||
IZStdDecompressor * ());
|
||||
MOCK_METHOD0(GetPerfHUD,
|
||||
ICryPerfHUD * ());
|
||||
MOCK_METHOD0(GetINotificationNetwork,
|
||||
INotificationNetwork * ());
|
||||
MOCK_METHOD0(GetIViewSystem,
|
||||
@@ -132,12 +124,6 @@ public:
|
||||
ISystemEventDispatcher * ());
|
||||
MOCK_METHOD0(GetIVisualLog,
|
||||
IVisualLog * ());
|
||||
MOCK_METHOD0(GetIFileChangeMonitor,
|
||||
IFileChangeMonitor * ());
|
||||
MOCK_METHOD0(GetHWND,
|
||||
WIN_HWND());
|
||||
MOCK_METHOD0(GetIRenderer,
|
||||
IRenderer * ());
|
||||
MOCK_METHOD0(GetITimer,
|
||||
ITimer * ());
|
||||
MOCK_METHOD0(GetIThreadManager,
|
||||
@@ -150,8 +136,6 @@ public:
|
||||
void(IMaterialEffects * pMaterialEffects));
|
||||
MOCK_METHOD1(SetIOpticsManager,
|
||||
void(IOpticsManager * pOpticsManager));
|
||||
MOCK_METHOD1(SetIFileChangeMonitor,
|
||||
void(IFileChangeMonitor * pFileChangeMonitor));
|
||||
MOCK_METHOD1(SetIVisualLog,
|
||||
void(IVisualLog * pVisualLog));
|
||||
MOCK_METHOD2(DebugStats,
|
||||
@@ -229,8 +213,6 @@ public:
|
||||
void(bool detectResolution));
|
||||
MOCK_METHOD2(SetThreadState,
|
||||
int(ESubsystem subsys, bool bActive));
|
||||
MOCK_METHOD0(CreateSizer,
|
||||
ICrySizer * ());
|
||||
MOCK_CONST_METHOD0(IsPaused,
|
||||
bool());
|
||||
MOCK_METHOD0(GetLocalizationManager,
|
||||
@@ -275,8 +257,6 @@ public:
|
||||
void(bool));
|
||||
MOCK_METHOD1(GetUpdateStats,
|
||||
void(SSystemUpdateStats & stats));
|
||||
MOCK_METHOD0(DumpMemoryCoverage,
|
||||
void());
|
||||
MOCK_METHOD0(GetSystemGlobalState,
|
||||
ESystemGlobalState(void));
|
||||
MOCK_METHOD1(SetSystemGlobalState,
|
||||
|
||||
@@ -162,10 +162,6 @@ typedef uint32 vtx_idx;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_PROFILING_CODE)
|
||||
#define USE_PERFHUD
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_PROFILING_CODE)
|
||||
#define ENABLE_ART_RT_TIME_ESTIMATE
|
||||
#endif
|
||||
|
||||
@@ -1,321 +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_RENDELEMENT_H
|
||||
#define CRYINCLUDE_CRYCOMMON_RENDELEMENT_H
|
||||
#pragma once
|
||||
|
||||
|
||||
//=============================================================
|
||||
|
||||
#include "VertexFormats.h"
|
||||
|
||||
class CRendElementBase;
|
||||
struct CRenderChunk;
|
||||
struct PrimitiveGroup;
|
||||
class CShader;
|
||||
struct SShaderTechnique;
|
||||
class CParserBin;
|
||||
struct SParserFrame;
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace Vertex
|
||||
{
|
||||
class Format;
|
||||
}
|
||||
}
|
||||
|
||||
enum EDataType
|
||||
{
|
||||
eDATA_Unknown = 0,
|
||||
eDATA_Sky,
|
||||
eDATA_Beam,
|
||||
eDATA_ClientPoly,
|
||||
eDATA_Flare,
|
||||
eDATA_Terrain,
|
||||
eDATA_SkyZone,
|
||||
eDATA_Mesh,
|
||||
eDATA_Imposter,
|
||||
eDATA_LensOptics,
|
||||
eDATA_FarTreeSprites_Deprecated,
|
||||
eDATA_OcclusionQuery,
|
||||
eDATA_Particle,
|
||||
eDATA_GPUParticle,
|
||||
eDATA_PostProcess,
|
||||
eDATA_HDRProcess,
|
||||
eDATA_Cloud,
|
||||
eDATA_HDRSky,
|
||||
eDATA_FogVolume,
|
||||
eDATA_WaterVolume,
|
||||
eDATA_WaterOcean,
|
||||
eDATA_VolumeObject,
|
||||
eDATA_PrismObject, // normally this would be #if !defined(EXCLUDE_DOCUMENTATION_PURPOSE) but we keep it to get consistent numbers for serialization
|
||||
eDATA_DeferredShading,
|
||||
eDATA_GameEffect,
|
||||
eDATA_BreakableGlass,
|
||||
eDATA_GeomCache,
|
||||
eDATA_Gem,
|
||||
};
|
||||
|
||||
#include <Cry_Color.h>
|
||||
|
||||
//=======================================================
|
||||
|
||||
#define FCEF_TRANSFORM 1
|
||||
#define FCEF_DIRTY 2
|
||||
#define FCEF_NODEL 4
|
||||
#define FCEF_DELETED 8
|
||||
|
||||
#define FCEF_MODIF_TC 0x10
|
||||
#define FCEF_MODIF_VERT 0x20
|
||||
#define FCEF_MODIF_COL 0x40
|
||||
#define FCEF_MODIF_MASK 0xf0
|
||||
|
||||
#define FCEF_UPDATEALWAYS 0x100
|
||||
#define FCEF_ALLOC_CUST_FLOAT_DATA 0x200
|
||||
#define FCEF_MERGABLE 0x400
|
||||
|
||||
#define FCEF_SKINNED 0x800
|
||||
#define FCEF_PRE_DRAW_DONE 0x1000
|
||||
|
||||
#define FGP_NOCALC 1
|
||||
#define FGP_SRC 2
|
||||
#define FGP_REAL 4
|
||||
#define FGP_WAIT 8
|
||||
|
||||
#define FGP_STAGE_SHIFT 0x10
|
||||
|
||||
#define MAX_CUSTOM_TEX_BINDS_NUM 2
|
||||
|
||||
struct SGeometryInfo;
|
||||
class CRendElement;
|
||||
|
||||
struct IRenderElementDelegate
|
||||
{
|
||||
virtual void mfPrepare(bool bCheckOverflow) = 0;
|
||||
virtual bool mfDraw(CShader* shader, SShaderPass* pass) = 0;
|
||||
virtual bool mfSetSampler([[maybe_unused]] int customId, [[maybe_unused]] int nTUnit, [[maybe_unused]] int nTState, [[maybe_unused]] int nTexMaterialSlot, [[maybe_unused]] int nSUnit) { return true; };
|
||||
};
|
||||
|
||||
struct IRenderElement
|
||||
{
|
||||
virtual int mfGetMatId() = 0;
|
||||
virtual uint16 mfGetFlags() = 0;
|
||||
virtual void mfSetFlags(uint16 fl) = 0;
|
||||
virtual void mfUpdateFlags(uint16 fl) = 0;
|
||||
virtual void mfClearFlags(uint16 fl) = 0;
|
||||
virtual void mfPrepare(bool bCheckOverflow) = 0;
|
||||
virtual void mfCenter(Vec3& centr, CRenderObject* pObj) = 0;
|
||||
virtual void mfGetBBox(Vec3& vMins, Vec3& vMaxs) = 0;
|
||||
virtual void mfReset() = 0;
|
||||
virtual void mfGetPlane(Plane_tpl<f32>& pl) = 0;
|
||||
virtual void mfExport(struct SShaderSerializeContext& SC) = 0;
|
||||
virtual void mfImport(struct SShaderSerializeContext& SC, uint32& offset) = 0;
|
||||
virtual void mfPrecache(const SShaderItem& SH) = 0;
|
||||
virtual bool mfIsHWSkinned() = 0;
|
||||
virtual bool mfCheckUpdate(int Flags, uint16 nFrame, bool bTessellation = false) = 0;
|
||||
virtual bool mfUpdate(int Flags, bool bTessellation = false) = 0;
|
||||
virtual bool mfCompile(CParserBin& Parser, SParserFrame& Frame) = 0;
|
||||
virtual bool mfDraw(CShader* ef, SShaderPass* sfm) = 0;
|
||||
virtual bool mfPreDraw(SShaderPass* sl) = 0;
|
||||
virtual bool mfSetSampler(int customId, int nTUnit, int nTState, int nTexMaterialSlot, int nSUnit) = 0;
|
||||
virtual void mfSetDelegate(IRenderElementDelegate* pDelegate) = 0;
|
||||
virtual IRenderElementDelegate* mfGetDelegate() = 0;
|
||||
virtual CRenderChunk* mfGetMatInfo() = 0;
|
||||
virtual TRenderChunkArray* mfGetMatInfoList() = 0;
|
||||
virtual void* mfGetPointer(ESrcPointer ePT, int* Stride, EParamType Type, ESrcPointer Dst, int Flags) = 0;
|
||||
virtual AZ::Vertex::Format GetVertexFormat() const = 0;
|
||||
virtual void* GetCustomData() const = 0;
|
||||
virtual int GetCustomTexBind(int i) const = 0;
|
||||
virtual CRendElementBase* mfCopyConstruct() = 0;
|
||||
virtual EDataType mfGetType() = 0;
|
||||
virtual int Size() = 0;
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const = 0;
|
||||
|
||||
};
|
||||
|
||||
class CRendElement
|
||||
{
|
||||
public:
|
||||
static CRendElement m_RootGlobal;
|
||||
static CRendElement m_RootRelease[];
|
||||
CRendElement* m_NextGlobal;
|
||||
CRendElement* m_PrevGlobal;
|
||||
|
||||
EDataType m_Type;
|
||||
|
||||
protected:
|
||||
virtual void UnlinkGlobal()
|
||||
{
|
||||
if (!m_NextGlobal || !m_PrevGlobal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_NextGlobal->m_PrevGlobal = m_PrevGlobal;
|
||||
m_PrevGlobal->m_NextGlobal = m_NextGlobal;
|
||||
m_NextGlobal = m_PrevGlobal = NULL;
|
||||
}
|
||||
|
||||
virtual void LinkGlobal(CRendElement* Before)
|
||||
{
|
||||
if (m_NextGlobal || m_PrevGlobal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_NextGlobal = Before->m_NextGlobal;
|
||||
Before->m_NextGlobal->m_PrevGlobal = this;
|
||||
Before->m_NextGlobal = this;
|
||||
m_PrevGlobal = Before;
|
||||
}
|
||||
|
||||
public:
|
||||
CRendElement();
|
||||
virtual ~CRendElement();
|
||||
virtual void Release(bool bForce = false);
|
||||
virtual const char* mfTypeString();
|
||||
virtual void mfSetType(EDataType t) { m_Type = t; }
|
||||
virtual void GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer) const {}
|
||||
virtual int Size() { return 0; }
|
||||
|
||||
static void ShutDown();
|
||||
static void Tick();
|
||||
static void Cleanup();
|
||||
};
|
||||
|
||||
class CRendElementBase
|
||||
: public CRendElement
|
||||
, public IRenderElement
|
||||
{
|
||||
public:
|
||||
uint16 m_Flags;
|
||||
uint16 m_nFrameUpdated;
|
||||
|
||||
public:
|
||||
void* m_CustomData;
|
||||
int m_CustomTexBind[MAX_CUSTOM_TEX_BINDS_NUM];
|
||||
|
||||
struct SGeometryStreamInfo
|
||||
{
|
||||
const void* pStream;
|
||||
int nOffset;
|
||||
int nStride;
|
||||
};
|
||||
struct SGeometryInfo
|
||||
{
|
||||
uint32 bonesRemapGUID; // Input paremeter to fetch correct skinning stream.
|
||||
|
||||
int primitiveType; //!< \see eRenderPrimitiveType
|
||||
AZ::Vertex::Format vertexFormat;
|
||||
uint32 streamMask;
|
||||
|
||||
int32 nFirstIndex;
|
||||
int32 nNumIndices;
|
||||
uint32 nFirstVertex;
|
||||
uint32 nNumVertices;
|
||||
|
||||
uint32 nMaxVertexStreams;
|
||||
|
||||
SGeometryStreamInfo indexStream;
|
||||
SGeometryStreamInfo vertexStream[VSF_NUM];
|
||||
|
||||
void* pTessellationAdjacencyBuffer;
|
||||
void* pSkinningExtraBonesBuffer;
|
||||
};
|
||||
|
||||
public:
|
||||
CRendElementBase();
|
||||
virtual ~CRendElementBase();
|
||||
|
||||
|
||||
virtual void mfPrepare(bool bCheckOverflow) override
|
||||
{
|
||||
if (m_delegate)
|
||||
{
|
||||
m_delegate->mfPrepare(bCheckOverflow);
|
||||
}
|
||||
}
|
||||
bool mfDraw(CShader* ef, SShaderPass* sfm) override { return m_delegate ? m_delegate->mfDraw(ef, sfm) : true; }
|
||||
bool mfSetSampler(int customId, int nTUnit, int nTState, int nTexMaterialSlot, int nSUnit) override { return m_delegate ? m_delegate->mfSetSampler(customId, nTUnit, nTState, nTexMaterialSlot, nSUnit) : false; }
|
||||
void mfSetDelegate(IRenderElementDelegate* pDelegate) override { m_delegate = pDelegate; }
|
||||
IRenderElementDelegate* mfGetDelegate() { return m_delegate; }
|
||||
|
||||
EDataType mfGetType() override { return m_Type; };
|
||||
|
||||
CRenderChunk* mfGetMatInfo() override { return nullptr; }
|
||||
TRenderChunkArray* mfGetMatInfoList() override { return nullptr; }
|
||||
int mfGetMatId() override { return -1; }
|
||||
void mfReset() override {};
|
||||
CRendElementBase* mfCopyConstruct() override;
|
||||
void mfCenter(Vec3& centr, CRenderObject* pObj) override;
|
||||
|
||||
bool mfCompile([[maybe_unused]] CParserBin& Parser, [[maybe_unused]] SParserFrame& Frame) override { return false; }
|
||||
bool mfPreDraw([[maybe_unused]] SShaderPass* sl) override { return true; }
|
||||
bool mfUpdate([[maybe_unused]] int Flags, [[maybe_unused]] bool bTessellation = false) override { return true; }
|
||||
void mfPrecache([[maybe_unused]] const SShaderItem& SH) override {}
|
||||
void mfExport([[maybe_unused]] struct SShaderSerializeContext& SC) override { CryFatalError("mfExport has not been implemented for this render element type"); }
|
||||
void mfImport([[maybe_unused]] struct SShaderSerializeContext& SC, [[maybe_unused]] uint32& offset) override { CryFatalError("mfImport has not been implemented for this render element type"); }
|
||||
void mfGetPlane(Plane_tpl<f32>& pl) override;
|
||||
void* mfGetPointer([[maybe_unused]] ESrcPointer ePT, [[maybe_unused]] int* Stride, [[maybe_unused]] EParamType Type, [[maybe_unused]] ESrcPointer Dst, [[maybe_unused]] int Flags) override { return nullptr; }
|
||||
|
||||
uint16 mfGetFlags() override { return m_Flags; }
|
||||
void mfSetFlags(uint16 fl) override { m_Flags = fl; }
|
||||
void mfUpdateFlags(uint16 fl) override { m_Flags |= fl; }
|
||||
void mfClearFlags(uint16 fl) override { m_Flags &= ~fl; }
|
||||
bool mfCheckUpdate(int Flags, uint16 nFrame, bool bTessellation = false) override
|
||||
{
|
||||
if (nFrame != m_nFrameUpdated || (m_Flags & (FCEF_DIRTY | FCEF_SKINNED | FCEF_UPDATEALWAYS)))
|
||||
{
|
||||
m_nFrameUpdated = nFrame;
|
||||
return mfUpdate(Flags, bTessellation);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
void mfGetBBox(Vec3& vMins, Vec3& vMaxs) override
|
||||
{
|
||||
vMins.Set(0, 0, 0);
|
||||
vMaxs.Set(0, 0, 0);
|
||||
}
|
||||
bool mfIsHWSkinned() override { return false; }
|
||||
int Size() override { return 0; }
|
||||
void GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer) const override {}
|
||||
AZ::Vertex::Format GetVertexFormat() const override { return AZ::Vertex::Format(eVF_Unknown); };
|
||||
virtual bool GetGeometryInfo([[maybe_unused]] SGeometryInfo& streams) { return false; }
|
||||
void Draw([[maybe_unused]] CRenderObject* pObj, [[maybe_unused]] const struct SGraphicsPiplinePassContext& ctx) {};
|
||||
void* GetCustomData() const { return m_CustomData; }
|
||||
int GetCustomTexBind(int index) const { return m_CustomTexBind[index]; }
|
||||
|
||||
protected:
|
||||
IRenderElementDelegate * m_delegate = nullptr;
|
||||
};
|
||||
|
||||
#include "CREMesh.h"
|
||||
#include "CRESky.h"
|
||||
#include "CREOcclusionQuery.h"
|
||||
#include "CREImposter.h"
|
||||
#include "CREBaseCloud.h"
|
||||
#include "CREPostProcess.h"
|
||||
#include "CREFogVolume.h"
|
||||
#include "CREWaterVolume.h"
|
||||
#include "CREWaterOcean.h"
|
||||
#include "CREVolumeObject.h"
|
||||
#include "CREGameEffect.h"
|
||||
#include "CREGeomCache.h"
|
||||
|
||||
#if !defined(EXCLUDE_DOCUMENTATION_PURPOSE)
|
||||
#include "CREPrismObject.h"
|
||||
#endif // EXCLUDE_DOCUMENTATION_PURPOSE
|
||||
|
||||
//==========================================================
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_RENDELEMENT_H
|
||||
@@ -1,512 +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_TYPELIBRARY_H
|
||||
#define CRYINCLUDE_CRYCOMMON_TYPELIBRARY_H
|
||||
#pragma once
|
||||
|
||||
#include <ISoftCodeMgr.h> // <> required for Interfuscator
|
||||
|
||||
#include <AzCore/std/containers/map.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
|
||||
#ifdef SOFTCODE_ENABLED
|
||||
|
||||
// Internal: Used by SC types to auto-remove themselves from their TypeRegistrar on destruction.
|
||||
struct InstanceTracker
|
||||
{
|
||||
InstanceTracker()
|
||||
: m_pRegistrar()
|
||||
{}
|
||||
|
||||
~InstanceTracker()
|
||||
{
|
||||
if (m_pRegistrar)
|
||||
{
|
||||
m_pRegistrar->RemoveInstance(this);
|
||||
}
|
||||
}
|
||||
|
||||
void SetRegistrar(ITypeRegistrar* pRegistrar)
|
||||
{
|
||||
m_pRegistrar = pRegistrar;
|
||||
}
|
||||
|
||||
ITypeRegistrar* m_pRegistrar; // Valid if created by a registrar, otherwise NULL
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SOFTCODE_ENABLED
|
||||
|
||||
// Include this for SEH support
|
||||
#include <excpt.h>
|
||||
|
||||
/*
|
||||
Used to declare the interface as having an associated TypeLibrary.
|
||||
Usage:
|
||||
struct IMyInterface
|
||||
{
|
||||
DECLARE_TYPELIB(IMyInterface);
|
||||
*/
|
||||
#define DECLARE_TYPELIB(IName) \
|
||||
static void VisitMembers(IExchanger & ex) {} \
|
||||
typedef CTypeLibrary<IName> TLibrary
|
||||
|
||||
/*
|
||||
Exposes a class to a TypeLibrary for registration.
|
||||
Usage:
|
||||
class MyThing : public IThing
|
||||
{
|
||||
DECLARE_TYPE(MyThing, IThing);
|
||||
...
|
||||
*/
|
||||
#define DECLARE_TYPE(TName, TSuperType) \
|
||||
public: \
|
||||
void VisitMembers(IExchanger & ex) { TSuperType::VisitMembers(ex); VisitMember<__START_MEMBERS>(ex); } \
|
||||
private: \
|
||||
friend class TypeRegistrar<TName>; \
|
||||
static const size_t __START_MEMBERS = __COUNTER__ + 1; \
|
||||
template <size_t IDX> \
|
||||
void VisitMember(IExchanger & exchanger) {} \
|
||||
InstanceTracker __instanceTracker
|
||||
|
||||
#ifdef SOFTCODE
|
||||
#define _EXPORT_TYPE_LIB(Interface) \
|
||||
extern "C" ITypeLibrary * GetTypeLibrary() { return CTypeLibrary<Interface>::Instance(); }
|
||||
#else
|
||||
#define _EXPORT_TYPE_LIB(Interface)
|
||||
#endif
|
||||
|
||||
// Internal: Outputs the specialized method template for the member at index
|
||||
#define _SOFT_MEMBER_VISITOR(member, index) \
|
||||
template <> \
|
||||
void VisitMember<index>(IExchanger & ex) { ex.Visit(#member, member); VisitMember<index + 1>(ex); }
|
||||
|
||||
/*
|
||||
Used to expose a class member to SoftCoding (to allow run-time member exchange)
|
||||
If SoftCode is disabled this does nothing and simple emits the member.
|
||||
For array types, use SOFT_ARRAY() instead or use AZStd::array which allows assignment.
|
||||
Usage: std::vector<string> SOFT(m_myStrings);
|
||||
*/
|
||||
#define SOFT(member) \
|
||||
member; \
|
||||
_SOFT_MEMBER_VISITOR(member, __COUNTER__)
|
||||
|
||||
/*
|
||||
Used to expose a primitive array type to SoftCoding.
|
||||
Declare it directly after the member.
|
||||
NOTE: It's cleaner to convert the member to AZStd::array as
|
||||
this avoid having to use this special case while preserving semantics.
|
||||
Usage:
|
||||
ColorB m_colors[20];
|
||||
SOFT_ARRAY(m_colors);
|
||||
*/
|
||||
#define SOFT_ARRAY(arrayMember) _SOFT_MEMBER_VISITOR(arrayMember, __COUNTER__)
|
||||
|
||||
// Internal: Executes given lambda in an SEH try block.
|
||||
template <typename TLambda>
|
||||
void SoftCodeTry(TLambda& lambda)
|
||||
{
|
||||
__try
|
||||
{
|
||||
lambda();
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// Internal: Used by TypeRegistry. Use SOFTCODE_RETRY() for user code.
|
||||
#define SOFTCODE_TRY(exp) SoftCodeTry([&](){ exp; })
|
||||
#define SOFTCODE_TRY_BLOCK SoftCodeTry([&]() {
|
||||
#define SOFTCODE_TRY_END });
|
||||
|
||||
/*
|
||||
Internal: Attempt a given lambda functor. In the even on an exception execution will pause
|
||||
to allow the user to provide a replacement implementation for the failing instance.
|
||||
Usage: See SOFTCODE_RETRY & SOFTCODE_RETRY_BLOCK below.
|
||||
*/
|
||||
template <typename TPtr, typename TLambda>
|
||||
void SoftCodeRetry(TPtr& pointer, TLambda& lambda)
|
||||
{
|
||||
bool complete = false;
|
||||
while (pointer && !complete)
|
||||
{
|
||||
__try
|
||||
{
|
||||
lambda();
|
||||
complete = true;
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
if (gEnv->pSoftCodeMgr)
|
||||
{
|
||||
pointer = reinterpret_cast<TPtr>(gEnv->pSoftCodeMgr->WaitForUpdate(pointer));
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
}
|
||||
|
||||
/*
|
||||
Attempts to call an expression based the given pointer.
|
||||
If a Structured Exception is raised the thread will wait for a replacement of
|
||||
the pointer to be provided via the SoftCodeMgr. This will repeat until no exception is raised.
|
||||
|
||||
Usage: SOFTCODE_RETRY(pThing, (pThing->Update(frameTime))); // Same as pThing->Update(frameTime);
|
||||
*/
|
||||
#define SOFTCODE_RETRY(pointer, exp) SoftCodeRetry(pointer, [&](){ exp; })
|
||||
|
||||
/*
|
||||
Attempts to call an expression based the given pointer.
|
||||
If a Structured Exception is raised the thread will wait for a replacement of
|
||||
the pointer to be provided via the SoftCodeMgr. This will repeat until no exception is raised.
|
||||
|
||||
Usage:
|
||||
SOFTCODE_RETRY_BLOCK(pThing)
|
||||
{
|
||||
pSomething = pThing->GetSomething();
|
||||
}
|
||||
SOFTCODE_RETRY_END
|
||||
*/
|
||||
#define SOFTCODE_RETRY_BLOCK(pointer) SoftCodeRetry(pointer, [&]() {
|
||||
#define SOFTCODE_RETRY_END });
|
||||
|
||||
#else // !SOFTCODE_ENABLED ...
|
||||
|
||||
// IMPORTANT: Docs for these macros are found above.
|
||||
|
||||
#define DECLARE_TYPELIB(IName) \
|
||||
typedef CTypeLibrary<IName> TLibrary
|
||||
|
||||
#define DECLARE_TYPE(TName, TSuperType) \
|
||||
private: \
|
||||
friend class TypeRegistrar<TName>;
|
||||
|
||||
#define _EXPORT_TYPE_LIB(Interface)
|
||||
|
||||
#define SOFT(member) member
|
||||
#define SOFT_ARRAY(arrayMember)
|
||||
|
||||
#define SOFTCODE_TRY(exp) (exp)
|
||||
#define SOFTCODE_TRY_BLOCK {
|
||||
#define SOFTCODE_TRY_END };
|
||||
|
||||
#define SOFTCODE_RETRY(pointer, exp) (exp)
|
||||
#define SOFTCODE_RETRY_BLOCK(pointer) {
|
||||
#define SOFTCODE_RETRY_END };
|
||||
|
||||
#endif // !SOFTCODE_ENABLED
|
||||
|
||||
/*
|
||||
Implements registration for a type to a TypeLibrary.
|
||||
Usage:
|
||||
// MyThing.cpp
|
||||
DECLARE_TYPE(MyThing);
|
||||
*/
|
||||
#define IMPLEMENT_TYPE(TName) \
|
||||
static TypeRegistrar<TName> s_register##TName(#TName)
|
||||
|
||||
/*
|
||||
Provides the singleton for the TypeLibrary implementation.
|
||||
Also exports the accessors function for SoftCode builds.
|
||||
Usage:
|
||||
// ThingLibrary.cpp
|
||||
IMPLEMENT_TYPELIB(IThing, "Things")
|
||||
*/
|
||||
#define IMPLEMENT_TYPELIB(Interface, Name) \
|
||||
_EXPORT_TYPE_LIB(Interface) \
|
||||
template <> \
|
||||
CTypeLibrary<Interface>* CTypeLibrary<Interface>::Instance() \
|
||||
{ \
|
||||
static CTypeLibrary<Interface> s_instance(Name); \
|
||||
return &s_instance; \
|
||||
}
|
||||
|
||||
/*
|
||||
Internal: Used to register a type with a TypeLibrary.
|
||||
Also provides instance construction (factory) access.
|
||||
For SC builds it also provides copying and instance tracking.
|
||||
*/
|
||||
template <typename T>
|
||||
class TypeRegistrar
|
||||
: public ITypeRegistrar
|
||||
{
|
||||
public:
|
||||
TypeRegistrar(const char* name)
|
||||
: m_name(name)
|
||||
{
|
||||
typedef typename T::TLibrary TLib;
|
||||
TLib::Instance()->RegisterType(this);
|
||||
}
|
||||
|
||||
virtual const char* GetName() const { return m_name; }
|
||||
|
||||
virtual void* CreateInstance()
|
||||
{
|
||||
T* pInstance = NULL;
|
||||
|
||||
SOFTCODE_TRY_BLOCK
|
||||
{
|
||||
pInstance = ConstructInstance();
|
||||
}
|
||||
SOFTCODE_TRY_END
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
RegisterInstance(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
#ifdef SOFTCODE_ENABLED
|
||||
virtual size_t InstanceCount() const
|
||||
{
|
||||
return m_instances.size();
|
||||
}
|
||||
|
||||
virtual void RemoveInstance(InstanceTracker* pTracker)
|
||||
{
|
||||
T* pInstance = GetInstanceFromTracker(pTracker);
|
||||
TInstanceVec::iterator iter(std::find(m_instances.begin(), m_instances.end(), pInstance));
|
||||
std::swap(*iter, m_instances.back());
|
||||
m_instances.pop_back();
|
||||
}
|
||||
|
||||
virtual bool ExchangeInstances(IExchanger& exchanger)
|
||||
{
|
||||
if (exchanger.IsLoading())
|
||||
{
|
||||
const size_t instanceCount = exchanger.InstanceCount();
|
||||
|
||||
// Ensure we have the correct number of instances
|
||||
if (m_instances.size() != instanceCount)
|
||||
{
|
||||
// TODO: Destroy any existing instances
|
||||
for (size_t i = 0; i < instanceCount; ++i)
|
||||
{
|
||||
if (!CreateInstance())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool complete = false;
|
||||
SOFTCODE_TRY_BLOCK
|
||||
{
|
||||
for (std::vector<T*>::iterator iter(m_instances.begin()); iter != m_instances.end(); ++iter)
|
||||
{
|
||||
T* pInstance = *iter;
|
||||
if (exchanger.BeginInstance(pInstance))
|
||||
{
|
||||
// Exchanges the members of pInstance as defined in T
|
||||
// Should also exchange members of parent types
|
||||
pInstance->VisitMembers(exchanger);
|
||||
}
|
||||
}
|
||||
complete = true;
|
||||
}
|
||||
SOFTCODE_TRY_END
|
||||
|
||||
return complete;
|
||||
}
|
||||
|
||||
virtual bool DestroyInstances()
|
||||
{
|
||||
bool complete = false;
|
||||
SOFTCODE_TRY_BLOCK
|
||||
{
|
||||
while (!m_instances.empty())
|
||||
{
|
||||
delete m_instances.back();
|
||||
// NOTE: No need to pop_back() as already done by the InstanceTracker via RemoveInstance()
|
||||
}
|
||||
complete = true;
|
||||
}
|
||||
SOFTCODE_TRY_END
|
||||
|
||||
return complete;
|
||||
}
|
||||
|
||||
|
||||
virtual bool HasInstance(void* pInstance) const
|
||||
{
|
||||
return std::find(m_instances.begin(), m_instances.end(), pInstance) != m_instances.end();
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
void RegisterInstance(T* pInstance)
|
||||
{
|
||||
#ifdef SOFTCODE_ENABLED
|
||||
pInstance->__instanceTracker.SetRegistrar(this);
|
||||
m_instances.push_back(pInstance);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef SOFTCODE_ENABLED
|
||||
// Util: Avoids having to redundantly store the instance address in the tracker
|
||||
T* GetInstanceFromTracker(InstanceTracker* pTracker)
|
||||
{
|
||||
ptrdiff_t trackerOffset = reinterpret_cast<ptrdiff_t>(&((static_cast<T*>(0))->__instanceTracker));
|
||||
return reinterpret_cast<T*>(reinterpret_cast<char*>(pTracker) - trackerOffset);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Needed to avoid C2712 due to lack of stack unwind within SEH try blocks
|
||||
T* ConstructInstance()
|
||||
{
|
||||
return new T();
|
||||
}
|
||||
|
||||
private:
|
||||
const char* m_name; // Name of the type
|
||||
|
||||
#ifdef SOFTCODE_ENABLED
|
||||
typedef std::vector<T*> TInstanceVec;
|
||||
TInstanceVec m_instances; // Tracks the active instances (SC only)
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
Provides factory creation support for a set of types that
|
||||
derive from a single interface T. Users need to provide a
|
||||
specialization of the static CTypeLibrary<T>* Instance() member
|
||||
in a cpp file to provide the singleton instance.
|
||||
*/
|
||||
template <typename T>
|
||||
class CTypeLibrary
|
||||
#ifdef SOFTCODE_ENABLED
|
||||
: public ITypeLibrary
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
CTypeLibrary(const char* name)
|
||||
: m_name(name)
|
||||
#ifdef SOFTCODE_ENABLED
|
||||
, m_pOverrideLib()
|
||||
, m_overrideActive()
|
||||
, m_registered()
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
// Implemented in the export cpp
|
||||
static CTypeLibrary<T>* Instance();
|
||||
|
||||
void RegisterType(ITypeRegistrar* pType)
|
||||
{
|
||||
m_typeMap[pType->GetName()] = pType;
|
||||
}
|
||||
|
||||
// The global identifier for this library module
|
||||
/*virtual*/ const char* GetName() { return m_name; }
|
||||
|
||||
#ifdef SOFTCODE_ENABLED
|
||||
virtual void* CreateInstanceVoid(const char* typeName)
|
||||
{
|
||||
return CreateInstance(typeName);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Generic creation function
|
||||
T* CreateInstance(const char* typeName)
|
||||
{
|
||||
#ifdef SOFTCODE_ENABLED
|
||||
RegisterWithSoftCode();
|
||||
|
||||
// If override is enabled, use it
|
||||
if (m_pOverrideLib)
|
||||
{
|
||||
return reinterpret_cast<T*>(m_pOverrideLib->CreateInstanceVoid(typeName));
|
||||
}
|
||||
#endif
|
||||
|
||||
TTypeMap::const_iterator typeIter(m_typeMap.find(typeName));
|
||||
if (typeIter != m_typeMap.end())
|
||||
{
|
||||
ITypeRegistrar* pRegistrar = typeIter->second;
|
||||
return reinterpret_cast<T*>(pRegistrar->CreateInstance());
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef SOFTCODE_ENABLED
|
||||
// Indicates CreateInstance requests should be forwarded to the specified lib
|
||||
virtual void SetOverride(ITypeLibrary* pOverrideLib)
|
||||
{
|
||||
m_pOverrideLib = pOverrideLib;
|
||||
}
|
||||
|
||||
virtual size_t GetTypes(ITypeRegistrar** ppTypes, size_t& count) const
|
||||
{
|
||||
size_t returnedCount = 0;
|
||||
|
||||
if (ppTypes && count >= m_typeMap.size())
|
||||
{
|
||||
for (TTypeMap::const_iterator iter(m_typeMap.begin()); iter != m_typeMap.end(); ++iter)
|
||||
{
|
||||
*ppTypes = iter->second;
|
||||
++ppTypes;
|
||||
++returnedCount;
|
||||
}
|
||||
}
|
||||
|
||||
count = m_typeMap.size();
|
||||
return returnedCount;
|
||||
}
|
||||
|
||||
// Inform the Mgr of this Library and allow it to set an override
|
||||
inline void RegisterWithSoftCode()
|
||||
{
|
||||
// Only register built-in types, SC types are handled directly by
|
||||
// the SoftCodeMgr, so there's no need to auto-register.
|
||||
#ifndef SOFTCODE
|
||||
if (!m_registered)
|
||||
{
|
||||
if (ISoftCodeMgr* pSoftCodeMgr = gEnv->pSoftCodeMgr)
|
||||
{
|
||||
pSoftCodeMgr->RegisterLibrary(this);
|
||||
}
|
||||
|
||||
m_registered = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
typedef AZStd::basic_string<char, AZStd::char_traits<char>, AZ::AZStdAlloc<CryLegacySTLAllocator>> TypeString;
|
||||
typedef AZStd::map<TypeString, ITypeRegistrar*, AZStd::less<TypeString>, AZ::AZStdAlloc<CryLegacySTLAllocator>> TTypeMap;
|
||||
TTypeMap m_typeMap;
|
||||
|
||||
// The name for this TypeLibrary used during SC registration
|
||||
const char* m_name;
|
||||
|
||||
#ifdef SOFTCODE_ENABLED
|
||||
// Used to patch in a new TypeLib at run-time
|
||||
ITypeLibrary* m_pOverrideLib;
|
||||
// True when the owning object system enables the override
|
||||
bool m_overrideActive;
|
||||
// True when registration with SoftCodeMgr has been attempted
|
||||
bool m_registered;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_TYPELIBRARY_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user