From 157530b8b6e11efc5573d5a0db8987a440197aa1 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 29 Mar 2019 22:28:40 +0800 Subject: *misc --- Build/Asura.Editor/Asura.Editor.vcxproj | 44 ++--- Build/Asura.Editor/Asura.Editor.vcxproj.filters | 140 ++++++------- Build/Asura.sln | 26 +-- bin/win64/05-physfs.exe | Bin 1147904 -> 1148416 bytes build/3rd-party/Luax/Luax.vcxproj | 2 + build/3rd-party/Luax/Luax.vcxproj.filters | 2 + build/3rd-party/Plotscript/Plotscript.vcxproj | 1 + build/Asura.Editor/Asura.Editor.vcxproj | 44 ++--- build/Asura.Editor/Asura.Editor.vcxproj.filters | 140 ++++++------- build/Asura.sln | 26 +-- build/libs/asura-lib-plot/asura-lib-plot.vcxproj | 122 ++++++++++++ .../asura-lib-plot/asura-lib-plot.vcxproj.filters | 17 ++ .../asura-lib-plot/asura-lib-plot.vcxproj.user | 4 + build/libs/asura-lib-utils/asura-lib-utils.vcxproj | 6 + .../asura-lib-utils.vcxproj.filters | 18 ++ samples/Hello/prefabs/player.prefab.asset | 38 ++-- source/3rd-party/Lua51/loadlib.c | 2 +- source/3rd-party/Luax/luax_class.cpp | 6 +- source/3rd-party/Luax/luax_class.hpp | 6 +- source/3rd-party/Luax/luax_class.inl | 44 +++-- source/3rd-party/Luax/luax_config.h | 6 +- source/3rd-party/Luax/luax_globalstate.h | 7 + source/3rd-party/Luax/luax_internal.h | 12 ++ source/3rd-party/Luax/luax_ref.cpp | 6 +- source/3rd-party/Luax/luax_state.cpp | 16 +- source/3rd-party/Luax/luax_state.h | 8 +- source/3rd-party/Luax/luax_vm.cpp | 32 ++- source/3rd-party/Luax/luax_vm.h | 34 ++-- source/3rd-party/plotscript/plot.c | 5 + .../3rd-party/plotscript/test/first_meeting.plot | 9 + source/Asura.Editor/controls/binding/_button.cpp | 60 ++++++ source/Asura.Editor/controls/button.cpp | 10 + source/Asura.Editor/controls/button.h | 79 ++++++++ source/Asura.Editor/controls/checkbox.cpp | 0 source/Asura.Editor/controls/checkbox.h | 0 source/Asura.Editor/controls/hslider.cpp | 0 source/Asura.Editor/controls/hslider.h | 0 source/Asura.Editor/controls/hvslider.cpp | 0 source/Asura.Editor/controls/hvslider.h | 0 source/Asura.Editor/controls/label.cpp | 0 source/Asura.Editor/controls/label.h | 25 +++ source/Asura.Editor/controls/panel.cpp | 0 source/Asura.Editor/controls/panel.h | 0 source/Asura.Editor/controls/progress.cpp | 0 source/Asura.Editor/controls/progress.h | 0 source/Asura.Editor/controls/radio_button.cpp | 0 source/Asura.Editor/controls/radio_button.h | 0 source/Asura.Editor/controls/textbox.cpp | 0 source/Asura.Editor/controls/textbox.h | 0 source/Asura.Editor/controls/vslider.cpp | 0 source/Asura.Editor/controls/vslider.h | 0 source/Asura.Editor/controls/widget.h | 43 ++++ source/Asura.Editor/widgets/binding/_button.cpp | 60 ------ source/Asura.Editor/widgets/button.cpp | 10 - source/Asura.Editor/widgets/button.h | 79 -------- source/Asura.Editor/widgets/checkbox.cpp | 0 source/Asura.Editor/widgets/checkbox.h | 0 source/Asura.Editor/widgets/hslider.cpp | 0 source/Asura.Editor/widgets/hslider.h | 0 source/Asura.Editor/widgets/hvslider.cpp | 0 source/Asura.Editor/widgets/hvslider.h | 0 source/Asura.Editor/widgets/label.cpp | 0 source/Asura.Editor/widgets/label.h | 25 --- source/Asura.Editor/widgets/panel.cpp | 0 source/Asura.Editor/widgets/panel.h | 0 source/Asura.Editor/widgets/progress.cpp | 0 source/Asura.Editor/widgets/progress.h | 0 source/Asura.Editor/widgets/radio_button.cpp | 0 source/Asura.Editor/widgets/radio_button.h | 0 source/Asura.Editor/widgets/textbox.cpp | 0 source/Asura.Editor/widgets/textbox.h | 0 source/Asura.Editor/widgets/vslider.cpp | 0 source/Asura.Editor/widgets/vslider.h | 0 source/Asura.Editor/widgets/widget.h | 43 ---- .../asura-lib-utils/io/binding/_data_buffer.cpp | 1 + source/libs/asura-lib-utils/io/io_batch_task.cpp | 0 source/libs/asura-lib-utils/io/io_batch_task.h | 31 +++ source/libs/asura-lib-utils/io/io_task.cpp | 4 +- source/libs/asura-lib-utils/io/io_task.h | 2 +- source/libs/asura-lib-utils/scripting/lua_env.h | 14 +- .../asura-lib-utils/threading/binding/_thread.cpp | 154 ++++++++++++--- .../libs/asura-lib-utils/threading/semaphore.cpp | 88 +++++++++ source/libs/asura-lib-utils/threading/semaphore.h | 70 +++++++ source/libs/asura-lib-utils/threading/task.h | 4 +- source/libs/asura-lib-utils/threading/thread.cpp | 217 ++++++++++++++++++--- source/libs/asura-lib-utils/threading/thread.h | 108 ++++++++-- .../threading/thread_impl_win32.cpp | 11 +- .../asura-lib-utils/threading/thread_impl_win32.h | 3 +- source/tests/05-physfs/main.cpp | 32 +-- 89 files changed, 1386 insertions(+), 610 deletions(-) create mode 100644 build/libs/asura-lib-plot/asura-lib-plot.vcxproj create mode 100644 build/libs/asura-lib-plot/asura-lib-plot.vcxproj.filters create mode 100644 build/libs/asura-lib-plot/asura-lib-plot.vcxproj.user create mode 100644 source/3rd-party/Luax/luax_globalstate.h create mode 100644 source/3rd-party/Luax/luax_internal.h create mode 100644 source/3rd-party/plotscript/plot.c create mode 100644 source/3rd-party/plotscript/test/first_meeting.plot create mode 100644 source/Asura.Editor/controls/binding/_button.cpp create mode 100644 source/Asura.Editor/controls/button.cpp create mode 100644 source/Asura.Editor/controls/button.h create mode 100644 source/Asura.Editor/controls/checkbox.cpp create mode 100644 source/Asura.Editor/controls/checkbox.h create mode 100644 source/Asura.Editor/controls/hslider.cpp create mode 100644 source/Asura.Editor/controls/hslider.h create mode 100644 source/Asura.Editor/controls/hvslider.cpp create mode 100644 source/Asura.Editor/controls/hvslider.h create mode 100644 source/Asura.Editor/controls/label.cpp create mode 100644 source/Asura.Editor/controls/label.h create mode 100644 source/Asura.Editor/controls/panel.cpp create mode 100644 source/Asura.Editor/controls/panel.h create mode 100644 source/Asura.Editor/controls/progress.cpp create mode 100644 source/Asura.Editor/controls/progress.h create mode 100644 source/Asura.Editor/controls/radio_button.cpp create mode 100644 source/Asura.Editor/controls/radio_button.h create mode 100644 source/Asura.Editor/controls/textbox.cpp create mode 100644 source/Asura.Editor/controls/textbox.h create mode 100644 source/Asura.Editor/controls/vslider.cpp create mode 100644 source/Asura.Editor/controls/vslider.h create mode 100644 source/Asura.Editor/controls/widget.h delete mode 100644 source/Asura.Editor/widgets/binding/_button.cpp delete mode 100644 source/Asura.Editor/widgets/button.cpp delete mode 100644 source/Asura.Editor/widgets/button.h delete mode 100644 source/Asura.Editor/widgets/checkbox.cpp delete mode 100644 source/Asura.Editor/widgets/checkbox.h delete mode 100644 source/Asura.Editor/widgets/hslider.cpp delete mode 100644 source/Asura.Editor/widgets/hslider.h delete mode 100644 source/Asura.Editor/widgets/hvslider.cpp delete mode 100644 source/Asura.Editor/widgets/hvslider.h delete mode 100644 source/Asura.Editor/widgets/label.cpp delete mode 100644 source/Asura.Editor/widgets/label.h delete mode 100644 source/Asura.Editor/widgets/panel.cpp delete mode 100644 source/Asura.Editor/widgets/panel.h delete mode 100644 source/Asura.Editor/widgets/progress.cpp delete mode 100644 source/Asura.Editor/widgets/progress.h delete mode 100644 source/Asura.Editor/widgets/radio_button.cpp delete mode 100644 source/Asura.Editor/widgets/radio_button.h delete mode 100644 source/Asura.Editor/widgets/textbox.cpp delete mode 100644 source/Asura.Editor/widgets/textbox.h delete mode 100644 source/Asura.Editor/widgets/vslider.cpp delete mode 100644 source/Asura.Editor/widgets/vslider.h delete mode 100644 source/Asura.Editor/widgets/widget.h create mode 100644 source/libs/asura-lib-utils/io/io_batch_task.cpp create mode 100644 source/libs/asura-lib-utils/io/io_batch_task.h create mode 100644 source/libs/asura-lib-utils/threading/semaphore.cpp create mode 100644 source/libs/asura-lib-utils/threading/semaphore.h diff --git a/Build/Asura.Editor/Asura.Editor.vcxproj b/Build/Asura.Editor/Asura.Editor.vcxproj index 892c3e3..7886653 100644 --- a/Build/Asura.Editor/Asura.Editor.vcxproj +++ b/Build/Asura.Editor/Asura.Editor.vcxproj @@ -117,25 +117,36 @@ + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + @@ -143,17 +154,6 @@ - - - - - - - - - - - diff --git a/Build/Asura.Editor/Asura.Editor.vcxproj.filters b/Build/Asura.Editor/Asura.Editor.vcxproj.filters index 940a465..937f9a2 100644 --- a/Build/Asura.Editor/Asura.Editor.vcxproj.filters +++ b/Build/Asura.Editor/Asura.Editor.vcxproj.filters @@ -1,109 +1,76 @@  - - {a4345092-d09c-424c-8d7c-c076914fb6a2} - {7654ef3d-54c4-490f-bb24-e6a67bd63e1e} {f67906bd-4f7c-4ac6-bca1-019617435a8b} - - {4be11763-e2f9-47a4-8947-5326a517e286} - {48600309-cddd-49cd-b939-7a19a2b1eaa3} + + {a4345092-d09c-424c-8d7c-c076914fb6a2} + + + {1e378398-d7f0-4616-a986-b6a86faeaa8c} + - - widgets + + layout - - widgets + + layout - - widgets + + + + + system - - widgets + + controls - - widgets + + controls - - widgets + + controls - - widgets + + controls - - widgets + + controls - - widgets + + controls - - layout + + controls - - layout + + controls - - widgets + + controls - - - - - widgets\binding + + controls - - system + + controls\binding - - widgets - - - widgets - - - widgets - - - widgets - - - widgets - - - widgets - - - widgets - - - widgets - - - widgets - - - widgets - layout layout - - widgets - @@ -115,5 +82,38 @@ system + + controls + + + controls + + + controls + + + controls + + + controls + + + controls + + + controls + + + controls + + + controls + + + controls + + + controls + \ No newline at end of file diff --git a/Build/Asura.sln b/Build/Asura.sln index 66cb6d4..779d30e 100644 --- a/Build/Asura.sln +++ b/Build/Asura.sln @@ -75,8 +75,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asura-lib-json", "libs\asur EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asura-lib-xml", "libs\asura-lib-xml\asura-lib-xml.vcxproj", "{AB4F8F4A-73B5-4EFF-BD5D-448A3E39C60A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asura-lib-log", "libs\asura-lib-log\asura-lib-log.vcxproj", "{73B0F8AB-EF5A-412A-9E34-0FD2574766B7}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Preprocessor", "Preprocessor\Preprocessor.vcxproj", "{983F6496-7BB2-48E3-B8F4-68C2600EA315}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asura-lib-steam", "libs\asura-lib-steam\asura-lib-steam.vcxproj", "{129C3826-B418-4C80-A126-0319C7E2A857}" @@ -101,6 +99,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plotscript", "3rd-party\Plo EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uuid4", "3rd-party\uuid4\uuid4.vcxproj", "{49F7847E-219E-4A7B-8484-2A33DAC29DD0}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asura-lib-plot", "libs\asura-lib-plot\asura-lib-plot.vcxproj", "{F248C936-2169-45DF-8FC4-60E56EA23ECC}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -441,16 +441,6 @@ Global {AB4F8F4A-73B5-4EFF-BD5D-448A3E39C60A}.Release|x64.Build.0 = Release|x64 {AB4F8F4A-73B5-4EFF-BD5D-448A3E39C60A}.Release|x86.ActiveCfg = Release|Win32 {AB4F8F4A-73B5-4EFF-BD5D-448A3E39C60A}.Release|x86.Build.0 = Release|Win32 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Debug|x64.ActiveCfg = Debug|x64 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Debug|x64.Build.0 = Debug|x64 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Debug|x86.ActiveCfg = Debug|Win32 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Debug|x86.Build.0 = Debug|Win32 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Release|Any CPU.ActiveCfg = Release|Win32 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Release|x64.ActiveCfg = Release|x64 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Release|x64.Build.0 = Release|x64 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Release|x86.ActiveCfg = Release|Win32 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Release|x86.Build.0 = Release|Win32 {983F6496-7BB2-48E3-B8F4-68C2600EA315}.Debug|Any CPU.ActiveCfg = Debug|Win32 {983F6496-7BB2-48E3-B8F4-68C2600EA315}.Debug|x64.ActiveCfg = Debug|x64 {983F6496-7BB2-48E3-B8F4-68C2600EA315}.Debug|x64.Build.0 = Debug|x64 @@ -563,6 +553,16 @@ Global {49F7847E-219E-4A7B-8484-2A33DAC29DD0}.Release|x64.Build.0 = Release|x64 {49F7847E-219E-4A7B-8484-2A33DAC29DD0}.Release|x86.ActiveCfg = Release|Win32 {49F7847E-219E-4A7B-8484-2A33DAC29DD0}.Release|x86.Build.0 = Release|Win32 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Debug|x64.ActiveCfg = Debug|x64 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Debug|x64.Build.0 = Debug|x64 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Debug|x86.ActiveCfg = Debug|Win32 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Debug|x86.Build.0 = Debug|Win32 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Release|Any CPU.ActiveCfg = Release|Win32 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Release|x64.ActiveCfg = Release|x64 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Release|x64.Build.0 = Release|x64 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Release|x86.ActiveCfg = Release|Win32 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -596,7 +596,6 @@ Global {38090AEB-3AA9-489B-BBEC-0CEDF9EAC0DE} = {E068D138-C824-4365-B5A3-27C65E8FD0B5} {1B83A353-9694-42E0-997E-79E150E1C2E5} = {CD115016-E377-4AC1-8595-DB2836CEFE7E} {AB4F8F4A-73B5-4EFF-BD5D-448A3E39C60A} = {CD115016-E377-4AC1-8595-DB2836CEFE7E} - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7} = {CD115016-E377-4AC1-8595-DB2836CEFE7E} {129C3826-B418-4C80-A126-0319C7E2A857} = {CD115016-E377-4AC1-8595-DB2836CEFE7E} {5BECAAB3-9C80-4A62-99BB-E48F4667D9CD} = {E068D138-C824-4365-B5A3-27C65E8FD0B5} {95CAC424-D558-43D0-88B0-C67AF1C4EE90} = {25C8D2F8-989B-4742-859D-E2FDBB14EC2F} @@ -607,6 +606,7 @@ Global {E15D111A-9E02-4E0D-86FE-62BFCD3C211E} = {64D4E4B2-4A60-46F4-A500-370EFED4524F} {2822F737-EEFA-4C74-872C-1EE0793E2221} = {64D4E4B2-4A60-46F4-A500-370EFED4524F} {49F7847E-219E-4A7B-8484-2A33DAC29DD0} = {64D4E4B2-4A60-46F4-A500-370EFED4524F} + {F248C936-2169-45DF-8FC4-60E56EA23ECC} = {CD115016-E377-4AC1-8595-DB2836CEFE7E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {331032D8-F7CC-43E3-A03B-67108767F96B} diff --git a/bin/win64/05-physfs.exe b/bin/win64/05-physfs.exe index 60d2c69..48b20fa 100644 Binary files a/bin/win64/05-physfs.exe and b/bin/win64/05-physfs.exe differ diff --git a/build/3rd-party/Luax/Luax.vcxproj b/build/3rd-party/Luax/Luax.vcxproj index 525ba06..5ceb5b4 100644 --- a/build/3rd-party/Luax/Luax.vcxproj +++ b/build/3rd-party/Luax/Luax.vcxproj @@ -126,6 +126,8 @@ + + diff --git a/build/3rd-party/Luax/Luax.vcxproj.filters b/build/3rd-party/Luax/Luax.vcxproj.filters index c2e6625..560e79a 100644 --- a/build/3rd-party/Luax/Luax.vcxproj.filters +++ b/build/3rd-party/Luax/Luax.vcxproj.filters @@ -11,6 +11,8 @@ + + diff --git a/build/3rd-party/Plotscript/Plotscript.vcxproj b/build/3rd-party/Plotscript/Plotscript.vcxproj index a0efb92..d3e1e8a 100644 --- a/build/3rd-party/Plotscript/Plotscript.vcxproj +++ b/build/3rd-party/Plotscript/Plotscript.vcxproj @@ -23,6 +23,7 @@ {2822F737-EEFA-4C74-872C-1EE0793E2221} Plotscript 10.0.17134.0 + plotscript diff --git a/build/Asura.Editor/Asura.Editor.vcxproj b/build/Asura.Editor/Asura.Editor.vcxproj index 892c3e3..7886653 100644 --- a/build/Asura.Editor/Asura.Editor.vcxproj +++ b/build/Asura.Editor/Asura.Editor.vcxproj @@ -117,25 +117,36 @@ + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + @@ -143,17 +154,6 @@ - - - - - - - - - - - diff --git a/build/Asura.Editor/Asura.Editor.vcxproj.filters b/build/Asura.Editor/Asura.Editor.vcxproj.filters index 940a465..937f9a2 100644 --- a/build/Asura.Editor/Asura.Editor.vcxproj.filters +++ b/build/Asura.Editor/Asura.Editor.vcxproj.filters @@ -1,109 +1,76 @@  - - {a4345092-d09c-424c-8d7c-c076914fb6a2} - {7654ef3d-54c4-490f-bb24-e6a67bd63e1e} {f67906bd-4f7c-4ac6-bca1-019617435a8b} - - {4be11763-e2f9-47a4-8947-5326a517e286} - {48600309-cddd-49cd-b939-7a19a2b1eaa3} + + {a4345092-d09c-424c-8d7c-c076914fb6a2} + + + {1e378398-d7f0-4616-a986-b6a86faeaa8c} + - - widgets + + layout - - widgets + + layout - - widgets + + + + + system - - widgets + + controls - - widgets + + controls - - widgets + + controls - - widgets + + controls - - widgets + + controls - - widgets + + controls - - layout + + controls - - layout + + controls - - widgets + + controls - - - - - widgets\binding + + controls - - system + + controls\binding - - widgets - - - widgets - - - widgets - - - widgets - - - widgets - - - widgets - - - widgets - - - widgets - - - widgets - - - widgets - layout layout - - widgets - @@ -115,5 +82,38 @@ system + + controls + + + controls + + + controls + + + controls + + + controls + + + controls + + + controls + + + controls + + + controls + + + controls + + + controls + \ No newline at end of file diff --git a/build/Asura.sln b/build/Asura.sln index 66cb6d4..779d30e 100644 --- a/build/Asura.sln +++ b/build/Asura.sln @@ -75,8 +75,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asura-lib-json", "libs\asur EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asura-lib-xml", "libs\asura-lib-xml\asura-lib-xml.vcxproj", "{AB4F8F4A-73B5-4EFF-BD5D-448A3E39C60A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asura-lib-log", "libs\asura-lib-log\asura-lib-log.vcxproj", "{73B0F8AB-EF5A-412A-9E34-0FD2574766B7}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Preprocessor", "Preprocessor\Preprocessor.vcxproj", "{983F6496-7BB2-48E3-B8F4-68C2600EA315}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asura-lib-steam", "libs\asura-lib-steam\asura-lib-steam.vcxproj", "{129C3826-B418-4C80-A126-0319C7E2A857}" @@ -101,6 +99,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plotscript", "3rd-party\Plo EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uuid4", "3rd-party\uuid4\uuid4.vcxproj", "{49F7847E-219E-4A7B-8484-2A33DAC29DD0}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asura-lib-plot", "libs\asura-lib-plot\asura-lib-plot.vcxproj", "{F248C936-2169-45DF-8FC4-60E56EA23ECC}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -441,16 +441,6 @@ Global {AB4F8F4A-73B5-4EFF-BD5D-448A3E39C60A}.Release|x64.Build.0 = Release|x64 {AB4F8F4A-73B5-4EFF-BD5D-448A3E39C60A}.Release|x86.ActiveCfg = Release|Win32 {AB4F8F4A-73B5-4EFF-BD5D-448A3E39C60A}.Release|x86.Build.0 = Release|Win32 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Debug|x64.ActiveCfg = Debug|x64 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Debug|x64.Build.0 = Debug|x64 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Debug|x86.ActiveCfg = Debug|Win32 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Debug|x86.Build.0 = Debug|Win32 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Release|Any CPU.ActiveCfg = Release|Win32 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Release|x64.ActiveCfg = Release|x64 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Release|x64.Build.0 = Release|x64 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Release|x86.ActiveCfg = Release|Win32 - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7}.Release|x86.Build.0 = Release|Win32 {983F6496-7BB2-48E3-B8F4-68C2600EA315}.Debug|Any CPU.ActiveCfg = Debug|Win32 {983F6496-7BB2-48E3-B8F4-68C2600EA315}.Debug|x64.ActiveCfg = Debug|x64 {983F6496-7BB2-48E3-B8F4-68C2600EA315}.Debug|x64.Build.0 = Debug|x64 @@ -563,6 +553,16 @@ Global {49F7847E-219E-4A7B-8484-2A33DAC29DD0}.Release|x64.Build.0 = Release|x64 {49F7847E-219E-4A7B-8484-2A33DAC29DD0}.Release|x86.ActiveCfg = Release|Win32 {49F7847E-219E-4A7B-8484-2A33DAC29DD0}.Release|x86.Build.0 = Release|Win32 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Debug|x64.ActiveCfg = Debug|x64 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Debug|x64.Build.0 = Debug|x64 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Debug|x86.ActiveCfg = Debug|Win32 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Debug|x86.Build.0 = Debug|Win32 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Release|Any CPU.ActiveCfg = Release|Win32 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Release|x64.ActiveCfg = Release|x64 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Release|x64.Build.0 = Release|x64 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Release|x86.ActiveCfg = Release|Win32 + {F248C936-2169-45DF-8FC4-60E56EA23ECC}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -596,7 +596,6 @@ Global {38090AEB-3AA9-489B-BBEC-0CEDF9EAC0DE} = {E068D138-C824-4365-B5A3-27C65E8FD0B5} {1B83A353-9694-42E0-997E-79E150E1C2E5} = {CD115016-E377-4AC1-8595-DB2836CEFE7E} {AB4F8F4A-73B5-4EFF-BD5D-448A3E39C60A} = {CD115016-E377-4AC1-8595-DB2836CEFE7E} - {73B0F8AB-EF5A-412A-9E34-0FD2574766B7} = {CD115016-E377-4AC1-8595-DB2836CEFE7E} {129C3826-B418-4C80-A126-0319C7E2A857} = {CD115016-E377-4AC1-8595-DB2836CEFE7E} {5BECAAB3-9C80-4A62-99BB-E48F4667D9CD} = {E068D138-C824-4365-B5A3-27C65E8FD0B5} {95CAC424-D558-43D0-88B0-C67AF1C4EE90} = {25C8D2F8-989B-4742-859D-E2FDBB14EC2F} @@ -607,6 +606,7 @@ Global {E15D111A-9E02-4E0D-86FE-62BFCD3C211E} = {64D4E4B2-4A60-46F4-A500-370EFED4524F} {2822F737-EEFA-4C74-872C-1EE0793E2221} = {64D4E4B2-4A60-46F4-A500-370EFED4524F} {49F7847E-219E-4A7B-8484-2A33DAC29DD0} = {64D4E4B2-4A60-46F4-A500-370EFED4524F} + {F248C936-2169-45DF-8FC4-60E56EA23ECC} = {CD115016-E377-4AC1-8595-DB2836CEFE7E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {331032D8-F7CC-43E3-A03B-67108767F96B} diff --git a/build/libs/asura-lib-plot/asura-lib-plot.vcxproj b/build/libs/asura-lib-plot/asura-lib-plot.vcxproj new file mode 100644 index 0000000..b26fbaa --- /dev/null +++ b/build/libs/asura-lib-plot/asura-lib-plot.vcxproj @@ -0,0 +1,122 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {F248C936-2169-45DF-8FC4-60E56EA23ECC} + asuralibplot + 10.0.17134.0 + + + + Application + true + v141 + MultiByte + + + Application + false + v141 + true + MultiByte + + + Application + true + v141 + MultiByte + + + Application + false + v141 + true + MultiByte + + + + + + + + + + + + + + + + + + + + + + + Level3 + Disabled + true + true + + + + + Level3 + Disabled + true + true + + + + + Level3 + MaxSpeed + true + true + true + true + + + true + true + + + + + Level3 + MaxSpeed + true + true + true + true + + + true + true + + + + + + + + \ No newline at end of file diff --git a/build/libs/asura-lib-plot/asura-lib-plot.vcxproj.filters b/build/libs/asura-lib-plot/asura-lib-plot.vcxproj.filters new file mode 100644 index 0000000..3c6f4fd --- /dev/null +++ b/build/libs/asura-lib-plot/asura-lib-plot.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + \ No newline at end of file diff --git a/build/libs/asura-lib-plot/asura-lib-plot.vcxproj.user b/build/libs/asura-lib-plot/asura-lib-plot.vcxproj.user new file mode 100644 index 0000000..be25078 --- /dev/null +++ b/build/libs/asura-lib-plot/asura-lib-plot.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/build/libs/asura-lib-utils/asura-lib-utils.vcxproj b/build/libs/asura-lib-utils/asura-lib-utils.vcxproj index e520659..b7c6576 100644 --- a/build/libs/asura-lib-utils/asura-lib-utils.vcxproj +++ b/build/libs/asura-lib-utils/asura-lib-utils.vcxproj @@ -135,6 +135,7 @@ + @@ -147,12 +148,14 @@ + + @@ -163,6 +166,7 @@ + @@ -183,12 +187,14 @@ + + diff --git a/build/libs/asura-lib-utils/asura-lib-utils.vcxproj.filters b/build/libs/asura-lib-utils/asura-lib-utils.vcxproj.filters index 5d8b40f..9e36a55 100644 --- a/build/libs/asura-lib-utils/asura-lib-utils.vcxproj.filters +++ b/build/libs/asura-lib-utils/asura-lib-utils.vcxproj.filters @@ -116,6 +116,15 @@ threading + + io + + + threading + + + io + @@ -213,6 +222,15 @@ threading + + io + + + threading + + + io + diff --git a/samples/Hello/prefabs/player.prefab.asset b/samples/Hello/prefabs/player.prefab.asset index fb9d34c..62fd7cf 100644 --- a/samples/Hello/prefabs/player.prefab.asset +++ b/samples/Hello/prefabs/player.prefab.asset @@ -1,22 +1,20 @@ -{ - type="prefab", - guid=_guid"0825df57da6d66a49a6b6f97d6af6ed8", +type="prefab", +guid=_guid"0825df57da6d66a49a6b6f97d6af6ed8", -- prefab specified - root=_suid"100100000", - entities = { - ["100100000"] = { - children = { - - } +root=_suid"100100000", +entities = { + ["100100000"] = { + children = { + } - }, - components = { - ["100100200"] = { - guid = _guid"0825df57da6d66a49a6b6f97d6af6ed8", - ["width"] = 10, - ["name"] = "Chai", - ["friend"] = _guid"0825df57da6d66a49a6b6f97d6af6ed8", - ["child"] = _guid"", - } - }, -} \ No newline at end of file + } +}, +components = { + ["100100200"] = { + guid = _guid"0825df57da6d66a49a6b6f97d6af6ed8", + ["width"] = 10, + ["name"] = "Chai", + ["friend"] = _guid"0825df57da6d66a49a6b6f97d6af6ed8", + ["child"] = _guid"", + } +}, diff --git a/source/3rd-party/Lua51/loadlib.c b/source/3rd-party/Lua51/loadlib.c index 9455c53..6158c53 100644 --- a/source/3rd-party/Lua51/loadlib.c +++ b/source/3rd-party/Lua51/loadlib.c @@ -654,7 +654,7 @@ LUALIB_API int luaopen_package (lua_State *L) { lua_setfield(L, -2, "config"); /* set field `loaded' */ luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 2); - lua_setfield(L, -2, "loaded"); // LUA_REGISTRYINDEX["_LOADED"]Ϊpackage.loaded\LUA_ENVIRONINDEX["loaded"] + lua_setfield(L, -2, "loaded"); /* set field `preload' */ lua_newtable(L); lua_setfield(L, -2, "preload"); diff --git a/source/3rd-party/Luax/luax_class.cpp b/source/3rd-party/Luax/luax_class.cpp index 960fd47..bb1609d 100644 --- a/source/3rd-party/Luax/luax_class.cpp +++ b/source/3rd-party/Luax/luax_class.cpp @@ -46,13 +46,13 @@ namespace Luax lua_setfield(L, -2, "__index"); lua_pushstring(L, type); - lua_pushcclosure(L, l___tostring, 1); + lua_pushcclosure(L, _Tostring, 1); lua_setfield(L, -2, "__tostring"); return 1; } - int LuaxPlainClass::l___tostring(lua_State* L) + int LuaxPlainClass::_Tostring(lua_State* L) { // upvalues: // 1: class name @@ -184,7 +184,7 @@ namespace Luax lua_setfield(L, -2, "__index"); lua_pushstring(L, type); - lua_pushcclosure(L, l___tostring, 1); + lua_pushcclosure(L, _Tostring, 1); lua_setfield(L, -2, "__tostring"); // classmetatableΪbaseClass diff --git a/source/3rd-party/Luax/luax_class.hpp b/source/3rd-party/Luax/luax_class.hpp index 99ac381..257e1ca 100644 --- a/source/3rd-party/Luax/luax_class.hpp +++ b/source/3rd-party/Luax/luax_class.hpp @@ -180,12 +180,12 @@ namespace Luax public: // - LUAX_DECL_METHOD( l___tostring ); + LUAX_DECL_METHOD( _Tostring ); LUAX_DECL_METHOD( l_GetClass ); LUAX_DECL_METHOD( l_GetClassName ); // - LUAX_DECL_METHOD( l___gc ); + LUAX_DECL_METHOD( _GC ); #if LUAX_ENABLE_NATIVE_EXTEND LUAX_DECL_METHOD( l_ExtendFactory ); #endif @@ -213,7 +213,7 @@ namespace Luax /// static int registry(lua_State* L); - LUAX_DECL_METHOD( l___tostring ); + LUAX_DECL_METHOD( _Tostring ); LUAX_DECL_METHOD( l_Extend ); LUAX_DECL_METHOD( l_New ); LUAX_DECL_METHOD( l_TypeOf ); diff --git a/source/3rd-party/Luax/luax_class.inl b/source/3rd-party/Luax/luax_class.inl index d1c8c4b..45e6552 100644 --- a/source/3rd-party/Luax/luax_class.inl +++ b/source/3rd-party/Luax/luax_class.inl @@ -116,7 +116,12 @@ namespace Luax u32 count = state.GetValue(-1, 0); // get the count (or 0) lua_pop(state, 1); // pop the old count - if (count == 0) return; // nothing to do + // no such reference + if (count == 0) + { + state.Pop(2); // userdata, reftable + return; // nothing to do + } if (count > 1) { lua_pushnumber(state, count - 1); // push the new count @@ -125,7 +130,12 @@ namespace Luax lua_pushnil(state); // maybe cause gc } lua_settable(state, -3); // save it in the table + + state.Pop(1); // reftable + return; } + state.Pop(2); // nil, reftable + return; } } @@ -194,9 +204,10 @@ namespace Luax /// /// userdataԴref tablemember tableclass table - /// ref table kvǿtableuserdataüͨuserdataΪkeyΪvalueԼԱ + /// ref table kvǿtableuserdataüͨuserdataΪkey + /// ΪvalueԼԱ /// member table luaʵijԱ - /// class table б͵ʵеĺ + /// class table б͵ʵеĺ /// template void LuaxNativeClass::BindToLua(LuaxState& state) @@ -205,8 +216,13 @@ namespace Luax assert(!T::IsLuaxClassSingleton()); assert(!mUserdata); - // userdataջעַҪתΪT*ֱthisܻᵼ¶ؼ̳еɥʧ̬ - state.PushPtrUserdata(static_cast(this)); + /// + /// userdataջעַҪתΪT*ֱthisܻᵼ¶ؼ̳еɥʧ̬ + /// ֱӴthisȥڶؼ̳£òһͷ麯ġҪthis + /// תΪĵ͵ַõһ麯ͨһʵֶ̬ + /// + T* p = static_cast(this); + state.PushPtrUserdata(p); lua_newtable(state); // ref table޷luaʣC lua_newtable(state); // member tableluaдĶԱ @@ -222,10 +238,13 @@ namespace Luax int memberTable = top - 1; int refTable = top - 2; - // ref table ע __tostring - lua_pushcfunction(state, l___tostring); + // ref table ע __tostring __gc + lua_pushcfunction(state, _Tostring); lua_setfield(state, refTable, "__tostring"); + lua_pushcfunction(state, _GC); + lua_setfield(state, refTable, "__gc"); + // ref table __index __newindex Ϊ member table lua_pushvalue(state, memberTable); lua_setfield(state, refTable, "__index"); @@ -233,9 +252,6 @@ namespace Luax lua_pushvalue(state, memberTable); lua_setfield(state, refTable, "__newindex"); - lua_pushcfunction(state, l___gc); - lua_setfield(state, refTable, "__gc"); - // Ԫ lua_setmetatable(state, -2); // class is meta of member lua_setmetatable(state, -2); // member is meta of ref @@ -321,8 +337,12 @@ namespace Luax /// ͷŹʵ /// template - int LuaxNativeClass::l___gc(lua_State* L) + int LuaxNativeClass::_GC(lua_State* L) { +#if LUAX_PROFILER + std::cout << "Luax: GC<" << T::GetLuaxClassName() << ">\n"; +#endif + LUAX_SETUP(L, "U"); T* self = state.GetUserdata(1); delete self; @@ -334,7 +354,7 @@ namespace Luax /// ַ /// template - int LuaxNativeClass::l___tostring(lua_State* L) + int LuaxNativeClass::_Tostring(lua_State* L) { // params: // 1: userdata diff --git a/source/3rd-party/Luax/luax_config.h b/source/3rd-party/Luax/luax_config.h index c251c6f..2a8ed3e 100644 --- a/source/3rd-party/Luax/luax_config.h +++ b/source/3rd-party/Luax/luax_config.h @@ -55,7 +55,11 @@ namespace Luax #define LUAX_ENABLE_PLAIN_CLASS 0 #define LUAX_ENABLE_PLAIN_ENUM 0 -#define LUAX_PROFILER 0 +#define LUAX_PROFILER 1 + +#if LUAX_PROFILER +#include +#endif } diff --git a/source/3rd-party/Luax/luax_globalstate.h b/source/3rd-party/Luax/luax_globalstate.h new file mode 100644 index 0000000..91be51f --- /dev/null +++ b/source/3rd-party/Luax/luax_globalstate.h @@ -0,0 +1,7 @@ +#ifndef __LUAX_GLOBAL_STATE_H__ +#define __LUAX_GLOBAL_STATE_H__ + +// luaglobal_State +typedef struct global_State global_State; + +#endif \ No newline at end of file diff --git a/source/3rd-party/Luax/luax_internal.h b/source/3rd-party/Luax/luax_internal.h new file mode 100644 index 0000000..5904008 --- /dev/null +++ b/source/3rd-party/Luax/luax_internal.h @@ -0,0 +1,12 @@ +#ifndef __LUAX_INTERNAL_H__ +#define __LUAX_INTERNAL_H__ + +/// +/// luaԴʹ +/// +extern "C" +{ +#include "lua51/lstate.h" +} + +#endif \ No newline at end of file diff --git a/source/3rd-party/Luax/luax_ref.cpp b/source/3rd-party/Luax/luax_ref.cpp index 78596e3..d4be775 100644 --- a/source/3rd-party/Luax/luax_ref.cpp +++ b/source/3rd-party/Luax/luax_ref.cpp @@ -23,7 +23,7 @@ namespace Luax { assert(mRefID != LUA_NOREF); - LuaxVM* vm = LuaxVM::TryGetVM(state); + LuaxVM* vm = state.GetVM(); if (!vm) return false; if (mMode == STRONG_REF) { @@ -37,13 +37,15 @@ namespace Luax } else { + state.PushNil(); return false; } + return true; } void LuaxRef::SetRef(LuaxState& state, int idx) { - LuaxVM* vm = LuaxVM::TryGetVM(state); + LuaxVM* vm = state.GetVM(); if (!vm) return; if (mMode == STRONG_REF) { diff --git a/source/3rd-party/Luax/luax_state.cpp b/source/3rd-party/Luax/luax_state.cpp index b4d989a..3eae1df 100644 --- a/source/3rd-party/Luax/luax_state.cpp +++ b/source/3rd-party/Luax/luax_state.cpp @@ -1,8 +1,8 @@ -//#include "luax_class.h" #include "luax_enum.h" #include "luax_state.h" #include "luax_vm.h" #include "luax_class.hpp" +#include "luax_internal.h" namespace Luax { @@ -28,6 +28,16 @@ namespace Luax luaL_openlibs(mState); } + global_State* LuaxState::GetGlobalState() + { + return G(mState); + } + + LuaxVM* LuaxState::GetVM() + { + return LuaxVM::TryGetVM(G(mState)); + } + void LuaxState::PushGlobalNamespace() { int top = GetTop(); @@ -642,8 +652,8 @@ namespace Luax return value; } - void LuaxState::PushPtrUserdata(void* ptr) { - + void LuaxState::PushPtrUserdata(void* ptr) + { void** handle = (void**)lua_newuserdata(this->mState, sizeof(void*)); assert(handle); (*handle) = ptr; diff --git a/source/3rd-party/Luax/luax_state.h b/source/3rd-party/Luax/luax_state.h index dc3b79f..7c7d813 100644 --- a/source/3rd-party/Luax/luax_state.h +++ b/source/3rd-party/Luax/luax_state.h @@ -5,6 +5,7 @@ #include "luax_config.h" #include "luax_reftable.h" +#include "luax_globalstate.h" namespace Luax { @@ -41,6 +42,10 @@ namespace Luax /// inline lua_State* GetHandle() { return mState; }; + global_State* GetGlobalState(); + + LuaxVM* GetVM(); + //------------------------------------------------------------------------------// void OpenLibs(); @@ -206,10 +211,7 @@ namespace Luax void* operator &(); void* operator new(size_t size); - //------------------------------------------------------------------------------// - lua_State* const mState; - }; //--------------------------------------------------------------------------------// diff --git a/source/3rd-party/Luax/luax_vm.cpp b/source/3rd-party/Luax/luax_vm.cpp index 549e20b..5e9d1f5 100644 --- a/source/3rd-party/Luax/luax_vm.cpp +++ b/source/3rd-party/Luax/luax_vm.cpp @@ -1,32 +1,39 @@ +#include "luax_internal.h" #include "luax_vm.h" namespace Luax { - LuaxVM::ThreadMap threadMap; // ̲ͨ߳Ϊ˷ + LuaxVM::VMap LuaxVM::VMs; // ̲ͨ߳Ϊ˷ - LuaxVM* LuaxVM::TryGetVM(lua_State* L) + LuaxVM* LuaxVM::TryGetVM(global_State* gState) { - auto it = threadMap.find(L); - if (it != threadMap.end()) + auto it = VMs.find(gState); + if (it != VMs.end()) return it->second; else return nullptr; } + LuaxVM* LuaxVM::TryGetVM(lua_State* state) + { + return TryGetVM(G(state)); + } + LuaxVM::LuaxVM() : mStrongRefTable() , mWeakRefTable() { mMainThread = luaL_newstate(); assert(mMainThread); - mThreads.insert(mMainThread); + mGlobalState = G(mMainThread); - threadMap.insert(std::pair(mMainThread, this)); + VMs.insert(std::pair(mGlobalState, this)); } LuaxVM::~LuaxVM() { + VMs.erase(mGlobalState); lua_close(mMainThread); } @@ -34,7 +41,7 @@ namespace Luax void LuaxVM::Setup() { LUAX_STATE(mMainThread); - // ȫñ + mStrongRefTable.Init(state, "_LUAX_STRONGREF_TABLE"); mWeakRefTable.Init(state, "_LUAX_WEAKREF_TABLE", "v"); } @@ -43,7 +50,6 @@ namespace Luax { lua_State* thread = lua_newthread(mMainThread); assert(thread); - mThreads.insert(thread); return thread; } @@ -62,14 +68,4 @@ namespace Luax return mWeakRefTable; } - bool LuaxVM::HasThread(lua_State* L) - { - return mThreads.find(L) != mThreads.end(); - } - - int LuaxVM::GetThreadCount() - { - return mThreads.size(); - } - } \ No newline at end of file diff --git a/source/3rd-party/Luax/luax_vm.h b/source/3rd-party/Luax/luax_vm.h index 9039a04..1bac71e 100644 --- a/source/3rd-party/Luax/luax_vm.h +++ b/source/3rd-party/Luax/luax_vm.h @@ -7,6 +7,7 @@ #include "luax_ref.h" #include "luax_config.h" #include "luax_state.h" +#include "luax_globalstate.h" namespace Luax { @@ -17,38 +18,41 @@ namespace Luax class LuaxVM { public: + + /// + /// global_Stateõ + /// + static LuaxVM* TryGetVM(global_State* gState); + static LuaxVM* TryGetVM(lua_State* state); + LuaxVM(); ~LuaxVM(); + /// + /// ҪֶSetupʼһЩ״̬ + /// void Setup(); - lua_State* CreateThread(); lua_State* GetMainThread(); - - int GetThreadCount(); + lua_State* CreateThread(); LuaxRefTable& GetStrongRefTable(); LuaxRefTable& GetWeakRefTable(); - bool HasThread(lua_State* L); - - static LuaxVM* TryGetVM(lua_State* L); - - typedef std::map ThreadMap; - private: - static ThreadMap threadMap; // ̲ͨ߳Ϊ˷ + typedef std::map VMap; - LuaxRefTable mStrongRefTable; // _LUAX_STRONGREF_TABLE - LuaxRefTable mWeakRefTable; // _LUAX_WEAKREF_TABLE + static VMap VMs; // ͨglobal_StateΪ˷ - lua_State* mMainThread; // ߳ + LuaxRefTable mStrongRefTable; // _LUAX_STRONGREF_TABLE + LuaxRefTable mWeakRefTable; // _LUAX_WEAKREF_TABLE - std::unordered_set mThreads; // ߳ + global_State* mGlobalState; // global_Stateɵǰ̹߳ + lua_State* mMainThread; // ߳ #if LUAX_PROFILER - size_t mObjectCount; // ͳڴдʵ + size_t mObjectCount; // ͳڴдʵ #endif }; diff --git a/source/3rd-party/plotscript/plot.c b/source/3rd-party/plotscript/plot.c new file mode 100644 index 0000000..6028671 --- /dev/null +++ b/source/3rd-party/plotscript/plot.c @@ -0,0 +1,5 @@ +/* + * ڽű̷š +*/ + + diff --git a/source/3rd-party/plotscript/test/first_meeting.plot b/source/3rd-party/plotscript/test/first_meeting.plot new file mode 100644 index 0000000..5cf69d6 --- /dev/null +++ b/source/3rd-party/plotscript/test/first_meeting.plot @@ -0,0 +1,9 @@ + +#ʱ + +@(): + +@camera: + move_to(1, 2, 4s) & move_to() + + \ No newline at end of file diff --git a/source/Asura.Editor/controls/binding/_button.cpp b/source/Asura.Editor/controls/binding/_button.cpp new file mode 100644 index 0000000..fbae64f --- /dev/null +++ b/source/Asura.Editor/controls/binding/_button.cpp @@ -0,0 +1,60 @@ +#include "../button.h" + +using namespace Luax; + +namespace AsuraEditor +{ + + LUAX_REGISTRY(Button) + { + + // Button.EStatus.xxx + LUAX_REGISTER_ENUM(state, "EStatus", + { "NORMAL", BUTTON_STATUS_NORMAL }, + { "PUSHED", BUTTON_STATUS_PUSHED }, + { "HOVER", BUTTON_STATUS_HOVER }, + { "DISABLED", BUTTON_STATUS_DISABLED }, + { "FOCUSED", BUTTON_STATUS_FOCUSED } + ); + + // Button.EMsg.xxx + LUAX_REGISTER_ENUM(state, "EMessage", + { "CLICK", BUTTON_MSG_CLICK }, + { "HOVER", BUTTON_MSG_HOVER }, + { "FOCUS", BUTTON_MSG_KILLFOCUS } + ); + + } + + LUAX_POSTPROCESS(Button) + { + + } + + // button:Connect(msg, callback) + LUAX_IMPL_METHOD(Button, _Connect) + { + LUAX_STATE(L); + + Button* self = state.GetUserdata