Merge branch 'main' into non-uniform-scale-compatibility

This commit is contained in:
greerdv
2021-05-12 22:19:33 +01:00
419 changed files with 14774 additions and 42309 deletions
@@ -1,402 +0,0 @@
<!--
= Platform names =
(case insensitive)
"ANDROID"
"PROVO"
"PC"
"LINUX"
"MAC"
= Basic Layout =
<ThreadConfig>
<Platform name="XXX">
<ThreadDefault Affinity="XX" Priority="XX" StackSizeKB="XX">
<Thread name ="A" Affinity="XX" Priority="XX" StackSizeKB="XX">
<Thread name ="B" Affinity="XX" >
...
</Platform>
<Platform name="YYY">
...
</Platform>
</ThreadConfig>
= Parser Order for Platform =
1. PlatformName_Common (valid for all potential platform configurations. Can be overridden by concert platform configuration)
2. PlatformName or PlatformName_X (for platforms with unknown CPU count where X is the number of potential cores. The equal or next lower matching configuration for the identified core count at runtime will be taken)
Note: Overriding of thread configuration by later parsed configuration allowed.
= <ThreadDefault> and <Thread> XML attributes =
!!!
Note: Use "ignore" as value if you do not want the thread system to set the value specifically!
If a value is not defines the <ThreadDefault> value of the parameter will be used.
This is useful when dealing with 3rdParty threads where you are not in control of the parameter setup.
!!!
Name:
"x" (string) : Name of thread
"x*y" (string) : Name of thread with wildcard character
Affinity:
"-1" : Put SW thread affinity in the hands of the scheduler - (default) -
"x" : Run thread on specified core
"x, y, ..." : Run thread on specified cores
Priority:
"idle" : Hint to CryEngine to run thread with pre-set priority
"below_normal" : Hint to CryEngine to run thread with pre-set priority
"normal" : Hint to CryEngine to run thread with pre-set priority - (default) -
"above_normal" : Hint to CryEngine to run thread with pre-set priority
"highest" : Hint to CryEngine to run thread with pre-set priority
"time_critical" : Hint to CryEngine to run thread with pre-set priority
"x" (number) : User defined thread priority number
StackSizeKB:
"0" : Let platform decide on the stack size - (default) -
"x" : Create thread with "x" KB of stack size
DisablePriorityBoost:
"true" : Disable priority boosting - (default) -
"false" : Enable priority boosting
-->
<ThreadConfig>
<!-- ============= -->
<!-- === PROVO === -->
<!-- ============= -->
<Platform name="Provo">
<ThreadDefault Affinity="-1" Priority="Normal" StackSizeKB="64"/>
<!-- [PROCESS] -->
<Thread name ="Main" Affinity="0" Priority="Above_Normal"/>
<!-- [RenderDLL] -->
<Thread name ="RenderThread" Affinity="2" Priority="Highest" StackSizeKB="128"/>
<Thread name ="RenderLoadingThread" Affinity="1" Priority="Above_Normal" StackSizeKB="72"/>
<Thread name ="ShaderCompile"/>
<!-- [SYSTEM] -->
<Thread name ="GFxMeshCacheReset"/>
<Thread name ="MTrace NetPump" Priority="25"/>
<Thread name ="NotificationNetwork"/>
<Thread name ="ReplayRecord"/>
<Thread name ="ResourceActivator"/>
<Thread name ="StatoscopeDataWriter"/>
<Thread name ="RemoteCommandClient"/>
<Thread name ="RemoteCommandServer"/>
<Thread name ="ServiceNetwork"/>
<Thread name ="SysCrashTestOnThread"/>
<!-- [SYSTEM] - JobSystem -->
<Thread name ="JobSystem_Worker_0(Blocking)" Affinity="1"/>
<Thread name ="JobSystem_Worker_0(Regular)" Affinity="1" StackSizeKB="256"/>
<Thread name ="JobSystem_Worker_1(Regular)" Affinity="3" StackSizeKB="256"/>
<Thread name ="JobSystem_Worker_2(Regular)" Affinity="4" StackSizeKB="256"/>
<Thread name ="JobSystem_Worker_3(Regular)" Affinity="5" StackSizeKB="256"/>
<!-- [SYSTEM] - Physics -->
<Thread name ="Physics" StackSizeKB="128"/>
<Thread name ="PhysicsWorkerThread_*" StackSizeKB="128"/>
<!-- [SYSTEM] - Streaming -->
<Thread name ="Streaming File IO HDD" Priority="Above_Normal" Affinity="1"/>
<Thread name ="Streaming File IO Optical" Priority="Above_Normal" Affinity="1"/>
<Thread name ="Streaming File IO InMemory" Priority="Above_Normal" Affinity="1"/>
<Thread name ="Streaming AsyncCallback" Affinity="5"/>
<Thread name ="Streaming AsyncCallback Pak 0" Affinity="5"/>
<!-- [SYSTEM] - Console -->
<Thread name ="RemoteConsoleServer"/>
<Thread name ="RemoteConsoleClient"/>
<!-- [NETWORK] -->
<Thread name ="Network"/>
<Thread name ="ServerProbe"/>
<Thread name ="NetworkDebugKit"/>
<Thread name ="NetFileDownload"/>
<Thread name ="NetworkWatchdog"/>
<Thread name ="NetAddressSolver"/>
<!-- [AI] -->
<Thread name ="NavigationSystemBackgroundUpdate"/>
<!-- [AUDIO] -->
<Thread name ="MainAudioThread" Affinity="1,3,4,5" Priority="below_normal" StackSize="ignore"/>
<Thread name ="Wwise_Device" Affinity="5" Priority="ignore" StackSize="ignore"/>
<Thread name ="Wwise_BankManager" Affinity="5" Priority="ignore" StackSize="ignore"/>
<Thread name ="Wwise_LEngine" Affinity="5" Priority="ignore" StackSize="ignore"/>
<Thread name ="Wwise_Monitor" Affinity="5" Priority="ignore" StackSize="ignore"/>
<!-- [ACTION] -->
<Thread name ="NetworkStallTicker"/>
<Thread name ="ZLibCompressor" Priority="Normal"/>
<!-- [INPUT] -->
<Thread name ="InputWorker"/>
<Thread name ="Synergy"/>
<!-- [LIVE_CREATE]-->
<Thread name ="LiveCreate_Server"/>
<Thread name ="LiveCreate_FileSync"/>
<Thread name ="LiveCreatePlatformService"/>
<Thread name ="LiveCreateUtilityService"/>
<!-- [SCALEFORM][3rd Party] -->
<Thread name ="GFxVideo_SoundUpdate" Affinity="5" Priority="time_critical" DisablePriorityBoost="ignore" StackSizeKB="ignore"/>
<Thread name ="GFxVideo_Decoder" Affinity="4" Priority="highest" DisablePriorityBoost="ignore" StackSizeKB="ignore"/>
<Thread name ="GFxVideo_Reader" Affinity="5" Priority="highest" DisablePriorityBoost="ignore" StackSizeKB="ignore"/>
</Platform>
<!-- ============ -->
<!-- === PC_Common === -->
<!-- ============ -->
<Platform name="PC_Common">
<ThreadDefault Affinity="-1" Priority="Normal" StackSizeKB="32"/>
<!-- [PROCESS] -->
<Thread name ="Main" Affinity="-1" Priority="Normal"/>
<!-- [SYSTEM] - JobSystem -->
<Thread name ="JobSystem_Worker_*(Blocking)" StackSizeKB="32"/>
<Thread name ="JobSystem_Worker_*(Regular)" StackSizeKB="256"/>
<!-- [SYSTEM] - Physics -->
<Thread name ="Physics" StackSizeKB="128"/>
<Thread name ="PhysicsWorkerThread_*" StackSizeKB="128"/>
<!-- [RenderDLL] -->
<Thread name ="RenderThread" StackSizeKB="128"/>
<Thread name ="RenderLoadingThread" Priority="Above_Normal" StackSizeKB="72"/>
<Thread name ="ShaderCompile"/>
<!-- [SYSTEM] -->
<Thread name ="GFxMeshCacheReset"/>
<Thread name ="MTrace NetPump" Priority="25" StackSizeKB="64"/>
<Thread name ="NotificationNetwork"/>
<Thread name ="ReplayRecord"/>
<Thread name ="ResourceActivator"/>
<Thread name ="StatoscopeDataWriter"/>
<Thread name ="RemoteCommandClient"/>
<Thread name ="RemoteCommandServer"/>
<Thread name ="ServiceNetwork"/>
<Thread name ="SysCrashTestOnThread"/>
<!-- [SYSTEM] - Streaming -->
<Thread name ="Streaming File IO HDD" Priority="Above_Normal"/>
<Thread name ="Streaming File IO Optical" Priority="Above_Normal"/>
<Thread name ="Streaming File IO InMemory" Priority="Above_Normal"/>
<Thread name ="Streaming AsyncCallback"/>
<Thread name ="Streaming AsyncCallback Pak 0"/>
<!-- [SYSTEM] - Console -->
<Thread name ="RemoteConsoleServer"/>
<Thread name ="RemoteConsoleClient"/>
<Thread name ="WindowsConsoleInput"/>
<Thread name ="UNIXConsoleInput"/>
<!-- [NETWORK] -->
<Thread name ="Network"/>
<Thread name ="ServerProbe"/>
<Thread name ="NetworkDebugKit"/>
<Thread name ="NetFileDownload"/>
<Thread name ="NetworkWatchdog" StackSizeKB="8"/>
<Thread name ="NetAddressSolver" StackSizeKB="16"/>
<!-- [AUDIO] -->
<Thread name ="MainAudioThread" Affinity="ignore" Priority="below_normal" StackSize="ignore"/>
<Thread name ="Wwise_Device" Affinity="ignore" Priority="ignore" StackSize="ignore"/>
<Thread name ="Wwise_BankManager" Affinity="ignore" Priority="ignore" StackSize="ignore"/>
<Thread name ="Wwise_LEngine" Affinity="ignore" Priority="ignore" StackSize="ignore"/>
<Thread name ="Wwise_Monitor" Affinity="ignore" Priority="ignore" StackSize="ignore"/>
<!-- [AI] -->
<Thread name ="NavigationSystemBackgroundUpdate"/>
<!-- [ACTION] -->
<Thread name ="NetworkStallTicker"/>
<Thread name ="ZLibCompressor" Priority="Normal" StackSizeKB="32"/>
<!-- [INPUT] -->
<Thread name ="InputWorker"/>
<Thread name ="Synergy"/>
<!-- [LIVE_CREATE]-->
<Thread name ="LiveCreate_Server"/>
<Thread name ="LiveCreate_FileSync"/>
<Thread name ="LiveCreatePlatformService"/>
<Thread name ="LiveCreateUtilityService"/>
<!-- [SCALEFORM][3rd Party] -->
<Thread name ="GFxVideo_SoundUpdate" Affinity="ignore" Priority="highest" DisablePriorityBoost="ignore" StackSizeKB="16"/>
<!-- Special case, to add additional decoder threads add a threads with an increase incremental number. "GFxVideo_Decoder_0" sets thread priority for all other decoder threads-->
<Thread name ="GFxVideo_Decoder_0" Affinity="ignore" Priority="normal" DisablePriorityBoost="ignore" StackSizeKB="ignore"/>
<Thread name ="GFxVideo_Decoder_1" Affinity="ignore" Priority="normal" DisablePriorityBoost="ignore" StackSizeKB="ignore"/>
</Platform>
<!-- ============ -->
<!-- === PC_8 === -->
<!-- ============ -->
<Platform name="PC_8">
<!-- Empty Example - Extend for 8 core specific machines. May override Common settings -->
</Platform>
<!-- ============ -->
<!-- === MAC_Common === -->
<!-- ============ -->
<Platform name="MAC_Common">
<ThreadDefault Affinity="-1" Priority="Normal" StackSizeKB="32"/>
</Platform>
<!-- ============ -->
<!-- === LINUX_Common === -->
<!-- ============ -->
<Platform name="LINUX_Common">
<ThreadDefault Affinity="-1" Priority="Normal" StackSizeKB="64"/>
<!-- [PROCESS] -->
<Thread name ="Main" Affinity="-1" Priority="Above_Normal"/>
<!-- [SYSTEM] - JobSystem -->
<Thread name ="JobSystem_Worker_*(Blocking)" StackSizeKB="32"/>
<Thread name ="JobSystem_Worker_*(Regular)" StackSizeKB="256"/>
<!-- [SYSTEM] - Physics -->
<Thread name ="Physics" StackSizeKB="128"/>
<Thread name ="PhysicsWorkerThread_*" StackSizeKB="128"/>
<!-- [RenderDLL] -->
<Thread name ="RenderThread" Priority="Above_Normal" StackSizeKB="128"/>
<Thread name ="RenderLoadingThread" Priority="Above_Normal" StackSizeKB="72"/>
<Thread name ="ShaderCompile"/>
<!-- [SYSTEM] -->
<Thread name ="GFxMeshCacheReset"/>
<Thread name ="MTrace NetPump" Priority="25" StackSizeKB="64"/>
<Thread name ="NotificationNetwork"/>
<Thread name ="ReplayRecord"/>
<Thread name ="ResourceActivator"/>
<Thread name ="StatoscopeDataWriter"/>
<Thread name ="RemoteCommandClient"/>
<Thread name ="RemoteCommandServer"/>
<Thread name ="ServiceNetwork"/>
<Thread name ="SysCrashTestOnThread"/>
<!-- [SYSTEM] - Streaming -->
<Thread name ="Streaming File IO HDD" Priority="Above_Normal"/>
<Thread name ="Streaming File IO Optical" Priority="Above_Normal"/>
<Thread name ="Streaming File IO InMemory" Priority="Above_Normal"/>
<Thread name ="Streaming AsyncCallback"/>
<Thread name ="Streaming AsyncCallback Pak 0"/>
<!-- [SYSTEM] - Console -->
<Thread name ="RemoteConsoleServer"/>
<Thread name ="RemoteConsoleClient"/>
<Thread name ="UNIXConsoleInput"/>
<!-- [NETWORK] -->
<Thread name ="Network"/>
<Thread name ="ServerProbe"/>
<Thread name ="NetworkDebugKit"/>
<Thread name ="NetFileDownload"/>
<Thread name ="NetworkWatchdog" StackSizeKB="8"/>
<Thread name ="NetAddressSolver"/>
<!-- [AUDIO] -->
<Thread name ="MainAudioThread" Affinity="ignore" Priority="below_normal" StackSize="ignore"/>
<Thread name ="Wwise_Device" Affinity="ignore" Priority="99" StackSize="ignore"/>
<Thread name ="Wwise_BankManager" Affinity="ignore" Priority="50" StackSize="ignore"/>
<Thread name ="Wwise_LEngine" Affinity="ignore" Priority="99" StackSize="ignore"/>
<Thread name ="Wwise_Monitor" Affinity="ignore" Priority="99" StackSize="ignore"/>
<!-- [AI] -->
<Thread name ="NavigationSystemBackgroundUpdate"/>
<!-- [ACTION] -->
<Thread name ="NetworkStallTicker"/>
<Thread name ="ZLibCompressor" Priority="Normal" StackSizeKB="32"/>
<!-- [INPUT] -->
<Thread name ="InputWorker"/>
<Thread name ="Synergy"/>
</Platform>
<!-- ============ -->
<!-- === ANDROID_Common === -->
<!-- ============ -->
<Platform name="ANDROID_Common">
<ThreadDefault Affinity="-1" Priority="Normal" StackSizeKB="32"/>
<!-- [PROCESS] -->
<Thread name ="Main" Priority="Above_Normal"/>
<!-- [SYSTEM] - JobSystem -->
<Thread name ="JobSystem_Worker_*(Blocking)" StackSizeKB="32"/>
<Thread name ="JobSystem_Worker_*(Regular)" StackSizeKB="256"/>
<!-- [SYSTEM] - Physics -->
<Thread name ="Physics" StackSizeKB="128"/>
<Thread name ="PhysicsWorkerThread_*" StackSizeKB="128"/>
<!-- [RenderDLL] -->
<Thread name ="RenderThread" Affinity="ignore" Priority="Above_Normal" StackSizeKB="128"/>
<Thread name ="RenderLoadingThread" Affinity="ignore" Priority="Above_Normal" StackSizeKB="72"/>
<Thread name ="ShaderCompile"/>
<!-- [SYSTEM] -->
<Thread name ="GFxMeshCacheReset"/>
<Thread name ="MTrace NetPump" Priority="25" StackSizeKB="64"/>
<Thread name ="NotificationNetwork"/>
<Thread name ="ReplayRecord"/>
<Thread name ="ResourceActivator"/>
<Thread name ="StatoscopeDataWriter"/>
<Thread name ="RemoteCommandClient"/>
<Thread name ="RemoteCommandServer"/>
<Thread name ="ServiceNetwork"/>
<Thread name ="SysCrashTestOnThread"/>
<!-- [AUDIO] -->
<Thread name ="MainAudioThread" Affinity="ignore" Priority="below_normal" StackSize="ignore"/>
<Thread name ="Wwise_Device" Affinity="ignore" Priority="99" StackSize="ignore"/>
<Thread name ="Wwise_BankManager" Affinity="ignore" Priority="50" StackSize="ignore"/>
<Thread name ="Wwise_LEngine" Affinity="ignore" Priority="99" StackSize="ignore"/>
<Thread name ="Wwise_Monitor" Affinity="ignore" Priority="99" StackSize="ignore"/>
<!-- [SYSTEM] - Streaming -->
<Thread name ="Streaming File IO HDD" Priority="Above_Normal"/>
<Thread name ="Streaming File IO Optical" Priority="Above_Normal"/>
<Thread name ="Streaming File IO InMemory" Priority="Above_Normal"/>
<Thread name ="Streaming AsyncCallback"/>
<Thread name ="Streaming AsyncCallback Pak 0"/>
<!-- [SYSTEM] - Console -->
<Thread name ="RemoteConsoleServer"/>
<!-- [NETWORK] -->
<Thread name ="Network"/>
<Thread name ="ServerProbe"/>
<Thread name ="NetworkDebugKit"/>
<Thread name ="NetFileDownload"/>
<Thread name ="NetworkWatchdog" StackSizeKB="8"/>
<Thread name ="NetAddressSolver" StackSizeKB="16"/>
<!-- [ACTION] -->
<Thread name ="NetworkStallTicker"/>
<Thread name ="ZLibCompressor" Affinity="ignore" Priority="Above_Normal" StackSizeKB="32"/>
</Platform>
</ThreadConfig>
@@ -1,128 +0,0 @@
<!--
= Platform names =
(case insensitive)
"ANDROID"
"PROVO"
"PC"
"MAC"
= Basic Layout =
<ThreadConfig>
<Platform name="XXX">
<ThreadDefault Affinity="XX" Priority="XX" StackSizeKB="XX">
<Thread name ="A" Affinity="XX" Priority="XX" StackSizeKB="XX">
<Thread name ="B" Affinity="XX" >
...
</Platform>
<Platform name="YYY">
...
</Platform>
</ThreadConfig>
= Parser Order for Platform =
1. PlatformName_Common (valid for all potential platform configurations. Can be overridden by concert platform configuration)
2. PlatformName or PlatformName_X (for platforms with unknown CPU count where X is the number of potential cores. The equal or next lower matching configuration for the identified core count at runtime will be taken)
Note: Overriding of thread configuration by later parsed configuration allowed.
= <ThreadDefault> and <Thread> XML attributes =
!!!
Note: Use "ignore" as value if you do not want the thread system to set the value specifically!
If a value is not defines the <ThreadDefault> value of the parameter will be used.
This is useful when dealing with 3rdParty threads where you are not in control of the parameter setup.
!!!
Name:
"x" (string) : Name of thread
"x*y" (string) : Name of thread with wildcard character
Affinity:
"-1" : Put SW thread affinity in the hands of the scheduler - (default) -
"x" : Run thread on specified core
"x, y, ..." : Run thread on specified cores
Priority:
"idle" : Hint to CryEngine to run thread with pre-set priority
"below_normal" : Hint to CryEngine to run thread with pre-set priority
"normal" : Hint to CryEngine to run thread with pre-set priority - (default) -
"above_normal" : Hint to CryEngine to run thread with pre-set priority
"highest" : Hint to CryEngine to run thread with pre-set priority
"time_critical" : Hint to CryEngine to run thread with pre-set priority
"x" (number) : User defined thread priority number
StackSizeKB:
"0" : Let platform decide on the stack size - (default) -
"x" : Create thread with "x" KB of stack size
DisablePriorityBoost:
"true" : Disable priority boosting - (default) -
"false" : Enable priority boosting
-->
<ThreadConfig>
<!-- ============ -->
<!-- === PC_Common === -->
<!-- ============ -->
<Platform name="PC_Common">
<ThreadDefault Affinity="-1" Priority="Normal" StackSizeKB="32"/>
<!-- [SANDBOX] -->
<Thread name ="TextureViewer"/>
<Thread name ="TextureDatabaseCreator"/>
<Thread name ="MaterialFilesScanning"/>
<Thread name ="FileChangeMonitor"/>
<Thread name ="FileSystemSearcher"/>
<Thread name ="BackgroundTask_IO"/>
<Thread name ="BackgroundTask_*"/>
<!-- [SANDBOX] - Dialogues -->
<Thread name ="ResourceCompilerDialog"/>
<!-- [SANDBOX] - Telemetry -->
<Thread name ="TelemetryPipeThread"/>
<!-- [SANDBOX] - Asset Browser -->
<Thread name ="AssetMetaDataFileDB_CachingInfo"/>
<Thread name ="AssetMetaDataFileDB_LoadAndUpdate"/>
<!-- [SANDBOX] - Console -->
<Thread name ="ConsoleHotUpdate"/>
<Thread name ="Console Synchronization"/>
<!-- [SANDBOX] - LiveCreate -->
<Thread name ="LiveCreate_PeerComm"/>
<Thread name ="LiveCreate_SyncFiles"/>
<Thread name ="LiveCreate_CheckPowerOn"/>
<!-- [SANDBOX] - Plug-ins -->
<Thread name ="PerforcePlugin"/>
<!-- [SANDBOX] - Utility -->
<Thread name ="FileIndexing"/>
<Thread name ="LODChainGenerateThread"/>
<Thread name ="VisualChangeCalculatorView"/>
<!-- [SANDBOX] - Segmented World -->
<Thread name ="SegWorld_MapUpdater"/>
<Thread name ="SegWorld_WorldUpdater"/>
<Thread name ="SegWorld_ExportSurfaceTexture_*"/>
<!-- [SANDBOX] - Indirect Lighting -->
<Thread name ="SHLighting_*" StackSizeKB="1024"/>
<Thread name ="SHLighting_TriRaster" StackSizeKB="1024"/>
</Platform>
<!-- ============ -->
<!-- === PC_8 === -->
<!-- ============ -->
<Platform name="PC_8">
<!-- Empty Example - Extend for 8 core specific machines. May override Common settings -->
</Platform>
</ThreadConfig>
@@ -10,6 +10,4 @@
#
set(GEM_DEPENDENCIES
Gem::Atom_RHI_Metal.Private
Gem::Atom_RHI_Null.Private
)
@@ -10,10 +10,4 @@
#
set(GEM_DEPENDENCIES
Gem::Atom_RHI_Null.Private
Gem::Atom_RHI_Null.Builders
Gem::Atom_RHI_Metal.Private
Gem::Atom_RHI_Metal.Builders
Gem::Atom_RHI_Vulkan.Builders
Gem::Atom_RHI_DX12.Builders
)
@@ -10,7 +10,4 @@
#
set(GEM_DEPENDENCIES
Gem::Atom_RHI_Vulkan.Private
Gem::Atom_RHI_DX12.Private
Gem::Atom_RHI_Null.Private
)
@@ -11,11 +11,4 @@
set(GEM_DEPENDENCIES
Gem::QtForPython.Editor
Gem::Atom_RHI_Vulkan.Private
Gem::Atom_RHI_Vulkan.Builders
Gem::Atom_RHI_DX12.Private
Gem::Atom_RHI_DX12.Builders
Gem::Atom_RHI_Null.Private
Gem::Atom_RHI_Null.Builders
Gem::Atom_RHI_Metal.Builders
)
@@ -42,17 +42,7 @@ set(GEM_DEPENDENCIES
Gem::SurfaceData
Gem::GradientSignal
Gem::Vegetation
Gem::Atom_RHI.Private
Gem::Atom_RPI.Private
Gem::Atom_Feature_Common
Gem::Atom_Bootstrap
Gem::Atom_Component_DebugCamera
Gem::AtomImGuiTools
Gem::AtomLyIntegration_CommonFeatures
Gem::EMotionFX_Atom
Gem::ImguiAtom
Gem::Atom_AtomBridge
Gem::AtomFont
Gem::NvCloth
Gem::Blast
)
@@ -50,24 +50,9 @@ set(GEM_DEPENDENCIES
Gem::Vegetation.Editor
Gem::GraphModel.Editor
Gem::LandscapeCanvas.Editor
Gem::Atom_RHI.Private
Gem::EMotionFX.Editor
Gem::Atom_RPI.Builders
Gem::Atom_RPI.Editor
Gem::Atom_Feature_Common.Builders
Gem::Atom_Feature_Common.Editor
Gem::ImGui.Editor
Gem::Atom_Bootstrap
Gem::Atom_Asset_Shader.Builders
Gem::Atom_Component_DebugCamera
Gem::AtomImGuiTools
Gem::AtomLyIntegration_CommonFeatures.Editor
Gem::EMotionFX_Atom.Editor
Gem::ImageProcessingAtom.Editor
Gem::Atom_AtomBridge.Editor
Gem::ImguiAtom
Gem::AtomFont
Gem::AtomToolsFramework.Editor
Gem::NvCloth.Editor
Gem::Blast.Editor
)
@@ -82,42 +82,34 @@ class TestDistanceBetweenFilterComponentOverrides(EditorTestHelper):
editor.EditorComponentAPIBus(bus.Broadcast, "SetComponentProperty", veg_system_settings_component,
'Configuration|Area System Settings|Sector Point Density', 16)
# Add a Vegetation Debugger component to allow area refreshes
hydra.add_level_component("Vegetation Debugger")
# 5) Add a Vegetation Distance Between Filter, toggle overrides on both the component and descriptor,
# and verify initial instance counts are accurate
spawner_entity.add_component("Vegetation Distance Between Filter")
spawner_entity.get_set_test(3, "Configuration|Allow Per-Item Overrides", True)
spawner_entity.get_set_test(2, "Configuration|Embedded Assets|[0]|Distance Between Filter (Radius)|Override Enabled", True)
general.run_console('veg_debugClearAllAreas')
self.test_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0) and \
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 2), 5.0) and \
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 2), 5.0) and \
self.test_success
num_expected = 16 * 16
initial_success = self.wait_for_condition(lambda: dynveg.validate_instance_count_in_entity_shape(spawner_entity.id, num_expected), 5.0)
self.test_success = self.test_success and initial_success
# 6) Change Radius Min to 1.0, refresh, and verify instance counts are accurate
spawner_entity.get_set_test(2, "Configuration|Embedded Assets|[0]|Distance Between Filter (Radius)|Radius Min", 1.0)
general.run_console('veg_debugClearAllAreas')
self.test_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0) and \
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 0), 5.0) and \
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 1), 5.0) and \
self.test_success
point_a_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0)
point_b_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 0), 5.0)
point_c_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 1), 5.0)
self.test_success = self.test_success and point_a_success and point_b_success and point_c_success
# 7) Change Radius Min to 2.0, refresh, and verify instance counts are accurate
spawner_entity.get_set_test(2, "Configuration|Embedded Assets|[0]|Distance Between Filter (Radius)|Radius Min", 2.0)
general.run_console('veg_debugClearAllAreas')
self.test_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0) and \
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 0), 5.0) and \
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 0), 5.0) and \
self.test_success
point_a_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0)
point_b_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 0), 5.0)
point_c_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 0), 5.0)
self.test_success = self.test_success and point_a_success and point_b_success and point_c_success
# 8) Change Radius Min to 16.0, refresh, and verify instance counts are accurate, only a single instance should plant
spawner_entity.get_set_test(2, "Configuration|Embedded Assets|[0]|Distance Between Filter (Radius)|Radius Min", 16.0)
general.run_console('veg_debugClearAllAreas')
num_expected_instances = 1
final_check_success = self.wait_for_condition(lambda: dynveg.validate_instance_count_in_entity_shape(spawner_entity.id, num_expected_instances), 5.0)
self.test_success = final_check_success and self.test_success
self.test_success = self.test_success and final_check_success
test = TestDistanceBetweenFilterComponentOverrides()
@@ -80,35 +80,29 @@ class TestDistanceBetweenFilterComponent(EditorTestHelper):
editor.EditorComponentAPIBus(bus.Broadcast, "SetComponentProperty", veg_system_settings_component,
'Configuration|Area System Settings|Sector Point Density', 16)
# Add a Vegetation Debugger component to allow area refreshes
hydra.add_level_component("Vegetation Debugger")
# 5) Add a Vegetation Distance Between Filter and verify initial instance counts are accurate
spawner_entity.add_component("Vegetation Distance Between Filter")
self.test_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0) and \
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 2), 5.0) and \
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 2), 5.0) and \
self.test_success
num_expected = 16 * 16
num_expected = 16 * 16
initial_success = self.wait_for_condition(lambda: dynveg.validate_instance_count_in_entity_shape(spawner_entity.id, num_expected), 5.0)
self.test_success = self.test_success and initial_success
# 6) Change Radius Min to 1.0, refresh, and verify instance counts are accurate
spawner_entity.get_set_test(3, "Configuration|Radius Min", 1.0)
general.run_console('veg_debugClearAllAreas')
self.test_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0) and \
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 0), 5.0) and \
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 1), 5.0) and \
self.test_success
point_a_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0)
point_b_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 0), 5.0)
point_c_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 1), 5.0)
self.test_success = self.test_success and point_a_success and point_b_success and point_c_success
# 7) Change Radius Min to 2.0, refresh, and verify instance counts are accurate
spawner_entity.get_set_test(3, "Configuration|Radius Min", 2.0)
general.run_console('veg_debugClearAllAreas')
self.test_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0) and \
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 0), 5.0) and \
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 0), 5.0) and \
self.test_success
point_a_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0)
point_b_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 0), 5.0)
point_c_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 0), 5.0)
self.test_success = self.test_success and point_a_success and point_b_success and point_c_success
# 8) Change Radius Min to 16.0, refresh, and verify instance counts are accurate
spawner_entity.get_set_test(3, "Configuration|Radius Min", 16.0)
general.run_console('veg_debugClearAllAreas')
num_expected_instances = 1
final_check_success = self.wait_for_condition(lambda: dynveg.validate_instance_count_in_entity_shape(spawner_entity.id, num_expected_instances), 5.0)
self.test_success = final_check_success and self.test_success
+19 -30
View File
@@ -39,6 +39,7 @@
<Class name="Vector3" field="Scale" value="0.5000000 0.5000000 0.5000000" type="{8379EB7D-01FA-4538-B64B-A6543B4BE73D}"/>
<Class name="bool" field="Locked" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
</Class>
<Class name="bool" field="AddNonUniformScaleButton" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
<Class name="Transform" field="Cached World Transform" value="0.0000000 0.0000000 0.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.0000000 0.0000000 0.0000000" version="1" type="{5D9958E9-9F1E-4985-B532-FFFDE75FEDFD}"/>
<Class name="EntityId" field="Cached World Transform Parent" version="1" type="{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}">
<Class name="AZ::u64" field="id" value="4294967295" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
@@ -61,7 +62,7 @@
<Class name="AZ::u64" field="SortIndex" value="0" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
</Class>
<Class name="ComponentOrderEntry" field="element" version="1" type="{335C5861-5197-4DD5-A766-EF2B551B0D9D}">
<Class name="AZ::u64" field="ComponentId" value="10451440384030983308" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
<Class name="AZ::u64" field="ComponentId" value="713494742159859414" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
<Class name="AZ::u64" field="SortIndex" value="1" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
</Class>
</Class>
@@ -122,38 +123,26 @@
</Class>
<Class name="AZStd::vector" field="DisabledComponents" type="{13D58FF9-1088-5C69-9A1F-C2A144B57B78}"/>
</Class>
<Class name="EditorMeshComponent" field="element" version="1" type="{FC315B86-3280-4D03-B4F0-5553D7D08432}">
<Class name="EditorComponentBase" field="BaseClass1" version="1" type="{D5346BD4-7F20-444E-B370-327ACD03D4A0}">
<Class name="AZ::Component" field="BaseClass1" type="{EDFCB2CF-F75D-43BE-B26B-F35821B29247}">
<Class name="AZ::u64" field="Id" value="10451440384030983308" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
</Class>
</Class>
<Class name="MeshComponentRenderNode" field="Static Mesh Render Node" version="1" type="{46FF2BC4-BEF9-4CC4-9456-36C127C310D7}">
<Class name="bool" field="Visible" value="true" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
<Class name="Asset" field="Static Mesh" value="id={878C6CF2-D4A8-5A2B-8EE0-3FD30AD967CD}:0,type={C2869E3B-DDA0-4E01-8FE3-6770D788866B},hint={objects/default/primitive_cube.cgf}" version="1" type="{77A19D40-8731-4D3C-9041-1B43047366A4}"/>
<Class name="AzFramework::SimpleAssetReference&lt;LmbrCentral::MaterialAsset&gt;" field="Material Override" version="1" type="{B7B8ECC7-FF89-4A76-A50E-4C6CA2B6E6B4}">
<Class name="SimpleAssetReferenceBase" field="BaseClass1" version="1" type="{E16CA6C5-5C78-4AD9-8E9B-F8C1FB4D1DB8}">
<Class name="AZStd::string" field="AssetPath" value="" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
<Class name="AZ::Render::EditorMeshComponent" field="element" version="2" type="{DCE68F6E-2E16-4CB4-A834-B6C2F900A7E9}">
<Class name="EditorRenderComponentAdapter&lt;AZ::Render::MeshComponentController AZ::Render::MeshComponent AZ::Render::MeshComponentConfig &gt;" field="BaseClass1" type="{3D614286-9164-53B5-833B-4F98D2820BA7}">
<Class name="EditorComponentAdapter&lt;AZ::Render::MeshComponentController AZ::Render::MeshComponent AZ::Render::MeshComponentConfig &gt;" field="BaseClass1" version="1" type="{52DFE044-18C1-5861-BA2A-EDB61107FEE9}">
<Class name="EditorComponentBase" field="BaseClass1" version="1" type="{D5346BD4-7F20-444E-B370-327ACD03D4A0}">
<Class name="AZ::Component" field="BaseClass1" type="{EDFCB2CF-F75D-43BE-B26B-F35821B29247}">
<Class name="AZ::u64" field="Id" value="713494742159859414" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
</Class>
</Class>
<Class name="AZ::Render::MeshComponentController" field="Controller" type="{D0F35FAC-4194-4C89-9487-D000DDB8B272}">
<Class name="AZ::Render::MeshComponentConfig" field="Configuration" version="1" type="{63737345-51B1-472B-9355-98F99993909B}">
<Class name="Asset" field="ModelAsset" value="id={C15CD465-9589-56ED-945F-8416FA4798A3}:10f216d9,type={2C7477B6-69C5-45BE-8163-BCD6A275B6D8},hint={objects/_primitives/_box_1x1.azmodel},loadBehavior=1" version="2" type="{77A19D40-8731-4D3C-9041-1B43047366A4}"/>
<Class name="AZ::s64" field="SortKey" value="0" type="{70D8A282-A1EA-462D-9D04-51EDE81FAC2F}"/>
<Class name="unsigned char" field="LodOverride" value="255" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
<Class name="bool" field="ExcludeFromReflectionCubeMaps" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
<Class name="bool" field="UseForwardPassIBLSpecular" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
</Class>
</Class>
</Class>
<Class name="MeshRenderOptions" field="Render Options" version="5" type="{EFF77BEB-CB99-44A3-8F15-111B0200F50D}">
<Class name="float" field="Opacity" value="1.0000000" type="{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}"/>
<Class name="float" field="MaxViewDistance" value="8000.0000000" type="{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}"/>
<Class name="float" field="ViewDistanceMultiplier" value="1.0000000" type="{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}"/>
<Class name="unsigned int" field="LODRatio" value="100" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
<Class name="bool" field="CastShadows" value="true" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
<Class name="bool" field="LODBBoxBased" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
<Class name="bool" field="UseVisAreas" value="true" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
<Class name="bool" field="RainOccluder" value="true" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
<Class name="bool" field="AffectDynamicWater" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
<Class name="bool" field="ReceiveWind" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
<Class name="bool" field="AcceptDecals" value="true" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
<Class name="bool" field="AffectNavmesh" value="true" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
<Class name="bool" field="VisibilityOccluder" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
<Class name="bool" field="DynamicMesh" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
<Class name="bool" field="AffectsGI" value="true" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
</Class>
</Class>
<Class name="bool" field="addMaterialComponentFlag" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
</Class>
</Class>
<Class name="bool" field="IsDependencyReady" value="true" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
+8
View File
@@ -0,0 +1,8 @@
.backup/
.cache/
*.log
*.akd
*.dat
*.prof
*.validationcache
*.wsettings
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:803ddb37eb27cba666f9320c2f5905219193e1a069d1144a64df92fab0e31878
size 1243
oid sha256:c9e6a4ef3d2f33f31827ce2bba2ed8bad87324f3fe86f79389ef2956b304a924
size 1180
-1
View File
@@ -21,5 +21,4 @@ Audio Bus ID Name Wwise Object Path Notes
Audio Devices ID Name Type Notes
2317455096 No_Output No Output
3859886410 System System
4230635974 Default_Motion_Device Wwise Motion
+4 -5
View File
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<PluginInfo Project="Helios" Platform="Windows" BasePlatform="Windows">
<PluginInfo Project="AutomatedTesting" Platform="Windows" BasePlatform="Windows">
<Plugins>
<Plugin Name="Wwise Tone Generator" ID="6684674" DLL="AkToneGen"/>
<Plugin Name="System" ID="11403271" DLL="DefaultSink"/>
<Plugin Name="No Output" ID="11862023" DLL="DefaultSink"/>
<Plugin Name="Wwise Motion" ID="33226759" DLL="AkMotion"/>
<Plugin Name="Wwise Tone Generator" ID="6684674" DLL="AkToneGen" StaticLib="AkToneSource"/>
<Plugin Name="System" ID="11403271"/>
<Plugin Name="No Output" ID="11862023"/>
</Plugins>
</PluginInfo>
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<SoundBanksInfo Platform="Windows" BasePlatform="Windows" SchemaVersion="12" SoundbankVersion="135">
<SoundBanksInfo Platform="Windows" BasePlatform="Windows" SchemaVersion="12" SoundbankVersion="140">
<RootPaths>
<ProjectRoot>Q:\audio\dev\AutomatedTesting\sounds\wwise_project\</ProjectRoot>
<SourceFilesRoot>Q:\audio\dev\AutomatedTesting\sounds\wwise_project\.cache\Windows\</SourceFilesRoot>
<SoundBanksRoot>Q:\audio\dev\AutomatedTesting\sounds\wwise\</SoundBanksRoot>
<ProjectRoot>D:\code\o3de\AutomatedTesting\sounds\wwise_project\</ProjectRoot>
<SourceFilesRoot>D:\code\o3de\AutomatedTesting\sounds\wwise_project\.cache\Windows\</SourceFilesRoot>
<SoundBanksRoot>D:\code\o3de\AutomatedTesting\sounds\wwise\</SoundBanksRoot>
<ExternalSourcesInputFile></ExternalSourcesInputFile>
<ExternalSourcesOutputRoot>Q:\audio\dev\AutomatedTesting\sounds\wwise_project\GeneratedSoundBanks\Windows</ExternalSourcesOutputRoot>
<ExternalSourcesOutputRoot>D:\code\o3de\AutomatedTesting\sounds\wwise_project\GeneratedSoundBanks\Windows</ExternalSourcesOutputRoot>
</RootPaths>
<DialogueEvents/>
<StreamedFiles>
@@ -28,7 +28,7 @@
</StreamedFiles>
<MediaFilesNotInAnyBank/>
<SoundBanks>
<SoundBank Id="1091743888" Language="SFX" Hash="1749663103">
<SoundBank Id="1091743888" Language="SFX" Hash="1442445546">
<ObjectPath>\SoundBanks\Default Work Unit\test_bank2</ObjectPath>
<ShortName>test_bank2</ShortName>
<Path>test_bank2.bnk</Path>
@@ -37,7 +37,7 @@
<Event Id="1100037040" Name="test_event_4_bank2_streamed_target" ObjectPath="\Events\Default Work Unit\test_event_4_bank2_streamed_target"/>
</IncludedEvents>
</SoundBank>
<SoundBank Id="1091743889" Language="SFX" Hash="3467851756">
<SoundBank Id="1091743889" Language="SFX" Hash="2708915409">
<ObjectPath>\SoundBanks\Default Work Unit\test_bank3</ObjectPath>
<ShortName>test_bank3</ShortName>
<Path>test_bank3.bnk</Path>
@@ -60,7 +60,7 @@
</Event>
</IncludedEvents>
</SoundBank>
<SoundBank Id="1091743891" Language="SFX" Hash="1393420309">
<SoundBank Id="1091743891" Language="SFX" Hash="3931660247">
<ObjectPath>\SoundBanks\Default Work Unit\test_bank1</ObjectPath>
<ShortName>test_bank1</ShortName>
<Path>test_bank1.bnk</Path>
@@ -83,7 +83,7 @@
</Event>
</IncludedEvents>
</SoundBank>
<SoundBank Id="1091743892" Language="SFX" Hash="3409201888">
<SoundBank Id="1091743892" Language="SFX" Hash="3991847887">
<ObjectPath>\SoundBanks\Default Work Unit\test_bank6</ObjectPath>
<ShortName>test_bank6</ShortName>
<Path>test_bank6.bnk</Path>
@@ -102,7 +102,7 @@
</Event>
</IncludedEvents>
</SoundBank>
<SoundBank Id="1091743893" Language="SFX" Hash="1766491996">
<SoundBank Id="1091743893" Language="SFX" Hash="3036863780">
<ObjectPath>\SoundBanks\Default Work Unit\test_bank7</ObjectPath>
<ShortName>test_bank7</ShortName>
<Path>test_bank7.bnk</Path>
@@ -125,7 +125,7 @@
</Event>
</IncludedEvents>
</SoundBank>
<SoundBank Id="1091743894" Language="SFX" Hash="1007559976">
<SoundBank Id="1091743894" Language="SFX" Hash="3337623278">
<ObjectPath>\SoundBanks\Default Work Unit\test_bank4</ObjectPath>
<ShortName>test_bank4</ShortName>
<Path>test_bank4.bnk</Path>
@@ -136,7 +136,7 @@
</File>
</IncludedMemoryFiles>
</SoundBank>
<SoundBank Id="1091743895" Language="SFX" Hash="1346356300">
<SoundBank Id="1091743895" Language="SFX" Hash="3368176">
<ObjectPath>\SoundBanks\Default Work Unit\test_bank5</ObjectPath>
<ShortName>test_bank5</ShortName>
<Path>test_bank5.bnk</Path>
@@ -169,7 +169,7 @@
</Event>
</IncludedEvents>
</SoundBank>
<SoundBank Id="1355168291" Language="SFX" Hash="2909358977">
<SoundBank Id="1355168291" Language="SFX" Hash="4145490603">
<ObjectPath>Init</ObjectPath>
<ShortName>Init</ShortName>
<Path>Init.bnk</Path>
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:94ea13931c13592deba669bd4920328ff96f17e6f8fce280d03f00251a96327a
size 94122
oid sha256:3db299d7d823b649ff20a7ffc986dccfce1fa3189f178491e2712d6c00b317af
size 94126
+2 -2
View File
@@ -3,8 +3,8 @@ Event ID Name Wwise Object Path Notes
865645077 test_event_1_bank1_embedded_target \Default Work Unit\test_event_1_bank1_embedded_target
In Memory Audio ID Name Audio source file Wwise Object Path Notes Data Size
23965881 test_sfx_1_bank1_embedded Q:\audio\dev\AutomatedTesting\sounds\wwise_project\.cache\Windows\SFX\AMZ_sfx_NME_wpn_plasma_pistol_fire_impact004_56D34C19.wem \Actor-Mixer Hierarchy\Default Work Unit\test_sfx_1_bank1_embedded 93864
23965881 test_sfx_1_bank1_embedded D:\code\o3de\AutomatedTesting\sounds\wwise_project\.cache\Windows\SFX\AMZ_sfx_NME_wpn_plasma_pistol_fire_impact004_56D34C19.wem \Actor-Mixer Hierarchy\Default Work Unit\test_sfx_1_bank1_embedded 93864
Streamed Audio ID Name Audio source file Generated audio file Wwise Object Path Notes
499820003 test_sfx_2_bank1_streamed Q:\audio\dev\AutomatedTesting\sounds\wwise_project\.cache\Windows\SFX\env_door_scanner_scan_success_56D34C19.wem 499820003.wem \Actor-Mixer Hierarchy\Default Work Unit\test_sfx_2_bank1_streamed
499820003 test_sfx_2_bank1_streamed D:\code\o3de\AutomatedTesting\sounds\wwise_project\.cache\Windows\SFX\env_door_scanner_scan_success_56D34C19.wem 499820003.wem \Actor-Mixer Hierarchy\Default Work Unit\test_sfx_2_bank1_streamed
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ad73fd0981e47fe3313eff51d2841ea5fd522a99103684d696849e7353277ea9
size 430
oid sha256:1bdaed4dc5cc514a8a3ddfaf990f59061514af7962a7a112eb677ad5c45fcb85
size 434
@@ -2,9 +2,9 @@
"version": "1.0",
"bankName": "test_bank3.bnk",
"dependencies": [
"196049145.wem",
"test_bank4.bnk",
"Init.bnk",
"test_bank4.bnk"
"196049145.wem"
],
"includedEvents": [
"test_event_5_bank3_embedded_target_bank4",
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:33eabaa646e9567017946bee05b1b5a835e91862f63145ebe5a2fbdd9c9f5a49
size 226
oid sha256:57c75cf8745b31071a788a20d8de5a60cedbfb8a6155eae1a461b8c6501e5479
size 230
+1 -1
View File
@@ -3,5 +3,5 @@ Event ID Name Wwise Object Path Notes
645979556 test_event_6_bank3_streamed_target_bank4 \Default Work Unit\test_event_6_bank3_streamed_target_bank4 Event that lives in test_bank3. This event targets only one media, which is streamed from test_bank4.
Streamed Audio ID Name Audio source file Generated audio file Wwise Object Path Notes
196049145 test_sfx_6_bank4_streamed Q:\audio\dev\AutomatedTesting\sounds\wwise_project\.cache\Windows\SFX\AMZ_sfx_NME_wpn_plasma_pistol_fire003_56D34C19.wem 196049145.wem \Actor-Mixer Hierarchy\Default Work Unit\test_sfx_6_bank4_streamed
196049145 test_sfx_6_bank4_streamed D:\code\o3de\AutomatedTesting\sounds\wwise_project\.cache\Windows\SFX\AMZ_sfx_NME_wpn_plasma_pistol_fire003_56D34C19.wem 196049145.wem \Actor-Mixer Hierarchy\Default Work Unit\test_sfx_6_bank4_streamed
+1 -1
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:79d308f3c50fece383fd82fd0060e26558e6a2e78a4ecd5d8afe24907489a88f
oid sha256:3a635f7d1ccb256caed90d18ca566cd0fa56d49b491af7c88c0b5da55a3ef4fe
size 142234
+1 -1
View File
@@ -1,3 +1,3 @@
In Memory Audio ID Name Audio source file Wwise Object Path Notes Data Size
666825490 test_sfx_5_bank4_embedded Q:\audio\dev\AutomatedTesting\sounds\wwise_project\.cache\Windows\SFX\AMZN_sfx_env_commsarray_apllyupdate_end_56D34C19.wem \Actor-Mixer Hierarchy\Default Work Unit\test_sfx_5_bank4_embedded 142170
666825490 test_sfx_5_bank4_embedded D:\code\o3de\AutomatedTesting\sounds\wwise_project\.cache\Windows\SFX\AMZN_sfx_env_commsarray_apllyupdate_end_56D34C19.wem \Actor-Mixer Hierarchy\Default Work Unit\test_sfx_5_bank4_embedded 142170
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:80c02f30d439ffcfb479e4a82b0269fe4f479c50019028e51f0fa6e3fea0bfdd
size 290
oid sha256:fa329eeb83184e88b7ab26fbff2479a98232210bcd130801041b20ccb3bcf16e
size 294
+1 -1
View File
@@ -5,5 +5,5 @@ Event ID Name Wwise Object Path Notes
3546419658 test_event_7_bank5_referenced_event_bank1_embedded \Default Work Unit\test_event_7_bank5_referenced_event_bank1_embedded
Streamed Audio ID Name Audio source file Generated audio file Wwise Object Path Notes
499820003 test_sfx_2_bank1_streamed Q:\audio\dev\AutomatedTesting\sounds\wwise_project\.cache\Windows\SFX\env_door_scanner_scan_success_56D34C19.wem 499820003.wem \Actor-Mixer Hierarchy\Default Work Unit\test_sfx_2_bank1_streamed
499820003 test_sfx_2_bank1_streamed D:\code\o3de\AutomatedTesting\sounds\wwise_project\.cache\Windows\SFX\env_door_scanner_scan_success_56D34C19.wem 499820003.wem \Actor-Mixer Hierarchy\Default Work Unit\test_sfx_2_bank1_streamed
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:07d132d54b2c747e2409a56c05a4adca0dfa4407b791ffaa6bb14531f92f89aa
size 494
oid sha256:80d3014fcfd3a8ff37219515f0c9d67a2a674094002538ac6741702dca07c14d
size 498
@@ -2,9 +2,9 @@
"version": "1.0",
"bankName": "test_bank7.bnk",
"dependencies": [
"656567798.wem",
"601903616.wem",
"Init.bnk",
"656567798.wem"
"Init.bnk"
],
"includedEvents": [
"test_event_11_bank7_streamed_target",
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:990538a33c72e79d63cab0c191b4e0f199688b923bb6bdcc8888aab375e7d11d
size 226
oid sha256:0de33094b9792d7f9ff8042e16b153dd76729e9010d6713e1824d2229c653042
size 230
+2 -2
View File
@@ -3,6 +3,6 @@ Event ID Name Wwise Object Path Notes
2110064689 test_event_11_bank7_streamed_target \Default Work Unit\test_event_11_bank7_streamed_target
Streamed Audio ID Name Audio source file Generated audio file Wwise Object Path Notes
601903616 test_sfx_8_bank7_streamed Q:\audio\dev\AutomatedTesting\sounds\wwise_project\.cache\Windows\SFX\gun_blaster_no_trigger_shot_1_56D34C19.wem 601903616.wem \Actor-Mixer Hierarchy\Default Work Unit\test_sfx_8_bank7_streamed
656567798 test_sfx_7_bank7_streamed Q:\audio\dev\AutomatedTesting\sounds\wwise_project\.cache\Windows\SFX\impact_bot_hits_metalelement_56D34C19.wem 656567798.wem \Actor-Mixer Hierarchy\Default Work Unit\test_sfx_7_bank7_streamed
601903616 test_sfx_8_bank7_streamed D:\code\o3de\AutomatedTesting\sounds\wwise_project\.cache\Windows\SFX\gun_blaster_no_trigger_shot_1_56D34C19.wem 601903616.wem \Actor-Mixer Hierarchy\Default Work Unit\test_sfx_8_bank7_streamed
656567798 test_sfx_7_bank7_streamed D:\code\o3de\AutomatedTesting\sounds\wwise_project\.cache\Windows\SFX\impact_bot_hits_metalelement_56D34C19.wem 656567798.wem \Actor-Mixer Hierarchy\Default Work Unit\test_sfx_7_bank7_streamed
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{E49D964A-E630-4580-BB43-C5ECA68306F9}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{E49D964A-E630-4580-BB43-C5ECA68306F9}" SchemaVersion="103">
<AudioObjects>
<WorkUnit Name="Default Work Unit" ID="{E49D964A-E630-4580-BB43-C5ECA68306F9}" PersistMode="Standalone">
<ChildrenList>
@@ -21,6 +21,7 @@
</MediaIDList>
</AudioFileSource>
</ChildrenList>
<ObjectLists/>
<ActiveSourceList>
<ActiveSource Name="AMZ_sfx_NME_wpn_plasma_pistol_fire_impact004" ID="{01769FD2-891B-40BA-98A1-DA38386292D6}" Platform="Linked"/>
</ActiveSourceList>
@@ -50,6 +51,7 @@
</MediaIDList>
</AudioFileSource>
</ChildrenList>
<ObjectLists/>
<ActiveSourceList>
<ActiveSource Name="AMZ_sfx_NME_wpn_plasma_pistol_fire003" ID="{6900C554-95EC-48DE-8A04-DEA195AF600C}" Platform="Linked"/>
</ActiveSourceList>
@@ -72,6 +74,7 @@
</MediaIDList>
</AudioFileSource>
</ChildrenList>
<ObjectLists/>
<ActiveSourceList>
<ActiveSource Name="AMZN_sfx_env_commsarray_apllyupdate_end" ID="{1F8E90CF-0F22-4A53-AE3B-C2ED6D12F7CB}" Platform="Linked"/>
</ActiveSourceList>
@@ -101,6 +104,7 @@
</MediaIDList>
</AudioFileSource>
</ChildrenList>
<ObjectLists/>
<ActiveSourceList>
<ActiveSource Name="env_door_scanner_scan_success" ID="{D60C55A0-E8EC-4940-B4BB-F5B510498E6F}" Platform="Linked"/>
</ActiveSourceList>
@@ -130,6 +134,7 @@
</MediaIDList>
</AudioFileSource>
</ChildrenList>
<ObjectLists/>
<ActiveSourceList>
<ActiveSource Name="gun_blaster_no_trigger_shot_1" ID="{D71A53D8-32C8-47DE-9E4C-556992016F8F}" Platform="Linked"/>
</ActiveSourceList>
@@ -159,6 +164,7 @@
</MediaIDList>
</AudioFileSource>
</ChildrenList>
<ObjectLists/>
<ActiveSourceList>
<ActiveSource Name="impact_bot_hits_metalelement" ID="{E92CDFBE-632F-4FB5-8A38-D014D25C3645}" Platform="Linked"/>
</ActiveSourceList>
@@ -187,6 +193,7 @@
<Language>SFX</Language>
</SourcePlugin>
</ChildrenList>
<ObjectLists/>
<ActiveSourceList>
<ActiveSource Name="Wwise Tone Generator" ID="{E45EE414-F90C-462E-9FB6-3AF940521F4C}" Platform="Linked"/>
</ActiveSourceList>
@@ -215,6 +222,7 @@
<Language>SFX</Language>
</SourcePlugin>
</ChildrenList>
<ObjectLists/>
<ActiveSourceList>
<ActiveSource Name="Wwise Tone Generator" ID="{CEC06DF2-6829-4429-AD5E-A75A06524E0C}" Platform="Linked"/>
</ActiveSourceList>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{0D0A68D7-4928-46AC-A278-FDCB6DF2A560}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{0D0A68D7-4928-46AC-A278-FDCB6DF2A560}" SchemaVersion="103">
<Attenuations>
<WorkUnit Name="Default Work Unit" ID="{0D0A68D7-4928-46AC-A278-FDCB6DF2A560}" PersistMode="Standalone"/>
</Attenuations>
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{5B99D375-82F5-411C-A21B-9B880B06219C}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{5B99D375-82F5-411C-A21B-9B880B06219C}" SchemaVersion="103">
<AudioDevices>
<WorkUnit Name="Default Work Unit" ID="{5B99D375-82F5-411C-A21B-9B880B06219C}" PersistMode="Standalone">
<ChildrenList>
<AudioDevice Name="System" ID="{D7E64BEE-3FAD-4E78-96A7-DA09B0437C67}" PluginName="System" CompanyID="0" PluginID="174" PluginType="7"/>
<AudioDevice Name="No_Output" ID="{53F1565D-E4CF-459A-908D-4DA6B3EB746F}" PluginName="No Output" CompanyID="0" PluginID="181" PluginType="7"/>
<AudioDevice Name="Default_Motion_Device" ID="{9B88FFAE-6CFA-42EF-838E-FF37C4FE2A2F}" PluginName="Wwise Motion" CompanyID="0" PluginID="507" PluginType="7"/>
</ChildrenList>
</WorkUnit>
</AudioDevices>
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{FFCC0189-6C29-438D-BB61-C82823256831}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{FFCC0189-6C29-438D-BB61-C82823256831}" SchemaVersion="103">
<ControlSurfaceSessions>
<WorkUnit Name="Default Work Unit" ID="{FFCC0189-6C29-438D-BB61-C82823256831}" PersistMode="Standalone">
<ChildrenList>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{486EAAD7-4509-4EC2-9E86-8F3EF594D99E}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{486EAAD7-4509-4EC2-9E86-8F3EF594D99E}" SchemaVersion="103">
<Conversions>
<WorkUnit Name="Default Work Unit" ID="{486EAAD7-4509-4EC2-9E86-8F3EF594D99E}" PersistMode="Standalone">
<ChildrenList>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{F6B2880C-85E5-47FA-A126-645B5DFD9ACC}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{F6B2880C-85E5-47FA-A126-645B5DFD9ACC}" SchemaVersion="103">
<Conversions>
<WorkUnit Name="Factory Conversion Settings" ID="{F6B2880C-85E5-47FA-A126-645B5DFD9ACC}" PersistMode="Standalone">
<ChildrenList>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{154C6FA1-E6BD-4FB7-8B4E-9277549C36A9}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{154C6FA1-E6BD-4FB7-8B4E-9277549C36A9}" SchemaVersion="103">
<DynamicDialogue>
<WorkUnit Name="Default Work Unit" ID="{154C6FA1-E6BD-4FB7-8B4E-9277549C36A9}" PersistMode="Standalone"/>
</DynamicDialogue>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{69A8E943-DBD7-4286-8A8F-93CEEDE3C105}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{69A8E943-DBD7-4286-8A8F-93CEEDE3C105}" SchemaVersion="103">
<Effects>
<WorkUnit Name="Default Work Unit" ID="{69A8E943-DBD7-4286-8A8F-93CEEDE3C105}" PersistMode="Standalone"/>
</Effects>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{E8613F7D-BAD3-45CD-A3ED-505576F31277}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{E8613F7D-BAD3-45CD-A3ED-505576F31277}" SchemaVersion="103">
<Effects>
<WorkUnit Name="Factory Effects" ID="{E8613F7D-BAD3-45CD-A3ED-505576F31277}" PersistMode="Standalone">
<ChildrenList>
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{923039AD-F8B4-46D4-BDA7-CB5A6EE595E0}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{923039AD-F8B4-46D4-BDA7-CB5A6EE595E0}" SchemaVersion="103">
<Effects>
<WorkUnit Name="Factory Reflect" ID="{923039AD-F8B4-46D4-BDA7-CB5A6EE595E0}" PersistMode="Standalone">
<ChildrenList>
<Effect Name="Wwise_Reflect" ID="{37779A87-4754-4420-8175-3236FA46AA12}" PluginName="Wwise Reflect" CompanyID="0" PluginID="171" PluginType="3"> <PluginData>
<ReflectData>
<Effect Name="Wwise_Reflect" ID="{37779A87-4754-4420-8175-3236FA46AA12}" PluginName="Wwise Reflect" CompanyID="0" PluginID="171" PluginType="3"> <PluginData><ReflectData>
<CurveList Version="4">
<CurveInfo Name="Diffraction Attenuation">
<Curve Name="" ID="{D8294A76-FF48-4022-909E-6A5363A86A52}">
@@ -185,8 +184,7 @@
</Curve>
</CurveInfo>
</CurveList>
</ReflectData>
</PluginData>
</ReflectData></PluginData>
</Effect>
</ChildrenList>
</WorkUnit>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{4BAACE00-7345-4DD7-8629-0F6F17898934}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{4BAACE00-7345-4DD7-8629-0F6F17898934}" SchemaVersion="103">
<Events>
<WorkUnit Name="Default Work Unit" ID="{4BAACE00-7345-4DD7-8629-0F6F17898934}" PersistMode="Standalone">
<ChildrenList>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{2D571880-E275-4C6D-AC47-641D787245D7}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{2D571880-E275-4C6D-AC47-641D787245D7}" SchemaVersion="103">
<GameParameters>
<WorkUnit Name="Default Work Unit" ID="{2D571880-E275-4C6D-AC47-641D787245D7}" PersistMode="Standalone"/>
</GameParameters>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{D7135222-D1DB-42D0-ADC0-930743567776}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{D7135222-D1DB-42D0-ADC0-930743567776}" SchemaVersion="103">
<GameParameters>
<WorkUnit Name="Factory Motion" ID="{D7135222-D1DB-42D0-ADC0-930743567776}" PersistMode="Standalone">
<ChildrenList>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{3B167755-FB42-458B-98BF-96F557AFB3B9}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{3B167755-FB42-458B-98BF-96F557AFB3B9}" SchemaVersion="103">
<GameParameters>
<WorkUnit Name="Factory SoundSeed Air Game Syncs" ID="{3B167755-FB42-458B-98BF-96F557AFB3B9}" PersistMode="Standalone">
<ChildrenList>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{76F38728-61FD-4F36-B443-0B8823EEDA4C}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{76F38728-61FD-4F36-B443-0B8823EEDA4C}" SchemaVersion="103">
<InteractiveMusic>
<WorkUnit Name="Default Work Unit" ID="{76F38728-61FD-4F36-B443-0B8823EEDA4C}" PersistMode="Standalone"/>
</InteractiveMusic>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{5FA23641-44EA-43FE-B247-34724209F33E}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{5FA23641-44EA-43FE-B247-34724209F33E}" SchemaVersion="103">
<Busses>
<WorkUnit Name="Default Work Unit" ID="{5FA23641-44EA-43FE-B247-34724209F33E}" PersistMode="Standalone">
<ChildrenList>
@@ -9,13 +9,15 @@
<ObjectRef Name="System" ID="{D7E64BEE-3FAD-4E78-96A7-DA09B0437C67}" WorkUnitID="{5B99D375-82F5-411C-A21B-9B880B06219C}"/>
</Reference>
</ReferenceList>
<ObjectLists/>
</Bus>
<Bus Name="Motion Factory Bus" ID="{2AF9B9C6-6EF1-46E9-B5F2-E30C9E602C74}">
<ReferenceList>
<Reference Name="AudioDevice">
<ObjectRef Name="Default_Motion_Device" ID="{9B88FFAE-6CFA-42EF-838E-FF37C4FE2A2F}" WorkUnitID="{5B99D375-82F5-411C-A21B-9B880B06219C}"/>
<ObjectRef Name="System" ID="{D7E64BEE-3FAD-4E78-96A7-DA09B0437C67}" WorkUnitID="{5B99D375-82F5-411C-A21B-9B880B06219C}"/>
</Reference>
</ReferenceList>
<ObjectLists/>
</Bus>
</ChildrenList>
</WorkUnit>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{CED370BF-940B-4409-81D6-5065B816B3E1}" SchemaVersion="103">
<Metadatas>
<WorkUnit Name="Default Work Unit" ID="{CED370BF-940B-4409-81D6-5065B816B3E1}" PersistMode="Standalone"/>
</Metadatas>
</WwiseDocument>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{E391E9D0-8FDB-4BFC-BA4C-6E05CEFC3CEA}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{E391E9D0-8FDB-4BFC-BA4C-6E05CEFC3CEA}" SchemaVersion="103">
<MixingSessions>
<WorkUnit Name="Default Work Unit" ID="{E391E9D0-8FDB-4BFC-BA4C-6E05CEFC3CEA}" PersistMode="Standalone"/>
</MixingSessions>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{B4BC8D44-2D52-483B-82B2-C3F5B60116E5}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{B4BC8D44-2D52-483B-82B2-C3F5B60116E5}" SchemaVersion="103">
<Modulators>
<WorkUnit Name="Default Work Unit" ID="{B4BC8D44-2D52-483B-82B2-C3F5B60116E5}" PersistMode="Standalone"/>
</Modulators>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{D60E2E0D-C929-490E-8DC2-CC13CBA255DB}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{D60E2E0D-C929-490E-8DC2-CC13CBA255DB}" SchemaVersion="103">
<Presets>
<WorkUnit Name="Default Work Unit" ID="{D60E2E0D-C929-490E-8DC2-CC13CBA255DB}" PersistMode="Standalone"/>
</Presets>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{C4AA5FFA-27C8-411F-8EA9-8D5494E6DE5C}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{C4AA5FFA-27C8-411F-8EA9-8D5494E6DE5C}" SchemaVersion="103">
<Presets>
<WorkUnit Name="Factory Reflect" ID="{C4AA5FFA-27C8-411F-8EA9-8D5494E6DE5C}" PersistMode="Standalone">
<ChildrenList>
@@ -19,6 +19,7 @@
<ObjectRef Name="Wwise_Reflect" ID="{37779A87-4754-4420-8175-3236FA46AA12}" WorkUnitID="{923039AD-F8B4-46D4-BDA7-CB5A6EE595E0}"/>
</Reference>
</ReferenceList>
<ObjectLists/>
</AuxBus>
</ChildrenList>
</WorkUnit>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{F7AD8DCD-60E6-4873-9A71-65A083815696}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{F7AD8DCD-60E6-4873-9A71-65A083815696}" SchemaVersion="103">
<Presets>
<WorkUnit Name="Factory Spatial Audio" ID="{F7AD8DCD-60E6-4873-9A71-65A083815696}" PersistMode="Standalone">
<ChildrenList>
@@ -17,6 +17,7 @@
</Custom>
</Reference>
</ReferenceList>
<ObjectLists/>
</AuxBus>
</ChildrenList>
</WorkUnit>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{2B2EA699-A0B6-4C00-A5B1-F69AEE18AA07}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{2B2EA699-A0B6-4C00-A5B1-F69AEE18AA07}" SchemaVersion="103">
<Queries>
<WorkUnit Name="Default Work Unit" ID="{2B2EA699-A0B6-4C00-A5B1-F69AEE18AA07}" PersistMode="Standalone"/>
</Queries>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{7FBA6390-4CF1-44FA-9DA5-FC65F66E8FC0}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{7FBA6390-4CF1-44FA-9DA5-FC65F66E8FC0}" SchemaVersion="103">
<Queries>
<WorkUnit Name="Factory Queries" ID="{7FBA6390-4CF1-44FA-9DA5-FC65F66E8FC0}" PersistMode="Standalone">
<ChildrenList>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{10702ED9-8ECE-45A7-A97F-65B54062C132}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{10702ED9-8ECE-45A7-A97F-65B54062C132}" SchemaVersion="103">
<SoundBanks>
<WorkUnit Name="Default Work Unit" ID="{10702ED9-8ECE-45A7-A97F-65B54062C132}" PersistMode="Standalone">
<ChildrenList>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{3657F4B5-6E4E-49F2-A28A-D1E31B8F8C58}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{3657F4B5-6E4E-49F2-A28A-D1E31B8F8C58}" SchemaVersion="103">
<SoundcasterSessions>
<WorkUnit Name="Default Work Unit" ID="{3657F4B5-6E4E-49F2-A28A-D1E31B8F8C58}" PersistMode="Standalone"/>
</SoundcasterSessions>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{74C56E26-4EED-4C51-A533-13ADEE1D309F}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{74C56E26-4EED-4C51-A533-13ADEE1D309F}" SchemaVersion="103">
<States>
<WorkUnit Name="Default Work Unit" ID="{74C56E26-4EED-4C51-A533-13ADEE1D309F}" PersistMode="Standalone"/>
</States>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{EE99F72C-B8B4-41FB-8485-666940D1E26A}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{EE99F72C-B8B4-41FB-8485-666940D1E26A}" SchemaVersion="103">
<Switches>
<WorkUnit Name="Default Work Unit" ID="{EE99F72C-B8B4-41FB-8485-666940D1E26A}" PersistMode="Standalone"/>
</Switches>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{4F927547-2DA0-4184-9B93-816EBD387432}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{4F927547-2DA0-4184-9B93-816EBD387432}" SchemaVersion="103">
<Triggers>
<WorkUnit Name="Default Work Unit" ID="{4F927547-2DA0-4184-9B93-816EBD387432}" PersistMode="Standalone"/>
</Triggers>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{8AC6B54E-0A86-43A1-9484-716D7670BD0F}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{8AC6B54E-0A86-43A1-9484-716D7670BD0F}" SchemaVersion="103">
<VirtualAcoustics>
<WorkUnit Name="Default Work Unit" ID="{8AC6B54E-0A86-43A1-9484-716D7670BD0F}" PersistMode="Standalone"/>
</VirtualAcoustics>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WwiseDocument Type="WorkUnit" ID="{463D666B-3CA8-4FA5-8B4A-5FEF12B883F6}" SchemaVersion="97">
<WwiseDocument Type="WorkUnit" ID="{463D666B-3CA8-4FA5-8B4A-5FEF12B883F6}" SchemaVersion="103">
<VirtualAcoustics>
<WorkUnit Name="Factory Reflect Acoustic Textures" ID="{463D666B-3CA8-4FA5-8B4A-5FEF12B883F6}" PersistMode="Standalone">
<ChildrenList>
-35
View File
@@ -32,41 +32,6 @@ ly_add_target(
AZ::AzFramework
)
ly_add_target(
NAME CryCommon.EngineSettings.Static STATIC
NAMESPACE Legacy
FILES_CMAKE
crycommon_enginesettings_files.cmake
${pal_dir}/crycommon_enginesettings_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
INCLUDE_DIRECTORIES
PUBLIC
.
${pal_dir}
BUILD_DEPENDENCIES
PUBLIC
AZ::AzCore
AZ::AzFramework
)
ly_add_target(
NAME CryCommon.EngineSettings.RC.Static STATIC
NAMESPACE Legacy
FILES_CMAKE
crycommon_enginesettings_files.cmake
${pal_dir}/crycommon_enginesettings_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
INCLUDE_DIRECTORIES
PUBLIC
.
${pal_dir}
COMPILE_DEFINITIONS
PRIVATE
RESOURCE_COMPILER
BUILD_DEPENDENCIES
PUBLIC
AZ::AzCore
AZ::AzFramework
)
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
ly_add_target(
+1 -1
View File
@@ -31,7 +31,7 @@ void CryAssertTrace(const char* szFormat, ...)
return;
}
if (!gEnv->bIgnoreAllAsserts || gEnv->bTesting)
if (!gEnv->bIgnoreAllAsserts)
{
if (szFormat == NULL)
{
+1 -1
View File
@@ -34,7 +34,7 @@ void CryAssertTrace(const char* szFormat, ...)
return;
}
if (!gEnv->bIgnoreAllAsserts || gEnv->bTesting)
if (!gEnv->bIgnoreAllAsserts)
{
if (szFormat == NULL)
{
+1 -1
View File
@@ -30,7 +30,7 @@ void CryAssertTrace(const char* szFormat, ...)
return;
}
if (!gEnv->bIgnoreAllAsserts || gEnv->bTesting)
if (!gEnv->bIgnoreAllAsserts)
{
if (szFormat == NULL)
{
+1 -1
View File
@@ -31,7 +31,7 @@ void CryAssertTrace(const char* szFormat, ...)
return;
}
if (!gEnv->bIgnoreAllAsserts || gEnv->bTesting)
if (!gEnv->bIgnoreAllAsserts)
{
if (szFormat == NULL)
{
+1 -1
View File
@@ -305,7 +305,7 @@ void CryAssertTrace(const char* _pszFormat, ...)
{
return;
}
if (!gEnv->bIgnoreAllAsserts || gEnv->bTesting)
if (!gEnv->bIgnoreAllAsserts)
{
if (NULL == _pszFormat)
{
-6
View File
@@ -49,12 +49,6 @@ public:
//! ISystem has shut down.
virtual void OnCrySystemPostShutdown() {}
//! Engine pre physics update.
virtual void OnCrySystemPrePhysicsUpdate() {}
//! Engine post physics update.
virtual void OnCrySystemPostPhysicsUpdate() {}
//! Sent when a new level is being created.
virtual void OnCryEditorBeginCreate() {}
-3
View File
@@ -37,9 +37,6 @@ enum CryLockType
#define CRYLOCK_HAVE_FASTLOCK 1
void CryThreadSetName(threadID nThreadId, const char* sThreadName);
const char* CryThreadGetName(threadID nThreadId);
/////////////////////////////////////////////////////////////////////////////
//
// Primitive locks and conditions.
-19
View File
@@ -31,22 +31,3 @@
#else
// Put other platform specific includes here!
#endif
#include <IThreadTask.h>
void CryThreadSetName(threadID dwThreadId, const char* sThreadName)
{
if (gEnv && gEnv->pSystem && gEnv->pSystem->GetIThreadTaskManager())
{
gEnv->pSystem->GetIThreadTaskManager()->SetThreadName(dwThreadId, sThreadName);
}
}
const char* CryThreadGetName(threadID dwThreadId)
{
if (gEnv && gEnv->pSystem && gEnv->pSystem->GetIThreadTaskManager())
{
return gEnv->pSystem->GetIThreadTaskManager()->GetThreadName(dwThreadId);
}
return "";
}
@@ -13,8 +13,6 @@
#pragma once
//#include <IThreadTask.h>
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
@@ -249,10 +249,6 @@ public:
void SetName(const char* Name)
{
m_name = Name;
if (m_threadId)
{
CryThreadSetName(m_threadId, m_name);
}
}
const char* GetName() { return m_name; }
@@ -289,11 +285,6 @@ private:
self->m_bIsStarted = true;
self->m_bIsRunning = true;
if (!self->m_name.empty())
{
CryThreadSetName(-1, self->m_name);
}
self->m_Runnable->Run();
self->m_bIsRunning = false;
self->m_bCreatedThread = false;
@@ -311,11 +302,6 @@ private:
self->m_bIsStarted = true;
self->m_bIsRunning = true;
if (!self->m_name.empty())
{
CryThreadSetName(-1, self->m_name);
}
self->Run();
self->m_bIsRunning = false;
self->m_bCreatedThread = false;
@@ -1,34 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include "EngineSettingsBackend.h"
#ifdef CRY_ENABLE_RC_HELPER
CEngineSettingsBackend::CEngineSettingsBackend(CEngineSettingsManager* parent, const wchar_t* moduleName)
: m_parent(parent)
, m_moduleName()
{
if (moduleName != nullptr)
{
m_moduleName = moduleName;
}
}
CEngineSettingsBackend::~CEngineSettingsBackend()
{
}
#endif // CRY_ENABLE_RC_HELPER
@@ -1,65 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#ifndef CRYINCLUDE_CRYCOMMON_ENGINESETTINGSBACKEND_H
#define CRYINCLUDE_CRYCOMMON_ENGINESETTINGSBACKEND_H
#pragma once
#include "ProjectDefines.h"
#ifdef CRY_ENABLE_RC_HELPER
#include "SettingsManagerHelpers.h"
#include <string>
class CEngineSettingsManager;
class CEngineSettingsBackend
{
public:
CEngineSettingsBackend(CEngineSettingsManager* parent, const wchar_t* moduleName = NULL);
virtual ~CEngineSettingsBackend();
virtual std::wstring GetModuleFilePath() const = 0;
virtual bool GetModuleSpecificStringEntryUtf16(const char* key, SettingsManagerHelpers::CWCharBuffer wbuffer) = 0;
virtual bool GetModuleSpecificIntEntry(const char* key, int& value) = 0;
virtual bool GetModuleSpecificBoolEntry(const char* key, bool& value) = 0;
virtual bool SetModuleSpecificStringEntryUtf16(const char* key, const wchar_t* str) = 0;
virtual bool SetModuleSpecificIntEntry(const char* key, const int& value) = 0;
virtual bool SetModuleSpecificBoolEntry(const char* key, const bool& value) = 0;
virtual bool GetInstalledBuildRootPathUtf16(const int index, SettingsManagerHelpers::CWCharBuffer name, SettingsManagerHelpers::CWCharBuffer path) = 0;
virtual void LoadEngineSettingsFromRegistry() = 0;
virtual bool StoreEngineSettingsToRegistry() = 0;
protected:
CEngineSettingsManager* parent() const
{
return m_parent;
}
const std::wstring& moduleName() const
{
return m_moduleName;
}
private:
std::wstring m_moduleName;
CEngineSettingsManager* m_parent;
};
#endif // CRY_ENABLE_RC_HELPER
#endif // CRYINCLUDE_CRYCOMMON_ENGINESETTINGSBACKEND_H
@@ -1,486 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include "EngineSettingsBackendApple.h"
#ifdef CRY_ENABLE_RC_HELPER
#include "AzCore/PlatformDef.h"
#if AZ_TRAIT_OS_PLATFORM_APPLE
#include "EngineSettingsManager.h"
#include "SettingsManagerHelpers.h"
#include "platform.h"
#include <dlfcn.h>
#include <mach-o/dyld.h>
#include <mach-o/nlist.h>
#include <cassert>
#include <codecvt>
#include <cstdlib>
#include <fstream>
#include <map>
#include <string>
using namespace SettingsManagerHelpers;
static const char gDefaultRegistryLocation[] = "/EngineSettings.reg";
#define REG_SOFTWARE L"Software\\"
#define REG_COMPANY_NAME L"Amazon\\"
#define REG_PRODUCT_NAME L"Lumberyard\\"
#define REG_SETTING L"Settings\\"
#define REG_BASE_SETTING_KEY REG_SOFTWARE REG_COMPANY_NAME REG_PRODUCT_NAME REG_SETTING
//////////////////////////////////////////////////////////////////////////
class SimpleRegistry
{
typedef std::map< std::wstring, std::wstring > WStringMap;
std::map< std::wstring, WStringMap * > m_modules;
public:
SimpleRegistry();
~SimpleRegistry();
void setBoolValue(const std::wstring& module, const std::wstring& key, bool value);
void setIntValue(const std::wstring& module, const std::wstring& key, int value);
void setStrValue(const std::wstring& module, const std::wstring& key, const std::wstring& value);
bool getBoolValue(const std::wstring& module, const std::wstring& key, bool& value);
bool getIntValue(const std::wstring& module, const std::wstring& key, int& value);
bool getStrValue(const std::wstring& module, const std::wstring& key, std::wstring& value);
bool loadFromFile(const char* fileName);
bool saveToFile(const char* fileName);
protected:
void clear();
private:
static const wchar_t gSimpleMagic[];
static const size_t gMetaCharCount;
};
const wchar_t SimpleRegistry::gSimpleMagic[] = L"FR0";
const size_t SimpleRegistry::gMetaCharCount = sizeof(size_t) / sizeof(wchar_t);
SimpleRegistry::SimpleRegistry()
{
}
SimpleRegistry::~SimpleRegistry()
{
clear();
}
void SimpleRegistry::setBoolValue(const std::wstring& module, const std::wstring& key, bool value)
{
return setStrValue(module, key, value ? L"true" : L"false");
}
void SimpleRegistry::setIntValue(const std::wstring& module, const std::wstring& key, int value)
{
return setStrValue(module, key, std::to_wstring(value));
}
void SimpleRegistry::setStrValue(const std::wstring& module, const std::wstring& key, const std::wstring& value)
{
WStringMap *map = nullptr;
auto i = m_modules.find(module);
if (i == m_modules.end())
{
map = new WStringMap;
m_modules.emplace(module, map);
}
else
{
map = i->second;
}
assert(map);
(*map)[key] = value;
}
bool SimpleRegistry::getBoolValue(const std::wstring& module, const std::wstring& key, bool& value)
{
std::wstring str;
if (!getStrValue(module, key, str))
{
return false;
}
value = (0 == str.compare(L"true"));
return true;
}
bool SimpleRegistry::getIntValue(const std::wstring& module, const std::wstring& key, int& value)
{
std::wstring str;
if (!getStrValue(module, key, str))
{
return false;
}
value = std::stoi(str);
return true;
}
bool SimpleRegistry::getStrValue(const std::wstring& module, const std::wstring& key, std::wstring& value)
{
WStringMap *map = nullptr;
auto mi = m_modules.find(module);
if (mi == m_modules.end())
{
return false;
}
map = mi->second;
assert(map);
auto ki = map->find(key);
if (ki == map->end())
{
return false;
}
value = ki->second;
return true;
}
bool SimpleRegistry::loadFromFile(const char* fileName)
{
clear();
std::wifstream file(fileName, std::ios_base::in|std::ios_base::binary);
file.imbue(std::locale(file.getloc(), new std::codecvt_utf16<wchar_t>));
if (!file.is_open())
{
AZ_Warning("EngineSettings", false, "Failed to open registry settings file: %s", fileName);
return false;
}
std::wstring module;
std::wstring key;
std::wstring value;
wchar_t buffer[512];
size_t size;
wchar_t meta[gMetaCharCount];
/* magic number */
if(!file.read(buffer, sizeof(gSimpleMagic) / sizeof(wchar_t)) ||
wcsncmp(gSimpleMagic, buffer, sizeof(gSimpleMagic) / sizeof(wchar_t)) != 0)
{
file.close();
AZ_Warning("EngineSettings", false, "Failed to load registry settings from file: %s", fileName);
return false;
}
while (file.good())
{
file.read(meta, gMetaCharCount);
if (!file.good())
{
break;
}
memcpy(&size, meta, sizeof(size));
file.read(buffer, size);
buffer[file.gcount()] = L'\0';
module = buffer;
file.read(meta, gMetaCharCount);
memcpy(&size, meta, sizeof(size));
file.read(buffer, size);
buffer[file.gcount()] = L'\0';
key = buffer;
file.read(meta, gMetaCharCount);
memcpy(&size, meta, sizeof(size));
file.read(buffer, size);
buffer[file.gcount()] = L'\0';
value = buffer;
setStrValue(module, key, value);
}
file.close();
return true;
}
bool SimpleRegistry::saveToFile(const char* fileName)
{
std::wofstream file(fileName, std::ios_base::out|std::ios_base::trunc|std::ios_base::binary);
file.imbue(std::locale(file.getloc(), new std::codecvt_utf16<wchar_t>));
if (!file.is_open())
{
return false;
}
std::wstring module;
size_t size;
wchar_t meta[gMetaCharCount];
/* magic number */
file.write(gSimpleMagic, sizeof(gSimpleMagic) / sizeof(wchar_t));
for (auto j : m_modules)
{
module = j.first;
for (auto i : *j.second)
{
size = module.size();
memcpy(meta, &size, sizeof(meta));
file.write(meta, gMetaCharCount);
file.write(module.c_str(), size);
size = i.first.size();
memcpy(meta, &size, sizeof(meta));
file.write(meta, gMetaCharCount);
file.write(i.first.c_str(), size);
size = i.second.size();
memcpy(meta, &size, sizeof(meta));
file.write(meta, gMetaCharCount);
file.write(i.second.c_str(), size);
}
}
file.close();
return true;
}
void SimpleRegistry::clear()
{
for (auto pair : m_modules)
{
delete pair.second;
}
m_modules.clear();
}
//////////////////////////////////////////////////////////////////////////
CEngineSettingsBackendApple::CEngineSettingsBackendApple(CEngineSettingsManager* parent, const wchar_t* moduleName)
: CEngineSettingsBackend(parent, moduleName)
, m_registry(new SimpleRegistry)
, m_registryFilePath()
{
std::string rootValue = gEnv->pFileIO->GetAlias("@root@");
if (rootValue.empty())
{
AZ_Warning("EngineSettings", false, "Could not get engine root.");
return;
}
rootValue.append(gDefaultRegistryLocation);
m_registryFilePath = rootValue;
}
CEngineSettingsBackendApple::~CEngineSettingsBackendApple()
{
delete m_registry, m_registry = nullptr;
}
std::wstring CEngineSettingsBackendApple::GetModuleFilePath() const
{
std::string path;
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
std::string module = converter.to_bytes(moduleName());
void* handle = ::dlopen(module.c_str(), RTLD_LAZY);
if (handle)
{
const int c = _dyld_image_count();
for (int i = 0; i < c; ++i)
{
const char* image = _dyld_get_image_name(i);
const void* altHandle = dlopen(image, RTLD_LAZY);
if (handle == altHandle)
{
char absImage[PATH_MAX];
realpath(image, absImage);
char *ext = rindex(absImage, '.');
if (ext)
{
*ext = '\0';
}
path.append(absImage);
path.append(".ini");
break;
}
}
}
return converter.from_bytes(path);
}
bool CEngineSettingsBackendApple::GetModuleSpecificStringEntryUtf16(const char* key, CWCharBuffer wbuffer)
{
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
std::wstring wkey = converter.from_bytes(key);
std::wstring str;
if (!m_registry->getStrValue(moduleName(), wkey, str))
{
return false;
}
std::wcscpy(wbuffer.getPtr(), str.c_str());
return true;
}
bool CEngineSettingsBackendApple::GetModuleSpecificIntEntry(const char* key, int& value)
{
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
std::wstring wkey = converter.from_bytes(key);
return m_registry->getIntValue(moduleName(), wkey, value);
}
bool CEngineSettingsBackendApple::GetModuleSpecificBoolEntry(const char* key, bool& value)
{
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
std::wstring wkey = converter.from_bytes(key);
return m_registry->getBoolValue(moduleName(), wkey, value);
}
bool CEngineSettingsBackendApple::SetModuleSpecificStringEntryUtf16(const char* key, const wchar_t* str)
{
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
std::wstring wkey = converter.from_bytes(key);
m_registry->setStrValue(moduleName(), wkey, str);
return true;
}
bool CEngineSettingsBackendApple::SetModuleSpecificIntEntry(const char* key, const int& value)
{
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
std::wstring wkey = converter.from_bytes(key);
m_registry->setIntValue(moduleName(), wkey, value);
return true;
}
bool CEngineSettingsBackendApple::SetModuleSpecificBoolEntry(const char* key, const bool& value)
{
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
std::wstring wkey = converter.from_bytes(key);
m_registry->setBoolValue(moduleName(), wkey, value);
return true;
}
bool CEngineSettingsBackendApple::GetInstalledBuildRootPathUtf16(const int index, CWCharBuffer name, CWCharBuffer path)
{
return false;
}
bool CEngineSettingsBackendApple::StoreEngineSettingsToRegistry()
{
bool bRet = true;
wchar_t buffer[1024];
// ResourceCompiler Specific
if (parent()->GetValueByRef("RC_ShowWindow", SettingsManagerHelpers::CWCharBuffer(buffer, sizeof(buffer))))
{
const bool b = wcscmp(buffer, L"true") == 0;
m_registry->setBoolValue(REG_BASE_SETTING_KEY, L"RC_ShowWindow", b);
}
if (parent()->GetValueByRef("RC_HideCustom", SettingsManagerHelpers::CWCharBuffer(buffer, sizeof(buffer))))
{
const bool b = wcscmp(buffer, L"true") == 0;
m_registry->setBoolValue(REG_BASE_SETTING_KEY, L"RC_HideCustom", b);
}
if (parent()->GetValueByRef("RC_Parameters", SettingsManagerHelpers::CWCharBuffer(buffer, sizeof(buffer))))
{
m_registry->setStrValue(REG_BASE_SETTING_KEY, L"RC_Parameters", buffer);
}
if (parent()->GetValueByRef("RC_EnableSourceControl", SettingsManagerHelpers::CWCharBuffer(buffer, sizeof(buffer))))
{
const bool b = wcscmp(buffer, L"true") == 0;
m_registry->setBoolValue(REG_BASE_SETTING_KEY, L"RC_EnableSourceControl", b);
}
bRet &= m_registry->saveToFile(m_registryFilePath.c_str());
return bRet;
}
void CEngineSettingsBackendApple::LoadEngineSettingsFromRegistry()
{
if (!m_registry->loadFromFile(m_registryFilePath.c_str()))
{
return;
}
std::wstring wStrResult;
bool bResult;
if (m_registry->getStrValue(REG_BASE_SETTING_KEY, L"RootPath", wStrResult))
{
parent()->SetKey("ENG_RootPath", wStrResult.c_str());
}
// Engine Specific
if (m_registry->getStrValue(REG_BASE_SETTING_KEY, L"ENG_RootPath", wStrResult))
{
parent()->SetKey("ENG_RootPath", wStrResult.c_str());
}
// ResourceCompiler Specific
if (m_registry->getBoolValue(REG_BASE_SETTING_KEY, L"RC_ShowWindow", bResult))
{
parent()->SetKey("RC_ShowWindow", bResult);
}
if (m_registry->getBoolValue(REG_BASE_SETTING_KEY, L"RC_HideCustom", bResult))
{
parent()->SetKey("RC_HideCustom", bResult);
}
if (m_registry->getStrValue(REG_BASE_SETTING_KEY, L"RC_Parameters", wStrResult))
{
parent()->SetKey("RC_Parameters", wStrResult.c_str());
}
if (m_registry->getBoolValue(REG_BASE_SETTING_KEY, L"RC_EnableSourceControl", bResult))
{
parent()->SetKey("RC_EnableSourceControl", bResult);
}
}
#endif // AZ_TRAIT_OS_PLATFORM_APPLE
#endif // CRY_ENABLE_RC_HELPER
@@ -1,51 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#ifndef CRYINCLUDE_CRYCOMMON_ENGINESETTINGSBACKENDAPPLE_H
#define CRYINCLUDE_CRYCOMMON_ENGINESETTINGSBACKENDAPPLE_H
#pragma once
#include "EngineSettingsBackend.h"
#ifdef CRY_ENABLE_RC_HELPER
class CEngineSettingsManager;
class SimpleRegistry;
class CEngineSettingsBackendApple : public CEngineSettingsBackend
{
public:
CEngineSettingsBackendApple(CEngineSettingsManager* parent, const wchar_t* moduleName = NULL);
~CEngineSettingsBackendApple();
std::wstring GetModuleFilePath() const override;
bool GetModuleSpecificStringEntryUtf16(const char* key, SettingsManagerHelpers::CWCharBuffer wbuffer) override;
bool GetModuleSpecificIntEntry(const char* key, int& value) override;
bool GetModuleSpecificBoolEntry(const char* key, bool& value) override;
bool SetModuleSpecificStringEntryUtf16(const char* key, const wchar_t* str) override;
bool SetModuleSpecificIntEntry(const char* key, const int& value) override;
bool SetModuleSpecificBoolEntry(const char* key, const bool& value) override;
bool GetInstalledBuildRootPathUtf16(const int index, SettingsManagerHelpers::CWCharBuffer name, SettingsManagerHelpers::CWCharBuffer path) override;
void LoadEngineSettingsFromRegistry() override;
bool StoreEngineSettingsToRegistry() override;
private:
SimpleRegistry *m_registry;
std::string m_registryFilePath;
};
#endif // CRY_ENABLE_RC_HELPER
#endif // CRYINCLUDE_CRYCOMMON_ENGINESETTINGSBACKENDAPPLE_H
@@ -1,431 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include "EngineSettingsBackendWin32.h"
#ifdef CRY_ENABLE_RC_HELPER
#include "AzCore/PlatformDef.h"
#ifdef AZ_PLATFORM_WINDOWS
#include "EngineSettingsManager.h"
#include "platform.h"
#include <windows.h>
#define REG_SOFTWARE L"Software\\"
#define REG_COMPANY_NAME L"Amazon\\"
#define REG_PRODUCT_NAME L"Open 3D Engine\\"
#define REG_SETTING L"Settings\\"
#define REG_BASE_SETTING_KEY REG_SOFTWARE REG_COMPANY_NAME REG_PRODUCT_NAME REG_SETTING
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
using namespace SettingsManagerHelpers;
static bool g_bWindowQuit;
static CEngineSettingsManager* g_pThis = 0;
static const unsigned int IDC_hEditRootPath = 100;
static const unsigned int IDC_hBtnBrowse = 101;
namespace
{
class RegKey
{
public:
RegKey(const wchar_t* key, bool writeable);
~RegKey();
void* pKey;
};
RegKey::RegKey(const wchar_t* key, bool writeable)
{
HKEY hKey;
LONG result;
if (writeable)
{
result = RegCreateKeyExW(HKEY_CURRENT_USER, key, 0, 0, 0, KEY_WRITE, 0, &hKey, 0);
}
else
{
result = RegOpenKeyExW(HKEY_CURRENT_USER, key, 0, KEY_READ, &hKey);
}
pKey = hKey;
}
RegKey::~RegKey()
{
RegCloseKey((HKEY)pKey);
}
}
CEngineSettingsBackendWin32::CEngineSettingsBackendWin32(CEngineSettingsManager* parent, const wchar_t* moduleName)
: CEngineSettingsBackend(parent, moduleName)
{
}
std::wstring CEngineSettingsBackendWin32::GetModuleFilePath() const
{
wchar_t szFilename[_MAX_PATH];
GetModuleFileNameW((HINSTANCE)&__ImageBase, szFilename, _MAX_PATH);
wchar_t drive[_MAX_DRIVE];
wchar_t dir[_MAX_DIR];
wchar_t fname[_MAX_FNAME];
wchar_t ext[1] = L"";
_wsplitpath_s(szFilename, drive, dir, fname, ext);
_wmakepath_s(szFilename, drive, dir, fname, L"ini");
return szFilename;
}
bool CEngineSettingsBackendWin32::GetModuleSpecificStringEntryUtf16(const char* key, CWCharBuffer wbuffer)
{
CFixedString<wchar_t, 256> s = REG_BASE_SETTING_KEY;
s.append(moduleName().c_str());
RegKey superKey(s.c_str(), false);
if (!superKey.pKey)
{
wbuffer[0] = 0;
return false;
}
if (!GetRegValue(superKey.pKey, key, wbuffer))
{
wbuffer[0] = 0;
return false;
}
return true;
}
bool CEngineSettingsBackendWin32::GetModuleSpecificIntEntry(const char* key, int& value)
{
CFixedString<wchar_t, 256> s = REG_BASE_SETTING_KEY;
s.append(moduleName().c_str());
RegKey superKey(s.c_str(), false);
if (!superKey.pKey)
{
return false;
}
if (!GetRegValue(superKey.pKey, key, value))
{
value = 0;
return false;
}
return true;
}
bool CEngineSettingsBackendWin32::GetModuleSpecificBoolEntry(const char* key, bool& value)
{
CFixedString<wchar_t, 256> s = REG_BASE_SETTING_KEY;
s.append(moduleName().c_str());
RegKey superKey(s.c_str(), false);
if (!superKey.pKey)
{
return false;
}
if (!GetRegValue(superKey.pKey, key, value))
{
value = false;
return false;
}
return true;
}
bool CEngineSettingsBackendWin32::SetModuleSpecificStringEntryUtf16(const char* key, const wchar_t* str)
{
CFixedString<wchar_t, 256> s = REG_BASE_SETTING_KEY;
s.append(moduleName().c_str());
RegKey superKey(s.c_str(), true);
if (superKey.pKey)
{
return SetRegValue(superKey.pKey, key, str);
}
return false;
}
bool CEngineSettingsBackendWin32::SetModuleSpecificIntEntry(const char* key, const int& value)
{
CFixedString<wchar_t, 256> s = REG_BASE_SETTING_KEY;
s.append(moduleName().c_str());
RegKey superKey(s.c_str(), true);
if (superKey.pKey)
{
return SetRegValue(superKey.pKey, key, value);
}
return false;
}
bool CEngineSettingsBackendWin32::SetModuleSpecificBoolEntry(const char* key, const bool& value)
{
CFixedString<wchar_t, 256> s = REG_BASE_SETTING_KEY;
s.append(moduleName().c_str());
RegKey superKey(s.c_str(), true);
if (superKey.pKey)
{
return SetRegValue(superKey.pKey, key, value);
}
return false;
}
bool CEngineSettingsBackendWin32::GetInstalledBuildRootPathUtf16(const int index, CWCharBuffer name, CWCharBuffer path)
{
RegKey key(REG_BASE_SETTING_KEY L"O3DEExport\\ProjectBuilds", false);
if (key.pKey)
{
DWORD type;
DWORD nameSizeInBytes = DWORD(name.getSizeInBytes());
DWORD pathSizeInBytes = DWORD(path.getSizeInBytes());
LONG result = RegEnumValueW((HKEY)key.pKey, index, name.getPtr(), &nameSizeInBytes, NULL, &type, (BYTE*)path.getPtr(), &pathSizeInBytes);
if (result == ERROR_SUCCESS)
{
return true;
}
}
return false;
}
bool CEngineSettingsBackendWin32::StoreEngineSettingsToRegistry()
{
// make sure the path in registry exists
{
RegKey key0(REG_SOFTWARE REG_COMPANY_NAME, true);
if (!key0.pKey)
{
RegKey software(REG_SOFTWARE, true);
HKEY hKey;
RegCreateKeyW((HKEY)software.pKey, REG_COMPANY_NAME, &hKey);
if (!hKey)
{
return false;
}
}
RegKey key1(REG_SOFTWARE REG_COMPANY_NAME REG_PRODUCT_NAME, true);
if (!key1.pKey)
{
RegKey softwareCompany(REG_SOFTWARE REG_COMPANY_NAME, true);
HKEY hKey;
RegCreateKeyW((HKEY)softwareCompany.pKey, REG_COMPANY_NAME, &hKey);
if (!hKey)
{
return false;
}
}
RegKey key2(REG_BASE_SETTING_KEY, true);
if (!key2.pKey)
{
RegKey softwareCompanyProduct(REG_SOFTWARE REG_COMPANY_NAME REG_PRODUCT_NAME, true);
HKEY hKey;
RegCreateKeyW((HKEY)key2.pKey, REG_SETTING, &hKey);
if (!hKey)
{
return false;
}
}
}
bool bRet = true;
RegKey key(REG_BASE_SETTING_KEY, true);
if (!key.pKey)
{
bRet = false;
}
else
{
wchar_t buffer[1024];
// ResourceCompiler Specific
if (parent()->GetValueByRef("RC_ShowWindow", SettingsManagerHelpers::CWCharBuffer(buffer, sizeof(buffer))))
{
const bool b = wcscmp(buffer, L"true") == 0;
SetRegValue(key.pKey, "RC_ShowWindow", b);
}
if (parent()->GetValueByRef("RC_HideCustom", SettingsManagerHelpers::CWCharBuffer(buffer, sizeof(buffer))))
{
const bool b = wcscmp(buffer, L"true") == 0;
SetRegValue(key.pKey, "RC_HideCustom", b);
}
if (parent()->GetValueByRef("RC_Parameters", SettingsManagerHelpers::CWCharBuffer(buffer, sizeof(buffer))))
{
SetRegValue(key.pKey, "RC_Parameters", buffer);
}
if (parent()->GetValueByRef("RC_EnableSourceControl", SettingsManagerHelpers::CWCharBuffer(buffer, sizeof(buffer))))
{
const bool b = wcscmp(buffer, L"true") == 0;
SetRegValue(key.pKey, "RC_EnableSourceControl", b);
}
}
return bRet;
}
void CEngineSettingsBackendWin32::LoadEngineSettingsFromRegistry()
{
wchar_t buffer[1024];
bool bResult;
// Engine Specific (Deprecated value)
RegKey key(REG_BASE_SETTING_KEY, false);
if (key.pKey)
{
if (GetRegValue(key.pKey, "RootPath", SettingsManagerHelpers::CWCharBuffer(buffer, sizeof(buffer))))
{
parent()->SetKey("ENG_RootPath", buffer);
}
// Engine Specific
if (GetRegValue(key.pKey, "ENG_RootPath", SettingsManagerHelpers::CWCharBuffer(buffer, sizeof(buffer))))
{
parent()->SetKey("ENG_RootPath", buffer);
}
// ResourceCompiler Specific
if (GetRegValue(key.pKey, "RC_ShowWindow", bResult))
{
parent()->SetKey("RC_ShowWindow", bResult);
}
if (GetRegValue(key.pKey, "RC_HideCustom", bResult))
{
parent()->SetKey("RC_HideCustom", bResult);
}
if (GetRegValue(key.pKey, "RC_Parameters", SettingsManagerHelpers::CWCharBuffer(buffer, sizeof(buffer))))
{
parent()->SetKey("RC_Parameters", buffer);
}
if (GetRegValue(key.pKey, "RC_EnableSourceControl", bResult))
{
parent()->SetKey("RC_EnableSourceControl", bResult);
}
}
}
bool CEngineSettingsBackendWin32::SetRegValue(void* key, const char* valueName, const wchar_t* value)
{
CFixedString<wchar_t, 256> name;
name.appendAscii(valueName);
size_t const sizeInBytes = (wcslen(value) + 1) * sizeof(value[0]);
return (ERROR_SUCCESS == RegSetValueExW((HKEY)key, name.c_str(), 0, REG_SZ, (BYTE*)value, DWORD(sizeInBytes)));
}
bool CEngineSettingsBackendWin32::SetRegValue(void* key, const char* valueName, bool value)
{
CFixedString<wchar_t, 256> name;
name.appendAscii(valueName);
DWORD dwVal = value;
return (ERROR_SUCCESS == RegSetValueExW((HKEY)key, name.c_str(), 0, REG_DWORD, (BYTE*)&dwVal, sizeof(dwVal)));
}
bool CEngineSettingsBackendWin32::SetRegValue(void* key, const char* valueName, int value)
{
CFixedString<wchar_t, 256> name;
name.appendAscii(valueName);
DWORD dwVal = value;
return (ERROR_SUCCESS == RegSetValueExW((HKEY)key, name.c_str(), 0, REG_DWORD, (BYTE*)&dwVal, sizeof(dwVal)));
}
bool CEngineSettingsBackendWin32::GetRegValue(void* key, const char* valueName, CWCharBuffer wbuffer)
{
if (wbuffer.getSizeInElements() <= 0)
{
return false;
}
CFixedString<wchar_t, 256> name;
name.appendAscii(valueName);
DWORD type;
DWORD sizeInBytes = DWORD(wbuffer.getSizeInBytes());
if (ERROR_SUCCESS != RegQueryValueExW((HKEY)key, name.c_str(), NULL, &type, (BYTE*)wbuffer.getPtr(), &sizeInBytes))
{
wbuffer[0] = 0;
return false;
}
const size_t sizeInElements = sizeInBytes / sizeof(wbuffer[0]);
if (sizeInElements > wbuffer.getSizeInElements()) // paranoid check
{
wbuffer[0] = 0;
return false;
}
// According to MSDN documentation for RegQueryValueEx(), strings returned by the function
// are not zero-terminated sometimes, so we need to terminate them by ourselves.
if (wbuffer[sizeInElements - 1] != 0)
{
if (sizeInElements >= wbuffer.getSizeInElements())
{
// No space left to put terminating zero character
wbuffer[0] = 0;
return false;
}
wbuffer[sizeInElements] = 0;
}
return true;
}
bool CEngineSettingsBackendWin32::GetRegValue(void* key, const char* valueName, bool& value)
{
CFixedString<wchar_t, 256> name;
name.appendAscii(valueName);
// Open the appropriate registry key
DWORD type, dwVal = 0, size = sizeof(dwVal);
bool res = (ERROR_SUCCESS == RegQueryValueExW((HKEY)key, name.c_str(), NULL, &type, (BYTE*)&dwVal, &size));
if (res)
{
value = (dwVal != 0);
}
else
{
wchar_t buffer[100];
res = GetRegValue(key, valueName, CWCharBuffer(buffer, sizeof(buffer)));
if (res)
{
value = (wcscmp(buffer, L"true") == 0);
}
}
return res;
}
bool CEngineSettingsBackendWin32::GetRegValue(void* key, const char* valueName, int& value)
{
CFixedString<wchar_t, 256> name;
name.appendAscii(valueName);
// Open the appropriate registry key
DWORD type, dwVal = 0, size = sizeof(dwVal);
bool res = (ERROR_SUCCESS == RegQueryValueExW((HKEY)key, name.c_str(), NULL, &type, (BYTE*)&dwVal, &size));
if (res)
{
value = dwVal;
}
return res;
}
#endif // AZ_PLATFORM_WINDOWS
#endif // CRY_ENABLE_RC_HELPER
@@ -1,53 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#ifndef CRYINCLUDE_CRYCOMMON_ENGINESETTINGSBACKENDWIN32_H
#define CRYINCLUDE_CRYCOMMON_ENGINESETTINGSBACKENDWIN32_H
#pragma once
#include "EngineSettingsBackend.h"
#ifdef CRY_ENABLE_RC_HELPER
class CEngineSettingsManager;
class CEngineSettingsBackendWin32 : public CEngineSettingsBackend
{
public:
CEngineSettingsBackendWin32(CEngineSettingsManager* parent, const wchar_t* moduleName = NULL);
std::wstring GetModuleFilePath() const override;
bool GetModuleSpecificStringEntryUtf16(const char* key, SettingsManagerHelpers::CWCharBuffer wbuffer) override;
bool GetModuleSpecificIntEntry(const char* key, int& value) override;
bool GetModuleSpecificBoolEntry(const char* key, bool& value) override;
bool SetModuleSpecificStringEntryUtf16(const char* key, const wchar_t* str) override;
bool SetModuleSpecificIntEntry(const char* key, const int& value) override;
bool SetModuleSpecificBoolEntry(const char* key, const bool& value) override;
bool GetInstalledBuildRootPathUtf16(const int index, SettingsManagerHelpers::CWCharBuffer name, SettingsManagerHelpers::CWCharBuffer path) override;
void LoadEngineSettingsFromRegistry() override;
bool StoreEngineSettingsToRegistry() override;
protected:
bool SetRegValue(void* key, const char* valueName, const wchar_t* value);
bool SetRegValue(void* key, const char* valueName, bool value);
bool SetRegValue(void* key, const char* valueName, int value);
bool GetRegValue(void* key, const char* valueName, SettingsManagerHelpers::CWCharBuffer wbuffer);
bool GetRegValue(void* key, const char* valueName, bool& value);
bool GetRegValue(void* key, const char* valueName, int& value);
};
#endif // CRY_ENABLE_RC_HELPER
#endif // CRYINCLUDE_CRYCOMMON_ENGINESETTINGSBACKENDWIN32_H
@@ -1,479 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#include "ProjectDefines.h"
#include "EngineSettingsManager.h"
#if defined(CRY_ENABLE_RC_HELPER)
#include <assert.h> // assert()
#include "EngineSettingsBackend.h"
#include "AzCore/PlatformDef.h"
#include "platform.h"
#if defined(AZ_PLATFORM_WINDOWS)
#include "EngineSettingsBackendWin32.h"
#include <AzCore/PlatformIncl.h>
#elif AZ_TRAIT_OS_PLATFORM_APPLE
#include "EngineSettingsBackendApple.h"
#endif
#include <climits>
#include <cstdio>
#define INFOTEXT L"Please specify the directory of your CryENGINE installation (RootPath):"
using namespace SettingsManagerHelpers;
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
CEngineSettingsManager::CEngineSettingsManager(const wchar_t* moduleName, const wchar_t* iniFileName)
: m_hWndParent(0)
, m_backend(NULL)
{
m_sModuleName.clear();
#if defined(AZ_PLATFORM_WINDOWS)
m_backend = new CEngineSettingsBackendWin32(this, moduleName);
#elif AZ_TRAIT_OS_PLATFORM_APPLE
m_backend = new CEngineSettingsBackendApple(this, moduleName);
#endif
assert(m_backend);
// std initialization
RestoreDefaults();
// try to load content from INI file
if (moduleName != NULL)
{
m_sModuleName = moduleName;
if (iniFileName == NULL)
{
// find INI filename located in module path
m_sModuleFileName = m_backend->GetModuleFilePath().c_str();
}
else
{
m_sModuleFileName = iniFileName;
}
if (LoadValuesFromConfigFile(m_sModuleFileName.c_str()))
{
m_bGetDataFromBackend = false;
return;
}
}
m_bGetDataFromBackend = true;
// load basic content from registry
LoadEngineSettingsFromRegistry();
}
//////////////////////////////////////////////////////////////////////////
CEngineSettingsManager::~CEngineSettingsManager()
{
delete m_backend, m_backend = NULL;
}
//////////////////////////////////////////////////////////////////////////
void CEngineSettingsManager::RestoreDefaults()
{
// Engine
SetKey("ENG_RootPath", L"");
// RC
SetKey("RC_ShowWindow", false);
SetKey("RC_HideCustom", false);
SetKey("RC_Parameters", L"");
}
//////////////////////////////////////////////////////////////////////////
bool CEngineSettingsManager::GetModuleSpecificStringEntryUtf16(const char* key, SettingsManagerHelpers::CWCharBuffer wbuffer)
{
if (wbuffer.getSizeInElements() <= 0)
{
return false;
}
if (!m_bGetDataFromBackend)
{
if (!HasKey(key))
{
wbuffer[0] = 0;
return false;
}
if (!GetValueByRef(key, wbuffer))
{
wbuffer[0] = 0;
return false;
}
}
else
{
assert(m_backend);
return m_backend->GetModuleSpecificStringEntryUtf16(key, wbuffer);
}
return true;
}
//////////////////////////////////////////////////////////////////////////
bool CEngineSettingsManager::GetModuleSpecificStringEntryUtf8(const char* key, SettingsManagerHelpers::CCharBuffer buffer)
{
if (buffer.getSizeInElements() <= 0)
{
return false;
}
wchar_t wBuffer[1024];
if (!GetModuleSpecificStringEntryUtf16(key, SettingsManagerHelpers::CWCharBuffer(wBuffer, sizeof(wBuffer))))
{
buffer[0] = 0;
return false;
}
SettingsManagerHelpers::ConvertUtf16ToUtf8(wBuffer, buffer);
return true;
}
//////////////////////////////////////////////////////////////////////////
bool CEngineSettingsManager::GetModuleSpecificIntEntry(const char* key, int& value)
{
value = 0;
if (!m_bGetDataFromBackend)
{
if (!HasKey(key))
{
return false;
}
if (!GetValueByRef(key, value))
{
return false;
}
}
else
{
assert(m_backend);
return m_backend->GetModuleSpecificIntEntry(key, value);
}
return true;
}
//////////////////////////////////////////////////////////////////////////
bool CEngineSettingsManager::GetModuleSpecificBoolEntry(const char* key, bool& value)
{
value = false;
if (!m_bGetDataFromBackend)
{
if (!HasKey(key))
{
return false;
}
if (!GetValueByRef(key, value))
{
return false;
}
}
else
{
assert(m_backend);
return m_backend->GetModuleSpecificBoolEntry(key, value);
}
return true;
}
//////////////////////////////////////////////////////////////////////////
bool CEngineSettingsManager::SetModuleSpecificStringEntryUtf16(const char* key, const wchar_t* str)
{
SetKey(key, str);
if (!m_bGetDataFromBackend)
{
return StoreData();
}
assert(m_backend);
return m_backend->SetModuleSpecificStringEntryUtf16(key, str);
}
//////////////////////////////////////////////////////////////////////////
bool CEngineSettingsManager::SetModuleSpecificIntEntry(const char* key, const int& value)
{
SetKey(key, value);
if (!m_bGetDataFromBackend)
{
return StoreData();
}
assert(m_backend);
return m_backend->SetModuleSpecificIntEntry(key, value);
}
//////////////////////////////////////////////////////////////////////////
bool CEngineSettingsManager::SetModuleSpecificBoolEntry(const char* key, const bool& value)
{
SetKey(key, value);
if (!m_bGetDataFromBackend)
{
return StoreData();
}
assert(m_backend);
return m_backend->SetModuleSpecificBoolEntry(key, value);
}
//////////////////////////////////////////////////////////////////////////
bool CEngineSettingsManager::SetModuleSpecificStringEntryUtf8(const char* key, const char* str)
{
wchar_t wbuffer[512];
SettingsManagerHelpers::ConvertUtf8ToUtf16(str, SettingsManagerHelpers::CWCharBuffer(wbuffer, sizeof(wbuffer)));
return SetModuleSpecificStringEntryUtf16(key, wbuffer);
}
//////////////////////////////////////////////////////////////////////////
bool CEngineSettingsManager::HasKey(const char* key)
{
return m_keyValueArray.find(key) != 0;
}
//////////////////////////////////////////////////////////////////////////
void CEngineSettingsManager::SetKey(const char* key, const wchar_t* value)
{
m_keyValueArray.set(key, value);
}
//////////////////////////////////////////////////////////////////////////
void CEngineSettingsManager::SetKey(const char* key, bool value)
{
m_keyValueArray.set(key, (value ? L"true" : L"false"));
}
//////////////////////////////////////////////////////////////////////////
void CEngineSettingsManager::SetKey(const char* key, int value)
{
m_keyValueArray.set(key, std::to_wstring(value).c_str());
}
bool CEngineSettingsManager::GetInstalledBuildRootPathUtf16(const int index, SettingsManagerHelpers::CWCharBuffer name, SettingsManagerHelpers::CWCharBuffer path)
{
assert(m_backend);
return m_backend->GetInstalledBuildRootPathUtf16(index, name, path);
}
//////////////////////////////////////////////////////////////////////////
void CEngineSettingsManager::SetParentDialog(size_t window)
{
m_hWndParent = window;
}
//////////////////////////////////////////////////////////////////////////
bool CEngineSettingsManager::StoreData()
{
if (m_bGetDataFromBackend)
{
bool res = StoreEngineSettingsToRegistry();
if (!res)
{
#ifdef AZ_PLATFORM_WINDOWS
MessageBoxA(reinterpret_cast<HWND>(m_hWndParent), "Could not store data to registry.", "Error", MB_OK | MB_ICONERROR);
#endif
}
return res;
}
// store data to INI file
FILE* file;
#ifdef AZ_PLATFORM_WINDOWS
_wfopen_s(&file, m_sModuleFileName.c_str(), L"wb");
#else
char fname[MAX_PATH];
memset(fname, 0, MAX_PATH);
wcstombs(fname, m_sModuleFileName.c_str(), MAX_PATH);
file = fopen(fname, "wb");
#endif
if (file == NULL)
{
return false;
}
char buffer[2048];
for (size_t i = 0; i < m_keyValueArray.size(); ++i)
{
const SKeyValue& kv = m_keyValueArray[i];
fprintf_s(file, kv.key.c_str());
fprintf_s(file, " = ");
if (kv.value.length() > 0)
{
SettingsManagerHelpers::ConvertUtf16ToUtf8(kv.value.c_str(), SettingsManagerHelpers::CCharBuffer(buffer, sizeof(buffer)));
fprintf_s(file, "%s", buffer);
}
fprintf_s(file, "\r\n");
}
fclose(file);
return true;
}
//////////////////////////////////////////////////////////////////////////
bool CEngineSettingsManager::LoadValuesFromConfigFile(const wchar_t* szFileName)
{
m_keyValueArray.clear();
// read file to memory
FILE* file;
#ifdef AZ_PLATFORM_WINDOWS
_wfopen_s(&file, szFileName, L"rb");
#else
char fname[MAX_PATH];
memset(fname, 0, MAX_PATH);
wcstombs(fname, szFileName, MAX_PATH);
file = fopen(fname, "rb");
#endif
if (file == NULL)
{
return false;
}
fseek(file, 0, SEEK_END);
long size = ftell(file);
fseek(file, 0, SEEK_SET);
char* data = new char[size + 1];
fread_s(data, size, 1, size, file);
fclose(file);
wchar_t wBuffer[1024];
// parse file for root path
int start = 0, end = 0;
while (end < size)
{
while (end < size && data[end] != '\n')
{
end++;
}
memcpy(data, &data[start], end - start);
data[end - start] = 0;
start = end = end + 1;
CFixedString<char, 2048> line(data);
size_t equalsOfs;
for (equalsOfs = 0; equalsOfs < line.length(); ++equalsOfs)
{
if (line[equalsOfs] == '=')
{
break;
}
}
if (equalsOfs < line.length())
{
CFixedString<char, 256> key;
CFixedString<wchar_t, 1024> value;
key.appendAscii(line.c_str(), equalsOfs);
key.trim();
SettingsManagerHelpers::ConvertUtf8ToUtf16(line.c_str() + equalsOfs + 1, SettingsManagerHelpers::CWCharBuffer(wBuffer, sizeof(wBuffer)));
value.append(wBuffer);
value.trim();
m_keyValueArray.set(key.c_str(), value.c_str());
}
}
delete[] data;
return true;
}
//////////////////////////////////////////////////////////////////////////
bool CEngineSettingsManager::StoreEngineSettingsToRegistry()
{
assert(m_backend);
return m_backend->StoreEngineSettingsToRegistry();
}
//////////////////////////////////////////////////////////////////////////
void CEngineSettingsManager::LoadEngineSettingsFromRegistry()
{
assert(m_backend);
m_backend->LoadEngineSettingsFromRegistry();
}
//////////////////////////////////////////////////////////////////////////
bool CEngineSettingsManager::GetValueByRef(const char* key, SettingsManagerHelpers::CWCharBuffer wbuffer) const
{
if (wbuffer.getSizeInElements() <= 0)
{
return false;
}
const SKeyValue* p = m_keyValueArray.find(key);
if (!p || (p->value.length() + 1) > wbuffer.getSizeInElements())
{
wbuffer[0] = 0;
return false;
}
azwcscpy(wbuffer.getPtr(), wbuffer.getSizeInElements(), p->value.c_str());
return true;
}
//////////////////////////////////////////////////////////////////////////
bool CEngineSettingsManager::GetValueByRef(const char* key, bool& value) const
{
wchar_t buffer[100];
if (!GetValueByRef(key, SettingsManagerHelpers::CWCharBuffer(buffer, sizeof(buffer))))
{
return false;
}
value = (wcscmp(buffer, L"true") == 0);
return true;
}
//////////////////////////////////////////////////////////////////////////
bool CEngineSettingsManager::GetValueByRef(const char* key, int& value) const
{
wchar_t buffer[100];
if (!GetValueByRef(key, SettingsManagerHelpers::CWCharBuffer(buffer, sizeof(buffer))))
{
return false;
}
value = wcstol(buffer, 0, 10);
return true;
}
#endif //(CRY_ENABLE_RC_HELPER)
@@ -1,89 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#ifndef CRYINCLUDE_CRYCOMMON_ENGINESETTINGSMANAGER_H
#define CRYINCLUDE_CRYCOMMON_ENGINESETTINGSMANAGER_H
#pragma once
#include "ProjectDefines.h"
#if defined(CRY_ENABLE_RC_HELPER)
#include "SettingsManagerHelpers.h"
class CEngineSettingsBackend;
//////////////////////////////////////////////////////////////////////////
// Manages storage and loading of all information for tools and CryENGINE, by either registry or an INI file.
// Information can be read and set by key-to-value functions.
// Specific information can be set by a dialog application called by this class.
// If the engine root path is not found, a fall-back dialog is opened.
class CEngineSettingsManager
{
public:
// prepares CEngineSettingsManager to get requested information either from registry or an INI file,
// if existent as a file with name an directory equal to the module, or from registry.
CEngineSettingsManager(const wchar_t* moduleName = NULL, const wchar_t* iniFileName = NULL);
~CEngineSettingsManager();
void RestoreDefaults();
// stores/loads user specific information for modules to/from registry or INI file
bool GetModuleSpecificStringEntryUtf16(const char* key, SettingsManagerHelpers::CWCharBuffer wbuffer);
bool GetModuleSpecificStringEntryUtf8(const char* key, SettingsManagerHelpers::CCharBuffer buffer);
bool GetModuleSpecificIntEntry(const char* key, int& value);
bool GetModuleSpecificBoolEntry(const char* key, bool& value);
bool SetModuleSpecificStringEntryUtf16(const char* key, const wchar_t* str);
bool SetModuleSpecificStringEntryUtf8(const char* key, const char* str);
bool SetModuleSpecificIntEntry(const char* key, const int& value);
bool SetModuleSpecificBoolEntry(const char* key, const bool& value);
bool GetValueByRef(const char* key, SettingsManagerHelpers::CWCharBuffer wbuffer) const;
bool GetValueByRef(const char* key, bool& value) const;
bool GetValueByRef(const char* key, int& value) const;
void SetKey(const char* key, const wchar_t* value);
void SetKey(const char* key, bool value);
void SetKey(const char* key, int value);
bool StoreData();
bool GetInstalledBuildRootPathUtf16(const int index, SettingsManagerHelpers::CWCharBuffer name, SettingsManagerHelpers::CWCharBuffer path);
void SetParentDialog(size_t window);
private:
bool HasKey(const char* key);
void LoadEngineSettingsFromRegistry();
bool StoreEngineSettingsToRegistry();
// parses a file and stores all flags in a private key-value-map
bool LoadValuesFromConfigFile(const wchar_t* szFileName);
private:
CEngineSettingsBackend *m_backend;
SettingsManagerHelpers::CFixedString<wchar_t, 256> m_sModuleName; // name to store key-value pairs of modules in (registry) or to identify INI file
SettingsManagerHelpers::CFixedString<wchar_t, 256> m_sModuleFileName; // used in case of data being loaded from INI file
bool m_bGetDataFromBackend;
SettingsManagerHelpers::CKeyValueArray<30> m_keyValueArray;
void* m_hBtnBrowse;
size_t m_hWndParent;
};
#endif // CRY_ENABLE_RC_HELPER
#endif // CRYINCLUDE_CRYCOMMON_ENGINESETTINGSMANAGER_H
-228
View File
@@ -1,228 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#ifndef CRYINCLUDE_CRYCOMMON_IFLARES_H
#define CRYINCLUDE_CRYCOMMON_IFLARES_H
#pragma once
#include <IFuncVariable.h> // <> required for Interfuscator
#include <IXml.h> // <> required for Interfuscator
#include "smartptr.h"
struct IShader;
class CCamera;
class __MFPA
{
};
class __MFPB
{
};
#define MFP_SIZE_ENFORCE : public __MFPA, public __MFPB
enum EFlareType
{
eFT__Base__,
eFT_Root,
eFT_Group,
eFT_Ghost,
eFT_MultiGhosts,
eFT_Glow,
eFT_ChromaticRing,
eFT_IrisShafts,
eFT_CameraOrbs,
eFT_ImageSpaceShafts,
eFT_Streaks,
eFT_Reference,
eFT_Proxy,
eFT_Max
};
#define FLARE_LIBS_PATH "libs/flares/"
#define FLARE_EXPORT_FILE "LensFlareList.xml"
#define FLARE_EXPORT_FILE_VERSION "1"
struct FlareInfo
{
EFlareType type;
const char* name;
#if defined(FLARES_SUPPORT_EDITING)
const char* imagename;
#endif
};
#if defined(FLARES_SUPPORT_EDITING)
# define ADD_FLARE_INFO(type, name, imagename) {type, name, imagename}
#else
# define ADD_FLARE_INFO(type, name, imagename) {type, name}
#endif
class FlareInfoArray
{
public:
struct Props
{
const FlareInfo* p;
size_t size;
};
static const Props Get()
{
static const FlareInfo flareInfoArray[] =
{
ADD_FLARE_INFO(eFT__Base__, "__Base__", NULL),
ADD_FLARE_INFO(eFT_Root, "Root", NULL),
ADD_FLARE_INFO(eFT_Group, "Group", NULL),
ADD_FLARE_INFO(eFT_Ghost, "Ghost", "EngineAssets/Textures/flares/icons/ghost.dds"),
ADD_FLARE_INFO(eFT_MultiGhosts, "Multi Ghost", "EngineAssets/Textures/flares/icons/multi_ghost.dds"),
ADD_FLARE_INFO(eFT_Glow, "Glow", "EngineAssets/Textures/flares/icons/glow.dds"),
ADD_FLARE_INFO(eFT_ChromaticRing, "ChromaticRing", "EngineAssets/Textures/flares/icons/ring.dds"),
ADD_FLARE_INFO(eFT_IrisShafts, "IrisShafts", "EngineAssets/Textures/flares/icons/iris_shafts.dds"),
ADD_FLARE_INFO(eFT_CameraOrbs, "CameraOrbs", "EngineAssets/Textures/flares/icons/orbs.dds"),
ADD_FLARE_INFO(eFT_ImageSpaceShafts, "Vol Shafts", "EngineAssets/Textures/flares/icons/vol_shafts.dds"),
ADD_FLARE_INFO(eFT_Streaks, "Streaks", "EngineAssets/Textures/flares/icons/iris_shafts.dds")
};
Props ret;
ret.p = flareInfoArray;
ret.size = sizeof(flareInfoArray) / sizeof(flareInfoArray[0]);
return ret;
}
private:
FlareInfoArray();
~FlareInfoArray();
};
struct SLensFlareRenderParam
{
SLensFlareRenderParam()
: pCamera(NULL)
, pShader(NULL)
{
}
~SLensFlareRenderParam(){}
bool IsValid() const
{
return pCamera && pShader;
}
CCamera* pCamera;
IShader* pShader;
};
class ISoftOcclusionQuery
{
public:
// <interfuscator:shuffle>
virtual ~ISoftOcclusionQuery() {}
virtual void AddRef() = 0;
virtual void Release() = 0;
// </interfuscator:shuffle>
};
class IOpticsElementBase MFP_SIZE_ENFORCE
{
public:
IOpticsElementBase()
: m_nRefCount(0)
{
}
void AddRef()
{
CryInterlockedIncrement(&m_nRefCount);
}
void Release()
{
if (CryInterlockedDecrement(&m_nRefCount) <= 0)
{
delete this;
}
}
// <interfuscator:shuffle>
virtual EFlareType GetType() = 0;
virtual bool IsGroup() const = 0;
virtual string GetName() const = 0;
virtual void SetName(const char* ch_name) = 0;
virtual void Load(IXmlNode* pNode) = 0;
virtual IOpticsElementBase* GetParent() const = 0;
virtual ~IOpticsElementBase() {
}
virtual bool IsEnabled() const = 0;
virtual void AddElement(IOpticsElementBase* pElement) = 0;
virtual void InsertElement(int nPos, IOpticsElementBase* pElement) = 0;
virtual void Remove(int i) = 0;
virtual void RemoveAll() = 0;
virtual int GetElementCount() const = 0;
virtual IOpticsElementBase* GetElementAt(int i) const = 0;
virtual void GetMemoryUsage(ICrySizer* pSizer) const = 0;
virtual void Invalidate() = 0;
virtual void Render(SLensFlareRenderParam* pParam, const Vec3& vPos) = 0;
virtual void SetOpticsReference([[maybe_unused]] IOpticsElementBase* pReference) {}
virtual IOpticsElementBase* GetOpticsReference() const { return NULL; }
// </interfuscator:shuffle>
#if defined(FLARES_SUPPORT_EDITING)
virtual AZStd::vector<FuncVariableGroup> GetEditorParamGroups() = 0;
#endif
///Basic Setters///////////////////////////////////////////////////////////////
virtual void SetEnabled(bool enabled) { (void)enabled; }
virtual void SetSize(float size) { (void)size; }
virtual void SetPerspectiveFactor(float perspectiveFactor) { (void)perspectiveFactor; }
virtual void SetDistanceFadingFactor(float distanceFadingFactor) { (void)distanceFadingFactor; }
virtual void SetBrightness(float brightness) { (void)brightness; }
virtual void SetColor(ColorF color) { (void)color; }
virtual void SetMovement(Vec2 movement) { (void)movement; }
virtual void SetTransform(const Matrix33& xform) { (void)xform; }
virtual void SetOccBokehEnabled(bool occBokehEnabled) { (void)occBokehEnabled; }
virtual void SetOrbitAngle(float orbitAngle) { (void)orbitAngle; }
virtual void SetSensorSizeFactor(float sizeFactor) { (void)sizeFactor; }
virtual void SetSensorBrightnessFactor(float brightnessFactor) { (void)brightnessFactor; }
virtual void SetAutoRotation(bool autoRotation) { (void)autoRotation; }
virtual void SetAspectRatioCorrection(bool aspectRatioCorrection) { (void)aspectRatioCorrection; }
////////////////////////////////////////////////////////////////////////////////
private:
volatile int m_nRefCount;
};
class IOpticsManager
{
public:
// <interfuscator:shuffle>
virtual ~IOpticsManager(){}
virtual void Reset() = 0;
virtual IOpticsElementBase* Create(EFlareType type) const = 0;
virtual bool Load(const char* fullFlareName, int& nOutIndex, bool forceReload = false) = 0;
virtual bool Load(XmlNodeRef& rootNode, int& nOutIndex) = 0;
virtual IOpticsElementBase* GetOptics(int nIndex) = 0;
virtual bool AddOptics(IOpticsElementBase* pOptics, const char* name, int& nOutNewIndex, bool allowReplace = false) = 0;
virtual bool Rename(const char* fullFlareName, const char* newFullFlareName) = 0;
virtual void GetMemoryUsage(ICrySizer* pSizer) const = 0;
virtual void Invalidate() = 0;
// </interfuscator:shuffle>
};
typedef _smart_ptr<IOpticsElementBase> IOpticsElementBasePtr;
#endif // CRYINCLUDE_CRYCOMMON_IFLARES_H
-504
View File
@@ -1,504 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
// Description : Interface to the Material Effects System
#ifndef CRYINCLUDE_CRYCOMMON_IMATERIALEFFECTS_H
#define CRYINCLUDE_CRYCOMMON_IMATERIALEFFECTS_H
#pragma once
#if !defined(_RELEASE)
#define MATERIAL_EFFECTS_DEBUG
#endif
#include "CryFixedArray.h"
struct IRenderNode;
struct ISurfaceType;
//////////////////////////////////////////////////////////////////////////
enum EMFXPlayFlags
{
eMFXPF_Disable_Delay = BIT(0),
eMFXPF_Audio = BIT(1),
eMFXPF_Decal = BIT(2),
eMFXPF_Particles = BIT(3),
eMFXPF_Deprecated0 = BIT(4), // formerly eMFXPF_Flowgraph
eMFXPF_ForceFeedback = BIT(5),
eMFXPF_All = (eMFXPF_Audio | eMFXPF_Decal | eMFXPF_Particles | eMFXPF_Deprecated0 | eMFXPF_ForceFeedback),
};
#define MFX_INVALID_ANGLE (gf_PI2 + 1)
//////////////////////////////////////////////////////////////////////////
struct SMFXAudioEffectRtpc
{
SMFXAudioEffectRtpc()
{
rtpcName = "";
rtpcValue = 0.0f;
}
const char* rtpcName;
float rtpcValue;
};
//////////////////////////////////////////////////////////////////////////
struct SMFXRunTimeEffectParams
{
static const int MAX_AUDIO_RTPCS = 4;
SMFXRunTimeEffectParams()
: playSoundFP(false)
, playflags(eMFXPF_All)
, fLastTime(0.0f)
, srcSurfaceId(0)
, trgSurfaceId(0)
, srcRenderNode(0)
, trgRenderNode(0)
, partID(0)
, pos(ZERO)
, decalPos(ZERO)
, normal(0.0f, 0.0f, 1.0f)
, angle(MFX_INVALID_ANGLE)
, scale(1.0f)
, audioComponentOffset(ZERO)
, numAudioRtpcs(0)
, fDecalPlacementTestMaxSize(1000.f)
{
dir[0].Set(0.0f, 0.0f, -1.0f);
dir[1].Set(0.0f, 0.0f, 1.0f);
}
bool AddAudioRtpc(const char* name, float val)
{
if (numAudioRtpcs < MAX_AUDIO_RTPCS)
{
audioRtpcs[numAudioRtpcs].rtpcName = name;
audioRtpcs[numAudioRtpcs].rtpcValue = val;
++numAudioRtpcs;
return true;
}
return false;
}
void ResetAudioRtpcs()
{
numAudioRtpcs = 0;
}
public:
uint16 playSoundFP; // Sets 1p/3p audio switch
uint16 playflags; // See EMFXPlayFlags
float fLastTime; // Last time this effect was played
float fDecalPlacementTestMaxSize;
int srcSurfaceId;
int trgSurfaceId;
IRenderNode* srcRenderNode;
IRenderNode* trgRenderNode;
int partID;
Vec3 pos;
Vec3 decalPos;
Vec3 dir[2];
Vec3 normal;
float angle;
float scale;
// audio related
Vec3 audioComponentOffset; // in case of audio component, uses this offset
SMFXAudioEffectRtpc audioRtpcs[MAX_AUDIO_RTPCS];
uint32 numAudioRtpcs;
};
struct SMFXBreakageParams
{
enum EBreakageRequestFlags
{
eBRF_Matrix = BIT(0),
eBRF_HitPos = BIT(1),
eBRF_HitImpulse = BIT(2),
eBRF_Velocity = BIT(3),
eBRF_ExplosionImpulse = BIT(4),
eBRF_Mass = BIT(5),
eBFR_Entity = BIT(6),
};
SMFXBreakageParams()
: m_flags(0)
, m_worldTM(IDENTITY)
, m_vHitPos(ZERO)
, m_vHitImpulse(IDENTITY)
, m_vVelocity(ZERO)
, m_fExplosionImpulse(1.0f)
, m_fMass(0.0f)
{
}
// Matrix
void SetMatrix(const Matrix34& worldTM)
{
m_worldTM = worldTM;
SetFlag(eBRF_Matrix);
}
const Matrix34& GetMatrix() const
{
return m_worldTM;
}
// HitPos
void SetHitPos(const Vec3& vHitPos)
{
m_vHitPos = vHitPos;
SetFlag(eBRF_HitPos);
}
const Vec3& GetHitPos() const
{
return m_vHitPos;
}
// HitImpulse
void SetHitImpulse(const Vec3& vHitImpulse)
{
m_vHitImpulse = vHitImpulse;
SetFlag(eBRF_HitImpulse);
}
const Vec3& GetHitImpulse() const
{
return m_vHitImpulse;
}
// Velocity
void SetVelocity(const Vec3& vVelocity)
{
m_vVelocity = vVelocity;
SetFlag(eBRF_Velocity);
}
const Vec3& GetVelocity() const
{
return m_vVelocity;
}
// Explosion Impulse
void SetExplosionImpulse(float fExplosionImpulse)
{
m_fExplosionImpulse = fExplosionImpulse;
SetFlag(eBRF_ExplosionImpulse);
}
float GetExplosionImpulse() const
{
return m_fExplosionImpulse;
}
// Mass
void SetMass(float fMass)
{
m_fMass = fMass;
SetFlag(eBRF_Mass);
}
float GetMass() const
{
return m_fMass;
}
// Checking for flags
bool CheckFlag(EBreakageRequestFlags flag) const
{
return (m_flags & flag) != 0;
}
protected:
void SetFlag(EBreakageRequestFlags flag)
{
m_flags |= flag;
}
void ClearFlag(EBreakageRequestFlags flag)
{
m_flags &= ~flag;
}
uint32 m_flags;
Matrix34 m_worldTM;
Vec3 m_vHitPos;
Vec3 m_vHitImpulse;
Vec3 m_vVelocity;
float m_fExplosionImpulse;
float m_fMass;
};
class IMFXParticleParams
{
public:
IMFXParticleParams()
: name(NULL)
, userdata(NULL)
, scale(1.0f)
{
}
const char* name;
const char* userdata;
float scale;
};
class SMFXParticleListNode
{
public:
static SMFXParticleListNode* Create();
void Destroy();
static void FreePool();
IMFXParticleParams m_particleParams;
SMFXParticleListNode* pNext;
private:
SMFXParticleListNode()
{
pNext = NULL;
}
~SMFXParticleListNode() {}
};
class IMFXAudioParams
{
const static uint MAX_SWITCH_DATA_ELEMENTS = 4;
public:
struct SSwitchData
{
SSwitchData()
: switchName(NULL)
, switchStateName(NULL)
{
}
const char* switchName;
const char* switchStateName;
};
IMFXAudioParams()
: triggerName(NULL)
{
}
const char* triggerName;
CryFixedArray<SSwitchData, MAX_SWITCH_DATA_ELEMENTS> triggerSwitches;
};
class SMFXAudioListNode
{
public:
static SMFXAudioListNode* Create();
void Destroy();
static void FreePool();
IMFXAudioParams m_audioParams;
SMFXAudioListNode* pNext;
private:
SMFXAudioListNode()
: pNext(NULL)
{
}
~SMFXAudioListNode()
{
}
};
class IMFXDecalParams
{
public:
IMFXDecalParams()
{
filename = 0;
material = 0;
minscale = 1.f;
maxscale = 1.f;
rotation = -1.f;
lifetime = 10.0f;
assemble = false;
forceedge = false;
}
const char* filename;
const char* material;
float minscale;
float maxscale;
float rotation;
float lifetime;
bool assemble;
bool forceedge;
};
class SMFXDecalListNode
{
public:
static SMFXDecalListNode* Create();
void Destroy();
static void FreePool();
IMFXDecalParams m_decalParams;
SMFXDecalListNode* pNext;
private:
SMFXDecalListNode()
{
pNext = 0;
}
~SMFXDecalListNode() {}
};
class IMFXForceFeedbackParams
{
public:
IMFXForceFeedbackParams()
: forceFeedbackEventName (NULL)
, intensityFallOffMinDistanceSqr(0.0f)
, intensityFallOffMaxDistanceSqr(0.0f)
{
}
const char* forceFeedbackEventName;
float intensityFallOffMinDistanceSqr;
float intensityFallOffMaxDistanceSqr;
};
class SMFXForceFeedbackListNode
{
public:
static SMFXForceFeedbackListNode* Create();
void Destroy();
static void FreePool();
IMFXForceFeedbackParams m_forceFeedbackParams;
SMFXForceFeedbackListNode* pNext;
private:
SMFXForceFeedbackListNode()
: pNext(NULL)
{
}
~SMFXForceFeedbackListNode() {}
};
struct SMFXResourceList;
typedef _smart_ptr<SMFXResourceList> SMFXResourceListPtr;
struct SMFXResourceList
{
public:
SMFXParticleListNode* m_particleList;
SMFXAudioListNode* m_audioList;
SMFXDecalListNode* m_decalList;
SMFXForceFeedbackListNode* m_forceFeedbackList;
void AddRef() { ++m_refs; }
void Release()
{
if (--m_refs <= 0)
{
Destroy();
}
}
static SMFXResourceListPtr Create();
static void FreePool();
private:
int m_refs;
virtual void Destroy();
SMFXResourceList()
: m_refs(0)
{
m_particleList = 0;
m_audioList = 0;
m_decalList = 0;
m_forceFeedbackList = 0;
}
virtual ~SMFXResourceList()
{
while (m_particleList != 0)
{
SMFXParticleListNode* next = m_particleList->pNext;
m_particleList->Destroy();
m_particleList = next;
}
while (m_audioList != 0)
{
SMFXAudioListNode* next = m_audioList->pNext;
m_audioList->Destroy();
m_audioList = next;
}
while (m_decalList != 0)
{
SMFXDecalListNode* next = m_decalList->pNext;
m_decalList->Destroy();
m_decalList = next;
}
while (m_forceFeedbackList != 0)
{
SMFXForceFeedbackListNode* next = m_forceFeedbackList->pNext;
m_forceFeedbackList->Destroy();
m_forceFeedbackList = next;
}
}
};
typedef uint16 TMFXEffectId;
static const TMFXEffectId InvalidEffectId = 0;
struct SMFXCustomParamValue
{
float fValue;
};
//////////////////////////////////////////////////////////////////////////
struct IMaterialEffects
{
// <interfuscator:shuffle>
virtual ~IMaterialEffects(){}
virtual void LoadFXLibraries() = 0;
virtual void Reset(bool bCleanup) = 0;
virtual void ClearDelayedEffects() = 0;
virtual TMFXEffectId GetEffectIdByName(const char* libName, const char* effectName) = 0;
virtual TMFXEffectId GetEffectId(int surfaceIndex1, int surfaceIndex2) = 0;
virtual TMFXEffectId GetEffectId(const char* customName, int surfaceIndex2) = 0;
virtual SMFXResourceListPtr GetResources(TMFXEffectId effectId) const = 0;
virtual void PreLoadAssets() = 0;
virtual bool ExecuteEffect(TMFXEffectId effectId, SMFXRunTimeEffectParams& runtimeParams) = 0;
virtual int GetDefaultSurfaceIndex() = 0;
virtual int GetDefaultCanopyIndex() = 0;
virtual bool PlayBreakageEffect(ISurfaceType* pSurfaceType, const char* breakageType, const SMFXBreakageParams& mfxBreakageParams) = 0;
virtual void SetCustomParameter(TMFXEffectId effectId, const char* customParameter, const SMFXCustomParamValue& customParameterValue) = 0;
virtual void CompleteInit() = 0;
// </interfuscator:shuffle>
};
#endif // CRYINCLUDE_CRYCOMMON_IMATERIALEFFECTS_H
@@ -1,147 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#ifndef CRYINCLUDE_CRYCOMMON_INOTIFICATIONNETWORK_H
#define CRYINCLUDE_CRYCOMMON_INOTIFICATIONNETWORK_H
#pragma once
// Constants
#define NN_CHANNEL_NAME_LENGTH_MAX 16
struct INotificationNetworkClient;
// User Interfaces
struct INotificationNetworkListener
{
// <interfuscator:shuffle>
virtual ~INotificationNetworkListener(){}
// Called upon receiving data from the Channel the Listener is binded to.
virtual void OnNotificationNetworkReceive(const void* pBuffer, size_t length) = 0;
// </interfuscator:shuffle>
};
struct INotificationNetworkConnectionCallback
{
// <interfuscator:shuffle>
virtual ~INotificationNetworkConnectionCallback(){}
virtual void OnConnect(INotificationNetworkClient* pClient, bool bSucceeded) = 0;
virtual void OnDisconnected(INotificationNetworkClient* pClient) = 0;
// </interfuscator:shuffle>
};
// Interfaces
struct INotificationNetworkClient
{
// <interfuscator:shuffle>
virtual ~INotificationNetworkClient(){}
virtual void Release() = 0;
// Binds a Listener to the given Notification Channel.
// Each Listener can be binded only to one Channel, calling the method
// again with an already added Listener and a different Channel will rebind it.
// The Channel name cannot exceed NN_CHANNEL_NAME_LENGTH_MAX chars.
virtual bool ListenerBind(const char* channelName, INotificationNetworkListener* pListener) = 0;
// If it exist, removes the given Listener form the Notification Network.
virtual bool ListenerRemove(INotificationNetworkListener* pListener) = 0;
// Sends arbitrary data to the Notification Network the Client is connected to.
virtual bool Send(const char* channelName, const void* pBuffer, size_t length) = 0;
// Checks if the current client is connected.
// Returns true if it is connected, false otherwise.
virtual bool IsConnected() = 0;
// Checks if the connection attempt failed.
// Returns true if it failed to connect by any reason (such as timeout).
virtual bool IsFailedToConnect() const = 0;
// Start the connection request for this particular client.
// Parameters:
// address - Is the host name or ipv4 (for now) address string to which
// we want to connect.
// port - Is the TCP port to which we want to connect.
// Remarks: Port 9432 is being used by the live preview already.
virtual bool Connect(const char* address, uint16 port) = 0;
// Tries to register a callback listener object.
// A callback listener object will receive events from the client element,
// such as connection result information.
// Parameters:
// - pConnectionCallback - Is a pointer to an object implementing interface
// INotificationNetworkConnectionCallback which will be called when
// the events happen, such as connection, disconnection and failed attempt
// to connect.
// Return Value:
// - It will return true if registered the callback object successfully.
// - It will return false when there the callback object is already
// registered.
virtual bool RegisterCallbackListener(INotificationNetworkConnectionCallback* pConnectionCallback) = 0;
// Tries to unregister a callback listener object.
// A callback listener object will receive events from the client element,
// such as connection result information.
// Parameters:
// - pConnectionCallback - Is a pointer to an object implementing interface
// INotificationNetworkConnectionCallback which will be called when
// the events happen, such as connection, disconnection and failed attempt
// to connect and that we want to unregister.
// Return Value:
// - It will return true if unregistered the callback object successfully.
// - It will return false when no object matching the one requested is found
// int the object.
virtual bool UnregisterCallbackListener(INotificationNetworkConnectionCallback* pConnectionCallback) = 0;
// </interfuscator:shuffle>
};
struct INotificationNetwork
{
// <interfuscator:shuffle>
virtual ~INotificationNetwork(){}
virtual void Release() = 0;
// Creates a disconnected client.
virtual INotificationNetworkClient* CreateClient() = 0;
// Attempts to connect to the Notification Network at the given address,
// returns a Client interface if communication is possible.
virtual INotificationNetworkClient* Connect(const char* address, uint16 port) = 0;
// Returns the Connection count of the given Channel. If NULL is passed
// instead of a valid Channel name the total count of all Connections is
// returned.
virtual size_t GetConnectionCount(const char* channelName = NULL) = 0;
// Has to be called from the main thread to process received notifications.
virtual void Update() = 0;
// Binds a Listener to the given Notification Channel.
// Each Listener can be binded only to one Channel, calling the method
// again with an already added Listener and a different Channel will rebind it.
// The Channel name cannot exceed NN_CHANNEL_NAME_LENGTH_MAX chars.
virtual bool ListenerBind(const char* channelName, INotificationNetworkListener* pListener) = 0;
// If it exist, removes the given Listener form the Notification Network.
virtual bool ListenerRemove(INotificationNetworkListener* pListener) = 0;
// Sends arbitrary data to all the Connections listening to the given Channel.
virtual uint32 Send(const char* channel, const void* pBuffer, size_t length) = 0;
// </interfuscator:shuffle>
};
#endif // CRYINCLUDE_CRYCOMMON_INOTIFICATIONNETWORK_H
+3 -25
View File
@@ -16,12 +16,12 @@
#include "Cry_Geo.h"
#include "Cry_Camera.h"
#include "ITexture.h"
#include <IFlares.h> // <> required for Interfuscator
#include <IFuncVariable.h> // <> required for Interfuscator
#include <IXml.h> // <> required for Interfuscator
#include "smartptr.h"
#include <AzCore/Casting/numeric_cast.h>
#include <AzCore/std/containers/intrusive_slist.h>
#include "IResourceCompilerHelper.h" // for IResourceCompilerHelper::ERcCallResult
// forward declarations
struct SRenderingPassInfo;
struct SRTStack;
@@ -95,7 +95,6 @@ struct IFFont;
struct IFFont_RenderProxy;
struct STextDrawContext;
struct IRenderMesh;
class IOpticsManager;
struct ShadowFrustumMGPUCache;
struct IAsyncTextureCompileListener;
struct IClipVolume;
@@ -955,25 +954,6 @@ protected:
virtual ~ITextureStreamListener() {}
};
#if defined(CRY_ENABLE_RC_HELPER)
////////////////////////////////////////////////////////////////////////////
// Listener for asynchronous texture compilation.
// Connects the listener to the task-queue of pending compilation requests.
enum ERcExitCode;
struct IAsyncTextureCompileListener
{
public:
virtual void OnCompilationStarted(const char* source, const char* target, int nPending) = 0;
virtual void OnCompilationFinished(const char* source, const char* target, IResourceCompilerHelper::ERcCallResult nReturnCode) = 0;
virtual void OnCompilationQueueTriggered(int nPending) = 0;
virtual void OnCompilationQueueDepleted() = 0;
protected:
virtual ~IAsyncTextureCompileListener() {}
};
#endif
enum eDolbyVisionMode
{
eDVM_Disabled,
@@ -1869,8 +1849,6 @@ struct IRenderer
virtual SDepthTexture* CreateDepthSurface(int nWidth, int nHeight, bool shaderResourceView = false) = 0;
virtual void DestroyDepthSurface(SDepthTexture* pDepthSurf) = 0;
virtual IOpticsElementBase* CreateOptics(EFlareType type) const = 0;
// Note:
// Used for pausing timer related stuff.
// Example:
@@ -1,378 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include "IResourceCompilerHelper.h"
#include <AzCore/base.h>
// DO NOT USE AZSTD.
#include <string> // std string used here.
#include <memory>
#include <cstring>
// the following block is for _mkdir on windows and mkdir on other platforms.
#if defined(_WIN32)
# include <direct.h>
#else
# include <sys/stat.h>
# include <sys/types.h>
#endif
namespace RCPathUtil
{
const char* GetExt(const char* filepath)
{
const char* str = filepath;
size_t len = strlen(filepath);
for (const char* p = str + len - 1; p >= str; --p)
{
switch (*p)
{
case ':':
case '/':
case '\\':
// we've reached a path separator - it means there's no extension in this name
return "";
case '.':
// there's an extension in this file name
return p + 1;
}
}
return "";
}
const char* GetFile(const char* filepath)
{
const size_t len = strlen(filepath);
for (const char* p = filepath + len - 1; p >= filepath; --p)
{
switch (*p)
{
case ':':
case '/':
case '\\':
return p + 1;
}
}
return filepath;
}
//! Replace extension for given file.
std::string RemoveExtension(const char* filepath)
{
std::string filepathstr = filepath;
const char* str = filepathstr.c_str();
for (const char* p = str + filepathstr.length() - 1; p >= str; --p)
{
switch (*p)
{
case ':':
case '/':
case '\\':
// we've reached a path separator - it means there's no extension in this name
return filepathstr;
case '.':
// there's an extension in this file name
filepathstr.erase(p - str);
return filepathstr;
}
}
// it seems the file name is a pure name, without path or extension
return filepathstr;
}
std::string ReplaceExtension(const char* filepath, const char* ext)
{
std::string str = filepath;
if (ext != 0)
{
str = RemoveExtension(str.c_str());
if (ext[0] != 0 && ext[0] != '.')
{
str += ".";
}
str += ext;
}
return str;
}
std::string GetPath(const char* filepath)
{
std::string filepathstr = filepath;
const char* str = filepathstr.c_str();
for (const char* p = str + filepathstr.length() - 1; p >= str; --p)
{
switch (*p)
{
case ':':
case '/':
case '\\':
// we've reached a path separator - it means there's no extension in this name
return filepathstr.substr(0, p - str);
}
}
// it seems the file name is a pure name, without path
return "";
}
//////////////////////////////////////////////////////////////////////////
bool IsRelativePath(const char* p)
{
if (!p || !p[0])
{
return true;
}
return p[0] != '/' && p[0] != '\\' && !strchr(p, ':');
}
}
const char* IResourceCompilerHelper::SourceImageFormatExts[NUM_SOURCE_IMAGE_TYPE] = { "tif", "bmp", "gif", "jpg", "jpeg", "jpe", "tga", "png" };
const char* IResourceCompilerHelper::SourceImageFormatExtsWithDot[NUM_SOURCE_IMAGE_TYPE] = { ".tif", ".bmp", ".gif", ".jpg", ".jpeg", ".jpe", ".tga", ".png" };
const char* IResourceCompilerHelper::EngineImageFormatExts[NUM_ENGINE_IMAGE_TYPE] = { "dds" };
const char* IResourceCompilerHelper::EngineImageFormatExtsWithDot[NUM_ENGINE_IMAGE_TYPE] = { ".dds" };
IResourceCompilerHelper::ERcCallResult IResourceCompilerHelper::ConvertResourceCompilerExitCodeToResultCode(int exitCode)
{
switch (exitCode)
{
case eRcExitCode_Success:
case eRcExitCode_UserFixing:
return eRcCallResult_success;
case eRcExitCode_Error:
return eRcCallResult_error;
case eRcExitCode_FatalError:
return eRcCallResult_error;
case eRcExitCode_Crash:
return eRcCallResult_crash;
}
return eRcCallResult_error;
}
//////////////////////////////////////////////////////////////////////////
const char* IResourceCompilerHelper::GetCallResultDescription(IResourceCompilerHelper::ERcCallResult result)
{
switch (result)
{
case eRcCallResult_success:
return "Success.";
case eRcCallResult_notFound:
return "ResourceCompiler executable was not found.";
case eRcCallResult_error:
return "ResourceCompiler exited with an error.";
case eRcCallResult_crash:
return "ResourceCompiler crashed! Please report this. Include source asset and this log in the report.";
default:
return "Unexpected failure in ResultCompilerHelper.";
}
}
// Arguments:
// szFilePath - could be source or destination filename
void IResourceCompilerHelper::GetOutputFilename(const char* szFilePath, char* buffer, size_t bufferSizeInBytes)
{
if (IResourceCompilerHelper::IsSourceImageFormatSupported(szFilePath))
{
std::string newString = RCPathUtil::ReplaceExtension(szFilePath, "dds");
azstrncpy(buffer, bufferSizeInBytes, newString.c_str(), bufferSizeInBytes - 1);
return;
}
azstrncpy(buffer, bufferSizeInBytes, szFilePath, bufferSizeInBytes - 1);
}
IResourceCompilerHelper::ERcCallResult IResourceCompilerHelper::InvokeResourceCompiler(const char* szSrcFilePath, const char* szDstFilePath, const bool bUserDialog)
{
const char* szDstFileName = RCPathUtil::GetFile(szDstFilePath);
std::string pathOnly = RCPathUtil::GetPath(szDstFilePath);
const int maxStringSize = 512;
char szRemoteCmdLine[maxStringSize] = { 0 };
char szFullPathToSourceFile[maxStringSize] = { 0 };
if (RCPathUtil::IsRelativePath(szSrcFilePath))
{
azstrcat(szFullPathToSourceFile, maxStringSize, "#ENGINEROOT#");
azstrcat(szFullPathToSourceFile, maxStringSize, "\\");
}
azstrcat(szFullPathToSourceFile, maxStringSize, szSrcFilePath);
azstrcat(szRemoteCmdLine, maxStringSize, " /targetroot=\"");
azstrcat(szRemoteCmdLine, maxStringSize, pathOnly.c_str());
azstrcat(szRemoteCmdLine, maxStringSize, "\"");
azstrcat(szRemoteCmdLine, maxStringSize, " /overwritefilename=\"");
azstrcat(szRemoteCmdLine, maxStringSize, szDstFileName);
azstrcat(szRemoteCmdLine, maxStringSize, "\"");
return CallResourceCompiler(szFullPathToSourceFile, szRemoteCmdLine, nullptr, true, false, !bUserDialog);
}
unsigned int IResourceCompilerHelper::GetNumSourceImageFormats()
{
return NUM_SOURCE_IMAGE_TYPE;
}
const char* IResourceCompilerHelper::GetSourceImageFormat(unsigned int index, bool bWithDot)
{
if (index >= GetNumSourceImageFormats())
{
return nullptr;
}
if (bWithDot)
{
return SourceImageFormatExtsWithDot[index];
}
else
{
return SourceImageFormatExts[index];
}
}
unsigned int IResourceCompilerHelper::GetNumEngineImageFormats()
{
return NUM_ENGINE_IMAGE_TYPE;
}
const char* IResourceCompilerHelper::GetEngineImageFormat(unsigned int index, bool bWithDot)
{
if (index >= GetNumEngineImageFormats())
{
return nullptr;
}
if (bWithDot)
{
return EngineImageFormatExtsWithDot[index];
}
else
{
return EngineImageFormatExts[index];
}
}
bool IResourceCompilerHelper::IsSourceImageFormatSupported(const char* szFileNameOrExtension)
{
if (!szFileNameOrExtension) // if this hits, might want to check the call site
{
return false;
}
//check the string length
size_t len = strlen(szFileNameOrExtension);
if (len < 3)//no point in going on if the smallest valid ext is 3 characters
{
return false;
}
//find the ext by starting at the last character and moving backward to first he first '.'
const char* szExtension = nullptr;
size_t cur = len - 1;
while (cur && !szExtension)
{
if (szFileNameOrExtension[cur] == '.')
{
szExtension = &szFileNameOrExtension[cur];
}
cur--;
}
if (len - cur < 3)//no point in going on if the smallest valid ext is 3 characters
{
return false;
}
//if we didn't find a '.' it could still be valid, they may not have
//passed it in. i.e. "dds" instead of ".dds" which is still valid
if (!szExtension)
{
//with no '.' the largest ext is currently 4 characters
//no point in going on if it is larger
if (len > 4)
{
return false;
}
szExtension = szFileNameOrExtension;
}
//loop over all the valid exts and see if it is one of them
for (unsigned int i = 0; i < GetNumSourceImageFormats(); ++i)
{
if (!azstricmp(szExtension, GetSourceImageFormat(i, szExtension[0] == '.')))
{
return true;
}
}
return false;
}
bool IResourceCompilerHelper::IsGameImageFormatSupported(const char* szFileNameOrExtension)
{
if (!szFileNameOrExtension) // if this hits, might want to check the call site
{
return false;
}
//check the string length
size_t len = strlen(szFileNameOrExtension);
if (len < 3)//no point in going on if the smallest valid ext is 3 characters
{
return false;
}
//find the ext by starting at the last character and moving backward to first he first '.'
const char* szExtension = nullptr;
size_t cur = len - 1;
while (cur && !szExtension)
{
if (szFileNameOrExtension[cur] == '.')
{
szExtension = &szFileNameOrExtension[cur];
}
cur--;
}
if (len - cur < 3)//no point in going on if the smallest valid ext is 3 characters
{
return false;
}
//if we didn't find a '.' it could still be valid, they may not have
//passed it in. i.e. "dds" instead of ".dds" which is still valid
if (!szExtension)
{
//with no '.' the largest ext is currently 4 characters
//no point in going on if it is larger
if (len > 4)
{
return false;
}
szExtension = szFileNameOrExtension;
}
//loop over all the valid exts and see if it is one of them
for (unsigned int i = 0; i < GetNumEngineImageFormats(); ++i)
{
if (!azstricmp(szExtension, GetEngineImageFormat(i, szExtension[0] == '.')))
{
return true;
}
}
return false;
}
@@ -1,167 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#ifndef CRYINCLUDE_CRYCOMMON_IRESOURCECOMPILERHELPER_H
#define CRYINCLUDE_CRYCOMMON_IRESOURCECOMPILERHELPER_H
#pragma once
// DO NOT USE AZSTD
#include <string>
// IResourceCompilerHelper exists to define an interface that allows
// remote or local compilation of resources through the "resource Compiler" executable
// in most tools it will be implemented as a local execution. However, in the engine
// it will be substituted for a remote RC invocation through the Asset Processor if
// that system is enabled (via con var and define)
// DO NOT USE CRYSTRING or CRY ALLOCATORS HERE. This is used in maya plugins, that kind of thing.
// the following path utils are special versions of these functions which take pains
// to not use crystring.
// the functions in this interface must be cross platform.
namespace RCPathUtil
{
// given a full path, return the extension (it will be a pointer into the existing string)
const char* GetExt(const char* filepath);
// given a full path, return the file only (it will be a pointer into the existing string)
const char* GetFile(const char* filepath);
// given a filepath, get only the path.
std::string GetPath(const char* filepath);
std::string ReplaceExtension(const char* filepath, const char* ext);
bool IsRelativePath(const char* p);
}
class IResourceCompilerListener;
enum ERcExitCode
{
eRcExitCode_Success = 0, // must be 0
eRcExitCode_Error = 1,
eRcExitCode_FatalError = 100,
eRcExitCode_Crash = 101,
eRcExitCode_UserFixing = 200,
eRcExitCode_Pending = 666,
};
/// A pure virtual interface to the RC Helper system
/// the RC helper system allows you to make requests to a remote process in order to process
/// an asset for you.
class IResourceCompilerHelper
{
public:
virtual ~IResourceCompilerHelper() {}
// defines the result of a call via this API to the RC system
enum ERcCallResult
{
eRcCallResult_success, // everything is OK
eRcCallResult_notFound, // the RC executable is not found
eRcCallResult_error, // the RC executable returned an error
eRcCallResult_crash, // the RC executable did not finish
};
//
// Arguments:
// szFileName null terminated ABSOLUTE file path or 0 can be used to test for rc.exe existence
// relative path needs to be relative to rc_plugins directory
// szAdditionalSettings - 0 or e.g. "/refresh" or "/refresh /xyz=56"
//
// this is a SYNCHRONOUS, BLOCKING call and will return once the process is complete
virtual ERcCallResult CallResourceCompiler(
const char* szFileName = 0,
const char* szAdditionalSettings = 0,
IResourceCompilerListener* listener = 0,
bool bMayShowWindow = true,
bool bSilent = false,
bool bNoUserDialog = false,
const wchar_t* szWorkingDirectory = 0,
const wchar_t* szRootPath = 0) = 0;
// InvokeResourceCompiler - a utility that calls the above CallResourceCompiler function
// but generates appropriate settings so you don't have to specify each option.
// This is a BLOCKING call
// the srcFile can be relative to the project root or an absolute path
// the dstFilePath MUST be relative to the same folder as the Src File path
// this will output dstFilePath in the same folder as srcFile.
virtual ERcCallResult InvokeResourceCompiler(const char* szSrcFilePath, const char* szDstFilePath, const bool bUserDialog);
// --------------------- utility functions ---------------------------------
// given a RC.EXE process exit code like 101, convert it to the above ERcCallResult
ERcCallResult ConvertResourceCompilerExitCodeToResultCode(int exitCode);
// given a ERcCallResult, convert it to a simple english string for debugging.
static const char* GetCallResultDescription(ERcCallResult result);
// given a filename such as "blah.tif" convert it to the appropriate output name "blah.dds" for example
static void GetOutputFilename(const char* szFilePath, char* buffer, size_t bufferSizeInBytes);
//////////////////////////////////////////////////////////////////////////
enum SourceImageTypes
{
SOURCE_IMAGE_TYPE_TIF,
SOURCE_IMAGE_TYPE_BMP,
SOURCE_IMAGE_TYPE_GIF,
SOURCE_IMAGE_TYPE_JPG,
SOURCE_IMAGE_TYPE_JPEG,
SOURCE_IMAGE_TYPE_JPE,
SOURCE_IMAGE_TYPE_TGA,
SOURCE_IMAGE_TYPE_PNG,
NUM_SOURCE_IMAGE_TYPE
};
enum EngineImageTypes
{
ENGINE_IMAGE_TYPE_DDS,
NUM_ENGINE_IMAGE_TYPE
};
private:
static const char* SourceImageFormatExts[NUM_SOURCE_IMAGE_TYPE];
static const char* SourceImageFormatExtsWithDot[NUM_SOURCE_IMAGE_TYPE];
static const char* EngineImageFormatExts[NUM_ENGINE_IMAGE_TYPE];
static const char* EngineImageFormatExtsWithDot[NUM_ENGINE_IMAGE_TYPE];
public:
static unsigned int GetNumSourceImageFormats();
static const char* GetSourceImageFormat(unsigned int index, bool bWithDot);
static unsigned int GetNumEngineImageFormats();
static const char* GetEngineImageFormat(unsigned int index, bool bWithDot);
static bool IsSourceImageFormatSupported(const char* szExtension);
static bool IsGameImageFormatSupported(const char* szExtension);
};
////////////////////////////////////////////////////////////////////////////
// Listener for synchronous resource-compilation.
// Connects the listener to the output of the RC process.
class IResourceCompilerListener
{
public:
// FbxImportDialog relies on this enum being in the order from most verbose to least verbose
enum MessageSeverity
{
MessageSeverity_Debug = 0,
MessageSeverity_Info,
MessageSeverity_Warning,
MessageSeverity_Error
};
virtual void OnRCMessage(MessageSeverity /*severity*/, const char* /*text*/) {}
virtual ~IResourceCompilerListener() {}
};
#endif // CRYINCLUDE_CRYCOMMON_IRESOURCECOMPILERHELPER_H
+3 -39
View File
@@ -24,7 +24,9 @@
#endif
#include "smartptr.h"
#include <IFlares.h> // <> required for Interfuscator
#include <IFuncVariable.h> // <> required for Interfuscator
#include <IXml.h> // <> required for Interfuscator
#include "smartptr.h"
#include "VertexFormats.h"
#include <Vertex.h>
#include <AzCore/Casting/numeric_cast.h>
@@ -2828,7 +2830,6 @@ struct SRenderLight
m_ObjMatrix.SetIdentity();
m_BaseObjMatrix.SetIdentity();
m_sName = "";
m_pSoftOccQuery = NULL;
m_pLightAnim = NULL;
m_fAreaWidth = 1;
m_fAreaHeight = 1;
@@ -2884,11 +2885,6 @@ struct SRenderLight
return m_pLightImage ? m_pLightImage : NULL;
}
IOpticsElementBase* GetLensOpticsElement() const
{
return m_pLensOpticsElement;
}
void SetOpticsParams(const SOpticsInstanceParameters& params)
{
m_opticsParams = params;
@@ -2899,24 +2895,6 @@ struct SRenderLight
return m_opticsParams;
}
void SetLensOpticsElement(IOpticsElementBase* pOptics)
{
if (m_pLensOpticsElement == pOptics)
{
return;
}
if (pOptics && pOptics->GetType() != eFT_Root)
{
return;
}
SAFE_RELEASE(m_pLensOpticsElement);
m_pLensOpticsElement = pOptics;
if (m_pLensOpticsElement)
{
m_pLensOpticsElement->AddRef();
}
}
void GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer) const { /*LATER*/}
void AcquireResources()
@@ -2937,14 +2915,6 @@ struct SRenderLight
{
m_pSpecularCubemap->AddRef();
}
if (m_pLensOpticsElement)
{
m_pLensOpticsElement->AddRef();
}
if (m_pSoftOccQuery)
{
m_pSoftOccQuery->AddRef();
}
if (m_pLightAnim)
{
m_pLightAnim->AddRef();
@@ -2961,8 +2931,6 @@ struct SRenderLight
SAFE_RELEASE(m_pLightImage);
SAFE_RELEASE(m_pDiffuseCubemap);
SAFE_RELEASE(m_pSpecularCubemap);
SAFE_RELEASE(m_pLensOpticsElement);
SAFE_RELEASE(m_pSoftOccQuery);
SAFE_RELEASE(m_pLightAnim);
SAFE_RELEASE(m_pLightAttenMap);
}
@@ -3046,8 +3014,6 @@ struct SRenderLight
const char* m_sName; // Optional name of the light source.
SShaderItem m_Shader; // Shader item
CRenderObject* m_pObject[MAX_RECURSION_LEVELS]; // Object for light coronas and light flares.
IOpticsElementBase* m_pLensOpticsElement; // Optics element for this shader instance
ISoftOcclusionQuery* m_pSoftOccQuery;
ILightAnimWrapper* m_pLightAnim;
Matrix34 m_BaseObjMatrix;
@@ -3146,9 +3112,7 @@ public:
m_fShadowSlopeBias = dl.m_fShadowSlopeBias;
m_fShadowResolutionScale = dl.m_fShadowResolutionScale;
m_fHDRDynamic = dl.m_fHDRDynamic;
m_pLensOpticsElement = dl.m_pLensOpticsElement;
m_LensOpticsFrustumAngle = dl.m_LensOpticsFrustumAngle;
m_pSoftOccQuery = dl.m_pSoftOccQuery;
m_fLightFrustumAngle = dl.m_fLightFrustumAngle;
m_fProjectorNearPlane = dl.m_fProjectorNearPlane;
m_Flags = dl.m_Flags;
-276
View File
@@ -1,276 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
// Description : Interface to manage SoftCode module loading and patching
#ifndef CRYINCLUDE_CRYCOMMON_ISOFTCODEMGR_H
#define CRYINCLUDE_CRYCOMMON_ISOFTCODEMGR_H
#pragma once
// Provides the generic interface for exchanging member values between SoftCode modules,
struct IExchangeValue
{
// <interfuscator:shuffle>
virtual ~IExchangeValue() {}
// Allocates a new IExchangeValue with the underlying type
virtual IExchangeValue* Clone() const = 0;
// Returns the size of the underlying type (to check compatibility)
virtual size_t GetSizeOf() const = 0;
// </interfuscator:shuffle>
};
template <typename T>
struct ExchangeValue
: public IExchangeValue
{
ExchangeValue(T& value)
: m_value(value)
{}
virtual IExchangeValue* Clone() const { return new ExchangeValue(*this); }
virtual size_t GetSizeOf() const { return sizeof(m_value); }
T m_value;
};
template <typename T, size_t S>
struct ExchangeArray
: public IExchangeValue
{
ExchangeArray(T* pArr)
{
for (size_t i = 0; i < S; ++i)
{
m_array[i] = pArr[i];
}
}
virtual IExchangeValue* Clone() const { return new ExchangeArray(*this); }
virtual size_t GetSizeOf() const { return sizeof(m_array); }
T m_array[S];
};
/*
This is a non-intrusive support function for types where default construction does no initialization.
SoftCoding relies on default construction to initialize object state correctly.
For most types this works as expected but for some types (typically things like vectors or matrices)
default initialization would be too costly and is therefore not implemented.
This function allows a specialized implementation to be used for such types that will perform
initialization on the newly constructed instance. For example:
inline void DefaultInitialize(Matrix34& matrix)
{
matrix.SetIdentity();
}
*/
template <typename T>
void DefaultInitialize(T& t)
{
t = T();
}
// Vector support
template<class F>
struct Vec2_tpl;
template<typename T>
struct Vec3_tpl;
template <class F>
void DefaultInitialize(Vec2_tpl<F>& vec) { vec.zero(); }
template <typename T>
void DefaultInitialize(Vec3_tpl<T>& vec) { vec.zero(); }
// Matrix support
template<typename F>
struct Matrix33_tpl;
template<typename F>
struct Matrix34_tpl;
template<typename F>
struct Matrix44_tpl;
template <typename F>
void DefaultInitialize(Matrix33_tpl<F>& matrix) { matrix.SetIdentity(); }
template <typename F>
void DefaultInitialize(Matrix34_tpl<F>& matrix) { matrix.SetIdentity(); }
template <typename F>
void DefaultInitialize(Matrix44_tpl<F>& matrix) { matrix.SetIdentity(); }
// Quat support
template <typename F>
struct Quat_tpl;
template <typename F>
void DefaultInitialize(Quat_tpl<F>& quat) { quat.SetIdentity(); }
// Interface for performing an exchange of instance data
struct IExchanger
{
// <interfuscator:shuffle>
virtual ~IExchanger() {}
// True if data is being read from instance members
virtual bool IsLoading() const = 0;
virtual size_t InstanceCount() const = 0;
virtual bool BeginInstance(void* pInstance) = 0;
virtual bool SetValue(const char* name, IExchangeValue& value) = 0;
virtual IExchangeValue* GetValue(const char* name, void* pTarget, size_t targetSize) = 0;
// </interfuscator:shuffle>
template <typename T>
void Visit(const char* name, T& instance);
template <typename T, size_t S>
void Visit(const char* name, T (&arr)[S]);
};
template <typename T>
void IExchanger::Visit(const char* name, T& value)
{
if (IsLoading())
{
IExchangeValue* pValue = GetValue(name, &value, sizeof(value));
if (pValue)
{
ExchangeValue<T>* pTypedValue = static_cast<ExchangeValue<T>*>(pValue);
value = pTypedValue->m_value;
}
}
else // Saving
{
// If this member is stored
if (SetValue(name, ExchangeValue<T>(value)))
{
// Set the original value to the default state (to allow safe destruction)
DefaultInitialize(value);
}
}
}
template <typename T, size_t S>
void IExchanger::Visit(const char* name, T (&arr)[S])
{
if (IsLoading())
{
IExchangeValue* pValue = GetValue(name, &arr, sizeof(arr));
if (pValue)
{
ExchangeArray<T, S>* pTypedArray = static_cast<ExchangeArray<T, S>*>(pValue);
// TODO: Accommodate array resizing? Complex however...
for (size_t i = 0; i < S; ++i)
{
arr[i] = pTypedArray->m_array[i];
}
}
}
else // Saving
{
// If this member is stored
if (SetValue(name, ExchangeArray<T, S>(arr)))
{
T defaultValue;
DefaultInitialize(defaultValue);
// Set the original value to the default value (to allow safe destruction)
for (size_t i = 0; i < S; ++i)
{
arr[i] = defaultValue;
}
}
}
}
struct InstanceTracker;
struct ITypeRegistrar
{
// <interfuscator:shuffle>
virtual ~ITypeRegistrar() {}
virtual const char* GetName() const = 0;
// Creates an instance of the type
virtual void* CreateInstance() = 0;
// </interfuscator:shuffle>
#ifdef SOFTCODE_ENABLED
// How many active instances exist of this type?
virtual size_t InstanceCount() const = 0;
// Used to remove a tracked instance from the Registrar
virtual void RemoveInstance(InstanceTracker* pTracker) = 0;
// Exchanges the instance state with the given exchanger data set
virtual bool ExchangeInstances(IExchanger& exchanger) = 0;
// Destroys all tracked instances of this type
virtual bool DestroyInstances() = 0;
// Returns true if pInstance is of this type (linear search)
virtual bool HasInstance(void* pInstance) const = 0;
#endif
};
struct ITypeLibrary
{
// <interfuscator:shuffle>
virtual ~ITypeLibrary() {}
virtual const char* GetName() = 0;
virtual void* CreateInstanceVoid(const char* typeName) = 0;
// </interfuscator:shuffle>
#ifdef SOFTCODE_ENABLED
virtual void SetOverride(ITypeLibrary* pOverrideLib) = 0;
// Fills in the supplied type list if large enough, and sets count to number of types
virtual size_t GetTypes(ITypeRegistrar** ppRegistrar, size_t& count) const = 0;
#endif
};
struct ISoftCodeListener
{
// <interfuscator:shuffle>
virtual ~ISoftCodeListener() {}
// Called when an instance is replaced to allow managing systems to fixup pointers
virtual void InstanceReplaced(void* pOldInstance, void* pNewInstance) = 0;
// </interfuscator:shuffle>
};
/// Interface for ...
struct ISoftCodeMgr
{
// <interfuscator:shuffle>
virtual ~ISoftCodeMgr() {}
// Used to register built-in libraries on first use
virtual void RegisterLibrary(ITypeLibrary* pLib) = 0;
// Loads any new SoftCode modules
virtual void LoadNewModules() = 0;
virtual void AddListener(const char* libraryName, ISoftCodeListener* pListener, const char* listenerName) = 0;
virtual void RemoveListener(const char* libraryName, ISoftCodeListener* pListener) = 0;
// To be called regularly to poll for library updates
virtual void PollForNewModules() = 0;
// Stops thread execution until a new SoftCode instance is available
virtual void* WaitForUpdate(void* pInstance) = 0;
/// Frees this instance from memory
//virtual void Release() = 0;
// </interfuscator:shuffle>
};
#endif // CRYINCLUDE_CRYCOMMON_ISOFTCODEMGR_H
-1
View File
@@ -34,7 +34,6 @@
#include <list>
#include "smartptr.h"
#include <IThreadTask.h> // <> required for Interfuscator
#include "CryThread.h"
#include "IStreamEngineDefs.h"
+3 -324
View File
@@ -49,19 +49,15 @@
#include <ILog.h> // <> required for Interfuscator
#include "CryVersion.h"
#include "smartptr.h"
#include <ISystemScheduler.h> // <> required for Interfuscator
#include <memory> // shared_ptr
#include <CrySystemBus.h>
struct ISystem;
struct ILog;
struct IProfileLogSystem;
namespace AZ::IO
{
struct IArchive;
}
struct IKeyboard;
struct IMouse;
struct IConsole;
struct IRemoteConsole;
struct IRenderer;
@@ -79,29 +75,21 @@ struct SFileVersion;
struct INameTable;
struct ILevelSystem;
struct IViewSystem;
struct IMaterialEffects;
class IOpticsManager;
class ICrySizer;
class IXMLBinarySerializer;
struct IReadWriteXMLSink;
struct IThreadTaskManager;
struct IResourceManager;
struct ITextModeConsole;
struct IAVI_Reader;
class CPNoise3;
struct IVisualLog;
struct ILocalizationManager;
struct ISoftCodeMgr;
struct IZLibCompressor;
struct IZLibDecompressor;
struct ILZ4Decompressor;
class IZStdDecompressor;
struct IOutputPrintSink;
struct IThreadManager;
struct IWindowMessageHandler;
struct IImageHandler;
class IResourceCompilerHelper;
class ILmbrAWS;
namespace AZ
{
@@ -111,12 +99,6 @@ namespace AZ
}
}
class IResourceCompilerHelper;
namespace Serialization {
struct IArchiveHost;
}
typedef void* WIN_HWND;
class CCamera;
@@ -124,39 +106,13 @@ struct CLoadingTimeProfiler;
class ICmdLine;
struct INotificationNetwork;
class ILyShine;
namespace JobManager {
struct IJobManager;
}
#define PROC_MENU 1
#define PROC_3DENGINE 2
// Summary:
// IDs for script userdata typing.
// Remarks:
// Maybe they should be moved into the game.dll .
//##@{
#define USER_DATA_SOUND 1
#define USER_DATA_TEXTURE 2
#define USER_DATA_OBJECT 3
#define USER_DATA_LIGHT 4
#define USER_DATA_BONEHANDLER 5
#define USER_DATA_POINTER 6
//##@}
enum ESystemUpdateFlags
{
ESYSUPDATE_IGNORE_PHYSICS = 0x0002,
// Summary:
// Special update mode for editor.
ESYSUPDATE_EDITOR = 0x0004,
ESYSUPDATE_MULTIPLAYER = 0x0008,
ESYSUPDATE_EDITOR_AI_PHYSICS = 0x0010,
ESYSUPDATE_EDITOR_ONLY = 0x0020,
ESYSUPDATE_UPDATE_VIEW_ONLY = 0x0040
ESYSUPDATE_EDITOR = 0x0004
};
// Description:
@@ -189,29 +145,6 @@ enum ESystemConfigPlatform
END_CONFIG_PLATFORM_ENUM, // MUST BE LAST VALUE. USED FOR ERROR CHECKING.
};
enum ESubsystem
{
ESubsys_3DEngine = 0,
ESubsys_AI = 1,
ESubsys_Physics = 2,
ESubsys_Renderer = 3,
ESubsys_Script = 4
};
// Summary:
// Collates cycles taken per update.
struct sUpdateTimes
{
uint32 PhysYields;
uint64 SysUpdateTime;
uint64 PhysStepTime;
uint64 RenderTime;
//extended yimes info
uint64 physWaitTime;
uint64 streamingWaitTime;
uint64 animationWaitTime;
};
enum ESystemGlobalState
{
ESYSTEM_GLOBAL_STATE_UNKNOWN,
@@ -568,33 +501,6 @@ struct IErrorObserver
// </interfuscator:shuffle>
};
enum ESystemProtectedFunctions
{
eProtectedFunc_Save = 0,
eProtectedFunc_Load = 1,
eProtectedFuncsLast = 10,
};
struct SCvarsDefault
{
SCvarsDefault()
{
sz_r_DriverDef = NULL;
}
const char* sz_r_DriverDef;
};
#if defined(CVARS_WHITELIST)
struct ICVarsWhitelist
{
// <interfuscator:shuffle>
virtual ~ICVarsWhitelist() {};
virtual bool IsWhiteListed(const string& command, bool silent) = 0;
// </interfuscator:shuffle>
};
#endif // defined(CVARS_WHITELIST)
#if defined(AZ_RESTRICTED_PLATFORM)
#define AZ_RESTRICTED_SECTION ISYSTEM_H_SECTION_3
#include AZ_RESTRICTED_FILE(ISystem_h)
@@ -616,9 +522,6 @@ struct SSystemInitParams
{
void* hInstance; //
void* hWnd; //
void* hWndForInputSystem; // the HWND for the input devices, distinct from the hWnd, which the rendering system overrides anyways
bool remoteResourceCompiler;
ILog* pLog; // You can specify your own ILog to be used by System.
ILogCallback* pLogCallback; // You can specify your own ILogCallback to be added on log creation (used by Editor).
@@ -633,33 +536,14 @@ struct SSystemInitParams
bool bPreview; // When running in Preview mode (Minimal initialization).
bool bTestMode; // When running in Automated testing mode.
bool bDedicatedServer; // When running a dedicated server.
bool bExecuteCommandLine; // can be switched of to suppress the feature or do it later during the initialization.
bool bSkipFont; // Don't load CryFont.dll
bool bSkipConsole; // Don't create console
bool bSkipNetwork; // Don't create Network
bool bSkipWebsocketServer; // Don't create the WebSocket server
bool bMinimal; // Don't load banks
bool bTesting; // CryUnit
bool bNoRandom; //use fixed generator init/seed
bool bUnattendedMode; // When running as part of a build on build-machines: Prevent popping up of any dialog
bool bSkipMovie; // Don't load movie
bool bSkipAnimation; // Don't load animation
bool bToolMode; // System is running inside a tool. Will not create USER directory or anything else that the game needs to do
bool bSkipPhysics; // Don't initialize CryPhysics.
ISystem* pSystem; // Pointer to existing ISystem interface, it will be reused if not NULL.
typedef void* (*ProtectedFunction)(void* param1, void* param2);
ProtectedFunction pProtectedFunctions[eProtectedFuncsLast]; // Protected functions.
SCvarsDefault* pCvarsDefault; // to override the default value of some cvar
#if defined(CVARS_WHITELIST)
ICVarsWhitelist* pCVarsWhitelist; // CVars whitelist callback
#endif // defined(CVARS_WHITELIST)
SharedEnvironmentInstance* pSharedEnvironment;
// Summary:
@@ -668,16 +552,10 @@ struct SSystemInitParams
{
hInstance = NULL;
hWnd = NULL;
hWndForInputSystem = NULL;
remoteResourceCompiler = false;
pLog = NULL;
pLogCallback = NULL;
pUserCallback = NULL;
#if defined(CVARS_WHITELIST)
pCVarsWhitelist = NULL;
#endif // defined(CVARS_WHITELIST)
sLogFileName = NULL;
autoBackupLogs = true;
pValidator = NULL;
@@ -688,32 +566,13 @@ struct SSystemInitParams
bPreview = false;
bTestMode = false;
bDedicatedServer = false;
bExecuteCommandLine = true;
bExecuteCommandLine = true;
bSkipFont = false;
bSkipConsole = false;
bSkipNetwork = false;
#if defined(WIN32) || defined(WIN64)
// create websocket server by default. bear in mind that USE_HTTP_WEBSOCKETS is not defined in release.
bSkipWebsocketServer = false;
#else
// CTCPStreamSocket only seems to fully support Win32 and 64
bSkipWebsocketServer = true;
#endif
bMinimal = false;
bTesting = false;
bNoRandom = false;
bUnattendedMode = false;
bSkipMovie = false;
bSkipAnimation = false;
bToolMode = false;
bSkipPhysics = false;
pSystem = NULL;
memset(pProtectedFunctions, 0, sizeof(pProtectedFunctions));
pCvarsDefault = NULL;
pSharedEnvironment = nullptr;
}
};
@@ -782,8 +641,6 @@ struct SSystemGlobalEnvironment
{
AZ::IO::IArchive* pCryPak;
AZ::IO::FileIOBase* pFileIO;
IProfileLogSystem* pProfileLogSystem;
IOpticsManager* pOpticsManager;
ITimer* pTimer;
ICryFont* pCryFont;
::IConsole* pConsole;
@@ -791,81 +648,27 @@ struct SSystemGlobalEnvironment
ILog* pLog;
IMovieSystem* pMovieSystem;
INameTable* pNameTable;
IVisualLog* pVisualLog;
IRenderer* pRenderer;
IMaterialEffects* pMaterialEffects;
ISoftCodeMgr* pSoftCodeMgr;
ILyShine* pLyShine;
IResourceCompilerHelper* pResourceCompilerHelper;
SharedEnvironmentInstance* pSharedEnvironment;
IThreadManager* pThreadManager;
#if defined(AZ_RESTRICTED_PLATFORM)
#define AZ_RESTRICTED_SECTION ISYSTEM_H_SECTION_4
#include AZ_RESTRICTED_FILE(ISystem_h)
#endif
ISystemScheduler* pSystemScheduler;
threadID mMainThreadId; //The main thread ID is used in multiple systems so should be stored globally
//////////////////////////////////////////////////////////////////////////
uint32 nMainFrameID;
//////////////////////////////////////////////////////////////////////////
const char* szCmdLine; // Startup command line.
//////////////////////////////////////////////////////////////////////////
// Generic debug string which can be easily updated by any system and output by the debug handler
enum
{
MAX_DEBUG_STRING_LENGTH = 128
};
char szDebugStatus[MAX_DEBUG_STRING_LENGTH];
//////////////////////////////////////////////////////////////////////////
// Used to tell if this is a server/multiplayer instance
bool bServer;
bool bMultiplayer;
bool bHostMigrating;
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// Indicate Editor status.
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// Used by CRY_ASSERT
bool bIgnoreAllAsserts;
bool bNoAssertDialog;
bool bTesting;
//////////////////////////////////////////////////////////////////////////
bool bNoRandomSeed;
SPlatformInfo pi;
// Protected functions.
SSystemInitParams::ProtectedFunction pProtectedFunctions[eProtectedFuncsLast]; // Protected functions.
//////////////////////////////////////////////////////////////////////////
// Flag to able to print out of memory conditon
bool bIsOutOfMemory;
bool bIsOutOfVideoMemory;
bool bToolMode;
int retCode = 0;
ILINE const bool IsClient() const
{
#if defined(CONSOLE)
return true;
#else
return bClient;
#endif
}
ILINE const bool IsDedicated() const
{
#if defined(CONSOLE)
@@ -895,11 +698,6 @@ struct SSystemGlobalEnvironment
{
bDedicated = isDedicated;
}
ILINE void SetIsClient(bool isClient)
{
bClient = isClient;
}
#endif
//this way the compiler can strip out code for consoles
@@ -939,26 +737,6 @@ struct SSystemGlobalEnvironment
#endif
}
ILINE const bool IsFMVPlaying() const
{
return m_isFMVPlaying;
}
ILINE void SetFMVIsPlaying(const bool isPlaying)
{
m_isFMVPlaying = isPlaying;
}
ILINE const bool IsCutscenePlaying() const
{
return m_isCutscenePlaying;
}
ILINE void SetCutsceneIsPlaying(const bool isPlaying)
{
m_isCutscenePlaying = isPlaying;
}
ILINE bool IsInToolMode() const
{
return bToolMode;
@@ -969,35 +747,17 @@ struct SSystemGlobalEnvironment
bToolMode = bNewToolMode;
}
ILINE void SetDynamicMergedMeshGenerationEnabled(bool mmgenEnable)
{
m_bDynamicMergedMeshGenerationEnabled = mmgenEnable;
}
ILINE const bool IsDynamicMergedMeshGenerationEnabled() const
{
return m_bDynamicMergedMeshGenerationEnabled;
}
#if !defined(CONSOLE)
private:
bool bClient;
bool bEditor; // Engine is running under editor.
bool bEditorGameMode; // Engine is in editor game mode.
bool bEditorSimulationMode; // Engine is in editor simulation mode.
bool bDedicated; // Engine is in dedicated
#endif
bool m_isFMVPlaying;
bool m_isCutscenePlaying;
bool m_bDynamicMergedMeshGenerationEnabled;
public:
SSystemGlobalEnvironment()
: pSystemScheduler(nullptr)
, szCmdLine("")
, bToolMode(false)
, m_bDynamicMergedMeshGenerationEnabled(false)
: bToolMode(false)
{
};
};
@@ -1035,37 +795,11 @@ struct IProfilingSystem
// Initialize and dispatch all engine's subsystems.
struct ISystem
{
struct ILoadingProgressListener
{
// <interfuscator:shuffle>
virtual ~ILoadingProgressListener() {}
virtual void OnLoadingProgress(int steps) = 0;
// </interfuscator:shuffle>
};
#ifndef _RELEASE
enum LevelLoadOrigin
{
eLLO_Unknown,
eLLO_NewLevel,
eLLO_Level2Level,
eLLO_Resumed,
eLLO_MapCmd,
};
struct ICheckpointData
{
int m_totalLoads;
LevelLoadOrigin m_loadOrigin;
};
#endif
// <interfuscator:shuffle>
virtual ~ISystem() {}
// Summary:
// Releases ISystem.
virtual void Release() = 0;
virtual ILoadConfigurationEntrySink* GetCVarsWhiteListConfigSink() const = 0; // will return NULL if no whitelisting
// Summary:
// Returns pointer to the global environment structure.
@@ -1094,9 +828,6 @@ struct ISystem
virtual void DoWorkDuringOcclusionChecks() = 0;
virtual bool NeedDoWorkDuringOcclusionChecks() = 0;
//! Update screen and call some important tick functions during loading.
virtual void SynchronousLoadingTick(const char* pFunc, int line) = 0;
// Summary:
// Returns the current used memory.
virtual uint32 GetUsedMemory() = 0;
@@ -1170,7 +901,6 @@ struct ISystem
virtual IZLibDecompressor* GetIZLibDecompressor() = 0;
virtual ILZ4Decompressor* GetLZ4Decompressor() = 0;
virtual IZStdDecompressor* GetZStdDecompressor() = 0;
virtual INotificationNetwork* GetINotificationNetwork() = 0;
virtual IViewSystem* GetIViewSystem() = 0;
virtual ILevelSystem* GetILevelSystem() = 0;
virtual INameTable* GetINameTable() = 0;
@@ -1187,24 +917,10 @@ struct ISystem
// Returns:
// Can be NULL, because it only exists when running through the editor, not in pure game mode.
virtual IResourceManager* GetIResourceManager() = 0;
virtual IThreadTaskManager* GetIThreadTaskManager() = 0;
virtual IProfilingSystem* GetIProfilingSystem() = 0;
virtual ISystemEventDispatcher* GetISystemEventDispatcher() = 0;
virtual IVisualLog* GetIVisualLog() = 0;
virtual ITimer* GetITimer() = 0;
virtual IThreadManager* GetIThreadManager() = 0;
virtual void SetLoadingProgressListener(ILoadingProgressListener* pListener) = 0;
virtual ISystem::ILoadingProgressListener* GetLoadingProgressListener() const = 0;
// Summary:
// Game is created after System init, so has to be set explicitly.
virtual void SetIMaterialEffects(IMaterialEffects* pMaterialEffects) = 0;
virtual void SetIOpticsManager(IOpticsManager* pOpticsManager) = 0;
virtual void SetIVisualLog(IVisualLog* pVisualLog) = 0;
//virtual const char *GetGamePath()=0;
virtual void DebugStats(bool checkpoint, bool leaks) = 0;
virtual void DumpWinHeaps() = 0;
@@ -1219,7 +935,6 @@ struct ISystem
virtual bool WasInDevMode() const = 0;
virtual bool IsDevMode() const = 0;
virtual bool IsMODValid(const char* szMODName) const = 0;
virtual bool IsMinimalMode() const = 0;
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
@@ -1334,12 +1049,6 @@ struct ISystem
// Detects and set optimal spec.
virtual void AutoDetectSpec(bool detectResolution) = 0;
// Summary:
// Thread management for subsystems
// Return Value:
// Non-0 if the state was indeed changed, 0 if already in that state.
virtual int SetThreadState(ESubsystem subsys, bool bActive) = 0;
// Summary:
// Query if system is now paused.
// Pause flag is set when calling system update with pause mode.
@@ -1406,14 +1115,6 @@ struct ISystem
// Get log index of the currently running Open 3D Engine application. (0 = first instance, 1 = second instance, etc)
virtual int GetApplicationLogInstance(const char* logFilePath) = 0;
// Summary:
// Retrieves the current stats for systems to update the respective time taken
virtual sUpdateTimes& GetCurrentUpdateTimeStats() = 0;
// Summary:
// Retrieves the array of update times and the number of entries
virtual const sUpdateTimes* GetUpdateTimeStats(uint32&, uint32&) = 0;
// Summary:
// Clear all currently logged and drawn on screen error messages
virtual void ClearErrorMessages() = 0;
@@ -1458,17 +1159,6 @@ struct ISystem
virtual void AsyncMemcpy(void* dst, const void* src, size_t size, int nFlags, volatile int* sync) = 0;
// </interfuscator:shuffle>
#if defined(CVARS_WHITELIST)
virtual ICVarsWhitelist* GetCVarsWhiteList() const = 0;
#endif // defined(CVARS_WHITELIST)
#ifndef _RELEASE
virtual void GetCheckpointData(ICheckpointData& data) = 0;
virtual void IncreaseCheckpointLoadCount() = 0;
virtual void SetLoadOrigin(LevelLoadOrigin origin) = 0;
#endif
#if !defined(_RELEASE)
virtual bool IsSavingResourceList() const = 0;
#endif
@@ -1513,11 +1203,6 @@ struct ISystem
using CrySystemNotificationBus = AZ::EBus<CrySystemNotifications>;
};
//JAT - this is a very important function for the dedicated server - it lets us run >1000 players per piece of server hardware
//JAT - this saves us lots of money on the dedicated server hardware
#define SYNCHRONOUS_LOADING_TICK() do { if (gEnv && gEnv->pSystem) {gEnv->pSystem->SynchronousLoadingTick(__FUNC__, __LINE__); } \
} while (0)
#if defined(USE_DISK_PROFILER)
struct DiskOperationInfo
@@ -1594,7 +1279,7 @@ typedef ISystem* (*PFNCREATESYSTEMINTERFACE)(SSystemInitParams& initParams);
//////////////////////////////////////////////////////////////////////////
// Global environment variable.
//////////////////////////////////////////////////////////////////////////
extern SC_API SSystemGlobalEnvironment* gEnv;
extern SSystemGlobalEnvironment* gEnv;
// Summary:
@@ -1613,11 +1298,6 @@ inline ISystem* GetISystem()
}
return systemInterface;
};
inline ISystemScheduler* GetISystemScheduler(void)
{
return gEnv->pSystemScheduler;
};
//////////////////////////////////////////////////////////////////////////
// Description:
@@ -1640,7 +1320,6 @@ void* GetDetachEnvironmentSymbol();
extern bool g_bProfilerEnabled;
extern int g_iTraceAllocations;
// Summary:
// Interface of the DLL.
@@ -1,63 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#ifndef CRYINCLUDE_CRYCOMMON_ISYSTEMSCHEDULER_H
#define CRYINCLUDE_CRYCOMMON_ISYSTEMSCHEDULER_H
#pragma once
#if defined(__cplusplus)
#define SLICE_AND_SLEEP() do { if (GetISystemScheduler()) { GetISystemScheduler()->SliceAndSleep(__FUNC__, __LINE__); } \
} while (0)
#define SLICE_SCOPE_DEFINE() CSliceLoadingMonitor sliceScope
#else
extern void SliceAndSleep(const char* pFunc, int line);
#define SLICE_AND_SLEEP() SliceAndSleep(__FILE__, __LINE__)
#endif
struct ISystemScheduler
{
virtual ~ISystemScheduler(){}
// <interfuscator:shuffle>
// Map load slicing functionality support
virtual void SliceAndSleep(const char* sliceName, int line) = 0;
virtual void SliceLoadingBegin() = 0;
virtual void SliceLoadingEnd() = 0;
virtual void SchedulingSleepIfNeeded(void) = 0;
// </interfuscator:shuffle>
};
ISystemScheduler* GetISystemScheduler(void);
class CSliceLoadingMonitor
{
public:
CSliceLoadingMonitor()
{
if (GetISystemScheduler())
{
GetISystemScheduler()->SliceLoadingBegin();
}
}
~CSliceLoadingMonitor()
{
if (GetISystemScheduler())
{
GetISystemScheduler()->SliceLoadingEnd();
}
}
};
#endif // CRYINCLUDE_CRYCOMMON_ISYSTEMSCHEDULER_H
-111
View File
@@ -1,111 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#pragma once
class IThreadConfigManager;
enum EJoinMode
{
eJM_TryJoin,
eJM_Join,
};
class IThread
{
public:
// <interfuscator:shuffle>
virtual ~IThread()
{
}
//! Entry functions for code executed on thread.
virtual void ThreadEntry() = 0;
// </interfuscator:shuffle>
};
enum EFPE_Severity
{
eFPE_None, //!< No Floating Point Exceptions.
eFPE_Basic, //!< Invalid operation, Div by 0.
eFPE_All, //!< Invalid operation, Div by 0, Denormalized operand, Overflow, Underflow, Inexact.
eFPE_LastEntry
};
//temp disable CRY DX12
//#define SCOPED_ENABLE_FLOAT_EXCEPTIONS(eFPESeverity) CScopedFloatingPointException scopedSetFloatExceptionMask(eFPESeverity)
//#define SCOPED_DISABLE_FLOAT_EXCEPTIONS() CScopedFloatingPointException scopedSetFloatExceptionMask(eFPE_None)
struct IThreadManager
{
public:
// <interfuscator:shuffle>
virtual ~IThreadManager()
{
}
//! Get thread config manager.
virtual IThreadConfigManager* GetThreadConfigManager() = 0;
//! Spawn a new thread and apply thread config settings at thread beginning.
virtual bool SpawnThread(IThread* pThread, const char* sThreadName, ...) = 0;
//! Wait on another thread to exit (Blocking).
//! Use eJM_TryJoin if you cannot be sure that the target thread is awake.
//! \retval true if target thread has not been started yet or has already exited.
//! \retval false if target thread is still running and therefore not in a state to exit.
virtual bool JoinThread(IThread* pThreadTask, EJoinMode joinStatus) = 0;
//! Register 3rd party thread with the thread manager.
//! Applies thread config for thread if found.
//! \param pThreadHandle If NULL, the current thread handle will be used.
virtual bool RegisterThirdPartyThread(void* pThreadHandle, const char* sThreadName, ...) = 0;
//! Unregister 3rd party thread with the thread manager.
virtual bool UnRegisterThirdPartyThread(const char* sThreadName, ...) = 0;
//! Get Thread Name.
//! Returns "" if thread not found.
virtual const char* GetThreadName(threadID nThreadId) = 0;
//! Get ThreadID.
virtual threadID GetThreadId(const char* sThreadName, ...) = 0;
//! Execute function for each other thread but this one.
typedef void (* ThreadModifFunction)(threadID nThreadId, void* pData);
virtual void ForEachOtherThread(IThreadManager::ThreadModifFunction fpThreadModiFunction, void* pFuncData = 0) = 0;
virtual void EnableFloatExceptions(EFPE_Severity eFPESeverity, threadID nThreadId = 0) = 0;
virtual void EnableFloatExceptionsForEachOtherThread(EFPE_Severity eFPESeverity) = 0;
virtual uint GetFloatingPointExceptionMask() = 0;
virtual void SetFloatingPointExceptionMask(uint nMask) = 0;
// </interfuscator:shuffle>
};
/*TEMP DISABLE CRY DX12
class CScopedFloatingPointException
{
public:
CScopedFloatingPointException(EFPE_Severity eFPESeverity)
{
oldMask = gEnv->pThreadManager->GetFloatingPointExceptionMask();
gEnv->pThreadManager->EnableFloatExceptions(eFPESeverity);
}
~CScopedFloatingPointException()
{
gEnv->pThreadManager->SetFloatingPointExceptionMask(oldMask);
}
private:
uint oldMask;
};
*/
-166
View File
@@ -1,166 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#include "BitFiddling.h"
#ifndef CRYINCLUDE_CRYCOMMON_ITHREADTASK_H
#define CRYINCLUDE_CRYCOMMON_ITHREADTASK_H
#pragma once
#include <smartptr.h>
// forward declarations
struct SThreadTaskInfo;
enum EThreadTaskFlags
{
THREAD_TASK_BLOCKING = BIT(0), // Blocking tasks will be allocated on their own thread.
THREAD_TASK_ASSIGN_TO_POOL = BIT(1), // Task can be assigned to any thread in the group of threads
};
class IThreadTask_Thread
{
public:
// <interfuscator:shuffle>
virtual ~IThreadTask_Thread() {};
virtual void AddTask(SThreadTaskInfo* pTaskInfo) = 0;
virtual void RemoveTask(SThreadTaskInfo* pTaskInfo) = 0;
virtual void RemoveAllTasks() = 0;
virtual void SingleUpdate() = 0;
// </interfuscator:shuffle>
};
typedef int ThreadPoolHandle;
struct SThreadTaskParams
{
uint32 nFlags; // Task flags. @see ETaskFlags
union
{
int nPreferedThread; // Preferred Thread index (0,1,2,3...)
ThreadPoolHandle nThreadsGroupId; // Id of group of threads(useful only if THREAD_TASK_ASSIGN_TO_POOL is set)
};
int16 nPriorityOff; // If THREAD_TASK_BLOCKING, this will adjust the priority of the thread
int16 nStackSizeKB; // If THREAD_TASK_BLOCKING, this will adjust the stack size of the thread
const char* name; // Name for this task (thread for the blocking task will be named using this string)
SThreadTaskParams()
: nFlags(0)
, nPreferedThread(-1)
, nPriorityOff(0)
, name("")
, nStackSizeKB(SIMPLE_THREAD_STACK_SIZE_KB) {}
};
//////////////////////////////////////////////////////////////////////////
// Tasks must implement this interface.
//////////////////////////////////////////////////////////////////////////
struct IThreadTask
{
// <interfuscator:shuffle>
// The function to be called on every update for non bocking tasks.
// Or will be called only once for the blocking threads.
virtual void OnUpdate() = 0;
// Called to indicate that this task must quit.
// Warning! can be called from different thread then OnUpdate call.
virtual void Stop() = 0;
// Returns task info
virtual struct SThreadTaskInfo* GetTaskInfo() = 0;
virtual ~IThreadTask() {}
// </interfuscator:shuffle>
};
struct SThreadTaskInfo
: public CMultiThreadRefCount
{
IThreadTask_Thread* m_pThread;
IThreadTask* m_pTask;
SThreadTaskParams m_params;
SThreadTaskInfo()
: m_pThread(NULL)
, m_pTask(NULL) { m_params.nFlags = 0; m_params.nPreferedThread = -1; }
};
// Might be changed to uint64 etc in the future
typedef uint32 ThreadPoolAffinityMask;
#define INVALID_AFFINITY 0
//////////////////////////////////////////////////////////////////////////
// Description of thread pool to create
//////////////////////////////////////////////////////////////////////////
struct ThreadPoolDesc
{
ThreadPoolAffinityMask AffinityMask; // number of bits means number of threads. affinity overlapping is prohibited
string sPoolName;
int32 nThreadPriority;
int32 nThreadStackSizeKB;
ThreadPoolDesc()
: AffinityMask(INVALID_AFFINITY)
, sPoolName("UnnamedPool")
, nThreadPriority(-1)
, nThreadStackSizeKB(-1) { }
ILINE bool CreateThread(ThreadPoolAffinityMask affinityMask)
{
if (this->AffinityMask & affinityMask)
{
return false;
}
this->AffinityMask |= affinityMask;
return true;
}
ILINE uint32 GetThreadCount() const
{
return CountBits(AffinityMask);
}
};
//////////////////////////////////////////////////////////////////////////
// Task manager.
//////////////////////////////////////////////////////////////////////////
struct IThreadTaskManager
{
// <interfuscator:shuffle>
virtual ~IThreadTaskManager(){}
// Register new task to the manager.
virtual void RegisterTask(IThreadTask* pTask, const SThreadTaskParams& options) = 0;
virtual void UnregisterTask(IThreadTask* pTask) = 0;
// Limit number of threads to this amount.
virtual void SetMaxThreadCount(int nMaxThreads) = 0;
// Create a pool of threads
virtual ThreadPoolHandle CreateThreadsPool(const ThreadPoolDesc& desc) = 0;
virtual const bool DestroyThreadsPool(const ThreadPoolHandle& handle) = 0;
virtual const bool GetThreadsPoolDesc(const ThreadPoolHandle handle, ThreadPoolDesc* pDesc) const = 0;
virtual const bool SetThreadsPoolAffinity(const ThreadPoolHandle handle, const ThreadPoolAffinityMask AffinityMask) = 0;
virtual void SetThreadName(threadID dwThreadId, const char* sThreadName) = 0;
virtual const char* GetThreadName(threadID dwThreadId) = 0;
// Return thread handle by thread name
virtual threadID GetThreadByName(const char* sThreadName) = 0;
// if bMark=true the calling thread will dump its stack during crashes
virtual void MarkThisThreadForDebugging(const char* name, bool bDump) = 0;
// </interfuscator:shuffle>
};
#endif // CRYINCLUDE_CRYCOMMON_ITHREADTASK_H
@@ -585,8 +585,6 @@ public:
SDepthTexture * (int, int, bool));
MOCK_METHOD1(DestroyDepthSurface,
void(SDepthTexture * pDepthSurf));
MOCK_CONST_METHOD1(CreateOptics,
IOpticsElementBase * (EFlareType type));
MOCK_METHOD1(PauseTimer,
void(bool bPause));
MOCK_METHOD0(CreateShaderPublicParams,
@@ -23,8 +23,6 @@ class SystemMock
public:
MOCK_METHOD0(Release,
void());
MOCK_CONST_METHOD0(GetCVarsWhiteListConfigSink,
ILoadConfigurationEntrySink * ());
MOCK_METHOD0(GetGlobalEnvironment,
SSystemGlobalEnvironment * ());
MOCK_METHOD2(UpdatePreTickBus,
@@ -37,8 +35,6 @@ public:
void());
MOCK_METHOD0(NeedDoWorkDuringOcclusionChecks,
bool());
MOCK_METHOD2(SynchronousLoadingTick,
void(const char* pFunc, int line));
MOCK_METHOD0(RenderStatistics,
void());
MOCK_METHOD0(GetUsedMemory,
@@ -84,8 +80,6 @@ public:
ILZ4Decompressor * ());
MOCK_METHOD0(GetZStdDecompressor,
IZStdDecompressor * ());
MOCK_METHOD0(GetINotificationNetwork,
INotificationNetwork * ());
MOCK_METHOD0(GetIViewSystem,
IViewSystem * ());
MOCK_METHOD0(GetILevelSystem,
@@ -116,28 +110,12 @@ public:
IRemoteConsole * ());
MOCK_METHOD0(GetIResourceManager,
IResourceManager * ());
MOCK_METHOD0(GetIThreadTaskManager,
IThreadTaskManager * ());
MOCK_METHOD0(GetIProfilingSystem,
IProfilingSystem * ());
MOCK_METHOD0(GetISystemEventDispatcher,
ISystemEventDispatcher * ());
MOCK_METHOD0(GetIVisualLog,
IVisualLog * ());
MOCK_METHOD0(GetITimer,
ITimer * ());
MOCK_METHOD0(GetIThreadManager,
IThreadManager * ());
MOCK_METHOD1(SetLoadingProgressListener,
void(ILoadingProgressListener * pListener));
MOCK_CONST_METHOD0(GetLoadingProgressListener,
ISystem::ILoadingProgressListener * ());
MOCK_METHOD1(SetIMaterialEffects,
void(IMaterialEffects * pMaterialEffects));
MOCK_METHOD1(SetIOpticsManager,
void(IOpticsManager * pOpticsManager));
MOCK_METHOD1(SetIVisualLog,
void(IVisualLog * pVisualLog));
MOCK_METHOD2(DebugStats,
void(bool checkpoint, bool leaks));
MOCK_METHOD0(DumpWinHeaps,
@@ -154,8 +132,6 @@ public:
bool());
MOCK_CONST_METHOD1(IsMODValid,
bool(const char* szMODName));
MOCK_CONST_METHOD0(IsMinimalMode,
bool());
MOCK_METHOD3(CreateXmlNode,
XmlNodeRef(const char*, bool, bool));
MOCK_METHOD4(LoadXmlFromBuffer,
@@ -209,8 +185,6 @@ public:
void(ESystemConfigPlatform platform));
MOCK_METHOD1(AutoDetectSpec,
void(bool detectResolution));
MOCK_METHOD2(SetThreadState,
int(ESubsystem subsys, bool bActive));
MOCK_CONST_METHOD0(IsPaused,
bool());
MOCK_METHOD0(GetLocalizationManager,
@@ -239,10 +213,6 @@ public:
int());
MOCK_METHOD1(GetApplicationLogInstance,
int(const char* logFilePath));
MOCK_METHOD0(GetCurrentUpdateTimeStats,
sUpdateTimes & ());
MOCK_METHOD2(GetUpdateTimeStats,
const sUpdateTimes * (uint32 &, uint32 &));
MOCK_METHOD0(ClearErrorMessages,
void());
MOCK_METHOD2(debug_GetCallStack,
@@ -260,20 +230,6 @@ public:
MOCK_METHOD5(AsyncMemcpy,
void(void* dst, const void* src, size_t size, int nFlags, volatile int* sync));
#if defined(CVARS_WHITELIST)
MOCK_CONST_METHOD0(GetCVarsWhiteList,
ICVarsWhitelist * ());
#endif
#ifndef _RELEASE
MOCK_METHOD1(GetCheckpointData,
void(ICheckpointData & data));
MOCK_METHOD0(IncreaseCheckpointLoadCount,
void());
MOCK_METHOD1(SetLoadOrigin,
void(LevelLoadOrigin origin));
#endif
#if !defined(_RELEASE)
MOCK_CONST_METHOD0(IsSavingResourceList,
bool());
-70
View File
@@ -1,70 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#ifndef CRYINCLUDE_CRYCOMMON_PROFILELOG_H
#define CRYINCLUDE_CRYCOMMON_PROFILELOG_H
#pragma once
#include <ISystem.h> // <> required for Interfuscator
#include <ITimer.h> // <> required for Interfuscator
struct ILogElement
{
virtual ~ILogElement(){}
virtual ILogElement* Log (const char* name, const char* message) = 0;
virtual ILogElement* SetTime (float time) = 0;
virtual void Flush (stack_string& indent) = 0;
};
struct IProfileLogSystem
{
virtual ~IProfileLogSystem(){}
virtual ILogElement* Log (const char* name, const char* msg) = 0;
virtual void SetTime (ILogElement* pElement, float time) = 0;
virtual void Release () = 0;
};
struct SHierProfileLogItem
{
SHierProfileLogItem(const char* name, const char* msg, int inbDoLog)
: m_pLogElement(NULL)
, m_bDoLog(inbDoLog)
{
if (m_bDoLog)
{
m_pLogElement = gEnv->pProfileLogSystem->Log(name, msg);
m_startTime = gEnv->pTimer->GetAsyncTime();
}
}
~SHierProfileLogItem()
{
if (m_bDoLog)
{
CTimeValue endTime = gEnv->pTimer->GetAsyncTime();
gEnv->pProfileLogSystem->SetTime(m_pLogElement, (endTime - m_startTime).GetMilliSeconds());
}
}
private:
int m_bDoLog;
CTimeValue m_startTime;
ILogElement* m_pLogElement;
};
#define HPROFILE_BEGIN(msg1, msg2, doLog) { SHierProfileLogItem __hier_profile_uniq_var_in_this_scope__(msg1, msg2, doLog);
#define HPROFILE_END() }
#define HPROFILE(msg1, msg2, doLog) SHierProfileLogItem __hier_profile_uniq_var_in_this_scope__(msg1, msg2, doLog);
#endif // CRYINCLUDE_CRYCOMMON_PROFILELOG_H
-33
View File
@@ -78,9 +78,6 @@ typedef uint32 vtx_idx;
#if defined(WIN32) || defined(WIN64) || LOG_CONST_CVAR_ACCESS
#define RELEASE_LOGGING
//#if defined(_RELEASE)
//#define CVARS_WHITELIST
//#endif // defined(_RELEASE)
#endif
#if defined(_RELEASE) && !defined(RELEASE_LOGGING)
@@ -181,32 +178,6 @@ typedef uint32 vtx_idx;
#define SHADER_REFLECT_TEXTURE_SLOTS 0
#endif
#if (defined(WIN32) || defined(WIN64) || defined(AZ_PLATFORM_MAC)) && (!defined(AZ_MONOLITHIC_BUILD) || defined(RESOURCE_COMPILER))
#define CRY_ENABLE_RC_HELPER 1
#endif
#if !defined(_RELEASE) && PROJECTDEFINES_H_TRAIT_ENABLE_SOFTCODE_SYSTEM
#define SOFTCODE_SYSTEM_ENABLED
#endif
// Is SoftCoding enabled for this module? Usually set by the SoftCode AddIn in conjunction with a SoftCode.props file.
#ifdef SOFTCODE_ENABLED
// Is this current compilation unit part of a SOFTCODE build?
#ifdef SOFTCODE
// Import any SC functions from the host module
#define SC_API __declspec(dllimport)
#else
// Export any SC functions from the host module
#define SC_API __declspec(dllexport)
#endif
#else // SoftCode disabled
#define SC_API
#endif
// these enable and disable certain net features to give compatibility between PCs and consoles / profile and performance builds
#define PC_CONSOLE_NET_COMPATIBLE 0
#define PROFILE_PERFORMANCE_NET_COMPATIBLE 0
@@ -292,10 +263,6 @@ typedef uint32 vtx_idx;
# define ENABLE_LOADING_PROFILER // requires AZ_PROFILE_TELEMETRY to also be defined
#endif
#if defined(SOFTCODE_ENABLED)
#error "SoftCode currently relies on CryMemoryManager being enabled. Either build without SoftCode support, or enable CryMemoryManager."
#endif
#if PROJECTDEFINES_H_TRAIT_USE_GPU_PARTICLES && !defined(NULL_RENDERER)
#define GPU_PARTICLES 1
#else
@@ -1,639 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#include "ProjectDefines.h"
#if defined(CRY_ENABLE_RC_HELPER)
#include "ResourceCompilerHelper.h"
#include "EngineSettingsManager.h"
// When complining CryTiffPlugin the mayaAssert.h is included that defined
// Assert as _Assert. This wreaks havoc with AZ_Assert since under the covers
// it calls AzCore::Debug::Trace::Assert, which gets transformed bo
// Trace::_Assert, which does not exist. Gotta love macros. Undefine Assert
// before we include semaphore so that it can compile correctly
#if defined(Assert)
#undef Assert
#endif
#include <AzCore/std/parallel/semaphore.h>
#include <AzCore/std/smart_ptr/shared_ptr.h>
#include <AzCore/std/string/string_view.h>
#include <AzCore/Component/ComponentApplicationBus.h>
#include <AzCore/Utils/Utils.h>
#if defined(AZ_PLATFORM_WINDOWS)
#include <windows.h>
#include <shellapi.h> // ShellExecuteW()
#endif
#if AZ_TRAIT_OS_PLATFORM_APPLE
#include "AppleSpecific.h"
#include <CoreFoundation/CoreFoundation.h>
#else
#undef RC_EXECUTABLE
#define RC_EXECUTABLE "rc.exe"
#endif
#include <assert.h>
#include <string> // lawsonn - we use std::string internally
#include <sstream>
namespace
{
class LineStreamBuffer
{
public:
template <typename T>
LineStreamBuffer(T* object, void (T::* method)(const char* line))
: m_charCount(0)
, m_bTruncated(false)
{
m_target = new Target<T>(object, method);
}
~LineStreamBuffer()
{
Flush();
delete m_target;
}
void HandleText(const char* text, int length)
{
const char* pos = text;
while (pos - text < length)
{
const char* start = pos;
while (pos - text < length && *pos != '\n' && *pos != '\r')
{
++pos;
}
size_t n = pos - start;
if (m_charCount + n > kMaxCharCount)
{
n = kMaxCharCount - m_charCount;
m_bTruncated = true;
}
memcpy(&m_buffer[m_charCount], start, n);
m_charCount += n;
if (pos - text < length)
{
Flush();
while (pos - text < length && (*pos == '\n' || *pos == '\r'))
{
++pos;
}
}
}
}
void Flush()
{
if (m_charCount > 0)
{
m_buffer[m_charCount] = 0;
m_target->Call(m_buffer);
m_charCount = 0;
}
}
bool IsTruncated() const
{
return m_bTruncated;
}
private:
struct ITarget
{
virtual ~ITarget() {}
virtual void Call(const char* line) = 0;
};
template <typename T>
struct Target
: public ITarget
{
public:
Target(T* object, void (T::* method)(const char* line))
: object(object)
, method(method) {}
virtual void Call(const char* line)
{
(object->*method)(line);
}
private:
T* object;
void (T::* method)(const char* line);
};
ITarget* m_target;
size_t m_charCount;
static const size_t kMaxCharCount = 2047;
char m_buffer[kMaxCharCount + 1];
bool m_bTruncated;
};
#if !defined(AZ_PLATFORM_WINDOWS)
void MessageBoxW(int, const wchar_t* header, const wchar_t* message, unsigned long)
{
#if AZ_TRAIT_OS_PLATFORM_APPLE
CFStringEncoding encoding = (CFByteOrderLittleEndian == CFByteOrderGetCurrent()) ?
kCFStringEncodingUTF32LE : kCFStringEncodingUTF32BE;
CFStringRef header_ref = CFStringCreateWithBytes(nullptr, reinterpret_cast<const UInt8*>(header), wcslen(header) * sizeof(wchar_t), encoding, false);
CFStringRef message_ref = CFStringCreateWithBytes(nullptr, reinterpret_cast<const UInt8*>(message), wcslen(message) * sizeof(wchar_t), encoding, false);
CFOptionFlags result; //result code from the message box
CFUserNotificationDisplayAlert(0, kCFUserNotificationStopAlertLevel, 0, 0, 0, header_ref, message_ref, 0, 0, 0, &result);
CFRelease(header_ref);
CFRelease(message_ref);
#endif
}
#endif
}
namespace
{
class RcLock
{
public:
RcLock()
: m_cs(0u, 1u)
{
m_cs.release();
}
~RcLock()
{
}
void Lock()
{
m_cs.acquire();
}
void Unlock()
{
m_cs.release();
}
private:
AZStd::semaphore m_cs;
};
template<class LockClass>
class RcAutoLock
{
public:
RcAutoLock(LockClass& lock)
: m_lock(lock)
{
m_lock.Lock();
}
~RcAutoLock()
{
m_lock.Unlock();
}
private:
RcAutoLock();
RcAutoLock(const RcAutoLock<LockClass>&);
RcAutoLock<LockClass>& operator =(const RcAutoLock<LockClass>&);
private:
LockClass& m_lock;
};
HANDLE s_rcProcessHandle = 0;
RcLock s_rcProcessHandleLock;
}
//////////////////////////////////////////////////////////////////////////
static void ShowMessageBoxRcNotFound([[maybe_unused]] const wchar_t* const szCmdLine, [[maybe_unused]] const wchar_t* const szDir)
{
SettingsManagerHelpers::CFixedString<wchar_t, MAX_PATH* 4 + 150> tmp;
tmp.append(L"The resource compiler (RC.EXE) was not found.");
MessageBoxW(0, tmp.c_str(), L"Error", MB_ICONERROR | MB_OK);
}
//////////////////////////////////////////////////////////////////////////
namespace
{
class ResourceCompilerLineHandler
{
public:
ResourceCompilerLineHandler(IResourceCompilerListener* listener)
: m_listener(listener)
{
}
void HandleLine(const char* line)
{
if (!m_listener || !line)
{
return;
}
// check the first three characters to see if it's a warning or error.
bool bHasPrefix;
IResourceCompilerListener::MessageSeverity severity;
if ((line[0] == 'E') && (line[1] == ':') && (line[2] == ' '))
{
bHasPrefix = true;
severity = IResourceCompilerListener::MessageSeverity_Error;
line += 3; // skip the prefix
}
else if ((line[0] == 'W') && (line[1] == ':') && (line[2] == ' '))
{
bHasPrefix = true;
severity = IResourceCompilerListener::MessageSeverity_Warning;
line += 3; // skip the prefix
}
else if ((line[0] == ' ') && (line[1] == ' ') && (line[2] == ' '))
{
bHasPrefix = true;
severity = IResourceCompilerListener::MessageSeverity_Info;
line += 3; // skip the prefix
}
else
{
bHasPrefix = false;
severity = IResourceCompilerListener::MessageSeverity_Info;
}
if (bHasPrefix)
{
// skip thread info "%d>", if present
{
const char* p = line;
while (*p == ' ')
{
++p;
}
if (isdigit(*p))
{
while (isdigit(*p))
{
++p;
}
if (*p == '>')
{
line = p + 1;
}
}
}
// skip time info "%d:%d", if present
{
const char* p = line;
while (*p == ' ')
{
++p;
}
if (isdigit(*p))
{
while (isdigit(*p))
{
++p;
}
if (*p == ':')
{
++p;
if (isdigit(*p))
{
while (isdigit(*p))
{
++p;
}
while (*p == ' ')
{
++p;
}
line = p;
}
}
}
}
}
m_listener->OnRCMessage(severity, line);
}
private:
IResourceCompilerListener* m_listener;
};
// we now support macros like #ENGINEROOT# in the string:
void replaceAllInStringInPlace(std::string& inOut, const char* findValue, const char* replaceValue)
{
if (!findValue)
{
return;
}
if (!replaceValue)
{
return;
}
std::string::size_type pos = std::string::npos;
std::string::size_type replaceLen = strlen(findValue);
while ((pos = inOut.find(findValue)) != std::string::npos)
{
inOut.replace(pos, replaceLen, replaceValue);
}
}
// given a string that contains macros (like #ENGINEROOT#), eliminate the macros and replace them with the real data.
// note that in the 'remote' implementation, these macros are sent to the remote RC. It can then expand them for its own environment
// but in a local RC, these macros are expanded by the local environment.
void expandMacros(const char* inputString, char* outputString, std::size_t bufferSize)
{
if (!inputString)
{
return;
}
if (!outputString)
{
return;
}
AZStd::string_view rootFolder;
AZ::ComponentApplicationBus::BroadcastResult(rootFolder, &AZ::ComponentApplicationRequests::GetAppRoot);
std::string finalString(inputString);
const AZStd::string rootFolderStr = rootFolder.data();
replaceAllInStringInPlace(finalString, "#ENGINEROOT#", rootFolderStr.c_str());
// put additional replacements here.
azstrcpy(outputString, bufferSize, finalString.c_str());
}
}
//////////////////////////////////////////////////////////////////////////
IResourceCompilerHelper::ERcCallResult CResourceCompilerHelper::CallResourceCompiler(
const char* szFileName,
const char* szAdditionalSettings,
IResourceCompilerListener* listener,
bool bMayShowWindow,
bool bSilent,
bool bNoUserDialog,
const wchar_t* szWorkingDirectory,
[[maybe_unused]] const wchar_t* szRootPath)
{
#if defined(AZ_PLATFORM_WINDOWS)
HANDLE hChildStdOutRd = INVALID_HANDLE_VALUE, hChildStdOutWr = INVALID_HANDLE_VALUE;
HANDLE hChildStdInRd = INVALID_HANDLE_VALUE, hChildStdInWr = INVALID_HANDLE_VALUE;
PROCESS_INFORMATION pi;
#else
FILE* hChildStdOutRd;
#endif
{
RcAutoLock<RcLock> lock(s_rcProcessHandleLock);
// make command for execution
SettingsManagerHelpers::CFixedString<wchar_t, MAX_PATH* 3> wRemoteCmdLine;
if (!szAdditionalSettings)
{
szAdditionalSettings = "";
}
// expand the additioanl settings.
char szActualFileName[512] = {0};
char szActualAdditionalSettings[512] = {0};
expandMacros(szFileName, szActualFileName, 512);
expandMacros(szAdditionalSettings, szActualAdditionalSettings, 512);
CSettingsManagerTools smTools = CSettingsManagerTools(); // moved this line to after macro expansion to avoid multiple of these existing at once.
AZStd::string_view exeFolderName;
AZ::ComponentApplicationBus::BroadcastResult(exeFolderName, &AZ::ComponentApplicationRequests::GetExecutableFolder);
wchar_t szRegSettingsBuffer[1024];
smTools.GetEngineSettingsManager()->GetValueByRef("RC_Parameters", SettingsManagerHelpers::CWCharBuffer(szRegSettingsBuffer, sizeof(szRegSettingsBuffer)));
bool enableSourceControl = true;
smTools.GetEngineSettingsManager()->GetValueByRef("RC_EnableSourceControl", enableSourceControl);
wRemoteCmdLine.appendAscii("\"");
wRemoteCmdLine.appendAscii(exeFolderName.data(), exeFolderName.size());
wRemoteCmdLine.appendAscii("/");
wRemoteCmdLine.appendAscii(RC_EXECUTABLE);
wRemoteCmdLine.appendAscii("\"");
if (!enableSourceControl)
{
wRemoteCmdLine.appendAscii(" -nosourcecontrol ");
}
if (!szFileName)
{
wRemoteCmdLine.appendAscii(" -userdialog=0 ");
wRemoteCmdLine.appendAscii(szActualAdditionalSettings);
wRemoteCmdLine.appendAscii(" ");
wRemoteCmdLine.append(szRegSettingsBuffer);
}
else
{
wRemoteCmdLine.appendAscii(" \"");
wRemoteCmdLine.appendAscii(szActualFileName);
wRemoteCmdLine.appendAscii("\"");
wRemoteCmdLine.appendAscii(bNoUserDialog ? " -userdialog=0 " : " -userdialog=1 ");
wRemoteCmdLine.appendAscii(szActualAdditionalSettings);
wRemoteCmdLine.appendAscii(" ");
wRemoteCmdLine.append(szRegSettingsBuffer);
}
// Create a pipe to read the stdout of the RC.
SECURITY_ATTRIBUTES saAttr;
if (listener)
{
#if defined(AZ_PLATFORM_WINDOWS)
ZeroMemory(&saAttr, sizeof(saAttr));
saAttr.bInheritHandle = TRUE;
saAttr.lpSecurityDescriptor = 0;
CreatePipe(&hChildStdOutRd, &hChildStdOutWr, &saAttr, 0);
SetHandleInformation(hChildStdOutRd, HANDLE_FLAG_INHERIT, 0); // Need to do this according to MSDN
CreatePipe(&hChildStdInRd, &hChildStdInWr, &saAttr, 0);
SetHandleInformation(hChildStdInWr, HANDLE_FLAG_INHERIT, 0); // Need to do this according to MSDN
#endif
}
#if defined(AZ_PLATFORM_WINDOWS)
STARTUPINFOW si;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
si.dwX = 100;
si.dwY = 100;
if (listener)
{
si.hStdError = hChildStdOutWr;
si.hStdOutput = hChildStdOutWr;
si.hStdInput = hChildStdInRd;
si.dwFlags = STARTF_USEPOSITION | STARTF_USESTDHANDLES;
}
else
{
si.dwFlags = STARTF_USEPOSITION;
}
ZeroMemory(&pi, sizeof(pi));
#endif
bool bShowWindow;
if (bMayShowWindow)
{
wchar_t buffer[20];
smTools.GetEngineSettingsManager()->GetValueByRef("ShowWindow", SettingsManagerHelpers::CWCharBuffer(buffer, sizeof(buffer)));
bShowWindow = (wcscmp(buffer, L"true") == 0);
}
else
{
bShowWindow = false;
}
#if defined(AZ_PLATFORM_WINDOWS)
const wchar_t* szStartingDirectory = szWorkingDirectory;
if (!szStartingDirectory)
{
char currentDirectory[MAX_PATH];
AZ::Utils::GetExecutableDirectory(currentDirectory, MAX_PATH);
SettingsManagerHelpers::CFixedString<wchar_t, MAX_PATH> wCurrentDirectory;
wCurrentDirectory.appendAscii(currentDirectory);
szStartingDirectory = wCurrentDirectory.c_str();
}
if (!CreateProcessW(
NULL, // No module name (use command line).
const_cast<wchar_t*>(wRemoteCmdLine.c_str()), // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
TRUE, // Set handle inheritance to TRUE.
bShowWindow ? 0 : CREATE_NO_WINDOW, // creation flags.
NULL, // Use parent's environment block.
szStartingDirectory, // Set starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi)) // Pointer to PROCESS_INFORMATION structure.
{
// The following code block is commented out instead of being deleted
// because it's good to have at hand for a debugging session.
#if 0
const size_t charsInMessageBuffer = 32768; // msdn about FormatMessage(): "The output buffer cannot be larger than 64K bytes."
wchar_t szMessageBuffer[charsInMessageBuffer] = L"";
FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, szMessageBuffer, charsInMessageBuffer, NULL);
GetCurrentDirectoryW(charsInMessageBuffer, szMessageBuffer);
#endif
if (!bSilent)
{
ShowMessageBoxRcNotFound(wRemoteCmdLine.c_str(), szStartingDirectory);
}
return eRcCallResult_notFound;
}
s_rcProcessHandle = pi.hProcess;
#else
int fd = open(".", O_RDONLY);
char remoteCmdLineUtf8[MAX_PATH * 8];
char workingDirectory[MAX_PATH * 8];
ConvertUtf16ToUtf8(wRemoteCmdLine.c_str(), SettingsManagerHelpers::CCharBuffer(remoteCmdLineUtf8, MAX_PATH * 8));
if (szWorkingDirectory)
{
ConvertUtf16ToUtf8(szWorkingDirectory, SettingsManagerHelpers::CCharBuffer(workingDirectory, MAX_PATH * 8));
chdir(workingDirectory);
}
hChildStdOutRd = popen(remoteCmdLineUtf8, "r");
fchdir(fd);
if (hChildStdOutRd == nullptr)
{
if (!bSilent)
{
ShowMessageBoxRcNotFound(wRemoteCmdLine.c_str(), szWorkingDirectory);
}
return eRcCallResult_notFound;
}
#endif
}
bool bFailedToReadOutput = false;
if (listener)
{
#if defined(AZ_PLATFORM_WINDOWS)
// Close the pipe that writes to the child process, since we don't actually have any input for it.
CloseHandle(hChildStdInWr);
// Read all the output from the child process.
CloseHandle(hChildStdOutWr);
#endif
ResourceCompilerLineHandler lineHandler(listener);
LineStreamBuffer lineBuffer(&lineHandler, &ResourceCompilerLineHandler::HandleLine);
for (;; )
{
char buffer[2048];
DWORD bytesRead;
#if defined(AZ_PLATFORM_WINDOWS)
if (!ReadFile(hChildStdOutRd, buffer, sizeof(buffer), &bytesRead, NULL) || (bytesRead == 0))
#else
if (fgets(buffer, sizeof(buffer), hChildStdOutRd) == nullptr || (bytesRead = strlen(buffer) == 0))
#endif
{
break;
}
lineBuffer.HandleText(buffer, bytesRead);
}
bFailedToReadOutput = lineBuffer.IsTruncated();
}
#if defined(AZ_PLATFORM_WINDOWS)
// Wait until child process exits.
WaitForSingleObject(pi.hProcess, INFINITE);
#else
DWORD exitCode = pclose(hChildStdOutRd);
#endif
#if defined(AZ_PLATFORM_WINDOWS)
RcAutoLock<RcLock> lock(s_rcProcessHandleLock);
s_rcProcessHandle = 0;
DWORD exitCode = eRcExitCode_Error;
if (bFailedToReadOutput || GetExitCodeProcess(pi.hProcess, &exitCode) == 0)
{
exitCode = eRcExitCode_Error;
}
// Close process and thread handles.
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
#endif
return ConvertResourceCompilerExitCodeToResultCode(exitCode);
}
#endif //(CRY_ENABLE_RC_HELPER)
@@ -1,46 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#ifndef CRYINCLUDE_CRYCOMMON_RESOURCECOMPILERHELPER_H
#define CRYINCLUDE_CRYCOMMON_RESOURCECOMPILERHELPER_H
#pragma once
#if defined(CRY_ENABLE_RC_HELPER)
#include "IResourceCompilerHelper.h"
//////////////////////////////////////////////////////////////////////////
// Provides settings and functions to make calls to RC.
// calls RC locally. only works on windows, does not exist on other platforms
// note: You shouldn't be calling this directly
// instead, you should be calling it via the IResourceCompilerHelper interface.
// since it may be replaced with a custom RC for your platform or a remote invocation
class CResourceCompilerHelper
: public IResourceCompilerHelper
{
public:
virtual ERcCallResult CallResourceCompiler(
const char* szFileName = 0,
const char* szAdditionalSettings = 0,
IResourceCompilerListener* listener = 0,
bool bMayShowWindow = true,
bool bSilent = false,
bool bNoUserDialog = false,
const wchar_t* szWorkingDirectory = 0,
const wchar_t* szRootPath = 0) override;
};
#endif // CRY_ENABLE_RC_HELPER
#endif // CRYINCLUDE_CRYCOMMON_RESOURCECOMPILERHELPER_H

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