1313namespace ice
1414{
1515
16- void asset_category_shader_definition (
16+ void asset_category_actions_definition (
1717 ice::AssetCategoryArchive& asset_category_archive,
1818 ice::ModuleQuery const & module_query
1919 ) noexcept
@@ -25,44 +25,39 @@ namespace ice
2525 asset_category_archive.register_category (ice::AssetCategory_InputActionsScript, definition);
2626 }
2727
28- struct InputActionsModule : public ice ::Module<InputActionsModule>
29- {
3028
3129#if 0
32- auto ias_compiler_supported_resources(
33- ice::Span<ice::Shard const> params
34- ) noexcept -> ice::Span<ice::String const>
35- {
36- static ice::String ext[]{ ".ias" };
37- return ext;
38- }
30+ auto ias_compiler_supported_resources(
31+ ice::Span<ice::Shard const> params
32+ ) noexcept -> ice::Span<ice::String const>
33+ {
34+ static ice::String ext[]{ ".ias" };
35+ return ext;
36+ }
3937
40- static void v1_compiler_api(ice::api::resource_compiler::v1::ResourceCompilerAPI& api) noexcept
41- {
42- api.id_category = "ice/ias-script-resource"_sid;
43- api.fn_supported_resources = ias_compiler_supported_resources;
44- }
38+ static void v1_compiler_api(ice::api::resource_compiler::v1::ResourceCompilerAPI& api) noexcept
39+ {
40+ api.id_category = "ice/ias-script-resource"_sid;
41+ api.fn_supported_resources = ias_compiler_supported_resources;
42+ }
4543#endif
4644
47- static void v1_archive_api (ice::detail::asset_system::v1::AssetArchiveAPI& api) noexcept
48- {
49- api.fn_register_categories = asset_category_shader_definition ;
50- }
45+ void InputActionsModule:: v1_archive_api (ice::detail::asset_system::v1::AssetArchiveAPI& api) noexcept
46+ {
47+ api.fn_register_categories = asset_category_actions_definition ;
48+ }
5149
52- static bool on_load (ice::Allocator& alloc, ice::ModuleNegotiator auto & negotiator) noexcept
50+ bool InputActionsModule::on_load (ice::Allocator& alloc, ice::ModuleNegotiator auto & negotiator) noexcept
51+ {
52+ // Since we are on the 'system' layer, we can be part of multiple dynamic libararies, and prefere to not be loaded from them.
53+ if (negotiator.from_app ())
5354 {
54- // Since we are on the 'system' layer, we can be part of multiple dynamic libararies, and prefere to not be loaded from them.
55- if (negotiator.from_app ())
56- {
5755#if 0 // Currently we don't really support compiling for InputAction scripts.
58- negotiator.register_api(v1_compiler_api);
56+ negotiator.register_api(v1_compiler_api);
5957#endif
60- negotiator.register_api (v1_archive_api);
61- }
62- return true ;
58+ negotiator.register_api (v1_archive_api);
6359 }
64-
65- ICE_WORKAROUND_MODULE_INITIALIZATION (InputActionsModule);
66- };
60+ return true ;
61+ }
6762
6863} // namespace ice
0 commit comments