Merge branch 'development' into Atom/guthadam/atomtools_refactor_move_mainwindow_bus

This commit is contained in:
Guthrie Adams
2021-08-12 08:34:30 -05:00
140 changed files with 1301 additions and 2155 deletions
@@ -105,7 +105,7 @@ class TestGeneralGraphFunctionality(object):
@pytest.mark.test_case_id("C17488412")
@pytest.mark.SUITE_periodic
@pytest.mark.xfail # https://github.com/o3de/o3de/issues/2201
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2201")
def test_LandscapeCanvas_GraphClosed_OnEntityDelete(self, request, editor, level, launcher_platform):
cfg_args = [level]
@@ -0,0 +1,66 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# fmt:off
class Tests():
create_new_entity = ("Entity: 'CreateNewEntity' passed", "Entity: 'CreateNewEntity' failed")
create_prefab = ("Prefab: 'CreatePrefab' passed", "Prefab: 'CreatePrefab' failed")
instantiate_prefab = ("Prefab: 'InstantiatePrefab' passed", "Prefab: 'InstantiatePrefab' failed")
new_prefab_position = ("Prefab: new prefab's position is at the expected position", "Prefab: new prefab's position is *not* at the expected position")
# fmt:on
def PrefabLevel_BasicWorkflow():
"""
This test will help verify if the following functions related to Prefab work as expected:
- CreatePrefab
- InstantiatePrefab
"""
import os
import sys
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
import editor_python_test_tools.hydra_editor_utils as hydra
import azlmbr.bus as bus
import azlmbr.entity as entity
from azlmbr.entity import EntityId
import azlmbr.editor as editor
import azlmbr.prefab as prefab
from azlmbr.math import Vector3
import azlmbr.legacy.general as general
EXPECTED_NEW_PREFAB_POSITION = Vector3(10.00, 20.0, 30.0)
helper.init_idle()
helper.open_level("Prefab", "Base")
# Create a new Entity at the root level
new_entity_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', EntityId())
Report.result(Tests.create_new_entity, new_entity_id.IsValid())
# Checks for prefab creation passed or not
new_prefab_file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'new_prefab.prefab')
create_prefab_result = prefab.PrefabPublicRequestBus(bus.Broadcast, 'CreatePrefabInMemory', [new_entity_id], new_prefab_file_path)
Report.result(Tests.create_prefab, create_prefab_result)
# Checks for prefab instantiation passed or not
container_entity_id = prefab.PrefabPublicRequestBus(bus.Broadcast, 'InstantiatePrefab', new_prefab_file_path, EntityId(), EXPECTED_NEW_PREFAB_POSITION)
Report.result(Tests.instantiate_prefab, container_entity_id.IsValid())
# Checks if the new prefab is at the correct position and if it fails, it will provide the expected postion and the actual postion of the entity in the Editor log
new_prefab_position = azlmbr.components.TransformBus(azlmbr.bus.Event, "GetWorldTranslation", container_entity_id)
is_at_position = new_prefab_position.IsClose(EXPECTED_NEW_PREFAB_POSITION)
Report.result(Tests.new_prefab_position, is_at_position)
if not is_at_position:
Report.info(f'Expected position: {EXPECTED_NEW_PREFAB_POSITION.ToString()}, actual position: {new_prefab_position.ToString()}')
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(PrefabLevel_BasicWorkflow)
@@ -16,6 +16,7 @@ from ly_test_tools import LAUNCHERS
sys.path.append (os.path.dirname (os.path.abspath (__file__)) + '/../automatedtesting_shared')
import ly_test_tools.environment.file_system as file_system
from base import TestAutomationBase
@pytest.mark.SUITE_main
@@ -29,3 +30,8 @@ class TestAutomation(TestAutomationBase):
def test_PrefabLevel_OpensLevelWithEntities(self, request, workspace, editor, launcher_platform):
from . import PrefabLevel_OpensLevelWithEntities as test_module
self._run_prefab_test(request, workspace, editor, test_module)
def test_PrefabLevel_BasicWorkflow(self, request, workspace, editor, launcher_platform):
from . import PrefabLevel_BasicWorkflow as test_module
self._run_prefab_test(request, workspace, editor, test_module)
@@ -0,0 +1,53 @@
{
"ContainerEntity": {
"Id": "Entity_[1146574390643]",
"Name": "Level",
"Components": {
"Component_[10641544592923449938]": {
"$type": "EditorInspectorComponent",
"Id": 10641544592923449938
},
"Component_[12039882709170782873]": {
"$type": "EditorOnlyEntityComponent",
"Id": 12039882709170782873
},
"Component_[12265484671603697631]": {
"$type": "EditorPendingCompositionComponent",
"Id": 12265484671603697631
},
"Component_[14126657869720434043]": {
"$type": "EditorEntitySortComponent",
"Id": 14126657869720434043
},
"Component_[15230859088967841193]": {
"$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
"Id": 15230859088967841193,
"Parent Entity": ""
},
"Component_[16239496886950819870]": {
"$type": "EditorDisabledCompositionComponent",
"Id": 16239496886950819870
},
"Component_[5688118765544765547]": {
"$type": "EditorEntityIconComponent",
"Id": 5688118765544765547
},
"Component_[6545738857812235305]": {
"$type": "SelectionComponent",
"Id": 6545738857812235305
},
"Component_[7247035804068349658]": {
"$type": "EditorPrefabComponent",
"Id": 7247035804068349658
},
"Component_[9307224322037797205]": {
"$type": "EditorLockComponent",
"Id": 9307224322037797205
},
"Component_[9562516168917670048]": {
"$type": "EditorVisibilityComponent",
"Id": 9562516168917670048
}
}
}
}
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ba9a2cd047a5ee696aaeed882869017a02fd4f5eeee91b6b2bfb830ad1e5ee15
size 10927631
oid sha256:c285cdf72ebe4c274f8d1fbab6ff558f9344d4fa62fb9d07cf11f7511ffaaac9
size 2177072
@@ -0,0 +1,328 @@
{
"values": [
{
"$type": "ActorGroup",
"name": "Jack",
"selectedRootBone": "RootNode.jack_root",
"id": "{B7194F91-D8A1-5D5D-AC6D-DDEBC087D80D}",
"rules": {
"rules": [
{
"$type": "MetaDataRule",
"metaData": "AdjustActor -actorID $(ACTORID) -name \"Jack\"\nActorSetCollisionMeshes -actorID $(ACTORID) -lod 0 -nodeList \"\"\nAdjustActor -actorID $(ACTORID) -nodesExcludedFromBounds \"\" -nodeAction \"select\"\nAdjustActor -actorID $(ACTORID) -nodeAction \"replace\" -attachmentNodes \"\"\nAdjustActor -actorID $(ACTORID) -motionExtractionNodeName \"jack_root\"\nAdjustActor -actorID $(ACTORID) -mirrorSetup \"\"\n"
}
]
}
},
{
"$type": "{5B03C8E6-8CEE-4DA0-A7FA-CD88689DD45B} MeshGroup",
"id": "{BF2CCF49-9BE0-5103-987A-84649A974991}",
"name": "Jack",
"NodeSelectionList": {
"unselectedNodes": [
"RootNode",
"RootNode.jack_root",
"RootNode.jack_meshZUp",
"RootNode.jack_root.Bip01__pelvis",
"RootNode.jack_meshZUp.jack_meshZUp_1",
"RootNode.jack_meshZUp.jack_meshZUp_2",
"RootNode.jack_root.Bip01__pelvis.transform",
"RootNode.jack_root.Bip01__pelvis.l_upLeg",
"RootNode.jack_root.Bip01__pelvis.r_upLeg",
"RootNode.jack_root.Bip01__pelvis.spine1",
"RootNode.jack_meshZUp.jack_meshZUp_1.Bitangent",
"RootNode.jack_meshZUp.jack_meshZUp_1.SkinWeight_",
"RootNode.jack_meshZUp.jack_meshZUp_1.transform",
"RootNode.jack_meshZUp.jack_meshZUp_1.Tangent",
"RootNode.jack_meshZUp.jack_meshZUp_1.map1",
"RootNode.jack_meshZUp.jack_meshZUp_1.jack",
"RootNode.jack_meshZUp.jack_meshZUp_2.Bitangent",
"RootNode.jack_meshZUp.jack_meshZUp_2.SkinWeight_",
"RootNode.jack_meshZUp.jack_meshZUp_2.transform",
"RootNode.jack_meshZUp.jack_meshZUp_2.Tangent",
"RootNode.jack_meshZUp.jack_meshZUp_2.map1",
"RootNode.jack_meshZUp.jack_meshZUp_2.jack",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.transform",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.l_upLegRoll",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.transform",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.r_upLegRoll",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg",
"RootNode.jack_root.Bip01__pelvis.spine1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.l_upLegRoll.transform",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.transform",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.r_upLegRoll.transform",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.transform",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.transform",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.l_ball",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.transform",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.r_ball",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.l_ball.transform",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.r_ball.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.head",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.head.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_upArmRoll",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_upArmRoll",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_upArmRoll.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_loArmRoll",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_upArmRoll.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_loArmRoll",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_loArmRoll.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_handProp",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_loArmRoll.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_handProp",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_handProp.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_handProp.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.l_thumb3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.l_index3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.l_mid3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.r_thumb3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.r_index3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.r_mid3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.l_thumb3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.l_index3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.l_mid3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.l_ring3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.l_pinky3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.r_thumb3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.r_index3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.r_mid3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.r_ring3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.r_pinky3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.l_ring3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.l_pinky3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.r_ring3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.r_pinky3.transform"
]
}
},
{
"$type": "{07B356B7-3635-40B5-878A-FAC4EFD5AD86} MeshGroup",
"name": "Jack",
"nodeSelectionList": {
"selectedNodes": [
"RootNode",
"RootNode.jack_root",
"RootNode.jack_meshZUp",
"RootNode.jack_root.Bip01__pelvis",
"RootNode.jack_meshZUp.jack_meshZUp_1",
"RootNode.jack_meshZUp.jack_meshZUp_2",
"RootNode.jack_root.Bip01__pelvis.transform",
"RootNode.jack_root.Bip01__pelvis.l_upLeg",
"RootNode.jack_root.Bip01__pelvis.r_upLeg",
"RootNode.jack_root.Bip01__pelvis.spine1",
"RootNode.jack_meshZUp.jack_meshZUp_1.Bitangent",
"RootNode.jack_meshZUp.jack_meshZUp_1.SkinWeight_",
"RootNode.jack_meshZUp.jack_meshZUp_1.transform",
"RootNode.jack_meshZUp.jack_meshZUp_1.Tangent",
"RootNode.jack_meshZUp.jack_meshZUp_1.map1",
"RootNode.jack_meshZUp.jack_meshZUp_1.jack",
"RootNode.jack_meshZUp.jack_meshZUp_2.Bitangent",
"RootNode.jack_meshZUp.jack_meshZUp_2.SkinWeight_",
"RootNode.jack_meshZUp.jack_meshZUp_2.transform",
"RootNode.jack_meshZUp.jack_meshZUp_2.Tangent",
"RootNode.jack_meshZUp.jack_meshZUp_2.map1",
"RootNode.jack_meshZUp.jack_meshZUp_2.jack",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.transform",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.l_upLegRoll",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.transform",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.r_upLegRoll",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg",
"RootNode.jack_root.Bip01__pelvis.spine1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.l_upLegRoll.transform",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.transform",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.r_upLegRoll.transform",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.transform",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.transform",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.l_ball",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.transform",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.r_ball",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr",
"RootNode.jack_root.Bip01__pelvis.l_upLeg.l_loLeg.l_ankle.l_ball.transform",
"RootNode.jack_root.Bip01__pelvis.r_upLeg.r_loLeg.r_ankle.r_ball.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.head",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.neck.head.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_upArmRoll",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_upArmRoll",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_upArmRoll.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_loArmRoll",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_upArmRoll.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_loArmRoll",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_loArmRoll.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_handProp",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_loArmRoll.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_handProp",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_handProp.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_handProp.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.l_thumb3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.l_index3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.l_mid3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.r_thumb3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.r_index3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.r_mid3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_thumb1.l_thumb2.l_thumb3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_index1.l_index2.l_index3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_mid1.l_mid2.l_mid3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.l_ring3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.l_pinky3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_thumb1.r_thumb2.r_thumb3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_index1.r_index2.r_index3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_mid1.r_mid2.r_mid3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.r_ring3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.r_pinky3",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_ring1.l_ring2.l_ring3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.l_shldr.l_upArm.l_loArm.l_hand.l_metacarpal.l_pinky1.l_pinky2.l_pinky3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_ring1.r_ring2.r_ring3.transform",
"RootNode.jack_root.Bip01__pelvis.spine1.spine2.spine3.r_shldr.r_upArm.r_loArm.r_hand.r_metacarpal.r_pinky1.r_pinky2.r_pinky3.transform"
]
},
"rules": {
"rules": [
{
"$type": "SkinRule"
},
{
"$type": "MaterialRule"
}
]
},
"id": "{59B1DB76-5B27-5569-8DF6-55296FD0E5D8}"
}
]
}
@@ -1,12 +0,0 @@
<Material MtlFlags="524544" DccMaterialHash="0" vertModifType="0">
<SubMaterials>
<Material Name="Jack:jack" MtlFlags="524416" DccMaterialHash="0" Shader="Illum" GenMask="A00080000003" StringGenMask="%ALLOW_SILHOUETTE_POM%ALLOW_SPECULAR_ANTIALIASING%FX_DISSOLVE%SPECULAR_MAP%SUBSURFACE_SCATTERING" SurfaceType="" Diffuse="0.80000001,0.80000001,0.80000001,1" Specular="0.5,0.5,0.5,1" Opacity="1" Shininess="3.4240739" vertModifType="0" LayerAct="1">
<Textures>
<Texture Map="Diffuse" File="objects/characters/jack/textures/jack_diff.dds"/>
<Texture Map="Specular" File="objects/characters/jack/textures/jack_spec.dds"/>
</Textures>
<PublicParams DissolveColor="1,1,1" EmittanceMapGamma="1" DissolveEdgeThickness="0" SSSIndex="0" DissolvePercentage="0" IndirectColor="0.25,0.25,0.25"/>
</Material>
</SubMaterials>
<PublicParams EmittanceMapGamma="1" SSSIndex="0" IndirectColor="0.25,0.25,0.25"/>
</Material>
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bb1c97394454a0a0c3b4aaf8380878aac3f7bedc9091ec920963932ad6ad2290
size 30484
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d090219fc20e7c1d9f0c187f976a7cb55e5b27b39e087aa8281ac794f314cb32
size 22364
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8fa78264ca46a2f201e24c3ba6a543e713bf9fd984df0a10f52b191d21077227
size 106676
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ebf610eecec9a4da2d5c9260c48b81f6a04eaf7686d69850ad9f5d06fdbcf183
size 12940
@@ -1,14 +0,0 @@
<Material MtlFlags="524544" vertModifType="0">
<SubMaterials>
<Material Name="jack" MtlFlags="524416" Shader="Illum" GenMask="4001010020001" StringGenMask="%ALLOW_SILHOUETTE_POM%EMITTANCE_MAP%NORMAL_MAP%SPECULAR_MAP%SUBSURFACE_SCATTERING" SurfaceType="mat_metal" Diffuse="1,1,1,1" Specular="1,1,1,1" Emittance="1,1,1,200" Opacity="1" Shininess="255" vertModifType="0" LayerAct="1">
<Textures>
<Texture Map="Diffuse" File="objects/characters/jack/textures/brokenrobot_black_diff.dds"/>
<Texture Map="Bumpmap" File="objects/characters/jack/textures/brokenrobot_01_ddna.dds"/>
<Texture Map="Specular" File="objects/characters/jack/textures/brokenrobot_spec.dds"/>
<Texture Map="Emittance" File="objects/characters/jack/textures/jack_emis.dds"/>
</Textures>
<PublicParams EmittanceMapGamma="1" SSSIndex="0" IndirectColor="0.25,0.25,0.25"/>
</Material>
</SubMaterials>
<PublicParams EmittanceMapGamma="1" SSSIndex="0" IndirectColor="0.25,0.25,0.25"/>
</Material>
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:30afe8cf6e4aca846b07ef81747607afb47c0ff88283f363aca29ded9818c3db
size 8148
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dba25dd8b3840d01aefb69007919b07befc5365fff714493c87cf1eff644d5dc
size 8148
@@ -1,8 +0,0 @@
<Material MtlFlags="524544" >
<SubMaterials>
<Material Name="dummyPlane_mat" MtlFlags="1152" Shader="Nodraw" GenMask="0" SurfaceType="" MatTemplate="" Diffuse="0.500000,0.500000,0.500000" Specular="0.000000,0.000000,0.000000" Emissive="0.000000,0.000000,0.000000" Shininess="10" Opacity="1" >
<Textures>
</Textures>
</Material>
</SubMaterials>
</Material>
@@ -1,14 +0,0 @@
<Material MtlFlags="524544" vertModifType="0">
<SubMaterials>
<Material Name="jack" MtlFlags="524416" Shader="Illum" GenMask="4001010020001" StringGenMask="%ALLOW_SILHOUETTE_POM%EMITTANCE_MAP%NORMAL_MAP%SPECULAR_MAP%SUBSURFACE_SCATTERING" SurfaceType="mat_player_collider" Diffuse="1,1,1,1" Specular="1,1,1,1" Emittance="0.99110222,0.0056053922,0.0056053922,200" Opacity="1" Shininess="255" vertModifType="0" LayerAct="1">
<Textures>
<Texture Map="Diffuse" File="objects/characters/jack/textures/brokenrobot_white_diff.dds"/>
<Texture Map="Bumpmap" File="objects/characters/jack/textures/brokenrobot_01_ddna.dds"/>
<Texture Map="Specular" File="objects/characters/jack/textures/brokenrobot_spec.dds"/>
<Texture Map="Emittance" File="objects/characters/jack/textures/brokenrobot_emis.dds"/>
</Textures>
<PublicParams EmittanceMapGamma="1" SSSIndex="0" IndirectColor="0.25,0.25,0.25"/>
</Material>
</SubMaterials>
<PublicParams EmittanceMapGamma="1" SSSIndex="0" IndirectColor="0.25,0.25,0.25"/>
</Material>
@@ -1,14 +0,0 @@
<Material MtlFlags="524544" vertModifType="0">
<SubMaterials>
<Material Name="jack" MtlFlags="524416" Shader="Illum" GenMask="4001010020001" StringGenMask="%ALLOW_SILHOUETTE_POM%EMITTANCE_MAP%NORMAL_MAP%SPECULAR_MAP%SUBSURFACE_SCATTERING" SurfaceType="mat_player_collider" Diffuse="1,1,1,1" Specular="1,1,1,1" Emittance="0.00091058103,0.70837593,0.76815128,160" Opacity="1" Shininess="255" vertModifType="0" LayerAct="1">
<Textures>
<Texture Map="Diffuse" File="objects/characters/jack/textures/brokenrobot_white_diff.dds"/>
<Texture Map="Bumpmap" File="objects/characters/jack/textures/brokenrobot_01_ddna.dds"/>
<Texture Map="Specular" File="objects/characters/jack/textures/brokenrobot_spec.dds"/>
<Texture Map="Emittance" File="objects/characters/jack/textures/jack_emis.dds"/>
</Textures>
<PublicParams EmittanceMapGamma="1" SSSIndex="0" IndirectColor="0.25,0.25,0.25"/>
</Material>
</SubMaterials>
<PublicParams EmittanceMapGamma="1" SSSIndex="0" IndirectColor="0.25,0.25,0.25"/>
</Material>
@@ -1,14 +0,0 @@
<Material MtlFlags="524544" vertModifType="0">
<SubMaterials>
<Material Name="jack" MtlFlags="524416" Shader="Illum" GenMask="4001010020001" StringGenMask="%ALLOW_SILHOUETTE_POM%EMITTANCE_MAP%NORMAL_MAP%SPECULAR_MAP%SUBSURFACE_SCATTERING" SurfaceType="mat_player_collider" Diffuse="1,1,1,1" Specular="1,1,1,1" Emittance="0.98225069,0.00030352699,0.00030352699,200" Opacity="1" Shininess="255" vertModifType="0" LayerAct="1">
<Textures>
<Texture Map="Diffuse" File="objects/characters/jack/textures/brokenrobot_black_diff.dds"/>
<Texture Map="Bumpmap" File="objects/characters/jack/textures/brokenrobot_01_ddna.dds"/>
<Texture Map="Specular" File="objects/characters/jack/textures/brokenrobot_spec.dds"/>
<Texture Map="Emittance" File="objects/characters/jack/textures/brokenrobot_emis.dds"/>
</Textures>
<PublicParams EmittanceMapGamma="1" SSSIndex="0" IndirectColor="0.25,0.25,0.25"/>
</Material>
</SubMaterials>
<PublicParams EmittanceMapGamma="1" SSSIndex="0" IndirectColor="0.25,0.25,0.25"/>
</Material>
@@ -1,14 +0,0 @@
<Material MtlFlags="524544" vertModifType="0">
<SubMaterials>
<Material Name="jack" MtlFlags="524416" Shader="Illum" GenMask="4001010020001" StringGenMask="%ALLOW_SILHOUETTE_POM%EMITTANCE_MAP%NORMAL_MAP%SPECULAR_MAP%SUBSURFACE_SCATTERING" SurfaceType="mat_player_collider" Diffuse="1,1,1,1" Specular="1,1,1,1" Emittance="0.00091058103,0.70837593,0.76815128,160" Opacity="1" Shininess="255" vertModifType="0" LayerAct="1">
<Textures>
<Texture Map="Diffuse" File="objects/characters/jack/textures/jack_diff.dds"/>
<Texture Map="Bumpmap" File="objects/characters/jack/textures/jack_ddna.dds"/>
<Texture Map="Specular" File="objects/characters/jack/textures/jack_spec_02_spec.dds"/>
<Texture Map="Emittance" File="objects/characters/jack/textures/jack_emis.dds"/>
</Textures>
<PublicParams EmittanceMapGamma="1" SSSIndex="0" IndirectColor="0.25,0.25,0.25"/>
</Material>
</SubMaterials>
<PublicParams EmittanceMapGamma="1" SSSIndex="0" IndirectColor="0.25,0.25,0.25"/>
</Material>
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ca5c900fabf8b5c8c9313a0144886f4da3f812c82e8cffd652d9c61b9bb5b953
size 4221960
@@ -1 +0,0 @@
/autooptimizefile=0 /preset=NormalsWithSmoothness /reduce=0
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:80f40a78e4b21dd27f5ddf34337e7d0e2119b7cfa08f0eea38d4b1d63808821f
size 3178996
@@ -1 +0,0 @@
/autooptimizefile=0 /preset=Albedo /reduce=0
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e5f5e327624e0f1fd35fac141019941b12ad0642c25853be9f7fd5b9b6f91bc5
size 3168212
@@ -1 +0,0 @@
/autooptimizefile=0 /preset=Albedo /reduce=0
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:089e74ca9a41967038e16a9107099a73f8e93d39c487ff5bacdde18f418bf761
size 3176732
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d45cd564d2b52575d1ad37b907a7d378871f05f6c9e5569ec73d7973d56599c9
size 3167984
@@ -1 +0,0 @@
/autooptimizefile=0 /preset=Albedo /reduce=0
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:83a872c07f7cbbcb868903429dd8d5a71e8c0b7b0e2cb16cb08b5cb26b02251c
size 3177492
@@ -1 +0,0 @@
/autooptimizefile=0 /preset=Albedo /reduce=0
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:81c1bc9545a17232523fd97561013534221b3bf8927feefa52bdc757e294c2e2
size 3179140
@@ -1 +0,0 @@
/autooptimizefile=0 /preset=Albedo /reduce=0
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:99f476a56205c80878be7472857a6430ce6dc40f2eb1558de4933a5b79fa2420
size 814244
@@ -1 +0,0 @@
/autooptimizefile=0 /preset=Reflectance /reduce=0
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:366959c8a31356669d47f58d07157171ed369b3e7549b3b65a8b8d153a1477a6
size 3179956
@@ -1 +0,0 @@
/autooptimizefile=0 /preset=Albedo /reduce=0
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e839924e03ba99459547df1cf5334de3bdad75b18e76176e430e343a979d9f05
size 3168472
@@ -1 +0,0 @@
/autooptimizefile=0 /preset=Albedo /reduce=0
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:36f537bb5be89fccba1502e9e8f8dfffbf05ea8aa82ac439305e8c2502b01691
size 16804800
@@ -1 +0,0 @@
/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce=0
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b0457cbbbe1fe7e52fdb9af7ee2bc32df96a453fe248738b35ffe0b8087a28c5
size 12615988
@@ -1 +0,0 @@
/autooptimizefile=0 /M=50,50,50,0,50,50 /preset=Albedo /reduce=0
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4ba741103d039bddf72d4834c92a5e069285e31b8be2e7f4e8103f9c5c81694f
size 3167864
@@ -1 +0,0 @@
/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Albedo /reduce=0
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4d7cb58f48e4df76214509fc01d5170fd38bc447d56af61f008c04a1653c2d20
size 12614884
@@ -1 +0,0 @@
/autooptimizefile=0 /M=50,50,50,0,50,50 /preset=Reflectance /reduce=0
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:80a2c56bfcb8c98bf5a72ec9fdb5fcc6eae28ba1c3c26efad5c8a36e6105f1d0
size 3173936
@@ -1 +0,0 @@
/autooptimizefile=0 /preset=Reflectance /reduce=0
+3 -13
View File
@@ -72,7 +72,6 @@
#include "IPostEffectGroup.h"
#include "EditorPreferencesPageGeneral.h"
#include "ViewportManipulatorController.h"
#include "LegacyViewportCameraController.h"
#include "EditorViewportSettings.h"
#include "ViewPane.h"
@@ -105,14 +104,13 @@
AZ_CVAR(
bool, ed_visibility_logTiming, false, nullptr, AZ::ConsoleFunctorFlags::Null, "Output the timing of the new IVisibilitySystem query");
AZ_CVAR(bool, ed_useNewCameraSystem, true, nullptr, AZ::ConsoleFunctorFlags::Null, "Use the new Editor camera system");
AZ_CVAR(bool, ed_showCursorCameraLook, true, nullptr, AZ::ConsoleFunctorFlags::Null, "Show the cursor when using free look with the new camera system");
namespace SandboxEditor
{
bool UsingNewCameraSystem()
{
return ed_useNewCameraSystem;
return true;
}
} // namespace SandboxEditor
@@ -1274,15 +1272,8 @@ void EditorViewportWidget::SetViewportId(int id)
m_renderViewport->GetControllerList()->Add(AZStd::make_shared<SandboxEditor::ViewportManipulatorController>());
if (ed_useNewCameraSystem)
{
m_renderViewport->GetControllerList()->Add(CreateModularViewportCameraController(AzFramework::ViewportId(id)));
}
else
{
m_renderViewport->GetControllerList()->Add(AZStd::make_shared<SandboxEditor::LegacyViewportCameraController>());
}
m_renderViewport->GetControllerList()->Add(CreateModularViewportCameraController(AzFramework::ViewportId(id)));
m_renderViewport->SetViewportSettings(&g_EditorViewportSettings);
UpdateScene();
@@ -2239,7 +2230,6 @@ void EditorViewportWidget::CenterOnAABB(const AABB& aabb)
orbitDistance = fabs(orbitDistance);
SetViewTM(newTM);
SandboxEditor::OrbitCameraControlsBus::Event(GetViewportId(), &SandboxEditor::OrbitCameraControlsBus::Events::SetOrbitDistance, orbitDistance);
}
void EditorViewportWidget::CenterOnSliceInstance()
+1
View File
@@ -20,6 +20,7 @@
#include "LogFile.h"
#include "CryListenerSet.h"
#include "Util/ModalWindowDismisser.h"
#include <CryCommon/CryThread.h>
#endif
class CStartupLogoDialog;
+1
View File
@@ -9,6 +9,7 @@
#pragma once
#include "../Include/SandboxAPI.h"
#include <set>
class QWidget;
+2
View File
@@ -12,8 +12,10 @@
#pragma once
#include <AzCore/PlatformIncl.h>
#include <AzCore/Math/Guid.h>
#include <CryCommon/platform.h>
#include <CryCommon/Cry_Geo.h>
#include <set>
// forward declarations.
class CEntityObject;
@@ -1,537 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include "LegacyViewportCameraController.h"
#include <AzFramework/Input/Devices/Mouse/InputDeviceMouse.h>
#include <AzFramework/Input/Devices/Keyboard/InputDeviceKeyboard.h>
#include <AzFramework/Viewport/ScreenGeometry.h>
#include <AzToolsFramework/Viewport/ViewportMessages.h>
#include <Atom/RPI.Public/ViewportContextBus.h>
#include <Atom/RPI.Public/ViewportContext.h>
#include <IViewSystem.h>
#include <ISystem.h>
#include "CryCommon/MathConversion.h"
#include "SandboxAPI.h"
#include "Settings.h"
namespace SandboxEditor
{
LegacyViewportCameraControllerInstance::LegacyViewportCameraControllerInstance(AzFramework::ViewportId viewportId, LegacyViewportCameraController* controller)
: AzFramework::MultiViewportControllerInstanceInterface<LegacyViewportCameraController>(viewportId, controller)
{
OrbitCameraControlsBus::Handler::BusConnect(viewportId);
}
LegacyViewportCameraControllerInstance::~LegacyViewportCameraControllerInstance()
{
OrbitCameraControlsBus::Handler::BusDisconnect();
}
bool LegacyViewportCameraControllerInstance::JustAltHeld() const
{
return (m_modifiers ^ Qt::AltModifier) == 0;
}
bool LegacyViewportCameraControllerInstance::NoModifierHeld() const
{
return !m_modifiers;
}
bool LegacyViewportCameraControllerInstance::AllowDolly() const
{
return JustAltHeld();
}
bool LegacyViewportCameraControllerInstance::AllowOrbit() const
{
return JustAltHeld();
}
bool LegacyViewportCameraControllerInstance::AllowPan() const
{
// begin pan with alt (inverted movement) or no modifiers
return JustAltHeld() || NoModifierHeld();
}
bool LegacyViewportCameraControllerInstance::InvertPan() const
{
return JustAltHeld();
}
void LegacyViewportCameraControllerInstance::SetOrbitDistance(float orbitDistance)
{
m_orbitDistance = orbitDistance;
}
AZ::RPI::ViewportContextPtr LegacyViewportCameraControllerInstance::GetViewportContext()
{
// This could be cached, if needed
auto viewportContextManager = AZ::Interface<AZ::RPI::ViewportContextRequestsInterface>::Get();
if (!viewportContextManager)
{
return {};
}
return viewportContextManager->GetViewportContextById(GetViewportId());
}
bool LegacyViewportCameraControllerInstance::HandleMouseMove(
int dx, int dy)
{
if (dx == 0 && dy == 0)
{
return false;
}
auto viewportContext = GetViewportContext();
if (!viewportContext)
{
return false;
}
float speedScale = gSettings.cameraMoveSpeed;
if (m_modifiers & Qt::Key_Control)
{
speedScale *= gSettings.cameraFastMoveSpeed;
}
if (m_inMoveMode || m_inOrbitMode || m_inRotateMode || m_inZoomMode)
{
m_totalMouseMoveDelta += AZStd::abs(dx) + AZStd::abs(dy);
}
if ((m_inRotateMode && m_inMoveMode) || m_inZoomMode)
{
Matrix34 m = AZTransformToLYTransform(viewportContext->GetCameraTransform());
Vec3 ydir = m.GetColumn1().GetNormalized();
Vec3 pos = m.GetTranslation();
const float posDelta = 0.2f * dy * speedScale;
pos = pos - ydir * posDelta;
m_orbitDistance = m_orbitDistance + posDelta;
m_orbitDistance = fabs(m_orbitDistance);
m.SetTranslation(pos);
viewportContext->SetCameraTransform(LYTransformToAZTransform(m));
return true;
}
else if (m_inRotateMode)
{
Ang3 angles(dy, 0, dx);
angles = angles * 0.002f * gSettings.cameraRotateSpeed;
if (gSettings.invertYRotation)
{
angles.x = -angles.x;
}
Matrix34 camtm = AZTransformToLYTransform(viewportContext->GetCameraTransform());
Ang3 ypr = CCamera::CreateAnglesYPR(Matrix33(camtm));
ypr.x += angles.z;
ypr.y += angles.x;
ypr.y = AZStd::clamp(ypr.y, -1.5f, 1.5f); // to keep rotation in reasonable range
ypr.z = 0; // to have camera always upward
camtm = Matrix34(CCamera::CreateOrientationYPR(ypr), camtm.GetTranslation());
viewportContext->SetCameraTransform(LYTransformToAZTransform(camtm));
return true;
}
else if (m_inMoveMode)
{
// Slide.
Matrix34 m = AZTransformToLYTransform(viewportContext->GetCameraTransform());
Vec3 xdir = m.GetColumn0().GetNormalized();
Vec3 zdir = m.GetColumn2().GetNormalized();
if (InvertPan())
{
xdir = -xdir;
zdir = -zdir;
}
Vec3 pos = m.GetTranslation();
pos += 0.1f * xdir * dx * speedScale + 0.1f * zdir * dy * speedScale;
m.SetTranslation(pos);
AZ::Transform transform = viewportContext->GetCameraTransform();
transform.SetTranslation(LYVec3ToAZVec3(pos));
viewportContext->SetCameraTransform(transform);
return true;
}
else if (m_inOrbitMode)
{
Ang3 angles(dy, 0, dx);
angles = angles * 0.002f * gSettings.cameraRotateSpeed;
if (gSettings.invertPan)
{
angles.z = -angles.z;
}
Matrix34 m = AZTransformToLYTransform(viewportContext->GetCameraTransform());
Ang3 ypr = CCamera::CreateAnglesYPR(Matrix33(m));
ypr.x += angles.z;
ypr.y = AZStd::clamp(ypr.y, -1.5f, 1.5f); // to keep rotation in reasonable range
ypr.y += angles.x;
Matrix33 rotateTM = CCamera::CreateOrientationYPR(ypr);
Vec3 src = m.GetTranslation();
Vec3 trg(m_orbitTarget.GetX(), m_orbitTarget.GetY(), m_orbitTarget.GetZ());
float fCameraRadius = (trg - src).GetLength();
// Calc new source.
src = trg - rotateTM * Vec3(0, 1, 0) * fCameraRadius;
Matrix34 camTM = rotateTM;
camTM.SetTranslation(src);
viewportContext->SetCameraTransform(LYTransformToAZTransform(camTM));
return true;
}
return false;
}
bool LegacyViewportCameraControllerInstance::HandleMouseWheel(float zDelta)
{
auto viewportContext = GetViewportContext();
if (!viewportContext)
{
return false;
}
Matrix34 m = AZTransformToLYTransform(viewportContext->GetCameraTransform());
const Vec3 ydir = m.GetColumn1().GetNormalized();
Vec3 pos = m.GetTranslation();
const float posDelta = 0.01f * zDelta * gSettings.wheelZoomSpeed;
pos += ydir * posDelta;
m_orbitDistance = m_orbitDistance - posDelta;
m_orbitDistance = fabs(m_orbitDistance);
m.SetTranslation(pos);
viewportContext->SetCameraTransform(LYTransformToAZTransform(m));
return true;
}
bool LegacyViewportCameraControllerInstance::IsKeyDown(Qt::Key key) const
{
return m_pressedKeys.contains(key);
}
Qt::Key LegacyViewportCameraControllerInstance::GetKeyboardKey(const AzFramework::InputChannel& inputChannel)
{
using Key = AzFramework::InputDeviceKeyboard::Key;
const auto& id = inputChannel.GetInputChannelId();
if (id == Key::AlphanumericW)
{
return Qt::Key_W;
}
else if (id == Key::AlphanumericA)
{
return Qt::Key_A;
}
else if (id == Key::AlphanumericS)
{
return Qt::Key_S;
}
else if (id == Key::AlphanumericD)
{
return Qt::Key_D;
}
else if (id == Key::AlphanumericQ)
{
return Qt::Key_Q;
}
else if (id == Key::AlphanumericE)
{
return Qt::Key_E;
}
else if (id == Key::NavigationArrowUp)
{
return Qt::Key_Up;
}
else if (id == Key::NavigationArrowUp)
{
return Qt::Key_Down;
}
else if (id == Key::NavigationArrowUp)
{
return Qt::Key_Left;
}
else if (id == Key::NavigationArrowUp)
{
return Qt::Key_Right;
}
return Qt::Key_unknown;
}
Qt::KeyboardModifier LegacyViewportCameraControllerInstance::GetKeyboardModifier(const AzFramework::InputChannel& inputChannel)
{
using Key = AzFramework::InputDeviceKeyboard::Key;
const auto& id = inputChannel.GetInputChannelId();
if (id == Key::ModifierAltL || id == Key::ModifierAltR)
{
return Qt::KeyboardModifier::AltModifier;
}
if (id == Key::ModifierCtrlL || id == Key::ModifierCtrlR)
{
return Qt::KeyboardModifier::ControlModifier;
}
if (id == Key::ModifierShiftL || id == Key::ModifierShiftR)
{
return Qt::KeyboardModifier::ShiftModifier;
}
return Qt::KeyboardModifier::NoModifier;
}
bool LegacyViewportCameraControllerInstance::HandleInputChannelEvent(const AzFramework::ViewportControllerInputEvent& event)
{
using AzFramework::InputChannel;
using MouseButton = AzFramework::InputDeviceMouse::Button;
const auto& id = event.m_inputChannel.GetInputChannelId();
const auto& state = event.m_inputChannel.GetState();
bool shouldCaptureCursor = m_capturingCursor;
bool shouldConsumeEvent = false;
if (id == AzFramework::InputDeviceMouse::Movement::X || id == AzFramework::InputDeviceMouse::Movement::Y)
{
int dx = 0;
int dy = 0;
if (id == AzFramework::InputDeviceMouse::Movement::X)
{
dx = -aznumeric_cast<int>(event.m_inputChannel.GetValue());
}
else
{
dy = -aznumeric_cast<int>(event.m_inputChannel.GetValue());
}
return HandleMouseMove(dx, dy);
}
else if (id == MouseButton::Left)
{
if (state == InputChannel::State::Began)
{
if (AllowOrbit())
{
AzFramework::CameraState cameraState;
AzToolsFramework::ViewportInteraction::ViewportInteractionRequestBus::EventResult(
cameraState, event.m_viewportId,
&AzToolsFramework::ViewportInteraction::ViewportInteractionRequestBus::Events::GetCameraState);
m_inOrbitMode = true;
m_orbitTarget = cameraState.m_position + cameraState.m_forward * m_orbitDistance;
shouldConsumeEvent = true;
shouldCaptureCursor = true;
}
}
else if (state == InputChannel::State::Ended)
{
m_inOrbitMode = false;
shouldCaptureCursor = false;
}
}
else if (id == MouseButton::Right)
{
if (state == InputChannel::State::Began)
{
if (AllowDolly())
{
m_inZoomMode = true;
}
else
{
m_inRotateMode = true;
}
shouldCaptureCursor = true;
// Record how much the cursor has been moved to see if we should own the mouse up event.
m_totalMouseMoveDelta = 0;
}
else if (state == InputChannel::State::Ended)
{
m_inZoomMode = false;
m_inRotateMode = false;
// If we've moved the cursor more than a couple pixels, we should eat this mouse up event to prevent the context menu controller from seeing it.
shouldConsumeEvent = m_totalMouseMoveDelta > 2;
shouldCaptureCursor = false;
}
}
else if (id == MouseButton::Middle)
{
if (state == InputChannel::State::Began)
{
if (AllowPan())
{
m_inMoveMode = true;
shouldConsumeEvent = true;
shouldCaptureCursor = true;
}
}
else if (state == InputChannel::State::Ended)
{
m_inMoveMode = false;
shouldCaptureCursor = false;
}
}
else if (auto modifier = GetKeyboardModifier(event.m_inputChannel); modifier != Qt::KeyboardModifier::NoModifier)
{
if (state == InputChannel::State::Ended)
{
m_modifiers &= ~modifier;
}
else
{
m_modifiers |= modifier;
}
}
else if (id == AzFramework::InputDeviceMouse::Movement::Z)
{
if (state == InputChannel::State::Began || state == InputChannel::State::Updated)
{
shouldConsumeEvent = HandleMouseWheel(event.m_inputChannel.GetValue());
}
}
else if (auto key = GetKeyboardKey(event.m_inputChannel); key != Qt::Key_unknown)
{
if (!event.m_inputChannel.IsActive())
{
m_pressedKeys.erase(key);
}
else
{
m_pressedKeys.insert(key);
shouldConsumeEvent = true;
}
}
UpdateCursorCapture(shouldCaptureCursor);
return shouldConsumeEvent;
}
void LegacyViewportCameraControllerInstance::UpdateCursorCapture(bool shouldCaptureCursor)
{
if (m_capturingCursor != shouldCaptureCursor)
{
if (shouldCaptureCursor)
{
AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Event(
GetViewportId(),
&AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Events::BeginCursorCapture
);
}
else
{
AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Event(
GetViewportId(),
&AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Events::EndCursorCapture
);
}
m_capturingCursor = shouldCaptureCursor;
}
}
void LegacyViewportCameraControllerInstance::ResetInputChannels()
{
m_modifiers = 0;
m_pressedKeys.clear();
UpdateCursorCapture(false);
m_inRotateMode = m_inMoveMode = m_inOrbitMode = m_inZoomMode = false;
}
void LegacyViewportCameraControllerInstance::UpdateViewport(const AzFramework::ViewportControllerUpdateEvent& event)
{
auto viewportContext = GetViewportContext();
if (!viewportContext)
{
return;
}
AZ::Transform transform = viewportContext->GetCameraTransform();
AZ::Vector3 xdir = transform.GetBasisX();
AZ::Vector3 ydir = transform.GetBasisY();
AZ::Vector3 zdir = transform.GetBasisZ();
AZ::Vector3 pos = transform.GetTranslation();
float speedScale = AZStd::GetMin(30.0f * event.m_deltaTime.count(), 20.0f);
// Use the global modifier keys instead of our keymap. It's more reliable.
const bool shiftPressed = m_modifiers & Qt::ShiftModifier;
const bool controlPressed = m_modifiers & Qt::ControlModifier;
speedScale *= gSettings.cameraMoveSpeed;
if (controlPressed)
{
return;
}
if (shiftPressed)
{
speedScale *= gSettings.cameraFastMoveSpeed;
}
bool cameraMoved = false;
if (IsKeyDown(Qt::Key_Up) || IsKeyDown(Qt::Key_W))
{
// move forward
cameraMoved = true;
pos = pos + (speedScale * m_moveSpeed * ydir);
}
if (IsKeyDown(Qt::Key_Down) || IsKeyDown(Qt::Key_S))
{
// move backward
cameraMoved = true;
pos = pos - (speedScale * m_moveSpeed * ydir);
}
if (IsKeyDown(Qt::Key_Left) || IsKeyDown(Qt::Key_A))
{
// move left
cameraMoved = true;
pos = pos - (speedScale * m_moveSpeed * xdir);
}
if (IsKeyDown(Qt::Key_Right) || IsKeyDown(Qt::Key_D))
{
// move right
cameraMoved = true;
pos = pos + (speedScale * m_moveSpeed * xdir);
}
if (IsKeyDown(Qt::Key_E))
{
// move Up
cameraMoved = true;
pos = pos + (speedScale * m_moveSpeed * zdir);
}
if (IsKeyDown(Qt::Key_Q))
{
// move down
cameraMoved = true;
pos = pos - (speedScale * m_moveSpeed * zdir);
}
if (cameraMoved)
{
transform.SetTranslation(pos);
viewportContext->SetCameraTransform(transform);
}
}
} //namespace SandboxEditor
@@ -1,91 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/EBus/EBus.h>
#include <AzFramework/Viewport/ViewportId.h>
#include <AzFramework/Viewport/MultiViewportController.h>
#include <AzCore/Math/Vector3.h>
#include <Atom/RPI.Public/Base.h>
#include <QtCore/qnamespace.h>
#include <QPoint>
namespace AzFramework
{
struct ScreenPoint;
}
namespace SandboxEditor
{
class OrbitCameraControls
: public AZ::EBusTraits
{
public:
//////////////////////////////////////////////////////////////////////////
// EBusTraits overrides
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
using BusIdType = AzFramework::ViewportId;
//////////////////////////////////////////////////////////////////////////
virtual void SetOrbitDistance(float orbitDistance [[maybe_unused]]) {;}
};
using OrbitCameraControlsBus = AZ::EBus<OrbitCameraControls>;
class LegacyViewportCameraControllerInstance;
using LegacyViewportCameraController = AzFramework::MultiViewportController<LegacyViewportCameraControllerInstance>;
class LegacyViewportCameraControllerInstance final
: public AzFramework::MultiViewportControllerInstanceInterface<LegacyViewportCameraController>
, public OrbitCameraControlsBus::Handler
{
public:
LegacyViewportCameraControllerInstance(AzFramework::ViewportId viewport, LegacyViewportCameraController* controller);
~LegacyViewportCameraControllerInstance();
bool HandleInputChannelEvent(const AzFramework::ViewportControllerInputEvent& event) override;
void ResetInputChannels() override;
void UpdateViewport(const AzFramework::ViewportControllerUpdateEvent& event) override;
void SetOrbitDistance(float orbitDistance) override;
private:
bool JustAltHeld() const;
bool NoModifierHeld() const;
bool AllowDolly() const;
bool AllowOrbit() const;
bool AllowPan() const;
bool InvertPan() const;
static Qt::KeyboardModifier GetKeyboardModifier(const AzFramework::InputChannel& inputChannel);
static Qt::Key GetKeyboardKey(const AzFramework::InputChannel& inputChannel);
AZ::RPI::ViewportContextPtr GetViewportContext();
bool HandleMouseMove(int dx, int dy);
bool HandleMouseWheel(float zDelta);
bool IsKeyDown(Qt::Key key) const;
void UpdateCursorCapture(bool shouldCaptureCursor);
bool m_inRotateMode = false;
bool m_inMoveMode = false;
bool m_inOrbitMode = false;
bool m_inZoomMode = false;
int m_totalMouseMoveDelta = 0;
float m_orbitDistance = 10.f;
float m_moveSpeed = 1.f;
AZ::Vector3 m_orbitTarget = {};
unsigned int m_modifiers = {};
AZStd::unordered_set<Qt::Key> m_pressedKeys;
bool m_capturingCursor = false;
};
} //namespace SandboxEditor
+2
View File
@@ -15,6 +15,8 @@
#include "Util/GuidUtil.h"
#include "ErrorReport.h"
#include <set>
class CPakFile;
class CErrorRecord;
struct IObjectManager;
@@ -9,6 +9,7 @@
#include "CryFile.h"
#include "PerforceSourceControl.h"
#include "PasswordDlg.h"
#include <CryCommon/CryThread.h>
#include <QSettings>
#include <QDir>
+1
View File
@@ -10,6 +10,7 @@
#pragma once
#include <QString>
#include <CryCommon/StlUtils.h>
#include <QApplication>
#include <QDropEvent>
-2
View File
@@ -799,8 +799,6 @@ set(FILES
EditorViewportCamera.h
ViewportManipulatorController.cpp
ViewportManipulatorController.h
LegacyViewportCameraController.cpp
LegacyViewportCameraController.h
TopRendererWnd.cpp
TopRendererWnd.h
ViewManager.cpp
@@ -15,6 +15,7 @@
#include <AzCore/base.h>
#include <AzCore/IO/SystemFile.h>
#include <AzCore/std/containers/fixed_vector.h>
#include <AzCore/std/parallel/thread.h>
#include <AzCore/std/smart_ptr/shared_ptr.h>
@@ -600,8 +600,8 @@ namespace AzToolsFramework
* Open 3D Engine Internal use only.
*
* Run a specific redo command separate from the undo/redo system.
* In many cases before a modifcation on an entity takes place, it is first packaged into
* undo/redo commands. Running the modification's redo command separete from the undo/redo
* In many cases before a modification on an entity takes place, it is first packaged into
* undo/redo commands. Running the modification's redo command separate from the undo/redo
* system simulates its execution, and avoids some code duplication.
*/
virtual void RunRedoSeparately(UndoSystem::URSequencePoint* redoCommand) = 0;
@@ -1781,5 +1781,4 @@ namespace AzToolsFramework
{
appType.m_maskValue = AZ::ApplicationTypeQuery::Masks::Tool;
};
} // namespace AzToolsFramework
@@ -61,7 +61,7 @@ namespace AzToolsFramework
m_prefabUndoCache.Destroy();
}
PrefabOperationResult PrefabPublicHandler::CreatePrefab(const AZStd::vector<AZ::EntityId>& entityIds, AZ::IO::PathView absolutePath)
PrefabOperationResult PrefabPublicHandler::CreatePrefabInMemory(const AZStd::vector<AZ::EntityId>& entityIds, AZ::IO::PathView filePath)
{
EntityList inputEntityList, topLevelEntities;
AZ::EntityId commonRootEntityId;
@@ -73,8 +73,6 @@ namespace AzToolsFramework
return findCommonRootOutcome;
}
AZ_Assert(absolutePath.IsAbsolute(), "CreatePrefab requires an absolute path for saving the initial prefab file.");
InstanceOptionalReference instanceToCreate;
{
// Initialize Undo Batch object
@@ -125,7 +123,7 @@ namespace AzToolsFramework
PrefabDom linkPatchesCopy;
linkPatchesCopy.CopyFrom(linkPatches->get(), linkPatchesCopy.GetAllocator());
nestedInstanceLinkPatchesMap.emplace(nestedInstance, AZStd::move(linkPatchesCopy));
RemoveLink(outInstance, commonRootEntityOwningInstance->get().GetTemplateId(), undoBatch.GetUndoBatch());
instancePtrs.emplace_back(AZStd::move(outInstance));
@@ -139,18 +137,20 @@ namespace AzToolsFramework
if (!prefabEditorEntityOwnershipInterface)
{
return AZ::Failure(AZStd::string("Could not create a new prefab out of the entities provided - internal error "
"(PrefabEditorEntityOwnershipInterface unavailable)."));
"(PrefabEditorEntityOwnershipInterface unavailable)."));
}
// Create the Prefab
AZ_Assert(filePath.IsAbsolute(), "CreatePrefabInMemory requires an absolute file path.");
instanceToCreate = prefabEditorEntityOwnershipInterface->CreatePrefab(
entities, AZStd::move(instancePtrs), m_prefabLoaderInterface->GenerateRelativePath(absolutePath),
entities, AZStd::move(instancePtrs), m_prefabLoaderInterface->GenerateRelativePath(filePath),
commonRootEntityOwningInstance);
if (!instanceToCreate)
{
return AZ::Failure(AZStd::string("Could not create a new prefab out of the entities provided - internal error "
"(A null instance is returned)."));
"(A null instance is returned)."));
}
AZ::EntityId containerEntityId = instanceToCreate->get().GetContainerEntityId();
@@ -218,7 +218,7 @@ namespace AzToolsFramework
linkUpdate.Redo();
}
});
// Create a link between the templates of the newly created instance and the instance it's being parented under.
CreateLink(
instanceToCreate->get(), commonRootEntityOwningInstance->get().GetTemplateId(), undoBatch.GetUndoBatch(),
@@ -255,18 +255,35 @@ namespace AzToolsFramework
// Select Container Entity
{
auto selectionUndo = aznew SelectionCommand({containerEntityId}, "Select Prefab Container Entity");
auto selectionUndo = aznew SelectionCommand({ containerEntityId }, "Select Prefab Container Entity");
selectionUndo->SetParent(undoBatch.GetUndoBatch());
ToolsApplicationRequestBus::Broadcast(&ToolsApplicationRequestBus::Events::RunRedoSeparately, selectionUndo);
}
}
// Save Template to file
m_prefabLoaderInterface->SaveTemplateToFile(instanceToCreate->get().GetTemplateId(), absolutePath);
return AZ::Success();
}
PrefabOperationResult PrefabPublicHandler::CreatePrefabInDisk(const AZStd::vector<AZ::EntityId>& entityIds, AZ::IO::PathView filePath)
{
auto result = CreatePrefabInMemory(entityIds, filePath);
if (result.IsSuccess())
{
// Save Template to file
auto relativePath = m_prefabLoaderInterface->GenerateRelativePath(filePath);
Prefab::TemplateId templateId = m_prefabSystemComponentInterface->GetTemplateIdFromFilePath(relativePath);
if (!m_prefabLoaderInterface->SaveTemplateToFile(templateId, filePath))
{
AZStd::string_view filePathString(filePath);
return AZ::Failure(AZStd::string::format(
"Could not save the newly created prefab to file path %.*s - internal error ",
AZ_STRING_ARG(filePathString)));
}
}
return result;
}
PrefabDom PrefabPublicHandler::ApplyContainerTransformAndGeneratePatch(AZ::EntityId containerEntityId, AZ::EntityId parentEntityId, const EntityList& childEntities)
{
AZ::Entity* containerEntity = GetEntityById(containerEntityId);
@@ -301,7 +318,7 @@ namespace AzToolsFramework
return AZStd::move(patch);
}
PrefabOperationResult PrefabPublicHandler::InstantiatePrefab(
InstantiatePrefabResult PrefabPublicHandler::InstantiatePrefab(
AZStd::string_view filePath, AZ::EntityId parent, const AZ::Vector3& position)
{
auto prefabEditorEntityOwnershipInterface = AZ::Interface<PrefabEditorEntityOwnershipInterface>::Get();
@@ -347,6 +364,7 @@ namespace AzToolsFramework
relativePath.Native().c_str(), instanceToParentUnder->get().GetTemplateSourcePath().Native().c_str()));
}
AZ::EntityId containerEntityId;
{
// Initialize Undo Batch object
ScopedUndoBatch undoBatch("Instantiate Prefab");
@@ -367,7 +385,7 @@ namespace AzToolsFramework
instanceToParentUnder->get(), "Update prefab instance", instanceToParentUnderDomBeforeCreate, undoBatch.GetUndoBatch());
// Create Link with correct container patches
AZ::EntityId containerEntityId = instanceToCreate->get().GetContainerEntityId();
containerEntityId = instanceToCreate->get().GetContainerEntityId();
AZ::Entity* containerEntity = GetEntityById(containerEntityId);
AZ_Assert(containerEntity, "Invalid container entity detected in InstantiatePrefab.");
@@ -394,7 +412,7 @@ namespace AzToolsFramework
&AzToolsFramework::ToolsApplicationRequestBus::Events::ClearDirtyEntities);
}
return AZ::Success();
return AZ::Success(containerEntityId);
}
PrefabOperationResult PrefabPublicHandler::FindCommonRootOwningInstance(
@@ -42,8 +42,11 @@ namespace AzToolsFramework
void UnregisterPrefabPublicHandlerInterface();
// PrefabPublicInterface...
PrefabOperationResult CreatePrefab(const AZStd::vector<AZ::EntityId>& entityIds, AZ::IO::PathView absolutePath) override;
PrefabOperationResult InstantiatePrefab(AZStd::string_view filePath, AZ::EntityId parent, const AZ::Vector3& position) override;
PrefabOperationResult CreatePrefabInDisk(
const AZStd::vector<AZ::EntityId>& entityIds, AZ::IO::PathView filePath) override;
PrefabOperationResult CreatePrefabInMemory(
const AZStd::vector<AZ::EntityId>& entityIds, AZ::IO::PathView filePath) override;
InstantiatePrefabResult InstantiatePrefab(AZStd::string_view filePath, AZ::EntityId parent, const AZ::Vector3& position) override;
PrefabOperationResult SavePrefab(AZ::IO::Path filePath) override;
PrefabEntityResult CreateEntity(AZ::EntityId parentId, const AZ::Vector3& position) override;
@@ -25,6 +25,7 @@ namespace AzToolsFramework
namespace Prefab
{
typedef AZ::Outcome<void, AZStd::string> PrefabOperationResult;
typedef AZ::Outcome<AZ::EntityId, AZStd::string> InstantiatePrefabResult;
typedef AZ::Outcome<bool, AZStd::string> PrefabRequestResult;
typedef AZ::Outcome<AZ::EntityId, AZStd::string> PrefabEntityResult;
@@ -39,22 +40,34 @@ namespace AzToolsFramework
AZ_RTTI(PrefabPublicInterface, "{931AAE9D-C775-4818-9070-A2DA69489CBE}");
/**
* Create a prefab out of the entities provided, at the path provided.
* Create a prefab out of the entities provided, at the path provided, and save it in disk immediately.
* Automatically detects descendants of entities, and discerns between entities and child instances.
* @param entityIds The entities that should form the new prefab (along with their descendants).
* @param filePath The absolute path for the new prefab file.
* @return An outcome object; on failure, it comes with an error message detailing the cause of the error.
*/
virtual PrefabOperationResult CreatePrefab(const AZStd::vector<AZ::EntityId>& entityIds, AZ::IO::PathView absolutePath) = 0;
virtual PrefabOperationResult CreatePrefabInDisk(
const AZStd::vector<AZ::EntityId>& entityIds, AZ::IO::PathView filePath) = 0;
/**
* Create a prefab out of the entities provided, at the path provided, and keep it in memory.
* Automatically detects descendants of entities, and discerns between entities and child instances.
* @param entityIds The entities that should form the new prefab (along with their descendants).
* @param filePath The absolute path for the new prefab file.
* @return An outcome object; on failure, it comes with an error message detailing the cause of the error.
*/
virtual PrefabOperationResult CreatePrefabInMemory(
const AZStd::vector<AZ::EntityId>& entityIds, AZ::IO::PathView filePath) = 0;
/**
* Instantiate a prefab from a prefab file.
* @param filePath The path to the prefab file to instantiate.
* @param parent The entity the prefab should be a child of in the transform hierarchy.
* @param position The position in world space the prefab should be instantiated in.
* @return An outcome object; on failure, it comes with an error message detailing the cause of the error.
* @return An outcome object with an entityId of the new prefab's container entity;
* on failure, it comes with an error message detailing the cause of the error.
*/
virtual PrefabOperationResult InstantiatePrefab(AZStd::string_view filePath, AZ::EntityId parent, const AZ::Vector3& position) = 0;
virtual InstantiatePrefabResult InstantiatePrefab(AZStd::string_view filePath, AZ::EntityId parent, const AZ::Vector3& position) = 0;
/**
* Saves changes to prefab to disk.
@@ -0,0 +1,56 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/Component/EntityId.h>
#include <AzCore/EBus/EBus.h>
#include <AzCore/Math/Vector3.h>
#include <AzCore/std/containers/vector.h>
#include <AzCore/std/string/string_view.h>
namespace AzToolsFramework
{
namespace Prefab
{
/**
* The primary purpose of this bus is to facilitate writing automated tests for prefabs.
* It calls PrefabPublicInterface internally to talk to the prefab system.
* If you would like to integrate prefabs into your system, please call PrefabPublicInterface
* directly for better performance.
*/
class PrefabPublicRequests
: public AZ::EBusTraits
{
public:
using Bus = AZ::EBus<PrefabPublicRequests>;
//////////////////////////////////////////////////////////////////////////
// EBusTraits overrides
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
//////////////////////////////////////////////////////////////////////////
virtual ~PrefabPublicRequests() = default;
/**
* Create a prefab out of the entities provided, at the path provided, and keep it in memory.
* Automatically detects descendants of entities, and discerns between entities and child instances.
*/
virtual bool CreatePrefabInMemory(
const AZStd::vector<AZ::EntityId>& entityIds, AZStd::string_view filePath) = 0;
/**
* Instantiate a prefab from a prefab file.
*/
virtual AZ::EntityId InstantiatePrefab(AZStd::string_view filePath, AZ::EntityId parent, const AZ::Vector3& position) = 0;
};
using PrefabPublicRequestBus = AZ::EBus<PrefabPublicRequests>;
} // namespace Prefab
} // namespace AzToolsFramework
@@ -0,0 +1,79 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <AzToolsFramework/Prefab/PrefabPublicRequestHandler.h>
#include <AzToolsFramework/Prefab/PrefabPublicInterface.h>
namespace AzToolsFramework
{
namespace Prefab
{
void PrefabPublicRequestHandler::Reflect(AZ::ReflectContext* context)
{
AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context);
if (behaviorContext)
{
behaviorContext->EBus<PrefabPublicRequestBus>("PrefabPublicRequestBus")
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation)
->Attribute(AZ::Script::Attributes::Category, "Prefab")
->Attribute(AZ::Script::Attributes::Module, "prefab")
->Event("CreatePrefabInMemory", &PrefabPublicRequests::CreatePrefabInMemory)
->Event("InstantiatePrefab", &PrefabPublicRequests::InstantiatePrefab)
;
}
}
void PrefabPublicRequestHandler::Connect()
{
m_prefabPublicInterface = AZ::Interface<Prefab::PrefabPublicInterface>::Get();
AZ_Assert(m_prefabPublicInterface, "PrefabPublicRequestHandler - Could not retrieve instance of PrefabPublicInterface");
PrefabPublicRequestBus::Handler::BusConnect();
}
void PrefabPublicRequestHandler::Disconnect()
{
PrefabPublicRequestBus::Handler::BusDisconnect();
m_prefabPublicInterface = nullptr;
}
bool PrefabPublicRequestHandler::CreatePrefabInMemory(const AZStd::vector<AZ::EntityId>& entityIds, AZStd::string_view filePath)
{
auto createPrefabOutcome = m_prefabPublicInterface->CreatePrefabInMemory(entityIds, filePath);
if (!createPrefabOutcome.IsSuccess())
{
AZ_Error("CreatePrefabInMemory", false,
"Failed to create Prefab on file path '%.*s'. Error message: %s.",
AZ_STRING_ARG(filePath),
createPrefabOutcome.GetError().c_str());
return false;
}
return true;
}
AZ::EntityId PrefabPublicRequestHandler::InstantiatePrefab(AZStd::string_view filePath, AZ::EntityId parent, const AZ::Vector3& position)
{
auto instantiatePrefabOutcome = m_prefabPublicInterface->InstantiatePrefab(filePath, parent, position);
if (!instantiatePrefabOutcome.IsSuccess())
{
AZ_Error("InstantiatePrefab", false,
"Failed to instantiate Prefab on file path '%.*s'. Error message: %s.",
AZ_STRING_ARG(filePath),
instantiatePrefabOutcome.GetError().c_str());
return AZ::EntityId();
}
return instantiatePrefabOutcome.GetValue();
}
} // namespace Prefab
} // namespace AzToolsFramework
@@ -0,0 +1,41 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/Memory/SystemAllocator.h>
#include <AzCore/RTTI/RTTI.h>
#include <AzToolsFramework/Prefab/PrefabPublicRequestBus.h>
namespace AzToolsFramework
{
namespace Prefab
{
class PrefabPublicInterface;
class PrefabPublicRequestHandler final
: public PrefabPublicRequestBus::Handler
{
public:
AZ_CLASS_ALLOCATOR(PrefabPublicRequestHandler, AZ::SystemAllocator, 0);
AZ_RTTI(PrefabPublicRequestHandler, "{83FBDDF9-10BE-4373-B1DC-44B47EE4805C}");
static void Reflect(AZ::ReflectContext* context);
void Connect();
void Disconnect();
bool CreatePrefabInMemory(const AZStd::vector<AZ::EntityId>& entityIds, AZStd::string_view filePath) override;
AZ::EntityId InstantiatePrefab(AZStd::string_view filePath, AZ::EntityId parent, const AZ::Vector3& position) override;
private:
PrefabPublicInterface* m_prefabPublicInterface = nullptr;
};
} // namespace Prefab
} // namespace AzToolsFramework
@@ -35,12 +35,14 @@ namespace AzToolsFramework
m_instanceUpdateExecutor.RegisterInstanceUpdateExecutorInterface();
m_instanceToTemplatePropagator.RegisterInstanceToTemplateInterface();
m_prefabPublicHandler.RegisterPrefabPublicHandlerInterface();
m_prefabPublicRequestHandler.Connect();
AZ::SystemTickBus::Handler::BusConnect();
}
void PrefabSystemComponent::Deactivate()
{
AZ::SystemTickBus::Handler::BusDisconnect();
m_prefabPublicRequestHandler.Disconnect();
m_prefabPublicHandler.UnregisterPrefabPublicHandlerInterface();
m_instanceToTemplatePropagator.UnregisterInstanceToTemplateInterface();
m_instanceUpdateExecutor.UnregisterInstanceUpdateExecutorInterface();
@@ -54,6 +56,7 @@ namespace AzToolsFramework
AzToolsFramework::Prefab::PrefabConversionUtils::PrefabConversionPipeline::Reflect(context);
AzToolsFramework::Prefab::PrefabConversionUtils::PrefabCatchmentProcessor::Reflect(context);
AzToolsFramework::Prefab::PrefabConversionUtils::EditorInfoRemover::Reflect(context);
PrefabPublicRequestHandler::Reflect(context);
AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context);
if (serialize)
@@ -62,7 +65,6 @@ namespace AzToolsFramework
}
AZ::JsonRegistrationContext* jsonRegistration = azrtti_cast<AZ::JsonRegistrationContext*>(context);
if (jsonRegistration)
{
jsonRegistration->Serializer<JsonInstanceSerializer>()->HandlesType<Instance>();
@@ -24,6 +24,7 @@
#include <AzToolsFramework/Prefab/PrefabIdTypes.h>
#include <AzToolsFramework/Prefab/PrefabLoader.h>
#include <AzToolsFramework/Prefab/PrefabPublicHandler.h>
#include <AzToolsFramework/Prefab/PrefabPublicRequestHandler.h>
#include <AzToolsFramework/Prefab/PrefabSystemComponentInterface.h>
#include <AzToolsFramework/Prefab/Template/Template.h>
@@ -369,6 +370,9 @@ namespace AzToolsFramework
// Used for updating Templates when Instances are modified
InstanceToTemplatePropagator m_instanceToTemplatePropagator;
// Handler of the public Prefab requests
PrefabPublicRequestHandler m_prefabPublicRequestHandler;
};
} // namespace Prefab
} // namespace AzToolsFramework
@@ -256,11 +256,11 @@ namespace AzToolsFramework
void PrefabIntegrationManager::HandleSourceFileType(AZStd::string_view sourceFilePath, AZ::EntityId parentId, AZ::Vector3 position) const
{
auto createPrefabOutcome = s_prefabPublicInterface->InstantiatePrefab(sourceFilePath, parentId, position);
auto instantiatePrefabOutcome = s_prefabPublicInterface->InstantiatePrefab(sourceFilePath, parentId, position);
if (!createPrefabOutcome.IsSuccess())
if (!instantiatePrefabOutcome.IsSuccess())
{
WarnUserOfError("Prefab Instantiation Error", createPrefabOutcome.GetError());
WarnUserOfError("Prefab Instantiation Error", instantiatePrefabOutcome.GetError());
}
}
@@ -348,7 +348,7 @@ namespace AzToolsFramework
}
}
auto createPrefabOutcome = s_prefabPublicInterface->CreatePrefab(selectedEntities, prefabFilePath.data());
auto createPrefabOutcome = s_prefabPublicInterface->CreatePrefabInDisk(selectedEntities, prefabFilePath.data());
if (!createPrefabOutcome.IsSuccess())
{
@@ -657,6 +657,9 @@ set(FILES
Prefab/PrefabPublicHandler.cpp
Prefab/PrefabPublicInterface.h
Prefab/PrefabPublicNotificationBus.h
Prefab/PrefabPublicRequestBus.h
Prefab/PrefabPublicRequestHandler.h
Prefab/PrefabPublicRequestHandler.cpp
Prefab/PrefabUndo.h
Prefab/PrefabUndo.cpp
Prefab/PrefabUndoCache.cpp
@@ -1527,7 +1527,7 @@ namespace GridMate
if (0 != WSAIoctl( m_socket, SIO_GET_MULTIPLE_EXTENSION_FUNCTION_POINTER, &functionTableId,
sizeof(GUID), (void**)&m_RIO_FN_TABLE, sizeof(m_RIO_FN_TABLE), &dwBytes, 0, 0))
{
AZ_Error("GridMate", false, "Could not initialize RIO: %u\n", ::WSAGetLastError());
AZ_Error("GridMate", false, "Could not initialize RIO: %u\n", GridMate::Platform::GetSocketError());
return EC_SOCKET_CREATE;
}
else
@@ -1542,13 +1542,13 @@ namespace GridMate
if ((m_events[WakeupOnSend] = WSACreateEvent()) == WSA_INVALID_EVENT)
{
AZ_Error("GridMate", false, "Failed WSACreateEvent(): %u\n", ::WSAGetLastError());
AZ_Error("GridMate", false, "Failed WSACreateEvent(): %u\n", GridMate::Platform::GetSocketError());
return EC_SOCKET_CREATE;
}
if ((m_events[ReceiveEvent] = WSACreateEvent()) == WSA_INVALID_EVENT)
{
AZ_Error("GridMate", false, "Failed WSACreateEvent(): %u\n", ::WSAGetLastError());
AZ_Error("GridMate", false, "Failed WSACreateEvent(): %u\n", GridMate::Platform::GetSocketError());
return EC_SOCKET_CREATE;
}
RIO_NOTIFICATION_COMPLETION typeRecv;
@@ -1558,13 +1558,13 @@ namespace GridMate
m_RIORecvQueue = m_RIO_FN_TABLE.RIOCreateCompletionQueue(maxOutstandingReceive, &typeRecv);
if (m_RIORecvQueue == RIO_INVALID_CQ)
{
AZ_Error("GridMate", false, "Could not RIOCreateCompletionQueue: %u\n", ::WSAGetLastError());
AZ_Error("GridMate", false, "Could not RIOCreateCompletionQueue: %u\n", GridMate::Platform::GetSocketError());
return EC_SOCKET_CREATE;
}
if ((m_events[SendEvent] = WSACreateEvent()) == WSA_INVALID_EVENT)
{
AZ_Error("GridMate", false, "Failed WSACreateEvent(): %u\n", ::WSAGetLastError());
AZ_Error("GridMate", false, "Failed WSACreateEvent(): %u\n", GridMate::Platform::GetSocketError());
return EC_SOCKET_CREATE;
}
RIO_NOTIFICATION_COMPLETION typeSend;
@@ -1574,7 +1574,7 @@ namespace GridMate
m_RIOSendQueue = m_RIO_FN_TABLE.RIOCreateCompletionQueue(maxOutstandingSend, &typeSend);
if (m_RIOSendQueue == RIO_INVALID_CQ)
{
AZ_Error("GridMate", false, "Could not RIOCreateCompletionQueue: %u\n", ::WSAGetLastError());
AZ_Error("GridMate", false, "Could not RIOCreateCompletionQueue: %u\n", GridMate::Platform::GetSocketError());
return EC_SOCKET_CREATE;
}
@@ -1582,7 +1582,7 @@ namespace GridMate
maxReceiveDataBuffers, maxOutstandingSend, maxSendDataBuffers, m_RIORecvQueue, m_RIOSendQueue, pContext);
if (m_requestQueue == RIO_INVALID_RQ)
{
AZ_Error("GridMate", m_requestQueue != NULL, "Could not RIOCreateRequestQueue: %u\n", ::WSAGetLastError());
AZ_Error("GridMate", m_requestQueue != NULL, "Could not RIOCreateRequestQueue: %u\n", GridMate::Platform::GetSocketError());
return EC_SOCKET_CREATE;
}
@@ -1595,24 +1595,24 @@ namespace GridMate
//Setup Recv raw buffer and RIO record
if (nullptr == (m_rawRecvBuffer = AllocRIOBuffer(bufferSize, m_RIORecvBufferCount, &recvAllocated)))
{
AZ_Error("GridMate", false, "Could not allocate buffer: %u\n", ::WSAGetLastError());
AZ_Error("GridMate", false, "Could not allocate buffer: %u\n", GridMate::Platform::GetSocketError());
return EC_SOCKET_CREATE;
}
if (RIO_INVALID_BUFFERID == (recvBufferId = m_RIO_FN_TABLE.RIORegisterBuffer(m_rawRecvBuffer, bufferSize * m_RIORecvBufferCount)))
{
AZ_Error("GridMate", false, "Could not register buffer: %u\n", ::WSAGetLastError());
AZ_Error("GridMate", false, "Could not register buffer: %u\n", GridMate::Platform::GetSocketError());
return EC_SOCKET_CREATE;
}
//Setup Recv address raw buffer and RIO record
if (nullptr == (m_rawRecvAddressBuffer = AllocRIOBuffer(sizeof(SOCKADDR_INET), m_RIORecvBufferCount, &recvAddrsAllocated)))
{
AZ_Error("GridMate", false, "Could not allocate buffer: %u\n", ::WSAGetLastError());
AZ_Error("GridMate", false, "Could not allocate buffer: %u\n", GridMate::Platform::GetSocketError());
return EC_SOCKET_CREATE;
}
if (RIO_INVALID_BUFFERID == (recvAddressBufferId = m_RIO_FN_TABLE.RIORegisterBuffer(m_rawRecvAddressBuffer, sizeof(SOCKADDR_INET) * m_RIORecvBufferCount)))
{
AZ_Error("GridMate", false, "Could not register buffer: %u\n", ::WSAGetLastError());
AZ_Error("GridMate", false, "Could not register buffer: %u\n", GridMate::Platform::GetSocketError());
return EC_SOCKET_CREATE;
}
@@ -1639,7 +1639,7 @@ namespace GridMate
//Start Receive Handler
if (false == m_RIO_FN_TABLE.RIOReceiveEx(m_requestQueue, &m_RIORecvBuffer[i], 1, NULL, &m_RIORecvAddressBuffer[i], NULL, NULL, 0, pBuffer))
{
AZ_Error("GridMate", false, "Could not RIOReceive: %u\n", ::WSAGetLastError());
AZ_Error("GridMate", false, "Could not RIOReceive: %u\n", GridMate::Platform::GetSocketError());
return EC_SOCKET_CREATE;
}
}
@@ -1649,25 +1649,25 @@ namespace GridMate
//setup send raw buffer and RIO record
if (nullptr == (m_rawSendBuffer = AllocRIOBuffer(bufferSize, m_RIOSendBufferCount, &sendAllocated)))
{
AZ_Error("GridMate", false, "Could not allocate buffer: %u", ::WSAGetLastError());
AZ_Error("GridMate", false, "Could not allocate buffer: %u", GridMate::Platform::GetSocketError());
return EC_SOCKET_CREATE;
}
if (RIO_INVALID_BUFFERID == (sendBufferId = m_RIO_FN_TABLE.RIORegisterBuffer(m_rawSendBuffer, m_RIOSendBufferCount * bufferSize)))
{
AZ_Error("GridMate", false, "Could not register buffer: %u\n", ::WSAGetLastError());
AZ_Error("GridMate", false, "Could not register buffer: %u\n", GridMate::Platform::GetSocketError());
return EC_SOCKET_CREATE;
}
//setup send address raw buffer and RIO record
if (nullptr == (m_rawSendAddressBuffer = AllocRIOBuffer(sizeof(SOCKADDR_INET), m_RIOSendBufferCount, &sendAddrsAllocated)))
{
AZ_Error("GridMate", false, "Could not allocate send address buffer: %u\n", ::WSAGetLastError());
AZ_Error("GridMate", false, "Could not allocate send address buffer: %u\n", GridMate::Platform::GetSocketError());
return EC_SOCKET_CREATE;
}
if (RIO_INVALID_BUFFERID == (sendAddressBufferId = m_RIO_FN_TABLE.RIORegisterBuffer(m_rawSendAddressBuffer, m_RIOSendBufferCount * sizeof(SOCKADDR_INET))))
{
AZ_Error("GridMate", false, "Could not register buffer: %u\n", ::WSAGetLastError());
AZ_Error("GridMate", false, "Could not register buffer: %u\n", GridMate::Platform::GetSocketError());
return EC_SOCKET_CREATE;
}
@@ -1725,7 +1725,7 @@ namespace GridMate
if (!m_RIO_FN_TABLE.RIOSendEx(m_requestQueue, &m_RIOSendBuffer[m_workerNextSendBuffer],
bufferCount, NULL, &m_RIOSendAddressBuffer[m_workerNextSendBuffer], NULL, NULL, 0, 0))
{
const DWORD lastError = ::WSAGetLastError();
const DWORD lastError = GridMate::Platform::GetSocketError();
if (lastError == WSAENOBUFS)
{
continue; //spin until free
@@ -1835,7 +1835,7 @@ namespace GridMate
if (false == m_RIO_FN_TABLE.RIOReceiveEx(m_requestQueue, &m_RIORecvBuffer[m_RIONextRecvBuffer],
bufferCount, NULL, &m_RIORecvAddressBuffer[m_RIONextRecvBuffer], NULL, NULL, 0, 0))
{
AZ_Error("GridMate", false, "Could not RIOReceive: %u\n", ::WSAGetLastError());
AZ_Error("GridMate", false, "Could not RIOReceive: %u\n", GridMate::Platform::GetSocketError());
}
if (recvd)
@@ -1866,7 +1866,7 @@ namespace GridMate
{
if (!WSAResetEvent(m_events[Index - WSA_WAIT_EVENT_0]))
{
AZ_Assert(false, "WSAResetEvent failed with error = %d\n", ::WSAGetLastError());
AZ_Assert(false, "WSAResetEvent failed with error = %d\n", GridMate::Platform::GetSocketError());
}
};
@@ -1925,7 +1925,7 @@ namespace GridMate
}
else if (isFailed(Index))
{
AZ_Assert(false, "WSAWaitForMultipleEvents failed with error = %d\n", ::WSAGetLastError());
AZ_Assert(false, "WSAWaitForMultipleEvents failed with error = %d\n", GridMate::Platform::GetSocketError());
return false;
}
else
@@ -1944,7 +1944,7 @@ namespace GridMate
{
if (!SetEvent(m_events[WakeupOnSend])) //Wake thread
{
AZ_Assert(false, "SetEvent failed with error = %d\n", ::WSAGetLastError());
AZ_Assert(false, "SetEvent failed with error = %d\n", GridMate::Platform::GetSocketError());
}
}
@@ -10,6 +10,7 @@
#include <AzCore/Debug/StackTracer.h>
#include <AzCore/IO/SystemFile.h> // for AZ_MAX_PATH_LEN
#include <AzCore/Math/Vector2.h>
#include <CryLibrary.h>
-14
View File
@@ -30,16 +30,6 @@
#define MOBILE
#endif
// Force all allocations to be aligned to TARGET_DEFAULT_ALIGN.
// This is because malloc on Android 32 bit returns memory that is not aligned
// to what some structs/classes need.
#define CRY_FORCE_MALLOC_NEW_ALIGN
#define DEBUG_BREAK raise(SIGTRAP)
#define RC_EXECUTABLE "rc"
#define USE_CRT 1
#define SIZEOF_PTR 4
//////////////////////////////////////////////////////////////////////////
// Standard includes.
//////////////////////////////////////////////////////////////////////////
@@ -121,10 +111,6 @@ typedef unsigned char byte;
#define DEFINE_ALIGNED_DATA(type, name, alignment) \
type __attribute__ ((aligned(alignment))) name;
#define DEFINE_ALIGNED_DATA_STATIC(type, name, alignment) \
static type __attribute__ ((aligned(alignment))) name;
#define DEFINE_ALIGNED_DATA_CONST(type, name, alignment) \
const type __attribute__ ((aligned(alignment))) name;
#include "LinuxSpecific.h"
// these functions do not exist int the wchar.h header
-78
View File
@@ -17,10 +17,6 @@
#pragma diagnostic ignore "-W#pragma-messages"
#endif
#define DEBUG_BREAK __builtin_trap()
#define RC_EXECUTABLE "rc"
//////////////////////////////////////////////////////////////////////////
// Standard includes.
//////////////////////////////////////////////////////////////////////////
@@ -52,12 +48,6 @@
#define __COUNTER__ __LINE__
#endif
#ifdef __FUNC__
#undef __FUNC__
#endif
#define __FUNC__ __func__
typedef void* LPVOID;
#define VOID void
#define PVOID void*
@@ -262,10 +252,6 @@ typedef uint64 __uint64;
#define DEFINE_ALIGNED_DATA(type, name, alignment) \
type __attribute__ ((aligned(alignment))) name;
#define DEFINE_ALIGNED_DATA_STATIC(type, name, alignment) \
static type __attribute__ ((aligned(alignment))) name;
#define DEFINE_ALIGNED_DATA_CONST(type, name, alignment) \
const type __attribute__ ((aligned(alignment))) name;
#define BST_UNCHECKED 0x0000
@@ -298,17 +284,6 @@ enum
IDCONTINUE = 11
};
#define ES_MULTILINE 0x0004L
#define ES_AUTOVSCROLL 0x0040L
#define ES_AUTOHSCROLL 0x0080L
#define ES_WANTRETURN 0x1000L
#define LB_ERR (-1)
#define LB_ADDSTRING 0x0180
#define LB_GETCOUNT 0x018B
#define LB_SETTOPINDEX 0x0197
#define MB_OK 0x00000000L
#define MB_OKCANCEL 0x00000001L
#define MB_ABORTRETRYIGNORE 0x00000002L
@@ -328,22 +303,16 @@ enum
#define MB_APPLMODAL 0x00000000L
#define MF_STRING 0x00000000L
#define MK_LBUTTON 0x0001
#define MK_RBUTTON 0x0002
#define MK_SHIFT 0x0004
#define MK_CONTROL 0x0008
#define MK_MBUTTON 0x0010
#define MK_ALT ( 0x20 )
#define SM_MOUSEPRESENT 0x00000000L
#define SM_CMOUSEBUTTONS 43
#define USER_TIMER_MINIMUM 0x0000000A
#define VK_TAB 0x09
#define VK_SHIFT 0x10
#define VK_MENU 0x12
@@ -351,11 +320,6 @@ enum
#define VK_SPACE 0x20
#define VK_DELETE 0x2E
#define VK_NUMPAD1 0x61
#define VK_NUMPAD2 0x62
#define VK_NUMPAD3 0x63
#define VK_NUMPAD4 0x64
#define VK_OEM_COMMA 0xBC // ',' any country
#define VK_OEM_PERIOD 0xBE // '.' any country
#define VK_OEM_3 0xC0 // '`~' for US
@@ -386,13 +350,9 @@ enum
#define wcsnicmp wcsncasecmp
//#define memcpy_s(dest,bytes,src,n) memcpy(dest,src,n)
#define _isnan ISNAN
#define _wtof(str) wcstod(str, 0)
#define TARGET_DEFAULT_ALIGN (0x8U)
#define _msize malloc_size
@@ -498,36 +458,6 @@ typedef HANDLE HMENU;
#endif //__cplusplus
inline char* _fullpath(char* absPath, const char* relPath, size_t maxLength)
{
char path[PATH_MAX];
if (realpath(relPath, path) == NULL)
{
return NULL;
}
const size_t len = std::min(strlen(path), maxLength - 1);
memcpy(absPath, path, len);
absPath[len] = 0;
return absPath;
}
typedef union _LARGE_INTEGER
{
struct
{
DWORD LowPart;
LONG HighPart;
};
struct
{
DWORD LowPart;
LONG HighPart;
} u;
long long QuadPart;
} LARGE_INTEGER;
extern bool QueryPerformanceCounter(LARGE_INTEGER*);
extern bool QueryPerformanceFrequency(LARGE_INTEGER* frequency);
@@ -568,14 +498,6 @@ inline int closesocket(int s)
return ::close(s);
}
inline int WSAGetLastError()
{
return errno;
}
//we take the definition of the pthread_t type directly from the pthread file
#define THREADID_NULL 0
template <typename T, size_t N>
char (*RtlpNumberOf( T (&)[N] ))[N];
+22 -25
View File
@@ -11,12 +11,9 @@
#define CRYINCLUDE_CRYCOMMON_BASETYPES_H
#pragma once
#include "CompileTimeAssert.h"
COMPILE_TIME_ASSERT(sizeof(char) == 1);
COMPILE_TIME_ASSERT(sizeof(float) == 4);
COMPILE_TIME_ASSERT(sizeof(int) >= 4);
static_assert(sizeof(char) == 1);
static_assert(sizeof(float) == 4);
static_assert(sizeof(int) >= 4);
typedef unsigned char uchar;
@@ -36,35 +33,35 @@ typedef signed long slong;
typedef unsigned long long ulonglong;
typedef signed long long slonglong;
COMPILE_TIME_ASSERT(sizeof(uchar) == sizeof(schar));
COMPILE_TIME_ASSERT(sizeof(ushort) == sizeof(sshort));
COMPILE_TIME_ASSERT(sizeof(uint) == sizeof(sint));
COMPILE_TIME_ASSERT(sizeof(ulong) == sizeof(slong));
COMPILE_TIME_ASSERT(sizeof(ulonglong) == sizeof(slonglong));
static_assert(sizeof(uchar) == sizeof(schar));
static_assert(sizeof(ushort) == sizeof(sshort));
static_assert(sizeof(uint) == sizeof(sint));
static_assert(sizeof(ulong) == sizeof(slong));
static_assert(sizeof(ulonglong) == sizeof(slonglong));
COMPILE_TIME_ASSERT(sizeof(uchar) <= sizeof(ushort));
COMPILE_TIME_ASSERT(sizeof(ushort) <= sizeof(uint));
COMPILE_TIME_ASSERT(sizeof(uint) <= sizeof(ulong));
COMPILE_TIME_ASSERT(sizeof(ulong) <= sizeof(ulonglong));
static_assert(sizeof(uchar) <= sizeof(ushort));
static_assert(sizeof(ushort) <= sizeof(uint));
static_assert(sizeof(uint) <= sizeof(ulong));
static_assert(sizeof(ulong) <= sizeof(ulonglong));
typedef schar int8;
typedef schar sint8;
typedef uchar uint8;
COMPILE_TIME_ASSERT(sizeof(uint8) == 1);
COMPILE_TIME_ASSERT(sizeof(sint8) == 1);
static_assert(sizeof(uint8) == 1);
static_assert(sizeof(sint8) == 1);
typedef sshort int16;
typedef sshort sint16;
typedef ushort uint16;
COMPILE_TIME_ASSERT(sizeof(uint16) == 2);
COMPILE_TIME_ASSERT(sizeof(sint16) == 2);
static_assert(sizeof(uint16) == 2);
static_assert(sizeof(sint16) == 2);
typedef sint int32;
typedef sint sint32;
typedef uint uint32;
COMPILE_TIME_ASSERT(sizeof(uint32) == 4);
COMPILE_TIME_ASSERT(sizeof(sint32) == 4);
static_assert(sizeof(uint32) == 4);
static_assert(sizeof(sint32) == 4);
typedef slonglong int64;
@@ -72,14 +69,14 @@ typedef slonglong int64;
#define O3DE_INT64_DEFINED
typedef slonglong sint64;
typedef ulonglong uint64;
COMPILE_TIME_ASSERT(sizeof(uint64) == 8);
COMPILE_TIME_ASSERT(sizeof(sint64) == 8);
static_assert(sizeof(uint64) == 8);
static_assert(sizeof(sint64) == 8);
#endif
typedef float f32;
typedef double f64;
COMPILE_TIME_ASSERT(sizeof(f32) == 4);
COMPILE_TIME_ASSERT(sizeof(f64) == 8);
static_assert(sizeof(f32) == 4);
static_assert(sizeof(f64) == 8);
#endif // CRYINCLUDE_CRYCOMMON_BASETYPES_H
-51
View File
@@ -12,7 +12,6 @@
#pragma once
#include "CompileTimeAssert.h"
#include <AzCore/Casting/numeric_cast.h>
// Section dictionary
@@ -36,7 +35,6 @@ ILINE uint32 countLeadingZeros32(uint32 x)
{
DWORD result = 32 ^ 31; // assumes result is unmodified if _BitScanReverse returns 0
_BitScanReverse(&result, x);
PREFAST_SUPPRESS_WARNING(6102);
result ^= 31; // needed because the index is from LSB (whereas all other implementations are from MSB)
return result;
}
@@ -73,16 +71,6 @@ inline bool IsPowerOfTwo(TInteger x)
return (x & (x - 1)) == 0;
}
// compile time version of IsPowerOfTwo, useful for STATIC_CHECK
template <int nValue>
struct IsPowerOfTwoCompileTime
{
enum
{
IsPowerOfTwo = ((nValue & (nValue - 1)) == 0)
};
};
inline uint32 NextPower2(uint32 n)
{
n--;
@@ -199,45 +187,6 @@ ILINE int32 Isel32(int32 v, int32 alt)
return ((static_cast<int32>(v) >> 31) & alt) | ((static_cast<int32>(~v) >> 31) & v);
}
template <uint32 ILOG>
struct CompileTimeIntegerLog2
{
static const uint32 result = 1 + CompileTimeIntegerLog2<(ILOG >> 1)>::result;
};
template <>
struct CompileTimeIntegerLog2<1>
{
static const uint32 result = 0;
};
template <>
struct CompileTimeIntegerLog2<0>; // keep it undefined, we cannot represent "minus infinity" result
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2<1>::result == 0);
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2<2>::result == 1);
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2<3>::result == 1);
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2<4>::result == 2);
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2<5>::result == 2);
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2<255>::result == 7);
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2<256>::result == 8);
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2<257>::result == 8);
template <uint32 ILOG>
struct CompileTimeIntegerLog2_RoundUp
{
static const uint32 result = CompileTimeIntegerLog2<ILOG>::result + ((ILOG & (ILOG - 1)) != 0);
};
template <>
struct CompileTimeIntegerLog2_RoundUp<0>; // we can return 0, but let's keep it undefined (same as CompileTimeIntegerLog2<0>)
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2_RoundUp<1>::result == 0);
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2_RoundUp<2>::result == 1);
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2_RoundUp<3>::result == 2);
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2_RoundUp<4>::result == 2);
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2_RoundUp<5>::result == 3);
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2_RoundUp<255>::result == 8);
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2_RoundUp<256>::result == 8);
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2_RoundUp<257>::result == 9);
// Character-to-bitfield mapping
inline uint32 AlphaBit(char c)
-56
View File
@@ -1,56 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
// Inspired by the Boost library's BOOST_STATIC_ASSERT(),
// see http://www.boost.org/doc/libs/1_49_0/doc/html/boost_staticassert/how.html
// or http://www.boost.org/libs/static_assert
#ifndef CRYINCLUDE_CRYCOMMON_COMPILETIMEASSERT_H
#define CRYINCLUDE_CRYCOMMON_COMPILETIMEASSERT_H
#pragma once
#if defined(__cplusplus)
/*
template <bool b>
struct COMPILE_TIME_ASSERT_FAIL;
template <>
struct COMPILE_TIME_ASSERT_FAIL<true>
{
};
template <int i>
struct COMPILE_TIME_ASSERT_TEST
{
enum { dummy = i };
};
#define COMPILE_TIME_ASSERT_BUILD_NAME2(x, y) x##y
#define COMPILE_TIME_ASSERT_BUILD_NAME1(x, y) COMPILE_TIME_ASSERT_BUILD_NAME2(x, y)
#define COMPILE_TIME_ASSERT_BUILD_NAME(x, y) COMPILE_TIME_ASSERT_BUILD_NAME1(x, y)
#ifndef __RECODE__
#define COMPILE_TIME_ASSERT(expr) \
typedef COMPILE_TIME_ASSERT_TEST<sizeof(COMPILE_TIME_ASSERT_FAIL<(bool)(expr)>)> \
COMPILE_TIME_ASSERT_BUILD_NAME(compile_time_assert_test_, __LINE__)
// note: for MS Visual Studio we could use __COUNTER__ instead of __LINE__
#else
#define COMPILE_TIME_ASSERT(expr)
#endif // __RECODE__
#else
#define COMPILE_TIME_ASSERT(expr)
*/
#endif
#define COMPILE_TIME_ASSERT_MSG(expr, msg) static_assert(expr, msg)
#define COMPILE_TIME_ASSERT(expr) COMPILE_TIME_ASSERT_MSG(expr, "Compile Time Assert")
#endif // CRYINCLUDE_CRYCOMMON_COMPILETIMEASSERT_H
+3 -17
View File
@@ -16,24 +16,10 @@
//---------------------------------------------------------------------------
// Convenient iteration macros
#define for_iter(IT, it, b, e) for (IT it = (b), _e = (e); it != _e; ++it)
#define for_container(CT, it, cont) for_iter (CT::iterator, it, (cont).begin(), (cont).end())
#define for_ptr(T, it, b, e) for (T* it = (b), * _e = (e); it != _e; ++it)
#define for_array_ptr(T, it, arr) for_ptr (T, it, (arr).begin(), (arr).end())
#define for_array(i, arr) for (int i = 0, _e = (arr).size(); i < _e; i++)
#define for_all(cont) for_array (_i, cont) cont[_i]
//---------------------------------------------------------------------------
// Stack array helper
#define ALIGNED_STACK_ARRAY(T, name, size, alignment) \
PREFAST_SUPPRESS_WARNING(6255) \
T * name = (T*) alloca((size) * sizeof(T) + alignment - 1); \
name = Align(name, alignment);
#define STACK_ARRAY(T, name, size) \
ALIGNED_STACK_ARRAY(T, name, size, alignof(T)) \
#define for_array_ptr(T, it, arr) for_ptr (T, it, (arr).begin(), (arr).end())
#define for_array(i, arr) for (int i = 0, _e = (arr).size(); i < _e; i++)
//---------------------------------------------------------------------------
// Specify semantics for moving objects.
@@ -774,7 +760,7 @@ namespace NArray
AP& allocator()
{
COMPILE_TIME_ASSERT(sizeof(AP) == sizeof(A));
static_assert(sizeof(AP) == sizeof(A));
return *(AP*)this;
}
const AP& allocator() const
+1 -2
View File
@@ -71,7 +71,6 @@
#if defined(USE_CRY_ASSERT) && CRYASSERT_H_TRAIT_USE_CRY_ASSERT_MESSAGE
void CryAssertTrace(const char*, ...);
bool CryAssert(const char*, const char*, unsigned int, bool*);
void CryDebugBreak();
#define CRY_ASSERT(condition) CRY_ASSERT_MESSAGE(condition, NULL)
@@ -86,7 +85,7 @@ void CryDebugBreak();
CryAssertTrace parenthese_message; \
if (CryAssert(#condition, __FILE__, __LINE__, &s_bIgnoreAssert)) \
{ \
DEBUG_BREAK; \
AZ::Debug::Trace::Break(); \
} \
} \
} while (0)
+2 -2
View File
@@ -708,8 +708,8 @@ protected:
static inline S FromFloat(float fIn)
{
COMPILE_TIME_ASSERT(sizeof(S) <= 4);
COMPILE_TIME_ASSERT(nEXP_BITS > 0 && nEXP_BITS <= 8 && nEXP_BITS < sizeof(S) * 8 - 4);
static_assert(sizeof(S) <= 4);
static_assert(nEXP_BITS > 0 && nEXP_BITS <= 8 && nEXP_BITS < sizeof(S) * 8 - 4);
// Clamp to allowed range.
float fClamped = clamp_tpl(fIn * fROUNDER(), fMIN(), fMAX());
+1 -1
View File
@@ -17,7 +17,7 @@
#ifdef MAX_SUB_MATERIALS
// This checks that the values are in sync in the different files.
COMPILE_TIME_ASSERT(MAX_SUB_MATERIALS == 128);
static_assert(MAX_SUB_MATERIALS == 128);
#else
#define MAX_SUB_MATERIALS 128
#endif
-1
View File
@@ -63,7 +63,6 @@ using DetachEnvironmentFunction = void(*)();
#if !defined(WIN32_LEAN_AND_MEAN)
#define WIN32_LEAN_AND_MEAN
#endif
#include <CryWindows.h>
HMODULE CryLoadLibrary(const char* libName);
+13 -14
View File
@@ -13,7 +13,6 @@
#include <limits> // std::numeric_limits
#include <type_traits> // std::make_unsigned
#include "BaseTypes.h" // uint32, uint64
#include "CompileTimeAssert.h"
#include "Cry_Vector2.h"
#include "Cry_Vector3.h"
#include "Cry_Vector4.h"
@@ -24,10 +23,10 @@ namespace CryRandom_Internal
template <class R, class T, size_t size>
struct BoundedRandomUint
{
COMPILE_TIME_ASSERT(std::numeric_limits<T>::is_integer);
COMPILE_TIME_ASSERT(!std::numeric_limits<T>::is_signed);
COMPILE_TIME_ASSERT(sizeof(T) == size);
COMPILE_TIME_ASSERT(sizeof(T) <= sizeof(uint32));
static_assert(std::numeric_limits<T>::is_integer);
static_assert(!std::numeric_limits<T>::is_signed);
static_assert(sizeof(T) == size);
static_assert(sizeof(T) <= sizeof(uint32));
inline static T Get(R& randomGenerator, const T maxValue)
{
@@ -41,9 +40,9 @@ namespace CryRandom_Internal
template <class R, class T>
struct BoundedRandomUint<R, T, 8>
{
COMPILE_TIME_ASSERT(std::numeric_limits<T>::is_integer);
COMPILE_TIME_ASSERT(!std::numeric_limits<T>::is_signed);
COMPILE_TIME_ASSERT(sizeof(T) == sizeof(uint64));
static_assert(std::numeric_limits<T>::is_integer);
static_assert(!std::numeric_limits<T>::is_signed);
static_assert(sizeof(T) == sizeof(uint64));
inline static T Get(R& randomGenerator, const T maxValue)
{
@@ -65,11 +64,11 @@ namespace CryRandom_Internal
template <class R, class T>
struct BoundedRandom<R, T, true>
{
COMPILE_TIME_ASSERT(std::numeric_limits<T>::is_integer);
static_assert(std::numeric_limits<T>::is_integer);
typedef typename std::make_unsigned<T>::type UT;
COMPILE_TIME_ASSERT(sizeof(T) == sizeof(UT));
COMPILE_TIME_ASSERT(std::numeric_limits<UT>::is_integer);
COMPILE_TIME_ASSERT(!std::numeric_limits<UT>::is_signed);
static_assert(sizeof(T) == sizeof(UT));
static_assert(std::numeric_limits<UT>::is_integer);
static_assert(!std::numeric_limits<UT>::is_signed);
inline static T Get(R& randomGenerator, T minValue, T maxValue)
{
@@ -84,7 +83,7 @@ namespace CryRandom_Internal
template <class R, class T>
struct BoundedRandom<R, T, false>
{
COMPILE_TIME_ASSERT(!std::numeric_limits<T>::is_integer);
static_assert(!std::numeric_limits<T>::is_integer);
inline static T Get(R& randomGenerator, const T minValue, const T maxValue)
{
@@ -139,7 +138,7 @@ namespace CryRandom_Internal
inline VT GetRandomUnitVector(R& randomGenerator)
{
typedef typename VT::value_type T;
COMPILE_TIME_ASSERT(!std::numeric_limits<T>::is_integer);
static_assert(!std::numeric_limits<T>::is_integer);
VT res;
T lenSquared;
+3 -2
View File
@@ -30,6 +30,7 @@
#include <Cry_Quat.h>
#include <Cry_Color.h>
#include <smartptr.h>
#include <AzCore/std/smart_ptr/shared_ptr.h>
// forward declarations for overloads
struct AABB;
@@ -579,7 +580,7 @@ protected:
// use this to push (and automatically pop) the sizer component name at the beginning of the
// getSize() function
#define SIZER_COMPONENT_NAME(pSizerPointer, szComponentName) PREFAST_SUPPRESS_WARNING(6246) CrySizerComponentNameHelper AZ_JOIN(sizerHelper, __LINE__)(pSizerPointer, szComponentName, false)
#define SIZER_SUBCOMPONENT_NAME(pSizerPointer, szComponentName) PREFAST_SUPPRESS_WARNING(6246) CrySizerComponentNameHelper AZ_JOIN(sizerHelper, __LINE__)(pSizerPointer, szComponentName, true)
#define SIZER_COMPONENT_NAME(pSizerPointer, szComponentName) CrySizerComponentNameHelper AZ_JOIN(sizerHelper, __LINE__)(pSizerPointer, szComponentName, false)
#define SIZER_SUBCOMPONENT_NAME(pSizerPointer, szComponentName) CrySizerComponentNameHelper AZ_JOIN(sizerHelper, __LINE__)(pSizerPointer, szComponentName, true)
#endif // CRYINCLUDE_CRYCOMMON_CRYSIZER_H
@@ -14,13 +14,7 @@
#include "CryThread_pthreads.h"
#if PLATFORM_SUPPORTS_THREADLOCAL
THREADLOCAL CrySimpleThreadSelf
* CrySimpleThreadSelf::m_Self = NULL;
#else
TLS_DEFINE(CrySimpleThreadSelf*, g_CrySimpleThreadSelf)
#endif
AZ_THREAD_LOCAL CrySimpleThreadSelf* CrySimpleThreadSelf::m_Self = NULL;
//////////////////////////////////////////////////////////////////////////
// CryEvent(Timed) implementation
@@ -20,7 +20,7 @@ struct SThreadNameDesc
DWORD dwFlags;
};
THREADLOCAL CrySimpleThreadSelf* CrySimpleThreadSelf::m_Self = NULL;
AZ_THREAD_LOCAL CrySimpleThreadSelf* CrySimpleThreadSelf::m_Self = NULL;
//////////////////////////////////////////////////////////////////////////
CryEvent::CryEvent()
+1 -21
View File
@@ -653,15 +653,9 @@ private:
typedef CryEventTimed CryEvent;
#if !PLATFORM_SUPPORTS_THREADLOCAL
TLS_DECLARE(class CrySimpleThreadSelf*, g_CrySimpleThreadSelf);
#endif
class CrySimpleThreadSelf
{
protected:
#if PLATFORM_SUPPORTS_THREADLOCAL
static CrySimpleThreadSelf* GetSelf()
{
return m_Self;
@@ -672,21 +666,7 @@ protected:
m_Self = pSelf;
}
private:
static THREADLOCAL CrySimpleThreadSelf* m_Self;
#else
static CrySimpleThreadSelf* GetSelf()
{
return TLS_GET(CrySimpleThreadSelf*, g_CrySimpleThreadSelf);
}
static void SetSelf(CrySimpleThreadSelf* pSelf)
{
TLS_SET(g_CrySimpleThreadSelf, pSelf);
}
#endif
static AZ_THREAD_LOCAL CrySimpleThreadSelf* m_Self;
};
template<class Runnable>
+1 -1
View File
@@ -189,7 +189,7 @@ public:
virtual ~CrySimpleThreadSelf();
protected:
void StartThread(unsigned (__stdcall * func)(void*), void* argList);
static THREADLOCAL CrySimpleThreadSelf* m_Self;
static AZ_THREAD_LOCAL CrySimpleThreadSelf* m_Self;
private:
CrySimpleThreadSelf(const CrySimpleThreadSelf&);
CrySimpleThreadSelf& operator = (const CrySimpleThreadSelf&);
-19
View File
@@ -1,19 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
// Description : Specific header to handle Windows.h include
#ifndef CRYINCLUDE_CRYCOMMON_CRYWINDOWS_H
#define CRYINCLUDE_CRYCOMMON_CRYWINDOWS_H
#pragma once
#include <AzCore/PlatformIncl.h>
#endif // CRYINCLUDE_CRYCOMMON_CRYWINDOWS_H
+1
View File
@@ -14,6 +14,7 @@
#define CRYINCLUDE_CRYCOMMON_IFUNCTORBASE_H
#pragma once
#include <CryCommon/CryThread.h>
// Base class for functor storage.
// Not intended for direct usage.
+2 -1
View File
@@ -37,10 +37,11 @@ struct IRenderMesh;
#include <IXml.h>
#include <smartptr.h>
#include <AzCore/EBus/EBus.h>
#include <CryThread.h>
#ifdef MAX_SUB_MATERIALS
// This checks that the values are in sync in the different files.
COMPILE_TIME_ASSERT(MAX_SUB_MATERIALS == 128);
static_assert(MAX_SUB_MATERIALS == 128);
#else
#define MAX_SUB_MATERIALS 128
#endif
+42 -43
View File
@@ -24,7 +24,6 @@
#endif
#include "CryAssert.h"
#include "CompileTimeAssert.h"
#include <AzCore/IO/SystemFile.h>
@@ -1416,7 +1415,7 @@ namespace Detail
} DummyStaticInstance; \
if (!(gEnv->pConsole != 0 ? gEnv->pConsole->Register(&DummyStaticInstance) : 0)) \
{ \
DEBUG_BREAK; \
AZ::Debug::Trace::Break(); \
CryFatalError("Can not register dummy CVar"); \
} \
} while (0)
@@ -1425,10 +1424,10 @@ namespace Detail
# define DeclareConstIntCVar(name, defaultValue) enum : int { name = (defaultValue) }
# define DeclareStaticConstIntCVar(name, defaultValue) enum : int { name = (defaultValue) }
# define DefineConstIntCVarName(strname, name, defaultValue, flags, help) { COMPILE_TIME_ASSERT((int)(defaultValue) == (int)(name)); REGISTER_DUMMY_CVAR(int, strname, defaultValue); }
# define DefineConstIntCVar(name, defaultValue, flags, help) { COMPILE_TIME_ASSERT((int)(defaultValue) == (int)(name)); REGISTER_DUMMY_CVAR(int, (#name), defaultValue); }
# define DefineConstIntCVarName(strname, name, defaultValue, flags, help) { static_assert((int)(defaultValue) == (int)(name)); REGISTER_DUMMY_CVAR(int, strname, defaultValue); }
# define DefineConstIntCVar(name, defaultValue, flags, help) { static_assert((int)(defaultValue) == (int)(name)); REGISTER_DUMMY_CVAR(int, (#name), defaultValue); }
// DefineConstIntCVar2 is deprecated, any such instance can be converted to the 3 variant by removing the quotes around the first parameter
# define DefineConstIntCVar3(name, _var_, defaultValue, flags, help) { COMPILE_TIME_ASSERT((int)(defaultValue) == (int)(_var_)); REGISTER_DUMMY_CVAR(int, name, defaultValue); }
# define DefineConstIntCVar3(name, _var_, defaultValue, flags, help) { static_assert((int)(defaultValue) == (int)(_var_)); REGISTER_DUMMY_CVAR(int, name, defaultValue); }
# define AllocateConstIntCVar(scope, name)
# define DefineConstFloatCVar(name, flags, help) { REGISTER_DUMMY_CVAR(float, (#name), name ## Default); }
@@ -1540,33 +1539,33 @@ static void AssertConsoleExists(void)
#define ILLEGAL_DEV_FLAGS (VF_NET_SYNCED | VF_CHEAT | VF_CHEAT_ALWAYS_CHECK | VF_CHEAT_NOCHECK | VF_READONLY | VF_CONST_CVAR)
#if defined(_RELEASE)
#define REGISTER_CVAR_DEV_ONLY(_var, _def_val, _flags, _comment) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0); _var = _def_val
#define REGISTER_CVAR_CB_DEV_ONLY(_var, _def_val, _flags, _comment, _onchangefunction) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0); _var = _def_val /* _onchangefunction consumed; callback not available */
#define REGISTER_STRING_DEV_ONLY(_name, _def_val, _flags, _comment) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
#define REGISTER_STRING_CB_DEV_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
#define REGISTER_INT_DEV_ONLY(_name, _def_val, _flags, _comment) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
#define REGISTER_INT_CB_DEV_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
#define REGISTER_INT64_DEV_ONLY(_name, _def_val, _flags, _comment) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
#define REGISTER_FLOAT_DEV_ONLY(_name, _def_val, _flags, _comment) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
#define REGISTER_CVAR2_DEV_ONLY(_name, _var, _def_val, _flags, _comment) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0); *(_var) = _def_val
#define REGISTER_CVAR2_CB_DEV_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0); *(_var) = _def_val
#define REGISTER_CVAR3_DEV_ONLY(_name, _var, _def_val, _flags, _comment) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0); _var = _def_val
#define REGISTER_CVAR3_CB_DEV_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0); _var = _def_val
#define REGISTER_CVAR_DEV_ONLY(_var, _def_val, _flags, _comment) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0); _var = _def_val
#define REGISTER_CVAR_CB_DEV_ONLY(_var, _def_val, _flags, _comment, _onchangefunction) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0); _var = _def_val /* _onchangefunction consumed; callback not available */
#define REGISTER_STRING_DEV_ONLY(_name, _def_val, _flags, _comment) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
#define REGISTER_STRING_CB_DEV_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
#define REGISTER_INT_DEV_ONLY(_name, _def_val, _flags, _comment) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
#define REGISTER_INT_CB_DEV_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
#define REGISTER_INT64_DEV_ONLY(_name, _def_val, _flags, _comment) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
#define REGISTER_FLOAT_DEV_ONLY(_name, _def_val, _flags, _comment) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
#define REGISTER_CVAR2_DEV_ONLY(_name, _var, _def_val, _flags, _comment) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0); *(_var) = _def_val
#define REGISTER_CVAR2_CB_DEV_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0); *(_var) = _def_val
#define REGISTER_CVAR3_DEV_ONLY(_name, _var, _def_val, _flags, _comment) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0); _var = _def_val
#define REGISTER_CVAR3_CB_DEV_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0); _var = _def_val
#define REGISTER_COMMAND_DEV_ONLY(_name, _func, _flags, _comment) /* consumed; command not available */
#else
#define REGISTER_CVAR_DEV_ONLY(_var, _def_val, _flags, _comment) REGISTER_CVAR(_var, _def_val, ((_flags) | VF_DEV_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR_CB_DEV_ONLY(_var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR_CB(_var, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_STRING_DEV_ONLY(_name, _def_val, _flags, _comment) REGISTER_STRING(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_STRING_CB_DEV_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) REGISTER_STRING_CB(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_INT_DEV_ONLY(_name, _def_val, _flags, _comment) REGISTER_INT(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_INT_CB_DEV_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) REGISTER_INT_CB(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_INT64_DEV_ONLY(_name, _def_val, _flags, _comment) REGISTER_INT64(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_FLOAT_DEV_ONLY(_name, _def_val, _flags, _comment) REGISTER_FLOAT(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR2_DEV_ONLY(_name, _var, _def_val, _flags, _comment) REGISTER_CVAR2(_name, _var, _def_val, ((_flags) | VF_DEV_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR2_CB_DEV_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR2_CB(_name, _var, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR3_DEV_ONLY(_name, _var, _def_val, _flags, _comment) REGISTER_CVAR3(_name, _var, _def_val, ((_flags) | VF_DEV_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR3_CB_DEV_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR3_CB(_name, _var, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_COMMAND_DEV_ONLY(_name, _func, _flags, _comment) REGISTER_COMMAND(_name, _func, ((_flags) | VF_DEV_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR_DEV_ONLY(_var, _def_val, _flags, _comment) REGISTER_CVAR(_var, _def_val, ((_flags) | VF_DEV_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR_CB_DEV_ONLY(_var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR_CB(_var, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_STRING_DEV_ONLY(_name, _def_val, _flags, _comment) REGISTER_STRING(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_STRING_CB_DEV_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) REGISTER_STRING_CB(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_INT_DEV_ONLY(_name, _def_val, _flags, _comment) REGISTER_INT(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_INT_CB_DEV_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) REGISTER_INT_CB(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_INT64_DEV_ONLY(_name, _def_val, _flags, _comment) REGISTER_INT64(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_FLOAT_DEV_ONLY(_name, _def_val, _flags, _comment) REGISTER_FLOAT(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR2_DEV_ONLY(_name, _var, _def_val, _flags, _comment) REGISTER_CVAR2(_name, _var, _def_val, ((_flags) | VF_DEV_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR2_CB_DEV_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR2_CB(_name, _var, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR3_DEV_ONLY(_name, _var, _def_val, _flags, _comment) REGISTER_CVAR3(_name, _var, _def_val, ((_flags) | VF_DEV_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR3_CB_DEV_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR3_CB(_name, _var, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_COMMAND_DEV_ONLY(_name, _func, _flags, _comment) REGISTER_COMMAND(_name, _func, ((_flags) | VF_DEV_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#endif // defined(_RELEASE)
//
////////////////////////////////////////////////////////////////////////////////
@@ -1583,19 +1582,19 @@ static void AssertConsoleExists(void)
// TODO Registering all cvars for Dedicated server as well. Currently CrySystems have no concept of Dedicated server with cmake.
// If we introduce server specific targets for CrySystems, we can add DEDICATED_SERVER flags to those and add the flag back in here.
#if defined(_RELEASE)
#define REGISTER_CVAR_DEDI_ONLY(_var, _def_val, _flags, _comment) REGISTER_CVAR(_var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR_CB_DEDI_ONLY(_var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR_CB(_var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_STRING_DEDI_ONLY(_name, _def_val, _flags, _comment) REGISTER_STRING(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_STRING_CB_DEDI_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) REGISTER_STRING_CB(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_INT_DEDI_ONLY(_name, _def_val, _flags, _comment) REGISTER_INT(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_INT_CB_DEDI_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) REGISTER_INT_CB(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_INT64_DEDI_ONLY(_name, _def_val, _flags, _comment) REGISTER_INT64(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_FLOAT_DEDI_ONLY(_name, _def_val, _flags, _comment) REGISTER_FLOAT(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR2_DEDI_ONLY(_name, _var, _def_val, _flags, _comment) REGISTER_CVAR2(_name, _var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR2_CB_DEDI_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR2_CB(_name, _var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR3_DEDI_ONLY(_name, _var, _def_val, _flags, _comment) REGISTER_CVAR3(_name, _var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR3_CB_DEDI_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR3_CB(_name, _var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_COMMAND_DEDI_ONLY(_name, _func, _flags, _comment) REGISTER_COMMAND(_name, _func, ((_flags) | VF_DEDI_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR_DEDI_ONLY(_var, _def_val, _flags, _comment) REGISTER_CVAR(_var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR_CB_DEDI_ONLY(_var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR_CB(_var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_STRING_DEDI_ONLY(_name, _def_val, _flags, _comment) REGISTER_STRING(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_STRING_CB_DEDI_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) REGISTER_STRING_CB(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_INT_DEDI_ONLY(_name, _def_val, _flags, _comment) REGISTER_INT(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_INT_CB_DEDI_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) REGISTER_INT_CB(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_INT64_DEDI_ONLY(_name, _def_val, _flags, _comment) REGISTER_INT64(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_FLOAT_DEDI_ONLY(_name, _def_val, _flags, _comment) REGISTER_FLOAT(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR2_DEDI_ONLY(_name, _var, _def_val, _flags, _comment) REGISTER_CVAR2(_name, _var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR2_CB_DEDI_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR2_CB(_name, _var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR3_DEDI_ONLY(_name, _var, _def_val, _flags, _comment) REGISTER_CVAR3(_name, _var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_CVAR3_CB_DEDI_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR3_CB(_name, _var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#define REGISTER_COMMAND_DEDI_ONLY(_name, _func, _flags, _comment) REGISTER_COMMAND(_name, _func, ((_flags) | VF_DEDI_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
#else
#define REGISTER_CVAR_DEDI_ONLY(_var, _def_val, _flags, _comment) REGISTER_CVAR_DEV_ONLY(_var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment)
#define REGISTER_CVAR_CB_DEDI_ONLY(_var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR_CB_DEV_ONLY(_var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction)
+2 -2
View File
@@ -314,8 +314,8 @@ public:
void GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer) const
{
COMPILE_TIME_ASSERT(eTT_MaxTexType <= 255);
COMPILE_TIME_ASSERT(eTF_MaxFormat <= 255);
static_assert(eTT_MaxTexType <= 255);
static_assert(eTF_MaxFormat <= 255);
/*LATER*/
}
-9
View File
@@ -18,11 +18,6 @@
#define _CPU_X86
//#define _CPU_SSE
#define DEBUG_BREAK raise(SIGTRAP)
#define RC_EXECUTABLE "rc"
#define USE_CRT 1
#define SIZEOF_PTR 4
//////////////////////////////////////////////////////////////////////////
// Standard includes.
//////////////////////////////////////////////////////////////////////////
@@ -98,10 +93,6 @@ typedef unsigned char byte;
#define DEFINE_ALIGNED_DATA(type, name, alignment) \
type __attribute__ ((aligned(alignment))) name;
#define DEFINE_ALIGNED_DATA_STATIC(type, name, alignment) \
static type __attribute__ ((aligned(alignment))) name;
#define DEFINE_ALIGNED_DATA_CONST(type, name, alignment) \
const type __attribute__ ((aligned(alignment))) name;
#include "LinuxSpecific.h"
-9
View File
@@ -20,11 +20,6 @@
#define _CPU_AMD64
#define _CPU_SSE
#define DEBUG_BREAK ::raise(SIGTRAP)
#define RC_EXECUTABLE "rc"
#define USE_CRT 1
#define SIZEOF_PTR 8
//////////////////////////////////////////////////////////////////////////
// Standard includes.
//////////////////////////////////////////////////////////////////////////
@@ -104,10 +99,6 @@ typedef uint8 byte;
#define DEFINE_ALIGNED_DATA(type, name, alignment) \
type __attribute__ ((aligned(alignment))) name;
#define DEFINE_ALIGNED_DATA_STATIC(type, name, alignment) \
static type __attribute__ ((aligned(alignment))) name;
#define DEFINE_ALIGNED_DATA_CONST(type, name, alignment) \
const type __attribute__ ((aligned(alignment))) name;
#include "LinuxSpecific.h"
-89
View File
@@ -42,23 +42,6 @@
#include <vector>
#include <string>
#ifdef __FUNC__
#undef __FUNC__
#endif
#if defined(__GNUC__) || defined(__clang__)
#define __FUNC__ __func__
#else
#define __FUNC__ \
({ \
static char __f[sizeof(__PRETTY_FUNCTION__) + 1]; \
strcpy(__f, __PRETTY_FUNCTION__); \
char* __p = (char*)strchr(__f, '('); \
*__p = 0; \
while (*(__p) != ' ' && __p != (__f - 1)) {--__p; } \
(__p + 1); \
})
#endif
typedef void* LPVOID;
#define VOID void
#define PVOID void*
@@ -194,7 +177,6 @@ typedef int64 __int64;
typedef uint64 __uint64;
#endif
#define THREADID_NULL -1
typedef unsigned long int threadID;
#define TRUE 1
@@ -222,14 +204,6 @@ typedef unsigned long int threadID;
#define wcsicmp wcscasecmp
#define wcsnicmp wcsncasecmp
#define _wtof(str) wcstod(str, 0)
/*static unsigned char toupper(unsigned char c)
{
return c & ~0x40;
}
*/
typedef union _LARGE_INTEGER
{
struct
@@ -245,7 +219,6 @@ typedef union _LARGE_INTEGER
long long QuadPart;
} LARGE_INTEGER;
// stdlib.h stuff
#define _MAX_DRIVE 3 // max. length of drive component
#define _MAX_DIR 256 // max. length of path component
@@ -269,21 +242,6 @@ typedef union _LARGE_INTEGER
#define _O_SEQUENTIAL 0x0020 /* file access is primarily sequential */
#define _O_RANDOM 0x0010 /* file access is primarily random */
// curses.h stubs for PDcurses keys
#define PADENTER KEY_MAX + 1
#define CTL_HOME KEY_MAX + 2
#define CTL_END KEY_MAX + 3
#define CTL_PGDN KEY_MAX + 4
#define CTL_PGUP KEY_MAX + 5
// stubs for virtual keys, isn't used on Linux
#define VK_UP 0
#define VK_DOWN 0
#define VK_RIGHT 0
#define VK_LEFT 0
#define VK_CONTROL 0
#define VK_SCROLL 0
enum
{
IDOK = 1,
@@ -297,17 +255,6 @@ enum
IDCONTINUE = 11
};
#define ES_MULTILINE 0x0004L
#define ES_AUTOVSCROLL 0x0040L
#define ES_AUTOHSCROLL 0x0080L
#define ES_WANTRETURN 0x1000L
#define LB_ERR (-1)
#define LB_ADDSTRING 0x0180
#define LB_GETCOUNT 0x018B
#define LB_SETTOPINDEX 0x0197
#define MB_OK 0x00000000L
#define MB_OKCANCEL 0x00000001L
#define MB_ABORTRETRYIGNORE 0x00000002L
@@ -327,22 +274,16 @@ enum
#define MB_APPLMODAL 0x00000000L
#define MF_STRING 0x00000000L
#define MK_LBUTTON 0x0001
#define MK_RBUTTON 0x0002
#define MK_SHIFT 0x0004
#define MK_CONTROL 0x0008
#define MK_MBUTTON 0x0010
#define MK_ALT ( 0x20 )
#define SM_MOUSEPRESENT 0x00000000L
#define SM_CMOUSEBUTTONS 43
#define USER_TIMER_MINIMUM 0x0000000A
#define VK_TAB 0x09
#define VK_SHIFT 0x10
#define VK_MENU 0x12
@@ -350,11 +291,6 @@ enum
#define VK_SPACE 0x20
#define VK_DELETE 0x2E
#define VK_NUMPAD1 0x61
#define VK_NUMPAD2 0x62
#define VK_NUMPAD3 0x63
#define VK_NUMPAD4 0x64
#define VK_OEM_COMMA 0xBC // ',' any country
#define VK_OEM_PERIOD 0xBE // '.' any country
#define VK_OEM_3 0xC0 // '`~' for US
@@ -541,36 +477,11 @@ inline int64 CryGetTicksPerSec()
inline int _CrtCheckMemory() { return 1; };
inline char* _fullpath(char* absPath, const char* relPath, size_t maxLength)
{
char path[PATH_MAX];
if (realpath(relPath, path) == NULL)
{
return NULL;
}
const size_t len = std::min(strlen(path), maxLength - 1);
memcpy(absPath, path, len);
absPath[len] = 0;
return absPath;
}
typedef void* HGLRC;
typedef void* HDC;
typedef void* PROC;
typedef void* PIXELFORMATDESCRIPTOR;
#define SCOPED_ENABLE_FLOAT_EXCEPTIONS
// Linux_Win32Wrapper.h now included directly by platform.h
//#include "Linux_Win32Wrapper.h"
#define closesocket close
inline int WSAGetLastError()
{
return errno;
}
template <typename T, size_t N>
char (*RtlpNumberOf( T (&)[N] ))[N];
@@ -326,8 +326,6 @@ inline uint32 GetTickCount()
#define _strlwr_s(BUF, SIZE) strlwr(BUF)
#define _strups strupr
#define _wtof(str) wcstod(str, 0)
typedef struct __finddata64_t
{
//!< atributes set by find request
@@ -489,8 +487,6 @@ extern void adaptFilenameToLinux(char* rAdjustedFilename);
extern const int comparePathNames(const char* cpFirst, const char* cpSecond, unsigned int len);//returns 0 if identical
extern void replaceDoublePathFilename(char* szFileName);//removes "\.\" to "\" and "/./" to "/"
//////////////////////////////////////////////////////////////////////////
extern char* _fullpath(char* absPath, const char* relPath, size_t maxLength);
//////////////////////////////////////////////////////////////////////////
extern void _makepath(char* path, const char* drive, const char* dir, const char* filename, const char* ext);
+1 -1
View File
@@ -63,7 +63,7 @@ void CMTRand_int32::seed(const uint32* array, int size) // init by array
}
for (int k = n - 1; k; --k)
{
PREFAST_SUPPRESS_WARNING(6385) PREFAST_SUPPRESS_WARNING(6386) m_nState[i] = (m_nState[i] ^ ((m_nState[i - 1] ^ (m_nState[i - 1] >> 30)) * 1566083941UL)) - i;
m_nState[i] = (m_nState[i] ^ ((m_nState[i - 1] ^ (m_nState[i - 1] >> 30)) * 1566083941UL)) - i;
if ((++i) == n)
{
m_nState[0] = m_nState[n - 1];
-34
View File
@@ -24,40 +24,6 @@
#define _CPU_SSE
#define PLATFORM_64BIT
#define USE_CRT 1
#define SIZEOF_PTR 8
typedef uint64_t threadID;
// curses.h stubs for PDcurses keys
#define PADENTER KEY_MAX + 1
#define CTL_HOME KEY_MAX + 2
#define CTL_END KEY_MAX + 3
#define CTL_PGDN KEY_MAX + 4
#define CTL_PGUP KEY_MAX + 5
// stubs for virtual keys, isn't used on Mac
#define VK_UP 0
#define VK_DOWN 0
#define VK_RIGHT 0
#define VK_LEFT 0
#define VK_CONTROL 0
#define VK_SCROLL 0
#define MAC_NOT_IMPLEMENTED assert(false);
typedef enum
{
eDAContinue,
eDAIgnore,
eDAIgnoreAll,
eDABreak,
eDAStop,
eDAReportAsBug
} EDialogAction;
extern EDialogAction MacOSXHandleAssert(const char* condition, const char* file, int line, const char* reason, bool);
#endif // CRYINCLUDE_CRYCOMMON_MACSPECIFIC_H

Some files were not shown because too many files have changed in this diff Show More