refactor IntrusivePtr & detach easy2d-audio component
minor minor refactoring projects fixes
This commit is contained in:
parent
c270418774
commit
ed65cf767b
|
|
@ -2,17 +2,21 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.271
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloWorld", "HelloWorld\HelloWorld.vcxproj", "{3561A359-F9FD-48AB-A977-34E7E568BC8E}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloWorld", "samples\HelloWorld\HelloWorld.vcxproj", "{3561A359-F9FD-48AB-A977-34E7E568BC8E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Easy2D", "Easy2D\Easy2D.vcxproj", "{FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Easy2D", "src\easy2d\Easy2D.vcxproj", "{FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Samples", "Samples\Samples.vcxproj", "{45F5738D-CDF2-4024-974D-25B64F9043DE}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Easy2D-ImGui", "src\easy2d-imgui\Easy2D-ImGui.vcxproj", "{23AFF03B-A670-4C33-B790-18EEC82C61AE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Box2D", "..\3rd-party\box2d\Box2D.vcxproj", "{A434E80C-1049-10BE-D9CA-B31D459E0CEF}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Easy2D-Audio", "src\easy2d-audio\Easy2D-Audio.vcxproj", "{5D45F66B-BECD-4909-BCFC-C0F3CED9D0A2}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Box2DSample", "Box2DSample\Box2DSample.vcxproj", "{324CFF47-4EB2-499A-BE5F-53A82E3BA14B}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Samples", "samples\Samples\Samples.vcxproj", "{45F5738D-CDF2-4024-974D-25B64F9043DE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImGuiSample", "ImGuiSample\ImGuiSample.vcxproj", "{6152D36C-EA40-4968-A696-244B6CA58395}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImGuiSample", "samples\ImGuiSample\ImGuiSample.vcxproj", "{6152D36C-EA40-4968-A696-244B6CA58395}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Box2D", "3rd-party\box2d\Box2D.vcxproj", "{A434E80C-1049-10BE-D9CA-B31D459E0CEF}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Box2DSample", "samples\Box2DSample\Box2DSample.vcxproj", "{324CFF47-4EB2-499A-BE5F-53A82E3BA14B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
|
@ -72,6 +76,22 @@ Global
|
|||
{6152D36C-EA40-4968-A696-244B6CA58395}.Release|Win32.Build.0 = Release|Win32
|
||||
{6152D36C-EA40-4968-A696-244B6CA58395}.Release|x64.ActiveCfg = Release|x64
|
||||
{6152D36C-EA40-4968-A696-244B6CA58395}.Release|x64.Build.0 = Release|x64
|
||||
{23AFF03B-A670-4C33-B790-18EEC82C61AE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{23AFF03B-A670-4C33-B790-18EEC82C61AE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{23AFF03B-A670-4C33-B790-18EEC82C61AE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{23AFF03B-A670-4C33-B790-18EEC82C61AE}.Debug|x64.Build.0 = Debug|x64
|
||||
{23AFF03B-A670-4C33-B790-18EEC82C61AE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{23AFF03B-A670-4C33-B790-18EEC82C61AE}.Release|Win32.Build.0 = Release|Win32
|
||||
{23AFF03B-A670-4C33-B790-18EEC82C61AE}.Release|x64.ActiveCfg = Release|x64
|
||||
{23AFF03B-A670-4C33-B790-18EEC82C61AE}.Release|x64.Build.0 = Release|x64
|
||||
{5D45F66B-BECD-4909-BCFC-C0F3CED9D0A2}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{5D45F66B-BECD-4909-BCFC-C0F3CED9D0A2}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{5D45F66B-BECD-4909-BCFC-C0F3CED9D0A2}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{5D45F66B-BECD-4909-BCFC-C0F3CED9D0A2}.Debug|x64.Build.0 = Debug|x64
|
||||
{5D45F66B-BECD-4909-BCFC-C0F3CED9D0A2}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{5D45F66B-BECD-4909-BCFC-C0F3CED9D0A2}.Release|Win32.Build.0 = Release|Win32
|
||||
{5D45F66B-BECD-4909-BCFC-C0F3CED9D0A2}.Release|x64.ActiveCfg = Release|x64
|
||||
{5D45F66B-BECD-4909-BCFC-C0F3CED9D0A2}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
@ -1,266 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\easy2d\audio\audio.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\audio\audio-modules.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\audio\Music.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\audio\Player.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\audio\Transcoder.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\audio\Voice.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\common\Array.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\common\closure.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\common\ComPtr.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\common\IntrusiveList.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\common\IntrusivePtr.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\common\noncopyable.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\common\Singleton.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\common\String.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\config.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Action.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\ActionGroup.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\ActionHelper.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\ActionTween.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\ActionManager.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Animation.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Canvas.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Color.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Component.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\DebugNode.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Event.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\EventDispatcher.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\EventListener.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Font.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Frames.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Application.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Geometry.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\GeometryNode.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\helper.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Image.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\include-forwards.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Input.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\keys.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Layer.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\logs.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\modules.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Node.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Object.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\RefCounter.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\render.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Resource.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Scene.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Sprite.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Task.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\TaskManager.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Text.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\TextStyle.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\time.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Transform.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Transition.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\window.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\dx\D2DDeviceResources.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\dx\D3D10DeviceResources.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\dx\D3D11DeviceResources.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\dx\DeviceResources.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\dx\helper.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\dx\TextRenderer.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\easy2d.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\macros.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\math\constants.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\math\ease.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\math\Matrix.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\math\rand.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\math\Rect.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\math\scalar.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\math\vector.hpp" />
|
||||
<ClInclude Include="..\..\src\easy2d\ui\Button.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\ui\Menu.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\utils\Data.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\utils\File.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\utils\Path.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\utils\ResLoader.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\easy2d\audio\audio.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\audio\audio-modules.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\audio\Music.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\audio\Player.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\audio\Transcoder.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\audio\Voice.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\common\String.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Action.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\ActionGroup.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\ActionTween.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\ActionManager.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Animation.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Canvas.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Color.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\DebugNode.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\EventDispatcher.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\EventListener.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Frames.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Application.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Geometry.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\GeometryNode.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Image.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Input.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Layer.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\logs.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\modules.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Node.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Object.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\render.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Resource.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Scene.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Sprite.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Task.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\TaskManager.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Text.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\time.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\Transition.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\core\window.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\dx\D2DDeviceResources.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\dx\D3D10DeviceResources.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\dx\D3D11DeviceResources.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\dx\TextRenderer.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\ui\Button.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\ui\Menu.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\utils\Data.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\utils\File.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\utils\Path.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d\utils\ResLoader.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}</ProjectGuid>
|
||||
<RootNamespace>Easy2D</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</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 Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<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 Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(ProjectDir)$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<IntDir>$(ProjectDir)$(Configuration)\</IntDir>
|
||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(ProjectDir)$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<IntDir>$(ProjectDir)$(Configuration)\</IntDir>
|
||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<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>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
|
@ -1,399 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="core">
|
||||
<UniqueIdentifier>{896bdedf-6e82-449b-9b6e-0bc69f3699b1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="math">
|
||||
<UniqueIdentifier>{80bc6386-2b70-4bae-993c-649a55163a1b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="utils">
|
||||
<UniqueIdentifier>{68eac919-ee87-4030-a033-c251731928f5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ui">
|
||||
<UniqueIdentifier>{07b6d541-4a1b-472a-aae0-daf9d082fe84}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="dx">
|
||||
<UniqueIdentifier>{a9793a75-3212-4e31-a443-b23f18a1e136}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="audio">
|
||||
<UniqueIdentifier>{836608a6-7443-48f9-8acd-18d3ba664348}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="common">
|
||||
<UniqueIdentifier>{86e2d0f2-a9d0-4456-b6a5-d480228bbf82}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\easy2d\easy2d.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\core\Animation.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Canvas.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Color.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Image.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Input.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\logs.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\modules.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Node.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\render.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Resource.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Scene.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Sprite.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Task.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Text.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\time.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Transition.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\window.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\math\rand.h">
|
||||
<Filter>math</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\math\scalar.hpp">
|
||||
<Filter>math</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\math\vector.hpp">
|
||||
<Filter>math</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\utils\Data.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\utils\File.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\utils\Path.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\ui\Button.h">
|
||||
<Filter>ui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\ui\Menu.h">
|
||||
<Filter>ui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\RefCounter.hpp">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\ActionManager.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\TaskManager.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\TextStyle.hpp">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Font.hpp">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Transform.hpp">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Geometry.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\GeometryNode.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\math\ease.hpp">
|
||||
<Filter>math</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\ActionTween.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Frames.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\math\constants.hpp">
|
||||
<Filter>math</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\EventDispatcher.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\EventListener.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Object.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\keys.hpp">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\include-forwards.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\DebugNode.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\math\Rect.hpp">
|
||||
<Filter>math</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\utils\ResLoader.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Application.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Event.hpp">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\ActionGroup.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\ActionHelper.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Action.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\math\Matrix.hpp">
|
||||
<Filter>math</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\dx\D2DDeviceResources.h">
|
||||
<Filter>dx</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\dx\D3D11DeviceResources.h">
|
||||
<Filter>dx</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\dx\DeviceResources.h">
|
||||
<Filter>dx</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\dx\helper.hpp">
|
||||
<Filter>dx</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\dx\TextRenderer.h">
|
||||
<Filter>dx</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\dx\D3D10DeviceResources.h">
|
||||
<Filter>dx</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\audio\audio.h">
|
||||
<Filter>audio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\audio\Music.h">
|
||||
<Filter>audio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\audio\Player.h">
|
||||
<Filter>audio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\audio\Transcoder.h">
|
||||
<Filter>audio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\audio\Voice.h">
|
||||
<Filter>audio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Component.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\audio\audio-modules.h">
|
||||
<Filter>audio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\Layer.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\config.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\macros.h" />
|
||||
<ClInclude Include="..\..\src\easy2d\common\Array.h">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\common\closure.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\common\ComPtr.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\common\IntrusiveList.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\common\IntrusivePtr.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\common\noncopyable.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\common\Singleton.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\core\helper.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d\common\String.h">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Animation.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Canvas.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Color.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Image.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Input.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\modules.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Node.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\render.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Resource.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Scene.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Sprite.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Task.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Text.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\time.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Transition.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\window.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\utils\Data.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\utils\File.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\utils\Path.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\ui\Button.cpp">
|
||||
<Filter>ui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\ui\Menu.cpp">
|
||||
<Filter>ui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\TaskManager.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\ActionManager.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\logs.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Geometry.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\GeometryNode.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\ActionTween.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Frames.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\EventDispatcher.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\EventListener.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Object.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\DebugNode.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\utils\ResLoader.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Application.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\ActionGroup.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Action.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\dx\D2DDeviceResources.cpp">
|
||||
<Filter>dx</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\dx\D3D11DeviceResources.cpp">
|
||||
<Filter>dx</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\dx\TextRenderer.cpp">
|
||||
<Filter>dx</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\dx\D3D10DeviceResources.cpp">
|
||||
<Filter>dx</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\audio\audio.cpp">
|
||||
<Filter>audio</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\audio\Music.cpp">
|
||||
<Filter>audio</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\audio\Player.cpp">
|
||||
<Filter>audio</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\audio\Transcoder.cpp">
|
||||
<Filter>audio</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\audio\Voice.cpp">
|
||||
<Filter>audio</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\audio\audio-modules.cpp">
|
||||
<Filter>audio</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\core\Layer.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d\common\String.cpp">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
|
|
@ -143,7 +143,7 @@
|
|||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Easy2D\Easy2D.vcxproj">
|
||||
<ProjectReference Include="..\..\src\easy2d\Easy2D.vcxproj">
|
||||
<Project>{ff7f943d-a89c-4e6c-97cf-84f7d8ff8edf}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
|
@ -132,29 +132,13 @@
|
|||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\3rd-party\ImGui\imgui.cpp" />
|
||||
<ClCompile Include="..\..\3rd-party\ImGui\imgui_demo.cpp" />
|
||||
<ClCompile Include="..\..\3rd-party\ImGui\imgui_draw.cpp" />
|
||||
<ClCompile Include="..\..\3rd-party\ImGui\imgui_widgets.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d-imgui\ImGuiLayer.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d-imgui\ImGuiView.cpp" />
|
||||
<ClCompile Include="..\..\src\easy2d-imgui\imgui_impl_dx11.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\3rd-party\ImGui\imconfig.h" />
|
||||
<ClInclude Include="..\..\3rd-party\ImGui\imgui.h" />
|
||||
<ClInclude Include="..\..\3rd-party\ImGui\imgui_internal.h" />
|
||||
<ClInclude Include="..\..\3rd-party\ImGui\imstb_rectpack.h" />
|
||||
<ClInclude Include="..\..\3rd-party\ImGui\imstb_textedit.h" />
|
||||
<ClInclude Include="..\..\3rd-party\ImGui\imstb_truetype.h" />
|
||||
<ClInclude Include="..\..\src\easy2d-imgui\easy2d-imgui.h" />
|
||||
<ClInclude Include="..\..\src\easy2d-imgui\ImGuiLayer.h" />
|
||||
<ClInclude Include="..\..\src\easy2d-imgui\ImGuiView.h" />
|
||||
<ClInclude Include="..\..\src\easy2d-imgui\imgui_impl_dx11.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Easy2D\Easy2D.vcxproj">
|
||||
<ProjectReference Include="..\..\src\easy2d-imgui\Easy2D-ImGui.vcxproj">
|
||||
<Project>{23aff03b-a670-4c33-b790-18eec82c61ae}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\src\easy2d\Easy2D.vcxproj">
|
||||
<Project>{ff7f943d-a89c-4e6c-97cf-84f7d8ff8edf}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -19,7 +19,6 @@
|
|||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{45F5738D-CDF2-4024-974D-25B64F9043DE}</ProjectGuid>
|
||||
<RootNamespace>Samples</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
|
@ -82,7 +81,7 @@
|
|||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>../../src/easy2d</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>../../src/easy2d;../../src/easy2d-audio;</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
|
|
@ -144,7 +143,10 @@
|
|||
<ClInclude Include="include-forwards.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Easy2D\Easy2D.vcxproj">
|
||||
<ProjectReference Include="..\..\src\easy2d-audio\Easy2D-Audio.vcxproj">
|
||||
<Project>{5d45f66b-becd-4909-bcfc-c0f3ced9d0a2}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\src\easy2d\Easy2D.vcxproj">
|
||||
<Project>{ff7f943d-a89c-4e6c-97cf-84f7d8ff8edf}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#pragma once
|
||||
#include "easy2d.h"
|
||||
#include "easy2d-audio.h"
|
||||
|
||||
using namespace easy2d;
|
||||
|
||||
|
Before Width: | Height: | Size: 702 KiB After Width: | Height: | Size: 702 KiB |
|
|
@ -0,0 +1,159 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.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">
|
||||
<ProjectGuid>{5D45F66B-BECD-4909-BCFC-C0F3CED9D0A2}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</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 Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>../easy2d</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="audio-modules.cpp" />
|
||||
<ClCompile Include="audio.cpp" />
|
||||
<ClCompile Include="Music.cpp" />
|
||||
<ClCompile Include="Player.cpp" />
|
||||
<ClCompile Include="Transcoder.cpp" />
|
||||
<ClCompile Include="Voice.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="audio-modules.h" />
|
||||
<ClInclude Include="audio.h" />
|
||||
<ClInclude Include="easy2d-audio.h" />
|
||||
<ClInclude Include="Music.h" />
|
||||
<ClInclude Include="Player.h" />
|
||||
<ClInclude Include="Transcoder.h" />
|
||||
<ClInclude Include="Voice.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="audio.cpp" />
|
||||
<ClCompile Include="audio-modules.cpp" />
|
||||
<ClCompile Include="Music.cpp" />
|
||||
<ClCompile Include="Player.cpp" />
|
||||
<ClCompile Include="Transcoder.cpp" />
|
||||
<ClCompile Include="Voice.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="audio.h" />
|
||||
<ClInclude Include="audio-modules.h" />
|
||||
<ClInclude Include="easy2d-audio.h" />
|
||||
<ClInclude Include="Music.h" />
|
||||
<ClInclude Include="Player.h" />
|
||||
<ClInclude Include="Transcoder.h" />
|
||||
<ClInclude Include="Voice.h" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -18,11 +18,9 @@
|
|||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#include "easy2d-audio.h"
|
||||
#include "Music.h"
|
||||
#include "Transcoder.h"
|
||||
#include "audio.h"
|
||||
#include "../core/logs.h"
|
||||
#include "../core/modules.h"
|
||||
|
||||
namespace easy2d
|
||||
{
|
||||
|
|
@ -19,8 +19,6 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include "../core/include-forwards.h"
|
||||
#include "../core/Resource.h"
|
||||
#include "Voice.h"
|
||||
|
||||
namespace easy2d
|
||||
|
|
@ -18,6 +18,7 @@
|
|||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#include "easy2d-audio.h"
|
||||
#include "Player.h"
|
||||
|
||||
namespace easy2d
|
||||
|
|
@ -19,8 +19,6 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include "../core/include-forwards.h"
|
||||
#include "Music.h"
|
||||
|
||||
namespace easy2d
|
||||
{
|
||||
|
|
@ -22,11 +22,9 @@
|
|||
# define INITGUID // MFAudioFormat_PCM, MF_MT_MAJOR_TYPE, MF_MT_SUBTYPE, MFMediaType_Audio
|
||||
#endif
|
||||
|
||||
#include "easy2d-audio.h"
|
||||
#include "Transcoder.h"
|
||||
#include "audio-modules.h"
|
||||
#include "../common/ComPtr.hpp"
|
||||
#include "../core/logs.h"
|
||||
#include "../core/modules.h"
|
||||
|
||||
namespace easy2d
|
||||
{
|
||||
|
|
@ -19,7 +19,6 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include "../core/Resource.h"
|
||||
#include <mfapi.h>
|
||||
#include <mfidl.h>
|
||||
#include <mfreadwrite.h>
|
||||
|
|
@ -18,8 +18,8 @@
|
|||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#include "easy2d-audio.h"
|
||||
#include "Voice.h"
|
||||
#include "audio.h"
|
||||
|
||||
namespace easy2d
|
||||
{
|
||||
|
|
@ -19,8 +19,6 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include "../macros.h"
|
||||
#include "../common/noncopyable.hpp"
|
||||
#include <xaudio2.h>
|
||||
|
||||
namespace easy2d
|
||||
|
|
@ -18,8 +18,8 @@
|
|||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#include "easy2d-audio.h"
|
||||
#include "audio-modules.h"
|
||||
#include "../core/logs.h"
|
||||
|
||||
namespace easy2d
|
||||
{
|
||||
|
|
@ -19,7 +19,6 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include "../macros.h"
|
||||
#include <xaudio2.h>
|
||||
#include <mfapi.h>
|
||||
#include <mfidl.h>
|
||||
|
|
@ -18,9 +18,9 @@
|
|||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#include "easy2d-audio.h"
|
||||
#include "audio.h"
|
||||
#include "audio-modules.h"
|
||||
#include "../core/logs.h"
|
||||
|
||||
namespace easy2d
|
||||
{
|
||||
|
|
@ -19,9 +19,6 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include "../core/include-forwards.h"
|
||||
#include "../core/Component.h"
|
||||
#include "../common/Singleton.hpp"
|
||||
#include "Voice.h"
|
||||
|
||||
namespace easy2d
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
// Copyright (C) 2019 Nomango
|
||||
|
||||
#pragma once
|
||||
#include "easy2d.h"
|
||||
|
||||
#include "audio.h"
|
||||
#include "Music.h"
|
||||
#include "Player.h"
|
||||
|
|
@ -0,0 +1,163 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.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">
|
||||
<ProjectGuid>{23AFF03B-A670-4C33-B790-18EEC82C61AE}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</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 Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>../easy2d;../../3rd-party/ImGui;</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\3rd-party\ImGui\imconfig.h" />
|
||||
<ClInclude Include="..\..\3rd-party\ImGui\imgui.h" />
|
||||
<ClInclude Include="..\..\3rd-party\ImGui\imgui_internal.h" />
|
||||
<ClInclude Include="..\..\3rd-party\ImGui\imstb_rectpack.h" />
|
||||
<ClInclude Include="..\..\3rd-party\ImGui\imstb_textedit.h" />
|
||||
<ClInclude Include="..\..\3rd-party\ImGui\imstb_truetype.h" />
|
||||
<ClInclude Include="easy2d-imgui.h" />
|
||||
<ClInclude Include="ImGuiLayer.h" />
|
||||
<ClInclude Include="ImGuiView.h" />
|
||||
<ClInclude Include="imgui_impl_dx11.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\3rd-party\ImGui\imgui.cpp" />
|
||||
<ClCompile Include="..\..\3rd-party\ImGui\imgui_demo.cpp" />
|
||||
<ClCompile Include="..\..\3rd-party\ImGui\imgui_draw.cpp" />
|
||||
<ClCompile Include="..\..\3rd-party\ImGui\imgui_widgets.cpp" />
|
||||
<ClCompile Include="ImGuiLayer.cpp" />
|
||||
<ClCompile Include="ImGuiView.cpp" />
|
||||
<ClCompile Include="imgui_impl_dx11.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
|
@ -1,30 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="..\..\3rd-party\ImGui\imgui.cpp">
|
||||
<Filter>imgui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\3rd-party\ImGui\imgui_demo.cpp">
|
||||
<Filter>imgui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\3rd-party\ImGui\imgui_draw.cpp">
|
||||
<Filter>imgui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\3rd-party\ImGui\imgui_widgets.cpp">
|
||||
<Filter>imgui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d-imgui\imgui_impl_dx11.cpp">
|
||||
<Filter>easy2d-imgui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d-imgui\ImGuiLayer.cpp">
|
||||
<Filter>easy2d-imgui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\easy2d-imgui\ImGuiView.cpp">
|
||||
<Filter>easy2d-imgui</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="easy2d-imgui.h" />
|
||||
<ClInclude Include="imgui_impl_dx11.h" />
|
||||
<ClInclude Include="ImGuiLayer.h" />
|
||||
<ClInclude Include="ImGuiView.h" />
|
||||
<ClInclude Include="..\..\3rd-party\ImGui\imconfig.h">
|
||||
<Filter>imgui</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -43,25 +23,27 @@
|
|||
<ClInclude Include="..\..\3rd-party\ImGui\imstb_truetype.h">
|
||||
<Filter>imgui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d-imgui\imgui_impl_dx11.h">
|
||||
<Filter>easy2d-imgui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d-imgui\ImGuiLayer.h">
|
||||
<Filter>easy2d-imgui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d-imgui\ImGuiView.h">
|
||||
<Filter>easy2d-imgui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\easy2d-imgui\easy2d-imgui.h">
|
||||
<Filter>easy2d-imgui</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="imgui_impl_dx11.cpp" />
|
||||
<ClCompile Include="ImGuiLayer.cpp" />
|
||||
<ClCompile Include="ImGuiView.cpp" />
|
||||
<ClCompile Include="..\..\3rd-party\ImGui\imgui.cpp">
|
||||
<Filter>imgui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\3rd-party\ImGui\imgui_demo.cpp">
|
||||
<Filter>imgui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\3rd-party\ImGui\imgui_draw.cpp">
|
||||
<Filter>imgui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\3rd-party\ImGui\imgui_widgets.cpp">
|
||||
<Filter>imgui</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="imgui">
|
||||
<UniqueIdentifier>{24ae99cd-ee12-481f-bb03-d8be40d99342}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="easy2d-imgui">
|
||||
<UniqueIdentifier>{37f1585a-e992-454a-8cac-e9a6142b08b6}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{d0ea3700-326c-4dc2-a674-fcb657039e87}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,254 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClInclude Include="common\Array.h" />
|
||||
<ClInclude Include="common\closure.hpp" />
|
||||
<ClInclude Include="common\ComPtr.hpp" />
|
||||
<ClInclude Include="common\IntrusiveList.hpp" />
|
||||
<ClInclude Include="common\IntrusivePtr.hpp" />
|
||||
<ClInclude Include="common\noncopyable.hpp" />
|
||||
<ClInclude Include="common\Singleton.hpp" />
|
||||
<ClInclude Include="common\String.h" />
|
||||
<ClInclude Include="config.h" />
|
||||
<ClInclude Include="core\Action.h" />
|
||||
<ClInclude Include="core\ActionGroup.h" />
|
||||
<ClInclude Include="core\ActionHelper.h" />
|
||||
<ClInclude Include="core\ActionTween.h" />
|
||||
<ClInclude Include="core\ActionManager.h" />
|
||||
<ClInclude Include="core\Animation.h" />
|
||||
<ClInclude Include="core\Canvas.h" />
|
||||
<ClInclude Include="core\Color.h" />
|
||||
<ClInclude Include="core\Component.h" />
|
||||
<ClInclude Include="core\DebugNode.h" />
|
||||
<ClInclude Include="core\Event.hpp" />
|
||||
<ClInclude Include="core\EventDispatcher.h" />
|
||||
<ClInclude Include="core\EventListener.h" />
|
||||
<ClInclude Include="core\Font.hpp" />
|
||||
<ClInclude Include="core\Frames.h" />
|
||||
<ClInclude Include="core\Application.h" />
|
||||
<ClInclude Include="core\Geometry.h" />
|
||||
<ClInclude Include="core\GeometryNode.h" />
|
||||
<ClInclude Include="core\helper.h" />
|
||||
<ClInclude Include="core\Image.h" />
|
||||
<ClInclude Include="core\include-forwards.h" />
|
||||
<ClInclude Include="core\Input.h" />
|
||||
<ClInclude Include="core\keys.hpp" />
|
||||
<ClInclude Include="core\Layer.h" />
|
||||
<ClInclude Include="core\logs.h" />
|
||||
<ClInclude Include="core\modules.h" />
|
||||
<ClInclude Include="core\Node.h" />
|
||||
<ClInclude Include="core\Object.h" />
|
||||
<ClInclude Include="core\RefCounter.hpp" />
|
||||
<ClInclude Include="core\render.h" />
|
||||
<ClInclude Include="core\Resource.h" />
|
||||
<ClInclude Include="core\Scene.h" />
|
||||
<ClInclude Include="core\Sprite.h" />
|
||||
<ClInclude Include="core\Task.h" />
|
||||
<ClInclude Include="core\TaskManager.h" />
|
||||
<ClInclude Include="core\Text.h" />
|
||||
<ClInclude Include="core\TextStyle.hpp" />
|
||||
<ClInclude Include="core\time.h" />
|
||||
<ClInclude Include="core\Transform.hpp" />
|
||||
<ClInclude Include="core\Transition.h" />
|
||||
<ClInclude Include="core\window.h" />
|
||||
<ClInclude Include="dx\D2DDeviceResources.h" />
|
||||
<ClInclude Include="dx\D3D10DeviceResources.h" />
|
||||
<ClInclude Include="dx\D3D11DeviceResources.h" />
|
||||
<ClInclude Include="dx\DeviceResources.h" />
|
||||
<ClInclude Include="dx\helper.hpp" />
|
||||
<ClInclude Include="dx\TextRenderer.h" />
|
||||
<ClInclude Include="easy2d.h" />
|
||||
<ClInclude Include="macros.h" />
|
||||
<ClInclude Include="math\constants.hpp" />
|
||||
<ClInclude Include="math\ease.hpp" />
|
||||
<ClInclude Include="math\Matrix.hpp" />
|
||||
<ClInclude Include="math\rand.h" />
|
||||
<ClInclude Include="math\Rect.hpp" />
|
||||
<ClInclude Include="math\scalar.hpp" />
|
||||
<ClInclude Include="math\vector.hpp" />
|
||||
<ClInclude Include="ui\Button.h" />
|
||||
<ClInclude Include="ui\Menu.h" />
|
||||
<ClInclude Include="utils\Data.h" />
|
||||
<ClInclude Include="utils\File.h" />
|
||||
<ClInclude Include="utils\Path.h" />
|
||||
<ClInclude Include="utils\ResLoader.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="common\String.cpp" />
|
||||
<ClCompile Include="core\Action.cpp" />
|
||||
<ClCompile Include="core\ActionGroup.cpp" />
|
||||
<ClCompile Include="core\ActionTween.cpp" />
|
||||
<ClCompile Include="core\ActionManager.cpp" />
|
||||
<ClCompile Include="core\Animation.cpp" />
|
||||
<ClCompile Include="core\Canvas.cpp" />
|
||||
<ClCompile Include="core\Color.cpp" />
|
||||
<ClCompile Include="core\DebugNode.cpp" />
|
||||
<ClCompile Include="core\EventDispatcher.cpp" />
|
||||
<ClCompile Include="core\EventListener.cpp" />
|
||||
<ClCompile Include="core\Frames.cpp" />
|
||||
<ClCompile Include="core\Application.cpp" />
|
||||
<ClCompile Include="core\Geometry.cpp" />
|
||||
<ClCompile Include="core\GeometryNode.cpp" />
|
||||
<ClCompile Include="core\Image.cpp" />
|
||||
<ClCompile Include="core\Input.cpp" />
|
||||
<ClCompile Include="core\Layer.cpp" />
|
||||
<ClCompile Include="core\logs.cpp" />
|
||||
<ClCompile Include="core\modules.cpp" />
|
||||
<ClCompile Include="core\Node.cpp" />
|
||||
<ClCompile Include="core\Object.cpp" />
|
||||
<ClCompile Include="core\render.cpp" />
|
||||
<ClCompile Include="core\Resource.cpp" />
|
||||
<ClCompile Include="core\Scene.cpp" />
|
||||
<ClCompile Include="core\Sprite.cpp" />
|
||||
<ClCompile Include="core\Task.cpp" />
|
||||
<ClCompile Include="core\TaskManager.cpp" />
|
||||
<ClCompile Include="core\Text.cpp" />
|
||||
<ClCompile Include="core\time.cpp" />
|
||||
<ClCompile Include="core\Transition.cpp" />
|
||||
<ClCompile Include="core\window.cpp" />
|
||||
<ClCompile Include="dx\D2DDeviceResources.cpp" />
|
||||
<ClCompile Include="dx\D3D10DeviceResources.cpp" />
|
||||
<ClCompile Include="dx\D3D11DeviceResources.cpp" />
|
||||
<ClCompile Include="dx\TextRenderer.cpp" />
|
||||
<ClCompile Include="ui\Button.cpp" />
|
||||
<ClCompile Include="ui\Menu.cpp" />
|
||||
<ClCompile Include="utils\Data.cpp" />
|
||||
<ClCompile Include="utils\File.cpp" />
|
||||
<ClCompile Include="utils\Path.cpp" />
|
||||
<ClCompile Include="utils\ResLoader.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}</ProjectGuid>
|
||||
<RootNamespace>Easy2D</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</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 Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<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 Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(ProjectDir)$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<IntDir>$(ProjectDir)$(Configuration)\</IntDir>
|
||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(ProjectDir)$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<IntDir>$(ProjectDir)$(Configuration)\</IntDir>
|
||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<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>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,360 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="core">
|
||||
<UniqueIdentifier>{896bdedf-6e82-449b-9b6e-0bc69f3699b1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="math">
|
||||
<UniqueIdentifier>{80bc6386-2b70-4bae-993c-649a55163a1b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="utils">
|
||||
<UniqueIdentifier>{68eac919-ee87-4030-a033-c251731928f5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ui">
|
||||
<UniqueIdentifier>{07b6d541-4a1b-472a-aae0-daf9d082fe84}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="dx">
|
||||
<UniqueIdentifier>{a9793a75-3212-4e31-a443-b23f18a1e136}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="common">
|
||||
<UniqueIdentifier>{86e2d0f2-a9d0-4456-b6a5-d480228bbf82}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="easy2d.h" />
|
||||
<ClInclude Include="core\Animation.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Canvas.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Color.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Image.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Input.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\logs.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\modules.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Node.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\render.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Resource.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Scene.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Sprite.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Task.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Text.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\time.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Transition.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\window.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="math\rand.h">
|
||||
<Filter>math</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="math\scalar.hpp">
|
||||
<Filter>math</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="math\vector.hpp">
|
||||
<Filter>math</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="utils\Data.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="utils\File.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="utils\Path.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ui\Button.h">
|
||||
<Filter>ui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ui\Menu.h">
|
||||
<Filter>ui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\RefCounter.hpp">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\ActionManager.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\TaskManager.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\TextStyle.hpp">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Font.hpp">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Transform.hpp">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Geometry.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\GeometryNode.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="math\ease.hpp">
|
||||
<Filter>math</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\ActionTween.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Frames.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="math\constants.hpp">
|
||||
<Filter>math</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\EventDispatcher.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\EventListener.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Object.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\keys.hpp">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\include-forwards.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\DebugNode.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="math\Rect.hpp">
|
||||
<Filter>math</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="utils\ResLoader.h">
|
||||
<Filter>utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Application.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Event.hpp">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\ActionGroup.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\ActionHelper.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Action.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="math\Matrix.hpp">
|
||||
<Filter>math</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="dx\D2DDeviceResources.h">
|
||||
<Filter>dx</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="dx\D3D11DeviceResources.h">
|
||||
<Filter>dx</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="dx\DeviceResources.h">
|
||||
<Filter>dx</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="dx\helper.hpp">
|
||||
<Filter>dx</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="dx\TextRenderer.h">
|
||||
<Filter>dx</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="dx\D3D10DeviceResources.h">
|
||||
<Filter>dx</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Component.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\Layer.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="config.h" />
|
||||
<ClInclude Include="macros.h" />
|
||||
<ClInclude Include="common\Array.h">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="common\closure.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="common\ComPtr.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="common\IntrusiveList.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="common\IntrusivePtr.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="common\noncopyable.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="common\Singleton.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\helper.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="common\String.h">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="core\Animation.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Canvas.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Color.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Image.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Input.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\modules.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Node.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\render.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Resource.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Scene.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Sprite.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Task.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Text.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\time.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Transition.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\window.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="utils\Data.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="utils\File.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="utils\Path.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ui\Button.cpp">
|
||||
<Filter>ui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ui\Menu.cpp">
|
||||
<Filter>ui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\TaskManager.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\ActionManager.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\logs.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Geometry.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\GeometryNode.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\ActionTween.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Frames.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\EventDispatcher.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\EventListener.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Object.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\DebugNode.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="utils\ResLoader.cpp">
|
||||
<Filter>utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Application.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\ActionGroup.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Action.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="dx\D2DDeviceResources.cpp">
|
||||
<Filter>dx</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="dx\D3D11DeviceResources.cpp">
|
||||
<Filter>dx</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="dx\TextRenderer.cpp">
|
||||
<Filter>dx</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="dx\D3D10DeviceResources.cpp">
|
||||
<Filter>dx</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\Layer.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="common\String.cpp">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#pragma once
|
||||
#include "../macros.h"
|
||||
#include <type_traits>
|
||||
|
||||
namespace easy2d
|
||||
{
|
||||
|
|
@ -27,37 +28,35 @@ namespace easy2d
|
|||
// Array
|
||||
// Lightweight std::vector<>-like class
|
||||
//
|
||||
template<typename _Ty, typename _Alloc = std::allocator<_Ty>>
|
||||
class Array
|
||||
template<typename _Ty, typename _Alloc = std::allocator<_Ty>, bool _TyIsClass = std::is_class<_Ty>::value>
|
||||
class Array;
|
||||
|
||||
template<typename _Ty, typename _Alloc>
|
||||
class __ArrayBase
|
||||
{
|
||||
public:
|
||||
using value_type = _Ty;
|
||||
using allocator_type = _Alloc;
|
||||
using iterator = value_type*;
|
||||
using const_iterator = const value_type*;
|
||||
using reference = value_type &;
|
||||
using const_reference = const value_type &;
|
||||
using reverse_iterator = std::reverse_iterator<iterator>;
|
||||
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
||||
using value_type = _Ty;
|
||||
using size_type = int;
|
||||
using allocator_type = _Alloc;
|
||||
using iterator = value_type*;
|
||||
using const_iterator = const value_type*;
|
||||
using reference = value_type &;
|
||||
using const_reference = const value_type &;
|
||||
using reverse_iterator = std::reverse_iterator<iterator>;
|
||||
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
||||
|
||||
inline Array() { size_ = capacity_ = 0; data_ = nullptr; }
|
||||
inline Array(std::initializer_list<_Ty> const& list) { size_ = capacity_ = 0; data_ = nullptr; operator=(list); }
|
||||
inline Array(const Array<_Ty>& src) { size_ = capacity_ = 0; data_ = nullptr; operator=(src); }
|
||||
inline Array(Array<_Ty>&& src) { size_ = capacity_ = 0; data_ = nullptr; operator=(std::forward<Array<_Ty>&&>(src)); }
|
||||
inline ~Array() { if (data_) _destroy_all(); }
|
||||
|
||||
inline Array<_Ty>& operator=(const Array<_Ty>& src) { if (&src == this) { return *this; } clear(); reserve(src.size_); std::uninitialized_copy(src.begin(), src.end(), begin()); size_ = src.size_; return *this; }
|
||||
inline Array<_Ty>& operator=(Array<_Ty>&& src) { clear(); size_ = src.size_; capacity_ = src.capacity_; data_ = src.data_; src.size_ = src.capacity_ = 0; src.data_ = nullptr; return *this; }
|
||||
inline Array<_Ty>& operator=(std::initializer_list<_Ty> const& list) { clear(); reserve((int)list.size()); std::uninitialized_copy(list.begin(), list.end(), begin()); size_ = (int)list.size(); return *this; }
|
||||
|
||||
public:
|
||||
inline bool empty() const { return size_ == 0; }
|
||||
inline int size() const { return size_; }
|
||||
inline int size_in_bytes() const { return size_ * ((int)sizeof(_Ty)); }
|
||||
inline int capacity() const { return capacity_; }
|
||||
inline reference operator[](int i) { if (i < 0 || i >= size_) throw std::out_of_range("vector subscript out of range"); return data_[i]; }
|
||||
inline const_reference operator[](int i) const { if (i < 0 || i >= size_) throw std::out_of_range("vector subscript out of range"); return data_[i]; }
|
||||
inline size_type size() const { return size_; }
|
||||
inline size_type size_in_bytes() const { return size_ * ((size_type)sizeof(_Ty)); }
|
||||
inline size_type capacity() const { return capacity_; }
|
||||
inline reference operator[](size_type off) { check_offset(off, "vector subscript out of range"); return data_[off]; }
|
||||
inline const_reference operator[](size_type off) const { check_offset(off, "vector subscript out of range"); return data_[off]; }
|
||||
|
||||
|
||||
inline bool contains(const _Ty& v) const { const _Ty* data = data_; const _Ty* data_end = data_ + size_; while (data < data_end) if (*data++ == v) return true; return false; }
|
||||
inline size_type index_of(const_iterator it) const { check_offset(it - cbegin(), "invalid array position"); const ptrdiff_t off = it - data_; return (size_type)off; }
|
||||
|
||||
inline void clear() { if (data_) { _destroy_all(); } }
|
||||
inline iterator begin() { return iterator(data_); }
|
||||
inline const_iterator begin() const { return const_iterator(data_); }
|
||||
inline const_iterator cbegin() const { return begin(); }
|
||||
|
|
@ -74,31 +73,111 @@ namespace easy2d
|
|||
inline const_reference front() const { if (empty()) throw std::out_of_range("front() called on empty array"); return data_[0]; }
|
||||
inline reference back() { if (empty()) throw std::out_of_range("back() called on empty array"); return data_[size_ - 1]; }
|
||||
inline const_reference back() const { if (empty()) throw std::out_of_range("back() called on empty array"); return data_[size_ - 1]; }
|
||||
inline void swap(Array<_Ty>& rhs) { int rhs_size = rhs.size_; rhs.size_ = size_; size_ = rhs_size; int rhs_cap = rhs.capacity_; rhs.capacity_ = capacity_; capacity_ = rhs_cap; _Ty* rhs_data = rhs.data_; rhs.data_ = data_; data_ = rhs_data; }
|
||||
|
||||
inline void resize(int new_size) { if (new_size > capacity_) { reserve(_grow_capacity(new_size)); } _Ty tmp; std::uninitialized_fill_n(data_ + size_, new_size - size_, tmp); size_ = new_size; }
|
||||
inline void resize(int new_size, const _Ty& v) { if (new_size > capacity_) reserve(_grow_capacity(new_size)); if (new_size > size_) std::uninitialized_fill_n(data_ + size_, new_size - size_, v); size_ = new_size; }
|
||||
inline void reserve(int new_capacity) { if (new_capacity <= capacity_) return; _Ty* new_data = allocator_.allocate(new_capacity); if (data_) { ::memcpy(new_data, data_, (size_t)size_ * sizeof(_Ty)); allocator_.deallocate(data_, capacity_); } data_ = new_data; capacity_ = new_capacity; }
|
||||
protected:
|
||||
inline void check_offset(const size_type off, const char* const msg) const { if (off < 0 || off >= size_) throw std::out_of_range(msg); }
|
||||
|
||||
inline void push_back(const _Ty& v) { if (size_ == capacity_) reserve(_grow_capacity(size_ + 1)); allocator_.construct(data_ + size_, v); size_++; }
|
||||
protected:
|
||||
size_type size_;
|
||||
size_type capacity_;
|
||||
_Ty* data_;
|
||||
_Alloc allocator_;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Array<> for common type
|
||||
//
|
||||
template<typename _Ty, typename _Alloc>
|
||||
class Array<_Ty, _Alloc, false>
|
||||
: public __ArrayBase<_Ty, _Alloc>
|
||||
{
|
||||
public:
|
||||
inline Array() { size_ = capacity_ = 0; data_ = nullptr; }
|
||||
inline Array(std::initializer_list<_Ty> const& list) { size_ = capacity_ = 0; data_ = nullptr; operator=(list); }
|
||||
inline Array(const Array<_Ty>& src) { size_ = capacity_ = 0; data_ = nullptr; operator=(src); }
|
||||
inline Array(Array<_Ty>&& src) { size_ = capacity_ = 0; data_ = nullptr; swap(src); }
|
||||
inline ~Array() { destroy(); }
|
||||
|
||||
template <typename _Iter>
|
||||
inline Array(_Iter first, _Iter last) { size_ = capacity_ = 0; data_ = nullptr; assign_iter(first, last); }
|
||||
|
||||
inline Array<_Ty>& operator=(const Array<_Ty>& src) { if (&src == this) { return *this; } clear(); reserve(src.size_); size_ = src.size_; ::memcpy(data_, src.data_, (size_t)size_ * sizeof(_Ty)); return *this; }
|
||||
inline Array<_Ty>& operator=(Array<_Ty>&& src) { swap(src); return *this; }
|
||||
inline Array<_Ty>& operator=(std::initializer_list<_Ty> const& list) { clear(); auto new_size =(size_type)list.size(); if (new_size == 0) return; reserve(new_size); size_ = new_size; assign_iter(list.begin(), list.end()); return *this; }
|
||||
|
||||
inline void clear() { size_ = 0; }
|
||||
inline void swap(Array<_Ty>& rhs) { size_type rhs_size = rhs.size_; rhs.size_ = size_; size_ = rhs_size; size_type rhs_cap = rhs.capacity_; rhs.capacity_ = capacity_; capacity_ = rhs_cap; _Ty* rhs_data = rhs.data_; rhs.data_ = data_; data_ = rhs_data; }
|
||||
|
||||
inline void resize(size_type new_size) { if (new_size > capacity_) { reserve(grow_capacity(new_size)); } size_ = new_size; }
|
||||
inline void resize(size_type new_size, const _Ty& v) { if (new_size > capacity_) reserve(grow_capacity(new_size)); if (new_size > size_) for (int n = size_; n < new_size; n++) ::memcpy(&data_[n], &v, sizeof(v)); size_ = new_size; }
|
||||
inline void reserve(size_type new_capacity) { if (new_capacity <= capacity_) return; _Ty* new_data = allocator_.allocate(new_capacity); if (data_) { ::memcpy(new_data, data_, (size_t)size_ * sizeof(_Ty)); allocator_.deallocate(data_, capacity_); } data_ = new_data; capacity_ = new_capacity; }
|
||||
|
||||
inline void push_back(const _Ty& v) { if (size_ == capacity_) reserve(grow_capacity(size_ + 1)); ::memcpy(&data_[size_], &v, sizeof(v)); size_++; }
|
||||
inline void pop_back() { if (empty()) throw std::out_of_range("pop() called on empty vector"); size_--; }
|
||||
inline void push_front(const _Ty& v) { if (size_ == 0) push_back(v); else insert(data_, v); }
|
||||
|
||||
inline iterator erase(const_iterator it) { const auto off = it - data_; check_offset(off, "invalid vector position"); ::memmove(data_ + off, data_ + off + 1, ((size_t)size_ - (size_t)off - 1) * sizeof(_Ty)); size_--; return data_ + off; }
|
||||
inline iterator erase(const_iterator it, const_iterator it_last) { const auto count = it_last - it; const auto off = it - data_; if (count == 0) return it; check_offset(off, "invalid vector position"); ::memmove(data_ + off, data_ + off + count, ((size_t)size_ - (size_t)off - count) * sizeof(_Ty)); size_ -= (size_type)count; return data_ + off; }
|
||||
|
||||
inline iterator insert(const_iterator it, const _Ty& v) { const auto off = it - data_; check_offset(off, "invalid vector position"); if (size_ == capacity_) reserve(grow_capacity(size_ + 1)); if (off < (size_type)size_) ::memmove(data_ + off + 1, data_ + off, ((size_t)size_ - (size_t)off) * sizeof(_Ty)); ::memcpy(&data_[off], &v, sizeof(v)); size_++; return data_ + off; }
|
||||
|
||||
private:
|
||||
inline size_type grow_capacity(size_type sz) const { size_type new_capacity = capacity_ ? (capacity_ + capacity_ / 2) : 8; return new_capacity > sz ? new_capacity : sz; }
|
||||
inline void destroy() { if (data_) allocator_.deallocate(data_, capacity_); size_ = capacity_ = 0; data_ = nullptr; }
|
||||
|
||||
template <typename _Iter>
|
||||
inline void assign_iter(_Iter first, _Iter last) { auto diff = std::distance(first, last); if (diff == 0) return; reserve(diff); size_ = diff; for (size_type index = 0; first != last; ++first, ++index) data_[index] = (*first); }
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Array<> for class
|
||||
//
|
||||
template<typename _Ty, typename _Alloc>
|
||||
class Array<_Ty, _Alloc, true>
|
||||
: public __ArrayBase<_Ty, _Alloc>
|
||||
{
|
||||
public:
|
||||
using value_type = _Ty;
|
||||
using allocator_type = _Alloc;
|
||||
using iterator = value_type*;
|
||||
using const_iterator = const value_type*;
|
||||
using reference = value_type &;
|
||||
using const_reference = const value_type &;
|
||||
using reverse_iterator = std::reverse_iterator<iterator>;
|
||||
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
||||
|
||||
inline Array() { size_ = capacity_ = 0; data_ = nullptr; }
|
||||
inline Array(std::initializer_list<_Ty> const& list) { size_ = capacity_ = 0; data_ = nullptr; operator=(list); }
|
||||
inline Array(const Array<_Ty>& src) { size_ = capacity_ = 0; data_ = nullptr; operator=(src); }
|
||||
inline Array(Array<_Ty>&& src) { size_ = capacity_ = 0; data_ = nullptr; operator=(std::forward<Array<_Ty>&&>(src)); }
|
||||
inline ~Array() { if (data_) destroy_all(); }
|
||||
|
||||
inline Array<_Ty>& operator=(const Array<_Ty>& src) { if (&src == this) { return *this; } clear(); assign_iter(src.begin(), src.end()); return *this; }
|
||||
inline Array<_Ty>& operator=(Array<_Ty>&& src) { clear(); size_ = src.size_; capacity_ = src.capacity_; data_ = src.data_; src.size_ = src.capacity_ = 0; src.data_ = nullptr; return *this; }
|
||||
inline Array<_Ty>& operator=(std::initializer_list<_Ty> const& list) { clear(); assign_iter(list.begin(), list.end()); return *this; }
|
||||
|
||||
inline void clear() { if (data_) { destroy_all(); } }
|
||||
inline void swap(Array<_Ty>& rhs) { size_type rhs_size = rhs.size_; rhs.size_ = size_; size_ = rhs_size; size_type rhs_cap = rhs.capacity_; rhs.capacity_ = capacity_; capacity_ = rhs_cap; _Ty* rhs_data = rhs.data_; rhs.data_ = data_; data_ = rhs_data; }
|
||||
|
||||
inline void resize(size_type new_size) { if (new_size > capacity_) { reserve(grow_capacity(new_size)); } _Ty tmp; std::uninitialized_fill_n(data_ + size_, new_size - size_, tmp); size_ = new_size; }
|
||||
inline void resize(size_type new_size, const _Ty& v) { if (new_size > capacity_) reserve(grow_capacity(new_size)); if (new_size > size_) std::uninitialized_fill_n(data_ + size_, new_size - size_, v); size_ = new_size; }
|
||||
inline void reserve(size_type new_capacity) { if (new_capacity <= capacity_) return; _Ty* new_data = allocator_.allocate(new_capacity); if (data_) { ::memcpy(new_data, data_, (size_t)size_ * sizeof(_Ty)); allocator_.deallocate(data_, capacity_); } data_ = new_data; capacity_ = new_capacity; }
|
||||
|
||||
inline void push_back(const _Ty& v) { if (size_ == capacity_) reserve(grow_capacity(size_ + 1)); allocator_.construct(data_ + size_, v); size_++; }
|
||||
inline void pop_back() { if (empty()) throw std::out_of_range("vector empty before pop"); size_--; }
|
||||
inline void push_front(const _Ty& v) { if (size_ == 0) push_back(v); else insert(data_, v); }
|
||||
inline iterator erase(const_iterator it) { E2D_ASSERT(it >= data_ && it < data_ + size_); allocator_.destroy(it); const ptrdiff_t off = it - data_; ::memmove(data_ + off, data_ + off + 1, ((size_t)size_ - (size_t)off - 1) * sizeof(_Ty)); size_--; return data_ + off; }
|
||||
inline iterator erase(const_iterator it, const_iterator it_last) { E2D_ASSERT(it >= data_ && it < data_ + size_ && it_last > it && it_last <= data_ + size_); _destroy(it, it_last); const ptrdiff_t count = it_last - it; const ptrdiff_t off = it - data_; ::memmove(data_ + off, data_ + off + count, ((size_t)size_ - (size_t)off - count) * sizeof(_Ty)); size_ -= (int)count; return data_ + off; }
|
||||
inline iterator insert(const_iterator it, const _Ty& v) { E2D_ASSERT(it >= data_ && it <= data_ + size_); const ptrdiff_t off = it - data_; if (size_ == capacity_) reserve(_grow_capacity(size_ + 1)); if (off < (int)size_) ::memmove(data_ + off + 1, data_ + off, ((size_t)size_ - (size_t)off) * sizeof(_Ty)); allocator_.construct(data_ + off, v); size_++; return data_ + off; }
|
||||
inline bool contains(const _Ty& v) const { const _Ty* data = data_; const _Ty* data_end = data_ + size_; while (data < data_end) if (*data++ == v) return true; return false; }
|
||||
inline int index_of(const_iterator it) const { E2D_ASSERT(it >= data_ && it <= data_ + size_); const ptrdiff_t off = it - data_; return (int)off; }
|
||||
inline iterator erase(const_iterator it, const_iterator it_last) { E2D_ASSERT(it >= data_ && it < data_ + size_ && it_last > it && it_last <= data_ + size_); destroy(it, it_last); const ptrdiff_t count = it_last - it; const ptrdiff_t off = it - data_; ::memmove(data_ + off, data_ + off + count, ((size_t)size_ - (size_t)off - count) * sizeof(_Ty)); size_ -= (size_type)count; return data_ + off; }
|
||||
inline iterator insert(const_iterator it, const _Ty& v) { E2D_ASSERT(it >= data_ && it <= data_ + size_); const ptrdiff_t off = it - data_; if (size_ == capacity_) reserve(grow_capacity(size_ + 1)); if (off < (size_type)size_) ::memmove(data_ + off + 1, data_ + off, ((size_t)size_ - (size_t)off) * sizeof(_Ty)); allocator_.construct(data_ + off, v); size_++; return data_ + off; }
|
||||
|
||||
private:
|
||||
inline int _grow_capacity(int sz) const { int new_capacity = capacity_ ? (capacity_ + capacity_ / 2) : 8; return new_capacity > sz ? new_capacity : sz; }
|
||||
inline void _destroy(iterator it, iterator it_last) { E2D_ASSERT(it >= data_ && it < data_ + size_ && it_last > it && it_last <= data_ + size_); for (; it != it_last; ++it) allocator_.destroy(it); }
|
||||
inline void _destroy_all() { E2D_ASSERT((data_ && capacity_) || (!data_ && !capacity_)); if (size_) _destroy(begin(), end()); if (data_ && capacity_) allocator_.deallocate(data_, capacity_); size_ = capacity_ = 0; data_ = nullptr; }
|
||||
|
||||
private:
|
||||
int size_;
|
||||
int capacity_;
|
||||
_Ty* data_;
|
||||
|
||||
typename _Alloc allocator_;
|
||||
inline size_type grow_capacity(size_type sz) const { size_type new_capacity = capacity_ ? (capacity_ + capacity_ / 2) : 8; return new_capacity > sz ? new_capacity : sz; }
|
||||
inline void destroy(iterator it, iterator it_last) { E2D_ASSERT(it >= data_ && it < data_ + size_ && it_last > it && it_last <= data_ + size_); for (; it != it_last; ++it) allocator_.destroy(it); }
|
||||
inline void destroy_all() { E2D_ASSERT((data_ && capacity_) || (!data_ && !capacity_)); if (size_) destroy(begin(), end()); if (data_ && capacity_) allocator_.deallocate(data_, capacity_); size_ = capacity_ = 0; data_ = nullptr; }
|
||||
|
||||
template <typename _Iter>
|
||||
inline void assign_iter(_Iter first, _Iter last) { auto diff = std::distance(first, last); if (diff == 0) return; resize(diff); for (size_type index = 0; first != last; ++first, ++index) data_[index] = (*first); }
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,21 +21,25 @@
|
|||
#pragma once
|
||||
#include "IntrusivePtr.hpp"
|
||||
#include <Unknwnbase.h>
|
||||
#include <type_traits>
|
||||
|
||||
namespace easy2d
|
||||
{
|
||||
struct ComPtrManager
|
||||
{
|
||||
static inline void AddRef(IUnknown* ptr)
|
||||
{
|
||||
if (ptr) ptr->AddRef();
|
||||
}
|
||||
|
||||
static inline void Release(IUnknown* ptr)
|
||||
{
|
||||
if (ptr) ptr->Release();
|
||||
}
|
||||
};
|
||||
|
||||
// ComPtr<> is a smart pointer for COM
|
||||
template <typename _Ty>
|
||||
using ComPtr = IntrusivePtr<_Ty>;
|
||||
|
||||
inline void IntrusivePtrAddRef(IUnknown* ptr)
|
||||
{
|
||||
if (ptr) { ptr->AddRef(); }
|
||||
}
|
||||
|
||||
inline void IntrusivePtrRelease(IUnknown* ptr)
|
||||
{
|
||||
if (ptr) { ptr->Release(); }
|
||||
}
|
||||
using ComPtr = IntrusivePtr<_Ty, ComPtrManager, ::std::is_base_of<IUnknown, _Ty>::value>;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,16 +21,27 @@
|
|||
#pragma once
|
||||
#include "../macros.h"
|
||||
#include <utility>
|
||||
#include <type_traits>
|
||||
|
||||
namespace easy2d
|
||||
{
|
||||
template <typename T>
|
||||
class IntrusivePtr
|
||||
template <typename _Ty, typename _Manager, bool _Enable>
|
||||
class IntrusivePtr;
|
||||
|
||||
template <typename _Ty, typename _Manager>
|
||||
class IntrusivePtr<_Ty, _Manager, false>;
|
||||
|
||||
|
||||
template <typename _Ty, typename _Manager>
|
||||
using RealIntrusivePtr = IntrusivePtr<_Ty, _Manager, true>;
|
||||
|
||||
template <typename _Ty, typename _Manager>
|
||||
class IntrusivePtr<_Ty, _Manager, true>
|
||||
{
|
||||
T* ptr_{ nullptr };
|
||||
_Ty* ptr_{ nullptr };
|
||||
|
||||
public:
|
||||
using Type = T;
|
||||
using Type = _Ty;
|
||||
|
||||
IntrusivePtr() E2D_NOEXCEPT {}
|
||||
|
||||
|
|
@ -38,20 +49,20 @@ namespace easy2d
|
|||
|
||||
IntrusivePtr(Type* p) E2D_NOEXCEPT : ptr_(p)
|
||||
{
|
||||
IntrusivePtrAddRef(ptr_);
|
||||
typename _Manager::AddRef(ptr_);
|
||||
}
|
||||
|
||||
IntrusivePtr(const IntrusivePtr& other) E2D_NOEXCEPT
|
||||
: ptr_(other.ptr_)
|
||||
{
|
||||
IntrusivePtrAddRef(ptr_);
|
||||
typename _Manager::AddRef(ptr_);
|
||||
}
|
||||
|
||||
template <typename U>
|
||||
IntrusivePtr(const IntrusivePtr<U>& other) E2D_NOEXCEPT
|
||||
template <typename _UTy>
|
||||
IntrusivePtr(const RealIntrusivePtr<_UTy, _Manager>& other) E2D_NOEXCEPT
|
||||
: ptr_(other.Get())
|
||||
{
|
||||
IntrusivePtrAddRef(ptr_);
|
||||
typename _Manager::AddRef(ptr_);
|
||||
}
|
||||
|
||||
IntrusivePtr(IntrusivePtr&& other) E2D_NOEXCEPT
|
||||
|
|
@ -62,7 +73,7 @@ namespace easy2d
|
|||
|
||||
~IntrusivePtr() E2D_NOEXCEPT
|
||||
{
|
||||
IntrusivePtrRelease(ptr_);
|
||||
typename _Manager::Release(ptr_);
|
||||
}
|
||||
|
||||
inline Type* Get() const E2D_NOEXCEPT { return ptr_; }
|
||||
|
|
@ -108,7 +119,7 @@ namespace easy2d
|
|||
|
||||
inline IntrusivePtr& operator =(IntrusivePtr&& other) E2D_NOEXCEPT
|
||||
{
|
||||
IntrusivePtrRelease(ptr_);
|
||||
typename _Manager::Release(ptr_);
|
||||
ptr_ = other.ptr_;
|
||||
other.ptr_ = nullptr;
|
||||
return *this;
|
||||
|
|
@ -129,76 +140,76 @@ namespace easy2d
|
|||
}
|
||||
};
|
||||
|
||||
template<class T, class U>
|
||||
inline bool operator==(IntrusivePtr<T> const& lhs, IntrusivePtr<U> const& rhs) E2D_NOEXCEPT
|
||||
template <class _Ty, class _UTy, class _Manager>
|
||||
inline bool operator==(RealIntrusivePtr<_Ty, _Manager> const& lhs, RealIntrusivePtr<_UTy, _Manager> const& rhs) E2D_NOEXCEPT
|
||||
{
|
||||
return lhs.Get() == rhs.Get();
|
||||
}
|
||||
|
||||
template<class T, class U>
|
||||
inline bool operator!=(IntrusivePtr<T> const& lhs, IntrusivePtr<U> const& rhs) E2D_NOEXCEPT
|
||||
template <class _Ty, class _UTy, class _Manager>
|
||||
inline bool operator!=(RealIntrusivePtr<_Ty, _Manager> const& lhs, RealIntrusivePtr<_UTy, _Manager> const& rhs) E2D_NOEXCEPT
|
||||
{
|
||||
return lhs.Get() != rhs.Get();
|
||||
}
|
||||
|
||||
template<class T, class U>
|
||||
inline bool operator<(IntrusivePtr<T> const& lhs, IntrusivePtr<U> const& rhs) E2D_NOEXCEPT
|
||||
template <class _Ty, class _UTy, class _Manager>
|
||||
inline bool operator<(RealIntrusivePtr<_Ty, _Manager> const& lhs, RealIntrusivePtr<_UTy, _Manager> const& rhs) E2D_NOEXCEPT
|
||||
{
|
||||
return lhs.Get() < rhs.Get();
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline bool operator==(IntrusivePtr<T> const& lhs, T* rhs) E2D_NOEXCEPT
|
||||
template <class _Ty, class _Manager>
|
||||
inline bool operator==(RealIntrusivePtr<_Ty, _Manager> const& lhs, _Ty* rhs) E2D_NOEXCEPT
|
||||
{
|
||||
return lhs.Get() == rhs;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline bool operator!=(IntrusivePtr<T> const& lhs, T* rhs) E2D_NOEXCEPT
|
||||
template <class _Ty, class _Manager>
|
||||
inline bool operator!=(RealIntrusivePtr<_Ty, _Manager> const& lhs, _Ty* rhs) E2D_NOEXCEPT
|
||||
{
|
||||
return lhs.Get() != rhs;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline bool operator==(T* lhs, IntrusivePtr<T> const& rhs) E2D_NOEXCEPT
|
||||
template <class _Ty, class _Manager>
|
||||
inline bool operator==(_Ty* lhs, RealIntrusivePtr<_Ty, _Manager> const& rhs) E2D_NOEXCEPT
|
||||
{
|
||||
return lhs == rhs.Get();
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline bool operator!=(T* lhs, IntrusivePtr<T> const& rhs) E2D_NOEXCEPT
|
||||
template <class _Ty, class _Manager>
|
||||
inline bool operator!=(_Ty* lhs, RealIntrusivePtr<_Ty, _Manager> const& rhs) E2D_NOEXCEPT
|
||||
{
|
||||
return lhs != rhs.Get();
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline bool operator==(IntrusivePtr<T> const& lhs, nullptr_t) E2D_NOEXCEPT
|
||||
template <class _Ty, class _Manager>
|
||||
inline bool operator==(RealIntrusivePtr<_Ty, _Manager> const& lhs, nullptr_t) E2D_NOEXCEPT
|
||||
{
|
||||
return !static_cast<bool>(lhs);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline bool operator!=(IntrusivePtr<T> const& lhs, nullptr_t) E2D_NOEXCEPT
|
||||
template <class _Ty, class _Manager>
|
||||
inline bool operator!=(RealIntrusivePtr<_Ty, _Manager> const& lhs, nullptr_t) E2D_NOEXCEPT
|
||||
{
|
||||
return static_cast<bool>(lhs);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline bool operator==(nullptr_t, IntrusivePtr<T> const& rhs) E2D_NOEXCEPT
|
||||
template <class _Ty, class _Manager>
|
||||
inline bool operator==(nullptr_t, RealIntrusivePtr<_Ty, _Manager> const& rhs) E2D_NOEXCEPT
|
||||
{
|
||||
return !static_cast<bool>(rhs);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline bool operator!=(nullptr_t, IntrusivePtr<T> const& rhs) E2D_NOEXCEPT
|
||||
template <class _Ty, class _Manager>
|
||||
inline bool operator!=(nullptr_t, RealIntrusivePtr<_Ty, _Manager> const& rhs) E2D_NOEXCEPT
|
||||
{
|
||||
return static_cast<bool>(rhs);
|
||||
}
|
||||
|
||||
// template class cannot specialize std::swap,
|
||||
// so implement a swap function in easy2d namespace
|
||||
template<class T>
|
||||
inline void swap(IntrusivePtr<T>& lhs, IntrusivePtr<T>& rhs) E2D_NOEXCEPT
|
||||
template <class _Ty, class _Manager>
|
||||
inline void swap(RealIntrusivePtr<_Ty, _Manager>& lhs, RealIntrusivePtr<_Ty, _Manager>& rhs) E2D_NOEXCEPT
|
||||
{
|
||||
lhs.Swap(rhs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ namespace easy2d
|
|||
}
|
||||
|
||||
template<class _Traits>
|
||||
constexpr size_t TraitsFindLastOf(
|
||||
size_t TraitsFindLastOf(
|
||||
const typename _Traits::char_type* first, const size_t first_size, const size_t pos,
|
||||
const typename _Traits::char_type* second, const size_t count)
|
||||
{
|
||||
|
|
@ -233,8 +233,8 @@ namespace easy2d
|
|||
}
|
||||
|
||||
size_type new_size = size_ - count;
|
||||
iterator erase_at = begin() + offset;
|
||||
traits::move(erase_at, erase_at + count, new_size - offset + 1);
|
||||
iterator erase_at = begin().base() + offset;
|
||||
traits::move(erase_at.base(), erase_at.base() + count, new_size - offset + 1);
|
||||
return (*this);
|
||||
}
|
||||
|
||||
|
|
@ -344,7 +344,7 @@ namespace easy2d
|
|||
|
||||
wchar_t* const insert_at = new_ptr + index;
|
||||
traits::move(new_ptr, old_ptr, index); // (0) - (index)
|
||||
traits::move(insert_at, str.begin() + off, count); // (index) - (index + count)
|
||||
traits::move(insert_at, str.begin().base() + off, count); // (index) - (index + count)
|
||||
traits::move(insert_at + count, old_ptr + index, suffix_size); // (index + count) - (old_size - index)
|
||||
|
||||
deallocate(str_, old_capacity);
|
||||
|
|
@ -354,7 +354,7 @@ namespace easy2d
|
|||
{
|
||||
wchar_t* const insert_at = old_ptr + index;
|
||||
traits::move(insert_at + count, old_ptr + index, suffix_size);
|
||||
traits::move(insert_at, str.begin() + off, count);
|
||||
traits::move(insert_at, str.begin().base() + off, count);
|
||||
}
|
||||
|
||||
return (*this);
|
||||
|
|
@ -414,7 +414,7 @@ namespace easy2d
|
|||
wchar_t* new_str = allocate(new_cap);
|
||||
|
||||
traits::move(new_str, str_, size_);
|
||||
traits::move(new_str + size_, other.begin() + pos, count);
|
||||
traits::move(new_str + size_, other.begin().base() + pos, count);
|
||||
traits::assign(new_str[new_size], value_type());
|
||||
|
||||
destroy();
|
||||
|
|
@ -478,7 +478,7 @@ namespace easy2d
|
|||
if (offset >= size_)
|
||||
return String::npos;
|
||||
|
||||
const_iterator citer = traits::find(const_str_ + offset, size_, ch);
|
||||
const_iterator citer = traits::find(cbegin().base() + offset, size_, ch);
|
||||
return citer ? (citer - cbegin()) : String::npos;
|
||||
}
|
||||
|
||||
|
|
@ -494,7 +494,7 @@ namespace easy2d
|
|||
if (offset >= size_)
|
||||
return String::npos;
|
||||
|
||||
const_iterator citer = std::find_first_of(cbegin() + offset, cend(), str, str + count);
|
||||
const_iterator citer = std::find_first_of(cbegin().base() + offset, cend().base(), str, str + count);
|
||||
return (citer != cend()) ? (citer - cbegin()) : String::npos;
|
||||
}
|
||||
|
||||
|
|
@ -605,6 +605,18 @@ namespace easy2d
|
|||
return (*this);
|
||||
}
|
||||
|
||||
String::size_type String::copy(wchar_t * cstr, size_type count, size_type pos) const
|
||||
{
|
||||
if (count == 0 || cstr == const_str_)
|
||||
return 0;
|
||||
|
||||
check_offset(pos);
|
||||
|
||||
count = clamp_suffix_size(pos, count);
|
||||
traits::move(cstr, cbegin().base() + pos, count);
|
||||
return count;
|
||||
}
|
||||
|
||||
std::string String::to_string() const
|
||||
{
|
||||
return StringWideCharToMultiByte(str_);
|
||||
|
|
|
|||
|
|
@ -32,13 +32,62 @@ namespace easy2d
|
|||
//
|
||||
class E2D_API String
|
||||
{
|
||||
public:
|
||||
// Iterator
|
||||
template <typename _Ty>
|
||||
struct _Iterator
|
||||
{
|
||||
using iterator_category = typename std::iterator_traits<_Ty*>::iterator_category;
|
||||
using value_type = typename std::iterator_traits<_Ty*>::value_type;
|
||||
using difference_type = typename std::iterator_traits<_Ty*>::difference_type;
|
||||
using pointer = typename std::iterator_traits<_Ty*>::pointer;
|
||||
using reference = typename std::iterator_traits<_Ty*>::reference;
|
||||
|
||||
// disable warning 4996
|
||||
using _Unchecked_type = _Ty;
|
||||
|
||||
inline _Iterator(pointer base = nullptr) : base_(base) {}
|
||||
|
||||
inline _Iterator& operator++() { ++base_; return (*this); }
|
||||
inline _Iterator operator++(int) { _Iterator old = (*this); ++(*this); return old; }
|
||||
|
||||
inline _Iterator& operator--() { --base_; return (*this); }
|
||||
inline _Iterator operator--(int) { _Iterator old = (*this); --(*this); return old; }
|
||||
|
||||
inline const _Iterator operator+(difference_type off) const { return _Iterator(base_ + off); }
|
||||
inline const _Iterator operator-(difference_type off) const { return _Iterator(base_ - off); }
|
||||
|
||||
inline _Iterator& operator+=(difference_type off) { base_ += off; return (*this); }
|
||||
inline _Iterator& operator-=(difference_type off) { base_ -= off; return (*this); }
|
||||
|
||||
inline difference_type operator-(_Iterator const& other) const { return base_ - other.base_; }
|
||||
|
||||
inline bool operator==(_Iterator const& other) const { return base_ == other.base_; }
|
||||
inline bool operator!=(_Iterator const& other) const { return !(*this == other); }
|
||||
|
||||
inline bool operator<(_Iterator const& other) const { return base_ < other.base_; }
|
||||
inline bool operator<=(_Iterator const& other) const { return base_ <= other.base_; }
|
||||
inline bool operator>(_Iterator const& other) const { return base_ > other.base_; }
|
||||
inline bool operator>=(_Iterator const& other) const { return base_ >= other.base_; }
|
||||
|
||||
inline reference operator[](difference_type off) const { return *(base_ + off); }
|
||||
|
||||
inline operator bool() const { return base_ != nullptr; }
|
||||
|
||||
inline reference operator*() const { return *base_; }
|
||||
inline pointer base() const { return base_; }
|
||||
|
||||
private:
|
||||
pointer base_{ nullptr };
|
||||
};
|
||||
|
||||
public:
|
||||
using value_type = wchar_t;
|
||||
using size_type = size_t;
|
||||
using iterator = value_type * ;
|
||||
using const_iterator = const value_type*;
|
||||
using reference = value_type & ;
|
||||
using reference = value_type &;
|
||||
using const_reference = const value_type &;
|
||||
using iterator = _Iterator<value_type>;
|
||||
using const_iterator = _Iterator<const value_type>;
|
||||
using reverse_iterator = std::reverse_iterator<iterator>;
|
||||
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
||||
using traits = std::char_traits<value_type>;
|
||||
|
|
@ -67,7 +116,7 @@ namespace easy2d
|
|||
inline void clear() { discard_const_data(); if (str_) { str_[0] = value_type(); } size_ = 0; }
|
||||
|
||||
void reserve(const size_type new_cap = 0);
|
||||
inline void resize(const size_type new_size, const wchar_t ch = value_type()) { check_operability(); if (new_size < size_) str_[size_ = new_size] = value_type(); else append(new_size - size_, ch); }
|
||||
inline void resize(const size_type new_size, const wchar_t ch = value_type()) { check_operability(); if (new_size < size_) str_[size_ = new_size] = value_type(); else append(new_size - size_, ch); }
|
||||
|
||||
int compare(const wchar_t* const str) const;
|
||||
inline int compare(String const& str) const { return compare(str.c_str()); }
|
||||
|
|
@ -105,32 +154,32 @@ namespace easy2d
|
|||
|
||||
String& assign(size_type count, const wchar_t ch);
|
||||
String& assign(const wchar_t* cstr, size_type count);
|
||||
inline String& assign(const wchar_t* cstr, bool const_str = true) { String(cstr, const_str).swap(*this); return *this; }
|
||||
inline String& assign(std::wstring const& str) { String{ str }.swap(*this); return *this; }
|
||||
inline String& assign(String const& rhs) { String{ rhs }.swap(*this); return *this; }
|
||||
inline String& assign(String const& rhs, size_type pos, size_type count = npos) { String(rhs, pos, count).swap(*this); return *this; }
|
||||
inline String& assign(const wchar_t* cstr, bool const_str = true) { String(cstr, const_str).swap(*this); return *this; }
|
||||
inline String& assign(std::wstring const& str) { String{ str }.swap(*this); return *this; }
|
||||
inline String& assign(String const& rhs) { String{ rhs }.swap(*this); return *this; }
|
||||
inline String& assign(String const& rhs, size_type pos, size_type count = npos) { String(rhs, pos, count).swap(*this); return *this; }
|
||||
|
||||
template <typename _Iter>
|
||||
inline String& assign(_Iter first, _Iter last) { assign_iter(first, last); return(*this); }
|
||||
inline String& assign(_Iter first, _Iter last) { assign_iter(first, last); return(*this); }
|
||||
|
||||
String& erase(size_type offset = 0, size_type count = npos);
|
||||
iterator erase(const const_iterator where) { size_type off = where - cbegin(); erase(off, 1); return begin() + off; }
|
||||
iterator erase(const const_iterator first, const const_iterator last) { size_type off = first - cbegin(); erase(first - cbegin(), last - first); return begin() + off; }
|
||||
iterator erase(const const_iterator where) { size_type off = where - cbegin(); erase(off, 1); return begin().base() + off; }
|
||||
iterator erase(const const_iterator first, const const_iterator last) { size_type off = first - cbegin(); erase(first - cbegin(), last - first); return begin().base() + off; }
|
||||
|
||||
String substr(size_type pos = 0, size_type count = npos) const { return String(*this, pos, count); }
|
||||
String substr(size_type pos = 0, size_type count = npos) const { return String(*this, pos, count); }
|
||||
|
||||
String& insert(size_type index, size_type count, wchar_t ch);
|
||||
String& insert(size_type index, const wchar_t* s, size_type count);
|
||||
String& insert(size_type index, const String& str, size_type off, size_type count = npos);
|
||||
inline String& insert(size_type index, const wchar_t* s) { return insert(index, s, traits::length(s)); }
|
||||
inline String& insert(size_type index, const String& str) { return insert(index, str, 0, str.size()); }
|
||||
inline iterator insert(const_iterator pos, size_type count, wchar_t ch) { size_type off = pos - cbegin(); insert(off, count, ch); return begin() + off; }
|
||||
inline iterator insert(const_iterator pos, wchar_t ch) { return insert(pos, 1, ch); }
|
||||
inline String& insert(size_type index, const wchar_t* s) { return insert(index, s, traits::length(s)); }
|
||||
inline String& insert(size_type index, const String& str) { return insert(index, str, 0, str.size()); }
|
||||
inline iterator insert(const_iterator pos, size_type count, wchar_t ch) { size_type off = pos - cbegin(); insert(off, count, ch); return begin().base() + off; }
|
||||
inline iterator insert(const_iterator pos, wchar_t ch) { return insert(pos, 1, ch); }
|
||||
|
||||
inline void push_back(const wchar_t ch) { append(1, ch); }
|
||||
inline wchar_t pop_back() { if (empty()) throw std::out_of_range("pop_back() called on empty string"); check_operability(); wchar_t ch = str_[--size_]; str_[size_] = value_type(); return ch; }
|
||||
inline void push_back(const wchar_t ch) { append(1, ch); }
|
||||
inline wchar_t pop_back() { if (empty()) throw std::out_of_range("pop_back() called on empty string"); check_operability(); wchar_t ch = str_[--size_]; str_[size_] = value_type(); return ch; }
|
||||
|
||||
inline size_type copy(wchar_t* cstr, size_type count, size_type pos = 0) const { check_offset(pos); if (count == 0 || cstr == const_str_) return 0; count = clamp_suffix_size(pos, count); traits::move(cstr, cbegin() + pos, count); return count; }
|
||||
size_type copy(wchar_t* cstr, size_type count, size_type pos = 0) const;
|
||||
|
||||
std::string to_string() const;
|
||||
std::wstring to_wstring() const;
|
||||
|
|
@ -140,26 +189,26 @@ namespace easy2d
|
|||
size_t hash() const;
|
||||
|
||||
public:
|
||||
inline iterator begin() { check_operability(); return iterator(str_); }
|
||||
inline const_iterator begin() const { return const_iterator(const_str_); }
|
||||
inline const_iterator cbegin() const { return begin(); }
|
||||
inline iterator end() { check_operability(); return iterator(str_ + size_); }
|
||||
inline const_iterator end() const { return const_iterator(const_str_ + size_); }
|
||||
inline const_iterator cend() const { return end(); }
|
||||
inline reverse_iterator rbegin() { check_operability(); return reverse_iterator(end()); }
|
||||
inline const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
|
||||
inline const_reverse_iterator crbegin() const { return rbegin(); }
|
||||
inline reverse_iterator rend() { check_operability(); return reverse_iterator(begin()); }
|
||||
inline const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
|
||||
inline const_reverse_iterator crend() const { return rend(); }
|
||||
inline reference front() { if (empty()) throw std::out_of_range("front() called on empty string"); check_operability(); return str_[0]; }
|
||||
inline const_reference front() const { if (empty()) throw std::out_of_range("front() called on empty string"); return const_str_[0]; }
|
||||
inline reference back() { if (empty()) throw std::out_of_range("back() called on empty string"); check_operability(); return str_[size_ - 1]; }
|
||||
inline const_reference back() const { if (empty()) throw std::out_of_range("back() called on empty string"); return const_str_[size_ - 1]; }
|
||||
inline iterator begin() { check_operability(); return iterator(str_); }
|
||||
inline const_iterator begin() const { return const_iterator(const_str_); }
|
||||
inline const_iterator cbegin() const { return begin(); }
|
||||
inline iterator end() { check_operability(); return iterator(str_ + size_); }
|
||||
inline const_iterator end() const { return const_iterator(const_str_ + size_); }
|
||||
inline const_iterator cend() const { return end(); }
|
||||
inline reverse_iterator rbegin() { check_operability(); return reverse_iterator(end()); }
|
||||
inline const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
|
||||
inline const_reverse_iterator crbegin() const { return rbegin(); }
|
||||
inline reverse_iterator rend() { check_operability(); return reverse_iterator(begin()); }
|
||||
inline const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
|
||||
inline const_reverse_iterator crend() const { return rend(); }
|
||||
inline reference front() { if (empty()) throw std::out_of_range("front() called on empty string"); check_operability(); return str_[0]; }
|
||||
inline const_reference front() const { if (empty()) throw std::out_of_range("front() called on empty string"); return const_str_[0]; }
|
||||
inline reference back() { if (empty()) throw std::out_of_range("back() called on empty string"); check_operability(); return str_[size_ - 1]; }
|
||||
inline const_reference back() const { if (empty()) throw std::out_of_range("back() called on empty string"); return const_str_[size_ - 1]; }
|
||||
|
||||
public:
|
||||
inline wchar_t operator[](size_type off) const { if(off >= size_) throw std::out_of_range("string subscript out of range"); return const_str_[off]; }
|
||||
inline wchar_t& operator[](size_type off) { if (off >= size_) throw std::out_of_range("string subscript out of range"); check_operability(); return str_[off]; }
|
||||
inline wchar_t operator[](size_type off) const { if(off >= size_) throw std::out_of_range("string subscript out of range"); return const_str_[off]; }
|
||||
inline wchar_t& operator[](size_type off) { if (off >= size_) throw std::out_of_range("string subscript out of range"); check_operability(); return str_[off]; }
|
||||
|
||||
public:
|
||||
inline const String operator+(const wchar_t ch) const { return String{ *this }.append(1, ch); }
|
||||
|
|
@ -308,7 +357,7 @@ namespace easy2d
|
|||
{
|
||||
using Ctype = std::ctype<wchar_t>;
|
||||
using IStream = std::basic_istream<wchar_t, String::traits>;
|
||||
using SizeType = typename String::size_type;
|
||||
using SizeType = String::size_type;
|
||||
|
||||
std::ios_base::iostate state = std::ios_base::goodbit;
|
||||
bool changed = false;
|
||||
|
|
@ -429,7 +478,7 @@ namespace easy2d
|
|||
template<typename _Ty>
|
||||
inline String FloatingToString(const wchar_t *fmt, _Ty val)
|
||||
{
|
||||
static_assert(std::is_floating_point_v<_Ty>, "_Ty must be floating point");
|
||||
static_assert(std::is_floating_point<_Ty>::value, "_Ty must be floating point");
|
||||
|
||||
return format_wstring(fmt, val);
|
||||
}
|
||||
|
|
@ -437,7 +486,7 @@ namespace easy2d
|
|||
template <typename _Ty>
|
||||
inline String IntegralToString(const _Ty val)
|
||||
{
|
||||
static_assert(std::is_integral_v<_Ty>, "_Ty must be integral");
|
||||
static_assert(std::is_integral<_Ty>::value, "_Ty must be integral");
|
||||
|
||||
using _UTy = std::make_unsigned_t<_Ty>;
|
||||
using _Elem = String::traits::char_type;
|
||||
|
|
|
|||
|
|
@ -144,41 +144,4 @@ namespace easy2d
|
|||
return group;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------
|
||||
// ActionSequence
|
||||
//-------------------------------------------------------
|
||||
|
||||
ActionSequence::ActionSequence()
|
||||
: ActionGroup()
|
||||
{
|
||||
}
|
||||
|
||||
ActionSequence::ActionSequence(Array<ActionPtr> const & actions)
|
||||
: ActionGroup(actions, true)
|
||||
{
|
||||
}
|
||||
|
||||
ActionSequence::~ActionSequence()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------
|
||||
// ActionSpawn
|
||||
//-------------------------------------------------------
|
||||
|
||||
ActionSpawn::ActionSpawn()
|
||||
: ActionGroup()
|
||||
{
|
||||
sequence_ = false;
|
||||
}
|
||||
|
||||
ActionSpawn::ActionSpawn(Array<ActionPtr> const & actions)
|
||||
: ActionGroup(actions, false)
|
||||
{
|
||||
}
|
||||
|
||||
ActionSpawn::~ActionSpawn()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -73,33 +73,31 @@ namespace easy2d
|
|||
|
||||
|
||||
// 顺序动作
|
||||
class E2D_DEPRECATED("ActionSequence is deprecated, use ActionGroup instead") E2D_API
|
||||
ActionSequence
|
||||
class E2D_API ActionSequence
|
||||
: public ActionGroup
|
||||
{
|
||||
public:
|
||||
ActionSequence();
|
||||
E2D_DEPRECATED("ActionSequence is deprecated, use ActionGroup instead")
|
||||
inline ActionSequence() : ActionGroup() {}
|
||||
|
||||
explicit ActionSequence(
|
||||
Array<ActionPtr> const& actions
|
||||
);
|
||||
E2D_DEPRECATED("ActionSequence is deprecated, use ActionGroup instead")
|
||||
inline explicit ActionSequence(Array<ActionPtr> const& actions) : ActionGroup(actions, true) {}
|
||||
|
||||
virtual ~ActionSequence();
|
||||
virtual ~ActionSequence() {}
|
||||
};
|
||||
|
||||
|
||||
// 同步动作
|
||||
class E2D_DEPRECATED("ActionSpawn is deprecated, use ActionGroup instead") E2D_API
|
||||
ActionSpawn
|
||||
class E2D_API ActionSpawn
|
||||
: public ActionGroup
|
||||
{
|
||||
public:
|
||||
ActionSpawn();
|
||||
E2D_DEPRECATED("ActionSpawn is deprecated, use ActionGroup instead")
|
||||
inline ActionSpawn() : ActionGroup() { sequence_ = false; }
|
||||
|
||||
explicit ActionSpawn(
|
||||
Array<ActionPtr> const& actions
|
||||
);
|
||||
E2D_DEPRECATED("ActionSpawn is deprecated, use ActionGroup instead")
|
||||
inline explicit ActionSpawn(Array<ActionPtr> const& actions) : ActionGroup(actions, false) {}
|
||||
|
||||
virtual ~ActionSpawn();
|
||||
virtual ~ActionSpawn() {}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,14 +49,4 @@ namespace easy2d
|
|||
protected:
|
||||
long ref_count_;
|
||||
};
|
||||
|
||||
inline void IntrusivePtrAddRef(RefCounter* ptr)
|
||||
{
|
||||
if (ptr) ptr->Retain();
|
||||
}
|
||||
|
||||
inline void IntrusivePtrRelease(RefCounter* ptr)
|
||||
{
|
||||
if (ptr) ptr->Release();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,18 +29,10 @@
|
|||
#include <unordered_set>
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
#ifndef E2D_DECLARE_SMART_PTR
|
||||
#define E2D_DECLARE_SMART_PTR(class_name)\
|
||||
class class_name;\
|
||||
using class_name##Ptr = ::easy2d::IntrusivePtr< class_name >
|
||||
|
||||
#define E2D_DECLARE_NS_SMART_PTR(ns_name, class_name)\
|
||||
namespace ns_name\
|
||||
{\
|
||||
class class_name; \
|
||||
using class_name##Ptr = ::easy2d::IntrusivePtr< class_name >;\
|
||||
}
|
||||
#define E2D_DECLARE_SMART_PTR(CLASS)\
|
||||
class CLASS;\
|
||||
using CLASS##Ptr = ::easy2d::SmartPtr< CLASS >
|
||||
#endif
|
||||
|
||||
namespace easy2d
|
||||
|
|
@ -68,6 +60,23 @@ namespace easy2d
|
|||
|
||||
namespace easy2d
|
||||
{
|
||||
struct DefaultIntrusivePtrManager
|
||||
{
|
||||
static inline void AddRef(RefCounter* ptr)
|
||||
{
|
||||
if (ptr) ptr->Retain();
|
||||
}
|
||||
|
||||
static inline void Release(RefCounter* ptr)
|
||||
{
|
||||
if (ptr) ptr->Release();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename _Ty>
|
||||
using SmartPtr = IntrusivePtr<_Ty, DefaultIntrusivePtrManager, true>;
|
||||
|
||||
|
||||
E2D_DECLARE_SMART_PTR(Object);
|
||||
E2D_DECLARE_SMART_PTR(Image);
|
||||
E2D_DECLARE_SMART_PTR(Task);
|
||||
|
|
@ -119,26 +128,3 @@ namespace easy2d
|
|||
E2D_DECLARE_SMART_PTR(Button);
|
||||
E2D_DECLARE_SMART_PTR(Menu);
|
||||
}
|
||||
|
||||
namespace easy2d
|
||||
{
|
||||
class __SmartPointerMaker
|
||||
{
|
||||
public:
|
||||
static inline __SmartPointerMaker const& Instance()
|
||||
{
|
||||
static __SmartPointerMaker maker;
|
||||
return maker;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline IntrusivePtr<T> operator- (T* ptr) const
|
||||
{
|
||||
return IntrusivePtr<T>(ptr);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#ifndef E_NEW
|
||||
# define E_NEW (::easy2d::__SmartPointerMaker::Instance()) - new (std::nothrow)
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -241,7 +241,14 @@ namespace easy2d
|
|||
swap_chain_desc.SampleDesc.Count = 1;
|
||||
swap_chain_desc.SampleDesc.Quality = 0;
|
||||
swap_chain_desc.Windowed = TRUE;
|
||||
|
||||
#if defined(_WIN32_WINNT_WIN10)
|
||||
swap_chain_desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;
|
||||
#elif defined(_WIN32_WINNT_WINBLUE)
|
||||
swap_chain_desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
|
||||
#else
|
||||
swap_chain_desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
|
||||
#endif
|
||||
|
||||
ComPtr<IDXGIDevice> dxgi_device;
|
||||
if (SUCCEEDED(hr))
|
||||
|
|
|
|||
|
|
@ -87,15 +87,6 @@
|
|||
#include "math/Matrix.hpp"
|
||||
|
||||
|
||||
//
|
||||
// audio
|
||||
//
|
||||
|
||||
#include "audio/audio.h"
|
||||
#include "audio/Music.h"
|
||||
#include "audio/Player.h"
|
||||
|
||||
|
||||
//
|
||||
// utils
|
||||
//
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ namespace easy2d
|
|||
|
||||
bool File::Exists() const
|
||||
{
|
||||
return modules::Shlwapi::Get().PathFileExistsW(file_path_.c_str());
|
||||
return !!modules::Shlwapi::Get().PathFileExistsW(file_path_.c_str());
|
||||
}
|
||||
|
||||
String const& File::GetPath() const
|
||||
|
|
@ -96,7 +96,6 @@ namespace easy2d
|
|||
DWORD buffer_size;
|
||||
if (res.Load(buffer, buffer_size))
|
||||
{
|
||||
// 写入文件
|
||||
DWORD written_bytes = 0;
|
||||
::WriteFile(file_handle, buffer, buffer_size, &written_bytes, NULL);
|
||||
::CloseHandle(file_handle);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
#include "../core/modules.h"
|
||||
#include "../core/Image.h"
|
||||
#include "../core/Frames.h"
|
||||
#include "../audio/Music.h"
|
||||
|
||||
namespace easy2d
|
||||
{
|
||||
|
|
@ -192,30 +191,6 @@ namespace easy2d
|
|||
return false;
|
||||
}
|
||||
|
||||
bool ResLoader::AddMusic(String const & id, Resource const & music)
|
||||
{
|
||||
MusicPtr ptr = new (std::nothrow) Music;
|
||||
if (ptr)
|
||||
{
|
||||
if (ptr->Load(LocateRes(music, search_paths_)))
|
||||
{
|
||||
res_.insert(std::make_pair(id, ptr));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ResLoader::AddMusic(String const & id, MusicPtr const & music)
|
||||
{
|
||||
if (music)
|
||||
{
|
||||
res_.insert(std::make_pair(id, music));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ResLoader::AddObj(String const& id, ObjectPtr const& obj)
|
||||
{
|
||||
if (obj)
|
||||
|
|
@ -228,22 +203,17 @@ namespace easy2d
|
|||
|
||||
ImagePtr ResLoader::GetImage(String const & id) const
|
||||
{
|
||||
return Get<Image*>(id);
|
||||
return Get<Image>(id);
|
||||
}
|
||||
|
||||
FramesPtr ResLoader::GetFrames(String const & id) const
|
||||
{
|
||||
return Get<Frames*>(id);
|
||||
}
|
||||
|
||||
MusicPtr ResLoader::GetMusic(String const & id) const
|
||||
{
|
||||
return Get<Music*>(id);
|
||||
return Get<Frames>(id);
|
||||
}
|
||||
|
||||
ObjectPtr ResLoader::GetObj(String const & id) const
|
||||
{
|
||||
return Get<Object*>(id);
|
||||
return Get<Object>(id);
|
||||
}
|
||||
|
||||
void ResLoader::Delete(String const & id)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
#pragma once
|
||||
#include "../core/include-forwards.h"
|
||||
#include "../core/Resource.h"
|
||||
#include "../audio/Music.h"
|
||||
|
||||
namespace easy2d
|
||||
{
|
||||
|
|
@ -51,12 +50,6 @@ namespace easy2d
|
|||
// 添加帧集合
|
||||
bool AddFrames(String const& id, FramesPtr const& frames);
|
||||
|
||||
// 警속稜있
|
||||
bool AddMusic(String const& id, Resource const& music);
|
||||
|
||||
// 警속稜있
|
||||
bool AddMusic(String const& id, MusicPtr const& music);
|
||||
|
||||
// 添加对象
|
||||
bool AddObj(String const& id, ObjectPtr const& obj);
|
||||
|
||||
|
|
@ -64,8 +57,6 @@ namespace easy2d
|
|||
|
||||
FramesPtr GetFrames(String const& id) const;
|
||||
|
||||
MusicPtr GetMusic(String const& id) const;
|
||||
|
||||
ObjectPtr GetObj(String const& id) const;
|
||||
|
||||
// 删除指定资源
|
||||
|
|
@ -79,13 +70,13 @@ namespace easy2d
|
|||
String const& path
|
||||
);
|
||||
|
||||
template<typename T>
|
||||
auto Get(String const& id) const -> decltype(auto)
|
||||
template<typename _Ty>
|
||||
_Ty* Get(String const& id) const
|
||||
{
|
||||
auto iter = res_.find(id);
|
||||
if (iter == res_.end())
|
||||
return T{};
|
||||
return dynamic_cast<T>((*iter).second.Get());
|
||||
return nullptr;
|
||||
return dynamic_cast<_Ty*>((*iter).second.Get());
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
|||
Loading…
Reference in New Issue