diff options
79 files changed, 892 insertions, 309 deletions
diff --git a/Build/Asura.sln b/Build/Asura.sln index 53e6d41..2e3f4f0 100644 --- a/Build/Asura.sln +++ b/Build/Asura.sln @@ -95,12 +95,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asura-network", "modules\as EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LuaSocket", "3rd-party\LuaSocket\LuaSocket.vcxproj", "{E15D111A-9E02-4E0D-86FE-62BFCD3C211E}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plotscript", "3rd-party\Plotscript\Plotscript.vcxproj", "{2822F737-EEFA-4C74-872C-1EE0793E2221}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "plotscript", "3rd-party\Plotscript\Plotscript.vcxproj", "{2822F737-EEFA-4C74-872C-1EE0793E2221}" 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-plot", "modules\asura-plot\asura-plot.vcxproj", "{F248C936-2169-45DF-8FC4-60E56EA23ECC}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "07-image", "tests\07-image\07-image.vcxproj", "{72119950-3542-41AD-97EB-DC4856FC16AA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -563,6 +565,16 @@ Global {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 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Debug|x64.ActiveCfg = Debug|x64 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Debug|x64.Build.0 = Debug|x64 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Debug|x86.ActiveCfg = Debug|Win32 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Debug|x86.Build.0 = Debug|Win32 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Release|Any CPU.ActiveCfg = Release|Win32 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Release|x64.ActiveCfg = Release|x64 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Release|x64.Build.0 = Release|x64 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Release|x86.ActiveCfg = Release|Win32 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -607,6 +619,7 @@ Global {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} + {72119950-3542-41AD-97EB-DC4856FC16AA} = {E068D138-C824-4365-B5A3-27C65E8FD0B5} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {331032D8-F7CC-43E3-A03B-67108767F96B} diff --git a/Source/Asura.Editor/main.cpp b/Source/Asura.Editor/main.cpp index cfe59ac..ed055cf 100644 --- a/Source/Asura.Editor/main.cpp +++ b/Source/Asura.Editor/main.cpp @@ -1,3 +1,23 @@ +/** + * Copyright (c) 2018-2019 AsuraEngine Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + /// /// ༭ĽͨdirectUIʵ֣Ⱦasura-libϣ¼Ӧͨwin32APIʵ֡ /// diff --git a/bin/win64/05-physfs.exe b/bin/win64/05-physfs.exe Binary files differindex 4686084..e325343 100644 --- a/bin/win64/05-physfs.exe +++ b/bin/win64/05-physfs.exe diff --git a/build/Asura.sln b/build/Asura.sln index 53e6d41..2e3f4f0 100644 --- a/build/Asura.sln +++ b/build/Asura.sln @@ -95,12 +95,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asura-network", "modules\as EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LuaSocket", "3rd-party\LuaSocket\LuaSocket.vcxproj", "{E15D111A-9E02-4E0D-86FE-62BFCD3C211E}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plotscript", "3rd-party\Plotscript\Plotscript.vcxproj", "{2822F737-EEFA-4C74-872C-1EE0793E2221}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "plotscript", "3rd-party\Plotscript\Plotscript.vcxproj", "{2822F737-EEFA-4C74-872C-1EE0793E2221}" 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-plot", "modules\asura-plot\asura-plot.vcxproj", "{F248C936-2169-45DF-8FC4-60E56EA23ECC}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "07-image", "tests\07-image\07-image.vcxproj", "{72119950-3542-41AD-97EB-DC4856FC16AA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -563,6 +565,16 @@ Global {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 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Debug|x64.ActiveCfg = Debug|x64 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Debug|x64.Build.0 = Debug|x64 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Debug|x86.ActiveCfg = Debug|Win32 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Debug|x86.Build.0 = Debug|Win32 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Release|Any CPU.ActiveCfg = Release|Win32 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Release|x64.ActiveCfg = Release|x64 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Release|x64.Build.0 = Release|x64 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Release|x86.ActiveCfg = Release|Win32 + {72119950-3542-41AD-97EB-DC4856FC16AA}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -607,6 +619,7 @@ Global {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} + {72119950-3542-41AD-97EB-DC4856FC16AA} = {E068D138-C824-4365-B5A3-27C65E8FD0B5} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {331032D8-F7CC-43E3-A03B-67108767F96B} diff --git a/build/modules/asura-box2d/asura-box2d.vcxproj b/build/modules/asura-box2d/asura-box2d.vcxproj index 8ad3c71..9855a26 100644 --- a/build/modules/asura-box2d/asura-box2d.vcxproj +++ b/build/modules/asura-box2d/asura-box2d.vcxproj @@ -76,6 +76,7 @@ <Optimization>Disabled</Optimization> <SDLCheck>true</SDLCheck> <ConformanceMode>true</ConformanceMode> + <AdditionalIncludeDirectories>$(SolutionDir)..\source\3rd-party;$(SolutionDir)..\source\modules;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> </ClCompile> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> @@ -108,6 +109,7 @@ <IntrinsicFunctions>true</IntrinsicFunctions> <SDLCheck>true</SDLCheck> <ConformanceMode>true</ConformanceMode> + <AdditionalIncludeDirectories>$(SolutionDir)..\source\3rd-party;$(SolutionDir)..\source\modules;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> </ClCompile> <Link> <EnableCOMDATFolding>true</EnableCOMDATFolding> @@ -115,6 +117,32 @@ </Link> </ItemDefinitionGroup> <ItemGroup> + <ClInclude Include="..\..\..\source\modules\asura-box2d\body.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\chain_shape.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\circle_shape.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\contact.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\debug_draw.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\distance_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\edge_shape.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\fixture.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\friction_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\gear_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\motor_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\mouse_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\polygon_shape.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\prismatic_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\pulley_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\revolute_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\rope_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\shape.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\weld_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\wheel_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\world.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\..\source\modules\asura-box2d\binding\_body.cpp" /> + <ClCompile Include="..\..\..\source\modules\asura-box2d\binding\_world.cpp" /> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> diff --git a/build/modules/asura-box2d/asura-box2d.vcxproj.filters b/build/modules/asura-box2d/asura-box2d.vcxproj.filters index 9cd8510..4411d16 100644 --- a/build/modules/asura-box2d/asura-box2d.vcxproj.filters +++ b/build/modules/asura-box2d/asura-box2d.vcxproj.filters @@ -1,2 +1,40 @@ <?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
\ No newline at end of file +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <ClInclude Include="..\..\..\source\modules\asura-box2d\body.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\chain_shape.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\circle_shape.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\contact.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\edge_shape.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\fixture.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\friction_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\motor_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\mouse_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\polygon_shape.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\prismatic_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\pulley_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\revolute_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\rope_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\shape.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\weld_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\wheel_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\world.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\distance_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\gear_joint.h" /> + <ClInclude Include="..\..\..\source\modules\asura-box2d\debug_draw.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\..\source\modules\asura-box2d\binding\_body.cpp"> + <Filter>binding</Filter> + </ClCompile> + <ClCompile Include="..\..\..\source\modules\asura-box2d\binding\_world.cpp"> + <Filter>binding</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <Filter Include="binding"> + <UniqueIdentifier>{a446fe08-e138-456d-bbc0-4e8d4aa79989}</UniqueIdentifier> + </Filter> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/build/modules/asura-core/asura-core.vcxproj b/build/modules/asura-core/asura-core.vcxproj index 07c9dd9..1ad07c2 100644 --- a/build/modules/asura-core/asura-core.vcxproj +++ b/build/modules/asura-core/asura-core.vcxproj @@ -185,7 +185,6 @@ <ClInclude Include="..\..\..\source\modules\asura-core\graphics\image_decode_task.h" /> <ClInclude Include="..\..\..\source\modules\asura-core\graphics\mesh2d.h" /> <ClInclude Include="..\..\..\source\modules\asura-core\graphics\mesh2d_data.h" /> - <ClInclude Include="..\..\..\source\modules\asura-core\graphics\pixel_format.h" /> <ClInclude Include="..\..\..\source\modules\asura-core\graphics\png_decoder.h" /> <ClInclude Include="..\..\..\source\modules\asura-core\graphics\quad.h" /> <ClInclude Include="..\..\..\source\modules\asura-core\graphics\render_state.h" /> diff --git a/build/modules/asura-core/asura-core.vcxproj.filters b/build/modules/asura-core/asura-core.vcxproj.filters index 8c3f7e1..84a379f 100644 --- a/build/modules/asura-core/asura-core.vcxproj.filters +++ b/build/modules/asura-core/asura-core.vcxproj.filters @@ -40,12 +40,6 @@ <ClCompile Include="..\..\..\source\modules\asura-core\graphics\gl.cpp"> <Filter>graphics</Filter> </ClCompile> - <ClCompile Include="..\..\..\source\modules\asura-core\graphics\image.cpp"> - <Filter>graphics</Filter> - </ClCompile> - <ClCompile Include="..\..\..\source\modules\asura-core\graphics\image_data.cpp"> - <Filter>graphics</Filter> - </ClCompile> <ClCompile Include="..\..\..\source\modules\asura-core\graphics\mesh2d.cpp"> <Filter>graphics</Filter> </ClCompile> @@ -110,9 +104,6 @@ <ClCompile Include="..\..\..\source\modules\asura-core\input\cursor_impl_sdl.cpp"> <Filter>input</Filter> </ClCompile> - <ClCompile Include="..\..\..\source\modules\asura-core\graphics\image_decode_task.cpp"> - <Filter>graphics</Filter> - </ClCompile> <ClCompile Include="..\..\..\source\modules\asura-core\graphics\binding\_canvas.cpp"> <Filter>graphics\binding</Filter> </ClCompile> @@ -161,6 +152,15 @@ <ClCompile Include="..\..\..\source\modules\asura-core\threading\channel.cpp"> <Filter>threading</Filter> </ClCompile> + <ClCompile Include="..\..\..\source\modules\asura-core\graphics\image.cpp"> + <Filter>graphics</Filter> + </ClCompile> + <ClCompile Include="..\..\..\source\modules\asura-core\graphics\image_data.cpp"> + <Filter>graphics</Filter> + </ClCompile> + <ClCompile Include="..\..\..\source\modules\asura-core\graphics\image_decode_task.cpp"> + <Filter>graphics</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\..\source\modules\asura-core\application.h" /> @@ -182,24 +182,12 @@ <ClInclude Include="..\..\..\source\modules\asura-core\graphics\gl.h"> <Filter>graphics</Filter> </ClInclude> - <ClInclude Include="..\..\..\source\modules\asura-core\graphics\image.h"> - <Filter>graphics</Filter> - </ClInclude> - <ClInclude Include="..\..\..\source\modules\asura-core\graphics\image_data.h"> - <Filter>graphics</Filter> - </ClInclude> - <ClInclude Include="..\..\..\source\modules\asura-core\graphics\image_decoder.h"> - <Filter>graphics</Filter> - </ClInclude> <ClInclude Include="..\..\..\source\modules\asura-core\graphics\mesh2d.h"> <Filter>graphics</Filter> </ClInclude> <ClInclude Include="..\..\..\source\modules\asura-core\graphics\mesh2d_data.h"> <Filter>graphics</Filter> </ClInclude> - <ClInclude Include="..\..\..\source\modules\asura-core\graphics\pixel_format.h"> - <Filter>graphics</Filter> - </ClInclude> <ClInclude Include="..\..\..\source\modules\asura-core\graphics\png_decoder.h"> <Filter>graphics</Filter> </ClInclude> @@ -275,9 +263,6 @@ <ClInclude Include="..\..\..\source\modules\asura-core\input\cursor_impl_sdl.h"> <Filter>input</Filter> </ClInclude> - <ClInclude Include="..\..\..\source\modules\asura-core\graphics\image_decode_task.h"> - <Filter>graphics</Filter> - </ClInclude> <ClInclude Include="..\..\..\source\modules\asura-core\window\window_impl_sdl.h"> <Filter>window</Filter> </ClInclude> @@ -296,6 +281,18 @@ <ClInclude Include="..\..\..\source\modules\asura-core\threading\channel.h"> <Filter>threading</Filter> </ClInclude> + <ClInclude Include="..\..\..\source\modules\asura-core\graphics\image.h"> + <Filter>graphics</Filter> + </ClInclude> + <ClInclude Include="..\..\..\source\modules\asura-core\graphics\image_data.h"> + <Filter>graphics</Filter> + </ClInclude> + <ClInclude Include="..\..\..\source\modules\asura-core\graphics\image_decode_task.h"> + <Filter>graphics</Filter> + </ClInclude> + <ClInclude Include="..\..\..\source\modules\asura-core\graphics\image_decoder.h"> + <Filter>graphics</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <None Include="..\..\..\source\modules\asura-core\font\string.inl"> diff --git a/build/modules/asura-framework/asura-framework.vcxproj.filters b/build/modules/asura-framework/asura-framework.vcxproj.filters index 3c6f4fd..9cd8510 100644 --- a/build/modules/asura-framework/asura-framework.vcxproj.filters +++ b/build/modules/asura-framework/asura-framework.vcxproj.filters @@ -1,17 +1,2 @@ <?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="源文件"> - <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> - </Filter> - <Filter Include="头文件"> - <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> - <Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions> - </Filter> - <Filter Include="资源文件"> - <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> - </Filter> - </ItemGroup> -</Project>
\ No newline at end of file +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
\ No newline at end of file diff --git a/build/modules/asura-openal/asura-openal.vcxproj b/build/modules/asura-openal/asura-openal.vcxproj index f29350e..04827fa 100644 --- a/build/modules/asura-openal/asura-openal.vcxproj +++ b/build/modules/asura-openal/asura-openal.vcxproj @@ -117,14 +117,24 @@ </Link> </ItemDefinitionGroup> <ItemGroup> + <ClCompile Include="..\..\..\source\modules\asura-openal\audio.cpp" /> + <ClCompile Include="..\..\..\source\modules\asura-openal\mpg123_decoder.cpp" /> <ClCompile Include="..\..\..\source\modules\asura-openal\sound.cpp" /> + <ClCompile Include="..\..\..\source\modules\asura-openal\sound_data.cpp" /> <ClCompile Include="..\..\..\source\modules\asura-openal\sound_decoder.cpp" /> <ClCompile Include="..\..\..\source\modules\asura-openal\sound_decode_task.cpp" /> + <ClCompile Include="..\..\..\source\modules\asura-openal\source.cpp" /> + <ClCompile Include="..\..\..\source\modules\asura-openal\vorbis_decoder.cpp" /> </ItemGroup> <ItemGroup> + <ClInclude Include="..\..\..\source\modules\asura-openal\audio.h" /> + <ClInclude Include="..\..\..\source\modules\asura-openal\mpg123_decoder.h" /> <ClInclude Include="..\..\..\source\modules\asura-openal\sound.h" /> + <ClInclude Include="..\..\..\source\modules\asura-openal\sound_data.h" /> <ClInclude Include="..\..\..\source\modules\asura-openal\sound_decoder.h" /> <ClInclude Include="..\..\..\source\modules\asura-openal\sound_decode_task.h" /> + <ClInclude Include="..\..\..\source\modules\asura-openal\source.h" /> + <ClInclude Include="..\..\..\source\modules\asura-openal\vorbis_decoder.h" /> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> diff --git a/build/modules/asura-openal/asura-openal.vcxproj.filters b/build/modules/asura-openal/asura-openal.vcxproj.filters index 7af022e..ceb2b29 100644 --- a/build/modules/asura-openal/asura-openal.vcxproj.filters +++ b/build/modules/asura-openal/asura-openal.vcxproj.filters @@ -4,10 +4,25 @@ <ClCompile Include="..\..\..\source\modules\asura-openal\sound.cpp" /> <ClCompile Include="..\..\..\source\modules\asura-openal\sound_decode_task.cpp" /> <ClCompile Include="..\..\..\source\modules\asura-openal\sound_decoder.cpp" /> + <ClCompile Include="..\..\..\source\modules\asura-openal\audio.cpp" /> + <ClCompile Include="..\..\..\source\modules\asura-openal\mpg123_decoder.cpp" /> + <ClCompile Include="..\..\..\source\modules\asura-openal\sound_data.cpp" /> + <ClCompile Include="..\..\..\source\modules\asura-openal\source.cpp" /> + <ClCompile Include="..\..\..\source\modules\asura-openal\vorbis_decoder.cpp" /> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\..\source\modules\asura-openal\sound.h" /> <ClInclude Include="..\..\..\source\modules\asura-openal\sound_decoder.h" /> <ClInclude Include="..\..\..\source\modules\asura-openal\sound_decode_task.h" /> + <ClInclude Include="..\..\..\source\modules\asura-openal\audio.h" /> + <ClInclude Include="..\..\..\source\modules\asura-openal\mpg123_decoder.h" /> + <ClInclude Include="..\..\..\source\modules\asura-openal\sound_data.h" /> + <ClInclude Include="..\..\..\source\modules\asura-openal\source.h" /> + <ClInclude Include="..\..\..\source\modules\asura-openal\vorbis_decoder.h" /> + </ItemGroup> + <ItemGroup> + <Filter Include="binding"> + <UniqueIdentifier>{006a5466-b1f4-4ab3-9f6c-eae54a78df37}</UniqueIdentifier> + </Filter> </ItemGroup> </Project>
\ No newline at end of file diff --git a/build/modules/asura-utils/asura-utils.vcxproj b/build/modules/asura-utils/asura-utils.vcxproj index cc67004..ad005d9 100644 --- a/build/modules/asura-utils/asura-utils.vcxproj +++ b/build/modules/asura-utils/asura-utils.vcxproj @@ -131,7 +131,6 @@ <ClCompile Include="..\..\..\source\modules\asura-utils\io\binding\_io_task.cpp" /> <ClCompile Include="..\..\..\source\modules\asura-utils\io\compressor.cpp" /> <ClCompile Include="..\..\..\source\modules\asura-utils\io\data_buffer.cpp" /> - <ClCompile Include="..\..\..\source\modules\asura-utils\io\decoded_data.cpp" /> <ClCompile Include="..\..\..\source\modules\asura-utils\io\file.cpp" /> <ClCompile Include="..\..\..\source\modules\asura-utils\io\file_data.cpp" /> <ClCompile Include="..\..\..\source\modules\asura-utils\io\file_system.cpp" /> diff --git a/build/modules/asura-utils/asura-utils.vcxproj.filters b/build/modules/asura-utils/asura-utils.vcxproj.filters index 8534675..967881d 100644 --- a/build/modules/asura-utils/asura-utils.vcxproj.filters +++ b/build/modules/asura-utils/asura-utils.vcxproj.filters @@ -53,9 +53,6 @@ <ClCompile Include="..\..\..\source\modules\asura-utils\io\data_buffer.cpp"> <Filter>io</Filter> </ClCompile> - <ClCompile Include="..\..\..\source\modules\asura-utils\io\decoded_data.cpp"> - <Filter>io</Filter> - </ClCompile> <ClCompile Include="..\..\..\source\modules\asura-utils\io\file_system.cpp"> <Filter>io</Filter> </ClCompile> diff --git a/build/tests/07-image/07-image.vcxproj b/build/tests/07-image/07-image.vcxproj new file mode 100644 index 0000000..11012d8 --- /dev/null +++ b/build/tests/07-image/07-image.vcxproj @@ -0,0 +1,122 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <VCProjectVersion>15.0</VCProjectVersion> + <ProjectGuid>{72119950-3542-41AD-97EB-DC4856FC16AA}</ProjectGuid> + <RootNamespace>My07image</RootNamespace> + <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v141</PlatformToolset> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v141</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v141</PlatformToolset> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v141</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup /> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <SDLCheck>true</SDLCheck> + <ConformanceMode>true</ConformanceMode> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <SDLCheck>true</SDLCheck> + <ConformanceMode>true</ConformanceMode> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <ConformanceMode>true</ConformanceMode> + </ClCompile> + <Link> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <ConformanceMode>true</ConformanceMode> + </ClCompile> + <Link> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/build/tests/07-image/07-image.vcxproj.filters b/build/tests/07-image/07-image.vcxproj.filters new file mode 100644 index 0000000..3c6f4fd --- /dev/null +++ b/build/tests/07-image/07-image.vcxproj.filters @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="源文件"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="头文件"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions> + </Filter> + <Filter Include="资源文件"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> + </Filter> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/build/tests/07-image/07-image.vcxproj.user b/build/tests/07-image/07-image.vcxproj.user new file mode 100644 index 0000000..be25078 --- /dev/null +++ b/build/tests/07-image/07-image.vcxproj.user @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup /> +</Project>
\ No newline at end of file diff --git a/source/3rd-party/Luax/luax_class.hpp b/source/3rd-party/Luax/luax_class.hpp index bfb1a4d..08b4e3f 100644 --- a/source/3rd-party/Luax/luax_class.hpp +++ b/source/3rd-party/Luax/luax_class.hpp @@ -21,9 +21,17 @@ namespace Luax static void RegisterLuaxPostprocess(Luax::LuaxState&); \ static const char* GetLuaxFactoryName() { return #type; };\ static const char* GetLuaxClassName() { return #type; };\ - static bool IsLuaxClassSingleton() { return false; }; + static bool IsLuaxClassSingleton() { return false; } /// + /// Ϊijʹô˺꣬עһڣעắеãעЩ + /// + /// +#define LUAX_DECL_ABSTRACT_FACTORY() \ + static void RegisterLuaxClass(Luax::LuaxState&);\ + static void RegisterLuaxPostprocess(Luax::LuaxState&) + + /// /// RegisterLuaxClass עķͳԱö١ȵclass table /// LuaxGetSingletonName õ /// @@ -32,7 +40,7 @@ namespace Luax static void RegisterLuaxPostprocess(Luax::LuaxState&); \ static const char* GetLuaxSingletonName() { return #type; }; \ static const char* GetLuaxClassName() { return #type; }; \ - static bool IsLuaxClassSingleton() { return true; }; + static bool IsLuaxClassSingleton() { return true; } #define LUAX_DECL_METHOD(mtd) static int mtd(lua_State* L) diff --git a/source/Asura.Editor/main.cpp b/source/Asura.Editor/main.cpp index cfe59ac..ed055cf 100644 --- a/source/Asura.Editor/main.cpp +++ b/source/Asura.Editor/main.cpp @@ -1,3 +1,23 @@ +/** + * Copyright (c) 2018-2019 AsuraEngine Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + /// /// ༭ĽͨdirectUIʵ֣Ⱦasura-libϣ¼Ӧͨwin32APIʵ֡ /// diff --git a/source/modules/asura-box2d/binding/_body.cpp b/source/modules/asura-box2d/binding/_body.cpp new file mode 100644 index 0000000..51cc0ab --- /dev/null +++ b/source/modules/asura-box2d/binding/_body.cpp @@ -0,0 +1,172 @@ +#include "../body.h" + +using namespace std; + +namespace AsuraEngine +{ + namespace Physics + { + + LUAX_REGISTRY(Body) + { + LUAX_REGISTER_METHODS(state, + { "GetType", _GetType }, + { "GetX", _GetX }, + { "GetY", _GetY }, + { "GetAngle", _GetAngle }, + { "GetPosition", _GetPosition }, + { "GetLinearVelocity", _GetLinearVelocity }, + { "GetWorldCenter", _GetWorldCenter }, + { "GetLocalCenter", _GetLocalCenter }, + { "GetAngularVelocity", _GetAngularVelocity }, + { "GetMass", _GetMass }, + { "GetInertia", _GetInertia }, + { "GetMassData", _GetMassData }, + { "GetAngularDamping", _GetAngularDamping }, + { "GetLinearDamping", _GetLinearDamping }, + { "GetGravityScale", _GetGravityScale }, + { "GetGravityScale", _GetGravityScale } + ); + } + + LUAX_POSTPROCESS(Body) + { + LUAX_REGISTER_ENUM(state, "EBodyType", + { "INVALID", BODY_TYPE_INVALID }, + { "STATIC", BODY_TYPE_STATIC }, + { "DYNAMIC", BODY_TYPE_DYNAMIC }, + { "KINEMATIC", BODY_TYPE_KINEMATIC }, + { "ENUM", BODY_TYPE_MAX_ENUM } + ); + + } + + // body:GetType() + LUAX_IMPL_METHOD(Body, _GetType) + { + LUAX_PREPARE(L, Body); + return 0; + } + + // body:GetX() + LUAX_IMPL_METHOD(Body, _GetX) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetY() + LUAX_IMPL_METHOD(Body, _GetY) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetAngle() + LUAX_IMPL_METHOD(Body, _GetAngle) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetPosition() + LUAX_IMPL_METHOD(Body, _GetPosition) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetLinearVelocity() + LUAX_IMPL_METHOD(Body, _GetLinearVelocity) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetWorldCenter() + LUAX_IMPL_METHOD(Body, _GetWorldCenter) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetLocalCenter() + LUAX_IMPL_METHOD(Body, _GetLocalCenter) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetAngularVelocity() + LUAX_IMPL_METHOD(Body, _GetAngularVelocity) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetMass() + LUAX_IMPL_METHOD(Body, _GetMass) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetInertia() + LUAX_IMPL_METHOD(Body, _GetInertia) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetMassData() + LUAX_IMPL_METHOD(Body, _GetMassData) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetAngularDamping() + LUAX_IMPL_METHOD(Body, _GetAngularDamping) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetLinearDamping() + LUAX_IMPL_METHOD(Body, _GetLinearDamping) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetGravityScale() + LUAX_IMPL_METHOD(Body, _GetGravityScale) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetGravityScale() + LUAX_IMPL_METHOD(Body, _GetGravityScale) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + } +} diff --git a/source/modules/asura-box2d/binding/_world.cpp b/source/modules/asura-box2d/binding/_world.cpp new file mode 100644 index 0000000..6edd193 --- /dev/null +++ b/source/modules/asura-box2d/binding/_world.cpp @@ -0,0 +1,21 @@ +#include "../world.h" + +using namespace std; + +namespace AsuraEngine +{ + namespace Physics + { + + LUAX_REGISTRY(World) + { + + } + + LUAX_POSTPROCESS(World) + { + + } + + } +} diff --git a/source/modules/asura-box2d/body.h b/source/modules/asura-box2d/body.h new file mode 100644 index 0000000..57295c6 --- /dev/null +++ b/source/modules/asura-box2d/body.h @@ -0,0 +1,65 @@ +#ifndef __ASURA_BOX2D_BODY_H__ +#define __ASURA_BOX2D_BODY_H__ + +#include <Box2D/Box2D.h> + +#include <asura-utils/scripting/portable.hpp> + +namespace AsuraEngine +{ + namespace Physics + { + + class World; + + enum BodyType + { + BODY_TYPE_INVALID, + BODY_TYPE_STATIC, + BODY_TYPE_DYNAMIC, + BODY_TYPE_KINEMATIC, + BODY_TYPE_MAX_ENUM + }; + + class Body + : public AEScripting::Portable<Body> + { + public: + + LUAX_DECL_FACTORY(Body); + + b2Body *body; + + private: + + //----------------------------------------------------------------------------// + + LUAX_DECL_ENUM(BodyType); + + LUAX_DECL_METHOD(_GetType); + LUAX_DECL_METHOD(_GetX); + LUAX_DECL_METHOD(_GetY); + LUAX_DECL_METHOD(_GetAngle); + LUAX_DECL_METHOD(_GetPosition); + LUAX_DECL_METHOD(_GetLinearVelocity); + LUAX_DECL_METHOD(_GetWorldCenter); + LUAX_DECL_METHOD(_GetLocalCenter); + LUAX_DECL_METHOD(_GetAngularVelocity); + LUAX_DECL_METHOD(_GetMass); + LUAX_DECL_METHOD(_GetInertia); + LUAX_DECL_METHOD(_GetMassData); + LUAX_DECL_METHOD(_GetAngularDamping); + LUAX_DECL_METHOD(_GetLinearDamping); + LUAX_DECL_METHOD(_GetGravityScale); + LUAX_DECL_METHOD(_GetGravityScale); + + //----------------------------------------------------------------------------// + + World* mWorld; + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/source/modules/asura-box2d/chain_shape.h b/source/modules/asura-box2d/chain_shape.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/chain_shape.h diff --git a/source/modules/asura-box2d/circle_shape.h b/source/modules/asura-box2d/circle_shape.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/circle_shape.h diff --git a/source/modules/asura-box2d/contact.h b/source/modules/asura-box2d/contact.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/contact.h diff --git a/source/modules/asura-box2d/debug_draw.h b/source/modules/asura-box2d/debug_draw.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/debug_draw.h diff --git a/source/modules/asura-box2d/distance_joint.h b/source/modules/asura-box2d/distance_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/distance_joint.h diff --git a/source/modules/asura-box2d/edge_shape.h b/source/modules/asura-box2d/edge_shape.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/edge_shape.h diff --git a/source/modules/asura-box2d/fixture.h b/source/modules/asura-box2d/fixture.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/fixture.h diff --git a/source/modules/asura-box2d/friction_joint.h b/source/modules/asura-box2d/friction_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/friction_joint.h diff --git a/source/modules/asura-box2d/gear_joint.h b/source/modules/asura-box2d/gear_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/gear_joint.h diff --git a/source/modules/asura-box2d/joint.h b/source/modules/asura-box2d/joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/joint.h diff --git a/source/modules/asura-box2d/motor_joint.h b/source/modules/asura-box2d/motor_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/motor_joint.h diff --git a/source/modules/asura-box2d/mouse_joint.h b/source/modules/asura-box2d/mouse_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/mouse_joint.h diff --git a/source/modules/asura-box2d/polygon_shape.h b/source/modules/asura-box2d/polygon_shape.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/polygon_shape.h diff --git a/source/modules/asura-box2d/prismatic_joint.h b/source/modules/asura-box2d/prismatic_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/prismatic_joint.h diff --git a/source/modules/asura-box2d/pulley_joint.h b/source/modules/asura-box2d/pulley_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/pulley_joint.h diff --git a/source/modules/asura-box2d/revolute_joint.h b/source/modules/asura-box2d/revolute_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/revolute_joint.h diff --git a/source/modules/asura-box2d/rope_joint.h b/source/modules/asura-box2d/rope_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/rope_joint.h diff --git a/source/modules/asura-box2d/shape.h b/source/modules/asura-box2d/shape.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/shape.h diff --git a/source/modules/asura-box2d/weld_joint.h b/source/modules/asura-box2d/weld_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/weld_joint.h diff --git a/source/modules/asura-box2d/wheel_joint.h b/source/modules/asura-box2d/wheel_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/wheel_joint.h diff --git a/source/modules/asura-box2d/world.h b/source/modules/asura-box2d/world.h new file mode 100644 index 0000000..0aac0c8 --- /dev/null +++ b/source/modules/asura-box2d/world.h @@ -0,0 +1,19 @@ +#ifndef __ASURA_BOX2D_WORLD_H__ +#define __ASURA_BOX2D_WORLD_H__ + +#include <asura-utils/scripting/portable.hpp> + +namespace AsuraEngine +{ + namespace Physics + { + + class World : public AEScripting::Portable<World> + { + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/source/modules/asura-core/graphics/binding/_image.cpp b/source/modules/asura-core/graphics/binding/_image.cpp index cb008d3..1d43067 100644 --- a/source/modules/asura-core/graphics/binding/_image.cpp +++ b/source/modules/asura-core/graphics/binding/_image.cpp @@ -11,7 +11,7 @@ namespace AsuraEngine { LUAX_REGISTER_METHODS(state, { "New", _New }, - { "Load", _Load }, + { "Refresh", _Refresh }, { "GetWidth", _GetWidth }, { "GetHeight", _GetHeight }, { "GetSize", _GetSize }, @@ -25,66 +25,52 @@ namespace AsuraEngine } - // image = Image.New() + // Image.New() LUAX_IMPL_METHOD(Image, _New) { LUAX_STATE(L); - Image* image = new Image(); - image->PushLuaxUserdata(state); return 0; } - // successed = image:Load(image_data) - LUAX_IMPL_METHOD(Image, _Load) + // image:Refresh() + LUAX_IMPL_METHOD(Image, _Refresh) { LUAX_PREPARE(L, Image); - ImageData* imgdata = state.CheckUserdata<ImageData>(2); - bool loaded = self->Load(imgdata); - state.Push(loaded); - return 1; + return 0; } - // width = image:GetWidth() + // image:GetWidth() LUAX_IMPL_METHOD(Image, _GetWidth) { LUAX_PREPARE(L, Image); - state.Push(self->GetWidth()); - return 1; + return 0; } - // height = image:GetHeight() + // image:GetHeight() LUAX_IMPL_METHOD(Image, _GetHeight) { LUAX_PREPARE(L, Image); - state.Push(self->GetHeight()); - return 1; + return 0; } - // w, h = image:GetSize() + // image:GetSize() LUAX_IMPL_METHOD(Image, _GetSize) { LUAX_PREPARE(L, Image); - Math::Vector2u size = self->GetSize(); - state.Push(size.x); - state.Push(size.y); - return 2; + return 0; } - // color32 = image:GetPixel(x, y) + // image:GetPixel() LUAX_IMPL_METHOD(Image, _GetPixel) { LUAX_PREPARE(L, Image); - uint x = state.CheckValue<uint>(2); - uint y = state.CheckValue<uint>(3); - Color32* c32 = new Color32(self->GetPixel(x, y)); - c32->PushLuaxUserdata(state); - return 1; + return 0; } // image:Render() @@ -96,4 +82,4 @@ namespace AsuraEngine } } -}
\ No newline at end of file +} diff --git a/source/modules/asura-core/graphics/binding/_image_data.cpp b/source/modules/asura-core/graphics/binding/_image_data.cpp index 3ff38f9..ac9473b 100644 --- a/source/modules/asura-core/graphics/binding/_image_data.cpp +++ b/source/modules/asura-core/graphics/binding/_image_data.cpp @@ -1,6 +1,11 @@ +#include <asura-utils/threading/thread.h> +#include <asura-utils/io/data_buffer.h> + #include "../image_data.h" using namespace std; +using namespace AEThreading; +using namespace AEIO; namespace AsuraEngine { @@ -15,7 +20,10 @@ namespace AsuraEngine { "GetSize", _GetSize }, { "GetWidth", _GetWidth }, { "GetHeight", _GetHeight }, - { "GetPixelFormat", _GetPixelFormat } + { "GetPixelFormat", _GetPixelFormat }, + { "Decode", _Decode }, + { "DecodeAsync", _DecodeAsync }, + { "IsAvailable", _IsAvailable } ); } @@ -29,6 +37,7 @@ namespace AsuraEngine { LUAX_STATE(L); + return 0; } // imagedata:GetPixel() @@ -36,6 +45,7 @@ namespace AsuraEngine { LUAX_PREPARE(L, ImageData); + return 0; } // imagedata:GetSize() @@ -43,6 +53,7 @@ namespace AsuraEngine { LUAX_PREPARE(L, ImageData); + return 0; } // imagedata:GetWidth() @@ -50,6 +61,7 @@ namespace AsuraEngine { LUAX_PREPARE(L, ImageData); + return 0; } // imagedata:GetHeight() @@ -57,6 +69,7 @@ namespace AsuraEngine { LUAX_PREPARE(L, ImageData); + return 0; } // imagedata:GetPixelFormat() @@ -64,6 +77,34 @@ namespace AsuraEngine { LUAX_PREPARE(L, ImageData); + return 0; + } + + // imagedata:Decode() + LUAX_IMPL_METHOD(ImageData, _Decode) + { + LUAX_PREPARE(L, ImageData); + + return 0; + } + + // imagedata:DecodeAsync(thread, databuffer, callback) + LUAX_IMPL_METHOD(ImageData, _DecodeAsync) + { + LUAX_PREPARE(L, ImageData); + + Thread* thread = state.CheckUserdata<Thread>(2); + DataBuffer* buffer = state.CheckUserdata<DataBuffer>(3); + + return 0; + } + + // imagedata:IsAvailable() + LUAX_IMPL_METHOD(ImageData, _IsAvailable) + { + LUAX_PREPARE(L, ImageData); + + return 0; } } diff --git a/source/modules/asura-core/graphics/canvas.cpp b/source/modules/asura-core/graphics/canvas.cpp index 61787b6..e54ba1f 100644 --- a/source/modules/asura-core/graphics/canvas.cpp +++ b/source/modules/asura-core/graphics/canvas.cpp @@ -14,7 +14,7 @@ namespace AsuraEngine GLint current_fbo; glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, ¤t_fbo); glBindFramebuffer(GL_FRAMEBUFFER, mFBO); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextureHandle, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTexHandle, 0); glBindFramebuffer(GL_FRAMEBUFFER, current_fbo); } @@ -22,7 +22,7 @@ namespace AsuraEngine { GLint current_tex; glGetIntegerv(GL_TEXTURE_BINDING_2D, ¤t_tex); - glBindTexture(GL_TEXTURE_2D, mTextureHandle); + glBindTexture(GL_TEXTURE_2D, mTexHandle); glBindTexture(GL_TEXTURE_2D, current_tex); } diff --git a/source/modules/asura-core/graphics/canvas.h b/source/modules/asura-core/graphics/canvas.h index 7e7b2fd..d1412da 100644 --- a/source/modules/asura-core/graphics/canvas.h +++ b/source/modules/asura-core/graphics/canvas.h @@ -60,7 +60,7 @@ namespace AsuraEngine public: - //---------------------------------------------------------------------------------------------------------- + //----------------------------------------------------------------------------// LUAX_DECL_FACTORY(SimCanvas); @@ -68,7 +68,7 @@ namespace AsuraEngine LUAX_DECL_METHOD(_Bind); LUAX_DECL_METHOD(_Unbind); - //---------------------------------------------------------------------------------------------------------- + //----------------------------------------------------------------------------// }; diff --git a/source/modules/asura-core/graphics/color.h b/source/modules/asura-core/graphics/color.h index d0d0751..c4945ca 100644 --- a/source/modules/asura-core/graphics/color.h +++ b/source/modules/asura-core/graphics/color.h @@ -13,7 +13,7 @@ namespace AsuraEngine class Color32; /// - /// 淶ɫ + /// 淶ɫColor32иIJԡ /// class Color ASURA_FINAL : public Scripting::Portable<Color> @@ -26,7 +26,7 @@ namespace AsuraEngine static Color Green; static Color Blue; - Color(); + Color(); Color(const Color& c); @@ -40,12 +40,24 @@ namespace AsuraEngine float r, g, b, a; + //----------------------------------------------------------------------------// + LUAX_DECL_FACTORY(Color); LUAX_DECL_METHOD(_ToColor32); LUAX_DECL_METHOD(_SetColor); LUAX_DECL_METHOD(_GetColor); - LUAX_DECL_METHOD(_Multiply); // ɫ˷ + LUAX_DECL_METHOD(_GetR); + LUAX_DECL_METHOD(_GetG); + LUAX_DECL_METHOD(_GetB); + LUAX_DECL_METHOD(_GetA); + + // Ԫ + LUAX_DECL_METHOD(__eq); // __eq + LUAX_DECL_METHOD(__add); // __add + LUAX_DECL_METHOD(__sub); // __sub + LUAX_DECL_METHOD(__mul); // __mul + LUAX_DECL_METHOD(__div); // __div }; diff --git a/source/modules/asura-core/graphics/color32.h b/source/modules/asura-core/graphics/color32.h index b18f66c..2b13d1a 100644 --- a/source/modules/asura-core/graphics/color32.h +++ b/source/modules/asura-core/graphics/color32.h @@ -35,13 +35,14 @@ namespace AsuraEngine byte r, g, b, a; LUAX_DECL_METHOD(_ToColor); + + LUAX_DECL_METHOD(_SetColor); + + LUAX_DECL_METHOD(_GetColor); LUAX_DECL_METHOD(_GetRed); LUAX_DECL_METHOD(_GetGreen); LUAX_DECL_METHOD(_GetBlue); LUAX_DECL_METHOD(_GetAlpha); - LUAX_DECL_METHOD(_Multiply); - LUAX_DECL_METHOD(_Index); //r,g,b,a - LUAX_DECL_METHOD(_NewIndex); //r,g,b,a }; diff --git a/source/modules/asura-core/graphics/gl.cpp b/source/modules/asura-core/graphics/gl.cpp index 7c68c8f..41d43a3 100644 --- a/source/modules/asura-core/graphics/gl.cpp +++ b/source/modules/asura-core/graphics/gl.cpp @@ -1,3 +1,5 @@ +#include <asura-utils/type.h> + #include "../core_config.h" #include "gl.h" diff --git a/source/modules/asura-core/graphics/image.cpp b/source/modules/asura-core/graphics/image.cpp index e704945..e0528eb 100644 --- a/source/modules/asura-core/graphics/image.cpp +++ b/source/modules/asura-core/graphics/image.cpp @@ -1,6 +1,9 @@ -#include "Config.h" -#include "Image.h" -#include "GL.h" +#include "../core_config.h" + +#include "image.h" +#include "gl.h" + +using namespace AEIO; namespace AsuraEngine { @@ -16,16 +19,28 @@ namespace AsuraEngine } //\Ϣ - bool Image::Load(ImageData* data) + bool Image::Refresh(DecodedData* data) { ASSERT(data); - glBindTexture(GL_TEXTURE_2D, mTextureHandle); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, data->width, data->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data->pixels); + ImageData* imgData = static_cast<ImageData*>(data); + ASSERT(imgData); + + glBindTexture(GL_TEXTURE_2D, mTexHandle); + + imgData->Lock(); + + int width = imgData->width; + int height = imgData->height; + + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, imgData->pixels); + mImageData = imgData; + + imgData->Unlock(); + glBindTexture(GL_TEXTURE_2D, 0); - return true; - RRA(data, mImageData); + return true; } } diff --git a/source/modules/asura-core/graphics/image.h b/source/modules/asura-core/graphics/image.h index 29fd97c..377e002 100644 --- a/source/modules/asura-core/graphics/image.h +++ b/source/modules/asura-core/graphics/image.h @@ -27,9 +27,9 @@ namespace AsuraEngine /// һֻࡣҪǿǵeditorengineʹòͬķװ /// class Image ASURA_FINAL - : public Drawable + : public Texture , public Scripting::Portable<Image> - , public AEIO::Reloadable + , public AEIO::Renewable { public: @@ -40,19 +40,17 @@ namespace AsuraEngine ~Image(); /// - /// bufferimageϢmPixelsΪգݡ¹image - /// ʹglTexImage2Dύimageݡ + /// ͼύGPUϢ¹imageʹglTexImage2D + /// ύimageݡ /// - bool Load(ImageData* data); + bool Refresh(AEIO::DecodedData* decodeData) override; + bool Refresh(AEIO::DecodedData* decodeData, const AEMath::Recti& rect); - uint GetWidth(); - uint GetHeight(); - Math::Vector2u GetSize(); - /// - /// ijһλõ - /// - Color32 GetPixel(uint x, uint y); + uint GetWidth(); + uint GetHeight(); + Math::Vector2u GetSize(); + Color32 GetPixel(uint x, uint y); void Render(const RenderTarget* rt, const RenderState& state) override; @@ -60,13 +58,14 @@ namespace AsuraEngine private: + /// + /// һͼƬһݵá + /// ImageData* mImageData; Luax::LuaxMemberRef mImageDataRef; - Math::Vector2u mSize; - LUAX_DECL_METHOD(_New); - LUAX_DECL_METHOD(_Load); + LUAX_DECL_METHOD(_Refresh); LUAX_DECL_METHOD(_GetWidth); LUAX_DECL_METHOD(_GetHeight); LUAX_DECL_METHOD(_GetSize); diff --git a/source/modules/asura-core/graphics/image_data.cpp b/source/modules/asura-core/graphics/image_data.cpp index b79dfab..64f83a8 100644 --- a/source/modules/asura-core/graphics/image_data.cpp +++ b/source/modules/asura-core/graphics/image_data.cpp @@ -16,8 +16,12 @@ namespace AsuraEngine new STBDecoder() // jpeg, tga, bmp }; - ImageData::ImageData(const IO::DataBuffer& buffer) - : DecodedData(buffer) + ImageData::ImageData() + : pixels(nullptr) + , size(0) + , width(0) + , height(0) + , format(COLOR_FORMAT_UNKNOWN) { } @@ -27,10 +31,12 @@ namespace AsuraEngine delete[] pixels; } - /// - /// ɹ׳쳣 - /// - void ImageData::Decode(const IO::DataBuffer& buffer) + ImageData::operator bool() + { + return size > 0; + } + + void ImageData::Decode(IO::DataBuffer& buffer) { for (ImageDecoder* decoder : ImageDecoders) { @@ -46,6 +52,16 @@ namespace AsuraEngine { } + + void ImageData::Lock() + { + mMutex.Lock(); + } + + void ImageData::Unlock() + { + mMutex.Unlock(); + } } }
\ No newline at end of file diff --git a/source/modules/asura-core/graphics/image_data.h b/source/modules/asura-core/graphics/image_data.h index ea1d53a..b9d656c 100644 --- a/source/modules/asura-core/graphics/image_data.h +++ b/source/modules/asura-core/graphics/image_data.h @@ -7,8 +7,9 @@ #include <asura-utils/io/decoded_data.h> #include <asura-utils/io/data_buffer.h> #include <asura-utils/threading/thread.h> +#include <asura-utils/threading/mutex.h> -#include "pixel_format.h" +#include "texture.h" #include "color.h" namespace AsuraEngine @@ -29,27 +30,28 @@ namespace AsuraEngine /// /// ͼƬļϢʧܣ׳쳣 /// - ImageData(const AEIO::DataBuffer& buffer); + ImageData(); ~ImageData(); - void Load(const AEIO::DataBuffer& buffer); - void LoadAsync(const AEIO::DataBuffer& buffer, AEThreading::Thread* thread); + void Decode(AEIO::DataBuffer& buffer) override; + + void Lock(); + void Unlock(); Color GetPixel(uint x, uint y); - uint width, height; - PixelFormat format; - std::size_t size; - byte* pixels; + //----------------------------------------------------------------------------// - private: + uint width, height; // سߴ + ColorFormat format; // ʽ + byte* pixels; // + std::size_t size; // ݳ - void Decode(const AEIO::DataBuffer& buffer) override; + //----------------------------------------------------------------------------// - /// - /// ڵһimage dataʱṩdecoderڼdecodersмѡԡ - /// - static std::list<ImageDecoder*> ImageDecoders; + private: + + //----------------------------------------------------------------------------// LUAX_DECL_METHOD(_New); LUAX_DECL_METHOD(_GetPixel); @@ -57,6 +59,21 @@ namespace AsuraEngine LUAX_DECL_METHOD(_GetWidth); LUAX_DECL_METHOD(_GetHeight); LUAX_DECL_METHOD(_GetPixelFormat); + LUAX_DECL_METHOD(_Decode); + LUAX_DECL_METHOD(_DecodeAsync); + LUAX_DECL_METHOD(_IsAvailable); + + //----------------------------------------------------------------------------// + + /// + /// ڵһimage dataʱṩdecoderڼdecodersмѡԡ + /// + static std::list<ImageDecoder*> ImageDecoders; + + /// + /// дݵ + /// + AEThreading::Mutex mMutex; }; diff --git a/source/modules/asura-core/graphics/image_decoder.h b/source/modules/asura-core/graphics/image_decoder.h index 263c694..869c82a 100644 --- a/source/modules/asura-core/graphics/image_decoder.h +++ b/source/modules/asura-core/graphics/image_decoder.h @@ -20,12 +20,12 @@ namespace AsuraEngine /// /// жڴǷñdecoderѹ /// - virtual bool CanDecode(const AEIO::DataBuffer& buffer) = 0; + virtual bool CanDecode(AEIO::DataBuffer& buffer) = 0; /// /// һڴ棬һѹImage dataѹʧܷnullptr /// - virtual void Decode(const AEIO::DataBuffer& buffer, ImageData& data) = 0; + virtual void Decode(AEIO::DataBuffer& buffer, ImageData& data) = 0; }; diff --git a/source/modules/asura-core/graphics/pixel_format.h b/source/modules/asura-core/graphics/pixel_format.h deleted file mode 100644 index 8df07d5..0000000 --- a/source/modules/asura-core/graphics/pixel_format.h +++ /dev/null @@ -1,91 +0,0 @@ -namespace AsuraEngine -{ - namespace Graphics - { - - /// - /// ظʽ - /// - enum PixelFormat - { - PIXELFORMAT_UNKNOWN, - - // these are converted to an actual format by love - PIXELFORMAT_NORMAL, - PIXELFORMAT_HDR, - - // "regular" formats - PIXELFORMAT_R8, - PIXELFORMAT_RG8, - PIXELFORMAT_RGBA8, - PIXELFORMAT_sRGBA8, - PIXELFORMAT_R16, - PIXELFORMAT_RG16, - PIXELFORMAT_RGBA16, - PIXELFORMAT_R16F, - PIXELFORMAT_RG16F, - PIXELFORMAT_RGBA16F, - PIXELFORMAT_R32F, - PIXELFORMAT_RG32F, - PIXELFORMAT_RGBA32F, - - PIXELFORMAT_LA8, // Same as RG8, but accessed as (L, L, L, A) - - // packed formats - PIXELFORMAT_RGBA4, - PIXELFORMAT_RGB5A1, - PIXELFORMAT_RGB565, - PIXELFORMAT_RGB10A2, - PIXELFORMAT_RG11B10F, - - // depth/stencil formats - PIXELFORMAT_STENCIL8, - PIXELFORMAT_DEPTH16, - PIXELFORMAT_DEPTH24, - PIXELFORMAT_DEPTH32F, - PIXELFORMAT_DEPTH24_STENCIL8, - PIXELFORMAT_DEPTH32F_STENCIL8, - - // compressed formats - PIXELFORMAT_DXT1, - PIXELFORMAT_DXT3, - PIXELFORMAT_DXT5, - PIXELFORMAT_BC4, - PIXELFORMAT_BC4s, - PIXELFORMAT_BC5, - PIXELFORMAT_BC5s, - PIXELFORMAT_BC6H, - PIXELFORMAT_BC6Hs, - PIXELFORMAT_BC7, - PIXELFORMAT_PVR1_RGB2, - PIXELFORMAT_PVR1_RGB4, - PIXELFORMAT_PVR1_RGBA2, - PIXELFORMAT_PVR1_RGBA4, - PIXELFORMAT_ETC1, - PIXELFORMAT_ETC2_RGB, - PIXELFORMAT_ETC2_RGBA, - PIXELFORMAT_ETC2_RGBA1, - PIXELFORMAT_EAC_R, - PIXELFORMAT_EAC_Rs, - PIXELFORMAT_EAC_RG, - PIXELFORMAT_EAC_RGs, - PIXELFORMAT_ASTC_4x4, - PIXELFORMAT_ASTC_5x4, - PIXELFORMAT_ASTC_5x5, - PIXELFORMAT_ASTC_6x5, - PIXELFORMAT_ASTC_6x6, - PIXELFORMAT_ASTC_8x5, - PIXELFORMAT_ASTC_8x6, - PIXELFORMAT_ASTC_8x8, - PIXELFORMAT_ASTC_10x5, - PIXELFORMAT_ASTC_10x6, - PIXELFORMAT_ASTC_10x8, - PIXELFORMAT_ASTC_10x10, - PIXELFORMAT_ASTC_12x10, - PIXELFORMAT_ASTC_12x12, - - PIXELFORMAT_MAX_ENUM - }; - - } -} diff --git a/source/modules/asura-core/graphics/png_decoder.cpp b/source/modules/asura-core/graphics/png_decoder.cpp index f919090..80463d5 100644 --- a/source/modules/asura-core/graphics/png_decoder.cpp +++ b/source/modules/asura-core/graphics/png_decoder.cpp @@ -1,16 +1,16 @@ -#include "PNGDecoder.h" +#include "png_decoder.h" namespace AsuraEngine { namespace Graphics { - bool PNGDecoder::CanDecode(const Filesystem::DataBuffer& buffer) + bool PNGDecoder::CanDecode(AEIO::DataBuffer& buffer) { return false; } - void PNGDecoder::Decode(const Filesystem::DataBuffer& buffer, ImageData& data) + void PNGDecoder::Decode(AEIO::DataBuffer& buffer, ImageData& data) { } diff --git a/source/modules/asura-core/graphics/png_decoder.h b/source/modules/asura-core/graphics/png_decoder.h index bc871fa..6377940 100644 --- a/source/modules/asura-core/graphics/png_decoder.h +++ b/source/modules/asura-core/graphics/png_decoder.h @@ -15,9 +15,9 @@ namespace AsuraEngine { public: - bool CanDecode(const AEIO::DataBuffer& buffer) override; + bool CanDecode(AEIO::DataBuffer& buffer) override; - void Decode(const AEIO::DataBuffer& buffer, ImageData& data) override; + void Decode(AEIO::DataBuffer& buffer, ImageData& data) override; }; diff --git a/source/modules/asura-core/graphics/render_state.h b/source/modules/asura-core/graphics/render_state.h index 2b1dd7f..4c3491c 100644 --- a/source/modules/asura-core/graphics/render_state.h +++ b/source/modules/asura-core/graphics/render_state.h @@ -4,7 +4,6 @@ #include <asura-utils/math/vector2.hpp> #include <asura-utils/math/transform.h> -#include "Shader.h" #include "blend_mode.h" namespace AsuraEngine @@ -12,6 +11,8 @@ namespace AsuraEngine namespace Graphics { + class Shader; + /// /// Ⱦǰķʽ /// diff --git a/source/modules/asura-core/graphics/shader.h b/source/modules/asura-core/graphics/shader.h index 97e2c15..8c21ab2 100644 --- a/source/modules/asura-core/graphics/shader.h +++ b/source/modules/asura-core/graphics/shader.h @@ -28,7 +28,7 @@ namespace AsuraEngine /// class Shader ASURA_FINAL : public Scripting::Portable<Shader> - , public AEIO::Reloadable + , public AEIO::Renewable { public: diff --git a/source/modules/asura-core/graphics/stb_decoder.cpp b/source/modules/asura-core/graphics/stb_decoder.cpp index eff2e65..9a14141 100644 --- a/source/modules/asura-core/graphics/stb_decoder.cpp +++ b/source/modules/asura-core/graphics/stb_decoder.cpp @@ -8,49 +8,54 @@ namespace AsuraEngine namespace Graphics { - bool STBDecoder::CanDecode(const Filesystem::DataBuffer& buffer) + bool STBDecoder::CanDecode(IO::DataBuffer& buffer) { int w = 0; int h = 0; int comp = 0; - int status = stbi_info_from_memory((const stbi_uc*)buffer.data, buffer.size, &w, &h, &comp); + int status = stbi_info_from_memory((const stbi_uc*)buffer.GetData(), buffer.GetSize(), &w, &h, &comp); return status == 1 && w > 0 && h > 0; } - void STBDecoder::Decode(const Filesystem::DataBuffer& db, ImageData& imageData) + void STBDecoder::Decode(IO::DataBuffer& db, ImageData& imageData) { - const stbi_uc *buffer = (const stbi_uc *)db.data; - int bufferlen = db.size; + const stbi_uc *buffer = (const stbi_uc *)db.GetData(); + // databufferݳ + int bufferlen = db.GetSize(); + int width, height; int comp = 0; byte* data = nullptr; - PixelFormat format = PIXELFORMAT_UNKNOWN; + ColorFormat format = COLOR_FORMAT_UNKNOWN; std::size_t size = 0; if (stbi_is_hdr_from_memory(buffer, bufferlen)) { // 4channelfloat data = (byte*)stbi_loadf_from_memory(buffer, bufferlen, &width, &height, &comp, STBI_rgb_alpha); - format = PIXELFORMAT_RGBA32F; + format = COLOR_FORMAT_RGBA32F; size = width * height * 4 * sizeof(float); } else { data = (byte*)stbi_load_from_memory(buffer, bufferlen, &width, &height, &comp, STBI_rgb_alpha); - format = PIXELFORMAT_ASTC_8x5; + format = COLOR_FORMAT_RGBA8; size = width * height * 4; } if (data) { - // ֤ڴ汻ͷţһϲûͷŵΪimage dataһԵģimageǶεġ + imageData.Lock(); + if (imageData.pixels) delete[] imageData.pixels; imageData.pixels = (byte*)data; imageData.format = format; imageData.width = width; imageData.height = height; + + imageData.Unlock(); } else { diff --git a/source/modules/asura-core/graphics/stb_decoder.h b/source/modules/asura-core/graphics/stb_decoder.h index 85bad21..76e70c3 100644 --- a/source/modules/asura-core/graphics/stb_decoder.h +++ b/source/modules/asura-core/graphics/stb_decoder.h @@ -16,9 +16,9 @@ namespace AsuraEngine { public: - bool CanDecode(const AEIO::DataBuffer& buffer) override; + bool CanDecode(AEIO::DataBuffer& buffer) override; - void Decode(const AEIO::DataBuffer& buffer, ImageData& data) override; + void Decode(AEIO::DataBuffer& buffer, ImageData& data) override; }; diff --git a/source/modules/asura-core/graphics/texture.cpp b/source/modules/asura-core/graphics/texture.cpp index 6cb6497..0897702 100644 --- a/source/modules/asura-core/graphics/texture.cpp +++ b/source/modules/asura-core/graphics/texture.cpp @@ -6,20 +6,20 @@ namespace AsuraEngine { Texture::Texture() - : mTextureHandle(0) + : mTexHandle(0) { // GL texture - glGenTextures(1, &mTextureHandle); + glGenTextures(1, &mTexHandle); } Texture::~Texture() { - glDeleteTextures(1, &mTextureHandle); + glDeleteTextures(1, &mTexHandle); } GLuint Texture::GetGLTextureHandle() const { - return mTextureHandle; + return mTexHandle; } } diff --git a/source/modules/asura-core/graphics/texture.h b/source/modules/asura-core/graphics/texture.h index 81ced9f..a76e1d4 100644 --- a/source/modules/asura-core/graphics/texture.h +++ b/source/modules/asura-core/graphics/texture.h @@ -1,9 +1,8 @@ -#ifndef __ASURA_ENGINE_TEXTURE_H__ -#define __ASURA_ENGINE_TEXTURE_H__ +#ifndef __ASURA_TEXTURE_H__ +#define __ASURA_TEXTURE_H__ #include <asura-utils/math/rect.hpp> #include <asura-utils/math/vector2.hpp> -#include <asura-utils/scripting/portable.hpp> #include "../core_config.h" @@ -17,20 +16,59 @@ namespace AsuraEngine class RenderTarget; + enum WrapMode + { + WRAP_MODE_REPEAT, + WRAP_MODE_MIRROR, + WRAP_MODE_CLAMPTOEDGE, + WRAP_MODE_CLAMPTOBORDER, + //WRAP_MODE_PERAXIS, // UVвͬ4ֵ + }; + + enum FilterMode + { + FILTER_MODE_NEAREST, + FILTER_MODE_LINEAR, + }; + /// - /// 2D࣬2d meshrender targetбʹáTextureȾԭϽǣϷϲԵѿϵΪ - /// EditorҲϽΪԭ㣬Ϊ˷㡣 + /// ͼݵɫʽ + /// + enum ColorFormat + { + COLOR_FORMAT_UNKNOWN, + + COLOR_FORMAT_RGBA8, ///< RGBA8bits int + COLOR_FORMAT_RGBA32F, ///< RGBA32bits float + }; + + /// + /// 2D࣬2d meshrender targetбʹáTextureȾԭϽǣϷ + /// ϲԵѿϵΪEditorҲϽΪԭ㣬Ϊ + /// 㡣 /// ASURA_ABSTRACT class Texture { public: - Texture(); + LUAX_DECL_ABSTRACT_FACTORY(); + Texture(); virtual ~Texture(); GLuint GetGLTextureHandle() const; + void SetFilterMode(FilterMode min, FilterMode mag); + void SetWrapMode(WrapMode wrapMode); + + void GetFilterMode(); + void GetWrapMode(); + + /// + /// UVfilterΪ + /// + void IsGenMipmap(); + /// /// ȾtexturertϣԭϽǣң /// @@ -41,22 +79,20 @@ namespace AsuraEngine /// virtual void Render(const RenderTarget* rt, const Math::Rectf& quad, const RenderState& state) = 0; - /// - /// ù˷ʽ - /// - void SetSmooth(bool smooth); + protected: - /// - /// ظʽ - /// - void SetRepeated(); + LUAX_DECL_ENUM(ColorFormat); + LUAX_DECL_ENUM(FilterMode); + LUAX_DECL_ENUM(WrapMode); - protected: + GLuint mTexHandle; - /// - /// OpenGL texture handle - /// - GLuint mTextureHandle; + FilterMode mMinFilter; + FilterMode mMagFilter; + + WrapMode mWrapMode; + + bool mIsGenMipmap; }; diff --git a/source/modules/asura-core/input/clipboard.h b/source/modules/asura-core/input/clipboard.h index 4cecd55..b3b9a1a 100644 --- a/source/modules/asura-core/input/clipboard.h +++ b/source/modules/asura-core/input/clipboard.h @@ -19,11 +19,11 @@ namespace AsuraEngine void SetString(const Text::String& text); - //---------------------------------------------------------------------------------------------------------- + //----------------------------------------------------------------------------// LUAX_DECL_SINGLETON(Clipboard); - //---------------------------------------------------------------------------------------------------------- + //----------------------------------------------------------------------------// private: diff --git a/source/modules/asura-core/input/keyboard.h b/source/modules/asura-core/input/keyboard.h index 1480d06..0caf61e 100644 --- a/source/modules/asura-core/input/keyboard.h +++ b/source/modules/asura-core/input/keyboard.h @@ -42,7 +42,7 @@ // // public: // -// //---------------------------------------------------------------------------------------------------------- +// //----------------------------------------------------------------------------// // // LUAX_DECL_SINGLETON(Keyboard); // ͨAsuraEngine.KeyboardֱӷʣûNew // @@ -63,7 +63,7 @@ // // LUAX_DECL_METHOD(GetConstant); // -// //---------------------------------------------------------------------------------------------------------- +// //----------------------------------------------------------------------------// // // }; // diff --git a/source/modules/asura-core/input/mouse.h b/source/modules/asura-core/input/mouse.h index 3ab67fa..050100f 100644 --- a/source/modules/asura-core/input/mouse.h +++ b/source/modules/asura-core/input/mouse.h @@ -40,11 +40,11 @@ namespace AsuraEngine bool SetRelativeMode(bool relative) ; bool GetRelativeMode() const; - //---------------------------------------------------------------------------------------------------------- + //----------------------------------------------------------------------------// LUAX_DECL_SINGLETON(Mouse); - //---------------------------------------------------------------------------------------------------------- + //----------------------------------------------------------------------------// private: diff --git a/source/modules/asura-openal/audio.cpp b/source/modules/asura-openal/audio.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/audio.cpp diff --git a/source/modules/asura-openal/audio.h b/source/modules/asura-openal/audio.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/audio.h diff --git a/source/modules/asura-openal/mpg123_decoder.cpp b/source/modules/asura-openal/mpg123_decoder.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/mpg123_decoder.cpp diff --git a/source/modules/asura-openal/mpg123_decoder.h b/source/modules/asura-openal/mpg123_decoder.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/mpg123_decoder.h diff --git a/source/modules/asura-openal/sound_data.cpp b/source/modules/asura-openal/sound_data.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/sound_data.cpp diff --git a/source/modules/asura-openal/sound_data.h b/source/modules/asura-openal/sound_data.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/sound_data.h diff --git a/source/modules/asura-openal/source.cpp b/source/modules/asura-openal/source.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/source.cpp diff --git a/source/modules/asura-openal/source.h b/source/modules/asura-openal/source.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/source.h diff --git a/source/modules/asura-openal/vorbis_decoder.cpp b/source/modules/asura-openal/vorbis_decoder.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/vorbis_decoder.cpp diff --git a/source/modules/asura-openal/vorbis_decoder.h b/source/modules/asura-openal/vorbis_decoder.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/vorbis_decoder.h diff --git a/source/modules/asura-utils/io/decoded_data.cpp b/source/modules/asura-utils/io/decoded_data.cpp deleted file mode 100644 index 358a7a5..0000000 --- a/source/modules/asura-utils/io/decoded_data.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "../exceptions/exception.h" - -#include "decoded_data.h" - -namespace AsuraEngine -{ - namespace IO - { - - DecodedData::DecodedData(const DataBuffer& databuffer) - { - Decode(databuffer); - } - - DecodedData::~DecodedData() - { - - } - - } -} diff --git a/source/modules/asura-utils/io/decoded_data.h b/source/modules/asura-utils/io/decoded_data.h index e201e91..724dbac 100644 --- a/source/modules/asura-utils/io/decoded_data.h +++ b/source/modules/asura-utils/io/decoded_data.h @@ -2,6 +2,7 @@ #define __ASURA_ENGINE_DATA_H__ #include <cstdlib> +#include <asura-utils/threading/thread.h> #include "../scripting/portable.hpp" @@ -13,8 +14,8 @@ namespace AsuraEngine { /// - /// һ̹߳data̳дࡣͼƬݡƵݵȣһ߳нԭļڲݸʽ - /// ȡ + /// һ̹߳data̳дࡣͼƬݡƵݵȣһ߳нԭ + /// ļڲݸʽصȡ /// ASURA_ABSTRACT class DecodedData { @@ -23,16 +24,13 @@ namespace AsuraEngine /// /// ڴйdataԷһ߳棬Դϵͳء /// - DecodedData(const DataBuffer& databuffer); - - virtual ~DecodedData(); - - protected: + DecodedData() {}; + virtual ~DecodedData() {}; /// - /// ڴеݡ + /// ڴеݲijָʽ档 /// - virtual void Decode(const DataBuffer& buffer) = 0; + virtual void Decode(DataBuffer& buffer) = 0; }; diff --git a/source/modules/asura-utils/io/reloadable.h b/source/modules/asura-utils/io/reloadable.h index 22a721c..c3b89ac 100644 --- a/source/modules/asura-utils/io/reloadable.h +++ b/source/modules/asura-utils/io/reloadable.h @@ -1,5 +1,5 @@ -#ifndef __ASURA_ENGINE_RELOADABLE_H__ -#define __ASURA_ENGINE_RELOADABLE_H__ +#ifndef __ASURA_ENGINE_RENEWABLE_H__ +#define __ASURA_ENGINE_RENEWABLE_H__ #include "../scripting/portable.hpp" @@ -9,15 +9,19 @@ namespace AsuraEngine { /// - /// ¹ݽṹͼƬƵ֣ⲿݿֱӹڱ༭¹ڲıhandleԴ + /// ¹ݽṹͼƬƵ֣ӽݿֱӹڱ༭ + /// ¹handleֵı䲻߱ƻԣڲıhandleԴ /// - ASURA_ABSTRACT class Reloadable + ASURA_ABSTRACT class Renewable { public: - Reloadable(); - virtual ~Reloadable(); + Renewable(); + virtual ~ Renewable(); - // ̳ReloadableҪṩһload + /// + /// ̳RenewableҪṩһRefresh + /// + virtual bool Refresh(AEIO::DecodedData* decode_data) = 0; }; |