Merge branch 'v3' of https://github.com/cocos2d/cocos2d-x into v3-audio909

Conflicts:
	build/cocos2d_libs.xcodeproj/project.pbxproj
This commit is contained in:
Dhilan007 2014-09-10 14:35:33 +08:00
commit fc27c5e32a
337 changed files with 2896 additions and 18935 deletions

2
.gitignore vendored
View File

@ -138,3 +138,5 @@ project.properties
/v*-deps-*.zip
/v*-lua-runtime-*.zip
/tools/fbx-conv/
external/chipmunk
tests/cpp-tests/Resources/audio

View File

@ -6,6 +6,8 @@ cocos2d-x-3.3?? ??
[NEW] Renderer: added TriangleCommand
[NEW] UI: added `WebView` on iOS and Android
[FIX] C++: CMake works for Mac builds
[FIX] C++: Reorganized cocos2d/platform folder. Easier to add new platforms
[FIX] EditBox: moved to ui:EditBox
[FIX] HttpClient: condition variable sleep on unrelated mutex
[FIX] Node: create unneeded temple `Vec2` object in `setPosition(int, int)`, `setPositionX()` and `setPositionY()`

View File

@ -27,8 +27,8 @@ cmake_minimum_required(VERSION 2.8)
project (Cocos2dx)
# The version number
set(Cocos2dxSamples_VERSION_MAJOR 3)
set(Cocos2dxSamples_VERSION_MINOR 1)
set(COCOS2D_X_VERSION 3.3.0)
#set(CMAKE_C_COMPILER_INIT g++)
include(build/BuildHelpers.CMakeLists.txt)
@ -58,10 +58,14 @@ if(WINDOWS)
ADD_DEFINITIONS (-D_USRDLL -DCOCOS2DXWIN32_EXPORTS -D_WINDOWS -DWIN32)
set(PLATFORM_FOLDER win32)
elseif(MACOSX)
ADD_DEFINITIONS (-DCC_TARGET_OS_MAC)
ADD_DEFINITIONS (-DUSE_FILE32API)
set(PLATFORM_FOLDER mac)
else(LINUX)
elseif(LINUX)
ADD_DEFINITIONS(-DLINUX)
set(PLATFORM_FOLDER linux)
else()
message( FATAL_ERROR "Unsupported platform, CMake will exit" )
endif()
if(MINGW)
@ -78,15 +82,28 @@ endif()
# architecture
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set(ARCH_DIR "64-bit")
set(ARCH_DIR "64-bit")
elseif ( CMAKE_SIZEOF_VOID_P EQUAL 4 )
set(ARCH_DIR "32-bit")
else()
set(ARCH_DIR "32-bit")
message( FATAL_ERROR "Unsupported architecture, CMake will exit" )
endif()
include_directories(
# Specific Include Directories
if(LINUX)
set(PLATFORM_INCLUDE_DIR
/usr/include
/usr/include/GLFW
/usr/local/include/GLFW
)
else()
set(PLATFORM_INCLUDE_DIR
${CMAKE_CURRENT_SOURCE_DIR}/external/glfw3/include/${PLATFORM_FOLDER}
)
endif()
include_directories(
${PLATFORM_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/cocos
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/cocos/platform/${PLATFORM_FOLDER}
@ -94,15 +111,33 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/external
)
link_directories(
# Specific Link Directories
if(LINUX)
set(PLATFORM_LINK_DIR
/usr/local/lib
${CMAKE_CURRENT_SOURCE_DIR}/external/jpeg/prebuilt/${PLATFORM_FOLDER}/${ARCH_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/external/tiff/prebuilt/${PLATFORM_FOLDER}/${ARCH_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/external/webp/prebuilt/${PLATFORM_FOLDER}/${ARCH_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/external/png/prebuilt/${PLATFORM_FOLDER}/${ARCH_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/external/freetype2/prebuilt/${PLATFORM_FOLDER}/${ARCH_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/external/websockets/prebuilt/${PLATFORM_FOLDER}/${ARCH_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/external/${PLATFORM_FOLDER}-specific/fmod/prebuilt/${ARCH_DIR}
)
set(PLATFORM_FOLDER_ARCH
${PLATFORM_FOLDER}/${ARCH_DIR}
)
else()
set(PLATFORM_FOLDER_ARCH
${PLATFORM_FOLDER}
)
set(PLATFORM_LINK_DIR
${CMAKE_CURRENT_SOURCE_DIR}/external/glfw3/prebuilt/${PLATFORM_FOLDER_ARCH}
)
endif()
link_directories(
${PLATFORM_LINK_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/external/jpeg/prebuilt/${PLATFORM_FOLDER_ARCH}
${CMAKE_CURRENT_SOURCE_DIR}/external/tiff/prebuilt/${PLATFORM_FOLDER_ARCH}
${CMAKE_CURRENT_SOURCE_DIR}/external/webp/prebuilt/${PLATFORM_FOLDER_ARCH}
${CMAKE_CURRENT_SOURCE_DIR}/external/png/prebuilt/${PLATFORM_FOLDER_ARCH}
${CMAKE_CURRENT_SOURCE_DIR}/external/freetype2/prebuilt/${PLATFORM_FOLDER_ARCH}
${CMAKE_CURRENT_SOURCE_DIR}/external/websockets/prebuilt/${PLATFORM_FOLDER_ARCH}
${CMAKE_CURRENT_SOURCE_DIR}/external/chipmunk/prebuilt/${PLATFORM_FOLDER_ARCH}
)
# libcocos2d.a

View File

@ -1,5 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\cocos2d_wp8.vcxproj", "{B5AF91B3-64EA-44E1-84B0-D759E93758FB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos\editor-support\spine\proj.wp8\libSpine.vcxproj", "{7D4FC6EB-9497-4804-98F3-3EAEDC896154}"
@ -24,8 +26,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "..\extensi
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Box2D", "..\external\Box2D\proj.wp8\Box2D.vcxproj", "{C55734A3-702C-4FA1-B950-32C8E169302F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chipmunk", "..\external\chipmunk\proj.wp8\chipmunk.vcxproj", "{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libLocalStorage", "..\cocos\storage\local-storage\proj.wp8\libLocalStorage.vcxproj", "{88982C27-5A7B-40A8-86E7-B3187B44B322}"
ProjectSection(ProjectDependencies) = postProject
{B5AF91B3-64EA-44E1-84B0-D759E93758FB} = {B5AF91B3-64EA-44E1-84B0-D759E93758FB}
@ -208,26 +208,6 @@ Global
{C55734A3-702C-4FA1-B950-32C8E169302F}.Release|x64.ActiveCfg = Release|Win32
{C55734A3-702C-4FA1-B950-32C8E169302F}.Release|x86.ActiveCfg = Release|Win32
{C55734A3-702C-4FA1-B950-32C8E169302F}.Release|x86.Build.0 = Release|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|Any CPU.ActiveCfg = Debug|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|ARM.ActiveCfg = Debug|ARM
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|ARM.Build.0 = Debug|ARM
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|Win32.ActiveCfg = Debug|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|Win32.Build.0 = Debug|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|x64.ActiveCfg = Debug|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|x86.ActiveCfg = Debug|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|x86.Build.0 = Debug|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|Any CPU.ActiveCfg = Release|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|ARM.ActiveCfg = Release|ARM
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|ARM.Build.0 = Release|ARM
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|Mixed Platforms.Build.0 = Release|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|Win32.ActiveCfg = Release|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|Win32.Build.0 = Release|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|x64.ActiveCfg = Release|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|x86.ActiveCfg = Release|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|x86.Build.0 = Release|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Debug|Any CPU.ActiveCfg = Debug|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Debug|ARM.ActiveCfg = Debug|ARM
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Debug|ARM.Build.0 = Debug|ARM

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,7 @@ THE SOFTWARE.
#include "2d/CCActionCamera.h"
#include "2d/CCNode.h"
#include "CCStdC.h"
#include "platform/CCStdC.h"
NS_CC_BEGIN
//

View File

@ -26,16 +26,17 @@ THE SOFTWARE.
****************************************************************************/
#include "2d/CCActionInterval.h"
#include <stdarg.h>
#include "2d/CCSprite.h"
#include "2d/CCNode.h"
#include "2d/CCSpriteFrame.h"
#include "CCStdC.h"
#include "2d/CCActionInstant.h"
#include "base/CCDirector.h"
#include "base/CCEventCustom.h"
#include "base/CCEventDispatcher.h"
#include <stdarg.h>
#include "platform/CCStdC.h"
NS_CC_BEGIN

View File

@ -27,7 +27,7 @@ THE SOFTWARE.
#ifndef __CC_ANIMATION_H__
#define __CC_ANIMATION_H__
#include "base/CCPlatformConfig.h"
#include "platform/CCPlatformConfig.h"
#include "base/CCRef.h"
#include "base/CCValue.h"
#include "base/CCVector.h"

View File

@ -29,7 +29,7 @@
#define __MISCNODE_CCCLIPPING_NODE_H__
#include "2d/CCNode.h"
#include "CCGL.h"
#include "platform/CCGL.h"
#include "renderer/CCGroupCommand.h"
#include "renderer/CCCustomCommand.h"

View File

@ -22,7 +22,6 @@
*/
#include "2d/CCDrawNode.h"
#include "CCGL.h"
#include "base/CCEventType.h"
#include "base/CCConfiguration.h"
#include "renderer/CCRenderer.h"
@ -31,6 +30,7 @@
#include "base/CCDirector.h"
#include "base/CCEventListenerCustom.h"
#include "base/CCEventDispatcher.h"
#include "platform/CCGL.h"
NS_CC_BEGIN

View File

@ -41,12 +41,12 @@ THE SOFTWARE.
#include <string.h>
#include <cmath>
#include "CCGL.h"
#include "2d/CCActionCatmullRom.h"
#include "base/CCDirector.h"
#include "renderer/ccGLStateCache.h"
#include "renderer/CCGLProgramCache.h"
#include "2d/CCActionCatmullRom.h"
#include "renderer/CCRenderer.h"
#include "platform/CCGL.h"
NS_CC_BEGIN
#ifndef M_PI

View File

@ -25,12 +25,13 @@
#ifndef _CCFontAtlas_h_
#define _CCFontAtlas_h_
#include "base/CCPlatformMacros.h"
#include "base/CCRef.h"
#include "CCStdC.h" // ssize_t on windows
#include <string>
#include <unordered_map>
#include "platform/CCPlatformMacros.h"
#include "base/CCRef.h"
#include "platform/CCStdC.h" // ssize_t on windows
NS_CC_BEGIN
//fwd

View File

@ -25,7 +25,7 @@ THE SOFTWARE.
#ifndef __CC_GL_BUFFERED_NODE__
#define __CC_GL_BUFFERED_NODE__
#include "CCGL.h"
#include "platform/CCGL.h"
class GLBufferedNode
{

View File

@ -27,7 +27,7 @@ THE SOFTWARE.
#define __EFFECTS_CCGRABBER_H__
#include "base/CCRef.h"
#include "CCGL.h"
#include "platform/CCGL.h"
NS_CC_BEGIN

View File

@ -34,7 +34,7 @@ THE SOFTWARE.
#include "renderer/ccGLStateCache.h"
#include "renderer/CCRenderer.h"
#include "renderer/CCTexture2D.h"
#include "CCGL.h"
#include "platform/CCGL.h"
NS_CC_BEGIN
// implementation of GridBase

View File

@ -26,7 +26,7 @@
#ifndef _CCLabelTextFormatter_h_
#define _CCLabelTextFormatter_h_
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
NS_CC_BEGIN

View File

@ -26,9 +26,9 @@ THE SOFTWARE.
#include "2d/CCMenu.h"
#include "base/CCDirector.h"
#include "base/CCTouch.h"
#include "CCStdC.h"
#include "base/CCEventListenerTouch.h"
#include "base/CCEventDispatcher.h"
#include "platform/CCStdC.h"
#include "deprecated/CCString.h"
#include <vector>

View File

@ -281,14 +281,6 @@ void Node::setSkewY(float skewY)
_transformUpdated = _transformDirty = _inverseDirty = true;
}
/// zOrder setter : private method
/// used internally to alter the zOrder variable. DON'T call this method manually
void Node::_setLocalZOrder(int z)
{
_localZOrder = z;
}
void Node::setLocalZOrder(int z)
{
if (_localZOrder == z)
@ -303,6 +295,13 @@ void Node::setLocalZOrder(int z)
_eventDispatcher->setDirtyForNode(this);
}
/// zOrder setter : private method
/// used internally to alter the zOrder variable. DON'T call this method manually
void Node::_setLocalZOrder(int z)
{
_localZOrder = z;
}
void Node::setGlobalZOrder(float globalZOrder)
{
if (_globalZOrder != globalZOrder)
@ -1172,7 +1171,7 @@ void Node::insertChild(Node* child, int z)
_transformUpdated = true;
_reorderChildDirty = true;
_children.pushBack(child);
child->_setLocalZOrder(z);
child->_localZOrder = z;
}
void Node::reorderChild(Node *child, int zOrder)
@ -1180,7 +1179,7 @@ void Node::reorderChild(Node *child, int zOrder)
CCASSERT( child != nullptr, "Child must be non-nil");
_reorderChildDirty = true;
child->setOrderOfArrival(s_globalOrderOfArrival++);
child->_setLocalZOrder(zOrder);
child->_localZOrder = zOrder;
}
void Node::sortAllChildren()

View File

@ -150,9 +150,11 @@ public:
virtual void setLocalZOrder(int localZOrder);
CC_DEPRECATED_ATTRIBUTE virtual void setZOrder(int localZOrder) { setLocalZOrder(localZOrder); }
/* Helper function used by `setLocalZOrder`. Don't use it unless you know what you are doing.
*/
virtual void _setLocalZOrder(int z);
CC_DEPRECATED_ATTRIBUTE virtual void _setLocalZOrder(int z);
/**
* Gets the local Z order of this node.
*

View File

@ -218,7 +218,7 @@ int ParticleBatchNode::addChildHelper(ParticleSystem* child, int z, int aTag, co
else
child->setName(name);
child->_setLocalZOrder(z);
child->setLocalZOrder(z);
child->setParent(this);
@ -285,7 +285,7 @@ void ParticleBatchNode::reorderChild(Node * aChild, int zOrder)
}
}
child->_setLocalZOrder(zOrder);
child->setLocalZOrder(zOrder);
}
void ParticleBatchNode::getCurrentIndex(int* oldIndex, int* newIndex, Node* child, int z)

View File

@ -249,7 +249,7 @@ void ProtectedNode::insertProtectedChild(cocos2d::Node *child, int z)
{
_reorderProtectedChildDirty = true;
_protectedChildren.pushBack(child);
child->_setLocalZOrder(z);
child->setLocalZOrder(z);
}
void ProtectedNode::sortAllProtectedChildren()
@ -265,7 +265,7 @@ void ProtectedNode::reorderProtectedChild(cocos2d::Node *child, int localZOrder)
CCASSERT( child != nullptr, "Child must be non-nil");
_reorderProtectedChildDirty = true;
child->setOrderOfArrival(s_globalOrderOfArrival++);
child->_setLocalZOrder(localZOrder);
child->setLocalZOrder(localZOrder);
}
void ProtectedNode::visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t parentFlags)

View File

@ -25,7 +25,7 @@ THE SOFTWARE.
#ifndef __CCTWEENFUNCTION_H__
#define __CCTWEENFUNCTION_H__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
NS_CC_BEGIN

View File

@ -93,8 +93,8 @@
</Link>
<Lib>
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>zlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;freetype.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(EngineRoot)external\wp8-specific\zlib\prebuilt\$(Platform);$(EngineRoot)external\png\prebuilt\wp8\$(Platform);$(EngineRoot)external\jpeg\prebuilt\wp8\$(Platform);$(EngineRoot)external\tiff\prebuilt\wp8\$(Platform);$(EngineRoot)external\freetype2\prebuilt\wp8\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>zlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;freetype.lib;ws2_32.lib;libchipmunk.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(EngineRoot)external\wp8-specific\zlib\prebuilt\$(Platform);$(EngineRoot)external\png\prebuilt\wp8\$(Platform);$(EngineRoot)external\jpeg\prebuilt\wp8\$(Platform);$(EngineRoot)external\tiff\prebuilt\wp8\$(Platform);$(EngineRoot)external\chipmunk\prebuilt\wp8\$(Platform);$(EngineRoot)external\freetype2\prebuilt\wp8\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -341,7 +341,7 @@
<ClCompile Include="..\platform\winrt\inet_ntop_winrt.cpp" />
<ClCompile Include="..\platform\winrt\InputEvent.cpp" />
<ClCompile Include="..\platform\winrt\sha1.cpp" />
<ClCompile Include="..\platform\wp8\CCGLViewImpl.cpp" />
<ClCompile Include="..\platform\wp8\CCGLViewImpl-wp8.cpp" />
<ClCompile Include="..\platform\wp8\Direct3DBase.cpp" />
<ClCompile Include="..\platform\wp8\DirectXBase.cpp" />
<ClCompile Include="..\platform\wp8\pch.cpp">
@ -495,8 +495,6 @@
<ClInclude Include="..\base\ccMacros.h" />
<ClInclude Include="..\base\CCMap.h" />
<ClInclude Include="..\base\CCNS.h" />
<ClInclude Include="..\base\CCPlatformConfig.h" />
<ClInclude Include="..\base\CCPlatformMacros.h" />
<ClInclude Include="..\base\CCProfiling.h" />
<ClInclude Include="..\base\CCProtocols.h" />
<ClInclude Include="..\base\ccRandom.h" />
@ -553,13 +551,19 @@
<ClInclude Include="..\physics\chipmunk\CCPhysicsJointInfo_chipmunk.h" />
<ClInclude Include="..\physics\chipmunk\CCPhysicsShapeInfo_chipmunk.h" />
<ClInclude Include="..\physics\chipmunk\CCPhysicsWorldInfo_chipmunk.h" />
<ClInclude Include="..\platform\CCApplication.h" />
<ClInclude Include="..\platform\CCApplicationProtocol.h" />
<ClInclude Include="..\platform\CCCommon.h" />
<ClInclude Include="..\platform\CCDevice.h" />
<ClInclude Include="..\platform\CCFileUtils.h" />
<ClInclude Include="..\platform\CCGL.h" />
<ClInclude Include="..\platform\CCGLView.h" />
<ClInclude Include="..\platform\CCImage.h" />
<ClInclude Include="..\platform\CCPlatformConfig.h" />
<ClInclude Include="..\platform\CCPlatformDefine.h" />
<ClInclude Include="..\platform\CCPlatformMacros.h" />
<ClInclude Include="..\platform\CCSAXParser.h" />
<ClInclude Include="..\platform\CCStdC.h" />
<ClInclude Include="..\platform\CCThread.h" />
<ClInclude Include="..\platform\winrt\CCApplication.h" />
<ClInclude Include="..\platform\winrt\CCFileUtilsWinRT.h" />
@ -576,7 +580,7 @@
<ClInclude Include="..\platform\winrt\InputEvent.h" />
<ClInclude Include="..\platform\winrt\InputEventTypes.h" />
<ClInclude Include="..\platform\winrt\sha1.h" />
<ClInclude Include="..\platform\wp8\CCGLViewImpl.h" />
<ClInclude Include="..\platform\wp8\CCGLViewImpl-wp8.h" />
<ClInclude Include="..\platform\wp8\Direct3DBase.h" />
<ClInclude Include="..\platform\wp8\DirectXBase.h" />
<ClInclude Include="..\platform\wp8\pch.h" />

View File

@ -611,9 +611,6 @@
<ClCompile Include="..\platform\CCGLView.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\wp8\CCGLViewImpl.cpp">
<Filter>platform\wp8</Filter>
</ClCompile>
<ClCompile Include="CCProtectedNode.cpp">
<Filter>2d</Filter>
</ClCompile>
@ -659,6 +656,9 @@
<ClCompile Include="..\3d\CCMeshVertexIndexData.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="..\platform\wp8\CCGLViewImpl-wp8.cpp">
<Filter>platform\wp8</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\physics\CCPhysicsBody.h">
@ -1105,12 +1105,6 @@
<ClInclude Include="..\base\CCNS.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\base\CCPlatformConfig.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\base\CCPlatformMacros.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\base\CCProfiling.h">
<Filter>base</Filter>
</ClInclude>
@ -1298,9 +1292,6 @@
<ClInclude Include="..\platform\CCGLView.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\wp8\CCGLViewImpl.h">
<Filter>platform\wp8</Filter>
</ClInclude>
<ClInclude Include="CCProtectedNode.h">
<Filter>2d</Filter>
</ClInclude>
@ -1346,6 +1337,27 @@
<ClInclude Include="..\3d\CCMeshVertexIndexData.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCApplication.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCGL.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCPlatformConfig.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCPlatformDefine.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCPlatformMacros.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCStdC.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\wp8\CCGLViewImpl-wp8.h">
<Filter>platform\wp8</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\math\Mat4.inl">

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -104,7 +104,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\zlib\prebuilt\*.*" "$(Ou
xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\icon\prebuilt\*.*" "$(OutDir)"
xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(OutDir)"
xcopy /Y /Q "$(ProjectDir)..\..\external\sqlite3\libraries\win32\*.*" "$(OutDir)"
xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\chipmunk\prebuilt\debug-lib\*.*" "$(OutDir)"</Command>
xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\debug-lib\*.*" "$(OutDir)"</Command>
</PreLinkEvent>
<Link>
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
@ -155,7 +155,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\websockets\prebuilt\win32\*.*" "$(OutDi
xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\zlib\prebuilt\*.*" "$(OutDir)"
xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\icon\prebuilt\*.*" "$(OutDir)"
xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(OutDir)"
xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\chipmunk\prebuilt\release-lib\*.*" "$(OutDir)"
xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*" "$(OutDir)"
</Command>
</PreLinkEvent>
<Link>
@ -374,12 +374,12 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\chipmunk\prebuilt\releas
<ClCompile Include="..\platform\CCImage.cpp" />
<ClCompile Include="..\platform\CCSAXParser.cpp" />
<ClCompile Include="..\platform\CCThread.cpp" />
<ClCompile Include="..\platform\desktop\CCGLViewImpl.cpp" />
<ClCompile Include="..\platform\win32\CCApplication.cpp" />
<ClCompile Include="..\platform\win32\CCCommon.cpp" />
<ClCompile Include="..\platform\win32\CCDevice.cpp" />
<ClCompile Include="..\platform\win32\CCFileUtilsWin32.cpp" />
<ClCompile Include="..\platform\win32\CCStdC.cpp" />
<ClCompile Include="..\platform\desktop\CCGLViewImpl-desktop.cpp" />
<ClCompile Include="..\platform\win32\CCApplication-win32.cpp" />
<ClCompile Include="..\platform\win32\CCCommon-win32.cpp" />
<ClCompile Include="..\platform\win32\CCDevice-win32.cpp" />
<ClCompile Include="..\platform\win32\CCFileUtils-win32.cpp" />
<ClCompile Include="..\platform\win32\CCStdC-win32.cpp" />
<ClCompile Include="..\renderer\CCBatchCommand.cpp" />
<ClCompile Include="..\renderer\CCCustomCommand.cpp" />
<ClCompile Include="..\renderer\CCGLProgram.cpp" />
@ -408,7 +408,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\chipmunk\prebuilt\releas
<ClCompile Include="..\ui\UICheckBox.cpp" />
<ClCompile Include="..\ui\UIDeprecated.cpp" />
<ClCompile Include="..\ui\UIEditBox\UIEditBox.cpp" />
<ClCompile Include="..\ui\UIEditBox\UIEditBoxImplWin.cpp" />
<ClCompile Include="..\ui\UIEditBox\UIEditBoxImpl-win32.cpp" />
<ClCompile Include="..\ui\UIHBox.cpp" />
<ClCompile Include="..\ui\UIHelper.cpp" />
<ClCompile Include="..\ui\UIImageView.cpp" />
@ -747,12 +747,12 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\chipmunk\prebuilt\releas
<ClInclude Include="..\platform\CCImage.h" />
<ClInclude Include="..\platform\CCSAXParser.h" />
<ClInclude Include="..\platform\CCThread.h" />
<ClInclude Include="..\platform\desktop\CCGLViewImpl.h" />
<ClInclude Include="..\platform\win32\CCApplication.h" />
<ClInclude Include="..\platform\win32\CCFileUtilsWin32.h" />
<ClInclude Include="..\platform\win32\CCGL.h" />
<ClInclude Include="..\platform\win32\CCPlatformDefine.h" />
<ClInclude Include="..\platform\win32\CCStdC.h" />
<ClInclude Include="..\platform\desktop\CCGLViewImpl-desktop.h" />
<ClInclude Include="..\platform\win32\CCApplication-win32.h" />
<ClInclude Include="..\platform\win32\CCFileUtils-win32.h" />
<ClInclude Include="..\platform\win32\CCGL-win32.h" />
<ClInclude Include="..\platform\win32\CCPlatformDefine-win32.h" />
<ClInclude Include="..\platform\win32\CCStdC-win32.h" />
<ClInclude Include="..\platform\win32\compat\stdint.h" />
<ClInclude Include="..\renderer\CCBatchCommand.h" />
<ClInclude Include="..\renderer\CCCustomCommand.h" />
@ -784,8 +784,8 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\chipmunk\prebuilt\releas
<ClInclude Include="..\ui\UICheckBox.h" />
<ClInclude Include="..\ui\UIDeprecated.h" />
<ClInclude Include="..\ui\UIEditBox\UIEditBox.h" />
<ClInclude Include="..\ui\UIEditBox\UIEditBoxImpl-win32.h" />
<ClInclude Include="..\ui\UIEditBox\UIEditBoxImpl.h" />
<ClInclude Include="..\ui\UIEditBox\UIEditBoxImplWin.h" />
<ClInclude Include="..\ui\UIHBox.h" />
<ClInclude Include="..\ui\UIHelper.h" />
<ClInclude Include="..\ui\UIImageView.h" />

View File

@ -631,21 +631,6 @@
<ClCompile Include="..\renderer\CCTextureCache.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="..\platform\win32\CCApplication.cpp">
<Filter>platform\win32</Filter>
</ClCompile>
<ClCompile Include="..\platform\win32\CCCommon.cpp">
<Filter>platform\win32</Filter>
</ClCompile>
<ClCompile Include="..\platform\win32\CCDevice.cpp">
<Filter>platform\win32</Filter>
</ClCompile>
<ClCompile Include="..\platform\win32\CCFileUtilsWin32.cpp">
<Filter>platform\win32</Filter>
</ClCompile>
<ClCompile Include="..\platform\win32\CCStdC.cpp">
<Filter>platform\win32</Filter>
</ClCompile>
<ClCompile Include="..\math\CCAffineTransform.cpp">
<Filter>math</Filter>
</ClCompile>
@ -718,9 +703,6 @@
<ClCompile Include="..\storage\local-storage\LocalStorage.cpp">
<Filter>storage</Filter>
</ClCompile>
<ClCompile Include="..\platform\desktop\CCGLViewImpl.cpp">
<Filter>platform\desktop</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCGLView.cpp">
<Filter>platform</Filter>
</ClCompile>
@ -1126,9 +1108,6 @@
<ClCompile Include="..\ui\UIEditBox\UIEditBox.cpp">
<Filter>ui\UIWidgets\EditBox</Filter>
</ClCompile>
<ClCompile Include="..\ui\UIEditBox\UIEditBoxImplWin.cpp">
<Filter>ui\UIWidgets\EditBox</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\GUI\CCControlExtension\CCControl.cpp">
<Filter>extension\GUI\CCControlExtensions</Filter>
</ClCompile>
@ -1165,6 +1144,27 @@
<ClCompile Include="..\ui\proj.win32\Win32InputBox.cpp">
<Filter>ui\UIWidgets\EditBox</Filter>
</ClCompile>
<ClCompile Include="..\platform\win32\CCApplication-win32.cpp">
<Filter>platform\win32</Filter>
</ClCompile>
<ClCompile Include="..\platform\win32\CCCommon-win32.cpp">
<Filter>platform\win32</Filter>
</ClCompile>
<ClCompile Include="..\platform\win32\CCDevice-win32.cpp">
<Filter>platform\win32</Filter>
</ClCompile>
<ClCompile Include="..\platform\win32\CCFileUtils-win32.cpp">
<Filter>platform\win32</Filter>
</ClCompile>
<ClCompile Include="..\platform\win32\CCStdC-win32.cpp">
<Filter>platform\win32</Filter>
</ClCompile>
<ClCompile Include="..\platform\desktop\CCGLViewImpl-desktop.cpp">
<Filter>platform\desktop</Filter>
</ClCompile>
<ClCompile Include="..\ui\UIEditBox\UIEditBoxImpl-win32.cpp">
<Filter>ui\UIWidgets\EditBox</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\physics\CCPhysicsBody.h">
@ -1639,21 +1639,6 @@
<ClInclude Include="..\platform\win32\compat\stdint.h">
<Filter>platform\win32\compat</Filter>
</ClInclude>
<ClInclude Include="..\platform\win32\CCApplication.h">
<Filter>platform\win32</Filter>
</ClInclude>
<ClInclude Include="..\platform\win32\CCFileUtilsWin32.h">
<Filter>platform\win32</Filter>
</ClInclude>
<ClInclude Include="..\platform\win32\CCGL.h">
<Filter>platform\win32</Filter>
</ClInclude>
<ClInclude Include="..\platform\win32\CCPlatformDefine.h">
<Filter>platform\win32</Filter>
</ClInclude>
<ClInclude Include="..\platform\win32\CCStdC.h">
<Filter>platform\win32</Filter>
</ClInclude>
<ClInclude Include="..\math\CCAffineTransform.h">
<Filter>math</Filter>
</ClInclude>
@ -1744,9 +1729,6 @@
<ClInclude Include="..\storage\local-storage\LocalStorage.h">
<Filter>storage</Filter>
</ClInclude>
<ClInclude Include="..\platform\desktop\CCGLViewImpl.h">
<Filter>platform\desktop</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCGLView.h">
<Filter>platform</Filter>
</ClInclude>
@ -2248,9 +2230,6 @@
<ClInclude Include="..\ui\UIEditBox\UIEditBoxImpl.h">
<Filter>ui\UIWidgets\EditBox</Filter>
</ClInclude>
<ClInclude Include="..\ui\UIEditBox\UIEditBoxImplWin.h">
<Filter>ui\UIWidgets\EditBox</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\GUI\CCControlExtension\CCControl.h">
<Filter>extension\GUI\CCControlExtensions</Filter>
</ClInclude>
@ -2290,6 +2269,27 @@
<ClInclude Include="..\ui\proj.win32\Win32InputBox.h">
<Filter>ui\UIWidgets\EditBox</Filter>
</ClInclude>
<ClInclude Include="..\platform\win32\CCApplication-win32.h">
<Filter>platform\win32</Filter>
</ClInclude>
<ClInclude Include="..\platform\win32\CCFileUtils-win32.h">
<Filter>platform\win32</Filter>
</ClInclude>
<ClInclude Include="..\platform\win32\CCGL-win32.h">
<Filter>platform\win32</Filter>
</ClInclude>
<ClInclude Include="..\platform\win32\CCPlatformDefine-win32.h">
<Filter>platform\win32</Filter>
</ClInclude>
<ClInclude Include="..\platform\win32\CCStdC-win32.h">
<Filter>platform\win32</Filter>
</ClInclude>
<ClInclude Include="..\platform\desktop\CCGLViewImpl-desktop.h">
<Filter>platform\desktop</Filter>
</ClInclude>
<ClInclude Include="..\ui\UIEditBox\UIEditBoxImpl-win32.h">
<Filter>ui\UIWidgets\EditBox</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\math\Mat4.inl">

View File

@ -25,11 +25,15 @@
#include "3d/CCAnimate3D.h"
#include "3d/CCSprite3D.h"
#include "3d/CCSkeleton3D.h"
#include "3d/CCMeshSkin.h"
#include "platform/CCFileUtils.h"
NS_CC_BEGIN
std::unordered_map<Sprite3D*, Animate3D*> Animate3D::s_fadeInAnimates;
std::unordered_map<Sprite3D*, Animate3D*> Animate3D::s_fadeOutAnimates;
std::unordered_map<Sprite3D*, Animate3D*> Animate3D::s_runningAnimates;
float Animate3D::_transTime = 0.1f;
//create Animate3D using Animation.
Animate3D* Animate3D::create(Animation3D* animation)
{
@ -107,6 +111,40 @@ void Animate3D::startWithTarget(Node *target)
{
CCLOG("warning: no animation finde for the skeleton");
}
auto runningAction = s_runningAnimates.find(sprite);
if (runningAction != s_runningAnimates.end())
{
//make the running action fade out
auto action = (*runningAction).second;
if (action != this)
{
s_fadeOutAnimates[sprite] = action;
action->_state = Animate3D::Animate3DState::FadeOut;
action->_accTransTime = 0.0f;
action->_weight = 1.0f;
action->_lastTime = 0.f;
s_fadeInAnimates[sprite] = this;
_accTransTime = 0.0f;
_state = Animate3D::Animate3DState::FadeIn;
_weight = 0.f;
_lastTime = 0.f;
}
}
else
{
s_runningAnimates[sprite] = this;
_state = Animate3D::Animate3DState::Running;
_weight = 1.0f;
}
}
void Animate3D::stop()
{
removeFromMap();
ActionInterval::stop();
}
//! called every frame with it's delta time. DON'T override unless you know what you are doing.
@ -117,7 +155,40 @@ void Animate3D::step(float dt)
void Animate3D::update(float t)
{
if (_target && _weight > 0.f)
if (_target)
{
if (_state == Animate3D::Animate3DState::FadeIn && _lastTime > 0.f)
{
_accTransTime += (t - _lastTime) * getDuration();
_weight = _accTransTime / _transTime;
if (_weight >= 1.0f)
{
_accTransTime = _transTime;
_weight = 1.0f;
_state = Animate3D::Animate3DState::Running;
Sprite3D* sprite = static_cast<Sprite3D*>(_target);
s_fadeInAnimates.erase(sprite);
s_runningAnimates[sprite] = this;
}
}
else if (_state == Animate3D::Animate3DState::FadeOut && _lastTime > 0.f)
{
_accTransTime += (t - _lastTime) * getDuration();
_weight = 1 - _accTransTime / _transTime;
if (_weight <= 0.0f)
{
_accTransTime = _transTime;
_weight = 0.0f;
Sprite3D* sprite = static_cast<Sprite3D*>(_target);
s_fadeOutAnimates.erase(sprite);
}
}
_lastTime = t;
if (_weight > 0.0f)
{
float transDst[3], rotDst[4], scaleDst[3];
float* trans = nullptr, *rot = nullptr, *scale = nullptr;
@ -146,7 +217,7 @@ void Animate3D::update(float t)
bone->setAnimationValue(trans, rot, scale, this, _weight);
}
}
}
}
float Animate3D::getSpeed() const
@ -172,12 +243,32 @@ Animate3D::Animate3D()
, _last(1.f)
, _animation(nullptr)
, _playReverse(false)
, _state(Animate3D::Animate3DState::Running)
, _accTransTime(0.0f)
, _lastTime(0.0f)
{
}
Animate3D::~Animate3D()
{
removeFromMap();
CC_SAFE_RELEASE(_animation);
}
void Animate3D::removeFromMap()
{
//remove this action from map
if (_target)
{
Sprite3D* sprite = static_cast<Sprite3D*>(_target);
if (_state == Animate3D::Animate3DState::FadeIn)
s_fadeInAnimates.erase(sprite);
else if (_state == Animate3D::Animate3DState::FadeOut)
s_fadeOutAnimates.erase(sprite);
else
s_runningAnimates.erase(sprite);
}
}
NS_CC_END

View File

@ -26,6 +26,7 @@
#define __CCANIMATE3D_H__
#include <map>
#include <unordered_map>
#include "3d/CCAnimation3D.h"
#include "3d/3dExport.h"
@ -36,6 +37,7 @@
NS_CC_BEGIN
class Bone3D;
class Sprite3D;
/**
* Animate3D, Animates a Sprite3D given with an Animation3D
*/
@ -57,6 +59,7 @@ public:
//
// Overrides
//
virtual void stop() override;
virtual void step(float dt) override;
virtual void startWithTarget(Node *target) override;
virtual Animate3D* reverse() const override;
@ -72,6 +75,9 @@ public:
float getWeight() const { return _weight; }
void setWeight(float weight);
/** animate transistion time */
static float getTransitionTime() { return _transTime; }
/**get & set play reverse, these are deprecated, use set negative speed instead*/
CC_DEPRECATED_ATTRIBUTE bool getPlayBack() const { return _playReverse; }
CC_DEPRECATED_ATTRIBUTE void setPlayBack(bool reverse) { _playReverse = reverse; }
@ -81,7 +87,16 @@ CC_CONSTRUCTOR_ACCESS:
Animate3D();
virtual ~Animate3D();
void removeFromMap();
protected:
enum class Animate3DState
{
FadeIn,
FadeOut,
Running,
};
Animate3DState _state; //animation state
Animation3D* _animation; //animation data
float _absSpeed; //playing speed
@ -89,7 +104,15 @@ protected:
float _start; //start time 0 - 1, used to generate sub Animate3D
float _last; //last time 0 - 1, used to generate sub Animate3D
bool _playReverse; // is playing reverse
std::map<Bone3D*, Animation3D::Curve*> _boneCurves; //weak ref
static float _transTime; //transition time from one animate3d to another
float _accTransTime; // acculate transition time
float _lastTime; // last t (0 - 1)
std::unordered_map<Bone3D*, Animation3D::Curve*> _boneCurves; //weak ref
//sprite animates
static std::unordered_map<Sprite3D*, Animate3D*> s_fadeInAnimates;
static std::unordered_map<Sprite3D*, Animate3D*> s_fadeOutAnimates;
static std::unordered_map<Sprite3D*, Animate3D*> s_runningAnimates;
};
NS_CC_END

View File

@ -26,7 +26,7 @@
#include <functional>
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "base/CCRef.h"
#include "math/CCMath.h"

View File

@ -29,7 +29,7 @@
#include <vector>
#include "base/CCRef.h"
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "base/CCConsole.h"
NS_CC_BEGIN

View File

@ -231,6 +231,7 @@ void Bone3D::updateLocalMat()
}
quat = Quaternion(it.localRot.x * weight + quat.x, it.localRot.y * weight + quat.y, it.localRot.z * weight + quat.z, it.localRot.w * weight + quat.w);
}
quat.normalize();
}
}

View File

@ -31,7 +31,7 @@
#include "3d/CCMesh.h"
#include "base/CCDirector.h"
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "base/ccMacros.h"
#include "platform/CCFileUtils.h"
#include "renderer/CCTextureCache.h"
@ -53,6 +53,7 @@ Sprite3D* Sprite3D::create(const std::string &modelPath)
auto sprite = new (std::nothrow) Sprite3D();
if (sprite && sprite->initWithFile(modelPath))
{
sprite->_contentSize = sprite->getBoundingBox().size;
sprite->autorelease();
return sprite;
}

View File

@ -1,36 +0,0 @@
set(COCOS_3D_SRC
CCRay.cpp
CCAABB.cpp
CCOBB.cpp
CCAnimate3D.cpp
CCAnimation3D.cpp
CCAttachNode.cpp
CCBundle3D.cpp
CCBundleReader.cpp
CCMesh.cpp
CCMeshSkin.cpp
CCMeshVertexIndexData.cpp
CCSprite3DMaterial.cpp
CCObjLoader.cpp
CCSkeleton3D.cpp
CCSprite3D.cpp
)
include_directories(
3d
)
add_library(cocos3d STATIC
${COCOS_3D_SRC}
)
target_link_libraries(cocos3d
cocos2d
)
set_target_properties(cocos3d
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)

View File

@ -25,17 +25,7 @@
#ifndef __COCOS_3D_COCOS3D_H__
#define __COCOS_3D_COCOS3D_H__
//3d
#include "3d/CCAABB.h"
#include "3d/CCOBB.h"
#include "3d/CCRay.h"
#include "3d/CCSprite3D.h"
#include "3d/CCMesh.h"
#include "3d/CCMeshSkin.h"
#include "3d/CCAnimate3D.h"
#include "3d/CCAnimation3D.h"
#include "3d/CCSprite3DMaterial.h"
#include "3d/CCAttachNode.h"
#include "3d/CCMeshVertexIndexData.h"
// DON'T ADD FILES HERE
// ADD THEM IN THE COCOS2D.H HEADER FILE
#endif

View File

@ -122,7 +122,7 @@ base/CCScheduler.cpp \
base/CCScriptSupport.cpp \
base/CCTouch.cpp \
base/CCUserDefault.cpp \
base/CCUserDefaultAndroid.cpp \
base/CCUserDefault-android.cpp \
base/CCValue.cpp \
base/TGAlib.cpp \
base/ZipUtils.cpp \
@ -217,7 +217,7 @@ LOCAL_STATIC_LIBRARIES += cocos_png_static
LOCAL_STATIC_LIBRARIES += cocos_jpeg_static
LOCAL_STATIC_LIBRARIES += cocos_tiff_static
LOCAL_STATIC_LIBRARIES += cocos_webp_static
LOCAL_STATIC_LIBRARIES += chipmunk_static
LOCAL_STATIC_LIBRARIES += cocos_chipmunk_static
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dxandroid_static
@ -244,19 +244,16 @@ LOCAL_STATIC_LIBRARIES += cocosbuilder_static
LOCAL_STATIC_LIBRARIES += spine_static
LOCAL_STATIC_LIBRARIES += cocos_network_static
LOCAL_STATIC_LIBRARIES += box2d_static
LOCAL_STATIC_LIBRARIES += chipmunk_static
include $(BUILD_STATIC_LIBRARY)
#==============================================================
$(call import-module,freetype2/prebuilt/android)
$(call import-module,chipmunk)
$(call import-module,platform/android)
$(call import-module,png/prebuilt/android)
$(call import-module,jpeg/prebuilt/android)
$(call import-module,tiff/prebuilt/android)
$(call import-module,webp/prebuilt/android)
$(call import-module,webp/prebuilt/android)
$(call import-module,webp/prebuilt/android)
$(call import-module,chipmunk/prebuilt/android)
$(call import-module,3d)
$(call import-module,audio/android)
$(call import-module,editor-support/cocosbuilder)

View File

@ -27,6 +27,7 @@
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/platform/desktop
${CMAKE_CURRENT_SOURCE_DIR}/platform
${CMAKE_CURRENT_SOURCE_DIR}/audio/include
${CMAKE_CURRENT_SOURCE_DIR}/editor-support
${CMAKE_CURRENT_SOURCE_DIR}/../external/tinyxml2
@ -42,69 +43,573 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../external/websockets/include/${PLATFORM_FOLDER}
${CMAKE_CURRENT_SOURCE_DIR}/../external/xxhash
${CMAKE_CURRENT_SOURCE_DIR}/../external/ConvertUTF
${CMAKE_CURRENT_SOURCE_DIR}/../external/linux-specific/fmod/include/${ARCH_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../external/${PLATFORM_FOLDER}-specific/fmod/include/${ARCH_DIR}
)
#
# cocos2d source files and header files
file(GLOB core_source_files
"${CMAKE_CURRENT_SOURCE_DIR}/cocos2d.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/base/ccFPSImages.c"
"${CMAKE_CURRENT_SOURCE_DIR}/2d/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/3d/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/audio/linux/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/base/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/deprecated/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/editor-support/cocosbuilder/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/editor-support/spine/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/math/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/network/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/physics/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/physics/chipmunk/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/platform/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/platform/linux/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/platform/desktop/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/renderer/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/storage/local-storage/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/ui/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../external/tinyxml2/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../external/xxhash/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/../external/unzip/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../external/chipmunk/src/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/../external/chipmunk/src/constraints/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/../external/edtaa3func/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../external/ConvertUTF/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../external/ConvertUTF/*.c"
)
file(GLOB_RECURSE cocostudio_source_files "${CMAKE_CURRENT_SOURCE_DIR}/editor-support/cocostudio/*.cpp")
file(GLOB_RECURSE extensions_source_files "${CMAKE_CURRENT_SOURCE_DIR}/../extensions/*.cpp")
file(GLOB_RECURSE box2d_source_files "${CMAKE_CURRENT_SOURCE_DIR}/../external/Box2D/*.cpp")
set(cocos2d_source_files ${chipmunk_source_files} ${box2d_source_files} ${core_source_files} ${cocostudio_source_files} ${extensions_source_files})
# exclude files specific for other platforms
list(REMOVE_ITEM cocos2d_source_files
"${CMAKE_CURRENT_SOURCE_DIR}/base/CCController-android.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/base/CCUserDefaultAndroid.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/ui/UIVideoPlayerAndroid.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/ui/UIWebView.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/ui/UIWebViewImpl_android.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/storage/local-storage/LocalStorageAndroid.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/base/CCEventController.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/base/CCEventListenerController.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/editor-support/cocostudio/proj.wp8/pch.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../extensions/proj.wp8/pch.cpp")
#
# From CMake page:
# We do not recommend using GLOB to collect a list of source files from your source tree.
# If no CMakeLists.txt file changes when a source is added or removed then the generated
# build system cannot know when to ask CMake to regenerate.)
add_library(cocos2d STATIC ${cocos2d_source_files})
set(COCOS2D_BASE_SRC
cocos2d.cpp
base/ccFPSImages.c
base/CCAutoreleasePool.cpp
base/CCCamera.cpp
base/CCConfiguration.cpp
base/CCConsole.cpp
base/CCController-android.cpp
base/CCController.cpp
base/CCData.cpp
base/CCDataVisitor.cpp
base/CCDirector.cpp
base/CCEvent.cpp
base/CCEventAcceleration.cpp
base/CCEventController.cpp
base/CCEventCustom.cpp
base/CCEventDispatcher.cpp
base/CCEventFocus.cpp
base/CCEventKeyboard.cpp
base/CCEventListener.cpp
base/CCEventListenerAcceleration.cpp
base/CCEventListenerController.cpp
base/CCEventListenerCustom.cpp
base/CCEventListenerFocus.cpp
base/CCEventListenerKeyboard.cpp
base/CCEventListenerMouse.cpp
base/CCEventListenerTouch.cpp
base/CCEventMouse.cpp
base/CCEventTouch.cpp
base/CCIMEDispatcher.cpp
base/CCNS.cpp
base/CCProfiling.cpp
base/CCRef.cpp
base/CCScheduler.cpp
base/CCScriptSupport.cpp
base/CCTouch.cpp
base/CCUserDefault.cpp
base/CCUserDefault-android.cpp
base/CCValue.cpp
base/ObjectFactory.cpp
base/TGAlib.cpp
base/ZipUtils.cpp
base/atitc.cpp
base/base64.cpp
base/ccCArray.cpp
base/ccRandom.cpp
base/ccTypes.cpp
base/ccUTF8.cpp
base/ccUtils.cpp
base/etc1.cpp
base/pvr.cpp
base/s3tc.cpp
2d/CCAction.cpp
2d/CCActionCamera.cpp
2d/CCActionCatmullRom.cpp
2d/CCActionEase.cpp
2d/CCActionGrid.cpp
2d/CCActionGrid3D.cpp
2d/CCActionInstant.cpp
2d/CCActionInterval.cpp
2d/CCActionManager.cpp
2d/CCActionPageTurn3D.cpp
2d/CCActionProgressTimer.cpp
2d/CCActionTiledGrid.cpp
2d/CCActionTween.cpp
2d/CCAnimation.cpp
2d/CCAnimationCache.cpp
2d/CCAtlasNode.cpp
2d/CCClippingNode.cpp
2d/CCComponent.cpp
2d/CCComponentContainer.cpp
2d/CCDrawNode.cpp
2d/CCDrawingPrimitives.cpp
2d/CCFastTMXLayer.cpp
2d/CCFastTMXTiledMap.cpp
2d/CCFont.cpp
2d/CCFontAtlas.cpp
2d/CCFontAtlasCache.cpp
2d/CCFontCharMap.cpp
2d/CCFontFNT.cpp
2d/CCFontFreeType.cpp
2d/CCGLBufferedNode.cpp
2d/CCGrabber.cpp
2d/CCGrid.cpp
2d/CCLabel.cpp
2d/CCLabelAtlas.cpp
2d/CCLabelBMFont.cpp
2d/CCLabelTTF.cpp
2d/CCLabelTextFormatter.cpp
2d/CCLayer.cpp
2d/CCMenu.cpp
2d/CCMenuItem.cpp
2d/CCMotionStreak.cpp
2d/CCNode.cpp
2d/CCNodeGrid.cpp
2d/CCParallaxNode.cpp
2d/CCParticleBatchNode.cpp
2d/CCParticleExamples.cpp
2d/CCParticleSystem.cpp
2d/CCParticleSystemQuad.cpp
2d/CCProgressTimer.cpp
2d/CCProtectedNode.cpp
2d/CCRenderTexture.cpp
2d/CCScene.cpp
2d/CCSprite.cpp
2d/CCSpriteBatchNode.cpp
2d/CCSpriteFrame.cpp
2d/CCSpriteFrameCache.cpp
2d/CCTMXLayer.cpp
2d/CCTMXObjectGroup.cpp
2d/CCTMXTiledMap.cpp
2d/CCTMXXMLParser.cpp
2d/CCTextFieldTTF.cpp
2d/CCTileMapAtlas.cpp
2d/CCTransition.cpp
2d/CCTransitionPageTurn.cpp
2d/CCTransitionProgress.cpp
2d/CCTweenFunction.cpp
3d/CCAABB.cpp
3d/CCAnimate3D.cpp
3d/CCAnimation3D.cpp
3d/CCAttachNode.cpp
3d/CCBundle3D.cpp
3d/CCBundleReader.cpp
3d/CCMesh.cpp
3d/CCMeshSkin.cpp
3d/CCMeshVertexIndexData.cpp
3d/CCOBB.cpp
3d/CCObjLoader.cpp
3d/CCRay.cpp
3d/CCSkeleton3D.cpp
3d/CCSprite3D.cpp
3d/CCSprite3DMaterial.cpp
network/HttpClient.cpp
network/SocketIO.cpp
network/WebSocket.cpp
ui/CocosGUI.cpp
ui/UIButton.cpp
ui/UICheckBox.cpp
ui/UIDeprecated.cpp
ui/UIHBox.cpp
ui/UIHelper.cpp
ui/UIImageView.cpp
ui/UILayout.cpp
ui/UILayoutManager.cpp
ui/UILayoutParameter.cpp
ui/UIListView.cpp
ui/UILoadingBar.cpp
ui/UIPageView.cpp
ui/UIRelativeBox.cpp
ui/UIRichText.cpp
ui/UIScale9Sprite.cpp
ui/UIScrollView.cpp
ui/UISlider.cpp
ui/UIText.cpp
ui/UITextAtlas.cpp
ui/UITextBMFont.cpp
ui/UITextField.cpp
ui/UIVBox.cpp
ui/UIVideoPlayer-android.cpp
ui/UIWebView.cpp
ui/UIWebViewImpl-android.cpp
ui/UIWidget.cpp
ui/UIEditBox/UIEditBox.cpp
ui/UIEditBox/UIEditBoxImpl-android.cpp
ui/UIEditBox/UIEditBoxImpl-stub.cpp
ui/UIEditBox/UIEditBoxImpl-win32.cpp
ui/UIEditBox/UIEditBoxImpl-wp8.cpp
math/CCAffineTransform.cpp
math/CCGeometry.cpp
math/CCVertex.cpp
math/Mat4.cpp
math/MathUtil.cpp
math/Quaternion.cpp
math/TransformUtils.cpp
math/Vec2.cpp
math/Vec3.cpp
math/Vec4.cpp
renderer/CCBatchCommand.cpp
renderer/CCCustomCommand.cpp
renderer/CCGLProgram.cpp
renderer/CCGLProgramCache.cpp
renderer/CCGLProgramState.cpp
renderer/CCGLProgramStateCache.cpp
renderer/CCGroupCommand.cpp
renderer/CCMeshCommand.cpp
renderer/CCPrimitive.cpp
renderer/CCPrimitiveCommand.cpp
renderer/CCQuadCommand.cpp
renderer/CCRenderCommand.cpp
renderer/CCRenderer.cpp
renderer/CCTexture2D.cpp
renderer/CCTextureAtlas.cpp
renderer/CCTextureCache.cpp
renderer/CCTrianglesCommand.cpp
renderer/CCVertexIndexBuffer.cpp
renderer/CCVertexIndexData.cpp
renderer/ccGLStateCache.cpp
renderer/ccShaders.cpp
deprecated/CCArray.cpp
deprecated/CCDeprecated.cpp
deprecated/CCDictionary.cpp
deprecated/CCNotificationCenter.cpp
deprecated/CCSet.cpp
deprecated/CCString.cpp
physics/CCPhysicsBody.cpp
physics/CCPhysicsContact.cpp
physics/CCPhysicsJoint.cpp
physics/CCPhysicsShape.cpp
physics/CCPhysicsWorld.cpp
physics/chipmunk/CCPhysicsBodyInfo_chipmunk.cpp
physics/chipmunk/CCPhysicsContactInfo_chipmunk.cpp
physics/chipmunk/CCPhysicsJointInfo_chipmunk.cpp
physics/chipmunk/CCPhysicsShapeInfo_chipmunk.cpp
physics/chipmunk/CCPhysicsWorldInfo_chipmunk.cpp
platform/CCFileUtils.cpp
platform/CCGLView.cpp
platform/CCImage.cpp
platform/CCSAXParser.cpp
platform/CCThread.cpp
storage/local-storage/LocalStorage.cpp
storage/local-storage/LocalStorage-android.cpp
)
if(MACOSX)
set(COCOS2D_BASE_SRC
${COCOS2D_BASE_SRC}
ui/UIEditBox/UIEditBoxImpl-ios.mm
ui/UIEditBox/UIEditBoxImpl-mac.mm
base/CCUserDefault.mm
)
endif()
set(COCOS2D_EDITOR_SUPPORT_SRC
editor-support/cocosbuilder/CCBAnimationManager.cpp
editor-support/cocosbuilder/CCBFileLoader.cpp
editor-support/cocosbuilder/CCBKeyframe.cpp
editor-support/cocosbuilder/CCBReader.cpp
editor-support/cocosbuilder/CCBSequence.cpp
editor-support/cocosbuilder/CCBSequenceProperty.cpp
editor-support/cocosbuilder/CCControlButtonLoader.cpp
editor-support/cocosbuilder/CCControlLoader.cpp
editor-support/cocosbuilder/CCLabelBMFontLoader.cpp
editor-support/cocosbuilder/CCLabelTTFLoader.cpp
editor-support/cocosbuilder/CCLayerColorLoader.cpp
editor-support/cocosbuilder/CCLayerGradientLoader.cpp
editor-support/cocosbuilder/CCLayerLoader.cpp
editor-support/cocosbuilder/CCMenuItemImageLoader.cpp
editor-support/cocosbuilder/CCMenuItemLoader.cpp
editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp
editor-support/cocosbuilder/CCNodeLoader.cpp
editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp
editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp
editor-support/cocosbuilder/CCScale9SpriteLoader.cpp
editor-support/cocosbuilder/CCScrollViewLoader.cpp
editor-support/cocosbuilder/CCSpriteLoader.cpp
editor-support/spine/Animation.cpp
editor-support/spine/AnimationState.cpp
editor-support/spine/AnimationStateData.cpp
editor-support/spine/Atlas.cpp
editor-support/spine/AtlasAttachmentLoader.cpp
editor-support/spine/Attachment.cpp
editor-support/spine/AttachmentLoader.cpp
editor-support/spine/Bone.cpp
editor-support/spine/BoneData.cpp
editor-support/spine/BoundingBoxAttachment.cpp
editor-support/spine/CCSkeleton.cpp
editor-support/spine/CCSkeletonAnimation.cpp
editor-support/spine/Event.cpp
editor-support/spine/EventData.cpp
editor-support/spine/Json.cpp
editor-support/spine/RegionAttachment.cpp
editor-support/spine/Skeleton.cpp
editor-support/spine/SkeletonBounds.cpp
editor-support/spine/SkeletonData.cpp
editor-support/spine/SkeletonJson.cpp
editor-support/spine/Skin.cpp
editor-support/spine/Slot.cpp
editor-support/spine/SlotData.cpp
editor-support/spine/extension.cpp
editor-support/spine/spine-cocos2dx.cpp
editor-support/cocostudio/CCActionFrame.cpp
editor-support/cocostudio/CCActionFrameEasing.cpp
editor-support/cocostudio/CCActionManagerEx.cpp
editor-support/cocostudio/CCActionNode.cpp
editor-support/cocostudio/CCActionObject.cpp
editor-support/cocostudio/CCArmature.cpp
editor-support/cocostudio/CCArmatureAnimation.cpp
editor-support/cocostudio/CCArmatureDataManager.cpp
editor-support/cocostudio/CCArmatureDefine.cpp
editor-support/cocostudio/CCBatchNode.cpp
editor-support/cocostudio/CCBone.cpp
editor-support/cocostudio/CCColliderDetector.cpp
editor-support/cocostudio/CCComAttribute.cpp
editor-support/cocostudio/CCComAudio.cpp
editor-support/cocostudio/CCComController.cpp
editor-support/cocostudio/CCComRender.cpp
editor-support/cocostudio/CCDataReaderHelper.cpp
editor-support/cocostudio/CCDatas.cpp
editor-support/cocostudio/CCDecorativeDisplay.cpp
editor-support/cocostudio/CCDisplayFactory.cpp
editor-support/cocostudio/CCDisplayManager.cpp
editor-support/cocostudio/CCInputDelegate.cpp
editor-support/cocostudio/CCProcessBase.cpp
editor-support/cocostudio/CCSGUIReader.cpp
editor-support/cocostudio/CCSSceneReader.cpp
editor-support/cocostudio/CCSkin.cpp
editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp
editor-support/cocostudio/CCTransformHelp.cpp
editor-support/cocostudio/CCTween.cpp
editor-support/cocostudio/CCUtilMath.cpp
editor-support/cocostudio/CocoLoader.cpp
editor-support/cocostudio/DictionaryHelper.cpp
editor-support/cocostudio/TriggerBase.cpp
editor-support/cocostudio/TriggerMng.cpp
editor-support/cocostudio/TriggerObj.cpp
editor-support/cocostudio/WidgetReader/WidgetReader.cpp
editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp
editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp
editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp
editor-support/cocostudio/WidgetReader/WidgetReader.cpp
editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp
editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp
editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp
editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp
editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp
editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp
editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp
editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp
editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp
editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp
editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.cpp
editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp
editor-support/cocostudio/ActionTimeline/CCFrame.cpp
editor-support/cocostudio/ActionTimeline/CCNodeReader.cpp
editor-support/cocostudio/ActionTimeline/CCTimeLine.cpp
)
if(LINUX)
set(COCOS2D_AUDIO_SRC
audio/linux/FmodAudioPlayer.cpp
audio/linux/SimpleAudioEngineFMOD.cpp
)
elseif(MACOSX)
# split it in _C and non C
# because C files needs to be compiled with C compiler and not C++
# compiler
set(COCOS2D_AUDIO_SRC_C
audio/mac/CDAudioManager.m
audio/mac/CDOpenALSupport.m
audio/mac/CocosDenshion.m
audio/mac/SimpleAudioEngine_objc.m
)
set(COCOS2D_AUDIO_SRC
${COCOS2D_AUDIO_SRC_C}
audio/mac/SimpleAudioEngine.mm
audio/mac/CDXMacOSXSupport.mm
)
SET_SOURCE_FILES_PROPERTIES(
${COCOS2D_AUDIO_SRC_C}
PROPERTIES LANGUAGE C
)
else()
message( FATAL_ERROR "Unsupported platform, CMake will exit" )
endif()
# For external projects, leave one empty line
# between projects
set(COCOS2D_EXTERNAL_SRC
../external/tinyxml2/tinyxml2.cpp
../external/xxhash/xxhash.c
../external/unzip/ioapi.cpp
../external/unzip/unzip.cpp
../external/edtaa3func/edtaa3func.cpp
../external/ConvertUTF/ConvertUTF.c
../external/ConvertUTF/ConvertUTFWrapper.cpp
)
set(COCOS2D_DESKTOP_SRC
platform/desktop/CCGLViewImpl-desktop.cpp
)
if(LINUX)
set(COCOS2D_PLATFORM_SRC
${COCOS2D_DESKTOP_SRC}
platform/linux/CCApplication-linux.cpp
platform/linux/CCCommon-linux.cpp
platform/linux/CCDevice-linux.cpp
platform/linux/CCFileUtils-linux.cpp
platform/linux/CCStdC-linux.cpp
)
elseif(MACOSX)
set(COCOS2D_PLATFORM_SRC
${COCOS2D_DESKTOP_SRC}
platform/mac/CCApplication-mac.mm
platform/mac/CCCommon-mac.mm
platform/mac/CCDevice-mac.mm
platform/apple/CCLock-apple.cpp
platform/apple/CCFileUtils-apple.mm
platform/apple/CCThread-apple.mm
)
else()
message( FATAL_ERROR "Unsupported architecture, CMake will exit" )
endif()
set(COCOS2D_SRC
${COCOS2D_BASE_SRC}
${COCOS2D_PLATFORM_SRC}
${COCOS2D_EXTERNAL_SRC}
${COCOS2D_AUDIO_SRC}
${COCOS2D_EDITOR_SUPPORT_SRC}
)
set(COCOS2D_EXTENSIONS_SRC
../extensions/ExtensionDeprecated.cpp
../extensions/GUI/CCControlExtension/CCControlButton.cpp
../extensions/GUI/CCControlExtension/CCControlColourPicker.cpp
../extensions/GUI/CCControlExtension/CCControl.cpp
../extensions/GUI/CCControlExtension/CCControlHuePicker.cpp
../extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp
../extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp
../extensions/GUI/CCControlExtension/CCControlSlider.cpp
../extensions/GUI/CCControlExtension/CCControlStepper.cpp
../extensions/GUI/CCControlExtension/CCControlSwitch.cpp
../extensions/GUI/CCControlExtension/CCControlUtils.cpp
../extensions/GUI/CCControlExtension/CCInvocation.cpp
../extensions/GUI/CCScrollView/CCScrollView.cpp
../extensions/GUI/CCScrollView/CCTableViewCell.cpp
../extensions/GUI/CCScrollView/CCTableView.cpp
../extensions/assets-manager/AssetsManager.cpp
../extensions/physics-nodes/CCPhysicsDebugNode.cpp
../extensions/physics-nodes/CCPhysicsSprite.cpp
)
set(BOX2D_SRC
../external/Box2D/Collision/b2BroadPhase.cpp
../external/Box2D/Collision/b2CollideCircle.cpp
../external/Box2D/Collision/b2CollideEdge.cpp
../external/Box2D/Collision/b2CollidePolygon.cpp
../external/Box2D/Collision/b2Collision.cpp
../external/Box2D/Collision/b2Distance.cpp
../external/Box2D/Collision/b2DynamicTree.cpp
../external/Box2D/Collision/b2TimeOfImpact.cpp
../external/Box2D/Collision/Shapes/b2ChainShape.cpp
../external/Box2D/Collision/Shapes/b2CircleShape.cpp
../external/Box2D/Collision/Shapes/b2EdgeShape.cpp
../external/Box2D/Collision/Shapes/b2PolygonShape.cpp
../external/Box2D/Common/b2BlockAllocator.cpp
../external/Box2D/Common/b2Draw.cpp
../external/Box2D/Common/b2Math.cpp
../external/Box2D/Common/b2Settings.cpp
../external/Box2D/Common/b2StackAllocator.cpp
../external/Box2D/Common/b2Timer.cpp
../external/Box2D/Dynamics/b2Body.cpp
../external/Box2D/Dynamics/b2ContactManager.cpp
../external/Box2D/Dynamics/b2Fixture.cpp
../external/Box2D/Dynamics/b2Island.cpp
../external/Box2D/Dynamics/b2World.cpp
../external/Box2D/Dynamics/b2WorldCallbacks.cpp
../external/Box2D/Dynamics/Joints/b2DistanceJoint.cpp
../external/Box2D/Dynamics/Joints/b2FrictionJoint.cpp
../external/Box2D/Dynamics/Joints/b2GearJoint.cpp
../external/Box2D/Dynamics/Joints/b2Joint.cpp
../external/Box2D/Dynamics/Joints/b2MotorJoint.cpp
../external/Box2D/Dynamics/Joints/b2MouseJoint.cpp
../external/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp
../external/Box2D/Dynamics/Joints/b2PulleyJoint.cpp
../external/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp
../external/Box2D/Dynamics/Joints/b2RopeJoint.cpp
../external/Box2D/Dynamics/Joints/b2WeldJoint.cpp
../external/Box2D/Dynamics/Joints/b2WheelJoint.cpp
../external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp
../external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp
../external/Box2D/Dynamics/Contacts/b2CircleContact.cpp
../external/Box2D/Dynamics/Contacts/b2Contact.cpp
../external/Box2D/Dynamics/Contacts/b2ContactSolver.cpp
../external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp
../external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp
../external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp
../external/Box2D/Dynamics/Contacts/b2PolygonContact.cpp
../external/Box2D/Rope/b2Rope.cpp
)
add_library(cocos2d STATIC ${COCOS2D_SRC} ${COCOS2D_EXTENSIONS_SRC} ${BOX2D_SRC})
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set(FMOD_LIB "fmodex64")
else()
elseif ( CMAKE_SIZEOF_VOID_P EQUAL 4 )
set(FMOD_LIB "fmodex")
else()
message( FATAL_ERROR "Unsupported architecture, CMake will exit" )
endif()
target_link_libraries(cocos2d jpeg webp tiff freetype fontconfig png pthread glfw GLEW GL X11 rt z ${FMOD_LIB} curl)
if(LINUX)
set(PLATFORM_SPECIFIC_LIBS
pthread
fontconfig
GLEW
X11
rt
glfw
GL
${FMOD_LIB}
)
elseif(MACOSX)
INCLUDE_DIRECTORIES ( /System/Library/Frameworks )
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
FIND_LIBRARY(OPENGL_LIBRARY OpenGL )
FIND_LIBRARY(AUDIOTOOLBOX_LIBRARY AudioToolbox)
FIND_LIBRARY(OPENAL_LIBRARY OpenAL )
FIND_LIBRARY(QUARTZCORE_LIBRARY QuartzCore )
FIND_LIBRARY(APPLICATIONSERVICES_LIBRARY ApplicationServices)
FIND_LIBRARY(IOKIT_LIBRARY IOKit)
FIND_LIBRARY(FOUNDATION_LIBRARY Foundation)
set(PLATFORM_SPECIFIC_LIBS
glfw3
websockets
${COCOA_LIBRARY}
${OPENGL_LIBRARY}
${OPENAL_LIBRARY}
${AUDIOTOOLBOX_LIBRARY}
${QUARTZCORE_LIBRARY}
${APPLICATIONSERVICES_LIBRARY}
${IOKIT_LIBRARY}
${FOUNDATION_LIBRARY}
)
else()
message( FATAL_ERROR "Unsupported platform, CMake will exit" )
endif()
target_link_libraries(cocos2d jpeg webp tiff freetype chipmunk png z curl ${PLATFORM_SPECIFIC_LIBS})
set_target_properties(cocos2d
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
VERSION ${COCOS2D_X_VERSION}
)

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
#include "SimpleAudioEngine_objc.h"
#include <string>
#include "CCFileUtils.h"
#include "platform/CCFileUtils.h"
using namespace cocos2d;
static void static_end()

View File

@ -1,7 +1,7 @@
#ifndef _MCI_PLAYER_WIN32_H_
#define _MCI_PLAYER_WIN32_H_
#include "CCStdC.h"
#include "platform/CCStdC.h"
#include <mmsystem.h>
#include <string>
using namespace std;

View File

@ -27,11 +27,12 @@ THE SOFTWARE.
#ifndef __CCCONFIGURATION_H__
#define __CCCONFIGURATION_H__
#include "base/CCRef.h"
#include "CCGL.h"
#include "base/CCValue.h"
#include <string>
#include "base/CCRef.h"
#include "base/CCValue.h"
#include "platform/CCGL.h"
NS_CC_BEGIN
/**

View File

@ -56,7 +56,7 @@
#include "base/CCDirector.h"
#include "base/CCScheduler.h"
#include "base/CCPlatformConfig.h"
#include "platform/CCPlatformConfig.h"
#include "base/CCConfiguration.h"
#include "2d/CCScene.h"
#include "platform/CCFileUtils.h"

View File

@ -49,7 +49,7 @@ typedef SSIZE_T ssize_t;
#include "base/CCRef.h"
#include "base/ccMacros.h"
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
NS_CC_BEGIN

View File

@ -24,7 +24,7 @@
****************************************************************************/
#include "CCController.h"
#include "base/CCPlatformConfig.h"
#include "platform/CCPlatformConfig.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#include "ccMacros.h"

View File

@ -26,7 +26,7 @@
#ifndef __cocos2d_libs__CCController__
#define __cocos2d_libs__CCController__
#include "CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include <string>
#include <vector>
#include <unordered_map>

View File

@ -26,10 +26,10 @@
#ifndef __CCDATA_H__
#define __CCDATA_H__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include <stdint.h> // for ssize_t on android
#include <string> // for ssize_t on linux
#include "CCStdC.h" // for ssize_t on window
#include "platform/CCStdC.h" // for ssize_t on window
NS_CC_BEGIN

View File

@ -25,7 +25,7 @@
#ifndef __CCDATAVISITOR_H__
#define __CCDATAVISITOR_H__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include <string>
NS_CC_BEGIN

View File

@ -57,9 +57,8 @@ THE SOFTWARE.
#include "base/CCConsole.h"
#include "base/CCAutoreleasePool.h"
#include "base/CCConfiguration.h"
#include "CCApplication.h"
#include "CCGLViewImpl.h"
#include "platform/CCApplication.h"
//#include "platform/CCGLViewImpl.h"
/**
Position of the FPS

View File

@ -28,14 +28,14 @@ THE SOFTWARE.
#ifndef __CCDIRECTOR_H__
#define __CCDIRECTOR_H__
#include "base/CCPlatformMacros.h"
#include <stack>
#include "platform/CCPlatformMacros.h"
#include "base/CCRef.h"
#include "base/CCVector.h"
#include "2d/CCScene.h"
#include "CCGL.h"
#include <stack>
#include "math/CCMath.h"
#include "platform/CCGL.h"
#include "platform/CCGLView.h"
NS_CC_BEGIN

View File

@ -27,7 +27,7 @@
#define __CCEVENT_H__
#include "base/CCRef.h"
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
NS_CC_BEGIN
@ -46,9 +46,7 @@ public:
ACCELERATION,
MOUSE,
FOCUS,
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
GAME_CONTROLLER,
#endif
CUSTOM
};

View File

@ -26,7 +26,7 @@
#ifndef __cocos2d_libs__EventController__
#define __cocos2d_libs__EventController__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "base/CCEvent.h"
NS_CC_BEGIN

View File

@ -31,10 +31,10 @@
#include <vector>
#include <set>
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "base/CCEventListener.h"
#include "base/CCEvent.h"
#include "CCStdC.h"
#include "platform/CCStdC.h"
NS_CC_BEGIN

View File

@ -29,7 +29,7 @@
#include <string>
#include <memory>
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "base/CCRef.h"
NS_CC_BEGIN
@ -54,9 +54,7 @@ public:
MOUSE,
ACCELERATION,
FOCUS,
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
GAME_CONTROLLER,
#endif
CUSTOM
};

View File

@ -26,7 +26,7 @@
#ifndef __cocos2d_libs__EventListenerController__
#define __cocos2d_libs__EventListenerController__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "base/CCEventListener.h"
NS_CC_BEGIN

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
#ifndef __BASE_CCREF_H__
#define __BASE_CCREF_H__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "base/ccConfig.h"
#define CC_USE_MEM_LEAK_DETECTION 0

View File

@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "base/CCUserDefault.h"
#include "base/CCPlatformConfig.h"
#include "platform/CCPlatformConfig.h"
#include "base/ccUtils.h"
#include "platform/CCCommon.h"
#include "base/base64.h"

View File

@ -23,16 +23,19 @@
THE SOFTWARE.
****************************************************************************/
#include "platform/CCPlatformConfig.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
#import <Foundation/Foundation.h>
#include <string>
#import "CCUserDefault.h"
#import <string>
#import "platform/CCFileUtils.h"
#import "tinyxml2.h"
#import "CCPlatformConfig.h"
#import "CCPlatformMacros.h"
#import "base64.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
#import "platform/CCFileUtils.h"
#define XML_FILE_NAME "UserDefault.xml"

View File

@ -25,7 +25,7 @@ THE SOFTWARE.
#ifndef __SUPPORT_CCUSERDEFAULT_H__
#define __SUPPORT_CCUSERDEFAULT_H__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include <string>
#include "base/CCData.h"

View File

@ -25,7 +25,7 @@
#ifndef __cocos2d_libs__CCValue__
#define __cocos2d_libs__CCValue__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "base/ccMacros.h"
#include <string>
#include <vector>

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
#include <unordered_map>
#include <functional>
#include "base/CCRef.h"
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
NS_CC_BEGIN

View File

@ -26,15 +26,15 @@ THE SOFTWARE.
#define __SUPPORT_ZIPUTILS_H__
#include <string>
#include "base/CCPlatformConfig.h"
#include "CCPlatformDefine.h"
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformConfig.h"
#include "platform/CCPlatformMacros.h"
#include "platform/CCPlatformDefine.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#include "platform/android/CCFileUtilsAndroid.h"
#include "platform/android/CCFileUtils-android.h"
#elif(CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
// for import ssize_t on win32 platform
#include "CCStdC.h"
#include "platform/CCStdC.h"
#endif
namespace cocos2d

View File

@ -26,7 +26,7 @@
#ifndef COCOS2DX_PLATFORM_THIRDPARTY_ATITC_
#define COCOS2DX_PLATFORM_THIRDPARTY_ATITC_
#include "CCStdC.h"
#include "platform/CCStdC.h"
enum class ATITCDecodeFlag
{

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
#ifndef __SUPPORT_BASE64_H__
#define __SUPPORT_BASE64_H__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#ifdef __cplusplus
extern "C" {

View File

@ -28,7 +28,7 @@ THE SOFTWARE.
#ifndef __CCCONFIG_H__
#define __CCCONFIG_H__
#include "base/CCPlatformConfig.h"
#include "platform/CCPlatformConfig.h"
/**
@file

View File

@ -33,7 +33,7 @@ THE SOFTWARE.
#endif
#include "base/CCConsole.h"
#include "CCStdC.h"
#include "platform/CCStdC.h"
#ifndef CCASSERT
#if COCOS2D_DEBUG > 0

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
#ifndef __ccRandom_H_
#define __ccRandom_H_
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include <random>

View File

@ -32,8 +32,8 @@ THE SOFTWARE.
#include "math/CCGeometry.h"
#include "math/CCMath.h"
#include "CCGL.h"
#include "CCRef.h"
#include "base/CCRef.h"
#include "platform/CCGL.h"
NS_CC_BEGIN

View File

@ -26,7 +26,7 @@
#ifndef __cocos2dx__ccUTF8__
#define __cocos2dx__ccUTF8__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include <vector>
#include <string>

View File

@ -26,7 +26,7 @@
#ifndef COCOS2DX_PLATFORM_THIRDPARTY_S3TC_
#define COCOS2DX_PLATFORM_THIRDPARTY_S3TC_
#include "CCStdC.h"
#include "platform/CCStdC.h"
enum class S3TCDecodeFlag
{

View File

@ -25,7 +25,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
NS_CC_BEGIN

View File

@ -108,6 +108,7 @@ THE SOFTWARE.
// 2d nodes
#include "2d/CCNode.h"
#include "2d/CCProtectedNode.h"
#include "2d/CCAtlasNode.h"
#include "2d/CCDrawingPrimitives.h"
#include "2d/CCDrawNode.h"
@ -174,21 +175,21 @@ THE SOFTWARE.
#include "platform/CCImage.h"
#include "platform/CCSAXParser.h"
#include "platform/CCThread.h"
#include "base/CCPlatformConfig.h"
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformConfig.h"
#include "platform/CCPlatformMacros.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#include "platform/ios/CCApplication.h"
#include "platform/ios/CCGLViewImpl.h"
#include "platform/ios/CCGL.h"
#include "platform/ios/CCStdC.h"
#include "platform/ios/CCApplication-ios.h"
#include "platform/ios/CCGLViewImpl-ios.h"
#include "platform/ios/CCGL-ios.h"
#include "platform/ios/CCStdC-ios.h"
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#include "platform/android/CCApplication.h"
#include "platform/android/CCGLViewImpl.h"
#include "platform/android/CCGL.h"
#include "platform/android/CCStdC.h"
#include "platform/android/CCApplication-android.h"
#include "platform/android/CCGLViewImpl-android.h"
#include "platform/android/CCGL-android.h"
#include "platform/android/CCStdC-android.h"
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
#if (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY)
@ -199,24 +200,24 @@ THE SOFTWARE.
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
#include "platform/win32/CCApplication.h"
#include "platform/desktop/CCGLViewImpl.h"
#include "platform/win32/CCGL.h"
#include "platform/win32/CCStdC.h"
#include "platform/win32/CCApplication-win32.h"
#include "platform/desktop/CCGLViewImpl-desktop.h"
#include "platform/win32/CCGL-win32.h"
#include "platform/win32/CCStdC-win32.h"
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
#include "platform/mac/CCApplication.h"
#include "platform/desktop/CCGLViewImpl.h"
#include "platform/mac/CCGL.h"
#include "platform/mac/CCStdC.h"
#include "platform/desktop/CCGLViewImpl-desktop.h"
#include "platform/mac/CCApplication-mac.h"
#include "platform/mac/CCGL-mac.h"
#include "platform/mac/CCStdC-mac.h"
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC
#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
#include "platform/linux/CCApplication.h"
#include "platform/desktop/CCGLViewImpl.h"
#include "platform/linux/CCGL.h"
#include "platform/linux/CCStdC.h"
#include "platform/linux/CCApplication-linux.h"
#include "platform/desktop/CCGLViewImpl-desktop.h"
#include "platform/linux/CCGL-linux.h"
#include "platform/linux/CCStdC-linux.h"
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
@ -229,7 +230,7 @@ THE SOFTWARE.
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
#include "platform/winrt/CCApplication.h"
#include "platform/wp8/CCGLViewImpl.h"
#include "platform/wp8/CCGLViewImpl-wp8.h"
#include "platform/winrt/CCGL.h"
#include "platform/winrt/CCStdC.h"
#include "platform/winrt/CCPrecompiledShaders.h"
@ -266,6 +267,20 @@ THE SOFTWARE.
#include "2d/CCComponent.h"
#include "2d/CCComponentContainer.h"
//3d
#include "3d/CCAABB.h"
#include "3d/CCOBB.h"
#include "3d/CCRay.h"
#include "3d/CCSprite3D.h"
#include "3d/CCMesh.h"
#include "3d/CCMeshSkin.h"
#include "3d/CCAnimate3D.h"
#include "3d/CCAnimation3D.h"
#include "3d/CCSprite3DMaterial.h"
#include "3d/CCAttachNode.h"
#include "3d/CCMeshVertexIndexData.h"
#include "3d/CCSkeleton3D.h"
// Deprecated include
#include "deprecated/CCDictionary.h"
#include "deprecated/CCArray.h"
@ -279,9 +294,6 @@ THE SOFTWARE.
// CCDeprecated.h must be included at the end
#include "deprecated/CCDeprecated.h"
//3d
#include "3d/cocos3d.h"
NS_CC_BEGIN

View File

@ -25,7 +25,7 @@ THE SOFTWARE.
#include <math.h>
#include "cocostudio/CCActionFrameEasing.h"
#include "cocostudio/DictionaryHelper.h"
#include "CCStdC.h"
#include "platform/CCStdC.h"
namespace cocostudio {

View File

@ -25,7 +25,7 @@ THE SOFTWARE.
#ifndef __CC_EXTENTIONS_CCINPUTDELEGATE_H__
#define __CC_EXTENTIONS_CCINPUTDELEGATE_H__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "base/CCTouch.h"
#include "base/CCEvent.h"
#include "base/ccTypes.h"

View File

@ -24,7 +24,7 @@ THE SOFTWARE.
#ifndef __CCSPRITEFRAMECACHEHELPER_H__
#define __CCSPRITEFRAMECACHEHELPER_H__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "cocostudio/CCArmatureDefine.h"
#include "cocostudio/CocosStudioExport.h"
#include <string>

View File

@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "cocostudio/DictionaryHelper.h"
namespace cocostudio {

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
#ifndef __MATH_CCAFFINETRANSFORM_H__
#define __MATH_CCAFFINETRANSFORM_H__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "math/CCGeometry.h"
#include "math/CCMath.h"

View File

@ -28,7 +28,7 @@ THE SOFTWARE.
#include <math.h>
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "base/ccMacros.h"
#include "math/CCMath.h"

View File

@ -3,7 +3,7 @@
#include <memory>
#include <string.h>
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#define MATH_DEG_TO_RAD(x) ((x) * 0.0174532925f)
#define MATH_RAD_TO_DEG(x) ((x)* 57.29577951f)

View File

@ -1,13 +0,0 @@
set(COCOS_MATH_SRC
math/CCAffineTransform.cpp
math/CCGeometry.cpp
math/CCVertex.cpp
math/Mat4.cpp
math/MathUtil.cpp
math/Quaternion.cpp
math/TransformUtils.cpp
math/Vec2.cpp
math/Vec3.cpp
math/Vec4.cpp
)

View File

@ -28,7 +28,7 @@ THE SOFTWARE.
#define __SUPPORT_TRANSFORM_UTILS_H__
// TODO: when in MAC or windows, it includes <OpenGL/gl.h>
#include "CCGL.h"
#include "platform/CCGL.h"
#include "base/ccMacros.h"
namespace cocos2d {

View File

@ -59,7 +59,7 @@ in the onClose method the pointer should be set to NULL or used to connect to a
#ifndef __CC_SOCKETIO_H__
#define __CC_SOCKETIO_H__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "base/CCMap.h"
#include <string>

View File

@ -30,11 +30,12 @@
#ifndef __CC_WEBSOCKET_H__
#define __CC_WEBSOCKET_H__
#include "base/CCPlatformMacros.h"
#include "CCStdC.h"
#include <string>
#include <vector>
#include "platform/CCPlatformMacros.h"
#include "platform/CCStdC.h"
struct libwebsocket;
struct libwebsocket_context;
struct libwebsocket_protocols;

View File

@ -28,7 +28,7 @@
#include "base/ccConfig.h"
#if CC_USE_PHYSICS
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "base/CCRef.h"
struct cpBody;

View File

@ -28,7 +28,7 @@
#include "base/ccConfig.h"
#if CC_USE_PHYSICS
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
NS_CC_BEGIN
class PhysicsContact;

View File

@ -29,7 +29,7 @@
#if CC_USE_PHYSICS
#include "chipmunk.h"
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "math/CCGeometry.h"
NS_CC_BEGIN

View File

@ -28,7 +28,7 @@
#include "base/ccConfig.h"
#if CC_USE_PHYSICS
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include <vector>
#include <unordered_map>

View File

@ -30,7 +30,7 @@
#include <vector>
#include <unordered_map>
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
typedef uintptr_t cpGroup;
struct cpShape;

View File

@ -29,7 +29,7 @@
#if CC_USE_PHYSICS
#include <vector>
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "math/CCGeometry.h"
struct cpSpace;

View File

@ -0,0 +1,45 @@
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2013-2014 Chukong Technologies Inc.
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 __PLATFORM_CCAPPLICATION_H__
#define __PLATFORM_CCAPPLICATION_H__
#include "platform/CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC
#include "platform/mac/CCApplication-mac.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#include "platform/ios/CCApplication-ios.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
#include "platform/android/CCApplication-android.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
#include "platform/win32/CCApplication-win32.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_WP8
#include "platform/winrt/CCApplication.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include "platform/linux/CCApplication-linux.h"
#endif
#endif /* __PLATFORM_CCAPPLICATION_H__*/

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
#ifndef __CC_APPLICATION_PROTOCOL_H__
#define __CC_APPLICATION_PROTOCOL_H__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "base/CCScriptSupport.h"
#include "base/CCAutoreleasePool.h"

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
#ifndef __CC_COMMON_H__
#define __CC_COMMON_H__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
NS_CC_BEGIN

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
#ifndef __CCDEVICE_H__
#define __CCDEVICE_H__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "base/ccMacros.h"
#include "base/CCData.h"

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
#include <vector>
#include <unordered_map>
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
#include "base/ccTypes.h"
#include "base/CCValue.h"
#include "base/CCData.h"

45
cocos/platform/CCGL.h Normal file
View File

@ -0,0 +1,45 @@
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2013-2014 Chukong Technologies Inc.
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 __PLATFORM_CCGL_H__
#define __PLATFORM_CCGL_H__
#include "platform/CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC
#include "platform/mac/CCGL-mac.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#include "platform/ios/CCGL-ios.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
#include "platform/android/CCGL-android.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
#include "platform/win32/CCGL-win32.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_WP8
#include "platform/winrt/CCGL.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include "platform/linux/CCGL-linux.h"
#endif
#endif /* __PLATFORM_CCPLATFORMDEFINE_H__*/

View File

@ -85,7 +85,7 @@ extern "C"
#include "base/ccUtils.h"
#include "base/ZipUtils.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#include "android/CCFileUtilsAndroid.h"
#include "android/CCFileUtils-android.h"
#endif
#define CC_GL_ATC_RGB_AMD 0x8C92

View File

@ -27,7 +27,9 @@ THE SOFTWARE.
#define __BASE_CC_PLATFORM_CONFIG_H__
/**
Config of cocos2d-x project, per target platform.
Config of cocos2d-x project, per target platform.
THIS FILE MUST NOT INCLUDE ANY OTHER FILE
*/
//////////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,45 @@
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2013-2014 Chukong Technologies Inc.
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 __PLATFORM_CCPLATFORMDEFINE_H__
#define __PLATFORM_CCPLATFORMDEFINE_H__
#include "platform/CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC
#include "platform/mac/CCPlatformDefine-mac.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#include "platform/ios/CCPlatformDefine-ios.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
#include "platform/android/CCPlatformDefine-android.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
#include "platform/win32/CCPlatformDefine-win32.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_WP8
#include "platform/winrt/CCPlatformDefine.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include "platform/linux/CCPlatformDefine-linux.h"
#endif
#endif /* __PLATFORM_CCPLATFORMDEFINE_H__*/

View File

@ -29,8 +29,8 @@ Copyright (c) 2013-2014 Chukong Technologies
* define some platform specific macros
*/
#include "base/ccConfig.h"
#include "base/CCPlatformConfig.h"
#include "CCPlatformDefine.h"
#include "platform/CCPlatformConfig.h"
#include "platform/CCPlatformDefine.h"
/**
* define a create function for a specific type, such as Layer

View File

@ -24,7 +24,7 @@
#ifndef __CCSAXPARSER_H__
#define __CCSAXPARSER_H__
#include "base/CCPlatformConfig.h"
#include "platform/CCPlatformConfig.h"
#include "platform/CCCommon.h"
#include <string>

45
cocos/platform/CCStdC.h Normal file
View File

@ -0,0 +1,45 @@
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2013-2014 Chukong Technologies Inc.
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 __PLATFORM_CCSTDC_H__
#define __PLATFORM_CCSTDC_H__
#include "platform/CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC
#include "platform/mac/CCStdC-mac.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#include "platform/ios/CCStdC-ios.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
#include "platform/android/CCStdC-android.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
#include "platform/win32/CCStdC-win32.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_WP8
#include "platform/winrt/CCStdC.h"
#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include "platform/linux/CCStdC-linux.h"
#endif
#endif /* __PLATFORM_CCSTDC_H__*/

View File

@ -26,7 +26,7 @@ THE SOFTWARE.
#ifndef __CC_PLATFORM_THREAD_H__
#define __CC_PLATFORM_THREAD_H__
#include "base/CCPlatformMacros.h"
#include "platform/CCPlatformMacros.h"
NS_CC_BEGIN

View File

@ -7,12 +7,12 @@ LOCAL_MODULE := cocos2dxandroid_static
LOCAL_MODULE_FILENAME := libcocos2dandroid
LOCAL_SRC_FILES := \
CCApplication.cpp \
CCCommon.cpp \
CCDevice.cpp \
CCGLViewImpl.cpp \
CCFileUtilsAndroid.cpp \
javaactivity.cpp \
CCApplication-android.cpp \
CCCommon-android.cpp \
CCDevice-android.cpp \
CCGLViewImpl-android.cpp \
CCFileUtils-android.cpp \
javaactivity-android.cpp \
jni/DPIJni.cpp \
jni/IMEJni.cpp \
jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp \

Some files were not shown because too many files have changed in this diff Show More