From af7bdaa10ee71a319dc55c3c7556fa43a95c9dc9 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 2 Apr 2019 21:45:33 +0800 Subject: *misc --- Build/Asura.Editor/Asura.Editor.vcxproj | 1 + Build/Asura.Editor/Asura.Editor.vcxproj.filters | 3 + Build/Asura.sln | 13 ++ bin/win64/01-window.exe | Bin 1319936 -> 1321984 bytes bin/win64/SDL2.dll | Bin 2491904 -> 2491904 bytes build/Asura.Editor/Asura.Editor.vcxproj | 1 + build/Asura.Editor/Asura.Editor.vcxproj.filters | 3 + build/Asura.sln | 13 ++ build/modules/asura-core/asura-core.vcxproj | 2 + .../modules/asura-core/asura-core.vcxproj.filters | 6 + build/modules/asura-log/asura-log.vcxproj | 122 +++++++++++++ build/modules/asura-log/asura-log.vcxproj.filters | 17 ++ build/modules/asura-log/asura-log.vcxproj.user | 4 + source/Asura.Editor/controls/binding/_button.cpp | 100 +++++----- source/Asura.Editor/controls/button.cpp | 4 - source/Asura.Editor/controls/button.h | 99 +++++----- source/Asura.Editor/core/shaders.h | 9 + .../modules/asura-core/graphics/binding/_image.cpp | 26 +-- source/modules/asura-core/graphics/canvas.cpp | 34 +++- source/modules/asura-core/graphics/canvas.h | 3 +- source/modules/asura-core/graphics/gl.cpp | 18 +- source/modules/asura-core/graphics/gl.h | 40 ++-- source/modules/asura-core/graphics/image.cpp | 54 +++++- source/modules/asura-core/graphics/image.h | 17 +- .../modules/asura-core/graphics/matrix_stack.cpp | 61 +++++++ source/modules/asura-core/graphics/matrix_stack.h | 82 +++++++++ source/modules/asura-core/graphics/shader.cpp | 136 ++++++++++++-- source/modules/asura-core/graphics/shader.h | 12 +- source/modules/asura-core/graphics/shader_source.h | 11 +- source/modules/asura-core/graphics/texture.cpp | 14 +- .../modules/asura-utils/exceptions/exception.cpp | 9 +- source/modules/asura-utils/exceptions/exception.h | 14 -- source/modules/asura-utils/io/binding/_file.cpp | 2 +- .../asura-utils/io/binding/_file_system.cpp | 4 +- source/modules/asura-utils/io/file.cpp | 8 +- source/modules/asura-utils/io/file.h | 12 +- source/modules/asura-utils/io/file_data.h | 2 +- source/modules/asura-utils/io/file_system.cpp | 8 +- source/modules/asura-utils/io/file_system.h | 10 +- source/modules/asura-utils/io/io_task.h | 2 +- source/modules/asura-utils/io/renewable.h | 8 +- source/modules/asura-utils/math/matrix44.cpp | 203 +++++++++++++++++++++ source/modules/asura-utils/math/matrix44.h | 152 ++++++++++++++- source/modules/asura-utils/math/rect.hpp | 2 +- source/modules/asura-utils/type.h | 13 +- source/tests/win32/01-window/03_sub_menu.cpp | 29 ++- 46 files changed, 1132 insertions(+), 251 deletions(-) create mode 100644 build/modules/asura-log/asura-log.vcxproj create mode 100644 build/modules/asura-log/asura-log.vcxproj.filters create mode 100644 build/modules/asura-log/asura-log.vcxproj.user create mode 100644 source/Asura.Editor/core/shaders.h create mode 100644 source/modules/asura-core/graphics/matrix_stack.cpp create mode 100644 source/modules/asura-core/graphics/matrix_stack.h diff --git a/Build/Asura.Editor/Asura.Editor.vcxproj b/Build/Asura.Editor/Asura.Editor.vcxproj index c582aac..82a4133 100644 --- a/Build/Asura.Editor/Asura.Editor.vcxproj +++ b/Build/Asura.Editor/Asura.Editor.vcxproj @@ -149,6 +149,7 @@ + diff --git a/Build/Asura.Editor/Asura.Editor.vcxproj.filters b/Build/Asura.Editor/Asura.Editor.vcxproj.filters index a87c4cb..8bb459d 100644 --- a/Build/Asura.Editor/Asura.Editor.vcxproj.filters +++ b/Build/Asura.Editor/Asura.Editor.vcxproj.filters @@ -121,5 +121,8 @@ controls + + core + \ No newline at end of file diff --git a/Build/Asura.sln b/Build/Asura.sln index 9513df5..02856f6 100644 --- a/Build/Asura.sln +++ b/Build/Asura.sln @@ -107,6 +107,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "win32", "win32", "{6096DD65 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01-window", "tests\win32\01-window\01-window.vcxproj", "{B8FF8AE1-D0C1-4C7D-9FEE-5727ECE604BA}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asura-log", "modules\asura-log\asura-log.vcxproj", "{11619483-427E-490F-9E82-4FED3591E93F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -589,6 +591,16 @@ Global {B8FF8AE1-D0C1-4C7D-9FEE-5727ECE604BA}.Release|x64.Build.0 = Release|x64 {B8FF8AE1-D0C1-4C7D-9FEE-5727ECE604BA}.Release|x86.ActiveCfg = Release|Win32 {B8FF8AE1-D0C1-4C7D-9FEE-5727ECE604BA}.Release|x86.Build.0 = Release|Win32 + {11619483-427E-490F-9E82-4FED3591E93F}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {11619483-427E-490F-9E82-4FED3591E93F}.Debug|x64.ActiveCfg = Debug|x64 + {11619483-427E-490F-9E82-4FED3591E93F}.Debug|x64.Build.0 = Debug|x64 + {11619483-427E-490F-9E82-4FED3591E93F}.Debug|x86.ActiveCfg = Debug|Win32 + {11619483-427E-490F-9E82-4FED3591E93F}.Debug|x86.Build.0 = Debug|Win32 + {11619483-427E-490F-9E82-4FED3591E93F}.Release|Any CPU.ActiveCfg = Release|Win32 + {11619483-427E-490F-9E82-4FED3591E93F}.Release|x64.ActiveCfg = Release|x64 + {11619483-427E-490F-9E82-4FED3591E93F}.Release|x64.Build.0 = Release|x64 + {11619483-427E-490F-9E82-4FED3591E93F}.Release|x86.ActiveCfg = Release|Win32 + {11619483-427E-490F-9E82-4FED3591E93F}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -636,6 +648,7 @@ Global {72119950-3542-41AD-97EB-DC4856FC16AA} = {E068D138-C824-4365-B5A3-27C65E8FD0B5} {6096DD65-FE67-4D0F-BEF4-4D81A1554A3A} = {E068D138-C824-4365-B5A3-27C65E8FD0B5} {B8FF8AE1-D0C1-4C7D-9FEE-5727ECE604BA} = {6096DD65-FE67-4D0F-BEF4-4D81A1554A3A} + {11619483-427E-490F-9E82-4FED3591E93F} = {CD115016-E377-4AC1-8595-DB2836CEFE7E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {331032D8-F7CC-43E3-A03B-67108767F96B} diff --git a/bin/win64/01-window.exe b/bin/win64/01-window.exe index 71ec490..dd108a0 100644 Binary files a/bin/win64/01-window.exe and b/bin/win64/01-window.exe differ diff --git a/bin/win64/SDL2.dll b/bin/win64/SDL2.dll index a88528d..3d3c59e 100644 Binary files a/bin/win64/SDL2.dll and b/bin/win64/SDL2.dll differ diff --git a/build/Asura.Editor/Asura.Editor.vcxproj b/build/Asura.Editor/Asura.Editor.vcxproj index c582aac..82a4133 100644 --- a/build/Asura.Editor/Asura.Editor.vcxproj +++ b/build/Asura.Editor/Asura.Editor.vcxproj @@ -149,6 +149,7 @@ + diff --git a/build/Asura.Editor/Asura.Editor.vcxproj.filters b/build/Asura.Editor/Asura.Editor.vcxproj.filters index a87c4cb..8bb459d 100644 --- a/build/Asura.Editor/Asura.Editor.vcxproj.filters +++ b/build/Asura.Editor/Asura.Editor.vcxproj.filters @@ -121,5 +121,8 @@ controls + + core + \ No newline at end of file diff --git a/build/Asura.sln b/build/Asura.sln index 9513df5..02856f6 100644 --- a/build/Asura.sln +++ b/build/Asura.sln @@ -107,6 +107,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "win32", "win32", "{6096DD65 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01-window", "tests\win32\01-window\01-window.vcxproj", "{B8FF8AE1-D0C1-4C7D-9FEE-5727ECE604BA}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asura-log", "modules\asura-log\asura-log.vcxproj", "{11619483-427E-490F-9E82-4FED3591E93F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -589,6 +591,16 @@ Global {B8FF8AE1-D0C1-4C7D-9FEE-5727ECE604BA}.Release|x64.Build.0 = Release|x64 {B8FF8AE1-D0C1-4C7D-9FEE-5727ECE604BA}.Release|x86.ActiveCfg = Release|Win32 {B8FF8AE1-D0C1-4C7D-9FEE-5727ECE604BA}.Release|x86.Build.0 = Release|Win32 + {11619483-427E-490F-9E82-4FED3591E93F}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {11619483-427E-490F-9E82-4FED3591E93F}.Debug|x64.ActiveCfg = Debug|x64 + {11619483-427E-490F-9E82-4FED3591E93F}.Debug|x64.Build.0 = Debug|x64 + {11619483-427E-490F-9E82-4FED3591E93F}.Debug|x86.ActiveCfg = Debug|Win32 + {11619483-427E-490F-9E82-4FED3591E93F}.Debug|x86.Build.0 = Debug|Win32 + {11619483-427E-490F-9E82-4FED3591E93F}.Release|Any CPU.ActiveCfg = Release|Win32 + {11619483-427E-490F-9E82-4FED3591E93F}.Release|x64.ActiveCfg = Release|x64 + {11619483-427E-490F-9E82-4FED3591E93F}.Release|x64.Build.0 = Release|x64 + {11619483-427E-490F-9E82-4FED3591E93F}.Release|x86.ActiveCfg = Release|Win32 + {11619483-427E-490F-9E82-4FED3591E93F}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -636,6 +648,7 @@ Global {72119950-3542-41AD-97EB-DC4856FC16AA} = {E068D138-C824-4365-B5A3-27C65E8FD0B5} {6096DD65-FE67-4D0F-BEF4-4D81A1554A3A} = {E068D138-C824-4365-B5A3-27C65E8FD0B5} {B8FF8AE1-D0C1-4C7D-9FEE-5727ECE604BA} = {6096DD65-FE67-4D0F-BEF4-4D81A1554A3A} + {11619483-427E-490F-9E82-4FED3591E93F} = {CD115016-E377-4AC1-8595-DB2836CEFE7E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {331032D8-F7CC-43E3-A03B-67108767F96B} diff --git a/build/modules/asura-core/asura-core.vcxproj b/build/modules/asura-core/asura-core.vcxproj index e9b1c06..604e04d 100644 --- a/build/modules/asura-core/asura-core.vcxproj +++ b/build/modules/asura-core/asura-core.vcxproj @@ -141,6 +141,7 @@ + @@ -187,6 +188,7 @@ + diff --git a/build/modules/asura-core/asura-core.vcxproj.filters b/build/modules/asura-core/asura-core.vcxproj.filters index 0482ee1..b1d0c9b 100644 --- a/build/modules/asura-core/asura-core.vcxproj.filters +++ b/build/modules/asura-core/asura-core.vcxproj.filters @@ -182,6 +182,9 @@ image\binding + + graphics + @@ -329,6 +332,9 @@ window + + graphics + diff --git a/build/modules/asura-log/asura-log.vcxproj b/build/modules/asura-log/asura-log.vcxproj new file mode 100644 index 0000000..51e0383 --- /dev/null +++ b/build/modules/asura-log/asura-log.vcxproj @@ -0,0 +1,122 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {11619483-427E-490F-9E82-4FED3591E93F} + asuralog + 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/modules/asura-log/asura-log.vcxproj.filters b/build/modules/asura-log/asura-log.vcxproj.filters new file mode 100644 index 0000000..3c6f4fd --- /dev/null +++ b/build/modules/asura-log/asura-log.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/modules/asura-log/asura-log.vcxproj.user b/build/modules/asura-log/asura-log.vcxproj.user new file mode 100644 index 0000000..be25078 --- /dev/null +++ b/build/modules/asura-log/asura-log.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/source/Asura.Editor/controls/binding/_button.cpp b/source/Asura.Editor/controls/binding/_button.cpp index fbae64f..9e6a6bb 100644 --- a/source/Asura.Editor/controls/binding/_button.cpp +++ b/source/Asura.Editor/controls/binding/_button.cpp @@ -1,60 +1,74 @@ #include "../button.h" +using namespace std; using namespace Luax; -namespace AsuraEditor +namespace AsuraEditor { - - LUAX_REGISTRY(Button) + namespace Controls { + + LUAX_REGISTRY(Button) + { + LUAX_REGISTER_METHODS(state, + { "Connect", _Connect }, + { "Disconnect", _Disconnect }, + { "SetImage", _SetImage } + ); + } - // 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) + { + LUAX_REGISTER_ENUM(state, "EButtonStatus", + { "NORMAL", BUTTON_STATUS_NORMAL }, + { "0", 0 }, + { "PUSHED", BUTTON_STATUS_PUSHED }, + { "1", 1 }, + { "HOVER", BUTTON_STATUS_HOVER }, + { "2", 2 }, + { "DISABLED", BUTTON_STATUS_DISABLED }, + { "3", 3 }, + { "FOCUSED", BUTTON_STATUS_FOCUSED }, + { "4", 4 }, + { "STATUS_COUNT", _BUTTON_STATUS_COUNT }, + { "5", 5 } + ); + LUAX_REGISTER_ENUM(state, "EButtonMessage", + { "CLICK", BUTTON_MSG_CLICK }, + { "0", 0 }, + { "HOVER", BUTTON_MSG_HOVER }, + { "1", 1 }, + { "KILLFOCUS", BUTTON_MSG_KILLFOCUS }, + { "2", 2 }, + { "MSG_COUNT", _BUTTON_MSG_COUNT }, + { "3", 3 } + ); - } + } - LUAX_POSTPROCESS(Button) - { + // button:Connect() + LUAX_IMPL_METHOD(Button, _Connect) + { + LUAX_PREPARE(L, Button); - } + return 0; + } - // button:Connect(msg, callback) - LUAX_IMPL_METHOD(Button, _Connect) - { - LUAX_STATE(L); + // button:Disconnect() + LUAX_IMPL_METHOD(Button, _Disconnect) + { + LUAX_PREPARE(L, Button); - Button* self = state.GetUserdata