mirror of https://github.com/axmolengine/axmol.git
issues #2905:add new vs project
This commit is contained in:
parent
f11dba586a
commit
232f0d598b
|
@ -0,0 +1,142 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}</ProjectGuid>
|
||||
<RootNamespace>libCocosBuilder</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<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" />
|
||||
<Import Project="..\..\..\2d\cocos2d_headers.props" />
|
||||
</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" />
|
||||
<Import Project="..\..\..\2d\cocos2d_headers.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>
|
||||
</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)extensions;$(EngineRoot)cocos\audio\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>
|
||||
</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)extensions;$(EngineRoot)cocos\audio\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\CCBAnimationManager.cpp" />
|
||||
<ClCompile Include="..\CCBFileLoader.cpp" />
|
||||
<ClCompile Include="..\CCBKeyframe.cpp" />
|
||||
<ClCompile Include="..\CCBReader.cpp" />
|
||||
<ClCompile Include="..\CCBSequence.cpp" />
|
||||
<ClCompile Include="..\CCBSequenceProperty.cpp" />
|
||||
<ClCompile Include="..\CCBValue.cpp" />
|
||||
<ClCompile Include="..\CCControlButtonLoader.cpp" />
|
||||
<ClCompile Include="..\CCControlLoader.cpp" />
|
||||
<ClCompile Include="..\CCLabelBMFontLoader.cpp" />
|
||||
<ClCompile Include="..\CCLabelTTFLoader.cpp" />
|
||||
<ClCompile Include="..\CCLayerColorLoader.cpp" />
|
||||
<ClCompile Include="..\CCLayerGradientLoader.cpp" />
|
||||
<ClCompile Include="..\CCLayerLoader.cpp" />
|
||||
<ClCompile Include="..\CCMenuItemImageLoader.cpp" />
|
||||
<ClCompile Include="..\CCMenuItemLoader.cpp" />
|
||||
<ClCompile Include="..\CCNode+CCBRelativePositioning.cpp" />
|
||||
<ClCompile Include="..\CCNodeLoader.cpp" />
|
||||
<ClCompile Include="..\CCNodeLoaderLibrary.cpp" />
|
||||
<ClCompile Include="..\CCParticleSystemQuadLoader.cpp" />
|
||||
<ClCompile Include="..\CCScale9SpriteLoader.cpp" />
|
||||
<ClCompile Include="..\CCScrollViewLoader.cpp" />
|
||||
<ClCompile Include="..\CCSpriteLoader.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\CCBAnimationManager.h" />
|
||||
<ClInclude Include="..\CCBFileLoader.h" />
|
||||
<ClInclude Include="..\CCBKeyframe.h" />
|
||||
<ClInclude Include="..\CCBMemberVariableAssigner.h" />
|
||||
<ClInclude Include="..\CCBReader.h" />
|
||||
<ClInclude Include="..\CCBSelectorResolver.h" />
|
||||
<ClInclude Include="..\CCBSequence.h" />
|
||||
<ClInclude Include="..\CCBSequenceProperty.h" />
|
||||
<ClInclude Include="..\CCBValue.h" />
|
||||
<ClInclude Include="..\CCControlButtonLoader.h" />
|
||||
<ClInclude Include="..\CCControlLoader.h" />
|
||||
<ClInclude Include="..\CCLabelBMFontLoader.h" />
|
||||
<ClInclude Include="..\CCLabelTTFLoader.h" />
|
||||
<ClInclude Include="..\CCLayerColorLoader.h" />
|
||||
<ClInclude Include="..\CCLayerGradientLoader.h" />
|
||||
<ClInclude Include="..\CCLayerLoader.h" />
|
||||
<ClInclude Include="..\CCMenuItemImageLoader.h" />
|
||||
<ClInclude Include="..\CCMenuItemLoader.h" />
|
||||
<ClInclude Include="..\CCMenuLoader.h" />
|
||||
<ClInclude Include="..\CCNode+CCBRelativePositioning.h" />
|
||||
<ClInclude Include="..\CCNodeLoader.h" />
|
||||
<ClInclude Include="..\CCNodeLoaderLibrary.h" />
|
||||
<ClInclude Include="..\CCNodeLoaderListener.h" />
|
||||
<ClInclude Include="..\CCParticleSystemQuadLoader.h" />
|
||||
<ClInclude Include="..\CCScale9SpriteLoader.h" />
|
||||
<ClInclude Include="..\CCScrollViewLoader.h" />
|
||||
<ClInclude Include="..\CCSpriteLoader.h" />
|
||||
<ClInclude Include="..\CocosBuilder.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,170 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\CCBSequenceProperty.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCBValue.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCControlButtonLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCControlLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCLabelBMFontLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCLabelTTFLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCLayerColorLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCLayerGradientLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCLayerLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCMenuItemImageLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCMenuItemLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCNode+CCBRelativePositioning.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCNodeLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCNodeLoaderLibrary.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCParticleSystemQuadLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCScale9SpriteLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCScrollViewLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCSpriteLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCBAnimationManager.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCBFileLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCBKeyframe.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCBReader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCBSequence.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\CCParticleSystemQuadLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCScale9SpriteLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCScrollViewLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCSpriteLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CocosBuilder.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCBAnimationManager.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCBFileLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCBKeyframe.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCBMemberVariableAssigner.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCBReader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCBSelectorResolver.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCBSequence.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCBSequenceProperty.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCBValue.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCControlButtonLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCControlLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCLabelBMFontLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCLabelTTFLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCLayerColorLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCLayerGradientLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCLayerLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCMenuItemImageLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCMenuItemLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCMenuLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCNode+CCBRelativePositioning.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCNodeLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCNodeLoaderLibrary.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCNodeLoaderListener.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
|
@ -0,0 +1,174 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\..\external\json\json_reader.cpp" />
|
||||
<ClCompile Include="..\..\..\..\external\json\json_value.cpp" />
|
||||
<ClCompile Include="..\..\..\..\external\json\json_writer.cpp" />
|
||||
<ClCompile Include="..\CCActionFrame.cpp" />
|
||||
<ClCompile Include="..\CCActionFrameEasing.cpp" />
|
||||
<ClCompile Include="..\CCActionManagerEx.cpp" />
|
||||
<ClCompile Include="..\CCActionNode.cpp" />
|
||||
<ClCompile Include="..\CCActionObject.cpp" />
|
||||
<ClCompile Include="..\CCArmature.cpp" />
|
||||
<ClCompile Include="..\CCArmatureAnimation.cpp" />
|
||||
<ClCompile Include="..\CCArmatureDataManager.cpp" />
|
||||
<ClCompile Include="..\CCArmatureDefine.cpp" />
|
||||
<ClCompile Include="..\CCBatchNode.cpp" />
|
||||
<ClCompile Include="..\CCBone.cpp" />
|
||||
<ClCompile Include="..\CCColliderDetector.cpp" />
|
||||
<ClCompile Include="..\CCComAttribute.cpp" />
|
||||
<ClCompile Include="..\CCComAudio.cpp" />
|
||||
<ClCompile Include="..\CCComController.cpp" />
|
||||
<ClCompile Include="..\CCComRender.cpp" />
|
||||
<ClCompile Include="..\CCDataReaderHelper.cpp" />
|
||||
<ClCompile Include="..\CCDatas.cpp" />
|
||||
<ClCompile Include="..\CCDecorativeDisplay.cpp" />
|
||||
<ClCompile Include="..\CCDisplayFactory.cpp" />
|
||||
<ClCompile Include="..\CCDisplayManager.cpp" />
|
||||
<ClCompile Include="..\CCInputDelegate.cpp" />
|
||||
<ClCompile Include="..\CCProcessBase.cpp" />
|
||||
<ClCompile Include="..\CCSGUIReader.cpp" />
|
||||
<ClCompile Include="..\CCSkin.cpp" />
|
||||
<ClCompile Include="..\CCSpriteFrameCacheHelper.cpp" />
|
||||
<ClCompile Include="..\CCSSceneReader.cpp" />
|
||||
<ClCompile Include="..\CCTransformHelp.cpp" />
|
||||
<ClCompile Include="..\CCTween.cpp" />
|
||||
<ClCompile Include="..\CCTweenFunction.cpp" />
|
||||
<ClCompile Include="..\CCUtilMath.cpp" />
|
||||
<ClCompile Include="..\CSContentJsonDictionary.cpp" />
|
||||
<ClCompile Include="..\DictionaryHelper.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\..\external\json\autolink.h" />
|
||||
<ClInclude Include="..\..\..\..\external\json\config.h" />
|
||||
<ClInclude Include="..\..\..\..\external\json\features.h" />
|
||||
<ClInclude Include="..\..\..\..\external\json\forwards.h" />
|
||||
<ClInclude Include="..\..\..\..\external\json\json.h" />
|
||||
<ClInclude Include="..\..\..\..\external\json\json_batchallocator.h" />
|
||||
<ClInclude Include="..\..\..\..\external\json\reader.h" />
|
||||
<ClInclude Include="..\..\..\..\external\json\value.h" />
|
||||
<ClInclude Include="..\..\..\..\external\json\writer.h" />
|
||||
<ClInclude Include="..\CCActionFrame.h" />
|
||||
<ClInclude Include="..\CCActionFrameEasing.h" />
|
||||
<ClInclude Include="..\CCActionManagerEx.h" />
|
||||
<ClInclude Include="..\CCActionNode.h" />
|
||||
<ClInclude Include="..\CCActionObject.h" />
|
||||
<ClInclude Include="..\CCArmature.h" />
|
||||
<ClInclude Include="..\CCArmatureAnimation.h" />
|
||||
<ClInclude Include="..\CCArmatureDataManager.h" />
|
||||
<ClInclude Include="..\CCArmatureDefine.h" />
|
||||
<ClInclude Include="..\CCBatchNode.h" />
|
||||
<ClInclude Include="..\CCBone.h" />
|
||||
<ClInclude Include="..\CCColliderDetector.h" />
|
||||
<ClInclude Include="..\CCComAttribute.h" />
|
||||
<ClInclude Include="..\CCComAudio.h" />
|
||||
<ClInclude Include="..\CCComController.h" />
|
||||
<ClInclude Include="..\CCComRender.h" />
|
||||
<ClInclude Include="..\CCDataReaderHelper.h" />
|
||||
<ClInclude Include="..\CCDatas.h" />
|
||||
<ClInclude Include="..\CCDecorativeDisplay.h" />
|
||||
<ClInclude Include="..\CCDisplayFactory.h" />
|
||||
<ClInclude Include="..\CCDisplayManager.h" />
|
||||
<ClInclude Include="..\CCInputDelegate.h" />
|
||||
<ClInclude Include="..\CCProcessBase.h" />
|
||||
<ClInclude Include="..\CCSGUIReader.h" />
|
||||
<ClInclude Include="..\CCSkin.h" />
|
||||
<ClInclude Include="..\CCSpriteFrameCacheHelper.h" />
|
||||
<ClInclude Include="..\CCSSceneReader.h" />
|
||||
<ClInclude Include="..\CCTransformHelp.h" />
|
||||
<ClInclude Include="..\CCTween.h" />
|
||||
<ClInclude Include="..\CCTweenFunction.h" />
|
||||
<ClInclude Include="..\CCUtilMath.h" />
|
||||
<ClInclude Include="..\CSContentJsonDictionary.h" />
|
||||
<ClInclude Include="..\DictionaryHelper.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\..\external\json\json_internalarray.inl" />
|
||||
<None Include="..\..\..\..\external\json\json_internalmap.inl" />
|
||||
<None Include="..\..\..\..\external\json\json_valueiterator.inl" />
|
||||
<None Include="..\..\..\..\external\json\sconscript" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{B57CF53F-2E49-4031-9822-047CC0E6BDE2}</ProjectGuid>
|
||||
<RootNamespace>libCocosStudio</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<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" />
|
||||
<Import Project="..\..\..\2d\cocos2d_headers.props" />
|
||||
</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" />
|
||||
<Import Project="..\..\..\2d\cocos2d_headers.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>
|
||||
</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<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,290 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="action">
|
||||
<UniqueIdentifier>{d793b86c-0905-4c9b-b6bc-161e351c9eb2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="armature">
|
||||
<UniqueIdentifier>{855f2366-3429-4f77-a080-a41a39c99270}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="components">
|
||||
<UniqueIdentifier>{1a8c6b14-fb28-4485-8417-9b6838fbc4ef}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="json">
|
||||
<UniqueIdentifier>{42f1ce3f-46ab-4a16-a96e-9eb076c873f7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="reader">
|
||||
<UniqueIdentifier>{f8271f80-1663-4425-91c8-7365ec3af017}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="armature\animation">
|
||||
<UniqueIdentifier>{48f28446-ffe4-4aa1-a34c-8968c3367ae6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="armature\datas">
|
||||
<UniqueIdentifier>{ad9b4fd1-dc17-4704-9c60-7709eb916f13}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="armature\display">
|
||||
<UniqueIdentifier>{55c682b3-7a48-4fab-ad5a-eb979f3c305e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="armature\physics">
|
||||
<UniqueIdentifier>{c6464479-e0ab-4afc-96fc-1ffc73e40232}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="armature\utils">
|
||||
<UniqueIdentifier>{023e3440-1259-4981-ba54-24390d1df447}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="json\libjson">
|
||||
<UniqueIdentifier>{e8d09ad5-8816-4724-a10b-04263868ed7c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\CCActionFrameEasing.cpp">
|
||||
<Filter>action</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCActionManagerEx.cpp">
|
||||
<Filter>action</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCActionNode.cpp">
|
||||
<Filter>action</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCActionObject.cpp">
|
||||
<Filter>action</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCActionFrame.cpp">
|
||||
<Filter>action</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCComAttribute.cpp">
|
||||
<Filter>components</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCComAudio.cpp">
|
||||
<Filter>components</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCComController.cpp">
|
||||
<Filter>components</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCComRender.cpp">
|
||||
<Filter>components</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCInputDelegate.cpp">
|
||||
<Filter>components</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\DictionaryHelper.cpp">
|
||||
<Filter>json</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CSContentJsonDictionary.cpp">
|
||||
<Filter>json</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCSSceneReader.cpp">
|
||||
<Filter>reader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCSGUIReader.cpp">
|
||||
<Filter>reader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCTween.cpp">
|
||||
<Filter>armature\animation</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCProcessBase.cpp">
|
||||
<Filter>armature\animation</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCArmatureAnimation.cpp">
|
||||
<Filter>armature\animation</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCDatas.cpp">
|
||||
<Filter>armature\datas</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCBatchNode.cpp">
|
||||
<Filter>armature\display</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCDecorativeDisplay.cpp">
|
||||
<Filter>armature\display</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCDisplayFactory.cpp">
|
||||
<Filter>armature\display</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCDisplayManager.cpp">
|
||||
<Filter>armature\display</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCSkin.cpp">
|
||||
<Filter>armature\display</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCArmatureDataManager.cpp">
|
||||
<Filter>armature\utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCArmatureDefine.cpp">
|
||||
<Filter>armature\utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCDataReaderHelper.cpp">
|
||||
<Filter>armature\utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCSpriteFrameCacheHelper.cpp">
|
||||
<Filter>armature\utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCTransformHelp.cpp">
|
||||
<Filter>armature\utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCTweenFunction.cpp">
|
||||
<Filter>armature\utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCUtilMath.cpp">
|
||||
<Filter>armature\utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCColliderDetector.cpp">
|
||||
<Filter>armature\physics</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCArmature.cpp">
|
||||
<Filter>armature</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCBone.cpp">
|
||||
<Filter>armature</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\external\json\json_reader.cpp">
|
||||
<Filter>json\libjson</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\external\json\json_value.cpp">
|
||||
<Filter>json\libjson</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\external\json\json_writer.cpp">
|
||||
<Filter>json\libjson</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\CCActionFrameEasing.h">
|
||||
<Filter>action</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCActionManagerEx.h">
|
||||
<Filter>action</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCActionNode.h">
|
||||
<Filter>action</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCActionObject.h">
|
||||
<Filter>action</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCActionFrame.h">
|
||||
<Filter>action</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCComAttribute.h">
|
||||
<Filter>components</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCComAudio.h">
|
||||
<Filter>components</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCComController.h">
|
||||
<Filter>components</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCComRender.h">
|
||||
<Filter>components</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCInputDelegate.h">
|
||||
<Filter>components</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\DictionaryHelper.h">
|
||||
<Filter>json</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CSContentJsonDictionary.h">
|
||||
<Filter>json</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCSSceneReader.h">
|
||||
<Filter>reader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCSGUIReader.h">
|
||||
<Filter>reader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCTween.h">
|
||||
<Filter>armature\animation</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCProcessBase.h">
|
||||
<Filter>armature\animation</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCArmatureAnimation.h">
|
||||
<Filter>armature\animation</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCDatas.h">
|
||||
<Filter>armature\datas</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCBatchNode.h">
|
||||
<Filter>armature\display</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCDecorativeDisplay.h">
|
||||
<Filter>armature\display</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCDisplayFactory.h">
|
||||
<Filter>armature\display</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCDisplayManager.h">
|
||||
<Filter>armature\display</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCSkin.h">
|
||||
<Filter>armature\display</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCArmatureDataManager.h">
|
||||
<Filter>armature\utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCArmatureDefine.h">
|
||||
<Filter>armature\utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCDataReaderHelper.h">
|
||||
<Filter>armature\utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCSpriteFrameCacheHelper.h">
|
||||
<Filter>armature\utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCTransformHelp.h">
|
||||
<Filter>armature\utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCTweenFunction.h">
|
||||
<Filter>armature\utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCUtilMath.h">
|
||||
<Filter>armature\utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCColliderDetector.h">
|
||||
<Filter>armature\physics</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCArmature.h">
|
||||
<Filter>armature</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCBone.h">
|
||||
<Filter>armature</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\external\json\forwards.h">
|
||||
<Filter>json\libjson</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\external\json\json.h">
|
||||
<Filter>json\libjson</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\external\json\json_batchallocator.h">
|
||||
<Filter>json\libjson</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\external\json\reader.h">
|
||||
<Filter>json\libjson</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\external\json\value.h">
|
||||
<Filter>json\libjson</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\external\json\writer.h">
|
||||
<Filter>json\libjson</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\external\json\autolink.h">
|
||||
<Filter>json\libjson</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\external\json\config.h">
|
||||
<Filter>json\libjson</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\external\json\features.h">
|
||||
<Filter>json\libjson</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\..\external\json\json_internalarray.inl">
|
||||
<Filter>json\libjson</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\external\json\json_internalmap.inl">
|
||||
<Filter>json\libjson</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\external\json\json_valueiterator.inl">
|
||||
<Filter>json\libjson</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\external\json\sconscript">
|
||||
<Filter>json\libjson</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
|
@ -0,0 +1,134 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Animation.h" />
|
||||
<ClInclude Include="..\AnimationState.h" />
|
||||
<ClInclude Include="..\AnimationStateData.h" />
|
||||
<ClInclude Include="..\Atlas.h" />
|
||||
<ClInclude Include="..\AtlasAttachmentLoader.h" />
|
||||
<ClInclude Include="..\Attachment.h" />
|
||||
<ClInclude Include="..\AttachmentLoader.h" />
|
||||
<ClInclude Include="..\Bone.h" />
|
||||
<ClInclude Include="..\BoneData.h" />
|
||||
<ClInclude Include="..\CCSkeleton.h" />
|
||||
<ClInclude Include="..\CCSkeletonAnimation.h" />
|
||||
<ClInclude Include="..\extension.h" />
|
||||
<ClInclude Include="..\Json.h" />
|
||||
<ClInclude Include="..\RegionAttachment.h" />
|
||||
<ClInclude Include="..\Skeleton.h" />
|
||||
<ClInclude Include="..\SkeletonData.h" />
|
||||
<ClInclude Include="..\SkeletonJson.h" />
|
||||
<ClInclude Include="..\Skin.h" />
|
||||
<ClInclude Include="..\Slot.h" />
|
||||
<ClInclude Include="..\SlotData.h" />
|
||||
<ClInclude Include="..\spine-cocos2dx.h" />
|
||||
<ClInclude Include="..\spine.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Animation.cpp" />
|
||||
<ClCompile Include="..\AnimationState.cpp" />
|
||||
<ClCompile Include="..\AnimationStateData.cpp" />
|
||||
<ClCompile Include="..\Atlas.cpp" />
|
||||
<ClCompile Include="..\AtlasAttachmentLoader.cpp" />
|
||||
<ClCompile Include="..\Attachment.cpp" />
|
||||
<ClCompile Include="..\AttachmentLoader.cpp" />
|
||||
<ClCompile Include="..\Bone.cpp" />
|
||||
<ClCompile Include="..\BoneData.cpp" />
|
||||
<ClCompile Include="..\CCSkeleton.cpp" />
|
||||
<ClCompile Include="..\CCSkeletonAnimation.cpp" />
|
||||
<ClCompile Include="..\extension.cpp" />
|
||||
<ClCompile Include="..\Json.cpp" />
|
||||
<ClCompile Include="..\RegionAttachment.cpp" />
|
||||
<ClCompile Include="..\Skeleton.cpp" />
|
||||
<ClCompile Include="..\SkeletonData.cpp" />
|
||||
<ClCompile Include="..\SkeletonJson.cpp" />
|
||||
<ClCompile Include="..\Skin.cpp" />
|
||||
<ClCompile Include="..\Slot.cpp" />
|
||||
<ClCompile Include="..\SlotData.cpp" />
|
||||
<ClCompile Include="..\spine-cocos2dx.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}</ProjectGuid>
|
||||
<RootNamespace>libSpine</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<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" />
|
||||
<Import Project="..\..\..\2d\cocos2d_headers.props" />
|
||||
</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" />
|
||||
<Import Project="..\..\..\2d\cocos2d_headers.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>
|
||||
</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>
|
||||
</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<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,146 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\SlotData.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\spine.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\spine-cocos2dx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Animation.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\AnimationState.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\AnimationStateData.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Atlas.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\AtlasAttachmentLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Attachment.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\AttachmentLoader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Bone.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\BoneData.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCSkeleton.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCSkeletonAnimation.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\extension.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Json.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\RegionAttachment.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Skeleton.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\SkeletonData.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\SkeletonJson.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Skin.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Slot.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Skeleton.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\SkeletonData.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\SkeletonJson.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Skin.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Slot.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\SlotData.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\spine-cocos2dx.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Animation.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\AnimationState.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\AnimationStateData.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Atlas.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\AtlasAttachmentLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Attachment.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\AttachmentLoader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Bone.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\BoneData.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCSkeleton.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCSkeletonAnimation.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\extension.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Json.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\RegionAttachment.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
|
@ -0,0 +1,136 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\CocosGUI.h" />
|
||||
<ClInclude Include="..\Layout.h" />
|
||||
<ClInclude Include="..\LayoutParameter.h" />
|
||||
<ClInclude Include="..\UIButton.h" />
|
||||
<ClInclude Include="..\UICheckBox.h" />
|
||||
<ClInclude Include="..\UIDragPanel.h" />
|
||||
<ClInclude Include="..\UIHelper.h" />
|
||||
<ClInclude Include="..\UIImageView.h" />
|
||||
<ClInclude Include="..\UIInputManager.h" />
|
||||
<ClInclude Include="..\UILabel.h" />
|
||||
<ClInclude Include="..\UILabelAtlas.h" />
|
||||
<ClInclude Include="..\UILabelBMFont.h" />
|
||||
<ClInclude Include="..\UILayer.h" />
|
||||
<ClInclude Include="..\UILayoutDefine.h" />
|
||||
<ClInclude Include="..\UIListView.h" />
|
||||
<ClInclude Include="..\UILoadingBar.h" />
|
||||
<ClInclude Include="..\UIPageView.h" />
|
||||
<ClInclude Include="..\UIRootWidget.h" />
|
||||
<ClInclude Include="..\UIScrollInterface.h" />
|
||||
<ClInclude Include="..\UIScrollView.h" />
|
||||
<ClInclude Include="..\UISlider.h" />
|
||||
<ClInclude Include="..\UITextField.h" />
|
||||
<ClInclude Include="..\UIWidget.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\CocosGUI.cpp" />
|
||||
<ClCompile Include="..\Layout.cpp" />
|
||||
<ClCompile Include="..\LayoutParameter.cpp" />
|
||||
<ClCompile Include="..\UIButton.cpp" />
|
||||
<ClCompile Include="..\UICheckBox.cpp" />
|
||||
<ClCompile Include="..\UIDragPanel.cpp" />
|
||||
<ClCompile Include="..\UIHelper.cpp" />
|
||||
<ClCompile Include="..\UIImageView.cpp" />
|
||||
<ClCompile Include="..\UIInputManager.cpp" />
|
||||
<ClCompile Include="..\UILabel.cpp" />
|
||||
<ClCompile Include="..\UILabelAtlas.cpp" />
|
||||
<ClCompile Include="..\UILabelBMFont.cpp" />
|
||||
<ClCompile Include="..\UILayer.cpp" />
|
||||
<ClCompile Include="..\UILayoutDefine.cpp" />
|
||||
<ClCompile Include="..\UIListView.cpp" />
|
||||
<ClCompile Include="..\UILoadingBar.cpp" />
|
||||
<ClCompile Include="..\UIPageView.cpp" />
|
||||
<ClCompile Include="..\UIRootWidget.cpp" />
|
||||
<ClCompile Include="..\UIScrollView.cpp" />
|
||||
<ClCompile Include="..\UISlider.cpp" />
|
||||
<ClCompile Include="..\UITextField.cpp" />
|
||||
<ClCompile Include="..\UIWidget.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{7E06E92C-537A-442B-9E4A-4761C84F8A1A}</ProjectGuid>
|
||||
<RootNamespace>libGUI</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<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" />
|
||||
<Import Project="..\..\2d\cocos2d_headers.props" />
|
||||
</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" />
|
||||
<Import Project="..\..\2d\cocos2d_headers.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>
|
||||
</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>
|
||||
</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<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,159 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="BaseClasses">
|
||||
<UniqueIdentifier>{e31ab7d3-b8b2-467f-9e08-fd5fe168b491}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Layouts">
|
||||
<UniqueIdentifier>{f9d13563-9e5e-4b35-b0e7-d41f587efa42}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="System">
|
||||
<UniqueIdentifier>{ed8a2ae0-5690-4d0d-829b-7c07164c0597}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="UIWidgets">
|
||||
<UniqueIdentifier>{5f6e9e52-fbe7-4073-ac71-98632f9e6781}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="UIWidgets\ScrollWidget">
|
||||
<UniqueIdentifier>{b59b178a-b7e0-4826-ba07-44c46cd29a10}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\UIScrollInterface.h">
|
||||
<Filter>UIWidgets\ScrollWidget</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UIScrollView.h">
|
||||
<Filter>UIWidgets\ScrollWidget</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UIDragPanel.h">
|
||||
<Filter>UIWidgets\ScrollWidget</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UIListView.h">
|
||||
<Filter>UIWidgets\ScrollWidget</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UIPageView.h">
|
||||
<Filter>UIWidgets\ScrollWidget</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UIButton.h">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UICheckBox.h">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UIImageView.h">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UILabel.h">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UILabelAtlas.h">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UILabelBMFont.h">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UISlider.h">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UITextField.h">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UILoadingBar.h">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UIHelper.h">
|
||||
<Filter>System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CocosGUI.h">
|
||||
<Filter>System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UIInputManager.h">
|
||||
<Filter>System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UILayer.h">
|
||||
<Filter>System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Layout.h">
|
||||
<Filter>Layouts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\LayoutParameter.h">
|
||||
<Filter>Layouts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UILayoutDefine.h">
|
||||
<Filter>Layouts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UIRootWidget.h">
|
||||
<Filter>BaseClasses</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\UIWidget.h">
|
||||
<Filter>BaseClasses</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\UIScrollView.cpp">
|
||||
<Filter>UIWidgets\ScrollWidget</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UIDragPanel.cpp">
|
||||
<Filter>UIWidgets\ScrollWidget</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UIListView.cpp">
|
||||
<Filter>UIWidgets\ScrollWidget</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UIPageView.cpp">
|
||||
<Filter>UIWidgets\ScrollWidget</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UIButton.cpp">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UICheckBox.cpp">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UIImageView.cpp">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UILabel.cpp">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UILabelAtlas.cpp">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UILabelBMFont.cpp">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UISlider.cpp">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UITextField.cpp">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UILoadingBar.cpp">
|
||||
<Filter>UIWidgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UIHelper.cpp">
|
||||
<Filter>System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CocosGUI.cpp">
|
||||
<Filter>System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UIInputManager.cpp">
|
||||
<Filter>System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UILayer.cpp">
|
||||
<Filter>System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Layout.cpp">
|
||||
<Filter>Layouts</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\LayoutParameter.cpp">
|
||||
<Filter>Layouts</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UILayoutDefine.cpp">
|
||||
<Filter>Layouts</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UIRootWidget.cpp">
|
||||
<Filter>BaseClasses</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\UIWidget.cpp">
|
||||
<Filter>BaseClasses</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
|
@ -0,0 +1,131 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\HttpClient.h" />
|
||||
<ClInclude Include="..\HttpRequest.h" />
|
||||
<ClInclude Include="..\HttpResponse.h" />
|
||||
<ClInclude Include="..\SocketIO.h" />
|
||||
<ClInclude Include="..\WebSocket.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\HttpClient.cpp" />
|
||||
<ClCompile Include="..\SocketIO.cpp" />
|
||||
<ClCompile Include="..\WebSocket.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>libNetwork</ProjectName>
|
||||
<ProjectGuid>{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}</ProjectGuid>
|
||||
<RootNamespace>network.win32</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\2d\cocos2d_headers.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\2d\cocos2d_headers.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration).win32\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration).win32\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LibraryPath>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LibraryPath>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;..\Include;$(EngineRoot)cocos;$(EngineRoot)external\websockets\include\win32;$(EngineRoot)external\curl\include\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>winmm.lib;libcocos2d.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;..\Include;$(EngineRoot)cocos;$(EngineRoot)external\websockets\include\win32;$(EngineRoot)external\curl\include\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>winmm.lib;libcocos2d.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\HttpClient.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\HttpRequest.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\HttpResponse.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\SocketIO.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\WebSocket.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\HttpClient.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\SocketIO.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\WebSocket.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
</Project>
|
|
@ -0,0 +1 @@
|
|||
6558be4f421be9227dc4fabf1b682d479825bd18
|
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* AUTOGENERATED FILE. DO NOT EDIT IT
|
||||
* Generated by "generate_js_bindings.py -c chipmunk_jsb.ini" on 2012-11-07
|
||||
* Script version: v0.3
|
||||
*/
|
||||
#include "js_bindings_config.h"
|
||||
#ifdef JSB_INCLUDE_CHIPMUNK
|
||||
|
||||
#include "js_bindings_chipmunk_manual.h"
|
||||
extern JSObject *JSB_cpConstraint_object;
|
||||
extern JSClass *JSB_cpConstraint_class;
|
||||
void JSB_cpConstraint_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpGrooveJoint_object;
|
||||
extern JSClass *JSB_cpGrooveJoint_class;
|
||||
void JSB_cpGrooveJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpSimpleMotor_object;
|
||||
extern JSClass *JSB_cpSimpleMotor_class;
|
||||
void JSB_cpSimpleMotor_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpPivotJoint_object;
|
||||
extern JSClass *JSB_cpPivotJoint_class;
|
||||
void JSB_cpPivotJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpPinJoint_object;
|
||||
extern JSClass *JSB_cpPinJoint_class;
|
||||
void JSB_cpPinJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpSlideJoint_object;
|
||||
extern JSClass *JSB_cpSlideJoint_class;
|
||||
void JSB_cpSlideJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpGearJoint_object;
|
||||
extern JSClass *JSB_cpGearJoint_class;
|
||||
void JSB_cpGearJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpDampedRotarySpring_object;
|
||||
extern JSClass *JSB_cpDampedRotarySpring_class;
|
||||
void JSB_cpDampedRotarySpring_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpDampedSpring_object;
|
||||
extern JSClass *JSB_cpDampedSpring_class;
|
||||
void JSB_cpDampedSpring_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpRatchetJoint_object;
|
||||
extern JSClass *JSB_cpRatchetJoint_class;
|
||||
void JSB_cpRatchetJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpRotaryLimitJoint_object;
|
||||
extern JSClass *JSB_cpRotaryLimitJoint_class;
|
||||
void JSB_cpRotaryLimitJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpArbiter_object;
|
||||
extern JSClass *JSB_cpArbiter_class;
|
||||
void JSB_cpArbiter_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpSpace_object;
|
||||
extern JSClass *JSB_cpSpace_class;
|
||||
void JSB_cpSpace_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpBody_object;
|
||||
extern JSClass *JSB_cpBody_class;
|
||||
void JSB_cpBody_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpShape_object;
|
||||
extern JSClass *JSB_cpShape_class;
|
||||
void JSB_cpShape_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpCircleShape_object;
|
||||
extern JSClass *JSB_cpCircleShape_class;
|
||||
void JSB_cpCircleShape_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpSegmentShape_object;
|
||||
extern JSClass *JSB_cpSegmentShape_class;
|
||||
void JSB_cpSegmentShape_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
extern JSObject *JSB_cpPolyShape_object;
|
||||
extern JSClass *JSB_cpPolyShape_class;
|
||||
void JSB_cpPolyShape_createClass(JSContext *cx, JSObject* globalObj, const char* name );
|
||||
|
||||
|
||||
#endif // JSB_INCLUDE_CHIPMUNK
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* AUTOGENERATED FILE. DO NOT EDIT IT
|
||||
* Generated by "generate_js_bindings.py -c chipmunk_jsb.ini" on 2012-11-07
|
||||
* Script version: v0.3
|
||||
*/
|
||||
#include "js_bindings_config.h"
|
||||
#ifdef JSB_INCLUDE_CHIPMUNK
|
||||
|
||||
JSB_cpConstraint_createClass(_cx, chipmunk, "Constraint");
|
||||
JSB_cpGrooveJoint_createClass(_cx, chipmunk, "GrooveJoint");
|
||||
JSB_cpSimpleMotor_createClass(_cx, chipmunk, "SimpleMotor");
|
||||
JSB_cpPivotJoint_createClass(_cx, chipmunk, "PivotJoint");
|
||||
JSB_cpPinJoint_createClass(_cx, chipmunk, "PinJoint");
|
||||
JSB_cpSlideJoint_createClass(_cx, chipmunk, "SlideJoint");
|
||||
JSB_cpGearJoint_createClass(_cx, chipmunk, "GearJoint");
|
||||
JSB_cpDampedRotarySpring_createClass(_cx, chipmunk, "DampedRotarySpring");
|
||||
JSB_cpDampedSpring_createClass(_cx, chipmunk, "DampedSpring");
|
||||
JSB_cpRatchetJoint_createClass(_cx, chipmunk, "RatchetJoint");
|
||||
JSB_cpRotaryLimitJoint_createClass(_cx, chipmunk, "RotaryLimitJoint");
|
||||
JSB_cpArbiter_createClass(_cx, chipmunk, "Arbiter");
|
||||
JSB_cpSpace_createClass(_cx, chipmunk, "Space");
|
||||
JSB_cpBody_createClass(_cx, chipmunk, "Body");
|
||||
JSB_cpShape_createClass(_cx, chipmunk, "Shape");
|
||||
JSB_cpCircleShape_createClass(_cx, chipmunk, "CircleShape");
|
||||
JSB_cpSegmentShape_createClass(_cx, chipmunk, "SegmentShape");
|
||||
JSB_cpPolyShape_createClass(_cx, chipmunk, "PolyShape");
|
||||
|
||||
|
||||
#endif // JSB_INCLUDE_CHIPMUNK
|
|
@ -0,0 +1 @@
|
|||
1c5eb9cd58c82de77374cdfa5c9ff647cc8b2f02
|
|
@ -0,0 +1,292 @@
|
|||
/*
|
||||
* AUTOGENERATED FILE. DO NOT EDIT IT
|
||||
* Generated by "generate_js_bindings.py -c chipmunk_jsb.ini" on 2012-11-07
|
||||
* Script version: v0.3
|
||||
*/
|
||||
#include "js_bindings_config.h"
|
||||
#ifdef JSB_INCLUDE_CHIPMUNK
|
||||
#include "js_bindings_chipmunk_manual.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
JSBool JSB_cpArbiterGetCount(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpArbiterGetDepth(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpArbiterGetElasticity(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpArbiterGetFriction(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpArbiterGetNormal(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpArbiterGetPoint(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpArbiterGetSurfaceVelocity(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpArbiterIgnore(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpArbiterIsFirstContact(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpArbiterSetElasticity(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpArbiterSetFriction(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpArbiterSetSurfaceVelocity(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpArbiterTotalImpulse(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpArbiterTotalImpulseWithFriction(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpArbiterTotalKE(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpAreaForCircle(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpAreaForSegment(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBBArea(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBBClampVect(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBBContainsBB(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBBContainsVect(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBBExpand(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBBIntersects(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBBIntersectsSegment(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBBMerge(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBBMergedArea(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBBNew(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBBNewForCircle(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBBSegmentQuery(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBBWrapVect(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyActivate(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyActivateStatic(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyApplyForce(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyApplyImpulse(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyDestroy(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyFree(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyGetAngVel(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyGetAngVelLimit(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyGetAngle(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyGetForce(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyGetMass(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyGetMoment(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyGetPos(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyGetRot(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyGetSpace(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyGetTorque(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyGetVel(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyGetVelAtLocalPoint(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyGetVelAtWorldPoint(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyGetVelLimit(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyInit(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyInitStatic(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyIsRogue(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyIsSleeping(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyIsStatic(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyKineticEnergy(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyLocal2World(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyNew(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyNewStatic(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyResetForces(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodySetAngVel(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodySetAngVelLimit(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodySetAngle(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodySetForce(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodySetMass(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodySetMoment(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodySetPos(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodySetTorque(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodySetVel(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodySetVelLimit(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodySleep(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodySleepWithGroup(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyUpdatePosition(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyUpdateVelocity(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodyWorld2Local(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBoxShapeNew(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBoxShapeNew2(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpCircleShapeGetOffset(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpCircleShapeGetRadius(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpCircleShapeNew(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpConstraintActivateBodies(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpConstraintDestroy(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpConstraintFree(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpConstraintGetA(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpConstraintGetB(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpConstraintGetErrorBias(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpConstraintGetImpulse(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpConstraintGetMaxBias(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpConstraintGetMaxForce(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpConstraintGetSpace(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpConstraintSetErrorBias(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpConstraintSetMaxBias(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpConstraintSetMaxForce(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedRotarySpringGetDamping(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedRotarySpringGetRestAngle(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedRotarySpringGetStiffness(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedRotarySpringNew(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedRotarySpringSetDamping(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedRotarySpringSetRestAngle(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedRotarySpringSetStiffness(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedSpringGetAnchr1(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedSpringGetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedSpringGetDamping(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedSpringGetRestLength(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedSpringGetStiffness(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedSpringNew(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedSpringSetAnchr1(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedSpringSetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedSpringSetDamping(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedSpringSetRestLength(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpDampedSpringSetStiffness(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpGearJointGetPhase(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpGearJointGetRatio(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpGearJointNew(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpGearJointSetPhase(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpGearJointSetRatio(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpGrooveJointGetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpGrooveJointGetGrooveA(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpGrooveJointGetGrooveB(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpGrooveJointNew(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpGrooveJointSetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpGrooveJointSetGrooveA(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpGrooveJointSetGrooveB(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpInitChipmunk(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpMomentForBox(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpMomentForBox2(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpMomentForCircle(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpMomentForSegment(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpPinJointGetAnchr1(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpPinJointGetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpPinJointGetDist(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpPinJointNew(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpPinJointSetAnchr1(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpPinJointSetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpPinJointSetDist(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpPivotJointGetAnchr1(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpPivotJointGetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpPivotJointNew(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpPivotJointNew2(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpPivotJointSetAnchr1(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpPivotJointSetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpPolyShapeGetNumVerts(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpPolyShapeGetVert(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpRatchetJointGetAngle(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpRatchetJointGetPhase(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpRatchetJointGetRatchet(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpRatchetJointNew(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpRatchetJointSetAngle(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpRatchetJointSetPhase(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpRatchetJointSetRatchet(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpResetShapeIdCounter(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpRotaryLimitJointGetMax(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpRotaryLimitJointGetMin(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpRotaryLimitJointNew(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpRotaryLimitJointSetMax(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpRotaryLimitJointSetMin(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSegmentShapeGetA(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSegmentShapeGetB(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSegmentShapeGetNormal(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSegmentShapeGetRadius(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSegmentShapeNew(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSegmentShapeSetNeighbors(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeCacheBB(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeDestroy(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeFree(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeGetBB(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeGetBody(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeGetCollisionType(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeGetElasticity(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeGetFriction(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeGetGroup(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeGetLayers(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeGetSensor(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeGetSpace(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeGetSurfaceVelocity(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapePointQuery(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeSetBody(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeSetCollisionType(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeSetElasticity(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeSetFriction(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeSetGroup(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeSetLayers(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeSetSensor(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeSetSurfaceVelocity(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpShapeUpdate(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSimpleMotorGetRate(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSimpleMotorNew(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSimpleMotorSetRate(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSlideJointGetAnchr1(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSlideJointGetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSlideJointGetMax(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSlideJointGetMin(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSlideJointNew(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSlideJointSetAnchr1(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSlideJointSetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSlideJointSetMax(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSlideJointSetMin(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceActivateShapesTouchingShape(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceAddBody(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceAddConstraint(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceAddShape(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceAddStaticShape(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceContainsBody(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceContainsConstraint(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceContainsShape(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceDestroy(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceFree(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceGetCollisionBias(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceGetCollisionPersistence(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceGetCollisionSlop(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceGetCurrentTimeStep(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceGetDamping(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceGetEnableContactGraph(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceGetGravity(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceGetIdleSpeedThreshold(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceGetIterations(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceGetSleepTimeThreshold(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceGetStaticBody(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceInit(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceIsLocked(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceNew(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpacePointQueryFirst(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceReindexShape(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceReindexShapesForBody(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceReindexStatic(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceRemoveBody(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceRemoveConstraint(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceRemoveShape(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceRemoveStaticShape(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceSetCollisionBias(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceSetCollisionPersistence(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceSetCollisionSlop(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceSetDamping(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceSetEnableContactGraph(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceSetGravity(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceSetIdleSpeedThreshold(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceSetIterations(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceSetSleepTimeThreshold(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceStep(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceUseSpatialHash(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpfabs(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpfclamp(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpfclamp01(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpflerp(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpflerpconst(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpfmax(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpfmin(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvadd(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvclamp(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvcross(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvdist(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvdistsq(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvdot(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpveql(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvforangle(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvlength(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvlengthsq(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvlerp(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvlerpconst(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvmult(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvnear(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvneg(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvnormalize(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvnormalize_safe(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvperp(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvproject(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvrotate(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvrperp(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvslerp(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvslerpconst(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvsub(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvtoangle(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpvunrotate(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif // JSB_INCLUDE_CHIPMUNK
|
|
@ -0,0 +1,285 @@
|
|||
/*
|
||||
* AUTOGENERATED FILE. DO NOT EDIT IT
|
||||
* Generated by "generate_js_bindings.py -c chipmunk_jsb.ini" on 2012-10-18
|
||||
* Script version: v0.3
|
||||
*/
|
||||
#include "js_bindings_config.h"
|
||||
#ifdef JSB_INCLUDE_CHIPMUNK
|
||||
|
||||
#include "js_bindings_chipmunk_manual.h"
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterGetCount", JSB_cpArbiterGetCount, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterGetDepth", JSB_cpArbiterGetDepth, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterGetElasticity", JSB_cpArbiterGetElasticity, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterGetFriction", JSB_cpArbiterGetFriction, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterGetNormal", JSB_cpArbiterGetNormal, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterGetPoint", JSB_cpArbiterGetPoint, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterGetSurfaceVelocity", JSB_cpArbiterGetSurfaceVelocity, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterIgnore", JSB_cpArbiterIgnore, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterIsFirstContact", JSB_cpArbiterIsFirstContact, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterSetElasticity", JSB_cpArbiterSetElasticity, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterSetFriction", JSB_cpArbiterSetFriction, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterSetSurfaceVelocity", JSB_cpArbiterSetSurfaceVelocity, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterTotalImpulse", JSB_cpArbiterTotalImpulse, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterTotalImpulseWithFriction", JSB_cpArbiterTotalImpulseWithFriction, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterTotalKE", JSB_cpArbiterTotalKE, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "areaForCircle", JSB_cpAreaForCircle, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "areaForSegment", JSB_cpAreaForSegment, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bBArea", JSB_cpBBArea, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bBClampVect", JSB_cpBBClampVect, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bBContainsBB", JSB_cpBBContainsBB, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bBContainsVect", JSB_cpBBContainsVect, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bBExpand", JSB_cpBBExpand, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bBIntersects", JSB_cpBBIntersects, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bBIntersectsSegment", JSB_cpBBIntersectsSegment, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bBMerge", JSB_cpBBMerge, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bBMergedArea", JSB_cpBBMergedArea, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bBNew", JSB_cpBBNew, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bBNewForCircle", JSB_cpBBNewForCircle, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bBSegmentQuery", JSB_cpBBSegmentQuery, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bBWrapVect", JSB_cpBBWrapVect, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyActivate", JSB_cpBodyActivate, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyActivateStatic", JSB_cpBodyActivateStatic, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyApplyForce", JSB_cpBodyApplyForce, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyApplyImpulse", JSB_cpBodyApplyImpulse, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyDestroy", JSB_cpBodyDestroy, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyFree", JSB_cpBodyFree, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyGetAngVel", JSB_cpBodyGetAngVel, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyGetAngVelLimit", JSB_cpBodyGetAngVelLimit, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyGetAngle", JSB_cpBodyGetAngle, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyGetForce", JSB_cpBodyGetForce, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyGetMass", JSB_cpBodyGetMass, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyGetMoment", JSB_cpBodyGetMoment, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyGetPos", JSB_cpBodyGetPos, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyGetRot", JSB_cpBodyGetRot, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyGetSpace", JSB_cpBodyGetSpace, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyGetTorque", JSB_cpBodyGetTorque, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyGetVel", JSB_cpBodyGetVel, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyGetVelAtLocalPoint", JSB_cpBodyGetVelAtLocalPoint, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyGetVelAtWorldPoint", JSB_cpBodyGetVelAtWorldPoint, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyGetVelLimit", JSB_cpBodyGetVelLimit, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyInit", JSB_cpBodyInit, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyInitStatic", JSB_cpBodyInitStatic, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyIsRogue", JSB_cpBodyIsRogue, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyIsSleeping", JSB_cpBodyIsSleeping, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyIsStatic", JSB_cpBodyIsStatic, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyKineticEnergy", JSB_cpBodyKineticEnergy, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyLocal2World", JSB_cpBodyLocal2World, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyNew", JSB_cpBodyNew, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyNewStatic", JSB_cpBodyNewStatic, 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyResetForces", JSB_cpBodyResetForces, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodySetAngVel", JSB_cpBodySetAngVel, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodySetAngVelLimit", JSB_cpBodySetAngVelLimit, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodySetAngle", JSB_cpBodySetAngle, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodySetForce", JSB_cpBodySetForce, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodySetMass", JSB_cpBodySetMass, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodySetMoment", JSB_cpBodySetMoment, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodySetPos", JSB_cpBodySetPos, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodySetTorque", JSB_cpBodySetTorque, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodySetVel", JSB_cpBodySetVel, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodySetVelLimit", JSB_cpBodySetVelLimit, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodySleep", JSB_cpBodySleep, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodySleepWithGroup", JSB_cpBodySleepWithGroup, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyUpdatePosition", JSB_cpBodyUpdatePosition, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyUpdateVelocity", JSB_cpBodyUpdateVelocity, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyWorld2Local", JSB_cpBodyWorld2Local, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "boxShapeNew", JSB_cpBoxShapeNew, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "boxShapeNew2", JSB_cpBoxShapeNew2, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "circleShapeGetOffset", JSB_cpCircleShapeGetOffset, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "circleShapeGetRadius", JSB_cpCircleShapeGetRadius, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "circleShapeNew", JSB_cpCircleShapeNew, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "constraintActivateBodies", JSB_cpConstraintActivateBodies, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "constraintDestroy", JSB_cpConstraintDestroy, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "constraintFree", JSB_cpConstraintFree, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "constraintGetA", JSB_cpConstraintGetA, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "constraintGetB", JSB_cpConstraintGetB, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "constraintGetErrorBias", JSB_cpConstraintGetErrorBias, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "constraintGetImpulse", JSB_cpConstraintGetImpulse, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "constraintGetMaxBias", JSB_cpConstraintGetMaxBias, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "constraintGetMaxForce", JSB_cpConstraintGetMaxForce, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "constraintGetSpace", JSB_cpConstraintGetSpace, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "constraintSetErrorBias", JSB_cpConstraintSetErrorBias, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "constraintSetMaxBias", JSB_cpConstraintSetMaxBias, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "constraintSetMaxForce", JSB_cpConstraintSetMaxForce, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedRotarySpringGetDamping", JSB_cpDampedRotarySpringGetDamping, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedRotarySpringGetRestAngle", JSB_cpDampedRotarySpringGetRestAngle, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedRotarySpringGetStiffness", JSB_cpDampedRotarySpringGetStiffness, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedRotarySpringNew", JSB_cpDampedRotarySpringNew, 5, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedRotarySpringSetDamping", JSB_cpDampedRotarySpringSetDamping, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedRotarySpringSetRestAngle", JSB_cpDampedRotarySpringSetRestAngle, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedRotarySpringSetStiffness", JSB_cpDampedRotarySpringSetStiffness, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedSpringGetAnchr1", JSB_cpDampedSpringGetAnchr1, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedSpringGetAnchr2", JSB_cpDampedSpringGetAnchr2, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedSpringGetDamping", JSB_cpDampedSpringGetDamping, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedSpringGetRestLength", JSB_cpDampedSpringGetRestLength, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedSpringGetStiffness", JSB_cpDampedSpringGetStiffness, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedSpringNew", JSB_cpDampedSpringNew, 7, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedSpringSetAnchr1", JSB_cpDampedSpringSetAnchr1, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedSpringSetAnchr2", JSB_cpDampedSpringSetAnchr2, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedSpringSetDamping", JSB_cpDampedSpringSetDamping, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedSpringSetRestLength", JSB_cpDampedSpringSetRestLength, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "dampedSpringSetStiffness", JSB_cpDampedSpringSetStiffness, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "gearJointGetPhase", JSB_cpGearJointGetPhase, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "gearJointGetRatio", JSB_cpGearJointGetRatio, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "gearJointNew", JSB_cpGearJointNew, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "gearJointSetPhase", JSB_cpGearJointSetPhase, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "gearJointSetRatio", JSB_cpGearJointSetRatio, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "grooveJointGetAnchr2", JSB_cpGrooveJointGetAnchr2, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "grooveJointGetGrooveA", JSB_cpGrooveJointGetGrooveA, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "grooveJointGetGrooveB", JSB_cpGrooveJointGetGrooveB, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "grooveJointNew", JSB_cpGrooveJointNew, 5, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "grooveJointSetAnchr2", JSB_cpGrooveJointSetAnchr2, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "grooveJointSetGrooveA", JSB_cpGrooveJointSetGrooveA, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "grooveJointSetGrooveB", JSB_cpGrooveJointSetGrooveB, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "initChipmunk", JSB_cpInitChipmunk, 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "momentForBox", JSB_cpMomentForBox, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "momentForBox2", JSB_cpMomentForBox2, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "momentForCircle", JSB_cpMomentForCircle, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "momentForSegment", JSB_cpMomentForSegment, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "pinJointGetAnchr1", JSB_cpPinJointGetAnchr1, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "pinJointGetAnchr2", JSB_cpPinJointGetAnchr2, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "pinJointGetDist", JSB_cpPinJointGetDist, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "pinJointNew", JSB_cpPinJointNew, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "pinJointSetAnchr1", JSB_cpPinJointSetAnchr1, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "pinJointSetAnchr2", JSB_cpPinJointSetAnchr2, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "pinJointSetDist", JSB_cpPinJointSetDist, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "pivotJointGetAnchr1", JSB_cpPivotJointGetAnchr1, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "pivotJointGetAnchr2", JSB_cpPivotJointGetAnchr2, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "pivotJointNew", JSB_cpPivotJointNew, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "pivotJointNew2", JSB_cpPivotJointNew2, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "pivotJointSetAnchr1", JSB_cpPivotJointSetAnchr1, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "pivotJointSetAnchr2", JSB_cpPivotJointSetAnchr2, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "polyShapeGetNumVerts", JSB_cpPolyShapeGetNumVerts, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "polyShapeGetVert", JSB_cpPolyShapeGetVert, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "ratchetJointGetAngle", JSB_cpRatchetJointGetAngle, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "ratchetJointGetPhase", JSB_cpRatchetJointGetPhase, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "ratchetJointGetRatchet", JSB_cpRatchetJointGetRatchet, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "ratchetJointNew", JSB_cpRatchetJointNew, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "ratchetJointSetAngle", JSB_cpRatchetJointSetAngle, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "ratchetJointSetPhase", JSB_cpRatchetJointSetPhase, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "ratchetJointSetRatchet", JSB_cpRatchetJointSetRatchet, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "resetShapeIdCounter", JSB_cpResetShapeIdCounter, 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "rotaryLimitJointGetMax", JSB_cpRotaryLimitJointGetMax, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "rotaryLimitJointGetMin", JSB_cpRotaryLimitJointGetMin, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "rotaryLimitJointNew", JSB_cpRotaryLimitJointNew, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "rotaryLimitJointSetMax", JSB_cpRotaryLimitJointSetMax, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "rotaryLimitJointSetMin", JSB_cpRotaryLimitJointSetMin, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "segmentShapeGetA", JSB_cpSegmentShapeGetA, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "segmentShapeGetB", JSB_cpSegmentShapeGetB, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "segmentShapeGetNormal", JSB_cpSegmentShapeGetNormal, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "segmentShapeGetRadius", JSB_cpSegmentShapeGetRadius, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "segmentShapeNew", JSB_cpSegmentShapeNew, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "segmentShapeSetNeighbors", JSB_cpSegmentShapeSetNeighbors, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeCacheBB", JSB_cpShapeCacheBB, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeDestroy", JSB_cpShapeDestroy, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeFree", JSB_cpShapeFree, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeGetBB", JSB_cpShapeGetBB, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeGetBody", JSB_cpShapeGetBody, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeGetCollisionType", JSB_cpShapeGetCollisionType, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeGetElasticity", JSB_cpShapeGetElasticity, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeGetFriction", JSB_cpShapeGetFriction, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeGetGroup", JSB_cpShapeGetGroup, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeGetLayers", JSB_cpShapeGetLayers, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeGetSensor", JSB_cpShapeGetSensor, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeGetSpace", JSB_cpShapeGetSpace, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeGetSurfaceVelocity", JSB_cpShapeGetSurfaceVelocity, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapePointQuery", JSB_cpShapePointQuery, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeSetBody", JSB_cpShapeSetBody, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeSetCollisionType", JSB_cpShapeSetCollisionType, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeSetElasticity", JSB_cpShapeSetElasticity, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeSetFriction", JSB_cpShapeSetFriction, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeSetGroup", JSB_cpShapeSetGroup, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeSetLayers", JSB_cpShapeSetLayers, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeSetSensor", JSB_cpShapeSetSensor, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeSetSurfaceVelocity", JSB_cpShapeSetSurfaceVelocity, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "shapeUpdate", JSB_cpShapeUpdate, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "simpleMotorGetRate", JSB_cpSimpleMotorGetRate, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "simpleMotorNew", JSB_cpSimpleMotorNew, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "simpleMotorSetRate", JSB_cpSimpleMotorSetRate, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "slideJointGetAnchr1", JSB_cpSlideJointGetAnchr1, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "slideJointGetAnchr2", JSB_cpSlideJointGetAnchr2, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "slideJointGetMax", JSB_cpSlideJointGetMax, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "slideJointGetMin", JSB_cpSlideJointGetMin, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "slideJointNew", JSB_cpSlideJointNew, 6, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "slideJointSetAnchr1", JSB_cpSlideJointSetAnchr1, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "slideJointSetAnchr2", JSB_cpSlideJointSetAnchr2, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "slideJointSetMax", JSB_cpSlideJointSetMax, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "slideJointSetMin", JSB_cpSlideJointSetMin, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceActivateShapesTouchingShape", JSB_cpSpaceActivateShapesTouchingShape, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceAddBody", JSB_cpSpaceAddBody, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceAddConstraint", JSB_cpSpaceAddConstraint, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceAddShape", JSB_cpSpaceAddShape, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceAddStaticShape", JSB_cpSpaceAddStaticShape, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceContainsBody", JSB_cpSpaceContainsBody, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceContainsConstraint", JSB_cpSpaceContainsConstraint, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceContainsShape", JSB_cpSpaceContainsShape, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceDestroy", JSB_cpSpaceDestroy, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceFree", JSB_cpSpaceFree, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceGetCollisionBias", JSB_cpSpaceGetCollisionBias, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceGetCollisionPersistence", JSB_cpSpaceGetCollisionPersistence, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceGetCollisionSlop", JSB_cpSpaceGetCollisionSlop, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceGetCurrentTimeStep", JSB_cpSpaceGetCurrentTimeStep, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceGetDamping", JSB_cpSpaceGetDamping, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceGetEnableContactGraph", JSB_cpSpaceGetEnableContactGraph, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceGetGravity", JSB_cpSpaceGetGravity, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceGetIdleSpeedThreshold", JSB_cpSpaceGetIdleSpeedThreshold, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceGetIterations", JSB_cpSpaceGetIterations, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceGetSleepTimeThreshold", JSB_cpSpaceGetSleepTimeThreshold, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceGetStaticBody", JSB_cpSpaceGetStaticBody, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceInit", JSB_cpSpaceInit, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceIsLocked", JSB_cpSpaceIsLocked, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceNew", JSB_cpSpaceNew, 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spacePointQueryFirst", JSB_cpSpacePointQueryFirst, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceReindexShape", JSB_cpSpaceReindexShape, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceReindexShapesForBody", JSB_cpSpaceReindexShapesForBody, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceReindexStatic", JSB_cpSpaceReindexStatic, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceRemoveBody", JSB_cpSpaceRemoveBody, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceRemoveConstraint", JSB_cpSpaceRemoveConstraint, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceRemoveShape", JSB_cpSpaceRemoveShape, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceRemoveStaticShape", JSB_cpSpaceRemoveStaticShape, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceSetCollisionBias", JSB_cpSpaceSetCollisionBias, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceSetCollisionPersistence", JSB_cpSpaceSetCollisionPersistence, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceSetCollisionSlop", JSB_cpSpaceSetCollisionSlop, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceSetDamping", JSB_cpSpaceSetDamping, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceSetEnableContactGraph", JSB_cpSpaceSetEnableContactGraph, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceSetGravity", JSB_cpSpaceSetGravity, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceSetIdleSpeedThreshold", JSB_cpSpaceSetIdleSpeedThreshold, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceSetIterations", JSB_cpSpaceSetIterations, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceSetSleepTimeThreshold", JSB_cpSpaceSetSleepTimeThreshold, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceStep", JSB_cpSpaceStep, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceUseSpatialHash", JSB_cpSpaceUseSpatialHash, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "fabs", JSB_cpfabs, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "fclamp", JSB_cpfclamp, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "fclamp01", JSB_cpfclamp01, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "flerp", JSB_cpflerp, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "flerpconst", JSB_cpflerpconst, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "fmax", JSB_cpfmax, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "fmin", JSB_cpfmin, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vadd", JSB_cpvadd, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vclamp", JSB_cpvclamp, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vcross", JSB_cpvcross, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vdist", JSB_cpvdist, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vdistsq", JSB_cpvdistsq, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vdot", JSB_cpvdot, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "veql", JSB_cpveql, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vforangle", JSB_cpvforangle, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vlength", JSB_cpvlength, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vlengthsq", JSB_cpvlengthsq, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vlerp", JSB_cpvlerp, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vlerpconst", JSB_cpvlerpconst, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vmult", JSB_cpvmult, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vnear", JSB_cpvnear, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vneg", JSB_cpvneg, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vnormalize", JSB_cpvnormalize, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vnormalize_safe", JSB_cpvnormalize_safe, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vperp", JSB_cpvperp, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vproject", JSB_cpvproject, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vrotate", JSB_cpvrotate, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vrperp", JSB_cpvrperp, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vslerp", JSB_cpvslerp, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vslerpconst", JSB_cpvslerpconst, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vsub", JSB_cpvsub, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vtoangle", JSB_cpvtoangle, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "vunrotate", JSB_cpvunrotate, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
|
||||
|
||||
#endif // JSB_INCLUDE_CHIPMUNK
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,103 @@
|
|||
/*
|
||||
* JS Bindings: https://github.com/zynga/jsbindings
|
||||
*
|
||||
* Copyright (c) 2012 Zynga Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __js_bindings_chipmunk_manual
|
||||
#define __js_bindings_chipmunk_manual
|
||||
|
||||
#include "js_bindings_config.h"
|
||||
#include "cocosjs_manual_conversions.h"
|
||||
#include "js_manual_conversions.h"
|
||||
#include "ScriptingCore.h"
|
||||
#ifdef JSB_INCLUDE_CHIPMUNK
|
||||
|
||||
#include "chipmunk.h"
|
||||
#include "jsapi.h"
|
||||
|
||||
#include "js_bindings_chipmunk_auto_classes.h"
|
||||
|
||||
// Free Functions
|
||||
JSBool JSB_cpSpaceAddCollisionHandler(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpaceRemoveCollisionHandler(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
|
||||
JSBool JSB_cpArbiterGetBodies(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpArbiterGetShapes(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
|
||||
JSBool JSB_cpBodyGetUserData(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBodySetUserData(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
|
||||
// poly related
|
||||
JSBool JSB_cpAreaForPoly(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpMomentForPoly(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpCentroidForPoly(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpRecenterPoly(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
|
||||
// "Methods" from the OO API
|
||||
JSBool JSB_cpSpace_addCollisionHandler(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpace_removeCollisionHandler(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
|
||||
// manually wrapped for rooting/unrooting purposes
|
||||
JSBool JSB_cpSpace_addBody(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpace_addConstraint(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpace_addShape(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpace_addStaticShape(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpace_removeBody(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpace_removeConstraint(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpace_removeShape(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpSpace_removeStaticShape(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
|
||||
|
||||
JSBool JSB_cpArbiter_getBodies(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpArbiter_getShapes(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
|
||||
JSBool JSB_cpBody_constructor(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBody_getUserData(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_cpBody_setUserData(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
|
||||
|
||||
// convertions
|
||||
|
||||
jsval cpBB_to_jsval(JSContext *cx, cpBB bb );
|
||||
JSBool jsval_to_cpBB( JSContext *cx, jsval vp, cpBB *ret );
|
||||
JSBool jsval_to_array_of_cpvect( JSContext *cx, jsval vp, cpVect**verts, int *numVerts);
|
||||
|
||||
// requires cocos2d
|
||||
#define cpVect_to_jsval CGPoint_to_jsval
|
||||
#define jsval_to_cpVect jsval_to_CGPoint
|
||||
|
||||
|
||||
// Object Oriented Chipmunk
|
||||
void JSB_cpBase_createClass(JSContext* cx, JSObject* globalObj, const char * name );
|
||||
extern JSObject* JSB_cpBase_object;
|
||||
extern JSClass* JSB_cpBase_class;
|
||||
extern void register_CCPhysicsSprite(JSContext *cx, JSObject *obj);
|
||||
extern void register_CCPhysicsDebugNode(JSContext *cx, JSObject *obj);
|
||||
|
||||
// Manual constructor / destructors
|
||||
JSBool JSB_cpPolyShape_constructor(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
void JSB_cpSpace_finalize(JSFreeOp *fop, JSObject *obj);
|
||||
|
||||
#endif // JSB_INCLUDE_CHIPMUNK
|
||||
|
||||
#endif // __js_bindings_chipmunk_manual
|
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* JS Bindings: https://github.com/zynga/jsbindings
|
||||
*
|
||||
* Copyright (c) 2012 Zynga Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef JSB_INCLUDE_CHIPMUNK
|
||||
#define JSB_INCLUDE_CHIPMUNK
|
||||
#endif
|
||||
|
||||
#include "js_bindings_config.h"
|
||||
#include "ScriptingCore.h"
|
||||
|
||||
|
||||
// chipmunk
|
||||
#include "js_bindings_chipmunk_auto_classes.h"
|
||||
#include "js_bindings_chipmunk_functions.h"
|
||||
#include "js_bindings_chipmunk_manual.h"
|
||||
|
||||
|
||||
void jsb_register_chipmunk(JSContext *_cx, JSObject *object)
|
||||
{
|
||||
//
|
||||
// Chipmunk
|
||||
//
|
||||
JSObject *chipmunk = JS_NewObject(_cx, NULL, NULL, NULL);
|
||||
jsval chipmunkVal = OBJECT_TO_JSVAL(chipmunk);
|
||||
JS_SetProperty(_cx, object, "cp", &chipmunkVal);
|
||||
|
||||
JSB_cpBase_createClass(_cx, chipmunk, "Base"); // manual base class registration
|
||||
#include "js_bindings_chipmunk_auto_classes_registration.h"
|
||||
#include "js_bindings_chipmunk_functions_registration.h"
|
||||
|
||||
// manual
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceAddCollisionHandler", JSB_cpSpaceAddCollisionHandler, 8, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "spaceRemoveCollisionHandler", JSB_cpSpaceRemoveCollisionHandler, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterGetBodies", JSB_cpArbiterGetBodies, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "arbiterGetShapes", JSB_cpArbiterGetShapes, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodyGetUserData", JSB_cpBodyGetUserData, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "bodySetUserData", JSB_cpBodySetUserData, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
|
||||
JS_DefineFunction(_cx, chipmunk, "areaForPoly", JSB_cpAreaForPoly, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "momentForPoly", JSB_cpMomentForPoly, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "centroidForPoly", JSB_cpCentroidForPoly, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, chipmunk, "recenterPoly", JSB_cpRecenterPoly, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
register_CCPhysicsSprite(_cx, object);
|
||||
register_CCPhysicsDebugNode(_cx, object);
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* JS Bindings: https://github.com/zynga/jsbindings
|
||||
*
|
||||
* Copyright (c) 2012 Zynga Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __JSB_CHIPMUNK_REGISTRATION
|
||||
#define __JSB_CHIPMUNK_REGISTRATION
|
||||
|
||||
void jsb_register_chipmunk( JSContext *globalC, JSObject *globalO);
|
||||
|
||||
#endif // __JSB_CHIPMUNK_REGISTRATION
|
|
@ -0,0 +1,121 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="js_bindings_chipmunk_auto_classes.h" />
|
||||
<ClInclude Include="js_bindings_chipmunk_auto_classes_registration.h" />
|
||||
<ClInclude Include="js_bindings_chipmunk_functions.h" />
|
||||
<ClInclude Include="js_bindings_chipmunk_functions_registration.h" />
|
||||
<ClInclude Include="js_bindings_chipmunk_manual.h" />
|
||||
<ClInclude Include="js_bindings_chipmunk_registration.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="js_bindings_chipmunk_auto_classes.cpp" />
|
||||
<ClCompile Include="js_bindings_chipmunk_functions.cpp" />
|
||||
<ClCompile Include="js_bindings_chipmunk_manual.cpp" />
|
||||
<ClCompile Include="js_bindings_chipmunk_registration.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{21070E58-EEC6-4E16-8B4F-6D083DF55790}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>libJSBindingForChipmunk</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>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
|
||||
</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" />
|
||||
<Import Project="..\..\..\..\2d\cocos2d_headers.props" />
|
||||
</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" />
|
||||
<Import Project="..\..\..\..\2d\cocos2d_headers.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>if not exist "$(OutDir)" mkdir "$(OutDir)"
|
||||
xcopy /Y /Q "$(ProjectDir)..\..\..\..\..\external\sqlite3\libraries\win32\*.*" "$(OutDir)"</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="generated">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="manual">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="js_bindings_chipmunk_auto_classes_registration.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="js_bindings_chipmunk_functions.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="js_bindings_chipmunk_functions_registration.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="js_bindings_chipmunk_manual.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="js_bindings_chipmunk_registration.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="js_bindings_chipmunk_auto_classes.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="js_bindings_chipmunk_functions.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="js_bindings_chipmunk_manual.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="js_bindings_chipmunk_registration.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="js_bindings_chipmunk_auto_classes.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ShowAllFiles>false</ShowAllFiles>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef __JS_COCOSBUILDER_SPECIFICS_H__
|
||||
#define __JS_COCOSBUILDER_SPECIFICS_H__
|
||||
|
||||
#include "../cocos2d_specifics.hpp"
|
||||
|
||||
class JSCCBAnimationWrapper: public JSCallbackWrapper {
|
||||
public:
|
||||
JSCCBAnimationWrapper() {}
|
||||
virtual ~JSCCBAnimationWrapper() {}
|
||||
|
||||
void animationCompleteCallback() {
|
||||
|
||||
JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
jsval retval = JSVAL_NULL;
|
||||
|
||||
if(!JSVAL_IS_VOID(_jsCallback) && !JSVAL_IS_VOID(_jsThisObj)) {
|
||||
JS_CallFunctionValue(cx, JSVAL_TO_OBJECT(_jsThisObj), _jsCallback, 0, NULL, &retval);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,324 @@
|
|||
//
|
||||
// js_bindings_ccbreader.cpp
|
||||
// watermelon
|
||||
//
|
||||
// Created by Rohan Kuruvilla on 14/08/2012.
|
||||
//
|
||||
//
|
||||
|
||||
#include "js_bindings_ccbreader.h"
|
||||
#include "ScriptingCore.h"
|
||||
#include "js_bindings_config.h"
|
||||
|
||||
USING_NS_CC;
|
||||
USING_NS_CC_EXT;
|
||||
using namespace cocosbuilder;
|
||||
|
||||
static void removeSelector(std::string &str) {
|
||||
size_t found;
|
||||
found = str.find(":");
|
||||
while (found!=std::string::npos){
|
||||
str.replace(found, found+1, "");
|
||||
found = str.find(":");
|
||||
}
|
||||
}
|
||||
|
||||
SEL_MenuHandler CCBScriptCallbackProxy::onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget,
|
||||
const char * pSelectorName) {
|
||||
this->callBackProp = pSelectorName;
|
||||
removeSelector(this->callBackProp);
|
||||
return menu_selector(CCBScriptCallbackProxy::menuItemCallback);
|
||||
}
|
||||
|
||||
Control::Handler CCBScriptCallbackProxy::onResolveCCBCCControlSelector(Object * pTarget,
|
||||
const char * pSelectorName) {
|
||||
|
||||
this->callBackProp = pSelectorName;
|
||||
removeSelector(this->callBackProp);
|
||||
return cccontrol_selector(CCBScriptCallbackProxy::controlCallback);
|
||||
}
|
||||
|
||||
bool CCBScriptCallbackProxy::onAssignCCBMemberVariable(Object * pTarget,
|
||||
const char * pMemberVariableName,
|
||||
Node * pNode) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void CCBScriptCallbackProxy::onNodeLoaded(Node * pNode,
|
||||
NodeLoader * pNodeLoader) {}
|
||||
|
||||
CCBSelectorResolver * CCBScriptCallbackProxy::createNew() {
|
||||
CCBScriptCallbackProxy * ret = new CCBScriptCallbackProxy();
|
||||
ret->setJSOwner(this->owner);
|
||||
return dynamic_cast<CCBSelectorResolver *>(ret);
|
||||
}
|
||||
|
||||
void CCBScriptCallbackProxy::menuItemCallback(Object *pSender) {
|
||||
ScriptingCore::getInstance()->executeFunctionWithOwner(owner, callBackProp.c_str() );
|
||||
}
|
||||
|
||||
void CCBScriptCallbackProxy::controlCallback(Object *pSender, Control::EventType event) {
|
||||
ScriptingCore::getInstance()->executeFunctionWithOwner(owner, callBackProp.c_str() );
|
||||
}
|
||||
|
||||
void CCBScriptCallbackProxy::setCallbackProperty(const char *prop) {
|
||||
callBackProp = prop;
|
||||
}
|
||||
|
||||
void CCBScriptCallbackProxy::setJSOwner(jsval ownr) {
|
||||
owner = ownr;
|
||||
}
|
||||
|
||||
jsval CCBScriptCallbackProxy::getJSOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
JSBool js_cocos2dx_CCBAnimationManager_animationCompleteCallback(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
if (argc >= 1) {
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
cocosbuilder::CCBAnimationManager *node = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);
|
||||
|
||||
JSCCBAnimationWrapper *tmpCobj = new JSCCBAnimationWrapper();
|
||||
tmpCobj->autorelease();
|
||||
|
||||
tmpCobj->setJSCallbackThis(argv[0]);
|
||||
if(argc >= 2) {
|
||||
tmpCobj->setJSCallbackFunc(argv[1]);
|
||||
}
|
||||
|
||||
node->setAnimationCompletedCallback(tmpCobj, callfunc_selector(JSCCBAnimationWrapper::animationCompleteCallback));
|
||||
|
||||
JS_SetReservedSlot(proxy->obj, 0, argv[0]);
|
||||
JS_SetReservedSlot(proxy->obj, 1, argv[1]);
|
||||
return JS_TRUE;
|
||||
}
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
JSBool js_cocos2dx_CCBReader_readNodeGraphFromFile(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
JSBool ok = JS_TRUE;
|
||||
JSObject *obj;
|
||||
cocosbuilder::CCBReader* cobj;
|
||||
obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);
|
||||
TEST_NATIVE_OBJECT(cx, cobj)
|
||||
|
||||
if (argc == 2) {
|
||||
const char* arg0;
|
||||
std::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();
|
||||
cocos2d::Object* arg1;
|
||||
do {
|
||||
js_proxy_t *proxy;
|
||||
JSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);
|
||||
proxy = jsb_get_js_proxy(tmpObj);
|
||||
arg1 = (cocos2d::Object*)(proxy ? proxy->ptr : NULL);
|
||||
TEST_NATIVE_OBJECT(cx, arg1)
|
||||
} while (0);
|
||||
|
||||
JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments");
|
||||
|
||||
cocos2d::Node* ret = cobj->readNodeGraphFromFile(arg0, arg1);
|
||||
jsval jsret; do {
|
||||
if (ret) {
|
||||
js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, ret);
|
||||
jsret = OBJECT_TO_JSVAL(proxy->obj);
|
||||
} else {
|
||||
jsret = JSVAL_NULL;
|
||||
}
|
||||
} while (0);
|
||||
JS_SET_RVAL(cx, vp, jsret);
|
||||
return JS_TRUE;
|
||||
}
|
||||
if (argc == 1) {
|
||||
const char* arg0;
|
||||
std::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();
|
||||
JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments");
|
||||
|
||||
cocos2d::Node* ret = cobj->readNodeGraphFromFile(arg0);
|
||||
jsval jsret; do {
|
||||
if (ret) {
|
||||
js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, ret);
|
||||
jsret = OBJECT_TO_JSVAL(proxy->obj);
|
||||
} else {
|
||||
jsret = JSVAL_NULL;
|
||||
}
|
||||
} while (0);
|
||||
JS_SET_RVAL(cx, vp, jsret);
|
||||
return JS_TRUE;
|
||||
}
|
||||
if (argc == 3) {
|
||||
const char* arg0;
|
||||
std::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();
|
||||
cocos2d::Object* arg1;
|
||||
do {
|
||||
js_proxy_t *proxy;
|
||||
JSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);
|
||||
proxy = jsb_get_js_proxy(tmpObj);
|
||||
arg1 = (cocos2d::Object*)(proxy ? proxy->ptr : NULL);
|
||||
TEST_NATIVE_OBJECT(cx, arg1)
|
||||
} while (0);
|
||||
cocos2d::Size arg2;
|
||||
ok &= jsval_to_ccsize(cx, argv[2], &arg2);
|
||||
|
||||
JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments");
|
||||
|
||||
cocos2d::Node* ret = cobj->readNodeGraphFromFile(arg0, arg1, arg2);
|
||||
jsval jsret; do {
|
||||
if (ret) {
|
||||
js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, ret);
|
||||
jsret = OBJECT_TO_JSVAL(proxy->obj);
|
||||
} else {
|
||||
jsret = JSVAL_NULL;
|
||||
}
|
||||
} while (0);
|
||||
JS_SET_RVAL(cx, vp, jsret);
|
||||
return JS_TRUE;
|
||||
}
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
JSBool js_cocos2dx_CCBReader_createSceneWithNodeGraphFromFile(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
JSBool ok = JS_TRUE;
|
||||
JSObject *obj;
|
||||
cocosbuilder::CCBReader* cobj;
|
||||
obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);
|
||||
TEST_NATIVE_OBJECT(cx, cobj)
|
||||
|
||||
if (argc == 2) {
|
||||
const char* arg0;
|
||||
std::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();
|
||||
cocos2d::Object* arg1;
|
||||
do {
|
||||
js_proxy_t *proxy;
|
||||
JSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);
|
||||
proxy = jsb_get_js_proxy(tmpObj);
|
||||
arg1 = (cocos2d::Object*)(proxy ? proxy->ptr : NULL);
|
||||
TEST_NATIVE_OBJECT(cx, arg1)
|
||||
} while (0);
|
||||
|
||||
JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments");
|
||||
|
||||
cocos2d::Scene* ret = cobj->createSceneWithNodeGraphFromFile(arg0, arg1);
|
||||
jsval jsret; do {
|
||||
if (ret) {
|
||||
js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Scene>(cx, ret);
|
||||
jsret = OBJECT_TO_JSVAL(proxy->obj);
|
||||
} else {
|
||||
jsret = JSVAL_NULL;
|
||||
}
|
||||
} while (0);
|
||||
JS_SET_RVAL(cx, vp, jsret);
|
||||
return JS_TRUE;
|
||||
}
|
||||
if (argc == 1) {
|
||||
const char* arg0;
|
||||
std::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();
|
||||
JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments");
|
||||
|
||||
cocos2d::Scene* ret = cobj->createSceneWithNodeGraphFromFile(arg0);
|
||||
jsval jsret; do {
|
||||
if (ret) {
|
||||
js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Scene>(cx, ret);
|
||||
jsret = OBJECT_TO_JSVAL(proxy->obj);
|
||||
} else {
|
||||
jsret = JSVAL_NULL;
|
||||
}
|
||||
} while (0);
|
||||
JS_SET_RVAL(cx, vp, jsret);
|
||||
return JS_TRUE;
|
||||
}
|
||||
if (argc == 3) {
|
||||
const char* arg0;
|
||||
std::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();
|
||||
cocos2d::Object* arg1;
|
||||
do {
|
||||
js_proxy_t *proxy;
|
||||
JSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);
|
||||
proxy = jsb_get_js_proxy(tmpObj);
|
||||
arg1 = (cocos2d::Object*)(proxy ? proxy->ptr : NULL);
|
||||
TEST_NATIVE_OBJECT(cx, arg1)
|
||||
} while (0);
|
||||
cocos2d::Size arg2;
|
||||
ok &= jsval_to_ccsize(cx, argv[2], &arg2);
|
||||
|
||||
JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments");
|
||||
|
||||
cocos2d::Scene* ret = cobj->createSceneWithNodeGraphFromFile(arg0, arg1, arg2);
|
||||
jsval jsret; do {
|
||||
if (ret) {
|
||||
js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Scene>(cx, ret);
|
||||
jsret = OBJECT_TO_JSVAL(proxy->obj);
|
||||
} else {
|
||||
jsret = JSVAL_NULL;
|
||||
}
|
||||
} while (0);
|
||||
JS_SET_RVAL(cx, vp, jsret);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
|
||||
JSBool js_CocosBuilder_create(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
|
||||
NodeLoaderLibrary * ccNodeLoaderLibrary = NodeLoaderLibrary::getInstance();
|
||||
|
||||
ccNodeLoaderLibrary->registerNodeLoader("", JSLayerLoader::loader());
|
||||
|
||||
CCBReader * ret = new CCBReader(ccNodeLoaderLibrary);
|
||||
ret->autorelease();
|
||||
|
||||
jsval jsret;
|
||||
if (ret) {
|
||||
js_proxy_t *proxy = jsb_get_native_proxy(ret);
|
||||
if (proxy) {
|
||||
jsret = OBJECT_TO_JSVAL(proxy->obj);
|
||||
} else {
|
||||
// create a new js obj of that class
|
||||
proxy = js_get_or_create_proxy<CCBReader>(cx, ret);
|
||||
jsret = OBJECT_TO_JSVAL(proxy->obj);
|
||||
}
|
||||
} else {
|
||||
jsret = JSVAL_NULL;
|
||||
}
|
||||
JS_SET_RVAL(cx, vp, jsret);
|
||||
return JS_TRUE;
|
||||
|
||||
}
|
||||
|
||||
extern JSObject* jsb_CCBReader_prototype;
|
||||
extern JSObject* jsb_CCBAnimationManager_prototype;
|
||||
|
||||
void register_CCBuilderReader(JSContext *cx, JSObject *obj) {
|
||||
jsval nsval;
|
||||
JSObject *ns;
|
||||
JS_GetProperty(cx, obj, "cc", &nsval);
|
||||
if (nsval == JSVAL_VOID) {
|
||||
ns = JS_NewObject(cx, NULL, NULL, NULL);
|
||||
nsval = OBJECT_TO_JSVAL(ns);
|
||||
JS_SetProperty(cx, obj, "cc", &nsval);
|
||||
} else {
|
||||
JS_ValueToObject(cx, nsval, &ns);
|
||||
}
|
||||
obj = ns;
|
||||
|
||||
JSObject *tmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, obj, "(function () { return cc._Reader; })()"));
|
||||
JS_DefineFunction(cx, tmpObj, "create", js_CocosBuilder_create, 2, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, tmpObj, "loadScene", js_cocos2dx_CCBReader_createSceneWithNodeGraphFromFile, 2, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
|
||||
JS_DefineFunction(cx, jsb_CCBReader_prototype, "load", js_cocos2dx_CCBReader_readNodeGraphFromFile, 2, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_CCBAnimationManager_prototype, "setCompletedAnimationCallback", js_cocos2dx_CCBAnimationManager_animationCompleteCallback, 2, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
//
|
||||
// js_bindings_ccbreader.h
|
||||
// watermelon
|
||||
//
|
||||
// Created by Rohan Kuruvilla on 14/08/2012.
|
||||
//
|
||||
//
|
||||
#ifndef __JS_BINDINGS_CCBREADER_H__
|
||||
#define __JS_BINDINGS_CCBREADER_H__
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "cocosbuilder_specifics.hpp"
|
||||
#include "cocosbuilder/CocosBuilder.h"
|
||||
|
||||
class CCBScriptCallbackProxy: public cocos2d::Layer
|
||||
, public cocosbuilder::CCBSelectorResolver
|
||||
, public cocosbuilder::CCBMemberVariableAssigner {
|
||||
|
||||
std::string callBackProp;
|
||||
jsval owner;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
CCBScriptCallbackProxy () {}
|
||||
virtual ~CCBScriptCallbackProxy() {}
|
||||
|
||||
CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(CCBScriptCallbackProxy, create);
|
||||
virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget,
|
||||
const char * pSelectorName);
|
||||
|
||||
virtual cocos2d::extension::Control::Handler onResolveCCBCCControlSelector(cocos2d::Object * pTarget,
|
||||
const char * pSelectorName);
|
||||
virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName,
|
||||
cocos2d::Node * pNode);
|
||||
virtual void onNodeLoaded(cocos2d::Node * pNode,
|
||||
cocosbuilder::NodeLoader * pNodeLoader);
|
||||
|
||||
virtual CCBSelectorResolver * createNew();
|
||||
void menuItemCallback(Object *pSender);
|
||||
void controlCallback(Object *pSender, cocos2d::extension::Control::EventType event);
|
||||
void setCallbackProperty(const char *prop);
|
||||
void setJSOwner(jsval ownr);
|
||||
jsval getJSOwner();
|
||||
};
|
||||
|
||||
|
||||
class JSLayerLoader : public cocosbuilder::LayerLoader {
|
||||
public:
|
||||
CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(JSLayerLoader, loader);
|
||||
|
||||
protected:
|
||||
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCBScriptCallbackProxy);
|
||||
};
|
||||
|
||||
void register_CCBuilderReader(JSContext *cx, JSObject *global);
|
||||
JSBool js_CocosBuilder_Run(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
|
||||
#endif /* __JS_BINDINGS_CCBREADER_H__ */
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_builder_auto.cpp" />
|
||||
<ClCompile Include="js_bindings_ccbreader.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_builder_auto.hpp" />
|
||||
<ClInclude Include="cocosbuilder_specifics.hpp" />
|
||||
<ClInclude Include="js_bindings_ccbreader.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_builder_auto_api.js" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{F9DA0FC1-651B-457B-962E-A4D61CEBF5FD}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>libJSBindingForBuilder</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>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
|
||||
</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" />
|
||||
<Import Project="..\..\..\..\2d\cocos2d_headers.props" />
|
||||
</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" />
|
||||
<Import Project="..\..\..\..\2d\cocos2d_headers.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>if not exist "$(OutDir)" mkdir "$(OutDir)"
|
||||
xcopy /Y /Q "$(ProjectDir)..\..\..\..\..\external\sqlite3\libraries\win32\*.*" "$(OutDir)"</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="generated">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="manual">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_builder_auto.cpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="js_bindings_ccbreader.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_builder_auto.hpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="cocosbuilder_specifics.hpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="js_bindings_ccbreader.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_builder_auto_api.js">
|
||||
<Filter>generated</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ShowAllFiles>false</ShowAllFiles>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,229 @@
|
|||
//
|
||||
// jsb_cocos2dx_studio_manual.h
|
||||
//
|
||||
// Created by LinWenhai on 20/10/13.
|
||||
//
|
||||
//
|
||||
#include "jsb_cocos2dx_studio_manual.h"
|
||||
#include "ScriptingCore.h"
|
||||
#include "cocos2d_specifics.hpp"
|
||||
#include "cocostudio/CocoStudio.h"
|
||||
|
||||
class JSArmatureWrapper: public JSCallbackWrapper {
|
||||
public:
|
||||
JSArmatureWrapper();
|
||||
virtual ~JSArmatureWrapper();
|
||||
|
||||
virtual void setJSCallbackThis(jsval thisObj);
|
||||
|
||||
void movementCallbackFunc(cocostudio::Armature * pArmature, cocostudio::MovementEventType pMovementEventType, const char *pMovementId);
|
||||
void frameCallbackFunc(cocostudio::Bone *pBone, const char *frameEventName, int originFrameIndex, int currentFrameIndex);
|
||||
void addArmatureFileInfoAsyncCallbackFunc(float percent);
|
||||
|
||||
private:
|
||||
bool m_bNeedUnroot;
|
||||
};
|
||||
|
||||
JSArmatureWrapper::JSArmatureWrapper()
|
||||
: m_bNeedUnroot(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
JSArmatureWrapper::~JSArmatureWrapper()
|
||||
{
|
||||
if (m_bNeedUnroot)
|
||||
{
|
||||
JSObject *thisObj = JSVAL_TO_OBJECT(_jsThisObj);
|
||||
JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JS_RemoveObjectRoot(cx, &thisObj);
|
||||
}
|
||||
}
|
||||
|
||||
void JSArmatureWrapper::setJSCallbackThis(jsval _jsThisObj)
|
||||
{
|
||||
JSCallbackWrapper::setJSCallbackThis(_jsThisObj);
|
||||
|
||||
JSObject *thisObj = JSVAL_TO_OBJECT(_jsThisObj);
|
||||
js_proxy *p = jsb_get_js_proxy(thisObj);
|
||||
if (!p)
|
||||
{
|
||||
JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JS_AddObjectRoot(cx, &thisObj);
|
||||
m_bNeedUnroot = true;
|
||||
}
|
||||
}
|
||||
|
||||
void JSArmatureWrapper::movementCallbackFunc(cocostudio::Armature *pArmature, cocostudio::MovementEventType pMovementEventType, const char *pMovementId)
|
||||
{
|
||||
JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JSObject *thisObj = JSVAL_IS_VOID(_jsThisObj) ? NULL : JSVAL_TO_OBJECT(_jsThisObj);
|
||||
js_proxy_t *proxy = js_get_or_create_proxy(cx, pArmature);
|
||||
jsval retval;
|
||||
if (_jsCallback != JSVAL_VOID)
|
||||
{
|
||||
int movementEventType = (int)pMovementEventType;
|
||||
jsval movementVal = INT_TO_JSVAL(movementEventType);
|
||||
|
||||
jsval idVal = c_string_to_jsval(cx, pMovementId);
|
||||
|
||||
jsval valArr[3];
|
||||
valArr[0] = OBJECT_TO_JSVAL(proxy->obj);
|
||||
valArr[1] = movementVal;
|
||||
valArr[2] = idVal;
|
||||
|
||||
JS_AddValueRoot(cx, valArr);
|
||||
JS_CallFunctionValue(cx, thisObj, _jsCallback, 3, valArr, &retval);
|
||||
JS_RemoveValueRoot(cx, valArr);
|
||||
}
|
||||
}
|
||||
|
||||
void JSArmatureWrapper::addArmatureFileInfoAsyncCallbackFunc(float percent)
|
||||
{
|
||||
JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JSObject *thisObj = JSVAL_IS_VOID(_jsThisObj) ? NULL : JSVAL_TO_OBJECT(_jsThisObj);
|
||||
jsval retval;
|
||||
if (_jsCallback != JSVAL_VOID)
|
||||
{
|
||||
jsval percentVal = DOUBLE_TO_JSVAL(percent);
|
||||
|
||||
JS_AddValueRoot(cx, &percentVal);
|
||||
JS_CallFunctionValue(cx, thisObj, _jsCallback, 1, &percentVal, &retval);
|
||||
JS_RemoveValueRoot(cx, &percentVal);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void JSArmatureWrapper::frameCallbackFunc(cocostudio::Bone *pBone, const char *frameEventName, int originFrameIndex, int currentFrameIndex)
|
||||
{
|
||||
JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JSObject *thisObj = JSVAL_IS_VOID(_jsThisObj) ? NULL : JSVAL_TO_OBJECT(_jsThisObj);
|
||||
js_proxy_t *proxy = js_get_or_create_proxy(cx, pBone);
|
||||
jsval retval;
|
||||
if (_jsCallback != JSVAL_VOID)
|
||||
{
|
||||
jsval nameVal = c_string_to_jsval(cx, frameEventName);
|
||||
jsval originIndexVal = INT_TO_JSVAL(originFrameIndex);
|
||||
jsval currentIndexVal = INT_TO_JSVAL(currentFrameIndex);
|
||||
|
||||
jsval valArr[4];
|
||||
valArr[0] = OBJECT_TO_JSVAL(proxy->obj);
|
||||
valArr[1] = nameVal;
|
||||
valArr[2] = originIndexVal;
|
||||
valArr[3] = currentIndexVal;
|
||||
|
||||
JS_AddValueRoot(cx, valArr);
|
||||
JS_CallFunctionValue(cx, thisObj, _jsCallback, 4, valArr, &retval);
|
||||
JS_RemoveValueRoot(cx, valArr);
|
||||
}
|
||||
}
|
||||
|
||||
static JSBool js_cocos2dx_ArmatureAnimation_setMovementEventCallFunc(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
cocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if (argc == 2) {
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
|
||||
JSArmatureWrapper *tmpObj = new JSArmatureWrapper();
|
||||
tmpObj->autorelease();
|
||||
|
||||
tmpObj->setJSCallbackFunc(argv[0]);
|
||||
tmpObj->setJSCallbackThis(argv[1]);
|
||||
|
||||
cobj->setMovementEventCallFunc(tmpObj, movementEvent_selector(JSArmatureWrapper::movementCallbackFunc));
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
JS_ReportError(cx, "Invalid number of arguments");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
static JSBool js_cocos2dx_ArmatureAnimation_setFrameEventCallFunc(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
cocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if (argc == 2) {
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
|
||||
JSArmatureWrapper *tmpObj = new JSArmatureWrapper();
|
||||
tmpObj->autorelease();
|
||||
|
||||
tmpObj->setJSCallbackFunc(argv[0]);
|
||||
tmpObj->setJSCallbackThis(argv[1]);
|
||||
|
||||
cobj->setFrameEventCallFunc(tmpObj, frameEvent_selector(JSArmatureWrapper::frameCallbackFunc));
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
JS_ReportError(cx, "Invalid number of arguments");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
static JSBool jsb_Animation_addArmatureFileInfoAsyncCallFunc(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
cocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if (argc == 3) {
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
|
||||
JSArmatureWrapper *tmpObj = new JSArmatureWrapper();
|
||||
tmpObj->autorelease();
|
||||
|
||||
tmpObj->setJSCallbackFunc(argv[2]);
|
||||
tmpObj->setJSCallbackThis(argv[1]);
|
||||
|
||||
std::string ret;
|
||||
jsval_to_std_string(cx, argv[0], &ret);
|
||||
|
||||
cobj->addArmatureFileInfoAsync(ret.c_str(), tmpObj, schedule_selector(JSArmatureWrapper::addArmatureFileInfoAsyncCallbackFunc));
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if(argc == 5){
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
|
||||
JSArmatureWrapper *tmpObj = new JSArmatureWrapper();
|
||||
tmpObj->autorelease();
|
||||
|
||||
tmpObj->setJSCallbackFunc(argv[4]);
|
||||
tmpObj->setJSCallbackThis(argv[3]);
|
||||
|
||||
std::string imagePath;
|
||||
jsval_to_std_string(cx ,argv[0] , &imagePath);
|
||||
|
||||
std::string plistPath;
|
||||
jsval_to_std_string(cx ,argv[1] , &plistPath);
|
||||
|
||||
std::string configFilePath;
|
||||
jsval_to_std_string(cx ,argv[2] , &configFilePath);
|
||||
|
||||
cobj->addArmatureFileInfoAsync(imagePath.c_str(), plistPath.c_str(), configFilePath.c_str(), tmpObj, schedule_selector(JSArmatureWrapper::addArmatureFileInfoAsyncCallbackFunc));
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
JS_ReportError(cx, "Invalid number of arguments");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
extern JSObject* jsb_ArmatureAnimation_prototype;
|
||||
extern JSObject* jsb_ArmatureDataManager_prototype;
|
||||
|
||||
void register_all_cocos2dx_studio_manual(JSContext* cx, JSObject* global)
|
||||
{
|
||||
JS_DefineFunction(cx, jsb_ArmatureAnimation_prototype, "setMovementEventCallFunc", js_cocos2dx_ArmatureAnimation_setMovementEventCallFunc, 2, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
|
||||
JS_DefineFunction(cx, jsb_ArmatureAnimation_prototype, "setFrameEventCallFunc", js_cocos2dx_ArmatureAnimation_setFrameEventCallFunc, 2, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
|
||||
JS_DefineFunction(cx, jsb_ArmatureDataManager_prototype, "addArmatureFileInfoAsync", jsb_Animation_addArmatureFileInfoAsyncCallFunc, 3, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// jsb_cocos2dx_studio_manual.h
|
||||
//
|
||||
// Created by LinWenhai on 20/10/13.
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef __jsb_cocos2dx_studio_manual__
|
||||
#define __jsb_cocos2dx_studio_manual__
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "jsfriendapi.h"
|
||||
|
||||
void register_all_cocos2dx_studio_manual(JSContext* cx, JSObject* global);
|
||||
|
||||
#endif /* defined(__jsb_cocos2dx_studio_manual__) */
|
|
@ -0,0 +1,118 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_studio_auto.cpp" />
|
||||
<ClCompile Include="jsb_cocos2dx_studio_manual.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_studio_auto.hpp" />
|
||||
<ClInclude Include="jsb_cocos2dx_studio_manual.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_studio_auto_api.js" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{79D34511-E54E-410A-8BBA-EF175AD6C695}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>libJSBindingForStudio</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>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
|
||||
</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" />
|
||||
<Import Project="..\..\..\..\2d\cocos2d_headers.props" />
|
||||
</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" />
|
||||
<Import Project="..\..\..\..\2d\cocos2d_headers.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)external;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>if not exist "$(OutDir)" mkdir "$(OutDir)"
|
||||
xcopy /Y /Q "$(ProjectDir)..\..\..\..\..\external\sqlite3\libraries\win32\*.*" "$(OutDir)"</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)external;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="generated">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="manual">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_studio_auto.cpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jsb_cocos2dx_studio_manual.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_studio_auto.hpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="jsb_cocos2dx_studio_manual.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_studio_auto_api.js">
|
||||
<Filter>generated</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ShowAllFiles>false</ShowAllFiles>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,799 @@
|
|||
//
|
||||
// jsb_cocos2d_extension_manual.cpp
|
||||
//
|
||||
// Created by James Chen on 3/11/13.
|
||||
//
|
||||
//
|
||||
|
||||
#include "jsb_cocos2dx_extension_manual.h"
|
||||
#include "extensions/cocos-ext.h"
|
||||
#include "ScriptingCore.h"
|
||||
#include "cocos2d_specifics.hpp"
|
||||
|
||||
USING_NS_CC;
|
||||
USING_NS_CC_EXT;
|
||||
|
||||
|
||||
class JSB_ScrollViewDelegate
|
||||
: public Object
|
||||
, public ScrollViewDelegate
|
||||
{
|
||||
public:
|
||||
JSB_ScrollViewDelegate()
|
||||
: _JSDelegate(NULL)
|
||||
, _needUnroot(false)
|
||||
{}
|
||||
|
||||
virtual ~JSB_ScrollViewDelegate()
|
||||
{
|
||||
if (_needUnroot)
|
||||
{
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JS_RemoveObjectRoot(cx, &_JSDelegate);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void scrollViewDidScroll(ScrollView* view)
|
||||
{
|
||||
js_proxy_t * p = jsb_get_native_proxy(view);
|
||||
if (!p) return;
|
||||
|
||||
jsval arg = OBJECT_TO_JSVAL(p->obj);
|
||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), "scrollViewDidScroll", 1, &arg, NULL);
|
||||
}
|
||||
|
||||
virtual void scrollViewDidZoom(ScrollView* view)
|
||||
{
|
||||
js_proxy_t * p = jsb_get_native_proxy(view);
|
||||
if (!p) return;
|
||||
|
||||
jsval arg = OBJECT_TO_JSVAL(p->obj);
|
||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), "scrollViewDidZoom", 1, &arg, NULL);
|
||||
}
|
||||
|
||||
void setJSDelegate(JSObject* pJSDelegate)
|
||||
{
|
||||
_JSDelegate = pJSDelegate;
|
||||
|
||||
// Check whether the js delegate is a pure js object.
|
||||
js_proxy_t* p = jsb_get_js_proxy(_JSDelegate);
|
||||
if (!p)
|
||||
{
|
||||
_needUnroot = true;
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JS_AddNamedObjectRoot(cx, &_JSDelegate, "TableViewDelegate");
|
||||
}
|
||||
}
|
||||
private:
|
||||
JSObject* _JSDelegate;
|
||||
bool _needUnroot;
|
||||
};
|
||||
|
||||
static JSBool js_cocos2dx_CCScrollView_setDelegate(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if (argc == 1)
|
||||
{
|
||||
// save the delegate
|
||||
JSObject *jsDelegate = JSVAL_TO_OBJECT(argv[0]);
|
||||
JSB_ScrollViewDelegate* nativeDelegate = new JSB_ScrollViewDelegate();
|
||||
nativeDelegate->setJSDelegate(jsDelegate);
|
||||
|
||||
cobj->setUserObject(nativeDelegate);
|
||||
cobj->setDelegate(nativeDelegate);
|
||||
|
||||
nativeDelegate->release();
|
||||
|
||||
JS_SET_RVAL(cx, vp, JSVAL_VOID);
|
||||
return JS_TRUE;
|
||||
}
|
||||
JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
|
||||
#define KEY_TABLEVIEW_DATA_SOURCE "TableViewDataSource"
|
||||
#define KEY_TABLEVIEW_DELEGATE "TableViewDelegate"
|
||||
|
||||
class JSB_TableViewDelegate
|
||||
: public Object
|
||||
, public TableViewDelegate
|
||||
{
|
||||
public:
|
||||
JSB_TableViewDelegate()
|
||||
: _JSDelegate(NULL)
|
||||
, _needUnroot(false)
|
||||
{}
|
||||
|
||||
virtual ~JSB_TableViewDelegate()
|
||||
{
|
||||
if (_needUnroot)
|
||||
{
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JS_RemoveObjectRoot(cx, &_JSDelegate);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void scrollViewDidScroll(ScrollView* view)
|
||||
{
|
||||
callJSDelegate(view, "scrollViewDidScroll");
|
||||
}
|
||||
|
||||
virtual void scrollViewDidZoom(ScrollView* view)
|
||||
{
|
||||
callJSDelegate(view, "scrollViewDidZoom");
|
||||
}
|
||||
|
||||
virtual void tableCellTouched(TableView* table, TableViewCell* cell)
|
||||
{
|
||||
callJSDelegate(table, cell, "tableCellTouched");
|
||||
}
|
||||
|
||||
virtual void tableCellHighlight(TableView* table, TableViewCell* cell)
|
||||
{
|
||||
callJSDelegate(table, cell, "tableCellHighlight");
|
||||
}
|
||||
|
||||
virtual void tableCellUnhighlight(TableView* table, TableViewCell* cell)
|
||||
{
|
||||
callJSDelegate(table, cell, "tableCellUnhighlight");
|
||||
}
|
||||
|
||||
virtual void tableCellWillRecycle(TableView* table, TableViewCell* cell)
|
||||
{
|
||||
callJSDelegate(table, cell, "tableCellWillRecycle");
|
||||
}
|
||||
|
||||
void setJSDelegate(JSObject* pJSDelegate)
|
||||
{
|
||||
_JSDelegate = pJSDelegate;
|
||||
|
||||
// Check whether the js delegate is a pure js object.
|
||||
js_proxy_t* p = jsb_get_js_proxy(_JSDelegate);
|
||||
if (!p)
|
||||
{
|
||||
_needUnroot = true;
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JS_AddNamedObjectRoot(cx, &_JSDelegate, "TableViewDelegate");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
void callJSDelegate(ScrollView* view, std::string jsFunctionName)
|
||||
{
|
||||
js_proxy_t * p = jsb_get_native_proxy(view);
|
||||
if (!p) return;
|
||||
|
||||
jsval arg = OBJECT_TO_JSVAL(p->obj);
|
||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), jsFunctionName.c_str(), 1, &arg, NULL);
|
||||
}
|
||||
|
||||
void callJSDelegate(TableView* table, TableViewCell* cell, std::string jsFunctionName)
|
||||
{
|
||||
js_proxy_t * p = jsb_get_native_proxy(table);
|
||||
if (!p) return;
|
||||
|
||||
js_proxy_t * pCellProxy = jsb_get_native_proxy(cell);
|
||||
if (!pCellProxy) return;
|
||||
|
||||
jsval args[2];
|
||||
args[0] = OBJECT_TO_JSVAL(p->obj);
|
||||
args[1] = OBJECT_TO_JSVAL(pCellProxy->obj);
|
||||
|
||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), jsFunctionName.c_str(), 2, args, NULL);
|
||||
}
|
||||
|
||||
JSObject* _JSDelegate;
|
||||
bool _needUnroot;
|
||||
};
|
||||
|
||||
static JSBool js_cocos2dx_CCTableView_setDelegate(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if (argc == 1)
|
||||
{
|
||||
// save the delegate
|
||||
JSObject *jsDelegate = JSVAL_TO_OBJECT(argv[0]);
|
||||
JSB_TableViewDelegate* nativeDelegate = new JSB_TableViewDelegate();
|
||||
nativeDelegate->setJSDelegate(jsDelegate);
|
||||
|
||||
Dictionary* userDict = static_cast<Dictionary*>(cobj->getUserObject());
|
||||
if (NULL == userDict)
|
||||
{
|
||||
userDict = new Dictionary();
|
||||
cobj->setUserObject(userDict);
|
||||
userDict->release();
|
||||
}
|
||||
|
||||
userDict->setObject(nativeDelegate, KEY_TABLEVIEW_DELEGATE);
|
||||
|
||||
cobj->setDelegate(nativeDelegate);
|
||||
|
||||
nativeDelegate->release();
|
||||
|
||||
JS_SET_RVAL(cx, vp, JSVAL_VOID);
|
||||
return JS_TRUE;
|
||||
}
|
||||
JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
class JSB_TableViewDataSource
|
||||
: public Object
|
||||
, public TableViewDataSource
|
||||
{
|
||||
public:
|
||||
JSB_TableViewDataSource()
|
||||
: _JSTableViewDataSource(NULL)
|
||||
, _needUnroot(false)
|
||||
{}
|
||||
|
||||
virtual ~JSB_TableViewDataSource()
|
||||
{
|
||||
if (_needUnroot)
|
||||
{
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JS_RemoveObjectRoot(cx, &_JSTableViewDataSource);
|
||||
}
|
||||
}
|
||||
|
||||
virtual Size tableCellSizeForIndex(TableView *table, unsigned int idx)
|
||||
{
|
||||
jsval ret;
|
||||
bool ok = callJSDelegate(table, idx, "tableCellSizeForIndex", ret);
|
||||
if (!ok)
|
||||
{
|
||||
ok = callJSDelegate(table, "cellSizeForTable", ret);
|
||||
}
|
||||
if (ok)
|
||||
{
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
Size size;
|
||||
JSBool isSucceed = jsval_to_ccsize(cx, ret, &size);
|
||||
if (isSucceed) return size;
|
||||
}
|
||||
return Size::ZERO;
|
||||
|
||||
}
|
||||
|
||||
virtual TableViewCell* tableCellAtIndex(TableView *table, unsigned int idx)
|
||||
{
|
||||
jsval ret;
|
||||
bool ok = callJSDelegate(table, idx, "tableCellAtIndex", ret);
|
||||
if (ok)
|
||||
{
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
cocos2d::extension::TableViewCell* arg0;
|
||||
do {
|
||||
js_proxy_t *proxy;
|
||||
JSObject *tmpObj = JSVAL_TO_OBJECT(ret);
|
||||
proxy = jsb_get_js_proxy(tmpObj);
|
||||
arg0 = (cocos2d::extension::TableViewCell*)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( arg0, cx, NULL, "Invalid Native Object");
|
||||
} while (0);
|
||||
return arg0;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
virtual unsigned int numberOfCellsInTableView(TableView *table)
|
||||
{
|
||||
jsval ret;
|
||||
bool ok = callJSDelegate(table, "numberOfCellsInTableView", ret);
|
||||
if (ok)
|
||||
{
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
uint32_t count = 0;
|
||||
JSBool isSucceed = jsval_to_uint32(cx, ret, &count);
|
||||
if (isSucceed) return count;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void setTableViewDataSource(JSObject* pJSSource)
|
||||
{
|
||||
_JSTableViewDataSource = pJSSource;
|
||||
|
||||
// Check whether the js delegate is a pure js object.
|
||||
js_proxy_t* p = jsb_get_js_proxy(_JSTableViewDataSource);
|
||||
if (!p)
|
||||
{
|
||||
_needUnroot = true;
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JS_AddNamedObjectRoot(cx, &_JSTableViewDataSource, "TableViewDataSource");
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
bool callJSDelegate(TableView* table, std::string jsFunctionName, jsval& retVal)
|
||||
{
|
||||
js_proxy_t * p = jsb_get_native_proxy(table);
|
||||
if (!p) return false;
|
||||
|
||||
JSBool hasAction;
|
||||
jsval temp_retval;
|
||||
jsval dataVal = OBJECT_TO_JSVAL(p->obj);
|
||||
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JSObject* obj = _JSTableViewDataSource;
|
||||
|
||||
if (JS_HasProperty(cx, obj, jsFunctionName.c_str(), &hasAction) && hasAction)
|
||||
{
|
||||
if(!JS_GetProperty(cx, obj, jsFunctionName.c_str(), &temp_retval))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(temp_retval == JSVAL_VOID)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
JSAutoCompartment ac(cx, obj);
|
||||
JS_CallFunctionName(cx, obj, jsFunctionName.c_str(),
|
||||
1, &dataVal, &retVal);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool callJSDelegate(TableView* table, int idx, std::string jsFunctionName, jsval& retVal)
|
||||
{
|
||||
js_proxy_t * p = jsb_get_native_proxy(table);
|
||||
if (!p) return false;
|
||||
|
||||
|
||||
JSBool hasAction;
|
||||
jsval temp_retval;
|
||||
jsval dataVal[2];
|
||||
dataVal[0] = OBJECT_TO_JSVAL(p->obj);
|
||||
dataVal[1] = INT_TO_JSVAL(idx);
|
||||
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JSObject* obj = _JSTableViewDataSource;
|
||||
|
||||
if (JS_HasProperty(cx, obj, jsFunctionName.c_str(), &hasAction) && hasAction)
|
||||
{
|
||||
if(!JS_GetProperty(cx, obj, jsFunctionName.c_str(), &temp_retval))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(temp_retval == JSVAL_VOID)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
JSAutoCompartment ac(cx, obj);
|
||||
JS_CallFunctionName(cx, obj, jsFunctionName.c_str(),
|
||||
2, dataVal, &retVal);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
JSObject* _JSTableViewDataSource;
|
||||
bool _needUnroot;
|
||||
};
|
||||
|
||||
static JSBool js_cocos2dx_CCTableView_setDataSource(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
if (argc == 1)
|
||||
{
|
||||
JSB_TableViewDataSource* pNativeSource = new JSB_TableViewDataSource();
|
||||
pNativeSource->setTableViewDataSource(JSVAL_TO_OBJECT(argv[0]));
|
||||
|
||||
Dictionary* userDict = static_cast<Dictionary*>(cobj->getUserObject());
|
||||
if (NULL == userDict)
|
||||
{
|
||||
userDict = new Dictionary();
|
||||
cobj->setUserObject(userDict);
|
||||
userDict->release();
|
||||
}
|
||||
|
||||
userDict->setObject(pNativeSource, KEY_TABLEVIEW_DATA_SOURCE);
|
||||
|
||||
cobj->setDataSource(pNativeSource);
|
||||
|
||||
pNativeSource->release();
|
||||
|
||||
JS_SET_RVAL(cx, vp, JSVAL_VOID);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "wrong number of arguments");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
static JSBool js_cocos2dx_CCTableView_create(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
JSBool ok = JS_TRUE;
|
||||
if (argc == 3 || argc == 2)
|
||||
{
|
||||
|
||||
JSB_TableViewDataSource* pNativeSource = new JSB_TableViewDataSource();
|
||||
pNativeSource->setTableViewDataSource(JSVAL_TO_OBJECT(argv[0]));
|
||||
|
||||
cocos2d::Size arg1;
|
||||
ok &= jsval_to_ccsize(cx, argv[1], &arg1);
|
||||
cocos2d::extension::TableView* ret = NULL;
|
||||
ret = new TableView();
|
||||
ret->autorelease();
|
||||
|
||||
ret->setDataSource(pNativeSource);
|
||||
|
||||
jsval jsret;
|
||||
do {
|
||||
if (ret)
|
||||
{
|
||||
js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::TableView>(cx, ret);
|
||||
jsret = OBJECT_TO_JSVAL(proxy->obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
jsret = JSVAL_NULL;
|
||||
}
|
||||
} while (0);
|
||||
|
||||
if (argc == 2)
|
||||
{
|
||||
ret->initWithViewSize(arg1);
|
||||
}
|
||||
else
|
||||
{
|
||||
cocos2d::Node* arg2;
|
||||
do
|
||||
{
|
||||
js_proxy_t *proxy;
|
||||
JSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);
|
||||
proxy = jsb_get_js_proxy(tmpObj);
|
||||
arg2 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( arg2, cx, JS_FALSE, "Invalid Native Object");
|
||||
} while (0);
|
||||
JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments");
|
||||
ret->initWithViewSize(arg1, arg2);
|
||||
}
|
||||
ret->reloadData();
|
||||
|
||||
Dictionary* userDict = new Dictionary();
|
||||
userDict->setObject(pNativeSource, KEY_TABLEVIEW_DATA_SOURCE);
|
||||
ret->setUserObject(userDict);
|
||||
userDict->release();
|
||||
|
||||
pNativeSource->release();
|
||||
|
||||
JS_SET_RVAL(cx, vp, jsret);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "wrong number of arguments");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
class JSB_EditBoxDelegate
|
||||
: public Object
|
||||
, public EditBoxDelegate
|
||||
{
|
||||
public:
|
||||
JSB_EditBoxDelegate()
|
||||
: _JSDelegate(NULL)
|
||||
, _needUnroot(false)
|
||||
{}
|
||||
|
||||
virtual ~JSB_EditBoxDelegate()
|
||||
{
|
||||
if (_needUnroot)
|
||||
{
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JS_RemoveObjectRoot(cx, &_JSDelegate);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void editBoxEditingDidBegin(EditBox* editBox)
|
||||
{
|
||||
js_proxy_t * p = jsb_get_native_proxy(editBox);
|
||||
if (!p) return;
|
||||
|
||||
jsval arg = OBJECT_TO_JSVAL(p->obj);
|
||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), "editBoxEditingDidBegin", 1, &arg, NULL);
|
||||
}
|
||||
|
||||
virtual void editBoxEditingDidEnd(EditBox* editBox)
|
||||
{
|
||||
js_proxy_t * p = jsb_get_native_proxy(editBox);
|
||||
if (!p) return;
|
||||
|
||||
jsval arg = OBJECT_TO_JSVAL(p->obj);
|
||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), "editBoxEditingDidEnd", 1, &arg, NULL);
|
||||
}
|
||||
|
||||
virtual void editBoxTextChanged(EditBox* editBox, const std::string& text)
|
||||
{
|
||||
js_proxy_t * p = jsb_get_native_proxy(editBox);
|
||||
if (!p) return;
|
||||
|
||||
jsval dataVal[2];
|
||||
dataVal[0] = OBJECT_TO_JSVAL(p->obj);
|
||||
std::string arg1 = text;
|
||||
dataVal[1] = std_string_to_jsval(ScriptingCore::getInstance()->getGlobalContext(), arg1);
|
||||
|
||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), "editBoxTextChanged", 2, dataVal, NULL);
|
||||
}
|
||||
|
||||
virtual void editBoxReturn(EditBox* editBox)
|
||||
{
|
||||
js_proxy_t * p = jsb_get_native_proxy(editBox);
|
||||
if (!p) return;
|
||||
|
||||
jsval arg = OBJECT_TO_JSVAL(p->obj);
|
||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), "editBoxReturn", 1, &arg, NULL);
|
||||
}
|
||||
|
||||
void setJSDelegate(JSObject* pJSDelegate)
|
||||
{
|
||||
_JSDelegate = pJSDelegate;
|
||||
|
||||
// Check whether the js delegate is a pure js object.
|
||||
js_proxy_t* p = jsb_get_js_proxy(_JSDelegate);
|
||||
if (!p)
|
||||
{
|
||||
_needUnroot = true;
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JS_AddNamedObjectRoot(cx, &_JSDelegate, "TableViewDelegate");
|
||||
}
|
||||
}
|
||||
private:
|
||||
JSObject* _JSDelegate;
|
||||
bool _needUnroot;
|
||||
};
|
||||
|
||||
static JSBool js_cocos2dx_CCEditBox_setDelegate(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
cocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if (argc == 1)
|
||||
{
|
||||
// save the delegate
|
||||
JSObject *jsDelegate = JSVAL_TO_OBJECT(argv[0]);
|
||||
JSB_EditBoxDelegate* nativeDelegate = new JSB_EditBoxDelegate();
|
||||
nativeDelegate->setJSDelegate(jsDelegate);
|
||||
|
||||
cobj->setUserObject(nativeDelegate);
|
||||
cobj->setDelegate(nativeDelegate);
|
||||
|
||||
nativeDelegate->release();
|
||||
|
||||
JS_SET_RVAL(cx, vp, JSVAL_VOID);
|
||||
return JS_TRUE;
|
||||
}
|
||||
JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
class JSB_ControlButtonTarget : public Object
|
||||
{
|
||||
public:
|
||||
JSB_ControlButtonTarget()
|
||||
: _jsFunc(nullptr),
|
||||
_type(Control::EventType::TOUCH_DOWN),
|
||||
_jsTarget(nullptr),
|
||||
_needUnroot(false)
|
||||
{}
|
||||
|
||||
virtual ~JSB_ControlButtonTarget()
|
||||
{
|
||||
CCLOGINFO("In the destruction of JSB_ControlButtonTarget ...");
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
if (_needUnroot)
|
||||
{
|
||||
JS_RemoveObjectRoot(cx, &_jsTarget);
|
||||
}
|
||||
|
||||
JS_RemoveObjectRoot(cx, &_jsFunc);
|
||||
|
||||
for (auto iter = _jsNativeTargetMap.begin(); iter != _jsNativeTargetMap.end(); ++iter)
|
||||
{
|
||||
if (this == iter->second)
|
||||
{
|
||||
_jsNativeTargetMap.erase(iter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual void onEvent(Object *controlButton, Control::EventType event)
|
||||
{
|
||||
js_proxy_t * p;
|
||||
JS_GET_PROXY(p, controlButton);
|
||||
if (!p)
|
||||
{
|
||||
log("Failed to get proxy for control button");
|
||||
return;
|
||||
}
|
||||
|
||||
jsval dataVal[2];
|
||||
dataVal[0] = OBJECT_TO_JSVAL(p->obj);
|
||||
int arg1 = (int)event;
|
||||
dataVal[1] = INT_TO_JSVAL(arg1);
|
||||
jsval jsRet;
|
||||
|
||||
ScriptingCore::getInstance()->executeJSFunctionWithThisObj(OBJECT_TO_JSVAL(_jsTarget), OBJECT_TO_JSVAL(_jsFunc), 2, dataVal, &jsRet);
|
||||
}
|
||||
|
||||
void setJSTarget(JSObject* pJSTarget)
|
||||
{
|
||||
_jsTarget = pJSTarget;
|
||||
|
||||
js_proxy_t* p = jsb_get_js_proxy(_jsTarget);
|
||||
if (!p)
|
||||
{
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JS_AddNamedObjectRoot(cx, &_jsTarget, "JSB_ControlButtonTarget, target");
|
||||
_needUnroot = true;
|
||||
}
|
||||
}
|
||||
|
||||
void setJSAction(JSObject* jsFunc)
|
||||
{
|
||||
_jsFunc = jsFunc;
|
||||
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JS_AddNamedObjectRoot(cx, &_jsFunc, "JSB_ControlButtonTarget, func");
|
||||
}
|
||||
|
||||
void setEventType(Control::EventType type)
|
||||
{
|
||||
_type = type;
|
||||
}
|
||||
public:
|
||||
|
||||
static std::multimap<JSObject*, JSB_ControlButtonTarget*> _jsNativeTargetMap;
|
||||
JSObject* _jsFunc;
|
||||
Control::EventType _type;
|
||||
private:
|
||||
JSObject* _jsTarget;
|
||||
bool _needUnroot;
|
||||
};
|
||||
|
||||
std::multimap<JSObject*, JSB_ControlButtonTarget*> JSB_ControlButtonTarget::_jsNativeTargetMap;
|
||||
|
||||
static JSBool js_cocos2dx_CCControl_addTargetWithActionForControlEvents(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
cocos2d::extension::Control* cobj = (cocos2d::extension::Control *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
JSBool ok = JS_TRUE;
|
||||
if (argc == 3)
|
||||
{
|
||||
JSObject* jsDelegate = JSVAL_TO_OBJECT(argv[0]);
|
||||
JSObject* jsFunc = JSVAL_TO_OBJECT(argv[1]);
|
||||
Control::EventType arg2;
|
||||
ok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);
|
||||
JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing control event");
|
||||
|
||||
// Check whether the target already exists.
|
||||
auto range = JSB_ControlButtonTarget::_jsNativeTargetMap.equal_range(jsDelegate);
|
||||
for (auto it = range.first; it != range.second; ++it)
|
||||
{
|
||||
if (it->second->_jsFunc == jsFunc && arg2 == it->second->_type)
|
||||
{
|
||||
// Return true directly.
|
||||
JS_SET_RVAL(cx, vp, JSVAL_VOID);
|
||||
return JS_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// save the delegate
|
||||
JSB_ControlButtonTarget* nativeDelegate = new JSB_ControlButtonTarget();
|
||||
|
||||
nativeDelegate->setJSTarget(jsDelegate);
|
||||
nativeDelegate->setJSAction(jsFunc);
|
||||
nativeDelegate->setEventType(arg2);
|
||||
|
||||
Array* nativeDelegateArray = static_cast<Array*>(cobj->getUserObject());
|
||||
if (nullptr == nativeDelegateArray)
|
||||
{
|
||||
nativeDelegateArray = new Array();
|
||||
nativeDelegateArray->init();
|
||||
cobj->setUserObject(nativeDelegateArray); // The reference of nativeDelegateArray is added to 2
|
||||
nativeDelegateArray->release(); // Release nativeDelegateArray to make the reference to 1
|
||||
}
|
||||
|
||||
nativeDelegateArray->addObject(nativeDelegate); // The reference of nativeDelegate is added to 2
|
||||
nativeDelegate->release(); // Release nativeDelegate to make the reference to 1
|
||||
|
||||
cobj->addTargetWithActionForControlEvents(nativeDelegate, cccontrol_selector(JSB_ControlButtonTarget::onEvent), arg2);
|
||||
|
||||
JSB_ControlButtonTarget::_jsNativeTargetMap.insert(std::make_pair(jsDelegate, nativeDelegate));
|
||||
|
||||
JS_SET_RVAL(cx, vp, JSVAL_VOID);
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 3);
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
static JSBool js_cocos2dx_CCControl_removeTargetWithActionForControlEvents(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
cocos2d::extension::Control* cobj = (cocos2d::extension::Control *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
JSBool ok = JS_TRUE;
|
||||
if (argc == 3)
|
||||
{
|
||||
Control::EventType arg2;
|
||||
ok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);
|
||||
JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing control event");
|
||||
|
||||
obj = JSVAL_TO_OBJECT(argv[0]);
|
||||
JSObject* jsFunc = JSVAL_TO_OBJECT(argv[1]);
|
||||
|
||||
JSB_ControlButtonTarget* nativeTargetToRemoved = nullptr;
|
||||
|
||||
auto range = JSB_ControlButtonTarget::_jsNativeTargetMap.equal_range(obj);
|
||||
for (auto it = range.first; it != range.second; ++it)
|
||||
{
|
||||
if (it->second->_jsFunc == jsFunc && arg2 == it->second->_type)
|
||||
{
|
||||
nativeTargetToRemoved = it->second;
|
||||
JSB_ControlButtonTarget::_jsNativeTargetMap.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
cobj->removeTargetWithActionForControlEvents(nativeTargetToRemoved, cccontrol_selector(JSB_ControlButtonTarget::onEvent), arg2);
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 3);
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
extern JSObject* jsb_ScrollView_prototype;
|
||||
extern JSObject* jsb_TableView_prototype;
|
||||
extern JSObject* jsb_EditBox_prototype;
|
||||
extern JSObject* jsb_Control_prototype;
|
||||
|
||||
void register_all_cocos2dx_extension_manual(JSContext* cx, JSObject* global)
|
||||
{
|
||||
JS_DefineFunction(cx, jsb_ScrollView_prototype, "setDelegate", js_cocos2dx_CCScrollView_setDelegate, 1, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_TableView_prototype, "setDelegate", js_cocos2dx_CCTableView_setDelegate, 1, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_TableView_prototype, "setDataSource", js_cocos2dx_CCTableView_setDataSource, 1, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_EditBox_prototype, "setDelegate", js_cocos2dx_CCEditBox_setDelegate, 1, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_Control_prototype, "addTargetWithActionForControlEvents", js_cocos2dx_CCControl_addTargetWithActionForControlEvents, 3, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, jsb_Control_prototype, "removeTargetWithActionForControlEvents", js_cocos2dx_CCControl_removeTargetWithActionForControlEvents, 3, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
|
||||
JSObject *tmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, "(function () { return cc.TableView; })()"));
|
||||
JS_DefineFunction(cx, tmpObj, "create", js_cocos2dx_CCTableView_create, 3, JSPROP_READONLY | JSPROP_PERMANENT);
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// jsb_cocos2d_extension_manual.h
|
||||
//
|
||||
// Created by James Chen on 3/11/13.
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef __jsb_cocos2dx_extension_manual__
|
||||
#define __jsb_cocos2dx_extension_manual__
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "jsfriendapi.h"
|
||||
|
||||
void register_all_cocos2dx_extension_manual(JSContext* cx, JSObject* global);
|
||||
|
||||
#endif /* defined(__jsb_cocos2dx_extension_manual__) */
|
|
@ -0,0 +1,118 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_extension_auto.cpp" />
|
||||
<ClCompile Include="jsb_cocos2dx_extension_manual.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_extension_auto.hpp" />
|
||||
<ClInclude Include="jsb_cocos2dx_extension_manual.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_extension_auto_api.js" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{625F7391-9A91-48A1-8CFC-79508C822637}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>libJSBindingForExtension</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>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
|
||||
</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" />
|
||||
<Import Project="..\..\..\..\2d\cocos2d_headers.props" />
|
||||
</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" />
|
||||
<Import Project="..\..\..\..\2d\cocos2d_headers.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\network;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>if not exist "$(OutDir)" mkdir "$(OutDir)"
|
||||
xcopy /Y /Q "$(ProjectDir)..\..\..\..\..\external\sqlite3\libraries\win32\*.*" "$(OutDir)"</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\network;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="generated">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="manual">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_extension_auto.cpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jsb_cocos2dx_extension_manual.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_extension_auto.hpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="jsb_cocos2dx_extension_manual.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_extension_auto_api.js">
|
||||
<Filter>generated</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ShowAllFiles>false</ShowAllFiles>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* AUTOGENERATED FILE. DO NOT EDIT IT
|
||||
* Generated by "generate_js_bindings.py -c system_jsb.ini" on 2012-12-17
|
||||
* Script version: v0.5
|
||||
*/
|
||||
#include "cocos2d.h"
|
||||
#include "js_bindings_config.h"
|
||||
//#ifdef JSB_INCLUDE_SYSTEM
|
||||
|
||||
#include "local-storage/LocalStorage.h"
|
||||
|
||||
#include "jsfriendapi.h"
|
||||
#include "js_bindings_config.h"
|
||||
#include "js_bindings_core.h"
|
||||
#include "js_manual_conversions.h"
|
||||
#include "js_bindings_system_functions.h"
|
||||
#include "ScriptingCore.h"
|
||||
|
||||
USING_NS_CC;
|
||||
|
||||
// Arguments: char*
|
||||
// Ret value: const char*
|
||||
JSBool JSB_localStorageGetItem(JSContext *cx, uint32_t argc, jsval *vp) {
|
||||
JSB_PRECONDITION2( argc == 1, cx, JS_FALSE, "Invalid number of arguments" );
|
||||
jsval *argvp = JS_ARGV(cx,vp);
|
||||
JSBool ok = JS_TRUE;
|
||||
const char* arg0;
|
||||
|
||||
ok &= jsval_to_charptr( cx, *argvp++, &arg0 );
|
||||
JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments");
|
||||
const char* ret_val;
|
||||
|
||||
ret_val = localStorageGetItem((char*)arg0 );
|
||||
|
||||
jsval ret_jsval = c_string_to_jsval(cx, ret_val ? ret_val : "");
|
||||
JS_SET_RVAL(cx, vp, ret_jsval );
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
// Arguments: char*
|
||||
// Ret value: void
|
||||
JSBool JSB_localStorageRemoveItem(JSContext *cx, uint32_t argc, jsval *vp) {
|
||||
JSB_PRECONDITION2( argc == 1, cx, JS_FALSE, "Invalid number of arguments" );
|
||||
jsval *argvp = JS_ARGV(cx,vp);
|
||||
JSBool ok = JS_TRUE;
|
||||
const char* arg0;
|
||||
|
||||
ok &= jsval_to_charptr( cx, *argvp++, &arg0 );
|
||||
JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments");
|
||||
|
||||
localStorageRemoveItem((char*)arg0 );
|
||||
JS_SET_RVAL(cx, vp, JSVAL_VOID);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
// Arguments: char*, char*
|
||||
// Ret value: void
|
||||
JSBool JSB_localStorageSetItem(JSContext *cx, uint32_t argc, jsval *vp) {
|
||||
JSB_PRECONDITION2( argc == 2, cx, JS_FALSE, "Invalid number of arguments" );
|
||||
jsval *argvp = JS_ARGV(cx,vp);
|
||||
JSBool ok = JS_TRUE;
|
||||
const char* arg0; const char* arg1;
|
||||
|
||||
ok &= jsval_to_charptr( cx, *argvp++, &arg0 );
|
||||
ok &= jsval_to_charptr( cx, *argvp++, &arg1 );
|
||||
JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments");
|
||||
|
||||
localStorageSetItem((char*)arg0 , (char*)arg1 );
|
||||
JS_SET_RVAL(cx, vp, JSVAL_VOID);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//#endif // JSB_INCLUDE_SYSTEM
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* AUTOGENERATED FILE. DO NOT EDIT IT
|
||||
* Generated by "generate_js_bindings.py -c system_jsb.ini" on 2012-12-17
|
||||
* Script version: v0.5
|
||||
*/
|
||||
#include "js_bindings_config.h"
|
||||
//#ifdef JSB_INCLUDE_SYSTEM
|
||||
|
||||
//#include "LocalStorage.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
JSBool JSB_localStorageGetItem(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_localStorageRemoveItem(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
JSBool JSB_localStorageSetItem(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//#endif // JSB_INCLUDE_SYSTEM
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* AUTOGENERATED FILE. DO NOT EDIT IT
|
||||
* Generated by "generate_js_bindings.py -c system_jsb.ini" on 2012-12-17
|
||||
* Script version: v0.5
|
||||
*/
|
||||
#include "../js_bindings_config.h"
|
||||
//#ifdef JSB_INCLUDE_SYSTEM
|
||||
|
||||
//#include "LocalStorage.h"
|
||||
JS_DefineFunction(_cx, system, "getItem", JSB_localStorageGetItem, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, system, "removeItem", JSB_localStorageRemoveItem, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
JS_DefineFunction(_cx, system, "setItem", JSB_localStorageSetItem, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );
|
||||
|
||||
|
||||
//#endif // JSB_INCLUDE_SYSTEM
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* JS Bindings: https://github.com/zynga/jsbindings
|
||||
*
|
||||
* Copyright (c) 2012 Zynga Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "js_bindings_config.h"
|
||||
#include "js_bindings_core.h"
|
||||
#include "local-storage/LocalStorage.h"
|
||||
#include "cocos2d.h"
|
||||
|
||||
// system
|
||||
#include "js_bindings_system_functions.h"
|
||||
|
||||
|
||||
void jsb_register_system( JSContext *_cx, JSObject *object)
|
||||
{
|
||||
//
|
||||
// sys
|
||||
//
|
||||
JSObject *sys = JS_NewObject(_cx, NULL, NULL, NULL);
|
||||
jsval systemVal = OBJECT_TO_JSVAL(sys);
|
||||
JS_SetProperty(_cx, object, "sys", &systemVal);
|
||||
|
||||
|
||||
// sys.localStorage
|
||||
JSObject *ls = JS_NewObject(_cx, NULL, NULL, NULL);
|
||||
jsval lsVal = OBJECT_TO_JSVAL(ls);
|
||||
JS_SetProperty(_cx, sys, "localStorage", &lsVal);
|
||||
|
||||
// sys.localStorage functions
|
||||
JSObject *system = ls;
|
||||
#include "js_bindings_system_functions_registration.h"
|
||||
|
||||
|
||||
// Init DB with full path
|
||||
//NSString *path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
|
||||
//NSString *fullpath = [path stringByAppendingPathComponent:@"jsb.sqlite"];
|
||||
std::string strFilePath = cocos2d::FileUtils::getInstance()->getWritablePath();
|
||||
strFilePath += "/jsb.sqlite";
|
||||
localStorageInit(strFilePath.c_str());
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* JS Bindings: https://github.com/zynga/jsbindings
|
||||
*
|
||||
* Copyright (c) 2012 Zynga Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __JSB_SYSTEM_REGISTRATION
|
||||
#define __JSB_SYSTEM_REGISTRATION
|
||||
|
||||
void jsb_register_system( JSContext *globalC, JSObject *globalO);
|
||||
|
||||
#endif // __JSB_CHIPMUNK_REGISTRATION
|
|
@ -0,0 +1,116 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="js_bindings_system_functions.cpp" />
|
||||
<ClCompile Include="js_bindings_system_registration.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="js_bindings_system_functions.h" />
|
||||
<ClInclude Include="js_bindings_system_functions_registration.h" />
|
||||
<ClInclude Include="js_bindings_system_registration.h" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{68F5F371-BD7B-4C30-AE5B-0B08F22E0CDE}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>libJSBindingForLocalStorage</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>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
|
||||
</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" />
|
||||
<Import Project="..\..\..\..\2d\cocos2d_headers.props" />
|
||||
</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" />
|
||||
<Import Project="..\..\..\..\2d\cocos2d_headers.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)external;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\spidermonkey\include\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>if not exist "$(OutDir)" mkdir "$(OutDir)"
|
||||
xcopy /Y /Q "$(ProjectDir)..\..\..\..\..\external\sqlite3\libraries\win32\*.*" "$(OutDir)"</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)external;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\spidermonkey\include\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="generated">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="manual">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="js_bindings_system_functions.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="js_bindings_system_registration.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="js_bindings_system_functions.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="js_bindings_system_functions_registration.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="js_bindings_system_registration.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ShowAllFiles>false</ShowAllFiles>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,847 @@
|
|||
//
|
||||
// XMLHTTPRequest.cpp
|
||||
// XMLHttpRequest
|
||||
//
|
||||
// Created by Zynga 2013
|
||||
//
|
||||
// Heavy based on: https://github.com/funkaster/FakeWebGL/blob/master/FakeWebGL/WebGL/XMLHTTPRequest.cpp
|
||||
// Copyright (c) 2012 Rolando Abarca. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
|
||||
#include "XMLHTTPRequest.h"
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
//#pragma mark - MinXmlHttpRequest
|
||||
|
||||
/**
|
||||
* @brief Implementation for header retrieving.
|
||||
* @param header
|
||||
*/
|
||||
void MinXmlHttpRequest::_gotHeader(string header)
|
||||
{
|
||||
// Get Header and Set StatusText
|
||||
// Split String into Tokens
|
||||
char * cstr = new char [header.length()+1];
|
||||
|
||||
// check for colon.
|
||||
unsigned found_header_field = header.find_first_of(":");
|
||||
|
||||
if (found_header_field != std::string::npos)
|
||||
{
|
||||
// Found a header field.
|
||||
string http_field;
|
||||
string http_value;
|
||||
|
||||
http_field = header.substr(0,found_header_field);
|
||||
http_value = header.substr(found_header_field+1, header.length());
|
||||
|
||||
// Get rid of all \n
|
||||
if (!http_value.empty() && http_value[http_value.size() - 1] == '\n') {
|
||||
http_value.erase(http_value.size() - 1);
|
||||
}
|
||||
|
||||
_httpHeader[http_field] = http_value;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Seems like we have the response Code! Parse it and check for it.
|
||||
char * pch;
|
||||
strcpy(cstr, header.c_str());
|
||||
|
||||
pch = strtok(cstr," ");
|
||||
while (pch != NULL)
|
||||
{
|
||||
|
||||
stringstream ss;
|
||||
string val;
|
||||
|
||||
ss << pch;
|
||||
val = ss.str();
|
||||
unsigned found_http = val.find("HTTP");
|
||||
|
||||
// Check for HTTP Header to set statusText
|
||||
if (found_http != std::string::npos) {
|
||||
|
||||
stringstream mystream;
|
||||
|
||||
// Get Response Status
|
||||
pch = strtok (NULL, " ");
|
||||
mystream << pch;
|
||||
|
||||
pch = strtok (NULL, " ");
|
||||
mystream << " " << pch;
|
||||
|
||||
_statusText = mystream.str();
|
||||
|
||||
}
|
||||
|
||||
pch = strtok (NULL, " ");
|
||||
}
|
||||
}
|
||||
|
||||
CC_SAFE_DELETE_ARRAY(cstr);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set Request header for next call.
|
||||
* @param field Name of the Header to be set.
|
||||
* @param value Value of the Headerfield
|
||||
*/
|
||||
void MinXmlHttpRequest::_setRequestHeader(const char* field, const char* value)
|
||||
{
|
||||
stringstream header_s;
|
||||
stringstream value_s;
|
||||
string header;
|
||||
|
||||
map<string, string>::iterator iter = _requestHeader.find(field);
|
||||
|
||||
// Concatenate values when header exists.
|
||||
if (iter != _requestHeader.end())
|
||||
{
|
||||
value_s << iter->second << "," << value;
|
||||
}
|
||||
else
|
||||
{
|
||||
value_s << value;
|
||||
}
|
||||
|
||||
_requestHeader[field] = value_s.str();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief If headers has been set, pass them to curl.
|
||||
*
|
||||
*/
|
||||
void MinXmlHttpRequest::_setHttpRequestHeader()
|
||||
{
|
||||
std::vector<string> header;
|
||||
|
||||
for (auto it = _requestHeader.begin(); it != _requestHeader.end(); ++it)
|
||||
{
|
||||
const char* first = it->first.c_str();
|
||||
const char* second = it->second.c_str();
|
||||
size_t len = sizeof(char) * (strlen(first) + 3 + strlen(second));
|
||||
char* test = (char*) malloc(len);
|
||||
memset(test, 0,len);
|
||||
|
||||
strcpy(test, first);
|
||||
strcpy(test + strlen(first) , ": ");
|
||||
strcpy(test + strlen(first) + 2, second);
|
||||
|
||||
header.push_back(test);
|
||||
|
||||
free(test);
|
||||
|
||||
}
|
||||
|
||||
if (!header.empty())
|
||||
{
|
||||
_httpRequest->setHeaders(header);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Callback for HTTPRequest. Handles the response and invokes Callback.
|
||||
* @param sender Object which initialized callback
|
||||
* @param respone Response object
|
||||
*/
|
||||
void MinXmlHttpRequest::handle_requestResponse(network::HttpClient *sender, network::HttpResponse *response)
|
||||
{
|
||||
if (0 != strlen(response->getHttpRequest()->getTag()))
|
||||
{
|
||||
CCLOG("%s completed", response->getHttpRequest()->getTag());
|
||||
}
|
||||
|
||||
int statusCode = response->getResponseCode();
|
||||
char statusString[64] = {};
|
||||
sprintf(statusString, "HTTP Status Code: %d, tag = %s", statusCode, response->getHttpRequest()->getTag());
|
||||
|
||||
if (!response->isSucceed())
|
||||
{
|
||||
CCLOG("response failed");
|
||||
CCLOG("error buffer: %s", response->getErrorBuffer());
|
||||
return;
|
||||
}
|
||||
|
||||
// set header
|
||||
std::vector<char> *headers = response->getResponseHeader();
|
||||
|
||||
char* concatHeader = (char*) malloc(headers->size() + 1);
|
||||
std::string header(headers->begin(), headers->end());
|
||||
strcpy(concatHeader, header.c_str());
|
||||
|
||||
std::istringstream stream(concatHeader);
|
||||
std::string line;
|
||||
while(std::getline(stream, line)) {
|
||||
_gotHeader(line);
|
||||
}
|
||||
|
||||
/** get the response data **/
|
||||
std::vector<char> *buffer = response->getResponseData();
|
||||
char* concatenated = (char*) malloc(buffer->size() + 1);
|
||||
std::string s2(buffer->begin(), buffer->end());
|
||||
|
||||
strcpy(concatenated, s2.c_str());
|
||||
|
||||
if (statusCode == 200)
|
||||
{
|
||||
//Succeeded
|
||||
_status = 200;
|
||||
_readyState = DONE;
|
||||
_data << concatenated;
|
||||
_dataSize = buffer->size();
|
||||
}
|
||||
else
|
||||
{
|
||||
_status = 0;
|
||||
}
|
||||
// Free Memory.
|
||||
free((void*) concatHeader);
|
||||
free((void*) concatenated);
|
||||
|
||||
js_proxy_t * p;
|
||||
void* ptr = (void*)this;
|
||||
p = jsb_get_native_proxy(ptr);
|
||||
|
||||
if(p)
|
||||
{
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
|
||||
if (_onreadystateCallback)
|
||||
{
|
||||
//JS_IsExceptionPending(cx) && JS_ReportPendingException(cx);
|
||||
jsval fval = OBJECT_TO_JSVAL(_onreadystateCallback);
|
||||
jsval out;
|
||||
JS_CallFunctionValue(cx, NULL, fval, 0, NULL, &out);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* @brief Send out request and fire callback when done.
|
||||
* @param cx Javascript context
|
||||
*/
|
||||
void MinXmlHttpRequest::_sendRequest(JSContext *cx)
|
||||
{
|
||||
_httpRequest->setResponseCallback(this, httpresponse_selector(MinXmlHttpRequest::handle_requestResponse));
|
||||
network::HttpClient::getInstance()->send(_httpRequest);
|
||||
_httpRequest->release();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Constructor initializes cchttprequest and stuff
|
||||
*
|
||||
*/
|
||||
MinXmlHttpRequest::MinXmlHttpRequest() : _onreadystateCallback(NULL), _isNetwork(true)
|
||||
{
|
||||
_httpHeader.clear();
|
||||
_requestHeader.clear();
|
||||
_withCredentialsValue = true;
|
||||
_cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
_httpRequest = new network::HttpRequest();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Destructor cleans up _httpRequest and stuff
|
||||
*
|
||||
*/
|
||||
MinXmlHttpRequest::~MinXmlHttpRequest()
|
||||
{
|
||||
_httpHeader.clear();
|
||||
_requestHeader.clear();
|
||||
|
||||
if (_onreadystateCallback != NULL)
|
||||
{
|
||||
JS_RemoveObjectRoot(_cx, &_onreadystateCallback);
|
||||
}
|
||||
|
||||
if (_httpRequest)
|
||||
{
|
||||
// We don't need to release _httpRequest here since it will be released in the http callback.
|
||||
// _httpRequest->release();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize Object and needed properties.
|
||||
*
|
||||
*/
|
||||
JS_BINDED_CLASS_GLUE_IMPL(MinXmlHttpRequest);
|
||||
|
||||
/**
|
||||
* @brief Implementation for the Javascript Constructor
|
||||
*
|
||||
*/
|
||||
JS_BINDED_CONSTRUCTOR_IMPL(MinXmlHttpRequest)
|
||||
{
|
||||
MinXmlHttpRequest* req = new MinXmlHttpRequest();
|
||||
req->autorelease();
|
||||
|
||||
js_proxy_t *p;
|
||||
jsval out;
|
||||
|
||||
JSObject *obj = JS_NewObject(cx, &MinXmlHttpRequest::js_class, MinXmlHttpRequest::js_proto, MinXmlHttpRequest::js_parent);
|
||||
|
||||
if (obj) {
|
||||
JS_SetPrivate(obj, req);
|
||||
out = OBJECT_TO_JSVAL(obj);
|
||||
}
|
||||
|
||||
JS_SET_RVAL(cx, vp, out);
|
||||
p =jsb_new_proxy(req, obj);
|
||||
|
||||
JS_AddNamedObjectRoot(cx, &p->obj, "XMLHttpRequest");
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get Callback function for Javascript
|
||||
*
|
||||
*/
|
||||
JS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, onreadystatechange)
|
||||
{
|
||||
if (_onreadystateCallback)
|
||||
{
|
||||
JSString *tmpstr = JS_NewStringCopyZ(cx, "1");
|
||||
jsval tmpval = STRING_TO_JSVAL(tmpstr);
|
||||
JS_SetProperty(cx, _onreadystateCallback, "readyState", &tmpval);
|
||||
|
||||
jsval out = OBJECT_TO_JSVAL(_onreadystateCallback);
|
||||
vp.set(out);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
vp.set(JSVAL_NULL);
|
||||
}
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set Callback function coming from Javascript
|
||||
*
|
||||
*
|
||||
*/
|
||||
JS_BINDED_PROP_SET_IMPL(MinXmlHttpRequest, onreadystatechange)
|
||||
{
|
||||
jsval callback = vp.get();
|
||||
if (callback != JSVAL_NULL)
|
||||
{
|
||||
_onreadystateCallback = JSVAL_TO_OBJECT(callback);
|
||||
JS_AddNamedObjectRoot(cx, &_onreadystateCallback, "onreadystateCallback");
|
||||
}
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief upload getter - TODO
|
||||
*
|
||||
* Placeholder for further implementations!!
|
||||
*/
|
||||
JS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, upload)
|
||||
{
|
||||
vp.set(JSVAL_NULL);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief upload setter - TODO
|
||||
*
|
||||
* Placeholder for further implementations
|
||||
*/
|
||||
JS_BINDED_PROP_SET_IMPL(MinXmlHttpRequest, upload)
|
||||
{
|
||||
vp.set(JSVAL_NULL);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief timeout getter - TODO
|
||||
*
|
||||
* Placeholder for further implementations
|
||||
*/
|
||||
JS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, timeout)
|
||||
{
|
||||
vp.set(INT_TO_JSVAL(_timeout));
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief timeout setter - TODO
|
||||
*
|
||||
* Placeholder for further implementations
|
||||
*/
|
||||
JS_BINDED_PROP_SET_IMPL(MinXmlHttpRequest, timeout)
|
||||
{
|
||||
jsval timeout_ms = vp.get();
|
||||
|
||||
_timeout = JSVAL_TO_INT(timeout_ms);
|
||||
//curl_easy_setopt(curlHandle, CURLOPT_CONNECTTIMEOUT_MS, timeout);
|
||||
return JS_TRUE;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get response type for actual XHR
|
||||
*
|
||||
*
|
||||
*/
|
||||
JS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, responseType)
|
||||
{
|
||||
JSString* str = JS_NewStringCopyN(cx, "", 0);
|
||||
vp.set(STRING_TO_JSVAL(str));
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief responseXML getter - TODO
|
||||
*
|
||||
* Placeholder for further implementation.
|
||||
*/
|
||||
JS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, responseXML)
|
||||
{
|
||||
vp.set(JSVAL_NULL);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief set response type for actual XHR
|
||||
*
|
||||
*
|
||||
*/
|
||||
JS_BINDED_PROP_SET_IMPL(MinXmlHttpRequest, responseType)
|
||||
{
|
||||
jsval type = vp.get();
|
||||
if (type.isString()) {
|
||||
JSString* str = type.toString();
|
||||
JSBool equal;
|
||||
|
||||
JS_StringEqualsAscii(cx, str, "text", &equal);
|
||||
if (equal)
|
||||
{
|
||||
_responseType = ResponseType::STRING;
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JS_StringEqualsAscii(cx, str, "arraybuffer", &equal);
|
||||
if (equal)
|
||||
{
|
||||
_responseType = ResponseType::ARRAY_BUFFER;
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JS_StringEqualsAscii(cx, str, "json", &equal);
|
||||
if (equal)
|
||||
{
|
||||
_responseType = ResponseType::JSON;
|
||||
return JS_TRUE;
|
||||
}
|
||||
// ignore the rest of the response types for now
|
||||
return JS_TRUE;
|
||||
}
|
||||
JS_ReportError(cx, "Invalid response type");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get readyState for actual XHR
|
||||
*
|
||||
*
|
||||
*/
|
||||
JS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, readyState)
|
||||
{
|
||||
vp.set(INT_TO_JSVAL(_readyState));
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get status for actual XHR
|
||||
*
|
||||
*
|
||||
*/
|
||||
JS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, status)
|
||||
{
|
||||
vp.set(INT_TO_JSVAL(_status));
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get statusText for actual XHR
|
||||
*
|
||||
*
|
||||
*/
|
||||
JS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, statusText)
|
||||
{
|
||||
jsval strVal = std_string_to_jsval(cx, _statusText);
|
||||
|
||||
if (strVal != JSVAL_NULL)
|
||||
{
|
||||
vp.set(strVal);
|
||||
return JS_TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
JS_ReportError(cx, "Error trying to create JSString from data");
|
||||
return JS_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get value of withCredentials property.
|
||||
*
|
||||
*/
|
||||
JS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, withCredentials)
|
||||
{
|
||||
vp.set(BOOLEAN_TO_JSVAL(_withCredentialsValue));
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* withCredentials - set value of withCredentials property.
|
||||
*
|
||||
*/
|
||||
JS_BINDED_PROP_SET_IMPL(MinXmlHttpRequest, withCredentials)
|
||||
{
|
||||
jsval credential = vp.get();
|
||||
if (credential != JSVAL_NULL)
|
||||
{
|
||||
_withCredentialsValue = JSVAL_TO_BOOLEAN(credential);
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get (raw) responseText
|
||||
*
|
||||
*/
|
||||
JS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, responseText)
|
||||
{
|
||||
jsval strVal = std_string_to_jsval(cx, _data.str());
|
||||
|
||||
if (strVal != JSVAL_NULL)
|
||||
{
|
||||
vp.set(strVal);
|
||||
//JS_ReportError(cx, "Result: %s", data.str().c_str());
|
||||
return JS_TRUE;
|
||||
} else {
|
||||
JS_ReportError(cx, "Error trying to create JSString from data");
|
||||
return JS_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get response of latest XHR
|
||||
*
|
||||
*/
|
||||
JS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, response)
|
||||
{
|
||||
|
||||
if (_responseType == ResponseType::JSON)
|
||||
{
|
||||
jsval outVal;
|
||||
|
||||
jsval strVal = std_string_to_jsval(cx, _data.str());
|
||||
if (JS_ParseJSON(cx, JS_GetStringCharsZ(cx, JSVAL_TO_STRING(strVal)), _dataSize, &outVal))
|
||||
{
|
||||
vp.set(outVal);
|
||||
return JS_TRUE;
|
||||
}
|
||||
}
|
||||
else if (_responseType == ResponseType::ARRAY_BUFFER)
|
||||
{
|
||||
JSObject* tmp = JS_NewArrayBuffer(cx, _dataSize);
|
||||
uint8_t* tmpData = JS_GetArrayBufferData(tmp);
|
||||
_data.read((char*)tmpData, _dataSize);
|
||||
jsval outVal = OBJECT_TO_JSVAL(tmp);
|
||||
|
||||
vp.set(outVal);
|
||||
return JS_TRUE;
|
||||
}
|
||||
// by default, return text
|
||||
return _js_get_responseText(cx, id, vp);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief initialize new xhr.
|
||||
*
|
||||
*/
|
||||
JS_BINDED_FUNC_IMPL(MinXmlHttpRequest, open)
|
||||
{
|
||||
if (argc >= 2)
|
||||
{
|
||||
jsval* argv = JS_ARGV(cx, vp);
|
||||
const char* method;
|
||||
const char* urlstr;
|
||||
JSBool async = true;
|
||||
JSString* jsMethod = JS_ValueToString(cx, argv[0]);
|
||||
JSString* jsURL = JS_ValueToString(cx, argv[1]);
|
||||
|
||||
if (argc > 2) {
|
||||
JS_ValueToBoolean(cx, argv[2], &async);
|
||||
}
|
||||
|
||||
JSStringWrapper w1(jsMethod);
|
||||
JSStringWrapper w2(jsURL);
|
||||
method = w1;
|
||||
urlstr = w2;
|
||||
|
||||
_url = urlstr;
|
||||
_meth = method;
|
||||
_readyState = 1;
|
||||
_isAsync = async;
|
||||
|
||||
if (_url.length() > 5 && _url.compare(_url.length() - 5, 5, ".json") == 0)
|
||||
{
|
||||
_responseType = ResponseType::JSON;
|
||||
}
|
||||
|
||||
if (_meth.compare("post") == 0 || _meth.compare("POST") == 0)
|
||||
{
|
||||
_httpRequest->setRequestType(network::HttpRequest::Type::POST);
|
||||
}
|
||||
else
|
||||
{
|
||||
_httpRequest->setRequestType(network::HttpRequest::Type::GET);
|
||||
}
|
||||
|
||||
_httpRequest->setUrl(_url.c_str());
|
||||
|
||||
_isNetwork = true;
|
||||
_readyState = OPENED;
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "invalid call: %s", __FUNCTION__);
|
||||
return JS_FALSE;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief send xhr
|
||||
*
|
||||
*/
|
||||
JS_BINDED_FUNC_IMPL(MinXmlHttpRequest, send)
|
||||
{
|
||||
JSString *str = NULL;
|
||||
std::string data;
|
||||
|
||||
// Clean up header map. New request, new headers!
|
||||
_httpHeader.clear();
|
||||
|
||||
if (argc == 1)
|
||||
{
|
||||
if (!JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), "S", &str))
|
||||
{
|
||||
return JS_FALSE;
|
||||
}
|
||||
JSStringWrapper strWrap(str);
|
||||
data = strWrap.get();
|
||||
}
|
||||
|
||||
|
||||
if (data.length() > 0 && (_meth.compare("post") == 0 || _meth.compare("POST") == 0))
|
||||
{
|
||||
_httpRequest->setRequestData(data.c_str(), data.length());
|
||||
}
|
||||
|
||||
_setHttpRequestHeader();
|
||||
_sendRequest(cx);
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief abort function Placeholder!
|
||||
*
|
||||
*/
|
||||
JS_BINDED_FUNC_IMPL(MinXmlHttpRequest, abort)
|
||||
{
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get all response headers as a string
|
||||
*
|
||||
*/
|
||||
JS_BINDED_FUNC_IMPL(MinXmlHttpRequest, getAllResponseHeaders)
|
||||
{
|
||||
stringstream responseheaders;
|
||||
string responseheader;
|
||||
|
||||
for (auto it = _httpHeader.begin(); it != _httpHeader.end(); ++it)
|
||||
{
|
||||
responseheaders << it->first << ": " << it->second << "\n";
|
||||
}
|
||||
|
||||
responseheader = responseheaders.str();
|
||||
|
||||
jsval strVal = std_string_to_jsval(cx, responseheader);
|
||||
if (strVal != JSVAL_NULL)
|
||||
{
|
||||
JS_SET_RVAL(cx, vp, strVal);
|
||||
return JS_TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
JS_ReportError(cx, "Error trying to create JSString from data");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get all response headers as a string
|
||||
*
|
||||
*/
|
||||
JS_BINDED_FUNC_IMPL(MinXmlHttpRequest, getResponseHeader)
|
||||
{
|
||||
JSString *header_value;
|
||||
|
||||
if (!JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), "S", &header_value)) {
|
||||
return JS_FALSE;
|
||||
};
|
||||
|
||||
std::string data;
|
||||
JSStringWrapper strWrap(header_value);
|
||||
data = strWrap.get();
|
||||
|
||||
stringstream streamdata;
|
||||
|
||||
streamdata << data;
|
||||
|
||||
string value = streamdata.str();
|
||||
|
||||
auto iter = _httpHeader.find(value);
|
||||
if (iter != _httpHeader.end())
|
||||
{
|
||||
jsval js_ret_val = std_string_to_jsval(cx, iter->second);
|
||||
JS_SET_RVAL(cx, vp, js_ret_val);
|
||||
return JS_TRUE;
|
||||
}
|
||||
else {
|
||||
JS_SET_RVAL(cx, vp, JSVAL_NULL);
|
||||
return JS_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the given Fields to request Header.
|
||||
*
|
||||
*
|
||||
*/
|
||||
JS_BINDED_FUNC_IMPL(MinXmlHttpRequest, setRequestHeader)
|
||||
{
|
||||
if (argc >= 2)
|
||||
{
|
||||
jsval* argv = JS_ARGV(cx, vp);
|
||||
const char* field;
|
||||
const char* value;
|
||||
|
||||
JSString* jsField = JS_ValueToString(cx, argv[0]);
|
||||
JSString* jsValue = JS_ValueToString(cx, argv[1]);
|
||||
|
||||
JSStringWrapper w1(jsField);
|
||||
JSStringWrapper w2(jsValue);
|
||||
field = w1;
|
||||
value = w2;
|
||||
|
||||
// Populate the request_header map.
|
||||
_setRequestHeader(field, value);
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
return JS_FALSE;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief overrideMimeType function - TODO!
|
||||
*
|
||||
* Just a placeholder for further implementations.
|
||||
*/
|
||||
JS_BINDED_FUNC_IMPL(MinXmlHttpRequest, overrideMimeType)
|
||||
{
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief destructor for Javascript
|
||||
*
|
||||
*/
|
||||
static void basic_object_finalize(JSFreeOp *freeOp, JSObject *obj)
|
||||
{
|
||||
CCLOG("basic_object_finalize %p ...", obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Register XMLHttpRequest to be usable in JS and add properties and Mehtods.
|
||||
* @param cx Global Spidermonkey JS Context.
|
||||
* @param global Global Spidermonkey Javascript object.
|
||||
*/
|
||||
void MinXmlHttpRequest::_js_register(JSContext *cx, JSObject *global)
|
||||
{
|
||||
JSClass js_class = {
|
||||
"XMLHttpRequest", JSCLASS_HAS_PRIVATE, JS_PropertyStub,
|
||||
JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
|
||||
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub,
|
||||
basic_object_finalize, JSCLASS_NO_OPTIONAL_MEMBERS
|
||||
};
|
||||
|
||||
MinXmlHttpRequest::js_class = js_class;
|
||||
static JSPropertySpec props[] = {
|
||||
JS_BINDED_PROP_DEF_ACCESSOR(MinXmlHttpRequest, onreadystatechange),
|
||||
JS_BINDED_PROP_DEF_ACCESSOR(MinXmlHttpRequest, responseType),
|
||||
JS_BINDED_PROP_DEF_ACCESSOR(MinXmlHttpRequest, withCredentials),
|
||||
JS_BINDED_PROP_DEF_GETTER(MinXmlHttpRequest, readyState),
|
||||
JS_BINDED_PROP_DEF_GETTER(MinXmlHttpRequest, status),
|
||||
JS_BINDED_PROP_DEF_GETTER(MinXmlHttpRequest, statusText),
|
||||
JS_BINDED_PROP_DEF_GETTER(MinXmlHttpRequest, responseText),
|
||||
JS_BINDED_PROP_DEF_GETTER(MinXmlHttpRequest, responseXML),
|
||||
JS_BINDED_PROP_DEF_GETTER(MinXmlHttpRequest, response),
|
||||
{0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
static JSFunctionSpec funcs[] = {
|
||||
JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, open),
|
||||
JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, abort),
|
||||
JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, send),
|
||||
JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, setRequestHeader),
|
||||
JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, getAllResponseHeaders),
|
||||
JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, getResponseHeader),
|
||||
JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, overrideMimeType),
|
||||
JS_FS_END
|
||||
};
|
||||
|
||||
MinXmlHttpRequest::js_parent = NULL;
|
||||
MinXmlHttpRequest::js_proto = JS_InitClass(cx, global, NULL, &MinXmlHttpRequest::js_class , MinXmlHttpRequest::_js_constructor, 0, props, funcs, NULL, NULL);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
//
|
||||
// XMLHTTPRequest.h
|
||||
// XMLHttpRequest
|
||||
//
|
||||
// Created by Zynga 2013
|
||||
//
|
||||
// Heavy based on: https://github.com/funkaster/FakeWebGL/blob/master/FakeWebGL/WebGL/XMLHTTPRequest.h
|
||||
// Copyright (c) 2012 Rolando Abarca. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
|
||||
#ifndef __FAKE_XMLHTTPREQUEST_H__
|
||||
#define __FAKE_XMLHTTPREQUEST_H__
|
||||
|
||||
#include "network/HttpClient.h"
|
||||
#include "js_bindings_config.h"
|
||||
#include "ScriptingCore.h"
|
||||
#include "jstypes.h"
|
||||
#include "jsapi.h"
|
||||
#include "jsfriendapi.h"
|
||||
#include "jsb_helper.h"
|
||||
|
||||
class MinXmlHttpRequest : public cocos2d::Object
|
||||
{
|
||||
public:
|
||||
enum class ResponseType
|
||||
{
|
||||
STRING,
|
||||
ARRAY_BUFFER,
|
||||
BLOB,
|
||||
DOCUMENT,
|
||||
JSON
|
||||
};
|
||||
|
||||
// Ready States (http://www.w3.org/TR/XMLHttpRequest/#interface-xmlhttprequest)
|
||||
static const unsigned short UNSENT = 0;
|
||||
static const unsigned short OPENED = 1;
|
||||
static const unsigned short HEADERS_RECEIVED = 2;
|
||||
static const unsigned short LOADING = 3;
|
||||
static const unsigned short DONE = 4;
|
||||
|
||||
MinXmlHttpRequest();
|
||||
~MinXmlHttpRequest();
|
||||
|
||||
JS_BINDED_CLASS_GLUE(MinXmlHttpRequest);
|
||||
JS_BINDED_CONSTRUCTOR(MinXmlHttpRequest);
|
||||
JS_BINDED_PROP_ACCESSOR(MinXmlHttpRequest, onreadystatechange);
|
||||
JS_BINDED_PROP_ACCESSOR(MinXmlHttpRequest, responseType);
|
||||
JS_BINDED_PROP_ACCESSOR(MinXmlHttpRequest, withCredentials);
|
||||
JS_BINDED_PROP_ACCESSOR(MinXmlHttpRequest, upload);
|
||||
JS_BINDED_PROP_ACCESSOR(MinXmlHttpRequest, timeout);
|
||||
JS_BINDED_PROP_GET(MinXmlHttpRequest, readyState);
|
||||
JS_BINDED_PROP_GET(MinXmlHttpRequest, status);
|
||||
JS_BINDED_PROP_GET(MinXmlHttpRequest, statusText);
|
||||
JS_BINDED_PROP_GET(MinXmlHttpRequest, responseText);
|
||||
JS_BINDED_PROP_GET(MinXmlHttpRequest, response);
|
||||
JS_BINDED_PROP_GET(MinXmlHttpRequest, responseXML);
|
||||
JS_BINDED_FUNC(MinXmlHttpRequest, open);
|
||||
JS_BINDED_FUNC(MinXmlHttpRequest, send);
|
||||
JS_BINDED_FUNC(MinXmlHttpRequest, abort);
|
||||
JS_BINDED_FUNC(MinXmlHttpRequest, getAllResponseHeaders);
|
||||
JS_BINDED_FUNC(MinXmlHttpRequest, getResponseHeader);
|
||||
JS_BINDED_FUNC(MinXmlHttpRequest, setRequestHeader);
|
||||
JS_BINDED_FUNC(MinXmlHttpRequest, overrideMimeType);
|
||||
|
||||
void handle_requestResponse(network::HttpClient *sender, network::HttpResponse *response);
|
||||
|
||||
|
||||
private:
|
||||
void _gotHeader(std::string header);
|
||||
void _setRequestHeader(const char* field, const char* value);
|
||||
void _setHttpRequestHeader();
|
||||
void _sendRequest(JSContext *cx);
|
||||
|
||||
std::string _url;
|
||||
JSContext* _cx;
|
||||
std::string _meth;
|
||||
std::string _type;
|
||||
std::stringstream _data;
|
||||
size_t _dataSize;
|
||||
JSObject* _onreadystateCallback;
|
||||
int _readyState;
|
||||
int _status;
|
||||
std::string _statusText;
|
||||
ResponseType _responseType;
|
||||
unsigned _timeout;
|
||||
bool _isAsync;
|
||||
network::HttpRequest* _httpRequest;
|
||||
bool _isNetwork;
|
||||
bool _withCredentialsValue;
|
||||
std::map<string, string> _httpHeader;
|
||||
std::map<string, string> _requestHeader;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,382 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2013 cocos2d-x.org
|
||||
Copyright (c) 2013 James Chen
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#include "jsb_websocket.h"
|
||||
#include "cocos2d.h"
|
||||
#include "network/WebSocket.h"
|
||||
#include "spidermonkey_specifics.h"
|
||||
#include "ScriptingCore.h"
|
||||
#include "cocos2d_specifics.hpp"
|
||||
|
||||
using namespace network;
|
||||
|
||||
/*
|
||||
[Constructor(in DOMString url, in optional DOMString protocols)]
|
||||
[Constructor(in DOMString url, in optional DOMString[] protocols)]
|
||||
interface WebSocket {
|
||||
readonly attribute DOMString url;
|
||||
|
||||
// ready state
|
||||
const unsigned short CONNECTING = 0;
|
||||
const unsigned short OPEN = 1;
|
||||
const unsigned short CLOSING = 2;
|
||||
const unsigned short CLOSED = 3;
|
||||
readonly attribute unsigned short readyState;
|
||||
readonly attribute unsigned long bufferedAmount;
|
||||
|
||||
// networking
|
||||
attribute Function onopen;
|
||||
attribute Function onmessage;
|
||||
attribute Function onerror;
|
||||
attribute Function onclose;
|
||||
readonly attribute DOMString protocol;
|
||||
void send(in DOMString data);
|
||||
void close();
|
||||
};
|
||||
WebSocket implements EventTarget;
|
||||
*/
|
||||
|
||||
class JSB_WebSocketDelegate : public WebSocket::Delegate
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void onOpen(WebSocket* ws)
|
||||
{
|
||||
js_proxy_t * p = jsb_get_native_proxy(ws);
|
||||
if (!p) return;
|
||||
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JSObject* jsobj = JS_NewObject(cx, NULL, NULL, NULL);
|
||||
jsval vp = c_string_to_jsval(cx, "open");
|
||||
JS_SetProperty(cx, jsobj, "type", &vp);
|
||||
|
||||
jsval args = OBJECT_TO_JSVAL(jsobj);
|
||||
|
||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), "onopen", 1, &args);
|
||||
}
|
||||
|
||||
virtual void onMessage(WebSocket* ws, const WebSocket::Data& data)
|
||||
{
|
||||
js_proxy_t * p = jsb_get_native_proxy(ws);
|
||||
if (!p) return;
|
||||
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JSObject* jsobj = JS_NewObject(cx, NULL, NULL, NULL);
|
||||
jsval vp = c_string_to_jsval(cx, "message");
|
||||
JS_SetProperty(cx, jsobj, "type", &vp);
|
||||
|
||||
jsval args = OBJECT_TO_JSVAL(jsobj);
|
||||
|
||||
if (data.isBinary)
|
||||
{// data is binary
|
||||
JSObject* buffer = JS_NewArrayBuffer(cx, data.len);
|
||||
uint8_t* bufdata = JS_GetArrayBufferData(buffer);
|
||||
memcpy((void*)bufdata, (void*)data.bytes, data.len);
|
||||
jsval dataVal = OBJECT_TO_JSVAL(buffer);
|
||||
JS_SetProperty(cx, jsobj, "data", &dataVal);
|
||||
}
|
||||
else
|
||||
{// data is string
|
||||
jsval dataVal = c_string_to_jsval(cx, data.bytes);
|
||||
JS_SetProperty(cx, jsobj, "data", &dataVal);
|
||||
}
|
||||
|
||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), "onmessage", 1, &args);
|
||||
}
|
||||
|
||||
virtual void onClose(WebSocket* ws)
|
||||
{
|
||||
js_proxy_t * p = jsb_get_native_proxy(ws);
|
||||
if (!p) return;
|
||||
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JSObject* jsobj = JS_NewObject(cx, NULL, NULL, NULL);
|
||||
jsval vp = c_string_to_jsval(cx, "close");
|
||||
JS_SetProperty(cx, jsobj, "type", &vp);
|
||||
|
||||
jsval args = OBJECT_TO_JSVAL(jsobj);
|
||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), "onclose", 1, &args);
|
||||
|
||||
js_proxy_t* jsproxy = jsb_get_js_proxy(p->obj);
|
||||
JS_RemoveObjectRoot(cx, &jsproxy->obj);
|
||||
jsb_remove_proxy(p, jsproxy);
|
||||
CC_SAFE_DELETE(ws);
|
||||
}
|
||||
|
||||
virtual void onError(WebSocket* ws, const WebSocket::ErrorCode& error)
|
||||
{
|
||||
js_proxy_t * p = jsb_get_native_proxy(ws);
|
||||
if (!p) return;
|
||||
|
||||
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
|
||||
JSObject* jsobj = JS_NewObject(cx, NULL, NULL, NULL);
|
||||
jsval vp = c_string_to_jsval(cx, "error");
|
||||
JS_SetProperty(cx, jsobj, "type", &vp);
|
||||
|
||||
jsval args = OBJECT_TO_JSVAL(jsobj);
|
||||
|
||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), "onerror", 1, &args);
|
||||
}
|
||||
|
||||
void setJSDelegate(JSObject* pJSDelegate)
|
||||
{
|
||||
_JSDelegate = pJSDelegate;
|
||||
}
|
||||
private:
|
||||
JSObject* _JSDelegate;
|
||||
};
|
||||
|
||||
JSClass *js_cocos2dx_websocket_class;
|
||||
JSObject *js_cocos2dx_websocket_prototype;
|
||||
|
||||
void js_cocos2dx_WebSocket_finalize(JSFreeOp *fop, JSObject *obj) {
|
||||
CCLOG("jsbindings: finalizing JS object %p (WebSocket)", obj);
|
||||
}
|
||||
|
||||
JSBool js_cocos2dx_extension_WebSocket_send(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
WebSocket* cobj = (WebSocket *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if(argc == 1){
|
||||
do
|
||||
{
|
||||
if (JSVAL_IS_STRING(argv[0]))
|
||||
{
|
||||
std::string data;
|
||||
jsval_to_std_string(cx, argv[0], &data);
|
||||
cobj->send(data);
|
||||
break;
|
||||
}
|
||||
|
||||
if (argv[0].isObject())
|
||||
{
|
||||
uint8_t *bufdata = NULL;
|
||||
uint32_t len = 0;
|
||||
|
||||
JSObject* jsobj = JSVAL_TO_OBJECT(argv[0]);
|
||||
if (JS_IsArrayBufferObject(jsobj))
|
||||
{
|
||||
bufdata = JS_GetArrayBufferData(jsobj);
|
||||
len = JS_GetArrayBufferByteLength(jsobj);
|
||||
}
|
||||
else if (JS_IsArrayBufferViewObject(jsobj))
|
||||
{
|
||||
bufdata = (uint8_t*)JS_GetArrayBufferViewData(jsobj);
|
||||
len = JS_GetArrayBufferViewByteLength(jsobj);
|
||||
}
|
||||
|
||||
if (bufdata && len > 0)
|
||||
{
|
||||
cobj->send(bufdata, len);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "data type to be sent is unsupported.");
|
||||
|
||||
} while (0);
|
||||
|
||||
JS_SET_RVAL(cx, vp, JSVAL_VOID);
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JSBool js_cocos2dx_extension_WebSocket_close(JSContext *cx, uint32_t argc, jsval *vp){
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
WebSocket* cobj = (WebSocket *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if(argc == 0){
|
||||
cobj->close();
|
||||
JS_SET_RVAL(cx, vp, JSVAL_VOID);
|
||||
return JS_TRUE;
|
||||
}
|
||||
JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
JSBool js_cocos2dx_extension_WebSocket_constructor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
|
||||
if (argc == 1 || argc == 2)
|
||||
{
|
||||
|
||||
std::string url;
|
||||
|
||||
do {
|
||||
JSBool ok = jsval_to_std_string(cx, argv[0], &url);
|
||||
JSB_PRECONDITION2( ok, cx, JS_FALSE, "Error processing arguments");
|
||||
} while (0);
|
||||
|
||||
JSObject *obj = JS_NewObject(cx, js_cocos2dx_websocket_class, js_cocos2dx_websocket_prototype, NULL);
|
||||
|
||||
|
||||
WebSocket* cobj = new WebSocket();
|
||||
JSB_WebSocketDelegate* delegate = new JSB_WebSocketDelegate();
|
||||
delegate->setJSDelegate(obj);
|
||||
|
||||
if (argc == 2)
|
||||
{
|
||||
std::vector<std::string> protocols;
|
||||
|
||||
if (JSVAL_IS_STRING(argv[1]))
|
||||
{
|
||||
std::string protocol;
|
||||
do {
|
||||
JSBool ok = jsval_to_std_string(cx, argv[1], &protocol);
|
||||
JSB_PRECONDITION2( ok, cx, JS_FALSE, "Error processing arguments");
|
||||
} while (0);
|
||||
protocols.push_back(protocol);
|
||||
}
|
||||
else if (argv[1].isObject())
|
||||
{
|
||||
JSBool ok = JS_TRUE;
|
||||
JSObject* arg2 = JSVAL_TO_OBJECT(argv[1]);
|
||||
JSB_PRECONDITION(JS_IsArrayObject( cx, arg2 ), "Object must be an array");
|
||||
|
||||
uint32_t len = 0;
|
||||
JS_GetArrayLength(cx, arg2, &len);
|
||||
|
||||
for( uint32_t i=0; i< len;i++ )
|
||||
{
|
||||
jsval valarg;
|
||||
JS_GetElement(cx, arg2, i, &valarg);
|
||||
std::string protocol;
|
||||
do {
|
||||
ok = jsval_to_std_string(cx, valarg, &protocol);
|
||||
JSB_PRECONDITION2( ok, cx, JS_FALSE, "Error processing arguments");
|
||||
} while (0);
|
||||
|
||||
protocols.push_back(protocol);
|
||||
}
|
||||
}
|
||||
cobj->init(*delegate, url, &protocols);
|
||||
}
|
||||
else
|
||||
{
|
||||
cobj->init(*delegate, url);
|
||||
}
|
||||
|
||||
|
||||
JS_DefineProperty(cx, obj, "URL", argv[0]
|
||||
, NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY);
|
||||
|
||||
//protocol not support yet (always return "")
|
||||
JS_DefineProperty(cx, obj, "protocol", c_string_to_jsval(cx, "")
|
||||
, NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY);
|
||||
|
||||
// link the native object with the javascript object
|
||||
js_proxy_t *p = jsb_new_proxy(cobj, obj);
|
||||
JS_AddNamedObjectRoot(cx, &p->obj, "WebSocket");
|
||||
|
||||
JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
static JSBool js_cocos2dx_extension_WebSocket_get_readyState(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp)
|
||||
{
|
||||
JSObject* jsobj = obj.get();
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(jsobj);
|
||||
WebSocket* cobj = (WebSocket *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
|
||||
|
||||
if (cobj) {
|
||||
vp.set(INT_TO_JSVAL((int)cobj->getReadyState()));
|
||||
return JS_TRUE;
|
||||
} else {
|
||||
JS_ReportError(cx, "Error: WebSocket instance is invalid.");
|
||||
return JS_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void register_jsb_websocket(JSContext *cx, JSObject *global) {
|
||||
|
||||
js_cocos2dx_websocket_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||
js_cocos2dx_websocket_class->name = "WebSocket";
|
||||
js_cocos2dx_websocket_class->addProperty = JS_PropertyStub;
|
||||
js_cocos2dx_websocket_class->delProperty = JS_DeletePropertyStub;
|
||||
js_cocos2dx_websocket_class->getProperty = JS_PropertyStub;
|
||||
js_cocos2dx_websocket_class->setProperty = JS_StrictPropertyStub;
|
||||
js_cocos2dx_websocket_class->enumerate = JS_EnumerateStub;
|
||||
js_cocos2dx_websocket_class->resolve = JS_ResolveStub;
|
||||
js_cocos2dx_websocket_class->convert = JS_ConvertStub;
|
||||
js_cocos2dx_websocket_class->finalize = js_cocos2dx_WebSocket_finalize;
|
||||
js_cocos2dx_websocket_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||
|
||||
static JSPropertySpec properties[] = {
|
||||
{"readyState", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_SHARED, JSOP_WRAPPER(js_cocos2dx_extension_WebSocket_get_readyState), NULL},
|
||||
{0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
static JSFunctionSpec funcs[] = {
|
||||
JS_FN("send",js_cocos2dx_extension_WebSocket_send, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("close",js_cocos2dx_extension_WebSocket_close, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FS_END
|
||||
};
|
||||
|
||||
static JSFunctionSpec st_funcs[] = {
|
||||
JS_FS_END
|
||||
};
|
||||
|
||||
js_cocos2dx_websocket_prototype = JS_InitClass(
|
||||
cx, global,
|
||||
NULL,
|
||||
js_cocos2dx_websocket_class,
|
||||
js_cocos2dx_extension_WebSocket_constructor, 0, // constructor
|
||||
properties,
|
||||
funcs,
|
||||
NULL, // no static properties
|
||||
st_funcs);
|
||||
|
||||
JSObject* jsclassObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, "(function () { return WebSocket; })()"));
|
||||
|
||||
JS_DefineProperty(cx, jsclassObj, "CONNECTING", INT_TO_JSVAL((int)WebSocket::State::CONNECTING)
|
||||
, NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY);
|
||||
JS_DefineProperty(cx, jsclassObj, "OPEN", INT_TO_JSVAL((int)WebSocket::State::OPEN)
|
||||
, NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY);
|
||||
JS_DefineProperty(cx, jsclassObj, "CLOSING", INT_TO_JSVAL((int)WebSocket::State::CLOSING)
|
||||
, NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY);
|
||||
JS_DefineProperty(cx, jsclassObj, "CLOSED", INT_TO_JSVAL((int)WebSocket::State::CLOSED)
|
||||
, NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY);
|
||||
|
||||
// make the class enumerable in the registered namespace
|
||||
JSBool found;
|
||||
JS_SetPropertyAttributes(cx, global, "WebSocket", JSPROP_ENUMERATE | JSPROP_READONLY, &found);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2013 cocos2d-x.org
|
||||
Copyright (c) 2013 James Chen
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __jsb_websocket__
|
||||
#define __jsb_websocket__
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "jsfriendapi.h"
|
||||
|
||||
void register_jsb_websocket(JSContext* cx, JSObject* global);
|
||||
|
||||
#endif /* defined(__jsb_websocket__) */
|
|
@ -0,0 +1,115 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="jsb_websocket.cpp" />
|
||||
<ClCompile Include="XMLHTTPRequest.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="jsb_websocket.h" />
|
||||
<ClInclude Include="XMLHTTPRequest.h" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{3BEC13F5-E227-4D80-BC77-1C857F83BCFC}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>libJSBindingForNetwork</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>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
|
||||
</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" />
|
||||
<Import Project="..\..\..\..\2d\cocos2d_headers.props" />
|
||||
</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" />
|
||||
<Import Project="..\..\..\..\2d\cocos2d_headers.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\network;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\websockets\include\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>if not exist "$(OutDir)" mkdir "$(OutDir)"
|
||||
xcopy /Y /Q "$(ProjectDir)..\..\..\..\..\external\sqlite3\libraries\win32\*.*" "$(OutDir)"</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\network;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\websockets\include\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="generated">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="manual">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="jsb_websocket.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="XMLHTTPRequest.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="jsb_websocket.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="XMLHTTPRequest.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ShowAllFiles>false</ShowAllFiles>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,93 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\LocalStorage.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\LocalStorage.h" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{632A8F38-D0F0-4D22-86B3-D69F5E6BF63A}</ProjectGuid>
|
||||
<RootNamespace>libLocalStorage</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<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" />
|
||||
<Import Project="..\..\..\2d\cocos2d_headers.props" />
|
||||
</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" />
|
||||
<Import Project="..\..\..\2d\cocos2d_headers.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
<IntDir>$(Configuration).win32\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>
|
||||
</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\sqlite3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>
|
||||
</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\sqlite3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<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,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{0310200c-b520-4f77-85f6-46f568b10f4d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{69cfa37c-4b20-409e-ad74-a26314878d8a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\LocalStorage.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\LocalStorage.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
Loading…
Reference in New Issue